UNPKG

react-xapi-wrapper

Version:

`react-xapi-wrapper` is a library for automating the process of creating and sending xAPI statements within React environments.

1 lines 52.8 kB
"use strict";var e=require("react/jsx-runtime"),t=require("react");function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;let r=function(e){return e.SIGNATURE="http://adlnet.gov/expapi/attachments/signature",e.CERTIFICATE_OF_COMPLETION="http://id.tincanapi.com/attachment/certificate-of-completion",e.CONTRACT="http://id.tincanapi.com/attachment/contract",e.SUPPORTING_MEDIA="http://id.tincanapi.com/attachment/supporting_media",e}({}),o=function(e){return e.ABOUT="about",e.AGENTS="agents",e.ACTIVITIES="activities",e.ACTIVITY_PROFILE="activities/profile",e.STATE="activities/state",e.AGENT_PROFILE="agents/profile",e.STATEMENT="statements",e}({});class s{static INITIALIZED={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}};static TERMINATED={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}};static SUSPENDED={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}};static RESUMED={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}};static PASSED={id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}};static FAILED={id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}};static SCORED={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}};static COMPLETED={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}};static RESPONDED={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}};static COMMENTED={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}};static VOIDED={id:"http://adlnet.gov/expapi/verbs/voided",display:{"en-US":"voided"}};static PROGRESSED={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}};static ANSWERED={id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}}}const i="\r\n";function a(e,t){const n=[],r=(Math.random()+" ").substring(2,10)+(Math.random()+" ").substring(2,10),o={"Content-Type":`multipart/mixed; boundary=${r}`};n.push(function(e,t){return[`--${t}`,"Content-Type: application/json",'Content-Disposition: form-data; name="statement"',"",JSON.stringify(e)].join(i)+i}(e,r));const s=Array.isArray(e)?e.reduce(((e,t)=>e.concat(t.attachments)),[]):e.attachments;return t.forEach(((e,t)=>{const o=s[t];n.push(function(e,t){return[`--${t}`,`Content-Type: ${e.contentType}`,"Content-Transfer-Encoding: binary",`X-Experience-API-Hash: ${e.sha2}`].join(i)+i+i}(o,r)),n.push(e)})),n.push(`${i}--${r}--${i}`),{header:o,blob:new Blob(n)}}function c(e){const t={};if(-1===e.indexOf("?"))return t;let n=e.substring(e.indexOf("?"));return n=n.split("#").shift(),new URLSearchParams(n).forEach(((e,n)=>{try{t[n]=JSON.parse(e)}catch{t[n]=e}var r;"actor"===n&&"object"==typeof t.actor&&(t.actor=(r=t.actor,["name","mbox","account"].forEach((e=>{Array.isArray(r[e])&&(r[e]="account"===e?{...!!r.account[0].accountServiceHomePage&&{homePage:r.account[0].accountServiceHomePage},...!!r.account[0].accountName&&{name:r.account[0].accountName}}:r[e][0])})),r))})),t}const u=36e5,l=864e5;function d(e,t){const n=t.getTime()-e.getTime();if(n<=0)return"PT0S";const r=Math.floor(n/l),o=n%l,s=Math.floor(o/u),i=o%u,a=Math.floor(i/6e4),c=i%6e4/1e3;return`P${r?r+"D":""}T${s?s+"H":""}${a?a+"M":""}${c?c+"S":""}`}function p(e,t){return function(){return e.apply(t,arguments)}}const{toString:f}=Object.prototype,{getPrototypeOf:h}=Object,m=(g=Object.create(null),e=>{const t=f.call(e);return g[t]||(g[t]=t.slice(8,-1).toLowerCase())});var g;const y=e=>(e=e.toLowerCase(),t=>m(t)===e),b=e=>t=>typeof t===e,{isArray:E}=Array,w=b("undefined"),S=y("ArrayBuffer"),v=b("string"),T=b("function"),O=b("number"),R=e=>null!==e&&"object"==typeof e,A=e=>{if("object"!==m(e))return!1;const t=h(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},P=y("Date"),C=y("File"),I=y("Blob"),x=y("FileList"),N=y("URLSearchParams"),[j,q,L,D]=["ReadableStream","Request","Response","Headers"].map(y);function U(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),E(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function B(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,F=e=>!w(e)&&e!==_,k=(M="undefined"!=typeof Uint8Array&&h(Uint8Array),e=>M&&e instanceof M);var M;const $=y("HTMLFormElement"),H=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),V=y("RegExp"),z=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};U(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},J="abcdefghijklmnopqrstuvwxyz",G="0123456789",W={DIGIT:G,ALPHA:J,ALPHA_DIGIT:J+J.toUpperCase()+G},K=y("AsyncFunction"),X=(Y="function"==typeof setImmediate,Q=T(_.postMessage),Y?setImmediate:Q?(Z=`axios@${Math.random()}`,ee=[],_.addEventListener("message",(({source:e,data:t})=>{e===_&&t===Z&&ee.length&&ee.shift()()}),!1),e=>{ee.push(e),_.postMessage(Z,"*")}):e=>setTimeout(e));var Y,Q,Z,ee;const te="undefined"!=typeof queueMicrotask?queueMicrotask.bind(_):"undefined"!=typeof process&&process.nextTick||X;var ne={isArray:E,isArrayBuffer:S,isBuffer:function(e){return null!==e&&!w(e)&&null!==e.constructor&&!w(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||T(e.append)&&("formdata"===(t=m(e))||"object"===t&&T(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&S(e.buffer),t},isString:v,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:R,isPlainObject:A,isReadableStream:j,isRequest:q,isResponse:L,isHeaders:D,isUndefined:w,isDate:P,isFile:C,isBlob:I,isRegExp:V,isFunction:T,isStream:e=>R(e)&&T(e.pipe),isURLSearchParams:N,isTypedArray:k,isFileList:x,forEach:U,merge:function e(){const{caseless:t}=F(this)&&this||{},n={},r=(r,o)=>{const s=t&&B(n,o)||o;A(n[s])&&A(r)?n[s]=e(n[s],r):A(r)?n[s]=e({},r):E(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&U(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(U(t,((t,r)=>{n&&T(t)?e[r]=p(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&h(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:m,kindOfTest:y,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(E(e))return e;let t=e.length;if(!O(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:$,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:z,freezeMethods:e=>{z(e,((t,n)=>{if(T(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];T(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return E(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:B,global:_,isContextDefined:F,ALPHABET:W,generateString:(e=16,t=W.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&T(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(R(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=E(e)?[]:{};return U(e,((e,t)=>{const s=n(e,r+1);!w(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:K,isThenable:e=>e&&(R(e)||T(e))&&T(e.then)&&T(e.catch),setImmediate:X,asap:te};function re(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}ne.inherits(re,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ne.toJSONObject(this.config),code:this.code,status:this.status}}});const oe=re.prototype,se={};function ie(e){return ne.isPlainObject(e)||ne.isArray(e)}function ae(e){return ne.endsWith(e,"[]")?e.slice(0,-2):e}function ce(e,t,n){return e?e.concat(t).map((function(e,t){return e=ae(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{se[e]={value:e}})),Object.defineProperties(re,se),Object.defineProperty(oe,"isAxiosError",{value:!0}),re.from=(e,t,n,r,o,s)=>{const i=Object.create(oe);return ne.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),re.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const ue=ne.toFlatObject(ne,{},null,(function(e){return/^is[A-Z]/.test(e)}));function le(e,t,n){if(!ne.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!ne.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ne.isSpecCompliantForm(t);if(!ne.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ne.isDate(e))return e.toISOString();if(!a&&ne.isBlob(e))throw new re("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(e)||ne.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(ne.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ne.isArray(e)&&function(e){return ne.isArray(e)&&!e.some(ie)}(e)||(ne.isFileList(e)||ne.endsWith(n,"[]"))&&(a=ne.toArray(e)))return n=ae(n),a.forEach((function(e,r){!ne.isUndefined(e)&&null!==e&&t.append(!0===i?ce([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!ie(e)||(t.append(ce(o,n,s),c(e)),!1)}const l=[],d=Object.assign(ue,{defaultVisitor:u,convertValue:c,isVisitable:ie});if(!ne.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!ne.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),ne.forEach(n,(function(n,s){!0===(!(ne.isUndefined(n)||null===n)&&o.call(t,n,ne.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function de(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function pe(e,t){this._pairs=[],e&&le(e,this,t)}const fe=pe.prototype;function he(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function me(e,t,n){if(!t)return e;const r=n&&n.encode||he,o=n&&n.serialize;let s;if(s=o?o(t,n):ne.isURLSearchParams(t)?t.toString():new pe(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}fe.append=function(e,t){this._pairs.push([e,t])},fe.toString=function(e){const t=e?function(t){return e.call(this,t,de)}:de;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class ge{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ne.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var ye={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},be={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:pe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ee="undefined"!=typeof window&&"undefined"!=typeof document,we="object"==typeof navigator&&navigator||void 0,Se=Ee&&(!we||["ReactNative","NativeScript","NS"].indexOf(we.product)<0),ve="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Te=Ee&&window.location.href||"http://localhost";var Oe={...Object.freeze({__proto__:null,hasBrowserEnv:Ee,hasStandardBrowserEnv:Se,hasStandardBrowserWebWorkerEnv:ve,navigator:we,origin:Te}),...be};function Re(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&ne.isArray(r)?r.length:s,a?(ne.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&ne.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&ne.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(ne.isFormData(e)&&ne.isFunction(e.entries)){const n={};return ne.forEachEntry(e,((e,r)=>{t(function(e){return ne.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const Ae={transitional:ye,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=ne.isObject(e);if(o&&ne.isHTMLForm(e)&&(e=new FormData(e)),ne.isFormData(e))return r?JSON.stringify(Re(e)):e;if(ne.isArrayBuffer(e)||ne.isBuffer(e)||ne.isStream(e)||ne.isFile(e)||ne.isBlob(e)||ne.isReadableStream(e))return e;if(ne.isArrayBufferView(e))return e.buffer;if(ne.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return le(e,new Oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Oe.isNode&&ne.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=ne.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return le(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(ne.isString(e))try{return(0,JSON.parse)(e),ne.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ae.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ne.isResponse(e)||ne.isReadableStream(e))return e;if(e&&ne.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw re.from(e,re.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Oe.classes.FormData,Blob:Oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],(e=>{Ae.headers[e]={}}));const Pe=ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ce=Symbol("internals");function Ie(e){return e&&String(e).trim().toLowerCase()}function xe(e){return!1===e||null==e?e:ne.isArray(e)?e.map(xe):String(e)}function Ne(e,t,n,r,o){return ne.isFunction(r)?r.call(this,t,n):(o&&(t=n),ne.isString(t)?ne.isString(r)?-1!==t.indexOf(r):ne.isRegExp(r)?r.test(t):void 0:void 0)}class je{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ie(t);if(!o)throw new Error("header name must be a non-empty string");const s=ne.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=xe(e))}const s=(e,t)=>ne.forEach(e,((e,n)=>o(e,n,t)));if(ne.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(ne.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Pe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(ne.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ie(e)){const n=ne.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(ne.isFunction(t))return t.call(this,e,n);if(ne.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ie(e)){const n=ne.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ne(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ie(e)){const o=ne.findKey(n,e);!o||t&&!Ne(0,n[o],o,t)||(delete n[o],r=!0)}}return ne.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ne(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return ne.forEach(this,((r,o)=>{const s=ne.findKey(n,o);if(s)return t[s]=xe(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=xe(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ne.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ne.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Ce]=this[Ce]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ie(e);t[r]||(function(e,t){const n=ne.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return ne.isArray(e)?e.forEach(r):r(e),this}}function qe(e,t){const n=this||Ae,r=t||n,o=je.from(r.headers);let s=r.data;return ne.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Le(e){return!(!e||!e.__CANCEL__)}function De(e,t,n){re.call(this,null==e?"canceled":e,re.ERR_CANCELED,t,n),this.name="CanceledError"}function Ue(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}je.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ne.reduceDescriptors(je.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),ne.freezeMethods(je),ne.inherits(De,re,{__CANCEL__:!0});const Be=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const p=u&&c-u;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s,e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},_e=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fe=e=>(...t)=>ne.asap((()=>e(...t)));var ke=Oe.hasStandardBrowserEnv?function(){const e=Oe.navigator&&/(msie|trident)/i.test(Oe.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=ne.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},Me=Oe.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];ne.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),ne.isString(r)&&i.push("path="+r),ne.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const He=e=>e instanceof je?{...e}:e;function Ve(e,t){t=t||{};const n={};function r(e,t,n){return ne.isPlainObject(e)&&ne.isPlainObject(t)?ne.merge.call({caseless:n},e,t):ne.isPlainObject(t)?ne.merge({},t):ne.isArray(t)?t.slice():t}function o(e,t,n){return ne.isUndefined(t)?ne.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!ne.isUndefined(t))return r(void 0,t)}function i(e,t){return ne.isUndefined(t)?ne.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(He(e),He(t),!0)};return ne.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);ne.isUndefined(i)&&s!==a||(n[r]=i)})),n}var ze=e=>{const t=Ve({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=je.from(a),t.url=me($e(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ne.isFormData(r))if(Oe.hasStandardBrowserEnv||Oe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Oe.hasStandardBrowserEnv&&(o&&ne.isFunction(o)&&(o=o(t)),o||!1!==o&&ke(t.url))){const e=s&&i&&Me.read(i);e&&a.set(s,e)}return t},Je="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=ze(e);let o=r.data;const s=je.from(r.headers).normalize();let i,a,c,u,l,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=je.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ue((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new re("Request aborted",re.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new re("Network Error",re.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ye;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new re(t,o.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&ne.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),ne.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),f&&([c,l]=Be(f,!0),m.addEventListener("progress",c)),p&&m.upload&&([a,u]=Be(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new De(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Oe.protocols.indexOf(y)?n(new re("Unsupported protocol "+y+":",re.ERR_BAD_REQUEST,e)):m.send(o||null)}))};const Ge=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof re?t:new De(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new re(`timeout ${t} of ms exceeded`,re.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>ne.asap(i),a}},We=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ke=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*We(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Xe="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ye=Xe&&"function"==typeof ReadableStream,Qe=Xe&&("function"==typeof TextEncoder?(Ze=new TextEncoder,e=>Ze.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Ze;const et=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},tt=Ye&&et((()=>{let e=!1;const t=new Request(Oe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),nt=Ye&&et((()=>ne.isReadableStream(new Response("").body))),rt={stream:nt&&(e=>e.body)};var ot;Xe&&(ot=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!rt[e]&&(rt[e]=ne.isFunction(ot[e])?t=>t[e]():(t,n)=>{throw new re(`Response type '${e}' is not supported`,re.ERR_NOT_SUPPORT,n)})})));const st={http:null,xhr:Je,fetch:Xe&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:p}=ze(e);u=u?(u+"").toLowerCase():"text";let f,h=Ge([o,s&&s.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(c&&tt&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=ne.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(ne.isBlob(e))return e.size;if(ne.isSpecCompliantForm(e)){const t=new Request(Oe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ne.isArrayBufferView(e)||ne.isArrayBuffer(e)?e.byteLength:(ne.isURLSearchParams(e)&&(e+=""),ne.isString(e)?(await Qe(e)).byteLength:void 0)})(t):n})(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(ne.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=_e(g,Be(Fe(c)));r=Ke(n.body,65536,e,t)}}ne.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let s=await fetch(f);const i=nt&&("stream"===u||"response"===u);if(nt&&(a||i&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=ne.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&_e(t,Be(Fe(a),!0))||[];s=new Response(Ke(s.body,65536,n,(()=>{r&&r(),m&&m()})),e)}u=u||"text";let y=await rt[ne.findKey(rt,u)||"text"](s,e);return!i&&m&&m(),await new Promise(((t,n)=>{Ue(t,n,{data:y,headers:je.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new re("Network Error",re.ERR_NETWORK,e,f),{cause:t.cause||t});throw re.from(t,t&&t.code,e,f)}})};ne.forEach(st,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const it=e=>`- ${e}`,at=e=>ne.isFunction(e)||null===e||!1===e;var ct=e=>{e=ne.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!at(n)&&(r=st[(t=String(n)).toLowerCase()],void 0===r))throw new re(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new re("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(it).join("\n"):" "+it(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new De(null,e)}function lt(e){return ut(e),e.headers=je.from(e.headers),e.data=qe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ct(e.adapter||Ae.adapter)(e).then((function(t){return ut(e),t.data=qe.call(e,e.transformResponse,t),t.headers=je.from(t.headers),t}),(function(t){return Le(t)||(ut(e),t&&t.response&&(t.response.data=qe.call(e,e.transformResponse,t.response),t.response.headers=je.from(t.response.headers))),Promise.reject(t)}))}const dt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{dt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const pt={};dt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new re(r(o," has been removed"+(t?" in "+t:"")),re.ERR_DEPRECATED);return t&&!pt[o]&&(pt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};var ft={assertOptions:function(e,t,n){if("object"!=typeof e)throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new re("option "+s+" must be "+n,re.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new re("Unknown option "+s,re.ERR_BAD_OPTION)}},validators:dt};const ht=ft.validators;class mt{constructor(e){this.defaults=e,this.interceptors={request:new ge,response:new ge}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ve(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ft.assertOptions(n,{silentJSONParsing:ht.transitional(ht.boolean),forcedJSONParsing:ht.transitional(ht.boolean),clarifyTimeoutError:ht.transitional(ht.boolean)},!1),null!=r&&(ne.isFunction(r)?t.paramsSerializer={serialize:r}:ft.assertOptions(r,{encode:ht.function,serialize:ht.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&ne.merge(o.common,o[t.method]);o&&ne.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=je.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[lt.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=i.length;let p=t;for(d=0;d<l;){const t=i[d++],n=i[d++];try{p=t(p)}catch(e){n.call(this,e);break}}try{u=lt.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return me($e((e=Ve(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}ne.forEach(["delete","get","head","options"],(function(e){mt.prototype[e]=function(t,n){return this.request(Ve(n||{},{method:e,url:t,data:(n||{}).data}))}})),ne.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Ve(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}mt.prototype[e]=t(),mt.prototype[e+"Form"]=t(!0)}));class gt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new De(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new gt((function(t){e=t})),cancel:e}}}const yt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yt).forEach((([e,t])=>{yt[t]=e}));const bt=function e(t){const n=new mt(t),r=p(mt.prototype.request,n);return ne.extend(r,mt.prototype,n,{allOwnKeys:!0}),ne.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ve(t,n))},r}(Ae);bt.Axios=mt,bt.CanceledError=De,bt.CancelToken=gt,bt.isCancel=Le,bt.VERSION="1.7.7",bt.toFormData=le,bt.AxiosError=re,bt.Cancel=bt.CanceledError,bt.all=function(e){return Promise.all(e)},bt.spread=function(e){return function(t){return e.apply(null,t)}},bt.isAxiosError=function(e){return ne.isObject(e)&&!0===e.isAxiosError},bt.mergeConfig=Ve,bt.AxiosHeaders=je,bt.formToJSON=e=>Re(ne.isHTMLForm(e)?new FormData(e):e),bt.getAdapter=ct,bt.HttpStatusCode=yt,bt.default=bt;const Et=({url:e,method:t,data:n,headers:r})=>bt.request({url:e,method:t,data:n,headers:r}).then((({data:e,headers:t,status:n})=>({data:e,headers:t,status:n}))),wt=async({url:e,method:t,data:n,headers:r})=>{let o=n;"application/json"===r["Content-Type"]&&(o=JSON.stringify(o));const s=await fetch(e,{method:t,body:o,headers:r});if(!s.ok){const e=await s.text();throw new Error(e)}let i=await s.text();try{i=JSON.parse(i)}catch{}return{data:i,headers:Object.fromEntries(s.headers.entries()),status:s.status}},St=e=>"function"==typeof e?e:"fetch"===e?wt:Et;function vt(e){if("undefined"==typeof location)return Promise.reject(new Error("Environment does not support location.search"));const t=c(location.search);if(!t.xAPILaunchService)return Promise.reject(new Error("xAPILaunchService parameter not found in URL."));const n=new URL(t.xAPILaunchService);return n.pathname+=`launch/${t.xAPILaunchKey}`,St(e.adapter)({method:"POST",url:n.toString()}).then((e=>e.data))}function Tt(){if("undefined"==typeof location)throw new Error("Environment does not support location.search");return c(location.search)}function Ot(e,t){const n=`${e}:${t}`;if("function"==typeof btoa)return`Basic ${btoa(n)}`;if("undefined"!=typeof Buffer)return`Basic ${Buffer.from(n,"binary").toString("base64")}`;throw new Error("Environment does not support base64 conversion.")}class Rt{static default=Rt;static AttachmentUsages=r;static Verbs=s;static calculateISO8601Duration=d;static getSearchQueryParamsAsObject=c;static getXAPILaunchData=vt;static getTinCanLaunchData=Tt;static toBasicAuth=Ot;constructor(e){const t=e.version||"1.0.3";var n;this.endpoint=(n=e.endpoint).endsWith("/")?n:`${n}/`,this.headers={"X-Experience-API-Version":t,"Content-Type":"application/json",Authorization:e.auth?e.auth:Ot("","")},this.adapter=St(e.adapter)}requestResource(e){var t;const n=Object.assign({},e.queryParams);null!==(t=e.requestOptions)&&void 0!==t&&t.useCacheBuster&&(n.cachebuster=(new Date).getTime().toString());const r=this.generateURL(e.resource,n);return this.requestURL(r,e.requestConfig)}requestURL(e,t){return this.adapter({url:e,method:(null==t?void 0:t.method)||"GET",headers:{...this.headers,...null==t?void 0:t.headers},data:null==t?void 0:t.data}).then((e=>{const t=e.headers["content-type"];return e.data&&t&&-1!==t.indexOf("multipart/mixed")&&(e.data=function(e){const t=e.trim().split(i)[0].trim(),n=e.split(t).map((e=>e.trim())).filter((e=>""!==e&&"--"!==e)),r=[];for(let e=0;e<n.length;e++){const t={},o=n[e].split(i);for(let e=0;e<o.length-2;e++){const n=o[e].split(":");t[n[0]]=n[1]}let s=o[o.length-1];t["Content-Type"].indexOf("application/json")>-1&&(s=JSON.parse(s)),r.push(s)}return r}(e.data)),e}))}generateURL(e,t){const n=Object.keys(t).map((e=>{let n="object"==typeof t[e]?JSON.stringify(t[e]):t[e];return n=encodeURIComponent(n),`${e}=${n}`})).join("&");return`${this.endpoint}${e}${n?"?"+n:""}`}}Rt.prototype.getAbout=function(e){return this.requestResource({resource:o.ABOUT,requestOptions:{useCacheBuster:null==e?void 0:e.useCacheBuster}})},Rt.prototype.getActivity=function(e){return this.requestResource({resource:o.ACTIVITIES,queryParams:{activityId:e.activityId},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.getAgent=function(e){return this.requestResource({resource:o.AGENTS,queryParams:{agent:e.agent},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.createActivityProfile=function(e){const t={};return e.etag&&(t[e.matchHeader]=e.etag),this.requestResource({resource:o.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestConfig:{method:"POST",data:e.profile,headers:t}})},Rt.prototype.setActivityProfile=function(e){const t={};return t[e.matchHeader]=e.etag,e.contentType&&(t["Content-Type"]=e.contentType),this.requestResource({resource:o.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestConfig:{method:"PUT",data:e.profile,headers:t}})},Rt.prototype.getActivityProfiles=function(e){return this.requestResource({resource:o.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,...!!e.since&&{since:e.since}},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.getActivityProfile=function(e){return this.requestResource({resource:o.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.deleteActivityProfile=function(e){const t={};return e.etag&&(t["If-Match"]=e.etag),this.requestResource({resource:o.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestConfig:{method:"DELETE",headers:t}})},Rt.prototype.createAgentProfile=function(e){const t={};return e.etag&&(t[e.matchHeader]=e.etag),this.requestResource({resource:o.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestConfig:{method:"POST",data:e.profile,headers:t}})},Rt.prototype.setAgentProfile=function(e){const t={};return t[e.matchHeader]=e.etag,e.contentType&&(t["Content-Type"]=e.contentType),this.requestResource({resource:o.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestConfig:{method:"PUT",data:e.profile,headers:t}})},Rt.prototype.getAgentProfiles=function(e){return this.requestResource({resource:o.AGENT_PROFILE,queryParams:{agent:e.agent,...!!e.since&&{since:e.since}},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.getAgentProfile=function(e){return this.requestResource({resource:o.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.deleteAgentProfile=function(e){const t={};return e.etag&&(t["If-Match"]=e.etag),this.requestResource({resource:o.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestConfig:{method:"DELETE",headers:t}})},Rt.prototype.createState=function(e){const t={};return e.etag&&e.matchHeader&&(t[e.matchHeader]=e.etag),this.requestResource({resource:o.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"POST",data:e.state,headers:t}})},Rt.prototype.setState=function(e){const t={};return e.etag&&e.matchHeader&&(t[e.matchHeader]=e.etag),e.contentType&&(t["Content-Type"]=e.contentType),this.requestResource({resource:o.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"PUT",data:e.state,headers:t}})},Rt.prototype.getStates=function(e){return this.requestResource({resource:o.STATE,queryParams:{agent:e.agent,activityId:e.activityId,...!!e.registration&&{registration:e.registration},...!!e.since&&{since:e.since}},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.getState=function(e){return this.requestResource({resource:o.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.deleteState=function(e){const t={};return e.etag&&(t["If-Match"]=e.etag),this.requestResource({resource:o.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"DELETE",headers:t}})},Rt.prototype.deleteStates=function(e){const t={};return e.etag&&(t["If-Match"]=e.etag),this.requestResource({resource:o.STATE,queryParams:{agent:e.agent,activityId:e.activityId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"DELETE",headers:t}})},Rt.prototype.getStatement=function(e){return this.requestResource({resource:o.STATEMENT,queryParams:{statementId:e.statementId,...!!e.attachments&&{attachments:e.attachments},...!!e.format&&{format:e.format}},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.getVoidedStatement=function(e){return this.requestResource({resource:o.STATEMENT,queryParams:{voidedStatementId:e.voidedStatementId,...!!e.attachments&&{attachments:e.attachments},...!!e.format&&{format:e.format}},requestOptions:{useCacheBuster:e.useCacheBuster}})},Rt.prototype.getStatements=function(e){return this.requestResource({resource:o.STATEMENT,queryParams:{...!(null==e||!e.activity)&&{activity:e.activity},...!(null==e||!e.agent)&&{agent:e.agent},...!(null==e||!e.ascending)&&{ascending:e.ascending},...!(null==e||!e.attachments)&&{attachments:e.attachments},...!(null==e||!e.format)&&{format:e.format},...!(null==e||!e.limit)&&{limit:e.limit},...!(null==e||!e.registration)&&{registration:e.registration},...!(null==e||!e.related_activities)&&{related_activities:e.related_activities},...!(null==e||!e.related_agents)&&{related_agents:e.related_agents},...!(null==e||!e.since)&&{since:e.since},...!(null==e||!e.until)&&{until:e.until},...!(null==e||!e.verb)&&{verb:e.verb}},requestOptions:{useCacheBuster:null==e?void 0:e.useCacheBuster}})},Rt.prototype.getMoreStatements=function(e){const t=new URL(this.endpoint),n=`${t.protocol}//${t.host}${e.more}`;return this.requestURL(n)},Rt.prototype.sendStatement=function(e){var t;if(null===(t=e.attachments)||void 0===t?void 0:t.length){const t=a(e.statement,e.attachments);return this.requestResource({resource:o.STATEMENT,requestConfig:{method:"POST",headers:t.header,data:t.blob}})}return this.requestResource({resource:o.STATEMENT,requestConfig:{method:"POST",data:e.statement}})},Rt.prototype.sendStatements=function(e){var t;if(null===(t=e.attachments)||void 0===t?void 0:t.length){const t=a(e.statements,e.attachments);return this.requestResource({resource:o.STATEMENT,requestConfig:{method:"POST",headers:t.header,data:t.blob}})}return this.requestResource({resource:o.STATEMENT,requestConfig:{method:"POST",data:e.statements}})},Rt.prototype.voidStatement=function(e){const t={actor:e.actor,verb:s.VOIDED,object:{objectType:"StatementRef",id:e.statementId}};return this.sendStatement({statement:t})},Rt.prototype.voidStatements=function(e){const t=e.statementIds.map((t=>({actor:e.actor,verb:s.VOIDED,object:{objectType:"StatementRef",id:t}})));return this.sendStatements({statements:t})};const At=t.createContext(null),Pt=({userID:e})=>({account:{homePage:window.location.origin,name:e}}),Ct=({componentFilePath:e,contextActivities:t,currentLanguage:n=navigator.language,projectURL:r,projectVersion:o})=>({platform:"Frontend",language:n,extensions:{"https://lrs.learninglocker.net/define/extensions/info":{domain:window.location.origin,domain_version:o,github:r,event_function:`src${e}`}},contextActivities:t}),It=({pageName:e,repository:t})=>[{id:window.location.href,definition:{type:`${t}${e}`,name:{en:e}}}],xt=e=>[{id:window.location.origin,definition:{type:`${e}Home`,name:{en:"Home"}}}],Nt=({pageName:e,repository:t})=>"/"===window.location.pathname?{parent:xt(t)}:{parent:It({pageName:e,repository:t}),grouping:xt(t)},jt=({componentID:e,componentType:t,repository:n})=>({id:window.location.href.concat("#"+e),definition:{name:{en:t},type:n.concat(t)}}),qt=({verbName:e,repository:t})=>({id:t.concat(e),display:{en:e}}),Lt=({componentFilePath:e,componentID:t,componentType:n,currentLanguage:r,pageName:o,projectURL:s,projectVersion:i,repositories:a,userID:c,verbName:u})=>({actor:Pt({userID:c}),verb:qt({verbName:u,repository:"string"==typeof a?a:a.verb}),object:jt({componentID:t,componentType:n,repository:"string"==typeof a?a:a.component}),context:Ct({contextActivities:Nt({pageName:o,repository:"string"==typeof a?a:a.page}),curre