@directus/sdk
Advanced tools
Comparing version 9.0.0 to 9.0.1
@@ -27,3 +27,3 @@ "use strict"; | ||
constructor(url, options) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
this._url = url; | ||
@@ -37,3 +37,3 @@ this._options = options; | ||
const directusStorageOptions = (_c = this._options) === null || _c === void 0 ? void 0 : _c.storage; | ||
const _j = directusStorageOptions !== null && directusStorageOptions !== void 0 ? directusStorageOptions : {}, { mode } = _j, storageOptions = __rest(_j, ["mode"]); | ||
const _k = directusStorageOptions !== null && directusStorageOptions !== void 0 ? directusStorageOptions : {}, { mode } = _k, storageOptions = __rest(_k, ["mode"]); | ||
if (mode === 'MemoryStorage' || typeof window === 'undefined') { | ||
@@ -49,5 +49,3 @@ this._storage = new storage_2.MemoryStorage(storageOptions); | ||
else { | ||
this._transport = new transport_2.Transport({ | ||
url: this.url, | ||
beforeRequest: (config) => { | ||
this._transport = new transport_2.Transport(Object.assign({ url: this.url, beforeRequest: (config) => { | ||
const token = this.storage.auth_token; | ||
@@ -60,9 +58,8 @@ const bearer = token | ||
return Object.assign(Object.assign({}, config), { headers: Object.assign({ Authorization: bearer }, config.headers) }); | ||
}, | ||
}); | ||
} }, (_f = this._options) === null || _f === void 0 ? void 0 : _f.transport)); | ||
} | ||
if (((_f = this._options) === null || _f === void 0 ? void 0 : _f.auth) && ((_g = this._options) === null || _g === void 0 ? void 0 : _g.auth) instanceof auth_1.IAuth) | ||
if (((_g = this._options) === null || _g === void 0 ? void 0 : _g.auth) && ((_h = this._options) === null || _h === void 0 ? void 0 : _h.auth) instanceof auth_1.IAuth) | ||
this._auth = this._options.auth; | ||
else | ||
this._auth = new auth_2.Auth(Object.assign({ transport: this._transport, storage: this._storage }, (_h = this._options) === null || _h === void 0 ? void 0 : _h.auth)); | ||
this._auth = new auth_2.Auth(Object.assign({ transport: this._transport, storage: this._storage }, (_j = this._options) === null || _j === void 0 ? void 0 : _j.auth)); | ||
} | ||
@@ -69,0 +66,0 @@ get url() { |
@@ -15,3 +15,3 @@ class t{constructor(){this.mode="undefined"==typeof window?"json":"cookie"}} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}class a extends r{constructor(t){super("directus_files",t)}}class u extends r{constructor(t){super("directus_folders",t)}}class d extends r{constructor(t){super("directus_permissions",t)}}class c extends r{constructor(t){super("directus_presets",t)}}class h{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}class l extends r{constructor(t){super("directus_revisions",t)}}class p extends r{constructor(t){super("directus_roles",t)}}class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;!function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(x||(x={}));class O{}class k{}class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}class R extends O{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class S extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class j extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var T={exports:{}},$=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},q=$,U=Object.prototype.toString;function A(t){return"[object Array]"===U.call(t)}function C(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function P(t){if("[object Object]"!==U.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function B(t){return"[object Function]"===U.call(t)}function L(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),A(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var I={isArray:A,isArrayBuffer:function(t){return"[object ArrayBuffer]"===U.call(t)},isBuffer:function(t){return null!==t&&!C(t)&&null!==t.constructor&&!C(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:P,isUndefined:C,isDate:function(t){return"[object Date]"===U.call(t)},isFile:function(t){return"[object File]"===U.call(t)},isBlob:function(t){return"[object Blob]"===U.call(t)},isFunction:B,isStream:function(t){return N(t)&&B(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:L,merge:function t(){var e={};function r(r,n){P(e[n])&&P(r)?e[n]=t(e[n],r):P(r)?e[n]=t({},r):A(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)L(arguments[n],r);return e},extend:function(t,e,r){return L(e,(function(e,n){t[n]=r&&"function"==typeof e?q(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},D=I;function M(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var J=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(D.isURLSearchParams(e))n=e.toString();else{var s=[];D.forEach(e,(function(t,e){null!=t&&(D.isArray(t)?e+="[]":t=[t],D.forEach(t,(function(t){D.isDate(t)?t=t.toISOString():D.isObject(t)&&(t=JSON.stringify(t)),s.push(M(e)+"="+M(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},F=I;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){F.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var H=z,W=I,V=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},X=V,K=function(t,e,r,n,s){var i=new Error(t);return X(i,e,r,n,s)},G=K,Q=I,Y=Q.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Q.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Q.isString(n)&&o.push("path="+n),Q.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Z=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},tt=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},et=I,rt=["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"],nt=I,st=nt.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=nt.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function it(t){this.message=t}it.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},it.prototype.__CANCEL__=!0;var ot=it,at=I,ut=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(G("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},dt=Y,ct=J,ht=function(t,e){return t&&!Z(e)?tt(t,e):e},lt=function(t){var e,r,n,s={};return t?(et.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=et.trim(t.substr(0,n)).toLowerCase(),r=et.trim(t.substr(n+1)),e){if(s[e]&&rt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},pt=st,ft=K,vt=Et,mt=ot,gt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}at.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=ht(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?lt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ut((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ct(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(ft("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(ft("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||vt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(ft(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},at.isStandardBrowserEnv()){var p=(t.withCredentials||pt(h))&&t.xsrfCookieName?dt.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&at.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),at.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new mt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},yt=I,_t=function(t,e){W.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},wt=V,bt={"Content-Type":"application/x-www-form-urlencoded"};function xt(t,e){!yt.isUndefined(t)&&yt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var Ot,kt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ot=gt),Ot),transformRequest:[function(t,e){return _t(e,"Accept"),_t(e,"Content-Type"),yt.isFormData(t)||yt.isArrayBuffer(t)||yt.isBuffer(t)||yt.isStream(t)||yt.isFile(t)||yt.isBlob(t)?t:yt.isArrayBufferView(t)?t.buffer:yt.isURLSearchParams(t)?(xt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):yt.isObject(t)||e&&"application/json"===e["Content-Type"]?(xt(e,"application/json"),function(t,e,r){if(yt.isString(t))try{return(e||JSON.parse)(t),yt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||kt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&yt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw wt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};yt.forEach(["delete","get","head"],(function(t){kt.headers[t]={}})),yt.forEach(["post","put","patch"],(function(t){kt.headers[t]=yt.merge(bt)}));var Et=kt,Rt=I,St=Et,jt=function(t){return!(!t||!t.__CANCEL__)},Tt=I,$t=function(t,e,r){var n=this||St;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},qt=jt,Ut=Et,At=ot;function Ct(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new At("canceled")}var Nt=I,Pt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Bt="0.24.0",Lt=Bt,It={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){It[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Dt={};It.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Lt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Dt[s]&&(Dt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Mt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:It},Jt=I,Ft=J,zt=H,Ht=function(t){return Ct(t),t.headers=t.headers||{},t.data=$t.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Ut.adapter)(t).then((function(e){return Ct(t),e.data=$t.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return qt(e)||(Ct(t),e&&e.response&&(e.response.data=$t.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Wt=Pt,Vt=Mt,Xt=Vt.validators;function Kt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Kt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Wt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Vt.assertOptions(e,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ht,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ht(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Kt.prototype.getUri=function(t){return t=Wt(this.defaults,t),Ft(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Jt.forEach(["delete","get","head","options"],(function(t){Kt.prototype[t]=function(e,r){return this.request(Wt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Jt.forEach(["post","put","patch"],(function(t){Kt.prototype[t]=function(e,r,n){return this.request(Wt(n||{},{method:t,url:e,data:r}))}}));var Gt=Kt,Qt=ot;function Yt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Qt(t),e(r.reason))}))}Yt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Yt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Yt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Yt.source=function(){var t;return{token:new Yt((function(e){t=e})),cancel:t}};var Zt=Yt,te=I,ee=$,re=Gt,ne=Pt;var se=function t(e){var r=new re(e),n=ee(re.prototype.request,r);return te.extend(n,re.prototype,r),te.extend(n,r),n.create=function(r){return t(ne(e,r))},n}(Et);se.Axios=re,se.Cancel=ot,se.CancelToken=Zt,se.isCancel=jt,se.VERSION=Bt,se.all=function(t){return Promise.all(t)},se.spread=function(t){return function(e){return t.apply(null,e)}},se.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=se,T.exports.default=se;var ie=T.exports;class oe extends k{constructor(t){var e;super(),this.config=t,this.axios=ie.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,r,n,s){var i,o,a,u,d;return e(this,void 0,void 0,(function*(){try{let e={method:t,url:r,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};e=this.beforeRequest(e);const i=yield this.axios.request(e),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(ie.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}class ae{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class ue extends t{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ae(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>e(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return e(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var r;return e(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(e.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}class de{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}class ce{constructor(e,r){var n,s,i,o,a,u,d,c;if(this._url=e,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof O)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new S(n):this._storage=new j(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof k?this._transport=this._options.transport:this._transport=new oe({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}}),(null===(u=this._options)||void 0===u?void 0:u.auth)&&(null===(d=this._options)||void 0===d?void 0:d.auth)instanceof t?this._auth=this._options.auth:this._auth=new ue(Object.assign({transport:this._transport,storage:this._storage},null===(c=this._options)||void 0===c?void 0:c.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new c(this.transport))}get relations(){return this._relations||(this._relations=new h(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new de(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}}export{s as ActivityHandler,ue as Auth,R as BaseStorage,i as CollectionsHandler,n as CommentsHandler,ce as Directus,o as FieldsHandler,a as FilesHandler,u as FoldersHandler,t as IAuth,O as IStorage,k as ITransport,r as ItemsHandler,j as LocalStorage,S as MemoryStorage,x as Meta,d as PermissionsHandler,c as PresetsHandler,h as RelationsHandler,l as RevisionsHandler,p as RolesHandler,f as ServerHandler,m as SettingsHandler,oe as Transport,E as TransportError,w as UsersHandler,b as UtilsHandler}; | ||
***************************************************************************** */function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}class a extends r{constructor(t){super("directus_files",t)}}class u extends r{constructor(t){super("directus_folders",t)}}class d extends r{constructor(t){super("directus_permissions",t)}}class c extends r{constructor(t){super("directus_presets",t)}}class h{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}class l extends r{constructor(t){super("directus_revisions",t)}}class p extends r{constructor(t){super("directus_roles",t)}}class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class g extends v{constructor(t){super("directus_settings",t)}}class m{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new m(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;!function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(x||(x={}));class O{}class k{}class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}class R extends O{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class S extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class j extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var T={exports:{}},$=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},q=$,U=Object.prototype.toString;function A(t){return"[object Array]"===U.call(t)}function C(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function P(t){if("[object Object]"!==U.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function B(t){return"[object Function]"===U.call(t)}function L(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),A(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var I={isArray:A,isArrayBuffer:function(t){return"[object ArrayBuffer]"===U.call(t)},isBuffer:function(t){return null!==t&&!C(t)&&null!==t.constructor&&!C(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:P,isUndefined:C,isDate:function(t){return"[object Date]"===U.call(t)},isFile:function(t){return"[object File]"===U.call(t)},isBlob:function(t){return"[object Blob]"===U.call(t)},isFunction:B,isStream:function(t){return N(t)&&B(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:L,merge:function t(){var e={};function r(r,n){P(e[n])&&P(r)?e[n]=t(e[n],r):P(r)?e[n]=t({},r):A(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)L(arguments[n],r);return e},extend:function(t,e,r){return L(e,(function(e,n){t[n]=r&&"function"==typeof e?q(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},D=I;function M(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var J=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(D.isURLSearchParams(e))n=e.toString();else{var s=[];D.forEach(e,(function(t,e){null!=t&&(D.isArray(t)?e+="[]":t=[t],D.forEach(t,(function(t){D.isDate(t)?t=t.toISOString():D.isObject(t)&&(t=JSON.stringify(t)),s.push(M(e)+"="+M(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},F=I;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){F.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var H=z,W=I,V=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},X=V,K=function(t,e,r,n,s){var i=new Error(t);return X(i,e,r,n,s)},G=K,Q=I,Y=Q.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Q.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Q.isString(n)&&o.push("path="+n),Q.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Z=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},tt=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},et=I,rt=["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"],nt=I,st=nt.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=nt.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function it(t){this.message=t}it.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},it.prototype.__CANCEL__=!0;var ot=it,at=I,ut=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(G("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},dt=Y,ct=J,ht=function(t,e){return t&&!Z(e)?tt(t,e):e},lt=function(t){var e,r,n,s={};return t?(et.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=et.trim(t.substr(0,n)).toLowerCase(),r=et.trim(t.substr(n+1)),e){if(s[e]&&rt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},pt=st,ft=K,vt=Et,gt=ot,mt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}at.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=ht(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?lt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ut((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ct(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(ft("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(ft("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||vt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(ft(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},at.isStandardBrowserEnv()){var p=(t.withCredentials||pt(h))&&t.xsrfCookieName?dt.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&at.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),at.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new gt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},yt=I,_t=function(t,e){W.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},wt=V,bt={"Content-Type":"application/x-www-form-urlencoded"};function xt(t,e){!yt.isUndefined(t)&&yt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var Ot,kt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ot=mt),Ot),transformRequest:[function(t,e){return _t(e,"Accept"),_t(e,"Content-Type"),yt.isFormData(t)||yt.isArrayBuffer(t)||yt.isBuffer(t)||yt.isStream(t)||yt.isFile(t)||yt.isBlob(t)?t:yt.isArrayBufferView(t)?t.buffer:yt.isURLSearchParams(t)?(xt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):yt.isObject(t)||e&&"application/json"===e["Content-Type"]?(xt(e,"application/json"),function(t,e,r){if(yt.isString(t))try{return(e||JSON.parse)(t),yt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||kt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&yt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw wt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};yt.forEach(["delete","get","head"],(function(t){kt.headers[t]={}})),yt.forEach(["post","put","patch"],(function(t){kt.headers[t]=yt.merge(bt)}));var Et=kt,Rt=I,St=Et,jt=function(t){return!(!t||!t.__CANCEL__)},Tt=I,$t=function(t,e,r){var n=this||St;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},qt=jt,Ut=Et,At=ot;function Ct(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new At("canceled")}var Nt=I,Pt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Bt="0.24.0",Lt=Bt,It={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){It[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Dt={};It.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Lt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Dt[s]&&(Dt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Mt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:It},Jt=I,Ft=J,zt=H,Ht=function(t){return Ct(t),t.headers=t.headers||{},t.data=$t.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Ut.adapter)(t).then((function(e){return Ct(t),e.data=$t.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return qt(e)||(Ct(t),e&&e.response&&(e.response.data=$t.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Wt=Pt,Vt=Mt,Xt=Vt.validators;function Kt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Kt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Wt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Vt.assertOptions(e,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ht,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ht(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Kt.prototype.getUri=function(t){return t=Wt(this.defaults,t),Ft(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Jt.forEach(["delete","get","head","options"],(function(t){Kt.prototype[t]=function(e,r){return this.request(Wt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Jt.forEach(["post","put","patch"],(function(t){Kt.prototype[t]=function(e,r,n){return this.request(Wt(n||{},{method:t,url:e,data:r}))}}));var Gt=Kt,Qt=ot;function Yt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Qt(t),e(r.reason))}))}Yt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Yt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Yt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Yt.source=function(){var t;return{token:new Yt((function(e){t=e})),cancel:t}};var Zt=Yt,te=I,ee=$,re=Gt,ne=Pt;var se=function t(e){var r=new re(e),n=ee(re.prototype.request,r);return te.extend(n,re.prototype,r),te.extend(n,r),n.create=function(r){return t(ne(e,r))},n}(Et);se.Axios=re,se.Cancel=ot,se.CancelToken=Zt,se.isCancel=jt,se.VERSION=Bt,se.all=function(t){return Promise.all(t)},se.spread=function(t){return function(e){return t.apply(null,e)}},se.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=se,T.exports.default=se;var ie=T.exports;class oe extends k{constructor(t){var e;super(),this.config=t,this.axios=ie.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,r,n,s){var i,o,a,u,d;return e(this,void 0,void 0,(function*(){try{let e={method:t,url:r,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};e=this.beforeRequest(e);const i=yield this.axios.request(e),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(ie.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}class ae{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class ue extends t{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ae(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>e(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return e(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var r;return e(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(e.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}class de{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}class ce{constructor(e,r){var n,s,i,o,a,u,d,c,h;if(this._url=e,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof O)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new S(n):this._storage=new j(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof k?this._transport=this._options.transport:this._transport=new oe(Object.assign({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}},null===(u=this._options)||void 0===u?void 0:u.transport)),(null===(d=this._options)||void 0===d?void 0:d.auth)&&(null===(c=this._options)||void 0===c?void 0:c.auth)instanceof t?this._auth=this._options.auth:this._auth=new ue(Object.assign({transport:this._transport,storage:this._storage},null===(h=this._options)||void 0===h?void 0:h.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new c(this.transport))}get relations(){return this._relations||(this._relations=new h(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new g(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new de(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}}export{s as ActivityHandler,ue as Auth,R as BaseStorage,i as CollectionsHandler,n as CommentsHandler,ce as Directus,o as FieldsHandler,a as FilesHandler,u as FoldersHandler,t as IAuth,O as IStorage,k as ITransport,r as ItemsHandler,j as LocalStorage,S as MemoryStorage,x as Meta,d as PermissionsHandler,c as PresetsHandler,h as RelationsHandler,l as RevisionsHandler,p as RolesHandler,f as ServerHandler,g as SettingsHandler,oe as Transport,E as TransportError,w as UsersHandler,b as UtilsHandler}; | ||
//# sourceMappingURL=sdk.esm.min.js.map |
@@ -15,3 +15,3 @@ var Directus=function(t){"use strict";class e{constructor(){this.mode="undefined"==typeof window?"json":"cookie"}} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function r(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class n{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:e})).data}))}readMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:e})).data}))}createMany(t,e){return r(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:e})}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,e,{params:n})).data}))}updateMany(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:e},{params:n})}))}updateByQuery(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:e},{params:n})}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class s{constructor(t){this.transport=t}create(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:e})).data}))}delete(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class i extends n{constructor(t){super("directus_activity",t),this._comments=new s(this.transport)}get comments(){return this._comments}}class o{constructor(t){this.transport=t}readOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,e,{params:n})).data}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class a{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,e)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${e}`,n)).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${e}`)}))}}class u extends n{constructor(t){super("directus_files",t)}}class d extends n{constructor(t){super("directus_folders",t)}}class c extends n{constructor(t){super("directus_permissions",t)}}class h extends n{constructor(t){super("directus_presets",t)}}class l{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${e}`,{params:n})).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${e}`)}))}}class p extends n{constructor(t){super("directus_revisions",t)}}class f extends n{constructor(t){super("directus_roles",t)}}class v{constructor(t){this.transport=t}ping(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class m{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:e})).data}))}}class g extends m{constructor(t){super("directus_settings",t)}}class y{constructor(t){this.transport=t}send(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:e,invite_url:n})}))}accept(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:e})}))}}class _{constructor(t){this.transport=t}generate(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:e})}))}disable(t){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class w{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new _(this._transport))}read(t){return r(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:e})).data}))}}class b extends n{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new y(this.transport))}get me(){return this._me||(this._me=new w(this.transport))}}class x{constructor(t){this.random={string:(t=32)=>r(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,e)=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:e})).data}))},this.transport=t}sort(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:e,to:n})}))}revert(t){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var O;t.Meta=void 0,(O=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",O.FILTER_COUNT="filter_count";class k{}class S{}class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}class R extends k{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class j extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class T extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var A={exports:{}},U=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},$=U,q=Object.prototype.toString;function C(t){return"[object Array]"===q.call(t)}function P(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function B(t){if("[object Object]"!==q.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function L(t){return"[object Function]"===q.call(t)}function I(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),C(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var H={isArray:C,isArrayBuffer:function(t){return"[object ArrayBuffer]"===q.call(t)},isBuffer:function(t){return null!==t&&!P(t)&&null!==t.constructor&&!P(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:B,isUndefined:P,isDate:function(t){return"[object Date]"===q.call(t)},isFile:function(t){return"[object File]"===q.call(t)},isBlob:function(t){return"[object Blob]"===q.call(t)},isFunction:L,isStream:function(t){return N(t)&&L(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:I,merge:function t(){var e={};function r(r,n){B(e[n])&&B(r)?e[n]=t(e[n],r):B(r)?e[n]=t({},r):C(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)I(arguments[n],r);return e},extend:function(t,e,r){return I(e,(function(e,n){t[n]=r&&"function"==typeof e?$(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},M=H;function D(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var F=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(M.isURLSearchParams(e))n=e.toString();else{var s=[];M.forEach(e,(function(t,e){null!=t&&(M.isArray(t)?e+="[]":t=[t],M.forEach(t,(function(t){M.isDate(t)?t=t.toISOString():M.isObject(t)&&(t=JSON.stringify(t)),s.push(D(e)+"="+D(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},J=H;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){J.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var W=z,V=H,X=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},K=X,G=function(t,e,r,n,s){var i=new Error(t);return K(i,e,r,n,s)},Q=G,Y=H,Z=Y.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},tt=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},et=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},rt=H,nt=["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"],st=H,it=st.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=st.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function ot(t){this.message=t}ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ot.prototype.__CANCEL__=!0;var at=ot,ut=H,dt=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Q("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ct=Z,ht=F,lt=function(t,e){return t&&!tt(e)?et(t,e):e},pt=function(t){var e,r,n,s={};return t?(rt.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=rt.trim(t.substr(0,n)).toLowerCase(),r=rt.trim(t.substr(n+1)),e){if(s[e]&&nt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ft=it,vt=G,mt=Et,gt=at,yt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}ut.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=lt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};dt((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ht(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(vt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(vt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||mt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(vt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ft(h))&&t.xsrfCookieName?ct.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new gt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},_t=H,wt=function(t,e){V.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},bt=X,xt={"Content-Type":"application/x-www-form-urlencoded"};function Ot(t,e){!_t.isUndefined(t)&&_t.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var kt,St={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kt=yt),kt),transformRequest:[function(t,e){return wt(e,"Accept"),wt(e,"Content-Type"),_t.isFormData(t)||_t.isArrayBuffer(t)||_t.isBuffer(t)||_t.isStream(t)||_t.isFile(t)||_t.isBlob(t)?t:_t.isArrayBufferView(t)?t.buffer:_t.isURLSearchParams(t)?(Ot(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_t.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ot(e,"application/json"),function(t,e,r){if(_t.isString(t))try{return(e||JSON.parse)(t),_t.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||St.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&_t.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw bt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_t.forEach(["delete","get","head"],(function(t){St.headers[t]={}})),_t.forEach(["post","put","patch"],(function(t){St.headers[t]=_t.merge(xt)}));var Et=St,Rt=H,jt=Et,Tt=function(t){return!(!t||!t.__CANCEL__)},At=H,Ut=function(t,e,r){var n=this||jt;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},$t=Tt,qt=Et,Ct=at;function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ct("canceled")}var Nt=H,Bt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Lt="0.24.0",It=Lt,Ht={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ht[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Mt={};Ht.transitional=function(t,e,r){function n(t,e){return"[Axios v"+It+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Mt[s]&&(Mt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Dt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Ht},Ft=H,Jt=F,zt=W,Wt=function(t){return Pt(t),t.headers=t.headers||{},t.data=Ut.call(t,t.data,t.headers,t.transformRequest),t.headers=At.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),At.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||qt.adapter)(t).then((function(e){return Pt(t),e.data=Ut.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return $t(e)||(Pt(t),e&&e.response&&(e.response.data=Ut.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Vt=Bt,Xt=Dt,Kt=Xt.validators;function Gt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Gt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Vt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Xt.assertOptions(e,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Wt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Wt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Gt.prototype.getUri=function(t){return t=Vt(this.defaults,t),Jt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Ft.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){Gt.prototype[t]=function(e,r,n){return this.request(Vt(n||{},{method:t,url:e,data:r}))}}));var Qt=Gt,Yt=at;function Zt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Yt(t),e(r.reason))}))}Zt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Zt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Zt.source=function(){var t;return{token:new Zt((function(e){t=e})),cancel:t}};var te=Zt,ee=H,re=U,ne=Qt,se=Bt;var ie=function t(e){var r=new ne(e),n=re(ne.prototype.request,r);return ee.extend(n,ne.prototype,r),ee.extend(n,r),n.create=function(r){return t(se(e,r))},n}(Et);ie.Axios=ne,ie.Cancel=at,ie.CancelToken=te,ie.isCancel=Tt,ie.VERSION=Lt,ie.all=function(t){return Promise.all(t)},ie.spread=function(t){return function(e){return t.apply(null,e)}},ie.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},A.exports=ie,A.exports.default=ie;var oe=A.exports;class ae extends S{constructor(t){var e;super(),this.config=t,this.axios=oe.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,e,n,s){var i,o,a,u,d;return r(this,void 0,void 0,(function*(){try{let r={method:t,url:e,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};r=this.beforeRequest(r);const i=yield this.axios.request(r),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(oe.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,e)}))}head(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,e)}))}options(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,e)}))}delete(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("delete",t,e,n)}))}put(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("put",t,e,n)}))}post(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("post",t,e,n)}))}patch(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("patch",t,e,n)}))}}class ue{constructor(t){this.transport=t}request(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:e})}))}reset(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:e})}))}}class de extends e{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ue(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>r(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return r(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var e;return r(this,void 0,void 0,(function*(){const r=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(r.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:r.data.access_token,refresh_token:null===(e=r.data)||void 0===e?void 0:e.refresh_token,expires:r.data.expires}}))}static(t){return r(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return r(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}class ce{constructor(t){this.transport=t}request(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:e,variables:void 0===n?{}:n})}))}items(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,e)}))}system(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,e)}))}}return t.ActivityHandler=i,t.Auth=de,t.BaseStorage=R,t.CollectionsHandler=o,t.CommentsHandler=s,t.Directus=class{constructor(t,r){var n,s,i,o,a,u,d,c;if(this._url=t,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof k)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new j(n):this._storage=new T(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof S?this._transport=this._options.transport:this._transport=new ae({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}}),(null===(u=this._options)||void 0===u?void 0:u.auth)&&(null===(d=this._options)||void 0===d?void 0:d.auth)instanceof e?this._auth=this._options.auth:this._auth=new de(Object.assign({transport:this._transport,storage:this._storage},null===(c=this._options)||void 0===c?void 0:c.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new i(this.transport))}get collections(){return this._collections||(this._collections=new o(this.transport))}get fields(){return this._fields||(this._fields=new a(this.transport))}get files(){return this._files||(this._files=new u(this.transport))}get folders(){return this._folders||(this._folders=new d(this.transport))}get permissions(){return this._permissions||(this._permissions=new c(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new l(this.transport))}get revisions(){return this._revisions||(this._revisions=new p(this.transport))}get roles(){return this._roles||(this._roles=new f(this.transport))}get users(){return this._users||(this._users=new b(this.transport))}get settings(){return this._settings||(this._settings=new g(this.transport))}get server(){return this._server||(this._server=new v(this.transport))}get utils(){return this._utils||(this._utils=new x(this.transport))}get graphql(){return this._graphql||(this._graphql=new ce(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new m(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new n(t,this.transport))}},t.FieldsHandler=a,t.FilesHandler=u,t.FoldersHandler=d,t.IAuth=e,t.IStorage=k,t.ITransport=S,t.ItemsHandler=n,t.LocalStorage=T,t.MemoryStorage=j,t.PermissionsHandler=c,t.PresetsHandler=h,t.RelationsHandler=l,t.RevisionsHandler=p,t.RolesHandler=f,t.ServerHandler=v,t.SettingsHandler=g,t.Transport=ae,t.TransportError=E,t.UsersHandler=b,t.UtilsHandler=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
***************************************************************************** */function r(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class n{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:e})).data}))}readMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:e})).data}))}createMany(t,e){return r(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:e})}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,e,{params:n})).data}))}updateMany(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:e},{params:n})}))}updateByQuery(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:e},{params:n})}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class s{constructor(t){this.transport=t}create(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:e})).data}))}delete(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class i extends n{constructor(t){super("directus_activity",t),this._comments=new s(this.transport)}get comments(){return this._comments}}class o{constructor(t){this.transport=t}readOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,e,{params:n})).data}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class a{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,e)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${e}`,n)).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${e}`)}))}}class u extends n{constructor(t){super("directus_files",t)}}class d extends n{constructor(t){super("directus_folders",t)}}class c extends n{constructor(t){super("directus_permissions",t)}}class h extends n{constructor(t){super("directus_presets",t)}}class l{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${e}`,{params:n})).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${e}`)}))}}class p extends n{constructor(t){super("directus_revisions",t)}}class f extends n{constructor(t){super("directus_roles",t)}}class v{constructor(t){this.transport=t}ping(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class g{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:e})).data}))}}class m extends g{constructor(t){super("directus_settings",t)}}class y{constructor(t){this.transport=t}send(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:e,invite_url:n})}))}accept(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:e})}))}}class _{constructor(t){this.transport=t}generate(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:e})}))}disable(t){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class w{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new _(this._transport))}read(t){return r(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:e})).data}))}}class b extends n{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new y(this.transport))}get me(){return this._me||(this._me=new w(this.transport))}}class x{constructor(t){this.random={string:(t=32)=>r(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,e)=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:e})).data}))},this.transport=t}sort(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:e,to:n})}))}revert(t){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var O;t.Meta=void 0,(O=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",O.FILTER_COUNT="filter_count";class k{}class S{}class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}class R extends k{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class j extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class T extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var A={exports:{}},U=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},$=U,q=Object.prototype.toString;function C(t){return"[object Array]"===q.call(t)}function P(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function B(t){if("[object Object]"!==q.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function L(t){return"[object Function]"===q.call(t)}function I(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),C(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var H={isArray:C,isArrayBuffer:function(t){return"[object ArrayBuffer]"===q.call(t)},isBuffer:function(t){return null!==t&&!P(t)&&null!==t.constructor&&!P(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:B,isUndefined:P,isDate:function(t){return"[object Date]"===q.call(t)},isFile:function(t){return"[object File]"===q.call(t)},isBlob:function(t){return"[object Blob]"===q.call(t)},isFunction:L,isStream:function(t){return N(t)&&L(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:I,merge:function t(){var e={};function r(r,n){B(e[n])&&B(r)?e[n]=t(e[n],r):B(r)?e[n]=t({},r):C(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)I(arguments[n],r);return e},extend:function(t,e,r){return I(e,(function(e,n){t[n]=r&&"function"==typeof e?$(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},M=H;function D(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var F=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(M.isURLSearchParams(e))n=e.toString();else{var s=[];M.forEach(e,(function(t,e){null!=t&&(M.isArray(t)?e+="[]":t=[t],M.forEach(t,(function(t){M.isDate(t)?t=t.toISOString():M.isObject(t)&&(t=JSON.stringify(t)),s.push(D(e)+"="+D(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},J=H;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){J.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var W=z,V=H,X=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},K=X,G=function(t,e,r,n,s){var i=new Error(t);return K(i,e,r,n,s)},Q=G,Y=H,Z=Y.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},tt=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},et=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},rt=H,nt=["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"],st=H,it=st.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=st.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function ot(t){this.message=t}ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ot.prototype.__CANCEL__=!0;var at=ot,ut=H,dt=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Q("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ct=Z,ht=F,lt=function(t,e){return t&&!tt(e)?et(t,e):e},pt=function(t){var e,r,n,s={};return t?(rt.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=rt.trim(t.substr(0,n)).toLowerCase(),r=rt.trim(t.substr(n+1)),e){if(s[e]&&nt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ft=it,vt=G,gt=Et,mt=at,yt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}ut.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=lt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};dt((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ht(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(vt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(vt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||gt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(vt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ft(h))&&t.xsrfCookieName?ct.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new mt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},_t=H,wt=function(t,e){V.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},bt=X,xt={"Content-Type":"application/x-www-form-urlencoded"};function Ot(t,e){!_t.isUndefined(t)&&_t.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var kt,St={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kt=yt),kt),transformRequest:[function(t,e){return wt(e,"Accept"),wt(e,"Content-Type"),_t.isFormData(t)||_t.isArrayBuffer(t)||_t.isBuffer(t)||_t.isStream(t)||_t.isFile(t)||_t.isBlob(t)?t:_t.isArrayBufferView(t)?t.buffer:_t.isURLSearchParams(t)?(Ot(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_t.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ot(e,"application/json"),function(t,e,r){if(_t.isString(t))try{return(e||JSON.parse)(t),_t.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||St.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&_t.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw bt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_t.forEach(["delete","get","head"],(function(t){St.headers[t]={}})),_t.forEach(["post","put","patch"],(function(t){St.headers[t]=_t.merge(xt)}));var Et=St,Rt=H,jt=Et,Tt=function(t){return!(!t||!t.__CANCEL__)},At=H,Ut=function(t,e,r){var n=this||jt;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},$t=Tt,qt=Et,Ct=at;function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ct("canceled")}var Nt=H,Bt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Lt="0.24.0",It=Lt,Ht={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ht[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Mt={};Ht.transitional=function(t,e,r){function n(t,e){return"[Axios v"+It+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Mt[s]&&(Mt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Dt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Ht},Ft=H,Jt=F,zt=W,Wt=function(t){return Pt(t),t.headers=t.headers||{},t.data=Ut.call(t,t.data,t.headers,t.transformRequest),t.headers=At.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),At.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||qt.adapter)(t).then((function(e){return Pt(t),e.data=Ut.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return $t(e)||(Pt(t),e&&e.response&&(e.response.data=Ut.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Vt=Bt,Xt=Dt,Kt=Xt.validators;function Gt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Gt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Vt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Xt.assertOptions(e,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Wt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Wt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Gt.prototype.getUri=function(t){return t=Vt(this.defaults,t),Jt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Ft.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){Gt.prototype[t]=function(e,r,n){return this.request(Vt(n||{},{method:t,url:e,data:r}))}}));var Qt=Gt,Yt=at;function Zt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Yt(t),e(r.reason))}))}Zt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Zt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Zt.source=function(){var t;return{token:new Zt((function(e){t=e})),cancel:t}};var te=Zt,ee=H,re=U,ne=Qt,se=Bt;var ie=function t(e){var r=new ne(e),n=re(ne.prototype.request,r);return ee.extend(n,ne.prototype,r),ee.extend(n,r),n.create=function(r){return t(se(e,r))},n}(Et);ie.Axios=ne,ie.Cancel=at,ie.CancelToken=te,ie.isCancel=Tt,ie.VERSION=Lt,ie.all=function(t){return Promise.all(t)},ie.spread=function(t){return function(e){return t.apply(null,e)}},ie.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},A.exports=ie,A.exports.default=ie;var oe=A.exports;class ae extends S{constructor(t){var e;super(),this.config=t,this.axios=oe.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,e,n,s){var i,o,a,u,d;return r(this,void 0,void 0,(function*(){try{let r={method:t,url:e,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};r=this.beforeRequest(r);const i=yield this.axios.request(r),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(oe.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,e)}))}head(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,e)}))}options(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,e)}))}delete(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("delete",t,e,n)}))}put(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("put",t,e,n)}))}post(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("post",t,e,n)}))}patch(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("patch",t,e,n)}))}}class ue{constructor(t){this.transport=t}request(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:e})}))}reset(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:e})}))}}class de extends e{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ue(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>r(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return r(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var e;return r(this,void 0,void 0,(function*(){const r=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(r.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:r.data.access_token,refresh_token:null===(e=r.data)||void 0===e?void 0:e.refresh_token,expires:r.data.expires}}))}static(t){return r(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return r(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}class ce{constructor(t){this.transport=t}request(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:e,variables:void 0===n?{}:n})}))}items(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,e)}))}system(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,e)}))}}return t.ActivityHandler=i,t.Auth=de,t.BaseStorage=R,t.CollectionsHandler=o,t.CommentsHandler=s,t.Directus=class{constructor(t,r){var n,s,i,o,a,u,d,c,h;if(this._url=t,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof k)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new j(n):this._storage=new T(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof S?this._transport=this._options.transport:this._transport=new ae(Object.assign({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}},null===(u=this._options)||void 0===u?void 0:u.transport)),(null===(d=this._options)||void 0===d?void 0:d.auth)&&(null===(c=this._options)||void 0===c?void 0:c.auth)instanceof e?this._auth=this._options.auth:this._auth=new de(Object.assign({transport:this._transport,storage:this._storage},null===(h=this._options)||void 0===h?void 0:h.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new i(this.transport))}get collections(){return this._collections||(this._collections=new o(this.transport))}get fields(){return this._fields||(this._fields=new a(this.transport))}get files(){return this._files||(this._files=new u(this.transport))}get folders(){return this._folders||(this._folders=new d(this.transport))}get permissions(){return this._permissions||(this._permissions=new c(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new l(this.transport))}get revisions(){return this._revisions||(this._revisions=new p(this.transport))}get roles(){return this._roles||(this._roles=new f(this.transport))}get users(){return this._users||(this._users=new b(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new v(this.transport))}get utils(){return this._utils||(this._utils=new x(this.transport))}get graphql(){return this._graphql||(this._graphql=new ce(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new g(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new n(t,this.transport))}},t.FieldsHandler=a,t.FilesHandler=u,t.FoldersHandler=d,t.IAuth=e,t.IStorage=k,t.ITransport=S,t.ItemsHandler=n,t.LocalStorage=T,t.MemoryStorage=j,t.PermissionsHandler=c,t.PresetsHandler=h,t.RelationsHandler=l,t.RevisionsHandler=p,t.RolesHandler=f,t.ServerHandler=v,t.SettingsHandler=m,t.Transport=ae,t.TransportError=E,t.UsersHandler=b,t.UtilsHandler=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
//# sourceMappingURL=sdk.iife.min.js.map |
@@ -1,2 +0,2 @@ | ||
System.register("Directus",[],(function(t){"use strict";return{execute:function(){class e{constructor(){this.mode="undefined"==typeof window?"json":"cookie"}}function r(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}t("IAuth",e);class n{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:e})).data}))}readMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:e})).data}))}createMany(t,e){return r(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:e})}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,e,{params:n})).data}))}updateMany(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:e},{params:n})}))}updateByQuery(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:e},{params:n})}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}t("ItemsHandler",n);class s{constructor(t){this.transport=t}create(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:e})).data}))}delete(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}t("CommentsHandler",s);class i extends n{constructor(t){super("directus_activity",t),this._comments=new s(this.transport)}get comments(){return this._comments}}t("ActivityHandler",i);class o{constructor(t){this.transport=t}readOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,e,{params:n})).data}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}t("CollectionsHandler",o);class a{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,e)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${e}`,n)).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${e}`)}))}}t("FieldsHandler",a);class u extends n{constructor(t){super("directus_files",t)}}t("FilesHandler",u);class d extends n{constructor(t){super("directus_folders",t)}}t("FoldersHandler",d);class c extends n{constructor(t){super("directus_permissions",t)}}t("PermissionsHandler",c);class h extends n{constructor(t){super("directus_presets",t)}}t("PresetsHandler",h);class l{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${e}`,{params:n})).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${e}`)}))}}t("RelationsHandler",l);class p extends n{constructor(t){super("directus_revisions",t)}}t("RevisionsHandler",p);class f extends n{constructor(t){super("directus_roles",t)}}t("RolesHandler",f);class v{constructor(t){this.transport=t}ping(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}t("ServerHandler",v);class m{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:e})).data}))}}class g extends m{constructor(t){super("directus_settings",t)}}t("SettingsHandler",g);class y{constructor(t){this.transport=t}send(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:e,invite_url:n})}))}accept(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:e})}))}}class _{constructor(t){this.transport=t}generate(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:e})}))}disable(t){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class w{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new _(this._transport))}read(t){return r(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:e})).data}))}}class b extends n{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new y(this.transport))}get me(){return this._me||(this._me=new w(this.transport))}}t("UsersHandler",b);class x{constructor(t){this.random={string:(t=32)=>r(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,e)=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:e})).data}))},this.transport=t}sort(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:e,to:n})}))}revert(t){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var O;t("UtilsHandler",x),t("Meta",O),function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(O||t("Meta",O={}));class k{}t("IStorage",k);class S{}t("ITransport",S);class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}t("TransportError",E);class R extends k{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}t("BaseStorage",R);class j extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}t("MemoryStorage",j);class T extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}t("LocalStorage",T);var A={exports:{}},U=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},$=U,q=Object.prototype.toString;function C(t){return"[object Array]"===q.call(t)}function P(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function B(t){if("[object Object]"!==q.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function L(t){return"[object Function]"===q.call(t)}function I(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),C(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var H={isArray:C,isArrayBuffer:function(t){return"[object ArrayBuffer]"===q.call(t)},isBuffer:function(t){return null!==t&&!P(t)&&null!==t.constructor&&!P(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:B,isUndefined:P,isDate:function(t){return"[object Date]"===q.call(t)},isFile:function(t){return"[object File]"===q.call(t)},isBlob:function(t){return"[object Blob]"===q.call(t)},isFunction:L,isStream:function(t){return N(t)&&L(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:I,merge:function t(){var e={};function r(r,n){B(e[n])&&B(r)?e[n]=t(e[n],r):B(r)?e[n]=t({},r):C(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)I(arguments[n],r);return e},extend:function(t,e,r){return I(e,(function(e,n){t[n]=r&&"function"==typeof e?$(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},D=H;function M(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var F=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(D.isURLSearchParams(e))n=e.toString();else{var s=[];D.forEach(e,(function(t,e){null!=t&&(D.isArray(t)?e+="[]":t=[t],D.forEach(t,(function(t){D.isDate(t)?t=t.toISOString():D.isObject(t)&&(t=JSON.stringify(t)),s.push(M(e)+"="+M(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},J=H;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){J.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var W=z,V=H,X=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},K=X,G=function(t,e,r,n,s){var i=new Error(t);return K(i,e,r,n,s)},Q=G,Y=H,Z=Y.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},tt=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},et=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},rt=H,nt=["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"],st=H,it=st.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=st.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function ot(t){this.message=t}ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ot.prototype.__CANCEL__=!0;var at=ot,ut=H,dt=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Q("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ct=Z,ht=F,lt=function(t,e){return t&&!tt(e)?et(t,e):e},pt=function(t){var e,r,n,s={};return t?(rt.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=rt.trim(t.substr(0,n)).toLowerCase(),r=rt.trim(t.substr(n+1)),e){if(s[e]&&nt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ft=it,vt=G,mt=Et,gt=at,yt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}ut.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=lt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};dt((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ht(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(vt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(vt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||mt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(vt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ft(h))&&t.xsrfCookieName?ct.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new gt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},_t=H,wt=function(t,e){V.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},bt=X,xt={"Content-Type":"application/x-www-form-urlencoded"};function Ot(t,e){!_t.isUndefined(t)&&_t.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var kt,St={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kt=yt),kt),transformRequest:[function(t,e){return wt(e,"Accept"),wt(e,"Content-Type"),_t.isFormData(t)||_t.isArrayBuffer(t)||_t.isBuffer(t)||_t.isStream(t)||_t.isFile(t)||_t.isBlob(t)?t:_t.isArrayBufferView(t)?t.buffer:_t.isURLSearchParams(t)?(Ot(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_t.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ot(e,"application/json"),function(t,e,r){if(_t.isString(t))try{return(e||JSON.parse)(t),_t.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||St.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&_t.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw bt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_t.forEach(["delete","get","head"],(function(t){St.headers[t]={}})),_t.forEach(["post","put","patch"],(function(t){St.headers[t]=_t.merge(xt)}));var Et=St,Rt=H,jt=Et,Tt=function(t){return!(!t||!t.__CANCEL__)},At=H,Ut=function(t,e,r){var n=this||jt;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},$t=Tt,qt=Et,Ct=at;function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ct("canceled")}var Nt=H,Bt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Lt="0.24.0",It=Lt,Ht={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ht[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Dt={};Ht.transitional=function(t,e,r){function n(t,e){return"[Axios v"+It+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Dt[s]&&(Dt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Mt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Ht},Ft=H,Jt=F,zt=W,Wt=function(t){return Pt(t),t.headers=t.headers||{},t.data=Ut.call(t,t.data,t.headers,t.transformRequest),t.headers=At.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),At.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||qt.adapter)(t).then((function(e){return Pt(t),e.data=Ut.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return $t(e)||(Pt(t),e&&e.response&&(e.response.data=Ut.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Vt=Bt,Xt=Mt,Kt=Xt.validators;function Gt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Gt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Vt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Xt.assertOptions(e,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Wt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Wt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Gt.prototype.getUri=function(t){return t=Vt(this.defaults,t),Jt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Ft.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){Gt.prototype[t]=function(e,r,n){return this.request(Vt(n||{},{method:t,url:e,data:r}))}}));var Qt=Gt,Yt=at;function Zt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Yt(t),e(r.reason))}))}Zt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Zt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Zt.source=function(){var t;return{token:new Zt((function(e){t=e})),cancel:t}};var te=Zt,ee=H,re=U,ne=Qt,se=Bt;var ie=function t(e){var r=new ne(e),n=re(ne.prototype.request,r);return ee.extend(n,ne.prototype,r),ee.extend(n,r),n.create=function(r){return t(se(e,r))},n}(Et);ie.Axios=ne,ie.Cancel=at,ie.CancelToken=te,ie.isCancel=Tt,ie.VERSION=Lt,ie.all=function(t){return Promise.all(t)},ie.spread=function(t){return function(e){return t.apply(null,e)}},ie.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},A.exports=ie,A.exports.default=ie;var oe=A.exports;class ae extends S{constructor(t){var e;super(),this.config=t,this.axios=oe.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,e,n,s){var i,o,a,u,d;return r(this,void 0,void 0,(function*(){try{let r={method:t,url:e,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};r=this.beforeRequest(r);const i=yield this.axios.request(r),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(oe.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,e)}))}head(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,e)}))}options(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,e)}))}delete(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("delete",t,e,n)}))}put(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("put",t,e,n)}))}post(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("post",t,e,n)}))}patch(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("patch",t,e,n)}))}}t("Transport",ae);class ue{constructor(t){this.transport=t}request(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:e})}))}reset(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:e})}))}}class de extends e{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ue(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>r(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return r(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var e;return r(this,void 0,void 0,(function*(){const r=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(r.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:r.data.access_token,refresh_token:null===(e=r.data)||void 0===e?void 0:e.refresh_token,expires:r.data.expires}}))}static(t){return r(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return r(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}t("Auth",de);class ce{constructor(t){this.transport=t}request(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:e,variables:void 0===n?{}:n})}))}items(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,e)}))}system(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,e)}))}}t("Directus",class{constructor(t,r){var n,s,i,o,a,u,d,c;if(this._url=t,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof k)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n= | ||
System.register("Directus",[],(function(t){"use strict";return{execute:function(){class e{constructor(){this.mode="undefined"==typeof window?"json":"cookie"}}function r(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}t("IAuth",e);class n{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:e})).data}))}readMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:e})).data}))}createMany(t,e){return r(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:e})}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,e,{params:n})).data}))}updateMany(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:e},{params:n})}))}updateByQuery(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:e},{params:n})}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}t("ItemsHandler",n);class s{constructor(t){this.transport=t}create(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:e})).data}))}delete(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}t("CommentsHandler",s);class i extends n{constructor(t){super("directus_activity",t),this._comments=new s(this.transport)}get comments(){return this._comments}}t("ActivityHandler",i);class o{constructor(t){this.transport=t}readOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,e,{params:n})).data}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}t("CollectionsHandler",o);class a{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,e)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${e}`,n)).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${e}`)}))}}t("FieldsHandler",a);class u extends n{constructor(t){super("directus_files",t)}}t("FilesHandler",u);class d extends n{constructor(t){super("directus_folders",t)}}t("FoldersHandler",d);class c extends n{constructor(t){super("directus_permissions",t)}}t("PermissionsHandler",c);class h extends n{constructor(t){super("directus_presets",t)}}t("PresetsHandler",h);class l{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${e}`,{params:n})).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${e}`)}))}}t("RelationsHandler",l);class p extends n{constructor(t){super("directus_revisions",t)}}t("RevisionsHandler",p);class f extends n{constructor(t){super("directus_roles",t)}}t("RolesHandler",f);class v{constructor(t){this.transport=t}ping(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}t("ServerHandler",v);class g{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:e})).data}))}}class m extends g{constructor(t){super("directus_settings",t)}}t("SettingsHandler",m);class y{constructor(t){this.transport=t}send(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:e,invite_url:n})}))}accept(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:e})}))}}class _{constructor(t){this.transport=t}generate(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:e})}))}disable(t){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class w{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new _(this._transport))}read(t){return r(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:e})).data}))}}class b extends n{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new y(this.transport))}get me(){return this._me||(this._me=new w(this.transport))}}t("UsersHandler",b);class x{constructor(t){this.random={string:(t=32)=>r(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,e)=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:e})).data}))},this.transport=t}sort(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:e,to:n})}))}revert(t){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var O;t("UtilsHandler",x),t("Meta",O),function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(O||t("Meta",O={}));class k{}t("IStorage",k);class S{}t("ITransport",S);class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}t("TransportError",E);class R extends k{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}t("BaseStorage",R);class j extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}t("MemoryStorage",j);class T extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}t("LocalStorage",T);var A={exports:{}},U=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},$=U,q=Object.prototype.toString;function C(t){return"[object Array]"===q.call(t)}function P(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function B(t){if("[object Object]"!==q.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function L(t){return"[object Function]"===q.call(t)}function I(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),C(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var H={isArray:C,isArrayBuffer:function(t){return"[object ArrayBuffer]"===q.call(t)},isBuffer:function(t){return null!==t&&!P(t)&&null!==t.constructor&&!P(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:B,isUndefined:P,isDate:function(t){return"[object Date]"===q.call(t)},isFile:function(t){return"[object File]"===q.call(t)},isBlob:function(t){return"[object Blob]"===q.call(t)},isFunction:L,isStream:function(t){return N(t)&&L(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:I,merge:function t(){var e={};function r(r,n){B(e[n])&&B(r)?e[n]=t(e[n],r):B(r)?e[n]=t({},r):C(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)I(arguments[n],r);return e},extend:function(t,e,r){return I(e,(function(e,n){t[n]=r&&"function"==typeof e?$(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},D=H;function M(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var F=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(D.isURLSearchParams(e))n=e.toString();else{var s=[];D.forEach(e,(function(t,e){null!=t&&(D.isArray(t)?e+="[]":t=[t],D.forEach(t,(function(t){D.isDate(t)?t=t.toISOString():D.isObject(t)&&(t=JSON.stringify(t)),s.push(M(e)+"="+M(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},J=H;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){J.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var W=z,V=H,X=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},K=X,G=function(t,e,r,n,s){var i=new Error(t);return K(i,e,r,n,s)},Q=G,Y=H,Z=Y.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},tt=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},et=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},rt=H,nt=["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"],st=H,it=st.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=st.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function ot(t){this.message=t}ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ot.prototype.__CANCEL__=!0;var at=ot,ut=H,dt=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Q("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ct=Z,ht=F,lt=function(t,e){return t&&!tt(e)?et(t,e):e},pt=function(t){var e,r,n,s={};return t?(rt.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=rt.trim(t.substr(0,n)).toLowerCase(),r=rt.trim(t.substr(n+1)),e){if(s[e]&&nt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ft=it,vt=G,gt=Et,mt=at,yt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}ut.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=lt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};dt((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ht(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(vt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(vt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||gt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(vt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ft(h))&&t.xsrfCookieName?ct.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new mt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},_t=H,wt=function(t,e){V.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},bt=X,xt={"Content-Type":"application/x-www-form-urlencoded"};function Ot(t,e){!_t.isUndefined(t)&&_t.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var kt,St={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kt=yt),kt),transformRequest:[function(t,e){return wt(e,"Accept"),wt(e,"Content-Type"),_t.isFormData(t)||_t.isArrayBuffer(t)||_t.isBuffer(t)||_t.isStream(t)||_t.isFile(t)||_t.isBlob(t)?t:_t.isArrayBufferView(t)?t.buffer:_t.isURLSearchParams(t)?(Ot(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_t.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ot(e,"application/json"),function(t,e,r){if(_t.isString(t))try{return(e||JSON.parse)(t),_t.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||St.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&_t.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw bt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_t.forEach(["delete","get","head"],(function(t){St.headers[t]={}})),_t.forEach(["post","put","patch"],(function(t){St.headers[t]=_t.merge(xt)}));var Et=St,Rt=H,jt=Et,Tt=function(t){return!(!t||!t.__CANCEL__)},At=H,Ut=function(t,e,r){var n=this||jt;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},$t=Tt,qt=Et,Ct=at;function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ct("canceled")}var Nt=H,Bt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Lt="0.24.0",It=Lt,Ht={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ht[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Dt={};Ht.transitional=function(t,e,r){function n(t,e){return"[Axios v"+It+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Dt[s]&&(Dt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Mt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Ht},Ft=H,Jt=F,zt=W,Wt=function(t){return Pt(t),t.headers=t.headers||{},t.data=Ut.call(t,t.data,t.headers,t.transformRequest),t.headers=At.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),At.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||qt.adapter)(t).then((function(e){return Pt(t),e.data=Ut.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return $t(e)||(Pt(t),e&&e.response&&(e.response.data=Ut.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Vt=Bt,Xt=Mt,Kt=Xt.validators;function Gt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Gt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Vt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Xt.assertOptions(e,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Wt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Wt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Gt.prototype.getUri=function(t){return t=Vt(this.defaults,t),Jt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Ft.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){Gt.prototype[t]=function(e,r,n){return this.request(Vt(n||{},{method:t,url:e,data:r}))}}));var Qt=Gt,Yt=at;function Zt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Yt(t),e(r.reason))}))}Zt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Zt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Zt.source=function(){var t;return{token:new Zt((function(e){t=e})),cancel:t}};var te=Zt,ee=H,re=U,ne=Qt,se=Bt;var ie=function t(e){var r=new ne(e),n=re(ne.prototype.request,r);return ee.extend(n,ne.prototype,r),ee.extend(n,r),n.create=function(r){return t(se(e,r))},n}(Et);ie.Axios=ne,ie.Cancel=at,ie.CancelToken=te,ie.isCancel=Tt,ie.VERSION=Lt,ie.all=function(t){return Promise.all(t)},ie.spread=function(t){return function(e){return t.apply(null,e)}},ie.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},A.exports=ie,A.exports.default=ie;var oe=A.exports;class ae extends S{constructor(t){var e;super(),this.config=t,this.axios=oe.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,e,n,s){var i,o,a,u,d;return r(this,void 0,void 0,(function*(){try{let r={method:t,url:e,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};r=this.beforeRequest(r);const i=yield this.axios.request(r),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(oe.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,e)}))}head(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,e)}))}options(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,e)}))}delete(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("delete",t,e,n)}))}put(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("put",t,e,n)}))}post(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("post",t,e,n)}))}patch(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("patch",t,e,n)}))}}t("Transport",ae);class ue{constructor(t){this.transport=t}request(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:e})}))}reset(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:e})}))}}class de extends e{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ue(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>r(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return r(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var e;return r(this,void 0,void 0,(function*(){const r=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(r.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:r.data.access_token,refresh_token:null===(e=r.data)||void 0===e?void 0:e.refresh_token,expires:r.data.expires}}))}static(t){return r(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return r(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}t("Auth",de);class ce{constructor(t){this.transport=t}request(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:e,variables:void 0===n?{}:n})}))}items(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,e)}))}system(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,e)}))}}t("Directus",class{constructor(t,r){var n,s,i,o,a,u,d,c,h;if(this._url=t,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof k)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n= | ||
/*! ***************************************************************************** | ||
@@ -16,3 +16,3 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new j(n):this._storage=new T(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof S?this._transport=this._options.transport:this._transport=new ae({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}}),(null===(u=this._options)||void 0===u?void 0:u.auth)&&(null===(d=this._options)||void 0===d?void 0:d.auth)instanceof e?this._auth=this._options.auth:this._auth=new de(Object.assign({transport:this._transport,storage:this._storage},null===(c=this._options)||void 0===c?void 0:c.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new i(this.transport))}get collections(){return this._collections||(this._collections=new o(this.transport))}get fields(){return this._fields||(this._fields=new a(this.transport))}get files(){return this._files||(this._files=new u(this.transport))}get folders(){return this._folders||(this._folders=new d(this.transport))}get permissions(){return this._permissions||(this._permissions=new c(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new l(this.transport))}get revisions(){return this._revisions||(this._revisions=new p(this.transport))}get roles(){return this._roles||(this._roles=new f(this.transport))}get users(){return this._users||(this._users=new b(this.transport))}get settings(){return this._settings||(this._settings=new g(this.transport))}get server(){return this._server||(this._server=new v(this.transport))}get utils(){return this._utils||(this._utils=new x(this.transport))}get graphql(){return this._graphql||(this._graphql=new ce(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new m(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new n(t,this.transport))}})}}})); | ||
function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new j(n):this._storage=new T(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof S?this._transport=this._options.transport:this._transport=new ae(Object.assign({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}},null===(u=this._options)||void 0===u?void 0:u.transport)),(null===(d=this._options)||void 0===d?void 0:d.auth)&&(null===(c=this._options)||void 0===c?void 0:c.auth)instanceof e?this._auth=this._options.auth:this._auth=new de(Object.assign({transport:this._transport,storage:this._storage},null===(h=this._options)||void 0===h?void 0:h.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new i(this.transport))}get collections(){return this._collections||(this._collections=new o(this.transport))}get fields(){return this._fields||(this._fields=new a(this.transport))}get files(){return this._files||(this._files=new u(this.transport))}get folders(){return this._folders||(this._folders=new d(this.transport))}get permissions(){return this._permissions||(this._permissions=new c(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new l(this.transport))}get revisions(){return this._revisions||(this._revisions=new p(this.transport))}get roles(){return this._roles||(this._roles=new f(this.transport))}get users(){return this._users||(this._users=new b(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new v(this.transport))}get utils(){return this._utils||(this._utils=new x(this.transport))}get graphql(){return this._graphql||(this._graphql=new ce(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new g(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new n(t,this.transport))}})}}})); | ||
//# sourceMappingURL=sdk.system.min.js.map |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Directus={})}(this,(function(t){"use strict";class e{constructor(){this.mode="undefined"==typeof window?"json":"cookie"}} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function r(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class n{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:e})).data}))}readMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:e})).data}))}createMany(t,e){return r(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:e})}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,e,{params:n})).data}))}updateMany(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:e},{params:n})}))}updateByQuery(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:e},{params:n})}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class s{constructor(t){this.transport=t}create(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:e})).data}))}delete(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class i extends n{constructor(t){super("directus_activity",t),this._comments=new s(this.transport)}get comments(){return this._comments}}class o{constructor(t){this.transport=t}readOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,e,{params:n})).data}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class a{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,e)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${e}`,n)).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${e}`)}))}}class u extends n{constructor(t){super("directus_files",t)}}class d extends n{constructor(t){super("directus_folders",t)}}class c extends n{constructor(t){super("directus_permissions",t)}}class h extends n{constructor(t){super("directus_presets",t)}}class l{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${e}`,{params:n})).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${e}`)}))}}class p extends n{constructor(t){super("directus_revisions",t)}}class f extends n{constructor(t){super("directus_roles",t)}}class v{constructor(t){this.transport=t}ping(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class m{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:e})).data}))}}class g extends m{constructor(t){super("directus_settings",t)}}class y{constructor(t){this.transport=t}send(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:e,invite_url:n})}))}accept(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:e})}))}}class _{constructor(t){this.transport=t}generate(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:e})}))}disable(t){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class w{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new _(this._transport))}read(t){return r(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:e})).data}))}}class b extends n{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new y(this.transport))}get me(){return this._me||(this._me=new w(this.transport))}}class x{constructor(t){this.random={string:(t=32)=>r(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,e)=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:e})).data}))},this.transport=t}sort(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:e,to:n})}))}revert(t){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var O;t.Meta=void 0,(O=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",O.FILTER_COUNT="filter_count";class k{}class S{}class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}class R extends k{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class j extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class T extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var A={exports:{}},U=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},$=U,q=Object.prototype.toString;function C(t){return"[object Array]"===q.call(t)}function P(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function B(t){if("[object Object]"!==q.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function L(t){return"[object Function]"===q.call(t)}function I(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),C(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var H={isArray:C,isArrayBuffer:function(t){return"[object ArrayBuffer]"===q.call(t)},isBuffer:function(t){return null!==t&&!P(t)&&null!==t.constructor&&!P(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:B,isUndefined:P,isDate:function(t){return"[object Date]"===q.call(t)},isFile:function(t){return"[object File]"===q.call(t)},isBlob:function(t){return"[object Blob]"===q.call(t)},isFunction:L,isStream:function(t){return N(t)&&L(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:I,merge:function t(){var e={};function r(r,n){B(e[n])&&B(r)?e[n]=t(e[n],r):B(r)?e[n]=t({},r):C(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)I(arguments[n],r);return e},extend:function(t,e,r){return I(e,(function(e,n){t[n]=r&&"function"==typeof e?$(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},M=H;function D(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var F=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(M.isURLSearchParams(e))n=e.toString();else{var s=[];M.forEach(e,(function(t,e){null!=t&&(M.isArray(t)?e+="[]":t=[t],M.forEach(t,(function(t){M.isDate(t)?t=t.toISOString():M.isObject(t)&&(t=JSON.stringify(t)),s.push(D(e)+"="+D(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},J=H;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){J.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var W=z,V=H,X=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},K=X,G=function(t,e,r,n,s){var i=new Error(t);return K(i,e,r,n,s)},Q=G,Y=H,Z=Y.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},tt=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},et=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},rt=H,nt=["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"],st=H,it=st.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=st.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function ot(t){this.message=t}ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ot.prototype.__CANCEL__=!0;var at=ot,ut=H,dt=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Q("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ct=Z,ht=F,lt=function(t,e){return t&&!tt(e)?et(t,e):e},pt=function(t){var e,r,n,s={};return t?(rt.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=rt.trim(t.substr(0,n)).toLowerCase(),r=rt.trim(t.substr(n+1)),e){if(s[e]&&nt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ft=it,vt=G,mt=Et,gt=at,yt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}ut.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=lt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};dt((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ht(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(vt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(vt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||mt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(vt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ft(h))&&t.xsrfCookieName?ct.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new gt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},_t=H,wt=function(t,e){V.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},bt=X,xt={"Content-Type":"application/x-www-form-urlencoded"};function Ot(t,e){!_t.isUndefined(t)&&_t.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var kt,St={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kt=yt),kt),transformRequest:[function(t,e){return wt(e,"Accept"),wt(e,"Content-Type"),_t.isFormData(t)||_t.isArrayBuffer(t)||_t.isBuffer(t)||_t.isStream(t)||_t.isFile(t)||_t.isBlob(t)?t:_t.isArrayBufferView(t)?t.buffer:_t.isURLSearchParams(t)?(Ot(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_t.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ot(e,"application/json"),function(t,e,r){if(_t.isString(t))try{return(e||JSON.parse)(t),_t.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||St.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&_t.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw bt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_t.forEach(["delete","get","head"],(function(t){St.headers[t]={}})),_t.forEach(["post","put","patch"],(function(t){St.headers[t]=_t.merge(xt)}));var Et=St,Rt=H,jt=Et,Tt=function(t){return!(!t||!t.__CANCEL__)},At=H,Ut=function(t,e,r){var n=this||jt;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},$t=Tt,qt=Et,Ct=at;function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ct("canceled")}var Nt=H,Bt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Lt="0.24.0",It=Lt,Ht={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ht[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Mt={};Ht.transitional=function(t,e,r){function n(t,e){return"[Axios v"+It+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Mt[s]&&(Mt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Dt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Ht},Ft=H,Jt=F,zt=W,Wt=function(t){return Pt(t),t.headers=t.headers||{},t.data=Ut.call(t,t.data,t.headers,t.transformRequest),t.headers=At.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),At.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||qt.adapter)(t).then((function(e){return Pt(t),e.data=Ut.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return $t(e)||(Pt(t),e&&e.response&&(e.response.data=Ut.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Vt=Bt,Xt=Dt,Kt=Xt.validators;function Gt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Gt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Vt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Xt.assertOptions(e,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Wt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Wt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Gt.prototype.getUri=function(t){return t=Vt(this.defaults,t),Jt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Ft.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){Gt.prototype[t]=function(e,r,n){return this.request(Vt(n||{},{method:t,url:e,data:r}))}}));var Qt=Gt,Yt=at;function Zt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Yt(t),e(r.reason))}))}Zt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Zt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Zt.source=function(){var t;return{token:new Zt((function(e){t=e})),cancel:t}};var te=Zt,ee=H,re=U,ne=Qt,se=Bt;var ie=function t(e){var r=new ne(e),n=re(ne.prototype.request,r);return ee.extend(n,ne.prototype,r),ee.extend(n,r),n.create=function(r){return t(se(e,r))},n}(Et);ie.Axios=ne,ie.Cancel=at,ie.CancelToken=te,ie.isCancel=Tt,ie.VERSION=Lt,ie.all=function(t){return Promise.all(t)},ie.spread=function(t){return function(e){return t.apply(null,e)}},ie.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},A.exports=ie,A.exports.default=ie;var oe=A.exports;class ae extends S{constructor(t){var e;super(),this.config=t,this.axios=oe.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,e,n,s){var i,o,a,u,d;return r(this,void 0,void 0,(function*(){try{let r={method:t,url:e,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};r=this.beforeRequest(r);const i=yield this.axios.request(r),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(oe.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,e)}))}head(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,e)}))}options(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,e)}))}delete(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("delete",t,e,n)}))}put(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("put",t,e,n)}))}post(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("post",t,e,n)}))}patch(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("patch",t,e,n)}))}}class ue{constructor(t){this.transport=t}request(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:e})}))}reset(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:e})}))}}class de extends e{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ue(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>r(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return r(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var e;return r(this,void 0,void 0,(function*(){const r=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(r.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:r.data.access_token,refresh_token:null===(e=r.data)||void 0===e?void 0:e.refresh_token,expires:r.data.expires}}))}static(t){return r(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return r(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}class ce{constructor(t){this.transport=t}request(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:e,variables:void 0===n?{}:n})}))}items(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,e)}))}system(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,e)}))}}t.ActivityHandler=i,t.Auth=de,t.BaseStorage=R,t.CollectionsHandler=o,t.CommentsHandler=s,t.Directus=class{constructor(t,r){var n,s,i,o,a,u,d,c;if(this._url=t,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof k)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new j(n):this._storage=new T(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof S?this._transport=this._options.transport:this._transport=new ae({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}}),(null===(u=this._options)||void 0===u?void 0:u.auth)&&(null===(d=this._options)||void 0===d?void 0:d.auth)instanceof e?this._auth=this._options.auth:this._auth=new de(Object.assign({transport:this._transport,storage:this._storage},null===(c=this._options)||void 0===c?void 0:c.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new i(this.transport))}get collections(){return this._collections||(this._collections=new o(this.transport))}get fields(){return this._fields||(this._fields=new a(this.transport))}get files(){return this._files||(this._files=new u(this.transport))}get folders(){return this._folders||(this._folders=new d(this.transport))}get permissions(){return this._permissions||(this._permissions=new c(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new l(this.transport))}get revisions(){return this._revisions||(this._revisions=new p(this.transport))}get roles(){return this._roles||(this._roles=new f(this.transport))}get users(){return this._users||(this._users=new b(this.transport))}get settings(){return this._settings||(this._settings=new g(this.transport))}get server(){return this._server||(this._server=new v(this.transport))}get utils(){return this._utils||(this._utils=new x(this.transport))}get graphql(){return this._graphql||(this._graphql=new ce(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new m(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new n(t,this.transport))}},t.FieldsHandler=a,t.FilesHandler=u,t.FoldersHandler=d,t.IAuth=e,t.IStorage=k,t.ITransport=S,t.ItemsHandler=n,t.LocalStorage=T,t.MemoryStorage=j,t.PermissionsHandler=c,t.PresetsHandler=h,t.RelationsHandler=l,t.RevisionsHandler=p,t.RolesHandler=f,t.ServerHandler=v,t.SettingsHandler=g,t.Transport=ae,t.TransportError=E,t.UsersHandler=b,t.UtilsHandler=x,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */function r(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class n{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:e})).data}))}readMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:e})).data}))}createMany(t,e){return r(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:e})}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,e,{params:n})).data}))}updateMany(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:e},{params:n})}))}updateByQuery(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:e},{params:n})}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class s{constructor(t){this.transport=t}create(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:e})).data}))}delete(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class i extends n{constructor(t){super("directus_activity",t),this._comments=new s(this.transport)}get comments(){return this._comments}}class o{constructor(t){this.transport=t}readOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return r(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,e,{params:n})).data}))}deleteOne(t){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class a{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,e)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${e}`,n)).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${e}`)}))}}class u extends n{constructor(t){super("directus_files",t)}}class d extends n{constructor(t){super("directus_folders",t)}}class c extends n{constructor(t){super("directus_permissions",t)}}class h extends n{constructor(t){super("directus_presets",t)}}class l{constructor(t){this.transport=t}readOne(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${e}`)).data}))}readMany(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,e,n){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${e}`,{params:n})).data}))}deleteOne(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${e}`)}))}}class p extends n{constructor(t){super("directus_revisions",t)}}class f extends n{constructor(t){super("directus_roles",t)}}class v{constructor(t){this.transport=t}ping(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return r(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class g{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:e})).data}))}}class m extends g{constructor(t){super("directus_settings",t)}}class y{constructor(t){this.transport=t}send(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:e,invite_url:n})}))}accept(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:e})}))}}class _{constructor(t){this.transport=t}generate(t){return r(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:e})}))}disable(t){return r(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class w{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new _(this._transport))}read(t){return r(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,e){return r(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:e})).data}))}}class b extends n{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new y(this.transport))}get me(){return this._me||(this._me=new w(this.transport))}}class x{constructor(t){this.random={string:(t=32)=>r(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,e)=>r(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:e})).data}))},this.transport=t}sort(t,e,n){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:e,to:n})}))}revert(t){return r(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var O;t.Meta=void 0,(O=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",O.FILTER_COUNT="filter_count";class k{}class S{}class E extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,E.prototype)}}class R extends k{constructor(t){var e;super(),this.prefix=null!==(e=null==t?void 0:t.prefix)&&void 0!==e?e:""}get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class j extends R{constructor(){super(...arguments),this.values={}}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class T extends R{get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var A={exports:{}},U=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},$=U,q=Object.prototype.toString;function C(t){return"[object Array]"===q.call(t)}function P(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function B(t){if("[object Object]"!==q.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function L(t){return"[object Function]"===q.call(t)}function I(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),C(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var H={isArray:C,isArrayBuffer:function(t){return"[object ArrayBuffer]"===q.call(t)},isBuffer:function(t){return null!==t&&!P(t)&&null!==t.constructor&&!P(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:N,isPlainObject:B,isUndefined:P,isDate:function(t){return"[object Date]"===q.call(t)},isFile:function(t){return"[object File]"===q.call(t)},isBlob:function(t){return"[object Blob]"===q.call(t)},isFunction:L,isStream:function(t){return N(t)&&L(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:I,merge:function t(){var e={};function r(r,n){B(e[n])&&B(r)?e[n]=t(e[n],r):B(r)?e[n]=t({},r):C(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)I(arguments[n],r);return e},extend:function(t,e,r){return I(e,(function(e,n){t[n]=r&&"function"==typeof e?$(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},M=H;function D(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var F=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(M.isURLSearchParams(e))n=e.toString();else{var s=[];M.forEach(e,(function(t,e){null!=t&&(M.isArray(t)?e+="[]":t=[t],M.forEach(t,(function(t){M.isDate(t)?t=t.toISOString():M.isObject(t)&&(t=JSON.stringify(t)),s.push(D(e)+"="+D(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},J=H;function z(){this.handlers=[]}z.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},z.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},z.prototype.forEach=function(t){J.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var W=z,V=H,X=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},K=X,G=function(t,e,r,n,s){var i=new Error(t);return K(i,e,r,n,s)},Q=G,Y=H,Z=Y.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},tt=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},et=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},rt=H,nt=["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"],st=H,it=st.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=st.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function ot(t){this.message=t}ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ot.prototype.__CANCEL__=!0;var at=ot,ut=H,dt=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(Q("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ct=Z,ht=F,lt=function(t,e){return t&&!tt(e)?et(t,e):e},pt=function(t){var e,r,n,s={};return t?(rt.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=rt.trim(t.substr(0,n)).toLowerCase(),r=rt.trim(t.substr(n+1)),e){if(s[e]&&nt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ft=it,vt=G,gt=Et,mt=at,yt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}ut.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+c)}var h=lt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};dt((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ht(h,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(vt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(vt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||gt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(vt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ft(h))&&t.xsrfCookieName?ct.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new mt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},_t=H,wt=function(t,e){V.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},bt=X,xt={"Content-Type":"application/x-www-form-urlencoded"};function Ot(t,e){!_t.isUndefined(t)&&_t.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var kt,St={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kt=yt),kt),transformRequest:[function(t,e){return wt(e,"Accept"),wt(e,"Content-Type"),_t.isFormData(t)||_t.isArrayBuffer(t)||_t.isBuffer(t)||_t.isStream(t)||_t.isFile(t)||_t.isBlob(t)?t:_t.isArrayBufferView(t)?t.buffer:_t.isURLSearchParams(t)?(Ot(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_t.isObject(t)||e&&"application/json"===e["Content-Type"]?(Ot(e,"application/json"),function(t,e,r){if(_t.isString(t))try{return(e||JSON.parse)(t),_t.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||St.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&_t.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw bt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_t.forEach(["delete","get","head"],(function(t){St.headers[t]={}})),_t.forEach(["post","put","patch"],(function(t){St.headers[t]=_t.merge(xt)}));var Et=St,Rt=H,jt=Et,Tt=function(t){return!(!t||!t.__CANCEL__)},At=H,Ut=function(t,e,r){var n=this||jt;return Rt.forEach(r,(function(r){t=r.call(n,t,e)})),t},$t=Tt,qt=Et,Ct=at;function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ct("canceled")}var Nt=H,Bt=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},Lt="0.24.0",It=Lt,Ht={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ht[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Mt={};Ht.transitional=function(t,e,r){function n(t,e){return"[Axios v"+It+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Mt[s]&&(Mt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Dt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Ht},Ft=H,Jt=F,zt=W,Wt=function(t){return Pt(t),t.headers=t.headers||{},t.data=Ut.call(t,t.data,t.headers,t.transformRequest),t.headers=At.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),At.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||qt.adapter)(t).then((function(e){return Pt(t),e.data=Ut.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return $t(e)||(Pt(t),e&&e.response&&(e.response.data=Ut.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Vt=Bt,Xt=Dt,Kt=Xt.validators;function Gt(t){this.defaults=t,this.interceptors={request:new zt,response:new zt}}Gt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Vt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Xt.assertOptions(e,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Wt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Wt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Gt.prototype.getUri=function(t){return t=Vt(this.defaults,t),Jt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Ft.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){Gt.prototype[t]=function(e,r,n){return this.request(Vt(n||{},{method:t,url:e,data:r}))}}));var Qt=Gt,Yt=at;function Zt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Yt(t),e(r.reason))}))}Zt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Zt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Zt.source=function(){var t;return{token:new Zt((function(e){t=e})),cancel:t}};var te=Zt,ee=H,re=U,ne=Qt,se=Bt;var ie=function t(e){var r=new ne(e),n=re(ne.prototype.request,r);return ee.extend(n,ne.prototype,r),ee.extend(n,r),n.create=function(r){return t(se(e,r))},n}(Et);ie.Axios=ne,ie.Cancel=at,ie.CancelToken=te,ie.isCancel=Tt,ie.VERSION=Lt,ie.all=function(t){return Promise.all(t)},ie.spread=function(t){return function(e){return t.apply(null,e)}},ie.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},A.exports=ie,A.exports.default=ie;var oe=A.exports;class ae extends S{constructor(t){var e;super(),this.config=t,this.axios=oe.create({baseURL:this.config.url,params:this.config.params,headers:this.config.headers,onUploadProgress:this.config.onUploadProgress,withCredentials:!0}),(null===(e=this.config)||void 0===e?void 0:e.beforeRequest)&&(this.beforeRequest=this.config.beforeRequest)}beforeRequest(t){return t}get url(){return this.config.url}request(t,e,n,s){var i,o,a,u,d;return r(this,void 0,void 0,(function*(){try{let r={method:t,url:e,data:n,params:null==s?void 0:s.params,headers:null==s?void 0:s.headers,onUploadProgress:null==s?void 0:s.onUploadProgress};r=this.beforeRequest(r);const i=yield this.axios.request(r),o={raw:i.data,status:i.status,statusText:i.statusText,headers:i.headers,data:i.data.data,meta:i.data.meta,errors:i.data.errors};if(i.data.errors)throw new E(null,o);return o}catch(t){if(!t||t instanceof Error==!1)throw t;if(oe.isAxiosError(t)){const e=null===(i=t.response)||void 0===i?void 0:i.data;throw new E(t,{raw:null===(o=t.response)||void 0===o?void 0:o.data,status:null===(a=t.response)||void 0===a?void 0:a.status,statusText:null===(u=t.response)||void 0===u?void 0:u.statusText,headers:null===(d=t.response)||void 0===d?void 0:d.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new E(t)}}))}get(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,e)}))}head(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,e)}))}options(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,e)}))}delete(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("delete",t,e,n)}))}put(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("put",t,e,n)}))}post(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("post",t,e,n)}))}patch(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.request("patch",t,e,n)}))}}class ue{constructor(t){this.transport=t}request(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:e})}))}reset(t,e){return r(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:e})}))}}class de extends e{constructor(t){var e,r,n;super(),this.autoRefresh=!0,this.msRefreshBeforeExpires=3e4,this.staticToken="",this._transport=t.transport,this._storage=t.storage,this.autoRefresh=null!==(e=null==t?void 0:t.autoRefresh)&&void 0!==e?e:this.autoRefresh,this.mode=null!==(r=null==t?void 0:t.mode)&&void 0!==r?r:this.mode,this.msRefreshBeforeExpires=null!==(n=null==t?void 0:t.msRefreshBeforeExpires)&&void 0!==n?n:this.msRefreshBeforeExpires,(null==t?void 0:t.staticToken)&&(this.staticToken=null==t?void 0:t.staticToken,this.updateStorage({access_token:this.staticToken,expires:null,refresh_token:null})),this.timer=!1}get storage(){return this._storage}get transport(){return this._transport}get token(){return this._storage.auth_token}get password(){return this.passwords=this.passwords||new ue(this._transport)}updateStorage(t){var e,r;this._storage.auth_token=t.access_token,this._storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,this._storage.auth_expires=null!==(r=t.expires)&&void 0!==r?r:null}autoRefreshJob(){if(!this.autoRefresh)return;if(!this._storage.auth_expires)return;const t=this._storage.auth_expires-this.msRefreshBeforeExpires;this.timer=setTimeout((()=>r(this,void 0,void 0,(function*(){yield this.refresh().catch((()=>{})),this.autoRefreshJob()}))),t)}refresh(){var t;return r(this,void 0,void 0,(function*(){const e=yield this._transport.post("/auth/refresh",{refresh_token:"json"===this.mode?this._storage.auth_refresh_token:void 0});return this.updateStorage(e.data),{access_token:e.data.access_token,refresh_token:null===(t=e.data)||void 0===t?void 0:t.refresh_token,expires:e.data.expires}}))}login(t){var e;return r(this,void 0,void 0,(function*(){const r=yield this._transport.post("/auth/login",Object.assign({mode:this.mode},t),{headers:{Authorization:null}});return this.updateStorage(r.data),this.autoRefresh&&this.autoRefreshJob(),{access_token:r.data.access_token,refresh_token:null===(e=r.data)||void 0===e?void 0:e.refresh_token,expires:r.data.expires}}))}static(t){return r(this,void 0,void 0,(function*(){return yield this._transport.get("/users/me",{params:{access_token:t},headers:{Authorization:null}}),this.updateStorage({access_token:t,expires:null,refresh_token:null}),!0}))}logout(){return r(this,void 0,void 0,(function*(){let t;"json"===this.mode&&(t=this._storage.auth_refresh_token||void 0),yield this._transport.post("/auth/logout",{refresh_token:t}),this.updateStorage({access_token:null,expires:null,refresh_token:null}),clearTimeout(this.timer)}))}}class ce{constructor(t){this.transport=t}request(t,e,n){return r(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:e,variables:void 0===n?{}:n})}))}items(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,e)}))}system(t,e){return r(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,e)}))}}t.ActivityHandler=i,t.Auth=de,t.BaseStorage=R,t.CollectionsHandler=o,t.CommentsHandler=s,t.Directus=class{constructor(t,r){var n,s,i,o,a,u,d,c,h;if(this._url=t,this._options=r,this._items={},this._singletons={},(null===(n=this._options)||void 0===n?void 0:n.storage)&&(null===(s=this._options)||void 0===s?void 0:s.storage)instanceof k)this._storage=this._options.storage;else{const t=null===(i=this._options)||void 0===i?void 0:i.storage,e=null!=t?t:{},{mode:r}=e,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(e,["mode"]);"MemoryStorage"===r||"undefined"==typeof window?this._storage=new j(n):this._storage=new T(n)}(null===(o=this._options)||void 0===o?void 0:o.transport)&&(null===(a=this._options)||void 0===a?void 0:a.transport)instanceof S?this._transport=this._options.transport:this._transport=new ae(Object.assign({url:this.url,beforeRequest:t=>{const e=this.storage.auth_token,r=e?e.startsWith("Bearer ")?String(this.storage.auth_token):`Bearer ${this.storage.auth_token}`:"";return Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:r},t.headers)})}},null===(u=this._options)||void 0===u?void 0:u.transport)),(null===(d=this._options)||void 0===d?void 0:d.auth)&&(null===(c=this._options)||void 0===c?void 0:c.auth)instanceof e?this._auth=this._options.auth:this._auth=new de(Object.assign({transport:this._transport,storage:this._storage},null===(h=this._options)||void 0===h?void 0:h.auth))}get url(){return this._url}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new i(this.transport))}get collections(){return this._collections||(this._collections=new o(this.transport))}get fields(){return this._fields||(this._fields=new a(this.transport))}get files(){return this._files||(this._files=new u(this.transport))}get folders(){return this._folders||(this._folders=new d(this.transport))}get permissions(){return this._permissions||(this._permissions=new c(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new l(this.transport))}get revisions(){return this._revisions||(this._revisions=new p(this.transport))}get roles(){return this._roles||(this._roles=new f(this.transport))}get users(){return this._users||(this._users=new b(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new v(this.transport))}get utils(){return this._utils||(this._utils=new x(this.transport))}get graphql(){return this._graphql||(this._graphql=new ce(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new g(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new n(t,this.transport))}},t.FieldsHandler=a,t.FilesHandler=u,t.FoldersHandler=d,t.IAuth=e,t.IStorage=k,t.ITransport=S,t.ItemsHandler=n,t.LocalStorage=T,t.MemoryStorage=j,t.PermissionsHandler=c,t.PresetsHandler=h,t.RelationsHandler=l,t.RevisionsHandler=p,t.RolesHandler=f,t.ServerHandler=v,t.SettingsHandler=m,t.Transport=ae,t.TransportError=E,t.UsersHandler=b,t.UtilsHandler=x,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=sdk.umd.min.js.map |
{ | ||
"name": "@directus/sdk", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"description": "The official Directus SDK for use in JavaScript!", | ||
@@ -24,3 +24,4 @@ "repository": { | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"index.mjs" | ||
], | ||
@@ -65,3 +66,3 @@ "scripts": { | ||
"jest-environment-jsdom": "27.3.1", | ||
"nock": "13.1.4", | ||
"nock": "13.2.0", | ||
"npm-run-all": "4.1.5", | ||
@@ -78,3 +79,3 @@ "rimraf": "3.0.2", | ||
}, | ||
"gitHead": "c95add08ef1386cab6e54546f03d541d889148ed" | ||
"gitHead": "ba72d2cfd040f7f0db282ccac006f36df6f05058" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1456411
140
12832