(function(e){function a(a){return{isValid:!1,errorCode:a,value:void 0}}function c(a){return{isValid:!0,value:a,errorCode:""}}function d(a){return"[object String]"===toString.call(a)}function b(){this.validatedModel={}}function f(a){return function(b,f,g){var d;d="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof nodelist?"function"==typeof f||!1:toString.call(f)==="[object "+Function+"]";d&&(g=f,f={});void 0===f&&(f={});d=function(d,h){if(g&&!g.call(this,h))return c(void 0);var e=
a.call(this,d,f);if(!e.isValid){e.fieldName=e.fieldName||[];e.fieldName=[b].concat(e.fieldName)}return e};d.fieldName=b;return d}}var h={validateBoolean:function(a){return"True"===a},validateInteger:function(a){var b={isValid:!1,value:NaN};if(h.isStringEmpty(a))return b;a=parseInt(a,10);if(isNaN(a))return b;b.isValid=!0;b.value=a;return b},validatePositiveInteger:function(a){a=this.validateInteger(a);return!a.isValid?a:1>a.value?{isValid:!1}:a},validateIntegerInRange:function(a,b,c){a=this.validateInteger(a);
if(!a.isValid)return a;c||(c=0);return a.value<c||a.value>b?{isValid:!1}:a},validateFloat:function(a,b){var c={isValid:!1,value:NaN,parsedValue:NaN};if(h.isStringEmpty(a))return c;var f=parseFloat(a);if(isNaN(f))return c;b||(b=2);c.isValid=!0;c.value=f.toFixed(b);c.parsedValue=parseFloat(c.value);return c},validateFloatInRange:function(a,b,c,f){f||(f=2);a=this.validateFloat(a,f);if(!a.isValid)return a;c||(c=0);c=parseFloat(c.toFixed(f));b=parseFloat(b.toFixed(f));return a.value<c||a.value>b?{isValid:!1}:
a},validateOption:function(a,b){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)&&c===b)return a[c];return a[a.DEFAULT]},validateJSVariableName:function(a){return null===a.match(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/)?{isValid:!1}:{isValid:!0}},validateColor:function(a,b){b||(b="#FFFFFF");if(!a)return{isValid:!1,color:b};var c=a.match(/#[0-9a-fA-F]+/),f;return(f=(f=!c||null===c||1!=c.length)||7!=c[0].length)?{isValid:!1,color:b}:{isValid:!0,color:a}},isStringEmpty:function(a){return void 0===
a||""===a},isHtmlEmpty:function(a){if(void 0===a)return!0;a=String(a);if(-1<a.indexOf("<img"))return!1;var b=document.createElement("div");b.innerHTML=a;a=b.textContent||b.innerText;return void 0===a||""===a.trim()?!0:!1},isStringWithPrefixEmpty:function(a,b){return h.isStringEmpty(a)?!0:a===b},isArrayElementEmpty:function(a){if(!a)return!0;for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b)&&!h.isStringEmpty(a[b]))return!1;return!0},isArrayEmpty:function(a){return!a?!0:1===a.length&&h.isArrayElementEmpty(a[0])},
removeDuplicatesFromArray:function(a){if(0===a.length)return[];for(var b=[],c=0;c<a.length-1;c++)a[c+1]!==a[c]&&b.push(a[c]);b.push(a[a.length-1]);return b}};b.prototype={validate:function(a,b){return this.validateModel(a,b,!0)},validateModel:function(b,c,f){var g={},d;void 0===f&&(f=!1);for(var h=c.length,e=0;e<h;e+=1)if(d=c[e].fieldName,void 0!==b[d]&&null!==b[d]){var i=c[e].call(this,b[d],g);if(!i.isValid)return i;f&&(this.validatedModel[d]=i.value);g[d]=i.value}else return b=a("UMF01"),b.fieldName=
[d],b;return{isValid:!0,value:g,errorCode:""}},generateErrorCode:a,generateValidValue:c,__validatorDecorator__:f};var g={DumbInteger:function(a){return this.generateValidValue(parseInt(a,10))},DumbString:function(a){return this.generateValidValue(a)},Boolean:function(a){return!d(a)?this.generateErrorCode("BL01"):this.generateValidValue("True"===a)},Integer:function(a,b){if(!d(a))return this.generateErrorCode("INT05");var c=b.minValue,f=b.maxValue,g=b["default"],h=void 0!==b["default"];if(void 0===
f||null===f)f=Number.MAX_VALUE;if(void 0===c||null===c)c=-1*Number.MAX_VALUE;a=a.trim();if(h&&""===a)return this.generateValidValue(g);if(""===a)return this.generateErrorCode("INT01");if(!/^[-]?[0-9]+$/.test(a))return this.generateErrorCode("INT02");g=parseInt(a,10);return g>f?this.generateErrorCode("INT03"):g<c?this.generateErrorCode("INT04"):this.generateValidValue(g)},String:function(a,b){if(!d(a))return this.generateErrorCode("STR02");var c=void 0!==b["default"],f=b["default"],g=a;if(void 0===
b.trim||b.trim)g=g.trim();return!c&&""===g?this.generateErrorCode("STR01"):c&&""===g?this.generateValidValue(f):this.generateValidValue(g)},CSSClass:function(a,b){if(!d(a))return this.generateErrorCode("CSS02");a=a.trim();return void 0!==b["default"]&&""===a.trim()?this.generateValidValue(b["default"]):!/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(a)?this.generateErrorCode("CSS01"):this.generateValidValue(a)},List:function(a,b){var c=function(a){return"[object Array]"===toString.call(a)};if(!(Array.isArray||
c)(a))return this.generateErrorCode("ARR01");for(var c=[],f=0;f<a.length;f++){var g=this.validateModel(a[f],b);if(!g.isValid)return g;c.push(g.value)}return this.generateValidValue(c)},Enum:function(a,b){if(!d(a))return this.generateErrorCode("EV02");var c=b.values||[],f=b.useLowerCase||!1,g=b["default"],a=a.trim();f&&(a=a.toLowerCase());if(void 0!==g&&""===a)return this.generateValidValue(g);for(f=0;f<c.length;f++)if(c[f].trim()===a)return this.generateValidValue(a);return this.generateErrorCode("EV01")}},
i={},m;for(m in g)i[m]=f(g[m]);e.ModelValidationUtils=h;e.ModelValidator=b;e.ModelValidators=i})(window);(function(e){e.DOMOperationsUtils={getOuterDimensions:function(a){a=$(a);return{border:{top:parseInt(a.css("border-top-width"),10),bottom:parseInt(a.css("border-bottom-width"),10),left:parseInt(a.css("border-left-width"),10),right:parseInt(a.css("border-right-width"),10)},margin:{top:parseInt(a.css("margin-top"),10),bottom:parseInt(a.css("margin-bottom"),10),left:parseInt(a.css("margin-left"),10),right:parseInt(a.css("margin-right"),10)},padding:{top:parseInt(a.css("padding-top"),10),bottom:parseInt(a.css("padding-bottom"),
10),left:parseInt(a.css("padding-left"),10),right:parseInt(a.css("padding-right"),10)}}},calculateOuterDistances:function(a){var c=a.border.top+a.border.bottom,c=c+(a.margin.top+a.margin.bottom),c=c+(a.padding.top+a.padding.bottom),d=a.border.left+a.border.right,d=d+(a.margin.left+a.margin.right),d=d+(a.padding.left+a.padding.right);return{vertical:c,horizontal:d}},calculateReducedSize:function(a,c){var d=DOMOperationsUtils.getOuterDimensions(c),d=DOMOperationsUtils.calculateOuterDistances(d);return{width:$(a).width()-
d.horizontal,height:$(a).height()-d.vertical}},setReducedSize:function(a,c){var d=DOMOperationsUtils.calculateReducedSize(a,c);$(c).css({width:d.width+"px",height:d.height+"px"});return d},showErrorMessage:function(a,c,d){$(a).html(c[d])},getResourceFullPath:function(a,c){return!a||!c?void 0:a.getStaticFilesPath()+c}}})(window);(function(e){function a(c){this._actualState=a._internal.STATE.START;this.correctCSS=c.correct||"";this.wrongCSS=c.wrong||"";this.showAnswersCSS=c.showAnswers||"";this.blockCSS=c.block||""}a._internal={STATE:{START:0,BLOCK:1,WORK:2,CORRECT:3,WRONG:4,SHOW_ANSWERS:5},changeStateToStart:function(){this._actualState=a._internal.STATE.START},changeStateToBlock:function(){this._actualState=a._internal.STATE.BLOCK},changeStateToWork:function(){this._actualState=a._internal.STATE.WORK},changeStateToCorrect:function(){this._actualState=
a._internal.STATE.CORRECT},changeStateToWrong:function(){this._actualState=a._internal.STATE.WRONG},changeStateToShowAnswers:function(){this._actualState=a._internal.STATE.SHOW_ANSWERS},checkStartState:function(){this.onBlock();this.setCssOnBlock();a._internal.changeStateToBlock.call(this)},showAnswersStartState:function(){this.notifyEdit();a._internal.showAnswersWorkState.call(this)},resetStartState:function(){},uncheckBlockState:function(){this.onUnblock();this.setCssOnUnblock();a._internal.changeStateToStart.call(this)},
resetBlockState:function(){a._internal.uncheckBlockState.call(this)},showAnswersBlockState:function(){a._internal.uncheckBlockState.call(this);a._internal.showAnswersStartState.call(this)},resetWorkState:function(){this.onReset();a._internal.changeStateToStart.call(this)},checkWorkState:function(){this.isCorrect()?(this.setCssOnCorrect(),this.onCorrect(),a._internal.changeStateToCorrect.call(this)):(this.setCssOnWrong(),this.onWrong(),a._internal.changeStateToWrong.call(this))},showAnswersWorkState:function(){this.onShowAnswers();
this.setCssOnShowAnswers();a._internal.changeStateToShowAnswers.call(this)},resetShowAnswersState:function(){a._internal.hideAnswersShowAnswersState.call(this);a._internal.resetWorkState.call(this)},hideAnswersShowAnswersState:function(){this.setCssOnHideAnswers();this.onHideAnswers();a._internal.changeStateToWork.call(this)},checkShowAnswersState:function(){a._internal.hideAnswersShowAnswersState.call(this);a._internal.checkWorkState.call(this)},uncheckCorrectState:function(){this.setCssOnUnCorrect();
this.onUnCorrect();a._internal.changeStateToWork.call(this)},resetCorrectState:function(){a._internal.uncheckCorrectState.call(this);a._internal.resetWorkState.call(this)},showAnswersCorrectState:function(){a._internal.uncheckCorrectState.call(this);a._internal.showAnswersWorkState.call(this)},resetWrongState:function(){a._internal.uncheckWrongState.call(this);a._internal.resetWorkState.call(this)},uncheckWrongState:function(){this.setCssOnUnWrong();this.onUnWrong();a._internal.changeStateToWork.call(this)},
showAnswersWrongState:function(){a._internal.uncheckWrongState.call(this);a._internal.showAnswersWorkState.call(this)}};a.prototype.reset=function(){switch(this._actualState){case a._internal.STATE.START:a._internal.resetStartState.call(this);break;case a._internal.STATE.BLOCK:a._internal.resetBlockState.call(this);break;case a._internal.STATE.WORK:a._internal.resetWorkState.call(this);break;case a._internal.STATE.WRONG:a._internal.resetWrongState.call(this);break;case a._internal.STATE.CORRECT:a._internal.resetCorrectState.call(this);
break;case a._internal.STATE.SHOW_ANSWERS:a._internal.resetShowAnswersState.call(this)}};a.prototype.check=function(){switch(this._actualState){case a._internal.STATE.START:a._internal.checkStartState.call(this);break;case a._internal.STATE.BLOCK:a._internal.uncheckBlockState.call(this);break;case a._internal.STATE.WORK:a._internal.checkWorkState.call(this);break;case a._internal.STATE.WRONG:a._internal.uncheckWrongState.call(this);break;case a._internal.STATE.CORRECT:a._internal.uncheckCorrectState.call(this);
break;case a._internal.STATE.SHOW_ANSWERS:a._internal.checkShowAnswersState.call(this)}};a.prototype.showAnswers=function(){switch(this._actualState){case a._internal.STATE.START:a._internal.showAnswersStartState.call(this);break;case a._internal.STATE.BLOCK:a._internal.showAnswersBlockState.call(this);break;case a._internal.STATE.WORK:a._internal.showAnswersWorkState.call(this);break;case a._internal.STATE.WRONG:a._internal.showAnswersWrongState.call(this);break;case a._internal.STATE.CORRECT:a._internal.showAnswersCorrectState.call(this)}};
a.prototype.hideAnswers=function(){switch(this._actualState){case a._internal.STATE.SHOW_ANSWERS:a._internal.hideAnswersShowAnswersState.call(this)}};a.prototype.notifyEdit=function(){a._internal.changeStateToWork.call(this)};a.prototype.onReset=function(){throw Error("onReset is  abstract method.");};a.prototype.onBlock=function(){throw Error("onBlock is  abstract method.");};a.prototype.onUnblock=function(){throw Error("onUnblock is  abstract method.");};a.prototype.isCorrect=function(){throw Error("isCorrect is  abstract method.");
};a.prototype.onWrong=function(){throw Error("onWrong is  abstract method.");};a.prototype.onUnWrong=function(){throw Error("onUnWrong is  abstract method.");};a.prototype.onCorrect=function(){throw Error("onCorrect is  abstract method.");};a.prototype.onUnCorrect=function(){throw Error("onUnCorrect is  abstract method.");};a.prototype.onShowAnswers=function(){throw Error("onShowAnswers is  abstract method.");};a.prototype.onHideAnswers=function(){throw Error("onHideAnswers is  abstract method.");
};a.prototype.addCssClass=function(){throw Error("addCssClass is  abstract method.");};a.prototype.removeCssClass=function(){throw Error("removeCssClass is  abstract method.");};a.prototype.setCssOnCorrect=function(){this.addCssClass(this.correctCSS)};a.prototype.setCssOnWrong=function(){this.addCssClass(this.wrongCSS)};a.prototype.setCssOnShowAnswers=function(){this.addCssClass(this.showAnswersCSS)};a.prototype.setCssOnHideAnswers=function(){this.removeCssClass(this.showAnswersCSS)};a.prototype.setCssOnUnCorrect=
function(){this.removeCssClass(this.correctCSS)};a.prototype.setCssOnUnWrong=function(){this.removeCssClass(this.wrongCSS)};a.prototype.setCssOnBlock=function(){this.addCssClass(this.blockCSS)};a.prototype.setCssOnUnblock=function(){this.removeCssClass(this.blockCSS)};e.StatefullAddonObject=e.StatefullAddonObject||a})(window);(function(e){function a(a,b){this.message=a;this.name=b}function c(b,c,g,d){if(void 0===b[c])throw new a(g,d);return!0}function d(a,b,c,d){if(typeof a[b]!==d)throw new TypeError(c);return!0}function b(a,c){StatefullAddonObject.call(this,c);b._internal.validateConfiguration(a);this.addonID=a.addonID;this.objectID=a.objectID;this.source=a.source||"";this.value=a.value||"";this.showAnswersValue=a.showAnswersValue||"";this.type=a.type||"string";this._isClickable=!0;this.droppedElement;this.createView=
a.createView||b.prototype.createView;this.connectEvents=a.connectEvents||b._internal.connectEvents;this.setValue=a.setValue||b.prototype.setValue;this.setViewValue=a.setViewValue||b.prototype.setViewValue;this.helper=a.helper||b.prototype.helper;this.makeGapEmpty=a.makeGapEmpty||b.prototype.makeGapEmpty;this.fillGap=a.fillGap||b.prototype.fillGap;this.cursorAt=a.cursorAt||b.prototype.cursorAt;this.getDroppedElement=b.prototype.getDroppedElement;this.eventBus=a.eventBus;this.getSelectedItem=a.getSelectedItem;
this.$view=this.createView.call(this);this.connectEvents(this)}b.prototype=Object.create(StatefullAddonObject.prototype);b.constructor=b;b._internal={validateConfiguration:function(a){c(a,"eventBus","EventBus attribute object is undefined in configuration object","UndefinedEventBusError");d(a,"eventBus","EventBus attribute should be a event bus object","function");c(a,"getSelectedItem","Get Selected Item function is undefined in configuration object","UndefinedGetSelectedItemError");d(a,"getSelectedItem",
"Get Selected Item should be a function","function");c(a,"addonID","AddonID attribute is undefined in configuration object","UndefinedAddonIDError");d(a,"addonID","AddonID attribute should be a string type in configuration object","string");c(a,"objectID","objectID attribute is undefined in configuration object","UndefinedObjectIDError");d(a,"objectID","objectID attribute should be a string type in configuration object","string");void 0!==a.createView&&d(a,"createView","Create view have to be a function",
"function");void 0!==a.setValue&&d(a,"setValue","Set value have to be a function","function");void 0!==a.setViewValue&&d(a,"setViewValue","Set view value have to be a function","function");void 0!==a.makeGapEmpty&&d(a,"makeGapEmpty","Make gap empty have to be a function","function");void 0!==a.connectEvents&&d(a,"connectEvents","Fill gap have to be a function","function");void 0!==a.fillGap&&d(a,"fillGap","Fill gap have to be a function","function")},isSelectedItemEmpty:function(a){return"Empty"===
a.type},getSelectedItemWrapper:function(){return b._internal.validateSelectedItemData(this.getSelectedItem.call(this))},getClickHandler:function(){return function(a){this.stopPropagationAndPreventDefault(a);this.clickDispatcher(a)}.bind(this)},getDropHandler:function(){return function(a,b){this.stopPropagationAndPreventDefault(a);this.dropHandler(a,b);var c=b.helper[0];$(c).addClass("ic_sourceListItem-selected");this.droppedElement=c}.bind(this)},getStartDraggingHandler:function(){return function(a,
b){this.wrapperStartDraggingHandler(a,b)}.bind(this)},getStopDraggingHandler:function(){return function(a,b){this.wrapperStopDraggingHandler(a,b)}.bind(this)},validateSelectedItemData:function(a){if(null===a.value||null===a.item||void 0===a.type||void 0===a.value||void 0===a.item)a.type="Empty";return a},getDraggableEventsData:function(){return{source:this.addonID,item:this.source,value:this.value,type:"string"}},connectEvents:function(){this.bindClickHandler();this.bindDropHandler()}};b.prototype.setValue=
function(a){this.value=a};b.prototype.setViewValue=function(a){this.$view.html(a)};b.prototype.helper=function(){return function(){return $(this.droppedElement)}.bind(this)};b.prototype.makeGapEmpty=function(){this.notifyEdit();this.setValue.call(this,"");this.setViewValue.call(this,"");this.setSource.call(this,"");this.destroyDraggableProperty()};b.prototype.createView=function(){var a=$("<span></span>");a.attr("id",this.objectID);a.addClass("ui-draggable");a.addClass("ui-widget-content");return a};
b.prototype.fillGap=function(a){this.notifyEdit();this.setValue.call(this,a.value);this.setViewValue.call(this,a.value);this.setSource.call(this,a.item);this.sendItemConsumedEvent();this.bindDraggableHandler()};b.prototype.cursorAt=function(){return{}};b.prototype.getValue=function(){return this.value};b.prototype.getView=function(){return this.$view};b.prototype.getAddonID=function(){return this.addonID};b.prototype.getObjectID=function(){return this.objectID};b.prototype.getSource=function(){return this.source};
b.prototype.getDroppedElement=function(){return $("<div>").append($(this.droppedElement).clone()).html()};b.prototype.setDroppedElement=function(a){this.droppedElement=a};b.prototype.setSource=function(a){this.source=a};b.prototype.addCssClass=function(a){this.$view.addClass(a)};b.prototype.removeCssClass=function(a){this.$view.removeClass(a)};b.prototype.bindClickHandler=function(){this.$view.click(b._internal.getClickHandler.call(this))};b.prototype.bindDropHandler=function(){this.$view.droppable({drop:b._internal.getDropHandler.call(this)})};
b.prototype.bindDraggableHandler=function(){this.$view.draggable({revert:!1,helper:this.helper(),cursorAt:this.cursorAt(),start:b._internal.getStartDraggingHandler.call(this),stop:b._internal.getStopDraggingHandler.call(this)})};b.prototype.clickHandler=function(){var a=b._internal.getSelectedItemWrapper.call(this);if(!b._internal.isSelectedItemEmpty(a)){var c=a.item.substr(0,a.item.lastIndexOf("-")),c=$("#_icplayer").find("#"+c).children().filter(function(){return $(this).text()==a.value}),c=$(c[0]);
c.css("display","inline-block");c.addClass("ic_sourceListItem-selected");this.droppedElement=$("<div>").append(c.clone()).html()}this.sendItemReturnedEvent();b._internal.isSelectedItemEmpty(a)?this.makeGapEmpty.call(this):this.fillGap.call(this,a)};b.prototype.clickDispatcher=function(a){this._isClickable?this.clickHandler.call(this,a):this._isClickable=!0};b.prototype.dropHandler=function(a,c){this.setDroppedElement(c.draggable[0]);this.sendItemReturnedEvent();this.fillGap.call(this,b._internal.getSelectedItemWrapper.call(this))};
b.prototype.startDraggingHandler=function(a,b){this.setViewValue.call(this,"");this.sendItemReturnedEvent();this.sendItemDraggedEvent();b.helper.zIndex(100);this.$view.removeClass("gapFilled")};b.prototype.wrapperStartDraggingHandler=function(a,b){this._isClickable=!1;this.startDraggingHandler(a,b)};b.prototype.wrapperStopDraggingHandler=function(a,b){this._isClickable=!0;this.stopDraggingHandler(a,b)};b.prototype.stopDraggingHandler=function(a,b){b.helper[0].remove();this.sendItemStoppedEvent();
this.makeGapEmpty.call(this)};b.prototype.destroyDraggableProperty=function(){this.$view.draggable("destroy")};b.prototype.stopPropagationAndPreventDefault=function(a){a.stopPropagation();a.preventDefault()};b.prototype.sendItemDraggedEvent=function(){this.sendEvent("itemDragged",b._internal.getDraggableEventsData.call(this))};b.prototype.sendItemStoppedEvent=function(){this.sendEvent("itemStopped",b._internal.getDraggableEventsData.call(this))};b.prototype.sendItemReturnedEvent=function(){this.sendEvent("ItemReturned",
b._internal.getDraggableEventsData.call(this))};b.prototype.sendItemConsumedEvent=function(){this.sendEvent("ItemConsumed",b._internal.getDraggableEventsData.call(this))};b.prototype.sendEvent=function(a,b){this.eventBus.sendEvent(a,b)};b.prototype.lock=function(){this.$view.unbind("click");this.$view.draggable("disable");this.$view.droppable("disable")};b.prototype.unlock=function(){this.bindClickHandler();this.$view.draggable("enable");this.$view.droppable("enable")};b.prototype.onReset=function(){this.setValue.call(this,
"");this.setViewValue.call(this,"");this.setSource.call(this,"");this.destroyDraggableProperty()};b.prototype.onBlock=function(){this.lock()};b.prototype.onUnblock=function(){this.unlock()};b.prototype.isCorrect=function(){return this.value===this.showAnswersValue};b.prototype.onWrong=function(){this.lock()};b.prototype.onUnWrong=function(){this.unlock()};b.prototype.onCorrect=function(){this.lock()};b.prototype.onUnCorrect=function(){this.unlock()};b.prototype.onShowAnswers=function(){this.lock();
this.setViewValue(this.showAnswersValue)};b.prototype.onHideAnswers=function(){this.unlock();this.setViewValue(this.value)};b.prototype.setState=function(a,b,c){this.setValue.call(this,a);this.setViewValue.call(this,a);this.setSource.call(this,b);this.droppedElement=c;this.bindDraggableHandler();this.notifyEdit()};e.DraggableDroppableObject=e.DraggableDroppableObject||b})(window);(function(e){e.Serialization={serialize:function(a){if(a){var c="";$.each(a,function(a,b){var f=typeof b;if("object"===f&&$.isArray(b)){var f="array",e="";$.each(b,function(a){e+=this+"-"+typeof b[a]+","});b=e=e.slice(0,-1)}c+="["+a+":"+f+":"+b+"]"});return c}},deserialize:function(a){if(a){var c={};if(a=a.match(/[\w]+:[\w-]+:[\w,.\- ]+/g)){for(var d=0;d<a.length;d++){var b=a[d].split(":");c[b[0]]=this.convert(b[2],b[1])}return c}}},convert:function(a,c){if(a&&c)switch(c){case "string":return a;case "number":return this.isInteger(a)?
parseInt(a):parseFloat(a);case "boolean":return"true"==a;case "array":return this.convertArray(a);default:return"This type of value is unrecognized."}},convertArray:function(a){for(var a=a.split(","),c=[],d=0;d<a.length;d++){var b=a[d].split("-");c.push(this.convert(b[0].trim(),b[1]))}return c},isInteger:function(a){return 0===a%1&&null!=a}}})(window);(function(e){e.Watermark={defaultOptions:{size:100,opacity:1,color:"#000000"},validateOptions:function(a){if(!a)return $.extend({},this.defaultOptions);var c=$.extend({},a);ModelValidationUtils.validatePositiveInteger(a.size).isValid||(c.size=this.defaultOptions.size);ModelValidationUtils.validateFloatInRange(a.opacity,1,0,2).isValid||(c.opacity=this.defaultOptions.opacity);ModelValidationUtils.validateColor(a.color,this.defaultOptions.color).isValid||(c.color=this.defaultOptions.color);return c},
draw:function(a,c){var d=$(a),b=$(document.createElement("canvas"));d.html(b);c=this.validateOptions(c);b.attr({width:c.size,height:c.size});b.rotateCanvas({x:c.size/2,y:c.size/2,angle:90}).drawArc({strokeWidth:1,strokeStyle:c.color,fillStyle:c.color,x:c.size/2,y:c.size/2,radius:c.size/2-1,opacity:c.opacity}).drawLine({strokeWidth:1,strokeStyle:"#FFF",fillStyle:"#FFF",rounded:!0,x1:c.size/2,y1:0.17*c.size,x2:c.size-0.2*c.size,y2:c.size-0.33*c.size,x3:0.2*c.size,y3:c.size-0.33*c.size,x4:c.size/2,y4:0.17*
c.size,opacity:c.opacity})}}})(window);(function(e){e.Helpers={splitLines:function(a){return a.split(/[\n\r]+/)},alertErrorMessage:function(a,c){var d=c+"\n\n";a.name&&(d+="["+a.name+"] ");d+=a.message?a.message:a;alert(d)},uuidv4:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var c=16*Math.random()|0;return("x"===a?c:c&3|8).toString(16)})}}})(window);
(function(e){if(!e.fn.style){var a=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};CSSStyleDeclaration.prototype.getPropertyValue||(CSSStyleDeclaration.prototype.getPropertyValue=function(a){return this.getAttribute(a)},CSSStyleDeclaration.prototype.setProperty=function(c,d,b){this.setAttribute(c,d);b="undefined"!=typeof b?b:"";if(""!=b){var f=RegExp(a(c)+"\\s*:\\s*"+a(d)+"(\\s*;)?","gmi");this.cssText=this.cssText.replace(f,c+": "+d+" !"+b+";")}},CSSStyleDeclaration.prototype.removeProperty=
function(a){return this.removeAttribute(a)},CSSStyleDeclaration.prototype.getPropertyPriority=function(c){return RegExp(a(c)+"\\s*:\\s*[^\\s]*\\s*!important(\\s*;)?","gmi").test(this.cssText)?"important":""});e.fn.style=function(a,d,b){if(typeof this.get(0)=="undefined")return this;var f=this.get(0).style;if(typeof a!="undefined"){if(typeof d!="undefined"){f.setProperty(a,d,typeof b!="undefined"?b:"");return this}return f.getPropertyValue(a)}return f}}})(jQuery);(function(e){var a={};e.MobileUtils={isMobileUserAgent:function(a){return void 0===a||!a?!1:a.match(/Android/i)||a.match(/BlackBerry/i)||a.match(/iPhone|iPad|iPod/i)||a.match(/IEMobile/i)||a.match(/Opera Mini/i)?!0:!1},isAndroidWebBrowser:function(a){return void 0===a||!a?!1:a.indexOf("Mozilla/5.0">-1&&-1<a.indexOf("Android ")&&-1<a.indexOf("AppleWebKit"))&&!(-1<a.indexOf("Chrome"))},getAndroidVersion:function(a){if(void 0===a||!a)return"";var a=a.toString(),d=a.indexOf("Android")+7;if(-1===d)return"";
var b=a.indexOf(";",d);return a.substring(d,b).trim()},isSafariMobile:function(a){return void 0===a||!a?!1:a.match(/iPhone|iPad|iPod/i)?!0:!1},isWindowsMobile:function(a){return void 0===a||!a?!1:a.msPointerEnabled?!0:!1},getAndroidVersion:function(a){a=a||navigator.userAgent;return(a=a.match(/Android\s([0-9\.]*)/))?a[1]:!1},isEventSupported:function(c){var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img",unload:"win",resize:"win",touchstart:"button"},
b=c.replace(/^on/,"");if(a[b])return a[b];var d="win"==d[b]?e:document.createElement(d[b]||"div"),c="on"+b,f=c in d;f||(d.setAttribute(c,"return;"),f="function"==typeof d[c]);return a[b]=f}}})(window);(function(e){function a(a,d){this.isSelectEnabled=!0;this.keyboardNavigationActive=!1;this.keyboardNavigationElements=a;this.columnsCount=d;this.keyboardNavigationElementsLen=a.length;var e={};e[c.TAB]=this.nextElement;e[c.ENTER]=this.enter;e[c.ESCAPE]=this.escape;e[c.SPACE]=this.select;e[c.ARROW_LEFT]=this.previousElement;e[c.ARROW_UP]=this.previousRow;e[c.ARROW_RIGHT]=this.nextElement;e[c.ARROW_DOWN]=this.nextRow;var g={};g[c.TAB]=this.previousElement;g[c.ENTER]=this.exitWCAGMode;this.mapping=e;
this.shiftKeysMapping=g}var c={TAB:9,ENTER:13,ESCAPE:27,SPACE:32,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40},d=null;a.prototype.handle=function(a,c){var d=this;$(document).on("keydown",function(g){try{c?d.shiftKeysMapping[a].call(d,g):d.mapping[a].call(d,g)}catch(e){}$(this).off("keydown")})};a.prototype.setElements=function(a){for(var c=0;c<this.keyboardNavigationElementsLen;c++)this.unmark(this.keyboardNavigationElements[c]);this.keyboardNavigationElements=a;this.keyboardNavigationElementsLen=
a.length;this.keyboardNavigationCurrentElementIndex=0;this.keyboardNavigationActive&&(this.keyboardNavigationCurrentElement=this.keyboardNavigationElements[0],this.mark(this.keyboardNavigationCurrentElement))};a.prototype.getTarget=function(a){return a};a.prototype.mark=function(a){this.getTarget(a,!1).addClass("keyboard_navigation_active_element")};a.prototype.unmark=function(a){this.getTarget(a,!1).removeClass("keyboard_navigation_active_element")};a.prototype.markCurrentElement=function(a){this.keyboardNavigationCurrentElement&&
this.unmark(this.keyboardNavigationCurrentElement);this.keyboardNavigationCurrentElementIndex=a;this.keyboardNavigationCurrentElement=this.keyboardNavigationElements[a];this.mark(this.keyboardNavigationCurrentElement)};a.prototype.switchElement=function(a){a=this.keyboardNavigationCurrentElementIndex+a;a>=this.keyboardNavigationElementsLen?a-=this.keyboardNavigationElementsLen:0>a&&(a=this.keyboardNavigationElementsLen+a);this.markCurrentElement(a)};a.prototype.nextElement=function(a){a&&a.preventDefault();
this.switchElement(1)};a.prototype.previousElement=function(a){a&&a.preventDefault();this.switchElement(-1)};a.prototype.nextRow=function(a){a&&a.preventDefault();this.switchElement(this.columnsCount)};a.prototype.previousRow=function(a){a&&a.preventDefault();this.switchElement(-this.columnsCount)};a.prototype.enter=function(a){a&&a.preventDefault();this.keyboardNavigationActive||(this.keyboardNavigationActive=!0,this.markCurrentElement(0))};a.prototype.escape=function(a){a&&a.preventDefault();this.keyboardNavigationActive&&
this.exitWCAGMode()};a.prototype.select=function(a){a&&a.preventDefault();this.isSelectEnabled&&this.selectAction()};a.prototype.selectAction=function(){this.getTarget(this.keyboardNavigationCurrentElement,!0).click()};a.prototype.reload=function(a,c){this.isSelectEnabled=!0;this.keyboardNavigationElements=a;this.columnsCount=c;this.keyboardNavigationElementsLen=a.length;this.keyboardNavigationActive&&this.enter()};a.prototype.selectEnabled=function(a){this.isSelectEnabled=a};a.prototype.exitWCAGMode=
function(){this.keyboardNavigationActive&&(this.keyboardNavigationActive=!1,this.unmark(this.keyboardNavigationCurrentElement),this.keyboardNavigationCurrentElement=null)};a.prototype.getTextToSpeechOrNull=function(a){d=null;a&&(d=a.getModule("Text_To_Speech1"));return d};e.KeyboardController=a;e.KeyboardControllerKeys=c})(window);(function(e){e.DevicesUtils={isInternetExplorer:function(){return 0<e.navigator.userAgent.indexOf("MSIE ")||navigator.userAgent.match(/Trident.*rv\:11\./)?!0:!1},isFirefox:function(){return"netscape"in e&&/ rv:/.test(navigator.userAgent)}}})(window);(function(e){e.Commands={dispatch:function(a,c,d,b){var f,e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&e.toLowerCase()===c&&a[e]&&(f=a[e].call(b,d));return f}};e.CommandsQueueFactory={create:function(a){console.log("CommandsQueueFactory is deprecated and won't be maintained from now. Please use: DeferredSyncQueue");return new e.CommandsQueue(a)}};e.CommandsQueueTask=function(a,c){this.name=a;this.params=c};e.CommandsQueue=function(a){this.module=a;this.queue=[]};e.CommandsQueue.prototype.addTask=
function(a,c){var d=new e.CommandsQueueTask(a,c);this.queue.push(d)};e.CommandsQueue.prototype.getTask=function(){return this.isQueueEmpty()?null:this.queue.splice(0,1)[0]};e.CommandsQueue.prototype.getAllTasks=function(){return this.queue};e.CommandsQueue.prototype.executeTask=function(){var a=this.getTask();a&&this.module.executeCommand(a.name.toLowerCase(),a.params)};e.CommandsQueue.prototype.executeAllTasks=function(){for(;!this.isQueueEmpty();)this.executeTask()};e.CommandsQueue.prototype.getTasksCount=
function(){return this.queue.length};e.CommandsQueue.prototype.isQueueEmpty=function(){return 0===this.queue.length}})(window);(function(e){e.ImageViewer={validateSound:function(a){var c=[];if(a&&$.isArray(a))for(var d=0;d<a.length;d++){var b=ModelValidationUtils.isStringWithPrefixEmpty(a[d]["MP3 sound"],"/file/"),e=ModelValidationUtils.isStringWithPrefixEmpty(a[d]["AAC sound"],"/file/"),h=ModelValidationUtils.isStringWithPrefixEmpty(a[d]["OGG sound"],"/file/");c.push({AAC:e?"":a[d]["AAC sound"],OGG:h?"":a[d]["OGG sound"],MP3:b?"":a[d]["MP3 sound"],isEmpty:b&&e&&h})}return{sounds:c}},loadSounds:function(a,c){var d=[];if(!buzz.isSupported()||
!a||!c)return d;for(var b=0;b<c;b++)b>a.length-1||a[b].isEmpty?d[b]=null:(d[b]=""!==a[b].MP3&&buzz.isMP3Supported()?new buzz.sound(a[b].MP3):""!==a[b].OGG&&buzz.isOGGSupported()?new buzz.sound(a[b].OGG):new buzz.sound(a[b].AAC),d[b].load());return d},convertFramesList:function(a,c,d){if(ModelValidationUtils.isStringEmpty(a))return{isError:!0,errorCode:"FL01"};var b=a.match(/[0-9a-zA-Z,-]+/);if(null===b||a.length!==b[0].length)return{isError:!0,errorCode:"FL02"};for(var b=[],a=a.split(","),e=0;e<a.length;e++){if(ModelValidationUtils.isStringEmpty(a[e]))return{isError:!0,
errorCode:"FL04"};if(-1!==a[e].search("-")){var h=a[e].split("-")[1],g=ModelValidationUtils.validateIntegerInRange(h,d,c);if(!g.isValid)return{isError:!0,errorCode:"FL05"};var i=a[e].split("-")[0],h=ModelValidationUtils.validateIntegerInRange(i,h.value,c);if(!h.isValid||h.value>g.value)return{isError:!0,errorCode:"FL05"};for(h=h.value;h<=g.value;h++)b.push(h)}else{g=ModelValidationUtils.validateIntegerInRange(a[e],d,c);if(!g.isValid)return{isError:!0,errorCode:"FL03"};b.push(g.value)}}b.sort();b=
ModelValidationUtils.removeDuplicatesFromArray(b);return{isError:!1,list:b}}}})(window);(function(e){e.StringUtils={replaceAll:function(a,c,d){c=c.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return a.replace(RegExp(c,"g"),d)},startsWith:function(a,c){return a.match("^"+c)==c},endsWith:function(a,c){return-1!==a.indexOf(c,a.length-c.length)},format:function(){if(0!=arguments.length){var a=arguments[0].toString();if(1==arguments.length)return a;for(var c=0,d=1;d<arguments.length;d++)a=a.replace(RegExp("\\{"+c+"\\}","gi"),arguments[d]),c++;return a}}}})(window);(function(e){e.TextParserProxy=function(a){if(null==a)return null;this.parser=a};e.TextParserProxy.prototype.parse=function(a){a=this.parser.parse(a);return StringUtils.replaceAll(a,"href='#'",'href="javascript:void(0)"')};e.TextParserProxy.prototype.connectLinks=function(a){return this.parser.connectLinks(a)};e.TextParserProxy.prototype.parseGaps=function(a,c){"undefined"==typeof c&&(c={isCaseSensitive:!1});return this.parser.parseGaps(a,c)}})(window);(function(e){e.Internationalization={EASTERN_ARABIC:"ea",WESTERN_ARABIC:"wa",PERSO_ARABIC:"pa",getNumericals:function(a){var c={};c[e.Internationalization.WESTERN_ARABIC]={"0":"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"};c[e.Internationalization.EASTERN_ARABIC]={"0":"&#x0660",1:"&#x0661",2:"&#x0662",3:"&#x0663",4:"&#x0664",5:"&#x0665",6:"&#x0666",7:"&#x0667",8:"&#x0668",9:"&#x0669"};c[e.Internationalization.PERSO_ARABIC]={"0":"&#x06F0",1:"&#x06F1",2:"&#x06F2",3:"&#x06F3",4:"&#x06F4",
5:"&#x06F5",6:"&#x06F6",7:"&#x06F7",8:"&#x06F8",9:"&#x06F9"};return a in c?c[a]:c[e.Internationalization.WESTERN_ARABIC]},translate:function(a,c){for(var d=a.toString(),b="",f=e.Internationalization.getNumericals(c),h=0;h<d.length;h++)b+=f[+d.charAt(h)];return b}}})(window);(function(e){e.LoadedPromise=function(a,c){var d=[];$.each(c,function(b){var c=new $.Deferred,e=c.promise();a[b+"LoadedDeferred"]=c;a[b+"Loaded"]=e;d.push(e);a.getLoadedPromise=function(){var a=new $.Deferred,b=function(c,d){d==c.length?a.resolve():$.when(c[d]).then(function(){b(c,d+1)})};b(d,0);return a.promise()}})}})(window);(function(e){var a=function(){};a._internals={};a._internals.clicks=[];a._internals.callbacks=[];a._internals.getUserAgent=function(){return navigator.userAgent};a._internals.getCurrentTime=function(){return(new Date).getTime()};a._internals.getTargetCallbacks=function(c){return a._internals.callbacks.filter(function(a){return a.target==c}).map(function(a){return a.callback})};a._internals.removeTargetCallbacks=function(c){a._internals.callbacks=a._internals.callbacks.filter(function(a){return a.target!=
c})};a._internals.addCallback=function(c,d){a._internals.callbacks.push({target:c,callback:d})};a._internals.getLastTargetClick=function(c){for(var d=a._internals.clicks,b=d.length-1;0<=b;b-=1)if(d[b].target==c)return d[b];return null};a._internals.removeTargetClicks=function(c){a._internals.clicks=a._internals.clicks.filter(function(a){return a.target!=c})};a._internals.addClick=function(c,d){a._internals.removeTargetClicks(c);a._internals.clicks.push({target:c,time:d})};a._internals.doubleTapHandler=
function(c){var d=this,b=a._internals.getCurrentTime(),e=a._internals.getLastTargetClick(c.target);null!==e&&e.time+300>=b?(a._internals.removeTargetClicks(c.target),a._internals.getTargetCallbacks(d).forEach(function(a){a.call(d,c)})):a._internals.addClick(c.target,b)};a._internals.getStartEvent=function(c){var d=c||a._internals.getUserAgent(),c=/chrome/i.exec(d),d=/android/i.exec(d);return"ontouchstart"in e&&(!c||d)?"touchstart":"mousedown"};a.on=function(c,d){var b=c[0],e=a._internals.getStartEvent();
a._internals.addCallback(b,d);c.on(e,a._internals.doubleTapHandler)};a.off=function(c){var d=c[0],b=a._internals.getStartEvent();c.off(b,a._internals.doubleTapHandler);a._internals.removeTargetCallbacks(d);a._internals.removeTargetClicks(d)};e.EventsUtils={};e.EventsUtils.DoubleTap=a})(window);(function(e){function a(){}a.getErrorObject=function(a){return{isValid:!1,isError:!0,errorCode:a}};a.showErrorMessage=function(a,d,b){if("undefined"!=typeof b)for(var e in b)b.hasOwnProperty(e)&&(d=d.replace("%"+e+"%",b[e]));b="<p>"+d+"</p>";a.innerHTML=b};e.ModelErrorUtils=e.ModelErrorUtils||a})(window);(function(e){function a(a){this.buildConfiguration(a);var c,d,e,f,h,l,o,p,j,k,r,t,s,u,v,a=document.createElement("div");a.className="CustomControlsBar-wrapper";c=document.createElement("div");c.className="CustomControlsBar-wrapper-controls-controlsWrapper";a.appendChild(c);d=document.createElement("div");d.className="CustomControlsBar-wrapper-controls-progressBarWrapper";a.appendChild(d);e=document.createElement("div");e.className="CustomControlsBar-wrapper-controls-progressBarWrapper-grayProgressBar";
d.appendChild(e);f=document.createElement("div");f.className="CustomControlsBar-wrapper-controls-progressBarWrapper-redProgressBar";d.appendChild(f);h=document.createElement("div");h.className="CustomControlsBar-wrapper-controls-play";c.appendChild(h);l=document.createElement("div");l.className="CustomControlsBar-wrapper-controls-pause";l.style.display="none";c.appendChild(l);o=document.createElement("div");o.className="CustomControlsBar-wrapper-controls-stop";c.appendChild(o);p=document.createElement("div");
p.className="CustomControlsBar-wrapper-controls-volume";c.appendChild(p);j=document.createElement("div");j.className="CustomControlsBar-wrapper-controls-volumeBarWrapper";c.appendChild(j);k=document.createElement("div");k.className="CustomControlsBar-wrapper-controls-volumeBarWrapper-volumeBackground";k.style.display="none";j.appendChild(k);r=document.createElement("div");r.className="CustomControlsBar-wrapper-controls-volumeBarWrapper-volumeBackgroundSelected";r.style.display="none";j.appendChild(r);
t=document.createElement("div");t.className="CustomControlsBar-wrapper-controls-fullscreen";c.appendChild(t);s=document.createElement("div");s.className="CustomControlsBar-wrapper-controls-closeFullscreen";s.style.display="none";c.appendChild(s);v=document.createElement("div");v.className="CustomControlsBar-wrapper-controls-burgersContainer";c.appendChild(v);u=document.createElement("div");u.className="CustomControlsBar-wrapper-controls-timer";c.appendChild(u);this.elements={mainDiv:b(a),playButton:b(h),
pauseButton:b(l),stopButton:b(o),progressBarWrapper:b(d),volume:b(p),volumeBarWrapper:b(j),timer:b(u),controlsWrapper:b(c),volumeBackground:b(k),fullscreen:b(t),redProgressBar:b(f),grayProgressBar:b(e),closeFullscreen:b(s),volumeBackgroundSelected:b(r),burgersContainer:b(v)};this.progressBarChangedCallbacks=[];this.volumeChangedCallbacks=[];this.ownTimerCallbacks=[];this.addPlayCallback(this.showPauseButton.bind(this));this.addPauseCallback(this.showPlayButton.bind(this));this.addStopCallback(this.showPlayButton.bind(this));
this.addVolumeClickCallback(this.showHideVolumeBar.bind(this));this.addFullscreenCallback(this.showCloseFullscreenButton.bind(this));this.addCloseFullscreenCallback(this.showFullscreenButton.bind(this));this.addProgressBarClickCallback(this.progressBarClicked.bind(this));this.addVolumeBarClickCallback(this.volumeBarClicked.bind(this));this.hideControls=this.hideControls.bind(this);this.showControls=this.showControls.bind(this);this.onWrapperMouseEnter=this.onWrapperMouseEnter.bind(this);this.onWrapperMouseMove=
this.onWrapperMouseMove.bind(this);this.refreshDataIntervalFunction=this.refreshDataIntervalFunction.bind(this);this.actualizeTimer();this.configuration.parentElement&&(this.buildShowAndHideControlsEvents(),this.addCallbackForParentChildren(this.playPauseClick.bind(this)));this.refreshDataIntervalFunction=setInterval(this.refreshDataIntervalFunction,this.configuration.mouseDontMoveRefreshTime)}function c(a){var b;if(null===a||void 0===a)return"--:--";b=parseInt(a/60,10);10>b&&(b="0"+b);a=parseInt(a%
60,10);10>a&&(a="0"+a);return b+":"+a}function d(a){var b=0,c=0;do b+=a.offsetTop||0,c+=a.offsetLeft||0,a=a.offsetParent;while(a);return{top:b,left:c}}function b(a){return{element:a,events:{}}}function f(a,b,c){a.events[c]||(a.events[c]=[]);a.events[c].push({callback:b});a.element.addEventListener(c,b,!1)}function h(a){for(var b in a.events)if(a.events.hasOwnProperty(b))for(var c=0;c<a.events[b].length;c++)a.element.removeEventListener(b,a.events[b][c].callback)}e.CustomControlsBar=a;a.prototype.addProgressChangedCallback=
function(a){this.progressBarChangedCallbacks.push(a)};a.prototype.addVolumeChangedCallback=function(a){this.volumeChangedCallbacks.push(a)};a.prototype.progressBarClicked=function(a){for(var b=100*(a.clientX-d(this.elements.grayProgressBar.element).left)/this.elements.grayProgressBar.element.offsetWidth,c=0;c<this.progressBarChangedCallbacks.length;c++)this.progressBarChangedCallbacks[c](b);a.preventDefault();a.stopPropagation()};a.prototype.volumeBarClicked=function(a){for(var b=100*(a.clientX-d(this.elements.volumeBarWrapper.element).left)/
this.elements.volumeBackground.element.offsetWidth,c=0;c<this.volumeChangedCallbacks.length;c++)this.volumeChangedCallbacks[c](b);this.elements.volumeBackgroundSelected.element.style.width=parseInt(b/100*this.elements.volumeBackground.element.offsetWidth,10)+"px";a.preventDefault();a.stopPropagation()};a.prototype.playPauseClick=function(){"block"===this.elements.playButton.element.style.display?this.elements.playButton.element.click():this.elements.pauseButton.element.click()};a.prototype.buildConfiguration=
function(a){this.configuration={mouseDontMoveClocks:30,mouseDontMoveRefreshTime:100,maxMediaTime:0,actualMediaTime:0,videoObject:null,parentElement:null};if(a)for(var b in this.configuration)this.configuration.hasOwnProperty(b)&&void 0!==a[b]&&(this.configuration[b]=a[b])};a.prototype.actualizeTimer=function(){var a;this.elements.timer.element.innerHTML=c(this.configuration.actualMediaTime)+"/"+c(this.configuration.maxMediaTime);this.configuration.maxMediaTime&&(a=parseInt(100*(this.configuration.actualMediaTime/
this.configuration.maxMediaTime),10),this.elements.redProgressBar.element.style.width=a+"%")};a.prototype.buildShowAndHideControlsEvents=function(){this.actualTime=0;this.configuration.parentElement.addEventListener("mouseleave",this.hideControls,!1);this.configuration.parentElement.addEventListener("mouseenter",this.onWrapperMouseEnter,!1);this.configuration.parentElement.addEventListener("mousemove",this.onWrapperMouseMove,!1)};a.prototype.refreshDataIntervalFunction=function(){this.configuration.parentElement&&
!this.mainDivIsHidden&&(this.actualTime>this.configuration.mouseDontMoveClocks&&this.hideControls(),this.actualTime++);var a=this.configuration.videoObject;null!==a&&(this.setCurrentTime(a.currentTime),3<=a.readyState&&(!1===a.paused?this.showPauseButton():this.showPlayButton()));for(a=0;a<this.ownTimerCallbacks.length;a++)this.ownTimerCallbacks[a].call(this)};a.prototype.checkBurgerMenuSize=function(a){var b=a.element.offsetHeight,c=a.element.offsetWidth,d=a.element.getBoundingClientRect().left-
this.configuration.parentElement.getBoundingClientRect().left,e=this.configuration.parentElement.offsetWidth,f=a.element.style.marginLeft;""===f&&(f="0");f=parseInt(f.replace("px",""),10);a.element.style.marginTop="-"+(b-2)+"px";a.element.style.marginLeft=c+d-f>e?"-"+(c+d-e-f)+"px":"0px"};a.prototype.addCallbackToBuildInTimer=function(a){this.ownTimerCallbacks.push(a)};a.prototype.onWrapperMouseMove=function(){this.actualTime=0;this.showControls()};a.prototype.hideControls=function(){this.elements.mainDiv.element.style.display=
"none";this.mainDivIsHidden=!0};a.prototype.onWrapperMouseEnter=function(){this.showControls();this.actualTime=0};a.prototype.showControls=function(){this.mainDivIsHidden&&(this.elements.mainDiv.element.style.display="block",this.mainDivIsHidden=!1)};a.prototype.addBurgerMenu=function(a,c){function d(a){a.element.style.display="none"}var e=document.createElement("div");e.classList.add("CustomControlsBar-wrapper-controls-burgersContainer-"+a);this.elements.burgersContainer.element.appendChild(e);this.elements[a]=
b(e);var h=document.createElement("div");h.classList.add("CustomControlsBar-wrapper-controls-burgersContainer-container-"+a);var n=b(h);this.elements["BURGER_MENU_"+a+"_container"]=n;e.appendChild(h);c.forEach(function(c,e){var i=document.createElement("div");i.classList.add("CustomControlsBar-wrapper-controls-burgersContainer-"+a+"-element");i.classList.add("number-"+e);i.innerText=c.title;var j=b(i);this.elements["BURGER_MENU_"+a+"_"+e]=j;f.call(this,j,this.wrapBurgerElementClick(d.bind(this,n),
c.callback),"click");h.appendChild(i)},this);f(this.elements[a],function(a){a.element.style.display="block";this.checkBurgerMenuSize(a)}.bind(this,n),"mouseenter");f(this.elements[a],d.bind(this,n),"mouseleave")};a.prototype.wrapBurgerElementClick=function(a,b){return function(){a.apply(this,arguments);b.apply(this,arguments)}};a.prototype.removeBurgerMenu=function(a){this.elements[a]&&(h.call(this,this.elements[a]),this.elements[a].element.parentNode.removeChild(this.elements[a].element),delete this.elements[a]);
for(var b in this.elements)this.elements.hasOwnProperty(b)&&b.startsWith("BURGER_MENU_"+a+"_")&&(h.call(this,this.elements[b]),this.elements[b].element.parentNode.removeChild(this.elements[b].element),delete this.elements[b])};a.prototype.showPauseButton=function(a){this.elements.playButton.element.style.display="none";this.elements.pauseButton.element.style.display="block";void 0!==a&&(a.preventDefault(),a.stopPropagation())};a.prototype.showCloseFullscreenButton=function(a){this.elements.fullscreen.element.style.display=
"none";this.elements.closeFullscreen.element.style.display="block";void 0!==a&&null!==a&&(a.preventDefault(),a.stopPropagation())};a.prototype.showFullscreenButton=function(a){this.elements.closeFullscreen.element.style.display="none";this.elements.fullscreen.element.style.display="block";void 0!==a&&null!==a&&(a.preventDefault(),a.stopPropagation())};a.prototype.showHideVolumeBar=function(a){"none"===this.elements.volumeBackground.element.style.display?(this.elements.volumeBackground.element.style.display=
"block",this.elements.volumeBackgroundSelected.element.style.display="block"):(this.elements.volumeBackground.element.style.display="none",this.elements.volumeBackgroundSelected.element.style.display="none");a.preventDefault();a.stopPropagation()};a.prototype.showPlayButton=function(a){this.elements.playButton.element.style.display="block";this.elements.pauseButton.element.style.display="none";void 0!==a&&(a.preventDefault(),a.stopPropagation())};a.prototype.addVolumeBarClickCallback=function(a){f.call(this,
this.elements.volumeBarWrapper,a,"click")};a.prototype.addPlayCallback=function(a){f.call(this,this.elements.playButton,a,"click")};a.prototype.addProgressBarClickCallback=function(a){f.call(this,this.elements.progressBarWrapper,a,"click")};a.prototype.addCallbackForParentChildren=function(a){for(var c=this.configuration.parentElement.childNodes,d=0;d<c.length;d++)c[d]!==this.elements.mainDiv.element&&(this.elements["PARENT_CHILD_"+d]=b(c[d]),f.call(this,this.elements["PARENT_CHILD_"+d],a,"click"))};
a.prototype.addPauseCallback=function(a){f.call(this,this.elements.pauseButton,a,"click")};a.prototype.addStopCallback=function(a){f.call(this,this.elements.stopButton,a,"click")};a.prototype.addFullscreenCallback=function(a){f.call(this,this.elements.fullscreen,a,"click")};a.prototype.addCloseFullscreenCallback=function(a){f.call(this,this.elements.closeFullscreen,a,"click")};a.prototype.addVolumeClickCallback=function(a){f.call(this,this.elements.volume,a,"click")};a.prototype.getMainElement=function(){return this.elements.mainDiv.element};
a.prototype.destroy=function(){clearInterval(this.refreshDataIntervalFunction);this.configuration.parentElement.removeEventListener("mouseleave",this.hideControls);this.configuration.parentElement.removeEventListener("mouseenter",this.onWrapperMouseEnter);this.configuration.parentElement.removeEventListener("mousemove",this.onWrapperMouseMove);for(var a in this.elements)this.elements.hasOwnProperty(a)&&(h.call(this,this.elements[a]),a.startsWith("PARENT_CHILD_")||(this.elements[a].element.parentNode.removeChild(this.elements[a].element),
this.elements[a]=null))};a.prototype.setMaxDurationTime=function(a){this.configuration.maxMediaTime=a;this.actualizeTimer()};a.prototype.setCurrentTime=function(a){this.configuration.actualMediaTime=a;this.actualizeTimer()}})(window);(function(e){function a(a){var b=new c;b.setIsAvailableCheckFunction(a);return b}function c(){this.queue=[];this.checkFunction={functionToCall:null}}c.prototype.push=function(a,b,c){this.queue.push({functionToCall:b,argumentsToCall:c,self:a})};c.prototype.callIsAvailableCheckFunction=function(){return this.checkFunction.functionToCall.call(this)};c.prototype.decorate=function(a,b){var c=this,e=b||this.callIsAvailableCheckFunction;return function(){if(e.call(c))return a.apply(this,arguments);c.push(this,
a,arguments)}};c.prototype.setIsAvailableCheckFunction=function(a){this.checkFunction.functionToCall=a};c.prototype.resolve=function(){for(var a=this.queue.length,b=0;b<a;b++){var c=this.queue[b];c.functionToCall.apply(c.self,c.argumentsToCall)}this.queue=[]};e.DecoratorUtils=e.DecoratorUtils||{};e.DecoratorUtils.DeferredSyncQueue=e.DecoratorUtils.DeferredSyncQueue||a})(window);(function(e){function a(){}function c(a){try{return""==a.trim()?void 0:a}catch(c){console.log(c)}}var d=!1;a.DEFAULT_LABELS={command_clear:"clear",command_mark:"mark",command_drawLeft:"drawLeft",command_drawRight:"drawRight",command_drawUp:"drawUp",command_drawDown:"drawDown",command_drawLeftFrom:"drawLeftFrom",command_drawRightFrom:"drawRightFrom",command_drawUpFrom:"drawUpFrom",command_drawDownFrom:"drawDownFrom",command_setColor:"setColor",command_setCursor:"setCursor",command_clearMark:"clearMark",
block_mark:"mark",block_x:"x",block_y:"y",block_clear:"clear",block_steps:"steps",block_drawLeft:"drawLeft",block_drawRight:"drawRight",block_drawUp:"drawUp",block_drawDown:"drawDown",block_drawLeftFrom:"drawLeftFrom",block_drawRightFrom:"drawRightFrom",block_drawUpFrom:"drawUpFrom",block_drawDownFrom:"drawDownFrom",block_setColor:"setColor",block_setCursor:"setCursor",block_clearMark:"clearMark"};a.addBlocks=function(b){if(!d){var e=b=void 0===b?a.DEFAULT_LABELS:$.extend({},a.DEFAULT_LABELS,b);Blockly.Blocks.scene_grid_mark=
{init:function(){this.appendDummyInput().appendField(e.block_mark);this.appendValueInput("x").setCheck("Number").setAlign(Blockly.ALIGN_CENTRE).appendField(e.block_x);this.appendValueInput("y").setCheck("Number").setAlign(Blockly.ALIGN_CENTRE).appendField(e.block_y);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(260);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_mark=
function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,"y",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2});\n",e.command_mark,c(b),c(a))};var h=b;Blockly.Blocks.scene_grid_clear={init:function(){this.appendDummyInput().appendField(h.block_clear);this.setColour(0);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_clear=function(){return StringUtils.format("{0}();\n",
h.command_clear)};var g=b;Blockly.Blocks.scene_grid_drawleftfrom={init:function(){this.appendDummyInput().appendField(g.block_drawLeftFrom);this.appendValueInput("x").setCheck("Number").appendField(g.block_x);this.appendValueInput("y").setCheck("Number").appendField(g.block_y);this.appendValueInput("steps").setCheck("Number").appendField(g.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(195);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};
Blockly.JavaScript.scene_grid_drawleftfrom=function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),d=Blockly.JavaScript.valueToCode(a,"y",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2}, {3});\n",g.command_drawLeftFrom,c(b),c(d),c(a))};var i=b;Blockly.Blocks.scene_grid_drawrightfrom={init:function(){this.appendDummyInput().appendField(i.block_drawRightFrom);this.appendValueInput("x").setCheck("Number").appendField(i.block_x);
this.appendValueInput("y").setCheck("Number").appendField(i.block_y);this.appendValueInput("steps").setCheck("Number").appendField(i.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(270);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawrightfrom=function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),d=Blockly.JavaScript.valueToCode(a,
"y",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2}, {3});\n",i.command_drawRightFrom,c(b),c(d),c(a))};var m=b;Blockly.Blocks.scene_grid_drawupfrom={init:function(){this.appendDummyInput().appendField(m.block_drawUpFrom);this.appendValueInput("x").setCheck("Number").appendField(m.block_x);this.appendValueInput("y").setCheck("Number").appendField(m.block_y);this.appendValueInput("steps").setCheck("Number").appendField(m.block_steps);
this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(120);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawupfrom=function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),d=Blockly.JavaScript.valueToCode(a,"y",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2}, {3});\n",
m.command_drawUpFrom,c(b),c(d),c(a))};var q=b;Blockly.Blocks.scene_grid_drawdownfrom={init:function(){this.appendDummyInput().appendField(q.block_drawDownFrom);this.appendValueInput("x").setCheck("Number").appendField(q.block_x);this.appendValueInput("y").setCheck("Number").appendField(q.block_y);this.appendValueInput("steps").setCheck("Number").appendField(q.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(150);this.setTooltip("");
this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawdownfrom=function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),d=Blockly.JavaScript.valueToCode(a,"y",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2}, {3});\n",q.command_drawDownFrom,c(b),c(d),c(a))};var w=b;Blockly.Blocks.scene_grid_drawleft={init:function(){this.appendDummyInput().appendField(w.block_drawLeft);
this.appendValueInput("steps").setCheck("Number").appendField(w.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(195);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawleft=function(a){a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1});\n",w.command_drawLeft,c(a))};var n=b;Blockly.Blocks.scene_grid_drawright=
{init:function(){this.appendDummyInput().appendField(n.block_drawRight);this.appendValueInput("steps").setCheck("Number").appendField(n.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(270);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawright=function(a){a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1});\n",
n.command_drawRight,c(a))};var l=b;Blockly.Blocks.scene_grid_drawup={init:function(){this.appendDummyInput().appendField(l.block_drawUp);this.appendValueInput("steps").setCheck("Number").appendField(l.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(120);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawup=function(a){a=Blockly.JavaScript.valueToCode(a,
"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1});\n",l.command_drawUp,c(a))};var o=b;Blockly.Blocks.scene_grid_drawdown={init:function(){this.appendDummyInput().appendField(o.block_drawDown);this.appendValueInput("steps").setCheck("Number").appendField(o.block_steps);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(150);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_drawdown=
function(a){a=Blockly.JavaScript.valueToCode(a,"steps",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1});\n",o.command_drawDown,c(a))};var p=b;Blockly.Blocks.scene_grid_setcolor={init:function(){this.appendDummyInput().appendField(p.block_setColor);this.appendValueInput("color").setCheck("String").appendField(p.color);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(300);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};
Blockly.JavaScript.scene_grid_setcolor=function(a){var a=Blockly.JavaScript.valueToCode(a,"color",Blockly.JavaScript.ORDER_ATOMIC),b=StringUtils.format("{0}({1});\n",p.command_setColor,a);return b=StringUtils.format("setColor({0});\n",a)};var j=b;Blockly.Blocks.scene_grid_setcursor={init:function(){this.appendDummyInput().appendField(j.block_setCursor);this.appendValueInput("x").setCheck("Number").appendField(j.block_x);this.appendValueInput("y").setCheck("Number").appendField(j.block_y);this.setInputsInline(!0);
this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(300);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_setcursor=function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,"y",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2});\n",j.command_setCursor,c(b),c(a))};var k=b;Blockly.Blocks.scene_grid_clearmark={init:function(){this.appendDummyInput().appendField(k.block_clearMark);
this.appendValueInput("x").setCheck("Number").appendField(k.block_x);this.appendValueInput("y").setCheck("Number").appendField(k.block_y);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(210);this.setTooltip("");this.setHelpUrl("http://mauthor.com/doc/en/page/Blockly-Code-Editor")}};Blockly.JavaScript.scene_grid_clearmark=function(a){var b=Blockly.JavaScript.valueToCode(a,"x",Blockly.JavaScript.ORDER_ATOMIC),a=Blockly.JavaScript.valueToCode(a,
"y",Blockly.JavaScript.ORDER_ATOMIC);return StringUtils.format("{0}({1}, {2});\n",k.command_clearMark,c(b),c(a))};d=!0}};e.BlocklyCustomBlocks=e.BlocklyCustomBlocks||{};e.BlocklyCustomBlocks.SceneGrid=e.BlocklyCustomBlocks.SceneGrid||a})(window);
/**
 * Player Addons Commons library
 * @version 4.2.1
 * Components:
 * - Model Validation Utils
 * - DOM Operations
 * - Statefull Addon Object
 * - Draggable Droppable Object
 * - States Serialization
 * - Watermark
 * - Commands
 * - Image Viewer (partial)
 * - Helpers
 * - Mobile Utils
 * - String Utils
 * - Internationalization
 * - Text Parser Proxy
 * - Loaded Promise
 * - Events Utils
 * - Model Error Utils
 * - Blockly Custom Scene Blocks
 * - Keyboard Navigation Controller
 */