scorm-again 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.github/workflows/stale.yml +14 -0
  2. package/.run/{Mocha Unit Tests.run.xml → Mocha Unit Tests (watch).run.xml } +1 -1
  3. package/.run/Template Mocha.run.xml +17 -0
  4. package/README.md +171 -72
  5. package/dist/aicc.js +1441 -1140
  6. package/dist/aicc.js.map +1 -1
  7. package/dist/aicc.min.js +1 -1
  8. package/dist/aicc.min.js.map +1 -1
  9. package/dist/scorm-again.js +2703 -2212
  10. package/dist/scorm-again.js.map +1 -1
  11. package/dist/scorm-again.min.js +1 -1
  12. package/dist/scorm-again.min.js.map +1 -1
  13. package/dist/scorm12.js +1069 -852
  14. package/dist/scorm12.js.map +1 -1
  15. package/dist/scorm12.min.js +1 -1
  16. package/dist/scorm12.min.js.map +1 -1
  17. package/dist/scorm2004.js +1861 -1571
  18. package/dist/scorm2004.js.map +1 -1
  19. package/dist/scorm2004.min.js +1 -1
  20. package/dist/scorm2004.min.js.map +1 -1
  21. package/package.json +10 -6
  22. package/src/AICC.ts +15 -17
  23. package/src/BaseAPI.ts +268 -417
  24. package/src/Scorm12API.ts +65 -38
  25. package/src/Scorm2004API.ts +151 -117
  26. package/src/cmi/aicc/attempts.ts +94 -0
  27. package/src/cmi/aicc/cmi.ts +100 -0
  28. package/src/cmi/aicc/core.ts +360 -0
  29. package/src/cmi/aicc/evaluation.ts +157 -0
  30. package/src/cmi/aicc/paths.ts +180 -0
  31. package/src/cmi/aicc/student_data.ts +86 -0
  32. package/src/cmi/aicc/student_demographics.ts +367 -0
  33. package/src/cmi/aicc/student_preferences.ts +176 -0
  34. package/src/cmi/aicc/tries.ts +116 -0
  35. package/src/cmi/aicc/validation.ts +25 -0
  36. package/src/cmi/common/array.ts +77 -0
  37. package/src/cmi/common/base_cmi.ts +46 -0
  38. package/src/cmi/common/score.ts +203 -0
  39. package/src/cmi/common/validation.ts +60 -0
  40. package/src/cmi/scorm12/cmi.ts +224 -0
  41. package/src/cmi/scorm12/interactions.ts +368 -0
  42. package/src/cmi/scorm12/nav.ts +54 -0
  43. package/src/cmi/scorm12/objectives.ts +112 -0
  44. package/src/cmi/scorm12/student_data.ts +130 -0
  45. package/src/cmi/scorm12/student_preference.ts +158 -0
  46. package/src/cmi/scorm12/validation.ts +48 -0
  47. package/src/cmi/scorm2004/adl.ts +272 -0
  48. package/src/cmi/scorm2004/cmi.ts +599 -0
  49. package/src/cmi/scorm2004/comments.ts +163 -0
  50. package/src/cmi/scorm2004/interactions.ts +466 -0
  51. package/src/cmi/scorm2004/learner_preference.ts +152 -0
  52. package/src/cmi/scorm2004/objectives.ts +212 -0
  53. package/src/cmi/scorm2004/score.ts +78 -0
  54. package/src/cmi/scorm2004/validation.ts +42 -0
  55. package/src/constants/default_settings.ts +81 -0
  56. package/src/constants/enums.ts +5 -0
  57. package/src/constants/regex.ts +2 -2
  58. package/src/constants/response_constants.ts +2 -0
  59. package/src/exceptions.ts +22 -1
  60. package/src/helpers/scheduled_commit.ts +42 -0
  61. package/src/interfaces/IBaseAPI.ts +35 -0
  62. package/src/types/api_types.ts +32 -0
  63. package/src/utilities/debounce.ts +31 -0
  64. package/src/utilities.ts +56 -0
  65. package/test/AICC.spec.ts +11 -1
  66. package/test/Scorm12API.spec.ts +262 -9
  67. package/test/Scorm2004API.spec.ts +488 -2
  68. package/test/cmi/aicc_cmi.spec.ts +188 -11
  69. package/test/cmi/scorm12_cmi.spec.ts +5 -5
  70. package/test/cmi/scorm2004_cmi.spec.ts +8 -8
  71. package/test/cmi_helpers.ts +1 -1
  72. package/test/types/api_types.spec.ts +126 -0
  73. package/test/utilities/debounce.spec.ts +56 -0
  74. package/src/cmi/aicc_cmi.ts +0 -1248
  75. package/src/cmi/common.ts +0 -411
  76. package/src/cmi/scorm12_cmi.ts +0 -1426
  77. package/src/cmi/scorm2004_cmi.ts +0 -1874
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)};function r(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var o={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},s={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:o,aicc:i(i({},o),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}},a={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},c={scorm12:i(i({},a),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:i(i({},a),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})},l={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},u={aicc:i(i({},l),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:l,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|{target=\\S{0,200}[a-zA-Z0-9]}choice|jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^(previous|continue|choice.{target=\\S{0,200}[a-zA-Z0-9]})$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}},_=s.scorm12,h=u.scorm12,d=c.scorm12,m=function(e){function i(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return t(i,e),Object.defineProperty(i.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),i.prototype.setMessage=function(e){this.message=e},i}(Error),p=function(e){function i(t){var i=e.call(this,t)||this;return i.name="Scorm12ValidationError",i}return t(i,e),i}(m);!function(e){function i(t){var i=e.call(this,t)||this;return i.name="Scorm2004ValidationError",i}t(i,e)}(m);function f(e,t,i,r,n){var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new r(i);return!0}function g(e,t,i,r){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}var E=function(){function e(){this.jsonString=!1,this._initialized=!1}return Object.defineProperty(e.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start_time",{get:function(){return this._start_time},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){this._initialized=!0},e.prototype.setStartTime=function(){this._start_time=(new Date).getTime()},e}(),y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i}(E),b=function(e){function i(t){var i=e.call(this)||this;return i._raw="",i._min="",i.__children=t.score_children||_.score_children,i.__score_range=!!t.score_range&&h.score_range,i._max=t.max||""===t.max?t.max:"100",i.__invalid_error_code=t.invalidErrorCode||d.INVALID_SET_VALUE,i.__invalid_type_code=t.invalidTypeCode||d.TYPE_MISMATCH,i.__invalid_range_code=t.invalidRangeCode||d.VALUE_OUT_OF_RANGE,i.__decimal_regex=t.decimalRegex||h.CMIDecimal,i.__error_class=t.errorClass,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this.__error_class(this.__invalid_error_code)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"raw",{get:function(){return this._raw},set:function(e){!f(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!g(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"min",{get:function(){return this._min},set:function(e){!f(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!g(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max",{get:function(){return this._max},set:function(e){!f(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!g(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},i}(E),M=function(e){function i(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||d.GENERAL,i._errorClass=t.errorClass||p,i.childArray=[],i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e},i}(E),I=s.scorm12.error_descriptions,S=s.aicc.error_descriptions,O=s.scorm2004.error_descriptions,v=function(e){function i(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return t(i,e),Object.defineProperty(i.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),i}(m),L=function(e){function i(t){return{}.hasOwnProperty.call(I,String(t))?e.call(this,t,I[String(t)].basicMessage,I[String(t)].detailMessage)||this:e.call(this,101,I[101].basicMessage,I[101].detailMessage)||this}return t(i,e),i}(v),C=function(e){function i(t){return{}.hasOwnProperty.call(S,String(t))?e.call(this,t,S[String(t)].basicMessage,S[String(t)].detailMessage)||this:e.call(this,101,S[101].basicMessage,S[101].detailMessage)||this}return t(i,e),i}(v),T=function(e){function i(t){return{}.hasOwnProperty.call(O,String(t))?e.call(this,t,O[String(t)].basicMessage,O[String(t)].detailMessage)||this:e.call(this,101,O[101].basicMessage,O[101].detailMessage)||this}return t(i,e),i}(v),w=3600,N={D:24*w,H:w,M:60,S:1};function R(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/w),i=new Date(1e3*e),r=i.getUTCMinutes(),n=i.getSeconds(),o=e%1,s="";return z(o)>0&&(s="."+(s=z(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+s}function A(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in N){var n=N[r],o=Math.floor(i/n);z(i%=n)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(o+=i),o&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(o).concat(r))}return t}function j(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function D(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function P(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n<o;n++)e(i[n],r+"["+n+"]"),0===o&&(t[r]=[]);else{var s=!0;for(var a in i)({}).hasOwnProperty.call(i,a)&&(s=!1,e(i[a],r?r+"."+a:a));s&&r&&(t[r]={})}}(e,""),t}function z(e){return Math.floor(e)===e||String(e).indexOf(".")<0?0:e.toString().split(".")[1].length||0}var x=s.global,V=c.scorm12;var F={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendBeaconCommit:!1,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:x.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return r(this,void 0,void 0,(function(){var t,i,r;return n(this,(function(n){switch(n.label){case 0:return void 0===e?[3,2]:(r=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=r.apply(i,[n.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===x.SCORM_TRUE?0:101}]:200===e.status?[2,{result:x.SCORM_TRUE,errorCode:0}]:[2,{result:x.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:x.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case x.LOG_LEVEL_ERROR:console.error(t);break;case x.LOG_LEVEL_WARNING:console.warn(t);break;case x.LOG_LEVEL_INFO:console.info(t);break;case x.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}}},G=function(){function e(t,i){var r=this.constructor;if(this._settings=F,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=x.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.initialize=function(e,t,i){var r=x.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=x.STATE_INITIALIZED,this.lastErrorCode="0",r=x.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,x.LOG_LEVEL_INFO),this.clearSCORMError(r),r},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=i(i({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){var i=x.SCORM_FALSE;if(this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)){this.currentState=x.STATE_TERMINATED;var r=this.storeData(!0);void 0!==r.errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:x.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=x.SCORM_TRUE,this.processListeners(e)}return this.apiLog(e,"returned: "+i,x.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,x.LOG_LEVEL_INFO,i),this.clearSCORMError(r),r},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=x.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=x.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,x.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e,t){void 0===t&&(t=!1),this.clearScheduledCommit();var i=x.SCORM_FALSE;if(this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)){var r=this.storeData(!1);r.errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:x.SCORM_FALSE,this.apiLog(e," Result: "+i,x.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e)}return this.apiLog(e,"returned: "+i,x.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,x.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,x.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,x.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.apiLog=function(e,t,i,r){t=this.formatMessage(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},e.prototype.formatMessage=function(e,t,i){for(var r="",n=20-(r+=e).length,o=0;o<n;o++)r+=" ";if(r+=": ",i){n=70-(r+=i).length;for(var s=0;s<n;s++)r+=" "}return t&&(r+=t),r},e.prototype.stringMatches=function(e,t){return null!==(null==e?void 0:e.match(t))},e.prototype._checkObjectHasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)||null!=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,r){if(!i||""===i)return x.SCORM_FALSE;for(var n=i.split("."),o=this,s=x.SCORM_FALSE,a=!1,c="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),l=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,u=0;u<n.length;u++){var _=n[u];if(u===n.length-1)t&&"{target="===_.substring(0,8)&&"function"==typeof o._isTargetValid?this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT):this._checkObjectHasProperty(o,_)?(this.isInitialized()&&this.stringMatches(i,"\\.correct_responses\\.\\d+")&&this.validateCorrectResponse(i,r),t&&"0"!==this.lastErrorCode||(o[_]=r,s=x.SCORM_TRUE)):this.throwSCORMError(l,c);else{if(!(o=o[_])){this.throwSCORMError(l,c);break}if(o instanceof M){var h=parseInt(n[u+1],10);if(!isNaN(h)){var d=o.childArray[h];if(d)o=d,a=!0;else{var m=this.getChildElement(i,r,a);a=!0,m?(o.initialized&&m.initialize(),o.childArray.push(m),o=m):this.throwSCORMError(l,c)}u++}}}}return s===x.SCORM_FALSE&&this.apiLog(e,"There was an error setting the value for: ".concat(i,", value of: ").concat(r),x.LOG_LEVEL_WARNING),s},e.prototype._commonGetCMIValue=function(e,t,i){if(!i||""===i)return"";for(var r=i.split("."),n=this,o=null,s="The data model element passed to ".concat(e," (").concat(i,") has not been initialized."),a="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),c=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,l=0;l<r.length;l++){if(o=r[l],t){if("{target="===String(o).substring(0,8)&&"function"==typeof n._isTargetValid){var u=String(o).substring(8,String(o).length-9);return n._isTargetValid(u)}if(!this._checkObjectHasProperty(n,o))return void this.throwSCORMError(c,a)}else if(l===r.length-1&&!this._checkObjectHasProperty(n,o))return void this.throwSCORMError(c,a);if(void 0===(n=n[o])){this.throwSCORMError(c,a);break}if(n instanceof M){var _=parseInt(r[l+1],10);if(!isNaN(_)){var h=n.childArray[_];if(!h){this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED,s);break}n=h,l++}}}if(null!=n)return n;t||("_children"===o?this.throwSCORMError(V.CHILDREN_ERROR):"_count"===o&&this.throwSCORMError(V.COUNT_ERROR))},e.prototype.isInitialized=function(){return this.currentState===x.STATE_INITIALIZED},e.prototype.isNotInitialized=function(){return this.currentState===x.STATE_NOT_INITIALIZED},e.prototype.isTerminated=function(){return this.currentState===x.STATE_TERMINATED},e.prototype.on=function(e,t){if(t)for(var i=e.split(" "),r=0;r<i.length;r++){var n=i[r].split(".");if(0===n.length)return;var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),x.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),x.LOG_LEVEL_INFO,s))},n=this,o=0;o<i.length;o++){var s=r(o);if("object"==typeof s)return s.value}},e.prototype.clear=function(e){for(var t=e.split(" "),i=function(i){var n=t[i].split(".");if(0===n.length)return{value:void 0};var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;n<t.length;n++){var o=i(n);if("object"==typeof o)return o.value}},e.prototype.processListeners=function(e,t,i){this.apiLog(e,i,x.LOG_LEVEL_INFO,t);for(var r=0;r<this.listenerArray.length;r++){var n=this.listenerArray[r],o=n.functionName===e,s=!!n.CMIElement,a=!1;a=t&&n.CMIElement&&"*"===n.CMIElement.substring(n.CMIElement.length-1)?0===t.indexOf(n.CMIElement.substring(0,n.CMIElement.length-1)):n.CMIElement===t,!o||s&&!a||(this.apiLog("processListeners","Processing listener: ".concat(n.functionName),x.LOG_LEVEL_INFO,t),n.callback(t,i))}},e.prototype.throwSCORMError=function(e,t){t||(t=this.getLmsErrorMessageDetails(e)),this.apiLog("throwSCORMError",e+": "+t,x.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)},e.prototype.clearSCORMError=function(e){void 0!==e&&e!==x.SCORM_FALSE&&(this.lastErrorCode="0")},e.prototype.loadFromFlattenedJSON=function(e,t){var i=this;if(this.isNotInitialized()){var r,n=/^(cmi\.interactions\.)(\d+)\.(.*)$/,o=/^(cmi\.objectives\.)(\d+)\.(.*)$/,s=Object.keys(e).map((function(t){return[String(t),e[t]]}));s.sort((function(e,t){var i,r=e[0],s=(e[1],t[0]);t[1];return null!==(i=a(r,s,n))||null!==(i=a(r,s,o))?i:r<s?-1:r>s?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){for(var n=i,o="",s=t.exec(r);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(r);n[o]=e[r]}return i[""]||i}(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o<n.childArray.length;o++)this.loadFromJSON(n.childArray[o],r+"."+o);else n.constructor===Object?this.loadFromJSON(n,r):this.setCMIValue(r,n)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")},e.prototype.renderCMIToJSONString=function(){var e=this.cmi;return JSON.stringify({cmi:e})},e.prototype.renderCMIToJSONObject=function(){return JSON.parse(this.renderCMIToJSONString())},e.prototype.processHttpRequest=function(e,t,o){var s=this;void 0===o&&(o=!1);var a=this,c={result:x.SCORM_FALSE,errorCode:this.error_codes.GENERAL},l=function(e,t,i){var r;return void 0===i&&(i=!1),function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=this,a=i&&!r;r&&clearTimeout(r),r=setTimeout((function(){r=null,i||e.apply(s,n)}),t),a&&e.apply(s,n)}}((function(e,t,o){return r(s,void 0,void 0,(function(){var r,s,l,u;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),t=o.requestHandler(t),[4,fetch(e,{method:"POST",body:t instanceof Array?t.join("&"):JSON.stringify(t),headers:i(i({},o.xhrHeaders),{"Content-Type":o.commitRequestDataType}),credentials:o.xhrWithCredentials?"include":void 0,keepalive:!0})];case 1:return r=n.sent(),"function"!=typeof o.responseHandler?[3,3]:[4,o.responseHandler(r)];case 2:return l=n.sent(),[3,5];case 3:return[4,r.json()];case 4:l=n.sent(),n.label=5;case 5:return s=l,r.status>=200&&r.status<=299&&(!0===s.result||s.result===x.SCORM_TRUE)?a.processListeners("CommitSuccess"):a.processListeners("CommitError"),[2,s];case 6:return u=n.sent(),this.apiLog("processHttpRequest",u,x.LOG_LEVEL_ERROR),a.processListeners("CommitError"),[2,c];case 7:return[2]}}))}))}),500,o);return l(e,t,this.settings),{result:x.SCORM_TRUE,errorCode:0}},e.prototype.scheduleCommit=function(e,t){this._timeout=new U(this,e,t),this.apiLog("scheduleCommit","scheduled",x.LOG_LEVEL_DEBUG,"")},e.prototype.clearScheduledCommit=function(){this._timeout&&(this._timeout.cancel(),this._timeout=void 0,this.apiLog("clearScheduledCommit","cleared",x.LOG_LEVEL_DEBUG,""))},e.prototype.handleValueAccessException=function(e,t){return e instanceof v?(this.lastErrorCode=String(e.errorCode),t=x.SCORM_FALSE):(e instanceof Error&&e.message?console.error(e.message):console.error(e),this.throwSCORMError(this._error_codes.GENERAL)),t},e}(),k=G,U=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){this._cancelled||this._API.commit(this._callback)},e}(),Y=u.scorm2004,q={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:Y.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:Y.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:Y.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:Y.CMIShortIdentifier,format2:Y.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+Y.CMIShortIdentifier,format2:Y.CMIDecimal+"|^$|"+Y.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:Y.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:Y.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:Y.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:Y.CMIString4000,max:1,delimiter:"",unique:!1}},H={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:Y.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:Y.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:Y.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:Y.CMIShortIdentifier,format2:Y.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:"^$|"+Y.CMIShortIdentifier,format2:Y.CMIDecimal+"|^$|"+Y.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:Y.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:Y.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:Y.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:Y.CMIString4000,limit:1}},$=s.scorm2004,J=c.scorm2004,B=q,Z=u.scorm2004;function W(e,t,i){return f(e,t,J.TYPE_MISMATCH,T,i)}function K(e,t){return g(e,t,J.VALUE_OUT_OF_RANGE,T)}var Q=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this)||this;return i.__version="1.0",i.__children=$.cmi_children,i._completion_status="unknown",i._completion_threshold="",i._credit="credit",i._entry="",i._exit="",i._launch_data="",i._learner_id="",i._learner_name="",i._location="",i._max_time_allowed="",i._mode="normal",i._progress_measure="",i._scaled_passing_score="",i._session_time="PT0H0M0S",i._success_status="unknown",i._suspend_data="",i._time_limit_action="continue,no message",i._total_time="",i.learner_preference=new X,i.score=new se,i.comments_from_learner=new re,i.comments_from_lms=new ie,i.interactions=new ee,i.objectives=new te,t&&i.initialize(),i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o,s;e.prototype.initialize.call(this),null===(t=this.learner_preference)||void 0===t||t.initialize(),null===(i=this.score)||void 0===i||i.initialize(),null===(r=this.comments_from_learner)||void 0===r||r.initialize(),null===(n=this.comments_from_lms)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize(),null===(s=this.objectives)||void 0===s||s.initialize()},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new T(J.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new T(J.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completion_status",{get:function(){return this._completion_status},set:function(e){W(e,Z.CMICStatus)&&(this._completion_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completion_threshold",{get:function(){return this._completion_threshold},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._completion_threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new T(J.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){W(e,Z.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_id",{get:function(){return this._learner_id},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._learner_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_name",{get:function(){return this._learner_name},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._learner_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){W(e,Z.CMIString1000)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"progress_measure",{get:function(){return this._progress_measure},set:function(e){W(e,Z.CMIDecimal)&&K(e,Z.progress_range)&&(this._progress_measure=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scaled_passing_score",{get:function(){return this._scaled_passing_score},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._scaled_passing_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new T(J.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){W(e,Z.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"success_status",{get:function(){return this._success_status},set:function(e){W(e,Z.CMISStatus)&&(this._success_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){W(e,Z.CMIString64000,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new T(J.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){var e=this._session_time,t=this.start_time;null!=t&&(e=A(((new Date).getTime()-t)/1e3));return function(e,t,i){var r="string"==typeof i?new RegExp(i):i;return A(D(e,r)+D(t,r))}(this._total_time,e,Z.CMITimespan)},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments_from_learner:this.comments_from_learner,comments_from_lms:this.comments_from_lms,completion_status:this.completion_status,completion_threshold:this.completion_threshold,credit:this.credit,entry:this.entry,exit:this.exit,interactions:this.interactions,launch_data:this.launch_data,learner_id:this.learner_id,learner_name:this.learner_name,learner_preference:this.learner_preference,location:this.location,max_time_allowed:this.max_time_allowed,mode:this.mode,objectives:this.objectives,progress_measure:this.progress_measure,scaled_passing_score:this.scaled_passing_score,score:this.score,session_time:this.session_time,success_status:this.success_status,suspend_data:this.suspend_data,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(y),X=function(e){function i(){var t=e.call(this)||this;return t.__children=$.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new T(J.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){W(e,Z.CMIDecimal)&&K(e,Z.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){W(e,Z.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){W(e,Z.CMIDecimal)&&K(e,Z.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){W(e,Z.CMISInteger)&&K(e,Z.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},i}(E),ee=function(e){function i(){return e.call(this,{children:$.interactions_children,errorCode:J.READ_ONLY_ELEMENT,errorClass:T})||this}return t(i,e),i}(M),te=function(e){function i(){return e.call(this,{children:$.objectives_children,errorCode:J.READ_ONLY_ELEMENT,errorClass:T})||this}return t(i,e),i}(M),ie=function(e){function i(){return e.call(this,{children:$.comments_children,errorCode:J.READ_ONLY_ELEMENT,errorClass:T})||this}return t(i,e),i}(M),re=function(e){function i(){return e.call(this,{children:$.comments_children,errorCode:J.READ_ONLY_ELEMENT,errorClass:T})||this}return t(i,e),i}(M),ne=function(e){function i(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new M({errorCode:J.READ_ONLY_ELEMENT,errorClass:T,children:$.objectives_children}),t.correct_responses=new M({errorCode:J.READ_ONLY_ELEMENT,errorClass:T,children:$.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){W(e,Z.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new T(J.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=B[this.type];if(!i)throw new T(J.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new T(J.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n<t.length;n++)if(null==i?void 0:i.delimiter2){var o=t[n].split(i.delimiter2);if(2!==o.length)throw new T(J.TYPE_MISMATCH);if(!o[0].match(r))throw new T(J.TYPE_MISMATCH);if(!i.format2||!o[1].match(new RegExp(i.format2)))throw new T(J.TYPE_MISMATCH)}else{if(!t[n].match(r))throw new T(J.TYPE_MISMATCH);if(""!==t[n]&&i.unique)for(var s=0;s<n;s++)if(t[n]===t[s])throw new T(J.TYPE_MISMATCH)}this._learner_response=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){return this._result},set:function(e){W(e,Z.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){return this._latency},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"description",{get:function(){return this._description},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMILangString250,!0)&&(this._description=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,type:this.type,objectives:this.objectives,timestamp:this.timestamp,weighting:this.weighting,learner_response:this.learner_response,result:this.result,latency:this.latency,description:this.description,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(E),oe=function(e){function i(){var t=e.call(this)||this;return t._id="",t._success_status="unknown",t._completion_status="unknown",t._progress_measure="",t._description="",t.score=new se,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){W(e,Z.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"success_status",{get:function(){return this._success_status},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMISStatus)&&(this._success_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completion_status",{get:function(){return this._completion_status},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMICStatus)&&(this._completion_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"progress_measure",{get:function(){return this._progress_measure},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMIDecimal)&&K(e,Z.progress_range)&&(this._progress_measure=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"description",{get:function(){return this._description},set:function(e){if(this.initialized&&""===this._id)throw new T(J.DEPENDENCY_NOT_ESTABLISHED);W(e,Z.CMILangString250,!0)&&(this._description=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,success_status:this.success_status,completion_status:this.completion_status,progress_measure:this.progress_measure,description:this.description,score:this.score};return delete this.jsonString,e},i}(E),se=function(e){function i(){var t=e.call(this,{score_children:$.score_children,max:"",invalidErrorCode:J.READ_ONLY_ELEMENT,invalidTypeCode:J.TYPE_MISMATCH,invalidRangeCode:J.VALUE_OUT_OF_RANGE,decimalRegex:Z.CMIDecimal,errorClass:T})||this;return t._scaled="",t}return t(i,e),Object.defineProperty(i.prototype,"scaled",{get:function(){return this._scaled},set:function(e){W(e,Z.CMIDecimal)&&K(e,Z.scaled_range)&&(this._scaled=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={scaled:this.scaled,raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},i}(b),ae=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this)||this;return i._comment="",i._location="",i._timestamp="",i._comment="",i._location="",i._timestamp="",i._readOnlyAfterInit=t,i}return t(i,e),Object.defineProperty(i.prototype,"comment",{get:function(){return this._comment},set:function(e){if(this.initialized&&this._readOnlyAfterInit)throw new T(J.READ_ONLY_ELEMENT);W(e,Z.CMILangString4000,!0)&&(this._comment=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){if(this.initialized&&this._readOnlyAfterInit)throw new T(J.READ_ONLY_ELEMENT);W(e,Z.CMIString250)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&this._readOnlyAfterInit)throw new T(J.READ_ONLY_ELEMENT);W(e,Z.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={comment:this.comment,location:this.location,timestamp:this.timestamp};return delete this.jsonString,e},i}(E),ce=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){W(e,Z.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(E),le=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){return this._pattern},set:function(e){W(e,Z.CMIFeedback)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e},i}(E),ue=function(e){function i(){var t=e.call(this)||this;return t.nav=new _e,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.nav)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={nav:this.nav};return delete this.jsonString,e},i}(E),_e=function(e){function i(){var t=e.call(this)||this;return t._request="_none_",t.request_valid=new he,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.request_valid)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"request",{get:function(){return this._request},set:function(e){W(e,Z.NAVEvent)&&(this._request=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={request:this.request};return delete this.jsonString,e},i}(E),he=function(e){function i(){var t=e.call(this)||this;return t._continue="unknown",t._previous="unknown",t.choice=function(){this._isTargetValid=function(e){return"unknown"}},t.jump=function(){this._isTargetValid=function(e){return"unknown"}},t}return t(i,e),Object.defineProperty(i.prototype,"continue",{get:function(){return this._continue},set:function(e){throw new T(J.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"previous",{get:function(){return this._previous},set:function(e){throw new T(J.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={previous:this._previous,continue:this.continue};return delete this.jsonString,e},i}(E),de=["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mo","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","sh","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu","aar","abk","ave","afr","aka","amh","arg","ara","asm","ava","aym","aze","bak","bel","bul","bih","bis","bam","ben","tib","bod","bre","bos","cat","che","cha","cos","cre","cze","ces","chu","chv","wel","cym","dan","ger","deu","div","dzo","ewe","gre","ell","eng","epo","spa","est","baq","eus","per","fas","ful","fin","fij","fao","fre","fra","fry","gle","gla","glg","grn","guj","glv","hau","heb","hin","hmo","hrv","hat","hun","arm","hye","her","ina","ind","ile","ibo","iii","ipk","ido","ice","isl","ita","iku","jpn","jav","geo","kat","kon","kik","kua","kaz","kal","khm","kan","kor","kau","kas","kur","kom","cor","kir","lat","ltz","lug","lim","lin","lao","lit","lub","lav","mlg","mah","mao","mri","mac","mkd","mal","mon","mol","mar","may","msa","mlt","bur","mya","nau","nob","nde","nep","ndo","dut","nld","nno","nor","nbl","nav","nya","oci","oji","orm","ori","oss","pan","pli","pol","pus","por","que","roh","run","rum","ron","rus","kin","san","srd","snd","sme","sag","slo","sin","slk","slv","smo","sna","som","alb","sqi","srp","ssw","sot","sun","swe","swa","tam","tel","tgk","tha","tir","tuk","tgl","tsn","ton","tur","tso","tat","twi","tah","uig","ukr","urd","uzb","ven","vie","vol","wln","wol","xho","yid","yor","zha","chi","zho","zul"],me=s.scorm2004,pe=s.global,fe=c.scorm2004,ge=H,Ee=u.scorm2004,ye=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,fe,t)||this)._version="1.0",i.cmi=new Q,i.adl=new ue,i.Initialize=i.lmsInitialize,i.Terminate=i.lmsFinish,i.GetValue=i.lmsGetValue,i.SetValue=i.lmsSetValue,i.Commit=i.lmsCommit,i.GetLastError=i.lmsGetLastError,i.GetErrorString=i.lmsGetErrorString,i.GetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),Object.defineProperty(i.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.initialize("Initialize")},i.prototype.lmsFinish=function(){var e=this.terminate("Terminate",!0);if(e===pe.SCORM_TRUE)if("_none_"!==this.adl.nav.request)switch(this.adl.nav.request){case"continue":this.processListeners("SequenceNext");break;case"previous":this.processListeners("SequencePrevious");break;case"choice":this.processListeners("SequenceChoice");break;case"exit":this.processListeners("SequenceExit");break;case"exitAll":this.processListeners("SequenceExitAll");break;case"abandon":this.processListeners("SequenceAbandon");break;case"abandonAll":this.processListeners("SequenceAbandonAll")}else this.settings.autoProgress&&this.processListeners("SequenceNext");return e},i.prototype.lmsGetValue=function(e){return this.getValue("GetValue",!0,e)},i.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},i.prototype.lmsCommit=function(){return this.commit("Commit")},i.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},i.prototype.getChildElement=function(e,t,i){if(this.stringMatches(e,"cmi\\.objectives\\.\\d+"))return new oe;if(i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")){var r=e.split("."),n=Number(r[2]),o=this.cmi.interactions.childArray[n];if(this.isInitialized())if(o.type){this.checkDuplicateChoiceResponse(o,t);var s=ge[o.type];s?this.checkValidResponseType(s,t,o.type):this.throwSCORMError(fe.GENERAL_SET_FAILURE,"Incorrect Response Type: "+o.type)}else this.throwSCORMError(fe.DEPENDENCY_NOT_ESTABLISHED);if("0"===this.lastErrorCode)return new le}else{if(i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new ce;if(!i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+"))return new ne;if(this.stringMatches(e,"cmi\\.comments_from_learner\\.\\d+"))return new ae;if(this.stringMatches(e,"cmi\\.comments_from_lms\\.\\d+"))return new ae(!0)}return null},i.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(fe.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},i.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r<i&&"0"===this.lastErrorCode;r++){e.correct_responses.childArray[r].pattern===t&&this.throwSCORMError(fe.GENERAL_SET_FAILURE)}},i.prototype.validateCorrectResponse=function(e,t){var i=e.split("."),r=Number(i[2]),n=Number(i[4]),o=this.cmi.interactions.childArray[r],s=o.correct_responses._count;this.checkDuplicateChoiceResponse(o,t);var a=ge[o.type];void 0===a.limit||s<=a.limit?(this.checkValidResponseType(a,t,o.type),"0"===this.lastErrorCode&&(!a.duplicate||!this.checkDuplicatedPattern(o.correct_responses,n,t))||"0"===this.lastErrorCode&&""===t||"0"===this.lastErrorCode&&this.throwSCORMError(fe.GENERAL_SET_FAILURE,"Data Model Element Pattern Already Exists")):this.throwSCORMError(fe.GENERAL_SET_FAILURE,"Data Model Element Collection Limit Reached")},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("GetValue",!0,e)},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="",r="";return e=String(e),me.error_descriptions[e]&&(i=me.error_descriptions[e].basicMessage,r=me.error_descriptions[e].detailMessage),t?r:i},i.prototype.checkDuplicatedPattern=function(e,t,i){for(var r=!1,n=e._count,o=0;o<n&&!r;o++)o!==t&&e.childArray[o]===i&&(r=!0);return r},i.prototype.checkCorrectResponseValue=function(e,t,i){for(var r=ge[e],n=new RegExp(r.format),o=0;o<t.length&&"0"===this.lastErrorCode;o++)if(e.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")&&(t[o]=this.removeCorrectResponsePrefixes(t[o])),null==r?void 0:r.delimiter2){var s=t[o].split(r.delimiter2);if(2===s.length)(a=s[0].match(n))&&r.format2&&s[1].match(new RegExp(r.format2))||this.throwSCORMError(fe.TYPE_MISMATCH);else this.throwSCORMError(fe.TYPE_MISMATCH)}else{var a;if(!(a=t[o].match(n))&&""!==i||!a&&"true-false"===e)this.throwSCORMError(fe.TYPE_MISMATCH);else if("numeric"===e&&t.length>1)Number(t[0])>Number(t[1])&&this.throwSCORMError(fe.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var c=0;c<o&&"0"===this.lastErrorCode;c++)t[o]===t[c]&&this.throwSCORMError(fe.TYPE_MISMATCH)}},i.prototype.removeCorrectResponsePrefixes=function(e){for(var t=!1,i=!1,r=!1,n=new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"),o=e.match(n),s=null;o;){switch(o[2]){case"lang":if(s=e.match(Ee.CMILangcr)){var a=s[3];void 0!==a&&a.length>0&&(de.includes(a.toLowerCase())||this.throwSCORMError(fe.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(fe.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(fe.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=P(t);switch(this.settings.dataCommitFormat){case"flattened":return P(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.storeData=function(e){var t,i,r;e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed"));var n=!1;this.adl.nav.request!==(null===(r=null===(i=null===(t=this.startingData)||void 0===t?void 0:t.adl)||void 0===i?void 0:i.nav)||void 0===r?void 0:r.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),n=!0);var o=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);if(this.apiLogLevel===pe.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(o)),"string"==typeof this.settings.lmsCommitUrl){var s=this.processHttpRequest(this.settings.lmsCommitUrl,o,e);return n&&void 0!==s.navRequest&&""!==s.navRequest&&Function('"use strict";(() => { '.concat(s.navRequest," })()"))(),s}return{result:pe.SCORM_TRUE,errorCode:0}},i}(k),be=s.scorm12,Me=u.scorm12,Ie=c.scorm12;function Se(e,t,i){return f(e,t,Ie.TYPE_MISMATCH,L,i)}function Oe(e,t,i){if(!i&&""===e)throw new L(Ie.VALUE_OUT_OF_RANGE);return g(e,t,Ie.VALUE_OUT_OF_RANGE,L)}var ve=function(e){function i(t,i,r){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",r&&n.initialize(),n.__children=t||be.cmi_children,n.core=new Le,n.objectives=new Ce,n.student_data=i||new Te,n.student_preference=new we,n.interactions=new Ne,n}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new L(Ie.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new L(Ie.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments",{get:function(){return this._comments},set:function(e){Se(e,Me.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},i}(y),Le=function(e){function i(){var t=e.call(this)||this;return t.__children=be.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new b({score_children:be.score_children,score_range:Me.score_range,invalidErrorCode:Ie.INVALID_SET_VALUE,invalidTypeCode:Ie.TYPE_MISMATCH,invalidRangeCode:Ie.VALUE_OUT_OF_RANGE,errorClass:L}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new L(Ie.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){Se(e,Me.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?Se(e,Me.CMIStatus)&&(this._lesson_status=e):Se(e,Me.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){Se(e,Me.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){Se(e,Me.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){Se(e,Me.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(e){var t,i,r,n=this._session_time,o=e;null!=o&&(n=R(((new Date).getTime()-o)/1e3));return t=this._total_time,i=n,"string"==typeof(r=new RegExp(Me.CMITimespan))&&(r=new RegExp(r)),R(j(t,r)+j(i,r))},i.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},i}(E),Ce=function(e){function i(){return e.call(this,{children:be.objectives_children,errorCode:Ie.INVALID_SET_VALUE,errorClass:L})||this}return t(i,e),i}(M),Te=function(e){function i(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||be.student_data_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new L(Ie.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new L(Ie.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(E),we=function(e){function i(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||be.student_preference_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new L(Ie.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio",{get:function(){return this._audio},set:function(e){Se(e,Me.CMISInteger)&&Oe(e,Me.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){Se(e,Me.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this._speed},set:function(e){Se(e,Me.CMISInteger)&&Oe(e,Me.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this._text},set:function(e){Se(e,Me.CMISInteger)&&Oe(e,Me.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},i}(E),Ne=function(e){function i(){return e.call(this,{children:be.interactions_children,errorCode:Ie.INVALID_SET_VALUE,errorClass:L})||this}return t(i,e),i}(M),Re=function(e){function i(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new M({errorCode:Ie.INVALID_SET_VALUE,errorClass:L,children:be.objectives_children}),t.correct_responses=new M({errorCode:Ie.INVALID_SET_VALUE,errorClass:L,children:be.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._id},set:function(e){Se(e,Me.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._time},set:function(e){Se(e,Me.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._type},set:function(e){Se(e,Me.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){Se(e,Me.CMIDecimal)&&Oe(e,Me.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_response",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){Se(e,Me.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._result},set:function(e){Se(e,Me.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){Se(e,Me.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(E),Ae=function(e){function i(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new b({score_children:be.score_children,score_range:Me.score_range,invalidErrorCode:Ie.INVALID_SET_VALUE,invalidTypeCode:Ie.TYPE_MISMATCH,invalidRangeCode:Ie.VALUE_OUT_OF_RANGE,errorClass:L}),t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){Se(e,Me.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Se(e,Me.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},i}(E),je=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){Se(e,Me.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(E),De=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){if(!this.jsonString)throw new L(Ie.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){Se(e,Me.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},i}(E),Pe=function(e){function i(){var t=e.call(this)||this;return t._event="",t}return t(i,e),Object.defineProperty(i.prototype,"event",{get:function(){return this._event},set:function(e){Se(e,Me.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},i}(E),ze=s.scorm12,xe=s.global,Ve=c.scorm12,Fe=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,Ve,t)||this).cmi=new ve,i.nav=new Pe,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},i.prototype.lmsFinish=function(){var e=this.terminate("LMSFinish",!0);return e===xe.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),e},i.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},i.prototype.lmsSetValue=function(e,t){return this.setValue("LMSSetValue","LMSCommit",!1,e,t)},i.prototype.lmsCommit=function(){return this.commit("LMSCommit",!1)},i.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},i.prototype.getChildElement=function(e,t,i){return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?new Ae:i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new De:i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new je:!i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")?new Re:null},i.prototype.validateCorrectResponse=function(e,t){},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),ze.error_descriptions[e]&&(i=ze.error_descriptions[e].basicMessage,r=ze.error_descriptions[e].detailMessage),t?r:i},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=P(t);switch(this.settings.dataCommitFormat){case"flattened":return P(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.storeData=function(e){var t,i,r;if(e){var n=this.cmi.core.lesson_status;"not attempted"===n&&(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?this.cmi.core.lesson_status="passed":this.cmi.core.lesson_status="failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(r=null===(i=null===(t=this.startingData)||void 0===t?void 0:t.cmi)||void 0===i?void 0:i.core)||void 0===r?void 0:r.lesson_status)||"")&&"not attempted"===n&&(this.cmi.core.lesson_status="browsed")}var o=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);return this.apiLogLevel===xe.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(o)),"string"==typeof this.settings.lmsCommitUrl?this.processHttpRequest(this.settings.lmsCommitUrl,o,e):{result:xe.SCORM_TRUE,errorCode:0}},i}(k),Ge=s.aicc,ke=u.aicc,Ue=c.scorm12;function Ye(e,t,i){return f(e,t,Ue.TYPE_MISMATCH,C,i)}var qe=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this,Ge.cmi_children)||this;return t&&i.initialize(),i.student_preference=new Je,i.student_data=new Be,i.student_demographics=new Ze,i.evaluation=new He,i.paths=new We,i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},i}(ve),He=function(e){function i(){var t=e.call(this)||this;return t.comments=new $e,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},i}(E),$e=function(e){function i(){return e.call(this,{children:Ge.comments_children,errorCode:Ue.INVALID_SET_VALUE,errorClass:C})||this}return t(i,e),i}(M),Je=function(e){function i(){var t=e.call(this,Ge.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new M({errorCode:Ue.INVALID_SET_VALUE,errorClass:C,children:""}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){Ye(e,ke.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_color",{get:function(){return this._text_color},set:function(e){Ye(e,ke.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_location",{get:function(){return this._text_location},set:function(e){Ye(e,ke.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_size",{get:function(){return this._text_size},set:function(e){Ye(e,ke.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"video",{get:function(){return this._video},set:function(e){Ye(e,ke.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},i}(we),Be=function(e){function i(){var t=e.call(this,Ge.student_data_children)||this;return t._tries_during_lesson="",t.tries=new Ke,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries};return delete this.jsonString,e},i}(Te),Ze=function(e){function i(){var t=e.call(this)||this;return t.__children=Ge.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new C(Ue.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},i}(E),We=function(e){function i(){return e.call(this,{children:Ge.paths_children})||this}return t(i,e),i}(M),Ke=(function(e){function i(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}t(i,e),Object.defineProperty(i.prototype,"location_id",{get:function(){return this._location_id},set:function(e){Ye(e,ke.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){Ye(e,ke.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Ye(e,ke.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Ye(e,ke.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"why_left",{get:function(){return this._why_left},set:function(e){Ye(e,ke.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){Ye(e,ke.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e}}(E),function(e){function i(){return e.call(this,{children:Ge.tries_children})||this}return t(i,e),i}(M)),Qe=function(e){function i(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new b({score_children:Ge.score_children,score_range:ke.score_range,invalidErrorCode:Ue.INVALID_SET_VALUE,invalidTypeCode:Ue.TYPE_MISMATCH,invalidRangeCode:Ue.VALUE_OUT_OF_RANGE,errorClass:C}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Ye(e,ke.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Ye(e,ke.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},i}(E),Xe=(function(e){function i(){return e.call(this,{children:Ge.attempt_records_children})||this}t(i,e)}(M),function(e){function i(){var t=e.call(this)||this;return t._lesson_status="",t.score=new b({score_children:Ge.score_children,score_range:ke.score_range,invalidErrorCode:Ue.INVALID_SET_VALUE,invalidTypeCode:Ue.TYPE_MISMATCH,invalidRangeCode:Ue.VALUE_OUT_OF_RANGE,errorClass:C}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){Ye(e,ke.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},i}(E)),et=function(e){function i(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return t(i,e),Object.defineProperty(i.prototype,"content",{get:function(){return this._content},set:function(e){Ye(e,ke.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){Ye(e,ke.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Ye(e,ke.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},i}(E),tt=function(e){function i(t){var i=e.call(this,t)||this;return i.cmi=new qe,i.nav=new Pe,i}return t(i,e),i.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||(this.stringMatches(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new et:this.stringMatches(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new Qe:this.stringMatches(t,"cmi\\.student_data\\.attempt_records\\.\\d+")&&(n=new Xe)),n},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},i}(Fe);window.Scorm12API=Fe,window.Scorm2004API=ye,window.AICC=tt}();
1
+ !function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)};function r(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var o=function(){function e(){this.jsonString=!1,this._initialized=!1}return Object.defineProperty(e.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start_time",{get:function(){return this._start_time},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){this._initialized=!0},e.prototype.setStartTime=function(){this._start_time=(new Date).getTime()},e}(),s=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i}(o),a={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},c={scorm12:i(i({},a),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:i(i({},a),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})},l={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},u={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:l,aicc:i(i({},l),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}},_=u.scorm12.error_descriptions,h=u.aicc.error_descriptions,d=u.scorm2004.error_descriptions,m=function(e){function i(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return t(i,e),Object.defineProperty(i.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),i.prototype.setMessage=function(e){this.message=e},i}(Error),p=function(e){function i(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return t(i,e),Object.defineProperty(i.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),i}(m),f=function(e){function i(t){return{}.hasOwnProperty.call(_,String(t))?e.call(this,t,_[String(t)].basicMessage,_[String(t)].detailMessage)||this:e.call(this,101,_[101].basicMessage,_[101].detailMessage)||this}return t(i,e),i}(p),g=function(e){function i(t){return{}.hasOwnProperty.call(h,String(t))?e.call(this,t,h[String(t)].basicMessage,h[String(t)].detailMessage)||this:e.call(this,101,h[101].basicMessage,h[101].detailMessage)||this}return t(i,e),i}(p),E=function(e){function i(t){return{}.hasOwnProperty.call(d,String(t))?e.call(this,t,d[String(t)].basicMessage,d[String(t)].detailMessage)||this:e.call(this,101,d[101].basicMessage,d[101].detailMessage)||this}return t(i,e),i}(p),b=c.scorm12,y=function(e){function i(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||b.GENERAL,i._errorClass=t.errorClass||m,i.childArray=[],i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e},i}(o),M=3600,I={D:24*M,H:M,M:60,S:1};function S(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/M),i=new Date(1e3*e),r=i.getUTCMinutes(),n=i.getSeconds(),o=e%1,s="";return C(o)>0&&(s="."+(s=C(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+s}function v(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in I){var n=I[r],o=Math.floor(i/n);C(i%=n)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(o+=i),o&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(o).concat(r))}return t}function O(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function L(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function T(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n<o;n++)e(i[n],r+"["+n+"]"),0===o&&(t[r]=[]);else{var s=!0;for(var a in i)({}).hasOwnProperty.call(i,a)&&(s=!1,e(i[a],r?r+"."+a:a));s&&r&&(t[r]={})}}(e,""),t}function C(e){return Math.floor(e)===e||String(e).indexOf(".")<0?0:e.toString().split(".")[1].length||0}function w(e,t){return null!==(null==e?void 0:e.match(t))}var N={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:u.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return r(this,void 0,void 0,(function(){var t,i,r;return n(this,(function(n){switch(n.label){case 0:return void 0===e?[3,2]:(r=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=r.apply(i,[n.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===u.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:u.global.SCORM_TRUE,errorCode:0}]:[2,{result:u.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:u.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case u.global.LOG_LEVEL_ERROR:console.error(t);break;case u.global.LOG_LEVEL_WARNING:console.warn(t);break;case u.global.LOG_LEVEL_INFO:console.info(t);break;case u.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},R=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||r(e,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),A=function(){function e(t,i){var r=this.constructor;if(this._settings=N,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=u.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=i(i({},this.settings),e),this.currentState=u.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=u.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=u.global.STATE_INITIALIZED,this.lastErrorCode="0",r=u.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=function(e,t,i){for(var r="",n=20-(r+=e).length,o=0;o<n;o++)r+=" ";if(r+=": ",i){n=70-(r+=i).length;for(var s=0;s<n;s++)r+=" "}return t&&(r+=t),r}(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=i(i({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return r(this,void 0,void 0,(function(){var i,r;return n(this,(function(n){switch(n.label){case 0:return i=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=u.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:u.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=u.global.SCORM_TRUE,this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,u.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=u.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=u.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,u.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return r(this,arguments,void 0,(function(e,t){var i,r;return void 0===t&&(t=!1),n(this,(function(n){switch(n.label){case 0:return this.clearScheduledCommit(),i=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:u.global.SCORM_FALSE,this.apiLog(e," Result: "+i,u.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,u.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,n){if(!r||""===r)return u.global.SCORM_FALSE;for(var o=r.split("."),s=this,a=u.global.SCORM_FALSE,c=!1,l="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),_=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,h=0;h<o.length;h++){var d=o[h];if(h===o.length-1)t&&"{target="===d.substring(0,8)?this.isInitialized()?this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT):s=i(i({},s),{attribute:n}):this._checkObjectHasProperty(s,d)?(w(r,"\\.correct_responses\\.\\d+")&&this.isInitialized()&&this.validateCorrectResponse(r,n),t&&"0"!==this.lastErrorCode||(s[d]=n,a=u.global.SCORM_TRUE)):this.throwSCORMError(_,l);else{if(!(s=s[d])){this.throwSCORMError(_,l);break}if(s instanceof y){var m=parseInt(o[h+1],10);if(!isNaN(m)){var p=s.childArray[m];if(p)s=p,c=!0;else{var f=this.getChildElement(r,n,c);c=!0,f?(s.initialized&&f.initialize(),s.childArray.push(f),s=f):this.throwSCORMError(_,l)}h++}}}}return a===u.global.SCORM_FALSE&&this.apiLog(e,"There was an error setting the value for: ".concat(r,", value of: ").concat(n),u.global.LOG_LEVEL_WARNING),a},e.prototype._commonGetCMIValue=function(e,t,i){if(!i||""===i)return"";for(var r=i.split("."),n=this,o=null,s="The data model element passed to ".concat(e," (").concat(i,") has not been initialized."),a="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),l=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,u=0;u<r.length;u++){if(o=r[u],t){if("{target="===String(o).substring(0,8)&&"function"==typeof n._isTargetValid){var _=String(o).substring(8,String(o).length-9);return n._isTargetValid(_)}if(!this._checkObjectHasProperty(n,o))return void this.throwSCORMError(l,a)}else if(u===r.length-1&&!this._checkObjectHasProperty(n,o))return void this.throwSCORMError(l,a);if(void 0===(n=n[o])){this.throwSCORMError(l,a);break}if(n instanceof y){var h=parseInt(r[u+1],10);if(!isNaN(h)){var d=n.childArray[h];if(!d){this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED,s);break}n=d,u++}}}if(null!=n)return n;t||("_children"===o?this.throwSCORMError(c.scorm12.CHILDREN_ERROR):"_count"===o&&this.throwSCORMError(c.scorm12.COUNT_ERROR))},e.prototype.isInitialized=function(){return this.currentState===u.global.STATE_INITIALIZED},e.prototype.isNotInitialized=function(){return this.currentState===u.global.STATE_NOT_INITIALIZED},e.prototype.isTerminated=function(){return this.currentState===u.global.STATE_TERMINATED},e.prototype.on=function(e,t){if(t)for(var i=e.split(" "),r=0;r<i.length;r++){var n=i[r].split(".");if(0===n.length)return;var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),u.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),u.global.LOG_LEVEL_INFO,s))},n=this,o=0;o<i.length;o++){var s=r(o);if("object"==typeof s)return s.value}},e.prototype.clear=function(e){for(var t=e.split(" "),i=function(i){var n=t[i].split(".");if(0===n.length)return{value:void 0};var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;n<t.length;n++){var o=i(n);if("object"==typeof o)return o.value}},e.prototype.processListeners=function(e,t,i){this.apiLog(e,i,u.global.LOG_LEVEL_INFO,t);for(var r=0;r<this.listenerArray.length;r++){var n=this.listenerArray[r],o=n.functionName===e,s=!!n.CMIElement,a=!1;a=t&&n.CMIElement&&"*"===n.CMIElement.substring(n.CMIElement.length-1)?0===t.indexOf(n.CMIElement.substring(0,n.CMIElement.length-1)):n.CMIElement===t,!o||s&&!a||(this.apiLog("processListeners","Processing listener: ".concat(n.functionName),u.global.LOG_LEVEL_INFO,t),n.callback(t,i))}},e.prototype.throwSCORMError=function(e,t){t||(t=this.getLmsErrorMessageDetails(e)),this.apiLog("throwSCORMError",e+": "+t,u.global.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)},e.prototype.clearSCORMError=function(e){void 0!==e&&e!==u.global.SCORM_FALSE&&(this.lastErrorCode="0")},e.prototype.loadFromFlattenedJSON=function(e,t){var i=this;if(t||(t=""),this.isNotInitialized()){var r,n=/^(cmi\.interactions\.)(\d+)\.(.*)$/,o=/^(cmi\.objectives\.)(\d+)\.(.*)$/,s=Object.keys(e).map((function(t){return[String(t),e[t]]}));s.sort((function(e,t){var i,r=e[0],s=(e[1],t[0]);t[1];return null!==(i=a(r,s,n))||null!==(i=a(r,s,o))?i:r<s?-1:r>s?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){for(var n=i,o="",s=t.exec(r);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(r);n[o]=e[r]}return i[""]||i}(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o<n.childArray.length;o++)this.loadFromJSON(n.childArray[o],r+"."+o);else n.constructor===Object?this.loadFromJSON(n,r):this.setCMIValue(r,n)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")},e.prototype.renderCMIToJSONString=function(){var e=this.cmi;return this.settings.sendFullCommit?JSON.stringify({cmi:e}):JSON.stringify({cmi:e},(function(e,t){return void 0===t?null:t}),2)},e.prototype.renderCMIToJSONObject=function(){return JSON.parse(this.renderCMIToJSONString())},e.prototype.processHttpRequest=function(e,t){return r(this,arguments,void 0,(function(e,t,i){var o,s,a,c,l=this;return void 0===i&&(i=!1),n(this,(function(_){switch(_.label){case 0:return o=this,s={result:u.global.SCORM_FALSE,errorCode:this.error_codes.GENERAL},i?(this.performFetch(e,t).then((function(e){return r(l,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.transformResponse(e)];case 1:return t.sent(),[2]}}))}))})),[2,{result:u.global.SCORM_TRUE,errorCode:0}]):(a=function(e,t,i){return r(l,void 0,void 0,(function(){var r,a;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=i.requestHandler(t),[4,this.performFetch(e,t)];case 1:return r=n.sent(),[2,this.transformResponse(r)];case 2:return a=n.sent(),this.apiLog("processHttpRequest",a,u.global.LOG_LEVEL_ERROR),o.processListeners("CommitError"),[2,s];case 3:return[2]}}))}))},this.settings.asyncCommit?(c=function(e,t,i){var r;return void 0===i&&(i=!1),function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=this,a=i&&!r;r&&clearTimeout(r),r=setTimeout((function(){r=null,i||e.apply(s,n)}),t),a&&e.apply(s,n)}}(a,500,i),c(e,t,this.settings),[2,{result:u.global.SCORM_TRUE,errorCode:0}]):[3,1]);case 1:return[4,a(e,t,this.settings)];case 2:return[2,_.sent()]}}))}))},e.prototype.scheduleCommit=function(e,t){this._timeout=new R(this,e,t),this.apiLog("scheduleCommit","scheduled",u.global.LOG_LEVEL_DEBUG,"")},e.prototype.clearScheduledCommit=function(){this._timeout&&(this._timeout.cancel(),this._timeout=void 0,this.apiLog("clearScheduledCommit","cleared",u.global.LOG_LEVEL_DEBUG,""))},e.prototype._checkObjectHasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)||null!=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e},e.prototype.handleValueAccessException=function(e,t){return e instanceof p?(this.lastErrorCode=String(e.errorCode),t=u.global.SCORM_FALSE):(e instanceof Error&&e.message?console.error(e.message):console.error(e),this.throwSCORMError(this._error_codes.GENERAL)),t},e.prototype.performFetch=function(e,t){return r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,fetch(e,{method:"POST",body:t instanceof Array?t.join("&"):JSON.stringify(t),headers:i(i({},this.settings.xhrHeaders),{"Content-Type":this.settings.commitRequestDataType}),credentials:this.settings.xhrWithCredentials?"include":void 0,keepalive:!0})]}))}))},e.prototype.transformResponse=function(e){return r(this,void 0,void 0,(function(){var t,i;return n(this,(function(r){switch(r.label){case 0:return"function"!=typeof this.settings.responseHandler?[3,2]:[4,this.settings.responseHandler(e)];case 1:return i=r.sent(),[3,4];case 2:return[4,e.json()];case 3:i=r.sent(),r.label=4;case 4:return t=i,e.status>=200&&e.status<=299&&(!0===t.result||t.result===u.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),j=A,D={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},P={aicc:i(i({},D),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:D,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};function z(e,t,i,r,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new r(i);return!0}function x(e,t,i,r){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}function V(e,t,i){return z(e,t,c.scorm2004.TYPE_MISMATCH,E,i)}function F(e,t){return x(e,t,c.scorm2004.VALUE_OUT_OF_RANGE,E)}var G,U=function(e){function i(){var t=e.call(this)||this;return t.__children=u.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(c.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){V(e,P.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){V(e,P.scorm2004.CMISInteger)&&F(e,P.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},i}(o),Y=P.scorm2004,k={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:Y.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:Y.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:Y.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:Y.CMIShortIdentifier,format2:Y.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+Y.CMIShortIdentifier,format2:Y.CMIDecimal+"|^$|"+Y.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:Y.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:Y.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:Y.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:Y.CMIString4000,max:1,delimiter:"",unique:!1}},q={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:Y.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:Y.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:Y.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:Y.CMIShortIdentifier,format2:Y.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+Y.CMIShortIdentifier,format2:Y.CMIDecimal+"|^$|"+Y.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:Y.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:Y.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:Y.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:Y.CMIString4000,limit:1}},H=function(e){function i(){return e.call(this,{children:u.scorm2004.interactions_children,errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E})||this}return t(i,e),i}(y),$=function(e){function i(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new y({errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E,children:u.scorm2004.objectives_children}),t.correct_responses=new y({errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E,children:u.scorm2004.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){V(e,P.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=k[this.type];if(!i)throw new E(c.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new E(c.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n<t.length;n++)if(null==i?void 0:i.delimiter2){var o=t[n].split(i.delimiter2);if(2!==o.length)throw new E(c.scorm2004.TYPE_MISMATCH);if(!o[0].match(r))throw new E(c.scorm2004.TYPE_MISMATCH);if(!i.format2||!o[1].match(new RegExp(i.format2)))throw new E(c.scorm2004.TYPE_MISMATCH)}else{if(!t[n].match(r))throw new E(c.scorm2004.TYPE_MISMATCH);if(""!==t[n]&&i.unique)for(var s=0;s<n;s++)if(t[n]===t[s])throw new E(c.scorm2004.TYPE_MISMATCH)}this._learner_response=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){return this._result},set:function(e){V(e,P.scorm2004.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){return this._latency},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"description",{get:function(){return this._description},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMILangString250,!0)&&(this._description=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,type:this.type,objectives:this.objectives,timestamp:this.timestamp,weighting:this.weighting,learner_response:this.learner_response,result:this.result,latency:this.latency,description:this.description,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(o),B=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){V(e,P.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(o),J=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){return this._pattern},set:function(e){V(e,P.scorm2004.CMIFeedback)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e},i}(o),Z=u.scorm12,W=P.scorm12,K=c.scorm12,Q=function(e){function i(t){var i=e.call(this)||this;return i._raw="",i._min="",i.__children=t.score_children||Z.score_children,i.__score_range=!!t.score_range&&W.score_range,i._max=t.max||""===t.max?t.max:"100",i.__invalid_error_code=t.invalidErrorCode||K.INVALID_SET_VALUE,i.__invalid_type_code=t.invalidTypeCode||K.TYPE_MISMATCH,i.__invalid_range_code=t.invalidRangeCode||K.VALUE_OUT_OF_RANGE,i.__decimal_regex=t.decimalRegex||W.CMIDecimal,i.__error_class=t.errorClass,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this.__error_class(this.__invalid_error_code)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"raw",{get:function(){return this._raw},set:function(e){!z(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!x(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"min",{get:function(){return this._min},set:function(e){!z(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!x(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max",{get:function(){return this._max},set:function(e){!z(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!x(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},i}(o),X=function(e){function i(){var t=e.call(this,{score_children:u.scorm2004.score_children,max:"",invalidErrorCode:c.scorm2004.READ_ONLY_ELEMENT,invalidTypeCode:c.scorm2004.TYPE_MISMATCH,invalidRangeCode:c.scorm2004.VALUE_OUT_OF_RANGE,decimalRegex:P.scorm2004.CMIDecimal,errorClass:E})||this;return t._scaled="",t}return t(i,e),Object.defineProperty(i.prototype,"scaled",{get:function(){return this._scaled},set:function(e){V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.scaled_range)&&(this._scaled=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={scaled:this.scaled,raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},i}(Q),ee=function(e){function i(){return e.call(this,{children:u.scorm2004.comments_children,errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E})||this}return t(i,e),i}(y),te=function(e){function i(){return e.call(this,{children:u.scorm2004.comments_children,errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E})||this}return t(i,e),i}(y),ie=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this)||this;return i._comment="",i._location="",i._timestamp="",i._comment="",i._location="",i._timestamp="",i._readOnlyAfterInit=t,i}return t(i,e),Object.defineProperty(i.prototype,"comment",{get:function(){return this._comment},set:function(e){if(this.initialized&&this._readOnlyAfterInit)throw new E(c.scorm2004.READ_ONLY_ELEMENT);V(e,P.scorm2004.CMILangString4000,!0)&&(this._comment=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){if(this.initialized&&this._readOnlyAfterInit)throw new E(c.scorm2004.READ_ONLY_ELEMENT);V(e,P.scorm2004.CMIString250)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&this._readOnlyAfterInit)throw new E(c.scorm2004.READ_ONLY_ELEMENT);V(e,P.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={comment:this.comment,location:this.location,timestamp:this.timestamp};return delete this.jsonString,e},i}(o),re=function(e){function i(){return e.call(this,{children:u.scorm2004.objectives_children,errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E})||this}return t(i,e),i}(y),ne=function(e){function i(){var t=e.call(this)||this;return t._id="",t._success_status="unknown",t._completion_status="unknown",t._progress_measure="",t._description="",t.score=new X,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){V(e,P.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"success_status",{get:function(){return this._success_status},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMISStatus)&&(this._success_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completion_status",{get:function(){return this._completion_status},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMICStatus)&&(this._completion_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"progress_measure",{get:function(){return this._progress_measure},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.progress_range)&&(this._progress_measure=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"description",{get:function(){return this._description},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMILangString250,!0)&&(this._description=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,success_status:this.success_status,completion_status:this.completion_status,progress_measure:this.progress_measure,description:this.description,score:this.score};return delete this.jsonString,e},i}(o),oe=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this)||this;return i.__version="1.0",i.__children=u.scorm2004.cmi_children,i._completion_status="unknown",i._completion_threshold="",i._credit="credit",i._entry="",i._exit="",i._launch_data="",i._learner_id="",i._learner_name="",i._location="",i._max_time_allowed="",i._mode="normal",i._progress_measure="",i._scaled_passing_score="",i._session_time="PT0H0M0S",i._success_status="unknown",i._suspend_data="",i._time_limit_action="continue,no message",i._total_time="",i.learner_preference=new U,i.score=new X,i.comments_from_learner=new te,i.comments_from_lms=new ee,i.interactions=new H,i.objectives=new re,t&&i.initialize(),i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o,s;e.prototype.initialize.call(this),null===(t=this.learner_preference)||void 0===t||t.initialize(),null===(i=this.score)||void 0===i||i.initialize(),null===(r=this.comments_from_learner)||void 0===r||r.initialize(),null===(n=this.comments_from_lms)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize(),null===(s=this.objectives)||void 0===s||s.initialize()},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new E(c.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(c.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completion_status",{get:function(){return this._completion_status},set:function(e){V(e,P.scorm2004.CMICStatus)&&(this._completion_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completion_threshold",{get:function(){return this._completion_threshold},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._completion_threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new E(c.scorm2004.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){V(e,P.scorm2004.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_id",{get:function(){return this._learner_id},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._learner_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_name",{get:function(){return this._learner_name},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._learner_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){V(e,P.scorm2004.CMIString1000)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"progress_measure",{get:function(){return this._progress_measure},set:function(e){V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.progress_range)&&(this._progress_measure=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scaled_passing_score",{get:function(){return this._scaled_passing_score},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._scaled_passing_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new E(c.scorm2004.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){V(e,P.scorm2004.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"success_status",{get:function(){return this._success_status},set:function(e){V(e,P.scorm2004.CMISStatus)&&(this._success_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){V(e,P.scorm2004.CMIString64000,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){var e=this._session_time,t=this.start_time;null!=t&&(e=v(((new Date).getTime()-t)/1e3));return function(e,t,i){var r="string"==typeof i?new RegExp(i):i;return v(L(e,r)+L(t,r))}(this._total_time,e,P.scorm2004.CMITimespan)},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments_from_learner:this.comments_from_learner,comments_from_lms:this.comments_from_lms,completion_status:this.completion_status,completion_threshold:this.completion_threshold,credit:this.credit,entry:this.entry,exit:this.exit,interactions:this.interactions,launch_data:this.launch_data,learner_id:this.learner_id,learner_name:this.learner_name,learner_preference:this.learner_preference,location:this.location,max_time_allowed:this.max_time_allowed,mode:this.mode,objectives:this.objectives,progress_measure:this.progress_measure,scaled_passing_score:this.scaled_passing_score,score:this.score,session_time:this.session_time,success_status:this.success_status,suspend_data:this.suspend_data,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(s),se=["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mo","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","sh","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu","aar","abk","ave","afr","aka","amh","arg","ara","asm","ava","aym","aze","bak","bel","bul","bih","bis","bam","ben","tib","bod","bre","bos","cat","che","cha","cos","cre","cze","ces","chu","chv","wel","cym","dan","ger","deu","div","dzo","ewe","gre","ell","eng","epo","spa","est","baq","eus","per","fas","ful","fin","fij","fao","fre","fra","fry","gle","gla","glg","grn","guj","glv","hau","heb","hin","hmo","hrv","hat","hun","arm","hye","her","ina","ind","ile","ibo","iii","ipk","ido","ice","isl","ita","iku","jpn","jav","geo","kat","kon","kik","kua","kaz","kal","khm","kan","kor","kau","kas","kur","kom","cor","kir","lat","ltz","lug","lim","lin","lao","lit","lub","lav","mlg","mah","mao","mri","mac","mkd","mal","mon","mol","mar","may","msa","mlt","bur","mya","nau","nob","nde","nep","ndo","dut","nld","nno","nor","nbl","nav","nya","oci","oji","orm","ori","oss","pan","pli","pol","pus","por","que","roh","run","rum","ron","rus","kin","san","srd","snd","sme","sag","slo","sin","slk","slv","smo","sna","som","alb","sqi","srp","ssw","sot","sun","swe","swa","tam","tel","tgk","tha","tir","tuk","tgl","tsn","ton","tur","tso","tat","twi","tah","uig","ukr","urd","uzb","ven","vie","vol","wln","wol","xho","yid","yor","zha","chi","zho","zul"];!function(e){e.unknown="unknown",e.true="true",e.false="false"}(G||(G={}));var ae=function(e){function i(){var t=e.call(this)||this;return t.nav=new ce,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.nav)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={nav:this.nav};return delete this.jsonString,e},i}(o),ce=function(e){function i(){var t=e.call(this)||this;return t._request="_none_",t.request_valid=new le,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.request_valid)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"request",{get:function(){return this._request},set:function(e){V(e,P.scorm2004.NAVEvent)&&(this._request=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={request:this.request};return delete this.jsonString,e},i}(o),le=function(e){function i(){var t=e.call(this)||this;return t._continue="unknown",t._previous="unknown",t._choice={},t._jump={},t}return t(i,e),Object.defineProperty(i.prototype,"continue",{get:function(){return this._continue},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);V(e,P.scorm2004.NAVBoolean)&&(this._continue=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"previous",{get:function(){return this._previous},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);V(e,P.scorm2004.NAVBoolean)&&(this._previous=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"choice",{get:function(){return this._choice},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);if("object"!=typeof e)throw new E(c.scorm2004.TYPE_MISMATCH);for(var t in e)({}).hasOwnProperty.call(e,t)&&V(e[t],P.scorm2004.NAVBoolean)&&V(t,P.scorm2004.NAVTarget)&&(this._choice[t]=G[e[t]])},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"jump",{get:function(){return this._jump},set:function(e){if(this.initialized)throw new E(c.scorm2004.READ_ONLY_ELEMENT);if("object"!=typeof e)throw new E(c.scorm2004.TYPE_MISMATCH);for(var t in e)({}).hasOwnProperty.call(e,t)&&V(e[t],P.scorm2004.NAVBoolean)&&V(t,P.scorm2004.NAVTarget)&&(this._jump[t]=G[e[t]])},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={previous:this._previous,continue:this._continue,choice:this._choice,jump:this._jump};return delete this.jsonString,e},i}(o),ue=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,c.scorm2004,t)||this)._version="1.0",i.cmi=new oe,i.adl=new ae,i.Initialize=i.lmsInitialize,i.Terminate=i.lmsFinish,i.GetValue=i.lmsGetValue,i.SetValue=i.lmsSetValue,i.Commit=i.lmsCommit,i.GetLastError=i.lmsGetLastError,i.GetErrorString=i.lmsGetErrorString,i.GetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),i.prototype.reset=function(e){this.commonReset(e),this.cmi=new oe,this.adl=new ae},Object.defineProperty(i.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.initialize("Initialize")},i.prototype.lmsFinish=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.internalFinish=function(){return r(this,void 0,void 0,(function(){var e,t,i,r,o,s,a;return n(this,(function(n){switch(n.label){case 0:return[4,this.terminate("Terminate",!0)];case 1:return(e=n.sent())===u.global.SCORM_TRUE&&("_none_"!==this.adl.nav.request?(t={continue:"SequenceNext",previous:"SequencePrevious",choice:"SequenceChoice",jump:"SequenceJump",exit:"SequenceExit",exitAll:"SequenceExitAll",abandon:"SequenceAbandon",abandonAll:"SequenceAbandonAll"},i=this.adl.nav.request,r=new RegExp(P.scorm2004.NAVEvent),o=i.match(r),s="",o&&o.length>2&&(s=o[2],i=o[1].replace(s,"")),(a=t[i])&&this.processListeners(a,"adl.nav.request",s)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},i.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if(w(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},i.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},i.prototype.lmsCommit=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},i.prototype.getChildElement=function(e,t,i){if(w(e,"cmi\\.objectives\\.\\d+"))return new ne;if(i){if(w(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if(w(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new B}else if(w(e,"cmi\\.interactions\\.\\d+"))return new $;return w(e,"cmi\\.comments_from_learner\\.\\d+")?new ie:w(e,"cmi\\.comments_from_lms\\.\\d+")?new ie(!0):null},i.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=q[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new J:null},i.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},i.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r<i&&"0"===this.lastErrorCode;r++){e.correct_responses.childArray[r].pattern===t&&this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE)}},i.prototype.validateCorrectResponse=function(e,t){var i=e.split("."),r=Number(i[2]),n=Number(i[4]),o=this.cmi.interactions.childArray[r],s=o.correct_responses._count;this.checkDuplicateChoiceResponse(o,t);var a=q[o.type];void 0===a.limit||s<=a.limit?(this.checkValidResponseType(a,t,o.type),"0"===this.lastErrorCode&&(!a.duplicate||!this.checkDuplicatedPattern(o.correct_responses,n,t))||"0"===this.lastErrorCode&&""===t||"0"===this.lastErrorCode&&this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Already Exists")):this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Collection Limit Reached")},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("GetValue",!0,e)},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="",r="";return e=String(e),u.scorm2004.error_descriptions[e]&&(i=u.scorm2004.error_descriptions[e].basicMessage,r=u.scorm2004.error_descriptions[e].detailMessage),t?r:i},i.prototype.checkDuplicatedPattern=function(e,t,i){for(var r=!1,n=e._count,o=0;o<n&&!r;o++)o!==t&&e.childArray[o]===i&&(r=!0);return r},i.prototype.checkCorrectResponseValue=function(e,t,i){for(var r=q[e],n=new RegExp(r.format),o=0;o<t.length&&"0"===this.lastErrorCode;o++)if(e.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")&&(t[o]=this.removeCorrectResponsePrefixes(t[o])),null==r?void 0:r.delimiter2){var s=t[o].split(r.delimiter2);if(2===s.length)(a=s[0].match(n))&&r.format2&&s[1].match(new RegExp(r.format2))||this.throwSCORMError(c.scorm2004.TYPE_MISMATCH);else this.throwSCORMError(c.scorm2004.TYPE_MISMATCH)}else{var a;if(!(a=t[o].match(n))&&""!==i||!a&&"true-false"===e)this.throwSCORMError(c.scorm2004.TYPE_MISMATCH);else if("numeric"===e&&t.length>1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var l=0;l<o&&"0"===this.lastErrorCode;l++)t[o]===t[l]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH)}},i.prototype.removeCorrectResponsePrefixes=function(e){for(var t=!1,i=!1,r=!1,n=new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"),o=e.match(n),s=null;o;){switch(o[2]){case"lang":if(s=e.match(P.scorm2004.CMILangcr)){var a=s[3];void 0!==a&&a.length>0&&(se.includes(a.toLowerCase())||this.throwSCORMError(c.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=T(t);switch(this.settings.dataCommitFormat){case"flattened":return T(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.storeData=function(e){return r(this,void 0,void 0,(function(){var t,i,r,o,s,a;return n(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(a=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.adl)||void 0===s?void 0:s.nav)||void 0===a?void 0:a.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return r=n.sent(),t&&void 0!==r.navRequest&&""!==r.navRequest&&Function('"use strict";(() => { '.concat(r.navRequest," })()"))(),[2,r];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},i}(j);function _e(e,t,i){return z(e,t,c.scorm12.TYPE_MISMATCH,f,i)}function he(e,t,i){if(!i&&""===e)throw new f(c.scorm12.VALUE_OUT_OF_RANGE);return x(e,t,c.scorm12.VALUE_OUT_OF_RANGE,f)}var de=function(e){function i(){var t=e.call(this)||this;return t.__children=u.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new Q({score_children:u.scorm12.score_children,score_range:P.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){_e(e,P.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?_e(e,P.scorm12.CMIStatus)&&(this._lesson_status=e):_e(e,P.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){_e(e,P.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){_e(e,P.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){_e(e,P.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(e){var t,i,r,n=this._session_time,o=e;null!=o&&(n=S(((new Date).getTime()-o)/1e3));return t=this._total_time,i=n,"string"==typeof(r=new RegExp(P.scorm12.CMITimespan))&&(r=new RegExp(r)),S(O(t,r)+O(i,r))},i.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},i}(o),me=function(e){function i(){return e.call(this,{children:u.scorm12.objectives_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(i,e),i}(y),pe=function(e){function i(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new Q({score_children:u.scorm12.score_children,score_range:P.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){_e(e,P.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){_e(e,P.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},i}(o),fe=function(e){function i(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||u.scorm12.student_data_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(o),ge=function(e){function i(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||u.scorm12.student_preference_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio",{get:function(){return this._audio},set:function(e){_e(e,P.scorm12.CMISInteger)&&he(e,P.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){_e(e,P.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this._speed},set:function(e){_e(e,P.scorm12.CMISInteger)&&he(e,P.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this._text},set:function(e){_e(e,P.scorm12.CMISInteger)&&he(e,P.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},i}(o),Ee=function(e){function i(){return e.call(this,{children:u.scorm12.interactions_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(i,e),i}(y),be=function(e){function i(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new y({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.objectives_children}),t.correct_responses=new y({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){_e(e,P.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){_e(e,P.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){_e(e,P.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){_e(e,P.scorm12.CMIDecimal)&&he(e,P.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_response",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){_e(e,P.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){_e(e,P.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){_e(e,P.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(o),ye=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){_e(e,P.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(o),Me=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){_e(e,P.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},i}(o),Ie=function(e){function i(t,i,r){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",r&&n.initialize(),n.__children=t||u.scorm12.cmi_children,n.core=new de,n.objectives=new me,n.student_data=i||new fe,n.student_preference=new ge,n.interactions=new Ee,n}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments",{get:function(){return this._comments},set:function(e){_e(e,P.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},i}(s),Se=function(e){function i(){var t=e.call(this)||this;return t._event="",t}return t(i,e),Object.defineProperty(i.prototype,"event",{get:function(){return this._event},set:function(e){_e(e,P.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},i}(o),ve=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,c.scorm12,t)||this).statusSetByModule=!1,i.cmi=new Ie,i.nav=new Se,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),i.prototype.reset=function(e){this.commonReset(e),this.cmi=new Ie,this.nav=new Se},i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},i.prototype.lmsFinish=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.internalFinish=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===u.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},i.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},i.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},i.prototype.lmsCommit=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},i.prototype.getChildElement=function(e,t,i){return w(e,"cmi\\.objectives\\.\\d+")?new pe:i&&w(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new Me:i&&w(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new ye:!i&&w(e,"cmi\\.interactions\\.\\d+")?new be:null},i.prototype.validateCorrectResponse=function(e,t){},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),u.scorm12.error_descriptions[e]&&(i=u.scorm12.error_descriptions[e].basicMessage,r=u.scorm12.error_descriptions[e].detailMessage),t?r:i},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=T(t);switch(this.settings.dataCommitFormat){case"flattened":return T(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.storeData=function(e){return r(this,void 0,void 0,(function(){var t,i,r,o,s;return n(this,(function(n){switch(n.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(s=null===(o=null===(r=this.startingData)||void 0===r?void 0:r.cmi)||void 0===o?void 0:o.core)||void 0===s?void 0:s.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return[2,n.sent()];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},i}(j),Oe=c.scorm12;function Le(e,t,i){return z(e,t,Oe.TYPE_MISMATCH,g,i)}var Te=function(e){function i(){var t=e.call(this)||this;return t.comments=new Ce,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},i}(o),Ce=function(e){function i(){return e.call(this,{children:u.aicc.comments_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:g})||this}return t(i,e),i}(y),we=function(e){function i(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return t(i,e),Object.defineProperty(i.prototype,"content",{get:function(){return this._content},set:function(e){Le(e,P.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){Le(e,P.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Le(e,P.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},i}(o),Ne=function(e){function i(){var t=e.call(this,u.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new y({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:g,children:""}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){Le(e,P.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_color",{get:function(){return this._text_color},set:function(e){Le(e,P.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_location",{get:function(){return this._text_location},set:function(e){Le(e,P.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_size",{get:function(){return this._text_size},set:function(e){Le(e,P.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"video",{get:function(){return this._video},set:function(e){Le(e,P.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},i}(ge),Re=function(e){function i(){var t=e.call(this)||this;return t.__children=u.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},i}(o),Ae=function(e){function i(){return e.call(this,{children:u.aicc.tries_children})||this}return t(i,e),i}(y),je=function(e){function i(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new Q({score_children:u.aicc.score_children,score_range:P.aicc.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:g}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Le(e,P.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Le(e,P.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},i}(o),De=function(e){function i(){return e.call(this,{children:u.aicc.attempt_records_children})||this}return t(i,e),i}(y),Pe=function(e){function i(){var t=e.call(this)||this;return t._lesson_status="",t.score=new Q({score_children:u.aicc.score_children,score_range:P.aicc.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:g}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){Le(e,P.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},i}(o),ze=function(e){function i(){var t=e.call(this,u.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new Ae,t.attempt_records=new De,t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},i}(fe),xe=function(e){function i(){return e.call(this,{children:u.aicc.paths_children})||this}return t(i,e),i}(y),Ve=function(e){function i(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return t(i,e),Object.defineProperty(i.prototype,"location_id",{get:function(){return this._location_id},set:function(e){Le(e,P.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){Le(e,P.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Le(e,P.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Le(e,P.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"why_left",{get:function(){return this._why_left},set:function(e){Le(e,P.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){Le(e,P.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},i}(o),Fe=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this,u.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new Ne,i.student_data=new ze,i.student_demographics=new Re,i.evaluation=new Te,i.paths=new xe,i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},i}(Ie),Ge=function(e){function i(t){var i=e.call(this,t)||this;return i.cmi=new Fe,i.nav=new Se,i}return t(i,e),i.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||(w(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new we:w(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new je:w(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new Pe:w(t,"cmi\\.paths\\.\\d+")&&(n=new Ve)),n},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},i}(ve);window.Scorm12API=ve,window.Scorm2004API=ue,window.AICC=Ge}();
2
2
  //# sourceMappingURL=scorm-again.min.js.map