cocoda-sdk 3.6.1 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +47 -33
- package/dist/cocoda-sdk.js +7 -7
- package/dist/cocoda-sdk.js.map +3 -3
- package/dist/esm/providers/base-provider.js +1 -1
- package/dist/esm/providers/concept-api-provider.js +3 -6
- package/dist/esm/providers/ols-api-provider.js +8 -17
- package/dist/esm/providers/skosmos-api-provider.js +35 -9
- package/package.json +1 -1
package/dist/cocoda-sdk.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* cocoda-sdk v3.6.
|
|
2
|
+
* cocoda-sdk v3.6.2
|
|
3
3
|
* Copyright (c) 2021 Verbundzentrale des GBV (VZG)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*
|
|
6
6
|
* For dependency license information, please see ./dist/cocoda-sdk.js.LICENSES.txt.
|
|
7
7
|
*/
|
|
8
|
-
var CDK=(()=>{var Na=Object.create;var Xt=Object.defineProperty,Fa=Object.defineProperties,Ba=Object.getOwnPropertyDescriptor,ja=Object.getOwnPropertyDescriptors,Ua=Object.getOwnPropertyNames,Ar=Object.getOwnPropertySymbols,za=Object.getPrototypeOf,Sn=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable;var At=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),$a=t=>{throw TypeError(t)},rt=Math.pow,vn=(t,e,r)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I=(t,e)=>{for(var r in e||(e={}))Sn.call(e,r)&&vn(t,r,e[r]);if(Ar)for(var r of Ar(e))es.call(e,r)&&vn(t,r,e[r]);return t},F=(t,e)=>Fa(t,ja(e));var Gt=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var W=(t,e)=>{var r={};for(var n in t)Sn.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Ar)for(var n of Ar(t))e.indexOf(n)<0&&es.call(t,n)&&(r[n]=t[n]);return r};var ts=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pt=(t,e)=>{for(var r in e)Xt(t,r,{get:e[r],enumerable:!0})},rs=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ua(e))!Sn.call(t,i)&&i!==r&&Xt(t,i,{get:()=>e[i],enumerable:!(n=Ba(e,i))||n.enumerable});return t};var ns=(t,e,r)=>(r=t!=null?Na(za(t)):{},rs(e||!t||!t.__esModule?Xt(r,"default",{value:t,enumerable:!0}):r,t)),Wa=t=>rs(Xt({},"__esModule",{value:!0}),t);var ee=(t,e,r)=>vn(t,typeof e!="symbol"?e+"":e,r);var E=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(l){i(l)}},o=u=>{try{a(r.throw(u))}catch(l){i(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),dt=function(t,e){this[0]=t,this[1]=e},xn=(t,e,r)=>{var n=(o,a,u,l)=>{try{var c=r[o](a),p=(a=c.value)instanceof dt,m=c.done;Promise.resolve(p?a[0]:a).then(g=>p?n(o==="return"?o:"next",a[1]?{done:g.done,value:g.value}:g,u,l):u({value:g,done:m})).catch(g=>n("throw",g,u,l))}catch(g){l(g)}},i=o=>s[o]=a=>new Promise((u,l)=>n(o,a,u,l)),s={};return r=r.apply(t,e),s[At("asyncIterator")]=()=>s,i("next"),i("throw"),i("return"),s},En=t=>{var e=t[At("asyncIterator")],r=!1,n,i={};return e==null?(e=t[At("iterator")](),n=s=>i[s]=o=>e[s](o)):(e=e.call(t),n=s=>i[s]=o=>{if(r){if(r=!1,s==="throw")throw o;return o}return r=!0,{done:!1,value:new dt(new Promise(a=>{var u=e[s](o);u instanceof Object||$a("Object expected"),a(u)}),1)}}),i[At("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=s=>{throw s},"return"in e&&n("return"),i},is=(t,e,r)=>(e=t[At("asyncIterator")])?e.call(t):(t=t[At("iterator")](),e={},r=(n,i)=>(i=t[n])&&(e[n]=s=>new Promise((o,a,u)=>(s=i.call(t,s),u=s.done,Promise.resolve(s.value).then(l=>o({value:l,done:u}),a)))),r("next"),r("return"),e);var fo=ts((co,ci)=>{(function(t){if(typeof co=="object"&&typeof ci!="undefined")ci.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return(function n(i,s,o){function a(c,p){if(!s[c]){if(!i[c]){var m=typeof Gt=="function"&≫if(!p&&m)return m(c,!0);if(u)return u(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var f=s[c]={exports:{}};i[c][0].call(f.exports,function(d){var y=i[c][1][d];return a(y||d)},f,f.exports,n,i,s,o)}return s[c].exports}for(var u=typeof Gt=="function"&&Gt,l=0;l<o.length;l++)a(o[l]);return a})({1:[function(n,i,s){(function(o){"use strict";var a=o.MutationObserver||o.WebKitMutationObserver,u;if(a){var l=0,c=new a(d),p=o.document.createTextNode("");c.observe(p,{characterData:!0}),u=function(){p.data=l=++l%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var m=new o.MessageChannel;m.port1.onmessage=d,u=function(){m.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?u=function(){var k=o.document.createElement("script");k.onreadystatechange=function(){d(),k.onreadystatechange=null,k.parentNode.removeChild(k),k=null},o.document.documentElement.appendChild(k)}:u=function(){setTimeout(d,0)};var g,f=[];function d(){g=!0;for(var k,R,C=f.length;C;){for(R=f,f=[],k=-1;++k<C;)R[k]();C=f.length}g=!1}i.exports=y;function y(k){f.push(k)===1&&!g&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,s){"use strict";var o=n(1);function a(){}var u={},l=["REJECTED"],c=["FULFILLED"],p=["PENDING"];i.exports=m;function m(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,S!==a&&y(this,S)}m.prototype.catch=function(S){return this.then(null,S)},m.prototype.then=function(S,O){if(typeof S!="function"&&this.state===c||typeof O!="function"&&this.state===l)return this;var D=new this.constructor(a);if(this.state!==p){var $=this.state===c?S:O;f(D,$,this.outcome)}else this.queue.push(new g(D,S,O));return D};function g(S,O,D){this.promise=S,typeof O=="function"&&(this.onFulfilled=O,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},g.prototype.otherCallFulfilled=function(S){f(this.promise,this.onFulfilled,S)},g.prototype.callRejected=function(S){u.reject(this.promise,S)},g.prototype.otherCallRejected=function(S){f(this.promise,this.onRejected,S)};function f(S,O,D){o(function(){var $;try{$=O(D)}catch(X){return u.reject(S,X)}$===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,$)})}u.resolve=function(S,O){var D=k(d,O);if(D.status==="error")return u.reject(S,D.value);var $=D.value;if($)y(S,$);else{S.state=c,S.outcome=O;for(var X=-1,K=S.queue.length;++X<K;)S.queue[X].callFulfilled(O)}return S},u.reject=function(S,O){S.state=l,S.outcome=O;for(var D=-1,$=S.queue.length;++D<$;)S.queue[D].callRejected(O);return S};function d(S){var O=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof O=="function")return function(){O.apply(S,arguments)}}function y(S,O){var D=!1;function $(Z){D||(D=!0,u.reject(S,Z))}function X(Z){D||(D=!0,u.resolve(S,Z))}function K(){O(X,$)}var V=k(K);V.status==="error"&&$(V.value)}function k(S,O){var D={};try{D.value=S(O),D.status="success"}catch($){D.status="error",D.value=$}return D}m.resolve=R;function R(S){return S instanceof this?S:u.resolve(new this(a),S)}m.reject=C;function C(S){var O=new this(a);return u.reject(O,S)}m.all=N;function N(S){var O=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=S.length,$=!1;if(!D)return this.resolve([]);for(var X=new Array(D),K=0,V=-1,Z=new this(a);++V<D;)se(S[V],V);return Z;function se(re,_e){O.resolve(re).then(lt,function(be){$||($=!0,u.reject(Z,be))});function lt(be){X[_e]=be,++K===D&&!$&&($=!0,u.resolve(Z,X))}}}m.race=L;function L(S){var O=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=S.length,$=!1;if(!D)return this.resolve([]);for(var X=-1,K=new this(a);++X<D;)V(S[X]);return K;function V(Z){O.resolve(Z).then(function(se){$||($=!0,u.resolve(K,se))},function(se){$||($=!0,u.reject(K,se))})}}},{1:1}],3:[function(n,i,s){(function(o){"use strict";typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,s){"use strict";var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h};function a(h,_){if(!(h instanceof _))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(h){return}}var l=u();function c(){try{if(!l||!l.open)return!1;var h=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),_=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!h||_)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(w){return!1}}function p(h,_){h=h||[],_=_||{};try{return new Blob(h,_)}catch(b){if(b.name!=="TypeError")throw b;for(var w=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,v=new w,x=0;x<h.length;x+=1)v.append(h[x]);return v.getBlob(_.type)}}typeof Promise=="undefined"&&n(3);var m=Promise;function g(h,_){_&&h.then(function(w){_(null,w)},function(w){_(w)})}function f(h,_,w){typeof _=="function"&&h.then(_),typeof w=="function"&&h.catch(w)}function d(h){return typeof h!="string"&&(console.warn(h+" used as a key, but it is not a string."),h=String(h)),h}function y(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var k="local-forage-detect-blob-support",R=void 0,C={},N=Object.prototype.toString,L="readonly",S="readwrite";function O(h){for(var _=h.length,w=new ArrayBuffer(_),v=new Uint8Array(w),x=0;x<_;x++)v[x]=h.charCodeAt(x);return w}function D(h){return new m(function(_){var w=h.transaction(k,S),v=p([""]);w.objectStore(k).put(v,"key"),w.onabort=function(x){x.preventDefault(),x.stopPropagation(),_(!1)},w.oncomplete=function(){var x=navigator.userAgent.match(/Chrome\/(\d+)/),b=navigator.userAgent.match(/Edge\//);_(b||!x||parseInt(x[1],10)>=43)}}).catch(function(){return!1})}function $(h){return typeof R=="boolean"?m.resolve(R):D(h).then(function(_){return R=_,R})}function X(h){var _=C[h.name],w={};w.promise=new m(function(v,x){w.resolve=v,w.reject=x}),_.deferredOperations.push(w),_.dbReady?_.dbReady=_.dbReady.then(function(){return w.promise}):_.dbReady=w.promise}function K(h){var _=C[h.name],w=_.deferredOperations.pop();if(w)return w.resolve(),w.promise}function V(h,_){var w=C[h.name],v=w.deferredOperations.pop();if(v)return v.reject(_),v.promise}function Z(h,_){return new m(function(w,v){if(C[h.name]=C[h.name]||ht(),h.db)if(_)X(h),h.db.close();else return w(h.db);var x=[h.name];_&&x.push(h.version);var b=l.open.apply(l,x);_&&(b.onupgradeneeded=function(T){var M=b.result;try{M.createObjectStore(h.storeName),T.oldVersion<=1&&M.createObjectStore(k)}catch(B){if(B.name==="ConstraintError")console.warn('The database "'+h.name+'" has been upgraded from version '+T.oldVersion+" to version "+T.newVersion+', but the storage "'+h.storeName+'" already exists.');else throw B}}),b.onerror=function(T){T.preventDefault(),v(b.error)},b.onsuccess=function(){var T=b.result;T.onversionchange=function(M){M.target.close()},w(T),K(h)}})}function se(h){return Z(h,!1)}function re(h){return Z(h,!0)}function _e(h,_){if(!h.db)return!0;var w=!h.db.objectStoreNames.contains(h.storeName),v=h.version<h.db.version,x=h.version>h.db.version;if(v&&(h.version!==_&&console.warn('The database "'+h.name+`" can't be downgraded from version `+h.db.version+" to version "+h.version+"."),h.version=h.db.version),x||w){if(w){var b=h.db.version+1;b>h.version&&(h.version=b)}return!0}return!1}function lt(h){return new m(function(_,w){var v=new FileReader;v.onerror=w,v.onloadend=function(x){var b=btoa(x.target.result||"");_({__local_forage_encoded_blob:!0,data:b,type:h.type})},v.readAsBinaryString(h)})}function be(h){var _=O(atob(h.data));return p([_],{type:h.type})}function Vt(h){return h&&h.__local_forage_encoded_blob}function ct(h){var _=this,w=_._initReady().then(function(){var v=C[_._dbInfo.name];if(v&&v.dbReady)return v.dbReady});return f(w,h,h),w}function ft(h){X(h);for(var _=C[h.name],w=_.forages,v=0;v<w.length;v++){var x=w[v];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return h.db=null,se(h).then(function(b){return h.db=b,_e(h)?re(h):b}).then(function(b){h.db=_.db=b;for(var T=0;T<w.length;T++)w[T]._dbInfo.db=b}).catch(function(b){throw V(h,b),b})}function ve(h,_,w,v){v===void 0&&(v=1);try{var x=h.db.transaction(h.storeName,_);w(null,x)}catch(b){if(v>0&&(!h.db||b.name==="InvalidStateError"||b.name==="NotFoundError"))return m.resolve().then(function(){if(!h.db||b.name==="NotFoundError"&&!h.db.objectStoreNames.contains(h.storeName)&&h.version<=h.db.version)return h.db&&(h.version=h.db.version+1),re(h)}).then(function(){return ft(h).then(function(){ve(h,_,w,v-1)})}).catch(w);w(b)}}function ht(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function J(h){var _=this,w={db:null};if(h)for(var v in h)w[v]=h[v];var x=C[w.name];x||(x=ht(),C[w.name]=x),x.forages.push(_),_._initReady||(_._initReady=_.ready,_.ready=ct);var b=[];function T(){return m.resolve()}for(var M=0;M<x.forages.length;M++){var B=x.forages[M];B!==_&&b.push(B._initReady().catch(T))}var j=x.forages.slice(0);return m.all(b).then(function(){return w.db=x.db,se(w)}).then(function(z){return w.db=z,_e(w,_._defaultConfig.version)?re(w):z}).then(function(z){w.db=x.db=z,_._dbInfo=w;for(var q=0;q<j.length;q++){var Q=j[q];Q!==_&&(Q._dbInfo.db=w.db,Q._dbInfo.version=w.version)}})}function ae(h,_){var w=this;h=d(h);var v=new m(function(x,b){w.ready().then(function(){ve(w._dbInfo,L,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=B.get(h);j.onsuccess=function(){var z=j.result;z===void 0&&(z=null),Vt(z)&&(z=be(z)),x(z)},j.onerror=function(){b(j.error)}}catch(z){b(z)}})}).catch(b)});return g(v,_),v}function Jt(h,_){var w=this,v=new m(function(x,b){w.ready().then(function(){ve(w._dbInfo,L,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=B.openCursor(),z=1;j.onsuccess=function(){var q=j.result;if(q){var Q=q.value;Vt(Q)&&(Q=be(Q));var ne=h(Q,q.key,z++);ne!==void 0?x(ne):q.continue()}else x()},j.onerror=function(){b(j.error)}}catch(q){b(q)}})}).catch(b)});return g(v,_),v}function $o(h,_,w){var v=this;h=d(h);var x=new m(function(b,T){var M;v.ready().then(function(){return M=v._dbInfo,N.call(_)==="[object Blob]"?$(M.db).then(function(B){return B?_:lt(_)}):_}).then(function(B){ve(v._dbInfo,S,function(j,z){if(j)return T(j);try{var q=z.objectStore(v._dbInfo.storeName);B===null&&(B=void 0);var Q=q.put(B,h);z.oncomplete=function(){B===void 0&&(B=null),b(B)},z.onabort=z.onerror=function(){var ne=Q.error?Q.error:Q.transaction.error;T(ne)}}catch(ne){T(ne)}})}).catch(T)});return g(x,w),x}function Wo(h,_){var w=this;h=d(h);var v=new m(function(x,b){w.ready().then(function(){ve(w._dbInfo,S,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=B.delete(h);M.oncomplete=function(){x()},M.onerror=function(){b(j.error)},M.onabort=function(){var z=j.error?j.error:j.transaction.error;b(z)}}catch(z){b(z)}})}).catch(b)});return g(v,_),v}function Ho(h){var _=this,w=new m(function(v,x){_.ready().then(function(){ve(_._dbInfo,S,function(b,T){if(b)return x(b);try{var M=T.objectStore(_._dbInfo.storeName),B=M.clear();T.oncomplete=function(){v()},T.onabort=T.onerror=function(){var j=B.error?B.error:B.transaction.error;x(j)}}catch(j){x(j)}})}).catch(x)});return g(w,h),w}function qo(h){var _=this,w=new m(function(v,x){_.ready().then(function(){ve(_._dbInfo,L,function(b,T){if(b)return x(b);try{var M=T.objectStore(_._dbInfo.storeName),B=M.count();B.onsuccess=function(){v(B.result)},B.onerror=function(){x(B.error)}}catch(j){x(j)}})}).catch(x)});return g(w,h),w}function Vo(h,_){var w=this,v=new m(function(x,b){if(h<0){x(null);return}w.ready().then(function(){ve(w._dbInfo,L,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=!1,z=B.openKeyCursor();z.onsuccess=function(){var q=z.result;if(!q){x(null);return}h===0||j?x(q.key):(j=!0,q.advance(h))},z.onerror=function(){b(z.error)}}catch(q){b(q)}})}).catch(b)});return g(v,_),v}function Jo(h){var _=this,w=new m(function(v,x){_.ready().then(function(){ve(_._dbInfo,L,function(b,T){if(b)return x(b);try{var M=T.objectStore(_._dbInfo.storeName),B=M.openKeyCursor(),j=[];B.onsuccess=function(){var z=B.result;if(!z){v(j);return}j.push(z.key),z.continue()},B.onerror=function(){x(B.error)}}catch(z){x(z)}})}).catch(x)});return g(w,h),w}function Ko(h,_){_=y.apply(this,arguments);var w=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||w.name,h.storeName=h.storeName||w.storeName);var v=this,x;if(!h.name)x=m.reject("Invalid arguments");else{var b=h.name===w.name&&v._dbInfo.db,T=b?m.resolve(v._dbInfo.db):se(h).then(function(M){var B=C[h.name],j=B.forages;B.db=M;for(var z=0;z<j.length;z++)j[z]._dbInfo.db=M;return M});h.storeName?x=T.then(function(M){if(M.objectStoreNames.contains(h.storeName)){var B=M.version+1;X(h);var j=C[h.name],z=j.forages;M.close();for(var q=0;q<z.length;q++){var Q=z[q];Q._dbInfo.db=null,Q._dbInfo.version=B}var ne=new m(function(ie,fe){var ce=l.open(h.name,B);ce.onerror=function(Ae){var Yt=ce.result;Yt.close(),fe(Ae)},ce.onupgradeneeded=function(){var Ae=ce.result;Ae.deleteObjectStore(h.storeName)},ce.onsuccess=function(){var Ae=ce.result;Ae.close(),ie(Ae)}});return ne.then(function(ie){j.db=ie;for(var fe=0;fe<z.length;fe++){var ce=z[fe];ce._dbInfo.db=ie,K(ce._dbInfo)}}).catch(function(ie){throw(V(h,ie)||m.resolve()).catch(function(){}),ie})}}):x=T.then(function(M){X(h);var B=C[h.name],j=B.forages;M.close();for(var z=0;z<j.length;z++){var q=j[z];q._dbInfo.db=null}var Q=new m(function(ne,ie){var fe=l.deleteDatabase(h.name);fe.onerror=function(){var ce=fe.result;ce&&ce.close(),ie(fe.error)},fe.onblocked=function(){console.warn('dropInstance blocked for database "'+h.name+'" until all open connections are closed')},fe.onsuccess=function(){var ce=fe.result;ce&&ce.close(),ne(ce)}});return Q.then(function(ne){B.db=ne;for(var ie=0;ie<j.length;ie++){var fe=j[ie];K(fe._dbInfo)}}).catch(function(ne){throw(V(h,ne)||m.resolve()).catch(function(){}),ne})})}return g(x,_),x}var Yo={_driver:"asyncStorage",_initStorage:J,_support:c(),iterate:Jt,getItem:ae,setItem:$o,removeItem:Wo,clear:Ho,length:qo,key:Vo,keys:Jo,dropInstance:Ko};function Xo(){return typeof openDatabase=="function"}var et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go="~~local_forage_type~",Li=/^~~local_forage_type~([^~]+)~/,xr="__lfsc__:",hn=xr.length,pn="arbf",dn="blob",Ni="si08",Fi="ui08",Bi="uic8",ji="si16",Ui="si32",zi="ur16",$i="ui32",Wi="fl32",Hi="fl64",qi=hn+pn.length,Vi=Object.prototype.toString;function Ji(h){var _=h.length*.75,w=h.length,v,x=0,b,T,M,B;h[h.length-1]==="="&&(_--,h[h.length-2]==="="&&_--);var j=new ArrayBuffer(_),z=new Uint8Array(j);for(v=0;v<w;v+=4)b=et.indexOf(h[v]),T=et.indexOf(h[v+1]),M=et.indexOf(h[v+2]),B=et.indexOf(h[v+3]),z[x++]=b<<2|T>>4,z[x++]=(T&15)<<4|M>>2,z[x++]=(M&3)<<6|B&63;return j}function mn(h){var _=new Uint8Array(h),w="",v;for(v=0;v<_.length;v+=3)w+=et[_[v]>>2],w+=et[(_[v]&3)<<4|_[v+1]>>4],w+=et[(_[v+1]&15)<<2|_[v+2]>>6],w+=et[_[v+2]&63];return _.length%3===2?w=w.substring(0,w.length-1)+"=":_.length%3===1&&(w=w.substring(0,w.length-2)+"=="),w}function Qo(h,_){var w="";if(h&&(w=Vi.call(h)),h&&(w==="[object ArrayBuffer]"||h.buffer&&Vi.call(h.buffer)==="[object ArrayBuffer]")){var v,x=xr;h instanceof ArrayBuffer?(v=h,x+=pn):(v=h.buffer,w==="[object Int8Array]"?x+=Ni:w==="[object Uint8Array]"?x+=Fi:w==="[object Uint8ClampedArray]"?x+=Bi:w==="[object Int16Array]"?x+=ji:w==="[object Uint16Array]"?x+=zi:w==="[object Int32Array]"?x+=Ui:w==="[object Uint32Array]"?x+=$i:w==="[object Float32Array]"?x+=Wi:w==="[object Float64Array]"?x+=Hi:_(new Error("Failed to get type for BinaryArray"))),_(x+mn(v))}else if(w==="[object Blob]"){var b=new FileReader;b.onload=function(){var T=Go+h.type+"~"+mn(this.result);_(xr+dn+T)},b.readAsArrayBuffer(h)}else try{_(JSON.stringify(h))}catch(T){console.error("Couldn't convert value into a JSON string: ",h),_(null,T)}}function Zo(h){if(h.substring(0,hn)!==xr)return JSON.parse(h);var _=h.substring(qi),w=h.substring(hn,qi),v;if(w===dn&&Li.test(_)){var x=_.match(Li);v=x[1],_=_.substring(x[0].length)}var b=Ji(_);switch(w){case pn:return b;case dn:return p([b],{type:v});case Ni:return new Int8Array(b);case Fi:return new Uint8Array(b);case Bi:return new Uint8ClampedArray(b);case ji:return new Int16Array(b);case zi:return new Uint16Array(b);case Ui:return new Int32Array(b);case $i:return new Uint32Array(b);case Wi:return new Float32Array(b);case Hi:return new Float64Array(b);default:throw new Error("Unkown type: "+w)}}var gn={serialize:Qo,deserialize:Zo,stringToBuffer:Ji,bufferToString:mn};function Ki(h,_,w,v){h.executeSql("CREATE TABLE IF NOT EXISTS "+_.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],w,v)}function ea(h){var _=this,w={db:null};if(h)for(var v in h)w[v]=typeof h[v]!="string"?h[v].toString():h[v];var x=new m(function(b,T){try{w.db=openDatabase(w.name,String(w.version),w.description,w.size)}catch(M){return T(M)}w.db.transaction(function(M){Ki(M,w,function(){_._dbInfo=w,b()},function(B,j){T(j)})},T)});return w.serializer=gn,x}function tt(h,_,w,v,x,b){h.executeSql(w,v,x,function(T,M){M.code===M.SYNTAX_ERR?T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[_.storeName],function(B,j){j.rows.length?b(B,M):Ki(B,_,function(){B.executeSql(w,v,x,b)},b)},b):b(T,M)},b)}function ta(h,_){var w=this;h=d(h);var v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"SELECT * FROM "+T.storeName+" WHERE key = ? LIMIT 1",[h],function(B,j){var z=j.rows.length?j.rows.item(0).value:null;z&&(z=T.serializer.deserialize(z)),x(z)},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function ra(h,_){var w=this,v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"SELECT * FROM "+T.storeName,[],function(B,j){for(var z=j.rows,q=z.length,Q=0;Q<q;Q++){var ne=z.item(Q),ie=ne.value;if(ie&&(ie=T.serializer.deserialize(ie)),ie=h(ie,ne.key,Q+1),ie!==void 0){x(ie);return}}x()},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function Yi(h,_,w,v){var x=this;h=d(h);var b=new m(function(T,M){x.ready().then(function(){_===void 0&&(_=null);var B=_,j=x._dbInfo;j.serializer.serialize(_,function(z,q){q?M(q):j.db.transaction(function(Q){tt(Q,j,"INSERT OR REPLACE INTO "+j.storeName+" (key, value) VALUES (?, ?)",[h,z],function(){T(B)},function(ne,ie){M(ie)})},function(Q){if(Q.code===Q.QUOTA_ERR){if(v>0){T(Yi.apply(x,[h,B,w,v-1]));return}M(Q)}})})}).catch(M)});return g(b,w),b}function na(h,_,w){return Yi.apply(this,[h,_,w,1])}function ia(h,_){var w=this;h=d(h);var v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"DELETE FROM "+T.storeName+" WHERE key = ?",[h],function(){x()},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function sa(h){var _=this,w=new m(function(v,x){_.ready().then(function(){var b=_._dbInfo;b.db.transaction(function(T){tt(T,b,"DELETE FROM "+b.storeName,[],function(){v()},function(M,B){x(B)})})}).catch(x)});return g(w,h),w}function oa(h){var _=this,w=new m(function(v,x){_.ready().then(function(){var b=_._dbInfo;b.db.transaction(function(T){tt(T,b,"SELECT COUNT(key) as c FROM "+b.storeName,[],function(M,B){var j=B.rows.item(0).c;v(j)},function(M,B){x(B)})})}).catch(x)});return g(w,h),w}function aa(h,_){var w=this,v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"SELECT key FROM "+T.storeName+" WHERE id = ? LIMIT 1",[h+1],function(B,j){var z=j.rows.length?j.rows.item(0).key:null;x(z)},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function ua(h){var _=this,w=new m(function(v,x){_.ready().then(function(){var b=_._dbInfo;b.db.transaction(function(T){tt(T,b,"SELECT key FROM "+b.storeName,[],function(M,B){for(var j=[],z=0;z<B.rows.length;z++)j.push(B.rows.item(z).key);v(j)},function(M,B){x(B)})})}).catch(x)});return g(w,h),w}function la(h){return new m(function(_,w){h.transaction(function(v){v.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(x,b){for(var T=[],M=0;M<b.rows.length;M++)T.push(b.rows.item(M).name);_({db:h,storeNames:T})},function(x,b){w(b)})},function(v){w(v)})})}function ca(h,_){_=y.apply(this,arguments);var w=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||w.name,h.storeName=h.storeName||w.storeName);var v=this,x;return h.name?x=new m(function(b){var T;h.name===w.name?T=v._dbInfo.db:T=openDatabase(h.name,"","",0),h.storeName?b({db:T,storeNames:[h.storeName]}):b(la(T))}).then(function(b){return new m(function(T,M){b.db.transaction(function(B){function j(ne){return new m(function(ie,fe){B.executeSql("DROP TABLE IF EXISTS "+ne,[],function(){ie()},function(ce,Ae){fe(Ae)})})}for(var z=[],q=0,Q=b.storeNames.length;q<Q;q++)z.push(j(b.storeNames[q]));m.all(z).then(function(){T()}).catch(function(ne){M(ne)})},function(B){M(B)})})}):x=m.reject("Invalid arguments"),g(x,_),x}var fa={_driver:"webSQLStorage",_initStorage:ea,_support:Xo(),iterate:ra,getItem:ta,setItem:na,removeItem:ia,clear:sa,length:oa,key:aa,keys:ua,dropInstance:ca};function ha(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(h){return!1}}function Xi(h,_){var w=h.name+"/";return h.storeName!==_.storeName&&(w+=h.storeName+"/"),w}function pa(){var h="_localforage_support_test";try{return localStorage.setItem(h,!0),localStorage.removeItem(h),!1}catch(_){return!0}}function da(){return!pa()||localStorage.length>0}function ma(h){var _=this,w={};if(h)for(var v in h)w[v]=h[v];return w.keyPrefix=Xi(h,_._defaultConfig),da()?(_._dbInfo=w,w.serializer=gn,m.resolve()):m.reject()}function ga(h){var _=this,w=_.ready().then(function(){for(var v=_._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var b=localStorage.key(x);b.indexOf(v)===0&&localStorage.removeItem(b)}});return g(w,h),w}function wa(h,_){var w=this;h=d(h);var v=w.ready().then(function(){var x=w._dbInfo,b=localStorage.getItem(x.keyPrefix+h);return b&&(b=x.serializer.deserialize(b)),b});return g(v,_),v}function ya(h,_){var w=this,v=w.ready().then(function(){for(var x=w._dbInfo,b=x.keyPrefix,T=b.length,M=localStorage.length,B=1,j=0;j<M;j++){var z=localStorage.key(j);if(z.indexOf(b)===0){var q=localStorage.getItem(z);if(q&&(q=x.serializer.deserialize(q)),q=h(q,z.substring(T),B++),q!==void 0)return q}}});return g(v,_),v}function _a(h,_){var w=this,v=w.ready().then(function(){var x=w._dbInfo,b;try{b=localStorage.key(h)}catch(T){b=null}return b&&(b=b.substring(x.keyPrefix.length)),b});return g(v,_),v}function ba(h){var _=this,w=_.ready().then(function(){for(var v=_._dbInfo,x=localStorage.length,b=[],T=0;T<x;T++){var M=localStorage.key(T);M.indexOf(v.keyPrefix)===0&&b.push(M.substring(v.keyPrefix.length))}return b});return g(w,h),w}function va(h){var _=this,w=_.keys().then(function(v){return v.length});return g(w,h),w}function Sa(h,_){var w=this;h=d(h);var v=w.ready().then(function(){var x=w._dbInfo;localStorage.removeItem(x.keyPrefix+h)});return g(v,_),v}function xa(h,_,w){var v=this;h=d(h);var x=v.ready().then(function(){_===void 0&&(_=null);var b=_;return new m(function(T,M){var B=v._dbInfo;B.serializer.serialize(_,function(j,z){if(z)M(z);else try{localStorage.setItem(B.keyPrefix+h,j),T(b)}catch(q){(q.name==="QuotaExceededError"||q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&M(q),M(q)}})})});return g(x,w),x}function Ea(h,_){if(_=y.apply(this,arguments),h=typeof h!="function"&&h||{},!h.name){var w=this.config();h.name=h.name||w.name,h.storeName=h.storeName||w.storeName}var v=this,x;return h.name?x=new m(function(b){h.storeName?b(Xi(h,v._defaultConfig)):b(h.name+"/")}).then(function(b){for(var T=localStorage.length-1;T>=0;T--){var M=localStorage.key(T);M.indexOf(b)===0&&localStorage.removeItem(M)}}):x=m.reject("Invalid arguments"),g(x,_),x}var Aa={_driver:"localStorageWrapper",_initStorage:ma,_support:ha(),iterate:ya,getItem:wa,setItem:xa,removeItem:Sa,clear:ga,length:va,key:_a,keys:ba,dropInstance:Ea},Ca=function(_,w){return _===w||typeof _=="number"&&typeof w=="number"&&isNaN(_)&&isNaN(w)},Oa=function(_,w){for(var v=_.length,x=0;x<v;){if(Ca(_[x],w))return!0;x++}return!1},Gi=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},Kt={},Qi={},Et={INDEXEDDB:Yo,WEBSQL:fa,LOCALSTORAGE:Aa},ka=[Et.INDEXEDDB._driver,Et.WEBSQL._driver,Et.LOCALSTORAGE._driver],Er=["dropInstance"],wn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Er),Ra={description:"",driver:ka.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ia(h,_){h[_]=function(){var w=arguments;return h.ready().then(function(){return h[_].apply(h,w)})}}function yn(){for(var h=1;h<arguments.length;h++){var _=arguments[h];if(_)for(var w in _)_.hasOwnProperty(w)&&(Gi(_[w])?arguments[0][w]=_[w].slice():arguments[0][w]=_[w])}return arguments[0]}var Ta=(function(){function h(_){a(this,h);for(var w in Et)if(Et.hasOwnProperty(w)){var v=Et[w],x=v._driver;this[w]=x,Kt[x]||this.defineDriver(v)}this._defaultConfig=yn({},Ra),this._config=yn({},this._defaultConfig,_),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return h.prototype.config=function(w){if((typeof w=="undefined"?"undefined":o(w))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var v in w){if(v==="storeName"&&(w[v]=w[v].replace(/\W/g,"_")),v==="version"&&typeof w[v]!="number")return new Error("Database version must be a number.");this._config[v]=w[v]}return"driver"in w&&w.driver?this.setDriver(this._config.driver):!0}else return typeof w=="string"?this._config[w]:this._config},h.prototype.defineDriver=function(w,v,x){var b=new m(function(T,M){try{var B=w._driver,j=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!w._driver){M(j);return}for(var z=wn.concat("_initStorage"),q=0,Q=z.length;q<Q;q++){var ne=z[q],ie=!Oa(Er,ne);if((ie||w[ne])&&typeof w[ne]!="function"){M(j);return}}var fe=function(){for(var Yt=function(Ma){return function(){var La=new Error("Method "+Ma+" is not implemented by the current driver"),Zi=m.reject(La);return g(Zi,arguments[arguments.length-1]),Zi}},_n=0,Da=Er.length;_n<Da;_n++){var bn=Er[_n];w[bn]||(w[bn]=Yt(bn))}};fe();var ce=function(Yt){Kt[B]&&console.info("Redefining LocalForage driver: "+B),Kt[B]=w,Qi[B]=Yt,T()};"_support"in w?w._support&&typeof w._support=="function"?w._support().then(ce,M):ce(!!w._support):ce(!0)}catch(Ae){M(Ae)}});return f(b,v,x),b},h.prototype.driver=function(){return this._driver||null},h.prototype.getDriver=function(w,v,x){var b=Kt[w]?m.resolve(Kt[w]):m.reject(new Error("Driver not found."));return f(b,v,x),b},h.prototype.getSerializer=function(w){var v=m.resolve(gn);return f(v,w),v},h.prototype.ready=function(w){var v=this,x=v._driverSet.then(function(){return v._ready===null&&(v._ready=v._initDriver()),v._ready});return f(x,w,w),x},h.prototype.setDriver=function(w,v,x){var b=this;Gi(w)||(w=[w]);var T=this._getSupportedDrivers(w);function M(){b._config.driver=b.driver()}function B(q){return b._extend(q),M(),b._ready=b._initStorage(b._config),b._ready}function j(q){return function(){var Q=0;function ne(){for(;Q<q.length;){var ie=q[Q];return Q++,b._dbInfo=null,b._ready=null,b.getDriver(ie).then(B).catch(ne)}M();var fe=new Error("No available storage method found.");return b._driverSet=m.reject(fe),b._driverSet}return ne()}}var z=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=z.then(function(){var q=T[0];return b._dbInfo=null,b._ready=null,b.getDriver(q).then(function(Q){b._driver=Q._driver,M(),b._wrapLibraryMethodsWithReady(),b._initDriver=j(T)})}).catch(function(){M();var q=new Error("No available storage method found.");return b._driverSet=m.reject(q),b._driverSet}),f(this._driverSet,v,x),this._driverSet},h.prototype.supports=function(w){return!!Qi[w]},h.prototype._extend=function(w){yn(this,w)},h.prototype._getSupportedDrivers=function(w){for(var v=[],x=0,b=w.length;x<b;x++){var T=w[x];this.supports(T)&&v.push(T)}return v},h.prototype._wrapLibraryMethodsWithReady=function(){for(var w=0,v=wn.length;w<v;w++)Ia(this,wn[w])},h.prototype.createInstance=function(w){return new h(w)},h})(),Pa=new Ta;i.exports=Pa},{3:3}]},{},[4])(4)})});var wi=ts(()=>{});var cc={};pt(cc,{BaseProvider:()=>G,CocodaSDK:()=>qt,ConceptApiProvider:()=>Te,LabelSearchSuggestionProvider:()=>We,LobidApiProvider:()=>Ye,LocApiProvider:()=>qe,LocalMappingsProvider:()=>st,MappingsApiProvider:()=>Ie,ModApiProvider:()=>Xe,MyCoReProvider:()=>Qe,NoTApiProvider:()=>Ze,OccurrencesApiProvider:()=>$e,OlsApiProvider:()=>Ge,ReconciliationApiProvider:()=>je,SkohubProvider:()=>Je,SkosmosApiProvider:()=>He,addAllProviders:()=>lc,cdk:()=>zo,errors:()=>ge,providers:()=>Ht,utils:()=>ui});var ge={};pt(ge,{BackendError:()=>Zt,BackendUnavailableError:()=>er,CDKError:()=>me,InvalidOrMissingParameterError:()=>U,InvalidProviderError:()=>Ct,InvalidRequestError:()=>Ne,MethodNotImplementedError:()=>Qt,MissingApiUrlError:()=>xe,NetworkError:()=>tr});var me=class extends Error{constructor({message:e="",relatedError:r=null,code:n=null}={}){!e&&r&&r.message&&(e=r.message),super(e),this.name=this.constructor.name,this.relatedError=r,this.code=n}},Qt=class extends me{constructor(i){var s=i,{method:e,message:r=""}=s,n=W(s,["method","message"]);n.message=`Method not implemented: ${e} (${r})`,super(n)}},U=class extends me{constructor(i){var s=i,{parameter:e,message:r=""}=s,n=W(s,["parameter","message"]);n.message=`Invalid or missing parameter: ${e} (${r})`,super(n)}},Ne=class extends me{},Zt=class extends me{},er=class extends me{},tr=class extends me{},xe=class extends me{},Ct=class extends me{};function rr(t,e){return function(){return t.apply(e,arguments)}}var{toString:Ha}=Object.prototype,{getPrototypeOf:On}=Object,Or=(t=>e=>{let r=Ha.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Oe=t=>(t=t.toLowerCase(),e=>Or(e)===t),kr=t=>e=>typeof e===t,{isArray:Ot}=Array,nr=kr("undefined");function qa(t){return t!==null&&!nr(t)&&t.constructor!==null&&!nr(t.constructor)&&Ee(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var as=Oe("ArrayBuffer");function Va(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&as(t.buffer),e}var Ja=kr("string"),Ee=kr("function"),us=kr("number"),Rr=t=>t!==null&&typeof t=="object",Ka=t=>t===!0||t===!1,Cr=t=>{if(Or(t)!=="object")return!1;let e=On(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ya=Oe("Date"),Xa=Oe("File"),Ga=Oe("Blob"),Qa=Oe("FileList"),Za=t=>Rr(t)&&Ee(t.pipe),eu=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ee(t.append)&&((e=Or(t))==="formdata"||e==="object"&&Ee(t.toString)&&t.toString()==="[object FormData]"))},tu=Oe("URLSearchParams"),[ru,nu,iu,su]=["ReadableStream","Request","Response","Headers"].map(Oe),ou=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t=="undefined")return;let n,i;if(typeof t!="object"&&(t=[t]),Ot(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{let s=r?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length,a;for(n=0;n<o;n++)a=s[n],e.call(null,t[a],a,t)}}function ls(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}var mt=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,cs=t=>!nr(t)&&t!==mt;function Cn(){let{caseless:t}=cs(this)&&this||{},e={},r=(n,i)=>{let s=t&&ls(e,i)||i;Cr(e[s])&&Cr(n)?e[s]=Cn(e[s],n):Cr(n)?e[s]=Cn({},n):Ot(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ir(arguments[n],r);return e}var au=(t,e,r,{allOwnKeys:n}={})=>(ir(e,(i,s)=>{r&&Ee(i)?t[s]=rr(i,r):t[s]=i},{allOwnKeys:n}),t),uu=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),lu=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},cu=(t,e,r,n)=>{let i,s,o,a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&On(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},fu=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},hu=t=>{if(!t)return null;if(Ot(t))return t;let e=t.length;if(!us(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},pu=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&On(Uint8Array)),du=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(t,s[0],s[1])}},mu=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},gu=Oe("HTMLFormElement"),wu=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),ss=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),yu=Oe("RegExp"),fs=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};ir(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},_u=t=>{fs(t,(e,r)=>{if(Ee(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(Ee(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},bu=(t,e)=>{let r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ot(t)?n(t):n(String(t).split(e)),r},vu=()=>{},Su=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,An="abcdefghijklmnopqrstuvwxyz",os="0123456789",hs={DIGIT:os,ALPHA:An,ALPHA_DIGIT:An+An.toUpperCase()+os},xu=(t=16,e=hs.ALPHA_DIGIT)=>{let r="",{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Eu(t){return!!(t&&Ee(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Au=t=>{let e=new Array(10),r=(n,i)=>{if(Rr(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let s=Ot(n)?[]:{};return ir(n,(o,a)=>{let u=r(o,i+1);!nr(u)&&(s[a]=u)}),e[i]=void 0,s}}return n};return r(t,0)},Cu=Oe("AsyncFunction"),Ou=t=>t&&(Rr(t)||Ee(t))&&Ee(t.then)&&Ee(t.catch),ps=((t,e)=>t?setImmediate:e?((r,n)=>(mt.addEventListener("message",({source:i,data:s})=>{i===mt&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),mt.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ee(mt.postMessage)),ku=typeof queueMicrotask!="undefined"?queueMicrotask.bind(mt):typeof process!="undefined"&&process.nextTick||ps,A={isArray:Ot,isArrayBuffer:as,isBuffer:qa,isFormData:eu,isArrayBufferView:Va,isString:Ja,isNumber:us,isBoolean:Ka,isObject:Rr,isPlainObject:Cr,isReadableStream:ru,isRequest:nu,isResponse:iu,isHeaders:su,isUndefined:nr,isDate:Ya,isFile:Xa,isBlob:Ga,isRegExp:yu,isFunction:Ee,isStream:Za,isURLSearchParams:tu,isTypedArray:pu,isFileList:Qa,forEach:ir,merge:Cn,extend:au,trim:ou,stripBOM:uu,inherits:lu,toFlatObject:cu,kindOf:Or,kindOfTest:Oe,endsWith:fu,toArray:hu,forEachEntry:du,matchAll:mu,isHTMLForm:gu,hasOwnProperty:ss,hasOwnProp:ss,reduceDescriptors:fs,freezeMethods:_u,toObjectSet:bu,toCamelCase:wu,noop:vu,toFiniteNumber:Su,findKey:ls,global:mt,isContextDefined:cs,ALPHABET:hs,generateString:xu,isSpecCompliantForm:Eu,toJSONObject:Au,isAsyncFn:Cu,isThenable:Ou,setImmediate:ps,asap:ku};function kt(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(kt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});var ds=kt.prototype,ms={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ms[t]={value:t}});Object.defineProperties(kt,ms);Object.defineProperty(ds,"isAxiosError",{value:!0});kt.from=(t,e,r,n,i,s)=>{let o=Object.create(ds);return A.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),kt.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Y=kt;var Ir=null;function kn(t){return A.isPlainObject(t)||A.isArray(t)}function ws(t){return A.endsWith(t,"[]")?t.slice(0,-2):t}function gs(t,e,r){return t?t.concat(e).map(function(i,s){return i=ws(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function Ru(t){return A.isArray(t)&&!t.some(kn)}var Iu=A.toFlatObject(A,{},null,function(e){return/^is[A-Z]/.test(e)});function Tu(t,e,r){if(!A.isObject(t))throw new TypeError("target must be an object");e=e||new(Ir||FormData),r=A.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,y){return!A.isUndefined(y[d])});let n=r.metaTokens,i=r.visitor||c,s=r.dots,o=r.indexes,u=(r.Blob||typeof Blob!="undefined"&&Blob)&&A.isSpecCompliantForm(e);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(A.isDate(f))return f.toISOString();if(!u&&A.isBlob(f))throw new Y("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(f)||A.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,d,y){let k=f;if(f&&!y&&typeof f=="object"){if(A.endsWith(d,"{}"))d=n?d:d.slice(0,-2),f=JSON.stringify(f);else if(A.isArray(f)&&Ru(f)||(A.isFileList(f)||A.endsWith(d,"[]"))&&(k=A.toArray(f)))return d=ws(d),k.forEach(function(C,N){!(A.isUndefined(C)||C===null)&&e.append(o===!0?gs([d],N,s):o===null?d:d+"[]",l(C))}),!1}return kn(f)?!0:(e.append(gs(y,d,s),l(f)),!1)}let p=[],m=Object.assign(Iu,{defaultVisitor:c,convertValue:l,isVisitable:kn});function g(f,d){if(!A.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+d.join("."));p.push(f),A.forEach(f,function(k,R){(!(A.isUndefined(k)||k===null)&&i.call(e,k,A.isString(R)?R.trim():R,d,m))===!0&&g(k,d?d.concat(R):[R])}),p.pop()}}if(!A.isObject(t))throw new TypeError("data must be an object");return g(t),e}var nt=Tu;function ys(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function _s(t,e){this._pairs=[],t&&nt(t,this,e)}var bs=_s.prototype;bs.append=function(e,r){this._pairs.push([e,r])};bs.toString=function(e){let r=e?function(n){return e.call(this,n,ys)}:ys;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Tr=_s;function Pu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sr(t,e,r){if(!e)return t;let n=r&&r.encode||Pu;A.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,s;if(i?s=i(e,r):s=A.isURLSearchParams(e)?e.toString():new Tr(e,r).toString(n),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var Rn=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){A.forEach(this.handlers,function(n){n!==null&&e(n)})}},In=Rn;var Pr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var vs=typeof URLSearchParams!="undefined"?URLSearchParams:Tr;var Ss=typeof FormData!="undefined"?FormData:null;var xs=typeof Blob!="undefined"?Blob:null;var Es={isBrowser:!0,classes:{URLSearchParams:vs,FormData:Ss,Blob:xs},protocols:["http","https","file","blob","url","data"]};var Dn={};pt(Dn,{hasBrowserEnv:()=>Pn,hasStandardBrowserEnv:()=>Du,hasStandardBrowserWebWorkerEnv:()=>Mu,navigator:()=>Tn,origin:()=>Lu});var Pn=typeof window!="undefined"&&typeof document!="undefined",Tn=typeof navigator=="object"&&navigator||void 0,Du=Pn&&(!Tn||["ReactNative","NativeScript","NS"].indexOf(Tn.product)<0),Mu=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Lu=Pn&&window.location.href||"http://localhost";var ue=I(I({},Dn),Es);function Mn(t,e){return nt(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return ue.isNode&&A.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Nu(t){return A.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Fu(t){let e={},r=Object.keys(t),n,i=r.length,s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}function Bu(t){function e(r,n,i,s){let o=r[s++];if(o==="__proto__")return!0;let a=Number.isFinite(+o),u=s>=r.length;return o=!o&&A.isArray(i)?i.length:o,u?(A.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&A.isArray(i[o])&&(i[o]=Fu(i[o])),!a)}if(A.isFormData(t)&&A.isFunction(t.entries)){let r={};return A.forEachEntry(t,(n,i)=>{e(Nu(n),i,r,0)}),r}return null}var Dr=Bu;function ju(t,e,r){if(A.isString(t))try{return(e||JSON.parse)(t),A.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Ln={transitional:Pr,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=A.isObject(e);if(s&&A.isHTMLForm(e)&&(e=new FormData(e)),A.isFormData(e))return i?JSON.stringify(Dr(e)):e;if(A.isArrayBuffer(e)||A.isBuffer(e)||A.isStream(e)||A.isFile(e)||A.isBlob(e)||A.isReadableStream(e))return e;if(A.isArrayBufferView(e))return e.buffer;if(A.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Mn(e,this.formSerializer).toString();if((a=A.isFileList(e))||n.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return nt(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),ju(e)):e}],transformResponse:[function(e){let r=this.transitional||Ln.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(e)||A.isReadableStream(e))return e;if(e&&A.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Y.from(a,Y.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],t=>{Ln.headers[t]={}});var Rt=Ln;var Uu=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),As=t=>{let e={},r,n,i;return t&&t.split(`
|
|
9
|
-
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&Uu[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var Cs=Symbol("internals");function or(t){return t&&String(t).trim().toLowerCase()}function Mr(t){return t===!1||t==null?t:A.isArray(t)?t.map(Mr):String(t)}function zu(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}var $u=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function
|
|
10
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[Cs]=this[Cs]={accessors:{}}).accessors,i=this.prototype;function s(o){let a=or(o);n[a]||(Hu(i,o),n[a]=!0)}return A.isArray(e)?e.forEach(s):s(e),this}};It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);A.reduceDescriptors(It.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});A.freezeMethods(It);var de=It;function ar(t,e){let r=this||Rt,n=e||r,i=de.from(n.headers),s=n.data;return A.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function ur(t){return!!(t&&t.__CANCEL__)}function Os(t,e,r){Y.call(this,t==null?"canceled":t,Y.ERR_CANCELED,e,r),this.name="CanceledError"}A.inherits(Os,Y,{__CANCEL__:!0});var Fe=Os;function lr(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new Y("Request failed with status code "+r.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Fn(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qu(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,s=0,o;return e=e!==void 0?e:1e3,function(u){let l=Date.now(),c=n[s];o||(o=l),r[i]=u,n[i]=l;let p=s,m=0;for(;p!==i;)m+=r[p++],p=p%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),l-o<e)return;let g=c&&l-c;return g?Math.round(m*1e3/g):void 0}}var ks=qu;function Vu(t,e){let r=0,n=1e3/e,i,s,o=(l,c=Date.now())=>{r=c,i=null,s&&(clearTimeout(s),s=null),t.apply(null,l)};return[(...l)=>{let c=Date.now(),p=c-r;p>=n?o(l,c):(i=l,s||(s=setTimeout(()=>{s=null,o(i)},n-p)))},()=>i&&o(i)]}var Rs=Vu;var Tt=(t,e,r=3)=>{let n=0,i=ks(50,250);return Rs(s=>{let o=s.loaded,a=s.lengthComputable?s.total:void 0,u=o-n,l=i(u),c=o<=a;n=o;let p={loaded:o,total:a,progress:a?o/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&c?(a-o)/l:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(p)},r)},Bn=(t,e)=>{let r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},jn=t=>(...e)=>A.asap(()=>t(...e));var Is=ue.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,ue.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0;var Ts=ue.hasStandardBrowserEnv?{write(t,e,r,n,i,s){let o=[t+"="+encodeURIComponent(e)];A.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),A.isString(n)&&o.push("path="+n),A.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Un(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function cr(t,e){return t&&!Un(e)?zn(t,e):e}var Ps=t=>t instanceof de?I({},t):t;function ke(t,e){e=e||{};let r={};function n(l,c,p,m){return A.isPlainObject(l)&&A.isPlainObject(c)?A.merge.call({caseless:m},l,c):A.isPlainObject(c)?A.merge({},c):A.isArray(c)?c.slice():c}function i(l,c,p,m){if(A.isUndefined(c)){if(!A.isUndefined(l))return n(void 0,l,p,m)}else return n(l,c,p,m)}function s(l,c){if(!A.isUndefined(c))return n(void 0,c)}function o(l,c){if(A.isUndefined(c)){if(!A.isUndefined(l))return n(void 0,l)}else return n(void 0,c)}function a(l,c,p){if(p in e)return n(l,c);if(p in t)return n(void 0,l)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,c,p)=>i(Ps(l),Ps(c),p,!0)};return A.forEach(Object.keys(Object.assign({},t,e)),function(c){let p=u[c]||i,m=p(t[c],e[c],c);A.isUndefined(m)&&p!==a||(r[c]=m)}),r}var Lr=t=>{let e=ke({},t),{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=de.from(o),e.url=sr(cr(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(A.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){let[l,...c]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...c].join("; "))}}if(ue.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(e)),n||n!==!1&&Is(e.url))){let l=i&&s&&Ts.read(s);l&&o.set(i,l)}return e};var Ju=typeof XMLHttpRequest!="undefined",Ds=Ju&&function(t){return new Promise(function(r,n){let i=Lr(t),s=i.data,o=de.from(i.headers).normalize(),{responseType:a,onUploadProgress:u,onDownloadProgress:l}=i,c,p,m,g,f;function d(){g&&g(),f&&f(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function k(){if(!y)return;let C=de.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),L={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:C,config:t,request:y};lr(function(O){r(O),d()},function(O){n(O),d()},L),y=null}"onloadend"in y?y.onloadend=k:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(k)},y.onabort=function(){y&&(n(new Y("Request aborted",Y.ECONNABORTED,t,y)),y=null)},y.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let N=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",L=i.transitional||Pr;i.timeoutErrorMessage&&(N=i.timeoutErrorMessage),n(new Y(N,L.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,t,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&A.forEach(o.toJSON(),function(N,L){y.setRequestHeader(L,N)}),A.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),a&&a!=="json"&&(y.responseType=i.responseType),l&&([m,f]=Tt(l,!0),y.addEventListener("progress",m)),u&&y.upload&&([p,g]=Tt(u),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(c=C=>{y&&(n(!C||C.type?new Fe(null,t,y):C),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));let R=Fn(i.url);if(R&&ue.protocols.indexOf(R)===-1){n(new Y("Unsupported protocol "+R+":",Y.ERR_BAD_REQUEST,t));return}y.send(s||null)})};var Ku=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,i,s=function(l){if(!i){i=!0,a();let c=l instanceof Error?l:this.reason;n.abort(c instanceof Y?c:new Fe(c instanceof Error?c.message:c))}},o=e&&setTimeout(()=>{o=null,s(new Y(`timeout ${e} of ms exceeded`,Y.ETIMEDOUT))},e),a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),t=null)};t.forEach(l=>l.addEventListener("abort",s));let{signal:u}=n;return u.unsubscribe=()=>A.asap(a),u}},Ms=Ku;var Yu=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let n=0,i;for(;n<r;)i=n+e,yield t.slice(n,i),n=i},Xu=function(t,e){return xn(this,null,function*(){try{for(var r=is(Gu(t)),n,i,s;n=!(i=yield new dt(r.next())).done;n=!1){let o=i.value;yield*En(Yu(o,e))}}catch(i){s=[i]}finally{try{n&&(i=r.return)&&(yield new dt(i.call(r)))}finally{if(s)throw s[0]}}})},Gu=function(t){return xn(this,null,function*(){if(t[Symbol.asyncIterator]){yield*En(t);return}let e=t.getReader();try{for(;;){let{done:r,value:n}=yield new dt(e.read());if(r)break;yield n}}finally{yield new dt(e.cancel())}})},$n=(t,e,r,n)=>{let i=Xu(t,e),s=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({pull(l){return E(this,null,function*(){try{let{done:c,value:p}=yield i.next();if(c){a(),l.close();return}let m=p.byteLength;if(r){let g=s+=m;r(g)}l.enqueue(new Uint8Array(p))}catch(c){throw a(c),c}})},cancel(l){return a(l),i.return()}},{highWaterMark:2})};var Fr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ns=Fr&&typeof ReadableStream=="function",Qu=Fr&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):t=>E(null,null,function*(){return new Uint8Array(yield new Response(t).arrayBuffer())})),Fs=(t,...e)=>{try{return!!t(...e)}catch(r){return!1}},Zu=Ns&&Fs(()=>{let t=!1,e=new Request(ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ls=64*1024,Wn=Ns&&Fs(()=>A.isReadableStream(new Response("").body)),Nr={stream:Wn&&(t=>t.body)};Fr&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Nr[e]&&(Nr[e]=A.isFunction(t[e])?r=>r[e]():(r,n)=>{throw new Y(`Response type '${e}' is not supported`,Y.ERR_NOT_SUPPORT,n)})})})(new Response);var el=t=>E(null,null,function*(){if(t==null)return 0;if(A.isBlob(t))return t.size;if(A.isSpecCompliantForm(t))return(yield new Request(ue.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(A.isArrayBufferView(t)||A.isArrayBuffer(t))return t.byteLength;if(A.isURLSearchParams(t)&&(t=t+""),A.isString(t))return(yield Qu(t)).byteLength}),tl=(t,e)=>E(null,null,function*(){let r=A.toFiniteNumber(t.getContentLength());return r==null?el(e):r}),Bs=Fr&&(t=>E(null,null,function*(){let{url:e,method:r,data:n,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:u,responseType:l,headers:c,withCredentials:p="same-origin",fetchOptions:m}=Lr(t);l=l?(l+"").toLowerCase():"text";let g=Ms([i,s&&s.toAbortSignal()],o),f,d=g&&g.unsubscribe&&(()=>{g.unsubscribe()}),y;try{if(u&&Zu&&r!=="get"&&r!=="head"&&(y=yield tl(c,n))!==0){let L=new Request(e,{method:"POST",body:n,duplex:"half"}),S;if(A.isFormData(n)&&(S=L.headers.get("content-type"))&&c.setContentType(S),L.body){let[O,D]=Bn(y,Tt(jn(u)));n=$n(L.body,Ls,O,D)}}A.isString(p)||(p=p?"include":"omit");let k="credentials"in Request.prototype;f=new Request(e,F(I({},m),{signal:g,method:r.toUpperCase(),headers:c.normalize().toJSON(),body:n,duplex:"half",credentials:k?p:void 0}));let R=yield fetch(f),C=Wn&&(l==="stream"||l==="response");if(Wn&&(a||C&&d)){let L={};["status","statusText","headers"].forEach($=>{L[$]=R[$]});let S=A.toFiniteNumber(R.headers.get("content-length")),[O,D]=a&&Bn(S,Tt(jn(a),!0))||[];R=new Response($n(R.body,Ls,O,()=>{D&&D(),d&&d()}),L)}l=l||"text";let N=yield Nr[A.findKey(Nr,l)||"text"](R,t);return!C&&d&&d(),yield new Promise((L,S)=>{lr(L,S,{data:N,headers:de.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:f})})}catch(k){throw d&&d(),k&&k.name==="TypeError"&&/fetch/i.test(k.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,t,f),{cause:k.cause||k}):Y.from(k,k&&k.code,t,f)}}));var Hn={http:Ir,xhr:Ds,fetch:Bs};A.forEach(Hn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(r){}Object.defineProperty(t,"adapterName",{value:e})}});var js=t=>`- ${t}`,rl=t=>A.isFunction(t)||t===null||t===!1,Br={getAdapter:t=>{t=A.isArray(t)?t:[t];let{length:e}=t,r,n,i={};for(let s=0;s<e;s++){r=t[s];let o;if(n=r,!rl(r)&&(n=Hn[(o=String(r)).toLowerCase()],n===void 0))throw new Y(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+s]=n}if(!n){let s=Object.entries(i).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build")),o=e?s.length>1?`since :
|
|
8
|
+
var CDK=(()=>{var La=Object.create;var Xt=Object.defineProperty,Fa=Object.defineProperties,Ba=Object.getOwnPropertyDescriptor,ja=Object.getOwnPropertyDescriptors,Ua=Object.getOwnPropertyNames,Ar=Object.getOwnPropertySymbols,za=Object.getPrototypeOf,Sn=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable;var At=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),$a=t=>{throw TypeError(t)},rt=Math.pow,vn=(t,e,r)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I=(t,e)=>{for(var r in e||(e={}))Sn.call(e,r)&&vn(t,r,e[r]);if(Ar)for(var r of Ar(e))es.call(e,r)&&vn(t,r,e[r]);return t},F=(t,e)=>Fa(t,ja(e));var Gt=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var W=(t,e)=>{var r={};for(var n in t)Sn.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Ar)for(var n of Ar(t))e.indexOf(n)<0&&es.call(t,n)&&(r[n]=t[n]);return r};var ts=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pt=(t,e)=>{for(var r in e)Xt(t,r,{get:e[r],enumerable:!0})},rs=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ua(e))!Sn.call(t,i)&&i!==r&&Xt(t,i,{get:()=>e[i],enumerable:!(n=Ba(e,i))||n.enumerable});return t};var ns=(t,e,r)=>(r=t!=null?La(za(t)):{},rs(e||!t||!t.__esModule?Xt(r,"default",{value:t,enumerable:!0}):r,t)),Wa=t=>rs(Xt({},"__esModule",{value:!0}),t);var ee=(t,e,r)=>vn(t,typeof e!="symbol"?e+"":e,r);var E=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(l){i(l)}},o=u=>{try{a(r.throw(u))}catch(l){i(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),dt=function(t,e){this[0]=t,this[1]=e},xn=(t,e,r)=>{var n=(o,a,u,l)=>{try{var c=r[o](a),f=(a=c.value)instanceof dt,m=c.done;Promise.resolve(f?a[0]:a).then(g=>f?n(o==="return"?o:"next",a[1]?{done:g.done,value:g.value}:g,u,l):u({value:g,done:m})).catch(g=>n("throw",g,u,l))}catch(g){l(g)}},i=o=>s[o]=a=>new Promise((u,l)=>n(o,a,u,l)),s={};return r=r.apply(t,e),s[At("asyncIterator")]=()=>s,i("next"),i("throw"),i("return"),s},En=t=>{var e=t[At("asyncIterator")],r=!1,n,i={};return e==null?(e=t[At("iterator")](),n=s=>i[s]=o=>e[s](o)):(e=e.call(t),n=s=>i[s]=o=>{if(r){if(r=!1,s==="throw")throw o;return o}return r=!0,{done:!1,value:new dt(new Promise(a=>{var u=e[s](o);u instanceof Object||$a("Object expected"),a(u)}),1)}}),i[At("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=s=>{throw s},"return"in e&&n("return"),i},is=(t,e,r)=>(e=t[At("asyncIterator")])?e.call(t):(t=t[At("iterator")](),e={},r=(n,i)=>(i=t[n])&&(e[n]=s=>new Promise((o,a,u)=>(s=i.call(t,s),u=s.done,Promise.resolve(s.value).then(l=>o({value:l,done:u}),a)))),r("next"),r("return"),e);var fo=ts((co,ci)=>{(function(t){if(typeof co=="object"&&typeof ci!="undefined")ci.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return(function n(i,s,o){function a(c,f){if(!s[c]){if(!i[c]){var m=typeof Gt=="function"&≫if(!f&&m)return m(c,!0);if(u)return u(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var h=s[c]={exports:{}};i[c][0].call(h.exports,function(d){var y=i[c][1][d];return a(y||d)},h,h.exports,n,i,s,o)}return s[c].exports}for(var u=typeof Gt=="function"&&Gt,l=0;l<o.length;l++)a(o[l]);return a})({1:[function(n,i,s){(function(o){"use strict";var a=o.MutationObserver||o.WebKitMutationObserver,u;if(a){var l=0,c=new a(d),f=o.document.createTextNode("");c.observe(f,{characterData:!0}),u=function(){f.data=l=++l%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var m=new o.MessageChannel;m.port1.onmessage=d,u=function(){m.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?u=function(){var O=o.document.createElement("script");O.onreadystatechange=function(){d(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},o.document.documentElement.appendChild(O)}:u=function(){setTimeout(d,0)};var g,h=[];function d(){g=!0;for(var O,R,C=h.length;C;){for(R=h,h=[],O=-1;++O<C;)R[O]();C=h.length}g=!1}i.exports=y;function y(O){h.push(O)===1&&!g&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,s){"use strict";var o=n(1);function a(){}var u={},l=["REJECTED"],c=["FULFILLED"],f=["PENDING"];i.exports=m;function m(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,S!==a&&y(this,S)}m.prototype.catch=function(S){return this.then(null,S)},m.prototype.then=function(S,k){if(typeof S!="function"&&this.state===c||typeof k!="function"&&this.state===l)return this;var D=new this.constructor(a);if(this.state!==f){var $=this.state===c?S:k;h(D,$,this.outcome)}else this.queue.push(new g(D,S,k));return D};function g(S,k,D){this.promise=S,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},g.prototype.otherCallFulfilled=function(S){h(this.promise,this.onFulfilled,S)},g.prototype.callRejected=function(S){u.reject(this.promise,S)},g.prototype.otherCallRejected=function(S){h(this.promise,this.onRejected,S)};function h(S,k,D){o(function(){var $;try{$=k(D)}catch(X){return u.reject(S,X)}$===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,$)})}u.resolve=function(S,k){var D=O(d,k);if(D.status==="error")return u.reject(S,D.value);var $=D.value;if($)y(S,$);else{S.state=c,S.outcome=k;for(var X=-1,K=S.queue.length;++X<K;)S.queue[X].callFulfilled(k)}return S},u.reject=function(S,k){S.state=l,S.outcome=k;for(var D=-1,$=S.queue.length;++D<$;)S.queue[D].callRejected(k);return S};function d(S){var k=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof k=="function")return function(){k.apply(S,arguments)}}function y(S,k){var D=!1;function $(Z){D||(D=!0,u.reject(S,Z))}function X(Z){D||(D=!0,u.resolve(S,Z))}function K(){k(X,$)}var V=O(K);V.status==="error"&&$(V.value)}function O(S,k){var D={};try{D.value=S(k),D.status="success"}catch($){D.status="error",D.value=$}return D}m.resolve=R;function R(S){return S instanceof this?S:u.resolve(new this(a),S)}m.reject=C;function C(S){var k=new this(a);return u.reject(k,S)}m.all=L;function L(S){var k=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=S.length,$=!1;if(!D)return this.resolve([]);for(var X=new Array(D),K=0,V=-1,Z=new this(a);++V<D;)se(S[V],V);return Z;function se(re,_e){k.resolve(re).then(lt,function(be){$||($=!0,u.reject(Z,be))});function lt(be){X[_e]=be,++K===D&&!$&&($=!0,u.resolve(Z,X))}}}m.race=N;function N(S){var k=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=S.length,$=!1;if(!D)return this.resolve([]);for(var X=-1,K=new this(a);++X<D;)V(S[X]);return K;function V(Z){k.resolve(Z).then(function(se){$||($=!0,u.resolve(K,se))},function(se){$||($=!0,u.reject(K,se))})}}},{1:1}],3:[function(n,i,s){(function(o){"use strict";typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,s){"use strict";var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p};function a(p,_){if(!(p instanceof _))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(p){return}}var l=u();function c(){try{if(!l||!l.open)return!1;var p=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),_=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!p||_)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(w){return!1}}function f(p,_){p=p||[],_=_||{};try{return new Blob(p,_)}catch(b){if(b.name!=="TypeError")throw b;for(var w=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,v=new w,x=0;x<p.length;x+=1)v.append(p[x]);return v.getBlob(_.type)}}typeof Promise=="undefined"&&n(3);var m=Promise;function g(p,_){_&&p.then(function(w){_(null,w)},function(w){_(w)})}function h(p,_,w){typeof _=="function"&&p.then(_),typeof w=="function"&&p.catch(w)}function d(p){return typeof p!="string"&&(console.warn(p+" used as a key, but it is not a string."),p=String(p)),p}function y(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var O="local-forage-detect-blob-support",R=void 0,C={},L=Object.prototype.toString,N="readonly",S="readwrite";function k(p){for(var _=p.length,w=new ArrayBuffer(_),v=new Uint8Array(w),x=0;x<_;x++)v[x]=p.charCodeAt(x);return w}function D(p){return new m(function(_){var w=p.transaction(O,S),v=f([""]);w.objectStore(O).put(v,"key"),w.onabort=function(x){x.preventDefault(),x.stopPropagation(),_(!1)},w.oncomplete=function(){var x=navigator.userAgent.match(/Chrome\/(\d+)/),b=navigator.userAgent.match(/Edge\//);_(b||!x||parseInt(x[1],10)>=43)}}).catch(function(){return!1})}function $(p){return typeof R=="boolean"?m.resolve(R):D(p).then(function(_){return R=_,R})}function X(p){var _=C[p.name],w={};w.promise=new m(function(v,x){w.resolve=v,w.reject=x}),_.deferredOperations.push(w),_.dbReady?_.dbReady=_.dbReady.then(function(){return w.promise}):_.dbReady=w.promise}function K(p){var _=C[p.name],w=_.deferredOperations.pop();if(w)return w.resolve(),w.promise}function V(p,_){var w=C[p.name],v=w.deferredOperations.pop();if(v)return v.reject(_),v.promise}function Z(p,_){return new m(function(w,v){if(C[p.name]=C[p.name]||ht(),p.db)if(_)X(p),p.db.close();else return w(p.db);var x=[p.name];_&&x.push(p.version);var b=l.open.apply(l,x);_&&(b.onupgradeneeded=function(T){var M=b.result;try{M.createObjectStore(p.storeName),T.oldVersion<=1&&M.createObjectStore(O)}catch(B){if(B.name==="ConstraintError")console.warn('The database "'+p.name+'" has been upgraded from version '+T.oldVersion+" to version "+T.newVersion+', but the storage "'+p.storeName+'" already exists.');else throw B}}),b.onerror=function(T){T.preventDefault(),v(b.error)},b.onsuccess=function(){var T=b.result;T.onversionchange=function(M){M.target.close()},w(T),K(p)}})}function se(p){return Z(p,!1)}function re(p){return Z(p,!0)}function _e(p,_){if(!p.db)return!0;var w=!p.db.objectStoreNames.contains(p.storeName),v=p.version<p.db.version,x=p.version>p.db.version;if(v&&(p.version!==_&&console.warn('The database "'+p.name+`" can't be downgraded from version `+p.db.version+" to version "+p.version+"."),p.version=p.db.version),x||w){if(w){var b=p.db.version+1;b>p.version&&(p.version=b)}return!0}return!1}function lt(p){return new m(function(_,w){var v=new FileReader;v.onerror=w,v.onloadend=function(x){var b=btoa(x.target.result||"");_({__local_forage_encoded_blob:!0,data:b,type:p.type})},v.readAsBinaryString(p)})}function be(p){var _=k(atob(p.data));return f([_],{type:p.type})}function Vt(p){return p&&p.__local_forage_encoded_blob}function ct(p){var _=this,w=_._initReady().then(function(){var v=C[_._dbInfo.name];if(v&&v.dbReady)return v.dbReady});return h(w,p,p),w}function ft(p){X(p);for(var _=C[p.name],w=_.forages,v=0;v<w.length;v++){var x=w[v];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return p.db=null,se(p).then(function(b){return p.db=b,_e(p)?re(p):b}).then(function(b){p.db=_.db=b;for(var T=0;T<w.length;T++)w[T]._dbInfo.db=b}).catch(function(b){throw V(p,b),b})}function ve(p,_,w,v){v===void 0&&(v=1);try{var x=p.db.transaction(p.storeName,_);w(null,x)}catch(b){if(v>0&&(!p.db||b.name==="InvalidStateError"||b.name==="NotFoundError"))return m.resolve().then(function(){if(!p.db||b.name==="NotFoundError"&&!p.db.objectStoreNames.contains(p.storeName)&&p.version<=p.db.version)return p.db&&(p.version=p.db.version+1),re(p)}).then(function(){return ft(p).then(function(){ve(p,_,w,v-1)})}).catch(w);w(b)}}function ht(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function J(p){var _=this,w={db:null};if(p)for(var v in p)w[v]=p[v];var x=C[w.name];x||(x=ht(),C[w.name]=x),x.forages.push(_),_._initReady||(_._initReady=_.ready,_.ready=ct);var b=[];function T(){return m.resolve()}for(var M=0;M<x.forages.length;M++){var B=x.forages[M];B!==_&&b.push(B._initReady().catch(T))}var j=x.forages.slice(0);return m.all(b).then(function(){return w.db=x.db,se(w)}).then(function(z){return w.db=z,_e(w,_._defaultConfig.version)?re(w):z}).then(function(z){w.db=x.db=z,_._dbInfo=w;for(var q=0;q<j.length;q++){var Q=j[q];Q!==_&&(Q._dbInfo.db=w.db,Q._dbInfo.version=w.version)}})}function ae(p,_){var w=this;p=d(p);var v=new m(function(x,b){w.ready().then(function(){ve(w._dbInfo,N,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=B.get(p);j.onsuccess=function(){var z=j.result;z===void 0&&(z=null),Vt(z)&&(z=be(z)),x(z)},j.onerror=function(){b(j.error)}}catch(z){b(z)}})}).catch(b)});return g(v,_),v}function Jt(p,_){var w=this,v=new m(function(x,b){w.ready().then(function(){ve(w._dbInfo,N,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=B.openCursor(),z=1;j.onsuccess=function(){var q=j.result;if(q){var Q=q.value;Vt(Q)&&(Q=be(Q));var ne=p(Q,q.key,z++);ne!==void 0?x(ne):q.continue()}else x()},j.onerror=function(){b(j.error)}}catch(q){b(q)}})}).catch(b)});return g(v,_),v}function $o(p,_,w){var v=this;p=d(p);var x=new m(function(b,T){var M;v.ready().then(function(){return M=v._dbInfo,L.call(_)==="[object Blob]"?$(M.db).then(function(B){return B?_:lt(_)}):_}).then(function(B){ve(v._dbInfo,S,function(j,z){if(j)return T(j);try{var q=z.objectStore(v._dbInfo.storeName);B===null&&(B=void 0);var Q=q.put(B,p);z.oncomplete=function(){B===void 0&&(B=null),b(B)},z.onabort=z.onerror=function(){var ne=Q.error?Q.error:Q.transaction.error;T(ne)}}catch(ne){T(ne)}})}).catch(T)});return g(x,w),x}function Wo(p,_){var w=this;p=d(p);var v=new m(function(x,b){w.ready().then(function(){ve(w._dbInfo,S,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=B.delete(p);M.oncomplete=function(){x()},M.onerror=function(){b(j.error)},M.onabort=function(){var z=j.error?j.error:j.transaction.error;b(z)}}catch(z){b(z)}})}).catch(b)});return g(v,_),v}function Ho(p){var _=this,w=new m(function(v,x){_.ready().then(function(){ve(_._dbInfo,S,function(b,T){if(b)return x(b);try{var M=T.objectStore(_._dbInfo.storeName),B=M.clear();T.oncomplete=function(){v()},T.onabort=T.onerror=function(){var j=B.error?B.error:B.transaction.error;x(j)}}catch(j){x(j)}})}).catch(x)});return g(w,p),w}function qo(p){var _=this,w=new m(function(v,x){_.ready().then(function(){ve(_._dbInfo,N,function(b,T){if(b)return x(b);try{var M=T.objectStore(_._dbInfo.storeName),B=M.count();B.onsuccess=function(){v(B.result)},B.onerror=function(){x(B.error)}}catch(j){x(j)}})}).catch(x)});return g(w,p),w}function Vo(p,_){var w=this,v=new m(function(x,b){if(p<0){x(null);return}w.ready().then(function(){ve(w._dbInfo,N,function(T,M){if(T)return b(T);try{var B=M.objectStore(w._dbInfo.storeName),j=!1,z=B.openKeyCursor();z.onsuccess=function(){var q=z.result;if(!q){x(null);return}p===0||j?x(q.key):(j=!0,q.advance(p))},z.onerror=function(){b(z.error)}}catch(q){b(q)}})}).catch(b)});return g(v,_),v}function Jo(p){var _=this,w=new m(function(v,x){_.ready().then(function(){ve(_._dbInfo,N,function(b,T){if(b)return x(b);try{var M=T.objectStore(_._dbInfo.storeName),B=M.openKeyCursor(),j=[];B.onsuccess=function(){var z=B.result;if(!z){v(j);return}j.push(z.key),z.continue()},B.onerror=function(){x(B.error)}}catch(z){x(z)}})}).catch(x)});return g(w,p),w}function Ko(p,_){_=y.apply(this,arguments);var w=this.config();p=typeof p!="function"&&p||{},p.name||(p.name=p.name||w.name,p.storeName=p.storeName||w.storeName);var v=this,x;if(!p.name)x=m.reject("Invalid arguments");else{var b=p.name===w.name&&v._dbInfo.db,T=b?m.resolve(v._dbInfo.db):se(p).then(function(M){var B=C[p.name],j=B.forages;B.db=M;for(var z=0;z<j.length;z++)j[z]._dbInfo.db=M;return M});p.storeName?x=T.then(function(M){if(M.objectStoreNames.contains(p.storeName)){var B=M.version+1;X(p);var j=C[p.name],z=j.forages;M.close();for(var q=0;q<z.length;q++){var Q=z[q];Q._dbInfo.db=null,Q._dbInfo.version=B}var ne=new m(function(ie,fe){var ce=l.open(p.name,B);ce.onerror=function(Ae){var Yt=ce.result;Yt.close(),fe(Ae)},ce.onupgradeneeded=function(){var Ae=ce.result;Ae.deleteObjectStore(p.storeName)},ce.onsuccess=function(){var Ae=ce.result;Ae.close(),ie(Ae)}});return ne.then(function(ie){j.db=ie;for(var fe=0;fe<z.length;fe++){var ce=z[fe];ce._dbInfo.db=ie,K(ce._dbInfo)}}).catch(function(ie){throw(V(p,ie)||m.resolve()).catch(function(){}),ie})}}):x=T.then(function(M){X(p);var B=C[p.name],j=B.forages;M.close();for(var z=0;z<j.length;z++){var q=j[z];q._dbInfo.db=null}var Q=new m(function(ne,ie){var fe=l.deleteDatabase(p.name);fe.onerror=function(){var ce=fe.result;ce&&ce.close(),ie(fe.error)},fe.onblocked=function(){console.warn('dropInstance blocked for database "'+p.name+'" until all open connections are closed')},fe.onsuccess=function(){var ce=fe.result;ce&&ce.close(),ne(ce)}});return Q.then(function(ne){B.db=ne;for(var ie=0;ie<j.length;ie++){var fe=j[ie];K(fe._dbInfo)}}).catch(function(ne){throw(V(p,ne)||m.resolve()).catch(function(){}),ne})})}return g(x,_),x}var Yo={_driver:"asyncStorage",_initStorage:J,_support:c(),iterate:Jt,getItem:ae,setItem:$o,removeItem:Wo,clear:Ho,length:qo,key:Vo,keys:Jo,dropInstance:Ko};function Xo(){return typeof openDatabase=="function"}var et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go="~~local_forage_type~",Ni=/^~~local_forage_type~([^~]+)~/,xr="__lfsc__:",hn=xr.length,pn="arbf",dn="blob",Li="si08",Fi="ui08",Bi="uic8",ji="si16",Ui="si32",zi="ur16",$i="ui32",Wi="fl32",Hi="fl64",qi=hn+pn.length,Vi=Object.prototype.toString;function Ji(p){var _=p.length*.75,w=p.length,v,x=0,b,T,M,B;p[p.length-1]==="="&&(_--,p[p.length-2]==="="&&_--);var j=new ArrayBuffer(_),z=new Uint8Array(j);for(v=0;v<w;v+=4)b=et.indexOf(p[v]),T=et.indexOf(p[v+1]),M=et.indexOf(p[v+2]),B=et.indexOf(p[v+3]),z[x++]=b<<2|T>>4,z[x++]=(T&15)<<4|M>>2,z[x++]=(M&3)<<6|B&63;return j}function mn(p){var _=new Uint8Array(p),w="",v;for(v=0;v<_.length;v+=3)w+=et[_[v]>>2],w+=et[(_[v]&3)<<4|_[v+1]>>4],w+=et[(_[v+1]&15)<<2|_[v+2]>>6],w+=et[_[v+2]&63];return _.length%3===2?w=w.substring(0,w.length-1)+"=":_.length%3===1&&(w=w.substring(0,w.length-2)+"=="),w}function Qo(p,_){var w="";if(p&&(w=Vi.call(p)),p&&(w==="[object ArrayBuffer]"||p.buffer&&Vi.call(p.buffer)==="[object ArrayBuffer]")){var v,x=xr;p instanceof ArrayBuffer?(v=p,x+=pn):(v=p.buffer,w==="[object Int8Array]"?x+=Li:w==="[object Uint8Array]"?x+=Fi:w==="[object Uint8ClampedArray]"?x+=Bi:w==="[object Int16Array]"?x+=ji:w==="[object Uint16Array]"?x+=zi:w==="[object Int32Array]"?x+=Ui:w==="[object Uint32Array]"?x+=$i:w==="[object Float32Array]"?x+=Wi:w==="[object Float64Array]"?x+=Hi:_(new Error("Failed to get type for BinaryArray"))),_(x+mn(v))}else if(w==="[object Blob]"){var b=new FileReader;b.onload=function(){var T=Go+p.type+"~"+mn(this.result);_(xr+dn+T)},b.readAsArrayBuffer(p)}else try{_(JSON.stringify(p))}catch(T){console.error("Couldn't convert value into a JSON string: ",p),_(null,T)}}function Zo(p){if(p.substring(0,hn)!==xr)return JSON.parse(p);var _=p.substring(qi),w=p.substring(hn,qi),v;if(w===dn&&Ni.test(_)){var x=_.match(Ni);v=x[1],_=_.substring(x[0].length)}var b=Ji(_);switch(w){case pn:return b;case dn:return f([b],{type:v});case Li:return new Int8Array(b);case Fi:return new Uint8Array(b);case Bi:return new Uint8ClampedArray(b);case ji:return new Int16Array(b);case zi:return new Uint16Array(b);case Ui:return new Int32Array(b);case $i:return new Uint32Array(b);case Wi:return new Float32Array(b);case Hi:return new Float64Array(b);default:throw new Error("Unkown type: "+w)}}var gn={serialize:Qo,deserialize:Zo,stringToBuffer:Ji,bufferToString:mn};function Ki(p,_,w,v){p.executeSql("CREATE TABLE IF NOT EXISTS "+_.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],w,v)}function ea(p){var _=this,w={db:null};if(p)for(var v in p)w[v]=typeof p[v]!="string"?p[v].toString():p[v];var x=new m(function(b,T){try{w.db=openDatabase(w.name,String(w.version),w.description,w.size)}catch(M){return T(M)}w.db.transaction(function(M){Ki(M,w,function(){_._dbInfo=w,b()},function(B,j){T(j)})},T)});return w.serializer=gn,x}function tt(p,_,w,v,x,b){p.executeSql(w,v,x,function(T,M){M.code===M.SYNTAX_ERR?T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[_.storeName],function(B,j){j.rows.length?b(B,M):Ki(B,_,function(){B.executeSql(w,v,x,b)},b)},b):b(T,M)},b)}function ta(p,_){var w=this;p=d(p);var v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"SELECT * FROM "+T.storeName+" WHERE key = ? LIMIT 1",[p],function(B,j){var z=j.rows.length?j.rows.item(0).value:null;z&&(z=T.serializer.deserialize(z)),x(z)},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function ra(p,_){var w=this,v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"SELECT * FROM "+T.storeName,[],function(B,j){for(var z=j.rows,q=z.length,Q=0;Q<q;Q++){var ne=z.item(Q),ie=ne.value;if(ie&&(ie=T.serializer.deserialize(ie)),ie=p(ie,ne.key,Q+1),ie!==void 0){x(ie);return}}x()},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function Yi(p,_,w,v){var x=this;p=d(p);var b=new m(function(T,M){x.ready().then(function(){_===void 0&&(_=null);var B=_,j=x._dbInfo;j.serializer.serialize(_,function(z,q){q?M(q):j.db.transaction(function(Q){tt(Q,j,"INSERT OR REPLACE INTO "+j.storeName+" (key, value) VALUES (?, ?)",[p,z],function(){T(B)},function(ne,ie){M(ie)})},function(Q){if(Q.code===Q.QUOTA_ERR){if(v>0){T(Yi.apply(x,[p,B,w,v-1]));return}M(Q)}})})}).catch(M)});return g(b,w),b}function na(p,_,w){return Yi.apply(this,[p,_,w,1])}function ia(p,_){var w=this;p=d(p);var v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"DELETE FROM "+T.storeName+" WHERE key = ?",[p],function(){x()},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function sa(p){var _=this,w=new m(function(v,x){_.ready().then(function(){var b=_._dbInfo;b.db.transaction(function(T){tt(T,b,"DELETE FROM "+b.storeName,[],function(){v()},function(M,B){x(B)})})}).catch(x)});return g(w,p),w}function oa(p){var _=this,w=new m(function(v,x){_.ready().then(function(){var b=_._dbInfo;b.db.transaction(function(T){tt(T,b,"SELECT COUNT(key) as c FROM "+b.storeName,[],function(M,B){var j=B.rows.item(0).c;v(j)},function(M,B){x(B)})})}).catch(x)});return g(w,p),w}function aa(p,_){var w=this,v=new m(function(x,b){w.ready().then(function(){var T=w._dbInfo;T.db.transaction(function(M){tt(M,T,"SELECT key FROM "+T.storeName+" WHERE id = ? LIMIT 1",[p+1],function(B,j){var z=j.rows.length?j.rows.item(0).key:null;x(z)},function(B,j){b(j)})})}).catch(b)});return g(v,_),v}function ua(p){var _=this,w=new m(function(v,x){_.ready().then(function(){var b=_._dbInfo;b.db.transaction(function(T){tt(T,b,"SELECT key FROM "+b.storeName,[],function(M,B){for(var j=[],z=0;z<B.rows.length;z++)j.push(B.rows.item(z).key);v(j)},function(M,B){x(B)})})}).catch(x)});return g(w,p),w}function la(p){return new m(function(_,w){p.transaction(function(v){v.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(x,b){for(var T=[],M=0;M<b.rows.length;M++)T.push(b.rows.item(M).name);_({db:p,storeNames:T})},function(x,b){w(b)})},function(v){w(v)})})}function ca(p,_){_=y.apply(this,arguments);var w=this.config();p=typeof p!="function"&&p||{},p.name||(p.name=p.name||w.name,p.storeName=p.storeName||w.storeName);var v=this,x;return p.name?x=new m(function(b){var T;p.name===w.name?T=v._dbInfo.db:T=openDatabase(p.name,"","",0),p.storeName?b({db:T,storeNames:[p.storeName]}):b(la(T))}).then(function(b){return new m(function(T,M){b.db.transaction(function(B){function j(ne){return new m(function(ie,fe){B.executeSql("DROP TABLE IF EXISTS "+ne,[],function(){ie()},function(ce,Ae){fe(Ae)})})}for(var z=[],q=0,Q=b.storeNames.length;q<Q;q++)z.push(j(b.storeNames[q]));m.all(z).then(function(){T()}).catch(function(ne){M(ne)})},function(B){M(B)})})}):x=m.reject("Invalid arguments"),g(x,_),x}var fa={_driver:"webSQLStorage",_initStorage:ea,_support:Xo(),iterate:ra,getItem:ta,setItem:na,removeItem:ia,clear:sa,length:oa,key:aa,keys:ua,dropInstance:ca};function ha(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(p){return!1}}function Xi(p,_){var w=p.name+"/";return p.storeName!==_.storeName&&(w+=p.storeName+"/"),w}function pa(){var p="_localforage_support_test";try{return localStorage.setItem(p,!0),localStorage.removeItem(p),!1}catch(_){return!0}}function da(){return!pa()||localStorage.length>0}function ma(p){var _=this,w={};if(p)for(var v in p)w[v]=p[v];return w.keyPrefix=Xi(p,_._defaultConfig),da()?(_._dbInfo=w,w.serializer=gn,m.resolve()):m.reject()}function ga(p){var _=this,w=_.ready().then(function(){for(var v=_._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var b=localStorage.key(x);b.indexOf(v)===0&&localStorage.removeItem(b)}});return g(w,p),w}function wa(p,_){var w=this;p=d(p);var v=w.ready().then(function(){var x=w._dbInfo,b=localStorage.getItem(x.keyPrefix+p);return b&&(b=x.serializer.deserialize(b)),b});return g(v,_),v}function ya(p,_){var w=this,v=w.ready().then(function(){for(var x=w._dbInfo,b=x.keyPrefix,T=b.length,M=localStorage.length,B=1,j=0;j<M;j++){var z=localStorage.key(j);if(z.indexOf(b)===0){var q=localStorage.getItem(z);if(q&&(q=x.serializer.deserialize(q)),q=p(q,z.substring(T),B++),q!==void 0)return q}}});return g(v,_),v}function _a(p,_){var w=this,v=w.ready().then(function(){var x=w._dbInfo,b;try{b=localStorage.key(p)}catch(T){b=null}return b&&(b=b.substring(x.keyPrefix.length)),b});return g(v,_),v}function ba(p){var _=this,w=_.ready().then(function(){for(var v=_._dbInfo,x=localStorage.length,b=[],T=0;T<x;T++){var M=localStorage.key(T);M.indexOf(v.keyPrefix)===0&&b.push(M.substring(v.keyPrefix.length))}return b});return g(w,p),w}function va(p){var _=this,w=_.keys().then(function(v){return v.length});return g(w,p),w}function Sa(p,_){var w=this;p=d(p);var v=w.ready().then(function(){var x=w._dbInfo;localStorage.removeItem(x.keyPrefix+p)});return g(v,_),v}function xa(p,_,w){var v=this;p=d(p);var x=v.ready().then(function(){_===void 0&&(_=null);var b=_;return new m(function(T,M){var B=v._dbInfo;B.serializer.serialize(_,function(j,z){if(z)M(z);else try{localStorage.setItem(B.keyPrefix+p,j),T(b)}catch(q){(q.name==="QuotaExceededError"||q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&M(q),M(q)}})})});return g(x,w),x}function Ea(p,_){if(_=y.apply(this,arguments),p=typeof p!="function"&&p||{},!p.name){var w=this.config();p.name=p.name||w.name,p.storeName=p.storeName||w.storeName}var v=this,x;return p.name?x=new m(function(b){p.storeName?b(Xi(p,v._defaultConfig)):b(p.name+"/")}).then(function(b){for(var T=localStorage.length-1;T>=0;T--){var M=localStorage.key(T);M.indexOf(b)===0&&localStorage.removeItem(M)}}):x=m.reject("Invalid arguments"),g(x,_),x}var Aa={_driver:"localStorageWrapper",_initStorage:ma,_support:ha(),iterate:ya,getItem:wa,setItem:xa,removeItem:Sa,clear:ga,length:va,key:_a,keys:ba,dropInstance:Ea},Ca=function(_,w){return _===w||typeof _=="number"&&typeof w=="number"&&isNaN(_)&&isNaN(w)},Oa=function(_,w){for(var v=_.length,x=0;x<v;){if(Ca(_[x],w))return!0;x++}return!1},Gi=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"},Kt={},Qi={},Et={INDEXEDDB:Yo,WEBSQL:fa,LOCALSTORAGE:Aa},ka=[Et.INDEXEDDB._driver,Et.WEBSQL._driver,Et.LOCALSTORAGE._driver],Er=["dropInstance"],wn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Er),Ra={description:"",driver:ka.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ia(p,_){p[_]=function(){var w=arguments;return p.ready().then(function(){return p[_].apply(p,w)})}}function yn(){for(var p=1;p<arguments.length;p++){var _=arguments[p];if(_)for(var w in _)_.hasOwnProperty(w)&&(Gi(_[w])?arguments[0][w]=_[w].slice():arguments[0][w]=_[w])}return arguments[0]}var Ta=(function(){function p(_){a(this,p);for(var w in Et)if(Et.hasOwnProperty(w)){var v=Et[w],x=v._driver;this[w]=x,Kt[x]||this.defineDriver(v)}this._defaultConfig=yn({},Ra),this._config=yn({},this._defaultConfig,_),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return p.prototype.config=function(w){if((typeof w=="undefined"?"undefined":o(w))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var v in w){if(v==="storeName"&&(w[v]=w[v].replace(/\W/g,"_")),v==="version"&&typeof w[v]!="number")return new Error("Database version must be a number.");this._config[v]=w[v]}return"driver"in w&&w.driver?this.setDriver(this._config.driver):!0}else return typeof w=="string"?this._config[w]:this._config},p.prototype.defineDriver=function(w,v,x){var b=new m(function(T,M){try{var B=w._driver,j=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!w._driver){M(j);return}for(var z=wn.concat("_initStorage"),q=0,Q=z.length;q<Q;q++){var ne=z[q],ie=!Oa(Er,ne);if((ie||w[ne])&&typeof w[ne]!="function"){M(j);return}}var fe=function(){for(var Yt=function(Ma){return function(){var Na=new Error("Method "+Ma+" is not implemented by the current driver"),Zi=m.reject(Na);return g(Zi,arguments[arguments.length-1]),Zi}},_n=0,Da=Er.length;_n<Da;_n++){var bn=Er[_n];w[bn]||(w[bn]=Yt(bn))}};fe();var ce=function(Yt){Kt[B]&&console.info("Redefining LocalForage driver: "+B),Kt[B]=w,Qi[B]=Yt,T()};"_support"in w?w._support&&typeof w._support=="function"?w._support().then(ce,M):ce(!!w._support):ce(!0)}catch(Ae){M(Ae)}});return h(b,v,x),b},p.prototype.driver=function(){return this._driver||null},p.prototype.getDriver=function(w,v,x){var b=Kt[w]?m.resolve(Kt[w]):m.reject(new Error("Driver not found."));return h(b,v,x),b},p.prototype.getSerializer=function(w){var v=m.resolve(gn);return h(v,w),v},p.prototype.ready=function(w){var v=this,x=v._driverSet.then(function(){return v._ready===null&&(v._ready=v._initDriver()),v._ready});return h(x,w,w),x},p.prototype.setDriver=function(w,v,x){var b=this;Gi(w)||(w=[w]);var T=this._getSupportedDrivers(w);function M(){b._config.driver=b.driver()}function B(q){return b._extend(q),M(),b._ready=b._initStorage(b._config),b._ready}function j(q){return function(){var Q=0;function ne(){for(;Q<q.length;){var ie=q[Q];return Q++,b._dbInfo=null,b._ready=null,b.getDriver(ie).then(B).catch(ne)}M();var fe=new Error("No available storage method found.");return b._driverSet=m.reject(fe),b._driverSet}return ne()}}var z=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=z.then(function(){var q=T[0];return b._dbInfo=null,b._ready=null,b.getDriver(q).then(function(Q){b._driver=Q._driver,M(),b._wrapLibraryMethodsWithReady(),b._initDriver=j(T)})}).catch(function(){M();var q=new Error("No available storage method found.");return b._driverSet=m.reject(q),b._driverSet}),h(this._driverSet,v,x),this._driverSet},p.prototype.supports=function(w){return!!Qi[w]},p.prototype._extend=function(w){yn(this,w)},p.prototype._getSupportedDrivers=function(w){for(var v=[],x=0,b=w.length;x<b;x++){var T=w[x];this.supports(T)&&v.push(T)}return v},p.prototype._wrapLibraryMethodsWithReady=function(){for(var w=0,v=wn.length;w<v;w++)Ia(this,wn[w])},p.prototype.createInstance=function(w){return new p(w)},p})(),Pa=new Ta;i.exports=Pa},{3:3}]},{},[4])(4)})});var wi=ts(()=>{});var cc={};pt(cc,{BaseProvider:()=>G,CocodaSDK:()=>qt,ConceptApiProvider:()=>Te,LabelSearchSuggestionProvider:()=>We,LobidApiProvider:()=>Ye,LocApiProvider:()=>qe,LocalMappingsProvider:()=>st,MappingsApiProvider:()=>Ie,ModApiProvider:()=>Xe,MyCoReProvider:()=>Qe,NoTApiProvider:()=>Ze,OccurrencesApiProvider:()=>$e,OlsApiProvider:()=>Ge,ReconciliationApiProvider:()=>je,SkohubProvider:()=>Je,SkosmosApiProvider:()=>He,addAllProviders:()=>lc,cdk:()=>zo,errors:()=>ge,providers:()=>Ht,utils:()=>ui});var ge={};pt(ge,{BackendError:()=>Zt,BackendUnavailableError:()=>er,CDKError:()=>me,InvalidOrMissingParameterError:()=>U,InvalidProviderError:()=>Ct,InvalidRequestError:()=>Le,MethodNotImplementedError:()=>Qt,MissingApiUrlError:()=>xe,NetworkError:()=>tr});var me=class extends Error{constructor({message:e="",relatedError:r=null,code:n=null}={}){!e&&r&&r.message&&(e=r.message),super(e),this.name=this.constructor.name,this.relatedError=r,this.code=n}},Qt=class extends me{constructor(i){var s=i,{method:e,message:r=""}=s,n=W(s,["method","message"]);n.message=`Method not implemented: ${e} (${r})`,super(n)}},U=class extends me{constructor(i){var s=i,{parameter:e,message:r=""}=s,n=W(s,["parameter","message"]);n.message=`Invalid or missing parameter: ${e} (${r})`,super(n)}},Le=class extends me{},Zt=class extends me{},er=class extends me{},tr=class extends me{},xe=class extends me{},Ct=class extends me{};function rr(t,e){return function(){return t.apply(e,arguments)}}var{toString:Ha}=Object.prototype,{getPrototypeOf:On}=Object,Or=(t=>e=>{let r=Ha.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Oe=t=>(t=t.toLowerCase(),e=>Or(e)===t),kr=t=>e=>typeof e===t,{isArray:Ot}=Array,nr=kr("undefined");function qa(t){return t!==null&&!nr(t)&&t.constructor!==null&&!nr(t.constructor)&&Ee(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var as=Oe("ArrayBuffer");function Va(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&as(t.buffer),e}var Ja=kr("string"),Ee=kr("function"),us=kr("number"),Rr=t=>t!==null&&typeof t=="object",Ka=t=>t===!0||t===!1,Cr=t=>{if(Or(t)!=="object")return!1;let e=On(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ya=Oe("Date"),Xa=Oe("File"),Ga=Oe("Blob"),Qa=Oe("FileList"),Za=t=>Rr(t)&&Ee(t.pipe),eu=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ee(t.append)&&((e=Or(t))==="formdata"||e==="object"&&Ee(t.toString)&&t.toString()==="[object FormData]"))},tu=Oe("URLSearchParams"),[ru,nu,iu,su]=["ReadableStream","Request","Response","Headers"].map(Oe),ou=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t=="undefined")return;let n,i;if(typeof t!="object"&&(t=[t]),Ot(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{let s=r?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length,a;for(n=0;n<o;n++)a=s[n],e.call(null,t[a],a,t)}}function ls(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}var mt=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,cs=t=>!nr(t)&&t!==mt;function Cn(){let{caseless:t}=cs(this)&&this||{},e={},r=(n,i)=>{let s=t&&ls(e,i)||i;Cr(e[s])&&Cr(n)?e[s]=Cn(e[s],n):Cr(n)?e[s]=Cn({},n):Ot(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ir(arguments[n],r);return e}var au=(t,e,r,{allOwnKeys:n}={})=>(ir(e,(i,s)=>{r&&Ee(i)?t[s]=rr(i,r):t[s]=i},{allOwnKeys:n}),t),uu=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),lu=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},cu=(t,e,r,n)=>{let i,s,o,a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&On(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},fu=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},hu=t=>{if(!t)return null;if(Ot(t))return t;let e=t.length;if(!us(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},pu=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&On(Uint8Array)),du=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(t,s[0],s[1])}},mu=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},gu=Oe("HTMLFormElement"),wu=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),ss=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),yu=Oe("RegExp"),fs=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};ir(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},_u=t=>{fs(t,(e,r)=>{if(Ee(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(Ee(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},bu=(t,e)=>{let r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ot(t)?n(t):n(String(t).split(e)),r},vu=()=>{},Su=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,An="abcdefghijklmnopqrstuvwxyz",os="0123456789",hs={DIGIT:os,ALPHA:An,ALPHA_DIGIT:An+An.toUpperCase()+os},xu=(t=16,e=hs.ALPHA_DIGIT)=>{let r="",{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Eu(t){return!!(t&&Ee(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Au=t=>{let e=new Array(10),r=(n,i)=>{if(Rr(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let s=Ot(n)?[]:{};return ir(n,(o,a)=>{let u=r(o,i+1);!nr(u)&&(s[a]=u)}),e[i]=void 0,s}}return n};return r(t,0)},Cu=Oe("AsyncFunction"),Ou=t=>t&&(Rr(t)||Ee(t))&&Ee(t.then)&&Ee(t.catch),ps=((t,e)=>t?setImmediate:e?((r,n)=>(mt.addEventListener("message",({source:i,data:s})=>{i===mt&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),mt.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ee(mt.postMessage)),ku=typeof queueMicrotask!="undefined"?queueMicrotask.bind(mt):typeof process!="undefined"&&process.nextTick||ps,A={isArray:Ot,isArrayBuffer:as,isBuffer:qa,isFormData:eu,isArrayBufferView:Va,isString:Ja,isNumber:us,isBoolean:Ka,isObject:Rr,isPlainObject:Cr,isReadableStream:ru,isRequest:nu,isResponse:iu,isHeaders:su,isUndefined:nr,isDate:Ya,isFile:Xa,isBlob:Ga,isRegExp:yu,isFunction:Ee,isStream:Za,isURLSearchParams:tu,isTypedArray:pu,isFileList:Qa,forEach:ir,merge:Cn,extend:au,trim:ou,stripBOM:uu,inherits:lu,toFlatObject:cu,kindOf:Or,kindOfTest:Oe,endsWith:fu,toArray:hu,forEachEntry:du,matchAll:mu,isHTMLForm:gu,hasOwnProperty:ss,hasOwnProp:ss,reduceDescriptors:fs,freezeMethods:_u,toObjectSet:bu,toCamelCase:wu,noop:vu,toFiniteNumber:Su,findKey:ls,global:mt,isContextDefined:cs,ALPHABET:hs,generateString:xu,isSpecCompliantForm:Eu,toJSONObject:Au,isAsyncFn:Cu,isThenable:Ou,setImmediate:ps,asap:ku};function kt(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(kt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});var ds=kt.prototype,ms={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ms[t]={value:t}});Object.defineProperties(kt,ms);Object.defineProperty(ds,"isAxiosError",{value:!0});kt.from=(t,e,r,n,i,s)=>{let o=Object.create(ds);return A.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),kt.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Y=kt;var Ir=null;function kn(t){return A.isPlainObject(t)||A.isArray(t)}function ws(t){return A.endsWith(t,"[]")?t.slice(0,-2):t}function gs(t,e,r){return t?t.concat(e).map(function(i,s){return i=ws(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function Ru(t){return A.isArray(t)&&!t.some(kn)}var Iu=A.toFlatObject(A,{},null,function(e){return/^is[A-Z]/.test(e)});function Tu(t,e,r){if(!A.isObject(t))throw new TypeError("target must be an object");e=e||new(Ir||FormData),r=A.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,y){return!A.isUndefined(y[d])});let n=r.metaTokens,i=r.visitor||c,s=r.dots,o=r.indexes,u=(r.Blob||typeof Blob!="undefined"&&Blob)&&A.isSpecCompliantForm(e);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(A.isDate(h))return h.toISOString();if(!u&&A.isBlob(h))throw new Y("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(h)||A.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function c(h,d,y){let O=h;if(h&&!y&&typeof h=="object"){if(A.endsWith(d,"{}"))d=n?d:d.slice(0,-2),h=JSON.stringify(h);else if(A.isArray(h)&&Ru(h)||(A.isFileList(h)||A.endsWith(d,"[]"))&&(O=A.toArray(h)))return d=ws(d),O.forEach(function(C,L){!(A.isUndefined(C)||C===null)&&e.append(o===!0?gs([d],L,s):o===null?d:d+"[]",l(C))}),!1}return kn(h)?!0:(e.append(gs(y,d,s),l(h)),!1)}let f=[],m=Object.assign(Iu,{defaultVisitor:c,convertValue:l,isVisitable:kn});function g(h,d){if(!A.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+d.join("."));f.push(h),A.forEach(h,function(O,R){(!(A.isUndefined(O)||O===null)&&i.call(e,O,A.isString(R)?R.trim():R,d,m))===!0&&g(O,d?d.concat(R):[R])}),f.pop()}}if(!A.isObject(t))throw new TypeError("data must be an object");return g(t),e}var nt=Tu;function ys(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function _s(t,e){this._pairs=[],t&&nt(t,this,e)}var bs=_s.prototype;bs.append=function(e,r){this._pairs.push([e,r])};bs.toString=function(e){let r=e?function(n){return e.call(this,n,ys)}:ys;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Tr=_s;function Pu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sr(t,e,r){if(!e)return t;let n=r&&r.encode||Pu;A.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,s;if(i?s=i(e,r):s=A.isURLSearchParams(e)?e.toString():new Tr(e,r).toString(n),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var Rn=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){A.forEach(this.handlers,function(n){n!==null&&e(n)})}},In=Rn;var Pr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var vs=typeof URLSearchParams!="undefined"?URLSearchParams:Tr;var Ss=typeof FormData!="undefined"?FormData:null;var xs=typeof Blob!="undefined"?Blob:null;var Es={isBrowser:!0,classes:{URLSearchParams:vs,FormData:Ss,Blob:xs},protocols:["http","https","file","blob","url","data"]};var Dn={};pt(Dn,{hasBrowserEnv:()=>Pn,hasStandardBrowserEnv:()=>Du,hasStandardBrowserWebWorkerEnv:()=>Mu,navigator:()=>Tn,origin:()=>Nu});var Pn=typeof window!="undefined"&&typeof document!="undefined",Tn=typeof navigator=="object"&&navigator||void 0,Du=Pn&&(!Tn||["ReactNative","NativeScript","NS"].indexOf(Tn.product)<0),Mu=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Nu=Pn&&window.location.href||"http://localhost";var ue=I(I({},Dn),Es);function Mn(t,e){return nt(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return ue.isNode&&A.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Lu(t){return A.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Fu(t){let e={},r=Object.keys(t),n,i=r.length,s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}function Bu(t){function e(r,n,i,s){let o=r[s++];if(o==="__proto__")return!0;let a=Number.isFinite(+o),u=s>=r.length;return o=!o&&A.isArray(i)?i.length:o,u?(A.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&A.isArray(i[o])&&(i[o]=Fu(i[o])),!a)}if(A.isFormData(t)&&A.isFunction(t.entries)){let r={};return A.forEachEntry(t,(n,i)=>{e(Lu(n),i,r,0)}),r}return null}var Dr=Bu;function ju(t,e,r){if(A.isString(t))try{return(e||JSON.parse)(t),A.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Nn={transitional:Pr,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=A.isObject(e);if(s&&A.isHTMLForm(e)&&(e=new FormData(e)),A.isFormData(e))return i?JSON.stringify(Dr(e)):e;if(A.isArrayBuffer(e)||A.isBuffer(e)||A.isStream(e)||A.isFile(e)||A.isBlob(e)||A.isReadableStream(e))return e;if(A.isArrayBufferView(e))return e.buffer;if(A.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Mn(e,this.formSerializer).toString();if((a=A.isFileList(e))||n.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return nt(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),ju(e)):e}],transformResponse:[function(e){let r=this.transitional||Nn.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(e)||A.isReadableStream(e))return e;if(e&&A.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Y.from(a,Y.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],t=>{Nn.headers[t]={}});var Rt=Nn;var Uu=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),As=t=>{let e={},r,n,i;return t&&t.split(`
|
|
9
|
+
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&Uu[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var Cs=Symbol("internals");function or(t){return t&&String(t).trim().toLowerCase()}function Mr(t){return t===!1||t==null?t:A.isArray(t)?t.map(Mr):String(t)}function zu(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}var $u=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ln(t,e,r,n,i){if(A.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!A.isString(e)){if(A.isString(n))return e.indexOf(n)!==-1;if(A.isRegExp(n))return n.test(e)}}function Wu(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Hu(t,e){let r=A.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}var It=class{constructor(e){e&&this.set(e)}set(e,r,n){let i=this;function s(a,u,l){let c=or(u);if(!c)throw new Error("header name must be a non-empty string");let f=A.findKey(i,c);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||u]=Mr(a))}let o=(a,u)=>A.forEach(a,(l,c)=>s(l,c,u));if(A.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(A.isString(e)&&(e=e.trim())&&!$u(e))o(As(e),r);else if(A.isHeaders(e))for(let[a,u]of e.entries())s(u,a,n);else e!=null&&s(r,e,n);return this}get(e,r){if(e=or(e),e){let n=A.findKey(this,e);if(n){let i=this[n];if(!r)return i;if(r===!0)return zu(i);if(A.isFunction(r))return r.call(this,i,n);if(A.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=or(e),e){let n=A.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Ln(this,this[n],n,r)))}return!1}delete(e,r){let n=this,i=!1;function s(o){if(o=or(o),o){let a=A.findKey(n,o);a&&(!r||Ln(n,n[a],a,r))&&(delete n[a],i=!0)}}return A.isArray(e)?e.forEach(s):s(e),i}clear(e){let r=Object.keys(this),n=r.length,i=!1;for(;n--;){let s=r[n];(!e||Ln(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){let r=this,n={};return A.forEach(this,(i,s)=>{let o=A.findKey(n,s);if(o){r[o]=Mr(i),delete r[s];return}let a=e?Wu(s):String(s).trim();a!==s&&delete r[s],r[a]=Mr(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return A.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&A.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
10
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[Cs]=this[Cs]={accessors:{}}).accessors,i=this.prototype;function s(o){let a=or(o);n[a]||(Hu(i,o),n[a]=!0)}return A.isArray(e)?e.forEach(s):s(e),this}};It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);A.reduceDescriptors(It.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});A.freezeMethods(It);var de=It;function ar(t,e){let r=this||Rt,n=e||r,i=de.from(n.headers),s=n.data;return A.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function ur(t){return!!(t&&t.__CANCEL__)}function Os(t,e,r){Y.call(this,t==null?"canceled":t,Y.ERR_CANCELED,e,r),this.name="CanceledError"}A.inherits(Os,Y,{__CANCEL__:!0});var Fe=Os;function lr(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new Y("Request failed with status code "+r.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Fn(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qu(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,s=0,o;return e=e!==void 0?e:1e3,function(u){let l=Date.now(),c=n[s];o||(o=l),r[i]=u,n[i]=l;let f=s,m=0;for(;f!==i;)m+=r[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),l-o<e)return;let g=c&&l-c;return g?Math.round(m*1e3/g):void 0}}var ks=qu;function Vu(t,e){let r=0,n=1e3/e,i,s,o=(l,c=Date.now())=>{r=c,i=null,s&&(clearTimeout(s),s=null),t.apply(null,l)};return[(...l)=>{let c=Date.now(),f=c-r;f>=n?o(l,c):(i=l,s||(s=setTimeout(()=>{s=null,o(i)},n-f)))},()=>i&&o(i)]}var Rs=Vu;var Tt=(t,e,r=3)=>{let n=0,i=ks(50,250);return Rs(s=>{let o=s.loaded,a=s.lengthComputable?s.total:void 0,u=o-n,l=i(u),c=o<=a;n=o;let f={loaded:o,total:a,progress:a?o/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&c?(a-o)/l:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},r)},Bn=(t,e)=>{let r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},jn=t=>(...e)=>A.asap(()=>t(...e));var Is=ue.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,ue.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0;var Ts=ue.hasStandardBrowserEnv?{write(t,e,r,n,i,s){let o=[t+"="+encodeURIComponent(e)];A.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),A.isString(n)&&o.push("path="+n),A.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Un(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function cr(t,e){return t&&!Un(e)?zn(t,e):e}var Ps=t=>t instanceof de?I({},t):t;function ke(t,e){e=e||{};let r={};function n(l,c,f,m){return A.isPlainObject(l)&&A.isPlainObject(c)?A.merge.call({caseless:m},l,c):A.isPlainObject(c)?A.merge({},c):A.isArray(c)?c.slice():c}function i(l,c,f,m){if(A.isUndefined(c)){if(!A.isUndefined(l))return n(void 0,l,f,m)}else return n(l,c,f,m)}function s(l,c){if(!A.isUndefined(c))return n(void 0,c)}function o(l,c){if(A.isUndefined(c)){if(!A.isUndefined(l))return n(void 0,l)}else return n(void 0,c)}function a(l,c,f){if(f in e)return n(l,c);if(f in t)return n(void 0,l)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,c,f)=>i(Ps(l),Ps(c),f,!0)};return A.forEach(Object.keys(Object.assign({},t,e)),function(c){let f=u[c]||i,m=f(t[c],e[c],c);A.isUndefined(m)&&f!==a||(r[c]=m)}),r}var Nr=t=>{let e=ke({},t),{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=de.from(o),e.url=sr(cr(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(A.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){let[l,...c]=u?u.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...c].join("; "))}}if(ue.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(e)),n||n!==!1&&Is(e.url))){let l=i&&s&&Ts.read(s);l&&o.set(i,l)}return e};var Ju=typeof XMLHttpRequest!="undefined",Ds=Ju&&function(t){return new Promise(function(r,n){let i=Nr(t),s=i.data,o=de.from(i.headers).normalize(),{responseType:a,onUploadProgress:u,onDownloadProgress:l}=i,c,f,m,g,h;function d(){g&&g(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function O(){if(!y)return;let C=de.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),N={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:C,config:t,request:y};lr(function(k){r(k),d()},function(k){n(k),d()},N),y=null}"onloadend"in y?y.onloadend=O:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(O)},y.onabort=function(){y&&(n(new Y("Request aborted",Y.ECONNABORTED,t,y)),y=null)},y.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let L=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",N=i.transitional||Pr;i.timeoutErrorMessage&&(L=i.timeoutErrorMessage),n(new Y(L,N.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,t,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&A.forEach(o.toJSON(),function(L,N){y.setRequestHeader(N,L)}),A.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),a&&a!=="json"&&(y.responseType=i.responseType),l&&([m,h]=Tt(l,!0),y.addEventListener("progress",m)),u&&y.upload&&([f,g]=Tt(u),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(c=C=>{y&&(n(!C||C.type?new Fe(null,t,y):C),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));let R=Fn(i.url);if(R&&ue.protocols.indexOf(R)===-1){n(new Y("Unsupported protocol "+R+":",Y.ERR_BAD_REQUEST,t));return}y.send(s||null)})};var Ku=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,i,s=function(l){if(!i){i=!0,a();let c=l instanceof Error?l:this.reason;n.abort(c instanceof Y?c:new Fe(c instanceof Error?c.message:c))}},o=e&&setTimeout(()=>{o=null,s(new Y(`timeout ${e} of ms exceeded`,Y.ETIMEDOUT))},e),a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),t=null)};t.forEach(l=>l.addEventListener("abort",s));let{signal:u}=n;return u.unsubscribe=()=>A.asap(a),u}},Ms=Ku;var Yu=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let n=0,i;for(;n<r;)i=n+e,yield t.slice(n,i),n=i},Xu=function(t,e){return xn(this,null,function*(){try{for(var r=is(Gu(t)),n,i,s;n=!(i=yield new dt(r.next())).done;n=!1){let o=i.value;yield*En(Yu(o,e))}}catch(i){s=[i]}finally{try{n&&(i=r.return)&&(yield new dt(i.call(r)))}finally{if(s)throw s[0]}}})},Gu=function(t){return xn(this,null,function*(){if(t[Symbol.asyncIterator]){yield*En(t);return}let e=t.getReader();try{for(;;){let{done:r,value:n}=yield new dt(e.read());if(r)break;yield n}}finally{yield new dt(e.cancel())}})},$n=(t,e,r,n)=>{let i=Xu(t,e),s=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({pull(l){return E(this,null,function*(){try{let{done:c,value:f}=yield i.next();if(c){a(),l.close();return}let m=f.byteLength;if(r){let g=s+=m;r(g)}l.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}})},cancel(l){return a(l),i.return()}},{highWaterMark:2})};var Fr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ls=Fr&&typeof ReadableStream=="function",Qu=Fr&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):t=>E(null,null,function*(){return new Uint8Array(yield new Response(t).arrayBuffer())})),Fs=(t,...e)=>{try{return!!t(...e)}catch(r){return!1}},Zu=Ls&&Fs(()=>{let t=!1,e=new Request(ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ns=64*1024,Wn=Ls&&Fs(()=>A.isReadableStream(new Response("").body)),Lr={stream:Wn&&(t=>t.body)};Fr&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Lr[e]&&(Lr[e]=A.isFunction(t[e])?r=>r[e]():(r,n)=>{throw new Y(`Response type '${e}' is not supported`,Y.ERR_NOT_SUPPORT,n)})})})(new Response);var el=t=>E(null,null,function*(){if(t==null)return 0;if(A.isBlob(t))return t.size;if(A.isSpecCompliantForm(t))return(yield new Request(ue.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(A.isArrayBufferView(t)||A.isArrayBuffer(t))return t.byteLength;if(A.isURLSearchParams(t)&&(t=t+""),A.isString(t))return(yield Qu(t)).byteLength}),tl=(t,e)=>E(null,null,function*(){let r=A.toFiniteNumber(t.getContentLength());return r==null?el(e):r}),Bs=Fr&&(t=>E(null,null,function*(){let{url:e,method:r,data:n,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:u,responseType:l,headers:c,withCredentials:f="same-origin",fetchOptions:m}=Nr(t);l=l?(l+"").toLowerCase():"text";let g=Ms([i,s&&s.toAbortSignal()],o),h,d=g&&g.unsubscribe&&(()=>{g.unsubscribe()}),y;try{if(u&&Zu&&r!=="get"&&r!=="head"&&(y=yield tl(c,n))!==0){let N=new Request(e,{method:"POST",body:n,duplex:"half"}),S;if(A.isFormData(n)&&(S=N.headers.get("content-type"))&&c.setContentType(S),N.body){let[k,D]=Bn(y,Tt(jn(u)));n=$n(N.body,Ns,k,D)}}A.isString(f)||(f=f?"include":"omit");let O="credentials"in Request.prototype;h=new Request(e,F(I({},m),{signal:g,method:r.toUpperCase(),headers:c.normalize().toJSON(),body:n,duplex:"half",credentials:O?f:void 0}));let R=yield fetch(h),C=Wn&&(l==="stream"||l==="response");if(Wn&&(a||C&&d)){let N={};["status","statusText","headers"].forEach($=>{N[$]=R[$]});let S=A.toFiniteNumber(R.headers.get("content-length")),[k,D]=a&&Bn(S,Tt(jn(a),!0))||[];R=new Response($n(R.body,Ns,k,()=>{D&&D(),d&&d()}),N)}l=l||"text";let L=yield Lr[A.findKey(Lr,l)||"text"](R,t);return!C&&d&&d(),yield new Promise((N,S)=>{lr(N,S,{data:L,headers:de.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:h})})}catch(O){throw d&&d(),O&&O.name==="TypeError"&&/fetch/i.test(O.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,t,h),{cause:O.cause||O}):Y.from(O,O&&O.code,t,h)}}));var Hn={http:Ir,xhr:Ds,fetch:Bs};A.forEach(Hn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(r){}Object.defineProperty(t,"adapterName",{value:e})}});var js=t=>`- ${t}`,rl=t=>A.isFunction(t)||t===null||t===!1,Br={getAdapter:t=>{t=A.isArray(t)?t:[t];let{length:e}=t,r,n,i={};for(let s=0;s<e;s++){r=t[s];let o;if(n=r,!rl(r)&&(n=Hn[(o=String(r)).toLowerCase()],n===void 0))throw new Y(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+s]=n}if(!n){let s=Object.entries(i).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build")),o=e?s.length>1?`since :
|
|
11
11
|
`+s.map(js).join(`
|
|
12
12
|
`):" "+js(s[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Hn};function qn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Fe(null,t)}function jr(t){return qn(t),t.headers=de.from(t.headers),t.data=ar.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Br.getAdapter(t.adapter||Rt.adapter)(t).then(function(n){return qn(t),n.data=ar.call(t,t.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return ur(n)||(qn(t),n&&n.response&&(n.response.data=ar.call(t,t.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}var Ur="1.7.9";var zr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{zr[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var Us={};zr.transitional=function(e,r,n){function i(s,o){return"[Axios v"+Ur+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new Y(i(o," has been removed"+(r?" in "+r:"")),Y.ERR_DEPRECATED);return r&&!Us[o]&&(Us[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};zr.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function nl(t,e,r){if(typeof t!="object")throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let s=n[i],o=e[s];if(o){let a=t[s],u=a===void 0||o(a,s,t);if(u!==!0)throw new Y("option "+s+" must be "+u,Y.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Y("Unknown option "+s,Y.ERR_BAD_OPTION)}}var fr={assertOptions:nl,validators:zr};var Be=fr.validators,Pt=class{constructor(e){this.defaults=e,this.interceptors={request:new In,response:new In}}request(e,r){return E(this,null,function*(){try{return yield this._request(e,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;let s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
13
|
-
`+s):n.stack=s}catch(o){}}throw n}})}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ke(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&fr.assertOptions(n,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean)},!1),i!=null&&(A.isFunction(i)?r.paramsSerializer={serialize:i}:fr.assertOptions(i,{encode:Be.function,serialize:Be.function},!0)),fr.assertOptions(r,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&A.merge(s.common,s[r.method]);s&&A.forEach(["delete","get","head","post","put","patch","common"],f=>{delete s[f]}),r.headers=de.concat(o,s);let a=[],u=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(u=u&&d.synchronous,a.unshift(d.fulfilled,d.rejected))});let l=[];this.interceptors.response.forEach(function(d){l.push(d.fulfilled,d.rejected)});let c,p=0,m;if(!u){let f=[jr.bind(this),void 0];for(f.unshift.apply(f,a),f.push.apply(f,l),m=f.length,c=Promise.resolve(r);p<m;)c=c.then(f[p++],f[p++]);return c}m=a.length;let g=r;for(p=0;p<m;){let f=a[p++],d=a[p++];try{g=f(g)}catch(y){d.call(this,y);break}}try{c=jr.call(this,g)}catch(f){return Promise.reject(f)}for(p=0,m=l.length;p<m;)c=c.then(l[p++],l[p++]);return c}getUri(e){e=ke(this.defaults,e);let r=cr(e.baseURL,e.url);return sr(r,e.params,e.paramsSerializer)}};A.forEach(["delete","get","head","options"],function(e){Pt.prototype[e]=function(r,n){return this.request(ke(n||{},{method:e,url:r,data:(n||{}).data}))}});A.forEach(["post","put","patch"],function(e){function r(n){return function(s,o,a){return this.request(ke(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Pt.prototype[e]=r(),Pt.prototype[e+"Form"]=r(!0)});var hr=Pt;var Vn=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Fe(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}},zs=Vn;function Jn(t){return function(r){return t.apply(null,r)}}function Kn(t){return A.isObject(t)&&t.isAxiosError===!0}var Yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yn).forEach(([t,e])=>{Yn[e]=t});var $s=Yn;function Ws(t){let e=new hr(t),r=rr(hr.prototype.request,e);return A.extend(r,hr.prototype,e,{allOwnKeys:!0}),A.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Ws(ke(t,i))},r}var he=Ws(Rt);he.Axios=hr;he.CanceledError=Fe;he.CancelToken=zs;he.isCancel=ur;he.VERSION=Ur;he.toFormData=nt;he.AxiosError=Y;he.Cancel=he.CanceledError;he.all=function(e){return Promise.all(e)};he.spread=Jn;he.isAxiosError=Kn;he.mergeConfig=ke;he.AxiosHeaders=de;he.formToJSON=t=>Dr(A.isHTMLForm(t)?new FormData(t):t);he.getAdapter=Br.getAdapter;he.HttpStatusCode=$s;he.default=he;var pe=he;var{Axios:vp,AxiosError:Sp,CanceledError:xp,isCancel:Ep,CancelToken:Ap,VERSION:Cp,all:Op,Cancel:kp,isAxiosError:Rp,spread:Ip,toFormData:Tp,AxiosHeaders:Pp,HttpStatusCode:Dp,formToJSON:Mp,getAdapter:Lp,mergeConfig:Np}=pe;var il=/[\\^$.*+?()[\]{}|]/g,sl=t=>t.replace(il,"\\$&"),ol=/[%ÄÖÜäöü ]/g,Xn=class{constructor(e={}){if(Object.assign(this,e),this.notationPattern||(this.notationPattern=".+"),!this.uriPattern&&this.namespace){this.uriPattern="^"+sl(this.namespace);let r=this.notationPattern.replace(ol,encodeURI);this.uriPattern+="("+r+")$"}this.NOTATION_REGEX=RegExp("^("+this.notationPattern+")$"),this.uriPattern&&(this.URI_REGEX=RegExp(this.uriPattern))}isValidNotation(e){return this.NOTATION_REGEX.exec(e)}notationFromUri(e){if(this.URI_REGEX){let r=this.URI_REGEX.exec(e);if(r)return decodeURI(r[1])}}uriFromNotation(e){if(this.uriPattern)return e=encodeURIComponent(e),this.uriPattern.replace(/^\^|\$$/g,"").replace(/\\/g,"").replace(/\(.*\)/,e)}conceptFromUri(e,r={}){let n=this.notationFromUri(e);if(n===void 0)return;let i={uri:e,notation:[n]};return r.inScheme&&(i.inScheme=[{uri:this.uri}]),r.topConcept&&(i.topConceptOf=[{uri:this.uri}]),i}conceptFromNotation(e,r){if(this.isValidNotation(e))return this.conceptFromUri(this.uriFromNotation(e),r)}},$r=Xn;function Dt(t,e,r){let n=Array.prototype.slice,i=typeof Object.keys=="function"?Object.keys:function(l){let c=[];for(let p in l)c.push(p);return c},s=function(l,c){return l===c?!0:l instanceof Date&&c instanceof Date?l.getTime()===c.getTime():typeof l!="object"&&typeof c!="object"?l==c:u(l,c)};function o(l){return l==null}function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}function u(l,c){if(o(l)||o(c)||l.prototype!==c.prototype)return!1;if(a(l))return a(c)?(l=n.call(l),c=n.call(c),s(l,c)):!1;let p,m,g,f;try{p=i(l),m=i(c)}catch(d){return!1}if(p.length!=m.length)return!1;for(p.sort(),m.sort(),f=p.length-1;f>=0;f--)if(p[f]!=m[f])return!1;for(f=p.length-1;f>=0;f--)if(g=p[f],r){let d=r(l[g],c[g],g);if(d===void 0&&(d=Dt(l[g],c[g])),!d)return!1}else if(!s(l[g],c[g]))return!1;return!0}return s(t,e)}function te(t,e,r=void 0){let n=s=>String.prototype.split.call(e,s).filter(Boolean).reduce((o,a)=>o!=null?o[a]:o,t),i=n(/[,[\]]+?/)||n(/[,[\].]+?/);return i===void 0||i===t?r:i}function Mt(t,e){return e.reduce((r,n)=>(t&&t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}function pr(t,e){for(let r in t)t.hasOwnProperty(r)&&e(t[r],r)}function Lt(t){return typeof t=="object"&&t!==null}function dr(t){return!!(t&&typeof t.valueOf()=="string")}function Hs(t,e){return[...new Set([...t,...e])]}function qs(t,e,r){return[...t,...e].reduce((n,i)=>(n.findIndex(s=>r(s,i))!==-1||n.push(i),n),[])}function Vs(t,e){for(let r of e){typeof r=="string"&&(r=r.split("."));for(let n=0;n<r.length-1;n++)t=t[r[n]];delete t[r.pop()]}}var Wr={store:null,path:"",defaults:["en"],getLanguages:Ks,selectLanguage:al};function Ks(){return te(Wr.store,Wr.path)||Wr.defaults}function al(t){if(!t)return null;for(let e of Ks())if(t[e])return e;for(let e of Object.keys(t))if(e!="-")return e;return null}var Hr=Wr;var ei={};pt(ei,{addMappingIdentifiers:()=>Qn,compareMappingContent:()=>ul,compareMappingMembers:()=>ll,compareMappings:()=>ro,mappingContent:()=>Gs,mappingContentIdentifier:()=>Zs,mappingMembers:()=>Qs,mappingMembersIdentifier:()=>eo});function Gn(t){var e=function(N,L){var S=N<<L|N>>>32-L;return S},r=function(N){var L="",S,O;for(S=7;S>=0;S--)O=N>>>S*4&15,L+=O.toString(16);return L},n,i,s,o=new Array(80),a=1732584193,u=4023233417,l=2562383102,c=271733878,p=3285377520,m,g,f,d,y,k;t=unescape(encodeURIComponent(t));var R=t.length,C=[];for(i=0;i<R-3;i+=4)s=t.charCodeAt(i)<<24|t.charCodeAt(i+1)<<16|t.charCodeAt(i+2)<<8|t.charCodeAt(i+3),C.push(s);switch(R%4){case 0:i=2147483648;break;case 1:i=t.charCodeAt(R-1)<<24|8388608;break;case 2:i=t.charCodeAt(R-2)<<24|t.charCodeAt(R-1)<<16|32768;break;case 3:i=t.charCodeAt(R-3)<<24|t.charCodeAt(R-2)<<16|t.charCodeAt(R-1)<<8|128;break}for(C.push(i);C.length%16!==14;)C.push(0);for(C.push(R>>>29),C.push(R<<3&4294967295),n=0;n<C.length;n+=16){for(i=0;i<16;i++)o[i]=C[n+i];for(i=16;i<=79;i++)o[i]=e(o[i-3]^o[i-8]^o[i-14]^o[i-16],1);for(m=a,g=u,f=l,d=c,y=p,i=0;i<=19;i++)k=e(m,5)+(g&f|~g&d)+y+o[i]+1518500249&4294967295,y=d,d=f,f=e(g,30),g=m,m=k;for(i=20;i<=39;i++)k=e(m,5)+(g^f^d)+y+o[i]+1859775393&4294967295,y=d,d=f,f=e(g,30),g=m,m=k;for(i=40;i<=59;i++)k=e(m,5)+(g&f|g&d|f&d)+y+o[i]+2400959708&4294967295,y=d,d=f,f=e(g,30),g=m,m=k;for(i=60;i<=79;i++)k=e(m,5)+(g^f^d)+y+o[i]+3395469782&4294967295,y=d,d=f,f=e(g,30),g=m,m=k;a=a+m&4294967295,u=u+g&4294967295,l=l+f&4294967295,c=c+d&4294967295,p=p+y&4294967295}return k=r(a)+r(u)+r(l)+r(c)+r(p),k.toLowerCase()}function Xs(t){return t.map(e=>e&&e.uri).filter(Boolean)}function Zn(t){return["memberSet","memberList","memberChoice"].find(e=>t[e])}function Ys(t){let e=Zn(t),r=t[e]?Xs(t[e]):[];return{[r.length>1?e:"memberSet"]:r.map(n=>({uri:n}))}}function Gs(t){let{from:e,to:r,type:n}=t,i={from:Ys(e||{}),to:Ys(r||{}),type:[n&&n[0]||"http://www.w3.org/2004/02/skos/core#mappingRelation"]};for(let s of["from","to"])if((i[s][Zn(i[s])]||[]).length==0){let o=t[s+"Scheme"];o&&o.uri&&(i[s+"Scheme"]={uri:o.uri})}return i}function Qs(t){let{from:e,to:r}=t,n=[e,r].filter(Boolean).map(i=>Xs(i[Zn(i)]||[]));return[].concat(...n).sort()}function Zs(t){let e=JSON.stringify(Gs(t),["from","fromScheme","to","toScheme","type","memberSet","memberList","memberChoice","uri"]);return"urn:jskos:mapping:content:"+Gn(e+`
|
|
13
|
+
`+s):n.stack=s}catch(o){}}throw n}})}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ke(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&fr.assertOptions(n,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean)},!1),i!=null&&(A.isFunction(i)?r.paramsSerializer={serialize:i}:fr.assertOptions(i,{encode:Be.function,serialize:Be.function},!0)),fr.assertOptions(r,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&A.merge(s.common,s[r.method]);s&&A.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),r.headers=de.concat(o,s);let a=[],u=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(u=u&&d.synchronous,a.unshift(d.fulfilled,d.rejected))});let l=[];this.interceptors.response.forEach(function(d){l.push(d.fulfilled,d.rejected)});let c,f=0,m;if(!u){let h=[jr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,l),m=h.length,c=Promise.resolve(r);f<m;)c=c.then(h[f++],h[f++]);return c}m=a.length;let g=r;for(f=0;f<m;){let h=a[f++],d=a[f++];try{g=h(g)}catch(y){d.call(this,y);break}}try{c=jr.call(this,g)}catch(h){return Promise.reject(h)}for(f=0,m=l.length;f<m;)c=c.then(l[f++],l[f++]);return c}getUri(e){e=ke(this.defaults,e);let r=cr(e.baseURL,e.url);return sr(r,e.params,e.paramsSerializer)}};A.forEach(["delete","get","head","options"],function(e){Pt.prototype[e]=function(r,n){return this.request(ke(n||{},{method:e,url:r,data:(n||{}).data}))}});A.forEach(["post","put","patch"],function(e){function r(n){return function(s,o,a){return this.request(ke(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Pt.prototype[e]=r(),Pt.prototype[e+"Form"]=r(!0)});var hr=Pt;var Vn=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Fe(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}},zs=Vn;function Jn(t){return function(r){return t.apply(null,r)}}function Kn(t){return A.isObject(t)&&t.isAxiosError===!0}var Yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yn).forEach(([t,e])=>{Yn[e]=t});var $s=Yn;function Ws(t){let e=new hr(t),r=rr(hr.prototype.request,e);return A.extend(r,hr.prototype,e,{allOwnKeys:!0}),A.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Ws(ke(t,i))},r}var he=Ws(Rt);he.Axios=hr;he.CanceledError=Fe;he.CancelToken=zs;he.isCancel=ur;he.VERSION=Ur;he.toFormData=nt;he.AxiosError=Y;he.Cancel=he.CanceledError;he.all=function(e){return Promise.all(e)};he.spread=Jn;he.isAxiosError=Kn;he.mergeConfig=ke;he.AxiosHeaders=de;he.formToJSON=t=>Dr(A.isHTMLForm(t)?new FormData(t):t);he.getAdapter=Br.getAdapter;he.HttpStatusCode=$s;he.default=he;var pe=he;var{Axios:vp,AxiosError:Sp,CanceledError:xp,isCancel:Ep,CancelToken:Ap,VERSION:Cp,all:Op,Cancel:kp,isAxiosError:Rp,spread:Ip,toFormData:Tp,AxiosHeaders:Pp,HttpStatusCode:Dp,formToJSON:Mp,getAdapter:Np,mergeConfig:Lp}=pe;var il=/[\\^$.*+?()[\]{}|]/g,sl=t=>t.replace(il,"\\$&"),ol=/[%ÄÖÜäöü ]/g,Xn=class{constructor(e={}){if(Object.assign(this,e),this.notationPattern||(this.notationPattern=".+"),!this.uriPattern&&this.namespace){this.uriPattern="^"+sl(this.namespace);let r=this.notationPattern.replace(ol,encodeURI);this.uriPattern+="("+r+")$"}this.NOTATION_REGEX=RegExp("^("+this.notationPattern+")$"),this.uriPattern&&(this.URI_REGEX=RegExp(this.uriPattern))}isValidNotation(e){return this.NOTATION_REGEX.exec(e)}notationFromUri(e){if(this.URI_REGEX){let r=this.URI_REGEX.exec(e);if(r)return decodeURI(r[1])}}uriFromNotation(e){if(this.uriPattern)return e=encodeURIComponent(e),this.uriPattern.replace(/^\^|\$$/g,"").replace(/\\/g,"").replace(/\(.*\)/,e)}conceptFromUri(e,r={}){let n=this.notationFromUri(e);if(n===void 0)return;let i={uri:e,notation:[n]};return r.inScheme&&(i.inScheme=[{uri:this.uri}]),r.topConcept&&(i.topConceptOf=[{uri:this.uri}]),i}conceptFromNotation(e,r){if(this.isValidNotation(e))return this.conceptFromUri(this.uriFromNotation(e),r)}},$r=Xn;function Dt(t,e,r){let n=Array.prototype.slice,i=typeof Object.keys=="function"?Object.keys:function(l){let c=[];for(let f in l)c.push(f);return c},s=function(l,c){return l===c?!0:l instanceof Date&&c instanceof Date?l.getTime()===c.getTime():typeof l!="object"&&typeof c!="object"?l==c:u(l,c)};function o(l){return l==null}function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}function u(l,c){if(o(l)||o(c)||l.prototype!==c.prototype)return!1;if(a(l))return a(c)?(l=n.call(l),c=n.call(c),s(l,c)):!1;let f,m,g,h;try{f=i(l),m=i(c)}catch(d){return!1}if(f.length!=m.length)return!1;for(f.sort(),m.sort(),h=f.length-1;h>=0;h--)if(f[h]!=m[h])return!1;for(h=f.length-1;h>=0;h--)if(g=f[h],r){let d=r(l[g],c[g],g);if(d===void 0&&(d=Dt(l[g],c[g])),!d)return!1}else if(!s(l[g],c[g]))return!1;return!0}return s(t,e)}function te(t,e,r=void 0){let n=s=>String.prototype.split.call(e,s).filter(Boolean).reduce((o,a)=>o!=null?o[a]:o,t),i=n(/[,[\]]+?/)||n(/[,[\].]+?/);return i===void 0||i===t?r:i}function Mt(t,e){return e.reduce((r,n)=>(t&&t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}function pr(t,e){for(let r in t)t.hasOwnProperty(r)&&e(t[r],r)}function Nt(t){return typeof t=="object"&&t!==null}function dr(t){return!!(t&&typeof t.valueOf()=="string")}function Hs(t,e){return[...new Set([...t,...e])]}function qs(t,e,r){return[...t,...e].reduce((n,i)=>(n.findIndex(s=>r(s,i))!==-1||n.push(i),n),[])}function Vs(t,e){for(let r of e){typeof r=="string"&&(r=r.split("."));for(let n=0;n<r.length-1;n++)t=t[r[n]];delete t[r.pop()]}}var Wr={store:null,path:"",defaults:["en"],getLanguages:Ks,selectLanguage:al};function Ks(){return te(Wr.store,Wr.path)||Wr.defaults}function al(t){if(!t)return null;for(let e of Ks())if(t[e])return e;for(let e of Object.keys(t))if(e!="-")return e;return null}var Hr=Wr;var ei={};pt(ei,{addMappingIdentifiers:()=>Qn,compareMappingContent:()=>ul,compareMappingMembers:()=>ll,compareMappings:()=>ro,mappingContent:()=>Gs,mappingContentIdentifier:()=>Zs,mappingMembers:()=>Qs,mappingMembersIdentifier:()=>eo});function Gn(t){var e=function(L,N){var S=L<<N|L>>>32-N;return S},r=function(L){var N="",S,k;for(S=7;S>=0;S--)k=L>>>S*4&15,N+=k.toString(16);return N},n,i,s,o=new Array(80),a=1732584193,u=4023233417,l=2562383102,c=271733878,f=3285377520,m,g,h,d,y,O;t=unescape(encodeURIComponent(t));var R=t.length,C=[];for(i=0;i<R-3;i+=4)s=t.charCodeAt(i)<<24|t.charCodeAt(i+1)<<16|t.charCodeAt(i+2)<<8|t.charCodeAt(i+3),C.push(s);switch(R%4){case 0:i=2147483648;break;case 1:i=t.charCodeAt(R-1)<<24|8388608;break;case 2:i=t.charCodeAt(R-2)<<24|t.charCodeAt(R-1)<<16|32768;break;case 3:i=t.charCodeAt(R-3)<<24|t.charCodeAt(R-2)<<16|t.charCodeAt(R-1)<<8|128;break}for(C.push(i);C.length%16!==14;)C.push(0);for(C.push(R>>>29),C.push(R<<3&4294967295),n=0;n<C.length;n+=16){for(i=0;i<16;i++)o[i]=C[n+i];for(i=16;i<=79;i++)o[i]=e(o[i-3]^o[i-8]^o[i-14]^o[i-16],1);for(m=a,g=u,h=l,d=c,y=f,i=0;i<=19;i++)O=e(m,5)+(g&h|~g&d)+y+o[i]+1518500249&4294967295,y=d,d=h,h=e(g,30),g=m,m=O;for(i=20;i<=39;i++)O=e(m,5)+(g^h^d)+y+o[i]+1859775393&4294967295,y=d,d=h,h=e(g,30),g=m,m=O;for(i=40;i<=59;i++)O=e(m,5)+(g&h|g&d|h&d)+y+o[i]+2400959708&4294967295,y=d,d=h,h=e(g,30),g=m,m=O;for(i=60;i<=79;i++)O=e(m,5)+(g^h^d)+y+o[i]+3395469782&4294967295,y=d,d=h,h=e(g,30),g=m,m=O;a=a+m&4294967295,u=u+g&4294967295,l=l+h&4294967295,c=c+d&4294967295,f=f+y&4294967295}return O=r(a)+r(u)+r(l)+r(c)+r(f),O.toLowerCase()}function Xs(t){return t.map(e=>e&&e.uri).filter(Boolean)}function Zn(t){return["memberSet","memberList","memberChoice"].find(e=>t[e])}function Ys(t){let e=Zn(t),r=t[e]?Xs(t[e]):[];return{[r.length>1?e:"memberSet"]:r.map(n=>({uri:n}))}}function Gs(t){let{from:e,to:r,type:n}=t,i={from:Ys(e||{}),to:Ys(r||{}),type:[n&&n[0]||"http://www.w3.org/2004/02/skos/core#mappingRelation"]};for(let s of["from","to"])if((i[s][Zn(i[s])]||[]).length==0){let o=t[s+"Scheme"];o&&o.uri&&(i[s+"Scheme"]={uri:o.uri})}return i}function Qs(t){let{from:e,to:r}=t,n=[e,r].filter(Boolean).map(i=>Xs(i[Zn(i)]||[]));return[].concat(...n).sort()}function Zs(t){let e=JSON.stringify(Gs(t),["from","fromScheme","to","toScheme","type","memberSet","memberList","memberChoice","uri"]);return"urn:jskos:mapping:content:"+Gn(e+`
|
|
14
14
|
`)}function eo(t){let e=JSON.stringify(Qs(t));return"urn:jskos:mapping:members:"+Gn(e+`
|
|
15
|
-
`)}function Qn(t){let e=(t.identifier||[]).filter(r=>r&&!r.startsWith("urn:jskos:mapping:")).concat([eo(t),Zs(t)]).sort();return Object.assign({},t,{identifier:e})}function to(t,e,r){t=t&&Qn(t),e=e&&Qn(e);let n=t&&t.identifier?t.identifier.find(s=>s.startsWith(r)):null,i=e&&e.identifier?e.identifier.find(s=>s.startsWith(r)):null;return n==i}function ro(t,e){return to(t,e,"urn:jskos:mapping:content:")}var ul=ro;function ll(t,e){return to(t,e,"urn:jskos:mapping:members:")}var si={};pt(si,{addContext:()=>fl,annotationCreatorMatches:()=>Nl,annotationCreatorName:()=>Ll,annotationCreatorUri:()=>Ml,clean:()=>ni,cleanJSKOS:()=>hl,compare:()=>it,compareConcepts:()=>gl,compareFunctions:()=>Rl,compareMappingsDeep:()=>Cl,compareObjects:()=>dl,compareSchemes:()=>ml,conceptsOfMapping:()=>gt,copyDeep:()=>Jr,deepCopy:()=>pl,defaultMappingType:()=>oo,definition:()=>Pl,flattenMapping:()=>xl,getAllUris:()=>ti,guessObjectType:()=>Vr,guessSchemeFromNotation:()=>Fl,isConcept:()=>wl,isContainedIn:()=>so,isScheme:()=>io,isSchemeInList:()=>yl,isValidUri:()=>kl,languageMapContent:()=>ii,mappingCSV:()=>Al,mappingRegistryIsStored:()=>Dl,mappingTypeByType:()=>Sl,mappingTypeByUri:()=>wr,mappingTypes:()=>mr,matchObjectTypes:()=>Ol,merge:()=>lo,mergeUris:()=>uo,minifyMapping:()=>vl,normalize:()=>ri,notation:()=>Tl,objectTypes:()=>gr,prefLabel:()=>Ft,sortConcepts:()=>_l,sortSchemes:()=>bl,usedObjectTypes:()=>no,userOwnsMapping:()=>Il});var mr=[{RELEVANCE:"very high",broader:[{uri:"http://www.w3.org/2004/02/skos/core#closeMatch"}],definition:{de:["gleiche Bedeutung"],en:["same meaning"]},notation:["="],prefLabel:{ar:"\u062A\u0637\u0627\u0628\u0642 \u062A\u0627\u0645",be:"\u0434\u0430\u043A\u043B\u0430\u0434\u043D\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u0446\u044C","be-tarask":"\u0434\u0430\u043A\u043B\u0430\u0434\u043D\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",bn:"\u09B9\u09C1\u09AC\u09C1\u09B9\u09C1 \u09AE\u09BF\u09B2",bs:"ta\u010Dno podudaranje",ca:"equival\xE8ncia exacta",cs:"p\u0159esn\xE1 shoda",da:"exact match",de:"exakte \xDCbereinstimmung",el:"\u03B1\u03BA\u03C1\u03B9\u03B2\u03AE\u03C2 \u03B1\u03BD\u03C4\u03B9\u03C3\u03C4\u03BF\u03B9\u03C7\u03AF\u03B1",en:"exact match",eo:"ekzakta ekvivalento",es:"equivalencia exacta",et:"t\xE4pne vaste",fi:"vastaava k\xE4site",fr:"\xE9quivalence exacte",ga:"meaitse\xE1il chruinn",gl:"correspondencia exacta",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05DE\u05D3\u05D5\u05D9\u05E7\u05EA",hu:"pontos egyez\xE9s",id:"sama persis",it:"corrispondenza esatta",ja:"\u5B8C\u5168\u4E00\u81F4",lv:"tie\u0161a sakrit\u012Bba",mk:"\u0442\u043E\u0447\u043D\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",ms:"padanan tepat","ms-arab":"\u06A4\u0627\u062F\u0646\u0646 \u062A\u06A4\u062A",nb:"eksakt samsvar",nl:"exacte match",nn:"eksakt samsvar",pl:"dok\u0142adne dopasowanie",pt:"correspond\xEAncia exata",ro:"echivalentul exact",ru:"\u0442\u043E\u0447\u043D\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"natan\u010Dno ujemanje",sq:"p\xEBrputhje e p\xEBrpikt\xEB",sr:"\u0442\u0430\u0447\u043D\u043E \u043F\u043E\u0434\u0443\u0434\u0430\u0440\u0430\u045A\u0435",sv:"exakt tr\xE4ff",tr:"tam e\u015Fle\u015Fme",uk:"\u0442\u043E\u0447\u043D\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0456\u0441\u0442\u044C",ur:"\u0628\u0627\u0644\u06A9\u0644 \u062F\u0631\u0633\u062A \u062C\u0648\u0691",zh:"\u7CBE\u78BA\u5339\u914D","zh-cn":"\u7CBE\u786E\u5339\u914D","zh-hans":"\u7CBE\u786E\u5339\u914D","zh-hant":"\u7CBE\u78BA\u5339\u914D"},SHORT:"exact",uri:"http://www.w3.org/2004/02/skos/core#exactMatch"},{RELEVANCE:"high",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{de:["in etwa gleiche Bedeutung"],en:["same general idea but not fully identical meaning"]},notation:["\u2248"],prefLabel:{ar:"\u062A\u0637\u0627\u0628\u0642 \u0642\u0631\u064A\u0628","be-tarask":"\u0431\u043B\u0456\u0437\u043A\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"equival\xE8ncia inexacta",de:"hohe \xDCbereinstimmung",el:"\u03C3\u03C4\u03B5\u03BD\u03AE \u03B1\u03BD\u03C4\u03B9\u03C3\u03C4\u03BF\u03B9\u03C7\u03AF\u03B1",en:"close match",eo:"proksima kongrua\u0135o",es:"equivalencia inexacta",fi:"l\xE4hes vastaava k\xE4site",fr:"quasi-\xE9quivalence",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E7\u05E8\u05D5\u05D1\u05D4",hu:"kv\xE1zi-egyen\xE9rt\xE9k\u0171s\xE9g",it:"corrispondenza parziale",ja:"\u985E\u4F3C\u4E00\u81F4",mk:"\u0431\u043B\u0438\u0441\u043A\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",ms:"padanan dekat","ms-arab":"\u06A4\u0627\u062F\u0646\u0646 \u062F\u06A9\u062A",nb:"n\xE6rt samsvar",nl:"nabije match",nn:"n\xE6rt samsvar",pl:"cz\u0119\u015Bciowe dopasowanie",pt:"correspond\xEAncia pr\xF3xima",ru:"\u0431\u043B\u0438\u0437\u043A\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"visoko ujemanje",sr:"\u0431\u043B\u0438\u0441\u043A\u043E \u043F\u043E\u043A\u043B\u0430\u043F\u0430\u045A\u0435",sv:"n\xE4ra matchning",tr:"yak\u0131n e\u015Fle\u015Fme","zh-hans":"\u9AD8\u5EA6\u5339\u914D"},SHORT:"close",uri:"http://www.w3.org/2004/02/skos/core#closeMatch"},{RELEVANCE:"medium",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{de:["umfassendere Bedeutung"],en:["broader meaning"]},notation:[">"],prefLabel:{"be-tarask":"\u0448\u044B\u0440\u043E\u043A\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"relaci\xF3 llunyana",cs:"\u0161ir\u0161\xED koncept",de:"allgemeinere Bedeutung",en:"broad match",eo:"malstrikta kongruo",et:"laiem vaste",fi:"vastaava laajempi k\xE4site",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E8\u05D7\u05D1\u05D4",hu:"t\xE1gabb jelent\xE9s",it:"corrispondenza con termine pi\xF9 generico",ja:"\u5E83\u7FA9\u4E00\u81F4",mk:"\u043F\u043E\u0448\u0438\u0440\u043E\u043A\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",nb:"bredere samsvar",nl:"brede match",nn:"breitt samsvar",pl:"dopasowanie poj\u0119cia o szerszym znaczeniu","pt-br":"correspond\xEAncia gen\xE9rica",ru:"\u0431\u043E\u043B\u0435\u0435 \u0448\u0438\u0440\u043E\u043A\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"splo\u0161ni pomen",sr:"\u0443 \u0448\u0438\u0440\u0435\u043C \u0441\u043C\u0438\u0441\u043B\u0443",sv:"bred tr\xE4ff",uk:"\u0448\u0438\u0440\u0448\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0456\u0441\u0442\u044C",vi:"\u0111\u1ED1i s\xE1nh r\u1ED9ng","zh-hans":"\u5E7F\u6CDB\u5339\u914D"},related:[{uri:"http://www.w3.org/2004/02/skos/core#narrowMatch"}],SHORT:"broad",uri:"http://www.w3.org/2004/02/skos/core#broadMatch"},{RELEVANCE:"medium",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{en:["more specific meaning"]},notation:["<"],prefLabel:{"be-tarask":"\u0432\u0443\u0437\u043A\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"relaci\xF3 estreta",de:"spezifischere Bedeutung",en:"narrow match",eo:"strikta kongruo",et:"kitsam vaste",fi:"vastaava suppeampi k\xE4site",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E6\u05E8\u05D4",hu:"sz\u0171kebb jelent\xE9s",it:"corrispondenza con termine pi\xF9 specifico",ja:"\u72ED\u7FA9\u4E00\u81F4",mk:"\u043F\u043E\u0442\u0435\u0441\u043D\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",nb:"smalere samsvar",nl:"nauwe match",nn:"snevert samsvar",pl:"dopasowanie poj\u0119cia o w\u0119\u017Cszym znaczeniu","pt-br":"correspond\xEAncia aproximada",ru:"\u0431\u043E\u043B\u0435\u0435 \u0443\u0437\u043A\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"ozki pomen",sr:"\u0443 \u0443\u0436\u0435\u043C \u0441\u043C\u0438\u0441\u043B\u0443",sv:"smal tr\xE4ff",ur:"\u0646\u06CC\u0631\u0648 \u0645\u06CC\u0686",vi:"\u0111\u1ED1i s\xE1nh h\u1EB9p","zh-hans":"\u6709\u9650\u5339\u914D"},related:[{uri:"http://www.w3.org/2004/02/skos/core#broadMatch"}],SHORT:"narrow",uri:"http://www.w3.org/2004/02/skos/core#narrowMatch"},{RELEVANCE:"low",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{de:["assoziative Verkn\xFCpfung unterschiedlicher Bedeutungen"],en:["associative link between meanings"]},notation:["~"],prefLabel:{"be-tarask":"\u0437\u044C\u0432\u044F\u0437\u0430\u043D\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"parella relacionada",de:"verwandte Bedeutung",en:"related match",eo:"rilata kongruo",fi:"liittyv\xE4 k\xE4site",fr:"association",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E7\u05E9\u05D5\u05E8\u05D4",hu:"rokon jelent\xE9s",it:"corrispondenza correlata",ja:"\u95A2\u9023\u4E00\u81F4",lv:"saist\u012Bta sakrit\u012Bba",mk:"\u043F\u043E\u0432\u0440\u0437\u0430\u043D\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",ms:"padanan berkaitan","ms-arab":"\u06A4\u0627\u062F\u0646\u0646 \u0628\u0631\u06A9\u0627\u0621\u064A\u062A\u0646",nb:"relatert samsvar",nl:"gerelateerde match",pl:"dopasowanie poj\u0119cia o powi\u0105zanym znaczeniu",ru:"\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0442\u0438\u0432\u043D\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"povezano ujemanje",tr:"ili\u015Fkili benze\u015Fme",uk:"\u043F\u043E\u0432\u2019\u044F\u0437\u044C",ur:"\u0645\u062A\u0639\u0644\u0642\u06C1 \u0645\u06CC\u0686",vec:"parente\u0142a re\u0142asionada","zh-hans":"\u5173\u8054\u5339\u914D"},SHORT:"related",uri:"http://www.w3.org/2004/02/skos/core#relatedMatch"},{RELEVANCE:"generic",definition:{de:["unbekannter Bedeutungszusammenhang"],en:["unknown type of link between meanings"]},notation:["\u2192"],prefLabel:{ar:"\u0646\u0648\u0639 \u0639\u0644\u0627\u0642\u0629 \u0627\u0644\u062A\u0637\u0628\u064A\u0642",be:"\u0445\u0430\u0440\u0430\u043A\u0442\u044D\u0440\u043D\u0430\u044F \u0430\u0434\u043D\u043E\u0441\u0456\u043D\u0430 \u0430\u0434\u043B\u044E\u0441\u0442\u0440\u0430\u0432\u0430\u043D\u043D\u044F","be-tarask":"\u0445\u0430\u0440\u0430\u043A\u0442\u044D\u0440\u043D\u0430\u044F \u0430\u0434\u043D\u043E\u0441\u0456\u043D\u0430 \u0430\u0434\u043B\u044E\u0441\u0442\u0440\u0430\u0432\u0430\u043D\u044C\u043D\u044F",ca:"relaci\xF3 de mapatge",de:"allgemeine Mapping-Relation",en:"SKOS generic mapping relation",fi:"SKOS-kartoitussuhde",fr:"lien de correspondance SKOS",he:"\u05D9\u05D7\u05E1 \u05DE\u05D9\u05E4\u05D5\u05D9 \u05DB\u05DC\u05DC\u05D9",id:"relasi pemetaan",ja:"SKOS\u4E00\u822C\u30DE\u30C3\u30D4\u30F3\u30B0\u95A2\u4FC2",mk:"\u043F\u0440\u0435\u0441\u043B\u0438\u043A\u0443\u0432\u0430\u0447\u043A\u0438 \u043E\u0434\u043D\u043E\u0441",nb:"SKOS generisk mappingrelasjon","pt-br":"rela\xE7\xE3o gen\xE9rica de mapeamento",sl:"splo\u0161na relacija kartiranja SKOS",sr:"\u0440\u0435\u043B\u0430\u0446\u0438\u0458\u0430 \u043C\u0430\u043F\u0438\u0440\u0430\u045A\u0430",sv:"mappnings relation",zh:"\u6620\u5C04\u95DC\u4FC2","zh-hant":"\u6620\u5C04\u95DC\u4FC2"},SHORT:"",uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}];var gr={Concept:{type:["http://www.w3.org/2004/02/skos/core#Concept"]},ConceptScheme:{type:["http://www.w3.org/2004/02/skos/core#ConceptScheme"]},ConceptMapping:{type:mr.map(t=>t.uri)},ConceptOccurrence:{},Registry:{type:["http://www.w3.org/ns/dcat#Catalog","http://purl.org/cld/cdtype/CatalogueOrIndex"]},Distribution:{type:["http://www.w3.org/ns/dcat#Distribution"]},Service:{type:["http://www.w3.org/ns/dcat#DataService"]},Dataset:{type:["http://www.w3.org/ns/dcat#Dataset"]},Concordance:{type:["http://rdf-vocabulary.ddialliance.org/xkos#Correspondence","http://rdfs.org/ns/void#Linkset","http://purl.org/spar/fabio/VocabularyMapping"]},Resource:{},Item:{},ConceptBundle:{},Annotation:{type:["Annotation","http://www.w3.org/ns/oa#Annotation"]}},qr=Object.keys(gr).reduce((t,e)=>{for(let r of gr[e].type||[])t[r]=e;return t},{});function Vr(t,e=!1){let r;if(typeof t=="string"&&t)t in qr?r=qr[t]:(t=t.toLowerCase().replace(/s$/,""),r=Object.keys(gr).find(n=>{let i=n.toLowerCase();if(i===t||i==="concept"+t)return!0}));else if(typeof t=="object"&&t.type){let n=Array.isArray(t.type)?t.type:[t.type];for(let i of n)if(i in qr){r=qr[i];break}}return e&&r?r.toLowerCase().replace(/^concept(.+)/,"$1"):r}function no(t){var n;let e=[],r={concepts:"http://www.w3.org/2004/02/skos/core#Concept",schemes:"http://www.w3.org/2004/02/skos/core#ConceptScheme",mappings:"http://www.w3.org/2004/02/skos/core#mappingRelation",concordances:"http://rdf-vocabulary.ddialliance.org/xkos#Correspondence",registries:"http://www.w3.org/ns/dcat#Catalog",types:"http://www.w3.org/2002/07/owl#Class",properties:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",annotations:"http://www.w3.org/ns/oa#Annotation"};for(let i in r)(n=t[i])!=null&&n.find(s=>s!==null)&&e.push(r[i]);return e.sort()}var cl=t=>/^[A-Z]*$/.test(t),Nt=(t,e)=>e.split(".").reduce((r,n)=>r&&r[n]?r[n]:null,t),fl=t=>((t instanceof Array?t:[t]).forEach(r=>{r["@context"]="https://gbv.github.io/jskos/context.json"}),t),ni=t=>(Object.keys(t).forEach(e=>{cl(e)||e.startsWith("_")?delete t[e]:t[e]!=null&&typeof t[e]=="object"&&(t[e]=ni(t[e]))}),t),hl=ni,Jr=(t,e=[],r=!0)=>{e=e.concat(["ancestors","narrower","broader","mappings","memberList","TOPCONCEPTS","MAPPINGS","PROVIDER"]);let n=Array.isArray(t)?[]:{};for(let i in t)if(!(r&&i[0]=="_")){if(e.includes(i))if(t[i]&&Array.isArray(t[i])){t[i].length>0?n[i]=[null]:n[i]=[];continue}else{n[i]=null;continue}if(i=="inScheme"){let s=[];for(let o of t.inScheme){let a={uri:o.uri};o.notation&&(a.notation=o.notation),o.prefLabel&&(a.prefLabel=o.prefLabel),s.push(a)}n.inScheme=s;continue}t[i]!=null&&typeof t[i]=="object"?n[i]=Jr(t[i]):n[i]=t[i]}return n},pl=Jr,ti=t=>t?(t.uri?[t.uri]:[]).concat(t.identifier||[]).filter(Boolean):[],it=(t,e)=>{if(t==null&&e==null)return!0;let r=i=>i.replace("https://","http://"),n=ti(t).map(r);for(let i of ti(e).map(r))if(n.indexOf(i)!==-1)return!0;return!1},dl=it,ml=it,gl=it,wl=t=>{var e;return((e=te(t,"type",[]))==null?void 0:e.includes("http://www.w3.org/2004/02/skos/core#Concept"))||te(t,"inScheme")!=null||te(t,"topConceptOf")!=null},io=t=>{var e;return(e=te(t,"type",[]))==null?void 0:e.includes("http://www.w3.org/2004/02/skos/core#ConceptScheme")},so=(t,e)=>{if(!t||!e)return!1;for(let r of e)if(it(t,r))return!0;return!1},yl=so,_l=(t,e=!1)=>t.sort((r,n)=>{let i=te(r,"notation[0]"),s=te(n,"notation[0]");if(i&&s&&(i=i.toLowerCase(),s=s.toLowerCase()),e&&i&&s){let o,a;if(o=parseFloat(i),a=parseFloat(s),!o&&!a){let u=`${i}`.split(/[^\w\d]/),l=`${s}`.split(/[^\w\d]/);for(let c=0;c<Math.min(u.length,l.length);c+=1)if(u[c]!==l[c]){o=parseFloat(u[c])||u[c],a=parseFloat(l[c])||l[c];break}!o&&!a&&(o=i,a=s)}i=o,s=a}if((!i||!s||i==s)&&(i=r.uri,s=n.uri),i&&s){if(i>s)return 1;if(i<s)return-1}return 0}),bl=t=>{let e=["notation[0]",["prefLabel.de","prefLabel.en"],"uri"];return t.sort((r,n)=>{for(let i of e){let s,o;if(Array.isArray(i))for(let a of i)s=s||te(r,a),o=o||te(n,a);else s=te(r,i),o=te(n,i);if(s!=null&&o!=null){if(s=s.toLowerCase(),o=o.toLowerCase(),s>o)return 1;if(s<o)return-1}}return 0})},vl=t=>{let e=Mt(Jr(t),["from","to","fromScheme","toScheme","creator","contributor","type","created","modified","note","identifier","uri","partOf","mappingRelevance"]);for(let r of[e.from,e.to])pr(r,(n,i)=>{let s=[];for(let o of n)s.push(Mt(o,["uri","notation"]));r[i]=s});return e.fromScheme&&(e.fromScheme=Mt(e.fromScheme,["uri","notation"])),e.toScheme&&(e.toScheme=Mt(e.toScheme,["uri","notation"])),e.partOf&&(e.partOf=e.partOf.map(r=>Mt(r,["uri"]))),e},wr=function(t){for(let e of mr)if(t==e.uri)return e;return null},oo=wr("http://www.w3.org/2004/02/skos/core#mappingRelation"),Sl=function(t,e=oo){let r;return Array.isArray(t)&&t.length>0?r=t[0]:r=t,wr(r)||e},xl=(t,e={})=>{let{language:r}=e,n=Nt(t,"from.memberSet.0.notation.0"),i=Nt(t,"to.memberSet.0.notation.0");n=n!==null?n:"",i=i!==null?i:"";let s=wr(Nt(t,"type.0"));s=s?s.SHORT:"";let o=Ft(Nt(t,"from.memberSet.0"),{language:r,fallbackToUri:!1})||"",a=Ft(Nt(t,"to.memberSet.0"),{language:r,fallbackToUri:!1})||"",u=Ft(Nt(t,"creator.0"),{language:r,fallbackToUri:!1})||"";return{fromNotation:n,toNotation:i,fromLabel:o,toLabel:a,type:s,creator:u}},El=(t={})=>{let e=t.delimiter||",",r=t.quoteChar||'"',n=t.lineTerminator||`
|
|
16
|
-
`,i=r+r,s=o=>r+(o==null?"":o.split(r).join(i))+r;return o=>o.map(s).join(e)+n},gt=(t,e)=>{let r=[];for(let n of["from","to"])(e==null||n===e)&&(r=r.concat(te(t,`${n}.memberSet`)||te(t,`${n}.memberChoice`)||te(t,`${n}.memberList`)||[]));return r.filter(n=>n!=null)},Al=(t={})=>{let e=El(t),r=t.language||"en";t.type==null&&(t.type=!0);let n=o=>{o=o||[];let a=[];for(let u of["from","to"]){t.schemes&&a.push(`${u}Scheme`);let l=Math.max(...o.map(c=>gt(c,u).length),1);for(let c=0;c<l;c+=1)a.push(`${u}Notation${c?c+1:""}`),t.labels&&a.push(`${u}Label${c?c+1:""}`)}return t.type&&a.push("type"),t.creator&&a.push("creator"),e(a)},i=(o,a={})=>{let u=[];for(let l of["from","to"]){t.schemes&&u.push(te(o,`${l}Scheme.notation[0]`,""));let c=gt(o,l),p=a[`${l}Count`];p==null&&(p=c.length),p=Math.max(p,1);for(let m=0;m<p;m+=1)u.push(te(c[m],"notation[0]","")),t.labels&&u.push(Ft(c[m],{language:r,fallbackToUri:!1}))}return t.type&&u.push(te(wr(te(o,"type[0]")),"SHORT","")),t.creator&&u.push(Ft(te(o,"creator[0]"),{language:r,fallbackToUri:!1})),e(u)};return{header:n,fromMapping:i,fromMappings:(o,a={header:!0})=>{let u="";a.header&&(u+=n(o));let l={fromCount:Math.max(...o.map(c=>gt(c,"from").length)),toCount:Math.max(...o.map(c=>gt(c,"to").length))};for(let c of o)u+=i(c,l);return u}}};function Cl(t,e){return Dt(t,e,(r,n,i)=>{let s={[i]:r},o={[i]:n};if(i=="from"||i=="to")return Dt(Object.getOwnPropertyNames(te(r,i,{})),Object.getOwnPropertyNames(te(n,i,{})))?Dt(gt(s,i),gt(o,i),(a,u,l)=>{if(l!=null)return it(a,u)}):!1;if(i=="fromScheme"||i=="toScheme")return it(r,n)})}var Ol=(t,e)=>{let r=Vr(t),n=Vr(e);return!(r&&n&&r!=n)},ao=t=>{Array.isArray(t)&&t.sort((e,r)=>e===null?1:r===null?-1:0)},uo=(t,e)=>(!t||!e||((Array.isArray(t.identifier)||Array.isArray(e.identifier))&&(t.identifier=Hs(t.identifier||[],e.identifier||[])),!t.uri&&e.uri&&(t.uri=e.uri),t.uri&&e.uri&&t.uri!=e.uri&&!(t.identifier||[]).includes(e.uri)&&(t.identifier=(t.identifier||[]).concat([e.uri])),Array.isArray(t.identifier)&&t.uri&&(t.identifier=t.identifier.filter(r=>r!==t.uri)),(t.identifier||[]).length==0&&delete t.identifier,ao(t.identifier)),t),lo=(t,e,r)=>{if(!t||!e)return t||e;r=r||{};let n=r._path||"",i=r.detectMismatch||[],s=r.skipPaths||[],o={};return pr(t,(a,u)=>{if(!s.includes(n+u))if(Array.isArray(a)&&Array.isArray(e[u]))o[u]=qs(a,e[u],(l,c)=>Lt(l)&&Lt(c)?it(l,c):l===c),ao(o[u]);else if(Lt(a)&&Lt(e[u]))o[u]=lo(a,e[u],Object.assign({_path:`${n}${u}.`},r));else{if(a&&e[u]&&i.includes(n+u)&&!Dt(a,e[u]))throw new Error("Property mismatch in "+n+u);o[u]=a}}),pr(e,(a,u)=>{t[u]||(o[u]=a)}),n==""&&Vs(o,s),r.mergeUris&&uo(o,e),o},ri=t=>Array.isArray(t)?t.map(e=>ri(e)):Lt(t)?(pr(t,(e,r)=>{t[r]=ri(e)}),t):dr(t)?t.normalize():t,kl=t=>{let e=/^[A-Za-z][A-Za-z0-9+\-.]*:(?:\/\/(?:(?:[A-Za-z0-9\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\.[A-Za-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*)(?::[0-9]*)?(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|\/(?:(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?|(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|)(?:\?(?:[A-Za-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?(?:#(?:[A-Za-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?$/;return t.match(e)!==null},Rl={mappingsByConcepts:(t,e,r)=>{let n=["memberSet","memberList","memberChoice"],i,s;for(let o of n)i=i||te(t,r+"."+o+"[0].notation[0]"),s=s||te(e,r+"."+o+"[0].notation[0]");return i==null||i<s?-1:s==null||i>s?1:0}},Il=(t,e)=>!t||!e?!1:[t.uri].concat(Object.values(t.identities||{}).map(r=>r.uri)).filter(r=>r!=null).includes(te(e,"creator[0].uri"));function Tl(t,e){let r;if(t&&t.notation&&t.notation.length)r=t.notation[0],(io(t)||e=="scheme")&&(r=r.toUpperCase());else if(t&&t.inScheme&&t.inScheme[0]&&t.uri)try{r=new $r(t&&t.inScheme&&t.inScheme[0]).notationFromUri(t.uri)}catch(n){}return r||""}function ii(t,e,{language:r}={}){let n=t&&e?t[e]:t;return n&&(n[r]||(r=Hr.selectLanguage(n),r))?n[r]:null}function Ft(t,e={}){e=e||{};let r=e.fallbackToUri==null?!0:e.fallbackToUri;return te(t,`prefLabel.${e.language}`)||ii(t,"prefLabel",e)||(r&&t&&t.uri?t.uri:"")}function Pl(t,e={}){e=e||{};let r=te(t,`definition.${e.language}`)||ii(t,"definition",e)||[];return dr(r)&&(r=[r]),r}function Dl(t){return te(t,"stored",te(t,"constructor.stored",te(t,"provider.constructor.stored",!1)))}function Ml(t){return dr(t.creator)?t.creator:t.creator&&t.creator.id}function Ll(t){return te(t,"creator.name")||""}function Nl(t,e){return!!(t&&dr(t.creator)?e&&e.includes(t.creator):e&&t.creator&&e.includes(t.creator.id))}function Fl(t,e){return e.filter(({notationPattern:r})=>(r||".+")===".+"?!1:RegExp("^("+r+")$").test(t))}var P=F(I(I({},ei),si),{ConceptScheme:$r,languagePreference:Hr});var ui={};pt(ui,{concatUrl:()=>Ue,deepEqual:()=>Re,listOfCapabilities:()=>ai,requestMethods:()=>oi,withCustomProps:()=>wt});var oi=[{method:"getRegistries",fallback:[],type:"Registries"},{method:"getSchemes",fallback:[],type:"Schemes"},{method:"vocSearch",fallback:[],type:"Schemes"},{method:"getTypes",fallback:[],type:"Types"},{method:"suggest",fallback:["",[],[],[]]},{method:"vocSuggest",fallback:["",[],[],[]]},{method:"getConcordances",fallback:[],type:"Concordances"},{method:"getOccurrences",fallback:[],type:"Occurrences"},{method:"getTop",fallback:[],type:"Concepts"},{method:"getConcepts",fallback:[],type:"Concepts"},{method:"getNarrower",fallback:[],type:"Concepts"},{method:"getAncestors",fallback:[],type:"Concepts"},{method:"search",fallback:[],type:"Concepts"},{method:"getMapping",fallback:null,type:"Mapping"},{method:"getMappings",fallback:[],type:"Mappings"},{method:"postMapping",fallback:null,type:"Mapping"},{method:"postMappings",fallback:[],type:"Mapping"},{method:"putMapping",fallback:null,type:"Mapping"},{method:"patchMapping",fallback:null,type:"Mapping"},{method:"deleteMapping",fallback:!1},{method:"deleteMappings",fallback:[]},{method:"getAnnotations",fallback:[],type:"Annotations"},{method:"postAnnotation",fallback:null,type:"Annotation"},{method:"putAnnotation",fallback:null,type:"Annotation"},{method:"patchAnnotation",fallback:null,type:"Annotation"},{method:"deleteAnnotation",fallback:!1}];function Ue(...t){let[e,...r]=t;for(let n of r)e.endsWith("/")||(e+="/"),n.startsWith("/")&&(n=n.slice(1)),e+=n;return e}function wt(t,e){return t._totalCount=e._totalCount,t._url=e._url,t}var ai=["schemes","top","data","concepts","narrower","ancestors","types","suggest","search","auth","mappings","concordances","annotations","occurrences"],Re=(t,e)=>{if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null)return!1;if(Object.keys(t).length===Object.keys(e).length){for(let r in t)if(!(r in e)||!Re(t[r],e[r]))return!1;return!0}return!1};var Ht={};pt(Ht,{BaseProvider:()=>G,ConceptApiProvider:()=>Te,LabelSearchSuggestionProvider:()=>We,LobidApiProvider:()=>Ye,LocApiProvider:()=>qe,LocalMappingsProvider:()=>st,MappingsApiProvider:()=>Ie,ModApiProvider:()=>Xe,MyCoReProvider:()=>Qe,NoTApiProvider:()=>Ze,OccurrencesApiProvider:()=>$e,OlsApiProvider:()=>Ge,ReconciliationApiProvider:()=>je,SkohubProvider:()=>Je,SkosmosApiProvider:()=>He});var li=t=>t.reduce((e,r)=>e.filter(n=>r.includes(n))),G=class{constructor(e={}){var n,i;this._jskos=e,this.axios=pe.create({timeout:2e5}),this._path=typeof window!="undefined"&&window.location.pathname,this.has={},(n=this.constructor)!=null&&n.supports&&(this.has=Object.assign({},(i=this.constructor)==null?void 0:i.supports)),ai.filter(s=>!this.has[s]).forEach(s=>{this.has[s]=!1}),this._defaultLanguages="en,de,fr,es,nl,it,fi,pl,ru,cs,jp".split(","),this.languages=[],this._auth={key:null,bearerToken:null},this._repeating=[],this._api={status:e.status,schemes:Array.isArray(e.schemes)?void 0:e.schemes,top:e.top,data:e.data,concepts:e.concepts,narrower:e.narrower,ancestors:e.ancestors,types:e.types,suggest:e.suggest,search:e.search,"voc-suggest":e["voc-suggest"],"voc-search":e["voc-search"],mappings:e.mappings,concordances:e.concordances,annotations:e.annotations,occurrences:e.occurrences,reconcile:e.reconcile,api:e.endpoint||e.api},this._config={},this.setRetryConfig(),this.axios.interceptors.request.use((s={})=>{var o,a,u;if(s._skipAdditionalParameters||(s.params||(s.params={}),s.params.language=[...new Set([].concat(((o=s.params.language)!=null?o:"").split(","),this.languages,this._defaultLanguages).filter(Boolean))].join(","),this.has.auth&&this._auth.bearerToken&&!((a=s==null?void 0:s.headers)!=null&&a.Authorization)&&(s.headers||(s.headers={}),s.headers.Authorization=`Bearer ${this._auth.bearerToken}`)),(u=s.url)!=null&&u.startsWith("http:")&&typeof window!="undefined"&&window.location.protocol=="https:")throw new pe.Cancel("Can't call http API from https.");return s}),this.axios.interceptors.response.use(({data:s,headers:o={},config:a={}})=>{s=P.normalize(s);let u=a.url;if(u.endsWith("?")||(u+="?"),u+=new URLSearchParams(a.params||{}).toString(),typeof s=="object"){let l=parseInt(o["x-total-count"]);isNaN(l)||(s._totalCount=l),s._url=u}return s},s=>{var l,c;let o=(l=s.config._retryCount)!=null?l:0,a=s.config.method,u=(c=s.response)==null?void 0:c.status;return this._retryConfig.methods.includes(a)&&this._retryConfig.statusCodes.includes(u)&&o<this._retryConfig.count?(s.config._retryCount=o+1,s.config.data&&(s.config.data=JSON.parse(s.config.data)),new Promise((p,m)=>{setTimeout(()=>{this.axios(s.config).then(p).catch(m)},(()=>{let g=this._retryConfig.delay;return typeof g=="function"?g(o):g})())})):Promise.reject(s)});let r=[];for(let{method:s,type:o}of oi){let a=this[s]&&this[s].bind(this);if(!a){this[s]=()=>{throw new Qt({method:s})};continue}this[s]=(u={})=>{if(u._raw)return delete u._raw,a(u);let l=r.find(y=>y.method==s&&Re(y.options,u));if(l)return l.promise;let c;u.cancelToken||(c=this.getCancelTokenSource(),u.cancelToken=c.token);let p=this.init().then(()=>a(u)).then(y=>(typeof y=="object"&&y._totalCount===void 0&&(y._totalCount=Array.isArray(y)?y.length:1),y&&o&&this[`adjust${o}`]&&(y=this[`adjust${o}`](y)),y)).catch(y=>{throw y instanceof me?y:y.response?y.response.status.toString().startsWith(4)?new Ne({relatedError:y,code:y.response.status}):new Zt({relatedError:y,code:y.response.status}):y.request?typeof navigator!="undefined"&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection)?new er({relatedError:y}):new tr({relatedError:y}):(console.error(y),new me({relatedError:y}))});c&&(p.cancel=(...y)=>c.cancel(...y));let d=u,{cancelToken:m}=d,g=W(d,["cancelToken"]),f={method:s,options:g,promise:p};return r.push(f),p.catch(()=>{}).then(()=>r.splice(r.indexOf(f),1)),p}}}get uri(){return this._jskos.uri}get notation(){return this._jskos.notation}get prefLabel(){return this._jskos.prefLabel}get definition(){return this._jskos.definition}get schemes(){return this._jskos.schemes}get excludedSchemes(){return this._jskos.excludedSchemes}get stored(){return this._jskos.stored!==void 0?this._jskos.stored:this.constructor.stored}init(){return E(this,null,function*(){return this._init?this._init:(this._init=E(this,null,function*(){var r;this._prepare();let e;if(typeof this._api.status=="string")try{e=yield this.axios({method:"get",url:this._api.status})}catch(n){((r=n==null?void 0:n.response)==null?void 0:r.status)===404&&(this._api.status=null)}else e=this._api.status;if(typeof e=="object"&&Object.keys(e).length){this._config=e.config||{};for(let n of Object.keys(this._api))this._api[n]===void 0&&(this._api[n]=e[n]||null)}this._setup()}),this._init)})}_prepare(){}_setup(){}getCancelTokenSource(){return pe.CancelToken.source()}setAuth({key:e=this._auth.key,bearerToken:r=this._auth.bearerToken}){this._auth.key=e,this._auth.bearerToken=r}setRetryConfig(e={}){this._retryConfig=Object.assign({methods:["get","head","options"],statusCodes:[401,403],count:3,delay:r=>300*r},e)}suggest(e){return E(this,null,function*(){e._raw=!0;let r=yield this.search(e),n=[e.search,[],[],[]];for(let i of r){let s=P.notation(i),o=P.prefLabel(i);n[1].push((s?s+" ":"")+o),n[2].push(""),n[3].push(i.uri)}return r._totalCount!=null?n._totalCount=r._totalCount:n._totalCount=r.length,n})}isAuthorizedFor({type:e,action:r,user:n,crossUser:i}){var a,u,l,c;if(r=="read"&&this.has[e]===!0)return!0;if(!this.has[e])return!1;let s=(u=(a=this._config)==null?void 0:a[e])==null?void 0:u[r];if(!s)return!!this.has[e][r];if(s.auth&&(!n||!this._auth.key)||s.auth&&this._auth.key!=((c=(l=this._config)==null?void 0:l.auth)==null?void 0:c.key))return!1;let o=[n==null?void 0:n.uri].concat(Object.values((n==null?void 0:n.identities)||{}).map(p=>p.uri)).filter(Boolean);if(s.auth&&s.identities&&li(o,s.identities).length==0)return!1;if(s.auth&&s.identityProviders){let p=Object.keys((n==null?void 0:n.identities)||{});if(li(p,s.identityProviders).length==0)return!1}return i?s.crossUser===!0||li(s.crossUser||[],o).length>0:!!this.has[e][r]}supportsScheme(e){if(!e)return!1;let r=Array.isArray(this.schemes)?this.schemes:null;return r==null&&!P.isContainedIn(e,this.excludedSchemes||[])?!0:P.isContainedIn(e,r)}adjustConcept(e){if(!e||e.__SAVED__)return e;e._getNarrower=r=>this.getNarrower(F(I({},r),{concept:e})),e._getAncestors=r=>this.getAncestors(F(I({},r),{concept:e})),e._getDetails=r=>E(this,null,function*(){return(yield this.getConcepts(F(I({},r),{concepts:[e]})))[0]});for(let r of["broader","narrower","ancestors"])Array.isArray(e[r])&&e[r].length&&!e[r].includes(null)&&(e[r]=this.adjustConcepts(e[r]));return e._registry=this,e}adjustConcepts(e){return wt(e.map(r=>this.adjustConcept(r)),e)}adjustRegistries(e){return e}adjustScheme(e){if(!e||e.__SAVED__)return e;let r=e._registry;return e._registry=this.cdk&&this.cdk.registryForScheme(e),!e._registry||r===e._registry||e._registry._api.api===this._api.api?e._registry=r||this:["concepts","topConcepts"].forEach(n=>{Array.isArray(e[n])&&(e[n].length===0||e[n][0]===null)&&delete e[n]}),e._registry&&(e._getTop=n=>e._registry.getTop(F(I({},n),{scheme:e})),e._getTypes=n=>e._registry.getTypes(F(I({},n),{scheme:e})),e._suggest=s=>{var o=s,{search:n}=o,i=W(o,["search"]);return e._registry.suggest(F(I({},i),{search:n,scheme:e}))}),e}adjustSchemes(e){return wt(e.map(r=>this.adjustScheme(r)),e)}adjustConcordances(e){for(let r of e)r._registry=this;return e}adjustMapping(e){var r,n,i,s,o;for(let a of["from","to"]){let u=`${a}Scheme`;e[u]||(e[u]=(s=(i=(n=(r=P.conceptsOfMapping(e,a))==null?void 0:r[0])==null?void 0:n.inScheme)==null?void 0:i[0])!=null?s:null)}if(e._registry=this,!e.identifier){let a=(o=P.addMappingIdentifiers(e))==null?void 0:o.identifier;a&&(e.identifier=a)}return e}adjustMappings(e){return wt(e.map(r=>this.adjustMapping(r)),e)}postMappings(){return E(this,arguments,function*(n={}){var i=n,{mappings:e}=i,r=W(i,["mappings"]);if(!e||!e.length)throw new U({parameter:"mappings"});return this._callHelperForArrayWrappers({method:"postMapping",items:e,itemProperty:"mapping",config:r})})}deleteMappings(){return E(this,arguments,function*(n={}){var i=n,{mappings:e}=i,r=W(i,["mappings"]);if(!e||!e.length)throw new U({parameter:"mappings"});return this._callHelperForArrayWrappers({method:"deleteMapping",items:e,itemProperty:"mapping",config:r})})}_callHelperForArrayWrappers(s){return E(this,arguments,function*({method:e,items:r,itemProperty:n,config:i}){let o=[],a=yield Promise.all(r.map(u=>E(this,null,function*(){try{return yield this[e](F(I({[n]:u},i),{_raw:!0}))}catch(l){return o[r.indexOf(u)]=l,null}})));return a._errors=o,a})}};ee(G,"providerName","Base");var ze=ns(fo(),1);var we=[];for(let t=0;t<256;++t)we.push((t+256).toString(16).slice(1));function ho(t,e=0){return(we[t[e+0]]+we[t[e+1]]+we[t[e+2]]+we[t[e+3]]+"-"+we[t[e+4]]+we[t[e+5]]+"-"+we[t[e+6]]+we[t[e+7]]+"-"+we[t[e+8]]+we[t[e+9]]+"-"+we[t[e+10]]+we[t[e+11]]+we[t[e+12]]+we[t[e+13]]+we[t[e+14]]+we[t[e+15]]).toLowerCase()}var fi,Bl=new Uint8Array(16);function hi(){if(!fi){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");fi=crypto.getRandomValues.bind(crypto)}return fi(Bl)}var jl=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),pi={randomUUID:jl};function Ul(t,e,r){var i,s,o;t=t||{};let n=(o=(s=t.random)!=null?s:(i=t.rng)==null?void 0:i.call(t))!=null?o:hi();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[r+a]=n[a];return e}return ho(n)}function zl(t,e,r){return pi.randomUUID&&!e&&!t?pi.randomUUID():Ul(t,e,r)}var Kr=zl;var Yr="urn:uuid:",st=class extends G{static get supports(){return{mappings:{read:!0,create:!0,update:!0,delete:!0}}}_setup(){this.queue=[],this.localStorageKey="cocoda-mappings--"+this._path;let e="mappings",r=()=>ze.default.getItem(this.localStorageKey).then(n=>{n=n||[];let i=0;for(let s of n.filter(o=>!o.uri||!o.uri.startsWith(Yr)))s.uri&&(s.identifier||(s.identifier=[]),s.identifier.push(s.uri)),s.uri=`${Yr}${Kr()}`,i+=1;return i&&console.warn(`URIs added to ${i} local mappings.`),ze.default.setItem(this.localStorageKey,n)});ze.default.getItem(e).then(n=>{n&&console.warn(`Warning: There is old data in local storage (or IndexedDB, depending on the ) with the key "${e}". This data will not be used anymore. A manual export is necessary to get this data back.`)}),this.queue.push(r().catch(n=>{console.warn("Error when adding URIs to local mappings:",n)}))}isAuthorizedFor({type:e,action:r}){return e=="mappings"&&r!="anonymous"}_getMappingsQueue(){let e=this.queue.slice(-1)[0]||Promise.resolve();return new Promise(r=>{function n(){let o,a,u=new Promise((l,c)=>{o=l,a=c});return u.resolve=o,u.reject=a,u}let i=n(),s=()=>{i.resolve()};this.queue.push(i),e.then(()=>ze.default.getItem(this.localStorageKey)).then(o=>{r({mappings:o,done:s})})})}getMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(r._raw=!0,!e||!e.uri)throw new U({parameter:"mapping"});return(yield this.getMappings(F(I({},r),{uri:e.uri})))[0]})}getMappings(){return E(this,arguments,function*({from:e,fromScheme:r,to:n,toScheme:i,creator:s,type:o,partOf:a,offset:u,limit:l,direction:c,mode:p,identifier:m,uri:g}={}){let f={};return e&&(f.from=typeof e=="string"?e:e.uri),r&&(f.fromScheme=typeof r=="string"?{uri:r}:r),n&&(f.to=typeof n=="string"?n:n.uri),i&&(f.toScheme=typeof i=="string"?{uri:i}:i),s&&(f.creator=typeof s=="string"?s:P.prefLabel(s)),o&&(f.type=typeof o=="string"?o:o.uri),a&&(f.partOf=typeof a=="string"?a:a.uri),u&&(f.offset=u),l&&(f.limit=l),c&&(f.direction=c),p&&(f.mode=p),m&&(f.identifier=m),g&&(f.uri=g),this._getMappingsQueue().catch(d=>{throw new me({message:"Could not get mappings from local storage",relatedError:d})}).then(({mappings:d,done:y})=>{y();let k=(C,N)=>C.uri==N||N&&C.notation&&C.notation[0].toLowerCase()==N.toLowerCase();if((f.from||f.to)&&(d=d.filter(C=>{let N=P.conceptsOfMapping(C,"from").find(D=>k(D,f.from))!=null,L=P.conceptsOfMapping(C,"to").find(D=>k(D,f.from))!=null,S=P.conceptsOfMapping(C,"from").find(D=>k(D,f.to))!=null,O=P.conceptsOfMapping(C,"to").find(D=>k(D,f.to))!=null;return f.direction=="backward"?f.mode=="or"?f.from&&L||f.to&&S:(!f.from||L)&&(!f.to||S):f.direction=="both"?f.mode=="or"?f.from&&(N||L)||f.to&&(S||O):(!f.from||N)&&(!f.to||O)||(!f.from||L)&&(!f.to||S):f.mode=="or"?f.from&&N||f.to&&O:(!f.from||N)&&(!f.to||O)})),(f.fromScheme||f.toScheme)&&(d=d.filter(C=>{let N=P.compare(C.fromScheme,f.fromScheme),L=P.compare(C.toScheme,f.fromScheme),S=P.compare(C.fromScheme,f.toScheme),O=P.compare(C.toScheme,f.toScheme);return f.direction=="backward"?f.mode=="or"?f.fromScheme&&L||f.toScheme&&S:(!f.fromScheme||L)&&(!f.toScheme||S):f.direction=="both"?f.mode=="or"?f.fromScheme&&(N||L)||f.toScheme&&(S||O):(!f.fromScheme||N)&&(!f.toScheme||O)||(!f.fromScheme||L)&&(!f.toScheme||S):f.mode=="or"?f.fromScheme&&N||f.toScheme&&O:(!f.fromScheme||N)&&(!f.toScheme||O)})),f.creator){let C=f.creator.split("|");d=d.filter(N=>(N.creator&&N.creator.find(L=>C.includes(P.prefLabel(L))||C.includes(L.uri)))!=null)}f.type&&(d=d.filter(C=>(C.type||[P.defaultMappingType.uri]).includes(f.type))),f.partOf&&(d=d.filter(C=>C.partOf!=null&&C.partOf.find(N=>P.compare(N,{uri:f.partOf}))!=null)),f.identifier&&(d=d.filter(C=>f.identifier.split("|").map(N=>(C.identifier||[]).includes(N)||C.uri==N).reduce((N,L)=>N||L))),f.uri&&(d=d.filter(C=>C.uri==f.uri));let R=d.length;return d=d.sort((C,N)=>{let L=C.modified||C.created,S=N.modified||N.created;return S==null?-1:L==null?1:L>S?-1:1}),d=d.slice(f.offset||0),d=d.slice(0,f.limit),d._totalCount=R,d})})}postMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue();if((!e.uri||!e.uri.startsWith(Yr))&&(e.uri&&(e.identifier||(e.identifier=[]),e.identifier.push(e.uri)),e.uri=`${Yr}${Kr()}`),n.find(s=>s.uri==e.uri))throw i(),new U({parameter:"mapping",message:"Duplicate URI"});e.created||(e.created=new Date().toISOString()),e.modified||(e.modified=e.created),delete e.partOf,n.push(e),n=n.map(s=>P.minifyMapping(s));try{return yield ze.default.setItem(this.localStorageKey,n),i(),e}catch(s){throw i(),s}})}putMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue(),s=n.findIndex(o=>o.uri==e.uri);if(s==-1)throw i(),new U({parameter:"mapping",message:"Mapping not found"});e.created||(e.created=n[s].created),e.modified=new Date().toISOString(),delete e.partOf,n[s]=e,n=n.map(o=>P.minifyMapping(o));try{return yield ze.default.setItem(this.localStorageKey,n),i(),e}catch(o){throw i(),o}})}patchMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue(),s=n.findIndex(o=>o.uri==e.uri);if(s==-1)throw i(),new U({parameter:"mapping",message:"Mapping not found"});e.created||(e.created=n[s].created),e.modified=new Date().toISOString(),delete e.partOf,n[s]=Object.assign(n[s],e),n=n.map(o=>P.minifyMapping(o));try{return yield ze.default.setItem(this.localStorageKey,n),i(),e}catch(o){throw i(),o}})}deleteMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue();try{return n=n.filter(s=>s.uri!=e.uri),n=n.map(s=>P.minifyMapping(s)),yield ze.default.setItem(this.localStorageKey,n),i(),!0}catch(s){throw i(),s}})}};st.providerName="LocalMappings";st.stored=!0;var Ie=class extends G{_prepare(){this._api.api&&this._api.status===void 0&&(this._api.status=Ue(this._api.api,"/status"))}_setup(){var e,r,n,i,s,o,a,u,l,c,p,m,g,f,d,y,k,R,C,N,L,S,O,D,$,X,K,V,Z;if(this._api.api){let se={mappings:"/mappings",concordances:"/concordances",annotations:"/annotations"};for(let re of Object.keys(se))this._api[re]===void 0&&(this._api[re]=Ue(this._api.api,se[re]))}this.has.mappings=this._api.mappings?{}:!1,this.has.mappings&&(this.has.mappings.read=!!((n=(r=(e=this._config)==null?void 0:e.mappings)==null?void 0:r.read)==null||n),this.has.mappings.create=!!((s=(i=this._config)==null?void 0:i.mappings)!=null&&s.create),this.has.mappings.update=!!((a=(o=this._config)==null?void 0:o.mappings)!=null&&a.update),this.has.mappings.delete=!!((l=(u=this._config)==null?void 0:u.mappings)!=null&&l.delete),this.has.mappings.anonymous=!!((p=(c=this._config)==null?void 0:c.mappings)!=null&&p.anonymous)),this.has.concordances=this._api.concordances?{}:!1,this.has.concordances&&(this.has.concordances.read=!!((g=(m=this._config)==null?void 0:m.concordances)!=null&&g.read),this.has.concordances.create=!!((d=(f=this._config)==null?void 0:f.concordances)!=null&&d.create),this.has.concordances.update=!!((k=(y=this._config)==null?void 0:y.concordances)!=null&&k.update),this.has.concordances.delete=!!((C=(R=this._config)==null?void 0:R.concordances)!=null&&C.delete)),this.has.annotations=this._api.annotations?{}:!1,this.has.annotations&&(this.has.annotations.read=!!((L=(N=this._config)==null?void 0:N.annotations)!=null&&L.read),this.has.annotations.create=!!((O=(S=this._config)==null?void 0:S.annotations)!=null&&O.create),this.has.annotations.update=!!(($=(D=this._config)==null?void 0:D.annotations)!=null&&$.update),this.has.annotations.delete=!!((K=(X=this._config)==null?void 0:X.annotations)!=null&&K.delete)),this.has.auth=((Z=(V=this._config)==null?void 0:V.auth)==null?void 0:Z.key)!=null,this._defaultParams={properties:"annotations"}}getMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);var s;if(!e)throw new U({parameter:"mapping"});if(!e.uri||!e.uri.startsWith(this._api.mappings))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});try{return yield this.axios(F(I({},r),{url:e.uri,params:I(I({},this._defaultParams),r.params||{})}))}catch(o){if(((s=o==null?void 0:o.response)==null?void 0:s.status)==404)return null;throw o}})}getMappings(N){return E(this,null,function*(){var L=N,{from:e,fromScheme:r,to:n,toScheme:i,creator:s,type:o,partOf:a,offset:u,limit:l,direction:c,mode:p,identifier:m,cardinality:g,annotatedBy:f,annotatedFor:d,annotatedWith:y,sort:k,order:R}=L,C=W(L,["from","fromScheme","to","toScheme","creator","type","partOf","offset","limit","direction","mode","identifier","cardinality","annotatedBy","annotatedFor","annotatedWith","sort","order"]);let S={},O=this._api.mappings;return e&&(S.from=typeof e=="string"?e:e.uri),r&&(S.fromScheme=typeof r=="string"?r:r.uri),n&&(S.to=typeof n=="string"?n:n.uri),i&&(S.toScheme=typeof i=="string"?i:i.uri),s&&(S.creator=typeof s=="string"?s:P.prefLabel(s)),o&&(S.type=typeof o=="string"?o:o.uri),a&&(S.partOf=typeof a=="string"?a:a.uri),u&&(S.offset=u),l&&(S.limit=l),c&&(S.direction=c),g&&(S.cardinality=g),f&&(S.annotatedBy=f),d&&(S.annotatedFor=d),y&&(S.annotatedWith=y),p&&(S.mode=p),m&&(S.identifier=m),k&&(S.sort=k),R&&(S.order=R),this.axios(F(I({},C),{method:"get",url:O,params:I(I(I({},this._defaultParams),C.params||{}),S)}))})}postMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(!e)throw new U({parameter:"mapping"});return e=P.minifyMapping(e),e=P.addMappingIdentifiers(e),this.axios(F(I({},r),{method:"post",url:this._api.mappings,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}putMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(!e)throw new U({parameter:"mapping"});e=P.minifyMapping(e),e=P.addMappingIdentifiers(e);let s=e.uri;if(!s||!s.startsWith(this._api.mappings))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"put",url:s,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}patchMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);var a;if(!e)throw new U({parameter:"mapping"});if(!((a=e.uri)!=null&&a.startsWith(this._api.mappings)))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});let u=e,{uri:s}=u,o=W(u,["uri"]);return this.axios(F(I({},r),{method:"patch",url:s,data:o,params:I(I({},this._defaultParams),r.params||{})}))})}deleteMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(!e)throw new U({parameter:"mapping"});let s=e.uri;if(!s||!s.startsWith(this._api.mappings))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});return yield this.axios(F(I({},r),{method:"delete",url:s})),!0})}getAnnotations(n){return E(this,null,function*(){var i=n,{target:e}=i,r=W(i,["target"]);return e&&(r.params||(r.params={}),r.params.target=e),this.axios(F(I({},r),{method:"get",url:this._api.annotations}))})}postAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);return this.axios(F(I({},r),{method:"post",url:this._api.annotations,data:e}))})}putAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);let s=e.id;if(!s||!s.startsWith(this._api.annotations))throw new U({parameter:"annotation",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"put",url:s,data:e}))})}patchAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);let s=e.id;if(!s||!s.startsWith(this._api.annotations))throw new U({parameter:"annotation",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"patch",url:s,data:e}))})}deleteAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);let s=e.id;if(!s||!s.startsWith(this._api.annotations))throw new U({parameter:"annotation",message:"URI doesn't seem to be part of this registry."});return yield this.axios(F(I({},r),{method:"delete",url:s})),!0})}getConcordances(e){return E(this,null,function*(){return this.axios(F(I({},e),{method:"get",url:this._api.concordances}))})}postConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);if(!e)throw new U({parameter:"concordance"});return this.axios(F(I({},r),{method:"post",url:this._api.concordances,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}putConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);if(!e)throw new U({parameter:"concordance"});let s=e.uri;if(!s||!s.startsWith(this._api.concordances))throw new U({parameter:"concordance",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"put",url:s,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}patchConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);var a;if(!e)throw new U({parameter:"concordance"});if(!((a=e.uri)!=null&&a.startsWith(this._api.concordances)))throw new U({parameter:"concordance",message:"URI doesn't seem to be part of this registry."});let u=e,{uri:s}=u,o=W(u,["uri"]);return this.axios(F(I({},r),{method:"patch",url:s,data:o,params:I(I({},this._defaultParams),r.params||{})}))})}deleteConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);if(!e)throw new U({parameter:"concordance"});let s=e.uri;if(!s||!s.startsWith(this._api.concordances))throw new U({parameter:"concordance",message:"URI doesn't seem to be part of this registry."});return yield this.axios(F(I({},r),{method:"delete",url:s})),!0})}};ee(Ie,"supports",{mappings:!0,concordances:!0,annotations:!0});Ie.providerName="MappingsApi";Ie.stored=!0;var di={},$e=class extends G{get _cache(){return di[this.uri]}_prepare(){di[this.uri]=[],this._occurrencesSupportedSchemes=[]}_occurrencesIsSupported(e){return E(this,null,function*(){if(!(this._occurrencesSupportedSchemes&&this._occurrencesSupportedSchemes.length))try{let n=Ue(this._api.api,"voc"),i=yield this.axios({method:"get",url:n});this._occurrencesSupportedSchemes=i||[]}catch(n){}let r=!1;for(let n of this._occurrencesSupportedSchemes)P.compare(e,n)&&(r=!0);return r})}getMappings(e){return E(this,null,function*(){var u,l,c,p,m,g,f,d,y,k,R,C,N,L;let r=yield this.getOccurrences(e),n=e.from,i=((u=n==null?void 0:n.inScheme)==null?void 0:u[0])||e.fromScheme,s=e.to,o=((l=s==null?void 0:s.inScheme)==null?void 0:l[0])||e.toScheme,a=[];for(let S of r){if(!S)continue;let O={};O.from=(c=S==null?void 0:S.memberSet)==null?void 0:c[0],O.from?O.from={memberSet:[O.from]}:O.from=null,O.fromScheme=(g=(m=(p=S==null?void 0:S.memberSet)==null?void 0:p[0])==null?void 0:m.inScheme)==null?void 0:g[0],O.to=(f=S==null?void 0:S.memberSet)==null?void 0:f[1],O.to?O.to={memberSet:[O.to]}:O.to={memberSet:[]},O.toScheme=(k=(y=(d=S==null?void 0:S.memberSet)==null?void 0:d[1])==null?void 0:y.inScheme)==null?void 0:k[0],(n&&P.compare(n,(C=(R=O==null?void 0:O.to)==null?void 0:R.memberSet)==null?void 0:C[0])||s&&P.compare(s,(L=(N=O==null?void 0:O.from)==null?void 0:N.memberSet)==null?void 0:L[0]))&&([O.from,O.fromScheme,O.to,O.toScheme]=[O.to,O.toScheme,O.from,O.fromScheme]),!O.fromScheme&&i&&(O.fromScheme=i),!O.toScheme&&o&&(O.toScheme=o),O.type=[P.defaultMappingType.uri],O._occurrence=S,O=P.addMappingIdentifiers(O),a.push(O)}return a._url=r._url,a})}getOccurrences(o){return E(this,null,function*(){var a=o,{from:e,to:r,concepts:n,threshold:i=0}=a,s=W(a,["from","to","concepts","threshold"]);var f;let u=[];n=(n||[]).concat([e,r]).filter(d=>!!d);for(let d of n)u.push(this._occurrencesIsSupported((f=d==null?void 0:d.inScheme)==null?void 0:f[0]).then(y=>y&&d.uri?d.uri:null));let l=yield Promise.all(u);if(l=l.filter(d=>d!=null),l.length==0)throw new U({parameter:"concepts"});u=[];for(let d of l)u.push(this._getOccurrences(F(I({},s),{params:{member:d,scheme:"*",threshold:i}})));let c=yield Promise.all(u),p=c.flat(),m=[],g=[];for(let d=0;d<p.length;d+=1){let y=p[d];if(!y)continue;let k=y.memberSet.reduce((R,C)=>R.concat(C.uri),[]).sort().join(" ");m.includes(k)?g.push(d):m.push(k)}return g.forEach(d=>{delete p[d]}),p=p.filter(d=>d!=null),p=p.sort((d,y)=>parseInt(y.count||0)-parseInt(d.count||0)),p._url=c.map(d=>d._url),p})}_getOccurrences(e){return E(this,null,function*(){let r=this._cache.find(i=>Re(i.config.params,e.params));if(r)return r.data;let n=yield this.axios(F(I({},e),{method:"get",url:this._api.api}));return this._cache.push({config:e,data:n}),this._cache.length>20&&(di[this.uri]=this._cache.slice(this._cache.length-20)),n})}};ee($e,"supports",{occurrences:!0,mappings:!0});$e.providerName="OccurrencesApi";$e.stored=!1;var Te=class extends G{_prepare(){this._api.api&&this._api.status===void 0&&(this._api.status=Ue(this._api.api,"/status"))}_setup(){var e,r;if(this._api.api){let n={schemes:"/voc",top:"/voc/top",concepts:"/voc/concepts",data:"/data",narrower:"/narrower",ancestors:"/ancestors",types:"/types",suggest:"/suggest",search:"/search"};for(let i of Object.keys(n))this._api[i]===void 0&&(this._api[i]=Ue(this._api.api,n[i]))}this.has.schemes=!!this._api.schemes,!this.has.schemes&&Array.isArray(this.schemes)&&(this.has.schemes=!0),this.has.top=!!this._api.top,this.has.data=!!this._api.data,this.has.concepts=!!this._api.concepts||this.has.data,this.has.narrower=!!this._api.narrower,this.has.ancestors=!!this._api.ancestors,this.has.types=!!this._api.types,this.has.suggest=!!this._api.suggest,this.has.search=!!this._api.search,this.has.auth=(r=(e=this._config)==null?void 0:e.auth)==null?void 0:r.key,this._defaultParams={properties:"+created,issued,modified,editorialNote,scopeNote,note,definition,mappings,location"}}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r?null:{api:e,schemes:[r]}}_getSchemeUri(e){return E(this,null,function*(){this._approvedSchemes=this._approvedSchemes||[],this._rejectedSchemes=this._rejectedSchemes||[];let r=this._approvedSchemes.find(s=>P.compare(e,s));if(r)return r.uri;if(this._rejectedSchemes.find(s=>P.compare(e,s)))return null;let i=(yield this.getSchemes({params:{uri:P.getAllUris(e).join("|")}})).find(s=>P.compare(s,e));return i?(this._approvedSchemes.push({uri:i.uri,identifier:P.getAllUris(e)}),i.uri):(this._rejectedSchemes.push({uri:e.uri,identifier:e.identifier}),null)})}getSchemes(){return E(this,arguments,function*(e={}){if(!this._api.schemes){if(Array.isArray(this.schemes))return this.schemes;throw new xe}let r=yield this.axios(F(I({},e),{method:"get",url:this._api.schemes,params:I(F(I({},this._defaultParams),{limit:500}),e.params||{})}));return Array.isArray(this.schemes)?wt(r.filter(n=>P.isContainedIn(n,this.schemes)),r):r})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!this._api.top)throw new xe;if(!e)throw new U({parameter:"scheme"});let s=yield this._getSchemeUri(e);if(!s)throw new U({parameter:"scheme",message:"Requested vocabulary seems to be unsupported by this API."});return Array.isArray(this._api.top)?this._api.top:this.axios(F(I({},r),{method:"get",url:this._api.top,params:F(I(F(I({},this._defaultParams),{limit:1e4}),r.params||{}),{uri:s})}))})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);let s=this._api.concepts||this._api.data;if(!s)throw new xe;if(!e)throw new U({parameter:"concepts"});Array.isArray(e)||(e=[e]);let o=e.map(a=>a.uri).filter(a=>a!=null);return this.axios(F(I({},r),{method:"get",url:s,params:F(I(F(I({},this._defaultParams),{limit:500}),r.params||{}),{uri:o.join("|")})}))})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);var s;if(!e||!e.uri)throw new U({parameter:"concept"});if(this._api.narrower)return this.axios(F(I({},r),{method:"get",url:this._api.narrower,params:F(I(F(I({},this._defaultParams),{limit:1e4}),r.params||{}),{uri:e.uri})}));{let o=I({params:{}},r);o.params.properties="narrower";let u=((s=(yield this.getConcepts(I({concepts:[e]},o)))[0])==null?void 0:s.narrower)||[];return u.length?this.getConcepts(I({concepts:u},r)):[]}})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);var s;if(!e||!e.uri)throw new U({parameter:"concept"});if(this._api.ancestors)return this.axios(F(I({},r),{method:"get",url:this._api.ancestors,params:F(I(F(I({},this._defaultParams),{limit:1e4}),r.params||{}),{uri:e.uri})}));{let o=I({params:{}},r);o.params.properties="ancestors";let u=((s=(yield this.getConcepts(I({concepts:[e]},o)))[0])==null?void 0:s.ancestors)||[];return u.length?this.getConcepts(I({concepts:u},r)):[]}})}suggest(o){return E(this,null,function*(){var a=o,{use:e="notation,label",types:r=[],sort:n="score",params:i={}}=a,s=W(a,["use","types","sort","params"]);return this._search(F(I({},s),{endpoint:"suggest",params:F(I({},i),{type:r.join("|"),use:e,sort:n})}))})}search(i){return E(this,null,function*(){var s=i,{types:e=[],params:r={}}=s,n=W(s,["types","params"]);return this._search(F(I({},n),{endpoint:"search",params:F(I({},r),{type:e.join("|")})}))})}vocSuggest(s){return E(this,null,function*(){var o=s,{use:e="notation,label",sort:r="score",params:n={}}=o,i=W(o,["use","sort","params"]);return this._search(F(I({},i),{endpoint:"voc-suggest",params:F(I({},n),{use:e,sort:r})}))})}vocSearch(e){return E(this,null,function*(){return this._search(F(I({},e),{endpoint:"voc-search"}))})}_search(l){return E(this,null,function*(){var c=l,{endpoint:e,scheme:r,search:n,limit:i,offset:s,params:o,url:a}=c,u=W(c,["endpoint","scheme","search","limit","offset","params","url"]);if(a=a!=null?a:this._api[e],!a)throw new xe;if(!n)throw new U({parameter:"search"});i=i||this._jskos.suggestResultLimit||100,s=s||0;let p=r&&(yield this._getSchemeUri(r));return a=a.replace("{searchTerms}",n),this.axios(F(I({},u),{params:F(I(I({},this._defaultParams),o),{limit:i,count:i,offset:s,search:n,query:n,voc:p}),method:"get",url:a}))})}getTypes(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!this._api.types)throw new xe;if(Array.isArray(this._api.types))return this._api.types;let s=e&&(yield this._getSchemeUri(e));s&&(r.params||(r.params={}),r.params.uri=s);let o=yield this.axios(F(I({},r),{method:"get",url:this._api.types}));return s&&(o=o.filter(a=>!a.inScheme||P.isContainedIn(e,a.inScheme))),o})}};ee(Te,"providerName","ConceptApi"),ee(Te,"providerType","http://bartoc.org/api-type/jskos"),ee(Te,"supports",{schemes:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,types:!0,suggest:!0,search:!0,auth:!0});var mi={},je=class extends G{get _cache(){return mi[this.uri]}_prepare(){mi[this.uri]=[]}getMappings(s){return E(this,null,function*(){var o=s,{from:e,to:r,mode:n}=o,i=W(o,["from","to","mode"]);var S,O,D,$,X,K;let a=[];Array.isArray(this.schemes)&&(a=this.schemes);let u,l,c=(S=e==null?void 0:e.inScheme)==null?void 0:S[0],p=(O=r==null?void 0:r.inScheme)==null?void 0:O[0],m,g;if(!e||P.isContainedIn(c,a)?(u=!0,l=r,m=p,g=a.find(V=>P.compare(V,c))||a[0]):(u=!1,l=e,m=c,g=a.find(V=>P.compare(V,p))||a[0]),n!="or")return[];if(!this._api.api)throw new xe;if(!l)throw new U({parameter:u?"to":"from"});let f=P.languagePreference.selectLanguage(l.prefLabel);if(!f)throw new U({parameter:u?"to":"from",message:"Missing language"});let d=($=(D=l==null?void 0:l.altLabel)==null?void 0:D[f])!=null?$:[];typeof d=="string"&&(d=[d]);let y=(X=l==null?void 0:l.prefLabel)==null?void 0:X[f],k=d.concat([y]);k=[y];let{url:R,data:C}=yield this._getReconciliationResults(F(I({},i),{labels:k,language:f}));C=[].concat(...Object.values(C).map(V=>V.result)).filter(V=>V),C=C.sort((V,Z)=>V.score!=Z.score?Z.score-V.score:V.match!=Z.match?V.match?-1:1:V.id.length-Z.id.length);let N=(K=g==null?void 0:g.namespace)!=null?K:"",L=C.map(V=>({fromScheme:m,from:{memberSet:[l]},toScheme:g,to:{memberSet:[{uri:N+V.id}]},type:[V.match?"http://www.w3.org/2004/02/skos/core#exactMatch":V.score>=80?"http://www.w3.org/2004/02/skos/core#closeMatch":"http://www.w3.org/2004/02/skos/core#mappingRelation"]}));return u&&(L=L.map(V=>Object.assign(V,{fromScheme:V.toScheme,from:V.to,toScheme:V.fromScheme,to:V.from}))),L._url=R,L})}_getReconciliationResults(i){return E(this,null,function*(){var s=i,{labels:e,language:r}=s,n=W(s,["labels","language"]);e=e.sort();let o=this._cache.find(g=>Re(g.labels,e)&&g.language==r);if(o)return o;let a={},u=0;for(let g of e)a[`q${u}`]={query:g},u+=1;let l=this._api.api;r&&(l=l.replace("{language}",r));let c=`queries=${encodeURIComponent(JSON.stringify(a))}`;n.headers||(n.headers={}),n.headers["Content-Type"]="application/x-www-form-urlencoded";let p=yield this.axios(F(I({},n),{method:"post",url:l,data:c}));p=p||{};let m={labels:e,language:r,data:p,url:`${l}${l.includes("?")?"&":"?"}${c}`};return this._cache.push(m),this._cache.length>20&&(mi[this.uri]=this._cache.slice(this._cache.length-20)),m})}};ee(je,"supports",{mappings:!0});je.providerName="ReconciliationApi";je.providerType="http://bartoc.org/api-type/reconciliation";je.stored=!1;var We=class extends G{_prepare(){this._cache=[]}supportsScheme(e){var r,n;return super.supportsScheme(e)&&((n=(r=e==null?void 0:e._registry)==null?void 0:r.has)==null?void 0:n.search)}getMappings(a){return E(this,null,function*(){var u=a,{from:e,to:r,mode:n,selected:i,limit:s=10}=u,o=W(u,["from","to","mode","selected","limit"]);if(n!="or")return[];if(!i)throw new U({parameter:"selected"});let l=[];e&&this.supportsScheme(i.scheme[!1])?l.push(this._getMappings(F(I({},o),{concept:e,sourceScheme:i.scheme[!0],targetScheme:i.scheme[!1],limit:s}))):l.push(Promise.resolve([])),r&&this.supportsScheme(i.scheme[!0])?l.push(this._getMappings(F(I({},o),{concept:r,sourceScheme:i.scheme[!1],targetScheme:i.scheme[!0],limit:s,swap:!0}))):l.push(Promise.resolve([]));let[c,p]=yield Promise.all(l);for(p=p.filter(m=>!c.find(g=>P.compareMappingMembers(m,g)));c.length+p.length>s;)p.length>=c.length?p.pop():c.pop();return[...c,...p]})}_getMappings(a){return E(this,null,function*(){var u=a,{concept:e,sourceScheme:r,targetScheme:n,limit:i,swap:s=!1}=u,o=W(u,["concept","sourceScheme","targetScheme","limit","swap"]);var f;if(!e||!r||!n)return[];if(P.compare(r,n))return[];let l=P.languagePreference.selectLanguage(e.prefLabel)||this._defaultLanguages[0],c=P.prefLabel(e,{fallbackToUri:!1,language:l});if(!c)return[];let p=/^[\s\wäüöÄÜÖß]*\w/.exec(c);c=p?p[0]:c;let m=yield this._getResults(F(I({},o),{label:c,targetScheme:n,limit:i}));if(!m.length&&((f=e.broader)!=null&&f.length))for(let d of e.broader){let y=P.prefLabel(d,{fallbackToUri:!1,language:l});if(y&&(m=yield this._getResults(F(I({},o),{label:y,targetScheme:n,limit:i})),m.length))break}let g=m.map(d=>({fromScheme:r,from:{memberSet:[e]},toScheme:n,to:{memberSet:[d]},type:["http://www.w3.org/2004/02/skos/core#mappingRelation"]}));return s&&(g=g.map(d=>Object.assign(d,{fromScheme:d.toScheme,from:d.to,toScheme:d.fromScheme,to:d.from}))),g})}_getResults(s){return E(this,null,function*(){var o=s,{label:e,targetScheme:r,limit:n}=o,i=W(o,["label","targetScheme","limit"]);var p;let a=(this._cache[r.uri]||{})[e];if(a&&a._limit>=n)return a;let u=r==null?void 0:r._registry;if(!u||u.has.search===!1)return[];let l=(p=(this._jskos.overrides||[]).find(m=>P.compare(m,r)))==null?void 0:p.search,c=yield u.search(F(I({},i),{url:l,search:e,scheme:r,limit:n}));return this._cache[r.uri]||(this._cache[r.uri]={}),this._cache[r.uri][e]=c,this._cache[r.uri][e]._limit=n,c})}};ee(We,"supports",{mappings:!0});We.providerName="LabelSearchSuggestion";We.stored=!1;var He=class extends G{static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){if(!e||!r)return null;let n={},i=e.match(/(.+\/)([^/]+)\/$/);return i?(n.api=i[1]+"rest/v1/",r.VOCID=i[2],n.schemes=[r],n):null}get _language(){return this.languages[0]||this._defaultLanguages[0]||"en"}_getApiUrl(e,r,n){var o;let i=e&&e.VOCID||((o=this.schemes.find(a=>P.compare(a,e)))==null?void 0:o.VOCID);if(!i)throw new U({parameter:"scheme",message:"Missing scheme or VOCID property on scheme"});r=r||"",n=n||{},n.lang||(n.lang=this._language);let s=Object.keys(n).map(a=>`${a}=${encodeURIComponent(n[a])}`).join("&");return`${this._api.api}${i}${r}${s?"?"+s:""}`}_getDataUrl(e,{addFormatParameter:r=!0}={}){var i;let n=(i=e==null?void 0:e.inScheme)==null?void 0:i[0];if(!e||!e.uri)throw new U({parameter:"concept",message:"Missing concept URI"});return this._getApiUrl(n,"/data",r?{format:"application/json"}:{})}_getSchemeUri(e){return E(this,null,function*(){this._approvedSchemes=this._approvedSchemes||[],this._rejectedSchemes=this._rejectedSchemes||[];let r=this._approvedSchemes.find(o=>P.compare(e,o));if(r)return r.uri;if(this._rejectedSchemes.find(o=>P.compare(e,o)))return null;let n=this._getApiUrl(e,"/"),s=(yield this.axios({method:"get",url:n})).conceptschemes.find(o=>P.compare(o,e));return s?(this._approvedSchemes.push({uri:s.uri,identifier:P.getAllUris(e)}),s.uri):(this._rejectedSchemes.push({uri:e.uri,identifier:e.identifier}),null)})}_toJskosConcept(e,{concept:r,scheme:n,result:i,language:s}={}){var l;if(!e)return null;r=P.deepCopy(r||{}),s=s||e.lang||"en",r.uri=e.uri,n&&(r.inScheme=[n]);let o=e.matchedPrefLabel||e.prefLabel||e.label;if(typeof o=="string")r.prefLabel||(r.prefLabel={}),r.prefLabel[s]=o;else{o&&!Array.isArray(o)&&(o=[o]);for(let c of o||[])r.prefLabel||(r.prefLabel={}),r.prefLabel[c.lang]=c.value}let a=e.altLabel;if(typeof a=="string")r.altLabel||(r.altLabel={}),r.altLabel[s]=a;else{a&&!Array.isArray(a)&&(a=[a]);for(let c of a||[])(l=r==null?void 0:r.altLabel)!=null&&l[c.lang]?(r.altLabel[c.lang].push(c.value),r.altLabel[c.lang]=[...new Set(r.altLabel[c.lang])]):(r.altLabel||(r.altLabel={}),r.altLabel[c.lang]=[c.value])}let u=e.notation||e["skos:notation"]||P.notation(r);u&&(r.notation=[u.value||u]),e.broader&&(Array.isArray(e.broader)||(e.broader=[e.broader]),r.broader=e.broader.map(c=>typeof c=="string"?{uri:c}:c)),e.hasChildren===!0?r.narrower=[null]:e.hasChildren===!1&&(r.narrower=[]),e.type&&!Array.isArray(e.type)&&(e.type=[e.type]),r.type=r.type||[];for(let c of e.type||[]){if(!P.isValidUri(c))continue;let p=c.slice(0,c.indexOf(":"));i&&i["@context"]&&i["@context"][p]&&(c=c.replace(p+":",i["@context"][p])),r.type.push(c)}return r.type=[...new Set(r.type)],r.type.length||(r.type=["http://www.w3.org/2004/02/skos/core#Concept"]),r}getSchemes(){return E(this,arguments,function*(r={}){var e=W(r,[]);let n=[];for(let i of this.schemes||[]){let s=this._getApiUrl(i,"/"),a=(yield this.axios(F(I({},e),{method:"get",url:s}))).conceptschemes.find(l=>P.compare(l,i)),u=a&&(a.prefLabel||a.label||a.title);u&&(i.prefLabel||(i.prefLabel={}),i.prefLabel[this._language]=u),n.push(i),this._approvedSchemes=this._approvedSchemes||[],this._approvedSchemes.find(l=>P.compare(i,l))||this._approvedSchemes.push({uri:a.uri,identifier:P.getAllUris(i)})}return n})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);let s=this._getApiUrl(e,"/topConcepts"),o=yield this._getSchemeUri(e);if(!o)throw new U({parameter:"scheme",message:"Missing or unsupported scheme or VOCID property on scheme"});r.params||(r.params={}),r.params.scheme=o;let a=yield this.axios(F(I({},r),{method:"get",url:s})),u=[];for(let l of a.topconcepts||[]){let c=this._toJskosConcept(l,{scheme:e,language:this._language});c.topConceptOf=[e],u.push(c)}return u})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);Array.isArray(e)||(e=[e]),e=e.map(o=>({uri:o.uri,inScheme:o.inScheme}));let s=[];for(let o of e){let a=this._getDataUrl(o,{addFormatParameter:!1});if(!a)continue;let u=yield this.axios(F(I({},r),{method:"get",url:a,params:{uri:o.uri,format:"application/json"}})),l=u&&u.graph&&u.graph.find(c=>P.compare(c,o));if(l){let c=this._toJskosConcept(l,{concept:o,result:u});for(let p of["broader","narrower"]){let m=l[p]||c[p];m&&!Array.isArray(m)&&(m=[m]),m||(m=[]),c[p]=m.map(g=>this._toJskosConcept(u.graph.find(f=>P.compare(f,g)),{scheme:o.inScheme[0],result:u}))}c.ancestors=[],s.push(c)}}return s})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});let s=e.inScheme[0],o=this._getApiUrl(s,"/children");return r.params||(r.params={}),r.params.uri=e.uri,((yield this.axios(F(I({},r),{method:"get",url:o}))).narrower||[]).map(l=>this._toJskosConcept(l,{scheme:s}))})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);var p,m,g,f;if(!e||!e.uri)throw new U({parameter:"concept"});let s=e.inScheme[0],o=this._getApiUrl(s,"/broaderTransitive");r.params||(r.params={}),r.params.uri=e.uri;let a=yield this.axios(F(I({},r),{method:"get",url:o})),u=[],l=e.uri;for(;l;){if(l!=e.uri){let d=(p=a==null?void 0:a.broaderTransitive)==null?void 0:p[l];u=u.concat([d])}l=(f=(g=(m=a==null?void 0:a.broaderTransitive)==null?void 0:m[l])==null?void 0:g.broader)==null?void 0:f[0]}return u.map(d=>this._toJskosConcept(d,{scheme:s})).filter(d=>d.uri!=e.uri)})}search(o){return E(this,null,function*(){var a=o,{search:e,scheme:r,limit:n,types:i=[]}=a,s=W(a,["search","scheme","limit","types"]);let u=this._getApiUrl(r,"/search");return s.params||(s.params={}),s.params.query=`${e}*`,s.params.unique=1,s.params.maxhits=n||100,s.params.type=i.join(" "),((yield this.axios(F(I({},s),{method:"get",url:u}))).results||[]).map(p=>this._toJskosConcept(p,{scheme:r}))})}getTypes(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);let s=this._getApiUrl(e,"/types"),o=[],a=yield this.axios(F(I({},r),{method:"get",url:s}));for(let u of a&&a.types||[])u.uri!="http://www.w3.org/2004/02/skos/core#Concept"&&(u.label&&(u.prefLabel={[a["@context"]["@language"]]:u.label},delete u.label),o.push(u));return o._url=s,o})}};ee(He,"supports",{scheme:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,types:!0,suggest:!0,search:!0});He.providerName="SkosmosApi";He.providerType="http://bartoc.org/api-type/skosmos";var Gr="http://id.loc.gov/authorities/",Xr=[{uri:`${Gr}subjects`,identifier:["http://bartoc.org/en/node/454"],notation:["LCSH"],concepts:[null],topConcepts:[]},{uri:`${Gr}names`,identifier:["http://bartoc.org/en/node/18536"],notation:["LCNAF"],concepts:[null],topConcepts:[]}],po=`${Gr}classification`;function mo(t){let e={};e.uri=t["@id"],e.notation=(t["http://www.loc.gov/mads/rdf/v1#code"]||[]).map(i=>i["@value"]);let r=t["http://www.loc.gov/mads/rdf/v1#authoritativeLabel"]||t["http://www.w3.org/2000/01/rdf-schema#label"]||[];r.length&&(e.prefLabel={},e.prefLabel[r[0]["@language"]||"en"]=r[0]["@value"]);let n=t["http://www.w3.org/2004/02/skos/core#altLabel"]||[];n.length&&(e.altLabel={en:n.map(i=>i["@value"])});for(let i of t["http://www.w3.org/2000/01/rdf-schema#comment"]||[])e.definition=e.definition||{},e.definition.en=e.definition.en||[],e.definition.en.push(i["@value"]);return e}function $l(t){let e=mo(t);return e.namespace=e.uri+"/",e.type=["http://www.w3.org/2004/02/skos/core#ConceptScheme"],e}var gi=t=>e=>!e||!t||!t.namespace?!0:e.uri.startsWith(t.namespace);function Wl(t,{scheme:e}){let r=mo(t);r.type=["http://www.w3.org/2004/02/skos/core#Concept"],r.inScheme=e?[e]:(t["http://www.loc.gov/mads/rdf/v1#isMemberOfMADSScheme"]||[]).map(s=>Xr.find(o=>o.uri===s["@id"])),(!r.inScheme.length||!r.inScheme[0])&&delete r.inScheme;let n=t["http://www.loc.gov/mads/rdf/v1#hasNarrowerAuthority"]||P.compare(r.inScheme[0],{uri:po})&&t["http://www.loc.gov/mads/rdf/v1#hasMADSCollectionMember"]||[];r.narrower=n.map(s=>({uri:s["@id"]})).filter(gi(r.inScheme&&r.inScheme[0]));let i=t["http://www.loc.gov/mads/rdf/v1#hasBroaderAuthority"]||P.compare(r.inScheme[0],{uri:po})&&t["http://www.loc.gov/mads/rdf/v1#isMemberOfMADSCollection"]||[];return r.broader=i.map(s=>({uri:s["@id"]})).filter(gi(r.inScheme&&r.inScheme[0])),r}var qe=class extends G{static _registryConfigForBartocApiConfig({scheme:e}={}){return!e||!Xr.find(r=>P.compare(r,e))?null:{schemes:[e]}}getSchemes(){return E(this,null,function*(){let e=[];for(let r of yield Promise.all(Xr.filter(n=>!this.schemes||!this.schemes.length||this.schemes.find(i=>P.compare(n,i))).map(n=>pe({method:"get",url:`${n.uri.replace("http:","https:")}.json`}).then(({status:i,data:s})=>{if(i===200){let o=s.find(a=>n.uri===a["@id"]);if(o)return o=P.merge($l(o),n),o.topConcepts=(o.topConcepts||[]).filter(a=>a),o}return null}))))r&&e.push(r);return e})}getConcepts(r){return E(this,arguments,function*({concepts:e}){Array.isArray(e)||(e=[e]);let n=[];for(let i of yield Promise.all(e.map(s=>pe({method:"get",url:`${s.uri.replace("http:","https:")}.json`}).then(({status:o,data:a})=>{if(o===200){let u=a.find(l=>s.uri===l["@id"]);return u?Wl(u,{scheme:s.inScheme&&s.inScheme[0]}):null}}))))i&&n.push(i);return n})}suggest(e){return E(this,null,function*(){let r=yield this.search(e);return[e.search,r.map(n=>P.prefLabel(n,{fallbackToUri:!0})),[],r.map(n=>n.uri)]})}search(s){return E(this,arguments,function*({search:e,scheme:r,limit:n,offset:i}){let o=P.getAllUris(r).find(u=>u.startsWith(Gr));if(!o||!Xr.find(u=>P.compare(u,{uri:o})))throw new U({parameter:"scheme",message:"provided scheme is not supported (yet)"});if(!e)throw new U({parameter:"search",message:"parameter is empty or missing"});n=n||this._jskos.suggestResultLimit||100,i=i||0;let{data:a}=yield pe({method:"get",url:`${o}/suggest2`.replace("http:","https:"),params:{q:e,count:n||100,offset:i,searchtype:"keyword"}});return(a.hits||[]).map(u=>({uri:u.uri,notation:[u.token],prefLabel:{en:u.aLabel},inScheme:[r]})).filter(gi(r))})}};ee(qe,"supports",{schemes:!0,top:!1,data:!0,concepts:!0,narrower:!1,ancestors:!1,suggest:!0,search:!0});qe.providerName="LocApi";qe.providerType="http://bartoc.org/api-type/loc";var ko={};var H;function ye(t,e,r){let n=typeof r,i=typeof t;if(n!=="undefined"){if(i!=="undefined"){if(r){if(i==="function"&&n===i)return function(a){return t(r(a))};if(e=t.constructor,e===r.constructor){if(e===Array)return r.concat(t);if(e===Map){var s=new Map(r);for(var o of t)s.set(o[0],o[1]);return s}if(e===Set){o=new Set(r);for(s of t.values())o.add(s);return o}}}return t}return r}return i==="undefined"?e:t}function Bt(t,e){return typeof t=="undefined"?e:t}function le(){return Object.create(null)}function Pe(t){return typeof t=="string"}function _r(t){return typeof t=="object"}function br(t,e){if(Pe(e))t=t[e];else for(let r=0;t&&r<e.length;r++)t=t[e[r]];return t}var Hl=/[^\p{L}\p{N}]+/u,ql=/(\d{3})/g,Vl=/(\D)(\d{3})/g,Jl=/(\d{3})(\D)/g,go=/[\u0300-\u036f]/g;function $t(t={}){if(!this||this.constructor!==$t)return new $t(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}H=$t.prototype;H.assign=function(t){this.normalize=ye(t.normalize,!0,this.normalize);let e=t.include,r=e||t.exclude||t.split,n;if(r||r===""){if(typeof r=="object"&&r.constructor!==RegExp){let i="";n=!e,e||(i+="\\p{Z}"),r.letter&&(i+="\\p{L}"),r.number&&(i+="\\p{N}",n=!!e),r.symbol&&(i+="\\p{S}"),r.punctuation&&(i+="\\p{P}"),r.control&&(i+="\\p{C}"),(r=r.char)&&(i+=typeof r=="object"?r.join(""):r);try{this.split=new RegExp("["+(e?"^":"")+i+"]+","u")}catch(s){this.split=/\s+/}}else this.split=r,n=r===!1||"a1a".split(r).length<2;this.numeric=ye(t.numeric,n)}else{try{this.split=ye(this.split,Hl)}catch(i){this.split=/\s+/}this.numeric=ye(t.numeric,ye(this.numeric,!0))}if(this.prepare=ye(t.prepare,null,this.prepare),this.finalize=ye(t.finalize,null,this.finalize),r=t.filter,this.filter=typeof r=="function"?r:ye(r&&new Set(r),null,this.filter),this.dedupe=ye(t.dedupe,!0,this.dedupe),this.matcher=ye((r=t.matcher)&&new Map(r),null,this.matcher),this.mapper=ye((r=t.mapper)&&new Map(r),null,this.mapper),this.stemmer=ye((r=t.stemmer)&&new Map(r),null,this.stemmer),this.replacer=ye(t.replacer,null,this.replacer),this.minlength=ye(t.minlength,1,this.minlength),this.maxlength=ye(t.maxlength,1024,this.maxlength),this.rtl=ye(t.rtl,!1,this.rtl),(this.cache=r=ye(t.cache,!0,this.cache))&&(this.F=null,this.L=typeof r=="number"?r:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(let i of this.matcher.keys())this.h+=(this.h?"|":"")+i;if(this.stemmer)for(let i of this.stemmer.keys())this.A+=(this.A?"|":"")+i;return this};H.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&_t(this),this};H.addFilter=function(t){return typeof t=="function"?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&_t(this),this};H.addMapper=function(t,e){return typeof t=="object"?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&_t(this),this)};H.addMatcher=function(t,e){return typeof t=="object"?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&_t(this),this)};H.addReplacer=function(t,e){return typeof t=="string"?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&_t(this),this)};H.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(_t,50,this);this.normalize&&(typeof this.normalize=="function"?t=this.normalize(t):t=go?t.normalize("NFKD").replace(go,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(Vl,"$1 $2").replace(Jl,"$1 $2").replace(ql,"$1 "));let r=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer),n=[],i=le(),s,o,a=this.split||this.split===""?t.split(this.split):[t];for(let l=0,c,p;l<a.length;l++)if((c=p=a[l])&&!(c.length<this.minlength||c.length>this.maxlength)){if(e){if(i[c])continue;i[c]=1}else{if(s===c)continue;s=c}if(r)n.push(c);else if(!this.filter||(typeof this.filter=="function"?this.filter(c):!this.filter.has(c))){if(this.cache&&c.length<=this.I)if(this.F){var u=this.D.get(c);if(u||u===""){u&&n.push(u);continue}}else this.F=setTimeout(_t,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let m;for(;m!==c&&c.length>2;)m=c,c=c.replace(this.K,g=>this.stemmer.get(g))}if(c&&(this.mapper||this.dedupe&&c.length>1)){u="";for(let m=0,g="",f,d;m<c.length;m++)f=c.charAt(m),f===g&&this.dedupe||((d=this.mapper&&this.mapper.get(f))||d===""?d===g&&this.dedupe||!(g=d)||(u+=d):u+=g=f);c=u}if(this.matcher&&c.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),c=c.replace(this.J,m=>this.matcher.get(m))),c&&this.replacer)for(u=0;c&&u<this.replacer.length;u+=2)c=c.replace(this.replacer[u],this.replacer[u+1]);if(this.cache&&p.length<=this.I&&(this.D.set(p,c),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),c){if(c!==p)if(e){if(i[c])continue;i[c]=1}else{if(o===c)continue;o=c}n.push(c)}}}return this.finalize&&(n=this.finalize(n)||n),this.cache&&t.length<=this.H&&(this.B.set(t,n),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),n};function _t(t){t.F=null,t.B.clear(),t.D.clear()}function Ei(t,e,r){r||(e||typeof t!="object"?typeof e=="object"&&(r=e,e=0):r=t),r&&(t=r.query||t,e=r.limit||e);let n=""+(e||0);r&&(n+=(r.offset||0)+!!r.context+!!r.suggest+(r.resolve!==!1)+(r.resolution||this.resolution)+(r.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new St);let i=this.cache.get(t+n);if(!i){let s=r&&r.cache;s&&(r.cache=!1),i=this.search(t,e,r),s&&(r.cache=s),this.cache.set(t+n,i)}return i}function St(t){this.limit=t&&t!==!0?t:1e3,this.cache=new Map,this.h=""}St.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};St.prototype.get=function(t){let e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e};St.prototype.remove=function(t){for(let e of this.cache){let r=e[0];e[1].includes(t)&&this.cache.delete(r)}};St.prototype.clear=function(){this.cache.clear(),this.h=""};var wo={normalize:!1,numeric:!1,dedupe:!1},Qr={},yi=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),yo=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),_o=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],bo={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,\u00DF:2,d:3,t:3,l:4,m:5,n:5,r:6},Ai={Exact:wo,Default:Qr,Normalize:Qr,LatinBalance:{mapper:yi},LatinAdvanced:{mapper:yi,matcher:yo,replacer:_o},LatinExtra:{mapper:yi,replacer:_o.concat([/(?!^)[aeo]/g,""]),matcher:yo},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let r=0;r<t.length;r++){var e=t[r];let n=e.charAt(0),i=bo[n];for(let s=1,o;s<e.length&&(o=e.charAt(s),o==="h"||o==="w"||!(o=bo[o])||o===i||(n+=o,i=o,n.length!==4));s++);t[r]=n}}},CJK:{split:""},LatinExact:wo,LatinDefault:Qr,LatinSimple:Qr};function vo(t,e,r,n){let i=[];for(let s=0,o;s<t.index.length;s++)if(o=t.index[s],e>=o.length)e-=o.length;else{e=o[n?"splice":"slice"](e,r);let a=e.length;if(a&&(i=i.length?i.concat(e):e,r-=a,n&&(t.length-=a),!r))break;e=0}return i}function Wt(t){if(!this||this.constructor!==Wt)return new Wt(t);this.index=t?[t]:[],this.length=t?t.length:0;let e=this;return new Proxy([],{get(r,n){if(n==="length")return e.length;if(n==="push")return function(i){e.index[e.index.length-1].push(i),e.length++};if(n==="pop")return function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()};if(n==="indexOf")return function(i){let s=0;for(let o=0,a,u;o<e.index.length;o++){if(a=e.index[o],u=a.indexOf(i),u>=0)return s+u;s+=a.length}return-1};if(n==="includes")return function(i){for(let s=0;s<e.index.length;s++)if(e.index[s].includes(i))return!0;return!1};if(n==="slice")return function(i,s){return vo(e,i||0,s||e.length,!1)};if(n==="splice")return function(i,s){return vo(e,i||0,s||e.length,!0)};if(n==="constructor")return Array;if(typeof n!="symbol")return(r=e.index[n/rt(2,31)|0])&&r[n]},set(r,n,i){return r=n/rt(2,31)|0,(e.index[r]||(e.index[r]=[]))[n]=i,e.length++,!0}})}Wt.prototype.clear=function(){this.index.length=0};Wt.prototype.push=function(){};function De(t=8){if(!this||this.constructor!==De)return new De(t);this.index=le(),this.h=[],this.size=0,t>32?(this.B=Io,this.A=BigInt(t)):(this.B=Ro,this.A=t)}De.prototype.get=function(t){let e=this.index[this.B(t)];return e&&e.get(t)};De.prototype.set=function(t,e){var r=this.B(t);let n=this.index[r];n?(r=n.size,n.set(t,e),(r-=n.size)&&this.size++):(this.index[r]=n=new Map([[t,e]]),this.h.push(n),this.size++)};function Me(t=8){if(!this||this.constructor!==Me)return new Me(t);this.index=le(),this.h=[],this.size=0,t>32?(this.B=Io,this.A=BigInt(t)):(this.B=Ro,this.A=t)}Me.prototype.add=function(t){var e=this.B(t);let r=this.index[e];r?(e=r.size,r.add(t),(e-=r.size)&&this.size++):(this.index[e]=r=new Set([t]),this.h.push(r),this.size++)};H=De.prototype;H.has=Me.prototype.has=function(t){let e=this.index[this.B(t)];return e&&e.has(t)};H.delete=Me.prototype.delete=function(t){let e=this.index[this.B(t)];e&&e.delete(t)&&this.size--};H.clear=Me.prototype.clear=function(){this.index=le(),this.h=[],this.size=0};H.values=Me.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e};H.keys=Me.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e};H.entries=Me.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};function Ro(t){let e=rt(2,this.A)-1;if(typeof t=="number")return t&e;let r=0,n=this.A+1;for(let i=0;i<t.length;i++)r=(r*n^t.charCodeAt(i))&e;return this.A===32?r+rt(2,31):r}function Io(t){let e=rt(BigInt(2),this.A)-BigInt(1);var r=typeof t;if(r==="bigint")return t&e;if(r==="number")return BigInt(t)&e;r=BigInt(0);let n=this.A+BigInt(1);for(let i=0;i<t.length;i++)r=(r*n^BigInt(t.charCodeAt(i)))&e;return r}var jt,yr;function Kl(t){return E(this,null,function*(){t=t.data;var e=t.task;let r=t.id,n=t.args;if(e==="init")yr=t.options||{},(e=t.factory)?(Function("return "+e)()(self),jt=new self.FlexSearch.Index(yr),delete self.FlexSearch):jt=new Le(yr),postMessage({id:r});else{let i;e==="export"&&(n[1]?(n[0]=yr.export,n[2]=0,n[3]=1):n=null),e==="import"?n[0]&&(t=yield yr.import.call(jt,n[0]),jt.import(n[0],t)):((i=n&&jt[e].apply(jt,n))&&i.then&&(i=yield i),i&&i.await&&(i=yield i.await),e==="search"&&i.result&&(i=i.result)),postMessage(e==="search"?{id:r,msg:i}:{id:r})}})}function Ci(t){Ut.call(t,"add"),Ut.call(t,"append"),Ut.call(t,"search"),Ut.call(t,"update"),Ut.call(t,"remove"),Ut.call(t,"searchCache")}var bi,So,tn;function Yl(){bi=tn=0}function Ut(t){this[t+"Async"]=function(){let e=arguments;var r=e[e.length-1];let n;if(typeof r=="function"&&(n=r,delete e[e.length-1]),bi?tn||(tn=Date.now()-So>=this.priority*this.priority*3):(bi=setTimeout(Yl,0),So=Date.now()),tn){let s=this;return new Promise(o=>{setTimeout(function(){o(s[t+"Async"].apply(s,e))},0)})}let i=this[t].apply(this,e);return r=i.then?i:new Promise(s=>s(i)),n&&r.then(n),r}}var ot=0;function bt(t={},e){function r(a){function u(l){l=l.data||l;let c=l.id,p=c&&s.h[c];p&&(p(l.msg),delete s.h[c])}if(this.worker=a,this.h=le(),this.worker)return i?this.worker.on("message",u):this.worker.onmessage=u,t.config?new Promise(function(l){ot>1e9&&(ot=0),s.h[++ot]=function(){l(s)},s.worker.postMessage({id:ot,task:"init",factory:n,options:t})}):(this.priority=t.priority||4,this.encoder=e||null,this.worker.postMessage({task:"init",factory:n,options:t}),this)}if(!this||this.constructor!==bt)return new bt(t);let n=typeof self!="undefined"?self._factory:typeof window!="undefined"?window._factory:null;n&&(n=n.toString());let i=typeof window=="undefined",s=this,o=Xl(n,i,t.worker);return o.then?o.then(function(a){return r.call(s,a)}):r.call(this,o)}at("add");at("append");at("search");at("update");at("remove");at("clear");at("export");at("import");bt.prototype.searchCache=Ei;Ci(bt.prototype);function at(t){bt.prototype[t]=function(){let e=this,r=[].slice.call(arguments);var n=r[r.length-1];let i;return typeof n=="function"&&(i=n,r.pop()),n=new Promise(function(s){t==="export"&&typeof r[0]=="function"&&(r[0]=null),ot>1e9&&(ot=0),e.h[++ot]=s,e.worker.postMessage({task:t,id:ot,args:r})}),i?(n.then(i),this):n}}function Xl(t,e,r){return e?typeof module!="undefined"?new(wi()).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(()=>ns(wi(),1)).then(function(n){return new n.Worker(ko.dirname+"/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Kl.toString()],{type:"text/javascript"}))):new window.Worker(typeof r=="string"?r:ko.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}vt.prototype.add=function(t,e,r){if(_r(t)&&(e=t,t=br(e,this.key)),e&&(t||t===0)){if(!r&&this.reg.has(t))return this.update(t,e);for(let a=0,u;a<this.field.length;a++){u=this.B[a];var n=this.index.get(this.field[a]);if(typeof u=="function"){var i=u(e);i&&n.add(t,i,r,!0)}else i=u.G,(!i||i(e))&&(u.constructor===String?u=[""+u]:Pe(u)&&(u=[u]),Si(e,u,this.D,0,n,t,u[0],r))}if(this.tag)for(n=0;n<this.A.length;n++){var s=this.A[n];i=this.tag.get(this.F[n]);let a=le();if(typeof s=="function"){if(s=s(e),!s)continue}else{var o=s.G;if(o&&!o(e))continue;s.constructor===String&&(s=""+s),s=br(e,s)}if(i&&s){Pe(s)&&(s=[s]);for(let u=0,l,c;u<s.length;u++)if(l=s[u],!a[l]&&(a[l]=1,(o=i.get(l))?c=o:i.set(l,c=[]),!r||!c.includes(t))){if(c.length===rt(2,31)-1){if(o=new Wt(c),this.fastupdate)for(let p of this.reg.values())p.includes(c)&&(p[p.indexOf(c)]=o);i.set(l,c=o)}c.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(c):this.reg.set(t,[c]))}}}if(this.store&&(!r||!this.store.has(t))){let a;if(this.h){a=le();for(let u=0,l;u<this.h.length;u++){if(l=this.h[u],(r=l.G)&&!r(e))continue;let c;if(typeof l=="function"){if(c=l(e),!c)continue;l=[l.O]}else if(Pe(l)||l.constructor===String){a[l]=e[l];continue}vi(e,a,l,0,l[0],c)}}this.store.set(t,a||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this};function vi(t,e,r,n,i,s){if(t=t[i],n===r.length-1)e[i]=s||t;else if(t)if(t.constructor===Array)for(e=e[i]=Array(t.length),i=0;i<t.length;i++)vi(t,e,r,n,i);else e=e[i]||(e[i]=le()),i=r[++n],vi(t,e,r,n,i)}function Si(t,e,r,n,i,s,o,a){if(t=t[o])if(n===e.length-1){if(t.constructor===Array){if(r[n]){for(e=0;e<t.length;e++)i.add(s,t[e],!0,!0);return}t=t.join(" ")}i.add(s,t,a,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)Si(t,e,r,n,i,s,o,a);else o=e[++n],Si(t,e,r,n,i,s,o,a)}function Oi(t,e,r,n){if(!t.length)return t;if(t.length===1)return t=t[0],t=r||t.length>e?t.slice(r,r+e):t,n?zt.call(this,t):t;let i=[];for(let s=0,o,a;s<t.length;s++)if((o=t[s])&&(a=o.length)){if(r){if(r>=a){r-=a;continue}o=o.slice(r,r+e),a=o.length,r=0}if(a>e&&(o=o.slice(0,e),a=e),!i.length&&a>=e)return n?zt.call(this,o):o;if(i.push(o),e-=a,!e)break}return i=i.length>1?[].concat.apply([],i):i[0],n?zt.call(this,i):i}function ln(t,e,r,n){var i=n[0];if(i[0]&&i[0].query)return t[e].apply(t,i);if(!(e!=="and"&&e!=="not"||t.result.length||t.await||i.suggest))return n.length>1&&(i=n[n.length-1]),(n=i.resolve)?t.await||t.result:t;let s=[],o=0,a=0,u,l,c,p,m;for(e=0;e<n.length;e++)if(i=n[e]){var g=void 0;if(i.constructor===oe)g=i.await||i.result;else if(i.then||i.constructor===Array)g=i;else{o=i.limit||0,a=i.offset||0,c=i.suggest,l=i.resolve,u=((p=i.highlight||t.highlight)||i.enrich)&&l,g=i.queue;let f=i.async||g,d=i.index,y=i.query;if(d?t.index||(t.index=d):d=t.index,y||i.tag){let k=i.field||i.pluck;if(k&&(!y||t.query&&!p||(t.query=y,t.field=k,t.highlight=p),d=d.index.get(k)),g&&(m||t.await)){m=1;let R,C=t.C.length,N=new Promise(function(L){R=L});(function(L,S){N.h=function(){S.index=null,S.resolve=!1;let O=f?L.searchAsync(S):L.search(S);return O.then?O.then(function(D){return t.C[C]=D=D.result||D,R(D),D}):(O=O.result||O,R(O),O)}})(d,Object.assign({},i)),t.C.push(N),s[e]=N;continue}else i.resolve=!1,i.index=null,g=f?d.searchAsync(i):d.search(i),i.resolve=l,i.index=d}else if(i.and)g=Zr(i,"and",d);else if(i.or)g=Zr(i,"or",d);else if(i.not)g=Zr(i,"not",d);else if(i.xor)g=Zr(i,"xor",d);else continue}g.await?(m=1,g=g.await):g.then?(m=1,g=g.then(function(f){return f.result||f})):g=g.result||g,s[e]=g}if(m&&!t.await&&(t.await=new Promise(function(f){t.return=f})),m){let f=Promise.all(s).then(function(d){for(let y=0;y<t.C.length;y++)if(t.C[y]===f){t.C[y]=function(){return r.call(t,d,o,a,u,l,c,p)};break}ki(t)});t.C.push(f)}else if(t.await)t.C.push(function(){return r.call(t,s,o,a,u,l,c,p)});else return r.call(t,s,o,a,u,l,c,p);return l?t.await||t.result:t}function Zr(t,e,r){t=t[e];let n=t[0]||t;return n.index||(n.index=r),r=new oe(n),t.length>1&&(r=r[e].apply(r,t.slice(1))),r}oe.prototype.or=function(){return ln(this,"or",Gl,arguments)};function Gl(t,e,r,n,i,s,o){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=To(t,e,r,!1,this.h),r=0)),i&&(this.await=null),i?this.resolve(e,r,n,o):this}oe.prototype.and=function(){return ln(this,"and",Ql,arguments)};function Ql(t,e,r,n,i,s,o){if(!s&&!this.result.length)return i?this.result:this;let a;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let u=0;for(let l=0,c,p;l<t.length;l++)if((c=t[l])&&(p=c.length))u<p&&(u=p);else if(!s){u=0;break}u?(this.result=nn(t,u,e,r,s,this.h,i),a=!0):this.result=[]}else s||(this.result=t);return i&&(this.await=null),i?this.resolve(e,r,n,o,a):this}oe.prototype.xor=function(){return ln(this,"xor",Zl,arguments)};function Zl(t,e,r,n,i,s,o){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{e:{s=r;var a=this.h;let u=[],l=le(),c=0;for(let p=0,m;p<t.length;p++)if(m=t[p]){c<m.length&&(c=m.length);for(let g=0,f;g<m.length;g++)if(f=m[g])for(let d=0,y;d<f.length;d++)y=f[d],l[y]=l[y]?2:1}for(let p=0,m,g=0;p<c;p++)for(let f=0,d;f<t.length;f++)if((d=t[f])&&(m=d[p])){for(let y=0,k;y<m.length;y++)if(k=m[y],l[k]===1)if(s)s--;else if(i){if(u.push(k),u.length===e){t=u;break e}}else{let R=p+(f?a:0);if(u[R]||(u[R]=[]),u[R].push(k),++g===e){t=u;break e}}}t=u}this.result=t,a=!0}else s||(this.result=t);return i&&(this.await=null),i?this.resolve(e,r,n,o,a):this}oe.prototype.not=function(){return ln(this,"not",ec,arguments)};function ec(t,e,r,n,i,s,o){if(!s&&!this.result.length)return i?this.result:this;if(t.length&&this.result.length){e:{s=r;var a=[];t=new Set(t.flat().flat());for(let u=0,l,c=0;u<this.result.length;u++)if(l=this.result[u]){for(let p=0,m;p<l.length;p++)if(m=l[p],!t.has(m)){if(s)s--;else if(i){if(a.push(m),a.length===e){t=a;break e}}else if(a[u]||(a[u]=[]),a[u].push(m),++c===e){t=a;break e}}}t=a}this.result=t,a=!0}return i&&(this.await=null),i?this.resolve(e,r,n,o,a):this}function rn(t,e,r,n,i){let s,o,a;typeof i=="string"?(s=i,i=""):s=i.template,o=s.indexOf("$1"),a=s.substring(o+2),o=s.substring(0,o);let u=i&&i.boundary,l=!i||i.clip!==!1,c=i&&i.merge&&a&&o&&new RegExp(a+" "+o,"g");i=i&&i.ellipsis;var p=0;if(typeof i=="object"){var m=i.template;p=m.length-2,i=i.pattern}typeof i!="string"&&(i=i===!1?"":"..."),p&&(i=m.replace("$1",i)),m=i.length-p;let g,f;typeof u=="object"&&(g=u.before,g===0&&(g=-1),f=u.after,f===0&&(f=-1),u=u.total||9e5),p=new Map;for(let lt=0,be,Vt,ct;lt<e.length;lt++){let ft;if(n)ft=e,ct=n;else{var d=e[lt];if(ct=d.field,!ct)continue;ft=d.result}Vt=r.get(ct),be=Vt.encoder,d=p.get(be),typeof d!="string"&&(d=be.encode(t),p.set(be,d));for(let ve=0;ve<ft.length;ve++){var y=ft[ve].doc;if(!y||(y=br(y,ct),!y))continue;var k=y.trim().split(/\s+/);if(!k.length)continue;y="";var R=[];let ht=[];for(var C=-1,N=-1,L=0,S=0;S<k.length;S++){var O=k[S],D=be.encode(O);D=D.length>1?D.join(" "):D[0];let J;if(D&&O){for(var $=O.length,X=(be.split?O.replace(be.split,""):O).length-D.length,K="",V=0,Z=0;Z<d.length;Z++){var se=d[Z];if(se){var re=se.length;re+=X<0?0:X,V&&re<=V||(se=D.indexOf(se),se>-1&&(K=(se?O.substring(0,se):"")+o+O.substring(se,se+re)+a+(se+re<$?O.substring(se+re):""),V=re,J=!0))}}K&&(u&&(C<0&&(C=y.length+(y?1:0)),N=y.length+(y?1:0)+K.length,L+=$,ht.push(R.length),R.push({match:K})),y+=(y?" ":"")+K)}if(!J)O=k[S],y+=(y?" ":"")+O,u&&R.push({text:O});else if(u&&L>=u)break}if(L=ht.length*(s.length-2),g||f||u&&y.length-L>u)if(L=u+L-m*2,S=N-C,g>0&&(S+=g),f>0&&(S+=f),S<=L)k=g?C-(g>0?g:0):C-((L-S)/2|0),R=f?N+(f>0?f:0):k+L,l||(k>0&&y.charAt(k)!==" "&&y.charAt(k-1)!==" "&&(k=y.indexOf(" ",k),k<0&&(k=0)),R<y.length&&y.charAt(R-1)!==" "&&y.charAt(R)!==" "&&(R=y.lastIndexOf(" ",R),R<N?R=N:++R)),y=(k?i:"")+y.substring(k,R)+(R<y.length?i:"");else{for(N=[],C={},L={},S={},O={},D={},K=X=$=0,Z=V=1;;){var _e=void 0;for(let J=0,ae;J<ht.length;J++){if(ae=ht[J],K)if(X!==K){if(S[J+1])continue;if(ae+=K,C[ae]){$-=m,L[J+1]=1,S[J+1]=1;continue}if(ae>=R.length-1){if(ae>=R.length){S[J+1]=1,ae>=k.length&&(L[J+1]=1);continue}$-=m}if(y=R[ae].text,re=f&&D[J])if(re>0){if(y.length>re)if(S[J+1]=1,l)y=y.substring(0,re);else continue;(re-=y.length)||(re=-1),D[J]=re}else{S[J+1]=1;continue}if($+y.length+1<=u)y=" "+y,N[J]+=y;else if(l)_e=u-$-1,_e>0&&(y=" "+y.substring(0,_e),N[J]+=y),S[J+1]=1;else{S[J+1]=1;continue}}else{if(S[J])continue;if(ae-=X,C[ae]){$-=m,S[J]=1,L[J]=1;continue}if(ae<=0){if(ae<0){S[J]=1,L[J]=1;continue}$-=m}if(y=R[ae].text,re=g&&O[J])if(re>0){if(y.length>re)if(S[J]=1,l)y=y.substring(y.length-re);else continue;(re-=y.length)||(re=-1),O[J]=re}else{S[J]=1;continue}if($+y.length+1<=u)y+=" ",N[J]=y+N[J];else if(l)_e=y.length+1-(u-$),_e>=0&&_e<y.length&&(y=y.substring(_e)+" ",N[J]=y+N[J]),S[J]=1;else{S[J]=1;continue}}else{y=R[ae].match,g&&(O[J]=g),f&&(D[J]=f),J&&$++;let Jt;if(ae?!J&&m&&($+=m):(L[J]=1,S[J]=1),ae>=k.length-1||ae<R.length-1&&R[ae+1].match?Jt=1:m&&($+=m),$-=s.length-2,!J||$+y.length<=u)N[J]=y;else{_e=V=Z=L[J]=0;break}Jt&&(L[J+1]=1,S[J+1]=1)}$+=y.length,_e=C[ae]=1}if(_e)X===K?K++:X++;else{if(X===K?V=0:Z=0,!V&&!Z)break;V?(X++,K=X):K++}}y="";for(let J=0,ae;J<N.length;J++)ae=(L[J]?J?" ":"":(J&&!i?" ":"")+i)+N[J],y+=ae;i&&!L[N.length]&&(y+=i)}c&&(y=y.replace(c," ")),ft[ve].highlight=y}if(n)break}return e}function oe(t,e){if(!this||this.constructor!==oe)return new oe(t,e);let r=0,n,i,s,o,a,u;if(t&&t.index){let l=t;if(e=l.index,r=l.boost||0,i=l.query){s=l.field||l.pluck,o=l.highlight;let c=l.resolve;t=l.async||l.queue,l.resolve=!1,l.index=null,t=t?e.searchAsync(l):e.search(l),l.resolve=c,l.index=e,t=t.result||t}else t=[]}if(t&&t.then){let l=this;t=t.then(function(c){l.C[0]=l.result=c.result||c,ki(l)}),n=[t],t=[],a=new Promise(function(c){u=c})}this.index=e||null,this.result=t||[],this.h=r,this.C=n||[],this.await=a||null,this.return=u||null,this.highlight=o||null,this.query=i||"",this.field=s||""}H=oe.prototype;H.limit=function(t){if(this.await){let e=this;this.C.push(function(){return e.limit(t).result})}else if(this.result.length){let e=[];for(let r=0,n;r<this.result.length;r++)if(n=this.result[r])if(n.length<=t){if(e[r]=n,t-=n.length,!t)break}else{e[r]=n.slice(0,t);break}this.result=e}return this};H.offset=function(t){if(this.await){let e=this;this.C.push(function(){return e.offset(t).result})}else if(this.result.length){let e=[];for(let r=0,n;r<this.result.length;r++)(n=this.result[r])&&(n.length<=t?t-=n.length:(e[r]=n.slice(t),t=0));this.result=e}return this};H.boost=function(t){if(this.await){let e=this;this.C.push(function(){return e.boost(t).result})}else this.h+=t;return this};function ki(t,e){let r=t.result;var n=t.await;t.await=null;for(let i=0,s;i<t.C.length;i++)if(s=t.C[i]){if(typeof s=="function")r=s(),t.C[i]=r=r.result||r,i--;else if(s.h)r=s.h(),t.C[i]=r=r.result||r,i--;else if(s.then)return t.await=n}return n=t.return,t.C=[],t.return=null,e||n(r),r}H.resolve=function(t,e,r,n,i){let s=this.await?ki(this,!0):this.result;if(s.then){let o=this;return s.then(function(){return o.resolve(t,e,r,n,i)})}return s.length&&(typeof t=="object"?(n=t.highlight||this.highlight,r=!!n||t.enrich,e=t.offset,t=t.limit):(n=n||this.highlight,r=!!n||r),s=i?r?zt.call(this.index,s):s:Oi.call(this.index,s,t||100,e,r)),this.finalize(s,n)};H.finalize=function(t,e){if(t.then){let n=this;return t.then(function(i){return n.finalize(i,e)})}e&&t.length&&this.query&&(t=rn(this.query,t,this.index.index,this.field,e));let r=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",r&&r(t),t};function nn(t,e,r,n,i,s,o){let a=t.length,u=[],l,c;l=le();for(let p=0,m,g,f,d;p<e;p++)for(let y=0;y<a;y++)if(f=t[y],p<f.length&&(m=f[p]))for(let k=0;k<m.length;k++){if(g=m[k],(c=l[g])?l[g]++:(c=0,l[g]=1),d=u[c]||(u[c]=[]),!o){let R=p+(y||!i?0:s||0);d=d[R]||(d[R]=[])}if(d.push(g),o&&r&&c===a-1&&d.length-n===r)return n?d.slice(n):d}if(t=u.length)if(i)u=u.length>1?To(u,r,n,o,s):(u=u[0])&&r&&u.length>r||n?u.slice(n,r+n):u;else{if(t<a)return[];if(u=u[t-1],r||n)if(o)(u.length>r||n)&&(u=u.slice(n,r+n));else{i=[];for(let p=0,m;p<u.length;p++)if(m=u[p]){if(n&&m.length>n)n-=m.length;else if((r&&m.length>r||n)&&(m=m.slice(n,r+n),r-=m.length,n&&(n-=m.length)),i.push(m),!r)break}u=i}}return u}function To(t,e,r,n,i){let s=[],o=le(),a;var u=t.length;let l;if(n){for(i=u-1;i>=0;i--)if(l=(n=t[i])&&n.length){for(u=0;u<l;u++)if(a=n[u],!o[a]){if(o[a]=1,r)r--;else if(s.push(a),s.length===e)return s}}}else for(let c=u-1,p,m=0;c>=0;c--){p=t[c];for(let g=0;g<p.length;g++)if(l=(n=p[g])&&n.length){for(let f=0;f<l;f++)if(a=n[f],!o[a])if(o[a]=1,r)r--;else{let d=(g+(c<u-1&&i||0))/(c+1)|0;if((s[d]||(s[d]=[])).push(a),++m===e)return s}}}return s}function tc(t,e,r,n,i){let s=le(),o=[];for(let a=0,u;a<e.length;a++){u=e[a];for(let l=0;l<u.length;l++)s[u[l]]=1}if(i){for(let a=0,u;a<t.length;a++)if(u=t[a],s[u]){if(n)n--;else if(o.push(u),s[u]=0,r&&--r===0)break}}else for(let a=0,u,l;a<t.result.length;a++)for(u=t.result[a],e=0;e<u.length;e++)l=u[e],s[l]&&((o[a]||(o[a]=[])).push(l),s[l]=0);return o}le();vt.prototype.search=function(t,e,r,n){r||(!e&&_r(t)?(r=t,t=""):_r(e)&&(r=e,e=0));let i=[];var s=[];let o,a,u,l,c,p,m=0,g=!0,f;if(r){r.constructor===Array&&(r={index:r}),t=r.query||t,o=r.pluck,a=r.merge,l=r.boost,p=o||r.field||(p=r.index)&&(p.index?null:p);var d=this.tag&&r.tag;u=r.suggest,g=r.resolve!==!1,c=r.cache,f=g&&this.store&&r.highlight;var y=!!f||g&&this.store&&r.enrich;e=r.limit||e;var k=r.offset||0;if(e||(e=g?100:0),d&&(!this.db||!n)){d.constructor!==Array&&(d=[d]);var R=[];for(let O=0,D;O<d.length;O++)if(D=d[O],D.field&&D.tag){var C=D.tag;if(C.constructor===Array)for(var N=0;N<C.length;N++)R.push(D.field,C[N]);else R.push(D.field,C)}else{C=Object.keys(D);for(let $=0,X,K;$<C.length;$++)if(X=C[$],K=D[X],K.constructor===Array)for(N=0;N<K.length;N++)R.push(X,K[N]);else R.push(X,K)}if(d=R,!t){if(s=[],R.length)for(d=0;d<R.length;d+=2){if(this.db){if(n=this.index.get(R[d]),!n)continue;s.push(n=n.db.tag(R[d+1],e,k,y))}else n=rc.call(this,R[d],R[d+1],e,k,y);i.push(g?{field:R[d],tag:R[d+1],result:n}:[n])}if(s.length){let O=this;return Promise.all(s).then(function(D){for(let $=0;$<D.length;$++)g?i[$].result=D[$]:i[$]=D[$];return g?i:new oe(i.length>1?nn(i,1,0,0,u,l):i[0],O)})}return g?i:new oe(i.length>1?nn(i,1,0,0,u,l):i[0],this)}}g||o||!(p=p||this.field)||(Pe(p)?o=p:(p.constructor===Array&&p.length===1&&(p=p[0]),o=p.field||p.index)),p&&p.constructor!==Array&&(p=[p])}p||(p=this.field);let L;R=(this.worker||this.db)&&!n&&[];for(let O=0,D,$,X;O<p.length;O++){if($=p[O],this.db&&this.tag&&!this.B[O])continue;let K;if(Pe($)||(K=$,$=K.field,t=K.query||t,e=Bt(K.limit,e),k=Bt(K.offset,k),u=Bt(K.suggest,u),f=g&&this.store&&Bt(K.highlight,f),y=!!f||g&&this.store&&Bt(K.enrich,y),c=Bt(K.cache,c)),n)D=n[O];else{C=K||r||{},N=C.enrich;var S=this.index.get($);if(d&&(this.db&&(C.tag=d,C.field=p,L=S.db.support_tag_search),!L&&N&&(C.enrich=!1),L||(C.limit=0,C.offset=0)),D=c?S.searchCache(t,d&&!L?0:e,C):S.search(t,d&&!L?0:e,C),d&&!L&&(C.limit=e,C.offset=k),N&&(C.enrich=N),R){R[O]=D;continue}}if(X=(D=D.result||D)&&D.length,d&&X){if(C=[],N=0,this.db&&n){if(!L)for(S=p.length;S<n.length;S++){let V=n[S];if(V&&V.length)N++,C.push(V);else if(!u)return g?i:new oe(i,this)}}else for(let V=0,Z,se;V<d.length;V+=2){if(Z=this.tag.get(d[V]),!Z){if(u)continue;return g?i:new oe(i,this)}if(se=(Z=Z&&Z.get(d[V+1]))&&Z.length)N++,C.push(Z);else if(!u)return g?i:new oe(i,this)}if(N){if(D=tc(D,C,e,k,g),X=D.length,!X&&!u)return g?D:new oe(D,this);N--}}if(X)s[m]=$,i.push(D),m++;else if(p.length===1)return g?i:new oe(i,this)}if(R){if(this.db&&d&&d.length&&!L)for(y=0;y<d.length;y+=2){if(s=this.index.get(d[y]),!s){if(u)continue;return g?i:new oe(i,this)}R.push(s.db.tag(d[y+1],e,k,!1))}let O=this;return Promise.all(R).then(function(D){return r&&(r.resolve=g),D.length&&(D=O.search(t,e,r,D)),D})}if(!m)return g?i:new oe(i,this);if(o&&(!y||!this.store))return i=i[0],g?i:new oe(i,this);for(R=[],k=0;k<s.length;k++){if(d=i[k],y&&d.length&&typeof d[0].doc=="undefined"&&(this.db?R.push(d=this.index.get(this.field[0]).db.enrich(d)):d=zt.call(this,d)),o)return g?f?rn(t,d,this.index,o,f):d:new oe(d,this);i[k]={field:s[k],result:d}}if(y&&this.db&&R.length){let O=this;return Promise.all(R).then(function(D){for(let $=0;$<D.length;$++)i[$].result=D[$];return f&&(i=rn(t,i,O.index,o,f)),a?xo(i):i})}return f&&(i=rn(t,i,this.index,o,f)),a?xo(i):i};function xo(t){let e=[],r=le(),n=le();for(let i=0,s,o,a,u,l,c,p;i<t.length;i++){s=t[i],o=s.field,a=s.result;for(let m=0;m<a.length;m++)l=a[m],typeof l!="object"?l={id:u=l}:u=l.id,(c=r[u])?c.push(o):(l.field=r[u]=[o],e.push(l)),(p=l.highlight)&&(c=n[u],c||(n[u]=c={},l.highlight=c),c[o]=p)}return e}function rc(t,e,r,n,i){return t=this.tag.get(t),t?(t=t.get(e),t?(e=t.length-n,e>0&&((r&&e>r||n)&&(t=t.slice(n,n+r)),i&&(t=zt.call(this,t))),t):[]):[]}function zt(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);let e=Array(t.length);for(let r=0,n;r<t.length;r++)n=t[r],e[r]={id:n,doc:this.store.get(n)};return e}function vt(t){if(!this||this.constructor!==vt)return new vt(t);let e=t.document||t.doc||t,r,n;if(this.B=[],this.field=[],this.D=[],this.key=(r=e.key||e.id)&&sn(r,this.D)||"id",(n=t.keystore||0)&&(this.keystore=n),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?n?new Me(n):new Set:n?new De(n):new Map,this.h=(r=e.store||null)&&r&&r!==!0&&[],this.store=r?n?new De(n):new Map:null,this.cache=(r=t.cache||null)&&new St(r),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=nc.call(this,t,e),this.tag=null,(r=e.tag)&&(typeof r=="string"&&(r=[r]),r.length)){this.tag=new Map,this.A=[],this.F=[];for(let i=0,s,o;i<r.length;i++){if(s=r[i],o=s.field||s,!o)throw Error("The tag field from the document descriptor is undefined.");s.custom?this.A[i]=s.custom:(this.A[i]=sn(o,this.D),s.filter&&(typeof this.A[i]=="string"&&(this.A[i]=new String(this.A[i])),this.A[i].G=s.filter)),this.F[i]=o,this.tag.set(o,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(let i of this.index.values())i.then&&t.push(i);if(t.length){let i=this;return Promise.all(t).then(function(s){let o=0;for(let a of i.index.entries()){let u=a[0],l=a[1];l.then&&(l=s[o],i.index.set(u,l),o++)}return i})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}H=vt.prototype;H.mount=function(t){let e=this.field;if(this.tag)for(let s=0,o;s<this.F.length;s++){o=this.F[s];var r=void 0;this.index.set(o,r=new Le({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(o),r.tag=this.tag.get(o)}r=[];let n={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let s=0,o,a;s<e.length;s++){n.field=a=e[s],o=this.index.get(a);let u=new t.constructor(t.id,n);u.id=t.id,r[s]=u.mount(o),o.document=!0,s?o.bypass=!0:o.store=this.store}let i=this;return this.db=Promise.all(r).then(function(){i.db=!0})};H.commit=function(){return E(this,null,function*(){let t=[];for(let e of this.index.values())t.push(e.commit());yield Promise.all(t),this.reg.clear()})};H.destroy=function(){let t=[];for(let e of this.index.values())t.push(e.destroy());return Promise.all(t)};function nc(t,e){let r=new Map,n=e.index||e.field||e;Pe(n)&&(n=[n]);for(let s=0,o,a;s<n.length;s++){if(o=n[s],Pe(o)||(a=o,o=o.field),a=_r(a)?Object.assign({},t,a):t,this.worker){var i=void 0;i=(i=a.encoder)&&i.encode?i:new $t(typeof i=="string"?Ai[i]:i||{}),i=new bt(a,i),r.set(o,i)}this.worker||r.set(o,new Le(a,this.reg)),a.custom?this.B[s]=a.custom:(this.B[s]=sn(o,this.D),a.filter&&(typeof this.B[s]=="string"&&(this.B[s]=new String(this.B[s])),this.B[s].G=a.filter)),this.field[s]=o}if(this.h){t=e.store,Pe(t)&&(t=[t]);for(let s=0,o,a;s<t.length;s++)o=t[s],a=o.field||o,o.custom?(this.h[s]=o.custom,o.custom.O=a):(this.h[s]=sn(a,this.D),o.filter&&(typeof this.h[s]=="string"&&(this.h[s]=new String(this.h[s])),this.h[s].G=o.filter))}return r}function sn(t,e){let r=t.split(":"),n=0;for(let i=0;i<r.length;i++)t=r[i],t[t.length-1]==="]"&&(t=t.substring(0,t.length-2))&&(e[n]=!0),t&&(r[n++]=t);return n<r.length&&(r.length=n),n>1?r:r[0]}H.append=function(t,e){return this.add(t,e,!0)};H.update=function(t,e){return this.remove(t).add(t,e)};H.remove=function(t){_r(t)&&(t=br(t,this.key));for(var e of this.index.values())e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let r of this.tag.values())for(let n of r){e=n[0];let i=n[1],s=i.indexOf(t);s>-1&&(i.length>1?i.splice(s,1):r.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this};H.clear=function(){let t=[];for(let e of this.index.values()){let r=e.clear();r.then&&t.push(r)}if(this.tag)for(let e of this.tag.values())e.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this};H.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)};H.cleanup=function(){for(let t of this.index.values())t.cleanup();return this};H.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(e){return e[0]&&e[0].doc||null}):this.store.get(t)||null};H.set=function(t,e){return typeof t=="object"&&(e=t,t=br(e,this.key)),this.store.set(t,e),this};H.searchCache=Ei;H.export=ic;H.import=sc;Ci(vt.prototype);function Ri(t,e=0){let r=[],n=[];e&&(e=25e4/e*5e3|0);for(let i of t.entries())n.push(i),n.length===e&&(r.push(n),n=[]);return n.length&&r.push(n),r}function Ii(t,e){e||(e=new Map);for(let r=0,n;r<t.length;r++)n=t[r],e.set(n[0],n[1]);return e}function Po(t,e=0){let r=[],n=[];e&&(e=25e4/e*1e3|0);for(let i of t.entries())n.push([i[0],Ri(i[1])[0]||[]]),n.length===e&&(r.push(n),n=[]);return n.length&&r.push(n),r}function Do(t,e){e||(e=new Map);for(let r=0,n,i;r<t.length;r++)n=t[r],i=e.get(n[0]),e.set(n[0],Ii(n[1],i));return e}function Mo(t){let e=[],r=[];for(let n of t.keys())r.push(n),r.length===25e4&&(e.push(r),r=[]);return r.length&&e.push(r),e}function Lo(t,e){e||(e=new Set);for(let r=0;r<t.length;r++)e.add(t[r]);return e}function on(t,e,r,n,i,s,o=0){let a=n&&n.constructor===Array;var u=a?n.shift():n;if(!u)return this.export(t,e,i,s+1);if((u=t((e?e+".":"")+(o+1)+"."+r,JSON.stringify(u)))&&u.then){let l=this;return u.then(function(){return on.call(l,t,e,r,a?n:null,i,s,o+1)})}return on.call(this,t,e,r,a?n:null,i,s,o+1)}function ic(t,e,r=0,n=0){if(r<this.field.length){let o=this.field[r];if((e=this.index.get(o).export(t,o,r,n=1))&&e.then){let a=this;return e.then(function(){return a.export(t,o,r+1)})}return this.export(t,o,r+1)}let i,s;switch(n){case 0:i="reg",s=Mo(this.reg),e=null;break;case 1:i="tag",s=this.tag&&Po(this.tag,this.reg.size),e=null;break;case 2:i="doc",s=this.store&&Ri(this.store),e=null;break;default:return}return on.call(this,t,e,i,s||null,r,n)}function sc(t,e){var r=t.split(".");r[r.length-1]==="json"&&r.pop();let n=r.length>2?r[0]:"";if(r=r.length>2?r[2]:r[1],this.worker&&n)return this.index.get(n).import(t);if(e){if(typeof e=="string"&&(e=JSON.parse(e)),n)return this.index.get(n).import(r,e);switch(r){case"reg":this.fastupdate=!1,this.reg=Lo(e,this.reg);for(let i=0,s;i<this.field.length;i++)s=this.index.get(this.field[i]),s.fastupdate=!1,s.reg=this.reg;if(this.worker){e=[];for(let i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=Do(e,this.tag);break;case"doc":this.store=Ii(e,this.store)}}}function Eo(t,e){let r="";for(let n of t.entries()){t=n[0];let i=n[1],s="";for(let o=0,a;o<i.length;o++){a=i[o]||[""];let u="";for(let l=0;l<a.length;l++)u+=(u?",":"")+(e==="string"?'"'+a[l]+'"':a[l]);u="["+u+"]",s+=(s?",":"")+u}s='["'+t+'",['+s+"]]",r+=(r?",":"")+s}return r}Le.prototype.remove=function(t,e){let r=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(r){if(this.fastupdate){for(let n=0,i,s;n<r.length;n++)if((i=r[n])&&(s=i.length))if(i[s-1]===t)i.pop();else{let o=i.indexOf(t);o>=0&&i.splice(o,1)}}else vr(this.map,t),this.depth&&vr(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&No(this)),this.cache&&this.cache.remove(t),this};function vr(t,e){let r=0;var n=typeof e=="undefined";if(t.constructor===Array){for(let i=0,s,o,a;i<t.length;i++)if((s=t[i])&&s.length){if(n)return 1;if(o=s.indexOf(e),o>=0){if(s.length>1)return s.splice(o,1),1;if(delete t[i],r)return 1;a=1}else{if(a)return 1;r++}}}else for(let i of t.entries())n=i[0],vr(i[1],e)?r++:t.delete(n);return r}var oc={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};Le.prototype.add=function(t,e,r,n){if(e&&(t||t===0)){if(!n&&!r&&this.reg.has(t))return this.update(t,e);n=this.depth,e=this.encoder.encode(e,!n);let l=e.length;if(l){let c=le(),p=le(),m=this.resolution;for(let g=0;g<l;g++){let f=e[this.rtl?l-1-g:g];var i=f.length;if(i&&(n||!p[f])){var s=this.score?this.score(e,f,g,null,0):en(m,l,g),o="";switch(this.tokenize){case"tolerant":if(Ve(this,p,f,s,t,r),i>2){for(let d=1,y,k,R,C;d<i-1;d++)y=f.charAt(d),k=f.charAt(d+1),R=f.substring(0,d)+k,C=f.substring(d+2),o=R+y+C,Ve(this,p,o,s,t,r),o=R+C,Ve(this,p,o,s,t,r);Ve(this,p,f.substring(0,f.length-1),s,t,r)}break;case"full":if(i>2){for(let d=0,y;d<i;d++)for(s=i;s>d;s--){o=f.substring(d,s),y=this.rtl?i-1-d:d;var a=this.score?this.score(e,f,g,o,y):en(m,l,g,i,y);Ve(this,p,o,a,t,r)}break}case"bidirectional":case"reverse":if(i>1){for(a=i-1;a>0;a--){o=f[this.rtl?i-1-a:a]+o;var u=this.score?this.score(e,f,g,o,a):en(m,l,g,i,a);Ve(this,p,o,u,t,r)}o=""}case"forward":if(i>1){for(a=0;a<i;a++)o+=f[this.rtl?i-1-a:a],Ve(this,p,o,s,t,r);break}default:if(Ve(this,p,f,s,t,r),n&&l>1&&g<l-1)for(i=this.N,o=f,s=Math.min(n+1,this.rtl?g+1:l-g),a=1;a<s;a++){f=e[this.rtl?l-1-g-a:g+a],u=this.bidirectional&&f>o;let d=this.score?this.score(e,o,g,f,a-1):en(i+(l/2>i?0:1),l,g,s-1,a-1);Ve(this,c,u?o:f,d,t,r,u?f:o)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(r?{ins:t}:{del:t}),this.M&&No(this)),this};function Ve(t,e,r,n,i,s,o){let a,u;if(!(a=e[r])||o&&!a[o]){if(o?(e=a||(e[r]=le()),e[o]=1,u=t.ctx,(a=u.get(o))?u=a:u.set(o,u=t.keystore?new De(t.keystore):new Map)):(u=t.map,e[r]=1),(a=u.get(r))?u=a:u.set(r,u=a=[]),s){for(let l=0,c;l<a.length;l++)if((c=a[l])&&c.includes(i)){if(l<=n)return;c.splice(c.indexOf(i),1),t.fastupdate&&(e=t.reg.get(i))&&e.splice(e.indexOf(c),1);break}}if(u=u[n]||(u[n]=[]),u.push(i),u.length===rt(2,31)-1){if(e=new Wt(u),t.fastupdate)for(let l of t.reg.values())l.includes(u)&&(l[l.indexOf(u)]=e);a[n]=u=e}t.fastupdate&&((n=t.reg.get(i))?n.push(u):t.reg.set(i,[u]))}}function en(t,e,r,n,i){return r&&t>1?e+(n||0)<=t?r+(i||0):(t-1)/(e+(n||0))*(r+(i||0))+1|0:0}Le.prototype.search=function(t,e,r){if(r||(e||typeof t!="object"?typeof e=="object"&&(r=e,e=0):(r=t,t="")),r&&r.cache)return r.cache=!1,t=this.searchCache(t,e,r),r.cache=!0,t;let n=[],i,s,o,a=0,u,l,c,p,m;r&&(t=r.query||t,e=r.limit||e,a=r.offset||0,s=r.context,o=r.suggest,m=(u=r.resolve)&&r.enrich,c=r.boost,p=r.resolution,l=this.db&&r.tag),typeof u=="undefined"&&(u=this.resolve),s=this.depth&&s!==!1;let g=this.encoder.encode(t,!s);if(i=g.length,e=e||(u?100:0),i===1)return Co.call(this,g[0],"",e,a,u,m,l);if(i===2&&s&&!o)return Co.call(this,g[1],g[0],e,a,u,m,l);let f=le(),d=0,y;if(s&&(y=g[0],d=1),p||p===0||(p=y?this.N:this.resolution),this.db){if(this.db.search&&(r=this.db.search(this,g,e,a,o,u,m,l),r!==!1))return r;let k=this;return(function(){return E(this,null,function*(){for(let R,C;d<i;d++){if((C=g[d])&&!f[C]){if(f[C]=1,R=yield xi(k,C,y,0,0,!1,!1),R=Oo(R,n,o,p)){n=R;break}y&&(o&&R&&n.length||(y=C))}o&&y&&d===i-1&&!n.length&&(p=k.resolution,y="",d=-1,f=le())}return Ao(n,p,e,a,o,c,u)})})()}for(let k,R;d<i;d++){if((R=g[d])&&!f[R]){if(f[R]=1,k=xi(this,R,y,0,0,!1,!1),k=Oo(k,n,o,p)){n=k;break}y&&(o&&k&&n.length||(y=R))}o&&y&&d===i-1&&!n.length&&(p=this.resolution,y="",d=-1,f=le())}return Ao(n,p,e,a,o,c,u)};function Ao(t,e,r,n,i,s,o){let a=t.length,u=t;if(a>1)u=nn(t,e,r,n,i,s,o);else if(a===1)return o?Oi.call(null,t[0],r,n):new oe(t[0],this);return o?u:new oe(u,this)}function Co(t,e,r,n,i,s,o){return t=xi(this,t,e,r,n,i,s,o),this.db?t.then(function(a){return i?a||[]:new oe(a,this)}):t&&t.length?i?Oi.call(this,t,r,n):new oe(t,this):i?[]:new oe([],this)}function Oo(t,e,r,n){let i=[];if(t&&t.length){if(t.length<=n){e.push(t);return}for(let s=0,o;s<n;s++)(o=t[s])&&(i[s]=o);if(i.length){e.push(i);return}}if(!r)return i}function xi(t,e,r,n,i,s,o,a){let u;return r&&(u=t.bidirectional&&e>r)&&(u=r,r=e,e=u),t.db?t.db.get(e,r,n,i,s,o,a):(t=r?(t=t.ctx.get(r))&&t.get(e):t.map.get(e),t)}function Le(t,e){if(!this||this.constructor!==Le)return new Le(t);if(t){var r=Pe(t)?t:t.preset;r&&(t=Object.assign({},oc[r],t))}else t={};r=t.context;let n=r===!0?{depth:1}:r||{},i=Pe(t.encoder)?Ai[t.encoder]:t.encode||t.encoder||{};this.encoder=i.encode?i:typeof i=="object"?new $t(i):{encode:i},this.resolution=t.resolution||9,this.tokenize=r=(r=t.tokenize)&&r!=="default"&&r!=="exact"&&r||"strict",this.depth=r==="strict"&&n.depth||0,this.bidirectional=n.bidirectional!==!1,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(r=t.keystore||0)&&(this.keystore=r),this.map=r?new De(r):new Map,this.ctx=r?new De(r):new Map,this.reg=e||(this.fastupdate?r?new De(r):new Map:r?new Me(r):new Set),this.N=n.resolution||3,this.rtl=i.rtl||t.rtl||!1,this.cache=(r=t.cache||null)&&new St(r),this.resolve=t.resolve!==!1,(r=t.db)&&(this.db=this.mount(r)),this.M=t.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}H=Le.prototype;H.mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)};H.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)};H.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function No(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}H.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this};H.append=function(t,e){return this.add(t,e,!0)};H.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)};H.update=function(t,e){let r=this,n=this.remove(t);return n&&n.then?n.then(()=>r.add(t,e)):this.add(t,e)};H.cleanup=function(){return this.fastupdate?(vr(this.map),this.depth&&vr(this.ctx),this):this};H.searchCache=Ei;H.export=function(t,e,r=0,n=0){let i,s;switch(n){case 0:i="reg",s=Mo(this.reg);break;case 1:i="cfg",s=null;break;case 2:i="map",s=Ri(this.map,this.reg.size);break;case 3:i="ctx",s=Po(this.ctx,this.reg.size);break;default:return}return on.call(this,t,e,i,s,r,n)};H.import=function(t,e){if(e)switch(typeof e=="string"&&(e=JSON.parse(e)),t=t.split("."),t[t.length-1]==="json"&&t.pop(),t.length===3&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=Lo(e,this.reg);break;case"map":this.map=Ii(e,this.map);break;case"ctx":this.ctx=Do(e,this.ctx)}};H.serialize=function(t=!0){let e="",r="",n="";if(this.reg.size){let s;for(var i of this.reg.keys())s||(s=typeof i),e+=(e?",":"")+(s==="string"?'"'+i+'"':i);e="index.reg=new Set(["+e+"]);",r=Eo(this.map,s),r="index.map=new Map(["+r+"]);";for(let o of this.ctx.entries()){i=o[0];let a=Eo(o[1],s);a="new Map(["+a+"])",a='["'+i+'",'+a+"]",n+=(n?",":"")+a}n="index.ctx=new Map(["+n+"]);"}return t?"function inject(index){"+e+r+n+"}":e+r+n};Ci(Le.prototype);var Fo=typeof window!="undefined"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),an=["map","ctx","tag","reg","cfg"],yt=le();function un(t,e={}){if(!this||this.constructor!==un)return new un(t,e);typeof t=="object"&&(e=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=e.field?e.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=e.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}H=un.prototype;H.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())};H.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),yt[t.id]||(yt[t.id]=[]),yt[t.id].push(t.field);let e=Fo.open(t.id,1);return e.onupgradeneeded=function(){let r=t.db=this.result;for(let n=0,i;n<an.length;n++){i=an[n];for(let s=0,o;s<yt[t.id].length;s++)o=yt[t.id][s],r.objectStoreNames.contains(i+(i!=="reg"&&o?":"+o:""))||r.createObjectStore(i+(i!=="reg"&&o?":"+o:""))}},t.db=ut(e,function(r){t.db=r,t.db.onversionchange=function(){t.close()}})};H.close=function(){this.db&&this.db.close(),this.db=null};H.destroy=function(){let t=Fo.deleteDatabase(this.id);return ut(t)};H.clear=function(){let t=[];for(let r=0,n;r<an.length;r++){n=an[r];for(let i=0,s;i<yt[this.id].length;i++)s=yt[this.id][i],t.push(n+(n!=="reg"&&s?":"+s:""))}let e=this.db.transaction(t,"readwrite");for(let r=0;r<t.length;r++)e.objectStore(t[r]).clear();return ut(e)};H.get=function(t,e,r=0,n=0,i=!0,s=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);let o=this;return ut(t).then(function(a){let u=[];if(!a||!a.length)return u;if(i){if(!r&&!n&&a.length===1)return a[0];for(let l=0,c;l<a.length;l++)if((c=a[l])&&c.length){if(n>=c.length){n-=c.length;continue}let p=r?n+Math.min(c.length-n,r):c.length;for(let m=n;m<p;m++)u.push(c[m]);if(n=0,u.length===r)break}return s?o.enrich(u):u}return a})};H.tag=function(t,e=0,r=0,n=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);let i=this;return ut(t).then(function(s){return!s||!s.length||r>=s.length?[]:!e&&!r?s:(s=s.slice(r,r+e),n?i.enrich(s):s)})};H.enrich=function(t){typeof t!="object"&&(t=[t]);let e=this.db.transaction("reg","readonly").objectStore("reg"),r=[];for(let n=0;n<t.length;n++)r[n]=ut(e.get(t[n]));return Promise.all(r).then(function(n){for(let i=0;i<n.length;i++)n[i]={id:t[i],doc:n[i]?JSON.parse(n[i]):null};return n})};H.has=function(t){return t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t),ut(t).then(function(e){return!!e})};H.search=null;H.info=function(){};H.transaction=function(t,e,r){t+=t!=="reg"&&this.field?":"+this.field:"";let n=this.h[t+":"+e];if(n)return r.call(this,n);let i=this.db.transaction(t,e);this.h[t+":"+e]=n=i.objectStore(t);let s=r.call(this,n);return this.h[t+":"+e]=null,ut(i).finally(function(){return s})};H.commit=function(t){return E(this,null,function*(){let e=t.commit_task,r=[];t.commit_task=[];for(let n=0,i;n<e.length;n++)i=e[n],i.del&&r.push(i.del);r.length&&(yield this.remove(r)),t.reg.size&&(yield this.transaction("map","readwrite",function(n){for(let i of t.map){let s=i[0],o=i[1];o.length&&(n.get(s).onsuccess=function(){let a=this.result;var u;if(a&&a.length){let l=Math.max(a.length,o.length);for(let c=0,p,m;c<l;c++)if((m=o[c])&&m.length){if((p=a[c])&&p.length)for(u=0;u<m.length;u++)p.push(m[u]);else a[c]=m;u=1}}else a=o,u=1;u&&n.put(a,s)})}}),yield this.transaction("ctx","readwrite",function(n){for(let i of t.ctx){let s=i[0],o=i[1];for(let a of o){let u=a[0],l=a[1];l.length&&(n.get(s+":"+u).onsuccess=function(){let c=this.result;var p;if(c&&c.length){let m=Math.max(c.length,l.length);for(let g=0,f,d;g<m;g++)if((d=l[g])&&d.length){if((f=c[g])&&f.length)for(p=0;p<d.length;p++)f.push(d[p]);else c[g]=d;p=1}}else c=l,p=1;p&&n.put(c,s+":"+u)})}}}),t.store?yield this.transaction("reg","readwrite",function(n){for(let i of t.store){let s=i[0],o=i[1];n.put(typeof o=="object"?JSON.stringify(o):1,s)}}):t.bypass||(yield this.transaction("reg","readwrite",function(n){for(let i of t.reg.keys())n.put(1,i)})),t.tag&&(yield this.transaction("tag","readwrite",function(n){for(let i of t.tag){let s=i[0],o=i[1];o.length&&(n.get(s).onsuccess=function(){let a=this.result;a=a&&a.length?a.concat(o):o,n.put(a,s)})}})),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())})};function _i(t,e,r){let n=t.value,i,s=0;for(let o=0,a;o<n.length;o++){if(a=r?n:n[o]){for(let u=0,l,c;u<e.length;u++)if(c=e[u],l=a.indexOf(c),l>=0)if(i=1,a.length>1)a.splice(l,1);else{n[o]=[];break}s+=a.length}if(r)break}s?i&&t.update(n):t.delete(),t.continue()}H.remove=function(t){return typeof t!="object"&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(e){e.openCursor().onsuccess=function(){let r=this.result;r&&_i(r,t)}}),this.transaction("ctx","readwrite",function(e){e.openCursor().onsuccess=function(){let r=this.result;r&&_i(r,t)}}),this.transaction("tag","readwrite",function(e){e.openCursor().onsuccess=function(){let r=this.result;r&&_i(r,t,!0)}}),this.transaction("reg","readwrite",function(e){for(let r=0;r<t.length;r++)e.delete(t[r])})])};function ut(t,e){return new Promise((r,n)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,r(this.result)},t.onerror=t.onblocked=n,t=null})}var cn={Index:Le,Charset:Ai,Encoder:$t,Document:vt,Worker:bt,Resolver:oe,IndexedDB:un,Language:{}};function fn(t){return t.replace(/\\u[\dA-F]{4}/gi,function(e){return String.fromCharCode(parseInt(e.replace(/\\u/g,""),16))})}var xt={},Je=class extends G{_prepare(){xt[this.uri]={index:{},conceptCache:{},schemeCache:{}}}get _index(){return xt[this.uri]&&xt[this.uri].index}get _conceptCache(){return xt[this.uri]&&xt[this.uri].conceptCache}get _schemeCache(){return xt[this.uri]&&xt[this.uri].schemeCache}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r?null:{schemes:[{uri:e,identifier:P.getAllUris(r).filter(i=>i!==e)}]}}_loadScheme(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);let s=P.getAllUris(e);for(let f of s)if(this._schemeCache[f])return this._schemeCache[f];let o=this.schemes.find(f=>P.compare(f,e));if(!o||!o.uri)throw new Ne({message:`Tried to load unsupported scheme (${e&&e.uri})`});let a=o.uri;s=[...new Set(s.concat(P.getAllUris(o)))];let u=".json";a.endsWith("/")&&(u="index.json");let l=yield this.axios(F(I({},r),{url:`${a}${u}`,_skipAdditionalParameters:!0}));if(l.id!==a)throw new Ne({message:"Skohub URL did not return expected concept scheme"});let{title:c,preferredNamespaceUri:p,hasTopConcept:m,description:g}=l;e={uri:a,identifier:s.filter(f=>f!==a)},e.prefLabel=c,Object.keys(e.prefLabel||{}).forEach(f=>{e.prefLabel[f]=fn(e.prefLabel[f])}),e.namespace=p,e.topConcepts=(m||[]).map(f=>this._toJskosConcept(f)),e.concepts=[null],g&&(e.definition=g,Object.keys(e.definition).forEach(f=>{e.definition[f]=[fn(e.definition[f])]}));for(let f of Object.keys(e).filter(d=>!e[d]))delete e[f];for(let f of s)this._schemeCache[f]=e;return e})}_loadConcept(n){return E(this,null,function*(){var i=n,{uri:e}=i,r=W(i,["uri"]);if(this._conceptCache[e])return this._conceptCache[e];try{let s=yield this.axios(F(I({},r),{url:`${e}.json`,_skipAdditionalParameters:!0}));if(s.id!==e)throw new Ne({message:"Skohub URL did not return expected concept URI"});let o=this._toJskosConcept(s);return this._conceptCache[e]=o,o}catch(s){return null}})}_toJskosConcept(e){let r={uri:e.id};return r.prefLabel=e.prefLabel,Object.keys(r.prefLabel||{}).forEach(n=>{r.prefLabel[n]=fn(r.prefLabel[n])}),r.narrower=(e.narrower||[]).map(n=>this._toJskosConcept(n)),r.notation=e.notation||[],e.broader&&e.broader.id&&(r.broader=[{uri:e.broader.id}]),e.inScheme&&e.inScheme.id&&(r.inScheme=[{uri:e.inScheme.id}]),e.scopeNote&&(r.scopeNote=e.scopeNote,Object.keys(r.scopeNote).forEach(n=>{r.scopeNote[n]=[fn(r.scopeNote[n])]})),r}getSchemes(){return E(this,arguments,function*(r={}){var e=W(r,[]);return Promise.all(this.schemes.map(n=>this._loadScheme(F(I({},e),{scheme:n}))))})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!e||!e.uri)throw new U({parameter:"scheme",message:"Missing scheme URI"});return e=yield this._loadScheme(I({scheme:e},r)),e.topConcepts||[]})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);return Array.isArray(e)||(e=[e]),(yield Promise.all(e.map(({uri:s})=>this._loadConcept(F(I({},r),{uri:s}))))).filter(Boolean)})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});if(e.ancestors&&e.ancestors[0]!==null)return e.ancestors;if(e=yield this._loadConcept(F(I({},r),{uri:e.uri})),!e||!e.broader||!e.broader.length)return[];let s=e.broader[0];return[s].concat(yield this.getAncestors(I({concept:s},r))).map(o=>({uri:o.uri}))})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});return e.narrower&&e.narrower[0]!==null||(e=yield this._loadConcept(F(I({},r),{uri:e.uri}))),e.narrower})}search(i){return E(this,arguments,function*({search:e,scheme:r,limit:n=100}){if(r=yield this._loadScheme({scheme:r}),!r||!r.uri)throw new U({parameter:"scheme"});if(!e)throw new U({parameter:"search"});let s;this._index[r.uri]||(this._index[r.uri]={});for(let u of[""].concat(this.languages)){if(this._index[r.uri][u]){s=this._index[r.uri][u];break}if(this._index[r.uri][u]!==null)try{let l=u?`.${u}.index`:".index";r.uri.endsWith("/")&&(l=`index${l}`);let c=yield this.axios({url:`${r.uri}${l}`,_skipAdditionalParameters:!0});if(c.length<100){this._index[r.uri][u]=null;continue}s=cn.create(),s.import(c),this._index[r.uri][u]=s;break}catch(l){this._index[r.uri][u]=null}}if(!s)throw new Ne({message:"Could not find search index for any of the available languages "+this.languages.join(",")});let o=s.search(e);return(yield this.getConcepts({concepts:o.map(u=>({uri:u}))})).slice(0,n)})}suggest(e){return E(this,null,function*(){e._raw=!0;let r=yield this.search(e),n=[e.search,[],[],[]];for(let i of r){let s=P.notation(i),o=P.prefLabel(i);n[1].push((s?s+" ":"")+o),n[2].push(""),n[3].push(i.uri)}return r._totalCount!=null?n._totalCount=r._totalCount:n._totalCount=r.length,n})}};ee(Je,"supports",{schemes:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,suggest:!0,search:!0});Je.providerName="Skohub";Je.providerType="http://bartoc.org/api-type/skohub";var Bo="https://lobid.org/gnd/",Ke={uri:"http://bartoc.org/en/node/430",concepts:[null],topConcepts:[],type:["http://www.w3.org/2004/02/skos/core#ConceptScheme"],DISPLAY:{hideNotation:!0},identifier:["http://www.wikidata.org/entity/Q36578"],license:[{uri:"http://creativecommons.org/publicdomain/zero/1.0/"}],namespace:"https://d-nb.info/gnd/",notation:["GND"],notationPattern:"[0-9X-]+",prefLabel:{de:"Gemeinsame Normdatei",en:"Integrated Authority File"},types:[{uri:"https://d-nb.info/standards/elementset/gnd#DifferentiatedPerson",prefLabel:{de:"Person",en:"Person"}},{uri:"https://d-nb.info/standards/elementset/gnd#PlaceOrGeographicName",prefLabel:{de:"Geografikum",en:"Place"}},{uri:"https://d-nb.info/standards/elementset/gnd#CorporateBody",prefLabel:{de:"Organisation",en:"Organization"}},{uri:"https://d-nb.info/standards/elementset/gnd#SubjectHeading",prefLabel:{de:"Sachbegriff",en:"Subject"}},{uri:"https://d-nb.info/standards/elementset/gnd#Work",prefLabel:{de:"Werk",en:"Work"}},{uri:"https://d-nb.info/standards/elementset/gnd#ConferenceOrEvent",prefLabel:{de:"Konferenz oder Veranstaltung",en:"ConferenceOrEvent"}}]},Di=new P.ConceptScheme({uri:"https://d-nb.info/standards/elementset/gnd",namespace:"https://d-nb.info/standards/elementset/gnd#"});Ke.types.forEach(t=>{t.notation=[Di.notationFromUri(t.uri)]});var ac=new P.ConceptScheme(Ke),Uo=["broaderTerm","broaderTermGeneral","broaderTermGeneric","broaderTermInstantial","broaderTermPartitive"],jo={sameAs:"http://www.w3.org/2004/02/skos/core#exactMatch",exactMatch:"http://www.w3.org/2004/02/skos/core#exactMatch",closeMatch:"http://www.w3.org/2004/02/skos/core#closeMatch",relatedDdcWithDegreeOfDeterminacy1:"http://www.w3.org/2004/02/skos/core#narrowMatch",relatedDdcWithDegreeOfDeterminacy2:"http://www.w3.org/2004/02/skos/core#narrowMatch",relatedDdcWithDegreeOfDeterminacy3:"http://www.w3.org/2004/02/skos/core#closeMatch",relatedDdcWithDegreeOfDeterminacy4:"http://www.w3.org/2004/02/skos/core#exactMatch"},uc=[{uri:"http://bartoc.org/en/node/241",uriPattern:"http://dewey.info/class/(.+)/"},{uri:"http://bartoc.org/en/node/18",namespace:"https://data.bnf.fr/ark:/12148/"},{uri:"http://bartoc.org/en/node/20450",namespace:"https://datos.bne.es/resource/"},{uri:"http://bartoc.org/en/node/1940",namespace:"http://www.wikidata.org/entity/"},{uri:"http://bartoc.org/en/node/294",namespace:"http://lod.gesis.org/thesoz/"},{uri:"http://bartoc.org/en/node/20425",namespace:"http://uri.gbv.de/terminology/tpro/"},{uri:"http://bartoc.org/en/node/2053",namespace:"http://viaf.org/viaf/"},{uri:"http://bartoc.org/en/node/305",uriPattern:"http?://aims.fao.org/aos/agrovoc/(.+)"},{uri:"http://bartoc.org/en/node/391",uriPattern:"http?://id.nlm.nih.gov/mesh/(.+)"},{uri:"http://bartoc.org/en/node/313",uriPattern:"http?://zbw.eu/stw/descriptor/(.+)"},{uri:"http://bartoc.org/en/node/443",uriPattern:"https?://purl.org/bncf/tid/(.+)"},{uri:"http://bartoc.org/en/node/454",uriPattern:"http?://id.loc.gov/authorities/subjects/(.+)"},{uri:"http://bartoc.org/en/node/18536",uriPattern:"http?://id.loc.gov/authorities/names/(.+)"}].map(t=>new P.ConceptScheme(t));function Ti(t){var n,i;let e={uri:t.id,notation:[t.gndIdentifier],prefLabel:{de:t.preferredName},inScheme:[{uri:Ke.uri}]};t.variantName&&(e.altLabel={de:t.variantName}),(n=t.usingInstructions)!=null&&n.length&&(e.scopeNote={de:t.usingInstructions}),e.type=t.type.map(s=>Di.uriFromNotation(s)).filter(Boolean),e.broader=[],Uo.forEach(s=>{e.broader=e.broader.concat(t[s]||[])}),e.broader=e.broader.map(s=>({uri:s.id})),e.uri&&(e.identifier=[e.uri.replace("https://","http://")]);let r=[];for(let s of Object.keys(jo)){let o=jo[s];(i=t[s])!=null&&i.length&&(r=r.concat(t[s].map(a=>{let u=uc.find(c=>c.notationFromUri(a.id)),l=u==null?void 0:u.conceptFromUri(a.id);return!u||!l?null:(u.uri==="http://bartoc.org/en/node/241"&&(l.uri+="e23/"),{from:{memberSet:[{uri:e.uri,notation:e.notation}]},fromScheme:{uri:Ke.uri},to:{memberSet:[l]},toScheme:{uri:u.uri},type:[o]})}).filter(Boolean)))}return r.length&&(e.mappings=r),e}function Pi(t){return t&&t.startsWith("http://")?t.replace("http://","https://"):t}var Ye=class extends G{_setup(){this._api.api||(this._api.api=Bo)}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r||!P.compare(r,Ke)||e!=="https://lobid.org/gnd/api"?null:{api:Bo,schemes:[Ke]}}getSchemes(){return E(this,null,function*(){return[Ke]})}getTop(){return E(this,null,function*(){return[]})}getConcepts(r){return E(this,arguments,function*({concepts:e}){if(!e)throw new i.InvalidOrMissingParameterError({parameter:"concepts"});Array.isArray(e)||(e=[e]);let n=e.map(o=>{var a,u;return(a=o==null?void 0:o.notation)!=null&&a[0]?(u=o==null?void 0:o.notation)==null?void 0:u[0]:ac.notationFromUri(Pi(o==null?void 0:o.uri))}).filter(Boolean),i=[],s=yield Promise.all(n.map(o=>E(this,null,function*(){try{let a=yield pe.get(`${this._api.api}${o}.json`);return Ti(a.data)}catch(a){i.push(a)}})));if(i.length===e.length)throw i[0];return s.filter(Boolean)})}getNarrower(i){return E(this,arguments,function*({concept:e,limit:r=200,offset:n=0}){if(!e||!e.uri)throw new U({parameter:"concept"});let s=Pi(e.uri),o=Uo.map(u=>`${u}.id:"${s}"`).join(" OR ");return(yield pe.get(`${this._api.api}search`,{params:{q:o,format:"json",size:r,from:n}})).data.member.map(u=>Ti(u))})}suggest(e){return E(this,null,function*(){let r=yield this._search(F(I({},e),{format:"json:suggest"}));return[e.search,r.map(n=>n.label),[],r.map(n=>n.id)]})}search(e){return E(this,null,function*(){return(yield this._search(e)).member.map(n=>Ti(n))})}_search(o){return E(this,arguments,function*({search:e,types:r,limit:n=100,offset:i=0,format:s="json"}){if(!e)throw new U({parameter:"search"});let a="";return r=(r==null?void 0:r.map(l=>Di.notationFromUri(Pi(l))).filter(Boolean))||[],r.length&&(a=r.map(l=>`type:${l}`).join(" OR ")),(yield pe.get(`${this._api.api}search`,{params:{q:e,filter:a,format:s,size:n,from:i}})).data})}getTypes(r){return E(this,arguments,function*({scheme:e}){if(!e||!P.compare(e,Ke))throw new U({parameter:"search",message:e!=null&&e.uri?`scheme ${e==null?void 0:e.uri} not supported`:""});return Ke.types})}};ee(Ye,"supports",{schemes:!0,data:!0,concepts:!0,narrower:!0,suggest:!0,search:!0,types:!0});Ye.providerName="LobidApi";Ye.providerType="http://bartoc.org/api-type/lobid-gnd";var Xe=class extends G{_getApiUrl(e,r){let n=this.uri||"";n.endsWith("/")&&(n=n.slice(0,-1));for(let i of e)if(i)n+="/"+i;else return;if(r){let i=Object.keys(r).map(s=>`${s}=${encodeURIComponent(r[s])}`).join("&");n+=(n.includes("?")?"&":"?")+i}return n}_artefactToJSKOS(e){let r=e.language||this._language||"en",n={};return e.subject&&(n.subject=[e.subject]),e.includedInDataCatalog&&(n.api=[e.includedInDataCatalog]),e["@type"]&&(n["@type"]=e["@type"]),e.type&&(n.type=[e.type]),e.source_name&&(n.notation=[e.source_name]),e.short_form&&(n.notation?n.notation.push(e.short_form):n.notation=[e.short_form]),e.label&&(n.prefLabel={},n.prefLabel[r]=[],n.prefLabel[r].push(e.label)),e.synonyms&&(n.altLabel={},n.altLabel[r]=e.synonyms),e.descriptions&&(n.definition={},n.definition[r]=e.descriptions),e.language&&(n.languages=e.language),e["@id"]&&(n.uri=e["@id"]),e.iri&&(n.iri=e.iri),e.identifier&&(n.identifier=[e.identifier]),e.source&&(n.source=[e.source]),e.source_url&&(n.namespace=e.source_url),e.landingPage&&(n.url=e.landingPage),e.version&&(n.version=e.version),e.modified&&(n.modified=e.modified),e.created&&(n.created=e.created),e.hasFormat&&(n.format=e.hasFormat),e.license&&(n.license=[e.license]),e.creator&&(n.creator=e.creator),e.contributor&&(n.contributor={},n.contributor.prefLabel={},n.contributor.prefLabel[r]=e.contributor),e.publisher&&(n.publisher={},n.publisher[r]=e.publisher),e.released&&(n.issued=e.released),e.children&&(n.narrower={},n.narrower[r]=e.children),n}_request(e,...r){return E(this,null,function*(){if(!e)return;let n=yield this.axios(I({method:"get",url:e,headers:{"Content-Type":"application/json",Accept:"application/json"}},r));if(!(n!=null&&n._url)||Object.keys(n).length!=1)return n})}_getSchemesMod(){return E(this,null,function*(){let e=this._getApiUrl(["artefacts"],null);return yield this._request(e)})}_getSchemesModLimit(e){return E(this,null,function*(){let r=yield this._getSchemesMod();return e&&e>0?r.slice(0,e):r})}_getSchemeMod(e){return E(this,null,function*(){if(e.short)return yield this._getSchemeFromShort(e.short);if(e.uri)return yield this._getSchemeFromUri(e.uri)})}_getSchemeFromShort(e){return E(this,null,function*(){let r=this._getApiUrl(["artefacts",e],null);return yield this._request(r)})}_getSchemeFromUri(e){return E(this,null,function*(){let r=yield this._getSchemesMod();if(r){for(let n of yield r)if(n.source==e||n.source_url==e||n.source_name==e||n["@id"]==e||n.iri==e||n.includedInDataCatalog&&n.includedInDataCatalog.includes(e))return yield n}})}_getConceptsMod(e){return E(this,null,function*(){let r=yield this._schemeShortFromObj(e);if(!r)return[];let n=this._getApiUrl(["artefacts",r,"resources","concepts"],null),i=yield this._request(n);if(!i)return[];let{page:s,totalPages:o,member:a}=i,u=[];for(let l of a)l&&u.push(l);for(let l=s+1;l<=o;l++){let c=this._getApiUrl(["artefacts",r,"resources","concepts"],{page:l}),p=yield this._request(c);if(!p)break;let{member:m}=p;for(let g of m)g&&u.push(g)}return u})}_getConceptsModLimit(e,r){return E(this,null,function*(){let n=yield this._getConceptsMod(e);return r&&r>0?n.slice(0,r):n})}_getConceptMod(e){return E(this,null,function*(){let{conceptNotation:r,schemeShort:n}=yield this._conceptNotationFromObj(e),i=this._getApiUrl(["artefacts",n,"resources","concepts",r],null);return yield this._request(i)})}_containsString(e,r){for(let n in e){let i=e[n];if(typeof i=="string"&&i.includes(r)||typeof i=="object"&&i!==null&&this.containsString(i,r))return!0}return!1}_getSchemesContaining(e){return E(this,null,function*(){let r=[],n=yield this._getSchemesMod();for(let i of n)this.containsString(i,e)&&r.push(i);return r})}_getSchemeShort(e){return E(this,null,function*(){let r=yield this._getSchemeFromUri(e);if(r)return yield r.short_form.toLowerCase()})}_getconceptNotation(e){return e.split("/").pop()}_schemeShortFromObj(e){return E(this,null,function*(){if(e.short)return e.short;if(e.uri)return yield this._getSchemeShort(e.uri)})}_conceptNotationFromObj(e){return E(this,null,function*(){if(!e.inScheme||!e.inScheme[0])return;let r=yield this._schemeShortFromObj(e.inScheme[0]),n=e.notation;return n||(n=yield this._getconceptNotation(e.uri)),{conceptNotation:n,schemeShort:r}})}_prepare(){}_setup(){}getSchemes(i){return E(this,null,function*(){var s=i,{schemes:e,limit:r}=s,n=W(s,["schemes","limit"]);let o=[],a=[];if(e)for(let u of e){let l=yield this._getSchemeMod(u);l&&a.push(l)}else a=yield this._getSchemesModLimit(r);for(let u of a){let l=yield this._artefactToJSKOS(u);l?o.push(l):console.warn("JSKOS transformation failed for artefact: ",u)}return o})}getConcepts(s){return E(this,null,function*(){var o=s,{concepts:e,scheme:r,limit:n}=o,i=W(o,["concepts","scheme","limit"]);let a=[];if(e)for(let u of e){let l=yield this._getConceptMod(u);if(l){let c=yield this._artefactToJSKOS(l);c?a.push(c):console.warn("JSKOS transformation failed for concept: ",l)}}else if(r){let u=yield this._getConceptsModLimit(r,n);for(let l of u){let c=yield this._artefactToJSKOS(l);c?a.push(c):console.warn("JSKOS transformation failed for concept: ",l)}}return a})}get _language(){return this._jskos.language||this.languages[0]||this._defaultLanguages[0]||"en"}getMappings(){return[]}};ee(Xe,"providerName","ModApi"),ee(Xe,"providerType","http://bartoc.org/en/node/20333"),ee(Xe,"supports",{schemes:!0,top:!1,data:!1,concepts:!0,narrower:!1,ancestors:!1,types:!1,suggest:!1,search:!1,auth:!1,mappings:!1,concordances:!1,annotations:!1,occurrences:!1});var Ge=class extends G{constructor(e){super(e),this.endpoint=e.endpoint}static _registryConfigForBartocApiConfig({url:e}={}){if(e)return{endpoint:e}}_getApiUrl(e,r={}){let n=this.endpoint+e.join("/");return r=Object.fromEntries(Object.entries(r).filter(([i,s])=>s!=null)),r=new URLSearchParams(r),r.size?`${n}?${r}`:n}_ontologyToJSKOS(e){var i;let r=e.lang||this._language||"en",n={};return e.iri&&(n.uri=e.iri),n.type=["http://www.w3.org/2004/02/skos/core#ConceptScheme"],e["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]&&(n.type=n.type.concat(e["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"])),e.title&&(n.prefLabel={},n.prefLabel[r]=e.title),e.description&&(n.definition={},n.definition[r]=[e.description]),e.homepage&&(n.url=e.homepage),e.tracker&&(n.issueTracker=[{url:e.tracker}]),e.language&&(n.languages=e.language),e.ontologyId&&(n.VOCID=e.ontologyId,n.notation=[e.ontologyId]),(i=e.license)!=null&&i.url&&(n.license=[{uri:e.license.url}]),n}_termToJSKOS(e){let r=e.language||this._language||"en",n={};return e.curie&&(n.notation=[e.curie]),e.hasDirectChildren?n.narrower=[null]:n.narrower=[],e.hasDirectParents?n.broader=[null]:n.broader=[],e.iri&&(n.uri=e.iri),e["http://www.w3.org/2000/01/rdf-schema#label"]&&(n.prefLabel={},n.prefLabel[r]=e["http://www.w3.org/2000/01/rdf-schema#label"]),n.type=["http://www.w3.org/2004/02/skos/core#Concept","http://www.w3.org/2002/07/owl#Class"],e.ontologyIri&&(n.inScheme=[{uri:e.ontologyIri}]),n}_request(n){return E(this,arguments,function*(e,r={_skipAdditionalParameters:!0}){if(e){e=new URL(e);let i=Object.fromEntries(e.searchParams.entries());return this.axios(I({method:"get",url:e.origin+e.pathname,params:I(I({},i),r.params)},r))}})}_paginate(e,r,n){return E(this,null,function*(){let i=n>0?n:null,s=this._getApiUrl(e,F(I({},r),{size:i})),o=yield this._request(s),a=(o==null?void 0:o.elements)||[];if(!i){let u=(o==null?void 0:o.totalPages)||0;for(let l=1;l<u;l++)s=this._getApiUrl(e,F(I({},r),{page:l})),o=yield this._request(s),a=a.concat((o==null?void 0:o.elements)||[])}return a})}_getConceptOls(e){return E(this,null,function*(){var n,i;let r=yield this._getSchemeVOCID((n=e==null?void 0:e.inScheme)==null?void 0:n[0]);if(r){let s=null;e.notation?s=this._getApiUrl(["ontologies",r,"classes"],{curie:e.notation}):e.uri&&(s=this._getApiUrl(["ontologies",r,"classes"],{iri:e.uri}));let o=yield this._request(s);return((i=o==null?void 0:o.elements)==null?void 0:i[0])||null}})}_searchOls(e,r,n,i){return E(this,null,function*(){let s=[],o={"http://www.w3.org/2002/07/owl#Class":"classes","http://www.w3.org/1999/02/22-rdf-syntax-ns#Property":"properties"};i!=null&&i.length||(i=Object.keys(o));for(let a of i)if(a in o){let u=r?yield this._getSchemeVOCID(r):null,l={search:e,ontology:u};if(!r||u){let c=yield this._paginate([o[a]],l,n);s.push(...c)}}return s})}_conceptIriFromObj(e,r){return E(this,null,function*(){let n=this._getApiUrl(["ontologies",e,"classes"],{curie:r}),i=yield this._request(n);if(i&&i.elements&&i.elements.length>0)return i.elements[0].iri})}get _language(){return this._jskos.language||this.languages[0]||this._defaultLanguages[0]||"en"}_getSchemeVOCID(e){return E(this,null,function*(){return e!=null&&e.VOCID?e.VOCID:this._getScheme(e).then(r=>r==null?void 0:r.ontologyId)})}_getScheme(e){return E(this,null,function*(){if(e){let{VOCID:r,uri:n,notation:i,identifier:s}=e;if(r)return this._request(this._getApiUrl(["ontologies",r]));if(n&&(e=yield this._getSchemeFromUri(n),e)||i!=null&&i[0]&&(n||s!=null&&s.length)&&(e=yield this._request(this._getApiUrl(["ontologies",i[0]])),e.iri===n||s!=null&&s.includes(e.iri)))return e;for(let o of s||[]){let a=yield this._getSchemeFromUri(o);if(a)return a}}})}_getSchemeFromUri(e){return E(this,null,function*(){if(e){let r=this._getApiUrl(["ontologies"],{searchFields:"iri",search:e}),n=yield this._request(r),i=(n==null?void 0:n.elements)||[];return i.reduce((s,o)=>o.ontologyId.length<s.ontologyId.length?o:s,i[0])}return null})}getSchemes(n){return E(this,arguments,function*({schemes:e,limit:r}){let i=[];if(e)i=(yield Promise.all(e.map(s=>this._getScheme(s)))).filter(Boolean);else if(r>0){let s=this._getApiUrl(["ontologies"],{size:r});i=(yield this._request(s)).elements||[]}else i=yield this._paginate(["ontologies"],{});return Promise.all(i.map(s=>this._ontologyToJSKOS(s)))})}getConcepts(i){return E(this,arguments,function*({concepts:e,scheme:r,limit:n}){let s=[];if(e)for(let o of e){let a=yield this._getConceptOls(o);a&&s.push(yield this._termToJSKOS(a))}else if(r){let o=yield this._getSchemeVOCID(r);if(o){let a=yield this._paginate(["ontologies",o,"classes"],{},n);s=Promise.all(a.map(u=>this._termToJSKOS(u)))}}return s})}getTop(r){return E(this,arguments,function*({scheme:e}){let n=yield this._getSchemeVOCID(e);if(n){let i=this._getApiUrl(["ontologies",n,"classes"],{hasDirectParents:"false"}),s=yield this._request(i);if(s!=null&&s.elements)return Promise.all(s.elements.map(o=>this._termToJSKOS(o)))}return[]})}_splitConcept(e){return E(this,null,function*(){var n;let r={};return e&&(r.VOCID=yield this._getSchemeVOCID((n=e==null?void 0:e.inScheme)==null?void 0:n[0]),r.iri=e.uri||(yield this._conceptIriFromObj(r.VOCID,e.notation)),r.iri=encodeURIComponent(encodeURIComponent(r.iri))),r})}getNarrower(r){return E(this,arguments,function*({concept:e}){let{VOCID:n,iri:i}=yield this._splitConcept(e);if(n&&i){let s=this._getApiUrl(["ontologies",n,"classes",i,"children"]),o=yield this._request(s);if(o!=null&&o.elements)return Promise.all(o.elements.map(a=>this._termToJSKOS(a)))}return[]})}getAncestors(r){return E(this,arguments,function*({concept:e}){let{VOCID:n,iri:i}=yield this._splitConcept(e);if(n&&i){let s=this._getApiUrl(["ontologies",n,"classes",i,"ancestors"]),o=yield this._request(s);if(o!=null&&o.elements)return Promise.all(o.elements.map(a=>this._termToJSKOS(a)))}return[]})}getTypes(){return E(this,null,function*(){return[{uri:"http://www.w3.org/2002/07/owl#Class",prefLabel:{en:"Class",de:"Klasse"}},{uri:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",prefLabel:{en:"Property",de:"Eigenschaft"}}]})}search(s){return E(this,arguments,function*({search:e,scheme:r=null,limit:n=0,types:i=["http://www.w3.org/2002/07/owl#Class"]}){let o=yield this._searchOls(e,r,n,i);return Promise.all(o.map(a=>this._termToJSKOS(a)))})}};ee(Ge,"providerName","OlsApi"),ee(Ge,"providerType","http://bartoc.org/api-type/ols"),ee(Ge,"supports",{schemes:!0,top:!0,data:!1,concepts:!0,narrower:!0,ancestors:!0,types:!0,suggest:!0,search:!0});var Se={},Qe=class extends G{_setup(){this._scheme=null}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r?null:{api:e}}_schemeInfoToJSKOS(e){let r=e.labels.find(s=>s.lang==="x-uri").text,n={};e.labels.filter(s=>!s.lang.startsWith("x-")).forEach(s=>{n[s.lang]=s.text});let i={uri:r,prefLabel:n};return e.categories&&e.categories.length&&(i.topConcepts=[null]),e.category&&e.category.length&&(i.concepts=[null]),i}_categoryToJSKOS(e,{scheme:r,broader:n=[]}){if(!e||!r)return null;let i=e.ID,s=`${r.uri}/${i}`;if(Se[r.uri].concepts[s])return Se[r.uri].concepts[s];let o={};e.labels.filter(u=>!u.lang.startsWith("x-")&&u.text).forEach(u=>{o[u.lang]=u.text.replace(`${i} `,""),Se[r.uri].searchIndex.add(s,o[u.lang])});let a={};return e.labels.filter(u=>!u.lang.startsWith("x-")&&u.description).forEach(u=>{a[u.lang]||(a[u.lang]=[]),a[u.lang].push(u.description)}),Se[r.uri].concepts[s]={uri:s,notation:[i],prefLabel:o,scopeNote:a,inScheme:[{uri:r.uri}],narrower:(e.categories||[]).map(u=>({uri:`${r.uri}/${u.ID}`})),broader:n},Se[r.uri].concepts[s]}_removeNarrower(e){return e&&Object.assign({},e,{narrower:e.narrower&&e.narrower.length?[null]:[]})}_loadSchemeData(e){return E(this,null,function*(){let r=yield this.axios(F(I({},e),{method:"get",url:this._api.api,_skipAdditionalParameters:!0}));this._scheme=this._schemeInfoToJSKOS(r);let n=this._scheme.uri;Se[n]={schemeInfo:r,searchIndex:cn.create({tokenize:"full"}),concepts:{}};let i=(s,{broader:o=[]}={})=>{let a=this._categoryToJSKOS(s,{scheme:this._scheme,broader:o});(s.categories||[]).forEach(u=>i(u,{broader:[{uri:a.uri}]}))};r.categories.forEach(s=>i(s)),Se[n].topConcepts=r.categories.map(s=>this._categoryToJSKOS(s,{scheme:this._scheme}))})}getSchemes(){return E(this,arguments,function*(e={}){if(!this._api.api)throw new xe;return this._scheme||(this._loadSchemeDataPromise||(this._loadSchemeDataPromise=this._loadSchemeData(e)),yield this._loadSchemeDataPromise),[this._scheme]})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!e||!e.uri)throw new U({parameter:"scheme",message:"Missing scheme URI"});if(this._scheme||(yield this.getSchemes(r)),!P.compare(e,this._scheme))throw new U({parameter:"scheme",message:"Requested vocabulary seems to be unsupported by this API."});return Se[this._scheme.uri].topConcepts.map(this._removeNarrower)})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);return Array.isArray(e)||(e=[e]),this._scheme||(yield this.getSchemes(r)),e.map(s=>Se[this._scheme.uri].concepts[s.uri]).map(this._removeNarrower)})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});if(e.ancestors&&e.ancestors[0]!==null)return e.ancestors;this._scheme||(yield this.getSchemes(r)),e=Se[this._scheme.uri].concepts[e.uri];let s=e&&e.broader&&e.broader[0];return s?[s].concat(yield this.getAncestors(I({concept:s},r))):[]})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});return e.narrower&&e.narrower[0]!==null?e.narrower:(this._scheme||(yield this.getSchemes(r)),e=Se[this._scheme.uri].concepts[e.uri],(e&&e.narrower||[]).map(s=>Se[this._scheme.uri].concepts[s.uri]).map(this._removeNarrower))})}search(i){return E(this,arguments,function*({search:e,scheme:r,limit:n=100}){if(!r||!r.uri)throw new U({parameter:"scheme"});if(!e)throw new U({parameter:"search"});if(!r||!r.uri)throw new U({parameter:"scheme",message:"Missing scheme URI"});if(this._scheme||(yield this.getSchemes()),!P.compare(r,this._scheme))throw new U({parameter:"scheme",message:"Requested vocabulary seems to be unsupported by this API."});return(yield Se[this._scheme.uri].searchIndex.search(e)).map(o=>Se[this._scheme.uri].concepts[o]).map(this._removeNarrower).slice(0,n)})}suggest(e){return E(this,null,function*(){e._raw=!0;let r=yield this.search(e),n=[e.search,[],[],[]];for(let i of r){let s=P.notation(i),o=P.prefLabel(i);n[1].push((s?s+" ":"")+o),n[2].push(""),n[3].push(i.uri)}return r._totalCount!=null?n._totalCount=r._totalCount:n._totalCount=r.length,n})}};ee(Qe,"supports",{schemes:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,suggest:!0,search:!0});Qe.providerName="MyCoRe";Qe.providerType="http://bartoc.org/api-type/mycore";var Sr={schemes:[]},Ze=class extends G{static _registryConfigForBartocApiConfig({url:e}={}){return e?{api:e}:null}getSchemes(){return E(this,null,function*(){var e,r;if(!Sr.schemes.length){let n=yield pe.post(this._api.api,{query:"query sources { sources { name uri description alternateName } }",operationName:"sources"}),i=((r=(e=n==null?void 0:n.data)==null?void 0:e.data)==null?void 0:r.sources)||[];if(i.length)Sr.schemes=i.map(s=>{let o={uri:s.uri,prefLabel:{und:s.name}};return s.desciption&&(o.description={und:[s.description]}),s.alternateName&&(o.notation=[s.alternateName]),o});else return[]}return Sr.schemes})}getConcepts(r){return E(this,arguments,function*({concepts:e}){var i,s;if(!e)throw new U({parameter:"concepts"});return Array.isArray(e)||(e=[e]),(((s=(i=(yield pe.post(this._api.api,{query:`query { lookup( uris: [${e.map(o=>`"${o.uri}"`)}], ) { uri source { ... on Source { uri } } result { ... on Term { uri prefLabel scopeNote altLabel broader { uri } narrower { uri } } } } }`})).data)==null?void 0:i.data)==null?void 0:s.lookup)||[]).map(o=>{var u,l,c,p,m,g,f,d,y,k;let a={uri:o.uri,inScheme:[Sr.schemes.find(R=>P.compare(R,{uri:o.source.uri}))]};return(l=(u=o.result)==null?void 0:u.prefLabel)!=null&&l[0]&&(a.prefLabel={und:o.result.prefLabel[0]}),(p=(c=o.result)==null?void 0:c.altLabel)!=null&&p[0]&&(a.altLabel={und:o.result.altLabel}),(g=(m=o.result)==null?void 0:m.scopeNote)!=null&&g[0]&&(a.scopeNote={und:o.result.scopeNote}),(d=(f=o.result)==null?void 0:f.broader)!=null&&d.length&&(a.broader=o.result.broader),(k=(y=o.result)==null?void 0:y.narrower)!=null&&k.length&&(a.narrower=o.result.narrower),a})})}suggest(e){return E(this,null,function*(){let r=e.search,n=yield this.search(e);return[r,n.map(i=>P.prefLabel(i,{fallbackToUri:!1})),[],n.map(i=>i.uri)]})}search(n){return E(this,arguments,function*({scheme:e,search:r}){var s,o,a,u,l;if(!r)throw new U({parameter:"search"});if(!e||!P.isContainedIn(e,Sr.schemes))throw new U({parameter:"scheme"});return(((l=(u=(a=(o=(s=(yield pe.post(this._api.api,{query:`query { terms( sources: ["${e.uri}"] query: "${r}" ) { source { uri } result { ... on Terms { terms { uri prefLabel scopeNote } } } }}`})).data)==null?void 0:s.data)==null?void 0:o.terms)==null?void 0:a[0])==null?void 0:u.result)==null?void 0:l.terms)||[]).map(c=>{var m,g,f;let p={uri:c.uri,inScheme:[e]};return(m=c.prefLabel)!=null&&m[0]&&(p.prefLabel={und:c.prefLabel[0]}),(g=c.altLabel)!=null&&g[0]&&(p.altLabel={und:c.altLabel}),(f=c.scopeNote)!=null&&f[0]&&(p.scopeNote={und:c.scopeNote[0]}),p})})}};ee(Ze,"supports",{schemes:!0,top:!1,data:!0,concepts:!0,narrower:!1,ancestors:!1,suggest:!0,search:!0});Ze.providerName="NoTApi";Ze.providerType="http://bartoc.org/api-type/noterms";var Ce={[G.providerName]:G,init(t){let e=t.provider;if(t.api&&Object.keys(this).find(r=>{if(Ce[r].prototype instanceof G&&t.api===Ce[r].providerType)return t=I({},t),delete t.api,e=r,!0}),this[e])return new this[e](t);throw new Ct},addProvider(t){if(t.prototype instanceof G||t===G)this[t.providerName]=t;else throw new Ct}};Ce.addProvider(Te);Ce.addProvider(Ie);Object.values(Ht).forEach(t=>{Ce.addProvider(t)});var Mi={},qt=class t{constructor(e){this.config=e,this.axios=pe.create()}setConfig(e){this.config=e}get config(){return this._config}set config(e){e=e||{},e.registries=e.registries||[],e.registries=e.registries.map(r=>Ce.init(r)).filter(r=>r),e.registries.forEach(r=>{r.cdk=this}),this._config=e}get providers(){return Ce}createInstance(e){return new t(e)}loadConfig(e){return E(this,null,function*(){let r=yield this.axios.get(e);this.config=r.data})}loadBuildInfo(o){var a=o,{url:e,buildInfo:r=null,interval:n=6e4,callback:i}=a,s=W(a,["url","buildInfo","interval","callback"]);if(!e&&!this.config.cocodaBaseUrl)throw new me({message:"Could not determine URL to load build config."});return e||(e=`${this.config.cocodaBaseUrl}build-info.json`),this.repeat(F(I({},s),{function:()=>E(this,null,function*(){return(yield this.axios.get(e,{headers:{"Cache-Control":"no-cache"}})).data}),interval:n,callback:(u,l,c)=>{u?i(u):(c||!c&&r&&!Re(l,r))&&i(null,l,c||r)}}))}getRegistryForUri(e){return this.config.registries.find(r=>r.uri==e)}initializeRegistry(e){return e=Ce.init(e),e.cdk=this,e}addProvider(e){Ce.addProvider(e)}static addProvider(e){Ce.addProvider(e)}repeat({function:e,interval:r=15e3,callback:n,callImmediately:i=!0}={}){if(!e)throw new U({parameter:"function"});if(typeof e!="function")throw new U({parameter:"function",message:"function needs to be a function"});let s=()=>E(null,null,function*(){return e()});if(r=parseInt(r),isNaN(r))throw new U({parameter:"interval"});if(!n)throw new U({parameter:"callback"});if(typeof n!="function")throw new U({parameter:"callback",message:"callback needs to be a function"});let o={timer:null,result:null,error:null,isPaused:!1,interval:r},a=m=>{let g=o.result;Re(g,m)||(o.result=m,o.error=null,n(null,m,g))},u=m=>{o.error=m,n(m)},l=m=>{o.isPaused||(o.timer=setTimeout(()=>{m()},o.interval))},c=()=>s().then(a).catch(u).then(()=>l(c)),p=(m=i)=>{m?c():l(c)};return p(),{start:(...m)=>{o.isPaused=!1,p(...m)},stop:()=>{o.isPaused=!0,o.timer?clearTimeout(o.timer):setTimeout(()=>{o.timer&&clearTimeout(o.timer)},o.interval)},get isPaused(){return o.isPaused},get lastResult(){return o.result},get hasErrored(){return!!o.error},get interval(){return o.interval},set interval(m){o.interval=m}}}getSchemes(){return E(this,arguments,function*(e={}){let r=[],n=[];for(let i of this.config.registries)if(i.has.schemes!==!1){let s=i.getSchemes(e).then(o=>{for(let l of o){l._registry=i,l.__DETAILSLOADED__=1,l.type=l.type||["http://www.w3.org/2004/02/skos/core#ConceptScheme"];let c=r.find(f=>P.compare(f,l)),p,m,g=!1;if(c){p=this.config.registries.indexOf(i),p!=-1&&(p=this.config.registries.length-p),m=this.config.registries.indexOf(c==null?void 0:c._registry),m!=-1&&(m=this.config.registries.length-m);let f=l.concepts?l.concepts.length==0?-1:1:0,d=c.concepts?c.concepts.length==0?-1:1:0;f>d?g=!0:f<d?g=!1:g=m<p}if(!c||g){if(g){let f=r.findIndex(R=>P.compare(R,c));f!=-1&&r.splice(f,1);let a=c,{concepts:d,topConcepts:y}=a,k=W(a,["concepts","topConcepts"]);l=P.merge(l,k,{mergeUris:!0,skipPaths:["_registry"]})}l._registry=i,r.push(l)}else{let f=r.findIndex(d=>P.compare(d,l));if(f!=-1){let d=r[f]._registry,u=l,{concepts:y,topConcepts:k}=u,R=W(u,["concepts","topConcepts"]);r[f]=P.merge(r[f],R,{mergeUris:!0,skipPaths:["_registry"]}),r[f]._registry=d}}}}).catch(o=>{console.warn("Couldn't load schemes for registry",i.uri,o)});n.push(s)}return yield Promise.all(n),r.forEach(i=>{let s=i._registry;delete i._registry;let o=this.registryForScheme(i);!o||o._api.api===s._api.api?i._registry=s:i._registry=o}),P.sortSchemes(r.filter(Boolean))})}registryForScheme(e,r="concepts"){var i;let n=e._registry;if(n)return n;for(let s of e.API||[]){let o=s,{type:a}=o,u=W(o,["type"]);let l=u.url,c=`${a}-${l}`;if(Mi[c]){let p=Mi[c];return Array.isArray(p._jskos.schemes)&&!P.isContainedIn(e,p._jskos.schemes)&&p._jskos.schemes.push(e),p}else{u.scheme=e;for(let p of Object.values(Ce)){if((p==null?void 0:p.providerType)!==a||!p._registryConfigForBartocApiConfig||r&&!((i=p==null?void 0:p.supports)!=null&&i[r]))continue;let m=p.providerName,g=Ce[m]._registryConfigForBartocApiConfig(u);if(g){g.provider=m;try{if(n=this.initializeRegistry(g),n)return Mi[c]=n,n}catch(f){continue}}}}}return null}};var zo=new qt;function lc(t){Object.values(Ht).forEach(e=>(t||zo).addProvider(e))}return Wa(cc);})();
|
|
15
|
+
`)}function Qn(t){let e=(t.identifier||[]).filter(r=>r&&!r.startsWith("urn:jskos:mapping:")).concat([eo(t),Zs(t)]).sort();return Object.assign({},t,{identifier:e})}function to(t,e,r){t=t&&Qn(t),e=e&&Qn(e);let n=t&&t.identifier?t.identifier.find(s=>s.startsWith(r)):null,i=e&&e.identifier?e.identifier.find(s=>s.startsWith(r)):null;return n==i}function ro(t,e){return to(t,e,"urn:jskos:mapping:content:")}var ul=ro;function ll(t,e){return to(t,e,"urn:jskos:mapping:members:")}var si={};pt(si,{addContext:()=>fl,annotationCreatorMatches:()=>Ll,annotationCreatorName:()=>Nl,annotationCreatorUri:()=>Ml,clean:()=>ni,cleanJSKOS:()=>hl,compare:()=>it,compareConcepts:()=>gl,compareFunctions:()=>Rl,compareMappingsDeep:()=>Cl,compareObjects:()=>dl,compareSchemes:()=>ml,conceptsOfMapping:()=>gt,copyDeep:()=>Jr,deepCopy:()=>pl,defaultMappingType:()=>oo,definition:()=>Pl,flattenMapping:()=>xl,getAllUris:()=>ti,guessObjectType:()=>Vr,guessSchemeFromNotation:()=>Fl,isConcept:()=>wl,isContainedIn:()=>so,isScheme:()=>io,isSchemeInList:()=>yl,isValidUri:()=>kl,languageMapContent:()=>ii,mappingCSV:()=>Al,mappingRegistryIsStored:()=>Dl,mappingTypeByType:()=>Sl,mappingTypeByUri:()=>wr,mappingTypes:()=>mr,matchObjectTypes:()=>Ol,merge:()=>lo,mergeUris:()=>uo,minifyMapping:()=>vl,normalize:()=>ri,notation:()=>Tl,objectTypes:()=>gr,prefLabel:()=>Ft,sortConcepts:()=>_l,sortSchemes:()=>bl,usedObjectTypes:()=>no,userOwnsMapping:()=>Il});var mr=[{RELEVANCE:"very high",broader:[{uri:"http://www.w3.org/2004/02/skos/core#closeMatch"}],definition:{de:["gleiche Bedeutung"],en:["same meaning"]},notation:["="],prefLabel:{ar:"\u062A\u0637\u0627\u0628\u0642 \u062A\u0627\u0645",be:"\u0434\u0430\u043A\u043B\u0430\u0434\u043D\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u0446\u044C","be-tarask":"\u0434\u0430\u043A\u043B\u0430\u0434\u043D\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",bn:"\u09B9\u09C1\u09AC\u09C1\u09B9\u09C1 \u09AE\u09BF\u09B2",bs:"ta\u010Dno podudaranje",ca:"equival\xE8ncia exacta",cs:"p\u0159esn\xE1 shoda",da:"exact match",de:"exakte \xDCbereinstimmung",el:"\u03B1\u03BA\u03C1\u03B9\u03B2\u03AE\u03C2 \u03B1\u03BD\u03C4\u03B9\u03C3\u03C4\u03BF\u03B9\u03C7\u03AF\u03B1",en:"exact match",eo:"ekzakta ekvivalento",es:"equivalencia exacta",et:"t\xE4pne vaste",fi:"vastaava k\xE4site",fr:"\xE9quivalence exacte",ga:"meaitse\xE1il chruinn",gl:"correspondencia exacta",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05DE\u05D3\u05D5\u05D9\u05E7\u05EA",hu:"pontos egyez\xE9s",id:"sama persis",it:"corrispondenza esatta",ja:"\u5B8C\u5168\u4E00\u81F4",lv:"tie\u0161a sakrit\u012Bba",mk:"\u0442\u043E\u0447\u043D\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",ms:"padanan tepat","ms-arab":"\u06A4\u0627\u062F\u0646\u0646 \u062A\u06A4\u062A",nb:"eksakt samsvar",nl:"exacte match",nn:"eksakt samsvar",pl:"dok\u0142adne dopasowanie",pt:"correspond\xEAncia exata",ro:"echivalentul exact",ru:"\u0442\u043E\u0447\u043D\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"natan\u010Dno ujemanje",sq:"p\xEBrputhje e p\xEBrpikt\xEB",sr:"\u0442\u0430\u0447\u043D\u043E \u043F\u043E\u0434\u0443\u0434\u0430\u0440\u0430\u045A\u0435",sv:"exakt tr\xE4ff",tr:"tam e\u015Fle\u015Fme",uk:"\u0442\u043E\u0447\u043D\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0456\u0441\u0442\u044C",ur:"\u0628\u0627\u0644\u06A9\u0644 \u062F\u0631\u0633\u062A \u062C\u0648\u0691",zh:"\u7CBE\u78BA\u5339\u914D","zh-cn":"\u7CBE\u786E\u5339\u914D","zh-hans":"\u7CBE\u786E\u5339\u914D","zh-hant":"\u7CBE\u78BA\u5339\u914D"},SHORT:"exact",uri:"http://www.w3.org/2004/02/skos/core#exactMatch"},{RELEVANCE:"high",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{de:["in etwa gleiche Bedeutung"],en:["same general idea but not fully identical meaning"]},notation:["\u2248"],prefLabel:{ar:"\u062A\u0637\u0627\u0628\u0642 \u0642\u0631\u064A\u0628","be-tarask":"\u0431\u043B\u0456\u0437\u043A\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"equival\xE8ncia inexacta",de:"hohe \xDCbereinstimmung",el:"\u03C3\u03C4\u03B5\u03BD\u03AE \u03B1\u03BD\u03C4\u03B9\u03C3\u03C4\u03BF\u03B9\u03C7\u03AF\u03B1",en:"close match",eo:"proksima kongrua\u0135o",es:"equivalencia inexacta",fi:"l\xE4hes vastaava k\xE4site",fr:"quasi-\xE9quivalence",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E7\u05E8\u05D5\u05D1\u05D4",hu:"kv\xE1zi-egyen\xE9rt\xE9k\u0171s\xE9g",it:"corrispondenza parziale",ja:"\u985E\u4F3C\u4E00\u81F4",mk:"\u0431\u043B\u0438\u0441\u043A\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",ms:"padanan dekat","ms-arab":"\u06A4\u0627\u062F\u0646\u0646 \u062F\u06A9\u062A",nb:"n\xE6rt samsvar",nl:"nabije match",nn:"n\xE6rt samsvar",pl:"cz\u0119\u015Bciowe dopasowanie",pt:"correspond\xEAncia pr\xF3xima",ru:"\u0431\u043B\u0438\u0437\u043A\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"visoko ujemanje",sr:"\u0431\u043B\u0438\u0441\u043A\u043E \u043F\u043E\u043A\u043B\u0430\u043F\u0430\u045A\u0435",sv:"n\xE4ra matchning",tr:"yak\u0131n e\u015Fle\u015Fme","zh-hans":"\u9AD8\u5EA6\u5339\u914D"},SHORT:"close",uri:"http://www.w3.org/2004/02/skos/core#closeMatch"},{RELEVANCE:"medium",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{de:["umfassendere Bedeutung"],en:["broader meaning"]},notation:[">"],prefLabel:{"be-tarask":"\u0448\u044B\u0440\u043E\u043A\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"relaci\xF3 llunyana",cs:"\u0161ir\u0161\xED koncept",de:"allgemeinere Bedeutung",en:"broad match",eo:"malstrikta kongruo",et:"laiem vaste",fi:"vastaava laajempi k\xE4site",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E8\u05D7\u05D1\u05D4",hu:"t\xE1gabb jelent\xE9s",it:"corrispondenza con termine pi\xF9 generico",ja:"\u5E83\u7FA9\u4E00\u81F4",mk:"\u043F\u043E\u0448\u0438\u0440\u043E\u043A\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",nb:"bredere samsvar",nl:"brede match",nn:"breitt samsvar",pl:"dopasowanie poj\u0119cia o szerszym znaczeniu","pt-br":"correspond\xEAncia gen\xE9rica",ru:"\u0431\u043E\u043B\u0435\u0435 \u0448\u0438\u0440\u043E\u043A\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"splo\u0161ni pomen",sr:"\u0443 \u0448\u0438\u0440\u0435\u043C \u0441\u043C\u0438\u0441\u043B\u0443",sv:"bred tr\xE4ff",uk:"\u0448\u0438\u0440\u0448\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0456\u0441\u0442\u044C",vi:"\u0111\u1ED1i s\xE1nh r\u1ED9ng","zh-hans":"\u5E7F\u6CDB\u5339\u914D"},related:[{uri:"http://www.w3.org/2004/02/skos/core#narrowMatch"}],SHORT:"broad",uri:"http://www.w3.org/2004/02/skos/core#broadMatch"},{RELEVANCE:"medium",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{en:["more specific meaning"]},notation:["<"],prefLabel:{"be-tarask":"\u0432\u0443\u0437\u043A\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"relaci\xF3 estreta",de:"spezifischere Bedeutung",en:"narrow match",eo:"strikta kongruo",et:"kitsam vaste",fi:"vastaava suppeampi k\xE4site",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E6\u05E8\u05D4",hu:"sz\u0171kebb jelent\xE9s",it:"corrispondenza con termine pi\xF9 specifico",ja:"\u72ED\u7FA9\u4E00\u81F4",mk:"\u043F\u043E\u0442\u0435\u0441\u043D\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",nb:"smalere samsvar",nl:"nauwe match",nn:"snevert samsvar",pl:"dopasowanie poj\u0119cia o w\u0119\u017Cszym znaczeniu","pt-br":"correspond\xEAncia aproximada",ru:"\u0431\u043E\u043B\u0435\u0435 \u0443\u0437\u043A\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"ozki pomen",sr:"\u0443 \u0443\u0436\u0435\u043C \u0441\u043C\u0438\u0441\u043B\u0443",sv:"smal tr\xE4ff",ur:"\u0646\u06CC\u0631\u0648 \u0645\u06CC\u0686",vi:"\u0111\u1ED1i s\xE1nh h\u1EB9p","zh-hans":"\u6709\u9650\u5339\u914D"},related:[{uri:"http://www.w3.org/2004/02/skos/core#broadMatch"}],SHORT:"narrow",uri:"http://www.w3.org/2004/02/skos/core#narrowMatch"},{RELEVANCE:"low",broader:[{uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}],definition:{de:["assoziative Verkn\xFCpfung unterschiedlicher Bedeutungen"],en:["associative link between meanings"]},notation:["~"],prefLabel:{"be-tarask":"\u0437\u044C\u0432\u044F\u0437\u0430\u043D\u0430\u044F \u0430\u0434\u043F\u0430\u0432\u0435\u0434\u043D\u0430\u0441\u044C\u0446\u044C",ca:"parella relacionada",de:"verwandte Bedeutung",en:"related match",eo:"rilata kongruo",fi:"liittyv\xE4 k\xE4site",fr:"association",he:"\u05D4\u05EA\u05D0\u05DE\u05D4 \u05E7\u05E9\u05D5\u05E8\u05D4",hu:"rokon jelent\xE9s",it:"corrispondenza correlata",ja:"\u95A2\u9023\u4E00\u81F4",lv:"saist\u012Bta sakrit\u012Bba",mk:"\u043F\u043E\u0432\u0440\u0437\u0430\u043D\u043E \u0441\u043E\u0432\u043F\u0430\u0453\u0430\u045A\u0435",ms:"padanan berkaitan","ms-arab":"\u06A4\u0627\u062F\u0646\u0646 \u0628\u0631\u06A9\u0627\u0621\u064A\u062A\u0646",nb:"relatert samsvar",nl:"gerelateerde match",pl:"dopasowanie poj\u0119cia o powi\u0105zanym znaczeniu",ru:"\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0442\u0438\u0432\u043D\u043E\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",sl:"povezano ujemanje",tr:"ili\u015Fkili benze\u015Fme",uk:"\u043F\u043E\u0432\u2019\u044F\u0437\u044C",ur:"\u0645\u062A\u0639\u0644\u0642\u06C1 \u0645\u06CC\u0686",vec:"parente\u0142a re\u0142asionada","zh-hans":"\u5173\u8054\u5339\u914D"},SHORT:"related",uri:"http://www.w3.org/2004/02/skos/core#relatedMatch"},{RELEVANCE:"generic",definition:{de:["unbekannter Bedeutungszusammenhang"],en:["unknown type of link between meanings"]},notation:["\u2192"],prefLabel:{ar:"\u0646\u0648\u0639 \u0639\u0644\u0627\u0642\u0629 \u0627\u0644\u062A\u0637\u0628\u064A\u0642",be:"\u0445\u0430\u0440\u0430\u043A\u0442\u044D\u0440\u043D\u0430\u044F \u0430\u0434\u043D\u043E\u0441\u0456\u043D\u0430 \u0430\u0434\u043B\u044E\u0441\u0442\u0440\u0430\u0432\u0430\u043D\u043D\u044F","be-tarask":"\u0445\u0430\u0440\u0430\u043A\u0442\u044D\u0440\u043D\u0430\u044F \u0430\u0434\u043D\u043E\u0441\u0456\u043D\u0430 \u0430\u0434\u043B\u044E\u0441\u0442\u0440\u0430\u0432\u0430\u043D\u044C\u043D\u044F",ca:"relaci\xF3 de mapatge",de:"allgemeine Mapping-Relation",en:"SKOS generic mapping relation",fi:"SKOS-kartoitussuhde",fr:"lien de correspondance SKOS",he:"\u05D9\u05D7\u05E1 \u05DE\u05D9\u05E4\u05D5\u05D9 \u05DB\u05DC\u05DC\u05D9",id:"relasi pemetaan",ja:"SKOS\u4E00\u822C\u30DE\u30C3\u30D4\u30F3\u30B0\u95A2\u4FC2",mk:"\u043F\u0440\u0435\u0441\u043B\u0438\u043A\u0443\u0432\u0430\u0447\u043A\u0438 \u043E\u0434\u043D\u043E\u0441",nb:"SKOS generisk mappingrelasjon","pt-br":"rela\xE7\xE3o gen\xE9rica de mapeamento",sl:"splo\u0161na relacija kartiranja SKOS",sr:"\u0440\u0435\u043B\u0430\u0446\u0438\u0458\u0430 \u043C\u0430\u043F\u0438\u0440\u0430\u045A\u0430",sv:"mappnings relation",zh:"\u6620\u5C04\u95DC\u4FC2","zh-hant":"\u6620\u5C04\u95DC\u4FC2"},SHORT:"",uri:"http://www.w3.org/2004/02/skos/core#mappingRelation"}];var gr={Concept:{type:["http://www.w3.org/2004/02/skos/core#Concept"]},ConceptScheme:{type:["http://www.w3.org/2004/02/skos/core#ConceptScheme"]},ConceptMapping:{type:mr.map(t=>t.uri)},ConceptOccurrence:{},Registry:{type:["http://www.w3.org/ns/dcat#Catalog","http://purl.org/cld/cdtype/CatalogueOrIndex"]},Distribution:{type:["http://www.w3.org/ns/dcat#Distribution"]},Service:{type:["http://www.w3.org/ns/dcat#DataService"]},Dataset:{type:["http://www.w3.org/ns/dcat#Dataset"]},Concordance:{type:["http://rdf-vocabulary.ddialliance.org/xkos#Correspondence","http://rdfs.org/ns/void#Linkset","http://purl.org/spar/fabio/VocabularyMapping"]},Resource:{},Item:{},ConceptBundle:{},Annotation:{type:["Annotation","http://www.w3.org/ns/oa#Annotation"]}},qr=Object.keys(gr).reduce((t,e)=>{for(let r of gr[e].type||[])t[r]=e;return t},{});function Vr(t,e=!1){let r;if(typeof t=="string"&&t)t in qr?r=qr[t]:(t=t.toLowerCase().replace(/s$/,""),r=Object.keys(gr).find(n=>{let i=n.toLowerCase();if(i===t||i==="concept"+t)return!0}));else if(typeof t=="object"&&t.type){let n=Array.isArray(t.type)?t.type:[t.type];for(let i of n)if(i in qr){r=qr[i];break}}return e&&r?r.toLowerCase().replace(/^concept(.+)/,"$1"):r}function no(t){var n;let e=[],r={concepts:"http://www.w3.org/2004/02/skos/core#Concept",schemes:"http://www.w3.org/2004/02/skos/core#ConceptScheme",mappings:"http://www.w3.org/2004/02/skos/core#mappingRelation",concordances:"http://rdf-vocabulary.ddialliance.org/xkos#Correspondence",registries:"http://www.w3.org/ns/dcat#Catalog",types:"http://www.w3.org/2002/07/owl#Class",properties:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",annotations:"http://www.w3.org/ns/oa#Annotation"};for(let i in r)(n=t[i])!=null&&n.find(s=>s!==null)&&e.push(r[i]);return e.sort()}var cl=t=>/^[A-Z]*$/.test(t),Lt=(t,e)=>e.split(".").reduce((r,n)=>r&&r[n]?r[n]:null,t),fl=t=>((t instanceof Array?t:[t]).forEach(r=>{r["@context"]="https://gbv.github.io/jskos/context.json"}),t),ni=t=>(Object.keys(t).forEach(e=>{cl(e)||e.startsWith("_")?delete t[e]:t[e]!=null&&typeof t[e]=="object"&&(t[e]=ni(t[e]))}),t),hl=ni,Jr=(t,e=[],r=!0)=>{e=e.concat(["ancestors","narrower","broader","mappings","memberList","TOPCONCEPTS","MAPPINGS","PROVIDER"]);let n=Array.isArray(t)?[]:{};for(let i in t)if(!(r&&i[0]=="_")){if(e.includes(i))if(t[i]&&Array.isArray(t[i])){t[i].length>0?n[i]=[null]:n[i]=[];continue}else{n[i]=null;continue}if(i=="inScheme"){let s=[];for(let o of t.inScheme){let a={uri:o.uri};o.notation&&(a.notation=o.notation),o.prefLabel&&(a.prefLabel=o.prefLabel),s.push(a)}n.inScheme=s;continue}t[i]!=null&&typeof t[i]=="object"?n[i]=Jr(t[i]):n[i]=t[i]}return n},pl=Jr,ti=t=>t?(t.uri?[t.uri]:[]).concat(t.identifier||[]).filter(Boolean):[],it=(t,e)=>{if(t==null&&e==null)return!0;let r=i=>i.replace("https://","http://"),n=ti(t).map(r);for(let i of ti(e).map(r))if(n.indexOf(i)!==-1)return!0;return!1},dl=it,ml=it,gl=it,wl=t=>{var e;return((e=te(t,"type",[]))==null?void 0:e.includes("http://www.w3.org/2004/02/skos/core#Concept"))||te(t,"inScheme")!=null||te(t,"topConceptOf")!=null},io=t=>{var e;return(e=te(t,"type",[]))==null?void 0:e.includes("http://www.w3.org/2004/02/skos/core#ConceptScheme")},so=(t,e)=>{if(!t||!e)return!1;for(let r of e)if(it(t,r))return!0;return!1},yl=so,_l=(t,e=!1)=>t.sort((r,n)=>{let i=te(r,"notation[0]"),s=te(n,"notation[0]");if(i&&s&&(i=i.toLowerCase(),s=s.toLowerCase()),e&&i&&s){let o,a;if(o=parseFloat(i),a=parseFloat(s),!o&&!a){let u=`${i}`.split(/[^\w\d]/),l=`${s}`.split(/[^\w\d]/);for(let c=0;c<Math.min(u.length,l.length);c+=1)if(u[c]!==l[c]){o=parseFloat(u[c])||u[c],a=parseFloat(l[c])||l[c];break}!o&&!a&&(o=i,a=s)}i=o,s=a}if((!i||!s||i==s)&&(i=r.uri,s=n.uri),i&&s){if(i>s)return 1;if(i<s)return-1}return 0}),bl=t=>{let e=["notation[0]",["prefLabel.de","prefLabel.en"],"uri"];return t.sort((r,n)=>{for(let i of e){let s,o;if(Array.isArray(i))for(let a of i)s=s||te(r,a),o=o||te(n,a);else s=te(r,i),o=te(n,i);if(s!=null&&o!=null){if(s=s.toLowerCase(),o=o.toLowerCase(),s>o)return 1;if(s<o)return-1}}return 0})},vl=t=>{let e=Mt(Jr(t),["from","to","fromScheme","toScheme","creator","contributor","type","created","modified","note","identifier","uri","partOf","mappingRelevance"]);for(let r of[e.from,e.to])pr(r,(n,i)=>{let s=[];for(let o of n)s.push(Mt(o,["uri","notation"]));r[i]=s});return e.fromScheme&&(e.fromScheme=Mt(e.fromScheme,["uri","notation"])),e.toScheme&&(e.toScheme=Mt(e.toScheme,["uri","notation"])),e.partOf&&(e.partOf=e.partOf.map(r=>Mt(r,["uri"]))),e},wr=function(t){for(let e of mr)if(t==e.uri)return e;return null},oo=wr("http://www.w3.org/2004/02/skos/core#mappingRelation"),Sl=function(t,e=oo){let r;return Array.isArray(t)&&t.length>0?r=t[0]:r=t,wr(r)||e},xl=(t,e={})=>{let{language:r}=e,n=Lt(t,"from.memberSet.0.notation.0"),i=Lt(t,"to.memberSet.0.notation.0");n=n!==null?n:"",i=i!==null?i:"";let s=wr(Lt(t,"type.0"));s=s?s.SHORT:"";let o=Ft(Lt(t,"from.memberSet.0"),{language:r,fallbackToUri:!1})||"",a=Ft(Lt(t,"to.memberSet.0"),{language:r,fallbackToUri:!1})||"",u=Ft(Lt(t,"creator.0"),{language:r,fallbackToUri:!1})||"";return{fromNotation:n,toNotation:i,fromLabel:o,toLabel:a,type:s,creator:u}},El=(t={})=>{let e=t.delimiter||",",r=t.quoteChar||'"',n=t.lineTerminator||`
|
|
16
|
+
`,i=r+r,s=o=>r+(o==null?"":o.split(r).join(i))+r;return o=>o.map(s).join(e)+n},gt=(t,e)=>{let r=[];for(let n of["from","to"])(e==null||n===e)&&(r=r.concat(te(t,`${n}.memberSet`)||te(t,`${n}.memberChoice`)||te(t,`${n}.memberList`)||[]));return r.filter(n=>n!=null)},Al=(t={})=>{let e=El(t),r=t.language||"en";t.type==null&&(t.type=!0);let n=o=>{o=o||[];let a=[];for(let u of["from","to"]){t.schemes&&a.push(`${u}Scheme`);let l=Math.max(...o.map(c=>gt(c,u).length),1);for(let c=0;c<l;c+=1)a.push(`${u}Notation${c?c+1:""}`),t.labels&&a.push(`${u}Label${c?c+1:""}`)}return t.type&&a.push("type"),t.creator&&a.push("creator"),e(a)},i=(o,a={})=>{let u=[];for(let l of["from","to"]){t.schemes&&u.push(te(o,`${l}Scheme.notation[0]`,""));let c=gt(o,l),f=a[`${l}Count`];f==null&&(f=c.length),f=Math.max(f,1);for(let m=0;m<f;m+=1)u.push(te(c[m],"notation[0]","")),t.labels&&u.push(Ft(c[m],{language:r,fallbackToUri:!1}))}return t.type&&u.push(te(wr(te(o,"type[0]")),"SHORT","")),t.creator&&u.push(Ft(te(o,"creator[0]"),{language:r,fallbackToUri:!1})),e(u)};return{header:n,fromMapping:i,fromMappings:(o,a={header:!0})=>{let u="";a.header&&(u+=n(o));let l={fromCount:Math.max(...o.map(c=>gt(c,"from").length)),toCount:Math.max(...o.map(c=>gt(c,"to").length))};for(let c of o)u+=i(c,l);return u}}};function Cl(t,e){return Dt(t,e,(r,n,i)=>{let s={[i]:r},o={[i]:n};if(i=="from"||i=="to")return Dt(Object.getOwnPropertyNames(te(r,i,{})),Object.getOwnPropertyNames(te(n,i,{})))?Dt(gt(s,i),gt(o,i),(a,u,l)=>{if(l!=null)return it(a,u)}):!1;if(i=="fromScheme"||i=="toScheme")return it(r,n)})}var Ol=(t,e)=>{let r=Vr(t),n=Vr(e);return!(r&&n&&r!=n)},ao=t=>{Array.isArray(t)&&t.sort((e,r)=>e===null?1:r===null?-1:0)},uo=(t,e)=>(!t||!e||((Array.isArray(t.identifier)||Array.isArray(e.identifier))&&(t.identifier=Hs(t.identifier||[],e.identifier||[])),!t.uri&&e.uri&&(t.uri=e.uri),t.uri&&e.uri&&t.uri!=e.uri&&!(t.identifier||[]).includes(e.uri)&&(t.identifier=(t.identifier||[]).concat([e.uri])),Array.isArray(t.identifier)&&t.uri&&(t.identifier=t.identifier.filter(r=>r!==t.uri)),(t.identifier||[]).length==0&&delete t.identifier,ao(t.identifier)),t),lo=(t,e,r)=>{if(!t||!e)return t||e;r=r||{};let n=r._path||"",i=r.detectMismatch||[],s=r.skipPaths||[],o={};return pr(t,(a,u)=>{if(!s.includes(n+u))if(Array.isArray(a)&&Array.isArray(e[u]))o[u]=qs(a,e[u],(l,c)=>Nt(l)&&Nt(c)?it(l,c):l===c),ao(o[u]);else if(Nt(a)&&Nt(e[u]))o[u]=lo(a,e[u],Object.assign({_path:`${n}${u}.`},r));else{if(a&&e[u]&&i.includes(n+u)&&!Dt(a,e[u]))throw new Error("Property mismatch in "+n+u);o[u]=a}}),pr(e,(a,u)=>{t[u]||(o[u]=a)}),n==""&&Vs(o,s),r.mergeUris&&uo(o,e),o},ri=t=>Array.isArray(t)?t.map(e=>ri(e)):Nt(t)?(pr(t,(e,r)=>{t[r]=ri(e)}),t):dr(t)?t.normalize():t,kl=t=>{let e=/^[A-Za-z][A-Za-z0-9+\-.]*:(?:\/\/(?:(?:[A-Za-z0-9\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\.[A-Za-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*)(?::[0-9]*)?(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|\/(?:(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?|(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|)(?:\?(?:[A-Za-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?(?:#(?:[A-Za-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?$/;return t.match(e)!==null},Rl={mappingsByConcepts:(t,e,r)=>{let n=["memberSet","memberList","memberChoice"],i,s;for(let o of n)i=i||te(t,r+"."+o+"[0].notation[0]"),s=s||te(e,r+"."+o+"[0].notation[0]");return i==null||i<s?-1:s==null||i>s?1:0}},Il=(t,e)=>!t||!e?!1:[t.uri].concat(Object.values(t.identities||{}).map(r=>r.uri)).filter(r=>r!=null).includes(te(e,"creator[0].uri"));function Tl(t,e){let r;if(t&&t.notation&&t.notation.length)r=t.notation[0],(io(t)||e=="scheme")&&(r=r.toUpperCase());else if(t&&t.inScheme&&t.inScheme[0]&&t.uri)try{r=new $r(t&&t.inScheme&&t.inScheme[0]).notationFromUri(t.uri)}catch(n){}return r||""}function ii(t,e,{language:r}={}){let n=t&&e?t[e]:t;return n&&(n[r]||(r=Hr.selectLanguage(n),r))?n[r]:null}function Ft(t,e={}){e=e||{};let r=e.fallbackToUri==null?!0:e.fallbackToUri;return te(t,`prefLabel.${e.language}`)||ii(t,"prefLabel",e)||(r&&t&&t.uri?t.uri:"")}function Pl(t,e={}){e=e||{};let r=te(t,`definition.${e.language}`)||ii(t,"definition",e)||[];return dr(r)&&(r=[r]),r}function Dl(t){return te(t,"stored",te(t,"constructor.stored",te(t,"provider.constructor.stored",!1)))}function Ml(t){return dr(t.creator)?t.creator:t.creator&&t.creator.id}function Nl(t){return te(t,"creator.name")||""}function Ll(t,e){return!!(t&&dr(t.creator)?e&&e.includes(t.creator):e&&t.creator&&e.includes(t.creator.id))}function Fl(t,e){return e.filter(({notationPattern:r})=>(r||".+")===".+"?!1:RegExp("^("+r+")$").test(t))}var P=F(I(I({},ei),si),{ConceptScheme:$r,languagePreference:Hr});var ui={};pt(ui,{concatUrl:()=>Ue,deepEqual:()=>Re,listOfCapabilities:()=>ai,requestMethods:()=>oi,withCustomProps:()=>wt});var oi=[{method:"getRegistries",fallback:[],type:"Registries"},{method:"getSchemes",fallback:[],type:"Schemes"},{method:"vocSearch",fallback:[],type:"Schemes"},{method:"getTypes",fallback:[],type:"Types"},{method:"suggest",fallback:["",[],[],[]]},{method:"vocSuggest",fallback:["",[],[],[]]},{method:"getConcordances",fallback:[],type:"Concordances"},{method:"getOccurrences",fallback:[],type:"Occurrences"},{method:"getTop",fallback:[],type:"Concepts"},{method:"getConcepts",fallback:[],type:"Concepts"},{method:"getNarrower",fallback:[],type:"Concepts"},{method:"getAncestors",fallback:[],type:"Concepts"},{method:"search",fallback:[],type:"Concepts"},{method:"getMapping",fallback:null,type:"Mapping"},{method:"getMappings",fallback:[],type:"Mappings"},{method:"postMapping",fallback:null,type:"Mapping"},{method:"postMappings",fallback:[],type:"Mapping"},{method:"putMapping",fallback:null,type:"Mapping"},{method:"patchMapping",fallback:null,type:"Mapping"},{method:"deleteMapping",fallback:!1},{method:"deleteMappings",fallback:[]},{method:"getAnnotations",fallback:[],type:"Annotations"},{method:"postAnnotation",fallback:null,type:"Annotation"},{method:"putAnnotation",fallback:null,type:"Annotation"},{method:"patchAnnotation",fallback:null,type:"Annotation"},{method:"deleteAnnotation",fallback:!1}];function Ue(...t){let[e,...r]=t;for(let n of r)e.endsWith("/")||(e+="/"),n.startsWith("/")&&(n=n.slice(1)),e+=n;return e}function wt(t,e){return t._totalCount=e._totalCount,t._url=e._url,t}var ai=["schemes","top","data","concepts","narrower","ancestors","types","suggest","search","auth","mappings","concordances","annotations","occurrences"],Re=(t,e)=>{if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null)return!1;if(Object.keys(t).length===Object.keys(e).length){for(let r in t)if(!(r in e)||!Re(t[r],e[r]))return!1;return!0}return!1};var Ht={};pt(Ht,{BaseProvider:()=>G,ConceptApiProvider:()=>Te,LabelSearchSuggestionProvider:()=>We,LobidApiProvider:()=>Ye,LocApiProvider:()=>qe,LocalMappingsProvider:()=>st,MappingsApiProvider:()=>Ie,ModApiProvider:()=>Xe,MyCoReProvider:()=>Qe,NoTApiProvider:()=>Ze,OccurrencesApiProvider:()=>$e,OlsApiProvider:()=>Ge,ReconciliationApiProvider:()=>je,SkohubProvider:()=>Je,SkosmosApiProvider:()=>He});var li=t=>t.reduce((e,r)=>e.filter(n=>r.includes(n))),G=class{constructor(e={}){var n,i;this._jskos=e,this.axios=pe.create({timeout:2e5}),this._path=typeof window!="undefined"&&window.location.pathname,this.has={},(n=this.constructor)!=null&&n.supports&&(this.has=Object.assign({},(i=this.constructor)==null?void 0:i.supports)),ai.filter(s=>!this.has[s]).forEach(s=>{this.has[s]=!1}),this._defaultLanguages="en,de,fr,es,nl,it,fi,pl,ru,cs,jp".split(","),this.languages=[],this._auth={key:null,bearerToken:null},this._repeating=[],this._api={status:e.status,schemes:Array.isArray(e.schemes)?void 0:e.schemes,top:e.top,data:e.data,concepts:e.concepts,narrower:e.narrower,ancestors:e.ancestors,types:e.types,suggest:e.suggest,search:e.search,"voc-suggest":e["voc-suggest"],"voc-search":e["voc-search"],mappings:e.mappings,concordances:e.concordances,annotations:e.annotations,occurrences:e.occurrences,reconcile:e.reconcile,api:e.endpoint||e.api},this._config={},this.setRetryConfig(),this.axios.interceptors.request.use((s={})=>{var o,a,u;if(s._skipAdditionalParameters||(s.params||(s.params={}),s.params.language=[...new Set([].concat(((o=s.params.language)!=null?o:"").split(","),this.languages,this._defaultLanguages).filter(Boolean))].join(","),this.has.auth&&this._auth.bearerToken&&!((a=s==null?void 0:s.headers)!=null&&a.Authorization)&&(s.headers||(s.headers={}),s.headers.Authorization=`Bearer ${this._auth.bearerToken}`)),(u=s.url)!=null&&u.startsWith("http:")&&typeof window!="undefined"&&window.location.protocol=="https:")throw new pe.Cancel("Can't call http API from https.");return s}),this.axios.interceptors.response.use(({data:s,headers:o={},config:a={}})=>{s=P.normalize(s);let u=a.url;if(u.endsWith("?")||(u+="?"),u+=new URLSearchParams(a.params||{}).toString(),typeof s=="object"){let l=parseInt(o["x-total-count"]);isNaN(l)||(s._totalCount=l),s._url=u}return s},s=>{var l,c,f;let o=(c=(l=s.config)==null?void 0:l._retryCount)!=null?c:0,a=s.config.method,u=(f=s.response)==null?void 0:f.status;return this._retryConfig.methods.includes(a)&&this._retryConfig.statusCodes.includes(u)&&o<this._retryConfig.count?(s.config._retryCount=o+1,s.config.data&&(s.config.data=JSON.parse(s.config.data)),new Promise((m,g)=>{setTimeout(()=>{this.axios(s.config).then(m).catch(g)},(()=>{let h=this._retryConfig.delay;return typeof h=="function"?h(o):h})())})):Promise.reject(s)});let r=[];for(let{method:s,type:o}of oi){let a=this[s]&&this[s].bind(this);if(!a){this[s]=()=>{throw new Qt({method:s})};continue}this[s]=(u={})=>{if(u._raw)return delete u._raw,a(u);let l=r.find(y=>y.method==s&&Re(y.options,u));if(l)return l.promise;let c;u.cancelToken||(c=this.getCancelTokenSource(),u.cancelToken=c.token);let f=this.init().then(()=>a(u)).then(y=>(typeof y=="object"&&y._totalCount===void 0&&(y._totalCount=Array.isArray(y)?y.length:1),y&&o&&this[`adjust${o}`]&&(y=this[`adjust${o}`](y)),y)).catch(y=>{throw y instanceof me?y:y.response?y.response.status.toString().startsWith(4)?new Le({relatedError:y,code:y.response.status}):new Zt({relatedError:y,code:y.response.status}):y.request?typeof navigator!="undefined"&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection)?new er({relatedError:y}):new tr({relatedError:y}):(console.error(y),new me({relatedError:y}))});c&&(f.cancel=(...y)=>c.cancel(...y));let d=u,{cancelToken:m}=d,g=W(d,["cancelToken"]),h={method:s,options:g,promise:f};return r.push(h),f.catch(()=>{}).then(()=>r.splice(r.indexOf(h),1)),f}}}get uri(){return this._jskos.uri}get notation(){return this._jskos.notation}get prefLabel(){return this._jskos.prefLabel}get definition(){return this._jskos.definition}get schemes(){return this._jskos.schemes}get excludedSchemes(){return this._jskos.excludedSchemes}get stored(){return this._jskos.stored!==void 0?this._jskos.stored:this.constructor.stored}init(){return E(this,null,function*(){return this._init?this._init:(this._init=E(this,null,function*(){var r;this._prepare();let e;if(typeof this._api.status=="string")try{e=yield this.axios({method:"get",url:this._api.status})}catch(n){((r=n==null?void 0:n.response)==null?void 0:r.status)===404&&(this._api.status=null)}else e=this._api.status;if(typeof e=="object"&&Object.keys(e).length){this._config=e.config||{};for(let n of Object.keys(this._api))this._api[n]===void 0&&(this._api[n]=e[n]||null)}this._setup()}),this._init)})}_prepare(){}_setup(){}getCancelTokenSource(){return pe.CancelToken.source()}setAuth({key:e=this._auth.key,bearerToken:r=this._auth.bearerToken}){this._auth.key=e,this._auth.bearerToken=r}setRetryConfig(e={}){this._retryConfig=Object.assign({methods:["get","head","options"],statusCodes:[401,403],count:3,delay:r=>300*r},e)}suggest(e){return E(this,null,function*(){e._raw=!0;let r=yield this.search(e),n=[e.search,[],[],[]];for(let i of r){let s=P.notation(i),o=P.prefLabel(i);n[1].push((s?s+" ":"")+o),n[2].push(""),n[3].push(i.uri)}return r._totalCount!=null?n._totalCount=r._totalCount:n._totalCount=r.length,n})}isAuthorizedFor({type:e,action:r,user:n,crossUser:i}){var a,u,l,c;if(r=="read"&&this.has[e]===!0)return!0;if(!this.has[e])return!1;let s=(u=(a=this._config)==null?void 0:a[e])==null?void 0:u[r];if(!s)return!!this.has[e][r];if(s.auth&&(!n||!this._auth.key)||s.auth&&this._auth.key!=((c=(l=this._config)==null?void 0:l.auth)==null?void 0:c.key))return!1;let o=[n==null?void 0:n.uri].concat(Object.values((n==null?void 0:n.identities)||{}).map(f=>f.uri)).filter(Boolean);if(s.auth&&s.identities&&li(o,s.identities).length==0)return!1;if(s.auth&&s.identityProviders){let f=Object.keys((n==null?void 0:n.identities)||{});if(li(f,s.identityProviders).length==0)return!1}return i?s.crossUser===!0||li(s.crossUser||[],o).length>0:!!this.has[e][r]}supportsScheme(e){if(!e)return!1;let r=Array.isArray(this.schemes)?this.schemes:null;return r==null&&!P.isContainedIn(e,this.excludedSchemes||[])?!0:P.isContainedIn(e,r)}adjustConcept(e){if(!e||e.__SAVED__)return e;e._getNarrower=r=>this.getNarrower(F(I({},r),{concept:e})),e._getAncestors=r=>this.getAncestors(F(I({},r),{concept:e})),e._getDetails=r=>E(this,null,function*(){return(yield this.getConcepts(F(I({},r),{concepts:[e]})))[0]});for(let r of["broader","narrower","ancestors"])Array.isArray(e[r])&&e[r].length&&!e[r].includes(null)&&(e[r]=this.adjustConcepts(e[r]));return e._registry=this,e}adjustConcepts(e){return wt(e.map(r=>this.adjustConcept(r)),e)}adjustRegistries(e){return e}adjustScheme(e){if(!e||e.__SAVED__)return e;let r=e._registry;return e._registry=this.cdk&&this.cdk.registryForScheme(e),!e._registry||r===e._registry||e._registry._api.api===this._api.api?e._registry=r||this:["concepts","topConcepts"].forEach(n=>{Array.isArray(e[n])&&(e[n].length===0||e[n][0]===null)&&delete e[n]}),e._registry&&(e._getTop=n=>e._registry.getTop(F(I({},n),{scheme:e})),e._getTypes=n=>e._registry.getTypes(F(I({},n),{scheme:e})),e._suggest=s=>{var o=s,{search:n}=o,i=W(o,["search"]);return e._registry.suggest(F(I({},i),{search:n,scheme:e}))}),e}adjustSchemes(e){return wt(e.map(r=>this.adjustScheme(r)),e)}adjustConcordances(e){for(let r of e)r._registry=this;return e}adjustMapping(e){var r,n,i,s,o;for(let a of["from","to"]){let u=`${a}Scheme`;e[u]||(e[u]=(s=(i=(n=(r=P.conceptsOfMapping(e,a))==null?void 0:r[0])==null?void 0:n.inScheme)==null?void 0:i[0])!=null?s:null)}if(e._registry=this,!e.identifier){let a=(o=P.addMappingIdentifiers(e))==null?void 0:o.identifier;a&&(e.identifier=a)}return e}adjustMappings(e){return wt(e.map(r=>this.adjustMapping(r)),e)}postMappings(){return E(this,arguments,function*(n={}){var i=n,{mappings:e}=i,r=W(i,["mappings"]);if(!e||!e.length)throw new U({parameter:"mappings"});return this._callHelperForArrayWrappers({method:"postMapping",items:e,itemProperty:"mapping",config:r})})}deleteMappings(){return E(this,arguments,function*(n={}){var i=n,{mappings:e}=i,r=W(i,["mappings"]);if(!e||!e.length)throw new U({parameter:"mappings"});return this._callHelperForArrayWrappers({method:"deleteMapping",items:e,itemProperty:"mapping",config:r})})}_callHelperForArrayWrappers(s){return E(this,arguments,function*({method:e,items:r,itemProperty:n,config:i}){let o=[],a=yield Promise.all(r.map(u=>E(this,null,function*(){try{return yield this[e](F(I({[n]:u},i),{_raw:!0}))}catch(l){return o[r.indexOf(u)]=l,null}})));return a._errors=o,a})}};ee(G,"providerName","Base");var ze=ns(fo(),1);var we=[];for(let t=0;t<256;++t)we.push((t+256).toString(16).slice(1));function ho(t,e=0){return(we[t[e+0]]+we[t[e+1]]+we[t[e+2]]+we[t[e+3]]+"-"+we[t[e+4]]+we[t[e+5]]+"-"+we[t[e+6]]+we[t[e+7]]+"-"+we[t[e+8]]+we[t[e+9]]+"-"+we[t[e+10]]+we[t[e+11]]+we[t[e+12]]+we[t[e+13]]+we[t[e+14]]+we[t[e+15]]).toLowerCase()}var fi,Bl=new Uint8Array(16);function hi(){if(!fi){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");fi=crypto.getRandomValues.bind(crypto)}return fi(Bl)}var jl=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),pi={randomUUID:jl};function Ul(t,e,r){var i,s,o;t=t||{};let n=(o=(s=t.random)!=null?s:(i=t.rng)==null?void 0:i.call(t))!=null?o:hi();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[r+a]=n[a];return e}return ho(n)}function zl(t,e,r){return pi.randomUUID&&!e&&!t?pi.randomUUID():Ul(t,e,r)}var Kr=zl;var Yr="urn:uuid:",st=class extends G{static get supports(){return{mappings:{read:!0,create:!0,update:!0,delete:!0}}}_setup(){this.queue=[],this.localStorageKey="cocoda-mappings--"+this._path;let e="mappings",r=()=>ze.default.getItem(this.localStorageKey).then(n=>{n=n||[];let i=0;for(let s of n.filter(o=>!o.uri||!o.uri.startsWith(Yr)))s.uri&&(s.identifier||(s.identifier=[]),s.identifier.push(s.uri)),s.uri=`${Yr}${Kr()}`,i+=1;return i&&console.warn(`URIs added to ${i} local mappings.`),ze.default.setItem(this.localStorageKey,n)});ze.default.getItem(e).then(n=>{n&&console.warn(`Warning: There is old data in local storage (or IndexedDB, depending on the ) with the key "${e}". This data will not be used anymore. A manual export is necessary to get this data back.`)}),this.queue.push(r().catch(n=>{console.warn("Error when adding URIs to local mappings:",n)}))}isAuthorizedFor({type:e,action:r}){return e=="mappings"&&r!="anonymous"}_getMappingsQueue(){let e=this.queue.slice(-1)[0]||Promise.resolve();return new Promise(r=>{function n(){let o,a,u=new Promise((l,c)=>{o=l,a=c});return u.resolve=o,u.reject=a,u}let i=n(),s=()=>{i.resolve()};this.queue.push(i),e.then(()=>ze.default.getItem(this.localStorageKey)).then(o=>{r({mappings:o,done:s})})})}getMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(r._raw=!0,!e||!e.uri)throw new U({parameter:"mapping"});return(yield this.getMappings(F(I({},r),{uri:e.uri})))[0]})}getMappings(){return E(this,arguments,function*({from:e,fromScheme:r,to:n,toScheme:i,creator:s,type:o,partOf:a,offset:u,limit:l,direction:c,mode:f,identifier:m,uri:g}={}){let h={};return e&&(h.from=typeof e=="string"?e:e.uri),r&&(h.fromScheme=typeof r=="string"?{uri:r}:r),n&&(h.to=typeof n=="string"?n:n.uri),i&&(h.toScheme=typeof i=="string"?{uri:i}:i),s&&(h.creator=typeof s=="string"?s:P.prefLabel(s)),o&&(h.type=typeof o=="string"?o:o.uri),a&&(h.partOf=typeof a=="string"?a:a.uri),u&&(h.offset=u),l&&(h.limit=l),c&&(h.direction=c),f&&(h.mode=f),m&&(h.identifier=m),g&&(h.uri=g),this._getMappingsQueue().catch(d=>{throw new me({message:"Could not get mappings from local storage",relatedError:d})}).then(({mappings:d,done:y})=>{y();let O=(C,L)=>C.uri==L||L&&C.notation&&C.notation[0].toLowerCase()==L.toLowerCase();if((h.from||h.to)&&(d=d.filter(C=>{let L=P.conceptsOfMapping(C,"from").find(D=>O(D,h.from))!=null,N=P.conceptsOfMapping(C,"to").find(D=>O(D,h.from))!=null,S=P.conceptsOfMapping(C,"from").find(D=>O(D,h.to))!=null,k=P.conceptsOfMapping(C,"to").find(D=>O(D,h.to))!=null;return h.direction=="backward"?h.mode=="or"?h.from&&N||h.to&&S:(!h.from||N)&&(!h.to||S):h.direction=="both"?h.mode=="or"?h.from&&(L||N)||h.to&&(S||k):(!h.from||L)&&(!h.to||k)||(!h.from||N)&&(!h.to||S):h.mode=="or"?h.from&&L||h.to&&k:(!h.from||L)&&(!h.to||k)})),(h.fromScheme||h.toScheme)&&(d=d.filter(C=>{let L=P.compare(C.fromScheme,h.fromScheme),N=P.compare(C.toScheme,h.fromScheme),S=P.compare(C.fromScheme,h.toScheme),k=P.compare(C.toScheme,h.toScheme);return h.direction=="backward"?h.mode=="or"?h.fromScheme&&N||h.toScheme&&S:(!h.fromScheme||N)&&(!h.toScheme||S):h.direction=="both"?h.mode=="or"?h.fromScheme&&(L||N)||h.toScheme&&(S||k):(!h.fromScheme||L)&&(!h.toScheme||k)||(!h.fromScheme||N)&&(!h.toScheme||S):h.mode=="or"?h.fromScheme&&L||h.toScheme&&k:(!h.fromScheme||L)&&(!h.toScheme||k)})),h.creator){let C=h.creator.split("|");d=d.filter(L=>(L.creator&&L.creator.find(N=>C.includes(P.prefLabel(N))||C.includes(N.uri)))!=null)}h.type&&(d=d.filter(C=>(C.type||[P.defaultMappingType.uri]).includes(h.type))),h.partOf&&(d=d.filter(C=>C.partOf!=null&&C.partOf.find(L=>P.compare(L,{uri:h.partOf}))!=null)),h.identifier&&(d=d.filter(C=>h.identifier.split("|").map(L=>(C.identifier||[]).includes(L)||C.uri==L).reduce((L,N)=>L||N))),h.uri&&(d=d.filter(C=>C.uri==h.uri));let R=d.length;return d=d.sort((C,L)=>{let N=C.modified||C.created,S=L.modified||L.created;return S==null?-1:N==null?1:N>S?-1:1}),d=d.slice(h.offset||0),d=d.slice(0,h.limit),d._totalCount=R,d})})}postMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue();if((!e.uri||!e.uri.startsWith(Yr))&&(e.uri&&(e.identifier||(e.identifier=[]),e.identifier.push(e.uri)),e.uri=`${Yr}${Kr()}`),n.find(s=>s.uri==e.uri))throw i(),new U({parameter:"mapping",message:"Duplicate URI"});e.created||(e.created=new Date().toISOString()),e.modified||(e.modified=e.created),delete e.partOf,n.push(e),n=n.map(s=>P.minifyMapping(s));try{return yield ze.default.setItem(this.localStorageKey,n),i(),e}catch(s){throw i(),s}})}putMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue(),s=n.findIndex(o=>o.uri==e.uri);if(s==-1)throw i(),new U({parameter:"mapping",message:"Mapping not found"});e.created||(e.created=n[s].created),e.modified=new Date().toISOString(),delete e.partOf,n[s]=e,n=n.map(o=>P.minifyMapping(o));try{return yield ze.default.setItem(this.localStorageKey,n),i(),e}catch(o){throw i(),o}})}patchMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue(),s=n.findIndex(o=>o.uri==e.uri);if(s==-1)throw i(),new U({parameter:"mapping",message:"Mapping not found"});e.created||(e.created=n[s].created),e.modified=new Date().toISOString(),delete e.partOf,n[s]=Object.assign(n[s],e),n=n.map(o=>P.minifyMapping(o));try{return yield ze.default.setItem(this.localStorageKey,n),i(),e}catch(o){throw i(),o}})}deleteMapping(r){return E(this,arguments,function*({mapping:e}){if(!e)throw new U({parameter:"mapping"});let{mappings:n,done:i}=yield this._getMappingsQueue();try{return n=n.filter(s=>s.uri!=e.uri),n=n.map(s=>P.minifyMapping(s)),yield ze.default.setItem(this.localStorageKey,n),i(),!0}catch(s){throw i(),s}})}};st.providerName="LocalMappings";st.stored=!0;var Ie=class extends G{_prepare(){this._api.api&&this._api.status===void 0&&(this._api.status=Ue(this._api.api,"/status"))}_setup(){var e,r,n,i,s,o,a,u,l,c,f,m,g,h,d,y,O,R,C,L,N,S,k,D,$,X,K,V,Z;if(this._api.api){let se={mappings:"/mappings",concordances:"/concordances",annotations:"/annotations"};for(let re of Object.keys(se))this._api[re]===void 0&&(this._api[re]=Ue(this._api.api,se[re]))}this.has.mappings=this._api.mappings?{}:!1,this.has.mappings&&(this.has.mappings.read=!!((n=(r=(e=this._config)==null?void 0:e.mappings)==null?void 0:r.read)==null||n),this.has.mappings.create=!!((s=(i=this._config)==null?void 0:i.mappings)!=null&&s.create),this.has.mappings.update=!!((a=(o=this._config)==null?void 0:o.mappings)!=null&&a.update),this.has.mappings.delete=!!((l=(u=this._config)==null?void 0:u.mappings)!=null&&l.delete),this.has.mappings.anonymous=!!((f=(c=this._config)==null?void 0:c.mappings)!=null&&f.anonymous)),this.has.concordances=this._api.concordances?{}:!1,this.has.concordances&&(this.has.concordances.read=!!((g=(m=this._config)==null?void 0:m.concordances)!=null&&g.read),this.has.concordances.create=!!((d=(h=this._config)==null?void 0:h.concordances)!=null&&d.create),this.has.concordances.update=!!((O=(y=this._config)==null?void 0:y.concordances)!=null&&O.update),this.has.concordances.delete=!!((C=(R=this._config)==null?void 0:R.concordances)!=null&&C.delete)),this.has.annotations=this._api.annotations?{}:!1,this.has.annotations&&(this.has.annotations.read=!!((N=(L=this._config)==null?void 0:L.annotations)!=null&&N.read),this.has.annotations.create=!!((k=(S=this._config)==null?void 0:S.annotations)!=null&&k.create),this.has.annotations.update=!!(($=(D=this._config)==null?void 0:D.annotations)!=null&&$.update),this.has.annotations.delete=!!((K=(X=this._config)==null?void 0:X.annotations)!=null&&K.delete)),this.has.auth=((Z=(V=this._config)==null?void 0:V.auth)==null?void 0:Z.key)!=null,this._defaultParams={properties:"annotations"}}getMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);var s;if(!e)throw new U({parameter:"mapping"});if(!e.uri||!e.uri.startsWith(this._api.mappings))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});try{return yield this.axios(F(I({},r),{url:e.uri,params:I(I({},this._defaultParams),r.params||{})}))}catch(o){if(((s=o==null?void 0:o.response)==null?void 0:s.status)==404)return null;throw o}})}getMappings(L){return E(this,null,function*(){var N=L,{from:e,fromScheme:r,to:n,toScheme:i,creator:s,type:o,partOf:a,offset:u,limit:l,direction:c,mode:f,identifier:m,cardinality:g,annotatedBy:h,annotatedFor:d,annotatedWith:y,sort:O,order:R}=N,C=W(N,["from","fromScheme","to","toScheme","creator","type","partOf","offset","limit","direction","mode","identifier","cardinality","annotatedBy","annotatedFor","annotatedWith","sort","order"]);let S={},k=this._api.mappings;return e&&(S.from=typeof e=="string"?e:e.uri),r&&(S.fromScheme=typeof r=="string"?r:r.uri),n&&(S.to=typeof n=="string"?n:n.uri),i&&(S.toScheme=typeof i=="string"?i:i.uri),s&&(S.creator=typeof s=="string"?s:P.prefLabel(s)),o&&(S.type=typeof o=="string"?o:o.uri),a&&(S.partOf=typeof a=="string"?a:a.uri),u&&(S.offset=u),l&&(S.limit=l),c&&(S.direction=c),g&&(S.cardinality=g),h&&(S.annotatedBy=h),d&&(S.annotatedFor=d),y&&(S.annotatedWith=y),f&&(S.mode=f),m&&(S.identifier=m),O&&(S.sort=O),R&&(S.order=R),this.axios(F(I({},C),{method:"get",url:k,params:I(I(I({},this._defaultParams),C.params||{}),S)}))})}postMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(!e)throw new U({parameter:"mapping"});return e=P.minifyMapping(e),e=P.addMappingIdentifiers(e),this.axios(F(I({},r),{method:"post",url:this._api.mappings,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}putMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(!e)throw new U({parameter:"mapping"});e=P.minifyMapping(e),e=P.addMappingIdentifiers(e);let s=e.uri;if(!s||!s.startsWith(this._api.mappings))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"put",url:s,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}patchMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);var a;if(!e)throw new U({parameter:"mapping"});if(!((a=e.uri)!=null&&a.startsWith(this._api.mappings)))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});let u=e,{uri:s}=u,o=W(u,["uri"]);return this.axios(F(I({},r),{method:"patch",url:s,data:o,params:I(I({},this._defaultParams),r.params||{})}))})}deleteMapping(n){return E(this,null,function*(){var i=n,{mapping:e}=i,r=W(i,["mapping"]);if(!e)throw new U({parameter:"mapping"});let s=e.uri;if(!s||!s.startsWith(this._api.mappings))throw new U({parameter:"mapping",message:"URI doesn't seem to be part of this registry."});return yield this.axios(F(I({},r),{method:"delete",url:s})),!0})}getAnnotations(n){return E(this,null,function*(){var i=n,{target:e}=i,r=W(i,["target"]);return e&&(r.params||(r.params={}),r.params.target=e),this.axios(F(I({},r),{method:"get",url:this._api.annotations}))})}postAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);return this.axios(F(I({},r),{method:"post",url:this._api.annotations,data:e}))})}putAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);let s=e.id;if(!s||!s.startsWith(this._api.annotations))throw new U({parameter:"annotation",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"put",url:s,data:e}))})}patchAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);let s=e.id;if(!s||!s.startsWith(this._api.annotations))throw new U({parameter:"annotation",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"patch",url:s,data:e}))})}deleteAnnotation(n){return E(this,null,function*(){var i=n,{annotation:e}=i,r=W(i,["annotation"]);let s=e.id;if(!s||!s.startsWith(this._api.annotations))throw new U({parameter:"annotation",message:"URI doesn't seem to be part of this registry."});return yield this.axios(F(I({},r),{method:"delete",url:s})),!0})}getConcordances(e){return E(this,null,function*(){return this.axios(F(I({},e),{method:"get",url:this._api.concordances}))})}postConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);if(!e)throw new U({parameter:"concordance"});return this.axios(F(I({},r),{method:"post",url:this._api.concordances,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}putConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);if(!e)throw new U({parameter:"concordance"});let s=e.uri;if(!s||!s.startsWith(this._api.concordances))throw new U({parameter:"concordance",message:"URI doesn't seem to be part of this registry."});return this.axios(F(I({},r),{method:"put",url:s,data:e,params:I(I({},this._defaultParams),r.params||{})}))})}patchConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);var a;if(!e)throw new U({parameter:"concordance"});if(!((a=e.uri)!=null&&a.startsWith(this._api.concordances)))throw new U({parameter:"concordance",message:"URI doesn't seem to be part of this registry."});let u=e,{uri:s}=u,o=W(u,["uri"]);return this.axios(F(I({},r),{method:"patch",url:s,data:o,params:I(I({},this._defaultParams),r.params||{})}))})}deleteConcordance(n){return E(this,null,function*(){var i=n,{concordance:e}=i,r=W(i,["concordance"]);if(!e)throw new U({parameter:"concordance"});let s=e.uri;if(!s||!s.startsWith(this._api.concordances))throw new U({parameter:"concordance",message:"URI doesn't seem to be part of this registry."});return yield this.axios(F(I({},r),{method:"delete",url:s})),!0})}};ee(Ie,"supports",{mappings:!0,concordances:!0,annotations:!0});Ie.providerName="MappingsApi";Ie.stored=!0;var di={},$e=class extends G{get _cache(){return di[this.uri]}_prepare(){di[this.uri]=[],this._occurrencesSupportedSchemes=[]}_occurrencesIsSupported(e){return E(this,null,function*(){if(!(this._occurrencesSupportedSchemes&&this._occurrencesSupportedSchemes.length))try{let n=Ue(this._api.api,"voc"),i=yield this.axios({method:"get",url:n});this._occurrencesSupportedSchemes=i||[]}catch(n){}let r=!1;for(let n of this._occurrencesSupportedSchemes)P.compare(e,n)&&(r=!0);return r})}getMappings(e){return E(this,null,function*(){var u,l,c,f,m,g,h,d,y,O,R,C,L,N;let r=yield this.getOccurrences(e),n=e.from,i=((u=n==null?void 0:n.inScheme)==null?void 0:u[0])||e.fromScheme,s=e.to,o=((l=s==null?void 0:s.inScheme)==null?void 0:l[0])||e.toScheme,a=[];for(let S of r){if(!S)continue;let k={};k.from=(c=S==null?void 0:S.memberSet)==null?void 0:c[0],k.from?k.from={memberSet:[k.from]}:k.from=null,k.fromScheme=(g=(m=(f=S==null?void 0:S.memberSet)==null?void 0:f[0])==null?void 0:m.inScheme)==null?void 0:g[0],k.to=(h=S==null?void 0:S.memberSet)==null?void 0:h[1],k.to?k.to={memberSet:[k.to]}:k.to={memberSet:[]},k.toScheme=(O=(y=(d=S==null?void 0:S.memberSet)==null?void 0:d[1])==null?void 0:y.inScheme)==null?void 0:O[0],(n&&P.compare(n,(C=(R=k==null?void 0:k.to)==null?void 0:R.memberSet)==null?void 0:C[0])||s&&P.compare(s,(N=(L=k==null?void 0:k.from)==null?void 0:L.memberSet)==null?void 0:N[0]))&&([k.from,k.fromScheme,k.to,k.toScheme]=[k.to,k.toScheme,k.from,k.fromScheme]),!k.fromScheme&&i&&(k.fromScheme=i),!k.toScheme&&o&&(k.toScheme=o),k.type=[P.defaultMappingType.uri],k._occurrence=S,k=P.addMappingIdentifiers(k),a.push(k)}return a._url=r._url,a})}getOccurrences(o){return E(this,null,function*(){var a=o,{from:e,to:r,concepts:n,threshold:i=0}=a,s=W(a,["from","to","concepts","threshold"]);var h;let u=[];n=(n||[]).concat([e,r]).filter(d=>!!d);for(let d of n)u.push(this._occurrencesIsSupported((h=d==null?void 0:d.inScheme)==null?void 0:h[0]).then(y=>y&&d.uri?d.uri:null));let l=yield Promise.all(u);if(l=l.filter(d=>d!=null),l.length==0)throw new U({parameter:"concepts"});u=[];for(let d of l)u.push(this._getOccurrences(F(I({},s),{params:{member:d,scheme:"*",threshold:i}})));let c=yield Promise.all(u),f=c.flat(),m=[],g=[];for(let d=0;d<f.length;d+=1){let y=f[d];if(!y)continue;let O=y.memberSet.reduce((R,C)=>R.concat(C.uri),[]).sort().join(" ");m.includes(O)?g.push(d):m.push(O)}return g.forEach(d=>{delete f[d]}),f=f.filter(d=>d!=null),f=f.sort((d,y)=>parseInt(y.count||0)-parseInt(d.count||0)),f._url=c.map(d=>d._url),f})}_getOccurrences(e){return E(this,null,function*(){let r=this._cache.find(i=>Re(i.config.params,e.params));if(r)return r.data;let n=yield this.axios(F(I({},e),{method:"get",url:this._api.api}));return this._cache.push({config:e,data:n}),this._cache.length>20&&(di[this.uri]=this._cache.slice(this._cache.length-20)),n})}};ee($e,"supports",{occurrences:!0,mappings:!0});$e.providerName="OccurrencesApi";$e.stored=!1;var Te=class extends G{_prepare(){this._api.api&&this._api.status===void 0&&(this._api.status=Ue(this._api.api,"/status"))}_setup(){var e,r;if(this._api.api){let n={schemes:"/voc",top:"/voc/top",concepts:"/voc/concepts",data:"/data",narrower:"/narrower",ancestors:"/ancestors",types:"/types",suggest:"/suggest",search:"/search"};for(let i of Object.keys(n))this._api[i]===void 0&&(this._api[i]=Ue(this._api.api,n[i]))}this.has.schemes=!!this._api.schemes,!this.has.schemes&&Array.isArray(this.schemes)&&(this.has.schemes=!0),this.has.top=!!this._api.top,this.has.data=!!this._api.data,this.has.concepts=!!this._api.concepts||this.has.data,this.has.narrower=!!this._api.narrower,this.has.ancestors=!!this._api.ancestors,this.has.types=!!this._api.types,this.has.suggest=!!this._api.suggest,this.has.search=!!this._api.search,this.has.auth=(r=(e=this._config)==null?void 0:e.auth)==null?void 0:r.key,this._defaultParams={properties:"+created,issued,modified,editorialNote,scopeNote,note,definition,mappings,location"}}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r?null:{api:e,schemes:[r]}}_getSchemeUri(e){return E(this,null,function*(){this._approvedSchemes=this._approvedSchemes||[],this._rejectedSchemes=this._rejectedSchemes||[];let r=this._approvedSchemes.find(s=>P.compare(e,s));if(r)return r.uri;if(this._rejectedSchemes.find(s=>P.compare(e,s)))return null;let i=(yield this.getSchemes({params:{uri:P.getAllUris(e).join("|")}})).find(s=>P.compare(s,e));return i?(this._approvedSchemes.push({uri:i.uri,identifier:P.getAllUris(e)}),i.uri):(this._rejectedSchemes.push({uri:e.uri,identifier:e.identifier}),null)})}getSchemes(){return E(this,arguments,function*(e={}){if(!this._api.schemes){if(Array.isArray(this.schemes))return this.schemes;throw new xe}let r=yield this.axios(F(I({},e),{method:"get",url:this._api.schemes,params:I(F(I({},this._defaultParams),{limit:500}),e.params||{})}));return Array.isArray(this.schemes)?wt(r.filter(n=>P.isContainedIn(n,this.schemes)),r):r})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!this._api.top)throw new xe;if(!e)throw new U({parameter:"scheme"});let s=yield this._getSchemeUri(e);if(!s)throw new U({parameter:"scheme",message:"Requested vocabulary seems to be unsupported by this API."});return Array.isArray(this._api.top)?this._api.top:this.axios(F(I({},r),{method:"get",url:this._api.top,params:F(I(F(I({},this._defaultParams),{limit:1e4}),r.params||{}),{uri:s})}))})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);let s=this._api.concepts||this._api.data;if(!s)throw new xe;Array.isArray(e)||(e=e?[e]:[]);let o=e.map(a=>a.uri).filter(a=>a!=null);return this.axios(F(I({},r),{method:"get",url:s,params:F(I(F(I({},this._defaultParams),{limit:100}),r.params||{}),{uri:o.join("|")})}))})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);var s;if(!e||!e.uri)throw new U({parameter:"concept"});if(this._api.narrower)return this.axios(F(I({},r),{method:"get",url:this._api.narrower,params:F(I(F(I({},this._defaultParams),{limit:1e4}),r.params||{}),{uri:e.uri})}));{let o=I({params:{}},r);o.params.properties="narrower";let u=((s=(yield this.getConcepts(I({concepts:[e]},o)))[0])==null?void 0:s.narrower)||[];return u.length?this.getConcepts(I({concepts:u},r)):[]}})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);var s;if(!e||!e.uri)throw new U({parameter:"concept"});if(this._api.ancestors)return this.axios(F(I({},r),{method:"get",url:this._api.ancestors,params:F(I(F(I({},this._defaultParams),{limit:1e4}),r.params||{}),{uri:e.uri})}));{let o=I({params:{}},r);o.params.properties="ancestors";let u=((s=(yield this.getConcepts(I({concepts:[e]},o)))[0])==null?void 0:s.ancestors)||[];return u.length?this.getConcepts(I({concepts:u},r)):[]}})}suggest(o){return E(this,null,function*(){var a=o,{use:e="notation,label",types:r=[],sort:n="score",params:i={}}=a,s=W(a,["use","types","sort","params"]);return this._search(F(I({},s),{endpoint:"suggest",params:F(I({},i),{type:r.join("|"),use:e,sort:n})}))})}search(i){return E(this,null,function*(){var s=i,{types:e=[],params:r={}}=s,n=W(s,["types","params"]);return this._search(F(I({},n),{endpoint:"search",params:F(I({},r),{type:e.join("|")})}))})}vocSuggest(s){return E(this,null,function*(){var o=s,{use:e="notation,label",sort:r="score",params:n={}}=o,i=W(o,["use","sort","params"]);return this._search(F(I({},i),{endpoint:"voc-suggest",params:F(I({},n),{use:e,sort:r})}))})}vocSearch(e){return E(this,null,function*(){return this._search(F(I({},e),{endpoint:"voc-search"}))})}_search(l){return E(this,null,function*(){var c=l,{endpoint:e,scheme:r,search:n,limit:i,offset:s,params:o,url:a}=c,u=W(c,["endpoint","scheme","search","limit","offset","params","url"]);if(a=a!=null?a:this._api[e],!a)throw new xe;if(!n)throw new U({parameter:"search"});i=i||this._jskos.suggestResultLimit||100,s=s||0;let f=r&&(yield this._getSchemeUri(r));return a=a.replace("{searchTerms}",n),this.axios(F(I({},u),{params:F(I(I({},this._defaultParams),o),{limit:i,count:i,offset:s,search:n,query:n,voc:f}),method:"get",url:a}))})}getTypes(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!this._api.types)throw new xe;if(Array.isArray(this._api.types))return this._api.types;let s=e&&(yield this._getSchemeUri(e));s&&(r.params||(r.params={}),r.params.uri=s);let o=yield this.axios(F(I({},r),{method:"get",url:this._api.types}));return s&&(o=o.filter(a=>!a.inScheme||P.isContainedIn(e,a.inScheme))),o})}};ee(Te,"providerName","ConceptApi"),ee(Te,"providerType","http://bartoc.org/api-type/jskos"),ee(Te,"supports",{schemes:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,types:!0,suggest:!0,search:!0,auth:!0});var mi={},je=class extends G{get _cache(){return mi[this.uri]}_prepare(){mi[this.uri]=[]}getMappings(s){return E(this,null,function*(){var o=s,{from:e,to:r,mode:n}=o,i=W(o,["from","to","mode"]);var S,k,D,$,X,K;let a=[];Array.isArray(this.schemes)&&(a=this.schemes);let u,l,c=(S=e==null?void 0:e.inScheme)==null?void 0:S[0],f=(k=r==null?void 0:r.inScheme)==null?void 0:k[0],m,g;if(!e||P.isContainedIn(c,a)?(u=!0,l=r,m=f,g=a.find(V=>P.compare(V,c))||a[0]):(u=!1,l=e,m=c,g=a.find(V=>P.compare(V,f))||a[0]),n!="or")return[];if(!this._api.api)throw new xe;if(!l)throw new U({parameter:u?"to":"from"});let h=P.languagePreference.selectLanguage(l.prefLabel);if(!h)throw new U({parameter:u?"to":"from",message:"Missing language"});let d=($=(D=l==null?void 0:l.altLabel)==null?void 0:D[h])!=null?$:[];typeof d=="string"&&(d=[d]);let y=(X=l==null?void 0:l.prefLabel)==null?void 0:X[h],O=d.concat([y]);O=[y];let{url:R,data:C}=yield this._getReconciliationResults(F(I({},i),{labels:O,language:h}));C=[].concat(...Object.values(C).map(V=>V.result)).filter(V=>V),C=C.sort((V,Z)=>V.score!=Z.score?Z.score-V.score:V.match!=Z.match?V.match?-1:1:V.id.length-Z.id.length);let L=(K=g==null?void 0:g.namespace)!=null?K:"",N=C.map(V=>({fromScheme:m,from:{memberSet:[l]},toScheme:g,to:{memberSet:[{uri:L+V.id}]},type:[V.match?"http://www.w3.org/2004/02/skos/core#exactMatch":V.score>=80?"http://www.w3.org/2004/02/skos/core#closeMatch":"http://www.w3.org/2004/02/skos/core#mappingRelation"]}));return u&&(N=N.map(V=>Object.assign(V,{fromScheme:V.toScheme,from:V.to,toScheme:V.fromScheme,to:V.from}))),N._url=R,N})}_getReconciliationResults(i){return E(this,null,function*(){var s=i,{labels:e,language:r}=s,n=W(s,["labels","language"]);e=e.sort();let o=this._cache.find(g=>Re(g.labels,e)&&g.language==r);if(o)return o;let a={},u=0;for(let g of e)a[`q${u}`]={query:g},u+=1;let l=this._api.api;r&&(l=l.replace("{language}",r));let c=`queries=${encodeURIComponent(JSON.stringify(a))}`;n.headers||(n.headers={}),n.headers["Content-Type"]="application/x-www-form-urlencoded";let f=yield this.axios(F(I({},n),{method:"post",url:l,data:c}));f=f||{};let m={labels:e,language:r,data:f,url:`${l}${l.includes("?")?"&":"?"}${c}`};return this._cache.push(m),this._cache.length>20&&(mi[this.uri]=this._cache.slice(this._cache.length-20)),m})}};ee(je,"supports",{mappings:!0});je.providerName="ReconciliationApi";je.providerType="http://bartoc.org/api-type/reconciliation";je.stored=!1;var We=class extends G{_prepare(){this._cache=[]}supportsScheme(e){var r,n;return super.supportsScheme(e)&&((n=(r=e==null?void 0:e._registry)==null?void 0:r.has)==null?void 0:n.search)}getMappings(a){return E(this,null,function*(){var u=a,{from:e,to:r,mode:n,selected:i,limit:s=10}=u,o=W(u,["from","to","mode","selected","limit"]);if(n!="or")return[];if(!i)throw new U({parameter:"selected"});let l=[];e&&this.supportsScheme(i.scheme[!1])?l.push(this._getMappings(F(I({},o),{concept:e,sourceScheme:i.scheme[!0],targetScheme:i.scheme[!1],limit:s}))):l.push(Promise.resolve([])),r&&this.supportsScheme(i.scheme[!0])?l.push(this._getMappings(F(I({},o),{concept:r,sourceScheme:i.scheme[!1],targetScheme:i.scheme[!0],limit:s,swap:!0}))):l.push(Promise.resolve([]));let[c,f]=yield Promise.all(l);for(f=f.filter(m=>!c.find(g=>P.compareMappingMembers(m,g)));c.length+f.length>s;)f.length>=c.length?f.pop():c.pop();return[...c,...f]})}_getMappings(a){return E(this,null,function*(){var u=a,{concept:e,sourceScheme:r,targetScheme:n,limit:i,swap:s=!1}=u,o=W(u,["concept","sourceScheme","targetScheme","limit","swap"]);var h;if(!e||!r||!n)return[];if(P.compare(r,n))return[];let l=P.languagePreference.selectLanguage(e.prefLabel)||this._defaultLanguages[0],c=P.prefLabel(e,{fallbackToUri:!1,language:l});if(!c)return[];let f=/^[\s\wäüöÄÜÖß]*\w/.exec(c);c=f?f[0]:c;let m=yield this._getResults(F(I({},o),{label:c,targetScheme:n,limit:i}));if(!m.length&&((h=e.broader)!=null&&h.length))for(let d of e.broader){let y=P.prefLabel(d,{fallbackToUri:!1,language:l});if(y&&(m=yield this._getResults(F(I({},o),{label:y,targetScheme:n,limit:i})),m.length))break}let g=m.map(d=>({fromScheme:r,from:{memberSet:[e]},toScheme:n,to:{memberSet:[d]},type:["http://www.w3.org/2004/02/skos/core#mappingRelation"]}));return s&&(g=g.map(d=>Object.assign(d,{fromScheme:d.toScheme,from:d.to,toScheme:d.fromScheme,to:d.from}))),g})}_getResults(s){return E(this,null,function*(){var o=s,{label:e,targetScheme:r,limit:n}=o,i=W(o,["label","targetScheme","limit"]);var f;let a=(this._cache[r.uri]||{})[e];if(a&&a._limit>=n)return a;let u=r==null?void 0:r._registry;if(!u||u.has.search===!1)return[];let l=(f=(this._jskos.overrides||[]).find(m=>P.compare(m,r)))==null?void 0:f.search,c=yield u.search(F(I({},i),{url:l,search:e,scheme:r,limit:n}));return this._cache[r.uri]||(this._cache[r.uri]={}),this._cache[r.uri][e]=c,this._cache[r.uri][e]._limit=n,c})}};ee(We,"supports",{mappings:!0});We.providerName="LabelSearchSuggestion";We.stored=!1;var He=class extends G{static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){if(!e||!r)return null;let n={},i=e.match(/(.+\/)([^/]+)\/$/);return i?(n.api=i[1]+"rest/v1/",r.VOCID=i[2],n.schemes=[r],n):null}get _language(){return this.languages[0]||this._defaultLanguages[0]||"en"}_getApiUrl(e,r,n){var o;let i=(e==null?void 0:e.VOCID)||((o=this.schemes.find(a=>P.compare(a,e)))==null?void 0:o.VOCID);if(!i)throw new U({parameter:"scheme",message:"Missing scheme or VOCID property on scheme"});r=r||"",n=n||{},n.lang||(n.lang=this._language);let s=Object.keys(n).map(a=>`${a}=${encodeURIComponent(n[a])}`).join("&");return`${this._api.api}${i}${r}${s?"?"+s:""}`}_getDataUrl(e,{addFormatParameter:r=!0}={}){var i;let n=(i=e==null?void 0:e.inScheme)==null?void 0:i[0];if(!e||!e.uri)throw new U({parameter:"concept",message:"Missing concept URI"});return this._getApiUrl(n,"/data",r?{format:"application/json"}:{})}_getSchemeUri(e){return E(this,null,function*(){this._approvedSchemes=this._approvedSchemes||[],this._rejectedSchemes=this._rejectedSchemes||[];let r=this._approvedSchemes.find(o=>P.compare(e,o));if(r)return r.uri;if(this._rejectedSchemes.find(o=>P.compare(e,o)))return null;let n=this._getApiUrl(e,"/"),s=(yield this.axios({method:"get",url:n})).conceptschemes.find(o=>P.compare(o,e));return s?(this._approvedSchemes.push({uri:s.uri,identifier:P.getAllUris(e)}),s.uri):(this._rejectedSchemes.push({uri:e.uri,identifier:e.identifier}),null)})}_toJskosConcept(e,{concept:r,scheme:n,result:i,language:s}={}){var c;if(!e)return null;r=P.deepCopy(r||{}),s=s||e.lang||"en",r.uri=e.uri,n&&(r.inScheme=[n]);let o=e.matchedPrefLabel||e.prefLabel||e.label;if(typeof o=="string")r.prefLabel||(r.prefLabel={}),r.prefLabel[s]=o;else{o&&!Array.isArray(o)&&(o=[o]);for(let f of o||[])r.prefLabel||(r.prefLabel={}),r.prefLabel[f.lang]=f.value}let a=e.altLabel;if(typeof a=="string")r.altLabel||(r.altLabel={}),r.altLabel[s]=a;else{a&&!Array.isArray(a)&&(a=[a]);for(let f of a||[])(c=r==null?void 0:r.altLabel)!=null&&c[f.lang]?(r.altLabel[f.lang].push(f.value),r.altLabel[f.lang]=[...new Set(r.altLabel[f.lang])]):(r.altLabel||(r.altLabel={}),r.altLabel[f.lang]=[f.value])}let u=e.notation||e["skos:notation"]||P.notation(r);u&&(r.notation=[u.value||u]),e.broader&&(Array.isArray(e.broader)||(e.broader=[e.broader]),r.broader=e.broader.map(f=>typeof f=="string"?{uri:f}:f)),e.hasChildren===!0?r.narrower=[null]:e.hasChildren===!1&&(r.narrower=[]),e.type&&!Array.isArray(e.type)&&(e.type=[e.type]),r.type=r.type||[];for(let f of e.type||[]){if(!P.isValidUri(f))continue;let m=f.slice(0,f.indexOf(":"));i&&i["@context"]&&i["@context"][m]&&(f=f.replace(m+":",i["@context"][m])),r.type.push(f)}r.type=[...new Set(r.type)],r.type.length||(r.type=["http://www.w3.org/2004/02/skos/core#Concept"]);let l={"skos:definition":"definition","skos:note":"note","skos:scopeNote":"scopeNote","skos:example":"example","skos:historyNote":"historyNote","skos:editorialNote":"editorialNote","skos:changeNote":"changeNote"};for(let f in l)if(e[f]){let m=e[f];if(m.lang&&m.value)r[l[f]]={[m.lang]:m.value};else if(Array.isArray(m)){r[l[f]]={};for(let g of m)g.lang&&g.value&&(r[l[f]][g.lang]=g.value)}}return r}getSchemes(){return E(this,arguments,function*(r={}){var e=W(r,[]);let n=[];for(let i of this.schemes||[]){let s=this._getApiUrl(i,"/"),a=(yield this.axios(F(I({},e),{method:"get",url:s}))).conceptschemes.find(l=>P.compare(l,i)),u=a&&(a.prefLabel||a.label||a.title);u&&(i.prefLabel||(i.prefLabel={}),i.prefLabel[this._language]=u),n.push(i),this._approvedSchemes=this._approvedSchemes||[],this._approvedSchemes.find(l=>P.compare(i,l))||this._approvedSchemes.push({uri:a.uri,identifier:P.getAllUris(i)})}return n})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);let s=this._getApiUrl(e,"/topConcepts"),o=yield this._getSchemeUri(e);if(!o)throw new U({parameter:"scheme",message:"Missing or unsupported scheme or VOCID property on scheme"});r.params||(r.params={}),r.params.scheme=o;let a=yield this.axios(F(I({},r),{method:"get",url:s})),u=[];for(let l of a.topconcepts||[]){let c=this._toJskosConcept(l,{scheme:e,language:this._language});c.topConceptOf=[e],u.push(c)}return u})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);var o,a;Array.isArray(e)||(e=[e]),e=e.map(u=>({uri:u.uri,inScheme:u.inScheme}));let s=[];for(let u of e){if(!u||!u.uri)throw new U({parameter:"concept",message:"Missing concept URI"});let l={uri:u.uri,format:"application/json"},c=this._getApiUrl((o=u==null?void 0:u.inScheme)==null?void 0:o[0],"/data",l);if(!c)continue;let f=yield this.axios(F(I({},r),{method:"get",url:c})),m=(a=f==null?void 0:f.graph)==null?void 0:a.find(g=>P.compare(g,u));if(m){let g=this._toJskosConcept(m,{concept:u,result:f});for(let h of["broader","narrower"]){let d=m[h]||g[h];d&&!Array.isArray(d)&&(d=[d]),d||(d=[]),g[h]=d.map(y=>this._toJskosConcept(f.graph.find(O=>P.compare(O,y)),{scheme:u.inScheme[0],result:f}))}g.ancestors=[],s.push(g)}}return s})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});let s=e.inScheme[0],o=this._getApiUrl(s,"/children");return r.params||(r.params={}),r.params.uri=e.uri,((yield this.axios(F(I({},r),{method:"get",url:o}))).narrower||[]).map(l=>this._toJskosConcept(l,{scheme:s}))})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);var f,m,g,h;if(!e||!e.uri)throw new U({parameter:"concept"});let s=e.inScheme[0],o=this._getApiUrl(s,"/broaderTransitive");r.params||(r.params={}),r.params.uri=e.uri;let a=yield this.axios(F(I({},r),{method:"get",url:o})),u=[],l=e.uri;for(;l;){if(l!=e.uri){let d=(f=a==null?void 0:a.broaderTransitive)==null?void 0:f[l];u=u.concat([d])}l=(h=(g=(m=a==null?void 0:a.broaderTransitive)==null?void 0:m[l])==null?void 0:g.broader)==null?void 0:h[0]}return u.map(d=>this._toJskosConcept(d,{scheme:s})).filter(d=>d.uri!=e.uri)})}search(o){return E(this,null,function*(){var a=o,{search:e,scheme:r,limit:n,types:i=[]}=a,s=W(a,["search","scheme","limit","types"]);let u=this._getApiUrl(r,"/search");return s.params||(s.params={}),s.params.query=`${e}*`,s.params.unique=1,s.params.maxhits=n||100,s.params.type=i.join(" "),((yield this.axios(F(I({},s),{method:"get",url:u}))).results||[]).map(f=>this._toJskosConcept(f,{scheme:r}))})}getTypes(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);let s=this._getApiUrl(e,"/types"),o=[],a=yield this.axios(F(I({},r),{method:"get",url:s}));for(let u of(a==null?void 0:a.types)||[])u.uri!="http://www.w3.org/2004/02/skos/core#Concept"&&(u.label&&(u.prefLabel={[a["@context"]["@language"]]:u.label},delete u.label),o.push(u));return o._url=s,o})}};ee(He,"supports",{scheme:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,types:!0,suggest:!0,search:!0});He.providerName="SkosmosApi";He.providerType="http://bartoc.org/api-type/skosmos";var Gr="http://id.loc.gov/authorities/",Xr=[{uri:`${Gr}subjects`,identifier:["http://bartoc.org/en/node/454"],notation:["LCSH"],concepts:[null],topConcepts:[]},{uri:`${Gr}names`,identifier:["http://bartoc.org/en/node/18536"],notation:["LCNAF"],concepts:[null],topConcepts:[]}],po=`${Gr}classification`;function mo(t){let e={};e.uri=t["@id"],e.notation=(t["http://www.loc.gov/mads/rdf/v1#code"]||[]).map(i=>i["@value"]);let r=t["http://www.loc.gov/mads/rdf/v1#authoritativeLabel"]||t["http://www.w3.org/2000/01/rdf-schema#label"]||[];r.length&&(e.prefLabel={},e.prefLabel[r[0]["@language"]||"en"]=r[0]["@value"]);let n=t["http://www.w3.org/2004/02/skos/core#altLabel"]||[];n.length&&(e.altLabel={en:n.map(i=>i["@value"])});for(let i of t["http://www.w3.org/2000/01/rdf-schema#comment"]||[])e.definition=e.definition||{},e.definition.en=e.definition.en||[],e.definition.en.push(i["@value"]);return e}function $l(t){let e=mo(t);return e.namespace=e.uri+"/",e.type=["http://www.w3.org/2004/02/skos/core#ConceptScheme"],e}var gi=t=>e=>!e||!t||!t.namespace?!0:e.uri.startsWith(t.namespace);function Wl(t,{scheme:e}){let r=mo(t);r.type=["http://www.w3.org/2004/02/skos/core#Concept"],r.inScheme=e?[e]:(t["http://www.loc.gov/mads/rdf/v1#isMemberOfMADSScheme"]||[]).map(s=>Xr.find(o=>o.uri===s["@id"])),(!r.inScheme.length||!r.inScheme[0])&&delete r.inScheme;let n=t["http://www.loc.gov/mads/rdf/v1#hasNarrowerAuthority"]||P.compare(r.inScheme[0],{uri:po})&&t["http://www.loc.gov/mads/rdf/v1#hasMADSCollectionMember"]||[];r.narrower=n.map(s=>({uri:s["@id"]})).filter(gi(r.inScheme&&r.inScheme[0]));let i=t["http://www.loc.gov/mads/rdf/v1#hasBroaderAuthority"]||P.compare(r.inScheme[0],{uri:po})&&t["http://www.loc.gov/mads/rdf/v1#isMemberOfMADSCollection"]||[];return r.broader=i.map(s=>({uri:s["@id"]})).filter(gi(r.inScheme&&r.inScheme[0])),r}var qe=class extends G{static _registryConfigForBartocApiConfig({scheme:e}={}){return!e||!Xr.find(r=>P.compare(r,e))?null:{schemes:[e]}}getSchemes(){return E(this,null,function*(){let e=[];for(let r of yield Promise.all(Xr.filter(n=>!this.schemes||!this.schemes.length||this.schemes.find(i=>P.compare(n,i))).map(n=>pe({method:"get",url:`${n.uri.replace("http:","https:")}.json`}).then(({status:i,data:s})=>{if(i===200){let o=s.find(a=>n.uri===a["@id"]);if(o)return o=P.merge($l(o),n),o.topConcepts=(o.topConcepts||[]).filter(a=>a),o}return null}))))r&&e.push(r);return e})}getConcepts(r){return E(this,arguments,function*({concepts:e}){Array.isArray(e)||(e=[e]);let n=[];for(let i of yield Promise.all(e.map(s=>pe({method:"get",url:`${s.uri.replace("http:","https:")}.json`}).then(({status:o,data:a})=>{if(o===200){let u=a.find(l=>s.uri===l["@id"]);return u?Wl(u,{scheme:s.inScheme&&s.inScheme[0]}):null}}))))i&&n.push(i);return n})}suggest(e){return E(this,null,function*(){let r=yield this.search(e);return[e.search,r.map(n=>P.prefLabel(n,{fallbackToUri:!0})),[],r.map(n=>n.uri)]})}search(s){return E(this,arguments,function*({search:e,scheme:r,limit:n,offset:i}){let o=P.getAllUris(r).find(u=>u.startsWith(Gr));if(!o||!Xr.find(u=>P.compare(u,{uri:o})))throw new U({parameter:"scheme",message:"provided scheme is not supported (yet)"});if(!e)throw new U({parameter:"search",message:"parameter is empty or missing"});n=n||this._jskos.suggestResultLimit||100,i=i||0;let{data:a}=yield pe({method:"get",url:`${o}/suggest2`.replace("http:","https:"),params:{q:e,count:n||100,offset:i,searchtype:"keyword"}});return(a.hits||[]).map(u=>({uri:u.uri,notation:[u.token],prefLabel:{en:u.aLabel},inScheme:[r]})).filter(gi(r))})}};ee(qe,"supports",{schemes:!0,top:!1,data:!0,concepts:!0,narrower:!1,ancestors:!1,suggest:!0,search:!0});qe.providerName="LocApi";qe.providerType="http://bartoc.org/api-type/loc";var ko={};var H;function ye(t,e,r){let n=typeof r,i=typeof t;if(n!=="undefined"){if(i!=="undefined"){if(r){if(i==="function"&&n===i)return function(a){return t(r(a))};if(e=t.constructor,e===r.constructor){if(e===Array)return r.concat(t);if(e===Map){var s=new Map(r);for(var o of t)s.set(o[0],o[1]);return s}if(e===Set){o=new Set(r);for(s of t.values())o.add(s);return o}}}return t}return r}return i==="undefined"?e:t}function Bt(t,e){return typeof t=="undefined"?e:t}function le(){return Object.create(null)}function Pe(t){return typeof t=="string"}function _r(t){return typeof t=="object"}function br(t,e){if(Pe(e))t=t[e];else for(let r=0;t&&r<e.length;r++)t=t[e[r]];return t}var Hl=/[^\p{L}\p{N}]+/u,ql=/(\d{3})/g,Vl=/(\D)(\d{3})/g,Jl=/(\d{3})(\D)/g,go=/[\u0300-\u036f]/g;function $t(t={}){if(!this||this.constructor!==$t)return new $t(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}H=$t.prototype;H.assign=function(t){this.normalize=ye(t.normalize,!0,this.normalize);let e=t.include,r=e||t.exclude||t.split,n;if(r||r===""){if(typeof r=="object"&&r.constructor!==RegExp){let i="";n=!e,e||(i+="\\p{Z}"),r.letter&&(i+="\\p{L}"),r.number&&(i+="\\p{N}",n=!!e),r.symbol&&(i+="\\p{S}"),r.punctuation&&(i+="\\p{P}"),r.control&&(i+="\\p{C}"),(r=r.char)&&(i+=typeof r=="object"?r.join(""):r);try{this.split=new RegExp("["+(e?"^":"")+i+"]+","u")}catch(s){this.split=/\s+/}}else this.split=r,n=r===!1||"a1a".split(r).length<2;this.numeric=ye(t.numeric,n)}else{try{this.split=ye(this.split,Hl)}catch(i){this.split=/\s+/}this.numeric=ye(t.numeric,ye(this.numeric,!0))}if(this.prepare=ye(t.prepare,null,this.prepare),this.finalize=ye(t.finalize,null,this.finalize),r=t.filter,this.filter=typeof r=="function"?r:ye(r&&new Set(r),null,this.filter),this.dedupe=ye(t.dedupe,!0,this.dedupe),this.matcher=ye((r=t.matcher)&&new Map(r),null,this.matcher),this.mapper=ye((r=t.mapper)&&new Map(r),null,this.mapper),this.stemmer=ye((r=t.stemmer)&&new Map(r),null,this.stemmer),this.replacer=ye(t.replacer,null,this.replacer),this.minlength=ye(t.minlength,1,this.minlength),this.maxlength=ye(t.maxlength,1024,this.maxlength),this.rtl=ye(t.rtl,!1,this.rtl),(this.cache=r=ye(t.cache,!0,this.cache))&&(this.F=null,this.L=typeof r=="number"?r:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(let i of this.matcher.keys())this.h+=(this.h?"|":"")+i;if(this.stemmer)for(let i of this.stemmer.keys())this.A+=(this.A?"|":"")+i;return this};H.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&_t(this),this};H.addFilter=function(t){return typeof t=="function"?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&_t(this),this};H.addMapper=function(t,e){return typeof t=="object"?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&_t(this),this)};H.addMatcher=function(t,e){return typeof t=="object"?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&_t(this),this)};H.addReplacer=function(t,e){return typeof t=="string"?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&_t(this),this)};H.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(_t,50,this);this.normalize&&(typeof this.normalize=="function"?t=this.normalize(t):t=go?t.normalize("NFKD").replace(go,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(Vl,"$1 $2").replace(Jl,"$1 $2").replace(ql,"$1 "));let r=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer),n=[],i=le(),s,o,a=this.split||this.split===""?t.split(this.split):[t];for(let l=0,c,f;l<a.length;l++)if((c=f=a[l])&&!(c.length<this.minlength||c.length>this.maxlength)){if(e){if(i[c])continue;i[c]=1}else{if(s===c)continue;s=c}if(r)n.push(c);else if(!this.filter||(typeof this.filter=="function"?this.filter(c):!this.filter.has(c))){if(this.cache&&c.length<=this.I)if(this.F){var u=this.D.get(c);if(u||u===""){u&&n.push(u);continue}}else this.F=setTimeout(_t,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let m;for(;m!==c&&c.length>2;)m=c,c=c.replace(this.K,g=>this.stemmer.get(g))}if(c&&(this.mapper||this.dedupe&&c.length>1)){u="";for(let m=0,g="",h,d;m<c.length;m++)h=c.charAt(m),h===g&&this.dedupe||((d=this.mapper&&this.mapper.get(h))||d===""?d===g&&this.dedupe||!(g=d)||(u+=d):u+=g=h);c=u}if(this.matcher&&c.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),c=c.replace(this.J,m=>this.matcher.get(m))),c&&this.replacer)for(u=0;c&&u<this.replacer.length;u+=2)c=c.replace(this.replacer[u],this.replacer[u+1]);if(this.cache&&f.length<=this.I&&(this.D.set(f,c),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),c){if(c!==f)if(e){if(i[c])continue;i[c]=1}else{if(o===c)continue;o=c}n.push(c)}}}return this.finalize&&(n=this.finalize(n)||n),this.cache&&t.length<=this.H&&(this.B.set(t,n),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),n};function _t(t){t.F=null,t.B.clear(),t.D.clear()}function Ei(t,e,r){r||(e||typeof t!="object"?typeof e=="object"&&(r=e,e=0):r=t),r&&(t=r.query||t,e=r.limit||e);let n=""+(e||0);r&&(n+=(r.offset||0)+!!r.context+!!r.suggest+(r.resolve!==!1)+(r.resolution||this.resolution)+(r.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new St);let i=this.cache.get(t+n);if(!i){let s=r&&r.cache;s&&(r.cache=!1),i=this.search(t,e,r),s&&(r.cache=s),this.cache.set(t+n,i)}return i}function St(t){this.limit=t&&t!==!0?t:1e3,this.cache=new Map,this.h=""}St.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};St.prototype.get=function(t){let e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e};St.prototype.remove=function(t){for(let e of this.cache){let r=e[0];e[1].includes(t)&&this.cache.delete(r)}};St.prototype.clear=function(){this.cache.clear(),this.h=""};var wo={normalize:!1,numeric:!1,dedupe:!1},Qr={},yi=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),yo=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),_o=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],bo={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,\u00DF:2,d:3,t:3,l:4,m:5,n:5,r:6},Ai={Exact:wo,Default:Qr,Normalize:Qr,LatinBalance:{mapper:yi},LatinAdvanced:{mapper:yi,matcher:yo,replacer:_o},LatinExtra:{mapper:yi,replacer:_o.concat([/(?!^)[aeo]/g,""]),matcher:yo},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let r=0;r<t.length;r++){var e=t[r];let n=e.charAt(0),i=bo[n];for(let s=1,o;s<e.length&&(o=e.charAt(s),o==="h"||o==="w"||!(o=bo[o])||o===i||(n+=o,i=o,n.length!==4));s++);t[r]=n}}},CJK:{split:""},LatinExact:wo,LatinDefault:Qr,LatinSimple:Qr};function vo(t,e,r,n){let i=[];for(let s=0,o;s<t.index.length;s++)if(o=t.index[s],e>=o.length)e-=o.length;else{e=o[n?"splice":"slice"](e,r);let a=e.length;if(a&&(i=i.length?i.concat(e):e,r-=a,n&&(t.length-=a),!r))break;e=0}return i}function Wt(t){if(!this||this.constructor!==Wt)return new Wt(t);this.index=t?[t]:[],this.length=t?t.length:0;let e=this;return new Proxy([],{get(r,n){if(n==="length")return e.length;if(n==="push")return function(i){e.index[e.index.length-1].push(i),e.length++};if(n==="pop")return function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()};if(n==="indexOf")return function(i){let s=0;for(let o=0,a,u;o<e.index.length;o++){if(a=e.index[o],u=a.indexOf(i),u>=0)return s+u;s+=a.length}return-1};if(n==="includes")return function(i){for(let s=0;s<e.index.length;s++)if(e.index[s].includes(i))return!0;return!1};if(n==="slice")return function(i,s){return vo(e,i||0,s||e.length,!1)};if(n==="splice")return function(i,s){return vo(e,i||0,s||e.length,!0)};if(n==="constructor")return Array;if(typeof n!="symbol")return(r=e.index[n/rt(2,31)|0])&&r[n]},set(r,n,i){return r=n/rt(2,31)|0,(e.index[r]||(e.index[r]=[]))[n]=i,e.length++,!0}})}Wt.prototype.clear=function(){this.index.length=0};Wt.prototype.push=function(){};function De(t=8){if(!this||this.constructor!==De)return new De(t);this.index=le(),this.h=[],this.size=0,t>32?(this.B=Io,this.A=BigInt(t)):(this.B=Ro,this.A=t)}De.prototype.get=function(t){let e=this.index[this.B(t)];return e&&e.get(t)};De.prototype.set=function(t,e){var r=this.B(t);let n=this.index[r];n?(r=n.size,n.set(t,e),(r-=n.size)&&this.size++):(this.index[r]=n=new Map([[t,e]]),this.h.push(n),this.size++)};function Me(t=8){if(!this||this.constructor!==Me)return new Me(t);this.index=le(),this.h=[],this.size=0,t>32?(this.B=Io,this.A=BigInt(t)):(this.B=Ro,this.A=t)}Me.prototype.add=function(t){var e=this.B(t);let r=this.index[e];r?(e=r.size,r.add(t),(e-=r.size)&&this.size++):(this.index[e]=r=new Set([t]),this.h.push(r),this.size++)};H=De.prototype;H.has=Me.prototype.has=function(t){let e=this.index[this.B(t)];return e&&e.has(t)};H.delete=Me.prototype.delete=function(t){let e=this.index[this.B(t)];e&&e.delete(t)&&this.size--};H.clear=Me.prototype.clear=function(){this.index=le(),this.h=[],this.size=0};H.values=Me.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e};H.keys=Me.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e};H.entries=Me.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};function Ro(t){let e=rt(2,this.A)-1;if(typeof t=="number")return t&e;let r=0,n=this.A+1;for(let i=0;i<t.length;i++)r=(r*n^t.charCodeAt(i))&e;return this.A===32?r+rt(2,31):r}function Io(t){let e=rt(BigInt(2),this.A)-BigInt(1);var r=typeof t;if(r==="bigint")return t&e;if(r==="number")return BigInt(t)&e;r=BigInt(0);let n=this.A+BigInt(1);for(let i=0;i<t.length;i++)r=(r*n^BigInt(t.charCodeAt(i)))&e;return r}var jt,yr;function Kl(t){return E(this,null,function*(){t=t.data;var e=t.task;let r=t.id,n=t.args;if(e==="init")yr=t.options||{},(e=t.factory)?(Function("return "+e)()(self),jt=new self.FlexSearch.Index(yr),delete self.FlexSearch):jt=new Ne(yr),postMessage({id:r});else{let i;e==="export"&&(n[1]?(n[0]=yr.export,n[2]=0,n[3]=1):n=null),e==="import"?n[0]&&(t=yield yr.import.call(jt,n[0]),jt.import(n[0],t)):((i=n&&jt[e].apply(jt,n))&&i.then&&(i=yield i),i&&i.await&&(i=yield i.await),e==="search"&&i.result&&(i=i.result)),postMessage(e==="search"?{id:r,msg:i}:{id:r})}})}function Ci(t){Ut.call(t,"add"),Ut.call(t,"append"),Ut.call(t,"search"),Ut.call(t,"update"),Ut.call(t,"remove"),Ut.call(t,"searchCache")}var bi,So,tn;function Yl(){bi=tn=0}function Ut(t){this[t+"Async"]=function(){let e=arguments;var r=e[e.length-1];let n;if(typeof r=="function"&&(n=r,delete e[e.length-1]),bi?tn||(tn=Date.now()-So>=this.priority*this.priority*3):(bi=setTimeout(Yl,0),So=Date.now()),tn){let s=this;return new Promise(o=>{setTimeout(function(){o(s[t+"Async"].apply(s,e))},0)})}let i=this[t].apply(this,e);return r=i.then?i:new Promise(s=>s(i)),n&&r.then(n),r}}var ot=0;function bt(t={},e){function r(a){function u(l){l=l.data||l;let c=l.id,f=c&&s.h[c];f&&(f(l.msg),delete s.h[c])}if(this.worker=a,this.h=le(),this.worker)return i?this.worker.on("message",u):this.worker.onmessage=u,t.config?new Promise(function(l){ot>1e9&&(ot=0),s.h[++ot]=function(){l(s)},s.worker.postMessage({id:ot,task:"init",factory:n,options:t})}):(this.priority=t.priority||4,this.encoder=e||null,this.worker.postMessage({task:"init",factory:n,options:t}),this)}if(!this||this.constructor!==bt)return new bt(t);let n=typeof self!="undefined"?self._factory:typeof window!="undefined"?window._factory:null;n&&(n=n.toString());let i=typeof window=="undefined",s=this,o=Xl(n,i,t.worker);return o.then?o.then(function(a){return r.call(s,a)}):r.call(this,o)}at("add");at("append");at("search");at("update");at("remove");at("clear");at("export");at("import");bt.prototype.searchCache=Ei;Ci(bt.prototype);function at(t){bt.prototype[t]=function(){let e=this,r=[].slice.call(arguments);var n=r[r.length-1];let i;return typeof n=="function"&&(i=n,r.pop()),n=new Promise(function(s){t==="export"&&typeof r[0]=="function"&&(r[0]=null),ot>1e9&&(ot=0),e.h[++ot]=s,e.worker.postMessage({task:t,id:ot,args:r})}),i?(n.then(i),this):n}}function Xl(t,e,r){return e?typeof module!="undefined"?new(wi()).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(()=>ns(wi(),1)).then(function(n){return new n.Worker(ko.dirname+"/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Kl.toString()],{type:"text/javascript"}))):new window.Worker(typeof r=="string"?r:ko.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}vt.prototype.add=function(t,e,r){if(_r(t)&&(e=t,t=br(e,this.key)),e&&(t||t===0)){if(!r&&this.reg.has(t))return this.update(t,e);for(let a=0,u;a<this.field.length;a++){u=this.B[a];var n=this.index.get(this.field[a]);if(typeof u=="function"){var i=u(e);i&&n.add(t,i,r,!0)}else i=u.G,(!i||i(e))&&(u.constructor===String?u=[""+u]:Pe(u)&&(u=[u]),Si(e,u,this.D,0,n,t,u[0],r))}if(this.tag)for(n=0;n<this.A.length;n++){var s=this.A[n];i=this.tag.get(this.F[n]);let a=le();if(typeof s=="function"){if(s=s(e),!s)continue}else{var o=s.G;if(o&&!o(e))continue;s.constructor===String&&(s=""+s),s=br(e,s)}if(i&&s){Pe(s)&&(s=[s]);for(let u=0,l,c;u<s.length;u++)if(l=s[u],!a[l]&&(a[l]=1,(o=i.get(l))?c=o:i.set(l,c=[]),!r||!c.includes(t))){if(c.length===rt(2,31)-1){if(o=new Wt(c),this.fastupdate)for(let f of this.reg.values())f.includes(c)&&(f[f.indexOf(c)]=o);i.set(l,c=o)}c.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(c):this.reg.set(t,[c]))}}}if(this.store&&(!r||!this.store.has(t))){let a;if(this.h){a=le();for(let u=0,l;u<this.h.length;u++){if(l=this.h[u],(r=l.G)&&!r(e))continue;let c;if(typeof l=="function"){if(c=l(e),!c)continue;l=[l.O]}else if(Pe(l)||l.constructor===String){a[l]=e[l];continue}vi(e,a,l,0,l[0],c)}}this.store.set(t,a||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this};function vi(t,e,r,n,i,s){if(t=t[i],n===r.length-1)e[i]=s||t;else if(t)if(t.constructor===Array)for(e=e[i]=Array(t.length),i=0;i<t.length;i++)vi(t,e,r,n,i);else e=e[i]||(e[i]=le()),i=r[++n],vi(t,e,r,n,i)}function Si(t,e,r,n,i,s,o,a){if(t=t[o])if(n===e.length-1){if(t.constructor===Array){if(r[n]){for(e=0;e<t.length;e++)i.add(s,t[e],!0,!0);return}t=t.join(" ")}i.add(s,t,a,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)Si(t,e,r,n,i,s,o,a);else o=e[++n],Si(t,e,r,n,i,s,o,a)}function Oi(t,e,r,n){if(!t.length)return t;if(t.length===1)return t=t[0],t=r||t.length>e?t.slice(r,r+e):t,n?zt.call(this,t):t;let i=[];for(let s=0,o,a;s<t.length;s++)if((o=t[s])&&(a=o.length)){if(r){if(r>=a){r-=a;continue}o=o.slice(r,r+e),a=o.length,r=0}if(a>e&&(o=o.slice(0,e),a=e),!i.length&&a>=e)return n?zt.call(this,o):o;if(i.push(o),e-=a,!e)break}return i=i.length>1?[].concat.apply([],i):i[0],n?zt.call(this,i):i}function ln(t,e,r,n){var i=n[0];if(i[0]&&i[0].query)return t[e].apply(t,i);if(!(e!=="and"&&e!=="not"||t.result.length||t.await||i.suggest))return n.length>1&&(i=n[n.length-1]),(n=i.resolve)?t.await||t.result:t;let s=[],o=0,a=0,u,l,c,f,m;for(e=0;e<n.length;e++)if(i=n[e]){var g=void 0;if(i.constructor===oe)g=i.await||i.result;else if(i.then||i.constructor===Array)g=i;else{o=i.limit||0,a=i.offset||0,c=i.suggest,l=i.resolve,u=((f=i.highlight||t.highlight)||i.enrich)&&l,g=i.queue;let h=i.async||g,d=i.index,y=i.query;if(d?t.index||(t.index=d):d=t.index,y||i.tag){let O=i.field||i.pluck;if(O&&(!y||t.query&&!f||(t.query=y,t.field=O,t.highlight=f),d=d.index.get(O)),g&&(m||t.await)){m=1;let R,C=t.C.length,L=new Promise(function(N){R=N});(function(N,S){L.h=function(){S.index=null,S.resolve=!1;let k=h?N.searchAsync(S):N.search(S);return k.then?k.then(function(D){return t.C[C]=D=D.result||D,R(D),D}):(k=k.result||k,R(k),k)}})(d,Object.assign({},i)),t.C.push(L),s[e]=L;continue}else i.resolve=!1,i.index=null,g=h?d.searchAsync(i):d.search(i),i.resolve=l,i.index=d}else if(i.and)g=Zr(i,"and",d);else if(i.or)g=Zr(i,"or",d);else if(i.not)g=Zr(i,"not",d);else if(i.xor)g=Zr(i,"xor",d);else continue}g.await?(m=1,g=g.await):g.then?(m=1,g=g.then(function(h){return h.result||h})):g=g.result||g,s[e]=g}if(m&&!t.await&&(t.await=new Promise(function(h){t.return=h})),m){let h=Promise.all(s).then(function(d){for(let y=0;y<t.C.length;y++)if(t.C[y]===h){t.C[y]=function(){return r.call(t,d,o,a,u,l,c,f)};break}ki(t)});t.C.push(h)}else if(t.await)t.C.push(function(){return r.call(t,s,o,a,u,l,c,f)});else return r.call(t,s,o,a,u,l,c,f);return l?t.await||t.result:t}function Zr(t,e,r){t=t[e];let n=t[0]||t;return n.index||(n.index=r),r=new oe(n),t.length>1&&(r=r[e].apply(r,t.slice(1))),r}oe.prototype.or=function(){return ln(this,"or",Gl,arguments)};function Gl(t,e,r,n,i,s,o){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=To(t,e,r,!1,this.h),r=0)),i&&(this.await=null),i?this.resolve(e,r,n,o):this}oe.prototype.and=function(){return ln(this,"and",Ql,arguments)};function Ql(t,e,r,n,i,s,o){if(!s&&!this.result.length)return i?this.result:this;let a;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let u=0;for(let l=0,c,f;l<t.length;l++)if((c=t[l])&&(f=c.length))u<f&&(u=f);else if(!s){u=0;break}u?(this.result=nn(t,u,e,r,s,this.h,i),a=!0):this.result=[]}else s||(this.result=t);return i&&(this.await=null),i?this.resolve(e,r,n,o,a):this}oe.prototype.xor=function(){return ln(this,"xor",Zl,arguments)};function Zl(t,e,r,n,i,s,o){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{e:{s=r;var a=this.h;let u=[],l=le(),c=0;for(let f=0,m;f<t.length;f++)if(m=t[f]){c<m.length&&(c=m.length);for(let g=0,h;g<m.length;g++)if(h=m[g])for(let d=0,y;d<h.length;d++)y=h[d],l[y]=l[y]?2:1}for(let f=0,m,g=0;f<c;f++)for(let h=0,d;h<t.length;h++)if((d=t[h])&&(m=d[f])){for(let y=0,O;y<m.length;y++)if(O=m[y],l[O]===1)if(s)s--;else if(i){if(u.push(O),u.length===e){t=u;break e}}else{let R=f+(h?a:0);if(u[R]||(u[R]=[]),u[R].push(O),++g===e){t=u;break e}}}t=u}this.result=t,a=!0}else s||(this.result=t);return i&&(this.await=null),i?this.resolve(e,r,n,o,a):this}oe.prototype.not=function(){return ln(this,"not",ec,arguments)};function ec(t,e,r,n,i,s,o){if(!s&&!this.result.length)return i?this.result:this;if(t.length&&this.result.length){e:{s=r;var a=[];t=new Set(t.flat().flat());for(let u=0,l,c=0;u<this.result.length;u++)if(l=this.result[u]){for(let f=0,m;f<l.length;f++)if(m=l[f],!t.has(m)){if(s)s--;else if(i){if(a.push(m),a.length===e){t=a;break e}}else if(a[u]||(a[u]=[]),a[u].push(m),++c===e){t=a;break e}}}t=a}this.result=t,a=!0}return i&&(this.await=null),i?this.resolve(e,r,n,o,a):this}function rn(t,e,r,n,i){let s,o,a;typeof i=="string"?(s=i,i=""):s=i.template,o=s.indexOf("$1"),a=s.substring(o+2),o=s.substring(0,o);let u=i&&i.boundary,l=!i||i.clip!==!1,c=i&&i.merge&&a&&o&&new RegExp(a+" "+o,"g");i=i&&i.ellipsis;var f=0;if(typeof i=="object"){var m=i.template;f=m.length-2,i=i.pattern}typeof i!="string"&&(i=i===!1?"":"..."),f&&(i=m.replace("$1",i)),m=i.length-f;let g,h;typeof u=="object"&&(g=u.before,g===0&&(g=-1),h=u.after,h===0&&(h=-1),u=u.total||9e5),f=new Map;for(let lt=0,be,Vt,ct;lt<e.length;lt++){let ft;if(n)ft=e,ct=n;else{var d=e[lt];if(ct=d.field,!ct)continue;ft=d.result}Vt=r.get(ct),be=Vt.encoder,d=f.get(be),typeof d!="string"&&(d=be.encode(t),f.set(be,d));for(let ve=0;ve<ft.length;ve++){var y=ft[ve].doc;if(!y||(y=br(y,ct),!y))continue;var O=y.trim().split(/\s+/);if(!O.length)continue;y="";var R=[];let ht=[];for(var C=-1,L=-1,N=0,S=0;S<O.length;S++){var k=O[S],D=be.encode(k);D=D.length>1?D.join(" "):D[0];let J;if(D&&k){for(var $=k.length,X=(be.split?k.replace(be.split,""):k).length-D.length,K="",V=0,Z=0;Z<d.length;Z++){var se=d[Z];if(se){var re=se.length;re+=X<0?0:X,V&&re<=V||(se=D.indexOf(se),se>-1&&(K=(se?k.substring(0,se):"")+o+k.substring(se,se+re)+a+(se+re<$?k.substring(se+re):""),V=re,J=!0))}}K&&(u&&(C<0&&(C=y.length+(y?1:0)),L=y.length+(y?1:0)+K.length,N+=$,ht.push(R.length),R.push({match:K})),y+=(y?" ":"")+K)}if(!J)k=O[S],y+=(y?" ":"")+k,u&&R.push({text:k});else if(u&&N>=u)break}if(N=ht.length*(s.length-2),g||h||u&&y.length-N>u)if(N=u+N-m*2,S=L-C,g>0&&(S+=g),h>0&&(S+=h),S<=N)O=g?C-(g>0?g:0):C-((N-S)/2|0),R=h?L+(h>0?h:0):O+N,l||(O>0&&y.charAt(O)!==" "&&y.charAt(O-1)!==" "&&(O=y.indexOf(" ",O),O<0&&(O=0)),R<y.length&&y.charAt(R-1)!==" "&&y.charAt(R)!==" "&&(R=y.lastIndexOf(" ",R),R<L?R=L:++R)),y=(O?i:"")+y.substring(O,R)+(R<y.length?i:"");else{for(L=[],C={},N={},S={},k={},D={},K=X=$=0,Z=V=1;;){var _e=void 0;for(let J=0,ae;J<ht.length;J++){if(ae=ht[J],K)if(X!==K){if(S[J+1])continue;if(ae+=K,C[ae]){$-=m,N[J+1]=1,S[J+1]=1;continue}if(ae>=R.length-1){if(ae>=R.length){S[J+1]=1,ae>=O.length&&(N[J+1]=1);continue}$-=m}if(y=R[ae].text,re=h&&D[J])if(re>0){if(y.length>re)if(S[J+1]=1,l)y=y.substring(0,re);else continue;(re-=y.length)||(re=-1),D[J]=re}else{S[J+1]=1;continue}if($+y.length+1<=u)y=" "+y,L[J]+=y;else if(l)_e=u-$-1,_e>0&&(y=" "+y.substring(0,_e),L[J]+=y),S[J+1]=1;else{S[J+1]=1;continue}}else{if(S[J])continue;if(ae-=X,C[ae]){$-=m,S[J]=1,N[J]=1;continue}if(ae<=0){if(ae<0){S[J]=1,N[J]=1;continue}$-=m}if(y=R[ae].text,re=g&&k[J])if(re>0){if(y.length>re)if(S[J]=1,l)y=y.substring(y.length-re);else continue;(re-=y.length)||(re=-1),k[J]=re}else{S[J]=1;continue}if($+y.length+1<=u)y+=" ",L[J]=y+L[J];else if(l)_e=y.length+1-(u-$),_e>=0&&_e<y.length&&(y=y.substring(_e)+" ",L[J]=y+L[J]),S[J]=1;else{S[J]=1;continue}}else{y=R[ae].match,g&&(k[J]=g),h&&(D[J]=h),J&&$++;let Jt;if(ae?!J&&m&&($+=m):(N[J]=1,S[J]=1),ae>=O.length-1||ae<R.length-1&&R[ae+1].match?Jt=1:m&&($+=m),$-=s.length-2,!J||$+y.length<=u)L[J]=y;else{_e=V=Z=N[J]=0;break}Jt&&(N[J+1]=1,S[J+1]=1)}$+=y.length,_e=C[ae]=1}if(_e)X===K?K++:X++;else{if(X===K?V=0:Z=0,!V&&!Z)break;V?(X++,K=X):K++}}y="";for(let J=0,ae;J<L.length;J++)ae=(N[J]?J?" ":"":(J&&!i?" ":"")+i)+L[J],y+=ae;i&&!N[L.length]&&(y+=i)}c&&(y=y.replace(c," ")),ft[ve].highlight=y}if(n)break}return e}function oe(t,e){if(!this||this.constructor!==oe)return new oe(t,e);let r=0,n,i,s,o,a,u;if(t&&t.index){let l=t;if(e=l.index,r=l.boost||0,i=l.query){s=l.field||l.pluck,o=l.highlight;let c=l.resolve;t=l.async||l.queue,l.resolve=!1,l.index=null,t=t?e.searchAsync(l):e.search(l),l.resolve=c,l.index=e,t=t.result||t}else t=[]}if(t&&t.then){let l=this;t=t.then(function(c){l.C[0]=l.result=c.result||c,ki(l)}),n=[t],t=[],a=new Promise(function(c){u=c})}this.index=e||null,this.result=t||[],this.h=r,this.C=n||[],this.await=a||null,this.return=u||null,this.highlight=o||null,this.query=i||"",this.field=s||""}H=oe.prototype;H.limit=function(t){if(this.await){let e=this;this.C.push(function(){return e.limit(t).result})}else if(this.result.length){let e=[];for(let r=0,n;r<this.result.length;r++)if(n=this.result[r])if(n.length<=t){if(e[r]=n,t-=n.length,!t)break}else{e[r]=n.slice(0,t);break}this.result=e}return this};H.offset=function(t){if(this.await){let e=this;this.C.push(function(){return e.offset(t).result})}else if(this.result.length){let e=[];for(let r=0,n;r<this.result.length;r++)(n=this.result[r])&&(n.length<=t?t-=n.length:(e[r]=n.slice(t),t=0));this.result=e}return this};H.boost=function(t){if(this.await){let e=this;this.C.push(function(){return e.boost(t).result})}else this.h+=t;return this};function ki(t,e){let r=t.result;var n=t.await;t.await=null;for(let i=0,s;i<t.C.length;i++)if(s=t.C[i]){if(typeof s=="function")r=s(),t.C[i]=r=r.result||r,i--;else if(s.h)r=s.h(),t.C[i]=r=r.result||r,i--;else if(s.then)return t.await=n}return n=t.return,t.C=[],t.return=null,e||n(r),r}H.resolve=function(t,e,r,n,i){let s=this.await?ki(this,!0):this.result;if(s.then){let o=this;return s.then(function(){return o.resolve(t,e,r,n,i)})}return s.length&&(typeof t=="object"?(n=t.highlight||this.highlight,r=!!n||t.enrich,e=t.offset,t=t.limit):(n=n||this.highlight,r=!!n||r),s=i?r?zt.call(this.index,s):s:Oi.call(this.index,s,t||100,e,r)),this.finalize(s,n)};H.finalize=function(t,e){if(t.then){let n=this;return t.then(function(i){return n.finalize(i,e)})}e&&t.length&&this.query&&(t=rn(this.query,t,this.index.index,this.field,e));let r=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",r&&r(t),t};function nn(t,e,r,n,i,s,o){let a=t.length,u=[],l,c;l=le();for(let f=0,m,g,h,d;f<e;f++)for(let y=0;y<a;y++)if(h=t[y],f<h.length&&(m=h[f]))for(let O=0;O<m.length;O++){if(g=m[O],(c=l[g])?l[g]++:(c=0,l[g]=1),d=u[c]||(u[c]=[]),!o){let R=f+(y||!i?0:s||0);d=d[R]||(d[R]=[])}if(d.push(g),o&&r&&c===a-1&&d.length-n===r)return n?d.slice(n):d}if(t=u.length)if(i)u=u.length>1?To(u,r,n,o,s):(u=u[0])&&r&&u.length>r||n?u.slice(n,r+n):u;else{if(t<a)return[];if(u=u[t-1],r||n)if(o)(u.length>r||n)&&(u=u.slice(n,r+n));else{i=[];for(let f=0,m;f<u.length;f++)if(m=u[f]){if(n&&m.length>n)n-=m.length;else if((r&&m.length>r||n)&&(m=m.slice(n,r+n),r-=m.length,n&&(n-=m.length)),i.push(m),!r)break}u=i}}return u}function To(t,e,r,n,i){let s=[],o=le(),a;var u=t.length;let l;if(n){for(i=u-1;i>=0;i--)if(l=(n=t[i])&&n.length){for(u=0;u<l;u++)if(a=n[u],!o[a]){if(o[a]=1,r)r--;else if(s.push(a),s.length===e)return s}}}else for(let c=u-1,f,m=0;c>=0;c--){f=t[c];for(let g=0;g<f.length;g++)if(l=(n=f[g])&&n.length){for(let h=0;h<l;h++)if(a=n[h],!o[a])if(o[a]=1,r)r--;else{let d=(g+(c<u-1&&i||0))/(c+1)|0;if((s[d]||(s[d]=[])).push(a),++m===e)return s}}}return s}function tc(t,e,r,n,i){let s=le(),o=[];for(let a=0,u;a<e.length;a++){u=e[a];for(let l=0;l<u.length;l++)s[u[l]]=1}if(i){for(let a=0,u;a<t.length;a++)if(u=t[a],s[u]){if(n)n--;else if(o.push(u),s[u]=0,r&&--r===0)break}}else for(let a=0,u,l;a<t.result.length;a++)for(u=t.result[a],e=0;e<u.length;e++)l=u[e],s[l]&&((o[a]||(o[a]=[])).push(l),s[l]=0);return o}le();vt.prototype.search=function(t,e,r,n){r||(!e&&_r(t)?(r=t,t=""):_r(e)&&(r=e,e=0));let i=[];var s=[];let o,a,u,l,c,f,m=0,g=!0,h;if(r){r.constructor===Array&&(r={index:r}),t=r.query||t,o=r.pluck,a=r.merge,l=r.boost,f=o||r.field||(f=r.index)&&(f.index?null:f);var d=this.tag&&r.tag;u=r.suggest,g=r.resolve!==!1,c=r.cache,h=g&&this.store&&r.highlight;var y=!!h||g&&this.store&&r.enrich;e=r.limit||e;var O=r.offset||0;if(e||(e=g?100:0),d&&(!this.db||!n)){d.constructor!==Array&&(d=[d]);var R=[];for(let k=0,D;k<d.length;k++)if(D=d[k],D.field&&D.tag){var C=D.tag;if(C.constructor===Array)for(var L=0;L<C.length;L++)R.push(D.field,C[L]);else R.push(D.field,C)}else{C=Object.keys(D);for(let $=0,X,K;$<C.length;$++)if(X=C[$],K=D[X],K.constructor===Array)for(L=0;L<K.length;L++)R.push(X,K[L]);else R.push(X,K)}if(d=R,!t){if(s=[],R.length)for(d=0;d<R.length;d+=2){if(this.db){if(n=this.index.get(R[d]),!n)continue;s.push(n=n.db.tag(R[d+1],e,O,y))}else n=rc.call(this,R[d],R[d+1],e,O,y);i.push(g?{field:R[d],tag:R[d+1],result:n}:[n])}if(s.length){let k=this;return Promise.all(s).then(function(D){for(let $=0;$<D.length;$++)g?i[$].result=D[$]:i[$]=D[$];return g?i:new oe(i.length>1?nn(i,1,0,0,u,l):i[0],k)})}return g?i:new oe(i.length>1?nn(i,1,0,0,u,l):i[0],this)}}g||o||!(f=f||this.field)||(Pe(f)?o=f:(f.constructor===Array&&f.length===1&&(f=f[0]),o=f.field||f.index)),f&&f.constructor!==Array&&(f=[f])}f||(f=this.field);let N;R=(this.worker||this.db)&&!n&&[];for(let k=0,D,$,X;k<f.length;k++){if($=f[k],this.db&&this.tag&&!this.B[k])continue;let K;if(Pe($)||(K=$,$=K.field,t=K.query||t,e=Bt(K.limit,e),O=Bt(K.offset,O),u=Bt(K.suggest,u),h=g&&this.store&&Bt(K.highlight,h),y=!!h||g&&this.store&&Bt(K.enrich,y),c=Bt(K.cache,c)),n)D=n[k];else{C=K||r||{},L=C.enrich;var S=this.index.get($);if(d&&(this.db&&(C.tag=d,C.field=f,N=S.db.support_tag_search),!N&&L&&(C.enrich=!1),N||(C.limit=0,C.offset=0)),D=c?S.searchCache(t,d&&!N?0:e,C):S.search(t,d&&!N?0:e,C),d&&!N&&(C.limit=e,C.offset=O),L&&(C.enrich=L),R){R[k]=D;continue}}if(X=(D=D.result||D)&&D.length,d&&X){if(C=[],L=0,this.db&&n){if(!N)for(S=f.length;S<n.length;S++){let V=n[S];if(V&&V.length)L++,C.push(V);else if(!u)return g?i:new oe(i,this)}}else for(let V=0,Z,se;V<d.length;V+=2){if(Z=this.tag.get(d[V]),!Z){if(u)continue;return g?i:new oe(i,this)}if(se=(Z=Z&&Z.get(d[V+1]))&&Z.length)L++,C.push(Z);else if(!u)return g?i:new oe(i,this)}if(L){if(D=tc(D,C,e,O,g),X=D.length,!X&&!u)return g?D:new oe(D,this);L--}}if(X)s[m]=$,i.push(D),m++;else if(f.length===1)return g?i:new oe(i,this)}if(R){if(this.db&&d&&d.length&&!N)for(y=0;y<d.length;y+=2){if(s=this.index.get(d[y]),!s){if(u)continue;return g?i:new oe(i,this)}R.push(s.db.tag(d[y+1],e,O,!1))}let k=this;return Promise.all(R).then(function(D){return r&&(r.resolve=g),D.length&&(D=k.search(t,e,r,D)),D})}if(!m)return g?i:new oe(i,this);if(o&&(!y||!this.store))return i=i[0],g?i:new oe(i,this);for(R=[],O=0;O<s.length;O++){if(d=i[O],y&&d.length&&typeof d[0].doc=="undefined"&&(this.db?R.push(d=this.index.get(this.field[0]).db.enrich(d)):d=zt.call(this,d)),o)return g?h?rn(t,d,this.index,o,h):d:new oe(d,this);i[O]={field:s[O],result:d}}if(y&&this.db&&R.length){let k=this;return Promise.all(R).then(function(D){for(let $=0;$<D.length;$++)i[$].result=D[$];return h&&(i=rn(t,i,k.index,o,h)),a?xo(i):i})}return h&&(i=rn(t,i,this.index,o,h)),a?xo(i):i};function xo(t){let e=[],r=le(),n=le();for(let i=0,s,o,a,u,l,c,f;i<t.length;i++){s=t[i],o=s.field,a=s.result;for(let m=0;m<a.length;m++)l=a[m],typeof l!="object"?l={id:u=l}:u=l.id,(c=r[u])?c.push(o):(l.field=r[u]=[o],e.push(l)),(f=l.highlight)&&(c=n[u],c||(n[u]=c={},l.highlight=c),c[o]=f)}return e}function rc(t,e,r,n,i){return t=this.tag.get(t),t?(t=t.get(e),t?(e=t.length-n,e>0&&((r&&e>r||n)&&(t=t.slice(n,n+r)),i&&(t=zt.call(this,t))),t):[]):[]}function zt(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);let e=Array(t.length);for(let r=0,n;r<t.length;r++)n=t[r],e[r]={id:n,doc:this.store.get(n)};return e}function vt(t){if(!this||this.constructor!==vt)return new vt(t);let e=t.document||t.doc||t,r,n;if(this.B=[],this.field=[],this.D=[],this.key=(r=e.key||e.id)&&sn(r,this.D)||"id",(n=t.keystore||0)&&(this.keystore=n),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?n?new Me(n):new Set:n?new De(n):new Map,this.h=(r=e.store||null)&&r&&r!==!0&&[],this.store=r?n?new De(n):new Map:null,this.cache=(r=t.cache||null)&&new St(r),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=nc.call(this,t,e),this.tag=null,(r=e.tag)&&(typeof r=="string"&&(r=[r]),r.length)){this.tag=new Map,this.A=[],this.F=[];for(let i=0,s,o;i<r.length;i++){if(s=r[i],o=s.field||s,!o)throw Error("The tag field from the document descriptor is undefined.");s.custom?this.A[i]=s.custom:(this.A[i]=sn(o,this.D),s.filter&&(typeof this.A[i]=="string"&&(this.A[i]=new String(this.A[i])),this.A[i].G=s.filter)),this.F[i]=o,this.tag.set(o,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(let i of this.index.values())i.then&&t.push(i);if(t.length){let i=this;return Promise.all(t).then(function(s){let o=0;for(let a of i.index.entries()){let u=a[0],l=a[1];l.then&&(l=s[o],i.index.set(u,l),o++)}return i})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}H=vt.prototype;H.mount=function(t){let e=this.field;if(this.tag)for(let s=0,o;s<this.F.length;s++){o=this.F[s];var r=void 0;this.index.set(o,r=new Ne({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(o),r.tag=this.tag.get(o)}r=[];let n={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let s=0,o,a;s<e.length;s++){n.field=a=e[s],o=this.index.get(a);let u=new t.constructor(t.id,n);u.id=t.id,r[s]=u.mount(o),o.document=!0,s?o.bypass=!0:o.store=this.store}let i=this;return this.db=Promise.all(r).then(function(){i.db=!0})};H.commit=function(){return E(this,null,function*(){let t=[];for(let e of this.index.values())t.push(e.commit());yield Promise.all(t),this.reg.clear()})};H.destroy=function(){let t=[];for(let e of this.index.values())t.push(e.destroy());return Promise.all(t)};function nc(t,e){let r=new Map,n=e.index||e.field||e;Pe(n)&&(n=[n]);for(let s=0,o,a;s<n.length;s++){if(o=n[s],Pe(o)||(a=o,o=o.field),a=_r(a)?Object.assign({},t,a):t,this.worker){var i=void 0;i=(i=a.encoder)&&i.encode?i:new $t(typeof i=="string"?Ai[i]:i||{}),i=new bt(a,i),r.set(o,i)}this.worker||r.set(o,new Ne(a,this.reg)),a.custom?this.B[s]=a.custom:(this.B[s]=sn(o,this.D),a.filter&&(typeof this.B[s]=="string"&&(this.B[s]=new String(this.B[s])),this.B[s].G=a.filter)),this.field[s]=o}if(this.h){t=e.store,Pe(t)&&(t=[t]);for(let s=0,o,a;s<t.length;s++)o=t[s],a=o.field||o,o.custom?(this.h[s]=o.custom,o.custom.O=a):(this.h[s]=sn(a,this.D),o.filter&&(typeof this.h[s]=="string"&&(this.h[s]=new String(this.h[s])),this.h[s].G=o.filter))}return r}function sn(t,e){let r=t.split(":"),n=0;for(let i=0;i<r.length;i++)t=r[i],t[t.length-1]==="]"&&(t=t.substring(0,t.length-2))&&(e[n]=!0),t&&(r[n++]=t);return n<r.length&&(r.length=n),n>1?r:r[0]}H.append=function(t,e){return this.add(t,e,!0)};H.update=function(t,e){return this.remove(t).add(t,e)};H.remove=function(t){_r(t)&&(t=br(t,this.key));for(var e of this.index.values())e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let r of this.tag.values())for(let n of r){e=n[0];let i=n[1],s=i.indexOf(t);s>-1&&(i.length>1?i.splice(s,1):r.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this};H.clear=function(){let t=[];for(let e of this.index.values()){let r=e.clear();r.then&&t.push(r)}if(this.tag)for(let e of this.tag.values())e.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this};H.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)};H.cleanup=function(){for(let t of this.index.values())t.cleanup();return this};H.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(e){return e[0]&&e[0].doc||null}):this.store.get(t)||null};H.set=function(t,e){return typeof t=="object"&&(e=t,t=br(e,this.key)),this.store.set(t,e),this};H.searchCache=Ei;H.export=ic;H.import=sc;Ci(vt.prototype);function Ri(t,e=0){let r=[],n=[];e&&(e=25e4/e*5e3|0);for(let i of t.entries())n.push(i),n.length===e&&(r.push(n),n=[]);return n.length&&r.push(n),r}function Ii(t,e){e||(e=new Map);for(let r=0,n;r<t.length;r++)n=t[r],e.set(n[0],n[1]);return e}function Po(t,e=0){let r=[],n=[];e&&(e=25e4/e*1e3|0);for(let i of t.entries())n.push([i[0],Ri(i[1])[0]||[]]),n.length===e&&(r.push(n),n=[]);return n.length&&r.push(n),r}function Do(t,e){e||(e=new Map);for(let r=0,n,i;r<t.length;r++)n=t[r],i=e.get(n[0]),e.set(n[0],Ii(n[1],i));return e}function Mo(t){let e=[],r=[];for(let n of t.keys())r.push(n),r.length===25e4&&(e.push(r),r=[]);return r.length&&e.push(r),e}function No(t,e){e||(e=new Set);for(let r=0;r<t.length;r++)e.add(t[r]);return e}function on(t,e,r,n,i,s,o=0){let a=n&&n.constructor===Array;var u=a?n.shift():n;if(!u)return this.export(t,e,i,s+1);if((u=t((e?e+".":"")+(o+1)+"."+r,JSON.stringify(u)))&&u.then){let l=this;return u.then(function(){return on.call(l,t,e,r,a?n:null,i,s,o+1)})}return on.call(this,t,e,r,a?n:null,i,s,o+1)}function ic(t,e,r=0,n=0){if(r<this.field.length){let o=this.field[r];if((e=this.index.get(o).export(t,o,r,n=1))&&e.then){let a=this;return e.then(function(){return a.export(t,o,r+1)})}return this.export(t,o,r+1)}let i,s;switch(n){case 0:i="reg",s=Mo(this.reg),e=null;break;case 1:i="tag",s=this.tag&&Po(this.tag,this.reg.size),e=null;break;case 2:i="doc",s=this.store&&Ri(this.store),e=null;break;default:return}return on.call(this,t,e,i,s||null,r,n)}function sc(t,e){var r=t.split(".");r[r.length-1]==="json"&&r.pop();let n=r.length>2?r[0]:"";if(r=r.length>2?r[2]:r[1],this.worker&&n)return this.index.get(n).import(t);if(e){if(typeof e=="string"&&(e=JSON.parse(e)),n)return this.index.get(n).import(r,e);switch(r){case"reg":this.fastupdate=!1,this.reg=No(e,this.reg);for(let i=0,s;i<this.field.length;i++)s=this.index.get(this.field[i]),s.fastupdate=!1,s.reg=this.reg;if(this.worker){e=[];for(let i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=Do(e,this.tag);break;case"doc":this.store=Ii(e,this.store)}}}function Eo(t,e){let r="";for(let n of t.entries()){t=n[0];let i=n[1],s="";for(let o=0,a;o<i.length;o++){a=i[o]||[""];let u="";for(let l=0;l<a.length;l++)u+=(u?",":"")+(e==="string"?'"'+a[l]+'"':a[l]);u="["+u+"]",s+=(s?",":"")+u}s='["'+t+'",['+s+"]]",r+=(r?",":"")+s}return r}Ne.prototype.remove=function(t,e){let r=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(r){if(this.fastupdate){for(let n=0,i,s;n<r.length;n++)if((i=r[n])&&(s=i.length))if(i[s-1]===t)i.pop();else{let o=i.indexOf(t);o>=0&&i.splice(o,1)}}else vr(this.map,t),this.depth&&vr(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&Lo(this)),this.cache&&this.cache.remove(t),this};function vr(t,e){let r=0;var n=typeof e=="undefined";if(t.constructor===Array){for(let i=0,s,o,a;i<t.length;i++)if((s=t[i])&&s.length){if(n)return 1;if(o=s.indexOf(e),o>=0){if(s.length>1)return s.splice(o,1),1;if(delete t[i],r)return 1;a=1}else{if(a)return 1;r++}}}else for(let i of t.entries())n=i[0],vr(i[1],e)?r++:t.delete(n);return r}var oc={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};Ne.prototype.add=function(t,e,r,n){if(e&&(t||t===0)){if(!n&&!r&&this.reg.has(t))return this.update(t,e);n=this.depth,e=this.encoder.encode(e,!n);let l=e.length;if(l){let c=le(),f=le(),m=this.resolution;for(let g=0;g<l;g++){let h=e[this.rtl?l-1-g:g];var i=h.length;if(i&&(n||!f[h])){var s=this.score?this.score(e,h,g,null,0):en(m,l,g),o="";switch(this.tokenize){case"tolerant":if(Ve(this,f,h,s,t,r),i>2){for(let d=1,y,O,R,C;d<i-1;d++)y=h.charAt(d),O=h.charAt(d+1),R=h.substring(0,d)+O,C=h.substring(d+2),o=R+y+C,Ve(this,f,o,s,t,r),o=R+C,Ve(this,f,o,s,t,r);Ve(this,f,h.substring(0,h.length-1),s,t,r)}break;case"full":if(i>2){for(let d=0,y;d<i;d++)for(s=i;s>d;s--){o=h.substring(d,s),y=this.rtl?i-1-d:d;var a=this.score?this.score(e,h,g,o,y):en(m,l,g,i,y);Ve(this,f,o,a,t,r)}break}case"bidirectional":case"reverse":if(i>1){for(a=i-1;a>0;a--){o=h[this.rtl?i-1-a:a]+o;var u=this.score?this.score(e,h,g,o,a):en(m,l,g,i,a);Ve(this,f,o,u,t,r)}o=""}case"forward":if(i>1){for(a=0;a<i;a++)o+=h[this.rtl?i-1-a:a],Ve(this,f,o,s,t,r);break}default:if(Ve(this,f,h,s,t,r),n&&l>1&&g<l-1)for(i=this.N,o=h,s=Math.min(n+1,this.rtl?g+1:l-g),a=1;a<s;a++){h=e[this.rtl?l-1-g-a:g+a],u=this.bidirectional&&h>o;let d=this.score?this.score(e,o,g,h,a-1):en(i+(l/2>i?0:1),l,g,s-1,a-1);Ve(this,c,u?o:h,d,t,r,u?h:o)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(r?{ins:t}:{del:t}),this.M&&Lo(this)),this};function Ve(t,e,r,n,i,s,o){let a,u;if(!(a=e[r])||o&&!a[o]){if(o?(e=a||(e[r]=le()),e[o]=1,u=t.ctx,(a=u.get(o))?u=a:u.set(o,u=t.keystore?new De(t.keystore):new Map)):(u=t.map,e[r]=1),(a=u.get(r))?u=a:u.set(r,u=a=[]),s){for(let l=0,c;l<a.length;l++)if((c=a[l])&&c.includes(i)){if(l<=n)return;c.splice(c.indexOf(i),1),t.fastupdate&&(e=t.reg.get(i))&&e.splice(e.indexOf(c),1);break}}if(u=u[n]||(u[n]=[]),u.push(i),u.length===rt(2,31)-1){if(e=new Wt(u),t.fastupdate)for(let l of t.reg.values())l.includes(u)&&(l[l.indexOf(u)]=e);a[n]=u=e}t.fastupdate&&((n=t.reg.get(i))?n.push(u):t.reg.set(i,[u]))}}function en(t,e,r,n,i){return r&&t>1?e+(n||0)<=t?r+(i||0):(t-1)/(e+(n||0))*(r+(i||0))+1|0:0}Ne.prototype.search=function(t,e,r){if(r||(e||typeof t!="object"?typeof e=="object"&&(r=e,e=0):(r=t,t="")),r&&r.cache)return r.cache=!1,t=this.searchCache(t,e,r),r.cache=!0,t;let n=[],i,s,o,a=0,u,l,c,f,m;r&&(t=r.query||t,e=r.limit||e,a=r.offset||0,s=r.context,o=r.suggest,m=(u=r.resolve)&&r.enrich,c=r.boost,f=r.resolution,l=this.db&&r.tag),typeof u=="undefined"&&(u=this.resolve),s=this.depth&&s!==!1;let g=this.encoder.encode(t,!s);if(i=g.length,e=e||(u?100:0),i===1)return Co.call(this,g[0],"",e,a,u,m,l);if(i===2&&s&&!o)return Co.call(this,g[1],g[0],e,a,u,m,l);let h=le(),d=0,y;if(s&&(y=g[0],d=1),f||f===0||(f=y?this.N:this.resolution),this.db){if(this.db.search&&(r=this.db.search(this,g,e,a,o,u,m,l),r!==!1))return r;let O=this;return(function(){return E(this,null,function*(){for(let R,C;d<i;d++){if((C=g[d])&&!h[C]){if(h[C]=1,R=yield xi(O,C,y,0,0,!1,!1),R=Oo(R,n,o,f)){n=R;break}y&&(o&&R&&n.length||(y=C))}o&&y&&d===i-1&&!n.length&&(f=O.resolution,y="",d=-1,h=le())}return Ao(n,f,e,a,o,c,u)})})()}for(let O,R;d<i;d++){if((R=g[d])&&!h[R]){if(h[R]=1,O=xi(this,R,y,0,0,!1,!1),O=Oo(O,n,o,f)){n=O;break}y&&(o&&O&&n.length||(y=R))}o&&y&&d===i-1&&!n.length&&(f=this.resolution,y="",d=-1,h=le())}return Ao(n,f,e,a,o,c,u)};function Ao(t,e,r,n,i,s,o){let a=t.length,u=t;if(a>1)u=nn(t,e,r,n,i,s,o);else if(a===1)return o?Oi.call(null,t[0],r,n):new oe(t[0],this);return o?u:new oe(u,this)}function Co(t,e,r,n,i,s,o){return t=xi(this,t,e,r,n,i,s,o),this.db?t.then(function(a){return i?a||[]:new oe(a,this)}):t&&t.length?i?Oi.call(this,t,r,n):new oe(t,this):i?[]:new oe([],this)}function Oo(t,e,r,n){let i=[];if(t&&t.length){if(t.length<=n){e.push(t);return}for(let s=0,o;s<n;s++)(o=t[s])&&(i[s]=o);if(i.length){e.push(i);return}}if(!r)return i}function xi(t,e,r,n,i,s,o,a){let u;return r&&(u=t.bidirectional&&e>r)&&(u=r,r=e,e=u),t.db?t.db.get(e,r,n,i,s,o,a):(t=r?(t=t.ctx.get(r))&&t.get(e):t.map.get(e),t)}function Ne(t,e){if(!this||this.constructor!==Ne)return new Ne(t);if(t){var r=Pe(t)?t:t.preset;r&&(t=Object.assign({},oc[r],t))}else t={};r=t.context;let n=r===!0?{depth:1}:r||{},i=Pe(t.encoder)?Ai[t.encoder]:t.encode||t.encoder||{};this.encoder=i.encode?i:typeof i=="object"?new $t(i):{encode:i},this.resolution=t.resolution||9,this.tokenize=r=(r=t.tokenize)&&r!=="default"&&r!=="exact"&&r||"strict",this.depth=r==="strict"&&n.depth||0,this.bidirectional=n.bidirectional!==!1,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(r=t.keystore||0)&&(this.keystore=r),this.map=r?new De(r):new Map,this.ctx=r?new De(r):new Map,this.reg=e||(this.fastupdate?r?new De(r):new Map:r?new Me(r):new Set),this.N=n.resolution||3,this.rtl=i.rtl||t.rtl||!1,this.cache=(r=t.cache||null)&&new St(r),this.resolve=t.resolve!==!1,(r=t.db)&&(this.db=this.mount(r)),this.M=t.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}H=Ne.prototype;H.mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)};H.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)};H.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function Lo(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}H.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this};H.append=function(t,e){return this.add(t,e,!0)};H.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)};H.update=function(t,e){let r=this,n=this.remove(t);return n&&n.then?n.then(()=>r.add(t,e)):this.add(t,e)};H.cleanup=function(){return this.fastupdate?(vr(this.map),this.depth&&vr(this.ctx),this):this};H.searchCache=Ei;H.export=function(t,e,r=0,n=0){let i,s;switch(n){case 0:i="reg",s=Mo(this.reg);break;case 1:i="cfg",s=null;break;case 2:i="map",s=Ri(this.map,this.reg.size);break;case 3:i="ctx",s=Po(this.ctx,this.reg.size);break;default:return}return on.call(this,t,e,i,s,r,n)};H.import=function(t,e){if(e)switch(typeof e=="string"&&(e=JSON.parse(e)),t=t.split("."),t[t.length-1]==="json"&&t.pop(),t.length===3&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=No(e,this.reg);break;case"map":this.map=Ii(e,this.map);break;case"ctx":this.ctx=Do(e,this.ctx)}};H.serialize=function(t=!0){let e="",r="",n="";if(this.reg.size){let s;for(var i of this.reg.keys())s||(s=typeof i),e+=(e?",":"")+(s==="string"?'"'+i+'"':i);e="index.reg=new Set(["+e+"]);",r=Eo(this.map,s),r="index.map=new Map(["+r+"]);";for(let o of this.ctx.entries()){i=o[0];let a=Eo(o[1],s);a="new Map(["+a+"])",a='["'+i+'",'+a+"]",n+=(n?",":"")+a}n="index.ctx=new Map(["+n+"]);"}return t?"function inject(index){"+e+r+n+"}":e+r+n};Ci(Ne.prototype);var Fo=typeof window!="undefined"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),an=["map","ctx","tag","reg","cfg"],yt=le();function un(t,e={}){if(!this||this.constructor!==un)return new un(t,e);typeof t=="object"&&(e=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=e.field?e.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=e.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}H=un.prototype;H.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())};H.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),yt[t.id]||(yt[t.id]=[]),yt[t.id].push(t.field);let e=Fo.open(t.id,1);return e.onupgradeneeded=function(){let r=t.db=this.result;for(let n=0,i;n<an.length;n++){i=an[n];for(let s=0,o;s<yt[t.id].length;s++)o=yt[t.id][s],r.objectStoreNames.contains(i+(i!=="reg"&&o?":"+o:""))||r.createObjectStore(i+(i!=="reg"&&o?":"+o:""))}},t.db=ut(e,function(r){t.db=r,t.db.onversionchange=function(){t.close()}})};H.close=function(){this.db&&this.db.close(),this.db=null};H.destroy=function(){let t=Fo.deleteDatabase(this.id);return ut(t)};H.clear=function(){let t=[];for(let r=0,n;r<an.length;r++){n=an[r];for(let i=0,s;i<yt[this.id].length;i++)s=yt[this.id][i],t.push(n+(n!=="reg"&&s?":"+s:""))}let e=this.db.transaction(t,"readwrite");for(let r=0;r<t.length;r++)e.objectStore(t[r]).clear();return ut(e)};H.get=function(t,e,r=0,n=0,i=!0,s=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);let o=this;return ut(t).then(function(a){let u=[];if(!a||!a.length)return u;if(i){if(!r&&!n&&a.length===1)return a[0];for(let l=0,c;l<a.length;l++)if((c=a[l])&&c.length){if(n>=c.length){n-=c.length;continue}let f=r?n+Math.min(c.length-n,r):c.length;for(let m=n;m<f;m++)u.push(c[m]);if(n=0,u.length===r)break}return s?o.enrich(u):u}return a})};H.tag=function(t,e=0,r=0,n=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);let i=this;return ut(t).then(function(s){return!s||!s.length||r>=s.length?[]:!e&&!r?s:(s=s.slice(r,r+e),n?i.enrich(s):s)})};H.enrich=function(t){typeof t!="object"&&(t=[t]);let e=this.db.transaction("reg","readonly").objectStore("reg"),r=[];for(let n=0;n<t.length;n++)r[n]=ut(e.get(t[n]));return Promise.all(r).then(function(n){for(let i=0;i<n.length;i++)n[i]={id:t[i],doc:n[i]?JSON.parse(n[i]):null};return n})};H.has=function(t){return t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t),ut(t).then(function(e){return!!e})};H.search=null;H.info=function(){};H.transaction=function(t,e,r){t+=t!=="reg"&&this.field?":"+this.field:"";let n=this.h[t+":"+e];if(n)return r.call(this,n);let i=this.db.transaction(t,e);this.h[t+":"+e]=n=i.objectStore(t);let s=r.call(this,n);return this.h[t+":"+e]=null,ut(i).finally(function(){return s})};H.commit=function(t){return E(this,null,function*(){let e=t.commit_task,r=[];t.commit_task=[];for(let n=0,i;n<e.length;n++)i=e[n],i.del&&r.push(i.del);r.length&&(yield this.remove(r)),t.reg.size&&(yield this.transaction("map","readwrite",function(n){for(let i of t.map){let s=i[0],o=i[1];o.length&&(n.get(s).onsuccess=function(){let a=this.result;var u;if(a&&a.length){let l=Math.max(a.length,o.length);for(let c=0,f,m;c<l;c++)if((m=o[c])&&m.length){if((f=a[c])&&f.length)for(u=0;u<m.length;u++)f.push(m[u]);else a[c]=m;u=1}}else a=o,u=1;u&&n.put(a,s)})}}),yield this.transaction("ctx","readwrite",function(n){for(let i of t.ctx){let s=i[0],o=i[1];for(let a of o){let u=a[0],l=a[1];l.length&&(n.get(s+":"+u).onsuccess=function(){let c=this.result;var f;if(c&&c.length){let m=Math.max(c.length,l.length);for(let g=0,h,d;g<m;g++)if((d=l[g])&&d.length){if((h=c[g])&&h.length)for(f=0;f<d.length;f++)h.push(d[f]);else c[g]=d;f=1}}else c=l,f=1;f&&n.put(c,s+":"+u)})}}}),t.store?yield this.transaction("reg","readwrite",function(n){for(let i of t.store){let s=i[0],o=i[1];n.put(typeof o=="object"?JSON.stringify(o):1,s)}}):t.bypass||(yield this.transaction("reg","readwrite",function(n){for(let i of t.reg.keys())n.put(1,i)})),t.tag&&(yield this.transaction("tag","readwrite",function(n){for(let i of t.tag){let s=i[0],o=i[1];o.length&&(n.get(s).onsuccess=function(){let a=this.result;a=a&&a.length?a.concat(o):o,n.put(a,s)})}})),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())})};function _i(t,e,r){let n=t.value,i,s=0;for(let o=0,a;o<n.length;o++){if(a=r?n:n[o]){for(let u=0,l,c;u<e.length;u++)if(c=e[u],l=a.indexOf(c),l>=0)if(i=1,a.length>1)a.splice(l,1);else{n[o]=[];break}s+=a.length}if(r)break}s?i&&t.update(n):t.delete(),t.continue()}H.remove=function(t){return typeof t!="object"&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(e){e.openCursor().onsuccess=function(){let r=this.result;r&&_i(r,t)}}),this.transaction("ctx","readwrite",function(e){e.openCursor().onsuccess=function(){let r=this.result;r&&_i(r,t)}}),this.transaction("tag","readwrite",function(e){e.openCursor().onsuccess=function(){let r=this.result;r&&_i(r,t,!0)}}),this.transaction("reg","readwrite",function(e){for(let r=0;r<t.length;r++)e.delete(t[r])})])};function ut(t,e){return new Promise((r,n)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,r(this.result)},t.onerror=t.onblocked=n,t=null})}var cn={Index:Ne,Charset:Ai,Encoder:$t,Document:vt,Worker:bt,Resolver:oe,IndexedDB:un,Language:{}};function fn(t){return t.replace(/\\u[\dA-F]{4}/gi,function(e){return String.fromCharCode(parseInt(e.replace(/\\u/g,""),16))})}var xt={},Je=class extends G{_prepare(){xt[this.uri]={index:{},conceptCache:{},schemeCache:{}}}get _index(){return xt[this.uri]&&xt[this.uri].index}get _conceptCache(){return xt[this.uri]&&xt[this.uri].conceptCache}get _schemeCache(){return xt[this.uri]&&xt[this.uri].schemeCache}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r?null:{schemes:[{uri:e,identifier:P.getAllUris(r).filter(i=>i!==e)}]}}_loadScheme(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);let s=P.getAllUris(e);for(let h of s)if(this._schemeCache[h])return this._schemeCache[h];let o=this.schemes.find(h=>P.compare(h,e));if(!o||!o.uri)throw new Le({message:`Tried to load unsupported scheme (${e&&e.uri})`});let a=o.uri;s=[...new Set(s.concat(P.getAllUris(o)))];let u=".json";a.endsWith("/")&&(u="index.json");let l=yield this.axios(F(I({},r),{url:`${a}${u}`,_skipAdditionalParameters:!0}));if(l.id!==a)throw new Le({message:"Skohub URL did not return expected concept scheme"});let{title:c,preferredNamespaceUri:f,hasTopConcept:m,description:g}=l;e={uri:a,identifier:s.filter(h=>h!==a)},e.prefLabel=c,Object.keys(e.prefLabel||{}).forEach(h=>{e.prefLabel[h]=fn(e.prefLabel[h])}),e.namespace=f,e.topConcepts=(m||[]).map(h=>this._toJskosConcept(h)),e.concepts=[null],g&&(e.definition=g,Object.keys(e.definition).forEach(h=>{e.definition[h]=[fn(e.definition[h])]}));for(let h of Object.keys(e).filter(d=>!e[d]))delete e[h];for(let h of s)this._schemeCache[h]=e;return e})}_loadConcept(n){return E(this,null,function*(){var i=n,{uri:e}=i,r=W(i,["uri"]);if(this._conceptCache[e])return this._conceptCache[e];try{let s=yield this.axios(F(I({},r),{url:`${e}.json`,_skipAdditionalParameters:!0}));if(s.id!==e)throw new Le({message:"Skohub URL did not return expected concept URI"});let o=this._toJskosConcept(s);return this._conceptCache[e]=o,o}catch(s){return null}})}_toJskosConcept(e){let r={uri:e.id};return r.prefLabel=e.prefLabel,Object.keys(r.prefLabel||{}).forEach(n=>{r.prefLabel[n]=fn(r.prefLabel[n])}),r.narrower=(e.narrower||[]).map(n=>this._toJskosConcept(n)),r.notation=e.notation||[],e.broader&&e.broader.id&&(r.broader=[{uri:e.broader.id}]),e.inScheme&&e.inScheme.id&&(r.inScheme=[{uri:e.inScheme.id}]),e.scopeNote&&(r.scopeNote=e.scopeNote,Object.keys(r.scopeNote).forEach(n=>{r.scopeNote[n]=[fn(r.scopeNote[n])]})),r}getSchemes(){return E(this,arguments,function*(r={}){var e=W(r,[]);return Promise.all(this.schemes.map(n=>this._loadScheme(F(I({},e),{scheme:n}))))})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!e||!e.uri)throw new U({parameter:"scheme",message:"Missing scheme URI"});return e=yield this._loadScheme(I({scheme:e},r)),e.topConcepts||[]})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);return Array.isArray(e)||(e=[e]),(yield Promise.all(e.map(({uri:s})=>this._loadConcept(F(I({},r),{uri:s}))))).filter(Boolean)})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});if(e.ancestors&&e.ancestors[0]!==null)return e.ancestors;if(e=yield this._loadConcept(F(I({},r),{uri:e.uri})),!e||!e.broader||!e.broader.length)return[];let s=e.broader[0];return[s].concat(yield this.getAncestors(I({concept:s},r))).map(o=>({uri:o.uri}))})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});return e.narrower&&e.narrower[0]!==null||(e=yield this._loadConcept(F(I({},r),{uri:e.uri}))),e.narrower})}search(i){return E(this,arguments,function*({search:e,scheme:r,limit:n=100}){if(r=yield this._loadScheme({scheme:r}),!r||!r.uri)throw new U({parameter:"scheme"});if(!e)throw new U({parameter:"search"});let s;this._index[r.uri]||(this._index[r.uri]={});for(let u of[""].concat(this.languages)){if(this._index[r.uri][u]){s=this._index[r.uri][u];break}if(this._index[r.uri][u]!==null)try{let l=u?`.${u}.index`:".index";r.uri.endsWith("/")&&(l=`index${l}`);let c=yield this.axios({url:`${r.uri}${l}`,_skipAdditionalParameters:!0});if(c.length<100){this._index[r.uri][u]=null;continue}s=cn.create(),s.import(c),this._index[r.uri][u]=s;break}catch(l){this._index[r.uri][u]=null}}if(!s)throw new Le({message:"Could not find search index for any of the available languages "+this.languages.join(",")});let o=s.search(e);return(yield this.getConcepts({concepts:o.map(u=>({uri:u}))})).slice(0,n)})}suggest(e){return E(this,null,function*(){e._raw=!0;let r=yield this.search(e),n=[e.search,[],[],[]];for(let i of r){let s=P.notation(i),o=P.prefLabel(i);n[1].push((s?s+" ":"")+o),n[2].push(""),n[3].push(i.uri)}return r._totalCount!=null?n._totalCount=r._totalCount:n._totalCount=r.length,n})}};ee(Je,"supports",{schemes:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,suggest:!0,search:!0});Je.providerName="Skohub";Je.providerType="http://bartoc.org/api-type/skohub";var Bo="https://lobid.org/gnd/",Ke={uri:"http://bartoc.org/en/node/430",concepts:[null],topConcepts:[],type:["http://www.w3.org/2004/02/skos/core#ConceptScheme"],DISPLAY:{hideNotation:!0},identifier:["http://www.wikidata.org/entity/Q36578"],license:[{uri:"http://creativecommons.org/publicdomain/zero/1.0/"}],namespace:"https://d-nb.info/gnd/",notation:["GND"],notationPattern:"[0-9X-]+",prefLabel:{de:"Gemeinsame Normdatei",en:"Integrated Authority File"},types:[{uri:"https://d-nb.info/standards/elementset/gnd#DifferentiatedPerson",prefLabel:{de:"Person",en:"Person"}},{uri:"https://d-nb.info/standards/elementset/gnd#PlaceOrGeographicName",prefLabel:{de:"Geografikum",en:"Place"}},{uri:"https://d-nb.info/standards/elementset/gnd#CorporateBody",prefLabel:{de:"Organisation",en:"Organization"}},{uri:"https://d-nb.info/standards/elementset/gnd#SubjectHeading",prefLabel:{de:"Sachbegriff",en:"Subject"}},{uri:"https://d-nb.info/standards/elementset/gnd#Work",prefLabel:{de:"Werk",en:"Work"}},{uri:"https://d-nb.info/standards/elementset/gnd#ConferenceOrEvent",prefLabel:{de:"Konferenz oder Veranstaltung",en:"ConferenceOrEvent"}}]},Di=new P.ConceptScheme({uri:"https://d-nb.info/standards/elementset/gnd",namespace:"https://d-nb.info/standards/elementset/gnd#"});Ke.types.forEach(t=>{t.notation=[Di.notationFromUri(t.uri)]});var ac=new P.ConceptScheme(Ke),Uo=["broaderTerm","broaderTermGeneral","broaderTermGeneric","broaderTermInstantial","broaderTermPartitive"],jo={sameAs:"http://www.w3.org/2004/02/skos/core#exactMatch",exactMatch:"http://www.w3.org/2004/02/skos/core#exactMatch",closeMatch:"http://www.w3.org/2004/02/skos/core#closeMatch",relatedDdcWithDegreeOfDeterminacy1:"http://www.w3.org/2004/02/skos/core#narrowMatch",relatedDdcWithDegreeOfDeterminacy2:"http://www.w3.org/2004/02/skos/core#narrowMatch",relatedDdcWithDegreeOfDeterminacy3:"http://www.w3.org/2004/02/skos/core#closeMatch",relatedDdcWithDegreeOfDeterminacy4:"http://www.w3.org/2004/02/skos/core#exactMatch"},uc=[{uri:"http://bartoc.org/en/node/241",uriPattern:"http://dewey.info/class/(.+)/"},{uri:"http://bartoc.org/en/node/18",namespace:"https://data.bnf.fr/ark:/12148/"},{uri:"http://bartoc.org/en/node/20450",namespace:"https://datos.bne.es/resource/"},{uri:"http://bartoc.org/en/node/1940",namespace:"http://www.wikidata.org/entity/"},{uri:"http://bartoc.org/en/node/294",namespace:"http://lod.gesis.org/thesoz/"},{uri:"http://bartoc.org/en/node/20425",namespace:"http://uri.gbv.de/terminology/tpro/"},{uri:"http://bartoc.org/en/node/2053",namespace:"http://viaf.org/viaf/"},{uri:"http://bartoc.org/en/node/305",uriPattern:"http?://aims.fao.org/aos/agrovoc/(.+)"},{uri:"http://bartoc.org/en/node/391",uriPattern:"http?://id.nlm.nih.gov/mesh/(.+)"},{uri:"http://bartoc.org/en/node/313",uriPattern:"http?://zbw.eu/stw/descriptor/(.+)"},{uri:"http://bartoc.org/en/node/443",uriPattern:"https?://purl.org/bncf/tid/(.+)"},{uri:"http://bartoc.org/en/node/454",uriPattern:"http?://id.loc.gov/authorities/subjects/(.+)"},{uri:"http://bartoc.org/en/node/18536",uriPattern:"http?://id.loc.gov/authorities/names/(.+)"}].map(t=>new P.ConceptScheme(t));function Ti(t){var n,i;let e={uri:t.id,notation:[t.gndIdentifier],prefLabel:{de:t.preferredName},inScheme:[{uri:Ke.uri}]};t.variantName&&(e.altLabel={de:t.variantName}),(n=t.usingInstructions)!=null&&n.length&&(e.scopeNote={de:t.usingInstructions}),e.type=t.type.map(s=>Di.uriFromNotation(s)).filter(Boolean),e.broader=[],Uo.forEach(s=>{e.broader=e.broader.concat(t[s]||[])}),e.broader=e.broader.map(s=>({uri:s.id})),e.uri&&(e.identifier=[e.uri.replace("https://","http://")]);let r=[];for(let s of Object.keys(jo)){let o=jo[s];(i=t[s])!=null&&i.length&&(r=r.concat(t[s].map(a=>{let u=uc.find(c=>c.notationFromUri(a.id)),l=u==null?void 0:u.conceptFromUri(a.id);return!u||!l?null:(u.uri==="http://bartoc.org/en/node/241"&&(l.uri+="e23/"),{from:{memberSet:[{uri:e.uri,notation:e.notation}]},fromScheme:{uri:Ke.uri},to:{memberSet:[l]},toScheme:{uri:u.uri},type:[o]})}).filter(Boolean)))}return r.length&&(e.mappings=r),e}function Pi(t){return t&&t.startsWith("http://")?t.replace("http://","https://"):t}var Ye=class extends G{_setup(){this._api.api||(this._api.api=Bo)}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r||!P.compare(r,Ke)||e!=="https://lobid.org/gnd/api"?null:{api:Bo,schemes:[Ke]}}getSchemes(){return E(this,null,function*(){return[Ke]})}getTop(){return E(this,null,function*(){return[]})}getConcepts(r){return E(this,arguments,function*({concepts:e}){if(!e)throw new i.InvalidOrMissingParameterError({parameter:"concepts"});Array.isArray(e)||(e=[e]);let n=e.map(o=>{var a,u;return(a=o==null?void 0:o.notation)!=null&&a[0]?(u=o==null?void 0:o.notation)==null?void 0:u[0]:ac.notationFromUri(Pi(o==null?void 0:o.uri))}).filter(Boolean),i=[],s=yield Promise.all(n.map(o=>E(this,null,function*(){try{let a=yield pe.get(`${this._api.api}${o}.json`);return Ti(a.data)}catch(a){i.push(a)}})));if(i.length===e.length)throw i[0];return s.filter(Boolean)})}getNarrower(i){return E(this,arguments,function*({concept:e,limit:r=200,offset:n=0}){if(!e||!e.uri)throw new U({parameter:"concept"});let s=Pi(e.uri),o=Uo.map(u=>`${u}.id:"${s}"`).join(" OR ");return(yield pe.get(`${this._api.api}search`,{params:{q:o,format:"json",size:r,from:n}})).data.member.map(u=>Ti(u))})}suggest(e){return E(this,null,function*(){let r=yield this._search(F(I({},e),{format:"json:suggest"}));return[e.search,r.map(n=>n.label),[],r.map(n=>n.id)]})}search(e){return E(this,null,function*(){return(yield this._search(e)).member.map(n=>Ti(n))})}_search(o){return E(this,arguments,function*({search:e,types:r,limit:n=100,offset:i=0,format:s="json"}){if(!e)throw new U({parameter:"search"});let a="";return r=(r==null?void 0:r.map(l=>Di.notationFromUri(Pi(l))).filter(Boolean))||[],r.length&&(a=r.map(l=>`type:${l}`).join(" OR ")),(yield pe.get(`${this._api.api}search`,{params:{q:e,filter:a,format:s,size:n,from:i}})).data})}getTypes(r){return E(this,arguments,function*({scheme:e}){if(!e||!P.compare(e,Ke))throw new U({parameter:"search",message:e!=null&&e.uri?`scheme ${e==null?void 0:e.uri} not supported`:""});return Ke.types})}};ee(Ye,"supports",{schemes:!0,data:!0,concepts:!0,narrower:!0,suggest:!0,search:!0,types:!0});Ye.providerName="LobidApi";Ye.providerType="http://bartoc.org/api-type/lobid-gnd";var Xe=class extends G{_getApiUrl(e,r){let n=this.uri||"";n.endsWith("/")&&(n=n.slice(0,-1));for(let i of e)if(i)n+="/"+i;else return;if(r){let i=Object.keys(r).map(s=>`${s}=${encodeURIComponent(r[s])}`).join("&");n+=(n.includes("?")?"&":"?")+i}return n}_artefactToJSKOS(e){let r=e.language||this._language||"en",n={};return e.subject&&(n.subject=[e.subject]),e.includedInDataCatalog&&(n.api=[e.includedInDataCatalog]),e["@type"]&&(n["@type"]=e["@type"]),e.type&&(n.type=[e.type]),e.source_name&&(n.notation=[e.source_name]),e.short_form&&(n.notation?n.notation.push(e.short_form):n.notation=[e.short_form]),e.label&&(n.prefLabel={},n.prefLabel[r]=[],n.prefLabel[r].push(e.label)),e.synonyms&&(n.altLabel={},n.altLabel[r]=e.synonyms),e.descriptions&&(n.definition={},n.definition[r]=e.descriptions),e.language&&(n.languages=e.language),e["@id"]&&(n.uri=e["@id"]),e.iri&&(n.iri=e.iri),e.identifier&&(n.identifier=[e.identifier]),e.source&&(n.source=[e.source]),e.source_url&&(n.namespace=e.source_url),e.landingPage&&(n.url=e.landingPage),e.version&&(n.version=e.version),e.modified&&(n.modified=e.modified),e.created&&(n.created=e.created),e.hasFormat&&(n.format=e.hasFormat),e.license&&(n.license=[e.license]),e.creator&&(n.creator=e.creator),e.contributor&&(n.contributor={},n.contributor.prefLabel={},n.contributor.prefLabel[r]=e.contributor),e.publisher&&(n.publisher={},n.publisher[r]=e.publisher),e.released&&(n.issued=e.released),e.children&&(n.narrower={},n.narrower[r]=e.children),n}_request(e,...r){return E(this,null,function*(){if(!e)return;let n=yield this.axios(I({method:"get",url:e,headers:{"Content-Type":"application/json",Accept:"application/json"}},r));if(!(n!=null&&n._url)||Object.keys(n).length!=1)return n})}_getSchemesMod(){return E(this,null,function*(){let e=this._getApiUrl(["artefacts"],null);return yield this._request(e)})}_getSchemesModLimit(e){return E(this,null,function*(){let r=yield this._getSchemesMod();return e&&e>0?r.slice(0,e):r})}_getSchemeMod(e){return E(this,null,function*(){if(e.short)return yield this._getSchemeFromShort(e.short);if(e.uri)return yield this._getSchemeFromUri(e.uri)})}_getSchemeFromShort(e){return E(this,null,function*(){let r=this._getApiUrl(["artefacts",e],null);return yield this._request(r)})}_getSchemeFromUri(e){return E(this,null,function*(){let r=yield this._getSchemesMod();if(r){for(let n of yield r)if(n.source==e||n.source_url==e||n.source_name==e||n["@id"]==e||n.iri==e||n.includedInDataCatalog&&n.includedInDataCatalog.includes(e))return yield n}})}_getConceptsMod(e){return E(this,null,function*(){let r=yield this._schemeShortFromObj(e);if(!r)return[];let n=this._getApiUrl(["artefacts",r,"resources","concepts"],null),i=yield this._request(n);if(!i)return[];let{page:s,totalPages:o,member:a}=i,u=[];for(let l of a)l&&u.push(l);for(let l=s+1;l<=o;l++){let c=this._getApiUrl(["artefacts",r,"resources","concepts"],{page:l}),f=yield this._request(c);if(!f)break;let{member:m}=f;for(let g of m)g&&u.push(g)}return u})}_getConceptsModLimit(e,r){return E(this,null,function*(){let n=yield this._getConceptsMod(e);return r&&r>0?n.slice(0,r):n})}_getConceptMod(e){return E(this,null,function*(){let{conceptNotation:r,schemeShort:n}=yield this._conceptNotationFromObj(e),i=this._getApiUrl(["artefacts",n,"resources","concepts",r],null);return yield this._request(i)})}_containsString(e,r){for(let n in e){let i=e[n];if(typeof i=="string"&&i.includes(r)||typeof i=="object"&&i!==null&&this.containsString(i,r))return!0}return!1}_getSchemesContaining(e){return E(this,null,function*(){let r=[],n=yield this._getSchemesMod();for(let i of n)this.containsString(i,e)&&r.push(i);return r})}_getSchemeShort(e){return E(this,null,function*(){let r=yield this._getSchemeFromUri(e);if(r)return yield r.short_form.toLowerCase()})}_getconceptNotation(e){return e.split("/").pop()}_schemeShortFromObj(e){return E(this,null,function*(){if(e.short)return e.short;if(e.uri)return yield this._getSchemeShort(e.uri)})}_conceptNotationFromObj(e){return E(this,null,function*(){if(!e.inScheme||!e.inScheme[0])return;let r=yield this._schemeShortFromObj(e.inScheme[0]),n=e.notation;return n||(n=yield this._getconceptNotation(e.uri)),{conceptNotation:n,schemeShort:r}})}_prepare(){}_setup(){}getSchemes(i){return E(this,null,function*(){var s=i,{schemes:e,limit:r}=s,n=W(s,["schemes","limit"]);let o=[],a=[];if(e)for(let u of e){let l=yield this._getSchemeMod(u);l&&a.push(l)}else a=yield this._getSchemesModLimit(r);for(let u of a){let l=yield this._artefactToJSKOS(u);l?o.push(l):console.warn("JSKOS transformation failed for artefact: ",u)}return o})}getConcepts(s){return E(this,null,function*(){var o=s,{concepts:e,scheme:r,limit:n}=o,i=W(o,["concepts","scheme","limit"]);let a=[];if(e)for(let u of e){let l=yield this._getConceptMod(u);if(l){let c=yield this._artefactToJSKOS(l);c?a.push(c):console.warn("JSKOS transformation failed for concept: ",l)}}else if(r){let u=yield this._getConceptsModLimit(r,n);for(let l of u){let c=yield this._artefactToJSKOS(l);c?a.push(c):console.warn("JSKOS transformation failed for concept: ",l)}}return a})}get _language(){return this._jskos.language||this.languages[0]||this._defaultLanguages[0]||"en"}getMappings(){return[]}};ee(Xe,"providerName","ModApi"),ee(Xe,"providerType","http://bartoc.org/en/node/20333"),ee(Xe,"supports",{schemes:!0,top:!1,data:!1,concepts:!0,narrower:!1,ancestors:!1,types:!1,suggest:!1,search:!1,auth:!1,mappings:!1,concordances:!1,annotations:!1,occurrences:!1});var Ge=class extends G{constructor(e){super(e),this.endpoint=e.endpoint||e.uri}static _registryConfigForBartocApiConfig({url:e}={}){if(e)return{endpoint:e}}_getApiUrl(e,r={}){let n=this.endpoint+e.join("/");return r=Object.fromEntries(Object.entries(r).filter(([i,s])=>s!=null)),r=new URLSearchParams(r),r.size?`${n}?${r}`:n}_ontologyToJSKOS(e){var i;let r=e.lang||this._language||"en",n={};return e.iri&&(n.uri=e.iri),n.type=["http://www.w3.org/2004/02/skos/core#ConceptScheme"],e["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]&&(n.type=n.type.concat(e["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"])),e.title&&(n.prefLabel={},n.prefLabel[r]=e.title),e.description&&(n.definition={},n.definition[r]=[e.description]),e.homepage&&(n.url=e.homepage),e.tracker&&(n.issueTracker=[{url:e.tracker}]),e.language&&(n.languages=e.language),e.ontologyId&&(n.VOCID=e.ontologyId,n.notation=[e.ontologyId]),(i=e.license)!=null&&i.url&&(n.license=[{uri:e.license.url}]),n}_termToJSKOS(e){let r=e.language||this._language||"en",n={};return e.curie&&(n.notation=[e.curie]),e.hasDirectChildren?n.narrower=[null]:n.narrower=[],e.hasDirectParents?n.broader=[null]:n.broader=[],e.iri&&(n.uri=e.iri),e["http://www.w3.org/2000/01/rdf-schema#label"]&&(n.prefLabel={},n.prefLabel[r]=e["http://www.w3.org/2000/01/rdf-schema#label"].value||e["http://www.w3.org/2000/01/rdf-schema#label"]),n.type=["http://www.w3.org/2004/02/skos/core#Concept","http://www.w3.org/2002/07/owl#Class"],e.ontologyIri&&(n.inScheme=[{uri:e.ontologyIri}]),n}_request(n){return E(this,arguments,function*(e,r={_skipAdditionalParameters:!0}){if(e){e=new URL(e);let i=Object.fromEntries(e.searchParams.entries());return this.axios(I({method:"get",url:e.origin+e.pathname,params:I(I({},i),r.params)},r))}})}_paginate(e,r,n){return E(this,null,function*(){let i=n>0?n:null,s=this._getApiUrl(e,F(I({},r),{size:i})),o=yield this._request(s),a=(o==null?void 0:o.elements)||[];if(!i){let u=(o==null?void 0:o.totalPages)||0;for(let l=1;l<u;l++)s=this._getApiUrl(e,F(I({},r),{page:l})),o=yield this._request(s),a=a.concat((o==null?void 0:o.elements)||[])}return a})}_getConceptOls(e){return E(this,null,function*(){var n,i;let r=yield this._getSchemeVOCID((n=e==null?void 0:e.inScheme)==null?void 0:n[0]);if(r){let s=null;e.notation?s=this._getApiUrl(["ontologies",r,"classes"],{curie:e.notation}):e.uri&&(s=this._getApiUrl(["ontologies",r,"classes"],{iri:e.uri}));let o=yield this._request(s);return((i=o==null?void 0:o.elements)==null?void 0:i[0])||null}})}_searchOls(e,r,n,i){return E(this,null,function*(){let s=[],o={"http://www.w3.org/2002/07/owl#Class":"classes","http://www.w3.org/1999/02/22-rdf-syntax-ns#Property":"properties"};i!=null&&i.length||(i=Object.keys(o));for(let a of i)if(a in o){let u=r?yield this._getSchemeVOCID(r):null,l={search:e,ontology:u};if(!r||u){let c=yield this._paginate([o[a]],l,n);s.push(...c)}}return s})}_conceptIriFromObj(e,r){return E(this,null,function*(){let n=this._getApiUrl(["ontologies",e,"classes"],{curie:r}),i=yield this._request(n);if(i&&i.elements&&i.elements.length>0)return i.elements[0].iri})}get _language(){return this._jskos.language||this.languages[0]||this._defaultLanguages[0]||"en"}_getSchemeVOCID(e){return E(this,null,function*(){return e!=null&&e.VOCID?e.VOCID:this._getScheme(e).then(r=>r==null?void 0:r.ontologyId)})}_getScheme(e){return E(this,null,function*(){if(e){let{VOCID:r,uri:n,notation:i,identifier:s}=e;if(r)return this._request(this._getApiUrl(["ontologies",r]));if(n&&(e=yield this._getSchemeFromUri(n),e)||i!=null&&i[0]&&(n||s!=null&&s.length)&&(e=yield this._request(this._getApiUrl(["ontologies",i[0]])),e.iri===n||s!=null&&s.includes(e.iri)))return e;for(let o of s||[]){let a=yield this._getSchemeFromUri(o);if(a)return a}}})}_getSchemeFromUri(e){return E(this,null,function*(){if(e){let r=this._getApiUrl(["ontologies"],{searchFields:"iri",search:e}),n=yield this._request(r),i=(n==null?void 0:n.elements)||[];return i.reduce((s,o)=>o.ontologyId.length<s.ontologyId.length?o:s,i[0])}return null})}getSchemes(n){return E(this,arguments,function*({schemes:e,limit:r}){let i=[];if(e)i=(yield Promise.all(e.map(s=>this._getScheme(s)))).filter(Boolean);else if(r>0){let s=this._getApiUrl(["ontologies"],{size:r});i=(yield this._request(s)).elements||[]}else i=yield this._paginate(["ontologies"],{});return Promise.all(i.map(s=>this._ontologyToJSKOS(s)))})}getConcepts(i){return E(this,arguments,function*({concepts:e,scheme:r,limit:n}){let s=[];if(e)for(let o of e){let a=yield this._getConceptOls(o);a&&s.push(yield this._termToJSKOS(a))}else if(r){let o=yield this._getSchemeVOCID(r);if(o){let a=yield this._paginate(["ontologies",o,"classes"],{},n);s=Promise.all(a.map(u=>this._termToJSKOS(u)))}}return s})}getTop(r){return E(this,arguments,function*({scheme:e}){let n=yield this._getSchemeVOCID(e);if(n){let i=yield this._paginate(["ontologies",n,"classes"],{hasDirectParents:"false"},null);return Promise.all(i.map(s=>this._termToJSKOS(s)))}return[]})}_splitConcept(e){return E(this,null,function*(){var n;let r={};return e&&(r.VOCID=yield this._getSchemeVOCID((n=e==null?void 0:e.inScheme)==null?void 0:n[0]),r.iri=e.uri||(yield this._conceptIriFromObj(r.VOCID,e.notation)),r.iri=encodeURIComponent(encodeURIComponent(r.iri))),r})}getNarrower(r){return E(this,arguments,function*({concept:e}){let{VOCID:n,iri:i}=yield this._splitConcept(e);if(n&&i){let s=yield this._paginate(["ontologies",n,"classes",i,"children"],{},0);return Promise.all(s.map(o=>this._termToJSKOS(o)))}return[]})}getAncestors(r){return E(this,arguments,function*({concept:e}){let{VOCID:n,iri:i}=yield this._splitConcept(e);if(n&&i){let s=yield this._paginate(["ontologies",n,"classes",i,"ancestors"],{},null);return Promise.all(s.map(o=>this._termToJSKOS(o)))}return[]})}getTypes(){return E(this,null,function*(){return[{uri:"http://www.w3.org/2002/07/owl#Class",prefLabel:{en:"Class",de:"Klasse"}},{uri:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",prefLabel:{en:"Property",de:"Eigenschaft"}}]})}search(s){return E(this,arguments,function*({search:e,scheme:r=null,limit:n=0,types:i=["http://www.w3.org/2002/07/owl#Class"]}){let o=yield this._searchOls(e,r,n,i);return Promise.all(o.map(a=>this._termToJSKOS(a)))})}};ee(Ge,"providerName","OlsApi"),ee(Ge,"providerType","http://bartoc.org/api-type/ols"),ee(Ge,"supports",{schemes:!0,top:!0,data:!1,concepts:!0,narrower:!0,ancestors:!0,types:!0,suggest:!0,search:!0});var Se={},Qe=class extends G{_setup(){this._scheme=null}static _registryConfigForBartocApiConfig({url:e,scheme:r}={}){return!e||!r?null:{api:e}}_schemeInfoToJSKOS(e){let r=e.labels.find(s=>s.lang==="x-uri").text,n={};e.labels.filter(s=>!s.lang.startsWith("x-")).forEach(s=>{n[s.lang]=s.text});let i={uri:r,prefLabel:n};return e.categories&&e.categories.length&&(i.topConcepts=[null]),e.category&&e.category.length&&(i.concepts=[null]),i}_categoryToJSKOS(e,{scheme:r,broader:n=[]}){if(!e||!r)return null;let i=e.ID,s=`${r.uri}/${i}`;if(Se[r.uri].concepts[s])return Se[r.uri].concepts[s];let o={};e.labels.filter(u=>!u.lang.startsWith("x-")&&u.text).forEach(u=>{o[u.lang]=u.text.replace(`${i} `,""),Se[r.uri].searchIndex.add(s,o[u.lang])});let a={};return e.labels.filter(u=>!u.lang.startsWith("x-")&&u.description).forEach(u=>{a[u.lang]||(a[u.lang]=[]),a[u.lang].push(u.description)}),Se[r.uri].concepts[s]={uri:s,notation:[i],prefLabel:o,scopeNote:a,inScheme:[{uri:r.uri}],narrower:(e.categories||[]).map(u=>({uri:`${r.uri}/${u.ID}`})),broader:n},Se[r.uri].concepts[s]}_removeNarrower(e){return e&&Object.assign({},e,{narrower:e.narrower&&e.narrower.length?[null]:[]})}_loadSchemeData(e){return E(this,null,function*(){let r=yield this.axios(F(I({},e),{method:"get",url:this._api.api,_skipAdditionalParameters:!0}));this._scheme=this._schemeInfoToJSKOS(r);let n=this._scheme.uri;Se[n]={schemeInfo:r,searchIndex:cn.create({tokenize:"full"}),concepts:{}};let i=(s,{broader:o=[]}={})=>{let a=this._categoryToJSKOS(s,{scheme:this._scheme,broader:o});(s.categories||[]).forEach(u=>i(u,{broader:[{uri:a.uri}]}))};r.categories.forEach(s=>i(s)),Se[n].topConcepts=r.categories.map(s=>this._categoryToJSKOS(s,{scheme:this._scheme}))})}getSchemes(){return E(this,arguments,function*(e={}){if(!this._api.api)throw new xe;return this._scheme||(this._loadSchemeDataPromise||(this._loadSchemeDataPromise=this._loadSchemeData(e)),yield this._loadSchemeDataPromise),[this._scheme]})}getTop(n){return E(this,null,function*(){var i=n,{scheme:e}=i,r=W(i,["scheme"]);if(!e||!e.uri)throw new U({parameter:"scheme",message:"Missing scheme URI"});if(this._scheme||(yield this.getSchemes(r)),!P.compare(e,this._scheme))throw new U({parameter:"scheme",message:"Requested vocabulary seems to be unsupported by this API."});return Se[this._scheme.uri].topConcepts.map(this._removeNarrower)})}getConcepts(n){return E(this,null,function*(){var i=n,{concepts:e}=i,r=W(i,["concepts"]);return Array.isArray(e)||(e=[e]),this._scheme||(yield this.getSchemes(r)),e.map(s=>Se[this._scheme.uri].concepts[s.uri]).map(this._removeNarrower)})}getAncestors(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});if(e.ancestors&&e.ancestors[0]!==null)return e.ancestors;this._scheme||(yield this.getSchemes(r)),e=Se[this._scheme.uri].concepts[e.uri];let s=e&&e.broader&&e.broader[0];return s?[s].concat(yield this.getAncestors(I({concept:s},r))):[]})}getNarrower(n){return E(this,null,function*(){var i=n,{concept:e}=i,r=W(i,["concept"]);if(!e||!e.uri)throw new U({parameter:"concept"});return e.narrower&&e.narrower[0]!==null?e.narrower:(this._scheme||(yield this.getSchemes(r)),e=Se[this._scheme.uri].concepts[e.uri],(e&&e.narrower||[]).map(s=>Se[this._scheme.uri].concepts[s.uri]).map(this._removeNarrower))})}search(i){return E(this,arguments,function*({search:e,scheme:r,limit:n=100}){if(!r||!r.uri)throw new U({parameter:"scheme"});if(!e)throw new U({parameter:"search"});if(!r||!r.uri)throw new U({parameter:"scheme",message:"Missing scheme URI"});if(this._scheme||(yield this.getSchemes()),!P.compare(r,this._scheme))throw new U({parameter:"scheme",message:"Requested vocabulary seems to be unsupported by this API."});return(yield Se[this._scheme.uri].searchIndex.search(e)).map(o=>Se[this._scheme.uri].concepts[o]).map(this._removeNarrower).slice(0,n)})}suggest(e){return E(this,null,function*(){e._raw=!0;let r=yield this.search(e),n=[e.search,[],[],[]];for(let i of r){let s=P.notation(i),o=P.prefLabel(i);n[1].push((s?s+" ":"")+o),n[2].push(""),n[3].push(i.uri)}return r._totalCount!=null?n._totalCount=r._totalCount:n._totalCount=r.length,n})}};ee(Qe,"supports",{schemes:!0,top:!0,data:!0,concepts:!0,narrower:!0,ancestors:!0,suggest:!0,search:!0});Qe.providerName="MyCoRe";Qe.providerType="http://bartoc.org/api-type/mycore";var Sr={schemes:[]},Ze=class extends G{static _registryConfigForBartocApiConfig({url:e}={}){return e?{api:e}:null}getSchemes(){return E(this,null,function*(){var e,r;if(!Sr.schemes.length){let n=yield pe.post(this._api.api,{query:"query sources { sources { name uri description alternateName } }",operationName:"sources"}),i=((r=(e=n==null?void 0:n.data)==null?void 0:e.data)==null?void 0:r.sources)||[];if(i.length)Sr.schemes=i.map(s=>{let o={uri:s.uri,prefLabel:{und:s.name}};return s.desciption&&(o.description={und:[s.description]}),s.alternateName&&(o.notation=[s.alternateName]),o});else return[]}return Sr.schemes})}getConcepts(r){return E(this,arguments,function*({concepts:e}){var i,s;if(!e)throw new U({parameter:"concepts"});return Array.isArray(e)||(e=[e]),(((s=(i=(yield pe.post(this._api.api,{query:`query { lookup( uris: [${e.map(o=>`"${o.uri}"`)}], ) { uri source { ... on Source { uri } } result { ... on Term { uri prefLabel scopeNote altLabel broader { uri } narrower { uri } } } } }`})).data)==null?void 0:i.data)==null?void 0:s.lookup)||[]).map(o=>{var u,l,c,f,m,g,h,d,y,O;let a={uri:o.uri,inScheme:[Sr.schemes.find(R=>P.compare(R,{uri:o.source.uri}))]};return(l=(u=o.result)==null?void 0:u.prefLabel)!=null&&l[0]&&(a.prefLabel={und:o.result.prefLabel[0]}),(f=(c=o.result)==null?void 0:c.altLabel)!=null&&f[0]&&(a.altLabel={und:o.result.altLabel}),(g=(m=o.result)==null?void 0:m.scopeNote)!=null&&g[0]&&(a.scopeNote={und:o.result.scopeNote}),(d=(h=o.result)==null?void 0:h.broader)!=null&&d.length&&(a.broader=o.result.broader),(O=(y=o.result)==null?void 0:y.narrower)!=null&&O.length&&(a.narrower=o.result.narrower),a})})}suggest(e){return E(this,null,function*(){let r=e.search,n=yield this.search(e);return[r,n.map(i=>P.prefLabel(i,{fallbackToUri:!1})),[],n.map(i=>i.uri)]})}search(n){return E(this,arguments,function*({scheme:e,search:r}){var s,o,a,u,l;if(!r)throw new U({parameter:"search"});if(!e||!P.isContainedIn(e,Sr.schemes))throw new U({parameter:"scheme"});return(((l=(u=(a=(o=(s=(yield pe.post(this._api.api,{query:`query { terms( sources: ["${e.uri}"] query: "${r}" ) { source { uri } result { ... on Terms { terms { uri prefLabel scopeNote } } } }}`})).data)==null?void 0:s.data)==null?void 0:o.terms)==null?void 0:a[0])==null?void 0:u.result)==null?void 0:l.terms)||[]).map(c=>{var m,g,h;let f={uri:c.uri,inScheme:[e]};return(m=c.prefLabel)!=null&&m[0]&&(f.prefLabel={und:c.prefLabel[0]}),(g=c.altLabel)!=null&&g[0]&&(f.altLabel={und:c.altLabel}),(h=c.scopeNote)!=null&&h[0]&&(f.scopeNote={und:c.scopeNote[0]}),f})})}};ee(Ze,"supports",{schemes:!0,top:!1,data:!0,concepts:!0,narrower:!1,ancestors:!1,suggest:!0,search:!0});Ze.providerName="NoTApi";Ze.providerType="http://bartoc.org/api-type/noterms";var Ce={[G.providerName]:G,init(t){let e=t.provider;if(t.api&&Object.keys(this).find(r=>{if(Ce[r].prototype instanceof G&&t.api===Ce[r].providerType)return t=I({},t),delete t.api,e=r,!0}),this[e])return new this[e](t);throw new Ct},addProvider(t){if(t.prototype instanceof G||t===G)this[t.providerName]=t;else throw new Ct}};Ce.addProvider(Te);Ce.addProvider(Ie);Object.values(Ht).forEach(t=>{Ce.addProvider(t)});var Mi={},qt=class t{constructor(e){this.config=e,this.axios=pe.create()}setConfig(e){this.config=e}get config(){return this._config}set config(e){e=e||{},e.registries=e.registries||[],e.registries=e.registries.map(r=>Ce.init(r)).filter(r=>r),e.registries.forEach(r=>{r.cdk=this}),this._config=e}get providers(){return Ce}createInstance(e){return new t(e)}loadConfig(e){return E(this,null,function*(){let r=yield this.axios.get(e);this.config=r.data})}loadBuildInfo(o){var a=o,{url:e,buildInfo:r=null,interval:n=6e4,callback:i}=a,s=W(a,["url","buildInfo","interval","callback"]);if(!e&&!this.config.cocodaBaseUrl)throw new me({message:"Could not determine URL to load build config."});return e||(e=`${this.config.cocodaBaseUrl}build-info.json`),this.repeat(F(I({},s),{function:()=>E(this,null,function*(){return(yield this.axios.get(e,{headers:{"Cache-Control":"no-cache"}})).data}),interval:n,callback:(u,l,c)=>{u?i(u):(c||!c&&r&&!Re(l,r))&&i(null,l,c||r)}}))}getRegistryForUri(e){return this.config.registries.find(r=>r.uri==e)}initializeRegistry(e){return e=Ce.init(e),e.cdk=this,e}addProvider(e){Ce.addProvider(e)}static addProvider(e){Ce.addProvider(e)}repeat({function:e,interval:r=15e3,callback:n,callImmediately:i=!0}={}){if(!e)throw new U({parameter:"function"});if(typeof e!="function")throw new U({parameter:"function",message:"function needs to be a function"});let s=()=>E(null,null,function*(){return e()});if(r=parseInt(r),isNaN(r))throw new U({parameter:"interval"});if(!n)throw new U({parameter:"callback"});if(typeof n!="function")throw new U({parameter:"callback",message:"callback needs to be a function"});let o={timer:null,result:null,error:null,isPaused:!1,interval:r},a=m=>{let g=o.result;Re(g,m)||(o.result=m,o.error=null,n(null,m,g))},u=m=>{o.error=m,n(m)},l=m=>{o.isPaused||(o.timer=setTimeout(()=>{m()},o.interval))},c=()=>s().then(a).catch(u).then(()=>l(c)),f=(m=i)=>{m?c():l(c)};return f(),{start:(...m)=>{o.isPaused=!1,f(...m)},stop:()=>{o.isPaused=!0,o.timer?clearTimeout(o.timer):setTimeout(()=>{o.timer&&clearTimeout(o.timer)},o.interval)},get isPaused(){return o.isPaused},get lastResult(){return o.result},get hasErrored(){return!!o.error},get interval(){return o.interval},set interval(m){o.interval=m}}}getSchemes(){return E(this,arguments,function*(e={}){let r=[],n=[];for(let i of this.config.registries)if(i.has.schemes!==!1){let s=i.getSchemes(e).then(o=>{for(let l of o){l._registry=i,l.__DETAILSLOADED__=1,l.type=l.type||["http://www.w3.org/2004/02/skos/core#ConceptScheme"];let c=r.find(h=>P.compare(h,l)),f,m,g=!1;if(c){f=this.config.registries.indexOf(i),f!=-1&&(f=this.config.registries.length-f),m=this.config.registries.indexOf(c==null?void 0:c._registry),m!=-1&&(m=this.config.registries.length-m);let h=l.concepts?l.concepts.length==0?-1:1:0,d=c.concepts?c.concepts.length==0?-1:1:0;h>d?g=!0:h<d?g=!1:g=m<f}if(!c||g){if(g){let h=r.findIndex(R=>P.compare(R,c));h!=-1&&r.splice(h,1);let a=c,{concepts:d,topConcepts:y}=a,O=W(a,["concepts","topConcepts"]);l=P.merge(l,O,{mergeUris:!0,skipPaths:["_registry"]})}l._registry=i,r.push(l)}else{let h=r.findIndex(d=>P.compare(d,l));if(h!=-1){let d=r[h]._registry,u=l,{concepts:y,topConcepts:O}=u,R=W(u,["concepts","topConcepts"]);r[h]=P.merge(r[h],R,{mergeUris:!0,skipPaths:["_registry"]}),r[h]._registry=d}}}}).catch(o=>{console.warn("Couldn't load schemes for registry",i.uri,o)});n.push(s)}return yield Promise.all(n),r.forEach(i=>{let s=i._registry;delete i._registry;let o=this.registryForScheme(i);!o||o._api.api===s._api.api?i._registry=s:i._registry=o}),P.sortSchemes(r.filter(Boolean))})}registryForScheme(e,r="concepts"){var i;let n=e._registry;if(n)return n;for(let s of e.API||[]){let o=s,{type:a}=o,u=W(o,["type"]);let l=u.url,c=`${a}-${l}`;if(Mi[c]){let f=Mi[c];return Array.isArray(f._jskos.schemes)&&!P.isContainedIn(e,f._jskos.schemes)&&f._jskos.schemes.push(e),f}else{u.scheme=e;for(let f of Object.values(Ce)){if((f==null?void 0:f.providerType)!==a||!f._registryConfigForBartocApiConfig||r&&!((i=f==null?void 0:f.supports)!=null&&i[r]))continue;let m=f.providerName,g=Ce[m]._registryConfigForBartocApiConfig(u);if(g){g.provider=m;try{if(n=this.initializeRegistry(g),n)return Mi[c]=n,n}catch(h){continue}}}}}return null}};var zo=new qt;function lc(t){Object.values(Ht).forEach(e=>(t||zo).addProvider(e))}return Wa(cc);})();
|
|
17
17
|
/*! Bundled license information:
|
|
18
18
|
|
|
19
19
|
localforage/dist/localforage.js:
|