seasons 0.9.3.beta6 → 0.9.3.beta7
Sign up to get free protection for your applications and to get access to all the features.
- data/seasons.gemspec +2 -2
- data/templates/project/treesaver-0.9.3b.js +113 -117
- metadata +2 -2
data/seasons.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{seasons}
|
5
|
-
s.version = "0.9.3.
|
5
|
+
s.version = "0.9.3.beta7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
|
8
8
|
s.authors = ["Scott Kellum"]
|
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.homepage = %q{http://www.treesaver.net/}
|
36
36
|
s.require_paths = ["lib"]
|
37
37
|
s.rubyforge_project = %q{seasons}
|
38
|
-
s.rubygems_version = %q{0.9.3.
|
38
|
+
s.rubygems_version = %q{0.9.3.beta7}
|
39
39
|
s.summary = %q{The Compass variant of the Seasons framework to style Treesaver.}
|
40
40
|
s.add_dependency(%q<compass>, ["~> 0.11"])
|
41
41
|
end
|
@@ -5,125 +5,121 @@ f,function(a){return c.render(a,b,d,!0)}):a?c.render(f,b,d,!0):""})},render_tags
|
|
5
5
|
f,this),c||this.send(a[h]);if(c)return a.join("\n")},set_delimiters:function(a){a=a.split(" ");this.otag=this.escape_regex(a[0]);this.ctag=this.escape_regex(a[1])},escape_regex:function(a){if(!arguments.callee.sRE)arguments.callee.sRE=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)","g");return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){var a=this.trim(a),d;b[a]===!1||b[a]===0||b[a]?d=b[a]:(this.context[a]===!1||this.context[a]===0||this.context[a])&&(d=this.context[a]);
|
6
6
|
return typeof d==="function"?d.apply(b):d!==void 0?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return String(a===null?"":a).replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case "&":return"&";case "\\":return"\\\\";case '"':return""";case "'":return"'";case "<":return"<";case ">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;else{var b=".";if(this.pragmas["IMPLICIT-ITERATOR"])b=this.pragmas["IMPLICIT-ITERATOR"].iterator;
|
7
7
|
var d={};d[b]=a;return d}},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);else{for(var d=[],c=a.length,e=0;e<c;e++)d.push(b(a[e]));return d}}};return{name:"mustache.js",version:"0.3.1-dev",to_html:function(a,b,d,c){var e=new j;if(c)e.send=c;e.render(a,b,d);if(!c)return e.buffer.join("\n")}}}();
|
8
|
-
(function(){'use strict';var g=void 0,
|
9
|
-
/mozilla/.test(
|
10
|
-
case "msie":return"ms";case "opera":return"O";default:return""}}();function
|
11
|
-
var
|
12
|
-
if("createElementNS"in document)var
|
13
|
-
var
|
14
|
-
if(!(
|
15
|
-
|
16
|
-
function
|
17
|
-
"horizontal":"vertical"));var a=document.documentElement.className;
|
18
|
-
function
|
19
|
-
function
|
20
|
-
function
|
21
|
-
function
|
22
|
-
|
23
|
-
|
24
|
-
function
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
I(b.
|
32
|
-
|
33
|
-
function
|
34
|
-
|
35
|
-
|
36
|
-
function
|
37
|
-
|
38
|
-
|
39
|
-
i.
|
40
|
-
function sc(a
|
41
|
-
|
42
|
-
function
|
43
|
-
function
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
function
|
48
|
-
|
49
|
-
function Ic(a,b){
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
function
|
62
|
-
|
63
|
-
|
64
|
-
function
|
65
|
-
function
|
66
|
-
function
|
67
|
-
function
|
68
|
-
n.
|
69
|
-
n.
|
70
|
-
|
71
|
-
|
72
|
-
function
|
73
|
-
|
74
|
-
function
|
75
|
-
|
76
|
-
(b
|
77
|
-
|
78
|
-
|
79
|
-
function
|
80
|
-
function
|
81
|
-
function
|
82
|
-
function
|
83
|
-
function
|
84
|
-
function
|
85
|
-
function
|
86
|
-
function
|
87
|
-
|
88
|
-
function
|
89
|
-
|
90
|
-
function
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
a.
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
function
|
108
|
-
function
|
109
|
-
function
|
110
|
-
|
111
|
-
function
|
112
|
-
|
113
|
-
function
|
114
|
-
function ye(
|
115
|
-
|
116
|
-
b}),a.vb=ba(),a.C-=b):a.C=a.C||0;a.Ba()}n.Ba=function(a){!a&&this.C?(lb(["animatePages","resumeTasks"]),a=1-(ba()-this.vb||0)/400,a=Math.max(0,Math.min(1,a)),(this.C=Math.round(this.C*a))?kb(this.Ba,"animatePages",this):(this.C=0,kb(mb,"resumeTasks"))):w("animatePages");this.i.forEach(function(a,c){a&&a.a&&Xb(a.a,this.da[c]+this.C,0)},this)};function ze(a){B(".container",a);this.r=a.hasAttribute("data-requires")?a.getAttribute("data-requires").split(" "):h;this.k=a.parentNode.innerHTML;this.size=new N(a);delete this.size.e;delete this.size.b}ze.prototype.N=function(){if(!this.s)this.s=!0,this.a=sb(this.k),this.p=B(".container",this.a)[0];return this.a};ze.prototype.v=function(){if(this.s)this.s=!1,this.a=h};ze.prototype.Ea=function(a){return Sb(this.size,a)};ze.prototype.ba=function(){return!this.r?!0:Xa(this.r,!0)};var $,Ae,pe;function Be(){var a=[];Pb("chrome").forEach(function(b){var c;c=b.getAttribute("data-requires");if(!c||Xa(c.split(" ")))$.ja.appendChild(b),c=new Vd(b),a.push(c),$.ja.removeChild(b)});return a}function Ce(){var a=[];Pb("lightbox").forEach(function(b){var c;c=b.getAttribute("data-requires");if(!c||Xa(c.split(" ")))$.ja.appendChild(b),c=new ze(b),a.push(c),$.ja.removeChild(b)});return a}
|
117
|
-
function De(){if($.orientation!==window.orientation)Ua(),$.orientation=window.orientation,$.orientation%180?$.viewport.setAttribute("content","width=device-height, height=device-width"):$.viewport.setAttribute("content","width=device-width, height=device-height"),va&&!ea&&!Ia&&window.scrollTo(0,0)}function oe(){if(r||!ea)return(window.pageYOffset||window.pageXOffset)&&window.scrollTo(0,0),{e:window.innerWidth,b:window.innerHeight};else{var a=q;return{e:Tb(a),b:J(a)}}}
|
118
|
-
function Ee(){var a=oe(),b;if(a.b!==$.size.b||a.e!==$.size.e){$.size=a;if(!$.G||!$.G.ba()||!$.G.Ea(a)){b=Ae;var c,d,e,f=h;for(c=0,d=b.length;c<d;c+=1)if(e=b[c],e.ba()&&e.Ea(a)){f=e;break}b=f;if(!b)return;pb($.ja);$.G&&$.G.v();$.ja.appendChild(b.N());$.G=b;C(document,"treesaver.chromechanged",{node:b.a})}b=$.G;K(b.a,"width",a.e);K(b.a,"height",a.b);b.hb=h;b.hb={e:Tb(b.T),b:J(b.T)};O&&(Zd(b),kb(b.Vb,"updateTOC",b))}}
|
119
|
-
if(r){var Fe=function(a){return function(){$.G&&Xd($.G);a()}};p("treesaver.nextPage",Fe(Nd));p("treesaver.previousPage",Fe(Id));p("treesaver.nextArticle",Fe(Md));p("treesaver.previousArticle",Fe(Hd))};/*
|
8
|
+
(function(){'use strict';var g=void 0,i=null,n;window.Cc=!0;var aa=this,o=Date.now||function(){return+new Date};function p(a,b){var c=a.split("."),d=aa;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&b!==g?d[e]=b:d=d[e]?d[e]:d[e]={}};var ba={},r,da,ea,fa;if(!1 in Array)Array.isArray=function(a){return Object.prototype.toString.apply(a)==="[object Array]"};function ga(a){return Array.prototype.slice.call(a,0)}function ha(a,b){var c=a.slice(b+1||a.length);a.length=b<0?a.length+b:b;a.push.apply(a,c)};p("treesaver.VERSION","0.9.2-299-gb431024");var ia,ja,t=window.navigator.userAgent.toLowerCase(),ka=document.compatMode!=="BackCompat"&&"XMLHttpRequest"in window&&"addEventListener"in document&&"getComputedStyle"in window&&"querySelectorAll"in document&&"localStorage"in window&&"JSON"in window,v=!!window.TS_WITHIN_NATIVE_IOS_APP,ma=v||la==="android"||/mobile/.test(t),na=window.screen.width<=600,oa=v?"safari":/webkit/.test(t)?/chrome|safari/.test(t)?/(chrome|safari)/.exec(t)[0]:"webkit":/opera/.test(t)?"opera":/msie/.test(t)?"msie":!/compatible/.test(t)&&
|
9
|
+
/mozilla/.test(t)?"mozilla":"unknown",la=(/(android|ipad|iphone|ipod|win|mac|linux)/.exec(window.navigator.platform?window.navigator.platform.toLowerCase():/android/.test(t)?"android":"unknown")||["unknown"])[0],pa=function(){switch(oa){case "chrome":case "safari":case "webkit":return"-webkit-";case "mozilla":return"-moz-";case "msie":return"-ms-";case "opera":return"-o-";default:return""}}(),qa=function(){switch(oa){case "chrome":case "safari":case "webkit":return"Webkit";case "mozilla":return"Moz";
|
10
|
+
case "msie":return"ms";case "opera":return"O";default:return""}}();function ra(a,b,c){var d=document.documentElement.style,b=b&&qa?qa+a[0].toUpperCase()+a.substr(1):!1;return!c&&typeof d[a]!=="undefined"||!!b&&typeof d[b]!=="undefined"}
|
11
|
+
var ta=v||"orientation"in window,ua=v||"createTouch"in document||/android/.test(t),va=!v&&function(){if(window.navigator.plugins&&window.navigator.plugins.length)return!!window.navigator.plugins["Shockwave Flash"];else if("ActiveXObject"in window)try{return!!new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(a){}return!1}(),wa="CSSFontFaceRule"in window,xa="getContext"in document.createElement("canvas");
|
12
|
+
if("createElementNS"in document)var ya="createElementNS"in document&&"createSVGRect"in document.createElementNS("http://www.w3.org/2000/svg","svg"),za=ya&&/SVG/.test(document.createElementNS("http://www.w3.org/2000/svg","animate").toString()),Aa=ya&&/SVG/.test(document.createElementNS("http://www.w3.org/2000/svg","clipPath").toString());var Ba,Ca=document.createElement("div");Ca.innerHTML="<svg/>";Ba=(Ca.firstChild&&Ca.firstChild.namespaceURI)=="http://www.w3.org/2000/svg";
|
13
|
+
var Da="canPlayType"in document.createElement("video"),Ea="localStorage"in window,Fa=!v&&"applicationCache"in window,Ga=v||window.navigator.standalone,Ha=v||ra("transformProperty")||ra("transform",!0,!0),Ia;
|
14
|
+
if(!(Ia=v)){var Ja=ra("perspectiveProperty")||ra("perspective",!0,!0);if(Ja&&"WebkitPerspective"in document.documentElement.style&&oa!=="safari"){var Ka=document.createElement("style"),La=document.createElement("div"),Ma="@media (perspective)",Na;Ma+=",("+pa+"perspective)";Ka.textContent=Ma+"{#ts-test {height:3px}}";La.setAttribute("id","ts-test");document.documentElement.appendChild(Ka);document.documentElement.appendChild(La);Na=La.offsetHeight===3;document.documentElement.removeChild(Ka);document.documentElement.removeChild(La);
|
15
|
+
Ja=Na}Ia=Ja}var Pa=Ia,Qa=v||ra("transitionProperty",!0);function w(a){return a?"":"no-"}var Ra=!1;
|
16
|
+
function Sa(){ia||(ia=[],ia.push("js",w(xa)+"canvas",w(Ea)+"localstorage",w(Da)+"video",w(Fa)+"applicationcache",w(wa)+"fontface",w(ua)+"touch",w(Ha)+"csstransforms",w(Pa)+"csstransforms3d",w(Qa)+"csstransitions",w(ya)+"svg",w(Ba)+"inlinesvg",w(za)+"smil",w(Aa)+"svgclippaths",w(ka)+"treesaver",w(va)+"flash",w(ta)+"orientation",w(Ga)+"fullscreen",w(ma)+"mobile",w(na)+"smallscreen",w(x.nc())+"cached",w(v)+"nativeapp","browser-"+oa,"os-"+la));ja=[w(!x.cb())+"offline"];ta&&ja.push("orientation-"+(window.orientation?
|
17
|
+
"horizontal":"vertical"));var a=document.documentElement.className;Ra||(Ra=!0,a=a?a.replace(/no-js|no-treesaver/g,""):"",a+=" "+ia.join(" "));Ta.lastIndex=0;a=a.replace(Ta,"");a+=" "+ja.join(" ");document.documentElement.className=a.split(/\s+/).join(" ")}var Ua=["offline","orientation-vertical","orientation-horizontal"],Ta=function(){var a=Ua.map(function(a){return"((no-)?"+a+")"});return RegExp(a.join("|"),"g")}();
|
18
|
+
function Va(a,b){return!a.length?!0:a.every(function(a){var d=a.substr(0,3)==="no-",a=d?a.substr(3):a,e=ia.concat(b?ja:[]);return d?e.indexOf(a)===-1:e.indexOf(a)!==-1?!0:!b&&Ua.indexOf(a)!==-1?!0:!1})};var Wa=[],Xa={},Ya=i,Za=-1,$a=-1,ab=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,25)},bb=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.clearTimeout;
|
19
|
+
function cb(){var a=o();Wa.forEach(function(b,c){if(Za!==-1&&!b.Qb&&(!Ya||b.name&&Ya.indexOf(b.name)!==-1)&&!(a-b.eb<=b.kc)){b.eb=a;b.qb-=1;if(b.qb<=0&&(!b.Fb||b.qb<0))if(ha(Wa,c),delete Xa[b.name],b.Fb)return;b.gc.apply(b.oc,b.bc)}});Za=-1;Wa.length&&Za===-1&&(Za=ab.call(window,cb,document.body))}
|
20
|
+
function db(a,b,c,d,e,f,h){var s=o(),k=f?Xa[f]:i;k||(k={gc:a,name:f,oc:h,eb:e?-Infinity:s},Wa.push(k),f&&(Xa[f]=k));k.bc=d||[];k.qb=c;k.kc=Math.max(b,25);k.Fb=e;k.Qb=!1;Za===-1&&(Za=ab.call(window,cb,document.body))}function eb(a,b,c,d,e){db(a,b,1,c,!1,d,e)}function fb(a,b,c){db(a,0,1,[],!1,b,c)}function gb(a){Ya=a;$a!==-1&&window.clearTimeout($a)}function hb(){Ya=i;$a!==-1&&(window.clearTimeout($a),$a=-1)}function A(a){delete Xa[a];Wa.forEach(function(b,c){if(b.name===a)ha(Wa,c),b.Qb=!0})};o();if("Node"in window&&Node.prototype&&!("contains"in Node.prototype))Node.prototype.contains=function(a){return!!(this.compareDocumentPosition(a)&16)};
|
21
|
+
if("classList"in document.documentElement)var B=function(a,b){b.split(/\s+/).forEach(function(b){a.classList.add(b)})},kb=function(a,b){return a.classList.remove(b)},C=function(a,b){return a.classList.contains(b)},lb=function(a){return ga(a.classList)};else B=function(a,b){a.className?C(a,b)||(a.className+=" "+b):a.className=b},kb=function(a,b){a.className=a.className.replace(RegExp("(^|\\s)"+b+"(\\s|$)"),"$2")},C=function(a,b){return!(!a.className||!RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className))},
|
22
|
+
lb=function(a){return!a.className?[]:a.className.split(/\s+/)};function D(a,b){b||(b=document);return ga(b.querySelectorAll(a))}function mb(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function nb(a){if("outerHTML"in a)return a.outerHTML;var a=a.cloneNode(!0),b;ob.appendChild(a);b=ob.innerHTML;ob.removeChild(a);return b}function pb(a){ob.innerHTML=a;a=ob.firstChild;mb(ob);return!a||a.nodeType!==1?i:a}
|
23
|
+
function qb(a,b){for(var c=a,d=b.toUpperCase();(c=c.parentNode)!==i&&c.nodeType===1;)if(c.nodeName===d)return c;return i}var rb=[];function sb(a){rb.push(a);a.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=");var a=tb,b=[];Xa.clearImgCache||db(a,3E3,1,b,!0,"clearImgCache",g)}function tb(){rb=[]}var ob=document.createElement("div");ob.style.display="none";function E(a,b,c){var d=document.createEvent("UIEvents"),e;d.initEvent(b,!1,!0);if(c)for(e in c)d[e]=c[e];a.dispatchEvent(d)}function ub(a,b,c){a.addEventListener(b,c,!1)}function vb(a,b,c){a.removeEventListener(b,c,!1)}p("treesaver.addListener",ub);p("treesaver.removeListener",vb);function wb(a,b,c){c=c?window.localStorage:window.sessionStorage;c.removeItem(a);try{c.setItem(a,window.JSON.stringify(b))}catch(d){}}function xb(a){return(a=window.sessionStorage.getItem(a)||window.localStorage.getItem(a))?window.JSON.parse(a):i};var yb,zb,Ab,Bb="pushState"in window.history;function Cb(){var a=document.location.href.indexOf("#");return a===-1?"":document.location.href.substr(a+1)}if(document.location.hash){var Db=Cb();Db[0]==="-"&&Db.length>=2&&document.location.replace(Db.substr(1))}zb=function(a,b,c){window.history.pushState(a,b,c)};yb=function(a,b,c){window.history.replaceState(a,b,c)};
|
24
|
+
if(!Bb){zb=function(a,b,c){Eb(a,b,c,!1)};yb=function(a,b,c){Eb(a,b,c,!0)};var Eb=function(a,b,c,d){var e="-"+window.escape(c);wb("history:"+e,{state:a,title:b});c===document.location.pathname&&(e="");Ab=e;d?document.location.replace("#"+e):document.location.hash="#"+e};window.onhashchange=function(){var a=Cb();a!==Ab&&(a=(Ab=a)?xb("history:"+a):{},E(window,"popstate",{state:a?a.state:i}))}};var x={Zb:1E4,Eb:{ac:"treesaver.online",$b:"treesaver.offline"},Xb:["offline","online"],Wb:"uncached,idle,checking,downloading,updateready,obsolete".split(","),Ha:!1};x.load=function(){if(!x.Ha)x.Ha=!0,x.Xb.forEach(function(a){ub(document,a,x)}),Fa&&x.fb&&x.Wb.forEach(function(a){ub(window.applicationCache,a,x)})};x.zc=function(){if(x.Ha)x.Ha=!1,x.Xb.forEach(function(a){vb(window,a,x)}),Fa&&x.fb&&x.Wb.forEach(function(a){vb(window.applicationCache,a,x)})};
|
25
|
+
x.Mb="onLine"in window.navigator?window.navigator.onLine:!0;x.cb=function(){return x.Mb};x.Tb=function(a){x.Mb=a;Sa();E(window,a?x.Eb.ac:x.Eb.$b)};x.fb=Fa&&!!window.applicationCache.status;x.nc=function(){return x.fb};x.handleEvent=function(a){switch(a.type){case "online":x.Tb(!0);break;case "offline":x.Tb(!1);break;case "updateready":window.applicationCache.swapCache()}};x.sc=/^https?:\/\//i;x.oa=function(a){if(a&&a[0]==="/"||x.sc.test(a))return a;var b=document.createElement("a");b.href=a;return b.href};
|
26
|
+
x.get=function(a,b,c){var d={M:new XMLHttpRequest,url:a,yb:b};eb(function(){x.tc(d)},c||x.Zb,[],x.Kb(d));d.M.onreadystatechange=x.fc(d);try{d.M.open("GET",d.url,!0),d.M.send(i)}catch(e){x.ob(d)}};x.Kb=function(a){return"fetch:"+a.url};x.fc=function(a){return function(){a.M.readyState===4&&(a.M.status===0||a.M.status===200||a.M.status===304?(a.yb(a.M.responseText,a.url),x.Bb(a)):x.ob(a))}};x.Bb=function(a){A(x.Kb(a));a.M.onreadystatechange=i};x.ob=function(a){a.yb(i,a.url);x.Bb(a)};
|
27
|
+
x.tc=function(a){a.M.abort();x.ob(a)};var Fb,Gb,Hb,Ib=/<body>\s*([\s\S]+?)\s*<\/body>/i;function Jb(a){return(a=Ib.exec(a))&&a[1]?a[1]:i}function Kb(a){Hb=document.createElement("div");if(a&&(a=Jb(a))){var b=document.createElement("div");b.style.display="none";b.innerHTML=a;ga(b.childNodes).forEach(function(a){/^div$/i.test(a.nodeName)&&Hb.appendChild(a)});mb(b)}Lb()}function Lb(){Fb=Mb;var a=Gb.slice(0);Gb=[];a.forEach(function(a){a()})}function Nb(a){return Hb?D("."+a,Hb):[]}var Mb=2;var Ob=document.createElement("style");Ob.setAttribute("type","text/css");D("head").length&&(D("head")[0].appendChild(Ob),Ob=document.styleSheets[document.styleSheets.length-1],Ob.insertRule(".offscreen{position:absolute;top:-200%;right:-200%;visibility:hidden;}",0),Ob.insertRule(".viewer .grid{top:50%;left:50%;margin:0}",0));var Pb=/^-?\d+(?:px)?$/i;function Qb(a,b){if(!a)return!1;var c=a.m||a.m===0?a.m:a.b;return b.e>=(a.K||a.K===0?a.K:a.e)&&b.b>=c&&b.e<=a.Ia&&b.b<=a.V}function I(a){return a&&Pb.test(a)?parseFloat(a)||0:i}function J(a){return a&&a.offsetHeight||0}function Rb(a){return a&&a.offsetWidth||0}function K(a,b,c){a.style[b]=c+"px";return c}function Sb(a,b){"transformProperty"in a.style?a.style.transformProperty=b:a.style[qa+"Transform"]=b}function Tb(a,b,c){Sb(a,"translate("+b+"px,"+c+"px)")}
|
28
|
+
Pa&&(Tb=function(a,b,c){Sb(a,"translate3d("+b+"px,"+c+"px,0)")});function Wb(a,b){return Math.ceil(a)+b-a%b}
|
29
|
+
function L(a){if(a){var b=document.defaultView.getComputedStyle(a,i);a.getAttribute("style");this.display=b.display;this.position=b.position;this.marginTop=I(b.marginTop)||0;this.marginBottom=I(b.marginBottom)||0;this.marginLeft=I(b.marginLeft)||0;this.marginRight=I(b.marginRight)||0;this.marginHeight=this.marginTop+this.marginBottom;this.marginWidth=this.marginLeft+this.marginRight;this.borderTop=I(b.borderTopWidth);this.borderBottom=I(b.borderBottomWidth);this.borderLeft=I(b.borderLeftWidth);this.borderRight=
|
30
|
+
I(b.borderRightWidth);this.paddingTop=I(b.paddingTop);this.paddingBottom=I(b.paddingBottom);this.paddingLeft=I(b.paddingLeft);this.paddingRight=I(b.paddingRight);this.F=this.borderTop+this.paddingTop;this.ga=this.borderBottom+this.paddingBottom;this.O=this.F+this.ga;this.cc=this.borderLeft+this.paddingLeft;this.dc=this.borderRight+this.paddingRight;this.Ca=this.cc+this.dc;this.Q=Rb(a);this.n=J(a);this.e=this.Q-this.Ca;this.b=this.n-this.O;this.K=I(b.minWidth)||0;this.m=I(b.minHeight)||0;a=I(b.maxWidth);
|
31
|
+
this.Ia=!a||a===-1?Infinity:a;a=I(b.maxHeight);this.V=!a||a===-1?Infinity:a;this.lineHeight=I(b.lineHeight)||i}}L.prototype.H=function(){var a=new L,b;for(b in this)a[b]!==this[b]&&(a[b]=this[b]);return a};function Xb(a,b,c){this.X=a;this.u=b;this.g=c}var Yb=new Xb(Infinity,Infinity,Infinity);Xb.prototype.wb=function(){return!this.X&&!this.u&&!this.g};function Zb(a,b){if(a.X!==b.X)return b.X-a.X;else if(a.g!==b.g)return a.g-b.g;return b.u-a.u}Xb.prototype.H=function(){return new this.constructor(this.X,this.u,this.g)};function $b(){this.g=this.f=this.index=0;this.t=[];this.la=[];this.va=0}$b.prototype.H=function(){var a=new this.constructor;a.index=this.index;a.f=this.f;a.g=this.g;a.J=this.J;a.t=this.t.slice(0);a.la=this.la.slice(0);a.va=this.va;return a};$b.prototype.Z=function(a){return!!a&&a.index===this.index&&a.f===this.f&&a.g===this.g&&a.t.length===this.t.length};
|
32
|
+
function ac(a,b){if(a.g)return!1;var c,d,e;for(c=a.index,d=b.k.length;c<d;c+=1){e=b.k[c];if(!e.Ga)return!1;if(!bc(a,c)&&!e.u.ca)return!1}if(!a.t.length&&a.f===b.o.length)return!0;for(c=a.t.slice(0);c.length;)if(e=b.o[c.pop()],!e.ca)return!1;for(c=a.f,d=b.o.length;c<d;c+=1)if(e=b.o[c],!e.ca)return!1;return!0}function cc(a,b){var c;if(b<a.f)(c=a.t.indexOf(b))!==-1?ha(a.t,c):(c=a.la.indexOf(b))!==-1&&ha(a.la,c);else{if(b>a.f)for(;a.f<b;a.f+=1)a.t.push(a.f);a.f=b+1}}
|
33
|
+
function dc(a,b){a.t.indexOf(b)===-1&&(cc(a,b),a.t.push(b))}function bc(a,b){return a.f<=b?!1:a.t.indexOf(b)!==-1?!1:a.la.indexOf(b)!==-1?!1:!0};function ec(a,b,c,d){this.l=a;this.K=parseInt(b||0,10);this.m=parseInt(c||0,10);this.r=d}ec.prototype.ba=function(){return!this.r?!0:Va(this.r,!0)};function fc(a,b,c){c&&B(b,c);b.innerHTML=a.l;D("img[data-src], iframe[data-src], video[data-src], source[data-src], audio[data-src]",b).forEach(function(a){a.setAttribute("src",a.getAttribute("data-src"))})};if(!1 in String.prototype)String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};function gc(a,b,c){this.Dc=c.index;this.f=c.f;c.f+=1;this.ma=i;this.q={};this.ca=!C(a,"required");this.Yb=C(a,"zoomable");this.La=C(a,"scroll");ga(a.childNodes).forEach(function(a){if(a.nodeType!==1)a.data&&a.data.trim();else{var b=a.getAttribute("data-sizes"),c=parseInt(a.getAttribute(a.hasAttribute("width")?"width":"data-minwidth"),10),h=parseInt(a.getAttribute(a.hasAttribute("height")?"height":"data-minheight"),10),s=a.hasAttribute("data-requires")?a.getAttribute("data-requires").split(" "):i;
|
34
|
+
if(!s||Va(s))a.removeAttribute("hidden"),kb(a,"hidden"),hc(a),a=nb(a),b=b?b.split(" "):["fallback"],ic(this,b,a,c,h,s)}},this);this.q.fallback&&(jc(this,this.q.fallback[0].l,a,b,c),delete this.q.fallback)}
|
35
|
+
function jc(a,b,c,d,e){var f=c.parentNode,h=document.createElement("div");h.innerHTML=b;b=h.childNodes.length===1?h.firstChild:h;f.insertBefore(b,c);a.Yb&&(B(b,"zoomable"),b.setAttribute("data-figureindex",a.f),(v||ua)&&b.setAttribute("onclick","void(0)"));kc(b,d);a.ma=new lc(b,d,e,!0);a.ma.u=a;a.ma.k&&a.ma.k.forEach(function(a){a.u=this;a.Ac=!0},a);f.removeChild(b)}
|
36
|
+
function mc(a,b){var c=-Infinity,d,e=Infinity,f,h,s=a.q;a.q.lightbox&&(s={lightbox:a.q.lightbox});for(h in s)a.q[h].forEach(function(a){if(a.ba()){var l=a.K*a.m;a.K&&a.K>b.e||a.m&&a.m>b.b?!f&&this.La&&l<=e&&(e=l,d={name:h,qa:a}):l>=c&&(c=l,f={name:h,qa:a})}},a);return f||d}function ic(a,b,c,d,e,f){var h=new ec(c,d,e,f);b.forEach(function(a){this.q[a]?this.q[a].push(h):this.q[a]=[h]},a)}function nc(a){var b=a.nodeName.toLowerCase();return a.nodeType===1&&b==="figure"};function lc(a,b,c,d){var e=oc(a),f,h="";if(a.nodeType!==1)this.sa=!0;else if(J(a)){this.index=c.index;c.index+=1;this.$=!e&&pc(a);this.k=[];this.o=[];f=!1;if(this.$&&!C(a,"keeptogether"))qc(this,a,b,c,d),f=!!this.o.length,this.$=!!this.k.length;this.Na=this.Na||!e;this.lc=C(a,"keepwithnext");this.ec=C(a,"columnbreak");this.na=this.na||!this.Na||C(a,"keeptogether");this.d=new L(a);if(!this.d.lineHeight)this.d.lineHeight=b;if(!this.na)this.na=this.d.O+this.d.lineHeight===this.d.n;this.ra=this.na?this.d.n:
|
37
|
+
!this.$?this.d.F+this.d.lineHeight:!this.ka?this.d.F+this.k[0].ra+(this.d.F?this.k[0].d.marginTop:0):this.d.F+this.k[0].ra;this.l=nb(a);this.Nb=this.$?this.l.substr(0,this.l.indexOf(">")+1):i;this.Oa=this.$?this.l.slice(this.l.lastIndexOf("<")):i;if(f)this.l=this.Nb,this.k.forEach(function(a){this.l+=a.l},this),this.l+=this.Oa;this.$&&(a=a.cloneNode(!0),this.d.marginTop&&K(a,"marginTop",0),this.d.borderTop&&K(a,"borderTopWidth",0),this.d.paddingTop&&K(a,"paddingTop",0),h=nb(a));this.pc=this.$?h.substr(0,
|
38
|
+
h.indexOf(">")+1):i}else this.sa=!0}function rc(a){return a.nextSibling?a.nextSibling:a.parent?rc(a.parent):i}
|
39
|
+
function qc(a,b,c,d,e){var f,h=a instanceof lc,s=b.nodeName.toLowerCase()==="ol"&&"start"in b,k=s?b.start:i;k===-1&&(k=1);ga(b.childNodes).forEach(function(b){if(s&&b.nodeName.toLowerCase()==="li"){if(b.value&&b.value!==-1)k=b.value;b.setAttribute("value",k);k+=1}if(nc(b)){if(e)return;b=new gc(b,c,d);a.o.push(b);if(b=b.ma)if(b.Ga=!0,h)a.ka=!0}else if(b=new lc(b,c,d,!!e),h&&!a.ka)a.ka=b.ka;if(b&&!b.sa){a.k=a.k.concat(b,b.k||[]);if(b.o.length)a.o=a.o.concat(b.o),delete b.o;b.parent=h?a:i;if(f)f.nextSibling=
|
40
|
+
b;f=b}})}function sc(a){for(var a=a.parent,b=[];a;)b.unshift(a.pc),a=a.parent;return b.join("")}function tc(a){for(var a=a.parent,b=[];a;)b.push(a.Oa),a=a.parent;return b.join("")}
|
41
|
+
function pc(a){if(uc(a))return!1;if(vc(a))return!0;var b,c,d,e=!1;for(b=0,c=a.childNodes.length;b<c;b+=1)if(d=a.childNodes[b],d.nodeType===3&&/[^\s]/.test(d.data))return!1;else if(d.nodeType===1){if(uc(d)||vc(d))return!0;e=!0;d=document.defaultView.getComputedStyle(d,i);if(/inline/.test(d.display))return!1;else if(/block/.test(d.display))return!0}return e}var wc="img,video,object,embed,iframe,audio,canvas,svg,table".split(",");
|
42
|
+
function oc(a){var b=a.nodeName.toLowerCase();return a.nodeType===1&&wc.indexOf(b)!==-1}var xc="p,h1,h2,h3,h4,h5,h6".split(",");function uc(a){var b=a.nodeName.toLowerCase();return a.nodeType===1&&xc.indexOf(b)!==-1}var yc="div,article,ul,ol,figure,aside".split(",");function vc(a){var b=a.nodeName.toLowerCase();return a.nodeType===1&&yc.indexOf(b)!==-1}
|
43
|
+
function kc(a,b){if(a.nodeType===1){var c,d;a.removeAttribute("id");if(!nc(a)){if(pc(a)&&!C(a,"keeptogether"))for(c=a.childNodes.length-1;c>=0;c-=1)d=a.childNodes[c],d.nodeType!==1?a.removeChild(d):kc(d,b);if(!window.TS_NO_AUTOMETRICS)if(c=new L(a),c.marginTop%b&&K(a,"marginTop",Wb(c.marginTop,b)),c.marginBottom%b&&K(a,"marginBottom",Wb(c.marginBottom,b)),oc(a)||C(a,"keeptogether"))c.n%b&&K(a,"paddingBottom",c.paddingBottom+b-c.n%b);else{c.lineHeight?c.lineHeight%b&&K(a,"lineHeight",Wb(c.lineHeight,
|
44
|
+
b)):(c.lineHeight=b,K(a,"lineHeight",b));c.F%b&&K(a,"paddingTop",Wb(c.F,b)-c.borderTop);if(c.ga%b)c.paddingBottom=K(a,"paddingBottom",Wb(c.ga,b)-c.borderBottom);c.n=J(a);c.n%b&&(c.paddingBottom+=b-c.n%b,K(a,"paddingBottom",c.paddingBottom))}}}};function zc(a,b){this.lineHeight=I(document.defaultView.getComputedStyle(a,i).lineHeight)||1;this.Y=a.offsetWidth;D("figure",a).forEach(function(a){a.style.display="none"});kc(a,this.lineHeight);this.o=[];this.k=[];this.Ua=b;qc(this,a,this.lineHeight,{index:0,f:0})};function Ac(a,b){var c=new L(a);this.z=!C(a,"fixed");(this.m=c.m)&&K(a,"minHeight",0);this.b=c.n;this.Da=Math.max(0,b-this.b)}Ac.prototype.wa=function(a){if(!this.z)return this;this.b=Math.max(0,a-this.Da);return this};function Bc(a,b){var c=new L(a);this.z=!C(a,"fixed");(this.m=c.m)&&K(a,"minHeight",0);this.b=c.n;this.Da=Math.max(0,b-this.b);this.q=(c=a.getAttribute("data-sizes"))?c.split(" "):[]}Bc.prototype.wa=function(a){if(!this.z)return this;this.b=Math.max(0,a-this.Da);return this};function Dc(a){document.body.appendChild(a);this.r=a.hasAttribute("data-requires")?a.getAttribute("data-requires").split(" "):i;this.Ab=lb(a).map(function(a){return a.toLowerCase()});this.z=!C(a,"fixed");Ec(this);this.xa=this.size=new L(a);this.z?this.size.K=Math.max(this.size.K||0,this.size.e):(this.size.m=this.size.b,this.size.K=this.size.e);this.lineHeight=this.size.lineHeight||1;this.Y=this.aa=this.W=0;this.cols=[];D(".column",a).forEach(function(a){var c=new Ac(a,this.size.b);this.cols.push(c);
|
45
|
+
this.W+=c.b;this.aa=Math.max(this.aa,c.b);if(this.Y){if(this.Y!==a.offsetWidth)this.error=!0}else this.Y=a.offsetWidth},this);this.I=[];D(".container",a).forEach(function(a){this.I.push(new Bc(a,this.size.b))},this);this.l=nb(a);document.body.removeChild(a)}var Fc={onlypage:!0,odd:!0,even:!0,sizetocontainer:!0},Gc=/^(no-)?page-(\d+)$/;
|
46
|
+
function Ec(a){var b=!1,c,d;a.L={};a.Ja={};a.Ob={};a.Ab.forEach(function(a){if(a in Fc)this.L[a]=!0;else if(c=Gc.exec(a))d=parseInt(c[2],10),isNaN(d)||(a.substr(0,3)==="no-"?this.Ob[d]=!0:(b=!0,this.Ja[d]=!0))},a);if(!b)a.Ja=i}
|
47
|
+
Dc.prototype.wa=function(a){if(!this.z)return this;var b=Math.min(this.size.V,Math.max(a-(this.size.marginHeight+this.size.O),this.size.m));b-=(b-this.size.m||0)%this.lineHeight;this.W=this.aa=0;this.cols.forEach(function(a){this.W+=a.wa(b).b;this.aa=Math.max(this.aa,a.b)},this);this.I.forEach(function(a){a.wa(b)},this);this.xa=this.size.H();this.xa.b=b;this.xa.n=b+this.size.O;this.xa.V=this.L.sizetocontainer?this.size.V:Math.min(this.size.V,b+this.lineHeight*3);return this};
|
48
|
+
function Hc(a,b){return b.size.e+20*b.I.length-(a.size.e+20*a.I.length)}Dc.prototype.ia=function(){return!this.r?!0:Va(this.r,!0)};
|
49
|
+
function Ic(a,b,c){var d=i,e=-Infinity,f,h,s=a.k.length,k,l,F,z,j,u,y,G,H,M,N,m,W;F=0;z=b.length;for(;F<z;F+=1){j=b[F];m=0;W=!1;f=c.H();y=f.g;G=j.W-y;y&&j.W&&(W=!0);u=0;h=f.va+1;u+=j.cols.length*50;j.lineHeight!==a.lineHeight&&(u-=2E3);j.Y&&j.Y!==a.Y&&(u-=Infinity);j.L.onlypage&&(u+=f.va?-Infinity:4E3);j.Ja&&(j.Ja[h]?u+=3E3:u-=Infinity);j.Ob[h]&&(u-=Infinity);u+=h%2?j.L.odd?2E3:j.L.even?-Infinity:0:j.L.even?2E3:j.L.odd?-Infinity:0;h=j;k=a;l=f;var S=N=M=H=g,q=g,ca=g,sa=g,Ub=g,X=g,ib=g,Vc=g,Vb=[];H=
|
50
|
+
0;M=h.I.length;for(;H<M;H+=1){N=h.I[H];Vb[H]=i;ca=l.f;ib=l.t.slice(0);c:for(;ib.length||ca<k.o.length;){sa=(Vc=!!ib.length)?ib.shift():ca;Ub=k.o[sa];S=N.q.length-1;d:for(;S>=0;S-=1){q=N.q[S];e:{var X=Ub,jb=q,Oa=g,Wc=g;if(X.q[jb])for(Oa=0,Wc=X.q[jb].length;Oa<Wc;Oa+=1)if(X.q[jb][Oa].ba()){X=X.q[jb][Oa];break e}X=i}if(X){if(N.z&&X.m&&X.m>N.b)continue d;Vb[H]={f:sa,qa:X,size:q,z:N.z};cc(l,sa);break c}}if(!Ub.ca)break;Vc||(ca+=1)}}h=Vb;l=0;H=h.length;for(;l<H;l+=1)M=j.I[l],(N=h[l])?(k=a.o[N.f],u+=2E3+
|
51
|
+
N.qa.m*5,k.ca||(u+=4E3),M.z||(u+=5E3),m+=1):M.z||(u-=5E3);b:for(;j.W&&f.index<s&&y<=j.W;){k=a.k[f.index];l=k.d.n+k.d.marginTop;if(k.na&&(l>j.aa||l>G))break b;if(l>G){if(k.na)break b;if(k.children){f.index+=1;continue b}y+=l}y+=l;u+=l;G-=l;W=!0;f.index=k.nextSibling?k.nextSibling.index:f.index+1}if(W)G>0&&(f=G/j.W,f-=m*0.2,f>0.5&&(u-=G,u-=f*f*2E3));else if(m){if((k=a.k[f.index])&&k.u&&!k.u.ca&&(f.g||k.Ac))u=-Infinity}else u=-Infinity;u>e&&(e=u,d={P:j,I:h})}return d};function Jc(a,b,c){a.innerHTML=Mustache.to_html(b,c,g,g);D("img[data-src], iframe[data-src], video[data-src]",a).forEach(function(a){a.setAttribute("src",a.getAttribute("data-src"))});D("a[data-href]",a).forEach(function(a){a.setAttribute("href",a.getAttribute("data-href"))})};function Kc(a){ua&&a.setAttribute("onclick","void(0)")}function hc(a){var b=D(".scroll",a);C(a,"scroll")&&b.unshift(a);b.forEach(Kc)};function Lc(a,b,c){var d=Ic(a,b,c),b=document.createElement("div"),e=c.H(),f=!1;!d||!d.P?(c.J=ac(c,a)||c.f===a.o.length,c.J?this.sa=!0:this.error=!0):(this.size=d.P.xa.H(),this.xb=new Xb(c.index,c.f,c.g),B(b,"offscreen"),document.body.appendChild(b),b.innerHTML=d.P.l,this.a=b.firstChild,K(this.a,"width",this.size.e),K(this.a,"height",this.size.b),D("[data-ts-template=document]",this.a).forEach(function(b){Jc(b,b.innerHTML,a.Ua.i)}),D(".container",this.a).forEach(function(b,e){var k=d.I[e],l,F,z;if(k){F=
|
52
|
+
k.f;l=a.o[F];a:{var j=a.lineHeight,u,y,G;z=!0;u=k.size;y=k.qa;G=J(b);fc(y,b,u);if(k.z){C(b,"bottom")?(z=!1,b.style.top="auto"):b.style.bottom="auto";y=new L(b);k=y.n;if(k>G)if(l.La)k=G,K(b,"height",k-y.O);else{kb(b,u);mb(b);z=!1;break a}else j&&k%j&&(k=Wb(k,j));l.La&&(B(b,"scroll"),Kc(b));for(j=b;j=j.nextSibling;)if(j.nodeType===1&&!C(j,"fixed")&&(C(j,"column")||C(j,"container")||C(j,"group")))B(j,"flexed"),J(j)<=k?K(j,"height",0):z?K(j,"top",(j&&j.offsetTop||0)+k):K(j,"bottom",J(j.offsetParent)-
|
53
|
+
((j&&j.offsetTop||0)+J(j))+k)}z=!0}if(z){if(cc(c,F),f=!0,l.Yb&&(B(b,"zoomable"),b.setAttribute("data-figureindex",F),(v||ua)&&b.setAttribute("onclick","void(0)")),e===0&&d.P.L.sizetocontainer)this.size.b=J(b)+d.P.I[0].Da,this.size.n=this.size.b+this.size.O,K(this.a,"height",this.size.b)}else!l.ca&&l.ma?dc(c,l.f):C(b,"flexed")||(cc(c,F),c.la.push(F)),b.parentNode.removeChild(b)}else b.parentNode.removeChild(b)},this),D(".column",this.a).forEach(function(b,e){var f=J(b),l=0,F,z,j=!0,u=0,y=0,G=0,H=0,
|
54
|
+
M=[],N=a.k.length,m=a.k[c.index],W,S,q;F=[];var ca,y=!1,sa=d.P.aa/f>1.5;if(m&&(f%a.lineHeight&&(f-=f%a.lineHeight),f&&!(f<d.P.cols[e].m))){m.parent&&M.push(sc(m));u=c.g?m.d.n-c.g:0;a:for(;c.index<N&&l<f;){m=a.k[c.index];S=(W=m.nextSibling)||rc(m);if(m.Ga&&bc(c,m.u.f)&&(!j||!c.g)){c.index=S?S.index:N;continue a}q=m.parent;F=f-l;j&&!G?(G=-u,y=c.overflow?m.d.lineHeight:m.ra):(G=Math.max(G,m.d.marginTop),y=G+m.ra);H=Math.max(m.d.marginBottom,W?W.d.marginTop:0);ca=m.d.n+G;y=F<y;if(!y&&m.lc&&W&&!(c.g||
|
55
|
+
j&&!sa))y=F>=ca&&F<ca+H+W.ra;y&&(y=!j||sa);y&&(y=!m.ka);m.ec&&!j&&(y=!0);if(y){if(q){for(;q&&q.index===m.index-1;)M.pop(),c.index=q.index,q.Ga&&dc(c,q.u.f),m=q,q=m.parent;q&&M.push(tc(m))}break a}m.Ga&&cc(c,m.u.f);if(m.ka||m.k.length&&F<ca){m.d.F&&(l+=j?0:G,G=0,l+=m.d.F);M.push(m.Nb);c.index+=1;continue a}l+=ca;M.push(m.l);j=!1;z=z||m;c.g=0;if(f>l+H){c.index=S?S.index:N;if(!W&&q){F=[];do F.push(q.Oa),q.d.ga?(l+=H+q.d.ga,H=q.d.marginBottom):H=Math.max(H,q.d.marginBottom);while(!q.nextSibling&&(q=q.parent));
|
56
|
+
if(f>l+H)M.push(F.join(""));else{q&&M.push(tc(m));l=f;break a}}G=H;continue a}q&&M.push(tc(m));if(m.Na){if(l<=f)c.index=S?S.index:N,l=f}else l=f,c.index=S?S.index:N;break a}j=m;if(f>=l||!j)c.g=0;else if(c.g=l-f,l=c.g-j.d.ga,l<=0)c.g=0,c.index=j.index+1;else if(l=(j.d.b-l)%j.d.lineHeight)f-=l,c.g+=l;K(b,"height",f);b.innerHTML=M.join("");if(z&&b.firstChild)if(b.firstChild.style.marginTop=-u+"px",z.parent&&!u){for(q=z.parent;q;)q.d.F&&(z=q),q=q.parent;if(q!==z){q=z.parent;for(m=b.firstChild;q;)m=m.firstChild,
|
57
|
+
q=q.parent,m&&(m.style.marginTop=0)}}else{if(z.k.length&&!u)for(m=b.firstChild;z;)z.k.length&&m.firstChild?(z=z.k[0],m=m.firstChild,m.style.marginTop=0):z=i}else mb(b)}}),e.Z(c)?this.error=!0:!f&&d.P.L.sizetocontainer?this.sa=!0:(K(this.a,"marginTop",-this.size.n/2),K(this.a,"marginLeft",-this.size.Q/2),c.J=d.P.L.onlypage||ac(c,a),c.J&&B(this.a,"last-page"),this.l=b.innerHTML,this.end=new Xb(c.index,c.f,c.g),c.va+=1),this.v(),document.body.removeChild(b))}
|
58
|
+
Lc.prototype.N=function(){if(this.s)return this.a;this.a=pb(this.l);this.s=!0;return this.a};Lc.prototype.v=function(){this.s=!1;Sb(this.a,"none");D("img",this.a).forEach(sb);this.a=i};Lc.prototype.H=function(){var a=Object.H(this);a.a=this.a&&this.a.cloneNode(!0)||i;a.s=this.s;return a};function Mc(a,b,c){this.j=[];this.Xa=[];this.ab=a;this.Ua=c;if(b)if(b.nodeName!=="ARTICLE")this.error=!0;else{this.loaded=!0;a=document.createElement("div");c=document.createElement("div");a.style.display="none";B(a,"offscreen grid");B(c,"column");b.removeAttribute("id");mb(a);if(this.ya=b.getAttribute("data-theme")||b.getAttribute("data-grids")||i)B(a,this.ya),B(c,this.ya),Nc(this,this.ab);for(;b.firstChild;)c.appendChild(b.firstChild);a.appendChild(c);c.style.display="block";a.style.display="block";
|
59
|
+
document.body.appendChild(a);this.content=new zc(c,this.Ua);document.body.removeChild(a);a.removeChild(c);mb(c);Oc(this)}}function Nc(a,b){a.ab=a.ya?b.filter(function(a){return a.Ab.indexOf(this.ya)!==-1},a):b.slice(0)}function Pc(a,b){a.Xa=a.ab.filter(function(a){return a.ia()&&Qb(a.size,{e:b.e-a.size.Ca,b:b.b-a.size.O-a.size.marginHeight})}).map(function(a){return a.wa(b.b)});a.Xa.sort(Hc)}function Qc(a,b){if(!a.ua||a.ua.e!==b.e||a.ua.b!==b.b)a.ua=b,a.Ka=Qb(a.pa,b);return!a.Ka}
|
60
|
+
function Oc(a){A("paginate");a.j=[];a.B=0;a.ua&&Pc(a,a.ua);a.ha=new $b;a.pa=i;a.Ka=!0;a.R=!1}
|
61
|
+
Mc.prototype.rc=function(a,b,c){A("paginate");for(var d,b=b||0;!this.ha.J;)if(d=new Lc(this.content,this.Xa,this.ha),d.sa){if(this.ha.J)break}else{if(d.error){if(this.ha.J)break;this.error=!0;E(document,"treesaver.paginationerror",{vb:this});this.ha.J=!0;break}this.j.push(d);this.B+=1;this.error=!1;var e=this.pa||{},f=d.size||{},h=f.O||(f.n?f.n-f.b:0),s=f.Ca||(f.Q?f.Q-f.e:0);this.pa={e:Math.max(e.e||0,f.e+s||0),b:Math.max(e.b||0,f.b+h||0),Ia:Math.min(e.Ia||Infinity,f.Ia+s||Infinity),V:Math.min(e.V||
|
62
|
+
Infinity,f.V+h||Infinity)};if(!(b&&this.B<=b||c&&(c===Yb||!(Zb(c,d.end)>=0)))&&!this.ha.J){a&&(E(document,"treesaver.paginationprogress",{vb:this}),Rc(this,ga(arguments)));return}}this.R=!0;E(document,"treesaver.paginationprogress",{vb:this,Ec:!0})};function Rc(a,b){eb(Mc.prototype.rc,200,b,"paginate",a)}
|
63
|
+
function Sc(a,b,c){a.Ka||Oc(a);var d=[],e=b>=0?b+c-1:Infinity;!a.R&&e>a.j.length-1&&Rc(a,[!0,e]);if(a.R)c=Math.min(c,a.B-(b>=0?b:b-1));else if(d.length=c,b<0)return d;if(b<0)for(e=-b;e<=c;e+=1)d[e+b]=a.j[a.B-e];else for(e=b;e<b+c;e+=1)d[e-b]=a.j[e];return d}
|
64
|
+
function Tc(){var a=O.c[P.index],b=Q;if(!a.content)return-1;var c,d;if(!b||b.wb())return 0;a.Ka||Oc(a);if(!a.R&&(b===Yb||!a.B||!(Zb(b,a.j[a.B-1].end)>=0)))return Rc(a,[!0,i,b]),-1;if(b===Yb)return a.R?a.B-1:-1;for(c=0,d=a.B;c<d;c+=1)if(Zb(a.j[c].end,b)<0)return c;return a.R?a.B-1:-1};function R(a,b){this.index=a;this.anchor=b}var Uc=new R(Infinity),Xc=new R(0);R.prototype.wb=function(){return this.index===0};R.prototype.Z=function(a){return this.index===a.index};function Yc(){this.h=[];this.parent=i}Yc.prototype.appendChild=function(a){a.parent=this;this.h.push(a);return a};Yc.prototype.replaceChild=function(a,b){var c=this.h.indexOf(b);return c!==-1?(a.parent=b.parent,b.parent=i,this.h.splice(c,1,a)[0]):i};Yc.prototype.insertBefore=function(a,b){var c=this.h.indexOf(b);a.parent=this;c===0?this.h.unshift(a):c>1&&this.h.splice(c,0,a);return a};Yc.prototype.removeChild=function(a){var a=this.h.indexOf(a),b=i;if(a!==-1)b=this.h.splice(a,1)[0],b.parent=i;return b};if(!Object.keys)Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b};Object.H=function(a){function b(){}b.prototype=a;return new b};var Zc=/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,$c="source,scheme,authority,userInfo,user,password,host,port,relative,path,directory,file,query,anchor".split(",");function ad(a){for(var b=$c.length,a=Zc.exec(a),c={};b--;)c[$c[b]]=a[b]||i;return c}
|
65
|
+
function bd(a){var b="";a.scheme&&(b+=a.scheme+":");a.source&&/^(?:[^:\/?#]+:)?\/\//.test(a.source)&&(b+="//");a.authority&&(a.userInfo&&(b+=a.user||"",a.userInfo.indexOf(":")!==-1&&(b+=":"),b+=a.password||"",b+="@"),b+=a.host||"",a.port!==i&&(b+=":"+a.port));a.relative&&(a.path&&(b+=a.directory||"",b+=a.file||""),a.query&&(b+="?"+a.query),a.anchor&&(b+="#"+a.anchor));return b}
|
66
|
+
function cd(a){a=ad(a);return a.file?/^(index|default)\.(html?|php|asp|aspx)$/i.test(a.file)||T&&T.get("DirectoryIndex","index.html")===a.file:!1}function dd(a){a=ad(a);a.anchor=i;return bd(a)}function ed(a){a=ad(a);a.file=i;return bd(a)};function U(a,b){if(a)this.url=a,this.path=ad(a).relative,this.i=b||{},this.c=[],this.Ma={},this.tb=[],this.h=[]}var fd=/<title>\s*(.+?)\s*<\/title>/i;U.prototype=new Yc;n=U.prototype;
|
67
|
+
n.parse=function(a){var b=document.createElement("div"),c=[];if(!a||typeof a!=="string"||a.trim()==="")return[];b.innerHTML=a;D("meta[name]",b).forEach(function(a){var b=a.getAttribute("name"),a=a.getAttribute("content");b&&a&&(this.i[b]=a)},this);c=D("article",b).filter(function(a){return qb(a,"article")===i});if(c.length===0)c.push(document.createElement("article")),c[0].innerHTML=b.innerHTML;return c.map(function(a,b){var c=a.getAttribute("id")||(b===0?i:"_"+b),h=new Mc(gd,a,this);c&&(this.Ma[c]=
|
68
|
+
b,this.tb[b]=c);return h},this)};n.Z=function(a){var b=a;if(!b)return!1;if(typeof a!=="string"&&a.url)b=a.url;return cd(b)&&cd(this.url)?b===this.url:cd(b)?ed(b)===this.url:cd(this.url)?b===ed(this.url):b===this.url};n.ia=function(){return this.r?Va(this.r,!0):!0};n.Ya=function(a){return this.c[a]||i};n.vc=function(a){this.c=a};n.$a=function(){return this.i};n.jc=function(){return this.url};n.wc=function(a){this.url=a};n.hc=function(){return this.c.length};
|
69
|
+
function hd(a){return(a=fd.exec(a))&&a[1]?a[1]:i}n.load=function(){var a=this,b=i;if(!this.ta){this.ta=!0;if(!v&&(b=xb("cache:"+this.url)))this.c=this.parse(b),this.title=hd(b),this.loaded=!0,E(document,"treesaver.loaded",{document:this});x.get(this.url,function(c){a.ta=!1;if(c){if(v||b!==c)v||wb("cache:"+a.url,c,!0),a.c=a.parse(c),a.title=hd(c),a.loaded=!0,E(document,"treesaver.loaded",{document:a})}else if(v||!b)a.mc=!0,a.loaded=!1,E(document,"treesaver.loadfailed",{document:a})})}};
|
70
|
+
p("treesaver.Document",U);p("treesaver.Document.prototype.setArticles",U.prototype.vc);p("treesaver.Document.prototype.getNumberOfArticles",U.prototype.hc);p("treesaver.Document.prototype.getArticle",U.prototype.Ya);p("treesaver.Document.prototype.parse",U.prototype.parse);p("treesaver.Document.prototype.getUrl",U.prototype.jc);p("treesaver.Document.prototype.setUrl",U.prototype.wc);p("treesaver.Document.prototype.getMeta",U.prototype.$a);function id(a){this.url=a;this.C={};this.i={}}id.prototype=new Yc;n=id.prototype;n.w=[];
|
71
|
+
function jd(a,b){var c=i,d=i,e={},f=i,h=i;typeof b==="string"?c=b:(c=b.url,d=b.contents,Object.keys(b).forEach(function(a){e[a]=b[a]}),b.requires&&(typeof b.requires==="string"?f=b.requires.split(/\s|,\s/g):Array.isArray(b.requires)&&(f=b.requires.map(function(a){return a.toString()})),f=f.filter(function(a){return a.trim()!==""})));if(!c)return i;c=dd(x.oa(c));h=new U(c,e);d&&Array.isArray(d)&&d.forEach(function(a){h.appendChild(jd(this,a))},a);if(f)h.r=f;return h}
|
72
|
+
n.update=function(){var a=0;this.w=[];this.Va={};this.Wa={};kd(this,this.h,function(b){this.Va[b.url]?this.Va[b.url].push(b):this.Va[b.url]=[b];this.w.push(b);this.Wa[b.url]?this.Wa[b.url].push(a):this.Wa[b.url]=[a];a+=1},this);E(document,"treesaver.index.updated",{index:this})};function kd(a,b,c,d){return b.every(function(a){return c.call(d,a)!==!1&&kd(this,a.h,c,d)},a)}n.ic=function(){return this.w.length};function ld(a,b){var c=-1,d=0;kd(a,a.h,function(a){a.Z(b)&&(c=d);d+=1},a);return c}
|
73
|
+
n.Za=function(a){var b=[];return a?(kd(this,this.h,function(c){c.Z(a)&&b.push(c)},this),b):this.w};
|
74
|
+
n.parse=function(a){var b={h:[],C:{},i:{}};if(!a)return b;if(typeof a==="string")try{a=window.JSON.parse(a)}catch(c){return b}if(Object.prototype.toString.apply(a)!=="[object Object]")return b;if(!a.contents||!Array.isArray(a.contents))return b;b.h=a.contents.map(function(a){return jd(this,a)},this);b.h=b.h.filter(function(a){return a!==i});b.h=b.h.map(function(a){return this.appendChild(a)},this);if(a.settings)b.C={},Object.keys(a.C).forEach(function(c){b.C[c]=a.C[c]});Object.keys(a).forEach(function(c){c!==
|
75
|
+
"settings"&&(b.i[c]=a[c])});return b};n.set=function(a,b){return this.C[a]=b};n.get=function(a,b){return this.C.hasOwnProperty(a)?this.C[a]:b};n.$a=function(){return this.i};
|
76
|
+
n.load=function(){var a=this,b=i,c=i;if(!this.ta)if(this.url){this.ta=!0;if(!v&&(b=xb("cache:"+this.url)))c=this.parse(b),this.h=c.h,this.i=c.i,this.C=c.C,this.loaded=!0,E(document,"treesaver.index.loaded",{index:this}),this.update();x.get(this.url,function(d){a.ta=!1;if(d){if(v||b!==d)v||wb("cache:"+a.url,d,!0),c=a.parse(d),a.h=c.h,a.i=c.i,a.C=c.C,a.loaded=!0,E(document,"treesaver.index.loaded",{index:a}),a.update()}else if(v||!b)a.mc=!0,a.loaded=!1,E(document,"treesaver.index.loadfailed",{index:a})})}else E(document,
|
77
|
+
"treesaver.index.loadfailed",{index:this})};p("treesaver.Index",id);p("treesaver.Index.prototype.get",id.prototype.get);p("treesaver.Index.prototype.set",id.prototype.set);p("treesaver.Index.prototype.update",id.prototype.update);p("treesaver.Index.prototype.getDocuments",id.prototype.Za);p("treesaver.Index.prototype.getNumberOfDocuments",id.prototype.ic);p("treesaver.Index.prototype.getMeta",id.prototype.$a);var T,gd,V,Y,P,O,md,Q,nd,Z,od,pd,qd,rd;function sd(){var a=fa;Y=V=-1;P=Xc;gd=td();if(!gd)return!1;Z=new U(dd(document.location.href),{});if(a)Z.c=Z.parse(a),Z.title=document.title,Z.loaded=!0;ub(document,"treesaver.index.loaded",ud);T=new id(vd());T.appendChild(Z);T.update();T.load();wd(Z,Xc,i,i,!0);xd();yd();zd.forEach(function(a){ub(document,a,Ad)});ub(window,"popstate",Ad);return!0}
|
78
|
+
function Bd(){Q=md=O=i;Y=V=-1;pd=od=P=i;vb(document,"treesaver.index.loaded",ud);zd.forEach(function(a){vb(document,a,Ad)});vb(window,"popstate",Ad)}function ud(a){var a=a.index,b=a.Za(Z.url),c=D("meta[name]");if(b.length)b.forEach(function(a){Z.i=a.i;Z.children=a.children;Z.r=a.r;c.forEach(function(b){var c=b.getAttribute("name"),b=b.getAttribute("content");c&&b&&(a.i[c]=b)});a.parent.replaceChild(Z,a)}),Y=ld(a,Z),document.title=Z.i.title||Z.title}
|
79
|
+
function td(){var a=[];Nb("grid").forEach(function(b){var c=b.getAttribute("data-requires");if(!c||Va(c.split(" ")))b=new Dc(b),b.error||a.push(b)});return a}function xd(){var a=Nb("loading")[0];a||(a=document.createElement("div"));document.body.appendChild(a);a.style.top="50%";a.style.left="50%";K(a,"margin-top",-J(a)/2);K(a,"margin-left",-Rb(a)/2);document.body.removeChild(a);od=nb(a);a=a.cloneNode(!0);document.body.appendChild(a);pd=new L(a);document.body.removeChild(a)}
|
80
|
+
function yd(){var a=Nb("error")[0];a||(a=document.createElement("div"));document.body.appendChild(a);a.style.top="50%";a.style.left="50%";K(a,"margin-top",-J(a)/2);K(a,"margin-left",-Rb(a)/2);document.body.removeChild(a);qd=nb(a);a=a.cloneNode(!0);document.body.appendChild(a);rd=new L(a);document.body.removeChild(a)}var zd=["treesaver.loaded","treesaver.loadfailed","treesaver.paginationprogress"];
|
81
|
+
function Ad(a){if(a.type==="treesaver.paginationprogress")E(document,"treesaver.pageschanged");else if(a.type==="treesaver.loaded")document.title=O.i.title||O.title,E(document,"treesaver.pageschanged");else if(a.type==="treesaver.loadfailed"&&a.document===O)x.cb()&&(document.location=O.url);else if(a.type==="popstate"){var b=-1,c=i,d;a.state?(d=(b=a.state.index)||b===0?T.w[b]:i)?(c=a.state.position,wd(d,Xc,c?new Xb(c.X,c.u,c.g):i,b,!0)):Cd(a.state.url):(b=ld(T,Z),wd(Z,Xc,i,b))}}
|
82
|
+
function vd(){var a=D("link[rel~=index]")[0];return!a?i:x.oa(a.href)}function Dd(){return V!==-1?V>=1?!0:Ed():!Q&&Ed()}function Ed(){return P.index>0||Fd()}function Fd(){for(var a=Y-1;a>=0;a-=1)if(T.w[a].ia())return!0;return!1}function Gd(a,b){if(!Ed())return i;if(P.index>0){var c=new R(P.index-1),d=Y,e=O;return b?e:wd(e,c,a?Yb:i,d)}else{if(Fd()){c=Y-1;for(e=d=i;c>=0;c-=1)if(d=T.w[c],d.ia())break;d?(e=d.loaded?new R(d.c.length-1):Uc,c=b?d:wd(d,e,a?Yb:i,c)):c=i}else c=i;return c}}
|
83
|
+
function Hd(){if(V===-1)return!Q&&Gd(!0)?!0:!1;var a=V-1;if(a<0)return Gd(!0)?!0:!1;V=a;Q=i;E(document,"treesaver.pageschanged");return!0}function Id(){return V!==-1?V<O.c[P.index].B-1?!0:O.c[P.index].R&&Jd():Q===Yb?Jd():!1}function Jd(){return P.index<O.c.length-1||Kd()}function Kd(){for(var a=Y+1,b=T.w.length;a<b;a+=1)if(T.w[a].ia())return!0;return!1}
|
84
|
+
function Ld(a){if(!Jd())return i;if(P.index<O.c.length-1){var b=new R(P.index+1),c=Y,d=O;return a?d:wd(d,b,i,c)}else{if(Kd()){b=Y+1;c=i;for(d=T.w.length;b<d;b+=1)if(c=T.w[b],c.ia())break;a=c?a?c:wd(c,Xc,i,b):i}else a=i;return a}}function Md(){if(V===-1)return Q===Yb?Ld():!1;var a=V+1;if(a>=O.c[P.index].B)return O.c[P.index].R?Ld():!1;V=a;Q=i;E(document,"treesaver.pageschanged");return!0}
|
85
|
+
function Cd(a){var b=ad(a).anchor,c=T.Za(dd(a)),a=-1,d=i;return c.length!==0&&(c=c[0],a=ld(T,c),d=c.loaded&&b?new R(c.Ma[b]||0):new R(0,b),a!==-1)?wd(c,d,i,a):!1}
|
86
|
+
function Nd(a){P.index===Infinity&&O.loaded?P=new R(O.c.length-1):P.anchor&&O.loaded&&(P=new R(O.Ma[P.anchor]||0));O.c[P.index]&&Qc(O.c[P.index],a)&&(V=-1,nd=0);var b=[],c,d,e;if(O.c[P.index]&&V===-1&&(V=Tc(),V===-1))return b.length=3,b[1]=Od(),b;c=V-1;if(c<0){if((d=Gd(!1,!0))&&d.loaded&&d===O)Qc(d.c[P.index-1],a),b=Sc(d.c[P.index-1],c,-c);else if(d&&d.loaded&&d.c[d.c.length-1].R)b=Sc(d.c[d.c.length-1],c,-c);else for(d=0,e=-c;d<e;d+=1)b[d]=i;d=3+c;c=0}else d=3;O.c[P.index]&&(b=b.concat(Sc(O.c[P.index],
|
87
|
+
c,d)));if(d=3-b.length)if((c=Ld(!0))&&c===O)Qc(c.c[P.index+1],a),b=b.concat(Sc(c.c[P.index+1],0,d));else if(c)c.loaded?(Qc(c.c[0],a),b=b.concat(Sc(c.c[0],0,d))):(c.load(),b.length=3);for(d=1,e=b.length;d<e;d+=1)b[d]||(b[d]=O.error?{N:Lc.prototype.N,v:Lc.prototype.v,l:qd,size:rd}:Od());if((!Q||Q===Yb)&&b[1]&&b[1].xb)Q=b[1].xb;O.c[P.index]&&!nd&&(a=O.c[P.index],nd=a.pa?a.pa.e:0);for(d=0;d<b.length;d+=1)for(a=d+1;a<b.length;a+=1)b[d]&&b[d]===b[a]&&(b[a]=b[d].H());return b}
|
88
|
+
function wd(a,b,c,d,e){var f=i,h=i,f=i,s;if(!a)return!1;f=a.tb[b&&b.index||0]||i||!!b.anchor&&b.anchor;h=a.url+(f?"#"+f:"");f=a.path+(f?"#"+f:"");if(a.Z(O)&&d!==Y&&!P.Z(b))return md=s=O.Ya(b.index),P=b,Q!==c&&(Q=c,V=-1),V=-1,e?yb({index:d,url:h,position:c},a.i.title,f):zb({index:d,url:h,position:c},a.i.title,f),E(document,"treesaver.pageschanged"),E(document,"treesaver.articlechanged",{article:s}),!0;document.title=a.i.title||a.title;O=a;Q!==c&&(Q=c,V=-1);V=-1;P=b;md=O.Ya(b&&b.index||0);if(a.loaded){if(a.error)x.cb()&&
|
89
|
+
(document.location=a.url)}else a.load();Y=d||d===0?d:ld(T,a);e?yb({index:d,url:h,position:c},a.i.title||"",f):zb({index:d,url:h,position:c},a.i.title||"",f);E(document,"treesaver.pageschanged");E(document,"treesaver.documentchanged",{document:a,url:h,path:f});E(document,"treesaver.articlechanged",{article:md});return!0}function Od(){return{N:Lc.prototype.N,v:Lc.prototype.v,l:od,size:pd}};function Pd(a){this.r=a.hasAttribute("data-requires")?a.getAttribute("data-requires").split(" "):i;hc(a);this.l=a.parentNode.innerHTML;this.size=new L(a);delete this.size.e;delete this.size.b}
|
90
|
+
Pd.prototype.N=function(){if(!this.s)this.s=!0,this.a=pb(this.l),this.T=D(".viewer",this.a)[0],this.Pb=D(".pagewidth",this.a),this.nextPage=D(".next",this.a),this.gb=D(".nextArticle",this.a),this.lb=D(".prev",this.a),this.kb=D(".prevArticle",this.a),this.ib=[],this.jb=[],this.Fa=[],this.bb=[],this.Pa=[],this.Qa=[],this.mb=[],this.nb=[],D("[data-ts-template]",this.a).forEach(function(a){var b,c;switch(a.getAttribute("data-ts-template")){case "position":b=this.ib;c=this.jb;break;case "index":b=this.Fa;
|
91
|
+
c=this.bb;break;case "currentdocument":b=this.Pa;c=this.Qa;break;case "publication":b=this.mb;c=this.nb;break;default:return}c.push(a.innerHTML);a.nodeName.toLowerCase()==="script"&&(c=document.createElement("div"),a.parentNode.replaceChild(c,a),a=c);b.push(a)},this),this.Lb=D(".menu",this.a),this.pb=D(".sidebar",this.a),this.j=[],Qd.forEach(function(a){ub(document,a,this)},this),this.Aa=!1,Rd(this);return this.a};
|
92
|
+
Pd.prototype.v=function(){if(this.s)Sd(),this.s=!1,Qd.forEach(function(a){vb(document,a,this)},this),this.nb=this.mb=this.Qa=this.Pa=this.bb=this.Fa=this.jb=this.ib=this.kb=this.lb=this.gb=this.nextPage=this.pb=this.Lb=this.Pb=this.T=this.a=i,this.j.forEach(function(a){a&&a.v()}),this.hb=this.j=i,A("idletimer"),A("updateTOC"),Sd()};function Sd(){A("selectPages");A("animatePages")}var Qd="treesaver.index.updated,treesaver.pageschanged,treesaver.documentchanged,keydown,click,mousewheel,DOMMouseScroll".split(",");
|
93
|
+
ua?Qd.push("touchstart","touchmove","touchend","touchcancel"):Qd.push("mouseover");
|
94
|
+
Pd.prototype.handleEvent=function(a){switch(a.type){case "treesaver.pageschanged":return Td(this);case "treesaver.index.updated":return fb(this.Vb,"updateTOC",this),Td(this);case "treesaver.documentchanged":Ud(this);Vd(this);break;case "mouseover":a.touches||Rd(this);break;case "touchstart":var b=Wd(a.target),c=Xd(b),d,e,f;if(r.contains(Wd(a.target)))if(a.stopPropagation(),a.preventDefault(),this.U&&!c)Yd(this);else{if(c)for(d=c;d;){e=d.id;if(e==="prevPage"||e==="nextPage"){c=i;break}d=d.parentNode}b=
|
95
|
+
this.T.contains(b);d=a.touches[0].pageX;e=a.touches[0].pageY;f=o();this.za={Gc:d,Hc:e,startTime:f,Ib:d,Jb:e,Fc:f,Ra:0,Sa:0,Cb:0,ea:0,sb:0,yc:0,fa:a.touches.length,Bc:b,qc:this.D,Sb:c,zb:c&&c.scrollWidth!==c.clientWidth};if(this.za.fa===2)this.za.xc=a.touches[1].pageX;gb(["resumeTasks"])}break;case "touchmove":if(c=this.za)a.stopPropagation(),a.preventDefault(),b=o(),d=a.touches[0].pageX,e=a.touches[0].pageY,c.Cb=c.Hb-b,c.Ra=d-c.Ib,c.Sa=e-c.Jb,c.Hb=b,c.Ib=a.touches[0].pageX,c.Jb=a.touches[0].pageY,
|
96
|
+
c.yc+=c.Cb,c.ea+=c.Ra,c.sb+=c.Sa,c.fa=Math.min(a.touches.length,c.fa),c.Ub=c.fa===1&&Math.abs(c.ea)>=30&&Math.abs(c.ea)*2>Math.abs(c.sb),c.Sb&&(c.Ta||c.zb||!c.Ub)?(c.Ta=c.Ta||c.zb||Math.abs(c.sb)>=30,a=c.Sb,b=-c.Sa,a.scrollLeft+=-c.Ra,a.scrollTop+=b,c.Bc||Rd(this)):c.fa===2?c.rb=a.touches[1].pageX-c.xc:(this.D=c.qc+c.ea,this.Ba(!0));break;case "touchend":d=this.za;e=!1;c=Wd(a.target);b=this.U||this.T.contains(c);Zd(this);if(d&&(a.stopPropagation(),a.preventDefault(),d.Ta?b?this.S():Rd(this):d.fa===
|
97
|
+
1?d.Hb?d.Ub&&((e=d.ea>0?$d(this):ae(this))?this.S():Rd(this)):(d=document.createEvent("MouseEvents"),d.initMouseEvent("click",!0,!0,a.view,1,a.changedTouches[0].screenX,a.changedTouches[0].screenY,a.changedTouches[0].clientX,a.changedTouches[0].clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,0,i),c.dispatchEvent(d)&&b?this.Aa?this.S():Rd(this):b?this.S():Rd(this),e=!0):d.fa===2&&Math.abs(d.rb)>=30&&(d.ea<0&&d.rb<0?e=Ld():d.ea>0&&d.rb>0&&(e=Gd()),e?this.S():Rd(this)),!e))this.ub=o(),this.D=0,this.Ba();
|
98
|
+
break;case "touchcancel":return Zd(this);case "keydown":a:if(this.U)Yd(this),a.preventDefault();else if(!/input|select|textarea/i.test(a.target.tagName)&&!be(a)){switch(a.keyCode){case 34:case 39:case 40:case 74:case 32:ae(this);break;case 33:case 37:case 38:case 75:$d(this);break;case 72:Gd();break;case 76:Ld();break;default:b=g;break a}this.S();a.preventDefault()}return b;case "click":return this.click(a);case "mousewheel":case "DOMMouseScroll":if(be(a))c=!0;else if(Xd(Wd(a.target)))c=!0;else if(this.U)Yd(this),
|
99
|
+
a.preventDefault();else if(b=o(),!(this.Gb&&b-this.Gb<1500))this.Gb=b,b=a.wheelDelta?a.wheelDelta:a.detail?-a.detail:0,d=this.T.contains(Wd(a.target)),b&&d&&(a.preventDefault(),a.stopPropagation(),b>0?$d(this):ae(this),this.S());return c}};function be(a){return a.ctrlKey||a.shiftKey||a.altKey||a.metaKey}n=Pd.prototype;
|
100
|
+
n.click=function(a){if(be(a))return!0;if(!("which"in a&&a.which!==1||a.button)){var b=Wd(a.target),c,d,e=!1,f=e=c=!1,h=i;d=i;if(this.U){if(this.A.a.contains(b)&&(c=b.nodeName==="A"?b:qb(b,"A"))&&c.href)if(d=x.oa(c.href),!Cd(d))return;Yd(this);a.stopPropagation();a.preventDefault()}else{this.Lb.forEach(function(a){C(a,"menu-active")&&(f=a.contains(b),kb(a,"menu-active"))},this);(e=this.pb.some(function(a){return a.contains(b)}))||this.pb.forEach(function(a){ce(a)},this);if(this.j[0]&&this.j[0].a.contains(b))$d(this),
|
101
|
+
c=!0;else if(this.j[2]&&this.j[2].a.contains(b))ae(this),c=!0;else for(e=this.j[1]&&this.j[1].a.contains(b);!c&&b&&b!==r;){if(e)C(b,"zoomable")&&(c=de(this,b));else if(C(b,"prev"))$d(this),c=!0;else if(C(b,"next"))ae(this),c=!0;else if(C(b,"prevArticle"))Gd(),c=!0;else if(C(b,"nextArticle"))Ld(),c=!0;else if(C(b,"menu"))f||B(b,"menu-active"),c=!0;else if(C(b,"sidebar")||C(b,"open-sidebar")||C(b,"toggle-sidebar")||C(b,"close-sidebar"))if(d=ee(b))C(b,"sidebar")||C(b,"open-sidebar")?fe(d):C(b,"toggle-sidebar")?
|
102
|
+
ge(d):ce(d),c=!0;if(!c&&b.href)if(h=b.getAttribute("target"),d=x.oa(b.href),h==="_blank")return;else if(h==="ts-lightbox"){b=b.parentNode;continue}else Cd(d)?c=!0:h==="ts-treesaver"&&(T.appendChild(new U(d)),T.update(),Cd(d)&&(c=!0));b=b.parentNode}c&&(a.stopPropagation(),a.preventDefault())}}};function Wd(a){a?a.nodeType!==1&&a.parentNode&&(a=a.parentNode||r):a=r;return a}function Zd(a){fb(hb,"resumeTasks");a.za=i}
|
103
|
+
function Xd(a){for(;a&&a!=document.documentElement;){if(C(a,"scroll"))return a;a=a.parentNode}return i}function $d(a){if(Dd())return he(a,-1),Hd()}function ae(a){if(Id())return he(a,1),Md()}function Rd(a){if(!a.Aa)a.Aa=!0,B(a.a,"active"),E(document,"treesaver.active");var b=a.S,c=Xa.idletimer;c?c.eb=o():db(b,5E3,1,i,!1,"idletimer",a)}n.S=function(){if(this.Aa)this.Aa=!1,kb(this.a,"active"),E(document,"treesaver.idle");A("idletimer")};
|
104
|
+
function fe(a){E(document,"treesaver.sidebaractive",{sidebar:a});B(a,"sidebar-active")}function ce(a){C(a,"sidebar-active")&&E(document,"treesaver.sidebarinactive",{sidebar:a});kb(a,"sidebar-active")}function ge(a){C(a,"sidebar-active")?ce(a):fe(a)}function ee(a){if(C(a,"sidebar"))return a;for(;(a=a.parentNode)!==i&&a.nodeType===1;)if(C(a,"sidebar"))return a;return i}
|
105
|
+
function de(a,b){var c;c=parseInt(b.getAttribute("data-figureindex"),10);c=isNaN(c)?i:O.c[P.index].content.o[c];if(!c)return!1;a.S();if(!a.U){var d=ie(),e=je,f,h,s,k=i;for(f=0,h=e.length;f<h;f+=1)if(s=e[f],s.ba()&&s.Ea(d)){k=s;break}a.A=k;if(!a.A)return!1;a.U=!0;a.A.N();a.a.parentNode.appendChild(a.A.a)}a.A.a=a.A.a;K(a.A.a,"width",Rb(a.a));K(a.A.a,"height",J(a.a));d=a.A;d.p=d.p;e=new L(d.p);e={e:e.e,b:e.b};s=mc(c,e);f=Rb(d.p.offsetParent);h=J(d.p.offsetParent);var l;d.p=d.p;d.s&&s?(fc(s.qa,d.p,s.name),
|
106
|
+
d.p.style.bottom="auto",d.p.style.right="auto",l=new L(d.p),s=l.e,k=l.b,c.La&&(s=Math.min(e.e,s),k=Math.min(e.b,k),K(d.p,"width",s),K(d.p,"height",k),B(d.p,"scroll"),Kc(d.p)),K(d.p,"left",(f-s-l.Ca)/2),K(d.p,"top",(h-k-l.O)/2),c=!0):c=!1;return!c?(Yd(a),!1):!0}function Yd(a){if(a.U)a.U=!1,a.a.parentNode.removeChild(a.A.a),a.A.v(),a.A=i}n.ba=function(){return!this.r?!0:Va(this.r,!0)};n.Ea=function(a){return Qb(this.size,a)};
|
107
|
+
function Ud(a){var b=O.url;a.Fa.forEach(function(a){var d=D("a[href]",a).filter(function(a){return x.oa(a.href)===b}),e=[];d.length&&(e=ga(a.children),e.forEach(function(a){d.some(function(b){return a.contains(b)})?B(a,"current"):kb(a,"current")}))})}function Vd(a){a.ib.forEach(function(a,c){Jc(a,this.jb[c],{pagenumber:V+1||1,pagecount:!O.c[P.index]||P===Uc?1:O.c[P.index].B||1,url:O.url,documentnumber:Y+1||1,documentcount:T.w.length})},a)}
|
108
|
+
function ke(a){a.mb.forEach(function(a,c){Jc(a,this.nb[c],T.i)},a)}function le(a){a.Pa.forEach(function(a,c){Jc(a,this.Qa[c],O.i)},a)}function me(a){var b=nd;b&&a.Pb.forEach(function(a){K(a,"width",b)},a)}function ne(a,b){a.nodeName==="BUTTON"?a.disabled=!b:b?kb(a,"disabled"):B(a,"disabled")}function oe(a){if(a.nextPage){var b=Id();a.nextPage.forEach(function(a){ne(a,b)},a)}}function pe(a){if(a.gb){var b=Jd();a.gb.forEach(function(a){ne(a,b)},a)}}
|
109
|
+
function qe(a){if(a.lb){var b=Dd();a.lb.forEach(function(a){ne(a,b)},a)}}function re(a){if(a.kb){var b=Ed();a.kb.forEach(function(a){ne(a,b)},a)}}function Td(a){fb(a.uc,"selectPages",a)}n.uc=function(){Sd();se(this);he(this);Vd(this);le(this);ke(this);me(this);oe(this);pe(this);qe(this);re(this)};n.Vb=function(){A("updateTOC");var a={contents:T.h.map(function(a){return a.i})};this.Fa.forEach(function(b,c){Jc(b,this.bb[c],a)},this);Ud(this)};
|
110
|
+
function se(a){var b=a.j;a.j=Nd(a.hb);b.forEach(function(a){if(a){var b=a.a;this.j.indexOf(a)===-1&&(a.v(),b&&b.parentNode===this.T&&this.T.removeChild(b))}},a);a.j.forEach(function(a,b){if(a){var e=a.a||a.N();e.parentNode||this.T.appendChild(e);e.setAttribute("id",b===0?"previousPage":b===1?"currentPage":"nextPage")}},a)}
|
111
|
+
function he(a,b){var c=a.j[0],d=a.j[1],e=a.j[2],f,h=d.size.Q/2;a.da=[0,0,0];c&&(f=Math.max(d.size.marginLeft,c.size.marginRight),a.da[0]=-(h+f+c.size.Q/2));e&&(f=Math.max(d.size.marginRight,e.size.marginLeft),a.da[2]=h+f+e.size.Q/2);b?(b>0?(d.a.setAttribute("id","nextPage"),e?(b=-a.da[2],e.a.setAttribute("id","currentPage")):b=-(d.size.Q+d.size.marginRight)):(d.a.setAttribute("id","previousPage"),c?(b=-a.da[0],c.a.setAttribute("id","currentPage")):b=d.size.Q+d.size.marginLeft),a.da=a.da.map(function(a){return a+
|
112
|
+
b}),a.ub=o(),a.D-=b):a.D=a.D||0;a.Ba()}n.Ba=function(a){!a&&this.D?(gb(["animatePages","resumeTasks"]),a=1-(o()-this.ub||0)/200,a=Math.max(0,Math.min(1,a)),(this.D=Math.round(this.D*a))?fb(this.Ba,"animatePages",this):(this.D=0,fb(hb,"resumeTasks"))):A("animatePages");this.j.forEach(function(a,c){a&&a.a&&Tb(a.a,this.da[c]+this.D,0)},this)};function te(a){D(".container",a);this.r=a.hasAttribute("data-requires")?a.getAttribute("data-requires").split(" "):i;this.l=a.parentNode.innerHTML;this.size=new L(a);delete this.size.e;delete this.size.b}te.prototype.N=function(){if(!this.s)this.s=!0,this.a=pb(this.l),this.p=D(".container",this.a)[0];return this.a};te.prototype.v=function(){if(this.s)this.s=!1,this.a=i};te.prototype.Ea=function(a){return Qb(this.size,a)};te.prototype.ba=function(){return!this.r?!0:Va(this.r,!0)};var $,ue,je;function ve(){var a=[];Nb("chrome").forEach(function(b){var c;c=b.getAttribute("data-requires");if(!c||Va(c.split(" ")))$.ja.appendChild(b),c=new Pd(b),a.push(c),$.ja.removeChild(b)});return a}function we(){var a=[];Nb("lightbox").forEach(function(b){var c;c=b.getAttribute("data-requires");if(!c||Va(c.split(" ")))$.ja.appendChild(b),c=new te(b),a.push(c),$.ja.removeChild(b)});return a}
|
113
|
+
function xe(){if($.orientation!==window.orientation)Sa(),$.orientation=window.orientation,$.orientation%180?$.viewport.setAttribute("content","width=device-height, height=device-width"):$.viewport.setAttribute("content","width=device-width, height=device-height"),ta&&!da&&!Ga&&window.scrollTo(0,0)}function ie(){if(v||!da)return(window.pageYOffset||window.pageXOffset)&&window.scrollTo(0,0),{e:window.innerWidth,b:window.innerHeight};else{var a=r;return{e:Rb(a),b:J(a)}}}
|
114
|
+
function ye(){var a=ie(),b;if(a.b!==$.size.b||a.e!==$.size.e){$.size=a;if(!$.G||!$.G.ba()||!$.G.Ea(a)){b=ue;var c,d,e,f=i;for(c=0,d=b.length;c<d;c+=1)if(e=b[c],e.ba()&&e.Ea(a)){f=e;break}b=f;if(!b)return;mb($.ja);$.G&&$.G.v();$.ja.appendChild(b.N());$.G=b;E(document,"treesaver.chromechanged",{node:b.a})}b=$.G;K(b.a,"width",a.e);K(b.a,"height",a.b);b.hb=i;b.hb={e:Rb(b.T),b:J(b.T)};O&&(Td(b),fb(b.Vb,"updateTOC",b))}}
|
115
|
+
if(v){var ze=function(a){return function(){$.G&&Rd($.G);a()}};p("treesaver.nextPage",ze(Md));p("treesaver.previousPage",ze(Hd));p("treesaver.nextArticle",ze(Ld));p("treesaver.previousArticle",ze(Gd))};/*
|
120
116
|
Copyright 2011 Filipe Fortes ( www.fortes.com ).
|
121
117
|
Version: 0.1.
|
122
118
|
|
123
119
|
Licensed under MIT and GPLv2.
|
124
120
|
*/
|
125
|
-
function
|
126
|
-
function
|
127
|
-
function
|
128
|
-
100,[0,0])),a=!0):a=!1;(!a||!sd())&&
|
129
|
-
if(
|
121
|
+
function Ae(){if(da)r.innerHTML=ea;else if(fa)r.innerHTML=fa;Be();Za&&bb.call(window,Za);hb();Za=-1;Wa=[];Xa={};Hb=i;Fb=0;Gb=[];x.zc();document.documentElement.className="js no-treesaver";document.documentElement.style.display="block"}function Be(){A("unboot");vb(document,"DOMContentLoaded",Ce);delete ba.Rb;delete ba.Db}
|
122
|
+
function Ce(){ba.Db=!0;(r=document.getElementById("ts_container"))?(da=!0,ea=r.innerHTML):(da=!1,r=document.body);fa=document.body.innerHTML;mb(r);r.innerHTML='<div id="loading">Loading '+document.title+"...</div>";document.documentElement.style.display="block";De()}
|
123
|
+
function De(){if(ba.Rb&&ba.Db&&document.body){Be();ub(window,"unload",Ee);var a;$={orientation:0,size:{e:0,b:0}};mb(r);a=$;var b;da?b=r:(b=document.createElement("div"),b.setAttribute("id","chromeContainer"),r.appendChild(b));a.ja=b;a=$;b=D("meta[name=viewport]")[0];b||(b=document.createElement("meta"),b.setAttribute("name","viewport"),D("head")[0].appendChild(b));a.viewport=b;ue=ve();je=we();ue.length?(ye(),db(ye,100,Infinity,[],!1,"checkState",g),ta&&!da&&!Ga&&(ub(window,"orientationchange",xe),
|
124
|
+
eb(window.scrollTo,100,[0,0])),a=!0):a=!1;(!a||!sd())&&Ee()}}function Ee(){vb(window,"unload",Ee);Bd();ta&&!da&&vb(window,"orientationchange",xe);$.G&&$.G.v();je=ue=$=i;Ae()}
|
125
|
+
if(ka){document.documentElement.style.display="none";x.load();Sa();var Fe=function(){ba.Rb=!0;De()},Ge,He=document.querySelectorAll("link[rel~=resources]");(Ge=He.length?He[0].getAttribute("href"):i)?Fb?Fb===Mb?Fe():Gb.push(Fe):(Fb=1,Gb=[Fe],x.get(Ge,Kb)):Fe();/complete|loaded/.test(document.readyState)?Ce():ub(document,"DOMContentLoaded",Ce);eb(Ae,5E3,[],"unboot")};}).call(window);
|