/* Copyright 2014 Adobe Systems Incorporated. Licensed under the Apache 2.0 License. www.apache.org/licenses/LICENSE-2.0.html */

!function(){“use strict”;function a(a){var b=parseFloat(a.fontSize),c=“normal”===a.lineHeight?p*b:parseFloat(a.lineHeight);return{leading:c-b,lineHeight:c,fontSize:b}}function b(a){var b=a.createElement(“div”);return b.style.position=“fixed”,b.style.padding=o,b.style.opacity=“0”,b.style.fontSize=n,b.style.lineHeight=“1”,a.body.appendChild(b),b}function c(a){var b=a.ownerDocument.createElement(“span”);return b.textContent=l,a&&a.appendChild(b),b}function d(a){a.ownerDocument.body.removeChild(a)}function e(a,b,c,d){function e(a,b){var c=4*b,d=a.data,e=a.data,f=a.data;return 0===d||0===e||0===f?!0:!1}var f=-1,g=document.createElement(“canvas”);g.width=c,g.height=d,a.appendChild(g);var h=g.getContext(“2d”);h.font=n+“ ”+b,h.fillStyle=“#ffffff”,h.fillRect(0,0,h.canvas.width,h.canvas.height),h.fillStyle=“#000000”,h.textBaseline=“top”,h.fillText(“E”,0,0);for(var i=h.getImageData(Math.ceil(g.width/2),0,1,g.height),j=null,k=g.height-1;k>=0;k–)if(e(i,k)){j=k;break}for(var k=0;k<g.height;k++)if(e(i,k)){f=(j+1-k)/d;break}return f}function f(a,f){var g=q;if(g)return g;g={baselineRatio:void 0,capHeightRatio:void 0};var h=b(a);h.style.fontFamily=f;var i=c(h);i.style.fontSize=o;var j=c(h);g.baselineRatio=i.offsetTop/m;try{g.capHeightRatio=e(h,f,j.offsetWidth,m)}catch(k){throw new Error(“ Error computing font metrics: ”+k.message)}finally{d(h)}return q=g,g}function g(a){return a+“px”}function h(a){return a.classList.contains®?!0:void 0}function i(a){var b=“gjpqQ”;return-1===b.indexOf(a.textContent)?!1:!0}function j(a){a.dcapjs&&(a.style.cssFloat=“”,a.style.padding=“”,a.style.fontSize=“”,a.style.lineHeight=“”,a.style.marginTop=“”)}function k(b,c,d){if(d||(d=c),1==d&&1==c)return void j(b);var e=b.ownerDocument,k=b,l=k.parentNode,m=window.getComputedStyle(k),n=window.getComputedStyle(l),p=f(e,m.fontFamily),q=f(e,n.fontFamily),r=p.capHeightRatio,s=a(n),t=(q.baselineRatio-q.capHeightRatio)*s.fontSize,u=c*s.lineHeight-s.leading-t-(1-q.baselineRatio)*s.fontSize,v=u/r;k.dcapjs=!0,k.style.cssFloat=“left”,k.style.padding=o,k.style.fontSize=g(v),k.style.lineHeight=o;var w=s.leading/2+t;if(w-=(c-d)*s.lineHeight,k.style.marginTop=g(w),c>d){var x=parseFloat(n.marginTop);l.style.marginTop=g(x+-1*w)}var y=0;i(k)?y=v*(1-p.baselineRatio):h(k)&&(y=v-u),k.style.height=g(u+y);var z=k.dcapjsStrut;z||(z=e.createElement(“span”),z.style.display=“inline-block”,k.appendChild(z),k.dcapjsStrut=z),z.style.height=g(u)}var l=“X”,m=100,n=m+“px”,o=“0px”,p=1.15,q={},r=“dcjs-descender”;window.Dropcap={layout:function(a,b,c){if(1>b||c&&1>c)throw new RangeError(“Dropcap.layout expects the baseline position and height to be 1 or above”);if(a instanceof HTMLElement)k(a,b,c);else{if(!(a instanceof NodeList))throw new TypeError(“Dropcap.layout expects a single HTMLElement or a NodeList”);var d=Array.prototype.forEach;d.call(a,function(a){k(a,b,c)})}}}}();