",document.writeln(d))},get:function(){try{var a=document.getElementById(this.properties.id+"")}catch(b){}return a},setVisible:function(a){var b=document.getElementById(this.properties.id+"Container");1==a?b.style.visibility="visible":(b.style.position="absolute",b.style.x="-1000px",b.style.y="-1000px",b.style.visibility="hidden")},center:function(){var a=(this.properties.width,this.properties.height,0),b=0,c=document.getElementById(this.properties.id+"Container");c.style.top=b+"px",c.style.left=a+"px"}},lz.embed.dojo.Communicator=function(a){this._id=a},lz.embed.dojo.Communicator.prototype={_addExternalInterfaceCallback:function(a,b){var c=lz.embed.dojo,d=function(){for(var d=[],e=0;e","g"),">"),a=a.replace("\\","&custom_backslash;&custom_backslash;"),a=a.replace(RegExp("\\n","g"),"\\n"),a=a.replace(RegExp("\\r","g"),"\\r"),a=a.replace(RegExp("\\f","g"),"\\f"),a=a.replace(RegExp("\\0","g"),"\\0"),a=a.replace(RegExp("\\'","g"),"\\'"),a=a.replace(RegExp('\\"',"g"),'\\"')},_decodeData:function($1){return null==$1||"undefined"==typeof $1?$1:($1=$1.replace(RegExp("\\&custom_lt\\;","g"),"<"),$1=$1.replace(RegExp("\\&custom_gt\\;","g"),">"),$1=eval('"'+$1+'"'))},_chunkArgumentData:function(a,b,c){for(var d=lz.embed.dojo.obj[c].get(),e=Math.ceil(a.length/1024),f=0;f'+i+""+b+"")}},_chunkReturnData:function(a){for(var b=lz.embed.dojo.obj[a].get(),c=b.getReturnLength(),d=[],e=0;e'+e+"");f='""'==f||"''"==f?"":f.substring(1,f.length-1),d.push(f)}var g=d.join("");return g},_execFlash:function(a,b,c){var d=lz.embed.dojo.obj[c].get();d.startExec(),d.setNumberArguments(b.length);for(var e=0;ea.info.versionMajor||!a.info.isVersionOrAbove(8,0,0)))},install:function(){var a=lz.embed.dojo;a.info.installing=!0,a.installing();var b=a.obj[this._id].properties,c=b.flash8,d=c.indexOf("swf7");d!=-1&&(a._tempurl=c,c=c.substring(0,d+3)+"8"+c.substring(d+4,c.length),b.flash8=c);var d=c.indexOf("swf9");if(d!=-1&&(a._tempurl=c,c=c.substring(0,d+3)+"8"+c.substring(d+4,c.length),b.flash8=c),a.ready=!1,0==a.info.capable){a._isinstaller=!0;var e=new a.Embed(b);e.write(a.minimumVersion)}else if(a.info.isVersionOrAbove(6,0,65)){var e=new a.Embed(b);e.write(a.minimumVersion,!0),e.setVisible(!0),e.center()}else alert("This content requires a more recent version of the Macromedia Flash Player."),window.location="http://www.macromedia.com/go/getflashplayer"},_onInstallStatus:function(a){"Download.Complete"==a?lz.embed.browser.isIE&&(top.location=top.location+""):"Download.Cancelled"==a?(alert("This content requires a more recent version of the Macromedia Flash Player."),window.location="http://www.macromedia.com/go/getflashplayer"):"Download.Failed"==a&&(alert("There was an error downloading the Flash Player update. Please try again later, or visit macromedia.com to download the latest version of the Flash plugin."),window.location="http://www.macromedia.com/go/getflashplayer")}},lz.embed.dojo.info=new lz.embed.dojo.Info,lz.embed.iframemanager={__counter:0,__frames:{},__namebyid:{},__loading:{},__callqueue:{},__calljsqueue:{},__sendmouseevents:{},__hidenativecontextmenu:{},__selectionbookmarks:{},create:function(a,b,c,d,e,f){var g="__lz"+lz.embed.iframemanager.__counter++,h='javascript:""',i='lz.embed.iframemanager.__gotload("'+g+'")';if(null!=b&&"null"!=b&&""!=b||(b=g),lz.embed.iframemanager.__namebyid[g]=b,null!=d&&"undefined"!=d||(d=document.body),document.all){var j="";var k=document.createElement("div");lz.embed.__setAttr(k,"id",g+"Container"),d.appendChild(k),k.innerHTML=j;var l=document.getElementById(g)}else{var l=document.createElement("iframe");lz.embed.__setAttr(l,"name",b),lz.embed.__setAttr(l,"src",h),lz.embed.__setAttr(l,"id",g),lz.embed.__setAttr(l,"onload",i),1!=c&&lz.embed.__setAttr(l,"scrolling","no"),this.appendTo(l,d)}return l?this.__finishCreate(g,a,b,c,d,e,f):(this.__callqueue[g]=[["__finishCreate",g,a,b,c,d,e,f]],setTimeout('lz.embed.iframemanager.__checkiframe("'+g+'")',10)),g+""},__checkiframe:function(a){var b=document.getElementById(a);if(b){var c=lz.embed.iframemanager.__callqueue[a];delete lz.embed.iframemanager.__callqueue[a],lz.embed.iframemanager.__playQueue(c)}else setTimeout('lz.embed.iframemanager.__checkiframe("'+a+'")',10)},__playQueue:function(a){for(var b=lz.embed.iframemanager,c=0;c0)for(var d=0;d0&&(a._intervalID=setInterval("lz.embed.history._checklocationhash()",a.intervaltime))}},listen:function(a){if(("string"!=typeof a||(a=lz.embed.applications[a],a&&a.runtime))&&a){var b=lz.embed.history;b._registeredapps[a._id]||(b._registeredapps[a.id]=!0,b._apps.push(a),b.init())}},_checklocationhash:function(){if(!(lz.embed.dojo&&lz.embed.dojo.info&&lz.embed.dojo.info.installing))if(lz.embed.browser.isSafari){var a=this._history[this._historylength-1];""!=a&&"#"!=a||(a="#0"),this._skip||this._historylength==history.length?this._parse(a.substring(1)):(this._historylength=history.length,"undefined"!=typeof a&&(a=a.substring(1),this._currentstate=a,this._parse(a)))}else{var a=lz.embed.history.get();""==a&&(a="0"),lz.embed.browser.isIE?(a!=this._currentstate&&(top.location.hash="0"==a?"":"#"+a,this._currentstate=a,this._parse(a)),top.document.title!=this._title&&(top.document.title=this._title)):(this._currentstate=a,this._parse(a))}},set:function(a){if(0!=lz.embed.history.active&&(null==a&&(a=""),lz.embed.history._currentstate!=a)){lz.embed.history._currentstate=a;var b="#"+a;if(lz.embed.browser.isIE){top.location.hash="#0"==b?"":b;var c=lz.embed.history._iframe.contentDocument||lz.embed.history._iframe.contentWindow.document;c.open(),c.close(),c.location.hash=b,lz.embed.history._parse(a+"")}else if(lz.embed.browser.isSafari)if(lz.embed.history._history[history.length]=b,lz.embed.history._historylength=history.length+1,lz.embed.browser.version<412)""==top.location.search&&(lz.embed.history._form.action=b,top.document.location.lzaddr.history=lz.embed.history._history.toString(),lz.embed.history._skip=!0,lz.embed.history._form.submit(),lz.embed.history._skip=!1);else{var d=document.createEvent("MouseEvents");d.initEvent("click",!0,!0);var e=document.createElement("a");e.href=b,e.dispatchEvent(d)}else top.location.hash=b,lz.embed.history._parse(a+"");return!0}},get:function(){var a="";if(lz.embed.browser.isIE){if(lz.embed.history._iframe){var b=lz.embed.history._iframe.contentDocument||lz.embed.history._iframe.contentWindow.document;a=b.location.hash}}else a=top.location.href;var c=a.indexOf("#");return c!=-1?a.substring(c+1):""},_parse:function(a){var b=lz.embed.history;if(0!=a.length)for(var c=0,d=lz.embed.history._apps.length;c";document.writeln(t);return t},__dhtmlLoadLibrary:function __dhtmlLoadLibrary(e){var t=document.createElement("script");this.__setAttr(t,"type","text/javascript");this.__setAttr(t,"src",e);document.getElementsByTagName("head")[0].appendChild(t);return t},__getqueryurl:function __getqueryurl(e,t){var n=e.split("?");e=n[0];if(1==n.length){return{url:e,flashvars:"",query:""}}var a=this.__parseQuery(n[1]),r="",s="",i=/\+/g;for(var o in a){if(""==o||null==o){continue}var d=a[o];if("lzr"==o||"lzt"==o||"debug"==o||"profile"==o||"lzbacktrace"==o||"lzconsoledebug"==o||"lzdebug"==o||"lzkrank"==o||"lzprofile"==o||"lzcopyresources"==o||"fb"==o||"sourcelocators"==o||"_canvas_debug"==o||"lzsourceannotations"==o){r+=o+"="+d+"&"}if(t){if(null==window[o]){window[o]=unescape(d.replace(i," "))}}s+=o+"="+d+"&"}r=r.substr(0,r.length-1);s=s.substr(0,s.length-1);return{url:e,flashvars:s,query:r}},__parseQuery:function __parseQuery(e){if(-1==e.indexOf("=")){return}for(var t=e.split("&"),n={},a=0,r;a");a=document.getElementById(n)}return a},_getSWFDiv:function _getSWFDiv(){return lz.embed.dojo.obj[this._id].get()},_sendMouseWheel:function _sendMouseWheel(e){if(null!=e){this.callMethod("lz.Keys.__mousewheelEvent("+e+")")}},_gotFocus:function _gotFocus(){lz.embed._broadcastMethod("_sendAllKeysUp")},_sendAllKeysUpSWF:function _sendAllKeysUpSWF(){this.callMethod("lz.Keys.__allKeysUp()")},_sendAllKeysUpDHTML:function _sendAllKeysUpDHTML(){if(lz.Keys&&lz.Keys.__allKeysUp){lz.Keys.__allKeysUp()}},_sendPercLoad:function _sendPercLoad(e){if(this.onloadstatus&&"function"==typeof this.onloadstatus){this.onloadstatus(e)}},attachEventHandler:function attachEventHandler(e,t,n,a,r){if(!(n&&a&&"function"==typeof n[a])){return}var s=e+t+n+a,i=this._handlers[s];if(null!=i){if(i instanceof Array){for(var o=i.length-1;0<=o;--o){if(i[o].$e===e&&i[o].$c===n){return}}}else{if(i.$e===e&&i.$c===n){return}}}var d=function(){var e=window.event?[window.event]:[].slice.call(arguments,0);if(r){e.push(r)}n[a].apply(n,e)};d.$e=e;d.$c=n;if(null!=i){if(i instanceof Array){i.push(d)}else{i=[i,d]}}else{i=d}this._handlers[s]=i;if(e.addEventListener){e.addEventListener(t,d,!1);return!0}else{if(e.attachEvent){return e.attachEvent("on"+t,d)}}},removeEventHandler:function removeEventHandler(e,t,n,a){var r=e+t+n+a,s,i=this._handlers[r];if(null!=i){if(i instanceof Array){for(var o=i.length-1;0<=o;--o){if(i[o].$e===e&&i[o].$c===n){s=i[o];i.splice(o,1);if(0==i.length){delete this._handlers[r]}}}}else{if(i.$e===e&&i.$c===n){s=i;delete this._handlers[r]}}}if(!s){return}if(e.removeEventListener){e.removeEventListener(t,s,!1);return!0}else{if(e.detachEvent){return e.detachEvent("on"+t,s)}}},_handlers:{},_cleanupHandlers:function _cleanupHandlers(){lz.embed._handlers={}},getAbsolutePosition:function getAbsolutePosition(e){var t=null,n={},a;if(!(lz.embed.browser.isFirefox&&e==document.body)&&e.getBoundingClientRect){a=e.getBoundingClientRect();var r=document.documentElement.scrollTop||document.body.scrollTop,s=document.documentElement.scrollLeft||document.body.scrollLeft;return{x:Math.floor(a.left+s),y:Math.floor(a.top+r)}}else{if(document.getBoxObjectFor){a=document.getBoxObjectFor(e);n={x:a.x,y:a.y}}else{n={x:e.offsetLeft,y:e.offsetTop};t=e.offsetParent;if(t!=e){while(t){n.x+=t.offsetLeft;n.y+=t.offsetTop;t=t.offsetParent}}if(lz.embed.browser.isSafari&&document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(e,"")}if(lz.embed.browser.isOpera||lz.embed.browser.isSafari&&i&&"absolute"==i.position){n.y-=document.body.offsetTop}}}if(e.parentNode){t=e.parentNode}else{return n}while(t&&"BODY"!=t.tagName&&"HTML"!=t.tagName){n.x-=t.scrollLeft;n.y-=t.scrollTop;if(t.parentNode){t=t.parentNode}else{return n}}return n},CSSDimension:function CSSDimension(e,t){var n=e;if(isNaN(e)){if(e.indexOf("%")==e.length-1&&!isNaN(e.substring(0,e.length-1))){return e}else{n=0}}else{if(e===1/0){n=2147483647}else{if(e===-Infinity){n=-2147483648}}}return n+(t?t:"px")}};lz.embed.browser.init();lz.embed.attachEventHandler(window,"beforeunload",lz.embed,"_cleanupHandlers");lz.embed.attachEventHandler(window,"focus",lz.embed,"_gotFocus");if(lz.embed.browser.isIE){lz.embed.attachEventHandler(window,"activate",lz.embed,"_gotFocus")}try{if(lzOptions){if(lzOptions.dhtmlKeyboardControl){alert("WARNING: this page uses lzOptions.dhtmlKeyboardControl. Please use the cancelkeyboardcontrol embed argument for lz.embed.dhtml() instead.")}if(lzOptions.ServerRoot){alert("WARNING: this page uses lzOptions.ServerRoot. Please use the second argument of lz.embed.lfc() instead.")}}}catch(t){}lz.embed.dojo=function(){};lz.embed.dojo={defaults:{flash8:null,ready:!1,visible:!0,width:500,height:400,bgcolor:"#ffffff",allowfullscreen:!1,wmode:"window",flashvars:"",minimumVersion:8,id:"flashObject",appenddiv:null},obj:{},comm:{},_loadedListeners:[],_loadedListenerScopes:[],_installingListeners:[],_installingListenerScopes:[],setSwf:function setSwf(e,t){if(null==e){return}var n={};for(var a in this.defaults){var r=e[a];if(null!=r){n[a]=r}else{n[a]=this.defaults[a]}}if(null!=t){this.minimumVersion=t}this._initialize(n)},addLoadedListener:function addLoadedListener(e,t){this._loadedListeners.push(e);this._loadedListenerScopes.push(t)},addInstallingListener:function addInstallingListener(e,t){this._installingListeners.push(e);this._installingListenerScopes.push(t)},loaded:function loaded(e){var t=lz.embed.dojo;if(t._isinstaller){top.location=top.location+""}t.info.installing=!1;t.ready=!0;if(0");document.writeln("Function VBGetSwfVer(i)");document.writeln(" on error resume next");document.writeln(" Dim swControl, swVersion");document.writeln(" swVersion = 0");document.writeln(" set swControl = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" + CStr(i))");document.writeln(" if (IsObject(swControl)) then");document.writeln(" swVersion = swControl.GetVariable(\"$version\")");document.writeln(" end if");document.writeln(" VBGetSwfVer = swVersion");document.writeln("End Function");document.writeln("")}this._detectVersion();this._detectCommunicationVersion()};lz.embed.dojo.Info.prototype={version:-1,versionMajor:-1,versionMinor:-1,versionRevision:-1,capable:!1,commVersion:8,installing:!1,isVersionOrAbove:function isVersionOrAbove(e,t,n){n=parseFloat("."+n);if(this.versionMajor>=e&&this.versionMinor>=t&&this.versionRevision>=n){return!0}else{return!1}},_detectVersion:function _detectVersion(){for(var e,t=lz.embed.browser.isIE,n=25;0s.dojo.version){t=!0}r=this.properties.flash8;var i=this.properties.flashvars,o=this.properties.flashvars;if(t){var d=escape(window.location);document.title=document.title.slice(0,47)+" - Flash Player Installation";var l=escape(document.title);i+="&MMredirectURL="+d+"&MMplayerType=ActiveX&MMdoctitle="+l;o+="&MMredirectURL="+d+"&MMplayerType=PlugIn"}if(s.browser.isIE){a=""}else{a=""}var m=this.properties.id+"Container",c=this.properties.appenddiv;if(c){c.innerHTML=a;c.setAttribute("style",n)}else{a="
"+a+"
";document.writeln(a)}},get:function get(){try{var e=document.getElementById(this.properties.id+"")}catch(t){}return e},setVisible:function setVisible(e){var t=document.getElementById(this.properties.id+"Container");if(!0==e){t.style.visibility="visible"}else{t.style.position="absolute";t.style.x="-1000px";t.style.y="-1000px";t.style.visibility="hidden"}},center:function center(){var e=this.properties.width,t=this.properties.height,n=document.getElementById(this.properties.id+"Container");n.style.top=0+"px";n.style.left=0+"px"}};lz.embed.dojo.Communicator=function(e){this._id=e};lz.embed.dojo.Communicator.prototype={_addExternalInterfaceCallback:function _addExternalInterfaceCallback(e,t){var n=lz.embed.dojo;n.comm[t][e]=function(){for(var a=[],r=0;r/g,">");e=e.replace("\\","&custom_backslash;&custom_backslash;");e=e.replace(/\n/g,"\\n");e=e.replace(/\r/g,"\\r");e=e.replace(/\f/g,"\\f");e=e.replace(/\0/g,"\\0");e=e.replace(/\'/g,"\\'");e=e.replace(/\"/g,"\\\"");return e},_decodeData:function _decodeData($1){if(null==$1||"undefined"==typeof $1){return $1}$1=$1.replace(/\&custom_lt\;/g,"<");$1=$1.replace(/\&custom_gt\;/g,">");$1=eval("\""+$1+"\"");return $1},_chunkArgumentData:function _chunkArgumentData(e,t,n){for(var a=lz.embed.dojo.obj[n].get(),r=Math.ceil(e.length/1024),s=0;s"+d+""+t+"")}},_chunkReturnData:function _chunkReturnData(e){for(var t=lz.embed.dojo.obj[e].get(),n=t.getReturnLength(),a=[],r=0,s;r"+r+"");if("\"\""==s||"''"==s){s=""}else{s=s.substring(1,s.length-1)}a.push(s)}var i=a.join("");return i},_execFlash:function _execFlash(e,t,n){var a=lz.embed.dojo.obj[n].get();a.startExec();a.setNumberArguments(t.length);for(var r=0;re.info.versionMajor){return!0}if(!e.info.isVersionOrAbove(8,0,0)){return!0}return!1},install:function install(){var e=lz.embed.dojo;e.info.installing=!0;e.installing();var t=e.obj[this._id].properties,n=t.flash8,a=n.indexOf("swf7");if(-1!=a){e._tempurl=n;n=n.substring(0,a+3)+"8"+n.substring(a+4,n.length);t.flash8=n}var a=n.indexOf("swf9");if(-1!=a){e._tempurl=n;n=n.substring(0,a+3)+"8"+n.substring(a+4,n.length);t.flash8=n}e.ready=!1;if(!1==e.info.capable){e._isinstaller=!0;var r=new e.Embed(t);r.write(e.minimumVersion)}else{if(e.info.isVersionOrAbove(6,0,65)){var r=new e.Embed(t);r.write(e.minimumVersion,!0);r.setVisible(!0);r.center()}else{alert("This content requires a more recent version of the Macromedia Flash Player.");window.location="http://www.macromedia.com/go/getflashplayer"}}},_onInstallStatus:function _onInstallStatus(e){if("Download.Complete"==e){if(lz.embed.browser.isIE){top.location=top.location+""}}else{if("Download.Cancelled"==e){alert("This content requires a more recent version of the Macromedia Flash Player.");window.location="http://www.macromedia.com/go/getflashplayer"}else{if("Download.Failed"==e){alert("There was an error downloading the Flash Player update. Please try again later, or visit macromedia.com to download the latest version of the Flash plugin.");window.location="http://www.macromedia.com/go/getflashplayer"}}}}};lz.embed.dojo.info=new lz.embed.dojo.Info;lz.embed.iframemanager={__counter:0,__frames:{},__namebyid:{},__loading:{},__callqueue:{},__calljsqueue:{},__sendmouseevents:{},__hidenativecontextmenu:{},__selectionbookmarks:{},create:function create(e,t,n,a,r,s){var i="__lz"+lz.embed.iframemanager.__counter++,o="javascript:\"\"",d="lz.embed.iframemanager.__gotload(\""+i+"\")";if(null==t||"null"==t||""==t){t=i}lz.embed.iframemanager.__namebyid[i]=t;if(null==a||"undefined"==a){a=document.body}if(document.all){var l="";var m=document.createElement("div");lz.embed.__setAttr(m,"id",i+"Container");a.appendChild(m);m.innerHTML=l;var c=document.getElementById(i)}else{var c=document.createElement("iframe");lz.embed.__setAttr(c,"name",t);lz.embed.__setAttr(c,"src",o);lz.embed.__setAttr(c,"id",i);lz.embed.__setAttr(c,"onload",d);if(!0!=n){lz.embed.__setAttr(c,"scrolling","no")}this.appendTo(c,a)}if(c){this.__finishCreate(i,e,t,n,a,r,s)}else{this.__callqueue[i]=[["__finishCreate",i,e,t,n,a,r,s]];setTimeout("lz.embed.iframemanager.__checkiframe(\""+i+"\")",10)}return i+""},__checkiframe:function __checkiframe(e){var t=document.getElementById(e);if(t){var n=lz.embed.iframemanager.__callqueue[e];delete lz.embed.iframemanager.__callqueue[e];lz.embed.iframemanager.__playQueue(n)}else{setTimeout("lz.embed.iframemanager.__checkiframe(\""+e+"\")",10)}},__playQueue:function __playQueue(e){for(var t=lz.embed.iframemanager,n=0;nlz.embed.browser.version){if(""==top.location.search){lz.embed.history._form.action=t;top.document.location.lzaddr.history=lz.embed.history._history.toString();lz.embed.history._skip=!0;lz.embed.history._form.submit();lz.embed.history._skip=!1}}else{var a=document.createEvent("MouseEvents");a.initEvent("click",!0,!0);var r=document.createElement("a");r.href=t;r.dispatchEvent(a)}}else{top.location.hash=t;lz.embed.history._parse(e+"")}}return!0},get:function get(){var e="";if(lz.embed.browser.isIE){if(lz.embed.history._iframe){var t=lz.embed.history._iframe.contentDocument||lz.embed.history._iframe.contentWindow.document;e=t.location.hash}}else{e=top.location.href}var n=e.indexOf("#");if(-1!=n){return e.substring(n+1)}return""},_parse:function _parse(e){var t=lz.embed.history;if(0==e.length){return}for(var n=0,a=lz.embed.history._apps.length,r;n'},test:function(){console.log(c.init())},fetch_dialogue_box:function(a){return'
"],optgroup:i,option:i,caption:s,colgroup:s,tbody:s,tfoot:s,thead:s,td:u,th:u};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(t){p[t]=l,a[t]=!0}),e.exports=function(t){return r?void 0:o(!1),p.hasOwnProperty(t)||(t="*"),a.hasOwnProperty(t)||("*"===t?r.innerHTML="":r.innerHTML="<"+t+">"+t+">",a[t]=!r.firstChild),a[t]?p[t]:null}},{144:144,158:158}],155:[function(n,e){"use strict";e.exports=function(t){return t===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:t.scrollLeft,y:t.scrollTop}}},{}],156:[function(n,e){"use strict";var t=/([A-Z])/g;e.exports=function(n){return n.replace(t,"-$1").toLowerCase()}},{}],157:[function(n,e){"use strict";var t=n(156),o=/^ms-/;e.exports=function(n){return t(n).replace(o,"-ms-")}},{156:156}],158:[function(n,e){"use strict";e.exports=function r(r,e,t,n,d,o,a,i){if(!r){var p;if(void 0===e)p=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[t,n,d,o,a,i],l=0;p=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[l++]}))}throw p.framesToPop=1,p}}},{}],159:[function(n,e){"use strict";function t(t){return!(!t||!("function"==typeof Node?t instanceof Node:"object"==_typeof(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName))}e.exports=t},{}],160:[function(n,e){"use strict";var t=n(159);e.exports=function(n){return t(n)&&3==n.nodeType}},{159:159}],161:[function(n,e){"use strict";function t(o){o||(o="");var a,d=arguments.length;if(1n;n++){a=arguments[n],a&&(o=(o?o+" ":"")+a)}return o}e.exports=t},{}],162:[function(n,e){"use strict";var o=n(158);e.exports=function o(r){var e,a={};r instanceof Object&&!Array.isArray(r)?void 0:o(!1);for(e in r){r.hasOwnProperty(e)&&(a[e]=e)}return a}},{158:158}],163:[function(n,e){"use strict";e.exports=function r(n){for(var e in n){if(n.hasOwnProperty(e))return e}return null}},{}],164:[function(n,e){"use strict";function t(o,e,t){if(!o)return null;var n={};for(var r in o){d.call(o,r)&&(n[r]=e.call(t,o[r],r,o))}return n}var d=Object.prototype.hasOwnProperty;e.exports=t},{}],165:[function(n,e){"use strict";e.exports=function(o){var e={};return function(t){return e.hasOwnProperty(t)||(e[t]=o.call(this,t)),e[t]}}},{}],166:[function(n,e){"use strict";function t(o,e){if(o===e)return!0;if("object"!=_typeof(o)||null===o||"object"!=_typeof(e)||null===e)return!1;var t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(var d=r.bind(e),a=0;ao;o++){t[o]=n[o]}return t}var d=n(158);e.exports=t},{158:158}],168:[function(n,e){"use strict";var t=n(150);e.exports=t},{150:150}]},{},[1])(1)});
+//# sourceMappingURL=react-with-addons.min.js.map
diff --git a/amd/build/react_amd.min.js b/amd/build/react_amd.min.js
index 4e2b7700..68f9cffa 100644
--- a/amd/build/react_amd.min.js
+++ b/amd/build/react_amd.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log","filter_poodll/react-with-addons"],function(a,b,c){"use strict";return b.debug("Filter PoodLL: revealjs initialising"),window.React=c,{}});
\ No newline at end of file
+define ("filter_poodll/react_amd",["jquery","core/log","filter_poodll/react-with-addons"],function(a,b,c){"use strict";b.debug("Filter PoodLL: revealjs initialising");window.React=c;return{}});
+//# sourceMappingURL=react_amd.min.js.map
diff --git a/amd/build/responsiveiframe.min.js b/amd/build/responsiveiframe.min.js
index 9e6ae0de..b1916087 100644
--- a/amd/build/responsiveiframe.min.js
+++ b/amd/build/responsiveiframe.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("responsive iframe initialising"),{defheight:150,defwidth:300,init:function(b){var c=a("#"+b.iframeid);if(0==c.length&&(c=a("#"+b.iframeid,window.parent.document)),c.length>0){var d={currentheight:this.defheight,currentwidth:this.defwidth,theiframe:c,thisref:this};this._iframeResize(d)}},_iframeResize:function(a){var b=a.theiframe;if(b&&!(b.length<1)){var c=b[0].contentWindow.document.body.scrollHeight,d=b[0].contentWindow.document.body.scrollWidth;c==a.currentheight&&d==a.currentwidth||(b.attr("height",c+"px"),b.attr("width",d+"px")),a.currentheight=c,a.currentwidth=d,setTimeout(a.thisref._iframeResize,100,a)}}}});
\ No newline at end of file
+define ("filter_poodll/responsiveiframe",["jquery","core/log"],function(a,b){"use strict";b.debug("responsive iframe initialising");return{defheight:150,defwidth:300,init:function init(b){var c=a("#"+b.iframeid);if(0==c.length){c=a("#"+b.iframeid,window.parent.document)}if(0b.length){return}var c=b[0].contentWindow.document.body.scrollHeight,d=b[0].contentWindow.document.body.scrollWidth;if(c!=a.currentheight||d!=a.currentwidth){b.attr("height",c+"px");b.attr("width",d+"px")}a.currentheight=c;a.currentwidth=d;setTimeout(a.thisref._iframeResize,100,a)}}});
+//# sourceMappingURL=responsiveiframe.min.js.map
diff --git a/amd/build/speech_browser.min.js b/amd/build/speech_browser.min.js
index 0a60d37d..98c73994 100644
--- a/amd/build/speech_browser.min.js
+++ b/amd/build/speech_browser.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("speech_browser: initialising"),{recognition:null,recognizing:!1,ignore_onend:!1,final_transcript:"",start_timestamp:0,lang:"en-US",clone:function(){return a.extend(!0,{},this)},init:function(a){var b=b||webkitSpeechRecognition;this.recognition=new b,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.lang=a?a:"en-US",this.register_events()},set_grammar:function(a){var b=b||webkitSpeechGrammarList;if(b){var c=new b;c.addFromString(a,1),this.recognition.grammars=c}},start:function(){this.recognizing||(this.recognizing=!0,this.final_transcript="",this.recognition.lang=this.lang,this.recognition.start(),this.ignore_onend=!1,this.start_timestamp=Date.now())},stop:function(){this.recognizing=!1,this.recognition.stop()},register_events:function(){var a=this.recognition,c=this;a.onstart=function(){c.recognizing=!0},a.onerror=function(a){"no-speech"==a.error&&(b.debug("info_no_speech"),c.ignore_onend=!0),"audio-capture"==a.error&&(b.debug("info_no_microphone"),c.ignore_onend=!0),"not-allowed"==a.error&&(a.timeStamp-c.start_timestamp<100?b.debug("info_blocked"):b.debug("info_denied"),c.ignore_onend=!0)},a.onend=function(){0!=c.recognizing&&(c.ignore_onend?c.recognizing=!1:a.start())},a.onresult=function(a){for(var b="",d=a.resultIndex;da.timeStamp-c.start_timestamp){b.debug("info_blocked")}else{b.debug("info_denied")}c.ignore_onend=!0}};a.onend=function(){if(!1==c.recognizing){return}if(c.ignore_onend){c.recognizing=!1}else{a.start()}};a.onresult=function(a){for(var b="",d=a.resultIndex;dthis.csslinks.indexOf(b.CSSLINK)){this.csslinks.push(b.CSSLINK);this.injectcss(b.CSSLINK)}}if(b.CSSUPLOAD){if(0>this.csslinks.indexOf(b.CSSUPLOAD)){this.csslinks.push(b.CSSUPLOAD);this.injectcss(b.CSSUPLOAD)}}if(b.CSSCUSTOM){if(0>this.csslinks.indexOf(b.CSSCUSTOM)){this.csslinks.push(b.CSSCUSTOM);this.injectcss(b.CSSCUSTOM)}}if("undefined"!=typeof b.TEMPLATEID){require(["filter_poodll_d"+b.TEMPLATEID],function(a){a(b)})}}}});
+//# sourceMappingURL=template_amd.min.js.map
diff --git a/amd/build/template_presets_amd.min.js b/amd/build/template_presets_amd.min.js
index be588369..582dd248 100644
--- a/amd/build/template_presets_amd.min.js
+++ b/amd/build/template_presets_amd.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("Filter Poodll Presets initialising"),{presetdata:!1,dataitems:["name","key","version","instructions","showatto","showplayers","requirecss","requirejs","shim","defaults","amd","body","bodyend","script","style","dataset","datasetvars","alternate","alternateend"],fetchcontrols:function(a){var b={};return b.name=document.getElementById("id_s_filter_poodll_templatename_"+a),b.key=document.getElementById("id_s_filter_poodll_templatekey_"+a),b.version=document.getElementById("id_s_filter_poodll_templateversion_"+a),b.instructions=document.getElementById("id_s_filter_poodll_templateinstructions_"+a),b.showatto=document.getElementById("id_s_filter_poodll_template_showatto_"+a),b.showplayers=document.getElementById("id_s_filter_poodll_template_showplayers_"+a),b.requirecss=document.getElementById("id_s_filter_poodll_templaterequire_css_"+a),b.requirejs=document.getElementById("id_s_filter_poodll_templaterequire_js_"+a),b.shim=document.getElementById("id_s_filter_poodll_templaterequire_js_shim_"+a),b.defaults=document.getElementById("id_s_filter_poodll_templatedefaults_"+a),b.amd=document.getElementById("id_s_filter_poodll_template_amd_"+a),b.body=document.getElementById("id_s_filter_poodll_template_"+a),b.bodyend=document.getElementById("id_s_filter_poodll_templateend_"+a),b.script=document.getElementById("id_s_filter_poodll_templatescript_"+a),b.style=document.getElementById("id_s_filter_poodll_templatestyle_"+a),b.dataset=document.getElementById("id_s_filter_poodll_dataset_"+a),b.datasetvars=document.getElementById("id_s_filter_poodll_datasetvars_"+a),b.alternate=document.getElementById("id_s_filter_poodll_templatealternate_"+a),b.alternateend=document.getElementById("id_s_filter_poodll_templatealternate_end_"+a),b.presetdata=document.getElementById("id_s_filter_poodll_presetdata_"+a),b},fetchjsonbundle:function(b,c){var d={};a.each(this.dataitems,function(a,b){d[b]=c[b].value});var e=JSON.stringify(d);return e},exportbundle:function(a){var b=this.fetchcontrols(a);if(""!=b.key.value){var c=this.fetchjsonbundle(a,b),d=document.createElement("a");if(d.setAttribute("href","data:text/json;charset=utf-8,"+encodeURIComponent(c)),d.setAttribute("download",b.key.value+".txt"),document.createEvent){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),d.dispatchEvent(e)}else d.click()}},populateform:function(b,c,d){var e=this.fetchcontrols(b);(c||d)&&(0==c&&d||(d=this.presetdata),a.each(this.dataitems,function(a,b){if(d[c].hasOwnProperty(b)){if("cleartemplate"!=d[c].key||"key"!=b&&"name"!=b)var f=d[c][b];else var f="";e[b].value=f}else switch(b){case"amd":case"showplayers":case"showatto":e[b].value=0;break;default:e[b].value=""}}))},dopopulate:function(a,b){this.populateform(a,0,new Array(b))},init:function(b){if(!this.presetdata){var c="#id_s_filter_poodll_presetdata_"+b.templateindex,d=a(c).get(0);this.presetdata=JSON.parse(d.value),a(c).remove()}var e=this;a("select[name='filter_poodll/presets']").change(function(){e.populateform(b.templateindex,a(this).val())});var f="#id_s_filter_poodll_dragdropsquare_"+b.templateindex;a(f).on("click",function(){e.exportbundle(b.templateindex)}),a(f).on("dragover",function(b){b.preventDefault(),b.stopPropagation(),a(this).addClass("filter_poodll_dragging")}),a(f).on("dragleave",function(b){b.preventDefault(),b.stopPropagation(),a(this).removeClass("filter_poodll_dragging")}),a(f).on("drop",function(c){c.preventDefault();var d=c.originalEvent.dataTransfer.files;if(d.length){var f=d[0];if(f){var g=new FileReader;g.onload=function(a){var c=a.target.result,d=JSON.parse(c);d.key&&e.dopopulate(b.templateindex,d)},g.readAsText(f)}else alert("Failed to load file")}a(this).removeClass("filter_poodll_dragging")})}}});
\ No newline at end of file
+define ("filter_poodll/template_presets_amd",["jquery","core/log"],function(a,b){"use strict";b.debug("Filter Poodll Presets initialising");return{presetdata:!1,dataitems:["name","key","version","instructions","showatto","showplayers","requirecss","requirejs","shim","defaults","amd","body","bodyend","script","style","dataset","datasetvars","alternate","alternateend"],fetchcontrols:function fetchcontrols(a){var b={name:document.getElementById("id_s_filter_poodll_templatename_"+a),key:document.getElementById("id_s_filter_poodll_templatekey_"+a),version:document.getElementById("id_s_filter_poodll_templateversion_"+a),instructions:document.getElementById("id_s_filter_poodll_templateinstructions_"+a),showatto:document.getElementById("id_s_filter_poodll_template_showatto_"+a),showplayers:document.getElementById("id_s_filter_poodll_template_showplayers_"+a),requirecss:document.getElementById("id_s_filter_poodll_templaterequire_css_"+a),requirejs:document.getElementById("id_s_filter_poodll_templaterequire_js_"+a),shim:document.getElementById("id_s_filter_poodll_templaterequire_js_shim_"+a),defaults:document.getElementById("id_s_filter_poodll_templatedefaults_"+a),amd:document.getElementById("id_s_filter_poodll_template_amd_"+a),body:document.getElementById("id_s_filter_poodll_template_"+a),bodyend:document.getElementById("id_s_filter_poodll_templateend_"+a),script:document.getElementById("id_s_filter_poodll_templatescript_"+a),style:document.getElementById("id_s_filter_poodll_templatestyle_"+a),dataset:document.getElementById("id_s_filter_poodll_dataset_"+a),datasetvars:document.getElementById("id_s_filter_poodll_datasetvars_"+a),alternate:document.getElementById("id_s_filter_poodll_templatealternate_"+a),alternateend:document.getElementById("id_s_filter_poodll_templatealternate_end_"+a),presetdata:document.getElementById("id_s_filter_poodll_presetdata_"+a)};return b},fetchjsonbundle:function fetchjsonbundle(b,c){var d={};a.each(this.dataitems,function(a,b){d[b]=c[b].value});var e=JSON.stringify(d);return e},exportbundle:function exportbundle(a){var b=this.fetchcontrols(a);if(""==b.key.value){return}var c=this.fetchjsonbundle(a,b),d=document.createElement("a");d.setAttribute("href","data:text/json;charset=utf-8,"+encodeURIComponent(c));d.setAttribute("download",b.key.value+".txt");if(document.createEvent){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0);d.dispatchEvent(e)}else{d.click()}},populateform:function populateform(b,c,d){var e=this.fetchcontrols(b);if(!c&&!d){return}if(!(0==c&&d)){d=this.presetdata}a.each(this.dataitems,function(a,b){if(d[c].hasOwnProperty(b)){if("cleartemplate"==d[c].key&&("key"==b||"name"==b)){var f=""}else{var f=d[c][b]}e[b].value=f}else{switch(b){case"amd":case"showplayers":case"showatto":e[b].value=0;break;default:e[b].value="";}}})},dopopulate:function dopopulate(a,b){this.populateform(a,0,Array(b))},init:function init(b){if(!this.presetdata){var c="#id_s_filter_poodll_presetdata_"+b.templateindex,d=a(c).get(0);this.presetdata=JSON.parse(d.value);a(c).remove()}var e=this;a("select[name='filter_poodll/presets']").change(function(){debugger;e.populateform(b.templateindex,a(this).val())});var f="#id_s_filter_poodll_dragdropsquare_"+b.templateindex;a(f).on("click",function(){e.exportbundle(b.templateindex)});a(f).on("dragover",function(b){b.preventDefault();b.stopPropagation();a(this).addClass("filter_poodll_dragging")});a(f).on("dragleave",function(b){b.preventDefault();b.stopPropagation();a(this).removeClass("filter_poodll_dragging")});a(f).on("drop",function(c){c.preventDefault();var d=c.originalEvent.dataTransfer.files;if(d.length){var g=d[0];if(g){var f=new FileReader;f.onload=function(a){var c=a.target.result,d=JSON.parse(c);if(d.key){e.dopopulate(b.templateindex,d)}};f.readAsText(g)}else{alert("Failed to load file")}}a(this).removeClass("filter_poodll_dragging")})}}});
+//# sourceMappingURL=template_presets_amd.min.js.map
diff --git a/amd/build/timer.min.js b/amd/build/timer.min.js
index 90661c11..ffe171b3 100644
--- a/amd/build/timer.min.js
+++ b/amd/build/timer.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("Timer: initialising"),{increment:1,initseconds:0,seconds:0,finalseconds:0,intervalhandle:null,callback:null,enabled:!1,clone:function(){return a.extend(!0,{},this)},init:function(a,b){this.initseconds=parseInt(a),this.seconds=parseInt(a),this.callback=b,this.enabled=!0},start:function(){if(this.enabled){var a=this;this.finalseconds=0,this.initseconds>0?this.increment=-1:this.increment=1,this.intervalhandle=this.customSetInterval(function(){a.seconds=a.seconds+a.increment,a.finalseconds=a.finalseconds+1,a.callback()},1e3)}},customSetInterval:function(a,b){function c(){var g=Date.now(),h=g-d;d=g,e=b+e-h,f.id=setTimeout(c,e),a()}var d=Date.now(),e=b,f={};return f.id=setTimeout(c,b),f},disable:function(){this.enabled=!1},enable:function(){this.enabled=!0},fetch_display_time:function(a){a||(a=this.seconds);var b="00"+parseInt(a/3600);b=b.substr(b.length-2,2);var c="00"+parseInt(a/60);c=c.substr(c.length-2,2);var d="00"+parseInt(a%60);d=d.substr(d.length-2,2);var e=b+":"+c+":"+d;return e},stop:function(){clearTimeout(this.intervalhandle.id)},reset:function(){this.seconds=this.initseconds},pause:function(){this.increment=0},resume:function(){this.initseconds>0?this.increment=-1:this.increment=1}}});
\ No newline at end of file
+define ("filter_poodll/timer",["jquery","core/log"],function(a,b){"use strict";b.debug("Timer: initialising");return{increment:1,initseconds:0,seconds:0,finalseconds:0,intervalhandle:null,callback:null,enabled:!1,clone:function clone(){return a.extend(!0,{},this)},init:function init(a,b){this.initseconds=parseInt(a);this.seconds=parseInt(a);this.callback=b;this.enabled=!0},start:function start(){if(!this.enabled){return}var a=this;this.finalseconds=0;if(00){var g={};return g.id=d.config.id,g.type="error",g.code=f.returnCode,g.message=f.returnMessage,void d.config.hermes.postMessage(g)}d.config.allowedURL=f.allowedURL,d.config.posturl=f.postURL,d.config.filename=f.filename,d.config.s3filename=f.s3filename,d.config.s3root=f.s3root,d.config.cloudfilename=f.shortfilename,d.config.cloudroot=f.shortroot}else b.debug("error:"+f.message)}else b.debug("Not 200 response:"+c.status)};var e="wstoken="+this.config.wstoken+"&wsfunction="+a+"&moodlewsrestformat="+this.config.moodlewsrestformat+"&mediatype="+this.config.mediatype+"&parent="+this.config.parent+"&appid="+this.config.appid+"&owner="+this.config.owner+"®ion="+this.config.region+"&expiredays="+this.config.expiredays+"&transcode="+this.config.transcode+"&transcoder="+this.config.transcoder+"&transcribe="+this.config.transcribe+"&subtitle="+this.config.subtitle+"&transcribelanguage="+this.config.language+"&transcribevocab="+this.config.transcribevocab+"¬ificationurl="+this.config.notificationurl+"&sourcemimetype="+this.config.sourcemimetype,f=M.cfg.wwwroot+"/webservice/rest/server.php";c.open("POST",f,!0),c.setRequestHeader("Cache-Control","no-cache"),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(e)},uploadBlob:function(a,b){this.uploadFile(a,b)},extractFilename:function(a){var b="success",c=a.indexOf(b);if(c<1)return!1;var d=a.indexOf(""),e=a.substring(c+b.length,d);return e},fetchFileExtension:function(a){var b="";switch(a){case"image/jpeg":b="jpg";break;case"image/png":b="png";break;case"audio/wav":b="wav";break;case"audio/ogg":b="ogg";break;case"video/quicktime":b="mov";break;case"audio/mpeg3":b="mp3";break;case"audio/mp3":b="mp3";break;case"audio/webm":b="webm";break;case"audio/x-mpeg-3":b="mp3";break;case"audio/3gpp":b="3gpp";break;case"video/mpeg3":b="3gpp";break;case"video/mp4":b="mp4";break;case"video/webm":b="webm";break;case"video/ogg":b="ogg"}return b},pokeFilename:function(c,d){var e="";return"undefined"!=typeof d.config.updatecontrol&&""!==d.config.updatecontrol&&(e=a('[id="'+d.config.updatecontrol+'"]')),e.length<1&&(e=a('[id="'+d.config.updatecontrol+'"]',window.parent.document)),e.length>0?(e.get(0).value=c,e.trigger("change"),!0):(b.debug("upload failed #2"),d.upskin.showMessage(M.util.get_string("recui_uploaderror","filter_poodll"),"recui_uploaderror"),!1)},alertRecorderSuccess:function(a){this.config.hasOwnProperty("onuploadsuccess")&&this.config.onuploadsuccess(a)},alertRecorderFailure:function(a){this.config.hasOwnProperty("onuploadfailure")&&this.config.onuploadfailure(a)},completeAfterProcessing:function(c,d,e){this.upskin.showMessage(M.util.get_string("recui_awaitingconversion","filter_poodll"),"recui_awaitingconversion"),c.config.iframeembed&&(d=c.config.s3root+c.config.s3filename);var f={};f.type="awaitingprocessing",f.mediaurl=d,f.mediafilename=c.config.s3filename,f.sourcefilename=c.config.sourcefilename,f.sourcemimetype=c.config.sourcemimetype,f.s3root=c.config.s3root,f.id=c.config.id,f.updatecontrol=c.config.updatecontrol,c.config.transcribe&&(f.transcripturl=d+".txt",f.transcriptfilename=c.config.s3filename+".txt"),c.config.hermes.postMessage(f);var g=this;a.ajax({url:c.config.s3root+c.config.s3filename,method:"HEAD",cache:!1,error:function(){b.debug("403 errors are normal here, till the file arrives back from conversion"),setTimeout(function(){g.completeAfterProcessing(c,d,e+500)},e)},success:function(a,b,f){switch(f.status){case 200:g.doUploadCompleteCallback(c,d);break;default:setTimeout(function(){g.completeAfterProcessing(c,d,e+500)},e)}}})},doUploadCompleteCallback:function(a,b){a.config.iframeembed&&(b=a.config.s3root+a.config.s3filename);var c=new Array;if(c[0]=a.config.widgetid,c[1]="filesubmitted",c[2]=b,c[3]=a.config.updatecontrol,c[4]=a.config.s3filename,this.upskin.showMessage(M.util.get_string("recui_uploadsuccess","filter_poodll"),"recui_uploadsuccess"),a.config.iframeembed){var d={};d.type="filesubmitted",d.mediaurl=a.config.s3root+a.config.s3filename,d.mediafilename=a.config.s3filename,d.sourcefilename=a.config.sourcefilename,d.sourcemimetype=a.config.sourcemimetype,d.s3root=a.config.s3root,d.id=a.config.id,d.updatecontrol=a.config.updatecontrol,a.config.transcribe&&(d.transcripturl=a.config.s3root+a.config.s3filename+".txt",d.transcriptfilename=a.config.s3filename+".txt"),a.config.hermes.postMessage(d)}else a.config.callbackjs&&""!=a.config.callbackjs?"function"==typeof a.config.callbackjs?a.config.callbackjs(c):this.executeFunctionByName(a.config.callbackjs,window,c):a.pokeFilename(b,a)},postProcessUpload:function(c,d){var e=c.currentTarget;if(4==e.readyState)if(d.upskin.deactivateProgressSession(),a(window).off("beforeunload",this.preventPrematureLeaving),200==e.status){var f=d.config.filename;if(f||(f=d.extractFilename(e.responseText)),!f)return b.debug("upload failed #1"),void b.debug(e);d.config.iframeembed?this.completeAfterProcessing(d,f,1e3):this.doUploadCompleteCallback(d,f),this.alertRecorderSuccess(d.config.widgetid)}else b.debug("upload failed #3"),b.debug(e),d.upskin.showMessage(M.util.get_string("recui_uploaderror","filter_poodll"),"recui_uploaderror"),this.alertRecorderFailure(d.config.widgetid)},preventPrematureLeaving:function(){return M.util.get_string("recui_waitwaitstilluploading","filter_poodll")},uploadFile:function(b,c){var d=new XMLHttpRequest,e=this.config,f=this,g=this.fetchFileExtension(c);"undefined"==typeof e.iframeembed&&(e.iframeembed=!1);var h=e.using_s3;if(this.upskin.initProgressSession(d),a(window).on("beforeunload",this.preventPrematureLeaving),this.upskin.showMessage(M.util.get_string("recui_uploading","filter_poodll"),"recui_uploading"),f.config.sourcemimetype=c,f.config.sourcefilename=f.config.s3filename,d.onreadystatechange=function(a){h&&4===this.readyState&&(e.iframeembed?f.update_filenames(f,g):f.postprocess_s3_upload(f)),f.postProcessUpload(a,f)},h)d.open("put",e.posturl,!0),d.setRequestHeader("Content-Type","application/octet-stream"),d.send(b);else if(b instanceof Blob){var i=new window.FileReader;i.readAsDataURL(b),i.onloadend=function(){var a=i.result,b="datatype=uploadfile";b+="¶mone="+encodeURIComponent(a),b+="¶mtwo="+g,b+="¶mthree="+e.mediatype,b+="&requestid="+e.widgetid,b+="&contextid="+e.p2,b+="&component="+e.p3,b+="&filearea="+e.p4,b+="&itemid="+e.p5,d.open("POST",e.posturl,!0),d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.setRequestHeader("Cache-Control","no-cache"),d.send(b)}}else{var j="datatype=uploadfile";j+="¶mone="+encodeURIComponent(b),j+="¶mtwo="+g,j+="¶mthree="+e.mediatype,j+="&requestid="+e.widgetid,j+="&contextid="+e.p2,j+="&component="+e.p3,j+="&filearea="+e.p4,j+="&itemid="+e.p5,d.open("POST",e.posturl,!0),d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.setRequestHeader("Cache-Control","no-cache"),d.send(j)}},update_filenames:function(a,b){var c=a.config;switch(c.mediatype){case"audio":a.config.sourcefilename=c.s3filename.replace(".mp3","."+b),c.transcode||(a.config.s3filename=a.config.sourcefilename,a.config.cloudfilename=a.config.s3filename);break;case"video":a.config.sourcefilename=c.s3filename.replace(".mp4","."+b),c.transcode||(a.config.s3filename=a.config.sourcefilename)}},postprocess_s3_upload:function(a){var b=a.config;const c=new FormData;c.append("datatype","handles3upload"),c.append("contextid",b.p2),c.append("component",b.p3),c.append("filearea",b.p4),c.append("itemid",b.p5),c.append("filename",b.filename),c.append("mediatype",b.mediatype),navigator.sendBeacon||(navigator.sendBeacon=function(a,b){window.fetch(a,{method:"POST",body:b,credentials:"include"})}),navigator.sendBeacon(M.cfg.wwwroot+"/filter/poodll/poodllfilelib.php",c)},executeFunctionByName:function(a,b,c){for(var d=a.split("."),e=d.pop(),f=0;f");if(1>b){return!1}var c=a.indexOf(""),d=a.substring(b+"success".length,c);return d},fetchFileExtension:function fetchFileExtension(a){var b="";switch(a){case"image/jpeg":b="jpg";break;case"image/png":b="png";break;case"audio/wav":b="wav";break;case"audio/ogg":b="ogg";break;case"video/quicktime":b="mov";break;case"audio/mpeg3":b="mp3";break;case"audio/mp3":b="mp3";break;case"audio/webm":b="webm";break;case"audio/x-mpeg-3":b="mp3";break;case"audio/3gpp":b="3gpp";break;case"video/mpeg3":b="3gpp";break;case"video/mp4":b="mp4";break;case"video/webm":b="webm";break;case"video/ogg":b="ogg";break;}return b},pokeFilename:function pokeFilename(c,d){var e="";if("undefined"!=typeof d.config.updatecontrol&&""!==d.config.updatecontrol){e=a("[id=\""+d.config.updatecontrol+"\"]")}if(1>e.length){e=a("[id=\""+d.config.updatecontrol+"\"]",window.parent.document)}if(0 0 indicates an error\n if (payloadobject.returnCode > 0) {\n //We alert the iframe host that something did not go right\n var messageObject = {};\n messageObject.id = that.config.id;\n messageObject.type = \"error\";\n messageObject.code = payloadobject.returnCode;\n messageObject.message = payloadobject.returnMessage;\n that.config.hermes.postMessage(messageObject);\n return;\n //if all good, then lets do the embed\n } else {\n that.config.allowedURL = payloadobject.allowedURL;\n that.config.posturl = payloadobject.postURL;\n that.config.filename = payloadobject.filename;\n that.config.s3filename = payloadobject.s3filename;\n that.config.s3root = payloadobject.s3root;\n that.config.cloudfilename = payloadobject.shortfilename;\n that.config.cloudroot = payloadobject.shortroot;\n }\n\n } else {\n log.debug('error:' + payloadobject.message);\n\n }\n } else {\n log.debug('Not 200 response:' + xhr.status);\n }\n }\n };\n\n //log.debug(params);\n var xhrparams = \"wstoken=\" + this.config.wstoken\n + \"&wsfunction=\" + functionname\n + \"&moodlewsrestformat=\" + this.config.moodlewsrestformat\n + \"&mediatype=\" + this.config.mediatype\n + '&parent=' + this.config.parent\n + '&appid=' + this.config.appid\n + '&owner=' + this.config.owner\n + '®ion=' + this.config.region\n + '&expiredays=' + this.config.expiredays\n + '&transcode=' + this.config.transcode\n + '&transcoder=' + this.config.transcoder\n + '&transcribe=' + this.config.transcribe\n + '&subtitle=' + this.config.subtitle\n + '&transcribelanguage=' + this.config.language\n + '&transcribevocab=' + this.config.transcribevocab\n + '¬ificationurl=' + this.config.notificationurl\n + '&sourcemimetype=' + this.config.sourcemimetype;\n\n var serverurl = M.cfg.wwwroot + \"/webservice/rest/server.php\";\n xhr.open(\"POST\", serverurl, true);\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.send(xhrparams);\n },\n\n uploadBlob: function (blob, filetype) {\n this.uploadFile(blob, filetype);\n return;\n },\n //extract filename from the text returned as response to upload\n extractFilename: function (returntext) {\n var searchkey = \"success\";\n var start = returntext.indexOf(searchkey);\n if (start < 1) {\n return false;\n }\n var end = returntext.indexOf(\"\");\n var filename = returntext.substring(start + (searchkey.length), end);\n return filename;\n },\n\n //fetch file extension from the filetype\n fetchFileExtension: function (filetype) {\n var ext = \"\";\n //Might need more mimetypes than this, and 3gpp maynot work\n switch (filetype) {\n case \"image/jpeg\":\n ext = \"jpg\";\n break;\n case \"image/png\":\n ext = \"png\";\n break;\n case \"audio/wav\":\n ext = \"wav\";\n break;\n case \"audio/ogg\":\n ext = \"ogg\";\n break;\n case \"video/quicktime\":\n ext = \"mov\";\n break;\n case \"audio/mpeg3\":\n ext = \"mp3\";\n break;\n case \"audio/mp3\":\n ext = \"mp3\";\n break;\n case \"audio/webm\":\n ext = \"webm\";\n break;\n case \"audio/x-mpeg-3\":\n ext = \"mp3\";\n break;\n case \"audio/3gpp\":\n ext = \"3gpp\";\n break;\n case \"video/mpeg3\":\n ext = \"3gpp\";\n break;\n case \"video/mp4\":\n ext = \"mp4\";\n break;\n case \"video/webm\":\n ext = \"webm\";\n break;\n case \"video/ogg\":\n ext = \"ogg\";\n break;\n }\n return ext;\n },\n\n pokeFilename: function (filename, uploader) {\n\n var upc = '';\n if (typeof uploader.config.updatecontrol !== 'undefined' && uploader.config.updatecontrol !== '') {\n upc = $('[id=\"' + uploader.config.updatecontrol + '\"]');\n //the code below used to work until odd chars in question id annoyed jquery 3\n //upc = $('#' + uploader.config.updatecontrol);\n }\n if (upc.length < 1) {\n upc = $('[id=\"' + uploader.config.updatecontrol + '\"]', window.parent.document);\n }\n if (upc.length > 0) {\n upc.get(0).value = filename;\n } else {\n log.debug('upload failed #2');\n uploader.upskin.showMessage(M.util.get_string('recui_uploaderror', 'filter_poodll'), 'recui_uploaderror');\n return false;\n }\n upc.trigger('change');\n return true;\n },\n\n alertRecorderSuccess: function (widgetid) {\n if (this.config.hasOwnProperty('onuploadsuccess')) {\n this.config.onuploadsuccess(widgetid);\n }\n },\n\n alertRecorderFailure: function (widgetid) {\n if (this.config.hasOwnProperty('onuploadfailure')) {\n this.config.onuploadfailure(widgetid);\n }\n },\n\n //We can detect conversion by pinging the s3 out filename\n //this is only done in the iFrame\n completeAfterProcessing: function (uploader, filename, waitms) {\n\n //alert the skin that we are awaiting processing\n this.upskin.showMessage(M.util.get_string('recui_awaitingconversion', 'filter_poodll'), 'recui_awaitingconversion');\n\n //this will always be true ...\n if (uploader.config.iframeembed) {\n filename = uploader.config.s3root + uploader.config.s3filename;\n }\n\n //We alert the iframe host that a file is now awaiting conversion\n var messageObject = {};\n messageObject.type = \"awaitingprocessing\";\n messageObject.mediaurl = filename;\n messageObject.mediafilename = uploader.config.s3filename;\n messageObject.sourcefilename = uploader.config.sourcefilename;\n messageObject.sourcemimetype = uploader.config.sourcemimetype;\n messageObject.s3root = uploader.config.s3root;\n messageObject.id = uploader.config.id;\n messageObject.updatecontrol = uploader.config.updatecontrol;\n if (uploader.config.transcribe) {\n messageObject.transcripturl = filename + '.txt';\n messageObject.transcriptfilename = uploader.config.s3filename + '.txt';\n }\n uploader.config.hermes.postMessage(messageObject);\n\n //we commence a series of ping and retries until the recorded file is available\n var that = this;\n $.ajax({\n url: uploader.config.s3root + uploader.config.s3filename,\n method: 'HEAD',\n cache: false,\n error: function () {\n //We get here if its a 404 or 403. So settimout here and wait for file to arrive\n //we increment the timeout period each time to prevent bottlenecks\n log.debug('403 errors are normal here, till the file arrives back from conversion');\n setTimeout(function () {\n that.completeAfterProcessing(uploader, filename, waitms + 500);\n }, waitms);\n },\n success: function (data, textStatus, xhr) {\n switch (xhr.status) {\n case 200:\n that.doUploadCompleteCallback(uploader, filename);\n break;\n default:\n setTimeout(function () {\n that.completeAfterProcessing(uploader, filename, waitms + 500);\n }, waitms);\n }\n\n }\n });\n },\n\n doUploadCompleteCallback: function (uploader, filename) {\n\n //in the case of an iframeembed we need a full URL not just a filename\n if (uploader.config.iframeembed) {\n filename = uploader.config.s3root + uploader.config.s3filename;\n }\n\n //For callbackjs and for postmessage we need an array of stuff\n var callbackObject = new Array();\n callbackObject[0] = uploader.config.widgetid;\n callbackObject[1] = \"filesubmitted\";\n callbackObject[2] = filename;\n callbackObject[3] = uploader.config.updatecontrol;\n callbackObject[4] = uploader.config.s3filename;\n\n //alert the skin that we were successful\n this.upskin.showMessage(M.util.get_string('recui_uploadsuccess', 'filter_poodll'), 'recui_uploadsuccess');\n\n //invoke callbackjs if we have one, otherwise just update the control(default behav.)\n if (!uploader.config.iframeembed) {\n if (uploader.config.callbackjs && uploader.config.callbackjs != '') {\n if (typeof(uploader.config.callbackjs) === 'function') {\n uploader.config.callbackjs(callbackObject);\n } else {\n //this was the old rubbish way, where the callback was a function name\n this.executeFunctionByName(uploader.config.callbackjs, window, callbackObject);\n }\n } else {\n //by default we just poke the filename\n uploader.pokeFilename(filename, uploader);\n }\n } else {\n //in the case of an iframeembed we will also post a message to the host, they can choose to handle it or not\n //The callback object above scan prob. be phased out. But not all integrations will use iframes either.\n var messageObject = {};\n messageObject.type = \"filesubmitted\";\n messageObject.mediaurl = uploader.config.s3root + uploader.config.s3filename;\n messageObject.mediafilename = uploader.config.s3filename;\n messageObject.sourcefilename = uploader.config.sourcefilename;\n messageObject.sourcemimetype = uploader.config.sourcemimetype;\n messageObject.s3root = uploader.config.s3root;\n messageObject.id = uploader.config.id;\n messageObject.updatecontrol = uploader.config.updatecontrol;\n if (uploader.config.transcribe) {\n messageObject.transcripturl = uploader.config.s3root + uploader.config.s3filename + '.txt';\n messageObject.transcriptfilename = uploader.config.s3filename + '.txt';\n }\n\n uploader.config.hermes.postMessage(messageObject);\n }\n },\n\n //after an upload handle the filename poke and callback call\n postProcessUpload: function (e, uploader) {\n var xhr = e.currentTarget;\n if (xhr.readyState == 4) {\n\n uploader.upskin.deactivateProgressSession();\n\n //deactivate premature leaving\n $(window).off('beforeunload', this.preventPrematureLeaving);\n\n if (xhr.status == 200) {\n var filename = uploader.config.filename;\n if (!filename) {\n filename = uploader.extractFilename(xhr.responseText);\n }\n if (!filename) {\n log.debug('upload failed #1');\n log.debug(xhr);\n return;\n }\n\n //Alert any listeners about the upload complete\n //in an iframeembed we only do this after conversion is complete. so we run a poll to check compl.\n //in standard Moodle we have a placeholder file to deal with any slow conversions. so we don't poll\n if (uploader.config.iframeembed) {\n this.completeAfterProcessing(uploader, filename, 1000);\n } else {\n this.doUploadCompleteCallback(uploader, filename);\n }\n\n //alert the recorder that this was successful\n this.alertRecorderSuccess(uploader.config.widgetid);\n\n } else {\n log.debug('upload failed #3');\n log.debug(xhr);\n uploader.upskin.showMessage(M.util.get_string('recui_uploaderror', 'filter_poodll'), 'recui_uploaderror');\n\n //alert the recorder that this failed\n this.alertRecorderFailure(uploader.config.widgetid);\n\n } //end of if status 200\n }//end of if ready state 4\n\n },\n\n preventPrematureLeaving: function(){\n return M.util.get_string('recui_waitwaitstilluploading', 'filter_poodll');\n },\n\n // upload Media file to wherever\n uploadFile: function (filedata, sourcemimetype) {\n\n var xhr = new XMLHttpRequest();\n var config = this.config;\n var uploader = this;\n\n //get the file extension from the filetype\n var sourceext = this.fetchFileExtension(sourcemimetype);\n\n //is this an iframe embed\n if (typeof config.iframeembed == 'undefined') {\n config.iframeembed = false;\n }\n\n //are we using s3\n var using_s3 = config.using_s3;\n\n //Handle UI display of this upload\n this.upskin.initProgressSession(xhr);\n\n //Add a page unload check ..\n $(window).on('beforeunload', this.preventPrematureLeaving);\n\n //alert user that we are now uploading\n this.upskin.showMessage(M.util.get_string('recui_uploading', 'filter_poodll'), 'recui_uploading');\n\n //init sourcemimetype and sourcefilename\n uploader.config.sourcemimetype = sourcemimetype;\n uploader.config.sourcefilename = uploader.config.s3filename;\n\n xhr.onreadystatechange = function (e) {\n if (using_s3 && this.readyState === 4) {\n if (config.iframeembed) {\n uploader.update_filenames(uploader, sourceext);\n } else {\n //ping Moodle and inform that we have a new file\n uploader.postprocess_s3_upload(uploader);\n }\n }\n uploader.postProcessUpload(e, uploader);\n\n };\n\n if (using_s3) {\n xhr.open(\"put\", config.posturl, true);\n xhr.setRequestHeader(\"Content-Type\", 'application/octet-stream');\n xhr.send(filedata);\n } else {\n\n //We NEED to redo this bit of code ..\n //its duplicating!!!\n if (!(filedata instanceof Blob)) {\n var params = \"datatype=uploadfile\";\n //We must URI encode the filedata, because otherwise the \"+\" characters get turned into spaces\n //spent hours tracking that down ...justin 20121012\n params += \"¶mone=\" + encodeURIComponent(filedata);\n params += \"¶mtwo=\" + sourceext;\n params += \"¶mthree=\" + config.mediatype;\n params += \"&requestid=\" + config.widgetid;\n params += \"&contextid=\" + config.p2;\n params += \"&component=\" + config.p3;\n params += \"&filearea=\" + config.p4;\n params += \"&itemid=\" + config.p5;\n\n xhr.open(\"POST\", config.posturl, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n //xhr.setRequestHeader(\"Content-length\", params.length);\n //xhr.setRequestHeader(\"Connection\", \"close\");\n xhr.send(params);\n } else {\n //we have to base64 string the blob before sending it\n var reader = new window.FileReader();\n reader.readAsDataURL(filedata);\n reader.onloadend = function () {\n var base64filedata = reader.result;\n //log.debug(params);\n var params = \"datatype=uploadfile\";\n //We must URI encode the filedata, because otherwise the \"+\" characters get turned into spaces\n //spent hours tracking that down ...justin 20121012\n params += \"¶mone=\" + encodeURIComponent(base64filedata);\n params += \"¶mtwo=\" + sourceext;\n params += \"¶mthree=\" + config.mediatype;\n params += \"&requestid=\" + config.widgetid;\n params += \"&contextid=\" + config.p2;\n params += \"&component=\" + config.p3;\n params += \"&filearea=\" + config.p4;\n params += \"&itemid=\" + config.p5;\n\n xhr.open(\"POST\", config.posturl, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n // xhr.setRequestHeader(\"Content-length\", params.length);\n // xhr.setRequestHeader(\"Connection\", \"close\");\n xhr.send(params);\n };//end of fileread on load end\n }//end of if blob\n }//end of if using_s3\n },\n\n update_filenames: function (uploader, sourceext) {\n var config = uploader.config;\n\n //now its a bit hacky, but\n // only now do we know the true final file extension (ext) and mimetype of unconv. media\n // so we want to save that and if the user is NOT transcoding,\n //we want to change the s3filename from the default mp4/mp3 to whatever the mimetype inidicates, ie sourceext\n\n switch (config.mediatype) {\n case 'audio':\n //source info\n uploader.config.sourcefilename = config.s3filename.replace('.mp3', '.' + sourceext);\n if (!config.transcode) {\n uploader.config.s3filename = uploader.config.sourcefilename;\n //do we need this, I think its old and noone uses it.\n uploader.config.cloudfilename = uploader.config.s3filename;\n }\n break;\n case 'video':\n uploader.config.sourcefilename = config.s3filename.replace('.mp4', '.' + sourceext);\n if (!config.transcode) {\n uploader.config.s3filename = uploader.config.sourcefilename;\n }\n break;\n }\n },\n\n postprocess_s3_upload: function (uploader) {\n var config = uploader.config;\n const formData = new FormData();\n formData.append(\"datatype\", \"handles3upload\");\n formData.append(\"contextid\", config.p2);\n formData.append(\"component\", config.p3);\n formData.append(\"filearea\", config.p4);\n formData.append(\"itemid\", config.p5);\n formData.append(\"filename\", config.filename);\n formData.append(\"mediatype\", config.mediatype);\n //navigator beacon polyfill\n if (!navigator.sendBeacon) {\n navigator.sendBeacon = function (url, thedata) {\n window.fetch(url, {method: 'POST', body: thedata, credentials: 'include'});\n };\n }\n //we use navigator beacon over xhr because there are times believe it or not, when a page load happens and that kills\n //the request. causing lost files\n navigator.sendBeacon(M.cfg.wwwroot + '/filter/poodll/poodllfilelib.php', formData);\n return;\n\n /*\n var xhr = new XMLHttpRequest();\n var that = this;\n\n //lets do a little error checking\n //if its a self signed error or rotten permissions on poodllfilelib.php we might error here.\n xhr.onreadystatechange = function(){\n if(this.readyState===4){\n if(xhr.status!=200){\n that.upskin.showMessage('Post Process s3 Upload Error:' + xhr.status, 'recui_uploaderror');\n $('#' + that.config.widgetid + '_messages').show();\n }\n }\n };\n\n //log.debug(params);\n var params = \"datatype=handles3upload\";\n params += \"&contextid=\" + config.p2;\n params += \"&component=\" + config.p3;\n params += \"&filearea=\" + config.p4;\n params += \"&itemid=\" + config.p5;\n params += \"&filename=\" + config.filename;\n params += \"&mediatype=\" + config.mediatype;\n\n xhr.open(\"POST\",M.cfg.wwwroot + '/filter/poodll/poodllfilelib.php', true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.send(params);\n */\n\n },\n\n //function to call the callback function with arguments\n executeFunctionByName: function (functionName, context, args) {\n\n //var args = Array.prototype.slice.call(arguments).splice(2);\n var namespaces = functionName.split(\".\");\n var func = namespaces.pop();\n for (var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].call(this, args);\n },\n\n dataURItoBlob: function (dataURI, mimetype) {\n var byteString = atob(dataURI.split(',')[1]);\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ab], {type: mimetype});\n },//end of dataURItoBlob\n\n //some recorder skins call this directly, so we just pass it through to the upskin\n Output: function (msg) {\n this.upskin.showMessage(msg, 'recorderskinmsg');\n }\n };//end of returned object\n});//total end\n"],"file":"uploader.min.js"}
\ No newline at end of file
+{"version":3,"sources":["../src/uploader.js"],"names":["define","$","log","upskin_plain","debug","config","clone","extend","init","element","upskin","initControls","registerEvents","that","hermes","on","fetchNewUploadDetails","xhr","XMLHttpRequest","onreadystatechange","readyState","status","payload","responseText","payloadobject","JSON","parse","returnCode","messageObject","id","type","code","message","returnMessage","postMessage","allowedURL","posturl","postURL","filename","s3filename","s3root","cloudfilename","shortfilename","cloudroot","shortroot","xhrparams","wstoken","moodlewsrestformat","mediatype","parent","appid","owner","region","expiredays","transcode","transcoder","transcribe","subtitle","language","transcribevocab","notificationurl","sourcemimetype","serverurl","M","cfg","wwwroot","open","setRequestHeader","send","uploadBlob","blob","filetype","uploadFile","extractFilename","returntext","start","indexOf","end","substring","length","fetchFileExtension","ext","pokeFilename","uploader","upc","updatecontrol","window","document","get","value","showMessage","util","get_string","trigger","alertRecorderSuccess","widgetid","hasOwnProperty","onuploadsuccess","alertRecorderFailure","onuploadfailure","completeAfterProcessing","waitms","iframeembed","mediaurl","mediafilename","sourcefilename","transcripturl","transcriptfilename","ajax","url","method","cache","error","setTimeout","success","data","textStatus","doUploadCompleteCallback","callbackObject","callbackjs","executeFunctionByName","postProcessUpload","e","currentTarget","deactivateProgressSession","off","preventPrematureLeaving","filedata","sourceext","using_s3","initProgressSession","update_filenames","postprocess_s3_upload","Blob","params","encodeURIComponent","p2","p3","p4","p5","reader","FileReader","readAsDataURL","onloadend","base64filedata","result","replace","formData","FormData","append","navigator","sendBeacon","thedata","fetch","body","credentials","functionName","context","args","namespaces","split","func","pop","i","call","dataURItoBlob","dataURI","mimetype","byteString","atob","ab","ArrayBuffer","ia","Uint8Array","charCodeAt","Output","msg"],"mappings":"AACAA,OAAM,0BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,4BAAvB,CAAD,CAAuD,SAAUC,CAAV,CAAaC,CAAb,CAAkBC,CAAlB,CAAgC,CAEzF,aAEAD,CAAG,CAACE,KAAJ,CAAU,kCAAV,EAEA,MAAO,CAEHC,MAAM,CAAE,IAFL,CAKHC,KAAK,CAAE,gBAAY,CACf,MAAOL,CAAAA,CAAC,CAACM,MAAF,IAAe,EAAf,CAAmB,IAAnB,CACV,CAPE,CASHC,IAAI,CAAE,cAAUC,CAAV,CAAmBJ,CAAnB,CAA2BK,CAA3B,CAAmC,CACrC,KAAKL,MAAL,CAAcA,CAAd,CACA,GAAIK,CAAJ,CAAY,CACR,KAAKA,MAAL,CAAcA,CACjB,CAFD,IAEO,CACH,KAAKA,MAAL,CAAcP,CAAY,CAACG,KAAb,EAAd,CACA,KAAKI,MAAL,CAAYF,IAAZ,CAAiBH,CAAjB,CAAyBI,CAAzB,OACH,CACD,KAAKC,MAAL,CAAYC,YAAZ,GACA,KAAKC,cAAL,EACH,CAnBE,CAqBHA,cAAc,CAAE,yBAAY,CACxB,GAAIC,CAAAA,CAAI,CAAG,IAAX,CAED,GAAG,KAAKR,MAAL,CAAYS,MAAf,CAAuB,CAClB,KAAKT,MAAL,CAAYS,MAAZ,CAAmBC,EAAnB,CAAsB,kBAAtB,CAA0C,UAAa,CACnDF,CAAI,CAACG,qBAAL,EACH,CAFD,CAGJ,CACH,CA7BE,CA+BHA,qBAAqB,CAAE,gCAAY,IAO3BC,CAAAA,CAAG,CAAG,GAAIC,CAAAA,cAPiB,CAQ3BL,CAAI,CAAG,IARoB,CAW/BI,CAAG,CAACE,kBAAJ,CAAyB,UAAa,CAClC,GAAwB,CAApB,QAAKC,UAAT,CAA2B,CACvB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AAC,EAAxC,CAA4C,CACxCS,CAAE,CAACT,CAAD,CAAF,CAAQK,CAAU,CAACM,UAAX,CAAsBX,CAAtB,CACX,CACD,MAAO,IAAI9B,CAAAA,IAAJ,CAAS,CAACqC,CAAD,CAAT,CAAe,CAAC5I,IAAI,CAAEyI,CAAP,CAAf,CACV,CAzjBE,CA4jBHQ,MAAM,CAAE,gBAAUC,CAAV,CAAe,CACnB,KAAKtK,MAAL,CAAYgF,WAAZ,CAAwBsF,CAAxB,CAA6B,iBAA7B,CACH,CA9jBE,CAgkBV,CAtkBK,CAAN","sourcesContent":["/* jshint ignore:start */\ndefine(['jquery', 'core/log', 'filter_poodll/upskin_plain'], function ($, log, upskin_plain) {\n\n \"use strict\"; // jshint ;_;\n\n log.debug('Universal Uploader: initialising');\n\n return {\n\n config: null,\n\n //for making multiple instances\n clone: function () {\n return $.extend(true, {}, this);\n },\n\n init: function (element, config, upskin) {\n this.config = config;\n if (upskin) {\n this.upskin = upskin;\n } else {\n this.upskin = upskin_plain.clone();\n this.upskin.init(config, element, false, false);\n }\n this.upskin.initControls();\n this.registerEvents();\n },\n\n registerEvents: function () {\n var that = this;\n //whteboard does not have a hermes\n if(this.config.hermes) {\n this.config.hermes.on('fetch_upload_url', function (e) {\n that.fetchNewUploadDetails();\n });\n }\n },\n\n fetchNewUploadDetails: function () {\n\n //The REST API we are calling\n var functionname = 'local_cpapi_fetch_upload_details';\n\n //fetch the Posturl. We need this.\n //set up our ajax request\n var xhr = new XMLHttpRequest();\n var that = this;\n\n //set up our handler for the response\n xhr.onreadystatechange = function (e) {\n if (this.readyState === 4) {\n if (xhr.status == 200) {\n\n //get a yes or forgetit or tryagain\n var payload = xhr.responseText;\n var payloadobject = JSON.parse(payload);\n if (payloadobject) {\n\n //returnCode > 0 indicates an error\n if (payloadobject.returnCode > 0) {\n //We alert the iframe host that something did not go right\n var messageObject = {};\n messageObject.id = that.config.id;\n messageObject.type = \"error\";\n messageObject.code = payloadobject.returnCode;\n messageObject.message = payloadobject.returnMessage;\n that.config.hermes.postMessage(messageObject);\n return;\n //if all good, then lets do the embed\n } else {\n that.config.allowedURL = payloadobject.allowedURL;\n that.config.posturl = payloadobject.postURL;\n that.config.filename = payloadobject.filename;\n that.config.s3filename = payloadobject.s3filename;\n that.config.s3root = payloadobject.s3root;\n that.config.cloudfilename = payloadobject.shortfilename;\n that.config.cloudroot = payloadobject.shortroot;\n }\n\n } else {\n log.debug('error:' + payloadobject.message);\n\n }\n } else {\n log.debug('Not 200 response:' + xhr.status);\n }\n }\n };\n\n //log.debug(params);\n var xhrparams = \"wstoken=\" + this.config.wstoken\n + \"&wsfunction=\" + functionname\n + \"&moodlewsrestformat=\" + this.config.moodlewsrestformat\n + \"&mediatype=\" + this.config.mediatype\n + '&parent=' + this.config.parent\n + '&appid=' + this.config.appid\n + '&owner=' + this.config.owner\n + '®ion=' + this.config.region\n + '&expiredays=' + this.config.expiredays\n + '&transcode=' + this.config.transcode\n + '&transcoder=' + this.config.transcoder\n + '&transcribe=' + this.config.transcribe\n + '&subtitle=' + this.config.subtitle\n + '&transcribelanguage=' + this.config.language\n + '&transcribevocab=' + this.config.transcribevocab\n + '¬ificationurl=' + this.config.notificationurl\n + '&sourcemimetype=' + this.config.sourcemimetype;\n\n var serverurl = M.cfg.wwwroot + \"/webservice/rest/server.php\";\n xhr.open(\"POST\", serverurl, true);\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.send(xhrparams);\n },\n\n uploadBlob: function (blob, filetype) {\n this.uploadFile(blob, filetype);\n return;\n },\n //extract filename from the text returned as response to upload\n extractFilename: function (returntext) {\n var searchkey = \"success\";\n var start = returntext.indexOf(searchkey);\n if (start < 1) {\n return false;\n }\n var end = returntext.indexOf(\"\");\n var filename = returntext.substring(start + (searchkey.length), end);\n return filename;\n },\n\n //fetch file extension from the filetype\n fetchFileExtension: function (filetype) {\n var ext = \"\";\n //Might need more mimetypes than this, and 3gpp maynot work\n switch (filetype) {\n case \"image/jpeg\":\n ext = \"jpg\";\n break;\n case \"image/png\":\n ext = \"png\";\n break;\n case \"audio/wav\":\n ext = \"wav\";\n break;\n case \"audio/ogg\":\n ext = \"ogg\";\n break;\n case \"video/quicktime\":\n ext = \"mov\";\n break;\n case \"audio/mpeg3\":\n ext = \"mp3\";\n break;\n case \"audio/mp3\":\n ext = \"mp3\";\n break;\n case \"audio/webm\":\n ext = \"webm\";\n break;\n case \"audio/x-mpeg-3\":\n ext = \"mp3\";\n break;\n case \"audio/3gpp\":\n ext = \"3gpp\";\n break;\n case \"video/mpeg3\":\n ext = \"3gpp\";\n break;\n case \"video/mp4\":\n ext = \"mp4\";\n break;\n case \"video/webm\":\n ext = \"webm\";\n break;\n case \"video/ogg\":\n ext = \"ogg\";\n break;\n }\n return ext;\n },\n\n pokeFilename: function (filename, uploader) {\n\n var upc = '';\n if (typeof uploader.config.updatecontrol !== 'undefined' && uploader.config.updatecontrol !== '') {\n upc = $('[id=\"' + uploader.config.updatecontrol + '\"]');\n //the code below used to work until odd chars in question id annoyed jquery 3\n //upc = $('#' + uploader.config.updatecontrol);\n }\n if (upc.length < 1) {\n upc = $('[id=\"' + uploader.config.updatecontrol + '\"]', window.parent.document);\n }\n if (upc.length > 0) {\n upc.get(0).value = filename;\n } else {\n log.debug('upload failed #2');\n uploader.upskin.showMessage(M.util.get_string('recui_uploaderror', 'filter_poodll'), 'recui_uploaderror');\n return false;\n }\n upc.trigger('change');\n return true;\n },\n\n alertRecorderSuccess: function (widgetid) {\n if (this.config.hasOwnProperty('onuploadsuccess')) {\n this.config.onuploadsuccess(widgetid);\n }\n },\n\n alertRecorderFailure: function (widgetid) {\n if (this.config.hasOwnProperty('onuploadfailure')) {\n this.config.onuploadfailure(widgetid);\n }\n },\n\n //We can detect conversion by pinging the s3 out filename\n //this is only done in the iFrame\n completeAfterProcessing: function (uploader, filename, waitms) {\n\n //alert the skin that we are awaiting processing\n this.upskin.showMessage(M.util.get_string('recui_awaitingconversion', 'filter_poodll'), 'recui_awaitingconversion');\n\n //this will always be true ...\n if (uploader.config.iframeembed) {\n filename = uploader.config.s3root + uploader.config.s3filename;\n }\n\n //We alert the iframe host that a file is now awaiting conversion\n var messageObject = {};\n messageObject.type = \"awaitingprocessing\";\n messageObject.mediaurl = filename;\n messageObject.mediafilename = uploader.config.s3filename;\n messageObject.sourcefilename = uploader.config.sourcefilename;\n messageObject.sourcemimetype = uploader.config.sourcemimetype;\n messageObject.s3root = uploader.config.s3root;\n messageObject.id = uploader.config.id;\n messageObject.updatecontrol = uploader.config.updatecontrol;\n if (uploader.config.transcribe) {\n messageObject.transcripturl = filename + '.txt';\n messageObject.transcriptfilename = uploader.config.s3filename + '.txt';\n }\n uploader.config.hermes.postMessage(messageObject);\n\n //we commence a series of ping and retries until the recorded file is available\n var that = this;\n $.ajax({\n url: uploader.config.s3root + uploader.config.s3filename,\n method: 'HEAD',\n cache: false,\n error: function () {\n //We get here if its a 404 or 403. So settimout here and wait for file to arrive\n //we increment the timeout period each time to prevent bottlenecks\n log.debug('403 errors are normal here, till the file arrives back from conversion');\n setTimeout(function () {\n that.completeAfterProcessing(uploader, filename, waitms + 500);\n }, waitms);\n },\n success: function (data, textStatus, xhr) {\n switch (xhr.status) {\n case 200:\n that.doUploadCompleteCallback(uploader, filename);\n break;\n default:\n setTimeout(function () {\n that.completeAfterProcessing(uploader, filename, waitms + 500);\n }, waitms);\n }\n\n }\n });\n },\n\n doUploadCompleteCallback: function (uploader, filename) {\n\n //in the case of an iframeembed we need a full URL not just a filename\n if (uploader.config.iframeembed) {\n filename = uploader.config.s3root + uploader.config.s3filename;\n }\n\n //For callbackjs and for postmessage we need an array of stuff\n var callbackObject = new Array();\n callbackObject[0] = uploader.config.widgetid;\n callbackObject[1] = \"filesubmitted\";\n callbackObject[2] = filename;\n callbackObject[3] = uploader.config.updatecontrol;\n callbackObject[4] = uploader.config.s3filename;\n\n //alert the skin that we were successful\n this.upskin.showMessage(M.util.get_string('recui_uploadsuccess', 'filter_poodll'), 'recui_uploadsuccess');\n\n //invoke callbackjs if we have one, otherwise just update the control(default behav.)\n if (!uploader.config.iframeembed) {\n if (uploader.config.callbackjs && uploader.config.callbackjs != '') {\n if (typeof(uploader.config.callbackjs) === 'function') {\n uploader.config.callbackjs(callbackObject);\n } else {\n //this was the old rubbish way, where the callback was a function name\n this.executeFunctionByName(uploader.config.callbackjs, window, callbackObject);\n }\n } else {\n //by default we just poke the filename\n uploader.pokeFilename(filename, uploader);\n }\n } else {\n //in the case of an iframeembed we will also post a message to the host, they can choose to handle it or not\n //The callback object above scan prob. be phased out. But not all integrations will use iframes either.\n var messageObject = {};\n messageObject.type = \"filesubmitted\";\n messageObject.mediaurl = uploader.config.s3root + uploader.config.s3filename;\n messageObject.mediafilename = uploader.config.s3filename;\n messageObject.sourcefilename = uploader.config.sourcefilename;\n messageObject.sourcemimetype = uploader.config.sourcemimetype;\n messageObject.s3root = uploader.config.s3root;\n messageObject.id = uploader.config.id;\n messageObject.updatecontrol = uploader.config.updatecontrol;\n if (uploader.config.transcribe) {\n messageObject.transcripturl = uploader.config.s3root + uploader.config.s3filename + '.txt';\n messageObject.transcriptfilename = uploader.config.s3filename + '.txt';\n }\n\n uploader.config.hermes.postMessage(messageObject);\n }\n },\n\n //after an upload handle the filename poke and callback call\n postProcessUpload: function (e, uploader) {\n var xhr = e.currentTarget;\n if (xhr.readyState == 4) {\n\n uploader.upskin.deactivateProgressSession();\n\n //deactivate premature leaving\n $(window).off('beforeunload', this.preventPrematureLeaving);\n\n if (xhr.status == 200) {\n var filename = uploader.config.filename;\n if (!filename) {\n filename = uploader.extractFilename(xhr.responseText);\n }\n if (!filename) {\n log.debug('upload failed #1');\n log.debug(xhr);\n return;\n }\n\n //Alert any listeners about the upload complete\n //in an iframeembed we only do this after conversion is complete. so we run a poll to check compl.\n //in standard Moodle we have a placeholder file to deal with any slow conversions. so we don't poll\n if (uploader.config.iframeembed) {\n this.completeAfterProcessing(uploader, filename, 1000);\n } else {\n this.doUploadCompleteCallback(uploader, filename);\n }\n\n //alert the recorder that this was successful\n this.alertRecorderSuccess(uploader.config.widgetid);\n\n } else {\n log.debug('upload failed #3');\n log.debug(xhr);\n uploader.upskin.showMessage(M.util.get_string('recui_uploaderror', 'filter_poodll'), 'recui_uploaderror');\n\n //alert the recorder that this failed\n this.alertRecorderFailure(uploader.config.widgetid);\n\n } //end of if status 200\n }//end of if ready state 4\n\n },\n\n preventPrematureLeaving: function(){\n return M.util.get_string('recui_waitwaitstilluploading', 'filter_poodll');\n },\n\n // upload Media file to wherever\n uploadFile: function (filedata, sourcemimetype) {\n\n var xhr = new XMLHttpRequest();\n var config = this.config;\n var uploader = this;\n\n //get the file extension from the filetype\n var sourceext = this.fetchFileExtension(sourcemimetype);\n\n //is this an iframe embed\n if (typeof config.iframeembed == 'undefined') {\n config.iframeembed = false;\n }\n\n //are we using s3\n var using_s3 = config.using_s3;\n\n //Handle UI display of this upload\n this.upskin.initProgressSession(xhr);\n\n //Add a page unload check ..\n $(window).on('beforeunload', this.preventPrematureLeaving);\n\n //alert user that we are now uploading\n this.upskin.showMessage(M.util.get_string('recui_uploading', 'filter_poodll'), 'recui_uploading');\n\n //init sourcemimetype and sourcefilename\n uploader.config.sourcemimetype = sourcemimetype;\n uploader.config.sourcefilename = uploader.config.s3filename;\n\n xhr.onreadystatechange = function (e) {\n if (using_s3 && this.readyState === 4) {\n if (config.iframeembed) {\n uploader.update_filenames(uploader, sourceext);\n } else {\n //ping Moodle and inform that we have a new file\n uploader.postprocess_s3_upload(uploader);\n }\n }\n uploader.postProcessUpload(e, uploader);\n\n };\n\n if (using_s3) {\n xhr.open(\"put\", config.posturl, true);\n xhr.setRequestHeader(\"Content-Type\", 'application/octet-stream');\n xhr.send(filedata);\n } else {\n\n //We NEED to redo this bit of code ..\n //its duplicating!!!\n if (!(filedata instanceof Blob)) {\n var params = \"datatype=uploadfile\";\n //We must URI encode the filedata, because otherwise the \"+\" characters get turned into spaces\n //spent hours tracking that down ...justin 20121012\n params += \"¶mone=\" + encodeURIComponent(filedata);\n params += \"¶mtwo=\" + sourceext;\n params += \"¶mthree=\" + config.mediatype;\n params += \"&requestid=\" + config.widgetid;\n params += \"&contextid=\" + config.p2;\n params += \"&component=\" + config.p3;\n params += \"&filearea=\" + config.p4;\n params += \"&itemid=\" + config.p5;\n\n xhr.open(\"POST\", config.posturl, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n //xhr.setRequestHeader(\"Content-length\", params.length);\n //xhr.setRequestHeader(\"Connection\", \"close\");\n xhr.send(params);\n } else {\n //we have to base64 string the blob before sending it\n var reader = new window.FileReader();\n reader.readAsDataURL(filedata);\n reader.onloadend = function () {\n var base64filedata = reader.result;\n //log.debug(params);\n var params = \"datatype=uploadfile\";\n //We must URI encode the filedata, because otherwise the \"+\" characters get turned into spaces\n //spent hours tracking that down ...justin 20121012\n params += \"¶mone=\" + encodeURIComponent(base64filedata);\n params += \"¶mtwo=\" + sourceext;\n params += \"¶mthree=\" + config.mediatype;\n params += \"&requestid=\" + config.widgetid;\n params += \"&contextid=\" + config.p2;\n params += \"&component=\" + config.p3;\n params += \"&filearea=\" + config.p4;\n params += \"&itemid=\" + config.p5;\n\n xhr.open(\"POST\", config.posturl, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n // xhr.setRequestHeader(\"Content-length\", params.length);\n // xhr.setRequestHeader(\"Connection\", \"close\");\n xhr.send(params);\n };//end of fileread on load end\n }//end of if blob\n }//end of if using_s3\n },\n\n update_filenames: function (uploader, sourceext) {\n var config = uploader.config;\n\n //now its a bit hacky, but\n // only now do we know the true final file extension (ext) and mimetype of unconv. media\n // so we want to save that and if the user is NOT transcoding,\n //we want to change the s3filename from the default mp4/mp3 to whatever the mimetype inidicates, ie sourceext\n\n switch (config.mediatype) {\n case 'audio':\n //source info\n uploader.config.sourcefilename = config.s3filename.replace('.mp3', '.' + sourceext);\n if (!config.transcode) {\n uploader.config.s3filename = uploader.config.sourcefilename;\n //do we need this, I think its old and noone uses it.\n uploader.config.cloudfilename = uploader.config.s3filename;\n }\n break;\n case 'video':\n uploader.config.sourcefilename = config.s3filename.replace('.mp4', '.' + sourceext);\n if (!config.transcode) {\n uploader.config.s3filename = uploader.config.sourcefilename;\n }\n break;\n }\n },\n\n postprocess_s3_upload: function (uploader) {\n var config = uploader.config;\n const formData = new FormData();\n formData.append(\"datatype\", \"handles3upload\");\n formData.append(\"contextid\", config.p2);\n formData.append(\"component\", config.p3);\n formData.append(\"filearea\", config.p4);\n formData.append(\"itemid\", config.p5);\n formData.append(\"filename\", config.filename);\n formData.append(\"mediatype\", config.mediatype);\n //navigator beacon polyfill\n if (!navigator.sendBeacon) {\n navigator.sendBeacon = function (url, thedata) {\n window.fetch(url, {method: 'POST', body: thedata, credentials: 'include'});\n };\n }\n //we use navigator beacon over xhr because there are times believe it or not, when a page load happens and that kills\n //the request. causing lost files\n navigator.sendBeacon(M.cfg.wwwroot + '/filter/poodll/poodllfilelib.php', formData);\n return;\n\n /*\n var xhr = new XMLHttpRequest();\n var that = this;\n\n //lets do a little error checking\n //if its a self signed error or rotten permissions on poodllfilelib.php we might error here.\n xhr.onreadystatechange = function(){\n if(this.readyState===4){\n if(xhr.status!=200){\n that.upskin.showMessage('Post Process s3 Upload Error:' + xhr.status, 'recui_uploaderror');\n $('#' + that.config.widgetid + '_messages').show();\n }\n }\n };\n\n //log.debug(params);\n var params = \"datatype=handles3upload\";\n params += \"&contextid=\" + config.p2;\n params += \"&component=\" + config.p3;\n params += \"&filearea=\" + config.p4;\n params += \"&itemid=\" + config.p5;\n params += \"&filename=\" + config.filename;\n params += \"&mediatype=\" + config.mediatype;\n\n xhr.open(\"POST\",M.cfg.wwwroot + '/filter/poodll/poodllfilelib.php', true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.send(params);\n */\n\n },\n\n //function to call the callback function with arguments\n executeFunctionByName: function (functionName, context, args) {\n\n //var args = Array.prototype.slice.call(arguments).splice(2);\n var namespaces = functionName.split(\".\");\n var func = namespaces.pop();\n for (var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].call(this, args);\n },\n\n dataURItoBlob: function (dataURI, mimetype) {\n var byteString = atob(dataURI.split(',')[1]);\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ab], {type: mimetype});\n },//end of dataURItoBlob\n\n //some recorder skins call this directly, so we just pass it through to the upskin\n Output: function (msg) {\n this.upskin.showMessage(msg, 'recorderskinmsg');\n }\n };//end of returned object\n});//total end\n"],"file":"uploader.min.js"}
\ No newline at end of file
diff --git a/amd/build/upskin_bar.min.js b/amd/build/upskin_bar.min.js
index e59827ff..9a3e7059 100644
--- a/amd/build/upskin_bar.min.js
+++ b/amd/build/upskin_bar.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log","filter_poodll/anim_progress_bar"],function(a,b,c){"use strict";return b.debug("upskin_bar: initialising"),{element:null,cvs:null,percent:0,progressbar:null,messagearea:null,clone:function(){return a.extend(!0,{},this)},init:function(a,b,d,e){this.config=a,this.element=b,this.cvs=d,this.progressbar=c.clone(),this.messagearea=e},initControls:function(){var a=this;this.progressbar.init(this.cvs,"#BCCCCC"),this.progressbar.fetchCurrent=function(){return a.percent}},initProgressSession:function(a){var b=this;b.percent=0;var c=M.util.get_string("recui_uploading","filter_poodll");a.upload.addEventListener("progress",function(a){a.lengthComputable&&(b.percent=a.loaded/a.total,b.showMessage(c+"("+Math.floor(100*b.percent)+"%)"))}),this.progressbar.start()},deactivateProgressSession:function(){this.progressbar.stopthere(),b.debug("deactivating session")},showMessage:function(a,b){this.messagearea.html(a)}}});
\ No newline at end of file
+define ("filter_poodll/upskin_bar",["jquery","core/log","filter_poodll/anim_progress_bar"],function(a,b,c){"use strict";b.debug("upskin_bar: initialising");return{element:null,cvs:null,percent:0,progressbar:null,messagearea:null,clone:function clone(){return a.extend(!0,{},this)},init:function init(a,b,d,e){this.config=a;this.element=b;this.cvs=d;this.progressbar=c.clone();this.messagearea=e},initControls:function initControls(){var a=this;this.progressbar.init(this.cvs,"#BCCCCC");this.progressbar.fetchCurrent=function(){return a.percent}},initProgressSession:function initProgressSession(a){var b=this;b.percent=0;var c=M.util.get_string("recui_uploading","filter_poodll");a.upload.addEventListener("progress",function(a){if(a.lengthComputable){b.percent=a.loaded/a.total;b.showMessage(c+"("+Math.floor(100*b.percent)+"%)")}});this.progressbar.start()},deactivateProgressSession:function deactivateProgressSession(){this.progressbar.stopthere();b.debug("deactivating session")},showMessage:function showMessage(a){this.messagearea.html(a)}}});
+//# sourceMappingURL=upskin_bar.min.js.map
diff --git a/amd/build/upskin_plain.min.js b/amd/build/upskin_plain.min.js
index 5b140dac..198e01ba 100644
--- a/amd/build/upskin_plain.min.js
+++ b/amd/build/upskin_plain.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("upskin_plain: initialising"),{element:null,cvs:null,cvsctx:null,clone:function(){return a.extend(!0,{},this)},init:function(a,b,c,d){this.config=a,this.element=b,this.cvs=c,this.messagearea=d},initControls:function(){var b=this.config.media_skin_style,c='
';c+='',a(this.element).append(c)},initProgressSession:function(b){var c=!1,d=a("#"+this.config.widgetid+"_progress");if(d.length){var e=d.get(0);c=e.firstChild,null===c&&(c=e.appendChild(document.createElement("p"))),c.className="",c.style.display="block",c.style.backgroundPosition="100% 0",b.upload.addEventListener("progress",function(a){var b=parseInt(100-a.loaded/a.total*100);c.style.backgroundPosition=b+"% 0"})}},deactivateProgressSession:function(){},showMessage:function(b,c){var d=a("#"+this.config.widgetid+"_messages");d.text(b)}}});
\ No newline at end of file
+define ("filter_poodll/upskin_plain",["jquery","core/log"],function(a,b){"use strict";b.debug("upskin_plain: initialising");return{element:null,cvs:null,cvsctx:null,clone:function clone(){return a.extend(!0,{},this)},init:function init(a,b,c,d){this.config=a;this.element=b;this.cvs=c;this.messagearea=d},initControls:function initControls(){var b=this.config.media_skin_style,c="
";c+="";a(this.element).append(c)},initProgressSession:function initProgressSession(b){var c=!1,d=a("#"+this.config.widgetid+"_progress");if(d.length){var e=d.get(0);c=e.firstChild;if(null===c){c=e.appendChild(document.createElement("p"))}c.className="";c.style.display="block";c.style.backgroundPosition="100% 0";b.upload.addEventListener("progress",function(a){var b=parseInt(100-100*(a.loaded/a.total));c.style.backgroundPosition=b+"% 0"})}},deactivateProgressSession:function deactivateProgressSession(){},showMessage:function showMessage(b){var c=a("#"+this.config.widgetid+"_messages");c.text(b)}}});
+//# sourceMappingURL=upskin_plain.min.js.map
diff --git a/amd/build/upskin_radial.min.js b/amd/build/upskin_radial.min.js
index bc0b8f61..5a212cae 100644
--- a/amd/build/upskin_radial.min.js
+++ b/amd/build/upskin_radial.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log","filter_poodll/anim_progress_radial"],function(a,b,c){"use strict";return b.debug("upskin_bar: initialising"),{element:null,cvs:null,percent:0,progressradial:null,messagearea:null,clone:function(){return a.extend(!0,{},this)},init:function(a,b,d,e){this.config=a,this.element=b,this.cvs=d,this.progressradial=c.clone(),this.messagearea=e},setDrawParam:function(a,b){this.progressradial.setDrawParam(a,b)},initControls:function(){var a=this,b=!0;this.progressradial.init(this.cvs,"#93c47d",b),this.progressradial.fetchCurrent=function(){return a.percent}},initProgressSession:function(a){var b=this;b.percent=0;var c=M.util.get_string("recui_uploading","filter_poodll");a.upload.addEventListener("progress",function(a){a.lengthComputable&&(b.percent=a.loaded/a.total,b.showMessage(c+"("+Math.floor(100*b.percent)+"%)"))}),this.progressradial.start()},deactivateProgressSession:function(){this.progressradial.stop(),b.debug("deactivating session")},showMessage:function(a,b){switch(b){case"recui_awaitingconversion":break;default:this.messagearea.html(a)}}}});
\ No newline at end of file
+define ("filter_poodll/upskin_radial",["jquery","core/log","filter_poodll/anim_progress_radial"],function(a,b,c){"use strict";b.debug("upskin_bar: initialising");return{element:null,cvs:null,percent:0,progressradial:null,messagearea:null,clone:function clone(){return a.extend(!0,{},this)},init:function init(a,b,d,e){this.config=a;this.element=b;this.cvs=d;this.progressradial=c.clone();this.messagearea=e},setDrawParam:function setDrawParam(a,b){this.progressradial.setDrawParam(a,b)},initControls:function initControls(){var a=this;this.progressradial.init(this.cvs,"#93c47d",!0);this.progressradial.fetchCurrent=function(){return a.percent}},initProgressSession:function initProgressSession(a){var b=this;b.percent=0;var c=M.util.get_string("recui_uploading","filter_poodll");a.upload.addEventListener("progress",function(a){if(a.lengthComputable){b.percent=a.loaded/a.total;b.showMessage(c+"("+Math.floor(100*b.percent)+"%)")}});this.progressradial.start()},deactivateProgressSession:function deactivateProgressSession(){this.progressradial.stop();b.debug("deactivating session")},showMessage:function showMessage(a,b){switch(b){case"recui_awaitingconversion":break;default:this.messagearea.html(a);}}}});
+//# sourceMappingURL=upskin_radial.min.js.map
diff --git a/amd/build/upskin_text.min.js b/amd/build/upskin_text.min.js
index f09e30f4..1aceb6bf 100644
--- a/amd/build/upskin_text.min.js
+++ b/amd/build/upskin_text.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("upskin_text: initialising"),{element:null,cvs:null,cvsctx:null,clone:function(){return a.extend(!0,{},this)},init:function(a,b,c,d){this.config=a,this.element=b,this.cvs=c,this.messagearea=d},initControls:function(){},initProgressSession:function(a){var b=this;b.percent=0;var c=M.util.get_string("recui_uploading","filter_poodll");a.upload.addEventListener("progress",function(a){a.lengthComputable&&(b.percent=a.loaded/a.total,b.showMessage(c+"("+Math.floor(100*b.percent)+"%)"))})},deactivateProgressSession:function(){b.debug("deactivating session")},showMessage:function(a,b){this.messagearea.html(a)}}});
\ No newline at end of file
+define ("filter_poodll/upskin_text",["jquery","core/log"],function(a,b){"use strict";b.debug("upskin_text: initialising");return{element:null,cvs:null,cvsctx:null,clone:function clone(){return a.extend(!0,{},this)},init:function init(a,b,c,d){this.config=a;this.element=b;this.cvs=c;this.messagearea=d},initControls:function initControls(){},initProgressSession:function initProgressSession(a){var b=this;b.percent=0;var c=M.util.get_string("recui_uploading","filter_poodll");a.upload.addEventListener("progress",function(a){if(a.lengthComputable){b.percent=a.loaded/a.total;b.showMessage(c+"("+Math.floor(100*b.percent)+"%)")}})},deactivateProgressSession:function deactivateProgressSession(){b.debug("deactivating session")},showMessage:function showMessage(a){this.messagearea.html(a)}}});
+//# sourceMappingURL=upskin_text.min.js.map
diff --git a/amd/build/util_dragdrop.min.js b/amd/build/util_dragdrop.min.js
index fe3132e0..729aecf9 100644
--- a/amd/build/util_dragdrop.min.js
+++ b/amd/build/util_dragdrop.min.js
@@ -1 +1,2 @@
-define(["jquery","jqueryui","core/log"],function(a,b,c){"use strict";return c.debug("Poodll util drag drop: initialising"),{theelement:!1,uploadfunction:!1,uploader:!1,started:!1,filebutton:!1,init:function(a,b,d){this.theelement=a,this.uploadfunction=b,this.uploader=d.uploader,this.filebutton=d.controlbar.filebutton,this.supports_dragdrop(a)?(c.debug("registering drag drop"),this.register_dragdrop(),this.do_visuals()):c.debug("drag drop not supported")},clone:function(){return a.extend(!0,{},this)},supports_dragdrop:function(a){return"draggable"in a||"ondragstart"in a&&"ondrop"in a},do_visuals:function(){this.theelement.addClass("poodll-can-do-drag-drop")},turnoff_dragdrop:function(){this.theelement&&(this.theelement.removeClass("poodll-can-do-drag-drop"),this.theelement.removeClass("is-poodll-drag-over"),this.theelement.off("drag dragstart dragend dragover dragenter dragleave drop"),this.theelement.on("drag dragstart dragend dragover dragenter dragleave drop",function(a){a.preventDefault(),a.stopPropagation()}))},register_dragdrop:function(){var a=this;this.theelement.on("drag dragstart dragend dragover dragenter dragleave drop",function(b){b.preventDefault(),b.stopPropagation(),a.started}).on("dragover dragenter",function(){a.theelement.addClass("is-poodll-drag-over")}).on("dragleave dragend drop",function(){a.theelement.removeClass("is-poodll-drag-over")}).on("drop",function(b){if(!a.started){var c=b.originalEvent.dataTransfer.files;a.uploadfunction(c,a.uploader),a.turnoff_dragdrop(),a.filebutton.off("change"),a.filebutton.attr("disabled",!0),a.started=!0}})}}});
\ No newline at end of file
+define ("filter_poodll/util_dragdrop",["jquery","jqueryui","core/log"],function(a,b,c){"use strict";c.debug("Poodll util drag drop: initialising");return{theelement:!1,uploadfunction:!1,uploader:!1,started:!1,filebutton:!1,init:function init(a,b,d){this.theelement=a;this.uploadfunction=b;this.uploader=d.uploader;this.filebutton=d.controlbar.filebutton;if(this.supports_dragdrop(a)){c.debug("registering drag drop");this.register_dragdrop();this.do_visuals()}else{c.debug("drag drop not supported")}},clone:function clone(){return a.extend(!0,{},this)},supports_dragdrop:function supports_dragdrop(a){return"draggable"in a||"ondragstart"in a&&"ondrop"in a},do_visuals:function do_visuals(){this.theelement.addClass("poodll-can-do-drag-drop")},turnoff_dragdrop:function turnoff_dragdrop(){if(!this.theelement){return}this.theelement.removeClass("poodll-can-do-drag-drop");this.theelement.removeClass("is-poodll-drag-over");this.theelement.off("drag dragstart dragend dragover dragenter dragleave drop");this.theelement.on("drag dragstart dragend dragover dragenter dragleave drop",function(a){a.preventDefault();a.stopPropagation()})},register_dragdrop:function register_dragdrop(){var a=this;this.theelement.on("drag dragstart dragend dragover dragenter dragleave drop",function(b){b.preventDefault();b.stopPropagation();if(a.started){}}).on("dragover dragenter",function(){a.theelement.addClass("is-poodll-drag-over")}).on("dragleave dragend drop",function(){a.theelement.removeClass("is-poodll-drag-over")}).on("drop",function(b){if(a.started){return}var c=b.originalEvent.dataTransfer.files;a.uploadfunction(c,a.uploader);a.turnoff_dragdrop();a.filebutton.off("change");a.filebutton.attr("disabled",!0);a.started=!0})}}});
+//# sourceMappingURL=util_dragdrop.min.js.map
diff --git a/amd/build/utils_amd.min.js b/amd/build/utils_amd.min.js
index a8cd1905..bc24a01d 100644
--- a/amd/build/utils_amd.min.js
+++ b/amd/build/utils_amd.min.js
@@ -1 +1,2 @@
-define(["jquery","core/log"],function(a,b){"use strict";return b.debug("Filter PoodLL: utils initialising"),{timeouthandles:[],WhiteboardUploadHandler:function(b,c,d,e){var f=a("#"+b+"_btn_upload_whiteboard")[0];f.disabled=!0,clearTimeout(this.timeouthandles[b]);var g=this.getCvs(b,c,d);this.pokeVectorData(b,c,d),e.uploadFile(g.toDataURL(),"image")},getCvs:function(a,b){if(0==a.indexOf("drawingboard_"))var c=b.canvas;else var c=b.canvasForExport();return c},escapeColon:function(a){return a.replace(/:/,"\\:")},pokeVectorData:function(c,d,e){var f="";f=0==c.indexOf("drawingboard_")?JSON.stringify(d.history,null,2):JSON.stringify(d.getSnapshot()),"undefined"!=typeof e.vectorcontrol&&""!==e.vectorcontrol&&(a("#"+this.escapeColon(e.vectorcontrol)).val(f),b.debug("Vectorcontrol:"+e.vectorcontrol))},_concatenateWavBlobs:function(a,b){for(var c=[],d=0,e=0,f=a.length,g=0;g-1},is_chrome:function(){var a=window.chrome,b=window.navigator,c=b.vendor,d=b.userAgent.indexOf("OPR")>-1,e=b.userAgent.indexOf("Edge")>-1,f=b.userAgent.match("CriOS");return!!f||null!==a&&"undefined"!=typeof a&&"Google Inc."===c&&d===!1&&e===!1},is_safari:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},is_ios:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},is_opera:function(){return"undefined"!=typeof opera&&navigator.userAgent&&navigator.userAgent.indexOf("OPR/")!==-1},is_android:function(){var a=window.navigator.userAgent,b=a.indexOf("android")>-1||a.indexOf("Android")>-1;return b},is_ie:function(){var a=!1,b=window.navigator.userAgent,c=b.indexOf("MSIE "),d=b.indexOf("Trident/"),e=b.indexOf("Edge/");return(c>-1||d>-1||e>-1)&&(a=!0),a},parseQueryString:function(a){var b={};return a.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(a,c,d,e){b[c]=e}),b}}});
\ No newline at end of file
+define ("filter_poodll/utils_amd",["jquery","core/log"],function(a,b){"use strict";b.debug("Filter PoodLL: utils initialising");return{timeouthandles:[],WhiteboardUploadHandler:function WhiteboardUploadHandler(b,c,d,e){var f=a("#"+b+"_btn_upload_whiteboard")[0];f.disabled=!0;clearTimeout(this.timeouthandles[b]);var g=this.getCvs(b,c,d);this.pokeVectorData(b,c,d);e.uploadFile(g.toDataURL(),"image")},getCvs:function getCvs(a,b){if(0==a.indexOf("drawingboard_")){var c=b.canvas}else{var c=b.canvasForExport()}return c},escapeColon:function escapeColon(a){return a.replace(/:/,"\\:")},pokeVectorData:function pokeVectorData(c,d,e){var f="";if(0==c.indexOf("drawingboard_")){f=JSON.stringify(d.history,null,2)}else{f=JSON.stringify(d.getSnapshot())}if("undefined"!=typeof e.vectorcontrol&&""!==e.vectorcontrol){a("#"+this.escapeColon(e.vectorcontrol)).val(f);b.debug("Vectorcontrol:"+e.vectorcontrol)}},_concatenateWavBlobs:function _concatenateWavBlobs(a,b){for(var c=[],d=0,e=0,f=a.length,g=0;g-1&&this.hooks[a].splice(c,1)}else this.hooks[a]=[]},dispatch:function(){var d=arguments[0].replace(/^on/i,"").toLowerCase(),e=Array.prototype.slice.call(arguments,1);if(this.hooks[d]&&this.hooks[d].length){for(var f=0,g=this.hooks[d].length;fERROR: the Webcam.js Flash fallback does not work from local disk. Please run it from a web server.';if(!this.detectFlash())return this.dispatch("error",new b("Adobe Flash Player not found. Please install from get.adobe.com/flashplayer and try again.")),'
'+this.params.flashNotDetectedText+"
";if(!d){for(var e="",f=document.getElementsByTagName("script"),g=0,h=f.length;g'},getMovie:function(){if(!this.loaded)return this.dispatch("error",new b("Flash Movie is not loaded yet"));var a=document.getElementById("webcam_movie_obj");return a&&a._snap||(a=document.getElementById("webcam_movie_embed")),a||this.dispatch("error",new b("Cannot locate Flash movie in DOM")),a},freeze:function(){var a=this,b=this.params;this.preview_active&&this.unfreeze();var c=this.params.width/this.params.dest_width,d=this.params.height/this.params.dest_height;this.unflip();var e=b.crop_width||b.dest_width,f=b.crop_height||b.dest_height,g=document.createElement("canvas");g.width=e,g.height=f;var h=g.getContext("2d");this.preview_canvas=g,this.preview_context=h,1==c&&1==d||(g.style.webkitTransformOrigin="0px 0px",g.style.mozTransformOrigin="0px 0px",g.style.msTransformOrigin="0px 0px",g.style.oTransformOrigin="0px 0px",g.style.transformOrigin="0px 0px",g.style.webkitTransform="scaleX("+c+") scaleY("+d+")",g.style.mozTransform="scaleX("+c+") scaleY("+d+")",g.style.msTransform="scaleX("+c+") scaleY("+d+")",g.style.oTransform="scaleX("+c+") scaleY("+d+")",g.style.transform="scaleX("+c+") scaleY("+d+")"),this.snap(function(){g.style.position="relative",g.style.left=""+a.container.scrollLeft+"px",g.style.top=""+a.container.scrollTop+"px",a.container.insertBefore(g,a.peg),a.container.style.overflow="hidden",a.preview_active=!0},g)},unfreeze:function(){this.preview_active&&(this.container.removeChild(this.preview_canvas),delete this.preview_context,delete this.preview_canvas,this.preview_active=!1,this.flip())},flip:function(){if(this.params.flip_horiz){var a=this.container.style;a.webkitTransform="scaleX(-1)",a.mozTransform="scaleX(-1)",a.msTransform="scaleX(-1)",a.oTransform="scaleX(-1)",a.transform="scaleX(-1)",a.filter="FlipH",a.msFilter="FlipH"}},unflip:function(){if(this.params.flip_horiz){var a=this.container.style;a.webkitTransform="scaleX(1)",a.mozTransform="scaleX(1)",a.msTransform="scaleX(1)",a.oTransform="scaleX(1)",a.transform="scaleX(1)",a.filter="",a.msFilter=""}},savePreview:function(a,b){var c=this.params,d=this.preview_canvas,e=this.preview_context;if(b){var f=b.getContext("2d");f.drawImage(d,0,0)}a(b?null:d.toDataURL("image/"+c.image_format,c.jpeg_quality/100),d,e),this.params.unfreeze_snap&&this.unfreeze()},snap:function(a,b){var d=this.params;if(!this.loaded)return this.dispatch("error",new c("Webcam is not loaded yet"));if(!a)return this.dispatch("error",new c("Please provide a callback function or canvas to snap()"));if(this.preview_active)return this.savePreview(a,b),null;var e=document.createElement("canvas");e.width=this.params.dest_width,e.height=this.params.dest_height;var f=e.getContext("2d");this.params.flip_horiz&&(f.translate(d.dest_width,0),f.scale(-1,1));var g=function(){if(this.src&&this.width&&this.height&&f.drawImage(this,0,0,d.dest_width,d.dest_height),d.crop_width&&d.crop_height){var c=document.createElement("canvas");c.width=d.crop_width,c.height=d.crop_height;var g=c.getContext("2d");g.drawImage(e,Math.floor(d.dest_width/2-d.crop_width/2),Math.floor(d.dest_height/2-d.crop_height/2),d.crop_width,d.crop_height,0,0,d.crop_width,d.crop_height),f=g,e=c}if(b){var h=b.getContext("2d");h.drawImage(e,0,0)}a(b?null:e.toDataURL("image/"+d.image_format,d.jpeg_quality/100),e,f)};if(this.userMedia)f.drawImage(this.video,0,0,this.params.dest_width,this.params.dest_height),g();else{var h=this.getMovie()._snap(),i=new Image;i.onload=g,i.src="data:image/"+this.params.image_format+";base64,"+h}return null},configure:function(a){a||(a="camera"),this.getMovie()._configure(a)},flashNotify:function(a,c){switch(a){case"flashLoadComplete":this.loaded=!0,this.dispatch("load");break;case"cameraLive":this.live=!0,this.dispatch("live");break;case"error":this.dispatch("error",new b(c))}},b64ToUint6:function(a){return a>64&&a<91?a-65:a>96&&a<123?a-71:a>47&&a<58?a+4:43===a?62:47===a?63:0},base64DecToArr:function(a,b){for(var c,d,e=a.replace(/[^A-Za-z0-9\+\/]/g,""),f=e.length,g=b?Math.ceil((3*f+1>>2)/b)*b:3*f+1>>2,h=new Uint8Array(g),i=0,j=0,k=0;k>>(16>>>c&24)&255;i=0}return h},upload:function(a,b,c){var d=this.params.upload_name||"webcam",f="";if(!a.match(/^data\:image\/(\w+)/))throw"Cannot locate image format in Data URI";f=RegExp.$1;var g=a.replace(/^data\:image\/\w+\;base64\,/,""),h=new XMLHttpRequest;h.open("POST",b,!0),h.upload&&h.upload.addEventListener&&h.upload.addEventListener("progress",function(a){if(a.lengthComputable){var b=a.loaded/a.total;e.dispatch("uploadProgress",b,a)}},!1);var i=this;h.onload=function(){c&&c.apply(i,[h.status,h.responseText,h.statusText]),e.dispatch("uploadComplete",h.status,h.responseText,h.statusText)};var j=new Blob([this.base64DecToArr(g)],{type:"image/"+f}),k=new FormData;k.append(d,j,d+"."+f.replace(/e/,"")),h.send(k)}};e.init(),"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:a.Webcam=e}(window);
\ No newline at end of file
+function _typeof(a){if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(b){var e;function c(){var a=Error.apply(this,arguments);a.name=this.name="FlashError";this.stack=a.stack;this.message=a.message}function d(){var a=Error.apply(this,arguments);a.name=this.name="WebcamError";this.stack=a.stack;this.message=a.message}IntermediateInheritor=function IntermediateInheritor(){};IntermediateInheritor.prototype=Error.prototype;c.prototype=new IntermediateInheritor;d.prototype=new IntermediateInheritor;var f={version:"1.0.15",protocol:location.protocol.match(/https/i)?"https":"http",loaded:!1,live:!1,userMedia:!0,params:{width:0,height:0,dest_width:0,dest_height:0,image_format:"jpeg",jpeg_quality:90,enable_flash:!0,force_flash:!1,flip_horiz:!1,fps:30,upload_name:"webcam",constraints:null,swfURL:"",flashNotDetectedText:"ERROR: No Adobe Flash Player detected. Webcam.js relies on Flash for browsers that do not support getUserMedia (like yours).",noInterfaceFoundText:"No supported webcam interface found.",unfreeze_snap:!0},errors:{FlashError:c,WebcamError:d},hooks:{},init:function init(){var a=this;this.mediaDevices=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices:navigator.mozGetUserMedia||navigator.webkitGetUserMedia?{getUserMedia:function getUserMedia(b){return new Promise(function(c,d){(navigator.mozGetUserMedia||navigator.webkitGetUserMedia).call(navigator,b,c,d)})}}:null;b.URL=b.URL||b.webkitURL||b.mozURL||b.msURL;this.userMedia=this.userMedia&&!!this.mediaDevices&&!!b.URL;if(navigator.userAgent.match(/Firefox\D+(\d+)/)){if(21>parseInt(RegExp.$1,10))this.userMedia=null}if(this.userMedia){b.addEventListener("beforeunload",function(){a.reset()})}},attach:function attach(g){if("string"==typeof g){g=document.getElementById(g)||document.querySelector(g)}if(!g){return this.dispatch("error",new d("Could not locate DOM element to attach to."))}this.container=g;g.innerHTML="";var j=document.createElement("div");g.appendChild(j);this.peg=j;if(!this.params.width)this.params.width=g.offsetWidth;if(!this.params.height)this.params.height=g.offsetHeight;if(!this.params.width||!this.params.height){return this.dispatch("error",new d("No width and/or height for webcam. Please call set() first, or attach to a visible element."))}if(!this.params.dest_width)this.params.dest_width=this.params.width;if(!this.params.dest_height)this.params.dest_height=this.params.height;this.userMedia=e===void 0?this.userMedia:e;if(this.params.force_flash){e=this.userMedia;this.userMedia=null}if("number"!=typeof this.params.fps)this.params.fps=30;var i=this.params.width/this.params.dest_width,k=this.params.height/this.params.dest_height;if(this.userMedia){var o=document.createElement("video");o.setAttribute("autoplay","autoplay");o.style.width=""+this.params.dest_width+"px";o.style.height=""+this.params.dest_height+"px";if(1!=i||1!=k){g.style.overflow="hidden";o.style.webkitTransformOrigin="0px 0px";o.style.mozTransformOrigin="0px 0px";o.style.msTransformOrigin="0px 0px";o.style.oTransformOrigin="0px 0px";o.style.transformOrigin="0px 0px";o.style.webkitTransform="scaleX("+i+") scaleY("+k+")";o.style.mozTransform="scaleX("+i+") scaleY("+k+")";o.style.msTransform="scaleX("+i+") scaleY("+k+")";o.style.oTransform="scaleX("+i+") scaleY("+k+")";o.style.transform="scaleX("+i+") scaleY("+k+")"}g.appendChild(o);this.video=o;var n=this;this.mediaDevices.getUserMedia({audio:!1,video:this.params.constraints||{mandatory:{minWidth:this.params.dest_width,minHeight:this.params.dest_height}}}).then(function(a){o.onloadedmetadata=function(){n.stream=a;n.loaded=!0;n.live=!0;n.dispatch("load");n.dispatch("live");n.flip()};o.srcObject=a||a}).catch(function(a){if(n.params.enable_flash&&n.detectFlash()){setTimeout(function(){n.params.force_flash=1;n.attach(g)},1)}else{n.dispatch("error",a)}})}else if(this.params.enable_flash&&this.detectFlash()){b.Webcam=f;var h=document.createElement("div");h.innerHTML=this.getSWFHTML();g.appendChild(h)}else{this.dispatch("error",new d(this.params.noInterfaceFoundText))}if(this.params.crop_width&&this.params.crop_height){var l=Math.floor(this.params.crop_width*i),c=Math.floor(this.params.crop_height*k);g.style.width=""+l+"px";g.style.height=""+c+"px";g.style.overflow="hidden";g.scrollLeft=Math.floor(this.params.width/2-l/2);g.scrollTop=Math.floor(this.params.height/2-c/2)}else{g.style.width=""+this.params.width+"px";g.style.height=""+this.params.height+"px"}},reset:function reset(){if(this.preview_active)this.unfreeze();this.unflip();if(this.userMedia){if(this.stream){if(this.stream.getVideoTracks){var a=this.stream.getVideoTracks();if(a&&a[0]&&a[0].stop)a[0].stop()}else if(this.stream.stop){this.stream.stop()}}delete this.stream;delete this.video}if(!0!==this.userMedia){this.getMovie()._releaseCamera()}if(this.container){this.container.innerHTML="";delete this.container}this.loaded=!1;this.live=!1},set:function set(){if(1==arguments.length){for(var a in arguments[0]){this.params[a]=arguments[0][a]}}else{this.params[arguments[0]]=arguments[1]}},on:function on(a,b){a=a.replace(/^on/i,"").toLowerCase();if(!this.hooks[a])this.hooks[a]=[];this.hooks[a].push(b)},off:function off(b,c){b=b.replace(/^on/i,"").toLowerCase();if(this.hooks[b]){if(c){var d=this.hooks[b].indexOf(c);if(-1ERROR: the Webcam.js Flash fallback does not work from local disk. Please run it from a web server."}if(!this.detectFlash()){this.dispatch("error",new c("Adobe Flash Player not found. Please install from get.adobe.com/flashplayer and try again."));return"
"+this.params.flashNotDetectedText+"
"}if(!d){for(var e="",f=document.getElementsByTagName("script"),g=0,j=f.length,k;g";return a},getMovie:function getMovie(){if(!this.loaded)return this.dispatch("error",new c("Flash Movie is not loaded yet"));var a=document.getElementById("webcam_movie_obj");if(!a||!a._snap)a=document.getElementById("webcam_movie_embed");if(!a)this.dispatch("error",new c("Cannot locate Flash movie in DOM"));return a},freeze:function freeze(){var b=this,c=this.params;if(this.preview_active)this.unfreeze();var d=this.params.width/this.params.dest_width,a=this.params.height/this.params.dest_height;this.unflip();var e=c.crop_width||c.dest_width,f=c.crop_height||c.dest_height,g=document.createElement("canvas");g.width=e;g.height=f;var h=g.getContext("2d");this.preview_canvas=g;this.preview_context=h;if(1!=d||1!=a){g.style.webkitTransformOrigin="0px 0px";g.style.mozTransformOrigin="0px 0px";g.style.msTransformOrigin="0px 0px";g.style.oTransformOrigin="0px 0px";g.style.transformOrigin="0px 0px";g.style.webkitTransform="scaleX("+d+") scaleY("+a+")";g.style.mozTransform="scaleX("+d+") scaleY("+a+")";g.style.msTransform="scaleX("+d+") scaleY("+a+")";g.style.oTransform="scaleX("+d+") scaleY("+a+")";g.style.transform="scaleX("+d+") scaleY("+a+")"}this.snap(function(){g.style.position="relative";g.style.left=""+b.container.scrollLeft+"px";g.style.top=""+b.container.scrollTop+"px";b.container.insertBefore(g,b.peg);b.container.style.overflow="hidden";b.preview_active=!0},g)},unfreeze:function unfreeze(){if(this.preview_active){this.container.removeChild(this.preview_canvas);delete this.preview_context;delete this.preview_canvas;this.preview_active=!1;this.flip()}},flip:function flip(){if(this.params.flip_horiz){var a=this.container.style;a.webkitTransform="scaleX(-1)";a.mozTransform="scaleX(-1)";a.msTransform="scaleX(-1)";a.oTransform="scaleX(-1)";a.transform="scaleX(-1)";a.filter="FlipH";a.msFilter="FlipH"}},unflip:function unflip(){if(this.params.flip_horiz){var a=this.container.style;a.webkitTransform="scaleX(1)";a.mozTransform="scaleX(1)";a.msTransform="scaleX(1)";a.oTransform="scaleX(1)";a.transform="scaleX(1)";a.filter="";a.msFilter=""}},savePreview:function savePreview(b,c){var d=this.params,a=this.preview_canvas,e=this.preview_context;if(c){var f=c.getContext("2d");f.drawImage(a,0,0)}b(c?null:a.toDataURL("image/"+d.image_format,d.jpeg_quality/100),a,e);if(this.params.unfreeze_snap)this.unfreeze()},snap:function snap(b,c){var e=this,f=this.params;if(!this.loaded)return this.dispatch("error",new d("Webcam is not loaded yet"));if(!b)return this.dispatch("error",new d("Please provide a callback function or canvas to snap()"));if(this.preview_active){this.savePreview(b,c);return null}var g=document.createElement("canvas");g.width=this.params.dest_width;g.height=this.params.dest_height;var i=g.getContext("2d");if(this.params.flip_horiz){i.translate(f.dest_width,0);i.scale(-1,1)}var a=function(){if(this.src&&this.width&&this.height){i.drawImage(this,0,0,f.dest_width,f.dest_height)}if(f.crop_width&&f.crop_height){var d=document.createElement("canvas");d.width=f.crop_width;d.height=f.crop_height;var a=d.getContext("2d");a.drawImage(g,Math.floor(f.dest_width/2-f.crop_width/2),Math.floor(f.dest_height/2-f.crop_height/2),f.crop_width,f.crop_height,0,0,f.crop_width,f.crop_height);i=a;g=d}if(c){var e=c.getContext("2d");e.drawImage(g,0,0)}b(c?null:g.toDataURL("image/"+f.image_format,f.jpeg_quality/100),g,i)};if(this.userMedia){i.drawImage(this.video,0,0,this.params.dest_width,this.params.dest_height);a()}else{var j=this.getMovie()._snap(),h=new Image;h.onload=a;h.src="data:image/"+this.params.image_format+";base64,"+j}return null},configure:function configure(a){if(!a)a="camera";this.getMovie()._configure(a)},flashNotify:function flashNotify(a,b){switch(a){case"flashLoadComplete":this.loaded=!0;this.dispatch("load");break;case"cameraLive":this.live=!0;this.dispatch("live");break;case"error":this.dispatch("error",new c(b));break;default:break;}},b64ToUint6:function b64ToUint6(a){return 64a?a-65:96a?a-71:47a?a+4:43===a?62:47===a?63:0},base64DecToArr:function base64DecToArr(b,d){for(var e=b.replace(/[^A-Za-z0-9\+\/]/g,""),a=e.length,f=d?Math.ceil((3*a+1>>2)/d)*d:3*a+1>>2,g=new Uint8Array(f),i,j,k=0,m=0,p=0;pi&&m>>(24&16>>>i)}k=0}}return g},upload:function upload(b,c,d){var a=this.params.upload_name||"webcam",e="";if(b.match(/^data\:image\/(\w+)/))e=RegExp.$1;else throw"Cannot locate image format in Data URI";var g=b.replace(/^data\:image\/\w+\;base64\,/,""),j=new XMLHttpRequest;j.open("POST",c,!0);if(j.upload&&j.upload.addEventListener){j.upload.addEventListener("progress",function(a){if(a.lengthComputable){var b=a.loaded/a.total;f.dispatch("uploadProgress",b,a)}},!1)}var k=this;j.onload=function(){if(d)d.apply(k,[j.status,j.responseText,j.statusText]);f.dispatch("uploadComplete",j.status,j.responseText,j.statusText)};var m=new Blob([this.base64DecToArr(g)],{type:"image/"+e}),h=new FormData;h.append(a,m,a+"."+e.replace(/e/,""));j.send(h)}};f.init();if("function"==typeof define&&define.amd){define ("filter_poodll/webcam",function(){return f})}else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){module.exports=f}else{b.Webcam=f}})(window);
+//# sourceMappingURL=webcam.min.js.map