/*! xAPIWrapper v 1.11.0 | Built on 2020-01-29 13:51:08-0500 */ var CryptoJS=(CryptoJS=CryptoJS||function(l){var t={},e=t.lib={},i=e.Base={extend:function(t){n.prototype=this;var e=new n;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}};function n(){}var u=e.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||o).stringify(this)},concat:function(t){var e=this.words,i=t.words,n=this.sigBytes,r=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else if(65535>>2]=i[o>>>2];else e.push.apply(e,i);return this.sigBytes+=r,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=l.ceil(e/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(i,e/2)}},s=r.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],r=0;r>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(i,e)}},a=r.Utf8={stringify:function(t){try{return decodeURIComponent(escape(s.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return s.parse(unescape(encodeURIComponent(t)))}},p=(r.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,n=this._map;t.clamp();for(var r=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var p=n.charAt(64);if(p)for(;r.length%4;)r.push(p);return r.join("")},parse:function(t){var e=t.length,i=this._map,n=i.charAt(64);if(n){var r=t.indexOf(n);-1!=r&&(e=r)}for(var o=[],s=0,a=0;a>>6-a%4*2;o[s>>>2]|=(p|c)<<24-s%4*8,s++}return u.create(o,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=a.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,i=e.words,n=e.sigBytes,r=this.blockSize,o=n/(4*r),s=(o=t?l.ceil(o):l.max((0|o)-this._minBufferSize,0))*r,a=l.min(4*s,n);if(s){for(var p=0;p>>31}var l=(n<<5|n>>>27)+a+h[p];l+=p<20?1518500249+(r&o|~r&s):p<40?1859775393+(r^o^s):p<60?(r&o|r&s|o&s)-1894007588:(r^o^s)-899497514,a=s,s=o,o=r<<30|r>>>2,r=n,n=l}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(64+n>>>9<<4)]=l.floor(i/4294967296),e[15+(64+n>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=c.clone.call(this);return t._hash=this._hash.clone(),t}});return t.SHA1=c._createHelper(f),t.HmacSHA1=c._createHmacHelper(f),t}(Math))||function(a){function i(){}var t={},e=t.lib={},n=e.Base={extend:function(t){i.prototype=this;var e=new i;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},p=e.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||o).stringify(this)},concat:function(t){var e=this.words,i=t.words,n=this.sigBytes;if(t=t.sigBytes,this.clamp(),n%4)for(var r=0;r>>2]|=(i[r>>>2]>>>24-r%4*8&255)<<24-(n+r)%4*8;else if(65535>>2]=i[r>>>2];else e.push.apply(e,i);return this.sigBytes+=t,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=a.ceil(e/4)},clone:function(){var t=n.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-n%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new p.init(i,e/2)}},s=r.Latin1={stringify:function(t){var e=t.words;t=t.sigBytes;for(var i=[],n=0;n>>2]>>>24-n%4*8&255));return i.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new p.init(i,e)}},c=r.Utf8={stringify:function(t){try{return decodeURIComponent(escape(s.stringify(t)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(t){return s.parse(unescape(encodeURIComponent(t)))}},l=e.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=c.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,i=e.words,n=e.sigBytes,r=this.blockSize,o=n/(4*r);if(t=(o=t?a.ceil(o):a.max((0|o)-this._minBufferSize,0))*r,n=a.min(4*t,n),t){for(var s=0;s>>7)^(d<<14|d>>>18)^d>>>3)+g[u-7]+((h<<15|h>>>17)^(h<<13|h>>>19)^h>>>10)+g[u-16]}d=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&p^~a&c)+f[u]+g[u],h=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&r^n&o^r&o),l=c,c=p,p=a,a=s+d|0,s=o,o=r,r=n,n=d+h|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0,i[5]=i[5]+p|0,i[6]=i[6]+c|0,i[7]=i[7]+l|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(64+n>>>9<<4)]=r.floor(i/4294967296),e[15+(64+n>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=n._createHelper(o),e.HmacSHA256=n._createHmacHelper(o)}(Math),function(){var c=CryptoJS.enc.Utf8;CryptoJS.algo.HMAC=CryptoJS.lib.Base.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=c.parse(e));var i=t.blockSize,n=4*i;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var r=this._oKey=e.clone(),o=this._iKey=e.clone(),s=r.words,a=o.words,p=0;p>s,s-=6;0<=s;)e[i+=1]=128|o>>s&63,s-=6;r+=65536<=o?2:1}return e.subarray(0,i+1)},t.TextEncoder=e}if(void 0===t.TextDecoder){function a(t){if(String.fromCodePoint)return String.fromCodePoint(t);for(var e=[],i="",n=0,r=arguments.length;n!==r;++n){var o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);16383<=(o<=65535?e.push(o):(o-=65536,e.push(55296+(o>>10),o%1024+56320)))&&(i+=String.fromCharCode.apply(null,e),e.length=0)}return i+String.fromCharCode.apply(null,e)}function i(t){switch(t=t||"utf8"){case"utf-8":case"utf8":break;default:throw"TextDecoder only supports utf8"}}i.prototype.decode=function(t){for(var e="",i=0;i";i=i.replace("",encodeURIComponent(t));var n=_.XHR_request(this.lrs,i,"GET",null,this.lrs.auth,e,null,!0,null,this.withCredentials,this.strictCallbacks);if(void 0===n||404==n.status)return null;try{return JSON.parse(n.response)}catch(t){return n.response}}},t.prototype.sendState=function(t,e,i,n,r,o,s,a){if(this.testConfig()){var p=this.lrs.endpoint+"activities/state?activityId=&agent=&stateId=";p=(p=(p=p.replace("",encodeURIComponent(t))).replace("",encodeURIComponent(JSON.stringify(e)))).replace("",encodeURIComponent(i)),n&&(p+="®istration="+encodeURIComponent(n));var c=null;o&&s?u("Can't have both If-Match and If-None-Match"):o?c={"If-Match":_.formatHash(o)}:s&&(c={"If-None-Match":_.formatHash(s)});var l="PUT";if(!r)return this.log("No activity state was included."),!1;r instanceof Array?(r=JSON.stringify(r),(c=c||{})["Content-Type"]="application/json"):r instanceof Object?(r=JSON.stringify(r),(c=c||{})["Content-Type"]="application/json",l="POST"):(c=c||{})["Content-Type"]="application/octet-stream",_.XHR_request(this.lrs,p,l,r,this.lrs.auth,a,null,null,c,this.withCredentials,this.strictCallbacks)}},t.prototype.getState=function(t,e,i,n,r,o){if(this.testConfig()){var s=this.lrs.endpoint+"activities/state?activityId=&agent=";s=(s=s.replace("",encodeURIComponent(t))).replace("",encodeURIComponent(JSON.stringify(e))),i&&(s+="&stateId="+encodeURIComponent(i)),n&&(s+="®istration="+encodeURIComponent(n)),r&&null!=(r=isDate(r))&&(s+="&since="+encodeURIComponent(r.toISOString()));var a=_.XHR_request(this.lrs,s,"GET",null,this.lrs.auth,o,null,!0,null,this.withCredentials,this.strictCallbacks);if(void 0===a||404==a.status)return null;try{return JSON.parse(a.response)}catch(t){return a.response}}},t.prototype.deleteState=function(t,e,i,n,r,o,s){if(this.testConfig()){var a=this.lrs.endpoint+"activities/state?activityId=&agent=&stateId=";a=(a=(a=a.replace("",encodeURIComponent(t))).replace("",encodeURIComponent(JSON.stringify(e)))).replace("",encodeURIComponent(i)),n&&(a+="®istration="+encodeURIComponent(n));var p=null;r&&o?u("Can't have both If-Match and If-None-Match"):r?p={"If-Match":_.formatHash(r)}:o&&(p={"If-None-Match":_.formatHash(o)});var c=_.XHR_request(this.lrs,a,"DELETE",null,this.lrs.auth,s,null,!1,p,this.withCredentials,this.strictCallbacks);if(void 0===c||404==c.status)return null;try{return JSON.parse(c.response)}catch(t){return c}}},t.prototype.sendActivityProfile=function(t,e,i,n,r,o){if(this.testConfig()){var s=this.lrs.endpoint+"activities/profile?activityId=&profileId=";s=(s=s.replace("",encodeURIComponent(t))).replace("",encodeURIComponent(e));var a=null;n&&r?u("Can't have both If-Match and If-None-Match"):n?a={"If-Match":_.formatHash(n)}:r&&(a={"If-None-Match":_.formatHash(r)});var p="PUT";if(!i)return this.log("No activity profile was included."),!1;i instanceof Array?(i=JSON.stringify(i),(a=a||{})["Content-Type"]="application/json"):i instanceof Object?(i=JSON.stringify(i),(a=a||{})["Content-Type"]="application/json",p="POST"):(a=a||{})["Content-Type"]="application/octet-stream",_.XHR_request(this.lrs,s,p,i,this.lrs.auth,o,null,!1,a,this.withCredentials,this.strictCallbacks)}},t.prototype.getActivityProfile=function(t,e,i,n){if(this.testConfig()){var r=this.lrs.endpoint+"activities/profile?activityId=";r=r.replace("",encodeURIComponent(t)),e&&(r+="&profileId="+encodeURIComponent(e)),i&&null!=(i=isDate(i))&&(r+="&since="+encodeURIComponent(i.toISOString()));var o=_.XHR_request(this.lrs,r,"GET",null,this.lrs.auth,n,null,!0,null,this.withCredentials,this.strictCallbacks);if(void 0===o||404==o.status)return null;try{return JSON.parse(o.response)}catch(t){return o.response}}},t.prototype.deleteActivityProfile=function(t,e,i,n,r){if(this.testConfig()){var o=this.lrs.endpoint+"activities/profile?activityId=&profileId=";o=(o=o.replace("",encodeURIComponent(t))).replace("",encodeURIComponent(e));var s=null;i&&n?u("Can't have both If-Match and If-None-Match"):i?s={"If-Match":_.formatHash(i)}:n&&(s={"If-None-Match":_.formatHash(n)});var a=_.XHR_request(this.lrs,o,"DELETE",null,this.lrs.auth,r,null,!1,s,this.withCredentials,this.strictCallbacks);if(void 0===a||404==a.status)return null;try{return JSON.parse(a.response)}catch(t){return a}}},t.prototype.getAgents=function(t,e){if(this.testConfig()){var i=this.lrs.endpoint+"agents?agent=";i=i.replace("",encodeURIComponent(JSON.stringify(t)));var n=_.XHR_request(this.lrs,i,"GET",null,this.lrs.auth,e,null,!0,null,this.withCredentials,this.strictCallbacks);if(void 0===n||404==n.status)return null;try{return JSON.parse(n.response)}catch(t){return n.response}}},t.prototype.sendAgentProfile=function(t,e,i,n,r,o){if(this.testConfig()){var s=this.lrs.endpoint+"agents/profile?agent=&profileId=";s=(s=s.replace("",encodeURIComponent(JSON.stringify(t)))).replace("",encodeURIComponent(e));var a=null;n&&r?u("Can't have both If-Match and If-None-Match"):n?a={"If-Match":_.formatHash(n)}:r&&(a={"If-None-Match":_.formatHash(r)});var p="PUT";if(!i)return this.log("No agent profile was included."),!1;i instanceof Array?(i=JSON.stringify(i),(a=a||{})["Content-Type"]="application/json"):i instanceof Object?(i=JSON.stringify(i),(a=a||{})["Content-Type"]="application/json",p="POST"):(a=a||{})["Content-Type"]="application/octet-stream",_.XHR_request(this.lrs,s,p,i,this.lrs.auth,o,null,!1,a,this.withCredentials,this.strictCallbacks)}},t.prototype.getAgentProfile=function(t,e,i,n){if(this.testConfig()){var r=this.lrs.endpoint+"agents/profile?agent=";r=(r=r.replace("",encodeURIComponent(JSON.stringify(t)))).replace("",encodeURIComponent(e)),e&&(r+="&profileId="+encodeURIComponent(e)),i&&null!=(i=isDate(i))&&(r+="&since="+encodeURIComponent(i.toISOString()));var o=_.XHR_request(this.lrs,r,"GET",null,this.lrs.auth,n,null,!0,null,this.withCredentials,this.strictCallbacks);if(void 0===o||404==o.status)return null;try{return JSON.parse(o.response)}catch(t){return o.response}}},t.prototype.deleteAgentProfile=function(t,e,i,n,r){if(this.testConfig()){var o=this.lrs.endpoint+"agents/profile?agent=&profileId=";o=(o=o.replace("",encodeURIComponent(JSON.stringify(t)))).replace("",encodeURIComponent(e));var s=null;i&&n?u("Can't have both If-Match and If-None-Match"):i?s={"If-Match":_.formatHash(i)}:n&&(s={"If-None-Match":_.formatHash(n)});var a=_.XHR_request(this.lrs,o,"DELETE",null,this.lrs.auth,r,null,!1,s,this.withCredentials,this.strictCallbacks);if(void 0===a||404==a.status)return null;try{return JSON.parse(a.response)}catch(t){return a}}},_.ruuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},_.dateFromISOString=function(t){var e=t.match(new RegExp("([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T| ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?")),i=0,n=new Date(e[1],0,1);e[3]&&n.setMonth(e[3]-1),e[5]&&n.setDate(e[5]),e[7]&&n.setHours(e[7]),e[8]&&n.setMinutes(e[8]),e[10]&&n.setSeconds(e[10]),e[12]&&n.setMilliseconds(1e3*Number("0."+e[12])),e[14]&&(i=60*Number(e[16])+Number(e[17]),i*="-"==e[15]?1:-1),i-=n.getTimezoneOffset(),time=Number(n)+60*i*1e3;var r=new Date;return r.setTime(Number(time)),r},_.XHR_request=function(t,n,r,e,i,o,s,a,p,c,l){"use strict";var u,d,h,f,g,v,y=!1,m=!1,S=!1,b=n.toLowerCase().match(/^(.+):\/\/([^:\/]*):?(\d+)?(\/.*)?$/),w=window.location,x={"Content-Type":"application/json"};if(x.Authorization=i,x["X-Experience-API-Version"]=_.XAPIWrapper.xapiVersion,null!==p)for(var C in p)p.hasOwnProperty(C)&&(x[C]=p[C]);if(m=(m=w.protocol.toLowerCase()!==b[1]||w.hostname.toLowerCase()!==b[2])||(null===b[3]?"http"===b[1]?"80":"443":b[3])===w.port,null!==t&&void 0!==t.extended){for(g in f=new Array,t.extended)f.push(g+"="+encodeURIComponent(t.extended[g]));0