Free javascript Hosting


recite-me.js

Uploaded on Sep 30 2021 23:26 by joel.jezc

var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(k,f,b){k instanceof String&&(k=String(k));for(var e=k.length,a=0;a<e;a++){var g=k[a];if(f.call(b,g,a,k))return{i:a,v:g}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,f,b){k!=Array.prototype&&k!=Object.prototype&&(k[f]=b.value)};$jscomp.getGlobal=function(k){k=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,k];for(var f=0;f<k.length;++f){var b=k[f];if(b&&b.Math==Math)return b}return globalThis};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(k,f,b,e){if(f){b=$jscomp.global;k=k.split(".");for(e=0;e<k.length-1;e++){var a=k[e];a in b||(b[a]={});b=b[a]}k=k[k.length-1];e=b[k];f=f(e);f!=e&&null!=f&&$jscomp.defineProperty(b,k,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Array.prototype.find",function(k){return k?k:function(f,b){return $jscomp.findInternal(this,f,b).v}},"es6","es3");$jscomp.polyfill("Object.is",function(k){return k?k:function(f,b){return f===b?0!==f||1/f===1/b:f!==f&&b!==b}},"es6","es3");
$jscomp.polyfill("Array.prototype.includes",function(k){return k?k:function(f,b){var e=this;e instanceof String&&(e=String(e));var a=e.length;b=b||0;for(0>b&&(b=Math.max(b+a,0));b<a;b++){var g=e[b];if(g===f||Object.is(g,f))return!0}return!1}},"es7","es3");
$jscomp.checkStringArgs=function(k,f,b){if(null==k)throw new TypeError("The 'this' value for String.prototype."+b+" must not be null or undefined");if(f instanceof RegExp)throw new TypeError("First argument to String.prototype."+b+" must not be a regular expression");return k+""};$jscomp.polyfill("String.prototype.includes",function(k){return k?k:function(f,b){return-1!==$jscomp.checkStringArgs(this,f,"includes").indexOf(f,b||0)}},"es6","es3");if("undefined"===typeof Recite||!Recite)var Recite={};
Recite=function(){function k(a){var b={persist:!0,autoEnable:!1,observeDom:!0,selectionMethod:"tooltip",rootNode:document.body,css:Recite.baseUrl+"/assets/"+Recite.version+"/css/recite.css",enableButton:".recite-enable",enableFragment:"#recite-enable",enableButtonToggle:!1,buttonDeactivateContent:"Deactivate Recite",buttonDeactivateContentElement:".recite-enable",parser:Recite.Parser.Html,autoCache:!0,defaultLanguage:null,showBrand:!0,shadowDomSupport:!1,classname:null,button:null,wrapTag:null,mode:null};
a=a||{};a=Recite.Util.merge(b,a);f(a);return a}function f(a,b){"undefined"===typeof b&&(b=Recite);Recite.Util.each(a,function(a,c){a=b[a];"undefined"!==typeof a&&(a.setOptions?a.setOptions(c):f(c,a))})}function b(b){a=k(Recite.Util.merge(a,b));try{a=k(Recite.Util.merge(a,JSON.parse("{\"Docreader\":{\"urlMatches\":[\"downloads-view-reciteme\"]},\"WordByWord\":{\"enabled\":true}}".replace("{dot}","."))))}catch(n){Recite.Debug.log("API Options are not loaded correctly")}Recite.Debug.log("Recite","(Version "+Recite.version+") Load called with options:",b);b=Recite.Sizzle(a.enableButton);
Recite.Event.publish("Recite:load");var d=Recite.Storage.Cookie.load("Recite.Persist");null!==a.enableFragment&&window.location.hash===a.enableFragment&&Recite.enable();(a.autoEnable&&!1!==d||a.persist&&!0===d)&&Recite.enable();null!==a.enableButton&&Recite.DomEvent.add(b,"click",function(){a.enableButtonToggle?e?Recite.disable():Recite.enable():Recite.enable()});Recite.Event.subscribe("Recite:ModuleEvent",function(a,b){Recite.Tracker.track(b.name,b.event)})}var e=!1,a={};return{namespace:function(){var a=
arguments,b=null,e,c;for(e=0;e<a.length;e+=1){var h=(""+a[e]).split(".");b=Recite;for(c="Recite"===h[0]?1:0;c<h.length;c+=1)b[h[c]]=b[h[c]]||{},b=b[h[c]]}return b},load:function(a){"complete"===document.readyState||"interactive"===document.readyState?b(a):Recite.DomEvent.add(window,"load",function(){b(a)})},enable:function(){if(e)return Recite.Debug.log("Recite","Already enabled, not re-enabling."),null;a.persist&&Recite.Storage.Cookie.save("Recite.Persist",!0,365);if(a.enableButtonToggle){var b=
Recite.Sizzle(a.buttonDeactivateContentElement);Recite.Util.each(b,function(b,e){e.innerHTML=a.buttonDeactivateContent})}Recite.AssetLoader.css(a.css,function(){Recite.Debug.log("Recite","Recite CSS loaded");Recite.Controls.load(document)});Recite.Event.subscribe("Controls:loaded",function(){Recite.Preferences.load();Recite.Controls.Desktop.applyTabOrder();Recite.Util.each(Recite.Sizzle(".recite-version"),function(a,b){b.innerHTML="Ver: "+Recite.version})});Recite.Event.subscribe("Recite.Parser:parsed",
function(){a.observeDom&&Recite.Dom.Observer.observe(document.getElementById("recite-wrapper"))});Recite.Event.subscribe("Preferences:load",function(){null!==a.defaultLanguage&&null===Recite.Preferences.get("language")&&Recite.Preferences.set("language",a.defaultLanguage)});"tooltip"===a.selectionMethod?window.setTimeout(function(){if(null!==a.rootNode){var b=a.parser.parse(a.rootNode);Recite.PlayerControls.invoke(b)}},0):"highlight"===a.selectionMethod&&(a.observeDom=!1,Recite.Selection.setOptions({playOnSelection:!0}));
Recite.FrameUpdater.enabled()&&Recite.FrameUpdater.load();Recite.Docreader.enabled()&&Recite.Docreader.load();Recite.Language.Translate.init();Recite.Event.publish("Recite:enable");Recite.Debug.log("Recite","Recite enabled (Version:"+Recite.version+")");Recite.Tracker.track("enable");e=!0;Recite.Storage.Cookie.save("Recite.Persist",!0,365)},disable:function(a){var b=Recite.Controls.disableOverlay();"undefined"!=typeof a?(Recite.Event.publish("Recite:disable"),Recite.Storage.Cookie.save("Recite.Persist",
!1,365),window.location.reload()):Recite.Gui.Modal.show(Recite.Message.getMessage("toolbarCloseHeader","About to close!"),Recite.Message.getMessage("toolbarCloseDialog","You are about to close the Recite Me toolbar. Are you sure you wish to continue? This will cause the page to be refreshed and you will lose any unsaved data."),Recite.Message.getMessage("toolbarCloseOk","OK"),Recite.Message.getMessage("toolbarCloseCancel","Cancel"),function(){Recite.Event.publish("Recite:disable");Recite.Storage.Cookie.save("Recite.Persist",
!1,365);window.location.reload()},function(){Recite.Gui.Notification.show("Close operation canceled");Recite.Controls.reEnableOverlay(b)})},isEnabled:function(){return e},getOptions:function(b){if("undefined"===typeof b)return a;var d;b=b.split(".");var e=a;for(d=0;d<b.length;d++)if(e=e[b[d]],"undefined"===typeof e)return null;return e},version:"3.2.59",baseUrl:"https://api.reciteme.com"}}();null!==null&&null();Recite.namespace("Recite.Util");
Recite.Util=function(){var k={},f=[],b=Object.prototype.toString,e=null;f["[object Boolean]"]="boolean";f["[object Number]"]="number";f["[object String]"]="string";f["[object Function]"]="function";f["[object Array]"]="array";f["[object Date]"]="date";f["[object RegExp]"]="regexp";f["[object Object]"]="object";String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},String.prototype.ltrim=function(){return this.replace(/^\s+/,"")},String.prototype.rtrim=
function(){return this.replace(/\s+$/,"")},String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ")});return{isFunction:function(a){return"function"===Recite.Util.type(a)},isArray:Array.isArray||function(a){return"array"===Recite.Util.type(a)},isWindow:function(a){return a&&"object"===typeof a&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):f[b.call(a)]||"object"},clone:function(a){return ReciteJSON.parse(ReciteJSON.stringify(a))},
guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)})},each:function(a,b,d){var e,c=0,h=a.length,g=void 0===h;if(d)if(g)for(e in a){if(!1===b.apply(a[e],d))break}else for(;c<h&&!1!==b.apply(a[c++],d););else if(g)for(e in a){if(!1===b.call(a[e],e,a[e]))break}else for(;c<h&&!1!==b.call(a[c],c,a[c++]););return a},merge:function(a,b){for(var d in b)try{a[d]=b[d].constructor===Object?Recite.Util.merge(a[d],
b[d]):b[d]}catch(n){a[d]=b[d]}return a},inArray:function(a,b,d){if(b){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(b,a,d);var e=b.length;for(d=d?0>d?Math.max(0,e+d):d:0;d<e;d++)if(d in b&&b[d]===a)return d}return-1},getWindowLocationOrigin:function(a){return a.location.origin||a.location.protocol+"//"+a.location.host},buildQueryString:function(a){var b="";Recite.Util.each(a,function(a,e){b+="&"+a+"="+encodeURIComponent(e)});return b="?"+b.substring(1)},unSetIFramePointerEvents:function(){if(null==
e){var a=Recite.Sizzle("iframe");e=[];Recite.Util.each(a,function(a,b){e.push({frame:b,state:void 0==b.style.pointerEvents?"all":b.style.pointerEvents})})}Recite.Util.each(e,function(a,b){b.frame.style.pointerEvents="none"})},reSetIFramePointerEvents:function(){null!==e&&Recite.Util.each(e,function(a,b){b.frame.style.pointerEvents=b.state})},setOptions:function(b){k=Recite.Util.merge(k,b)}}}();Recite.namespace("Event");
Recite.Event=function(){var k={},f=-1;return{publish:function(b,e){if(!k[b])return!1;setTimeout(function(){for(var a=k[b],g=a?a.length:0;g--;)a[g].func(b,e)},0);return!0},subscribe:function(b,e){k[b]||(k[b]=[]);var a=(++f).toString();k[b].push({token:a,func:e});return a},unsubscribe:function(b){for(var e in k)if(k[e])for(var a=0,g=k[e].length;a<g;a++)if(k[e][a].token===b)return k[e].splice(a,1),b;return!1}}}();Recite.namespace("Debug");
Recite.Debug=function(){var k={log:!1};return{setOptions:function(f){k=Recite.Util.merge(k,f)},enable:function(){k.log=!0},log:function(f){null===f&&(f="Recite.Debug");arguments[0]="["+f+"]";k.log&&window.console&&Function.apply.call(console.log,console,arguments)}}}();Recite.namespace("Recite.DomEvent");
Recite.DomEvent=function(){return{add:function(k,f,b){k=Recite.Util.isArray(k)?k:[k];Recite.Util.each(k,function(e,a){a.addEventListener?a.addEventListener(f,b,!1):a.attachEvent&&(a["e"+f+b]=b,a[f+b]=function(){var e=window.event;e.target=e.target||e.srcElement;a["e"+f+b](e)},a.attachEvent("on"+f,a[f+b]))})},remove:function(k,f,b){k=Recite.Util.isArray(k)?k:[k];Recite.Util.each(k,function(e,a){a.removeEventListener?a.removeEventListener(f,b,!1):a.detachEvent&&"undefined"!==typeof a[f+b]&&(a.detachEvent("on"+
f,a[f+b]),a[f+b]=null,a["e"+f+b]=null)})}}}();Recite.namespace("XDM");
Recite.XDM=function(){var k,f,b=1,e;return{postMessage:function(a,e,d){e&&(d=d||parent,window.postMessage?d.postMessage(a,e.replace(/([^:]+:\/\/[^\/]+).*/,"$1")):e&&(d.location=e.replace(/#.*$/,"")+"#"+ +new Date+b++ +"&"+a))},receiveMessage:function(b,g){window.postMessage?(b&&(e=function(a){if("string"===typeof g&&a.origin!==g||"[object Function]"===Object.prototype.toString.call(g)&&!1===g(a.origin))return!1;b(a)}),Recite.DomEvent.add(window,"message",e)):(k&&clearInterval(k),k=null,b&&(k=setInterval(function(){var a=
document.location.hash,e=/^#?\d+&/;a!==f&&e.test(a)&&(f=a,b({data:a.replace(e,"")}))},100)))}}}();
(function(){function k(b,a,c,d,h,r){h=0;for(var v=d.length;h<v;h++){var w=d[h];if(w){var l=!1;for(w=w[b];w;){if(w[e]===c){l=d[w.sizset];break}1!==w.nodeType||r||(w[e]=c,w.sizset=h);if(w.nodeName.toLowerCase()===a){l=w;break}w=w[b]}d[h]=l}}}function f(b,a,c,d,h,r){h=0;for(var v=d.length;h<v;h++){var w=d[h];if(w){var l=!1;for(w=w[b];w;){if(w[e]===c){l=d[w.sizset];break}if(1===w.nodeType)if(r||(w[e]=c,w.sizset=h),"string"!==typeof a){if(w===a){l=!0;break}}else if(0<m.filter(a,[w]).length){l=w;break}w=
w[b]}d[h]=l}}}var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),a=0,g=Object.prototype.toString,d=!1,n=!0,c=/\\/g,h=/\r\n/g,p=/\W/;[0,0].sort(function(){n=!1;return 0});var m=function(a,v,c,d){c=c||[];var h=v=v||document;if(1!==v.nodeType&&9!==v.nodeType)return[];if(!a||"string"!==typeof a)return c;var w,e,l,f=!0,z=m.isXML(v),n=[],p=a;do if(b.exec(""),w=b.exec(p))if(p=
w[3],n.push(w[1]),w[2]){var C=w[3];break}while(w);if(1<n.length&&x.exec(a))if(2===n.length&&q.relative[n[0]])var k=D(n[0]+n[1],v,d);else for(k=q.relative[n[0]]?[v]:m(n.shift(),v);n.length;)a=n.shift(),q.relative[a]&&(a+=n.shift()),k=D(a,k,d);else if(!d&&1<n.length&&9===v.nodeType&&!z&&q.match.ID.test(n[0])&&!q.match.ID.test(n[n.length-1])&&(w=m.find(n.shift(),v,z),v=w.expr?m.filter(w.expr,w.set)[0]:w.set[0]),v)for(w=d?{expr:n.pop(),set:r(d)}:m.find(n.pop(),1!==n.length||"~"!==n[0]&&"+"!==n[0]||!v.parentNode?
v:v.parentNode,z),k=w.expr?m.filter(w.expr,w.set):w.set,0<n.length?e=r(k):f=!1;n.length;)w=l=n.pop(),q.relative[l]?w=n.pop():l="",null==w&&(w=v),q.relative[l](e,w,z);else e=[];e||(e=k);e||m.error(l||a);if("[object Array]"===g.call(e))if(f)if(v&&1===v.nodeType)for(a=0;null!=e[a];a++)e[a]&&(!0===e[a]||1===e[a].nodeType&&m.contains(v,e[a]))&&c.push(k[a]);else for(a=0;null!=e[a];a++)e[a]&&1===e[a].nodeType&&c.push(k[a]);else c.push.apply(c,e);else r(e,c);C&&(m(C,h,c,d),m.uniqueSort(c));return c};m.uniqueSort=
function(a){if(B&&(d=n,a.sort(B),d))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};m.matches=function(a,b){return m(a,null,null,b)};m.matchesSelector=function(a,b){return 0<m(b,null,null,[a]).length};m.find=function(a,b,d){var v,h;if(!a)return[];var w=0;for(v=q.order.length;w<v;w++){var e=q.order[w];if(h=q.leftMatch[e].exec(a)){var l=h[1];h.splice(1,1);if("\\"!==l.substr(l.length-1)){h[1]=(h[1]||"").replace(c,"");var r=q.find[e](h,b,d);if(null!=r){a=a.replace(q.match[e],"");break}}}}r||
(r="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:r,expr:a}};m.filter=function(a,b,c,d){for(var v,h,e,w,l,r,n,f,g=a,z=[],p=b,C=b&&b[0]&&m.isXML(b[0]);a&&b.length;){for(e in q.filter)if(null!=(v=q.leftMatch[e].exec(a))&&v[2]&&(r=q.filter[e],l=v[1],h=!1,v.splice(1,1),"\\"!==l.substr(l.length-1))){p===z&&(z=[]);if(q.preFilter[e])if(v=q.preFilter[e](v,p,c,z,d,C),!v)h=w=!0;else if(!0===v)continue;if(v)for(n=0;null!=(l=p[n]);n++)l&&(w=r(l,v,n,p),f=d^w,c&&null!=w?
f?h=!0:p[n]=!1:f&&(z.push(l),h=!0));if(void 0!==w){c||(p=z);a=a.replace(q.match[e],"");if(!h)return[];break}}if(a===g)if(null==h)m.error(a);else break;g=a}return p};m.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var l=m.getText=function(a){var b;var c=a.nodeType;var d="";if(c)if(1===c||9===c||11===c){if("string"===typeof a.textContent)return a.textContent;if("string"===typeof a.innerText)return a.innerText.replace(h,"");for(a=a.firstChild;a;a=a.nextSibling)d+=l(a)}else{if(3===
c||4===c)return a.nodeValue}else for(c=0;b=a[c];c++)8!==b.nodeType&&(d+=l(b));return d},q=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"===typeof b,d=c&&!p.test(b);c=c&&!d;d&&(b=b.toLowerCase());d=0;for(var v=a.length,h;d<v;d++)if(h=a[d]){for(;(h=h.previousSibling)&&1!==h.nodeType;);
a[d]=c||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}c&&m.filter(b,a,!0)},">":function(a,b){var c,d="string"===typeof b,v=0,h=a.length;if(d&&!p.test(b))for(b=b.toLowerCase();v<h;v++){if(c=a[v])c=c.parentNode,a[v]=c.nodeName.toLowerCase()===b?c:!1}else{for(;v<h;v++)(c=a[v])&&(a[v]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(b,c,d){var v=a++,h=f;if("string"===typeof c&&!p.test(c)){var e=c=c.toLowerCase();h=k}h("parentNode",c,v,b,e,d)},"~":function(b,c,d){var h=a++,v=f;if("string"===
typeof c&&!p.test(c)){var e=c=c.toLowerCase();v=k}v("previousSibling",c,h,b,e,d)}},find:{ID:function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){var c=[];b=b.getElementsByName(a[1]);for(var d=0,h=b.length;d<h;d++)b[d].getAttribute("name")===a[1]&&c.push(b[d]);return 0===c.length?null:c}},TAG:function(a,b){if("undefined"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},
preFilter:{CLASS:function(a,b,d,h,e,l){a=" "+a[1].replace(c,"")+" ";if(l)return a;l=0;for(var v;null!=(v=b[l]);l++)v&&(e^(v.className&&0<=(" "+v.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?d||h.push(v):d&&(b[l]=!1));return!1},ID:function(a){return a[1].replace(c,"")},TAG:function(a,b){return a[1].replace(c,"").toLowerCase()},CHILD:function(b){if("nth"===b[1]){b[2]||m.error(b[0]);b[2]=b[2].replace(/^\+|\s*/g,"");var c=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===b[2]&&"2n"||"odd"===b[2]&&"2n+1"||
!/\D/.test(b[2])&&"0n+"+b[2]||b[2]);b[2]=c[1]+(c[2]||1)-0;b[3]=c[3]-0}else b[2]&&m.error(b[0]);b[0]=a++;return b},ATTR:function(a,b,d,h,e,l){b=a[1]=a[1].replace(c,"");!l&&q.attrMap[b]&&(a[1]=q.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(c,"");"~="===a[2]&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,c,d,h,e){if("not"===a[1])if(1<(b.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=m(a[3],null,null,c);else return a=m.filter(a[3],c,d,1^e),d||h.push.apply(h,a),!1;else if(q.match.POS.test(a[0])||q.match.CHILD.test(a[0]))return!0;
return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return!0===a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),
c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},
image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-
1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var h=b[1],e=q.filters[h];if(e)return e(a,c,b,d);if("contains"===h)return 0<=(a.textContent||a.innerText||l([a])||"").indexOf(b[3]);if("not"===h){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}m.error(h)},CHILD:function(a,b){var c;
var d=b[1];var h=a;switch(d){case "only":case "first":for(;h=h.previousSibling;)if(1===h.nodeType)return!1;if("first"===d)return!0;h=a;case "last":for(;h=h.nextSibling;)if(1===h.nodeType)return!1;return!0;case "nth":d=b[2];var l=b[3];if(1===d&&0===l)return!0;b=b[0];if((c=a.parentNode)&&(c[e]!==b||!a.nodeIndex)){var v=0;for(h=c.firstChild;h;h=h.nextSibling)1===h.nodeType&&(h.nodeIndex=++v);c[e]=b}a=a.nodeIndex-l;return 0===d?0===a:0===a%d&&0<=a/d}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===
b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var c=b[1];a=m.attr?m.attr(a,c):q.attrHandle[c]?q.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c);c=a+"";var d=b[2];b=b[4];return null==a?"!="===d:!d&&m.attr?null!=a:"="===d?c===b:"*="===d?0<=c.indexOf(b):"~="===d?0<=(" "+c+" ").indexOf(b):b?"!="===d?c!==b:"^="===d?0===c.indexOf(b):"$="===d?c.substr(c.length-
b.length)===b:"|="===d?c===b||c.substr(0,b.length+1)===b+"-":!1:c&&!1!==a},POS:function(a,b,c,d){var h=q.setFilters[b[2]];if(h)return h(a,c,b,d)}}},x=q.match.POS,u=function(a,b){return"\\"+(b-0+1)},y;for(y in q.match)q.match[y]=new RegExp(q.match[y].source+/(?![^\[]*\])(?![^\(]*\))/.source),q.leftMatch[y]=new RegExp(/(^(?:.|\r|\n)*?)/.source+q.match[y].source.replace(/\\(\d+)/g,u));q.match.globalPOS=x;var r=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(document.documentElement.childNodes,
0)[0].nodeType}catch(w){r=function(a,b){var c=0;b=b||[];if("[object Array]"===g.call(a))Array.prototype.push.apply(b,a);else if("number"===typeof a.length)for(var d=a.length;c<d;c++)b.push(a[c]);else for(;a[c];c++)b.push(a[c]);return b}}if(document.documentElement.compareDocumentPosition)var B=function(a,b){return a===b?(d=!0,0):a.compareDocumentPosition&&b.compareDocumentPosition?a.compareDocumentPosition(b)&4?-1:1:a.compareDocumentPosition?-1:1};else{B=function(a,b){if(a===b)return d=!0,0;if(a.sourceIndex&&
b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c=[],h=[];var e=a.parentNode;var l=b.parentNode;var r=e;if(e===l)return A(a,b);if(!e)return-1;if(!l)return 1;for(;r;)c.unshift(r),r=r.parentNode;for(r=l;r;)h.unshift(r),r=r.parentNode;e=c.length;l=h.length;for(r=0;r<e&&r<l;r++)if(c[r]!==h[r])return A(c[r],h[r]);return r===e?A(a,h[r],-1):A(c[r],b,1)};var A=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1}}(function(){var a=document.createElement("div"),
b="script"+(new Date).getTime(),c=document.documentElement;a.innerHTML="<a name='"+b+"'/>";c.insertBefore(a,c.firstChild);document.getElementById(b)&&(q.find.ID=function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(b=b.getElementById(a[1]))?b.id===a[1]||"undefined"!==typeof b.getAttributeNode&&b.getAttributeNode("id").nodeValue===a[1]?[b]:void 0:[]},q.filter.ID=function(a,b){var c="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===
b});c.removeChild(a);c=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));0<a.getElementsByTagName("*").length&&(q.find.TAG=function(a,b){b=b.getElementsByTagName(a[1]);if("*"===a[1]){a=[];for(var c=0;b[c];c++)1===b[c].nodeType&&a.push(b[c]);b=a}return b});a.innerHTML="<a href='#'></a>";a.firstChild&&"undefined"!==typeof a.firstChild.getAttribute&&"#"!==a.firstChild.getAttribute("href")&&(q.attrHandle.href=function(a){return a.getAttribute("href",
2)});a=null})();document.querySelectorAll&&function(){var a=m,b=document.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){m=function(b,c,d,h){c=c||document;if(!h&&!m.isXML(c)){var e=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(e&&(1===c.nodeType||9===c.nodeType)){if(e[1])return r(c.getElementsByTagName(b),d);if(e[2]&&q.find.CLASS&&c.getElementsByClassName)return r(c.getElementsByClassName(e[2]),d)}if(9===c.nodeType){if("body"===
b&&c.body)return r([c.body],d);if(e&&e[3]){var l=c.getElementById(e[3]);if(l&&l.parentNode){if(l.id===e[3])return r([l],d)}else return r([],d)}try{return r(c.querySelectorAll(b),d)}catch(K){}}else if(1===c.nodeType&&"object"!==c.nodeName.toLowerCase()){e=c;var n=(l=c.getAttribute("id"))||"__sizzle__",f=c.parentNode,g=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):c.setAttribute("id",n);g&&f&&(c=c.parentNode);try{if(!g||f)return r(c.querySelectorAll("[id='"+n+"'] "+b),d)}catch(K){}finally{l||e.removeAttribute("id")}}}return a(b,
c,d,h)};for(var c in a)m[c]=a[c];b=null}}();(function(){var a=document.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(document.createElement("div"),"div"),d=!1;try{b.call(document.documentElement,"[test!='']:sizzle")}catch(G){d=!0}m.matchesSelector=function(a,h){h=h.replace(/=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(d||!q.match.PSEUDO.test(h)&&!/!=/.test(h)){var e=b.call(a,h);if(e||!c||a.document&&11!==a.document.nodeType)return e}}catch(E){}return 0<
m(h,null,null,[a]).length}}})();(function(){var a=document.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";a.getElementsByClassName&&0!==a.getElementsByClassName("e").length&&(a.lastChild.className="e",1!==a.getElementsByClassName("e").length&&(q.order.splice(1,0,"CLASS"),q.find.CLASS=function(a,b,c){if("undefined"!==typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},a=null))})();m.contains=document.documentElement.contains?function(a,
b){return a!==b&&(a.contains?a.contains(b):!0)}:document.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};m.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var D=function(a,b,c){var d,h=[],e="";for(b=b.nodeType?[b]:b;d=q.match.PSEUDO.exec(a);)e+=d[0],a=a.replace(q.match.PSEUDO,"");a=q.relative[a]?a+"*":a;d=0;for(var l=b.length;d<l;d++)m(a,b[d],h,c);return m.filter(e,h)};window.Recite.Sizzle=
m})();
(function(k){function f(a,l){a=a?a:"";l=l||{};if("object"==typeof a&&a.hasOwnProperty("_tc_id"))return a;a=b(a);var r=a.r,p=a.g,m=a.b,v=a.a,k=u(100*v)/100,w=l.format||a.format;1>r&&(r=u(r));1>p&&(p=u(p));1>m&&(m=u(m));return{ok:a.ok,format:w,_tc_id:q++,alpha:v,getAlpha:function(){return v},setAlpha:function(a){v=n(a);k=u(100*v)/100},toHsv:function(){var a=g(r,p,m);return{h:360*a.h,s:a.s,v:a.v,a:v}},toHsvString:function(){var a=g(r,p,m),b=u(360*a.h),c=u(100*a.s);a=u(100*a.v);return 1==v?"hsv("+b+", "+
c+"%, "+a+"%)":"hsva("+b+", "+c+"%, "+a+"%, "+k+")"},toHsl:function(){var a=e(r,p,m);return{h:360*a.h,s:a.s,l:a.l,a:v}},toHslString:function(){var a=e(r,p,m),b=u(360*a.h),c=u(100*a.s);a=u(100*a.l);return 1==v?"hsl("+b+", "+c+"%, "+a+"%)":"hsla("+b+", "+c+"%, "+a+"%, "+k+")"},toHex:function(a){return d(r,p,m,a)},toHexString:function(a){return"#"+d(r,p,m,a)},toRgb:function(){return{r:u(r),g:u(p),b:u(m),a:v}},toRgbString:function(){return 1==v?"rgb("+u(r)+", "+u(p)+", "+u(m)+")":"rgba("+u(r)+", "+u(p)+
", "+u(m)+", "+k+")"},toPercentageRgb:function(){return{r:u(100*c(r,255))+"%",g:u(100*c(p,255))+"%",b:u(100*c(m,255))+"%",a:v}},toPercentageRgbString:function(){return 1==v?"rgb("+u(100*c(r,255))+"%, "+u(100*c(p,255))+"%, "+u(100*c(m,255))+"%)":"rgba("+u(100*c(r,255))+"%, "+u(100*c(p,255))+"%, "+u(100*c(m,255))+"%, "+k+")"},toName:function(){return 0===v?"transparent":D[d(r,p,m,!0)]||!1},toFilter:function(a){var b=d(r,p,m),c=b,e=Math.round(255*parseFloat(v)).toString(16),n=e,q=l&&l.gradientType?"GradientType = 1, ":
"";a&&(a=f(a),c=a.toHex(),n=Math.round(255*parseFloat(a.alpha)).toString(16));return"progid:DXImageTransform.Microsoft.gradient("+q+"startColorstr=#"+h(e)+b+",endColorstr=#"+h(n)+c+")"},toString:function(a){var b=!!a;a=a||this.format;var c=!1;b=!b&&1>v&&0<v&&("hex"===a||"hex6"===a||"hex3"===a||"name"===a);"rgb"===a&&(c=this.toRgbString());"prgb"===a&&(c=this.toPercentageRgbString());if("hex"===a||"hex6"===a)c=this.toHexString();"hex3"===a&&(c=this.toHexString(!0));"name"===a&&(c=this.toName());"hsl"===
a&&(c=this.toHslString());"hsv"===a&&(c=this.toHsvString());return b?this.toRgbString():c||this.toHexString()}}}function b(b){var d={r:0,g:0,b:0},h=1,e=!1,q=!1;if("string"==typeof b)a:{b=b.replace(m,"").replace(l,"").toLowerCase();var f=!1;if(A[b])b=A[b],f=!0;else if("transparent"==b){b={r:0,g:0,b:0,a:0,format:"name"};break a}var g;b=(g=w.rgb.exec(b))?{r:g[1],g:g[2],b:g[3]}:(g=w.rgba.exec(b))?{r:g[1],g:g[2],b:g[3],a:g[4]}:(g=w.hsl.exec(b))?{h:g[1],s:g[2],l:g[3]}:(g=w.hsla.exec(b))?{h:g[1],s:g[2],
l:g[3],a:g[4]}:(g=w.hsv.exec(b))?{h:g[1],s:g[2],v:g[3]}:(g=w.hex6.exec(b))?{r:parseInt(g[1],16),g:parseInt(g[2],16),b:parseInt(g[3],16),format:f?"name":"hex"}:(g=w.hex3.exec(b))?{r:parseInt(g[1]+""+g[1],16),g:parseInt(g[2]+""+g[2],16),b:parseInt(g[3]+""+g[3],16),format:f?"name":"hex"}:!1}if("object"==typeof b){if(b.hasOwnProperty("r")&&b.hasOwnProperty("g")&&b.hasOwnProperty("b"))d=b.g,e=b.b,d={r:255*c(b.r,255),g:255*c(d,255),b:255*c(e,255)},e=!0,q="%"===String(b.r).substr(-1)?"prgb":"rgb";else if(b.hasOwnProperty("h")&&
b.hasOwnProperty("s")&&b.hasOwnProperty("v")){b.s=p(b.s);b.v=p(b.v);q=b.h;f=b.s;d=b.v;q=6*c(q,360);f=c(f,100);d=c(d,100);e=x.floor(q);var v=q-e;q=d*(1-f);g=d*(1-v*f);f=d*(1-(1-v)*f);e%=6;d={r:255*[d,g,q,q,f,d][e],g:255*[f,d,d,g,q,q][e],b:255*[q,q,f,d,d,g][e]};e=!0;q="hsv"}else b.hasOwnProperty("h")&&b.hasOwnProperty("s")&&b.hasOwnProperty("l")&&(b.s=p(b.s),b.l=p(b.l),d=a(b.h,b.s,b.l),e=!0,q="hsl");b.hasOwnProperty("a")&&(h=b.a)}h=n(h);return{ok:e,format:b.format||q,r:y(255,r(d.r,0)),g:y(255,r(d.g,
0)),b:y(255,r(d.b,0)),a:h}}function e(a,b,d){a=c(a,255);b=c(b,255);d=c(d,255);var h=r(a,b,d),e=y(a,b,d),l=(h+e)/2;if(h==e)var g=e=0;else{var q=h-e;e=.5<l?q/(2-h-e):q/(h+e);switch(h){case a:g=(b-d)/q+(b<d?6:0);break;case b:g=(d-a)/q+2;break;case d:g=(a-b)/q+4}g/=6}return{h:g,s:e,l:l}}function a(a,b,d){function h(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:.5>c?b:c<2/3?a+(b-a)*(2/3-c)*6:a}a=c(a,360);b=c(b,100);d=c(d,100);if(0===b)d=b=a=d;else{var e=.5>d?d*(1+b):d+b-d*b,l=2*d-e;d=h(l,e,a+1/
3);b=h(l,e,a);a=h(l,e,a-1/3)}return{r:255*d,g:255*b,b:255*a}}function g(a,b,d){a=c(a,255);b=c(b,255);d=c(d,255);var h=r(a,b,d),e=y(a,b,d),l=h-e;if(h==e)var g=0;else{switch(h){case a:g=(b-d)/l+(b<d?6:0);break;case b:g=(d-a)/l+2;break;case d:g=(a-b)/l+4}g/=6}return{h:g,s:0===h?0:l/h,v:h}}function d(a,b,c,d){a=[h(u(a).toString(16)),h(u(b).toString(16)),h(u(c).toString(16))];return d&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+
a[2].charAt(0):a.join("")}function n(a){a=parseFloat(a);if(isNaN(a)||0>a||1<a)a=1;return a}function c(a,b){var c=a;"string"==typeof c&&-1!=c.indexOf(".")&&1===parseFloat(c)&&(a="100%");c="string"===typeof a&&-1!=a.indexOf("%");a=y(b,r(0,parseFloat(a)));c&&(a=parseInt(a*b,10)/100);return 1E-6>x.abs(a-b)?1:a%b/parseFloat(b)}function h(a){return 1==a.length?"0"+a:""+a}function p(a){1>=a&&(a=100*a+"%");return a}var m=/^[\s,#]+/,l=/\s+$/,q=0,x=Math,u=x.round,y=x.min,r=x.max,B=x.random;f.fromRatio=function(a,
b){if("object"==typeof a){var c={},d;for(d in a)a.hasOwnProperty(d)&&(c[d]="a"===d?a[d]:p(a[d]));a=c}return f(a,b)};f.equals=function(a,b){return a&&b?f(a).toRgbString()==f(b).toRgbString():!1};f.random=function(){return f.fromRatio({r:B(),g:B(),b:B()})};f.desaturate=function(a,b){b=0===b?0:b||10;a=f(a).toHsl();a.s-=b/100;a.s=y(1,r(0,a.s));return f(a)};f.saturate=function(a,b){b=0===b?0:b||10;a=f(a).toHsl();a.s+=b/100;a.s=y(1,r(0,a.s));return f(a)};f.greyscale=function(a){return f.desaturate(a,100)};
f.lighten=function(a,b){b=0===b?0:b||10;a=f(a).toHsl();a.l+=b/100;a.l=y(1,r(0,a.l));return f(a)};f.darken=function(a,b){b=0===b?0:b||10;a=f(a).toHsl();a.l-=b/100;a.l=y(1,r(0,a.l));return f(a)};f.complement=function(a){a=f(a).toHsl();a.h=(a.h+180)%360;return f(a)};f.triad=function(a){var b=f(a).toHsl(),c=b.h;return[f(a),f({h:(c+120)%360,s:b.s,l:b.l}),f({h:(c+240)%360,s:b.s,l:b.l})]};f.tetrad=function(a){var b=f(a).toHsl(),c=b.h;return[f(a),f({h:(c+90)%360,s:b.s,l:b.l}),f({h:(c+180)%360,s:b.s,l:b.l}),
f({h:(c+270)%360,s:b.s,l:b.l})]};f.splitcomplement=function(a){var b=f(a).toHsl(),c=b.h;return[f(a),f({h:(c+72)%360,s:b.s,l:b.l}),f({h:(c+216)%360,s:b.s,l:b.l})]};f.analogous=function(a,b,c){b=b||6;c=c||30;var d=f(a).toHsl();c=360/c;a=[f(a)];for(d.h=(d.h-(c*b>>1)+720)%360;--b;)d.h=(d.h+c)%360,a.push(f(d));return a};f.monochromatic=function(a,b){b=b||6;var c=f(a).toHsv();a=c.h;var d=c.s;c=c.v;for(var h=[],e=1/b;b--;)h.push(f({h:a,s:d,v:c})),c=(c+e)%1;return h};f.readability=function(a,b){a=f(a).toRgb();
b=f(b).toRgb();return{brightness:Math.abs((299*a.r+587*a.g+114*a.b)/1E3-(299*b.r+587*b.g+114*b.b)/1E3),color:Math.max(a.r,b.r)-Math.min(a.r,b.r)+Math.max(a.g,b.g)-Math.min(a.g,b.g)+Math.max(a.b,b.b)-Math.min(a.b,b.b)}};f.readable=function(a,b){a=f.readability(a,b);return 125<a.brightness&&500<a.color};f.mostReadable=function(a,b){for(var c=null,d=0,h=!1,e=0;e<b.length;e++){var l=f.readability(a,b[e]),r=125<l.brightness&&500<l.color;l=l.brightness/125*3+l.color/500;if(r&&!h||r&&h&&l>d||!r&&!h&&l>d)h=
r,d=l,c=f(b[e])}return c};var A=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",
darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",
gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",
lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",
olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",
slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},D=f.hexNames=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}(A),w={rgb:/rgb[\s|\(]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))\s*\)?/,rgba:/rgba[\s|\(]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))\s*\)?/,
hsl:/hsl[\s|\(]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))\s*\)?/,hsla:/hsla[\s|\(]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))\s*\)?/,hsv:/hsv[\s|\(]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))[,|\s]+((?:[-\+]?\d*\.\d+%?)|(?:[-\+]?\d+%?))\s*\)?/,
hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};"undefined"!==typeof module&&module.exports?module.exports=f:"undefined"!==typeof define&&define(function(){return f});window.Recite.Tinycolor=f})(this);
(function(k){function f(a,b){for(var c=a.length;c--;)if(a[c]===b)return c;return-1}function b(b){var d,r;var g=b.keyCode;-1==f(x,g)&&x.push(g);if(93==g||224==g)g=91;if(g in p)for(d in p[g]=!0,l)l[d]==g&&(e[d]=!0);else{for(c in p)p[c]=b[u[c]];if(e.filter.call(this,b)&&g in h){var q=a();for(r=0;r<h[g].length;r++){var n=h[g][r];if(n.scope==q||"all"==n.scope){var m=0<n.mods.length;for(d in p)if(!p[d]&&-1<f(n.mods,+d)||p[d]&&-1==f(n.mods,+d))m=!1;(0!=n.mods.length||p[16]||p[18]||p[17]||p[91])&&!m||!1!==
n.method(b,n)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),b.cancelBubble&&(b.cancelBubble=!0))}}}}}function e(a,b,c){var e=g(a);void 0===c&&(c=b,b="all");for(var l=0;l<e.length;l++){var r=[];a=e[l].split("+");1<a.length&&(r=d(a),a=[a[a.length-1]]);a=a[0];a=q[a]||a.toUpperCase().charCodeAt(0);a in h||(h[a]=[]);h[a].push({shortcut:e[l],scope:b,method:c,key:e[l],mods:r})}}function a(){return m||"all"}function g(a){a=a.replace(/\s/g,"");a=a.split(",");
""==a[a.length-1]&&(a[a.length-2]+=",");return a}function d(a){a=a.slice(0,a.length-1);for(var b=0;b<a.length;b++)a[b]=l[a[b]];return a}function n(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,function(){c(window.event)})}var c,h={},p={16:!1,18:!1,17:!1,91:!1},m="all",l={"\u21e7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,command:91},q={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,
up:38,right:39,down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},x=[];for(c=1;20>c;c++)q["f"+c]=111+c;var u={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(c in l)e[c]=!1;n(document,"keydown",function(a){b(a)});n(document,"keyup",function(a){a=a.keyCode;var b,c=f(x,a);0<=c&&x.splice(c,1);if(93==a||224==a)a=91;if(a in p)for(b in p[a]=!1,l)l[b]==a&&(e[b]=!1)});n(window,"focus",function(){for(c in p)p[c]=
!1;for(c in l)e[c]=!1});var y=k.key;k.key=e;k.key.setScope=function(a){m=a||"all"};k.key.getScope=a;k.key.deleteScope=function(a){var b,c;for(b in h){var d=h[b];for(c=0;c<d.length;)d[c].scope===a?d.splice(c,1):c++}};k.key.filter=function(a){a=(a.target||a.srcElement).tagName;return!("INPUT"==a||"SELECT"==a||"TEXTAREA"==a)};k.key.isPressed=function(a){"string"==typeof a&&(a=q[a]||a.toUpperCase().charCodeAt(0));return-1!=f(x,a)};k.key.getPressedKeyCodes=function(){return x.slice(0)};k.key.noConflict=
function(){var a=k.key;k.key=y;return a};k.key.unbind=function(b,c){var e=[],l,n;var f=g(b);for(n=0;n<f.length;n++){var r=f[n].split("+");1<r.length&&(e=d(r),b=r[r.length-1]);b=q[b]||b.toUpperCase().charCodeAt(0);void 0===c&&(c=a());if(!h[b])break;for(l in h[b]){r=h[b][l];var p;if(p=r.scope===c)a:if(r=r.mods,r.length!=e.length)p=!1;else{for(p=0;p<r.length;p++)if(r[p]!==e[p]){p=!1;break a}p=!0}p&&(h[b][l]={})}}};"undefined"!==typeof module&&(module.exports=key);window.Recite.Key=key})(this);
Recite.AssetLoader=function(k){function f(a,b){a=k.createElement(a);for(var c in b)b.hasOwnProperty(c)&&a.setAttribute(c,b[c]);a.setAttribute("data-recite-skip","true");return a}function b(b){var c=h[b];if(c){var d=c.callback;var e=c.urls;e.shift();p=0;e.length||(d&&d.call(c.context,c.obj),h[b]=null,m[b].length&&a(b))}}function e(){var a=navigator.userAgent;n={async:!0===k.createElement("script").async};(n.webkit=/AppleWebKit\//.test(a))||(n.ie=/MSIE|Trident/.test(a))||(n.opera=/Opera/.test(a))||
(n.gecko=/Gecko\//.test(a))||(n.unknown=!0)}function a(a,l,p,y,r){var q=function(){b(a)},u="css"===a,x=[],w,v;n||e();if(l)if(l="string"===typeof l?[l]:l.concat(),u||n.async||n.gecko||n.opera)m[a].push({urls:l,callback:p,obj:y,context:r});else{var C=0;for(w=l.length;C<w;++C)m[a].push({urls:[l[C]],callback:C===w-1?p:null,obj:y,context:r})}if(!h[a]&&(v=h[a]=m[a].shift())){c||(c=k.head||k.getElementsByTagName("head")[0]);l=v.urls;C=0;for(w=l.length;C<w;++C){p=l[C];if(u)var z=n.gecko?f("style"):f("link",
{href:p,rel:"stylesheet"});else z=f("script",{src:p}),z.async=!1;z.className="lazyload";z.setAttribute("charset","utf-8");n.ie&&!u&&"onreadystatechange"in z&&!("draggable"in z)?z.onreadystatechange=function(){/loaded|complete/.test(z.readyState)&&(z.onreadystatechange=null,q())}:u&&(n.gecko||n.webkit)?n.webkit?(v.urls[C]=z.href,d()):(z.innerHTML='@import "'+p+'";',g(z)):z.onload=z.onerror=q;x.push(z)}C=0;for(w=x.length;C<w;++C)c.appendChild(x[C])}}function g(a){try{var c=!!a.sheet.cssRules}catch(u){p+=
1;200>p?setTimeout(function(){g(a)},50):c&&b("css");return}b("css")}function d(){var a=h.css,c;if(a){for(c=l.length;0<=--c;)if(l[c].href===a.urls[0]){b("css");break}p+=1;a&&(200>p?setTimeout(d,50):b("css"))}}var n,c,h={},p=0,m={css:[],js:[]},l=k.styleSheets;return{css:function(b,c,d,h){a("css",b,c,d,h)},js:function(b,c,d,h){a("js",b,c,d,h)}}}(this.document);Recite.namespace("Preset");Recite.namespace("preset");
Recite.Preset=Recite.preset=function(){return{square24:{background:Recite.baseUrl+"img/buttons/square24.gif",width:"24px",height:"24px"},square36:{background:Recite.baseUrl+"img/buttons/square36.gif",width:"36px",height:"36px"},hor24_recite:{background:Recite.baseUrl+"img/buttons/recite_hor24.gif",width:"83px",height:"24px"},hor24_recite_red:{background:Recite.baseUrl+"img/buttons/recite_hor24_red.gif",width:"83px",height:"24px"},hor48_recite:{background:Recite.baseUrl+"img/buttons/recite_hor48.gif",
width:"166px",height:"48px"},hor48_recite_red:{background:Recite.baseUrl+"img/buttons/recite_hor48_red.gif",width:"166px",height:"48px"},ver24_recite:{background:Recite.baseUrl+"img/buttons/recite_ver24.gif",width:"24px",height:"109px"},ver24_recite_red:{background:Recite.baseUrl+"img/buttons/recite_ver24_red.gif",width:"24px",height:"109px"},ver48_recite:{background:Recite.baseUrl+"img/buttons/recite_ver48.gif",width:"48px",height:"217px"},ver48_recite_red:{background:Recite.baseUrl+"img/buttons/recite_ver48_red.gif",
width:"48px",height:"217px"},hor24_speak:{background:Recite.baseUrl+"img/buttons/speak_hor24.gif",width:"79px",height:"24px"},hor24_speak_red:{background:Recite.baseUrl+"img/buttons/speak_hor24_red.gif",width:"79px",height:"24px"},hor48_speak:{background:Recite.baseUrl+"img/buttons/speak_hor48.gif",width:"158px",height:"48px"},hor48_speak_red:{background:Recite.baseUrl+"img/buttons/speak_hor48_red.gif",width:"158px",height:"48px"},ver24_speak:{background:Recite.baseUrl+"img/buttons/speak_ver24.gif",
width:"24px",height:"109px"},ver24_speak_red:{background:Recite.baseUrl+"img/buttons/speak_ver24_red.gif",width:"24px",height:"109px"},ver48_speak:{background:Recite.baseUrl+"img/buttons/speak_ver48.gif",width:"48px",height:"217px"},ver48_speak_red:{background:Recite.baseUrl+"img/buttons/speak_ver48_red.gif",width:"48px",height:"217px"},square24_png:{background:Recite.baseUrl+"img/buttons/24x24.png",width:"24px",height:"24px"},square36_png:{background:Recite.baseUrl+"img/buttons/36x36.png",width:"36px",
height:"36px"},hor24_recite_png:{background:Recite.baseUrl+"img/buttons/recite_hor24.png",width:"83px",height:"24px"},hor24_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_hor24_red.png",width:"83px",height:"24px"},hor48_recite_png:{background:Recite.baseUrl+"img/buttons/recite_hor48.png",width:"166px",height:"48px"},hor48_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_hor48_red.png",width:"166px",height:"48px"},ver24_recite_png:{background:Recite.baseUrl+"img/buttons/recite_ver24.png",
width:"24px",height:"109px"},ver24_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_ver24_red.png",width:"24px",height:"109px"},ver48_recite_png:{background:Recite.baseUrl+"img/buttons/recite_ver48.png",width:"48px",height:"217px"},ver48_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_ver48_red.png",width:"48px",height:"217px"},hor24_speak_png:{background:Recite.baseUrl+"img/buttons/speak_hor24.png",width:"79px",height:"24px"},hor24_speak_red_png:{background:Recite.baseUrl+
"img/buttons/speak_hor24_red.png",width:"79px",height:"24px"},hor48_speak_png:{background:Recite.baseUrl+"img/buttons/speak_hor48.png",width:"158px",height:"48px"},hor48_speak_red_png:{background:Recite.baseUrl+"img/buttons/speak_hor48_red.png",width:"158px",height:"48px"},ver24_speak_png:{background:Recite.baseUrl+"img/buttons/speak_ver24.png",width:"24px",height:"109px"},ver24_speak_red_png:{background:Recite.baseUrl+"img/buttons/speak_ver24_red.png",width:"24px",height:"109px"},ver48_speak_png:{background:Recite.baseUrl+
"img/buttons/speak_ver48.png",width:"48px",height:"217px"},ver48_speak_red_png:{background:Recite.baseUrl+"img/buttons/speak_ver48_red.png",width:"48px",height:"217px"}}}();Recite.namespace("Ajax");
Recite.Ajax=function(){function k(a){var b=Recite.Util.clone(d);return Recite.Util.merge(b,a)}function f(a){var b="";if(a.getResponseHeader)b=/^application\/json/.test(a.getResponseHeader("Content-Type"))?ReciteJSON.parse(a.responseText):a.responseText;else if(0<a.responseText.length)try{b=ReciteJSON.parse(a.responseText)}catch(h){b=a.responseText}return b}function b(a,b){b=k(b);var c=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");"GET"===b.method&&null!==b.data&&
"undefined"!==typeof b.data&&(a+=Recite.Util.buildQueryString(b.data));c.open(b.method,a,b.async,b.user,b.password);b.async&&(c.timeout=b.timeout);c.setRequestHeader("Content-Type",b.contentType);c.onreadystatechange=function(){if(4===c.readyState){var a=f(c);200===c.status?b.success(c,a):b.error(c,a)}};null!==b.beforeSend&&b.beforeSend(c);c.send(b.data)}function e(a,b){b=k(b);var c=new XDomainRequest;"GET"===b.method&&null!==b.data&&"undefined"!==typeof b.data&&(a+=Recite.Util.buildQueryString(b.data));
c.onload=function(){var a=f(c);b.success(c,a)};c.onerror=function(){var a=f(c);b.error(c,a)};c.open(b.method,a);c.timeout=b.timeout;null!==b.beforeSend&&b.beforeSend(c);c.send(b.data)}function a(a,c){"withCredentials"in(window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP"))?b(a,c):"undefined"!==typeof window.XDomainRequest?e(a,c):"undefined"===typeof window.flensed?Recite.AssetLoader.js(Recite.baseUrl+"/js/flxhr/flXHR.js",function(){g(c)}):g(a,c)}function g(a,b){var c=
new flensed.flXHR({autoUpdatePlayer:!1,instanceId:"recite-proxy",xmlResponseText:!1,onreadystatechange:function(a){if(4===a.readyState){var c=f(a);200===a.status?b.success(a,c):b.error(a,c)}}});c.open(b.method,a);null!==b.beforeSend&&b.beforeSend(c);c.send(b.data)}var d={method:"POST",contentType:"application/x-www-form-urlencoded",async:!0,username:null,password:null,success:function(){},error:function(){},beforeSend:null,data:null,timeout:1E4};return{get:function(a,b,d){Recite.Debug.log("Recite.Ajax",
"Making AJAX request to: "+a);this.ajax(a,{method:"GET",data:b,success:d})},post:function(a,b,d){this.ajax(a,{method:"POST",data:b,success:d})},ajax:function(d,c){"undefined"!==typeof c.data&&"POST"==c.method&&"object"==Recite.Util.type(c.data)&&(c.data=ReciteJSON.stringify(c.data));return String(window.location).substr(0,Recite.baseUrl.length)==Recite.baseUrl?b(d,c):a(d,c)},nativeXDomainSupported:function(){return"undefined"!==typeof(new XMLHttpRequest).withCredentials||"undefined"!==typeof window.XDomainRequest?
!0:!1}}}();Recite.namespace("Api");
Recite.Api=function(){function k(e,a){e=b.endpoint+e;a=Recite.Util.merge({access_token:a.access_token,v:Recite.version},a.data);return e+Recite.Util.buildQueryString(a)}function f(e,a,g){var d=b.endpoint+e;d+=Recite.Util.buildQueryString({access_token:g.access_token,v:Recite.version});Recite.Ajax.ajax(d,{method:a,data:g.data,contentType:g.contentType,success:function(a,b){g.success&&g.success(b)},error:function(b,c){Recite.Debug.log("Recite.Api","Error occured during API call to: "+d,c);if("undefined"!==
typeof c.error)if("invalid_grant"===c.error)Recite.Debug.log("Recite.Api","Requesting a new token."),Recite.Auth.clear(),Recite.Api.call(e,a,g);else{if("invalid_token"===c.error||"invalid_referrer"===c.error||"invalid_ip"===c.error)alert("We have detected invalid usage of Recite and we have disabled future access. If you think this is an error please contact support@reciteme.com"),window.location.reload();g.error&&g.error(c)}}})}var b={endpoint:Recite.baseUrl+"/api/"};return{setOptions:function(e){b=
Recite.Util.merge(b,e)},call:function(b,a,g){g.contentType=g.contentType||"application/x-www-form-urlencoded";"undefined"===typeof g.authRequired&&(g.authRequired=!0);g.authRequired?Recite.Auth.getStatus(function(d){"authorized"===d.state&&(g.access_token=d.access_token,f(b,a,g))}):f(b,a,g)},getUri:function(b,a){"undefined"===typeof a.authRequired&&(a.authRequired=!0);a.authRequired?Recite.Auth.getStatus(function(e){"authorized"===e.state&&(a.access_token=e.access_token,a.success&&a.success(k(b,a)))}):
a.success&&a.success(k(b,a))}}}();Recite.namespace("Recite.Dom");
Recite.Dom=function(){function k(b){if(b.nodeType===Node.TEXT_NODE)return b.textContent;try{var e=getComputedStyle(b);if(e&&"none"===e.display)return"";e="";for(var a=0;a<b.childNodes.length;a++)"RECITEWORDBYWORD"!=b.childNodes[a].tagName&&(e+=k(b.childNodes[a]));return e}catch(g){return Recite.Debug.log("Recite.Dom","Unable to get getComputedStyle() of element: "+b),Recite.Debug.log("Recite.Dom",g),""}}var f={word_filters:{},srollTopPadding:150,skipSelectors:["[aria-hidden=true]"]};return{getPosition:function(b){"undefined"!=
typeof b.positionalProxy&&null!=b.positionalProxy&&(b=b.positionalProxy);var e=0,a=0;if(b.offsetParent){do"BODY"!==b.tagName&&(e+=b.offsetLeft,a+=b.offsetTop);while(b=b.offsetParent)}return{left:e,top:a}},isCurrent:function(b){var e=Recite.Dom.getPosition(b);b=b.currentStyle;return 0!==e.left&&0!==e.top&&0<b.width&&0<b.height?!0:!1},getScroll:function(b){"undefined"===typeof b&&(b=window);var e=b.document;if(b.pageYOffset){var a=b.pageYOffset;var g=b.pageXOffset}else e.documentElement&&e.documentElement.scrollTop?
(a=e.documentElement.scrollTop,g=e.documentElement.scrollLeft):e.body&&(a=e.body.scrollTop,g=e.body.scrollLeft);return{x:g,y:a}},getStyle:function(b,e){if(b.currentStyle){e=e.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")});var a=b.currentStyle[e]}else window.getComputedStyle&&(a=document.defaultView.getComputedStyle(b,null).getPropertyValue(e));return a},getStyles:function(b){var e;b.currentStyle?e=b.currentStyle:window.getComputedStyle&&(e=document.defaultView.getComputedStyle(b,
null));return e},getText:function(b,e){var a="";if("undefined"==typeof b)return"";if("undefined"!==typeof e)return 0===b.childNodes.length&&(a+=e.call(b)),Recite.Util.each(b.childNodes,function(b,g){a+=e.call(g)}),a.trim();"IMG"===b.tagName?a=b.getAttribute("alt"):3===b.nodeType?a=b.data:"INPUT"===b.tagName||"TEXTAREA"===b.tagName?""==b.value&&(b=b.getAttribute("placeholder"))&&(a=b+" "):a=k(b);null==a&&(a="");for(var g in f.word_filters)a=a.toLowerCase().replace(g,f.word_filters[g]);return null!=
a?a.trim():""},getAllWindows:function(b,e){e||(e=[]);b||(b=window);0===e.length&&e.push(b);b=b.frames;for(var a=0;a<b.length;a++)try{b[a].document.body,e.push(b[a]),0<b[a].frames.length&&e.concat(e,Recite.Dom.getAllWindows(b[a],e))}catch(g){}return e},prepend:function(b,e){if("string"===Recite.Util.type(b)){var a=e.ownerDocument.createElement("div");a.innerHTML=b;for(b=0;b<a.childNodes.length;b++)e.insertBefore(a.childNodes[0],e.childNodes[0])}else e.insertBefore(b,e.childNodes[0])},append:function(b,
e){if("string"===Recite.Util.type(b)){var a=e.ownerDocument.createElement("div");a.innerHTML=b;for(b=0;b<a.childNodes.length;b++)e.appendChild(a.childNodes[b])}else e.appendChild(b)},getSelected:function(){var b="";"undefined"!==typeof window.getSelection?b=window.getSelection().toString():"undefined"!==typeof document.selection&&"Text"===document.selection.type&&(b=document.selection.createRange().text);return b.replace(/^\s+|\s+$/g,"")},isDescendant:function(b,e){for(;b;){if(b===e)return!0;b=b.parentNode}return!1},
getAncestors:function(b){for(var e=null,a=[];void 0!==b&&null!==(e=b.parentNode)&&(void 0===e||1===e.nodeType);)a.push(e),b=e;return a},getWindowDimensions:function(b){var e=b.document;if("number"===typeof b.innerWidth){var a=b.innerWidth;var g=b.innerHeight}else e.documentElement&&(e.documentElement.clientWidth||e.documentElement.clientHeight)?(a=e.documentElement.clientWidth,g=e.documentElement.clientHeight):e.body&&(e.body.clientWidth||e.body.clientHeight)&&(a=e.body.clientWidth,g=e.body.clientHeight);
return{width:a,height:g}},getLanguage:function(b){var e=null;if(void 0===b)return e;if(1===b.nodeType&&void 0!==b.lang&&""!==b.lang)return b.lang.toLowerCase();var a=b.childNodes;if(void 0!==a&&void 0!=a.length&&0<a.length&&(Recite.Util.each(a,function(a,b){for(;null!==b;){if(3!==b.nodeType&&void 0!==b.lang&&""!==b.lang){e=b.lang;break}b=0<b.childNodes.length?b.childNodes[0]:null}}),null!==e))return e.toLowerCase();b=Recite.Dom.getAncestors(b);for(var g in b){a=b[g];if(void 0!==a&&a.lang&&0!==a.lang.length){e=
a.lang;break}if(void 0!==a&&1===a.nodeType&&null!==a.getAttribute("xml:lang")&&""!==a.getAttribute("xml:lang")){e=a.getAttribute("xml:lang");break}}null===e&&(g=Recite.Sizzle('meta[http-equiv="Content-Language"]'),0<g.length&&(e=g[0].getAttribute("content")));return null!==e&&"string"===typeof e?e.toLowerCase():null},detectLanguage:function(b,e){b&&0!=b.length?(Recite.Debug.log("Recite.Dom","Auto detecting language"),Recite.Api.call("language-detect","POST",{data:{q:b},contentType:"application/json",
success:function(a){Recite.Debug.log("Recite.Dom","Language detected: "+a.lang);void 0!=e&&e(null!=a.lang?a.lang.toLowerCase():null)},error:function(){void 0!=e&&e(null)}})):void 0!=e&&e(null)},getNextElement:function(b,e){"undefined"==typeof e&&(e=!1);var a="recite, [data-recite-ele] "+(Recite.FrameUpdater.isActive()?", iframe":"");a=Recite.Sizzle(a);if("undefined"===b||null===b)return Recite.Debug.log("Recite.DOM","Current element is null - probably been removed from DOM"),a[0];for(var g=null,d=
0;d<a.length;d++)if(a[d]===b||null===b||null!==g){if(null===b)g=a[0];else if("undefined"!==typeof a[d+1]){if(!Recite.Dom.isValidElement(a[d+1])){b=a[d+1];continue}g=a[d+1]}else break;b=Recite.Dom.getPosition(g);if(0>b.left||0>b.top||0==b.top&&0==b.left)b=g;else{if("IFRAME"!=g.nodeName||e)return g;Recite.Event.publish("FrameUpdater:EnterFrame",{element:g,direction:"next"});break}}return null},getPreviousElement:function(b,e){"undefined"==typeof e&&(e=!1);var a="recite, [data-recite-ele] "+(Recite.FrameUpdater.isActive()?
", iframe":"");a=Recite.Sizzle(a);if("undefined"===b||null===b)return Recite.Debug.log("Recite.DOM","getPreviousElement return 1st ele"),a[0];for(var g=null,d=a.length;0<d;d--)if(a[d]==b||null==b||null!==g){if(null==b)g=a[0];else if("undefined"!==typeof a[d-1]){if(!Recite.Dom.isValidElement(a[d-1])){b=a[d-1];continue}g=a[d-1]}else break;b=Recite.Dom.getPosition(g);if(0>b.left||0>b.top||0==b.top&&0==b.left)b=g;else{if("IFRAME"!=g.nodeName||e)return g;Recite.Event.publish("FrameUpdater:EnterFrame",
{element:g,direction:"prev"});break}}return null},getLastElement:function(){var b="recite, [data-recite-ele] "+(Recite.FrameUpdater.isActive()?", iframe":"");b=Recite.Sizzle(b);return b[b.length-1]},getFirstElement:function(){var b="recite, [data-recite-ele] "+(Recite.FrameUpdater.isActive()?", iframe":"");return Recite.Sizzle(b)[0]},isVisible:function(b){var e=Recite.Dom.getScroll(b.ownerDocument.defaultView),a=Recite.Dom.getPosition(b);Recite.PlayerControls.getProvider().getOptions();var g=Recite.Dom.getWindowDimensions(window),
d=a.top-b.offsetHeight+200,f=a.left,c=!1;d<g.height+e.y&&a.top>d&&0<f&&f<g.width+e.x&&(c=!0);return c&&Recite.Dom.isValidElement(b)},isValidElement:function(b){return null==f.skipSelectors?!0:b.matches(f.skipSelectors)?!1:"HTML"!=b.nodeName&&b.parentNode?Recite.Dom.isValidElement(b.parentNode):!0},scrollTo:function(b){var e=Recite.Dom.getPosition(b);b=e.top-b.offsetHeight;b-=f.srollTopPadding;window.scrollTo(e.left,b)},getIndex:function(b){if("undefined"===typeof b||null===b)return null;for(var e=
b.parentElement||b.parentNode,a=-1,g;e&&(g=e.childNodes[++a]);)if(g==b)return a;return-1},getPath:function(b){var e,a=[],g=Recite.Dom.getIndex(b),d=0;if("undefined"===typeof b||null===b)return null;for(;e=b.parentNode;){++d;if(-1>=g)break;b=e;a.push(g);g=Recite.Dom.getIndex(e)}return a.reverse()},getNode:function(b){var e=document.documentElement,a;if("undefined"===typeof e||null===e)return null;for(a=1;a<b.length;){var g=b[a];"undefined"!==typeof e&&(e=e.childNodes[g]);++a}return e},setOptions:function(b){f=
Recite.Util.merge(f,b)}}}();Recite.namespace("Dom.Traverser");Recite.Dom.Traverser=function(){return{traverse:function(k,f){for(var b=k.childNodes[0];null!==b;){var e=f(b);if(b.hasChildNodes()&&e)b=b.firstChild;else{for(;null===b.nextSibling&&b!==k;)b=b.parentNode;b=b===k?null:b.nextSibling}}}}};Recite.namespace("Recite.Dom.Observer");
Recite.Dom.Observer=function(){function k(){Recite.Util.each(b,function(a,b){a=b.innerHTML.length;"undefined"===typeof b.prevLength&&(b.prevLength=a);b.prevLength!==a&&(a=Recite.Parser.Html.parse(b),Recite.Event.publish("Recite.Dom.Observor:change",{affectedElements:a}),b.prevLength=b.innerHTML.length)})}var f=null,b=[],e={pollTime:1500,useMutations:!0};return{setOptions:function(a){e=Recite.Util.merge(e,a)},observe:function(a){b.push(a);null===f&&(Recite.Debug.log("Recite.Dom.Observer","Setting up body length polling."),
f=setInterval(function(){k()},e.pollTime))}}}();var ReciteJSON;ReciteJSON||(ReciteJSON={});
(function(){function k(a){return 10>a?"0"+a:a}function f(b){a.lastIndex=0;return a.test(b)?'"'+b.replace(a,function(a){var b=n[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function b(a,e){var h=g,l=e[a];l&&"object"===typeof l&&"function"===typeof l.toReciteJSON&&(l=l.toReciteJSON(a));"function"===typeof c&&(l=c.call(e,a,l));switch(typeof l){case "string":return f(l);case "number":return isFinite(l)?String(l):"null";case "boolean":case "null":return String(l);
case "object":if(!l)return"null";g+=d;var q=[];if("[object Array]"===Object.prototype.toString.apply(l)){var n=l.length;for(a=0;a<n;a+=1)q[a]=b(a,l)||"null";e=0===q.length?"[]":g?"[\n"+g+q.join(",\n"+g)+"\n"+h+"]":"["+q.join(",")+"]";g=h;return e}if(c&&"object"===typeof c)for(n=c.length,a=0;a<n;a+=1){if("string"===typeof c[a]){var p=c[a];(e=b(p,l))&&q.push(f(p)+(g?": ":":")+e)}}else for(p in l)Object.prototype.hasOwnProperty.call(l,p)&&(e=b(p,l))&&q.push(f(p)+(g?": ":":")+e);e=0===q.length?"{}":g?
"{\n"+g+q.join(",\n"+g)+"\n"+h+"}":"{"+q.join(",")+"}";g=h;return e}}"function"!==typeof Date.prototype.toReciteJSON&&(Date.prototype.toReciteJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null},String.prototype.toReciteJSON=Number.prototype.toReciteJSON=Boolean.prototype.toReciteJSON=function(a){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
a=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,d,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;"function"!==typeof ReciteJSON.stringify&&(ReciteJSON.stringify=function(a,e,f){var h;d=g="";if("number"===typeof f)for(h=0;h<f;h+=1)d+=" ";else"string"===typeof f&&(d=f);if((c=e)&&"function"!==typeof e&&("object"!==typeof e||"number"!==typeof e.length))throw Error("ReciteJSON.stringify");
return b("",{"":a})});"function"!==typeof ReciteJSON.parse&&(ReciteJSON.parse=function(a,b){function c(a,d){var e,h=a[d];if(h&&"object"===typeof h)for(e in h)if(Object.prototype.hasOwnProperty.call(h,e)){var l=c(h,e);void 0!==l?h[e]=l:delete h[e]}return b.call(a,d,h)}a=String(a);e.lastIndex=0;e.test(a)&&(a=a.replace(e,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return a=eval("("+a+")"),"function"===typeof b?c({"":a},""):a;throw new SyntaxError("ReciteJSON.parse");})})();Recite.namespace("Auth");
Recite.Auth=function(){function k(b,c){"undefined"===typeof c&&(c={});var d=a.authorization_endpoint+"?response_type="+b+"&client_id="+a.client_id;null!==a.redirect_uri&&(d+="&redirect_uri="+encodeURIComponent(a.redirect_uri));null!==a.required_scope&&(d+="&scope="+a.required_scope);Recite.Util.each(c,function(a,b){d+="&"+a+"="+b});return d}function f(b,c){var e=document.createElement("div");e.setAttribute("class","recite_auth_iframe_wrapper");e.style.top=parseInt(a.popup.top)+"px";e.style.left="50%";
e.style.marginLeft=-(parseInt(a.popup.width)/2)+"px";e.style.height=Recite.Dom.getWindowDimensions(window).height/1.5;e.style.width=a.popup.width;var h=document.createElement("iframe");h.src=b;h.frameborder=0;h.width=a.popup.width;h.style.border=0;h.height=Recite.Dom.getWindowDimensions(window).height/1.5;b=document.createElement("div");b.setAttribute("class","recite_auth_iframe_close recite-sprite-auth-close");b.setAttribute("data-recite-state",c);e.appendChild(b);e.appendChild(h);document.body.appendChild(e);
Recite.DomEvent.add(h,"load",function(){Recite.DomEvent.add(Recite.Sizzle(".recite_auth_iframe_close")[0],"click",function(a){a=a.target.getAttribute("data-recite-state");d[a].parentNode.removeChild(d[a]);delete d[a]})});return e}var b=!1,e={state:null,access_token:null,expires:null},a={authorization_endpoint:Recite.baseUrl+"/oauth/authorize",token_endpoint:Recite.baseUrl+"/oauth/token",client_id:"a698c90ce1ff2b99b56d006cc689b5fac1eeac9b",redirect_uri:Recite.baseUrl+"/oauth/callback/?uri="+Recite.Util.getWindowLocationOrigin(window),
required_scope:null,type:"iframe",popup:{status:"yes",toolbar:"no",location:"no",menubar:"no",directories:"no",resizable:"no",scrollbars:"no",width:850,height:600,top:"120"}},g=[],d=[],n=[],c=!1,h=[];Recite.XDM.receiveMessage(function(a){Recite.Debug.log("Recite.Auth","Message received:",a);a=ReciteJSON.parse(a.data);if(null!==a&&"undefined"!==typeof a.access_token&&-1!==Recite.Util.inArray(a.state,h)){h.splice(Recite.Util.inArray(a.state,h),1);var f=new Date;e.access_token=a.access_token;e.expires=
Math.ceil(f.getTime()/1E3)+parseInt(a.expires_in,10);e.state="authorized";Recite.Event.publish("Auth:authorize",e);b&&Recite.Event.publish("Auth:reauthorize",e);b=!0;Recite.Util.each(n,function(a,b){b(e)});n=[];c=!1;"undefined"!==typeof d[a.state]&&(f=d[a.state],f.parentNode.removeChild(f),delete d[a.state]);"undefined"!==typeof g[a.state]&&(g[a.state].close(),delete g[a.state])}},Recite.baseUrl);return{setOptions:function(b){a=Recite.Util.merge(a,b)},isAuthorized:function(){return"authorized"===
e.state},clear:function(){e.state=null;e.access_token=null;e.expires=null},getStatus:function(a,b){if(!b&&this.isAuthorized())a(e);else if(n.push(a),!c){c=!0;a=Recite.Util.guid();h.push(a);b=k("token",{createGuest:1,display:0,state:a});var l=document.createElement("iframe");l.id=a;l.src=b;l.frameborder=0;l.width=0;l.height=0;d[a]=l;Recite.Debug.log("Recite.Auth","Adding iframe to dom");document.body.appendChild(l)}},authPopup:function(){var b=Recite.Util.guid();h.push(b);var c=k("token",{state:b});
if("iframe"===a.type)d[b]=f(c,b);else{var e="";Recite.Util.each(a.popup,function(a,b){e+=a+"="+b+","});e=e.substr(0,e.length-1);e+=",left="+(Math.ceil(screen.width/2)-a.popup.width/2)+",top="+(Math.ceil(screen.height/2)-a.popup.height/2);g[b]=window.open(c,b,e)}}}}();Recite.namespace("Message");
Recite.Message=function(){var k={toolbarCloseHeader:null,toolbarCloseDialog:null,toolbarCloseOk:null,toolbarCloseCancel:null,leavingCloseHeader:null,leavingCloseDialog:null,leavingCloseOk:null,leavingCloseCancel:null};return{setOptions:function(f){k=Recite.Util.merge(k,f)},getOptions:function(){return k},init:function(){},getMessage:function(f,b){return k[f]?k[f]:b}}}();Recite.namespace("Storage");
Recite.Storage=function(){var k={};return{setOptions:function(f){k=Recite.Util.merge(k,f);Recite.Storage.Cookie.setOptions(f.Cookie);Recite.Storage.Api.setOptions(f.Api);Recite.Storage.LocalStorage.setOptions(f.LocalStorage)},getOptions:function(){return k},init:function(){}}}();Recite.namespace("Storage.Cookie");
Recite.Storage.Cookie=function(){function k(b,e,a){if(a){var g=new Date;g.setTime(g.getTime()+864E5*a);a="; expires="+g.toGMTString()}else a="";b=b+"="+encodeURIComponent(e)+a+"; path=/";f.cookiesDomain&&(b+="; domain="+f.cookiesDomain);f.secure&&(b+="; secure");document.cookie=b+"; samesite = strict"}var f={cookiesDomain:"",secure:!1};return{setOptions:function(b){f=Recite.Util.merge(f,b)},save:function(b,e,a){e=ReciteJSON.stringify(e);k(b,e,a)},load:function(b,e){a:{b+="=";for(var a=document.cookie.split(";"),
g=0;g<a.length;g++){for(var d=a[g];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(b)){b=decodeURIComponent(d.substring(b.length,d.length));break a}}b=null}b=ReciteJSON.parse(b);e&&e(b);return b},clear:function(b){k(b,"",-1)},supported:function(){return!0}}}();Recite.namespace("Storage.LocalStorage");
Recite.Storage.LocalStorage=function(){var k={};return{save:function(f,b){_supported()&&window.localStorage.setItem(f,b)},load:function(f,b){return _supported()?(f=window.localStorage.getItem(f),"undefined"!==typeof b&&b(f),f):null},clear:function(f){_supported()&&window.localStorage.removeItem(f)},supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(f){return!1}},setOptions:function(f){k=Recite.Util.merge(k,f)}}}();Recite.namespace("Storage.Api");
Recite.Storage.Api=function(){var k=["Recite.Preferences"],f={};return{save:function(b,e){if(!b in k)throw{name:"InvalidNamespace",message:"The provided namespace is invalid."};"Recite.Preferences"===b?Recite.Api.call("preferences","POST",{data:e,contentType:"application/json",success:function(a){Recite.Debug.log("Recite.Storage.Api","Preferences Saved.")}}):Recite.Storage.Cookie.save(b,e)},load:function(b,e){!b in k||("Recite.Preferences"===b?Recite.Api.call("preferences","GET",{success:e,error:e}):
Recite.Storage.Cookie.load(b,e))},clear:function(b){},supported:function(){return!0},setOptions:function(b){f=Recite.Util.merge(f,b)}}}();Recite.namespace("Preferences");
Recite.Preferences=function(){function k(a){Recite.Storage.Cookie.load("Recite.Preferences",function(e){null!=e&&(Recite.Debug.log("Recite.Preferences","Loading and merging cookie storage preferences"),b=a?Recite.Util.merge(e,b):e);Recite.Event.publish("Preferences:load",b)})}var f={storageEngine:Recite.Storage.Cookie,autoSave:!0},b={style:{backgroundColor:null,font:{color:null,face:null,size:null},link:{color:null},marginSize:null,textAlign:null,ruler:{enabled:!1,color:null},screenMask:{enabled:!1,
color:null},wwHighlight:{color:null},lineHeight:null,charSpacing:null},dictionary:{enabled:!1},player:{autoplay:!0,continuePlay:!1,playbackSpeed:1},textMode:{enabled:!1},playerControls:{enabled:!0},language:null,voice:{gender:"f"},magnifier:{enabled:!1},voices:{en:"Amy"}},e=Recite.Util.clone(b);Recite.Event.subscribe("Auth:reauthorize",function(){f.storageEngine===Recite.Storage.Api&&Recite.Preferences.load()});return{setOptions:function(a){var b=!1;Recite.Util.each(a,function(a,e){"storageEngine"===
a&&(b=!0)});f=Recite.Util.merge(f,a);b&&Recite.Preferences.load()},save:function(a){Recite.Debug.log("Recite.Preferences","Saving preferences.");f.storageEngine.save("Recite.Preferences",b);f.storageEngine!==Recite.Storage.Cookie&&Recite.Storage.Cookie.save("Recite.Preferences",b,365);Recite.Gui.Notification.show("Your preferences have been saved. To reset them press the reset button",{read:!1})},load:function(){Recite.Debug.log("Recite.Preferences","Loading preferences.");Recite.Debug.log("Recite.Preferences",
"Loading primary storage preferences");var a=Recite.Util.clone(e);f.storageEngine.load("Recite.Preferences",function(e){null===e||e.error?k():(Recite.Debug.log("Recite.Preferences","Found user preferences"),b=Recite.Util.merge(a,e),f.storageEngine!==Recite.Storage.Cookie?k(b):Recite.Event.publish("Preferences:load",b))})},get:function(a){if("undefined"===typeof a)return b;var e;a=a.split(".");var d=b;for(e=0;e<a.length;e++)if(d=d[a[e]],"undefined"===typeof d)return null;return d},set:function(a,e){var d=
{};"object"===Recite.Util.type(a)?d=a:d[a]=e;"player.autoplay"!=a&&"playerControls.enabled"!=a&&"player.continuePlay"!=a||Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Preferences",event:a+": "+e});Recite.Util.each(d,function(a,c){var d;a=a.split(".");var e=b;for(d=0;d<a.length-1;d++)if(e=e[a[d]],"undefined"===typeof e)return null;e[a[d]]=c});Recite.Event.publish("Preferences:set",d);f.autoSave&&Recite.Preferences.save();return null},reset:function(a){Recite.Debug.log("Recite.Preferences",
"Reset."+a);var g;var d=a.split(".");var n=b;var c=e;for(g=0;g<d.length-1;g++)n=n[d[g]],c=c[d[g]];var h=c[d[g]];"object"===Recite.Util.type(h)&&(h=Recite.Util.clone(h));n[d[g]]=h;Recite.Event.publish("Preferences:reset",{key:a,value:c});f.autoSave&&Recite.Preferences.save()},resetAll:function(){Recite.Debug.log("Recite.Preferences","ResetAll.");Recite.Event.publish("Preferences:reset");var a=f.autoSave;f.autoSave=!1;Recite.Util.each(e,function(a,b){Recite.Preferences.reset(a)});f.autoSave=a;f.autoSave&&
Recite.Preferences.save();Recite.Gui.Notification.show("Your preferences have been reset.");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Preferences",event:"resetAll"})}}}();Recite.namespace("UI.Toggle");
Recite.UI.Toggle=function(){function k(f){var b=f.ownerDocument?f.ownerDocument:document;f.setAttribute("class","recite-ui-toggle");b=b.createElement("div");b.setAttribute("class","recite-ui-toggle-slider");b.setAttribute("data-recite-tabbable","");f.appendChild(b);Object.defineProperty?Object.defineProperty(f,"checked",{get:function(){return this._checked},set:function(b){(this._checked=b)?this.setAttribute("class",this.getAttribute("class")+" recite-ui-toggle-active"):this.setAttribute("class",
this.getAttribute("class").replace(" recite-ui-toggle-active",""));this.fireEvent?this.fireEvent("onClick"):(b=document.createEvent("Event"),b.initEvent("change",!0,!0),this.dispatchEvent(b))}}):Recite.Debug.log("Recite.UI.Toggle","defineProperty not found");f.checked=!0}return{invoke:function(f,b){f=Recite.Util.isArray(f)?f:[f];Recite.Util.each(f,function(b,a){k(a);Recite.DomEvent.add(a.childNodes[0],"click",function(a){a=a.target.parentNode;a.checked=!a.checked})})}}}();Recite.namespace("UI.Dropdown");
Recite.UI.Dropdown=function(){function k(e,d,n){d=d||"default";"undefined"===typeof a[d]&&(a[d]=[]);var c=e.getAttribute("class")||"";e.setAttribute("class",c+" recite-active");f(e,n);a[d].push(e);"default"!==d&&Recite.Util.each(a[d],function(a,c){"undefined"!==typeof c&&c!==e&&b(c,d)});Recite.Event.publish("DropDown:menuShown",e)}function f(a,b){Recite.Dom.getWindowDimensions(window);var d=Recite.Sizzle(".recite-controls")[0];b=Recite.Dom.getPosition(b).left-d.scrollLeft-a.offsetWidth/2+20;0>b&&
(b=0);a.style.left=b+"px"}function b(b,d){if(1===b.nodeType||3===b.nodeType){var e=b.getAttribute("class")||"";for(b.setAttribute("class",e.replace(" recite-active",""));-1!==(e=Recite.Util.inArray(b,a[d]));)a[d].splice(e,1);d=Recite.Sizzle(".recite-dropdown-invoke, .recite-dropdown-invoke-active, .recite-dropdown-invoke .recite-button",document);Recite.Util.each(d,function(a,b){b.setAttribute("class",b.getAttribute("class").replace("-active",""))});Recite.Event.publish("DropDown:menuHidden",b)}}
function e(e){for(var d in a)for(var f in a[d])b(a[d][f],d)}var a={};Recite.Event.subscribe("Recite:Style:wrappedElements",function(){var a=Recite.Sizzle("#recite-wrapper")[0];Recite.DomEvent.add(a,"touchstart",e);Recite.DomEvent.add(a,"click",e)});return{loaded:function(){return!1},invoke:function(a,d){a=Recite.Util.isArray(a)?a:[a];Recite.Util.each(a,function(a,c){Recite.DomEvent.add(c,"click",function(a){var c=a.target,d=Recite.Sizzle(c.getAttribute("data-target"))[0],e=c.getAttribute("data-group")||
"default";"undefined"!==typeof d&&(Recite.DomEvent.add(d,"click",function(a){"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}),/recite-active/g.test(d.getAttribute("class"))?(b(d,e),c.setAttribute("class",c.getAttribute("class").replace("-active",""))):(k(d,e,c),c.setAttribute("class",c.getAttribute("class")+"-active")),"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0)})})},hideGroup:function(e){e=e||null;for(var d in a)null!==e&&e!==d||Recite.Util.each(a[d],
function(a,c){b(c)})}}}();Recite.namespace("UI.ColorPicker");
Recite.UI.ColorPicker=function(){function k(a){var b=a.clientY-(B+q.offsetTop);b=255<b?255:b;var c=Math.abs(360*(b-0)/255-360);x.style.top=b+"px";b=Recite.Tinycolor("hsl("+Math.ceil(c)+", 100%, 50%)");u.style.backgroundColor=b.toRgbString();b=p.getColor().toHsv();b.h=Math.ceil(c);p.setColor(b,a)}function f(a){var b=a.clientY-(B+u.offsetTop),c=a.clientX-(A+u.offsetLeft);b=252<b?252:b;c=252<c?252:c;b=3>b?3:b;c=3>c?3:c;var d=p.getColor().toHsv();d.v=Math.ceil(Math.abs(b-255)/255*100);d.s=Math.ceil(c/
255*100);p.setColor(d,a);r.style.top=b+D.selectorAdjust.top+"px";r.style.left=c+D.selectorAdjust.left+"px"}function b(){Recite.DomEvent.add(q,"mousedown",function(a){k(a)});Recite.DomEvent.add(q,"mouseup",function(a){k(a)});Recite.DomEvent.add(q,"mousemove",function(a){h&&k(a)})}function e(){Recite.DomEvent.add(u,"mousedown",function(a){f(a)});Recite.DomEvent.add(u,"mouseup",function(a){f(a)});Recite.DomEvent.add(u,"mousemove",function(a){h&&f(a)})}function a(){Recite.DomEvent.add(y,"click",function(){l.style.display=
"none"})}function g(a){x.style.top=Math.abs(a-360)/360*100+"%";a=Recite.Tinycolor("hsl("+Math.ceil(a)+", 100%, 50%)");u.style.backgroundColor=a.toRgbString()}function d(a){var b=parseInt(Recite.Dom.getStyle(u,"width"));r.style.left=Math.ceil(b/100*100*a)+D.selectorAdjust.left+"px"}function n(a){a=Math.abs(100*a-100);var b=parseInt(Recite.Dom.getStyle(u,"height"));r.style.top=Math.ceil(b/100*a)+D.selectorAdjust.top+"px"}function c(a){Recite.UI.ColorPicker.hide()}var h=!1,p=null,m=!1,l=null,q=null,
x=null,u=null,y=null,r=null,B=0,A=0,D={selectorAdjust:{left:-5,top:-5},markup:'<div id="recite-ui-colorpicker"> <div class="recite-colorbox-close">Close</div> <div class="recite-colorbox recite-sprite-colorpicker-mask"> <div class="recite-colorselector recite-sprite-colorpicker-selector"></div> </div> <div class="recite-huebox recite-sprite-colorpicker-hue"> <div class="recite-hueslider"></div> </div> </div>'};
return{setOptions:function(a){D=Recite.Util.merge(D,a)},init:function(){Recite.DomEvent.add(document.body,"mousedown",function(a){h=!0});Recite.DomEvent.add(document.body,"mouseup",function(a){h=!1});Recite.DomEvent.add(document.body,"click",c);Recite.Dom.append(D.markup,document.body);l=Recite.Sizzle("#recite-ui-colorpicker")[0];y=Recite.Sizzle(".recite-colorbox-close")[0];u=Recite.Sizzle(".recite-colorbox")[0];r=Recite.Sizzle(".recite-colorselector")[0];q=Recite.Sizzle(".recite-huebox")[0];x=Recite.Sizzle(".recite-hueslider")[0];
Recite.DomEvent.add(l,"click",function(a){"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0});m=!0;e();b();a()},invoke:function(a,b){b=b||{};a=Recite.Util.isArray(a)?a:[a];m||this.init();Recite.Util.each(a,function(a,c){a="INPUT"===c.tagName?"focus":"click";c.colorPicker={};c.setColor=function(a,b,c,e){var h=void 0==b||"mouseup"==b.type;if(h||!Recite.Tinycolor.equals(a,this.getColor()))c=!1===c?!1:!0,e=!1===e?!1:!0,a=Recite.Tinycolor(a),a.ok&&(this.colorPicker.color=a,"INPUT"===
this.tagName?c&&(this.value=this.colorPicker.color.toHexString()):this.innerText=this.colorPicker.color.toHexString(),"undefined"!==typeof this.colorPicker.callback&&(e||h)&&this.colorPicker.callback(p,a,b),p===this&&(b=this.colorPicker.color.toHsv(),g(b.h),d(b.s),n(b.v)))};c.getColor=function(){return this.colorPicker.color};var e=Recite.Tinycolor(c.style.backgroundColor);e.ok?c.setColor(e):c.setColor(Recite.Tinycolor("#000"));Recite.DomEvent.add(c,a,function(a){Recite.UI.ColorPicker.show();p=a.target;
var b=Recite.Dom.getPosition(p),c=Recite.Dom.getStyle(p,"width"),d=Recite.Sizzle("#recite-colors-advanced")[0];parseInt(Recite.Dom.getPosition(d).top);parseInt(Recite.Dom.getStyle(d,"height"));d=parseInt(Recite.Dom.getStyle(l,"height"));B=window.innerHeight/2-d/2;A=parseInt(b.left)+parseInt(c);l.style.top=B+"px";l.style.left=A+"px";Recite.UI.ColorPicker.invalidate();"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0});"undefined"!==typeof b.callback&&(c.colorPicker.callback=
b.callback);"INPUT"===c.tagName&&Recite.DomEvent.add(c,"keyup",function(a){this.setColor(a.target.value,a,!1,!0);"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0})})},show:function(){l.style.display="block"},hide:function(){l.style.display="none"},invalidate:function(){var a=p.colorPicker.color.toHsv();g(a.h);d(a.s);n(a.v)}}}();Recite.namespace("UI.AdvancedColors");
Recite.UI.AdvancedColors=function(){function k(a,b,c){var d=a.getAttribute("data-key"),e=b.toRgbString();f(a,b);a=Recite.Preferences.get(d);e==a||void 0==c||"mouseup"!=c.type&&"blur"!=c.type||(Recite.Debug.log("Recite.UI.AdvancedColors"," set "+d+" to "+e),Recite.Preferences.set(d,e))}function f(a,e){var c=null!=e?e.toRgbString():"transparent";a.parentNode.style.borderColor=c;b(a,c);a.value=null!=e?e.toHexString():""}function b(a,b){switch(a.getAttribute("data-key")){case "style.backgroundColor":a=
Recite.Sizzle("#advanced_colors_background,#advanced_colors_text,#advanced_colors_links");Recite.Util.each(a,function(a,d){d.style.backgroundColor=b});break;case "style.font.color":a=Recite.Sizzle("#advanced_colors_background,#advanced_colors_text,#advanced_colors_ruler,#advanced_colors_mask");Recite.Util.each(a,function(a,d){d.style.color=b});break;case "style.link.color":a=Recite.Sizzle("#advanced_colors_links");Recite.Util.each(a,function(a,d){d.style.color=b});break;case "style.screenMask.color":case "style.ruler.color":a.style.backgroundColor=
b}}function e(a,b){if(void 0===a||"style"==a||"Preferences:reset"==a&&void 0!=b&&"style"==b.key||"Preferences:set"==a||"Preferences:load"==a)Recite.Debug.log("AdvancedColors","Update Color Pickers"),Recite.Util.each(g,function(a,b){a=Recite.Preferences.get(a);void 0!=a&&"null"!=a&&""!=a.trim()?(a=Recite.Tinycolor(a),b.value!=a.toHexString()&&f(b,a)):f(b,null)})}var a={enabled:!0},g={};return{setOptions:function(b){Recite.Debug.log("UI.AdvancedColors",b);a=Recite.Util.merge(a,b)},invoke:function(b,
f){Recite.Debug.log("UI.AdvancedColors","invoke "+a.enabled);a.enabled?(b=Recite.Sizzle(b,f),Recite.Util.each(b,function(a,b){a=b.getAttribute("data-key");g[a]=b}),Recite.UI.ColorPicker.invoke(b,{callback:function(a,b,d){k(a,b,d)}}),Recite.Util.each(b,function(a,b){Recite.DomEvent.add(b,"blur",function(a){var c=Recite.Tinycolor(b.value);k(b,c,a)})}),Recite.Event.subscribe("Preferences:load",e),Recite.Event.subscribe("Preferences:reset",e),Recite.Event.subscribe("Preferences:set",e),Recite.Event.subscribe("DropDown:menuHidden",
function(a,b){Recite.UI.ColorPicker.hide()})):(b=Recite.Sizzle("#recite-themes-advanced")[0],b.parentNode.removeChild(b))}}}();Recite.namespace("Controls");
Recite.Controls=function(){function k(){Recite.Util.each(Recite.Sizzle(".recite-sprite-button-magnifier"),function(a,b){b.style.display="none"});Recite.Util.each(Recite.Sizzle(".recite-sprite-button-ruler"),function(a,b){b.style.display="none"});Recite.Util.each(Recite.Sizzle(".recite-sprite-button-mp3"),function(a,b){b.style.display="none"});Recite.Util.each(Recite.Sizzle(".recite-sprite-button-dictionary"),function(a,b){b.style.display="none"})}function f(a,b){Recite.Debug.log("Controls","Setting up custom user guide for lang: "+
a);Recite.Util.each(Recite.Sizzle(".recite-sprite-button-userguide"),function(a,c){c.setAttribute("href",b)})}function b(){var a=Recite.Dom.getLanguage(Recite.Sizzle("html")[0]);Recite.Util.each(d.languageOverrides.userGuide.languages,function(b,c){b.toLowerCase()==a.toLowerCase()?f(b,c.src):"undefined"!=typeof c.additionalLangs?Recite.Util.each(c.additionalLangs,function(b,d){d.toLowerCase()==a.toLowerCase()&&f(d,c.src)}):f(b,d.languageOverrides.userGuide["default"].src)})}function e(){var a=Recite.Dom.getLanguage(Recite.Sizzle("html")[0]);
Recite.Util.each(d.modules,function(b,c){null!==a&&"undefined"!=typeof c.localize&&c.localize(a)})}function a(a){d.enabled&&(0===d.modules.length&&(d.modules=[Recite.Controls.Desktop,Recite.Controls.Core]),Recite.Debug.log("Recite.Controls","Loading controls"),Recite.Debug.log("Recite.Controls","Getting controls content"),Recite.Ajax.get(d.url,null,function(b,c){d.enabled&&(Recite.Debug.log("Recite.Controls","Got controls content"),b=document.createElement("div"),b.innerHTML=c,n=b.childNodes[0],c=
Recite.Sizzle("body",a)[0],Recite.Dom.prepend(n,c),Recite.Browser.isMobile()&&k(),Recite.Util.each(d.modules,function(a,b){b.init();b.invoke(n)}),e(),Recite.Debug.log("Recite.Controls","Controls loaded"),g=!0,Recite.Event.publish("Controls:loaded"))}))}var g=!1,d={enabled:!0,url:Recite.baseUrl+"/assets/"+Recite.version+"/html/header.htm",modules:[],languageOverrides:{userGuide:{languages:{cy:{src:"http://reciteme.com/user-guides/welsh.pdf"},ar:{src:"https://api.reciteme.com/common/user_guide_ar.pdf",
additionalLangs:["ar-UAE","ar-AE"]}},"default":{src:"http://reciteme.com/user-guide"}}}};Recite.Event.subscribe("Translate:restore_complete",function(){e();b()});Recite.Event.subscribe("Translate:complete",function(){b()});Recite.Event.subscribe("Controls:loaded",function(){b()});var n=null;return{setOptions:function(a){Recite.Debug.log("Recite.Controls","Setting options");d=Recite.Util.merge(d,a);Recite.Controls.Mobile.setOptions(a.Mobile);Recite.Controls.Core.setOptions(a.Core);Recite.Controls.Desktop.setOptions(a.Desktop)},
load:function(b){window.self!=window.top?setTimeout(function(){a(b)},2E3):a(b)},disableOverlay:function(){var a=0;Recite.Magnifier.isEnabled()&&(a=1,Recite.Magnifier.disable());Recite.Ruler.isEnabled()&&(a=2,Recite.Ruler.disable());Recite.ScreenMask.isEnabled()&&(a=3,Recite.ScreenMask.disable());return a},reEnableOverlay:function(a){switch(a){case 1:Recite.Magnifier.enable();break;case 2:Recite.Ruler.enable();break;case 3:Recite.ScreenMask.enable()}},disableInstanceOverlay:function(){Recite.Magnifier.disableInstance();
Recite.Ruler.disableInstance();Recite.ScreenMask.disableInstance()},loaded:g,disable:function(){g&&Recite.Util.each(d.modules,function(a,b){"undefined"!=typeof b.disable&&b.disable()});d.enabled=!1}}}();Recite.namespace("Controls.Core");
Recite.Controls.Core=function(){function k(b,c){a();f()}function f(){Recite.Util.each(Recite.Sizzle(".recite-ui-toggle",document),function(a,b){a=b.getAttribute("data-preference");"undefined"!==Recite.Preferences.get(a)&&(Recite.Preferences.get(a)?b.setAttribute("class",b.getAttribute("class").replace("recite-ui-toggle-active","")+" recite-ui-toggle-active"):b.setAttribute("class",b.getAttribute("class").replace("recite-ui-toggle-active","")))});var a=Recite.Preferences.get("voice.gender");"undefined"!=
typeof a&&null!=a&&Recite.Util.each(Recite.Sizzle(".recite-voice",document),function(b,c){b=c.getAttribute("data-value");c.setAttribute("class",c.getAttribute("class").replace("active",""));-1!==b.indexOf(a)&&c.setAttribute("class",c.getAttribute("class")+" active")});var b=Recite.Preferences.get("player.playbackSpeed");b&&(Recite.Sizzle("#recite-playback-current-speed")[0].innerText=b)}function b(){Recite.Api.call("user","GET",{success:function(b){p.user=b;a()}})}function e(a){if("undefined"===typeof a)return p;
var b;a=a.split(".");var c=p;for(b=0;b<a.length;b++)if(c=c[a[b]],"undefined"===typeof c)return null;return c}function a(){Recite.Util.each(h,function(a,b){if("undefined"!==typeof b.text){a=b.text;var d;c.tagPattern.lastIndex=0;for(var h=a;null!==(d=c.tagPattern.exec(a));){var l=e(d[1])||"";h=h.replace(d[0],l)}b.node.nodeValue=h}"undefined"!==typeof b.attributes&&Recite.Util.each(b.attributes,function(a,d){c.tagPattern.lastIndex=0;for(var h=d.value;null!==(a=c.tagPattern.exec(d.value));){var l=e(a[1]);
"undefined"===typeof l&&(l=null);h=h.replace(a[0],l)}b.node.setAttribute(d.name,h)})})}function g(a,b){var e=b.target?b.target:b.srcElement;Recite.Debug.log("event",b);b=e.getAttribute("data-key").split(" ");a=e.getAttribute("data-value").split(" ");if(b.length!==a.length)Recite.Debug.log("Recite.Controls.Core","Warning: Number of \n keys does not match number of values.",e);else{e={};for(var h=0;h<b.length;h++){var l=b[h],f=("-"===a[h].charAt(0)?"-":"")+a[h].replace(/-/g," ");"toggle"===
f&&(f=!Recite.Preferences.get(l));if(/\+|\-/.test(f[0])){var r="+"===f[0],g=parseInt(f.replace(/[^0-9]/g,""),10),n=!1;if(r&&"0"==f[1]&&"."==f[2]||"0"==f[2]&&"."==f[3])n=!0,g/=10;var m=Recite.Preferences.get(l);m=null===m?d(l):m;f=r?m+g:m-g;n&&(f=Math.round(10*f)/10);n=l.replace("style.","").split(".");var p="";Recite.Util.each(n,function(a,b){p+=b.charAt(0).toUpperCase()+b.slice(1)});n=c.hasOwnProperty("max"+p+"Percentage")?c["max"+p+"Percentage"]:c.hasOwnProperty("max"+p)?c["max"+p]:c.defaultMax;
var k=c.hasOwnProperty("min"+p+"Percentage")?c["min"+p+"Percentage"]:c.hasOwnProperty("min"+p)?c["min"+p]:c.defaultMin;f>n&&(f=n);f<k&&(f=k);"style.font.size"==l&&(n=Recite.Preferences.get("style.zoom"),n=null===n?100:n,r=r?n+g:n-g,r>c.maxFontSizePercentage&&(r=c.maxFontSizePercentage),r<c.minFontSizePercentage&&(r=c.minFontSizePercentage),m>=c.zoomThreshold&&100<r?(e["style.font.size"]=c.zoomThreshold,l="style.zoom",f=r):100!=n&&(e["style.zoom"]=100));if(0===f.length||"null"===f)f=null}e[l]=f}Recite.Preferences.set(e)}}
function d(a){if("undefined"===typeof a)return 100;var b;a=a.split(".");var d=c.defaults;for(b=0;b<a.length;b++)if(d=d[a[b]],"undefined"===typeof d)return 100;return d}function n(a){var b=Recite.Sizzle(".recite-preference-set",a);Recite.DomEvent.add(b,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Event.publish("Controls:affect",a)});b=Recite.Sizzle(".recite-save",a);Recite.DomEvent.add(b,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Preferences.save()});
b=Recite.Sizzle(".recite-reset",a);Recite.DomEvent.add(b,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Preferences.resetAll()});b=Recite.Sizzle("#recite-toolbar-button-guide");Recite.DomEvent.add(b,"click",function(a){a.preventDefault&&(a.preventDefault?a.preventDefault():a.returnValue=!1);"undefined"!=typeof a.target&&window.open(a.target.getAttribute("href"))});Recite.DomEvent.add(Recite.Sizzle(".recite-language-set",a),"click",function(a){var b=(a.currentTarget?
a.currentTarget:a.srcElement).getAttribute("data-language");"default"===b?(Recite.Language.Translate.restore(),Recite.Preferences.set("language",null)):Recite.Preferences.set("language",b);Recite.Util.each(Recite.Sizzle(".recite-language-set"),function(a,c){c.getAttribute("data-language")===b?c.setAttribute("class",c.getAttribute("class")+" recite-active"):c.setAttribute("class",c.getAttribute("class").replace(" recite-active",""))})})}var c={tagPattern:/{{([A-Za-z._]+)}}/g,defaultMax:200,defaultMin:30,
maxFontSizePercentage:200,minFontSizePercentage:30,zoomThreshold:150,minLineHeight:50,maxLineHeight:300,minCharSpacing:0,maxCharSpacing:20,defaults:{style:{charSpacing:0}},minPlayerPlaybackSpeed:.5,maxPlayerPlaybackSpeed:2},h=[],p={links:{logout:Recite.baseUrl+"/user/logout"},preferences:null};return{setOptions:function(a){c=Recite.Util.merge(c,a)},init:function(){Recite.Debug.log("Recite.Controls.Core","Core controls invoked");Recite.Event.subscribe("Preferences:load",k);Recite.Event.subscribe("Preferences:set",
k);Recite.Event.subscribe("Preferences:reset",k);Recite.Event.subscribe("Auth:reauthorize",b);Recite.Event.subscribe("Controls:affect",g)},invoke:function(a){for(var d=a;null!==d;){if(3===d.nodeType&&0<d.nodeValue.trim().length){var f=d.nodeValue;if(c.tagPattern.test(f)){var g;c.tagPattern.lastIndex=0;for(var p=f;null!==(g=c.tagPattern.exec(f));){var k=e(g[1])||"";p=p.replace(g[0],k)}d.nodeValue=p;h.push({node:d,text:f})}}if(1===d.nodeType){var r=[];Recite.Util.each(d.attributes,function(a,b){a=b.value;
if(c.tagPattern.test(a)){var d;c.tagPattern.lastIndex=0;for(r.push({name:b.name,value:b.value});null!==(d=c.tagPattern.exec(a));)a=e(d[1]),"undefined"===typeof a&&(a=null),b.value=b.value.replace(d[0],a)}});0<r.length&&h.push({node:d,attributes:r})}if(d.hasChildNodes())d=d.firstChild;else{for(;null===d.nextSibling&&d!==a;)d=d.parentNode;d=d===a?null:d.nextSibling}}Recite.Util.each(Recite.Sizzle(".recite-ui-toggle",a),function(a,b){Recite.UI.Toggle.invoke(b);Recite.DomEvent.add(b,"click",function(a){a=
a.currentTarget?a.currentTarget:a.srcElement;Recite.Preferences.set(a.getAttribute("data-preference"),a.checked)})});Recite.Util.each(Recite.Sizzle(".recite-slider"),function(a,b){var c=b.getAttribute("data-type");Recite.UI.Slider.invoke(b,function(a){Recite.Event.publish("Slider:"+c,a)})});n(a);b()}}}();Recite.namespace("Controls.Desktop");
Recite.Controls.Desktop=function(){function k(a,b){if("play"===b||"stopped"===a.getAttribute("data-status")&&"undefined"===b)return a.setAttribute("class",a.getAttribute("class").replace("recite-sprite-button-play","recite-sprite-button-stop")),a.setAttribute("data-status","playing"),"playing";if("stop"===b||"playing"===a.getAttribute("data-status")&&"undefined"===b)return a.setAttribute("class",a.getAttribute("class").replace("recite-sprite-button-stop","recite-sprite-button-play")),a.setAttribute("data-status",
"stopped"),"stopped"}function f(){var a=Recite.Sizzle("[tabindex]");Recite.Util.each(a,function(a,b){a=parseInt(b.getAttribute("tabindex"));a>=c.tabIndexStartValue&&b.setAttribute("tabindex",a+200)})}function b(a){c.tabEnabled&&(null==n&&(n=c.tabIndexStartValue),a=Recite.Sizzle("[data-recite-tabbable]",a),Recite.Util.each(a,function(a,c){if("undefined"!=typeof c.getAttribute("data-tabbable-offset"))var d=parseInt(c.getAttribute("data-tabbable-offset"));null==c.getAttribute("tabindex")&&(a=n,isNaN(d)||
(a+=d),c.setAttribute("tabindex",a),n++,-1<(" "+c.className+" ").replace(/[\n\t]/g," ").indexOf(" recite-dropdown-invoke ")&&(d=Recite.Sizzle(c.getAttribute("data-target"))[0],b(d)),c.onfocus=function(a){var b="undefined"!=typeof a.target?a.target:a.srcElement;Recite.Util.each(Recite.Sizzle(".recite-dropdown-invoke-active"),function(a,b){a=Recite.Sizzle(b.getAttribute("data-target"))[0];Recite.Dom.isDescendant(document.activeElement,a)||b.click()});Recite.Util.each(Recite.Sizzle(".recite-dropdown"),
function(a,c){Recite.Dom.isDescendant(b,c)&&(a=Recite.Sizzle("[data-target='#"+c.getAttribute("id")+"']")[0],"undefined"!=a&&-1==(" "+a.className+" ").replace(/[\n\t]/g," ").indexOf(" recite-dropdown-invoke-active ")&&e(a))})})}))}function e(a){var b=parseInt(a.getAttribute("tabindex")),c=0;Recite.Util.each(Recite.Sizzle(".recite-button-primary"),function(a,d){a=parseInt(d.getAttribute("tabindex"));a>b&&(0==c||a<c)&&(c=a)});Recite.Sizzle("[tabindex="+c+"]")[0].focus()}function a(){Recite.Key("enter",
function(){if(null!=document.activeElement.getAttribute("data-recite-tabbable"))return document.activeElement.click(),!1});Recite.Key("space",function(){if(null!=document.activeElement.getAttribute("data-recite-tabbable"))return document.activeElement.click(),!1});Recite.Key("shift+tab",function(){var a=parseInt(document.activeElement.getAttribute("tabindex"))-1,b=Recite.Sizzle("[tabindex="+a+"]")[0],c=!1;Recite.Util.each(Recite.Sizzle(".recite-dropdown"),function(a,d){Recite.Dom.isDescendant(b,d)&&
(a=Recite.Sizzle("[data-target='#"+d.getAttribute("id")+"']")[0],-1==(" "+a.className+" ").replace(/[\n\t]/g," ").indexOf(" recite-dropdown-invoke-active ")&&(c=!0,a.focus()))});if(c)return!1})}function g(){0<c.disabledButtons.length&&Recite.Util.each(c.disabledButtons,function(a,b){d.hasOwnProperty(b)&&(a=d[b],a.hasOwnProperty("buttonClass")&&(b=Recite.Sizzle(a.buttonClass),Recite.Util.each(b,function(a,b){b.style.display="none"})),a.hasOwnProperty("module")&&Recite.hasOwnProperty(a.module)&&"function"==
typeof Recite[a.module].disable&&"function"==typeof Recite[a.module].isEnabled&&Recite[a.module].isEnabled()&&(Recite[a.module].disable(),Recite.Debug.log("Recite.Controls.Desktop","Disable button : "+a.module)))})}var d={previous:{buttonClass:".recite-sprite-button-back"},play:{buttonClass:".recite-sprite-button-play"},forward:{buttonClass:".recite-sprite-button-forward"},fontMinus:{buttonClass:".recite-sprite-button-font-minus"},font:{buttonClass:".recite-sprite-button-font"},fontPlus:{buttonClass:".recite-sprite-button-font-plus"},
themes:{buttonClass:".recite-sprite-button-themes"},ruler:{buttonClass:".recite-sprite-button-ruler",module:"Ruler",preferences:{"style.ruler.enabled":!1}},screenMask:{buttonClass:".recite-sprite-button-screenmask",module:"ScreenMask",preferences:{"style.screenMask.enabled":!1}},dictionary:{buttonClass:".recite-sprite-button-dictionary",module:"Dictionary"},translate:{buttonClass:".recite-sprite-button-translate"},textMode:{buttonClass:".recite-sprite-button-textmode"},margin:{buttonClass:".recite-sprite-button-margin"},
alignment:{buttonClass:".recite-sprite-button-alignment"},mp3:{buttonClass:".recite-sprite-button-mp3"},magnifier:{buttonClass:".recite-sprite-button-magnifier",module:"Magnifier",preferences:{"magnifier.enabled":!1}},settings:{buttonClass:".recite-sprite-button-settings"},reset:{buttonClass:".recite-sprite-button-reset"},guide:{buttonClass:".recite-sprite-button-userguide"}},n=null,c={promptBeforeLeave:!0,tabEnabled:!0,tabIndexStartValue:1,autoIncrementTabIndex:!0,disabledButtons:[],fonts:[{name:"Default",
font:"Default"},{name:"Arial",font:"Arial"},{name:"Verdana",font:"Verdana"},{name:"Comic-Sans-MS",font:"Comic Sans MS"},{name:"Georgia",font:"Georgia"},{name:"Tahoma",font:"Tahoma"},{name:"Lato",font:"Lato"},{name:"Trebuchet",font:"Trebuchet"},{name:"Open-Dyslexic",font:"Open Dyslexic"}],swatches:[{backgroundColor:"#000",color:"#fff",linkColor:"#FF0000",rulerColor:"#fff",maskColor:"#fff",section:"dark"},{backgroundColor:"#000",color:"#FCED20",linkColor:"#FF0000",rulerColor:"#FCED20",maskColor:"#FCED20",
section:"dark"},{backgroundColor:"#005B0E",color:"#fff",linkColor:"#FFE100",section:"dark"},{backgroundColor:"#0201FF",color:"#fff",linkColor:"#FFAB00",section:"dark"},{backgroundColor:"#C83400",color:"#FFF",linkColor:"#F5FF00",section:"dark"},{backgroundColor:"#0201FF",color:"#FFAB00",linkColor:"#fff",section:"dark"},{backgroundColor:"#343A3F",color:"#B8BCC0",linkColor:"#FCED20",section:"dark"},{backgroundColor:"#4D4D4D",color:"#FFF",linkColor:"#ffcb53",section:"dark"},{backgroundColor:"#932191",
color:"#FFF",linkColor:"#fff902",section:"dark"},{backgroundColor:"#7C1818",color:"#FFF",linkColor:"#00ff67",section:"dark"},{backgroundColor:"#F4EED9",color:"#1D1916",linkColor:"#000",rulerColor:"#1D1916",maskColor:"#1D1916",section:"light"},{backgroundColor:"#CACFD3",color:"#343A3F",linkColor:"#000",rulerColor:"#343A3F",maskColor:"#343A3F",section:"light"},{backgroundColor:"#FFE9BD",color:"#000000",linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},{backgroundColor:"#FCED20",color:"#000",
linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},{backgroundColor:"#FCED20",color:"#0201FF",linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},{backgroundColor:"#FFFFFF",color:"#C3272B",linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},{backgroundColor:"#FFFFFF",color:"#955200",linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},{backgroundColor:"#FFFFFF",color:"#007312",linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},
{backgroundColor:"#FFFFFF",color:"#0100FF",linkColor:"#000",rulerColor:"#000",maskColor:"#000",section:"light"},{backgroundColor:"#fff",color:"#000",linkColor:"#C00",rulerColor:"#000",maskColor:"#000",section:"light"}],pallettes:[{backgroundColor:"#FCED20",color:"#000",linkColor:"#C00",rulerColor:"#000",maskColor:"#000"},{backgroundColor:"#FCED20",color:"#000",linkColor:"#C00",rulerColor:"#000",maskColor:"#000"},{backgroundColor:"#FCED20",color:"#000",linkColor:"#C00",rulerColor:"#000",maskColor:"#000"}],
languages:{"default":{name:"Default",native_name:"Reset",audible:!1,flag:null},af:{name:"Afrikaans",native_name:"Afrikaans",audible:!1,flag:"sa"},sq:{name:"Albanian",native_name:"shqip",audible:!1,flag:"al"},am:{name:"Amharic",native_name:"\u12a3\u121b\u122d\u129b",audible:!1,flag:null},ar:{name:"Arabic",native_name:"\u0639\u0631\u0628\u064a",audible:!0,flag:"dz"},hy:{name:"Armenian",native_name:"\u0540\u0561\u0575\u0565\u0580\u0567\u0576",audible:!1,flag:null},az:{name:"Azerbaijani",native_name:"\u0622\u0630\u0631\u0628\u0627\u064a\u062c\u0627\u0646\u062c\u0627 \u062f\u064a\u0644\u064a",
audible:!1,flag:"az"},eu:{name:"Basque",native_name:"euskara",audible:!1,flag:null},bn:{name:"Bengali",native_name:"\u09ac\u09be\u0982\u09b2\u09be (ba\u025b\u1e45l\u0101)",audible:!1,flag:"bd"},be:{name:"Belarusian",native_name:"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f \u043c\u043e\u0432\u0430",audible:!1,flag:"by"},bs:{name:"Bosnian",native_name:"bosanski",audible:!1,flag:null},bg:{name:"Bulgarian",native_name:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 (b\u00e3lgarski)",
audible:!1,flag:"bg"},ca:{name:"Catalan",native_name:"catal\u00e0",audible:!1,flag:"ad"},ceb:{name:"Cebuano",native_name:"Sinugboanon",audible:!1,flag:null},ny:{name:"Chichewa",native_name:"Chiche\u0175a",audible:!1,flag:null},"zh-CN":{name:"Chinese Simplified",native_name:"\u4e2d\u56fd\u7b80\u5316",audible:!0,flag:"cn"},"zh-TW":{name:"Chinese Traditional",native_name:"\u4e2d\u570b\u50b3\u7d71",audible:!0,flag:"cn"},co:{name:"Corsican",native_name:"corsu",audible:!1,flag:null},hr:{name:"Croatian",
native_name:"Hrvatski",audible:!1,flag:"hr"},cs:{name:"Czech",native_name:"\u010de\u0161tina",audible:!0,flag:"cz"},da:{name:"Danish",native_name:"dansk",audible:!0,flag:"dk"},nl:{name:"Dutch",native_name:"Nederlands",audible:!0,flag:"nl"},en:{name:"English",native_name:"English",audible:!0,flag:"gb"},eo:{name:"Esperanto",native_name:"Esperanto",audible:!1,flag:null},et:{name:"Estonian",native_name:"eesti keel",audible:!1,flag:"ee"},tl:{name:"Filipino",native_name:"filipino",audible:!1,flag:"ph"},
fi:{name:"Finnish",native_name:"suomi",audible:!0,flag:"fi"},fr:{name:"French",native_name:"fran\u00e7ais",audible:!0,flag:"fr"},fy:{name:"Frisian (West)",native_name:"Frysk",audible:!1,flag:null},gl:{name:"Galician",native_name:"Galego",audible:!1,flag:"gl"},ka:{name:"Georgian",native_name:"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8 (k\u02bbart\u02bbuli)",audible:!1,flag:"ge"},de:{name:"German",native_name:"Deutsch",audible:!0,flag:"de"},el:{name:"Greek",native_name:"\u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac ",
audible:!0,flag:"gr"},gu:{name:"Gujarati",native_name:"\t\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0 ",audible:!1,flag:"gu"},ht:{name:"Haitian Creole",native_name:"Krey\u00f2l ayisyen",audible:!1,flag:"ht"},ha:{name:"Hausa",native_name:"\u062d\u064e\u0648\u0652\u0633",audible:!1,flag:null},haw:{name:"Hawaiian",native_name:"\u02bb\u014dlelo Hawai\u02bbi",audible:!1,flag:null},iw:{name:"Hebrew",native_name:"\u05e2\u05b4\u05d1\u05b0\u05e8\u05b4\u05d9\u05ea",audible:!1,flag:"il"},hi:{name:"Hindi",native_name:"\u0939\u093f\u0928\u094d\u0926\u0940",
audible:!0,flag:"in"},hmn:{name:"Hmong",native_name:"Hmong",audible:!1,flag:null},hu:{name:"Hungarian",native_name:"Hungarian Magyar",audible:!0,flag:"hu"},is:{name:"Icelandic",native_name:"\u00cdslenska",audible:!1,flag:"is"},ig:{name:"Igbo",native_name:"Igbo",audible:!1,flag:null},id:{name:"Indonesian",native_name:"Bahasa Indonesia",audible:!0,flag:"id"},ga:{name:"Irish (Gaelic)",native_name:"Gaeilge",audible:!0,flag:"ie"},it:{name:"Italian",native_name:"italiano",audible:!0,flag:"it"},ja:{name:"Japanese",
native_name:"\u65e5rus\u672c\u8a9e",audible:!0,flag:"jp"},jv:{name:"Javanese",native_name:"ba\u1e63a Jawa",audible:!1,flag:null},kn:{name:"Kannada",native_name:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 ",audible:!1,flag:"id"},kk:{name:"Kazakh",native_name:"\u049a\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456 ",audible:!1,flag:null},km:{name:"Khmer",native_name:"\t\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a ",audible:!1,flag:null},ko:{name:"Korean",native_name:"\ud55c\uad6d\uc5b4 ",audible:!0,
flag:"kr"},ku:{name:"Kurdish",native_name:"Kurmanji ",audible:!1,flag:null},ky:{name:"Kyrgyz",native_name:"\u0642\u0649\u0631\u0639\u0649\u0632 ",audible:!1,flag:null},lo:{name:"Lao",native_name:"\u0e9e\u0eb2\u0eaa\u0eb2\u0ea5\u0eb2\u0ea7 ",audible:!1,flag:null},la:{name:"Latin",native_name:"Lingua Latina",audible:!1,flag:"va"},lv:{name:"Latvian",native_name:"\tlatvie\u0161u valoda",audible:!1,flag:"lv"},lt:{name:"Lithuanian",native_name:"lietuvi\u0173 kalba",audible:!1,flag:"lt"},lb:{name:"Luxembourgish",
native_name:"L\u00ebtzebuergesch",audible:!1,flag:null},mk:{name:"Macedonian",native_name:"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438",audible:!1,flag:"mk"},mg:{name:"Malagasy",native_name:"Fiteny Malagasy",audible:!1,flag:null},ms:{name:"Malay",native_name:"Bahasa melayu",audible:!1,flag:"my"},ml:{name:"Malayalam",native_name:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02 ",audible:!1,flag:null},mt:{name:"Maltese",native_name:"Malti",audible:!1,flag:"mt"},mi:{name:"Maori",native_name:"\tte Reo M\u0101ori",
audible:!1,flag:null},mr:{name:"Marathi",native_name:"\u092e\u0930\u093e\u0920\u0940",audible:!1,flag:null},mn:{name:"Mongolian",native_name:"\u041c\u043e\u043d\u0433\u043e\u043b",audible:!1,flag:null},my:{name:"Myanmar (Burmese)",native_name:"\t\u1017\u1019\u102c\u1005\u1000\u102c\u1038 ",audible:!1,flag:null},ne:{name:"Nepali",native_name:"\u0928\u0947\u092a\u093e\u0932\u0940",audible:!1,flag:null},no:{name:"Norwegian",native_name:"norsk",audible:!0,flag:"no"},ps:{name:"Pashto",native_name:"\u067e\u069a\u062a\u0648",
audible:!1,flag:null},fa:{name:"Persian",native_name:"\u0641\u0627\u0631\u0633\u0649",audible:!1,flag:"ir"},pl:{name:"Polish",native_name:"polski",audible:!0,flag:"pl"},pt:{name:"Portuguese",native_name:"portugu\u00eas",audible:!0,flag:"pt"},pa:{name:"Punjabi",native_name:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40",audible:!1,flag:null},ro:{name:"Romanian",native_name:"rom\u00e2n\u0103",audible:!0,flag:"ro"},ru:{name:"Russian",native_name:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a ",
audible:!0,flag:"ru"},sm:{name:"Samoan",native_name:"Gagana Samoa",audible:!1,flag:null},gd:{name:"Scots Gaelic",native_name:"G\u00e0idhlig",audible:!0,flag:null},sr:{name:"Serbian",native_name:"\u0441\u0440\u043f\u0441\u043a\u0438",audible:!1,flag:"rs"},st:{name:"Sesotho",native_name:"seSotho",audible:!1,flag:null},sn:{name:"Shona",native_name:"chiShona",audible:!1,flag:null},sd:{name:"Sindhi",native_name:"\u0633\u0646\u068c\u064a",audible:!1,flag:null},si:{name:"Sinhala",native_name:"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd",
audible:!1,flag:null},sk:{name:"Slovak",native_name:"sloven\u010dina",audible:!0,flag:"sk"},sl:{name:"Slovenian",native_name:"sloven\u0161\u010dina",audible:!1,flag:"sk"},so:{name:"Somali",native_name:"af Soomaali",audible:!1,flag:null},es:{name:"Spanish",native_name:"espa\u00f1ol",audible:!0,flag:"es"},su:{name:"Sundanese",native_name:"Basa Sunda",audible:!1,flag:null},sw:{name:"Swahili",native_name:"Kiswahili",audible:!1,flag:"ke"},sv:{name:"Swedish",native_name:"svenska",audible:!0,flag:"se"},
ta:{name:"Tamil",native_name:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd ",audible:!0,flag:"in"},tg:{name:"Tajik",native_name:"\u0442\u043e\u04b7\u0438\u043a\u0438",audible:!1,flag:null},te:{name:"Telugu",native_name:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",audible:!1,flag:"in"},th:{name:"Thai",native_name:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22",audible:!1,flag:"th"},tr:{name:"Turkish",native_name:"T\u00fcrk\u00e7e",audible:!0,flag:"tr"},uk:{name:"Ukrainian",native_name:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",
audible:!1,flag:"ua"},ur:{name:"Urdu",native_name:"\u0627\u0631\u062f\u0648",audible:!0,flag:"pk"},uz:{name:"Uzbek",native_name:"\t\u0623\u06c7\u0632\u0628\u06d0\u0643 \ufe97\ufef4\ufee0\u06cc o'zbek tili \u045e\u0437\u0431\u0435\u043a \u0442\u0438\u043b\u0438",audible:!1,flag:null},vi:{name:"Vietnamese",native_name:"ti\u1ebfng vi\u1ec7t",audible:!1,flag:"vn"},cy:{name:"Welsh",native_name:"Cymraeg",audible:!0,flag:"wales"},yi:{name:"Yiddish",native_name:"\u05f2\u05b4\u05d3\u05d9\u05e9",audible:!1,
flag:"ua"},xh:{name:"Xhosa",native_name:"isiXhosa",audible:!1,flag:null},yo:{name:"Yoruba",native_name:"Yor\u00f9b\u00e1",audible:!1,flag:null},zu:{name:"Zulu",native_name:"isiZulu",audible:!1,flag:null}},margins:[{name:"Default",value:null,icon:null},{name:"Large",value:"5%",icon:"recite-sprite-margin-large"},{name:"Medium",value:"15%",icon:"recite-sprite-margin-medium"},{name:"Small",value:"30%",icon:"recite-sprite-margin-small"}],alignments:[{name:"Default",value:null,icon:null},{name:"Left aligned",
value:"left",icon:null},{name:"Right aligned",value:"right",icon:null},{name:"Centered",value:"center",icon:null},{name:"Justified",value:"justify",icon:null}],simplifiedControls:!0,showLogo:!0,customLogo:!1,customLogoLink:!1,customLogoTitle:!1,customCloseTitle:!1,repositionBackground:!0};Recite.Event.subscribe("Preferences:load",g);Recite.Event.subscribe("Preferences:set",g);Recite.Event.subscribe("Preferences:reset",g);Recite.Event.subscribe("Controls:loaded",function(){var a=document.getElementById("recite-toolbar-button-previous");
a&&a.focus()});return{setOptions:function(a){c=Recite.Util.merge(c,a)},getOptions:function(){return c},init:function(){},localize:function(a){Recite.Debug.log("Recite.Controls.Desktop","Localizing controls: "+a);Recite.Language.Translate.translate(Recite.Sizzle("#recite-header")[0],a)},applyTabOrder:function(){c.autoIncrementTabIndex&&f();b();a()},disable:function(){},invoke:function(a){var b=document.body;if(c.simplifiedControls){a.setAttribute("class",a.getAttribute("class")+" recite-controls-simplified");
var d=Recite.Sizzle(".recite-sprite-logo")[0],e=Recite.Sizzle("#recite-logo-header")[0];if(Recite.Browser.isMobile()){d.setAttribute("class","recite-sprite-logo-icon");e.setAttribute("class",e.getAttribute("class")+" recite-header-logo-icon");d=Recite.Sizzle(".recite-sprite-button-magnifier")[0];e=Recite.Sizzle(".recite-sprite-button-ruler")[0];var h=Recite.Sizzle(".recite-sprite-button-screenmask")[0];d.style.display="none";e.style.display="none";h.style.display="none"}else d.setAttribute("class",
"recite-sprite-logo-small")}g();var f=Recite.Dom.getStyle(a,"height");f=parseInt(f.replace("px",""),10);if("tooltip"===Recite.getOptions().selectionMethod)try{Recite.PlayerControls.getProvider().setTopProtection(f)}catch(z){}if(c.repositionBackground)if(d=Recite.Dom.getStyle(b,"background-position-y"),"0%"===d)b.setAttribute("style","background-position-y:"+f+" px !important");else if(d.match(/px/i)||"top"===d)d=d.replace("px",""),d=parseInt(d,10)+parseInt(f,10),b.setAttribute("style","background-position-y:"+
d+" px !important");b.style.setProperty?(b.style.setProperty("position","absolute","important"),b.style.setProperty("top",f+"px","important"),b.style.setProperty("width","100%","important")):(b.style.width="100%",b.style.position="absolute",b.style.top=f+"px");Recite.Util.each(Recite.Sizzle("*"),function(a,b){/recite/.test(b.getAttribute("id"))||/recite/.test(b.getAttribute("class"))||"fixed"!==Recite.Dom.getStyle(b,"position")||(a=b.offsetTop,a<f&&(b.style.top=f+a+"px"))});var n=Recite.Sizzle("#recite-fonts")[0];
Recite.Util.each(c.fonts,function(a,b){a=document.createElement("div");a.setAttribute("class","recite-font recite-preference-set recite-default-button recite-default-button-full recite-standard-border-radius");a.setAttribute("data-key","style.font.face");"Default"!==b?(a.setAttribute("data-value",b.name),a.style.fontFamily=b.font):a.setAttribute("data-value","null");a.innerText=b.name;a.textContent=b.name;a.setAttribute("data-recite-tabbable","");n.appendChild(a)});Recite.Sizzle("#recite-swatches");
var y=Recite.Sizzle("#recite-swatches-dark")[0],r=Recite.Sizzle("#recite-swatches-light")[0];Recite.Util.each(c.swatches,function(a,b){a=document.createElement("div");a.setAttribute("class","recite-swatch recite-preference-set recite-standard-border-radius");a.setAttribute("data-recite-translate-skip","true");null===b.backgroundColor&&null===b.color&&null===b.linkColor?(a.setAttribute("class",a.getAttribute("class")+" recite-swatch-default"),a.textContent="Default",a.innerText="Default"):(a.textContent=
"A",a.innerText="A");var c="style.backgroundColor style.font.color style.link.color",d=b.backgroundColor+" "+b.color+" "+b.linkColor;b.hasOwnProperty("rulerColor")&&(c+=" style.ruler.color",d+=" "+b.rulerColor);b.hasOwnProperty("maskColor")&&(c+=" style.screenMask.color",d+=" "+b.maskColor);b.hasOwnProperty("highlightColor")&&(c+=" style.wwHighlight.color",d+=" "+b.highlightColor);a.setAttribute("data-key",c);a.setAttribute("data-value",d);a.setAttribute("data-recite-tabbable","");a.style.color=b.color;
a.style.backgroundColor=b.backgroundColor;"dark"==b.section&&y.appendChild(a);"light"==b.section&&r.appendChild(a)});var B=Recite.Sizzle("#recite-languages")[0];Recite.Util.each(c.languages,function(a,b){var c=document.createElement("li"),d=document.createElement("div"),e=document.createElement("div");b.audible&&(e.setAttribute("class","recite_language_audible recite-sprite-audible "),c.appendChild(e));e=document.createElement("div");e.appendChild(document.createTextNode(b.name));e.setAttribute("class",
"recite_language_main_name_str");c.appendChild(e);"undefined"!=typeof b.native_name&&(d.setAttribute("class","recite_language_native_name_str"),d.setAttribute("data-recite-translate-skip","false"),d.appendChild(document.createTextNode(b.native_name)),c.appendChild(d));c.setAttribute("class","recite-language-set recite-default-button recite-default-button-full recite-standard-border-radius");c.setAttribute("data-language",a);c.setAttribute("data-recite-tabbable","");c.setAttribute("data-recite-translate-skip",
"false");B.appendChild(c)});var A=Recite.Sizzle("#recite-margins")[0];Recite.Util.each(c.margins,function(a,b){a=document.createElement("div");a.setAttribute("class","recite-margin recite-preference-set");a.setAttribute("data-key","style.marginSize");a.setAttribute("data-value",b.value);var c=b.icon||null;if(null!==c){var d=document.createElement("div");d.setAttribute("class",c);d.style.margin="0 auto";d.setAttribute("data-key","style.marginSize");d.setAttribute("data-value",b.value);a.appendChild(d)}else a.textContent=
b.name,a.innerText=b.name;A.appendChild(a)});var D=Recite.Sizzle(".recite-sprite-button-margin")[0];D.style.display="none";Recite.Event.subscribe("TextMode:enabled",function(a,b){D.style.display="block"});Recite.Event.subscribe("TextMode:disabled",function(a,b){D.style.display="none"});var w=Recite.Sizzle("#recite-alignments")[0];Recite.Util.each(c.alignments,function(a,b){a=document.createElement("div");a.setAttribute("class","recite-alignment recite-preference-set");a.setAttribute("data-key","style.textAlign");
a.setAttribute("data-value",b.value);var c=b.icon||null;if(null!==c){var d=document.createElement("div");d.setAttribute("class",c);d.style.margin="0 auto";d.setAttribute("data-key","style.text-align");d.setAttribute("data-value",b.value);a.appendChild(d)}else a.textContent=b.name,a.innerText=b.name;w.appendChild(a)});var v=Recite.Sizzle(".recite-sprite-button-alignment")[0];v&&(v.style.display="none",Recite.Event.subscribe("TextMode:enabled",function(a,b){v.style.display="block"}),Recite.Event.subscribe("TextMode:disabled",
function(a,b){v.style.display="none"}));b=Recite.Sizzle(".recite-button",a);Recite.UI.Dropdown.invoke(b);Recite.Debug.log("Recite.Desktop","launch advanced");Recite.UI.AdvancedColors.invoke(".recite-colorpicker",a);var C=Recite.Sizzle(".recite-sprite-button-play")[0];Recite.DomEvent.add(C,"click",function(a){"stopped"===C.getAttribute("data-status")?Recite.PlayerControls.play():Recite.PlayerControls.stop()});Recite.Event.subscribe("Audio:ended",function(a,b){k(C,"stop")});Recite.Event.subscribe("Audio:started",
function(a,b){k(C,"play")});c.showLogo&&Recite.getOptions("showBrand")||(a=Recite.Sizzle(".recite-logo")[0],a.innerHTML="",a.setAttribute("class","custom-logo"));0!=c.customLogo&&(a=Recite.Sizzle(".recite-logo")[0],a.setAttribute("class","custom-logo"),a.innerHTML='<img src="'+c.customLogo+'" />',0!=c.customLogoLink&&(a.href=c.customLogoLink),0!=c.customLogoTitle&&(a.title=c.customLogoTitle));0!=c.customCloseTitle&&(a=Recite.Sizzle("a.recite-close"),Recite.Util.each(a,function(a,b){b.title=c.customCloseTitle}));
!1===Recite.AudioDownload.getOptions().enabled&&(a=Recite.Sizzle(".recite-sprite-button-mp3")[0],a.outerHTML="");a=Recite.Sizzle(".recite-close");Recite.getOptions("showBrand")||Recite.Util.each(a,function(a,b){b.setAttribute("title","Close Accessibility Toolbar")});Recite.DomEvent.add(a,"click",function(a){a.preventDefault()});a=Recite.Sizzle(".recite-version");Recite.DomEvent.add(a,"click",function(a){Recite.Util.each(Recite.Sizzle(".recite-auth"),function(a,b){b.style.display="block"})});Recite.DomEvent.add(Recite.Sizzle("#recite-logo-header"),
"click",function(a){if(c.promptBeforeLeave){a.preventDefault();var b=Recite.Controls.disableOverlay();Recite.Gui.Modal.show(Recite.Message.getMessage("leavingCloseHeader","Leaving Website"),Recite.Message.getMessage("leavingCloseDialog","You are about to leave this website to go to http://www.reciteme.com. Click OK or hit <em>enter</em> key to continue. Press esc key or hit <em>cancel</em> to stay on this page."),Recite.Message.getMessage("leavingCloseOk","OK"),Recite.Message.getMessage("leavingCloseCancel",
"Cancel"),function(){window.open(Recite.Sizzle("#recite-logo-header")[0].getAttribute("href"),"_blank")},function(){Recite.Gui.Notification.show("Close operation canceled");Recite.Controls.reEnableOverlay(b)})}})}}}();Recite.namespace("Controls.Mobile");
Recite.Controls.Mobile=function(){function k(b,e){if("play"===e||"stopped"===b.getAttribute("data-status")&&"undefined"===e)return b.setAttribute("class",b.getAttribute("class").replace("recite-sprite-button-top-play-mobile","recite-sprite-button-top-stop-mobile")),b.setAttribute("data-status","playing"),"playing";if("stop"===e||"playing"===b.getAttribute("data-status")&&"undefined"===e)return b.setAttribute("class",b.getAttribute("class").replace("recite-sprite-button-top-stop-mobile","recite-sprite-button-top-play-mobile")),
b.setAttribute("data-status","stopped"),"stopped"}var f={fonts:"Default Arial Verdana Georgia Tahoma Trebuchet Tiresias".split(" "),swatches:[{backgroundColor:null,color:null,linkColor:null},{backgroundColor:"#000",color:"#fff",linkColor:"#C00"},{backgroundColor:"#C3272A",color:"#FFF",linkColor:"#00C"},{backgroundColor:"#F05924",color:"#FFF",linkColor:"#00C"},{backgroundColor:"#37B64B",color:"#fff",linkColor:"#2fc2ef"},{backgroundColor:"#0201FF",color:"#fff",linkColor:"#9c0001"},{backgroundColor:"#0000FE",
color:"#FCED20",linkColor:"#2fc2ef"},{backgroundColor:"#FCED20",color:"#0000FE",linkColor:"#2fc2ef"},{backgroundColor:"#fff",color:"#C3272A",linkColor:"#2fc2ef"},{backgroundColor:"#fff",color:"#F05924",linkColor:"#2fc2ef"},{backgroundColor:"#fff",color:"#37B64B",linkColor:"#C00"},{backgroundColor:"#fff",color:"#0201FF",linkColor:"#C00"},{backgroundColor:"#1DFF16",color:"#F4EED9",linkColor:"#C00"},{backgroundColor:"#CACFD3",color:"#343A3F",linkColor:"#C00"},{backgroundColor:"#F4EED9",color:"#1D1916",
linkColor:"#C00"},{backgroundColor:"#343A3F",color:"#CACFD3",linkColor:"#C00"},{backgroundColor:"#fff",color:"#000",linkColor:"#C00"}],languages:{"default":{name:"Default",flag:null},af:{name:"Afrikaans",flag:"sa"},sq:{name:"Albanian",flag:"al"},ar:{name:"Arabic",flag:"dz"},az:{name:"Azerbaijani",flag:"az"},eu:{name:"Basque",flag:null},bn:{name:"Bengali",flag:"bd"},be:{name:"Belarusian",flag:"by"},bg:{name:"Bulgarian",flag:"bg"},ca:{name:"Catalan",flag:"ad"},"zh-CN":{name:"Chinese Simplified",flag:"cn"},
"zh-TW":{name:"Chinese Traditional",flag:"cn"},hr:{name:"Croatian",flag:"hr"},cs:{name:"Czech",flag:"cz"},da:{name:"Danish",flag:"dk"},nl:{name:"Dutch",flag:"nl"},en:{name:"English",flag:"gb"},eo:{name:"Esperanto",flag:null},et:{name:"Estonian",flag:"ee"},tl:{name:"Filipino",flag:"ph"},fi:{name:"Finnish",flag:"fi"},fr:{name:"French",flag:"fr"},gl:{name:"Galician",flag:"gl"},ka:{name:"Georgian",flag:"ge"},de:{name:"German",flag:"de"},el:{name:"Greek",flag:"gr"},gu:{name:"Gujarati",flag:"gu"},ht:{name:"Haitian Creole",
flag:"ht"},iw:{name:"Hebrew",flag:"il"},hi:{name:"Hindi",flag:"in"},hu:{name:"Hungarian",flag:"hu"},is:{name:"Icelandic",flag:"is"},id:{name:"Indonesian",flag:"id"},ga:{name:"Irish",flag:"ie"},it:{name:"Italian",flag:"it"},ja:{name:"Japanese",flag:"jp"},kn:{name:"Kannada",flag:"id"},ko:{name:"Korean",flag:"kr"},la:{name:"Latin",flag:"va"},lv:{name:"Latvian",flag:"lv"},lt:{name:"Lithuanian",flag:"lt"},mk:{name:"Macedonian",flag:"mk"},ms:{name:"Malay",flag:"my"},mt:{name:"Maltese",flag:"mt"},no:{name:"Norwegian",
flag:"no"},fa:{name:"Persian",flag:"ir"},pl:{name:"Polish",flag:"pl"},pt:{name:"Portuguese",flag:"pt"},ro:{name:"Romanian",flag:"ro"},ru:{name:"Russian",flag:"ru"},sr:{name:"Serbian",flag:"rs"},sk:{name:"Slovak",flag:"sk"},sl:{name:"Slovenian",flag:"sk"},es:{name:"Spanish",flag:"es"},sw:{name:"Swahili",flag:"ke"},sv:{name:"Swedish",flag:"se"},ta:{name:"Tamil",flag:"in"},te:{name:"Telugu",flag:"in"},th:{name:"Thai",flag:"th"},tr:{name:"Turkish",flag:"tr"},uk:{name:"Ukrainian",flag:"ua"},ur:{name:"Urdu",
flag:"pk"},vi:{name:"Vietnamese",flag:"vn"},cy:{name:"Welsh",flag:"wales"},yi:{name:"Yiddish",flag:"ua"}}};return{setOptions:function(b){Recite.Debug.log("Recite.Controls.Mobile","Setting options");f=Recite.Util.merge(f,b)},init:function(){},localize:function(b){Recite.Debug.log("Recite.Controls.Desktop","Localizing controls: "+b)},invoke:function(b){var e=document.body,a=Recite.Dom.getStyle(b,"height");a=parseInt(a.replace("px",""),10)+10;e.style.position="absolute";e.style.paddingBottom=a+"px";
e.style.top=a+"px";e.style.width="100%";var g=Recite.Sizzle("#recite-fonts-list")[0];Recite.Util.each(f.fonts,function(a,b){a=document.createElement("li");var c=document.createTextNode(b);a.setAttribute("class","recite-font recite-preference-set");a.setAttribute("data-key","style.font.face");a.setAttribute("data-value",b);a.style.fontFamily=b;a.appendChild(c);g.appendChild(a)});var d=Recite.Sizzle("#recite-languages")[0];Recite.Util.each(f.languages,function(a,b){var c=document.createElement("li");
b=document.createTextNode(b.name);c.setAttribute("class","recite-language-set");c.setAttribute("data-language",a);c.appendChild(b);d.appendChild(c)});var n=Recite.Sizzle("#recite-swatches")[0];Recite.Util.each(f.swatches,function(a,b){a=document.createElement("div");a.setAttribute("class","recite-swatch recite-preference-set");null===b.backgroundColor&&null===b.color&&null===b.linkColor?(a.setAttribute("class",a.getAttribute("class")+" recite-swatch-default"),a.textContent="/",a.innerText="/"):(a.textContent=
"A",a.innerText="A");a.setAttribute("data-key","style.backgroundColor style.font.color style.link.color");a.setAttribute("data-value",b.backgroundColor+" "+b.color+" "+b.linkColor);a.style.setProperty("color",b.color,"important");a.style.backgroundColor=b.backgroundColor;n.appendChild(a)});b=Recite.Sizzle(".recite-dropdown-invoke",b);Recite.UI.Dropdown.invoke(b);b=Recite.Sizzle(".recite-language-set");Recite.DomEvent.add(b,"click",function(a){Recite.UI.Dropdown.hideGroup("main")});b=Recite.Sizzle(".recite-sprite-button-share-mobile")[0];
Recite.DomEvent.add(b,"click",function(a){ReciteAndroidInterface.sharePage(document.URL)});b=Recite.Sizzle(".recite-sprite-button-favourite-mobile")[0];Recite.DomEvent.add(b,"click",function(a){ReciteAndroidInterface.addToFavourites(document.URL)});var c=Recite.Sizzle(".recite-sprite-button-top-play-mobile")[0];Recite.DomEvent.add(c,"click",function(a){"stopped"===c.getAttribute("data-status")?Recite.PlayerControls.play():Recite.PlayerControls.stop()});Recite.Event.subscribe("Audio:ended",function(a,
b){k(c,"stop")});Recite.Event.subscribe("Audio:started",function(a,b){k(c,"play")})}}}();Recite.namespace("Recite.Parser.Html");
Recite.Parser.Html=function(){function k(a){!1!==g.bubbleEvents&&(a=Recite.Sizzle(".recite-ele"),Recite.DomEvent.add(a,"click",function(a){a.target.parentNode.click()}))}function f(a){var c=null;if(0<a.length){var d=0,e=!1;Recite.Util.each(a,function(a,b){d+=Recite.Dom.getText(b).trim().length;if("IMG"==b.nodeName||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName)e=!0,b.setAttribute(g.elementAttribute,"true"),c=b});if(d>=g.minCharacters&&!e){var f=!1;Recite.Util.each(Recite.Dom.getAncestors(a[0]),function(b,
d){/ui-datepicker/g.test(d.getAttribute("class"))&&3===a[0].nodeType&&(f=!0,c=a[0].parentNode,(b=a[0].parentNode.getAttribute("class"))&&(b=b.replace(" recite-ele","")),a[0].parentNode.setAttribute("class",b+" recite-ele"))});if(!f){c=b(a[0].ownerDocument);a[0].parentNode.insertBefore(c,a[0]);for(var l=0;l<a.length;l++){var n=a[l].parentNode.removeChild(a[l]);c.appendChild(n)}}}}return c}function b(a){a=a.createElement(g.wrapTag);a.className="recite-ele recite-ele-style";a.style.display="inline";
if(g.debug.highlightElements){var b=Math.floor(256*Math.random()),d=Math.floor(256*Math.random()),e=Math.floor(256*Math.random());try{a.style.backgroundColor="rgba("+b+","+d+","+e+",0.4)"}catch(m){a.style.backgroundColor="rgb("+b+","+d+","+e+")"}}return a}function e(a){var b=[],d=[];Recite.Util.each(g.concatenateElementExceptions,function(a,c){b.push(c.toLowerCase())});Recite.Util.each(g.concatenateTypes,function(a,b){d.push(b.toLowerCase())});Recite.Util.each(g.skipConcatenation.elementTypes,function(a,
c){b.push(c.toLowerCase())});var e=0<=Recite.Util.inArray(Recite.Dom.getStyle(a,"display"),d),f=0<=Recite.Util.inArray(a.tagName.toLowerCase(),b),l=!1;Recite.Util.each(g.skipConcatenation.selectors,function(b,c){b=Recite.Sizzle(c);Recite.Util.each(b,function(b,c){c==a&&(l=!0)})});return e&&!f&&!l}function a(b,c,f){"undefined"===typeof f&&(f=[[]]);var h=!1,n=!1;if(1===b.nodeType&&/recite-ele/g.test(b.getAttribute("class")))return f;if(b){b.shadowRoot&&1==Recite.getOptions("shadowDomSupport")&&(a(b.shadowRoot,
1,f),b.setAttribute("data-recite-shadow","true"));if(1===b.nodeType&&(0<=Recite.Util.inArray(b.tagName,g.skipElements)||"true"===b.getAttribute("data-recite-skip"))||1===b.nodeType&&0<d.length&&"BR"===b.tagName&&"BR"===d[d.length-1].tagName)return f;3===b.nodeType&&Recite.Dom.getText(b).replace(/^\s*/,"").replace(/\s*$/,"");if(1===b.nodeType){var l;if(l=e(b)){a:{if(1===b.nodeType){l=b.getElementsByTagName("*");for(var k=0;k<l.length;k++)if("block"===Recite.Dom.getStyle(l[k],"display")){l=!0;break a}}l=
!1}l=!l}if(l||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName&&"true"!==b.getAttribute("data-recite-skip"))h=!0}else 3===b.nodeType&&(h=!0);!0===h&&(d[d.length-1]!==b.previousSibling&&(f.push(d),d=[]),d.push(b),n=!0);h=0;l=b.childNodes[h];if(!n)for(;l;)a(l,c+1,f),h++,l=b.childNodes[h]}return f}var g={maxCharacters:1E3,minCharacters:1,wrapTag:"recite",elementAttribute:"data-recite-ele",concatenateTypes:["inline","inline-block"],skipConcatenation:{elementTypes:["li","img","label"],selectors:[]},skipElements:"SCRIPT STYLE SELECT OPTION FRAMESET FRAME IFRAME NOSCRIPT".split(" "),
parseImgAltAttribute:!0,bubbleEvents:!1,bubbleStyles:!0,debug:{highlightElements:!1},concatenateElementExceptions:["li"]},d=[];return{setOptions:function(a){Recite.Debug.log("Recite.Parser.Html","Setting options");g=Recite.Util.merge(g,a)},parse:function(b){var c=new Date,e=a(b,1);b=Recite.Sizzle("img");Recite.Util.each(b,function(a,b){"true"!==b.getAttribute("data-recite-skip")&&e.push([b])});0<d.length&&e.push(d);0===e[e.length-1].length&&e.pop();var g=[];Recite.Util.each(e,function(a,b){0!==b.length&&
(a=f(b),null!==a&&g.push(a))});Recite.Debug.log("Recite.Parser.Html","Parsed "+g.length+" elements in: "+((new Date).getTime()-c.getTime())+"ms");k(g);Recite.Event.publish("Recite.Parser:parsed");c=document.getElementsByTagName("*");b=0;for(var n=c.length;b<n;b++)Recite.Style.getOptions().preserve_background_images&&""!=c[b].style.backgroundImage&&c[b].setAttribute("class",c[b].getAttribute("class")+" recite-ignore-styles-background ");return g},wrapElements:function(a){Recite.Util.each(a,function(a,
b){f(b)})}}}();Recite.namespace("Recite.Parser.Selector");
Recite.Parser.Selector=function(){var k={maxCharacters:1E3,minCharacters:1,selector:".recite"};return{setOptions:function(f){Recite.Debug.log("Recite.Parser.Selector","Setting options");k=Recite.Util.merge(k,f)},parse:function(f){Recite.Debug.log("Recite.Parser.Selector","Parser invoked on element:",f);var b=Recite.Sizzle(k.selector,f);Recite.Util.each(b,function(e,a){a=Recite.Dom.getText(a);(a.length<k.minCharacters||a.length>k.maxCharacters)&&b.splice(e)});return b}}}();Recite.namespace("PlayerControls");
Recite.PlayerControls=function(){function k(){null===b.provider?b.enableMobileControls&&Recite.Browser.isMobile()?b.provider=Recite.PlayerControls.Fixed:b.provider=Recite.PlayerControls.Tooltip:"none"===b.provider?b.provider=Recite.PlayerControls.NoGUI:"disable"===b.provider&&(b.provider=null);null!=b.provider&&b.provider.init&&b.provider.init()}function f(){Recite.Preferences.get("playerControls.enabled")?Recite.PlayerControls.enable():Recite.PlayerControls.disable()}var b={provider:null,enableMobileControls:!0,
minSkipTime:300},e=null;Recite.Event.subscribe("Recite.Dom.Observor:change",function(a,b){void 0!=b&&b.hasOwnProperty("affectedElements")&&Recite.PlayerControls.invoke(b.affectedElements)});Recite.Event.subscribe("Recite:load",k);Recite.Event.subscribe("Preferences:load",f);Recite.Event.subscribe("Preferences:set",f);Recite.Event.subscribe("Preferences:reset",f);return{init:k,setOptions:function(a){a.provider&&b.provider&&b.provider.destroy();b=Recite.Util.merge(b,a);Recite.PlayerControls.Tooltip.setOptions(a.Tooltip);
Recite.PlayerControls.Fixed.setOptions(a.Fixed);Recite.PlayerControls.NoGUI.setOptions(a.NoGUI);a.provider&&a.provider.init&&b.provider.init()},invoke:function(a){null!=b.provider&&b.provider.invoke(a)},enable:function(){null!=b.provider&&b.provider.enable()},disable:function(){null!=b.provider&&b.provider.disable()},hide:function(){null!=b.provider&&b.provider.hide()},invalidate:function(){null!=b.provider&&b.provider.invalidate()},getControls:function(){return null!=b.provider?b.provider.getControls():
null},getProvider:function(){return b.provider},play:function(){Recite.Debug.log("Recite.PlayerControls PLAY",document.activeElement);return null!=b.provider?document.activeElement!==document.body?b.provider.play(document.activeElement):b.provider.play():null},stop:function(){return null!=b.provider?b.provider.stop():null},next:function(a){var f=Math.floor(Date.now());window.clearTimeout(null);if(null==e||f-e>b.minSkipTime)return Recite.Debug.log("Recite.PlayerControls","next"),Recite.FrameUpdater.isActive()&&
Recite.FrameUpdater.hasActiveChildFrame()?(Recite.FrameUpdater.activeFramePlayNext(),null):null!=b.provider?(a=b.provider.next(a),e=f,a):null;Recite.Debug.log("Recite.PlayerControls","Skipping too fast, halting")},previous:function(a){var f=Math.floor(Date.now());window.clearTimeout(null);if(null==e||f-e>b.minSkipTime)return Recite.Debug.log("Recite.PlayerControls","prev"),Recite.FrameUpdater.isActive()&&Recite.FrameUpdater.hasActiveChildFrame()?(Recite.FrameUpdater.activeFramePlayPrev(),null):null!=
b.provider?(a=b.provider.previous(a),e=f,a):null;Recite.Debug.log("Recite.PlayerControls","Skipping too fast, halting")},first:function(){var a=Math.floor(Date.now());window.clearTimeout(null);if(null==e||a-e>b.minSkipTime)return e=a,Recite.Debug.log("Recite.PlayerControls","first"),null!=b.provider?b.provider.first():null;Recite.Debug.log("Recite.PlayerControls","Skipping too fast, halting")},last:function(){var a=Math.floor(Date.now());window.clearTimeout(null);if(null==e||a-e>b.minSkipTime)return e=
a,Recite.Debug.log("Recite.PlayerControls","last"),null!=b.provider?b.provider.last():null;Recite.Debug.log("Recite.PlayerControls","Skipping too fast, halting")}}}();Recite.namespace("PlayerControls.Tooltip");
Recite.PlayerControls.Tooltip=function(){function k(a){Recite.Util.each(m,function(b,c){Recite.Dom.isDescendant(a.target,c)||a.target===c||Recite.Dom.isDescendant(a.target,l)||a.target===l||Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0])||g(c)})}function f(){Recite.Event.unsubscribe(x);Recite.Util.each([window],function(a,b){Recite.DomEvent.remove(b,"resize",u);Recite.DomEvent.remove(b,"scroll",y);Recite.DomEvent.remove(b,"click",k)})}function b(a){if(h){clearTimeout(c.timeout);
var b=this;l!==this&&(c.timeout=setTimeout(function(){e(b)},c.intent))}}function e(a){null!==a&&(null!==l&&(null!=l.getAttribute("class")&&l.setAttribute("class",l.getAttribute("class").replace("recite-selected","")),Recite.Event.publish("Recite.Tooltip:hide",{target:l})),l=a,n(a),l.setAttribute("class",l.getAttribute("class")+" recite-selected"),Recite.Event.publish("Recite.Tooltip:show",{target:l}),Recite.Preferences.get("player.autoplay")&&Recite.PlayerControls.Tooltip.play())}function a(){Recite.Debug.log("Recite.Tooltip",
"Binding buttons for tooltip");var a=p.getElementById("recite-play");Recite.DomEvent.add(a,"click",function(a){Recite.PlayerControls.Tooltip.play()});a=p.getElementById("recite-stop");Recite.DomEvent.add(a,"click",function(a){Recite.Player.stop()});a=p.getElementById("recite-back");Recite.DomEvent.add(a,"click",function(a){Recite.Player.rewind()});a=p.getElementById("recite-forward");Recite.DomEvent.add(a,"click",function(a){Recite.Player.forward()})}function g(a){a.style.display="none";null!==l&&
(null!=l.getAttribute("class")&&l.setAttribute("class",l.getAttribute("class").replace("recite-selected","")),Recite.Event.publish("Recite.Tooltip:hide",{target:l}));l=null}function d(a){return a.style&&a.style.transform?a.style.transform:"HTML"!=a.nodeName&&a.parentNode?d(a.parentNode):""}function n(b){b&&l&&b===l&&Recite.PlayerControls.getProvider().current&&Recite.PlayerControls.getProvider().current!==b&&(b=Recite.PlayerControls.getProvider().current);var e=Recite.Sizzle("#recite-tooltip",p)[0];
"undefined"===typeof e&&(Recite.Debug.log("Recite.Tooltip","Adding tooltip to document"),e=p.createElement("div"),e.setAttribute("class","recite-tooltip small"),e.setAttribute("id","recite-tooltip"),e.style.position="absolute",e.innerHTML='<div class="recite-tooltip-content">'+c.content+'</div> <div class="recite-sprite-tip-bottomleft" id="recite-tip"></div>',Recite.Sizzle("body",p)[0].appendChild(e),Recite.getOptions(),!1!==Recite.Controls.Desktop.getOptions().showLogo&&!1!==
Recite.getOptions("showBrand")&&!1===Recite.Controls.Desktop.getOptions().customLogo&&(document.getElementById("recite-tooltip-logo").setAttribute("class","recite-sprite-tooltip-logo"),e.setAttribute("class","recite-tooltip")),a(p),m.push(e));var f=e;f.style.display="block";for(var h=0;h<m.length;h++)m[h]!==f&&(m[h].style.display="none");var g=p.body,r=Recite.Dom.getPosition(b);h=Recite.Dom.getScroll(b.ownerDocument.defaultView);var n=r.top-f.offsetHeight-c.adjust.y,k=r.left+("right"==c.position?
b.offsetWidth:0);e="recite-sprite-tip-bottom-left";var q=n-h.y-c.adjust.y,u=k+f.offsetWidth-h.x;f.style.position="absolute";var y=Recite.Dom.getAncestors(b);for(h=0;h<y.length;h++)"fixed"===Recite.Dom.getStyle(y[h],"position")&&(f.style.position="fixed",q=n-c.adjust.y);q<c.protect.top-c.adjust.y?(n=r.top+b.offsetHeight+c.adjust.y,e="recite-sprite-tip-top-left",u>g.clientWidth-c.protect.right&&(k=r.left-f.offsetWidth+c.adjust.x,e="recite-sprite-tip-top-right")):u>g.clientWidth&&(k=r.left-f.offsetWidth+
c.adjust.x,e="recite-sprite-tip-bottom-right");f.style.top=n+"px";f.style.left=k+"px";b&&(f.style.transform=d(b));b=p.getElementById("recite-tip");b.setAttribute("class",e);b.setAttribute("className",e)}var c={dimensions:{height:0},adjust:{x:0,y:15},protect:{top:40,right:0,bottom:0,left:0},position:"left",intent:500,timeout:null,content:'<div id="recite-tooltip-logo" data-recite-skip="true"></div> <a id="recite-play" class= "recite-sprite-tooltip-btn recite-sprite-tooltip-play" ></a> <a id="recite-stop" class="recite-sprite-tooltip-btn recite-sprite-tooltip-stop"></a> <a id="recite-back" class="recite-sprite-tooltip-btn recite-sprite-tooltip-back"></a> <a id="recite-forward" class="recite-sprite-tooltip-btn recite-sprite-tooltip-forward"></a>'},
h=!0,p,m=[],l=null,q=!1,x=null,u;var y=u=function(){l&&n(l)};return{init:function(){if(!q){x=Recite.Event.subscribe("Style:updated",Recite.PlayerControls.Tooltip.invalidate);for(var a=[window],b=0;b<a.length;b++)Recite.DomEvent.add(a[b],"resize",u),Recite.DomEvent.add(a[b],"scroll",y),Recite.DomEvent.add(a[b],"click",k);q=!0}},destroy:function(){f();q=!1},enable:function(){h=!0},disable:function(){h=!1;Recite.Util.each(m,function(a,b){g(b)})},hide:function(){Recite.Util.each(m,function(a,b){g(b)})},
setOptions:function(a){c=Recite.Util.merge(c,a)},getOptions:function(){return c},invoke:function(a){this.init();p=a.ownerDocument?a.ownerDocument:document;Recite.DomEvent.add(a,"mouseover",b);Recite.DomEvent.add(a,"mouseout",function(a){clearTimeout(c.timeout)})},invalidate:function(){l&&n(l)},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),e(a)):null===l?Recite.PlayerControls.next():Recite.PlayerDispatcher.dispatch(l)},stop:function(){Recite.Player.stop()},seekingSupported:function(){return!0},
next:function(a){"undefined"!=typeof a&&(l=a);a=Recite.Dom.getNextElement(l);if(a===l||null==a)return Recite.Debug.log("Recite.PlayerControls.Tooltip","next element same as current or null, halting"),null;e(a);Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a);return a},previous:function(a){"undefined"!=typeof a&&(l=a);a=Recite.Dom.getPreviousElement(l);if(a===l||null==a)return Recite.Debug.log("Recite.PlayerControls.Tooltip","prev element same as current or null, halting"),null;e(a);Recite.Dom.isVisible(a)||
Recite.Dom.scrollTo(a);return a},first:function(){var a=Recite.Dom.getFirstElement();if(null!=a)e(a);else return Recite.Debug.log("Recite.PlayerControls.Tooltip","no first element, halting"),null;Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a)},last:function(){var a=Recite.Dom.getLastElement();if(null!=a)e(a);else return Recite.Debug.log("Recite.PlayerControls.Tooltip","no last element, halting"),null;Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a)},setCurrent:function(a){l=a},current:l}}();Recite.namespace("PlayerControls.Fixed");
Recite.PlayerControls.Fixed=function(){function k(){q=Recite.Event.subscribe("Style:updated",Recite.PlayerControls.Tooltip.invalidate);for(var a=[window],b=0;b<a.length;b++)Recite.DomEvent.add(a[b],"resize",x),Recite.DomEvent.add(a[b],"scroll",u),Recite.DomEvent.add(a[b],"click",y)}function f(){Recite.Event.unsubscribe(q);Recite.Util.each([window],function(a,b){Recite.DomEvent.remove(b,"resize",x);Recite.DomEvent.remove(b,"scroll",u);Recite.DomEvent.remove(b,"click",y)})}function b(a){if(c){clearTimeout(n.timeout);
var b=this;m!==this&&(n.timeout=setTimeout(function(){e(b)},n.intent))}}function e(a){null!==m&&null!=m.getAttribute("class")&&m.setAttribute("class",m.getAttribute("class").replace("recite-selected",""));m=a;d(a);Recite.Preferences.get("player.autoplay")&&Recite.PlayerDispatcher.dispatch(m);m.setAttribute("class",m.getAttribute("class")+" recite-selected")}function a(){Recite.Debug.log("Recite.PlayerControls.Fixed","Binding buttons for fixed controls");var a=h.getElementById("recite-play");Recite.DomEvent.add(a,
"click",function(a){Recite.PlayerDispatcher.dispatch(m)});a=h.getElementById("recite-stop");Recite.DomEvent.add(a,"click",function(a){Recite.Player.stop()});a=h.getElementById("recite-back");Recite.DomEvent.add(a,"click",function(a){Recite.PlayerControls.previous()});a=h.getElementById("recite-forward");Recite.DomEvent.add(a,"click",function(a){Recite.PlayerControls.next()})}function g(a){a.style.display="none";null!==m&&null!=m.getAttribute("class")&&m.setAttribute("class",m.getAttribute("class").replace("recite-selected",
""));Recite.Sizzle("body",document)[0].style.paddingBottom="0px";m=null}function d(b){b=Recite.Sizzle("#recite-tooltip",h)[0];"undefined"===typeof b&&(Recite.Debug.log("Recite.PlayerControls.Fixed","Adding fixed controls to document"),b=h.createElement("div"),b.setAttribute("class","recite-tooltip-fixed"),b.setAttribute("id","recite-tooltip"),b.style.position="absolute",b.innerHTML='<div class="recite-tooltip-content">'+n.content+'</div> <div class="recite-tip-bottomleft" id="recite-tip"></div>',
Recite.Sizzle("body",h)[0].appendChild(b),a(h),p.push(b));Recite.Debug.log("Recite.PlayerControls.Fixed","Fixed controls added to document: "+b);b.style.display="block";b.style.position="fixed";for(var c=0;c<p.length;c++)p[c]!==b&&(p[c].style.display="none");Recite.Sizzle("body",document)[0].style.paddingBottom=n.dimensions.height+"px"}var n={dimensions:{height:98},intent:500,timeout:null,content:'<a id="recite-back" class="recite-sprite-mobile-previous" onclick="Recite.PlayerControls.previous();"></a> <a id="recite-play" class="recite-sprite-mobile-play"></a> <a id="recite-stop" class="recite-sprite-mobile-stop"></a> <a id="recite-forward" class="recite-sprite-mobile-next" onclick="Recite.PlayerControls.next();"></a>'},
c=!0,h,p=[],m=null,l=!1,q=null,x;var u=x=function(){m&&d(m)};var y=function(a){Recite.Util.each(p,function(b,c){Recite.Dom.isDescendant(a.target,c)||a.target===c||Recite.Dom.isDescendant(a.target,m)||a.target===m||Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0])||g(c)})};return{init:function(){l||(k(),l=!0)},destroy:function(){f();l=!1},enable:function(){c||k();c=!0},disable:function(){c&&f();c=!1},hide:function(){Recite.Util.each(p,function(a,b){g(b)})},setOptions:function(a){n=
Recite.Util.merge(n,a)},getOptions:function(){return n},invoke:function(a){Recite.Debug.log("Recite.Tooltop.Desktop","Invoking fixed playerControls");h=a.ownerDocument?a.ownerDocument:document;Recite.DomEvent.add(a,"mouseover",b);Recite.DomEvent.add(a,"mouseout",function(a){clearTimeout(n.timeout)})},invalidate:function(){m&&d(m)},seekingSupported:function(){return!0},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),e(a)):null===m?Recite.PlayerControls.next():Recite.PlayerDispatcher.dispatch(m)},
stop:function(){Recite.Player.stop()},next:function(a){"undefined"!=typeof a&&(m=a);a=Recite.Dom.getNextElement(m);a===m||null===a?Recite.Debug.log("Recite.PlayerControls.Fixed","next element same as current or null, halting"):(e(a),Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a))},previous:function(a){"undefined"!=typeof a&&(m=a);a=Recite.Dom.getPreviousElement(m);a===m||null===a?Recite.Debug.log("Recite.PlayerControls.Fixed","prev element same as current or null, halting"):(e(a),Recite.Dom.isVisible(a)||
Recite.Dom.scrollTo(a))},first:function(){var a=Recite.Dom.getFirstElement();if(null!=a)e(a);else return Recite.Debug.log("Recite.PlayerControls.Fixed","no first element, halting"),null;Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a)},last:function(){var a=Recite.Dom.getLastElement();if(null!=a)e(a);else return Recite.Debug.log("Recite.PlayerControls.Fixed","no last element, halting"),null;Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a)},current:m}}();Recite.namespace("PlayerControls.NoGUI");
Recite.PlayerControls.NoGUI=function(){function k(b){null!==b&&(null!==a&&null!=a.getAttribute("class")&&a.setAttribute("class",a.getAttribute("class").replace("recite-selected","")),a=b,a.setAttribute("class",a.getAttribute("class")+" recite-selected"),Recite.Preferences.get("player.autoplay")&&Recite.PlayerControls.NoGUI.play())}function f(d){if(e){clearTimeout(b.timeout);var f=this;a!==this&&(b.timeout=setTimeout(function(){k(f)},b.intent))}}var b={timeout:null,dimensions:{height:0}},e=!0,a=null,
g=!1;return{init:function(){g||(Recite.Event.subscribe("Style:updated",Recite.PlayerControls.Tooltip.invalidate),g=!0)},destroy:function(){g=!1},enable:function(){e=!0},disable:function(){e=!1},hide:function(){null!==a&&(null!=a.getAttribute("class")&&a.setAttribute("class",a.getAttribute("class").replace("recite-selected","")),Recite.Event.publish("Recite.Tooltip:hide",{target:a}));a=null},setOptions:function(a){b=Recite.Util.merge(b,a)},getOptions:function(){return b},invoke:function(a){this.init();
Recite.Debug.log("Recite.PlayerControls.NoGUI","Invoking NoGUI controls.");Recite.DomEvent.add(a,"mouseover",f);Recite.DomEvent.add(a,"mouseout",function(a){clearTimeout(b.timeout)})},invalidate:function(){},play:function(b){b?(Recite.PlayerDispatcher.dispatch(b),k(b)):null===a?Recite.PlayerControls.next():Recite.PlayerDispatcher.dispatch(a)},stop:function(){Recite.Player.stop()},seekingSupported:function(){return!0},next:function(b){"undefined"!=typeof b&&(a=b);b=Recite.Dom.getNextElement(a);b===
a||null===b?Recite.Debug.log("Recite.PlayerControls.NoGUI","next element same as current or null, halting"):k(b)},previous:function(b){"undefined"!=typeof b&&(a=b);b=Recite.Dom.getPreviousElement(a);b===a||null===b?Recite.Debug.log("Recite.PlayerControls.NoGUI","prev element same as current or null, halting"):k(b)},first:function(){var a=Recite.Dom.getFirstElement();if(null!=a)k(a);else return Recite.Debug.log("Recite.PlayerControls.NoGUI","no first element, halting"),null},last:function(){var a=
Recite.Dom.getLastElement();if(null!=a)k(a);else return Recite.Debug.log("Recite.PlayerControls.NoGUI","no last element, halting"),null},current:a}}();Recite.namespace("PlayerControls.MobileControls");
Recite.PlayerControls.MobileControls=function(){function k(){y=Recite.Event.subscribe("Style:updated",Recite.PlayerControls.Tooltip.invalidate);for(var a=[window],b=0;b<a.length;b++)Recite.DomEvent.add(a[b],"resize",B),Recite.DomEvent.add(a[b],"scroll",A),Recite.DomEvent.add(a[b],"click",D)}function f(){Recite.Event.unsubscribe(y);Recite.Util.each([window],function(a,b){Recite.DomEvent.remove(b,"resize",B);Recite.DomEvent.remove(b,"scroll",A);Recite.DomEvent.remove(b,"click",D)})}function b(a){if(p)if(x)x=
!1;else{Recite.Player.prepare();clearTimeout(h.timeout);var b=this;q!==this&&(h.timeout=setTimeout(function(){e(b)},h.intent))}}function e(a){null!==q&&null!=q.getAttribute("class")&&q.setAttribute("class",q.getAttribute("class").replace("recite-selected",""));q=a;c(a);Recite.Preferences.get("player.autoplay")&&(Recite.Debug.log("Recite.MobileControls","Playing audio..."),Recite.PlayerDispatcher.dispatch(q));q.setAttribute("class",q.getAttribute("class")+" recite-selected")}function a(){Recite.Debug.log("Recite.PlayerControls.MobileControls",
"Binding buttons for mobile controls");var a=m.getElementById("recite-play");Recite.DomEvent.add(a,"click",function(a){m.getElementById("recite-play");r?(d(),Recite.Player.stop(),r=!1):(n(),Recite.PlayerDispatcher.dispatch(q),r=!0)});a=m.getElementById("recite-back");Recite.DomEvent.add(a,"click",function(a){Recite.PlayerControls.Mobile.previous()});a=m.getElementById("recite-forward");Recite.DomEvent.add(a,"click",function(a){Recite.PlayerControls.next()})}function g(a){a.style.display="none";null!==
q&&null!=q.getAttribute("class")&&q.setAttribute("class",q.getAttribute("class").replace("recite-selected",""));Recite.Sizzle("body",document)[0].style.paddingBottom="0px";q=null}function d(){m.getElementById("recite-play").setAttribute("class","recite-sprite-mobile-play")}function n(){m.getElementById("recite-play").setAttribute("class","recite-sprite-mobile-stop")}function c(b){b=Recite.Sizzle("#recite-tooltip",m)[0];"undefined"===typeof b&&(Recite.Debug.log("Recite.PlayerControls.MobileControls",
"Adding mobile controls to document"),b=m.createElement("div"),b.setAttribute("class","recite-tooltip-mobile"),b.setAttribute("id","recite-tooltip"),b.style.position="absolute",b.innerHTML='<div class="recite-tooltip-content">'+h.content+'</div> <div class="recite-tip-bottomleft" id="recite-tip"></div>',Recite.Sizzle("body",m)[0].appendChild(b),a(m),l.push(b));Recite.Debug.log("Recite.PlayerControls.MobileControls","Mobile controls added to document: "+b);b.style.display="block";b.style.position=
"mobile";for(var c=0;c<l.length;c++)l[c]!==b&&(l[c].style.display="none");Recite.Sizzle("body",document)[0].style.paddingBottom=h.dimensions.height+"px"}var h={dimensions:{height:58},intent:500,timeout:null,content:'<a id="recite-back" class="recite-sprite-mobile-previous" onclick="Recite.PlayerControls.previous();"></a> <a id="recite-play" class="recite-sprite-mobile-play"></a> <a id="recite-forward" class="recite-sprite-mobile-next" onclick="Recite.PlayerControls.next();"></a>'},
p=!0,m,l=[],q=null,x=!1,u=!1,y=null,r=!1,B;var A=B=function(){q&&c(q)};var D=function(a){Recite.Util.each(l,function(b,c){Recite.Dom.isDescendant(a.target,c)||a.target===c||Recite.Dom.isDescendant(a.target,q)||a.target===q||Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0])||g(c)})};return{init:function(){u||(k(),u=!0)},destroy:function(){f();u=!1},enable:function(){p||k();p=!0},disable:function(){p&&f();p=!1},hide:function(){Recite.Util.each(l,function(a,b){g(b)})},setOptions:function(a){h=
Recite.Util.merge(h,a)},getOptions:function(){return h},invoke:function(a){Recite.Debug.log("Recite.Tooltop.Desktop","Invoking mobile playerControls");m=a.ownerDocument?a.ownerDocument:document;Recite.DomEvent.add(a,"touchmove",function(){x=!0});Recite.DomEvent.add(a,"click",b);Recite.Event.subscribe("Audio:started",function(){r=!0;n()});Recite.Event.subscribe("Audio:ended",function(){d()})},invalidate:function(){q&&c(q)},seekingSupported:function(){return!0},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),
e(a)):null===q?Recite.PlayerControls.next():Recite.PlayerDispatcher.dispatch(q)},stop:function(){Recite.Player.stop()},next:function(a){"undefined"!=typeof a&&(q=a);a=Recite.Dom.getNextElement(q);a===q||null===a?Recite.Debug.log("Recite.PlayerControls.MobileControls","next element same as current or null, halting"):(e(a),Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a))},previous:function(a){"undefined"!=typeof a&&(q=a);a=Recite.Dom.getPreviousElement(q);a===q||null===a?Recite.Debug.log("Recite.PlayerControls.MobileControls",
"prev element same as current or null, halting"):(e(a),Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a))},first:function(){var a=Recite.Dom.getFirstElement();if(null!=a)e(a);else return Recite.Debug.log("Recite.PlayerControls.MobileControls","no first element, halting"),null;Recite.Dom.isVisible(a)||Recite.Dom.scrollTo(a)},last:function(){var a=Recite.Dom.getLastElement();if(null!=a)e(a);else return Recite.Debug.log("Recite.PlayerControls.MobileControls","no last element, halting"),null;Recite.Dom.isVisible(a)||
Recite.Dom.scrollTo(a)},current:q}}();Recite.namespace("PlayerDispatcher");
Recite.PlayerDispatcher=function(){function k(){n="en";for(var a in d)d[a].translated=!1}function f(b){if("A"===b.tagName&&!b.getAttribute("href")||"IMG"===b.tagName&&!b.getAttribute("alt"))return d[a.readElements.SPAN];if("LABEL"===b.tagName){var c=b.getAttribute("for");if(c&&(c=document.getElementById(c))&&c.checked)return d.checked}return d[a.readElements[b.tagName]]}function b(a,d){d=void 0===d?"":d;if("undefined"==typeof a)return"";var c=f(a);if(c){var e="";c.translated?e=c.translated:c["default"]&&
(e=c["default"]);d+=e+": "}if(!d){e=Recite.Dom.getAncestors(a);for(var l=0;l<e.length;l++)if(c=f(e[l])){e="";c.translated?e=c.translated:c["default"]&&(e=c["default"]);d+=e+": ";break}}a.nodeType===Node.TEXT_NODE?d+=Recite.Dom.getText(a)+" ":"IMG"===a.tagName&&a.getAttribute("alt")?d+=a.getAttribute("alt")+" ":"INPUT"!==a.tagName&&"TEXTAREA"!==a.tagName||""!=a.value||(c=a.getAttribute("placeholder"))&&(d+=c+" ");if(a.childNodes)for(l=0;l<a.childNodes.length;l++)d=b(a.childNodes[l],d);return d}function e(a,
d){d=Recite.Language.Locale.getLocalePreference(d);var c=null,e=null;"string"===typeof a?c=a:(c=b(a),e=a.getAttribute("data-recite-voice")||null);try{if(c&&0<c.length&&(Recite.Player.play(c,d,e),Recite.getOptions().autoCache&&"string"!==typeof a)){var f=Recite.Dom.getNextElement(a,!0);f!==a&&null!=f&&setTimeout(function(){g===a&&Recite.Player.cache(b(f),d,e)},500)}}catch(q){if(q instanceof Recite.Player.PlayerException)switch(q.code){case 400:Recite.Gui.Notification.show("This language is not supported by Recite",
{play:!0})}}}var a={readElements:{A:"link",IMG:"image"}},g=null,d={link:{"default":"link",translated:!1},image:{"default":"image",translated:!1},checked:{"default":"selected",translated:!1}},n="en";Recite.Event.subscribe("Translate:begin",function(a,b){b=b["lang:"];if(b!=n){n=b;a=[];for(var c in d)a.push(d[c]["default"]);c=Recite.Language.Locale.stripLanguageLocale(b);c==Recite.Language.Translate.getOptions().sourceLanguage?k():Recite.Api.call("translate","POST",{data:{target:c,source:"en",text:a},
contentType:"application/json",success:function(a){var b=0,c;for(c in d)d[c].translated=a[b++]}})}});Recite.Event.subscribe("Translate:restore_begin",k);return{setOptions:function(b){a=Recite.Util.merge(a,b)},dispatch:function(a){(null===Recite.Player.getPlayer()||Recite.Player.getPlayer().getOptions().prepareAudio)&&Recite.Player.prepare();var b=null,c=null;"string"===typeof a?b=a:(c=Recite.Dom.getLanguage(a),g=a,b=Recite.Dom.getText(a));var d=Recite.Player.getOptions().languageDetection;2===d||
null===c&&1<=d?c=Recite.Dom.detectLanguage(b,function(b){"und"===b&&(b=null);e(a,b)}):e(a,c)}}}();Recite.namespace("Player");
Recite.Player=function(){function k(){if(b)return b;var a=Recite.Audio.AEBroker.init();a?b=a:alert("Sorry, Recite requires either an HTML5 compatible browser or Flash support. Please upgrade your browser or install Flash to use Recite.");return b}function f(a,f,d,n,c){f=f||e.language;if(!Recite.Player.languageSupported(f))throw Recite.Debug.log("Recite.Player","Language not supported:"+f),new Recite.Player.PlayerException(400,"Unsupported Language");var h=k().format();d={q:a,f:h};null!==f&&(d.l=f);
var g=Recite.Preferences.get("voice.gender");d.g=g;(g=Recite.Preferences.get("player.playbackSpeed"))||(g=1);d.s=g;Recite.Debug.log("Recite.Player","Audio request: "+a);0>a.length&&!n.cache?(Recite.Debug.log("Recite.Player","GET Request"),Recite.Api.getUri("tts",{authRequired:!0,data:d,success:function(a){Recite.Debug.log("Recite.Player","Request url: "+a);c&&c(a)}})):(Recite.Debug.log("Recite.Player","POST Request"),b.getOptions().playlist||(d.playlist=!1),b.getOptions().waitForAudioProcessing&&
(d.waitForProcessing=!0),Recite.Api.call("tts","POST",{data:d,contentType:"application/json; charset=UTF-8",success:function(a){var b=a.data;Recite.Auth.getStatus(function(a){n.cache&&c.call();var d=[];Recite.Debug.log("Recite.Player","POST Callback");void 0!==b.id?(Recite.Debug.log("Recite.Player","Playing single file"),b.url=Recite.baseUrl+"/api/tts/"+b.id+"?f="+h+"&access_token="+a.access_token,d.push(b)):(Recite.Debug.log("Recite.Player","Playing multiple files - create a playlist"),Recite.Util.each(b,
function(b,c){c.url=Recite.baseUrl+"/api/tts/"+c.id+"?f="+h+"&access_token="+a.access_token;Recite.Debug.log("Recite.Player","Adding to playlist: "+c.url);d.push(c);Recite.Debug.log("Recite.Player","Added to playlist: "+c.url)}));c&&(Recite.Debug.log("Recite.Player","Calling callback with playlist"),c(d))})}}));Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Player",event:"play ("+f+")"})}var b=null,e={language:null,voices:{},languages:["cy","cy-gb","en","en-gb","en-us","en-in","en-au","fr","fr-fr","fr-ca","cn","da","nl","de","de-de","hi","is","it","ja","ko","no","pl","pl-pl","pt-br","pt","ro","ru","es","es-es","es-mx","es-us","sv","tr","cy","cy-gb","en","en-gb","en-us","en-in","en-au","fr","fr-fr","fr-ca","cn","da","nl","de","de-de","hi","is","it","ja","ko","no","pl","pl-pl","pt-br","pt","ro","ru","es","es-es","es-mx","es-us","sv","tr","cy","cy-gb","en","en-gb","en-us","en-in","en-au","fr","fr-fr","fr-ca","cn","da","nl","de","de-de","hi","is","it","ja","ko","no","pl","pl-pl","pt-br","pt","ro","ru","es","es-es","es-mx","es-us","sv","tr","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","en","EN-US","en-us","en-gb","en-sc","en-au","ar-ae","ar","tr","it","ko","zh-CN","zh-TW","th","ja","id","eu","ca","cs","da","nl","fi","fr","fr-fr","de","el","hi","hu","no","pl","pt","ro","ru","sk","es","sv","gl","iw","en","EN-US","en-us","en-gb","en-sc","en-au","ar-ae","ar","tr","it","ko","zh-CN","zh-TW","th","ja","id","eu","ca","cs","da","nl","fi","fr","fr-fr","de","el","hi","hu","no","pl","pt","ro","ru","sk","es","sv","gl","iw","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","en","EN-US","en-us","en-gb","en-sc","en-au","ar-ae","ar","tr","it","ko","zh-CN","zh-TW","th","ja","id","eu","ca","cs","da","nl","fi","fr","fr-fr","de","el","hi","hu","no","pl","pt","ro","ru","sk","es","sv","gl","iw","en","EN-US","en-us","en-gb","en-sc","en-au","ar-ae","ar","tr","it","ko","zh-CN","zh-TW","th","ja","id","eu","ca","cs","da","nl","fi","fr","fr-fr","de","el","hi","hu","no","pl","pt","ro","ru","sk","es","sv","gl","iw","en","EN-US","en-us","en-gb","en-sc","en-au","ar-ae","ar","tr","it","ko","zh-CN","zh-TW","th","ja","id","eu","ca","cs","da","nl","fi","fr","fr-fr","de","el","hi","hu","no","pl","pt","ro","ru","sk","es","sv","gl","iw","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","ar-ae","ar","zh-cn","zh-tw","cs","el","fi","sk","sk-sk","hu","hu-hu","id","ta","gd","ga","ga-ga","gd","ga","ga-ga","gd","ga","ga-ga","ur","cy","cy-gb","en","en-gb","en-us","en-in","en-au","fr","fr-fr","fr-ca","cn","da","nl","de","de-de","hi","is","it","ja","ko","no","pl","pl-pl","pt-br","pt","ro","ru","es","es-es","es-mx","es-us","sv","tr","cy","cy-gb"],languageDetection:1};Recite.Event.subscribe("Audio:ended",
function(){Recite.Debug.log("Recite.Player","-------\x3eAudio ended")});return{setOptions:function(a){e=Recite.Util.merge(e,a)},getOptions:function(){return e},init:function(){if(null===e.language){var a=document.documentElement.lang;0<a.length&&this.setOptions({language:a})}},prepare:function(){k().getOptions().prepareAudio&&(Recite.Debug.log("Recite.Player","--------------------\x3e Preloading audio..."),k().play({url:Recite.baseUrl+"/audio/blank.mp3"}))},play:function(a,b,d){k().getOptions().playlist&&
k().clearPlaylist();f(a,b,d,{},function(a){Recite.Debug.log("Recite.Player","In callback");1==a.length?(Recite.Debug.log("Recite.Player","Queue length == 1 ... "+a[0].url),k().play(a[0])):(Recite.Debug.log("Recite.Player","Queue length = "+a.length),Recite.Util.each(a,function(a,b){Recite.Debug.log("Recite.Player","Adding URL to playlist: "+b.url);k().addToPlaylist(b)}),Recite.Debug.log("Recite.Player","Play the playlist"),k().playPlaylist(),Recite.Debug.log("Recite.Player","Finished invoking play"))})},
pause:function(){k().pause()},restart:function(){k().restart()},resume:function(){k().resume()},cache:function(a,b,d){f(a,b,d,{cache:!0},function(b){Recite.Debug.log("Recite.Player","Cached audio for: "+a)})},stop:function(){k().stop()},rewind:function(){k().rewind()},forward:function(){k().forward()},setPlayer:function(a){b=a},getPlayer:function(){return b},getSupportedLanguauges:function(){return e.languages},languageSupported:function(a){return-1<Recite.Util.inArray(a,e.languages)||null===a}}}();
Recite.Player.PlayerException=function(k,f){this.code=k;this.message=f};Recite.namespace("Audio.WebAudio");
Recite.Audio.WebAudio=function(){function k(){Recite.Player.getPlayer().play(e[0]);e.splice(0,1)}function f(b){null!=a&&Recite.Audio.WebAudio.stop();Recite.Event.publish("Audio:started");a=g.createBufferSource();a.buffer=b;a.connect(g.destination);a.start(0);a.onended=function(){0<e.length?(Recite.Event.publish("Audio:playlist-item-ended"),k()):Recite.Preferences.get("player.continuePlay")?Recite.PlayerControls.next():Recite.Event.publish("Audio:ended")}}var b="",e=[],a=null,g=null,d={prepareAudio:!0,
playlist:!0,waitForAudioProcessing:!1};return{setOptions:function(a){d=Recite.Util.merge(d,a)},init:function(){Recite.Debug.log("Recite.Audio.WebAudio","Init");b=Recite.Audio.WebAudio.support();Recite.Debug.log("Recite.Audio.WebAudio","Preferred format detected as:"+b);Recite.Debug.log("Recite.Audio.WebAudio",b)},play:function(a){Recite.Debug.log("Recite.Audio.WebAudio","Webaudio play called!");var b=new XMLHttpRequest;b.open("GET",a,!0);b.responseType="arraybuffer";b.onload=function(){Recite.Debug.log("Recite.Audio.WebAudio",
"ONLOAD CALLED!");g.decodeAudioData(b.response,function(a){Recite.Debug.log("Recite.Audio.WebAudio","PLAY SOUND CALLED!");f(a)})};b.send()},stop:function(){null!=a&&(a.onended=null,a.stop(0),Recite.Event.publish("Audio:ended"))},rewind:function(){},forward:function(){},support:function(){try{var a=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;return AudioContext?(window.AudioContext=a,g=new a,!0):!1}catch(c){return!1}},format:function(){return"mp3"},
getOptions:function(){return d},getPlaylistState:function(){return _playlistPlaying},addToPlaylist:function(a){e.push(a);return e},clearPlaylist:function(){return e=[]},playPlaylist:function(){k()},updateMeta:function(a,b){if(b&&a)for(var c=0,d=e.length;c<d;c++)e[c]&&e[c].hasOwnProperty("id")&&e[c].id==b&&(e[c].meta=a);return e}}}();Recite.namespace("Audio.HTML5");
Recite.Audio.HTML5=function(){function k(){var a=g[0];g.splice(0,1);Recite.Player.getPlayer().play(a)}function f(){Recite.Debug.log("Recite.Audio.HTML5","Moving onto next playlist item");Recite.Preferences.get("player.continuePlay")&&0>=g.length?Recite.PlayerControls.next():(Recite.Debug.log("Recite.Audio.HTML5","Playlist length: "+g.length),Recite.Event.publish("Audio:playlist-item-ended"))}function b(){var a=e.play();void 0!==a&&(a.then(function(){}),a.catch(function(a){Recite.Audio.AEBroker.stop();
Recite.WordByWord.resetSection();Recite.Gui.Notification.show("Recite would like to read this content aloud. Please click the play button.")}))}var e=null,a="",g=[],d={prepareAudio:!0,playlist:!0,waitForAudioProcessing:!1};return{setOptions:function(a){d=Recite.Util.merge(d,a)},init:function(){Recite.Event.subscribe("Audio:playlist-item-ended",function(){0<g.length?k():Recite.Event.publish("Audio:ended")});null==e&&(Recite.Debug.log("Recite.Audio.HTML5","Init"),e=document.createElement("audio"),
a=Recite.Audio.HTML5.format(),e.addEventListener("ended",function(){f()},!1),e.addEventListener("error",function(){Recite.Debug.log("Recite.Audio.HTML5","Audio failed");f()},!1),e.addEventListener("canplay",function(){Recite.Debug.log("Recite.Audio.HTML5","Can play");b()},!1),Recite.Debug.log("Recite.Audio.HTML5","Preferred format detected as:"+a),Recite.Debug.log("Recite.Audio.Html5",a))},play:function(a){Recite.Event.publish("Audio:started");e.setAttribute("src",a);Recite.Debug.log("Recite.Audio.HTML5",
"PLAY CALLED..."+a);return e.load()},pause:function(){e.pause();Recite.Event.publish("Audio:paused")},resume:function(){e.play();Recite.Event.publish("Audio:started")},restart:function(){e.currentTime=0;e.load();e.play();Recite.Event.publish("Audio:restarted")},stop:function(){Recite.Debug.log("Recite.Audio.HTML5","STOP CALLED...");e.pause();g=[];Recite.Event.publish("Audio:ended")},rewind:function(){--e.currentTime},forward:function(){e.currentTime+=2},support:function(){var a=document.createElement("audio"),
b=!!a.canPlayType;b&&(b=new Boolean(b),b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),b.mp3=a.canPlayType("audio/mpeg;"),b.wav=a.canPlayType('audio/wav; codecs="1"'),b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return b},format:function(){var a=Recite.Audio.HTML5.support();return a.ogg?"ogg":a.mp3?"mp3":a.wav?"wav":a.m4a?"m4a":!1},getOptions:function(){return d},getPlaylistState:function(){return _playlistPlaying},addToPlaylist:function(a){g.push(a);return g},clearPlaylist:function(){Recite.Debug.log("Recite.Audio.HTML5",
"CLEAR PLAYLIST CALLED...");return g=[]},playPlaylist:function(){k()},getCurrentTime:function(){return Math.floor(1E3*e.currentTime)},updateMeta:function(a,b){if(b&&a)for(var c=0,d=g.length;c<d;c++)g[c]&&g[c].hasOwnProperty("id")&&g[c].id==b&&(g[c].meta=a);return g}}}();Recite.namespace("Audio.SoundManager");
Recite.Audio.SoundManager=function(){function k(){Recite.Player.getPlayer().play(b[0]);b.splice(0,1)}var f=null,b=[],e={path:Recite.baseUrl+"/common/js/soundmanager/soundmanager2-jsmin.js",soundmanager:{debugMode:!1,debug:!1,url:Recite.baseUrl+"/common/swf/"},prepareAudio:!0,playlist:!0,waitForAudioProcessing:!1};return{setOptions:function(a){e=Recite.Util.merge(e,a)},init:function(){Recite.Debug.log("Recite.Audio.SoundManager","Init soundmanager");Recite.Event.subscribe("Audio:ended",function(){Recite.Preferences.get("player.continuePlay")&&
Recite.PlayerControls.next()});Recite.Event.subscribe("Audio:playlist-item-ended",function(){0<b.length?k():Recite.Event.publish("Audio:ended")})},play:function(a){Recite.Debug.log("Recite.Audio.SoundManager","Play called");window.soundManager?((f=soundManager.getSoundById(a))||(f=soundManager.createSound({id:a,url:a})),soundManager.stopAll(),f.play({onload:function(a){a||(Recite.Debug.log("Recite.Audio.SoundManager","Cannot load audio file"),Recite.Event.publish("Audio:playlist-item-ended"))},onfinish:function(){Recite.Debug.log("Recite.Audio.SoundManager",
"Onfinish called");Recite.Event.publish("Audio:playlist-item-ended")},ondataerror:function(){Recite.Debug.log("Sound manager --- > Item failed: "+a);Recite.Event.publish("Audio:playlist-item-ended")}})):Recite.AssetLoader.js(e.path,function(){window.soundManager=new SoundManager;Recite.Util.each(e.soundmanager,function(a,b){soundManager[a]=b});soundManager.beginDelayedInit();soundManager.stopAll();soundManager.onready(function(){f=soundManager.createSound({id:a,url:a}).play({onload:function(a){a||
(Recite.Debug.log("Recite.Audio.SoundManager","Cannot load audio file"),Recite.Event.publish("Audio:playlist-item-ended"))},onfinish:function(){Recite.Debug.log("Recite.Audio.SoundManager","Onfinish called");Recite.Event.publish("Audio:playlist-item-ended")},ondataerror:function(){Recite.Debug.log("Sound manager --- > Item failed: "+a);Recite.Event.publish("Audio:playlist-item-ended")}})})});Recite.Event.publish("Audio:started")},preload:function(a){Recite.Audio.SoundManager.play(a)},pause:function(){f.pause();
Recite.Event.publish("Audio:paused")},resume:function(){f.resume();Recite.Event.publish("Audio:started")},restart:function(){f&&(Recite.Debug.log("Recite.Audio.Soundmanager","Restarting track"),f.setPosition(0))},stop:function(){f&&f.stop();Recite.Event.publish("Audio:ended")},rewind:function(){f&&(Recite.Debug.log("Recite.Audio.Soundmanager","Skiping backwards"),f.setPosition(f.position-500))},forward:function(){f?(Recite.Debug.log("Recite.Sudio.Soundmanager","Skiping forward"),f.setPosition(f.position+
500)):Recite.Debug.log("Recite.Sudio.Soundmanager","No sound object!?")},support:function(){return!0},format:function(){return"mp3"},addToPlaylist:function(a){b.push(a);return b},clearPlaylist:function(){return b=[]},playPlaylist:function(){k()},getOptions:function(){return e},getCurrentTime:function(){return f.position},updateMeta:function(a,e){if(e&&a)for(var d=0,f=b.length;d<f;d++)b[d]&&b[d].hasOwnProperty("id")&&b[d].id==e&&(b[d].meta=a);return b}}}();Recite.namespace("Audio.Download");
Recite.Audio.Download=function(){var k={prepareAudio:!1,playlist:!1,waitForAudioProcessing:!0};return{setOptions:function(f){k=Recite.Util.merge(k,f)},init:function(){},play:function(f){Recite.Audio.AEBroker.setDownload(!1);Recite.Debug.log("Recite.Audio.Download","PLAY");window.location.href=f+"&download=true"},stop:function(){},rewind:function(){},forward:function(){},support:function(){return!0},format:function(){return"mp3"},getOptions:function(){return k}}}();Recite.namespace("Audio.AEBroker");
Recite.Audio.AEBroker=function(){function k(){var a=Recite.Preferences.get("player.playbackSpeed");0>p?p=a:0<p&&p!=a&&(p=a,setTimeout(function(){if(h&&p==a){f();var b=Recite.Sizzle("recite.recite-selected");0<b.length&&Recite.PlayerDispatcher.dispatch(b[0])}},n.speedChangeWait))}function f(){null!=d&&d.stop()}function b(a){var f=a.id,l=a.url;if("blank.mp3"!=l.substr(l.length-9,9)){var g=e(f,"meta");if(g)d.updateMeta(g,f),h&&h.hasOwnProperty("id")&&h.id==f&&(h.meta=g);else{var k=e(f,"count");null==
k&&(k=0);k<=n.metaLoadAttempts&&Recite.Ajax.ajax(l+"&meta=true",{method:"get",success:function(a){200==a.status&&a.response&&(a=JSON.parse(a.response))&&(null!=f&&null!=k&&(c[f]={meta:a,count:k}),d.updateMeta(a,f),h&&h.hasOwnProperty("id")&&h.id==f&&(h.meta=a))},error:function(d){if(404==d.status||408==d.status)k++,null!=f&&null!=k&&(c[f]={meta:null,count:k}),k<n.metaLoadAttempts&&setTimeout(function(){b(a)},n.metaLoadPause)}})}}}function e(a,b){return c.hasOwnProperty(a)&&c[a].hasOwnProperty(b)?
c[a][b]:null}function a(){Recite.Audio.HTML5.support()?(Recite.Debug.log("Recite.Player","HTML5 Audio support detected, using Recite.Audio.HTML5 as backend."),Recite.Audio.HTML5.init(),d=Recite.Audio.HTML5):Recite.Audio.SoundManager.support()&&(Recite.Debug.log("Recite.Player","HTML5 Audio not supported, using Recite.Audio.SoundManager as backend."),Recite.Audio.SoundManager.init(),d=Recite.Audio.SoundManager)}function g(a,b){null!=d&&(a=a?d.play(a):d.play(),void 0!==a?(a.then(function(){"function"==
typeof b&&b()}),a.catch(function(a){Recite.Audio.AEBroker.stop();Recite.WordByWord.resetSection();Recite.Gui.Notification.show("Recite would like to read this content aloud. Please click the play button.")})):"function"==typeof b&&b())}var d=null,n={metaLoadAttempts:10,metaLoadPause:500,speedChangeWait:300},c={},h=null,p=-1,m=!1;Recite.Event.subscribe("Translate:global-begin",f);Recite.Event.subscribe("Preferences:load",k);Recite.Event.subscribe("Preferences:set",k);Recite.Event.subscribe("Preferences:reset",
k);Recite.Event.subscribe("Audio:ended",function(){h=null});return{setOptions:function(a){n=Recite.Util.merge(n,a)},init:function(){if(null!=d)return this;a();return this},play:function(c){var e=null;if(c&&(c.hasOwnProperty("url")&&(e=c.url),null!=e&&"blank.mp3"==e.toLowerCase().substr(e.length-9)))return;m&&null!==e?(d.play(e),a()):((h=c)&&!h.hasOwnProperty("meta")&&b(h),g(e,"_setStartPlay"))},getMeta:function(){return h&&h.hasOwnProperty("meta")?h.meta:null},pause:function(){null!=d&&"function"==
typeof d.pause&&d.pause()},resume:function(){null!=d&&"function"==typeof d.play&&d.play()},restart:function(){null!=d&&"function"==typeof d.restart&&d.restart()},stop:function(){null!=d&&"function"==typeof d.stop&&d.stop()},rewind:function(){null!=d&&"function"==typeof d.rewind&&(d.rewind(),Recite.Event.publish("Audio:rewind"))},forward:function(){null!=d&&"function"==typeof d.forward&&(d.forward(),Recite.Event.publish("Audio:forward"))},getOptions:function(){return null!=d?Recite.Util.merge(n,d.getOptions()):
n},getPlaylistState:function(){if(null!=d)return d.getPlaylistState()},addToPlaylist:function(a){null!=d&&(d.addToPlaylist(a),!a.hasOwnProperty("meta")&&a.hasOwnProperty("id")&&a.hasOwnProperty("url")&&b(a))},clearPlaylist:function(){null!=d&&"function"==typeof d.clearPlaylist&&d.clearPlaylist()},playPlaylist:function(){null!=d&&d.playPlaylist()},format:function(){if(null!=d)return d.format()},getPlayTime:function(){return null!=d&&d.hasOwnProperty("getCurrentTime")?d.getCurrentTime():Date.now()-
0},setDownload:function(a){m=1==a;Recite.Audio.Download.init();d=Recite.Audio.Download}}}();Recite.namespace("WordByWord");
Recite.WordByWord=function(){function k(){for(var a=Recite.Sizzle("reciteword[data-highlight=1]"),b=e(),c=0;c<a.length;c++)a[c]&&(b.fg&&(a[c].style.color=b.fg),b.bg&&(a[c].style.background=b.bg))}function f(){if(null!=C)return C;var a=null;H&&(a=H.color);if(null!=a){a=a.replace("rgb(","").replace("rgba(","").replace(")","");a=a.split(",");a=b(a);var c="rgb("+(255-parseInt(a[0]))+","+(255-parseInt(a[1]))+","+(255-parseInt(a[2]))+")";a=[parseInt(a[0]),parseInt(a[1]),parseInt(a[2])];a=b(a);a="rgb("+
a[0]+","+a[1]+","+a[2]+")";return C={bg:a,fg:c}}return{bg:"black",fg:"white"}}function b(a){for(var b=0;b<a.length;b++)parseInt(a[b])<r.colorRoundingThreshold&&(a[b]=0),a[b]>255-r.colorRoundingThreshold&&(a[b]=255);return a}function e(){var a=f(),b=Recite.Preferences.get("style.wwHighlight.color"),c=Recite.Preferences.get("style.font.color"),d=Recite.Preferences.get("style.backgroundColor");return{fg:null==d||"null"==d?a.fg:d,bg:null==b||"null"==b?null==c||"null"==c?a.bg:c:b}}function a(){d();v=!0}
function g(){v=!1}function d(){r.enabled&&!v&&(y(),Recite.Audio.AEBroker.pause(),(0<Recite.Sizzle("[data-have-read]").length||0<Recite.Sizzle("reciteword[data-highlight=1]").length)&&q())}function n(){if(z&&w&&!v){var a=Recite.Audio.AEBroker.getMeta();if(F!=a&&void 0!=a){var b=r.wordCheckRate;for(var d=1,e=a.length;d<e;d++){var f=a[d].time-a[d-1].time;f<b&&(b=f)}b<r.wordCheckRate&&(r.wordCheckRate=b,u());F=a}if(a){b=Recite.Audio.AEBroker.getPlayTime();d=null;e=0;for(f=a.length;e<f;e++)a[e].time<=
b?d=a[e]:e=f+10;(a=d)&&a.hasOwnProperty("time")&&a.hasOwnProperty("value")&&(null==G||a.time!=G)&&(G=a.time,c(a.value))}}}function c(a){if(w&&!v){p();var b=h(a),c=void 0,d=Recite.Sizzle("reciteword[data-have-read]"),e=Recite.Sizzle("reciteword:not([data-have-read])"),f=void 0;if(!I&&e){var g=/^[0-9a-zA-Z]+$/,l=0;-1=="af eu ca da nl en fi fr gl de id id id ms no pt es sw sv".split(" ").indexOf(Recite.Language.Translate.getWorkingPageLanguage())&&(f=e[l],c=e[l].getAttribute("data-word-value"));for(;l<
e.length&&void 0==c;){var n=e[l].getAttribute("data-word-value");n.match(g)&&(f=e[l],c=n);l++}}if(c&&c==b&&!f.hasAttribute("data-partword"))f.setAttribute("data-highlight",1),k();else if(e=null,d&&(e=d[d.length-1]),e&&(e=e.getAttribute("data-word-value")),d=c?c.length>a.length:!1,f=c?c.length<a.length:!1,b=void 0,f&&(g=h(a),l=h(c),0==g.indexOf(l)&&(b=[c],g=g.substr(l.length),b=b.concat(g.split(A)))),void 0==b&&(b=-1<["&amp;"].indexOf(a)?[a]:a.split(A)),!(!f&&2<=b.length&&e&&c&&b.includes(e)&&b.includes(c))){for(a=
b.length-1;-1<a;a--)if(e=h(b[a]).trim(),""!=e){f=Recite.Sizzle("reciteword[data-word-value"+(I||d?"*":"")+'="'+e+'"]:not([data-have-read]):not([data-currentword])');if(0<f.length)var q=f[0];void 0!=q&&(q.setAttribute("data-highlight",1),q.setAttribute("data-currentword",1),d&&(f=q.getAttribute("data-partword"),g="",f&&(g=f),f=h(g+e),g=c?h(c):"",f!=g&&f.length<g.length?q.setAttribute("data-partword",e):q.removeAttribute("data-partword")))}Recite.Util.each(Recite.Sizzle("[data-currentword]"),function(){this.removeAttribute("data-currentword")});
I=!1;k()}}}function h(a){a=a.replace(/\u00a0/g," ");for(var b=0;b<B.length;b++)a=a.replace(B[b],"");return a}function p(){Recite.Util.each(Recite.Sizzle("reciteword[data-highlight]:not([data-partword])"),function(){var a=this,b=!1,c=Recite.Sizzle("reciteWordByWord")[0];Recite.Util.each(Recite.Sizzle("reciteword:not([data-have-read])",c),function(){if(!b&&(this.setAttribute("data-have-read",1),this.removeAttribute("data-highlight"),this.removeAttribute("style"),this==a))return b=!0,!1})})}function m(a){Recite.Util.each(Recite.Sizzle("reciteword["+
a+"]"),function(){this.removeAttribute(a)})}function l(){r.enabled&&!v&&(I=!0,G=null,m("data-have-read"),m("data-currentword"),m("data-partword"),m("data-highlight"),m("style"))}function q(){w&&z&&E&&(E.remove(),E=null,z.setAttribute("style",J));z&&(z.positionalProxy=null);w=!1;z=C=H=G=null}function x(a){try{return document.createTreeWalker(a)}catch(K){r.enabled=!1}return null}function u(){y();D=setInterval(function(){n()},r.wordCheckRate)}function y(){D&&(clearInterval(D),D=null)}var r={enabled:!1,
wordCheckRate:50,css:"",colorRoundingThreshold:75},B=[/"/g,/'/g,/\//g,/\\/g,/`/g,/-/g,/\(/g,/\)/g,/{/g,/}/g,/\[/g,/\]/g],A=/([ . !:;\u2013?,\n])/gi,D=null,w=!1,v=!1,C=null,z=null,G=null,F;Recite.Event.subscribe("Audio:started",function(){if(r.enabled&&!v){var a=Recite.Sizzle("recite.recite-selected");if(0<a.length){a=a[0];z&&z==a||(q(),w=!1,z=a);if(!w&&r.enabled&&!v&&z){E=document.createElement("reciteWordByWord");E.setAttribute("class","recite-word-by-word");E.setAttribute("data-recite-skip","true");
a=z.cloneNode(!0);H=getComputedStyle(z);e();var b=E;b:{var c=void 0;void 0==c&&(c=A);var d=x(a);if(null==d)c=a;else{var f=document.createElement(a.tagName);for(f.innerHTML=a.innerHTML;d.nextNode();){var g=d.currentNode;if(3==g.nodeType){var l=document.createElement("recitesentence");l.setAttribute("class","recite-ignore-styles-background recite-ignore-styles-color");for(var h=g.textContent.replace(/\u00a0/g," ").split(c),k=0;k<h.length;k++)if(""!=h[k].trim()){var m=document.createElement("reciteword");
m.innerText=h[k];var p=h[k];1<p.length&&(p=p.replace(/^[ '".,;:'`|\/?]/,""),p=p.replace(/[ '".,;:'`|\/?]+$/,""));"&"==p&&(p="&amp;");for(var F=0;F<B.length;F++)p=p.replace(B[F],"");m.setAttribute("data-word-value",p);m.setAttribute("class","recite-ignore-styles-background recite-ignore-styles-color");l.appendChild(m)}else m=document.createTextNode(h[k]),l.appendChild(m);h=x(f);if(null==h){c=a;break b}for(;h.nextNode();)k=h.currentNode,m=k.parentElement,3==k.nodeType&&k.textContent==g.textContent&&
"RECITEWORD"!=m.tagName&&(m.insertBefore(l,k),m.removeChild(k))}}c=f}}b.innerHTML=c.innerHTML;E.innerHTML!==a.innerHTML&&(z.parentNode.insertBefore(E,z),J=z.getAttribute("style"),E.style=r.css,E.style.color=H.color,z.setAttribute("style",J+" "+L),w=!0,z.positionalProxy=E)}y();G=null;n();u()}}});Recite.Event.subscribe("Audio:ended",d);Recite.Event.subscribe("Audio:rewind",l);Recite.Event.subscribe("Audio:forward",l);Recite.Event.subscribe("Translate:global-begin",a);Recite.Event.subscribe("Translate:restore_begin",
a);Recite.Event.subscribe("Translate:global-end",g);Recite.Event.subscribe("Translate:restore_complete",g);Recite.Event.subscribe("Preferences:load",k);Recite.Event.subscribe("Preferences:set",k);Recite.Event.subscribe("Preferences:reset",k);var I=!1,E=null,L=" ; display:none; color:transparent !IMPORTANT; background:transparent",J="",H=null;return{updateWordHighlight:function(){r.enabled&&!v&&n()},enable:function(){r.enabled=!0},disable:function(){q();r.enabled=!1},getOptions:function(){return r},
setOptions:function(a){r=Recite.Util.merge(r,a)},resetSection:function(){q()}}}();Recite.namespace("Style");
Recite.Style=function(){function k(a){var b=Recite.Sizzle("style[id=recite-style]");0===b.length?(b=a.createElement("style"),b.type="text/css",b.id="recite-style",b.setAttribute("data-recite-skip","true"),Recite.Sizzle("head",a)[0].appendChild(b)):b=b[0];return b}function f(){var b="",d=Recite.Preferences.get("style"),f=Recite.Preferences.get("textMode.enabled");null!==d.marginSize&&f&&(b+="#recite-wrapper, recitewordbyword, #recite-dictionary * { padding: 0 "+d.marginSize+"; } body { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; } ",
d.marginSize!==a.marginSize&&(a.marginSize=d.marginSize,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"margin: "+d.marginSize})));null!==d.textAlign&&f&&(b+="#recite-wrapper, recitewordbyword, #recite-dictionary * { text-align: "+d.textAlign+"; }",d.textAlign!==a.textAlign&&(a.textAlign=d.textAlign,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"textAlign: "+d.textAlign})));d.font&&null!==d.font.face&&(b+="[data-recite-shadow] *, #recite-wrapper, recitewordbyword, #recite-wrapper *, #recite-dictionary * { font-family: "+
d.font.face+" !important; }",d.font.face!==a.font.face&&(a.font.face=d.font.face,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"font-family: "+d.font.face})));d.font&&null!==d.font.size&&(b+=".recite-ele, recitewordbyword, #recite-dictionary * { font-size: "+d.font.size+"% !important; } ",d.font.size!==a.font.size&&(a.font.size=d.font.size,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"font-size: "+d.font.size+"%"})));if(d.font&&null!==d.font.color){var c=
"{color: "+d.font.color+"!important; text-shadow: none !important;}";for(f=0;f<e.foregroundColorSelectors.length;f++){var h=e.foregroundColorSelectors[f],k=":not(.recite-ignore-styles-color)";b+="#recite-wrapper "+h+k+" "+c;b+="[data-recite-shadow] "+h+k+" "+c}b=b+("#recite-wrapper "+c)+("#recite-dictionary * "+c)+("*::-webkit-input-placeholder "+c)+("*:-moz-placeholder "+c)+("*::-moz-placeholder "+c)+("*::-ms-input-placeholder "+c)+("input:not(.recite-colorpicker) "+c)+("textarea "+c)+("select "+
c)+("button "+c);d.font.color!==a.font.color&&(a.font.color=d.font.color,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"font-colour: "+d.font.color}))}if(d.link&&null!==d.link.color){c="{color: "+d.link.color+" !important;}";for(f=0;f<e.linkColorSelectors.length;f++)h=e.linkColorSelectors[f],k="",b+="#recite-wrapper "+h+k+" "+c,b+="[data-recite-shadow] "+h+k+" "+c;d.link.color!==a.link.color&&(a.link.color=d.link.color,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",
event:"link-colour: "+d.link.color}))}if(null!==d.backgroundColor){c="{background: "+d.backgroundColor+" !important; box-shadow: none !important;}";for(f=0;f<e.backgroundColorSelectors.length;f++)h=e.backgroundColorSelectors[f],k=":not(.recite-ignore-styles-background)",b+="#recite-wrapper "+h+k+" "+c,b+="[data-recite-shadow] "+h+k+" "+c;b=b+("body, html, #recite-wrapper, #recite-dictionary, #recite-dictionary * "+c)+("input:not(.recite-colorpicker) "+c)+("textarea "+c)+("select "+c)+("button:not(#recite-header button) "+
c);d.backgroundColor!==a.backgroundColor&&(a.backgroundColor=d.backgroundColor,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"background-colour: "+d.backgroundColor}))}d.ruler&&null!==d.ruler.color&&d.ruler.color!==a.ruler.color&&(a.ruler.color=d.ruler.color,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"ruler-colour: "+d.ruler.color}));d.screenMask&&null!==d.screenMask.color&&d.screenMask.color!==a.screenMask.color&&(a.screenMask.color=d.screenMask.color,
Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"screenMask-colour: "+d.screenMask.color}));null!==d.zoom&&void 0!==d.zoom&&(f=parseInt(d.zoom),k=f/100,b+="#recite-wrapper { -moz-transform: scale( "+k+" , "+k+" ); /* Moz-browsers */ zoom: "+k+"; /* Other non-webkit browsers */ zoom: "+f+"%; /* Webkit browsers*/ } ",d.zoom!==a.zoom&&(a.zoom=d.zoom,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"zoom: "+d.zoom})));null!==d.lineHeight&&(b+=".recite-ele, recitewordbyword, #recite-dictionary * { line-height: "+
d.lineHeight+"% !important; } ",d.lineHeight!==a.lineHeight&&(a.lineHeight=d.lineHeight,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"line-height: "+d.lineHeight+"%"})));null!==d.charSpacing&&(b+=".recite-ele, recitewordbyword, #recite-dictionary * { letter-spacing: "+d.charSpacing+"px !important; } ",d.charSpacing!==a.charSpacing&&(a.charSpacing=d.charSpacing,Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Style",event:"character-spacing: "+d.charSpacing+"px"})));
return b}function b(){var a=k(window.document);if(a.styleSheet)a.styleSheet.cssText=f();else{for(var b=window.document.createTextNode(f());a.hasChildNodes();)a.removeChild(a.lastChild);a.appendChild(b)}1==Recite.getOptions("shadowDomSupport")&&(b=Recite.Sizzle("[data-recite-shadow='true']"),Recite.Util.each(b,function(b,c){b=a.cloneNode(!0);b.setAttribute("id","recite-shadow-style");if("undefined"!=typeof c.shadowRoot){var d=c.shadowRoot.querySelectorAll("#recite-shadow-style");Recite.Util.each(d,
function(a,b){b.remove()});c.shadowRoot.appendChild(b)}}));Recite.Event.publish("Style:updated",{origin:"Recite.Style"})}var e={preserve_background_images:!1,foregroundColorSelectors:["*:not(a)"],linkColorSelectors:["a"],backgroundColorSelectors:["*"]},a={marginSize:null,font:{color:null,face:null,size:null},backgroundColor:null,link:{color:null},ruler:{color:null},screenMask:{color:null,opacity:1},zoom:null,lineHeight:null,charSpacing:null};Recite.Event.subscribe("Preferences:load",function(){b()});
Recite.Event.subscribe("Preferences:set",function(){b()});Recite.Event.subscribe("Preferences:reset",function(){b()});Recite.Event.subscribe("Recite:enable",function(){var a=Recite.Sizzle("body > *",document),b=Recite.Sizzle("body",document)[0];Recite.Debug.log("Recite.Style","Wrapping body elements in a recite-wrapper.");var e=document.createElement("div");e.id="recite-wrapper";Recite.Util.each(a,function(a,b){"true"!==b.getAttribute("data-recite-skipwrap")&&(b.parentNode.removeChild(b),e.appendChild(b))});
b.appendChild(e);Recite.Event.publish("Recite:Style:wrappedElements")});return{setOptions:function(a){e=Recite.Util.merge(e,a)},getOptions:function(){return e},update:b}}();Recite.namespace("Ruler");
Recite.Ruler=function(){function k(){Recite.Preferences.get("style.ruler.enabled")?Recite.Ruler.enable():Recite.Ruler.disable();e()}function f(d){var c=Recite.Sizzle("#recite-ruler",d);if(0==c.length){var e=Recite.Sizzle("body",d)[0];c=d.createElement("div");c.id="recite-ruler";c.style.backgroundColor=b();c.style.opacity=a.opacity;e.appendChild(c)}else c=c[0];return c}function b(){var b=Recite.Preferences.get("style.ruler.color");if(null==b||"null"==b||""==b.trim())b=a.backgroundColor;return b}function e(d){if(a.enabled&&
!g){clearTimeout(a.timeout);Recite.Util.unSetIFramePointerEvents();a.timeout=setTimeout(function(){Recite.Util.reSetIFramePointerEvents()},a.intent);var c=f(document),e=d?d.clientY:0;switch(a.mode){case "bottom":void 0!=d&&(c.style.bottom=0,c.style.top=e+a.modes.bottom.yOffset+"px");break;case "top":void 0!=d&&(c.style.top=0,c.style.height=e+a.modes.top.yOffset+"px");break;case "bar":void 0!=d&&(c.style.bottom="auto",c.style.top=e+a.modes.bar.yOffset+"px"),c.style.height=a.modes.bar.height+"px"}c.style.backgroundColor=
b();c.style.opacity=a.opacity}}var a={enabled:!1,mode:"bar",backgroundColor:"#000",opacity:1,modes:{top:{yOffset:-80},bottom:{yOffset:-80},bar:{yOffset:40,height:160}},timeout:null,intent:200},g=!1,d=null;Recite.Event.subscribe("Preferences:load",k);Recite.Event.subscribe("Preferences:set",k);Recite.Event.subscribe("Preferences:reset",k);return{setOptions:function(b){a=Recite.Util.merge(a,b)},enable:function(){if(Recite.Browser.isMobile())Recite.Debug.log("Recite.Ruler","Preventing load as feature not supported on mobile"),
Recite.Gui.Notification.show("This feature is not available on your platform.",{read:!1});else if(!g&&!a.enabled){Recite.Debug.log("Recite.Ruler","Enabled ruler");Recite.PlayerControls.disable();Recite.Player.stop();Recite.ScreenMask.disable();Recite.Magnifier.disable();Recite.Sizzle("body",document);f(document);if(null==d){var b=Recite.Sizzle("iframe");d=[];Recite.Util.each(b,function(a,b){d.push({frame:b,state:void 0==b.style.pointerEvents?"all":b.style.pointerEvents})})}Recite.Util.unSetIFramePointerEvents();
Recite.DomEvent.add(document,"mousemove",e);a.enabled=!0;Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Ruler",event:"enable"})}},disable:function(){if(a.enabled){Recite.Debug.log("Recite.Ruler","Disabled ruler");Recite.Util.reSetIFramePointerEvents();Recite.PlayerControls.enable();Recite.Preferences.set("style.ruler.enabled",!1);Recite.Sizzle("body",document);Recite.DomEvent.remove(document,"mousemove",e);var b=f(document);b.parentNode.removeChild(b);a.enabled=!1;Recite.Event.publish("Recite:ModuleEvent",
{name:"Recite.Ruler",event:"disable"});Recite.Event.publish("Recite.Dom.Observor:change")}},disableInstance:function(){g=!0},isEnabled:function(){return a.enabled}}}();Recite.namespace("ScreenMask");
Recite.ScreenMask=function(){function k(){Recite.Preferences.get("style.screenMask.enabled")?Recite.ScreenMask.enable():Recite.ScreenMask.disable();b()}function f(b){var d=Recite.Sizzle("#recite-screen-mask-top",b),c=Recite.Sizzle("#recite-screen-mask-bottom",b);if(0==d.length){var f=Recite.Sizzle("body",b)[0];d=b.createElement("div");d.id="recite-screen-mask-top";d.style.backgroundColor=e();d.style.opacity=a.opacity;f.appendChild(d)}else d=d[0];0==c.length?(f=Recite.Sizzle("body",b)[0],c=b.createElement("div"),
c.id="recite-screen-mask-bottom",c.style.backgroundColor=e(),c.style.opacity=a.opacity,f.appendChild(c)):c=c[0];return{top:d,bottom:c}}function b(b){if(!g){clearTimeout(a.timeout);Recite.Util.unSetIFramePointerEvents();a.timeout=setTimeout(function(){Recite.Util.reSetIFramePointerEvents()},a.intent);var d=f(document);if(a.enabled){var c=a.height/2;if(void 0!=b){var h=b.clientY+a.yOffset;b=h+c;c=h-c;d.top.style.height=(0<c?c:0)+"px";d.bottom.style.top=(0<b?b:0)+"px"}d.top.style.backgroundColor=e();
d.bottom.style.backgroundColor=e();d.top.style.opacity=a.opacity;d.bottom.style.opacity=a.opacity}}}function e(){var b=Recite.Preferences.get("style.screenMask.color");if(null==b||"null"==b||""==b.trim())b=a.backgroundColor;return b}var a={enabled:!1,height:160,yOffset:0,backgroundColor:"#000",opacity:1,timeout:null,intent:200},g=!1;Recite.Event.subscribe("Preferences:load",k);Recite.Event.subscribe("Preferences:set",k);Recite.Event.subscribe("Preferences:reset",k);return{setOptions:function(b){a=
Recite.Util.merge(a,b)},enable:function(){if(Recite.Browser.isMobile())Recite.Debug.log("Recite.ScreenMask","Preventing load as feature not supported on mobile"),Recite.Gui.Notification.show("This feature is not available on your platform.",{read:!1});else if(!g&&!a.enabled){Recite.Debug.log("Recite.ScreenMask","Enabled ScreenMask");Recite.PlayerControls.disable();Recite.Player.stop();Recite.Ruler.disable();Recite.Magnifier.disable();var d=Recite.Sizzle("body",document)[0];f(document);Recite.Util.unSetIFramePointerEvents();
Recite.DomEvent.add(d,"mousemove",b);a.enabled=!0;Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.ScreenMask",event:"enable"})}},disable:function(){if(a.enabled){Recite.Debug.log("Recite.ScreenMask","Disabled screen mask");Recite.Preferences.set("style.screenMask.enabled",!1);Recite.Util.reSetIFramePointerEvents();Recite.PlayerControls.enable();var d=Recite.Sizzle("body",document)[0];Recite.DomEvent.remove(d,"mousemove",b);d=f(document);var e=d.top.parentNode;e.removeChild(d.top);e.removeChild(d.bottom);
a.enabled=!1;Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.ScreenMask",event:"disable"});Recite.Event.publish("Recite.Dom.Observor:change")}},isEnabled:function(){return a.enabled},disableInstance:function(){g=!0}}}();Recite.namespace("Browser");
Recite.Browser=function(){function k(){e=f(n)||"unknown browser";a=b(navigator.userAgent)||b(navigator.appVersion)||"unknown version";g=f(c)||"unknown OS"}function f(a){for(var b=0;b<a.length;b++){var c=a[b].string,e=a[b].prop;d=a[b].versionSearch||a[b].identity;if(c){if(-1!==c.indexOf(a[b].subString))return a[b].subString}else if(e)return a[b].subString}return!1}function b(a){var b=a.indexOf(d);return-1===b?!1:parseFloat(a.substring(b+d.length+1))}var e,a,g,d,n=[{string:navigator.userAgent,subString:"Chrome",
identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,subString:"Opera",identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",
identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Internet Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],c=[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,
subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.userAgent,subString:"iPad",identity:"iPad"},{string:navigator.userAgent,subString:"Android",identity:"Andriod"},{string:navigator.platform,subString:"Linux",identity:"Linux"},{string:navigator.platform,subString:"Andriod",identity:"Andriod"}];return{getName:function(){k();return e},getVersion:function(){k();return a},getOS:function(){k();return g},getData:function(){k();return{name:e,version:a,OS:g}},isMobile:function(){return"Android"===
Recite.Browser.getOS()||"iPhone"===Recite.Browser.getOS()||"iPad"===Recite.Browser.getOS()?!0:!1}}}();Recite.namespace("Selection");
Recite.Selection=function(){function k(){var b="";"undefined"!==typeof window.getSelection?b=window.getSelection().toString():"undefined"!==typeof document.selection&&"Text"===document.selection.type&&(b=document.selection.createRange().text);return b.replace(/^\s+|\s+$/g,"")}var f={playOnSelection:!1};Recite.DomEvent.add(document,"mouseup",function(b){b=k();0<b.length&&(Recite.Event.publish("Selection:textSelection",{method:"selection",text:b}),f.playOnSelection&&Recite.Player.play(b))});return{setOptions:function(b){f=
Recite.Util.merge(f,b)},getOptions:function(){return f},getTextSelection:k}}();Recite.namespace("AudioDownload");
Recite.AudioDownload=function(){function k(b){Recite.Audio.AEBroker.stop();Recite.Audio.AEBroker.clearPlaylist();Recite.Gui.Notification.show("Your download file is being created. It will be automatically downloaded once created",{read:!1});Recite.Audio.AEBroker.setDownload(!0);Recite.PlayerDispatcher.dispatch(b);Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Audio",event:"download"})}var f={enabled:!0},b=!1;Recite.Event.subscribe("Selection:textSelection",function(e,a){"selection"===a.method&&
f.enabled&&b&&(k(a.text),b=!1)});return{setOptions:function(b){f=Recite.Util.merge(f,b)},getOptions:function(){return f},getEnabled:function(){return f.enabled},generateDownload:function(e){Recite.Debug.log("AudioDownload","Generate");f.enabled?(e=e||null)&&void 0!=e&&null!=e&&""!=e?(Recite.Debug.log("AudioDownload","Generate: "+e),k(e)):(Recite.Debug.log("AudioDownload","Listen for selection...."),Recite.Gui.Notification.show("Please select some text.",{read:!1}),b=!0):(Recite.Debug.log("AudioDownload",
"Disabled"),Recite.Gui.Notification.show("MP3 download functionality currently disabled",{read:!0}))},init:function(){}}}();Recite.namespace("TextMode");
Recite.TextMode=function(){function k(b,a){Recite.Util.each(b.styleSheets,function(b,d){a?"true"!==(d.ownerNode||d.owningElement).getAttribute("data-recite-skip")&&(d.prevState=d.disabled,d.disabled=!0):"undefined"!==typeof d.prevState?(d.disabled=d.prevState,d.prevState=null):d.disabled=!1})}var f={disableInlineStyles:!0,disableStylesheets:!0,hideElements:["img","iframe","object","embed"],textAlign:!1,defaultMarginSize:"30%"},b=[];Recite.Event.subscribe("Preferences:load",function(b,a){Recite.Preferences.get("textMode.enabled")&&
(b=Recite.Sizzle("#recite-wrapper")[0],Recite.TextMode.transform(b))});Recite.Event.subscribe("Preferences:set",function(b,a){b=Recite.Preferences.get("textMode.enabled");a=Recite.Sizzle("#recite-wrapper")[0];b?Recite.TextMode.transform(a):Recite.TextMode.restore(a)});Recite.Event.subscribe("Preferences:reset",function(){var b=Recite.Preferences.get("textMode.enabled"),a=Recite.Sizzle("#recite-wrapper")[0];!0===b?Recite.TextMode.transform(a):Recite.TextMode.restore(a)});return{setOptions:function(b){f=
Recite.Util.merge(f,b)},transform:function(e){if(!(0<=Recite.Util.inArray(e,b))){b.push(e);var a=e.ownerDocument;f.disableStylesheets&&k(a,!0);a=Recite.Sizzle("*",e);f.disableInlineStyles&&Recite.Util.each(a,function(a,b){null!==b.getAttribute("style")&&(b.setAttribute("data-recite-restore-style",b.getAttribute("style")),b.setAttribute("style",null))});f.textAlign&&Recite.Util.each(a,function(a,b){b&&b.style&&(b.style.textAlign&&b.setAttribute("data-recite-restore-text-align",b.style.textAlign),b.style.textAlign=
f.textAlign)});Recite.Util.each(f.hideElements,function(a,b){a=Recite.Sizzle(b,e);Recite.Util.each(a,function(a,b){b.setAttribute("data-recite-restore-display",Recite.Dom.getStyle(b,"display"));b.style.display="none"})});Recite.Preferences.get("style.marginSize")||Recite.Preferences.set("style.marginSize",f.defaultMarginSize);Recite.Event.publish("TextMode:enabled");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.TextMode",event:"enable"})}},restore:function(e){var a=Recite.Util.inArray(e,
b);if(!(0>a)){var g=e.ownerDocument;f.disableStylesheets&&k(g,!1);g=Recite.Sizzle("*",e);f.textAlign&&Recite.Util.each(g,function(a,b){null!==b.getAttribute("data-recite-restore-text-align")&&b.style?b.style.textAlign=b.getAttribute("data-recite-restore-text-align"):b.style.textAlign=null});f.disableInlineStyles&&Recite.Util.each(g,function(a,b){null!==b.getAttribute("data-recite-restore-style")&&(b.setAttribute("style",b.getAttribute("data-recite-restore-style")),b.setAttribute("data-recite-restore-style",
null))});Recite.Util.each(f.hideElements,function(a,b){a=Recite.Sizzle(b,e);Recite.Util.each(a,function(a,b){null!==b.getAttribute("data-recite-restore-display")&&(b.style.display=b.getAttribute("data-recite-restore-display"),b.setAttribute("data-recite-restore-display",null))})});b.splice(a,1);Recite.Event.publish("TextMode:disabled");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.TextMode",event:"disable"})}}}}();Recite.namespace("Recite.Dictionary");
Recite.Dictionary=function(){function k(){Recite.Preferences.get("dictionary.enabled")?Recite.Dictionary.enable():Recite.Dictionary.disable()}function f(){Recite.Sizzle("#recite-dictionary",document)[0].style.display="block";Recite.DomEvent.add(Recite.Sizzle("#recite-dictionary-inner-reveal",document)[0],"click",function(){if(""===Recite.Sizzle("#recite-dictionary-inner",document)[0].style.height){var a=Recite.Sizzle("#recite-dictionary-inner",document)[0],b=Recite.Dom.getWindowDimensions(window).height-
n.offsets.height;a.style.height=b+"px";a.style.overflow="auto";Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"enable"})}else a=Recite.Sizzle("#recite-dictionary-inner",document)[0],a.style.height="",a.style.overflow="hidden",Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"disable"})})}function b(b){var c=Recite.Sizzle("#recite-dictionary-inner-words",document)[0];c.innerHTML=b?"<h4>Recite English Dictionary</h4> <br /><br />"+b:"<h4>Recite English Dictionary</h4> <br /> Select one or more words to get definition";
b=Recite.Parser.Html.parse(c);Recite.PlayerControls.invoke(b);Recite.DomEvent.add(Recite.Sizzle(".recite-dictionary-synonym"),"click",function(b){a({text:b.target.innerHTML})})}function e(b,c){if("selection"===c.method){if(!h||""===c.text||!1===c.text||c.text===p)return!1;a(c);p=c.text}return!0}function a(a){b("Getting definition...");g(a.text.replace(/ /g,","),function(a){b("");var c="";Recite.Util.each(a,function(a,b){c+="<strong>"+unescape(b.word)+"</strong><br />"+unescape(b.definition)+"<br /><br />";
b.synonyms&&(c+="<strong>Synonyms</strong><br />",Recite.Util.each(b.synonyms,function(a,b){c+="<span class='recite-dictionary-synonym'>"+unescape(b)+"</span>,<br />"}),c+="<hr />")});b(c)})}function g(a,b){Recite.Debug.log("Recite.Dictionary","Start ajax");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"definition: "+a});Recite.Api.call("dictionary","POST",{data:{words:escape(a)},contentType:"application/json",success:b});return!1}function d(a,b){a=document.createElement("div");
a.id="recite-dictionary";a.setAttribute("data-recite-skip","true");a.innerHTML=n.content;document.body.appendChild(a);a.className="recite-dictionary-"+n.position;"header"!==n.position&&(a.style.width=n.dimensions.width,a.style.height=n.dimensions.height);b.call()}var n={offsets:{height:140},position:"top-left",dimensions:{width:"250px",height:"400px"},content:'<div id="recite-dictionary-inner"> <div id="recite-dictionary-inner-words"> </div> </div> <div id="recite-dictionary-inner-reveal"> </div>'},
c=null,h=!1,p=null;Recite.Event.subscribe("Recite.disable",function(){Recite.Dictionary.disable()});Recite.Event.subscribe("Preferences:load",k);Recite.Event.subscribe("Preferences:set",k);Recite.Event.subscribe("Preferences:reset",k);return{enable:function(){h||(0!==Recite.Dom.getLanguage(Recite.Sizzle("html")[0]).lastIndexOf("en",0)?Recite.Gui.Notification.show("Dictionary not available for this language."):(d(document,function(){f();b()}),c=Recite.Event.subscribe("Selection:textSelection",e),h=
!0,Recite.PlayerControls.disable(),Recite.Player.stop(),Recite.Debug.log("Recite.Dictionary","Dictionary enabled"),Recite.Gui.Notification.show("Recite dictionary enabled. Select any word on the page to view it's definition"),Recite.Event.publish("Recite.Dictionary.enabled"),Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"enable"})))},disable:function(){h&&(Recite.Sizzle("#recite-dictionary",document)[0].style.display="none",Recite.Event.unsubscribe(c),h=!1,Recite.PlayerControls.enable(),
Recite.Gui.Notification.show("Dictionary disabled"),Recite.Event.publish("Recite.Dictionary.disabled"),Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"disable"}))},isEnabled:function(){return h},setOptions:function(a){n=Recite.Util.merge(n,a)}}}();Recite.namespace("Docreader");
Recite.Docreader=function(){function k(b){-1===b.getAttribute("href").indexOf(a.endpoint)&&b.setAttribute("href",a.endpoint+encodeURI(f(b.getAttribute("href"))))}function f(a){var b=document.createElement("span");b.innerHTML='<a href="'+a.split("&").join("&amp;").split('"').join("&quot;").split("<").join("&lt;")+'">&nbsp;</a>';return b.firstChild.href}var b=[],e=["pdf"],a={enabled:!0,selector:"docreader",urlMatches:[],endpoint:"https://docreader.reciteme.com/doc/url?q="};return{setOptions:function(b){a=Recite.Util.merge(a,
b)},enabled:function(){return a.enabled},setEnabled:function(b){a.enabled=b},load:function(){if(a.enabled){b=document.getElementsByTagName("a");for(var f=0;f<b.length;f++){var d=b[f];if(null!==d.getAttribute("href")){for(var n=d,c=0;c<a.urlMatches.length;c++)null!==n.getAttribute("href").match(a.urlMatches[c])&&k(n);n=d;c=n.getAttribute("href").split(".").pop();for(var h=0;h<e.length;h++)c===e[h]&&k(n);-1===d.className.indexOf(" "+a.selector)&&-1===d.className.indexOf(a.selector+" ")&&d.className!==
a.selector&&d.getAttribute("id")!==a.selector||k(d)}}}}}}();Recite.namespace("Keyboard");
Recite.Keyboard=function(){function k(){Recite.Debug.log("Recite.Keyboard","Binding keyboard keys");f.enabled&&Recite.Util.each(f.key_bindings,function(b,e){Recite.Key(b,e)})}var f={enabled:!0,key_bindings:{"ctrl+right":function(){Recite.PlayerControls.next();return!1},"ctrl+left":function(){Recite.PlayerControls.previous();return!1},"ctrl+alt+p":function(){Recite.PlayerControls.play();return!1},"ctrl+alt+f":function(){Recite.Sizzle(".recite-sprite-button-font")[0].click();return!1},"ctrl+alt+c":function(){Recite.Sizzle(".recite-sprite-button-themes")[0].click();
return!1},"ctrl+r":function(){Recite.Sizzle(".recite-sprite-button-ruler")[0].click();return!1},"ctrl+d":function(){Recite.Sizzle(".recite-sprite-button-dictionary")[0].click();return!1},"ctrl+l":function(){Recite.Sizzle(".recite-sprite-button-translate")[0].click();return!1},"ctrl+x":function(){Recite.Sizzle(".recite-sprite-button-textmode")[0].click();return!1},"ctrl+m":function(){Recite.Sizzle(".recite-sprite-button-margin")[0].click();return!1},"ctrl+shift+o":function(){Recite.Sizzle(".recite-sprite-button-settings")[0].click();
return!1},"ctrl+s":function(){Recite.Sizzle(".recite-sprite-button-save")[0].click();return!1}}};Recite.Event.subscribe("Recite:enable",k);return{setOptions:function(b){f=Recite.Util.merge(f,b)},enabled:function(){return f.enabled},setEnabled:function(b){f.enabled=b},load:function(){k()}}}();Recite.namespace("Tracker");
Recite.Tracker=function(){var k={enabled:!0};return{setOptions:function(f){k=Recite.Util.merge(k,f);Recite.Tracker.Api.setOptions(k.Api);Recite.Tracker.Ga.setOptions(k.Ga)},track:function(f,b){Recite.Debug.log("Recite.Tracker",f);Recite.Tracker.Api.track(f,b);Recite.Tracker.Ga.track(f,b)}}}();Recite.namespace("Tracker.Ga");
Recite.Tracker.Ga=function(){var k={enabled:!1,trackerName:void 0};return{setOptions:function(f){k=Recite.Util.merge(k,f)},track:function(f,b){k.enabled?(window.hasOwnProperty=window.hasOwnProperty||Object.prototype.hasOwnProperty,window.hasOwnProperty("GoogleAnalyticsObject")&&"function"==typeof window[window.GoogleAnalyticsObject]&&(Recite.Debug.log("Recite.Tracker.Ga",f),window[window.GoogleAnalyticsObject](void 0==k.trackerName?"send":k.trackerName+".send","event","ReciteMe",f+": "+b))):Recite.Debug.log("Recite.Tracker.Ga",
"Not enabled, ignoring")}}}();Recite.namespace("Tracker.Api");
Recite.Tracker.Api=function(){var k={enabled:!0};return{setOptions:function(f){k=Recite.Util.merge(k,f)},track:function(f,b){if(k.enabled){Recite.Debug.log("Recite.Tracker.Api",f);var e={};e.type=f;e.value=b;e.uri=window.location.toString();e.referrer=window.document.referrer||null;Recite.Api.call("tracking","POST",{data:{events:[e],system_info:{type:"browser",recite_version:"3.2.59",screenWidth:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,screenHeight:window.innerHeight||
document.documentElement.clientHeight||document.body.clientHeight}},success:function(a){Recite.Debug.log("Recite.Tracker.Api","Tracked event type: "+f)}})}}}}();Recite.namespace("Language.Translate");
Recite.Language.Translate=function(){function k(){var a=Recite.Dom.getLanguage(p);null==a&&(a="en");if(null==m.sourceLanguage||m.sourceLanguage!=a)m.sourceLanguage=a;null==m.workingPageLanguage&&(m.workingPageLanguage=a);m.listenForPreferenceChanges?(Recite.Debug.log("Recite.Language.Translate","Listening for prerefrence changes"),Recite.Event.subscribe("Preferences:load",d),Recite.Event.subscribe("Preferences:set",d),Recite.Event.subscribe("Preferences:reset",d)):Recite.Debug.log("Recite.Language.Translate",
"NOT Listening for prerefrence changes")}function f(a){if("undefined"!=typeof a.getAttribute&&("true"===a.getAttribute("data-recite-skip")||null!=m.translateIgnore&&void 0!=a.getAttribute(m.translateIgnore)))return!1;if(m.ignoreSelectors)for(var c=0;c<m.ignoreSelectors.length;c++){var d=m.ignoreSelectors[c];if(b(a,d))return!1;for(var e=Recite.Dom.getAncestors(a),f=0;f<e.length;f++)if(b(e[f],d))return!1}return!0}function b(a,b){if("function"==typeof a.matches)return a.matches(b);if("function"==typeof a.matchesSelector)return a.matchesSelector(b);
if("function"==typeof a.mozMatchesSelector)return a.mozMatchesSelector(b);if("function"==typeof a.msMatchesSelector)return a.msMatchesSelector(b);if("function"==typeof a.oMatchesSelector)return a.oMatchesSelector(b);if("function"==typeof a.webkitMatchesSelector)return a.webkitMatchesSelector(b);b=document.querySelectorAll(b);for(var c=0;c<b.length;c++)if(b[c]==a)return!0;return!1}function e(a,b){var c={};Recite.Util.each(a,function(a,d){a=null;for("undefined"!=typeof d&&(a=d.childNodes[0]);null!==
a&&"undefined"!=typeof a;){var e=!f(a);if(!e&&3===a.nodeType&&0<a.nodeValue.trim().length){if("undefined"===typeof a.originalContent||null===a.originalContent){a.originalContent=a.nodeValue;var h=Recite.Dom.getLanguage(a);a.originalLang=null!==h?h:m.sourceLanguage;a.originalParentLang=a.parentNode.lang}if(a.originalLang===b||a.originalLang.split("-")[0]===b){if(a.nodeValue=a.originalContent,a.parentNode.lang=a.originalParentLang||null,null==a.parentNode.lang||"null"==a.parentNode.lang)a.parentNode.lang=
m.sourceLanguage}else h=a.originalLang.split("-")[0],"undefined"===typeof c[h]&&(c[h]=[]),c[h].push(a)}if(a.hasChildNodes()&&0>Recite.Util.inArray(a.tagName,m.disallowedTags)&&!e)a=a.firstChild;else{for(;null===a.nextSibling&&a!==d;)a=a.parentNode;a=a===d?null:a.nextSibling}}});return c}function a(a){var b=[];if("INPUT"===a.nodeName&&a.attributes&&a.attributes.type){var c=a.attributes.type.value.toLowerCase();if("submit"==c||"reset"==c||"button"==c)b=["value"]}"BUTTON"===a.nodeName&&(b=["value"]);
return m.translateableAttributes.concat(b)}function g(b,c){var d={};if(0===m.translateableAttributes.length)return d;Recite.Util.each(b,function(b,e){var h=null;for("undefined"!=typeof e&&(h=e.childNodes[0]);null!==h&&"undefined"!=typeof h;){h.affectedAttributes=[];var k=!1;if("undefined"!==typeof h.attributes&&null!==h.attributes){var g=a(h);if(f(h))for(var l=0;l<g.length;l++)for(b=0;b<h.attributes.length;b++)if(h.attributes[b].nodeName===g[l]){h.affectedAttributes.push(h.attributes[b].nodeName);
"undefined"===typeof h.originalContent&&(h.originalContent=[]);if("undefined"===typeof h.originalContent[g[l]]||null===h.originalContent[g[l]])h.originalContent[g[l]]=h.getAttribute(g[l]),h.originalLang=null!==Recite.Dom.getLanguage(h)?Recite.Dom.getLanguage(h):m.sourceLanguage,h.originalParentLang=h.parentNode.lang;if(h.originalLang===c||"string"===typeof h.originalLang&&h.originalLang.split("-")[0]===c)h.setAttribute(h.attributes[b].nodeName,h.originalContent[g[l]]),h.parentNode.lang=h.originalParentLang||
m.sourceLanguage,null==h.parentNode.lang&&(h.parentNode.lang=m.sourceLanguage),k=!0}k||"undefined"===typeof h.originalLang||(b=h.originalLang.split("-")[0],"undefined"===typeof d[b]&&(d[b]=[]),d[b].push(h))}if(h.hasChildNodes()&&0>Recite.Util.inArray(h.tagName,m.disallowedTags))h=h.firstChild;else{for(;null===h.nextSibling&&h!==e;)h=h.parentNode;h=h===e?null:h.nextSibling}}});return d}function d(){var a=Recite.Preferences.get("language");null==m.sourceLanguage&&k();var b=null===a?m.workingPageLanguage!=
m.sourceLanguage:a!=m.workingPageLanguage;b&&Recite.Event.publish("Translate:global-begin");if(null!==a){if(Recite.Language.Translate.translate(Recite.Sizzle("#recite-wrapper")[0],a),Recite.Language.Translate.translate(Recite.Sizzle("#recite-header")[0],a),Recite.getOptions("shadowDomSupport")){var c=Recite.Sizzle("[data-recite-shadow]");Recite.Util.each(c,function(b,c){"undefined"!=typeof c.shadowRoot&&Recite.Language.Translate.translate(c.shadowRoot,a)})}}else Recite.Language.Translate.restore(),
Recite.Language.Translate.setWorkingPageLaguage(a);b&&Recite.Event.publish("Translate:global-end");if(null!==a)var d=Recite.Event.subscribe("Translate:complete",function(){Recite.Language.Translate.setWorkingPageLaguage(a);Recite.Event.unsubscribe(d)})}function n(a,b,c){a&&(3===a.nodeType?(c&&(a.nodeValue=c),a.parentNode&&(a.parentNode.lang=b)):(c&&(a.innerHTML=t),a.lang=b))}var c=[],h=[],p=Recite.Sizzle("html")[0];Text.prototype.originalContent=null;Text.prototype.originalLang=null;Text.prototype.originalParentLang=
null;var m={sourceLanguage:"en",workingPageLanguage:null,maxChunkSize:100,maxCharacterLimit:3E3,disallowedTags:["SCRIPT","STYLE","NOSCRIPT"],translateableAttributes:["title","alt","placeholder"],translateIgnore:"data-recite-translate-skip",ignoreSelectors:[],listenForPreferenceChanges:!0};Recite.Event.subscribe("Recite.Dom.Observor:change",function(a,b){var c=Recite.Preferences.get("language");null!=c&&void 0!=b&&b.hasOwnProperty("affectedElements")&&Recite.Util.each(b.affectedElements,function(a,
b){Recite.Debug.log("Recite.Language.Translate","DOM observer detected change");Recite.Debug.log("Recite.Language.Translate",b);void 0==b.getAttribute("lang")&&(a=Recite.Dom.getLanguage(b.textContent),a=null===a?m.sourceLanguage:a,b.setAttribute("lang",a));Recite.Language.Translate.translate(b,c)})});return{init:function(){k()},setOptions:function(a){null!=a.sourceLanguage&&(a.workingPageLanguage=a.sourceLanguage);m=Recite.Util.merge(m,a)},getOptions:function(){return m},translate:function(a,b){if(Recite.Dom.getLanguage(a)!=
b||b!==m.sourceLanguage&&0!==b.indexOf(m.sourceLanguage)){Recite.Event.publish("Translate:begin",{"lang:":b});a=Recite.Util.isArray(a)?a:[a];var d=[],f=[];d=e(a,b);f=g(a,b);for(var k in f){var l=[];Recite.Util.each(f[k],function(a,b){for(a=0;a<b.affectedAttributes.length;a++)l.push(b.originalContent[b.affectedAttributes[a]])});a="null"!=k?k:m.sourceLanguage;var q=Recite.Language.Locale.stripLanguageLocale(a),p=Recite.Language.Locale.stripLanguageLocale(b);if(q==p||Recite.Language.Translate.getWorkingPageLanguage()==
p)Recite.Util.each(f[k],function(a,c){for(a=0;a<c.affectedAttributes.length;a++)c.lang=b;h.push(c)});else{var D={target:Recite.Language.Locale.stripLanguageLocale(b),source:a,text:l};Recite.Api.call("translate","POST",{data:D,contentType:"application/json",success:function(a){Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Language",event:"translate:"+b});for(var c in f)Recite.Util.each(f[c],function(c,d){for(c=0;c<d.affectedAttributes.length;c++)d.setAttribute(d.affectedAttributes[c],a[0]),
d.lang=b,a.shift&&a.shift();h.push(d)})}})}}for(k in d){var w=[],v=0,C=[];Recite.Util.each(d[k],function(a,b){if(null!==m.maxChunkSize&&C.length>=m.maxChunkSize||null!==m.maxCharacterLimit&&v>=m.maxCharacters)w.push(C),C=[],v=0;C.push(b.originalContent);v+=b.originalContent.length});w.push(C);Recite.Util.each(w,function(a,e){var f="null"!=k?k:m.sourceLanguage,h=Recite.Language.Locale.stripLanguageLocale(f),g=Recite.Language.Locale.stripLanguageLocale(b);h!=g?(D={target:Recite.Language.Locale.stripLanguageLocale(b),
source:f,text:e},Recite.Api.call("translate","POST",{data:D,contentType:"application/json",success:function(e){Recite.Util.each(e,function(e,h){e=d[f][a*m.maxChunkSize+e];n(e,b,h);c.push(e)});Recite.Event.publish("Translate:complete");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Language",event:"translate:"+b})}})):(g=Recite.Language.Locale.stripLanguageLocale(b),g==Recite.Language.Locale.stripLanguageLocale(m.sourceLanguage)&&Recite.Language.Translate.restore(b),Recite.Util.each(d[k],
function(a,c){n(c,b);Recite.Language.Translate.setWorkingPageLaguage(b)}),Recite.Event.publish("Translate:complete"),Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Language",event:"translate:"+b}))})}}else Recite.Language.Translate.restore()},restore:function(b){b?Recite.Language.Translate.setWorkingPageLaguage(b):Recite.Language.Translate.resetWorkingPageLanguage();0<c.length&&(Recite.Debug.log("Language","Restoring source language"),Recite.Event.publish("Translate:restore_begin"),Recite.Util.each(c,
function(a,c){c.nodeValue=c.originalContent;c.parentNode&&(c.parentNode.lang=b?b:null!==c.originalParentLang?c.originalParentLang:m.sourceLanguage)}),Recite.Util.each(h,function(c,d){var e=a(d);for(c=0;c<d.attributes.length;c++)for(var f=0;f<e.length;f++)e[f]===d.attributes[c].nodeName&&(d.setAttribute(d.attributes[c].nodeName,d.originalContent[d.attributes[c].nodeName]),d.lang=b?b:null!==d.originalLang?d.originalLang:m.sourceLanguage)}),c=[],h=[],Recite.Event.publish("Translate:restore_complete"))},
setWorkingPageLaguage:function(a){var b=Recite.Language.Locale.stripLanguageLocale(a);if(null!=b){if(null==p.originalLang||"undefined"==typeof p.originalLang)p.originalLang=Recite.Dom.getLanguage(p);"undefined"!=typeof p.getAttribute&&p.setAttribute("lang",a);m.workingPageLanguage=b}},getWorkingPageLanguage:function(){return Recite.Language.Locale.stripLanguageLocale(m.workingPageLanguage)},resetWorkingPageLanguage:function(){null===p.originalLang&&(p.originalLang=m.sourceLanguage);null!==p.originalLang&&
"undefined"!==typeof p.originalLang&&p.setAttribute("lang",p.originalLang);m.workingPageLanguage=m.sourceLanguage},hasActiveWorkingPageLanguage:function(){return m.workingPageLanguage!=m.sourceLanguage?!0:!1}}}();Recite.namespace("Language.Locale");
Recite.Language.Locale=function(){var k={skipLanguageLocaleExceptions:["zh"],localePreferences:{}};return{getLocalePreference:function(f){if(!f)return f;if(!Recite.Preferences.get("language"))for(var b in k.localePreferences)k.localePreferences.hasOwnProperty(f)&&(f=k.localePreferences[b]);return f.toLowerCase()},stripLanguageLocale:function(f){if(!f)return f;var b=f.split("-");return-1!=k.skipLanguageLocaleExceptions.indexOf(b[0])?f:b[0]},setOptions:function(f){k=Recite.Util.merge(k,f)},getOptions:function(){return k}}}();
Recite.namespace("Gui.Notification");
Recite.Gui.Notification=function(){function k(a){var b=document.createElement("div");b.innerHTML=a;b.id=n;b.content=a;b.setAttribute("role","alert");n++;var c=!1;Recite.Util.each(d,function(a,d){d.content==b.content&&(c=!0)});c||(d.push(b),document.body.appendChild(b));return b}function f(a){try{document.body.removeChild(a),d.splice(d.indexOf(a.id),1)}catch(h){}}function b(a,b){a.style.display="block";a.setAttribute("lang","en");g.timeout&&setTimeout(function(){f(a)},g.timeout);if(g.read)try{setTimeout(function(){Recite.Player.play(a.innerHTML)},
200)}catch(p){}g.localize&&setTimeout(function(){e(a)},200);Recite.DomEvent.add(a,"click",function(b,c){f(a)})}function e(b){var c=[];null==b?c=a():c.push(b);var d=null;Recite.Language.Translate.hasActiveWorkingPageLanguage()&&(d=Recite.Language.Translate.getWorkingPageLanguage());null==d&&(d=Recite.Dom.getLanguage(Recite.Sizzle("html")[0]));null!==d&&Recite.Language.Locale.stripLanguageLocale(d)!=Recite.Language.Translate.getOptions().sourceLanguage&&Recite.Util.each(c,function(a,b){"object"==typeof b&&
Recite.Language.Translate.translate(b,d)})}function a(){var a=Recite.Sizzle(".recite-notification");return 1<a.length?a:[]}var g={position:"top-right",timeout:4E3,read:!1,elementTopMgn:5,suppress:!1,localize:!0},d=[],n=0;return{show:function(a,d){g.suppress||Recite.Browser.isMobile()||(Recite.Gui.Notification.setOptions(d),a=k(a),a.className="recite-notification recite-notification-"+g.position,d=Recite.Sizzle(".recite-notification"),1<d.length&&(d=d[d.length-2],d=parseInt(d.offsetTop+d.offsetHeight+
g.elementTopMgn,10),a.style.top=d+"px"),b(a))},destroy:function(a){f(a)},setOptions:function(a){g=Recite.Util.merge(g,a)},getOptions:function(){return g},getActive:function(){return a()},localizeActive:function(){e()}}}();Recite.namespace("Gui.Modal");
Recite.Gui.Modal=function(){function k(a,b){Recite.DomEvent.add(c,"click",function(b){e();a.call()});Recite.DomEvent.add(h,"click",function(a){e();b.call()})}function f(a){var b=[];Recite.Util.each(Recite.Sizzle("#recite-modal [tabindex]"),function(a,c){b.push(c)});0<b.length&&(b[0].focus(),Recite.Key("tab",function(){if(document.activeElement==b[b.length-1])return b[0].focus(),!1}),Recite.Key("shift+tab",function(){if(document.activeElement==b[0])return b[b.length-1].focus(),!1}))}function b(){p||
(Recite.DomEvent.add(Recite.Sizzle("#recite-wrapper")[0],"click",function(a){Recite.Gui.Modal.hide()}),Recite.Key("enter",function(){null!=g&&document.activeElement.click()}),Recite.Key("esc",function(){null!=g&&h.click()}),p=!0)}function e(){if(null!=g){g.parentNode.removeChild(g);g=null;var a=Recite.Sizzle("#recite-wrapper")[0];a.setAttribute("class",a.getAttribute("class").replace(" recite-fade",""))}}function a(a){var b=[];null==a?null!=g&&b.push(g):b.push(a);if(0!=b.length){var c=null;Recite.Language.Translate.hasActiveWorkingPageLanguage()&&
(c=Recite.Language.Translate.getWorkingPageLanguage());null==c&&(c=Recite.Dom.getLanguage(Recite.Sizzle("html")[0]));null!==c&&Recite.Language.Locale.stripLanguageLocale(c)!=Recite.Language.Translate.getOptions().sourceLanguage&&Recite.Util.each(b,function(a,b){"object"==typeof b&&Recite.Language.Translate.translate(b,c)})}}var g=null,d=null,n=null,c=null,h=null,p=!1;Recite.Event.subscribe("Translate:restore_complete",a);Recite.Event.subscribe("Translate:complete",a);return{init:function(){b()},show:function(m,
l,q,p,u,y){b();e();if(null==g){var r=document.createElement("div");r.id="recite-modal";r.setAttribute("aria-modal","true");g=r;var B=document.createElement("div");B.id="recite-modal-header";r.appendChild(B);d=B;B=document.createElement("div");B.id="recite-modal-content";r.appendChild(B);n=B;B=document.createElement("div");B.id="recite-modal-buttons";r.appendChild(B);var A=document.createElement("a");A.id="recite-modal-button-ok";A.className="recite-modal-button";A.setAttribute("tabindex",9001);A.innerHTML=
"OK";B.appendChild(A);c=A;A=document.createElement("a");A.id="recite-modal-button-cancel";A.className="recite-modal-button";A.setAttribute("tabindex",9002);A.innerHTML="Cancel";B.appendChild(A);h=A;document.body.appendChild(r)}d.innerHTML=m;n.innerHTML=l;null!=q&&(c.innerHTML=q);null!=p&&(h.innerHTML=p);k(u,y);g.style.display="block";g.setAttribute("lang","en");f(g);m=Recite.Sizzle("#recite-wrapper")[0];m.setAttribute("class",m.getAttribute("class")+" recite-fade");a(g)},hide:function(){e()},localizeActive:function(){a()}}}();
Recite.namespace("Magnifier");
Recite.Magnifier=function(){var k;function f(){Recite.Preferences.get("magnifier.enabled")&&!u?Recite.Magnifier.enable():u&&!Recite.Preferences.get("magnifier.enabled")&&Recite.Magnifier.disable()}function b(){if(!m){if(y||!u)return!1;Recite.Debug.log("Recite.Magnifier","Rendering Magnifier ...");y=!0;if(r){q=document.createElement("div");q.className="magnifying_holder";q.id="magnifying_holder";x=document.createElement("div");x.className="magnifying_glass";x.id="magnifying_glass";q.appendChild(x);
var b=document.createElement("div");b.className="magnifying_handle";b.id="magnifying_handle";q.appendChild(b);document.body.appendChild(q)}b=document.createElement("div");b.className="magnifying_content";b.id="magnifying_content";b.innerHTML+=Recite.Sizzle("body")[0].innerHTML;e("magnifying_holder",b);g(Recite.Sizzle("#recite-header",b)[0],b);a("script",b);b.style.visibility="hidden";b.style.top=C+"px";b.style.left=v+"px";b.style.width=window.innerWidth+"px";b.style.height="auto";var c=window.getComputedStyle(Recite.Sizzle("body")[0],
null).getPropertyValue("padding-top");b.style.paddingTop=c;""!=Recite.Dom.getStyle(document.body,"background")&&(b.style.background=Recite.Dom.getStyle(document.body,"background"));x.appendChild(b);b.style.visibility="visible";l&&g(l,document);l=b;r&&(b=window.pageXOffset,q.style.top=window.pageYOffset+30+"px",q.style.left=b+30+"px",r=!1);y=!1}}function e(a,b){a=b.getElementsByClassName(a);Recite.Util.each(a,function(a,c){g(c,b)})}function a(a,b){a=b.getElementsByTagName(a);Recite.Util.each(a,function(a,
c){g(c,b)})}function g(a,b){try{a.parentNode.removeChild(a)}catch(F){Recite.Debug.log("Recite.Magnifier","Error "+F)}}function d(){document.onmousemove=function(a){var b=a.pageX-q.offsetWidth/2,c=-(Math.abs(a.pageY)*p.scale)+q.offsetHeight-20,d=-(Math.abs(a.pageX)*p.scale)+q.offsetWidth;q.style.top=a.pageY-q.offsetHeight/2+"px";q.style.left=b+"px";l.style.top=c+"px";l.style.left=d+"px"}}function n(){var a=document.getElementById("magnifying_holder");document.getElementById("magnifying_glass");var b=
document.getElementById("magnifying_content");Recite.DomEvent.add(b,"mousedown",function(a){var b=[];var c=Recite.Dom.getIndex(q),d=Recite.Dom.getPath(a.target);c=d.indexOf(c);--d[c];var e=Recite.Dom.getPath(l.querySelector("#recite-wrapper")),f=Recite.Dom.getPath(document.querySelector("#recite-wrapper"));--e[c];for(var k in e)-1>=f.indexOf(e[k])&&b.push(k);for(k in b)d.splice(b[0],1);b=Recite.Dom.getNode(d);a=a.target;"INPUT"==a.nodeName&&a.focus();try{Recite.Debug.log("Recite.Magnifier","simulate mousedown");
var g=h(w,{});d=a=null;for(var m in D)if(D[m].test("mousedown")){d=m;break}if(!d)throw new SyntaxError("Only HTMLEvents and MouseEvents interfaces are supported");if(document.createEvent)a=document.createEvent(d),"HTMLEvents"==d?a.initEvent("mousedown",g.bubbles,g.cancelable):a.initMouseEvent("mousedown",g.bubbles,g.cancelable,document.defaultView,g.button,g.pointerX,g.pointerY,g.pointerX,g.pointerY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,b),b.dispatchEvent(a);else{g.clientX=g.pointerX;g.clientY=
g.pointerY;var n=document.createEventObject();a=h(n,g);b.fireEvent("onmousedown",a)}}catch(M){Recite.Debug.log("Recite.Magnifier","Error "+M)}});Recite.DomEvent.add(a,"mousedown",function(a){a.preventDefault();this.setAttribute("data-drag",!0);this.setAttribute("data-dragMouseTop",a.pageY);this.setAttribute("data-dragMouseLeft",a.pageX);this.setAttribute("data-dragOffsetTop",parseInt(document.defaultView.getComputedStyle(this,null).getPropertyValue("top")));this.setAttribute("data-dragOffsetLeft",
parseInt(document.defaultView.getComputedStyle(this,null).getPropertyValue("left")))});Recite.DomEvent.add(document,"mousemove",function(a){k=a.pageX;A=a.pageY;if("true"==q.getAttribute("data-drag")){a=parseInt(q.getAttribute("data-dragOffsetLeft"))+(k-q.getAttribute("data-dragMouseLeft"));var b=parseInt(q.getAttribute("data-dragOffsetTop"))+(A-q.getAttribute("data-dragMouseTop"));q.style.top=b+60+"px";q.style.left=a+"px";b=-(b*p.scale)-q.offsetHeight/2;a=-(a*p.scale)-q.offsetWidth/2;l.style.top=
b+"px";l.style.left=a+"px";v=a;C=b}});Recite.DomEvent.add(window,"mouseup",function(a){q.setAttribute("data-drag",!1)})}function c(){var a=!1;window.onkeydown=function(b){17==b.keyCode&&(q.style.borderColor="#FF9600",q.style.pointerEvents="none",l.style.pointerEvents="none",a=1==a?!1:!0);if(192==b.keyCode){b=k;var c=A,d=q;d.setAttribute("data-dragMouseTop",c);d.setAttribute("data-dragMouseLeft",b);d.setAttribute("data-dragOffsetTop",c);d.setAttribute("data-dragOffsetLeft",b);b=k-q.offsetWidth/2;c=
A-q.offsetHeight/2;b=parseInt(q.getAttribute("data-dragOffsetLeft"))+(b-q.getAttribute("data-dragMouseLeft"));c=parseInt(q.getAttribute("data-dragOffsetTop"))+(c-q.getAttribute("data-dragMouseTop"));q.style.top=c+"px";q.style.left=b+"px";c=-(c*p.scale)-q.offsetHeight/2;b=-(b*p.scale)-q.offsetWidth/2;l.style.top=c+"px";l.style.left=b+"px";v=b;C=c}};window.onkeyup=function(b){0==a&&17==b.keyCode&&(q.style.borderColor="#333333",q.style.pointerEvents="inherit",l.style.pointerEvents="inherit",a=!1)}}function h(a,
b){for(var c in b)a[c]=b[c];return a}var p={realtimeRender:!0,followMouse:!1,scale:2,allowHighlights:!1,cacheImages:!0},m=!1,l=!1,q=!1,x=!1,u=!1,y=!1,r=!0,B=null;var A=k=0;var D={HTMLEvents:/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,MouseEvents:/^(?:click|hover|dblclick|mouse(?:down|up|over|move|out))$/},w={pointerX:0,pointerY:0,button:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,bubbles:!0,cancelable:!0},v=100,C=100;Recite.Event.subscribe("Preferences:load",
f);Recite.Event.subscribe("Preferences:set",f);Recite.Event.subscribe("Preferences:reset",f);return{enable:function(){if(Recite.Browser.isMobile())Recite.Debug.log("Recite.Magnifier","Preventing load as feature not supported on mobile"),Recite.Gui.Notification.show("This feature is not available on your platform.",{read:!1});else if(!u){u=!0;m||(Recite.Ruler.disable(),Recite.ScreenMask.disable(),b(),p.followMouse?d():n(),1==p.realtimeRender&&(B=Recite.Event.subscribe("Recite.Dom.Observor:change",
b)),p.allowHighlights&&c(),Recite.Debug.log("Recite.Magnifier","Magnifier enabled"),Recite.Gui.Notification.show("Recite magnifier enabled"),Recite.Event.publish("Recite.Magnifier.enabled"),Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Magnifier",event:"enable"}));for(var a=[window],e=0;e<a.length;e++)Recite.DomEvent.add(a[e],"resize",b)}},disable:function(){if(u){u=!1;g(q,document);r=!0;Recite.Event.unsubscribe(B);Recite.Debug.log("Recite.Magnifier","Magnifier disabled");Recite.Gui.Notification.show("Recite magnifier disabled");
Recite.Event.publish("Recite.Magnifier.disabled");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Magnifier",event:"disable"});Recite.Preferences.set("magnifier.enabled",!1);for(var a=[window],c=0;c<a.length;c++)Recite.DomEvent.remove(a[c],"resize",b)}},toggle:function(){Recite.Magnifier.isEnabled()?Recite.Magnifier.disable():Recite.Magnifier.enable()},isEnabled:function(){return u},setOptions:function(a){p=Recite.Util.merge(p,a)},disableInstance:function(){m=!0}}}();Recite.namespace("FrameUpdater");
Recite.FrameUpdater=function(){function k(a){var b=!1;a.hasOwnProperty("msgType")&&Recite.Util.each(u.validMessages,function(c,d){a.msgType==d&&(b=c)});return b}function f(a,b){if(c&&1==u.enable.post)for(var d=0;d<h.length;d++)("undefined"==typeof b||"undefined"!=typeof b&&-1==b.indexOf(h[d]))&&e(h[d],a)}function b(a){c&&1==u.enable.post&&e(window.top,a)}function e(a,b){if(c&&1==u.enable.post)try{var d=JSON.stringify(b);a.postMessage(d,"*")}catch(A){}}function a(a){if(c&&1==u.enable.listen&&"undefined"!=
typeof a.data)try{var b=JSON.parse(a.data);!1!==k(b)&&g(a)}catch(B){}}function g(a){var d=JSON.parse(a.data),g=k(d);if(0!=g&&c&&1==u.enable.listen){"setChildFrame"==g&&(h.push(a.source),e(a.source,{msgType:u.validMessages.HideControls}));"HideControls"==g&&(Recite.Controls.disable(),Recite.Controls.disableInstanceOverlay());"PreferencesSet"==g&&d.hasOwnProperty("payload")&&Recite.Preferences.set(d.payload);"PreferencesReset"==g&&d.hasOwnProperty("payload")&&Recite.Preferences.resetAll();"playerControlsShown"==
g&&(p&&f({msgType:u.validMessages.playerControlsShown},[a.source]),Recite.PlayerControls.hide(),Recite.PlayerControls.stop());"disable"==g&&(p&&f({msgType:u.validMessages.disable},[a.source]),Recite.disable(!0));if("playNext"==g&&d.hasOwnProperty("payload"))if(d.payload.hasOwnProperty("playParent"))p&&(l=null,setTimeout(function(){Recite.PlayerControls.next(x)},400));else if(d.payload.hasOwnProperty("src")){if(d.payload.src==window.self.location.href){var m={msgType:u.validMessages.setActiveChildFrame};
b(m);q=!0;Recite.PlayerControls.first()}}else d.payload.hasOwnProperty("playActiveChild")&&q&&(m=Recite.PlayerControls.next(),null==m&&"undefined"!=typeof m&&(m={msgType:u.validMessages.removeActiveChildFrame},b(m),q=!1,b({msgType:u.validMessages.playNext,payload:{playParent:!0,src:window.location.href}})));"playPrev"==g&&d.hasOwnProperty("payload")&&(d.payload.hasOwnProperty("playParent")?p&&(l=null,setTimeout(function(){Recite.PlayerControls.previous(x)},400)):d.payload.hasOwnProperty("src")?d.payload.src==
window.self.location.href&&(m={msgType:u.validMessages.setActiveChildFrame},b(m),q=!0,Recite.PlayerControls.last()):d.payload.hasOwnProperty("playActiveChild")&&q&&(m=Recite.PlayerControls.previous(),null==m&&"undefined"!=typeof m&&(m={msgType:u.validMessages.removeActiveChildFrame},b(m),q=!1,b({msgType:u.validMessages.playPrev,payload:{playParent:!0,src:window.location.href}}))));"setActiveChildFrame"==g&&(p?l=a.source:(l=null,q=!1));"removeActiveChildFrame"==g&&(p&&(m={msgType:u.validMessages.removeActiveChildFrame},
f(m,[a.source])),q=!1,l=null)}}function d(){var a={msgType:u.validMessages.PreferencesSet},c={msgType:u.validMessages.PreferencesReset},d={msgType:u.validMessages.playerControlsShown},e={msgType:u.validMessages.playNext},g={msgType:u.validMessages.playPrev};Recite.Event.subscribe("Preferences:set",function(){a.payload=Recite.Preferences.get();f(a)});Recite.Event.subscribe("Preferences:load",function(){a.payload=Recite.Preferences.get();f(a)});Recite.Event.subscribe("Preferences:reset",function(){c.payload=
Recite.Preferences.get();f(c)});Recite.Event.subscribe("Recite.Tooltip:show",function(){b({msgType:u.validMessages.removeActiveChildFrame});p?(f(d),l=null):(b(d),b({msgType:u.validMessages.setActiveChildFrame}),q=!0)});Recite.Event.subscribe("FrameUpdater:EnterFrame",function(a,b){b.hasOwnProperty("element")&&(b.hasOwnProperty("direction")&&"next"==b.direction?(e.payload={src:b.element.src},x=b.element,f(e)):b.hasOwnProperty("direction")&&"prev"==b.direction?(g.payload={src:b.element.src},x=b.element,
f(g)):(e.payload={src:b.element.src},x=b.element,f(e)))});p&&Recite.Event.subscribe("Recite:disable",function(a,b){f({msgType:u.validMessages.disable})})}function n(){Recite.Debug.log("FrameUpdater","Enabling");c||(window.top==window.self?p=!0:m=!0,c=1==u.enable.post||1==u.enable.listen,1==u.enable.listen&&window.addEventListener("message",a),1==u.enable.post&&d());m&&e(window.parent,{msgType:u.validMessages.setChildFrame});p&&(Recite.Util.each(window.frames,function(a,b){}),Recite.Util.each(Recite.Sizzle("iframe"),
function(a,b){Recite.DomEvent.add(b,"mouseover",function(){x=b})}))}var c=!1,h=[],p=null,m=null,l=null,q=!1,x=null,u={enabled:!1,enable:{post:!0,listen:!0},validOrigins:[window.location.origin],validDestinations:[window.location.origin],validMessages:{PreferencesSet:"Recite.PreferencesSet",PreferencesReset:"Recite.PreferencesReset",setChildFrame:"iknowittobetrue",playerControlsShown:"playerControlsShown",HideControls:"HideControls",playNext:"playNext",playPrev:"playPrev",setActiveChildFrame:"setActiveChildFrame",
removeActiveChildFrame:"removeActiveChildFrame",disable:"disable"},preferencesReloadDelay:100,parentSetDelay:1E3,maxTries:10};return{setOptions:function(a){u=Recite.Util.merge(u,a)},getOptions:function(){return u},load:function(){c||n()},disable:function(){c=!1},enabled:function(){return u.enabled},isActive:function(){return c},isParentFrame:function(){return p},isChildFrame:function(){return m},getActiveChildFrame:function(){return l},hasActiveChildFrame:function(){return p&&null!=l?!0:!1},activeFramePlayNext:function(){f({msgType:u.validMessages.playNext,
payload:{playActiveChild:!0}})},activeFramePlayPrev:function(){f({msgType:u.validMessages.playPrev,payload:{playActiveChild:!0}})}}}();

Back to list