diff --git a/holder.js b/holder.js index a7e8446..b91f0bd 100644 --- a/holder.js +++ b/holder.js @@ -1,8 +1,8 @@ /*! Holder - client side image placeholders -Version 2.4.1+f63aw -© 2014 Ivan Malopinsky - http://imsky.co +Version 2.5.0-pre+1ms4m +© 2015 Ivan Malopinsky - http://imsky.co Site: http://imsky.github.io/holder Issues: https://github.com/imsky/holder/issues @@ -466,14 +466,20 @@ if (!Object.prototype.hasOwnProperty){ /* Holder.js - client side image placeholders -© 2012-2014 Ivan Malopinsky - http://imsky.co +© 2012-2015 Ivan Malopinsky - http://imsky.co */ (function(register, global, undefined) { //Constants and definitions var SVG_NS = 'http://www.w3.org/2000/svg'; + var NODE_TYPE_COMMENT = 8; var document = global.document; + var version = '2.5.0-pre'; + var generatorComment = '\n' + + 'Created with Holder.js ' + version + '.\n' + + 'Learn more at http://holderjs.com\n' + + '(c) 2012-2015 Ivan Malopinsky - http://imsky.co\n'; var Holder = { /** @@ -515,22 +521,15 @@ Holder.js - client side image placeholders */ run: function(userOptions) { userOptions = userOptions || {}; - var renderSettings = {}; + var engineSettings = {}; App.vars.preempted = true; var options = extend(App.settings, userOptions); - renderSettings.renderer = options.renderer ? options.renderer : App.setup.renderer; - if (App.setup.renderers.join(',').indexOf(renderSettings.renderer) === -1) { - renderSettings.renderer = App.setup.supportsSVG ? 'svg' : (App.setup.supportsCanvas ? 'canvas' : 'html'); - } - - //< v2.4 API compatibility - if (options.use_canvas) { - renderSettings.renderer = 'canvas'; - } else if (options.use_svg) { - renderSettings.renderer = 'svg'; + engineSettings.renderer = options.renderer ? options.renderer : App.setup.renderer; + if (App.setup.renderers.join(',').indexOf(engineSettings.renderer) === -1) { + engineSettings.renderer = App.setup.supportsSVG ? 'svg' : (App.setup.supportsCanvas ? 'canvas' : 'html'); } var images = getNodeArray(options.images); @@ -538,9 +537,9 @@ Holder.js - client side image placeholders var stylenodes = getNodeArray(options.stylenodes); var objects = getNodeArray(options.objects); - renderSettings.stylesheets = []; - renderSettings.svgXMLStylesheet = true; - renderSettings.noFontFallback = options.noFontFallback ? options.noFontFallback : false; + engineSettings.stylesheets = []; + engineSettings.svgXMLStylesheet = true; + engineSettings.noFontFallback = options.noFontFallback ? options.noFontFallback : false; for (var i = 0; i < stylenodes.length; i++) { var styleNode = stylenodes[i]; @@ -550,7 +549,7 @@ Holder.js - client side image placeholders var proxyLink = newEl('a'); proxyLink.href = href; var stylesheetURL = proxyLink.protocol + '//' + proxyLink.host + proxyLink.pathname + proxyLink.search; - renderSettings.stylesheets.push(stylesheetURL); + engineSettings.stylesheets.push(stylesheetURL); } } @@ -582,7 +581,12 @@ Holder.js - client side image placeholders if (holderURL != null) { var holderFlags = parseURL(holderURL, options); if (holderFlags) { - prepareDOMElement('background', bgnodes[i], holderFlags, renderSettings); + prepareDOMElement({ + mode:'background', + el: bgnodes[i], + flags: holderFlags, + engineSettings: engineSettings + }); } } } @@ -600,9 +604,9 @@ Holder.js - client side image placeholders var objectHasDataSrcURL = objectAttr.dataSrc != null && objectAttr.dataSrc.indexOf(options.domain) === 0; if (objectHasSrcURL) { - prepareImageElement(options, renderSettings, objectAttr.data, object); + prepareImageElement(options, engineSettings, objectAttr.data, object); } else if (objectHasDataSrcURL) { - prepareImageElement(options, renderSettings, objectAttr.dataSrc, object); + prepareImageElement(options, engineSettings, objectAttr.dataSrc, object); } } @@ -622,25 +626,25 @@ Holder.js - client side image placeholders if (imageHasSrc) { if (imageAttr.src.indexOf(options.domain) === 0) { - prepareImageElement(options, renderSettings, imageAttr.src, image); + prepareImageElement(options, engineSettings, imageAttr.src, image); } else if (imageHasDataSrcURL) { //Image has a valid data-src and an invalid src if (imageRendered) { //If the placeholder has already been render, re-render it - prepareImageElement(options, renderSettings, imageAttr.dataSrc, image); + prepareImageElement(options, engineSettings, imageAttr.dataSrc, image); } else { //If the placeholder has not been rendered, check if the image exists and render a fallback if it doesn't - (function(src, options, renderSettings, dataSrc, image){ - imageExists(src, function(exists){ - if(!exists){ - prepareImageElement(options, renderSettings, dataSrc, image); - } - }); - })(imageAttr.src, options, renderSettings, imageAttr.dataSrc, image); + (function(src, options, engineSettings, dataSrc, image){ + imageExists(src, function(exists){ + if(!exists){ + prepareImageElement(options, engineSettings, dataSrc, image); + } + }); + })(imageAttr.src, options, engineSettings, imageAttr.dataSrc, image); } } } else if (imageHasDataSrcURL) { - prepareImageElement(options, renderSettings, imageAttr.dataSrc, image); + prepareImageElement(options, engineSettings, imageAttr.dataSrc, image); } } @@ -653,15 +657,10 @@ Holder.js - client side image placeholders throw 'Holder: invisible placeholder'; } }; - } + }, + version: version }; - //< v2.4 API compatibility - - Holder.add_theme = Holder.addTheme; - Holder.add_image = Holder.addImage; - Holder.invisible_error_fn = Holder.invisibleErrorFn; - var App = { settings: { domain: 'holder.js', @@ -697,11 +696,11 @@ Holder.js - client side image placeholders } } }, - defaults: { - size: 10, - units: 'pt', - scale: 1/16 - }, + defaults: { + size: 10, + units: 'pt', + scale: 1 / 16 + }, flags: { dimensions: { regex: /^(\d+)x(\d+)$/, @@ -769,10 +768,15 @@ Holder.js - client side image placeholders * @param src Image URL * @param el Image DOM element */ - function prepareImageElement(options, renderSettings, src, el) { + function prepareImageElement(options, engineSettings, src, el) { var holderFlags = parseURL(src.substr(src.lastIndexOf(options.domain)), options); if (holderFlags) { - prepareDOMElement(null, el, holderFlags, renderSettings); + prepareDOMElement({ + mode: null, + el: el, + flags: holderFlags, + engineSettings: engineSettings + }); } } @@ -859,11 +863,13 @@ Holder.js - client side image placeholders * Modifies the DOM to fit placeholders and sets up resizable image callbacks (for fluid and automatically sized placeholders) * * @private - * @param el Image DOM element - * @param flags Placeholder-specific configuration - * @param _renderSettings Instance configuration + * @param settings DOM prep settings */ - function prepareDOMElement(mode, el, flags, _renderSettings) { + function prepareDOMElement(prepSettings) { + var mode = prepSettings.mode; + var el = prepSettings.el; + var flags = prepSettings.flags; + var _engineSettings = prepSettings.engineSettings; var dimensions = flags.dimensions, theme = flags.theme; var dimensionsCaption = dimensions.width + 'x' + dimensions.height; @@ -883,21 +889,21 @@ Holder.js - client side image placeholders } var holderURL = flags.holderURL; - var renderSettings = extend(_renderSettings, null); + var engineSettings = extend(_engineSettings, null); if (flags.font) { theme.font = flags.font; //Only run the webfont fallback if noFontFallback is false, if the node is not an image, and if canvas is supported - if (!renderSettings.noFontFallback && el.nodeName.toLowerCase() === 'img' && App.setup.supportsCanvas && renderSettings.renderer === 'svg') { - renderSettings = extend(renderSettings, { + if (!engineSettings.noFontFallback && el.nodeName.toLowerCase() === 'img' && App.setup.supportsCanvas && engineSettings.renderer === 'svg') { + engineSettings = extend(engineSettings, { renderer: 'canvas' }); } } //Chrome and Opera require a quick 10ms re-render if web fonts are used with canvas - if (flags.font && renderSettings.renderer == 'canvas') { - renderSettings.reRender = true; + if (flags.font && engineSettings.renderer == 'canvas') { + engineSettings.reRender = true; } if (mode == 'background') { @@ -916,41 +922,43 @@ Holder.js - client side image placeholders el.holderData = { flags: flags, - renderSettings: renderSettings + engineSettings: engineSettings }; if (mode == 'image' || mode == 'fluid') { setAttr(el, { - 'alt': (theme.text ? (theme.text.length > 16 ? theme.text.substring(0, 16) + '…' : theme.text) + ' [' + dimensionsCaption + ']' : dimensionsCaption) + 'alt': (theme.text ? theme.text + ' [' + dimensionsCaption + ']' : dimensionsCaption) }); } - - if (mode == 'image') { - if (renderSettings.renderer == 'html' || !flags.auto) { - el.style.width = dimensions.width + 'px'; - el.style.height = dimensions.height + 'px'; - } - if (renderSettings.renderer == 'html') { - el.style.backgroundColor = theme.background; - } else { - render(mode, { + + var settings = { + mode: mode, + params: { dimensions: dimensions, theme: theme, flags: flags - }, el, renderSettings); + }, + el: el, + engineSettings: engineSettings + }; + + if (mode == 'image') { + if (engineSettings.renderer == 'html' || !flags.auto) { + el.style.width = dimensions.width + 'px'; + el.style.height = dimensions.height + 'px'; + } + if (engineSettings.renderer == 'html') { + el.style.backgroundColor = theme.background; + } else { + render(settings); if (flags.textmode && flags.textmode == 'exact') { App.vars.resizableImages.push(el); updateResizableElements(el); } } - } else if (mode == 'background' && renderSettings.renderer != 'html') { - render(mode, { - dimensions: dimensions, - theme: theme, - flags: flags - }, - el, renderSettings); + } else if (mode == 'background' && engineSettings.renderer != 'html') { + render(settings); } else if (mode == 'fluid') { if (dimensions.height.slice(-1) == '%') { el.style.height = dimensions.height; @@ -968,7 +976,7 @@ Holder.js - client side image placeholders setInitialDimensions(el); - if (renderSettings.renderer == 'html') { + if (engineSettings.renderer == 'html') { el.style.backgroundColor = theme.background; } else { App.vars.resizableImages.push(el); @@ -981,16 +989,19 @@ Holder.js - client side image placeholders * Core function that takes output from renderers and sets it as the source or background-image of the target element * * @private - * @param mode Placeholder mode, either background or image - * @param params Placeholder-specific parameters - * @param el Image DOM element - * @param renderSettings Instance configuration + * @param renderSettings Renderer settings */ - - function render(mode, params, el, renderSettings) { + function render(renderSettings) { var image = null; + var mode = renderSettings.mode; + //todo rename params + var params = renderSettings.params; + //todo rename el + var el = renderSettings.el; + //todo rename renderSettings! + var engineSettings = renderSettings.engineSettings; - switch (renderSettings.renderer) { + switch (engineSettings.renderer) { case 'svg': if (!App.setup.supportsSVG) return; break; @@ -1011,27 +1022,17 @@ Holder.js - client side image placeholders var sceneGraph = buildSceneGraph(scene); - var rendererParams = { - text: scene.text, - width: scene.width, - height: scene.height, - textHeight: scene.font.size, - font: scene.font.family, - fontWeight: scene.font.weight, - template: scene.theme - }; - function getRenderedImage() { var image = null; - switch (renderSettings.renderer) { + switch (engineSettings.renderer) { case 'canvas': - image = sgCanvasRenderer(sceneGraph); + image = sgCanvasRenderer(sceneGraph, renderSettings); break; case 'svg': image = sgSVGRenderer(sceneGraph, renderSettings); break; default: - throw 'Holder: invalid renderer: ' + renderSettings.renderer; + throw 'Holder: invalid renderer: ' + engineSettings.renderer; } return image; } @@ -1059,7 +1060,7 @@ Holder.js - client side image placeholders 'type': 'image/svg+xml' }); } - if (renderSettings.reRender) { + if (engineSettings.reRender) { setTimeout(function() { var image = getRenderedImage(); if (image == null) { @@ -1265,18 +1266,23 @@ Holder.js - client side image placeholders } } - var drawParams = { + var settings = { + mode: 'image', + params: { dimensions: dimensions, theme: flags.theme, flags: flags + }, + el: el, + engineSettings: el.holderData.engineSettings }; if (flags.textmode && flags.textmode == 'exact') { flags.exactDimensions = dimensions; - drawParams.dimensions = flags.dimensions; + settings.params.dimensions = flags.dimensions; } - render('image', drawParams, el, el.holderData.renderSettings); + render(settings); } } } @@ -1349,10 +1355,14 @@ Holder.js - client side image placeholders var tnode = function(text) { return document.createTextNode(text); }; - if (svg == null) { + if (svg == null || svg.parentNode !== document.body) { firstTimeSetup = true; } + svg = initSVG(svg, rootNode.properties.width, rootNode.properties.height); + //Show staging element before staging + svg.style.display = 'block'; + if (firstTimeSetup) { stagingText = newEl('text', SVG_NS); stagingTextNode = tnode(null); @@ -1416,6 +1426,9 @@ Holder.js - client side image placeholders } } + //Hide staging element after staging + svg.style.display = 'none'; + return { spaceWidth: spaceWidth, lineCount: lineCount, @@ -1476,8 +1489,12 @@ Holder.js - client side image placeholders return function(sceneGraph, renderSettings) { var root = sceneGraph.root; + var holderURL = renderSettings.params.flags.holderURL; + var commentNode = document.createComment('\n' + 'Source URL: ' + holderURL + generatorComment); initSVG(svg, root.properties.width, root.properties.height); + svg.insertBefore(commentNode, svg.firstChild); + var groups = svg.querySelectorAll('g'); for (var i = 0; i < groups.length; i++) { @@ -1524,7 +1541,7 @@ Holder.js - client side image placeholders } var svgString = 'data:image/svg+xml;base64,' + - btoa(unescape(encodeURIComponent(serializeSVG(svg, renderSettings)))); + btoa(unescape(encodeURIComponent(serializeSVG(svg, renderSettings.engineSettings)))); return svgString; }; })(); @@ -1577,6 +1594,12 @@ Holder.js - client side image placeholders if (svg.webkitMatchesSelector) { svg.setAttribute('xmlns', SVG_NS); } + //Remove comment nodes + for (var i = 0; i < svg.childNodes.length; i++) { + if (svg.childNodes[i].nodeType === NODE_TYPE_COMMENT) { + svg.removeChild(svg.childNodes[i]); + } + } setAttr(svg, { 'width': width, @@ -1594,15 +1617,15 @@ Holder.js - client side image placeholders * @param svg SVG context * @param stylesheets CSS stylesheets to include */ - function serializeSVG(svg, renderSettings) { + function serializeSVG(svg, engineSettings) { if (!global.XMLSerializer) return; var serializer = new XMLSerializer(); var svgCSS = ''; - var stylesheets = renderSettings.stylesheets; + var stylesheets = engineSettings.stylesheets; var defs = svg.querySelector('defs'); //External stylesheets: Processing Instruction method - if (renderSettings.svgXMLStylesheet) { + if (engineSettings.svgXMLStylesheet) { var xml = new DOMParser().parseFromString('', 'application/xml'); //Add directives for (var i = stylesheets.length - 1; i >= 0; i--) { diff --git a/holder.min.js b/holder.min.js index 84b039f..d6c12c3 100644 --- a/holder.min.js +++ b/holder.min.js @@ -1,12 +1,12 @@ /*! Holder - client side image placeholders -Version 2.4.1+f63aw -© 2014 Ivan Malopinsky - http://imsky.co +Version 2.5.0-pre+1ms4m +© 2015 Ivan Malopinsky - http://imsky.co Site: http://imsky.github.io/holder Issues: https://github.com/imsky/holder/issues License: http://opensource.org/licenses/MIT */ -!function(a,b,c){b[a]=c}("onDomReady",this,function(a){"use strict";function b(a){if(!v){if(!g.body)return e(b);for(v=!0;a=w.shift();)e(a)}}function c(a){(t||a.type===i||g[m]===l)&&(d(),b())}function d(){t?(g[s](q,c,j),a[s](i,c,j)):(g[o](r,c),a[o](k,c))}function e(a,b){setTimeout(a,+b>=0?b:1)}function f(a){v?e(a):w.push(a)}null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function y(){document.removeEventListener("DOMContentLoaded",y,!1),document.readyState="complete"},!1),document.readyState="loading");var g=a.document,h=g.documentElement,i="load",j=!1,k="on"+i,l="complete",m="readyState",n="attachEvent",o="detachEvent",p="addEventListener",q="DOMContentLoaded",r="onreadystatechange",s="removeEventListener",t=p in g,u=j,v=j,w=[];if(g[m]===l)e(b);else if(t)g[p](q,c,j),a[p](i,c,j);else{g[n](r,c),a[n](k,c);try{u=null==a.frameElement&&h}catch(x){}u&&u.doScroll&&!function z(){if(!v){try{u.doScroll("left")}catch(a){return e(z,50)}d(),b()}}()}return f.version="1.4.0",f.isReady=function(){return v},f}(this)),document.querySelectorAll||(document.querySelectorAll=function(a){var b,c=document.createElement("style"),d=[];for(document.documentElement.firstChild.appendChild(c),document._qsa=[],c.styleSheet.cssText=a+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),c.parentNode.removeChild(c);document._qsa.length;)b=document._qsa.shift(),b.style.removeAttribute("x-qsa"),d.push(b);return document._qsa=null,d}),document.querySelector||(document.querySelector=function(a){var b=document.querySelectorAll(a);return b.length?b[0]:null}),document.getElementsByClassName||(document.getElementsByClassName=function(a){return a=String(a).replace(/^|\s+/g,"."),document.querySelectorAll(a)}),Object.keys||(Object.keys=function(a){if(a!==Object(a))throw TypeError("Object.keys called on non-object");var b,c=[];for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(b);return c}),function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.atob=a.atob||function(a){a=String(a);var c,d=0,e=[],f=0,g=0;if(a=a.replace(/\s/g,""),a.length%4===0&&(a=a.replace(/=+$/,"")),a.length%4===1)throw Error("InvalidCharacterError");if(/[^+/0-9A-Za-z]/.test(a))throw Error("InvalidCharacterError");for(;d>16&255)),e.push(String.fromCharCode(f>>8&255)),e.push(String.fromCharCode(255&f)),g=0,f=0),d+=1;return 12===g?(f>>=4,e.push(String.fromCharCode(255&f))):18===g&&(f>>=2,e.push(String.fromCharCode(f>>8&255)),e.push(String.fromCharCode(255&f))),e.join("")},a.btoa=a.btoa||function(a){a=String(a);var c,d,e,f,g,h,i,j=0,k=[];if(/[^\x00-\xFF]/.test(a))throw Error("InvalidCharacterError");for(;j>2,g=(3&c)<<4|d>>4,h=(15&d)<<2|e>>6,i=63&e,j===a.length+2?(h=64,i=64):j===a.length+1&&(i=64),k.push(b.charAt(f),b.charAt(g),b.charAt(h),b.charAt(i));return k.join("")}}(this),function(){function a(b,c,d){b.document;var e,f=b.currentStyle[c].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],g=f[1],h=f[2];return d=d?/%|em/.test(h)&&b.parentElement?a(b.parentElement,"fontSize",null):16:d,e="fontSize"==c?d:/width/i.test(c)?b.clientWidth:b.clientHeight,"%"==h?g/100*e:"cm"==h?.3937*g*96:"em"==h?g*d:"in"==h?96*g:"mm"==h?.3937*g*96/10:"pc"==h?12*g*96/72:"pt"==h?96*g/72:g}function b(a,b){var c="border"==b?"Width":"",d=b+"Top"+c,e=b+"Right"+c,f=b+"Bottom"+c,g=b+"Left"+c;a[b]=(a[d]==a[e]&&a[d]==a[f]&&a[d]==a[g]?[a[d]]:a[d]==a[f]&&a[g]==a[e]?[a[d],a[e]]:a[g]==a[e]?[a[d],a[e],a[f]]:[a[d],a[e],a[f],a[g]]).join(" ")}function c(c){var d,e=this,f=c.currentStyle,g=a(c,"fontSize"),h=function(a){return"-"+a.toLowerCase()};for(d in f)if(Array.prototype.push.call(e,"styleFloat"==d?"float":d.replace(/[A-Z]/,h)),"width"==d)e[d]=c.offsetWidth+"px";else if("height"==d)e[d]=c.offsetHeight+"px";else if("styleFloat"==d)e.float=f[d];else if(/margin.|padding.|border.+W/.test(d)&&"auto"!=e[d])e[d]=Math.round(a(c,d,g))+"px";else if(/^outline/.test(d))try{e[d]=f[d]}catch(i){e.outlineColor=f.color,e.outlineStyle=e.outlineStyle||"none",e.outlineWidth=e.outlineWidth||"0px",e.outline=[e.outlineColor,e.outlineWidth,e.outlineStyle].join(" ")}else e[d]=f[d];b(e,"margin"),b(e,"padding"),b(e,"border"),e.fontSize=Math.round(g)+"px"}window.getComputedStyle||(c.prototype={constructor:c,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(a){var b=a.replace(/-([a-z])/g,function(a){return a=a.charAt?a.split(""):a,a[1].toUpperCase()}),c=this[b];return c},item:function(a){return this[a]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},window.getComputedStyle=function(a){return new c(a)})}(),Object.prototype.hasOwnProperty||(Object.prototype.hasOwnProperty=function(a){var b=this.__proto__||this.constructor.prototype;return a in this&&(!(a in b)||b[a]!==this[a])}),function(a,b){a.augment=b()}(this,function(){"use strict";var a=function(){},b=Array.prototype.slice,c=function(c,d){var e=a.prototype="function"==typeof c?c.prototype:c,f=new a,g=d.apply(f,b.call(arguments,2).concat(e));if("object"==typeof g)for(var h in g)f[h]=g[h];if(!f.hasOwnProperty("constructor"))return f;var i=f.constructor;return i.prototype=f,i};return c.defclass=function(a){var b=a.constructor;return b.prototype=a,b},c.extend=function(a,b){return c(a,function(a){return this.uber=a,b})},c}),function(a,b){function c(a,b,c,f){var g=d(c.substr(c.lastIndexOf(a.domain)),a);g&&e(null,f,g,b)}function d(a,b){for(var c={theme:p(A.settings.themes.gray,null),stylesheets:b.stylesheets,holderURL:[]},d=!1,e=String.fromCharCode(11),f=a.replace(/([^\\])\//g,"$1"+e).split(e),g=/%[0-9a-f]{2}/gi,h=f.length,i=0;h>i;i++){var j=f[i];if(j.match(g))try{j=decodeURIComponent(j)}catch(k){j=f[i]}var l=!1;if(A.flags.dimensions.match(j))d=!0,c.dimensions=A.flags.dimensions.output(j),l=!0;else if(A.flags.fluid.match(j))d=!0,c.dimensions=A.flags.fluid.output(j),c.fluid=!0,l=!0;else if(A.flags.textmode.match(j))c.textmode=A.flags.textmode.output(j),l=!0;else if(A.flags.colors.match(j)){var m=A.flags.colors.output(j);c.theme=p(c.theme,m),l=!0}else if(b.themes[j])b.themes.hasOwnProperty(j)&&(c.theme=p(b.themes[j],null)),l=!0;else if(A.flags.font.match(j))c.font=A.flags.font.output(j),l=!0;else if(A.flags.auto.match(j))c.auto=!0,l=!0;else if(A.flags.text.match(j))c.text=A.flags.text.output(j),l=!0;else if(A.flags.random.match(j)){null==A.vars.cache.themeKeys&&(A.vars.cache.themeKeys=Object.keys(b.themes));var n=A.vars.cache.themeKeys[0|Math.random()*A.vars.cache.themeKeys.length];c.theme=p(b.themes[n],null),l=!0}l&&c.holderURL.push(j)}return c.holderURL.unshift(b.domain),c.holderURL=c.holderURL.join("/"),d?c:!1}function e(a,b,c,d){var e=c.dimensions,g=c.theme,h=e.width+"x"+e.height;if(a=null==a?c.fluid?"fluid":"image":a,null!=c.text&&(g.text=c.text,"object"===b.nodeName.toLowerCase())){for(var j=g.text.split("\\n"),l=0;l16?g.text.substring(0,16)+"…":g.text)+" ["+h+"]":h}),"image"==a?("html"!=o.renderer&&c.auto||(b.style.width=e.width+"px",b.style.height=e.height+"px"),"html"==o.renderer?b.style.backgroundColor=g.background:(f(a,{dimensions:e,theme:g,flags:c},b,o),c.textmode&&"exact"==c.textmode&&(A.vars.resizableImages.push(b),i(b)))):"background"==a&&"html"!=o.renderer?f(a,{dimensions:e,theme:g,flags:c},b,o):"fluid"==a&&("%"==e.height.slice(-1)?b.style.height=e.height:null!=c.auto&&c.auto||(b.style.height=e.height+"px"),"%"==e.width.slice(-1)?b.style.width=e.width:null!=c.auto&&c.auto||(b.style.width=e.width+"px"),("inline"==b.style.display||""===b.style.display||"none"==b.style.display)&&(b.style.display="block"),k(b),"html"==o.renderer?b.style.backgroundColor=g.background:(A.vars.resizableImages.push(b),i(b)))}function f(a,b,c,d){function e(){var a=null;switch(d.renderer){case"canvas":a=C(i);break;case"svg":a=D(i,d);break;default:throw"Holder: invalid renderer: "+d.renderer}return a}var f=null;switch(d.renderer){case"svg":if(!A.setup.supportsSVG)return;break;case"canvas":if(!A.setup.supportsCanvas)return;break;default:return}{var h={width:b.dimensions.width,height:b.dimensions.height,theme:b.theme,flags:b.flags},i=g(h);({text:h.text,width:h.width,height:h.height,textHeight:h.font.size,font:h.font.family,fontWeight:h.font.weight,template:h.theme})}if(f=e(),null==f)throw"Holder: couldn't render placeholder";"background"==a?(c.style.backgroundImage="url("+f+")",c.style.backgroundSize=h.width+"px "+h.height+"px"):("img"===c.nodeName.toLowerCase()?m(c,{src:f}):"object"===c.nodeName.toLowerCase()&&(m(c,{data:f}),m(c,{type:"image/svg+xml"})),d.reRender&&setTimeout(function(){var a=e();if(null==a)throw"Holder: couldn't render placeholder";"img"===c.nodeName.toLowerCase()?m(c,{src:a}):"object"===c.nodeName.toLowerCase()&&(m(c,{data:a}),m(c,{type:"image/svg+xml"}))},100)),m(c,{"data-holder-rendered":!0})}function g(a){function b(a,b,c,d){b.width=c,b.height=d,a.width=Math.max(a.width,b.width),a.height+=b.height,a.add(b)}switch(a.font={family:a.theme.font?a.theme.font:"Arial, Helvetica, Open Sans, sans-serif",size:h(a.width,a.height,a.theme.size?a.theme.size:A.defaults.size),units:a.theme.units?a.theme.units:A.defaults.units,weight:a.theme.fontweight?a.theme.fontweight:"bold"},a.text=a.theme.text?a.theme.text:Math.floor(a.width)+"x"+Math.floor(a.height),a.flags.textmode){case"literal":a.text=a.flags.dimensions.width+"x"+a.flags.dimensions.height;break;case"exact":if(!a.flags.exactDimensions)break;a.text=Math.floor(a.flags.exactDimensions.width)+"x"+Math.floor(a.flags.exactDimensions.height)}var c=new E({width:a.width,height:a.height}),d=c.Shape,e=new d.Rect("holderBg",{fill:a.theme.background});e.resize(a.width,a.height),c.root.add(e);var f=new d.Group("holderTextGroup",{text:a.text,align:"center",font:a.font,fill:a.theme.foreground});f.moveTo(null,null,1),c.root.add(f);var g=f.textPositionData=B(c);if(!g)throw"Holder: staging fallback not supported yet.";f.properties.leading=g.boundingBox.height;var i=null,j=null;if(g.lineCount>1){var k=0,l=0,m=a.width*A.setup.lineWrapRatio,n=0;j=new d.Group("line"+n);for(var o=0;o=m||q===!0)&&(b(f,j,k,f.properties.leading),k=0,l+=f.properties.leading,n+=1,j=new d.Group("line"+n),j.y=l),q!==!0&&(i.moveTo(k,0),k+=g.spaceWidth+p.width,j.add(i))}b(f,j,k,f.properties.leading);for(var r in f.children)j=f.children[r],j.moveTo((f.width-j.width)/2,null,null);f.moveTo((a.width-f.width)/2,(a.height-f.height)/2,null),(a.height-f.height)/2<0&&f.moveTo(null,0,null)}else i=new d.Text(a.text),j=new d.Group("line0"),j.add(i),f.add(j),f.moveTo((a.width-g.boundingBox.width)/2,(a.height-g.boundingBox.height)/2,null);return c}function h(a,b,c){b=parseInt(b,10),a=parseInt(a,10);var d=Math.max(b,a),e=Math.min(b,a),f=A.defaults.scale,g=Math.min(.75*e,.75*d*f);return Math.round(Math.max(c,g))}function i(a){var b;b=null==a||null==a.nodeType?A.vars.resizableImages:[a];for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];if(d.holderData){var e=d.holderData.flags,g=j(d,z.invisibleErrorFn(i));if(g){if(e.fluid&&e.auto){var h=d.holderData.fluidConfig;switch(h.mode){case"width":g.height=g.width/h.ratio;break;case"height":g.width=g.height*h.ratio}}var k={dimensions:g,theme:e.theme,flags:e};e.textmode&&"exact"==e.textmode&&(e.exactDimensions=g,k.dimensions=e.dimensions),f("image",k,d,d.holderData.renderSettings)}}}}function j(a,b){var c={height:a.clientHeight,width:a.clientWidth};return c.height||c.width?(a.removeAttribute("data-holder-invisible"),c):(m(a,{"data-holder-invisible":!0}),void b.call(this,a))}function k(a){if(a.holderData){var b=j(a,z.invisibleErrorFn(k));if(b){var c=a.holderData.flags,d={fluidHeight:"%"==c.dimensions.height.slice(-1),fluidWidth:"%"==c.dimensions.width.slice(-1),mode:null,initialDimensions:b};d.fluidWidth&&!d.fluidHeight?(d.mode="width",d.ratio=d.initialDimensions.width/parseFloat(c.dimensions.height)):!d.fluidWidth&&d.fluidHeight&&(d.mode="height",d.ratio=parseFloat(c.dimensions.width)/d.initialDimensions.height),a.holderData.fluidConfig=d}}}function l(a,b){return null==b?y.createElement(a):y.createElementNS(b,a)}function m(a,b){for(var c in b)a.setAttribute(c,b[c])}function n(a,b,c){if(null==a){a=l("svg",x);var d=l("defs",x);a.appendChild(d)}return a.webkitMatchesSelector&&a.setAttribute("xmlns",x),m(a,{width:b,height:c,viewBox:"0 0 "+b+" "+c,preserveAspectRatio:"none"}),a}function o(a,c){if(b.XMLSerializer){{var d=new XMLSerializer,e="",f=c.stylesheets;a.querySelector("defs")}if(c.svgXMLStylesheet){for(var g=(new DOMParser).parseFromString("","application/xml"),h=f.length-1;h>=0;h--){var i=g.createProcessingInstruction("xml-stylesheet",'href="'+f[h]+'" rel="stylesheet"');g.insertBefore(i,g.firstChild)}var j=g.createProcessingInstruction("xml",'version="1.0" encoding="UTF-8" standalone="yes"');g.insertBefore(j,g.firstChild),g.removeChild(g.documentElement),e=d.serializeToString(g)}var k=d.serializeToString(a);return k=k.replace(/\&(\#[0-9]{2,}\;)/g,"&$1"),e+k}}function p(a,b){var c={};for(var d in a)a.hasOwnProperty(d)&&(c[d]=a[d]);if(null!=b)for(var e in b)b.hasOwnProperty(e)&&(c[e]=b[e]);return c}function q(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+":"+a[c]);return b.join(";")}function r(a){A.vars.debounceTimer||a.call(this),A.vars.debounceTimer&&clearTimeout(A.vars.debounceTimer),A.vars.debounceTimer=setTimeout(function(){A.vars.debounceTimer=null,a.call(this)},A.setup.debounce)}function s(){r(function(){i(null)})}function t(a){var c=null;return"string"==typeof a?c=y.querySelectorAll(a):b.NodeList&&a instanceof b.NodeList?c=a:b.Node&&a instanceof b.Node?c=[a]:b.HTMLCollection&&a instanceof b.HTMLCollection?c=a:null===a&&(c=[]),c}function u(a,b){var c=new Image;c.onerror=function(){b.call(this,!1)},c.onload=function(){b.call(this,!0)},c.src=a}function v(a){for(var b=[],c=0,d=a.length-1;d>=0;d--)c=a.charCodeAt(d),b.unshift(c>128?["&#",c,";"].join(""):a[d]);return b.join("")}function w(a){return a.replace(/&#(\d+);/g,function(a,b){return String.fromCharCode(b)})}var x="http://www.w3.org/2000/svg",y=b.document,z={addTheme:function(a,b){return null!=a&&null!=b&&(A.settings.themes[a]=b),delete A.vars.cache.themeKeys,this},addImage:function(a,b){var c=y.querySelectorAll(b);if(c.length)for(var d=0,e=c.length;e>d;d++){var f=l("img");m(f,{"data-src":a}),c[d].appendChild(f)}return this},run:function(a){a=a||{};var f={};A.vars.preempted=!0;var g=p(A.settings,a);f.renderer=g.renderer?g.renderer:A.setup.renderer,-1===A.setup.renderers.join(",").indexOf(f.renderer)&&(f.renderer=A.setup.supportsSVG?"svg":A.setup.supportsCanvas?"canvas":"html"),g.use_canvas?f.renderer="canvas":g.use_svg&&(f.renderer="svg");var h=t(g.images),i=t(g.bgnodes),j=t(g.stylenodes),k=t(g.objects);f.stylesheets=[],f.svgXMLStylesheet=!0,f.noFontFallback=g.noFontFallback?g.noFontFallback:!1;for(var m=0;m1){c.nodeValue="";for(var v=0;v=0?b:1)}function f(a){v?e(a):w.push(a)}null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function y(){document.removeEventListener("DOMContentLoaded",y,!1),document.readyState="complete"},!1),document.readyState="loading");var g=a.document,h=g.documentElement,i="load",j=!1,k="on"+i,l="complete",m="readyState",n="attachEvent",o="detachEvent",p="addEventListener",q="DOMContentLoaded",r="onreadystatechange",s="removeEventListener",t=p in g,u=j,v=j,w=[];if(g[m]===l)e(b);else if(t)g[p](q,c,j),a[p](i,c,j);else{g[n](r,c),a[n](k,c);try{u=null==a.frameElement&&h}catch(x){}u&&u.doScroll&&!function z(){if(!v){try{u.doScroll("left")}catch(a){return e(z,50)}d(),b()}}()}return f.version="1.4.0",f.isReady=function(){return v},f}(this)),document.querySelectorAll||(document.querySelectorAll=function(a){var b,c=document.createElement("style"),d=[];for(document.documentElement.firstChild.appendChild(c),document._qsa=[],c.styleSheet.cssText=a+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),c.parentNode.removeChild(c);document._qsa.length;)b=document._qsa.shift(),b.style.removeAttribute("x-qsa"),d.push(b);return document._qsa=null,d}),document.querySelector||(document.querySelector=function(a){var b=document.querySelectorAll(a);return b.length?b[0]:null}),document.getElementsByClassName||(document.getElementsByClassName=function(a){return a=String(a).replace(/^|\s+/g,"."),document.querySelectorAll(a)}),Object.keys||(Object.keys=function(a){if(a!==Object(a))throw TypeError("Object.keys called on non-object");var b,c=[];for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(b);return c}),function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.atob=a.atob||function(a){a=String(a);var c,d=0,e=[],f=0,g=0;if(a=a.replace(/\s/g,""),a.length%4===0&&(a=a.replace(/=+$/,"")),a.length%4===1)throw Error("InvalidCharacterError");if(/[^+/0-9A-Za-z]/.test(a))throw Error("InvalidCharacterError");for(;d>16&255)),e.push(String.fromCharCode(f>>8&255)),e.push(String.fromCharCode(255&f)),g=0,f=0),d+=1;return 12===g?(f>>=4,e.push(String.fromCharCode(255&f))):18===g&&(f>>=2,e.push(String.fromCharCode(f>>8&255)),e.push(String.fromCharCode(255&f))),e.join("")},a.btoa=a.btoa||function(a){a=String(a);var c,d,e,f,g,h,i,j=0,k=[];if(/[^\x00-\xFF]/.test(a))throw Error("InvalidCharacterError");for(;j>2,g=(3&c)<<4|d>>4,h=(15&d)<<2|e>>6,i=63&e,j===a.length+2?(h=64,i=64):j===a.length+1&&(i=64),k.push(b.charAt(f),b.charAt(g),b.charAt(h),b.charAt(i));return k.join("")}}(this),function(){function a(b,c,d){b.document;var e,f=b.currentStyle[c].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],g=f[1],h=f[2];return d=d?/%|em/.test(h)&&b.parentElement?a(b.parentElement,"fontSize",null):16:d,e="fontSize"==c?d:/width/i.test(c)?b.clientWidth:b.clientHeight,"%"==h?g/100*e:"cm"==h?.3937*g*96:"em"==h?g*d:"in"==h?96*g:"mm"==h?.3937*g*96/10:"pc"==h?12*g*96/72:"pt"==h?96*g/72:g}function b(a,b){var c="border"==b?"Width":"",d=b+"Top"+c,e=b+"Right"+c,f=b+"Bottom"+c,g=b+"Left"+c;a[b]=(a[d]==a[e]&&a[d]==a[f]&&a[d]==a[g]?[a[d]]:a[d]==a[f]&&a[g]==a[e]?[a[d],a[e]]:a[g]==a[e]?[a[d],a[e],a[f]]:[a[d],a[e],a[f],a[g]]).join(" ")}function c(c){var d,e=this,f=c.currentStyle,g=a(c,"fontSize"),h=function(a){return"-"+a.toLowerCase()};for(d in f)if(Array.prototype.push.call(e,"styleFloat"==d?"float":d.replace(/[A-Z]/,h)),"width"==d)e[d]=c.offsetWidth+"px";else if("height"==d)e[d]=c.offsetHeight+"px";else if("styleFloat"==d)e["float"]=f[d];else if(/margin.|padding.|border.+W/.test(d)&&"auto"!=e[d])e[d]=Math.round(a(c,d,g))+"px";else if(/^outline/.test(d))try{e[d]=f[d]}catch(i){e.outlineColor=f.color,e.outlineStyle=e.outlineStyle||"none",e.outlineWidth=e.outlineWidth||"0px",e.outline=[e.outlineColor,e.outlineWidth,e.outlineStyle].join(" ")}else e[d]=f[d];b(e,"margin"),b(e,"padding"),b(e,"border"),e.fontSize=Math.round(g)+"px"}window.getComputedStyle||(c.prototype={constructor:c,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(a){var b=a.replace(/-([a-z])/g,function(a){return a=a.charAt?a.split(""):a,a[1].toUpperCase()}),c=this[b];return c},item:function(a){return this[a]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},window.getComputedStyle=function(a){return new c(a)})}(),Object.prototype.hasOwnProperty||(Object.prototype.hasOwnProperty=function(a){var b=this.__proto__||this.constructor.prototype;return a in this&&(!(a in b)||b[a]!==this[a])}),function(a,b){a.augment=b()}(this,function(){"use strict";var a=function(){},b=Array.prototype.slice,c=function(c,d){var e=a.prototype="function"==typeof c?c.prototype:c,f=new a,g=d.apply(f,b.call(arguments,2).concat(e));if("object"==typeof g)for(var h in g)f[h]=g[h];if(!f.hasOwnProperty("constructor"))return f;var i=f.constructor;return i.prototype=f,i};return c.defclass=function(a){var b=a.constructor;return b.prototype=a,b},c.extend=function(a,b){return c(a,function(a){return this.uber=a,b})},c}),function(a,b){function c(a,b,c,f){var g=d(c.substr(c.lastIndexOf(a.domain)),a);g&&e({mode:null,el:f,flags:g,engineSettings:b})}function d(a,b){for(var c={theme:p(D.settings.themes.gray,null),stylesheets:b.stylesheets,holderURL:[]},d=!1,e=String.fromCharCode(11),f=a.replace(/([^\\])\//g,"$1"+e).split(e),g=/%[0-9a-f]{2}/gi,h=f.length,i=0;h>i;i++){var j=f[i];if(j.match(g))try{j=decodeURIComponent(j)}catch(k){j=f[i]}var l=!1;if(D.flags.dimensions.match(j))d=!0,c.dimensions=D.flags.dimensions.output(j),l=!0;else if(D.flags.fluid.match(j))d=!0,c.dimensions=D.flags.fluid.output(j),c.fluid=!0,l=!0;else if(D.flags.textmode.match(j))c.textmode=D.flags.textmode.output(j),l=!0;else if(D.flags.colors.match(j)){var m=D.flags.colors.output(j);c.theme=p(c.theme,m),l=!0}else if(b.themes[j])b.themes.hasOwnProperty(j)&&(c.theme=p(b.themes[j],null)),l=!0;else if(D.flags.font.match(j))c.font=D.flags.font.output(j),l=!0;else if(D.flags.auto.match(j))c.auto=!0,l=!0;else if(D.flags.text.match(j))c.text=D.flags.text.output(j),l=!0;else if(D.flags.random.match(j)){null==D.vars.cache.themeKeys&&(D.vars.cache.themeKeys=Object.keys(b.themes));var n=D.vars.cache.themeKeys[0|Math.random()*D.vars.cache.themeKeys.length];c.theme=p(b.themes[n],null),l=!0}l&&c.holderURL.push(j)}return c.holderURL.unshift(b.domain),c.holderURL=c.holderURL.join("/"),d?c:!1}function e(a){var b=a.mode,c=a.el,d=a.flags,e=a.engineSettings,g=d.dimensions,h=d.theme,j=g.width+"x"+g.height;if(b=null==b?d.fluid?"fluid":"image":b,null!=d.text&&(h.text=d.text,"object"===c.nodeName.toLowerCase())){for(var l=h.text.split("\\n"),n=0;n1){var k=0,l=0,m=a.width*D.setup.lineWrapRatio,n=0;j=new d.Group("line"+n);for(var o=0;o=m||q===!0)&&(b(f,j,k,f.properties.leading),k=0,l+=f.properties.leading,n+=1,j=new d.Group("line"+n),j.y=l),q!==!0&&(i.moveTo(k,0),k+=g.spaceWidth+p.width,j.add(i))}b(f,j,k,f.properties.leading);for(var r in f.children)j=f.children[r],j.moveTo((f.width-j.width)/2,null,null);f.moveTo((a.width-f.width)/2,(a.height-f.height)/2,null),(a.height-f.height)/2<0&&f.moveTo(null,0,null)}else i=new d.Text(a.text),j=new d.Group("line0"),j.add(i),f.add(j),f.moveTo((a.width-g.boundingBox.width)/2,(a.height-g.boundingBox.height)/2,null);return c}function h(a,b,c){b=parseInt(b,10),a=parseInt(a,10);var d=Math.max(b,a),e=Math.min(b,a),f=D.defaults.scale,g=Math.min(.75*e,.75*d*f);return Math.round(Math.max(c,g))}function i(a){var b;b=null==a||null==a.nodeType?D.vars.resizableImages:[a];for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];if(d.holderData){var e=d.holderData.flags,g=j(d,C.invisibleErrorFn(i));if(g){if(e.fluid&&e.auto){var h=d.holderData.fluidConfig;switch(h.mode){case"width":g.height=g.width/h.ratio;break;case"height":g.width=g.height*h.ratio}}var k={mode:"image",params:{dimensions:g,theme:e.theme,flags:e},el:d,engineSettings:d.holderData.engineSettings};e.textmode&&"exact"==e.textmode&&(e.exactDimensions=g,k.params.dimensions=e.dimensions),f(k)}}}}function j(a,b){var c={height:a.clientHeight,width:a.clientWidth};return c.height||c.width?(a.removeAttribute("data-holder-invisible"),c):(m(a,{"data-holder-invisible":!0}),void b.call(this,a))}function k(a){if(a.holderData){var b=j(a,C.invisibleErrorFn(k));if(b){var c=a.holderData.flags,d={fluidHeight:"%"==c.dimensions.height.slice(-1),fluidWidth:"%"==c.dimensions.width.slice(-1),mode:null,initialDimensions:b};d.fluidWidth&&!d.fluidHeight?(d.mode="width",d.ratio=d.initialDimensions.width/parseFloat(c.dimensions.height)):!d.fluidWidth&&d.fluidHeight&&(d.mode="height",d.ratio=parseFloat(c.dimensions.width)/d.initialDimensions.height),a.holderData.fluidConfig=d}}}function l(a,b){return null==b?z.createElement(a):z.createElementNS(b,a)}function m(a,b){for(var c in b)a.setAttribute(c,b[c])}function n(a,b,c){if(null==a){a=l("svg",x);var d=l("defs",x);a.appendChild(d)}a.webkitMatchesSelector&&a.setAttribute("xmlns",x);for(var e=0;e","application/xml"),h=f.length-1;h>=0;h--){var i=g.createProcessingInstruction("xml-stylesheet",'href="'+f[h]+'" rel="stylesheet"');g.insertBefore(i,g.firstChild)}var j=g.createProcessingInstruction("xml",'version="1.0" encoding="UTF-8" standalone="yes"');g.insertBefore(j,g.firstChild),g.removeChild(g.documentElement),e=d.serializeToString(g)}var k=d.serializeToString(a);return k=k.replace(/\&(\#[0-9]{2,}\;)/g,"&$1"),e+k}}function p(a,b){var c={};for(var d in a)a.hasOwnProperty(d)&&(c[d]=a[d]);if(null!=b)for(var e in b)b.hasOwnProperty(e)&&(c[e]=b[e]);return c}function q(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+":"+a[c]);return b.join(";")}function r(a){D.vars.debounceTimer||a.call(this),D.vars.debounceTimer&&clearTimeout(D.vars.debounceTimer),D.vars.debounceTimer=setTimeout(function(){D.vars.debounceTimer=null,a.call(this)},D.setup.debounce)}function s(){r(function(){i(null)})}function t(a){var c=null;return"string"==typeof a?c=z.querySelectorAll(a):b.NodeList&&a instanceof b.NodeList?c=a:b.Node&&a instanceof b.Node?c=[a]:b.HTMLCollection&&a instanceof b.HTMLCollection?c=a:null===a&&(c=[]),c}function u(a,b){var c=new Image;c.onerror=function(){b.call(this,!1)},c.onload=function(){b.call(this,!0)},c.src=a}function v(a){for(var b=[],c=0,d=a.length-1;d>=0;d--)c=a.charCodeAt(d),b.unshift(c>128?["&#",c,";"].join(""):a[d]);return b.join("")}function w(a){return a.replace(/&#(\d+);/g,function(a,b){return String.fromCharCode(b)})}var x="http://www.w3.org/2000/svg",y=8,z=b.document,A="2.5.0-pre",B="\nCreated with Holder.js "+A+".\nLearn more at http://holderjs.com\n(c) 2012-2015 Ivan Malopinsky - http://imsky.co\n",C={addTheme:function(a,b){return null!=a&&null!=b&&(D.settings.themes[a]=b),delete D.vars.cache.themeKeys,this},addImage:function(a,b){var c=z.querySelectorAll(b);if(c.length)for(var d=0,e=c.length;e>d;d++){var f=l("img");m(f,{"data-src":a}),c[d].appendChild(f)}return this},run:function(a){a=a||{};var f={};D.vars.preempted=!0;var g=p(D.settings,a);f.renderer=g.renderer?g.renderer:D.setup.renderer,-1===D.setup.renderers.join(",").indexOf(f.renderer)&&(f.renderer=D.setup.supportsSVG?"svg":D.setup.supportsCanvas?"canvas":"html");var h=t(g.images),i=t(g.bgnodes),j=t(g.stylenodes),k=t(g.objects);f.stylesheets=[],f.svgXMLStylesheet=!0,f.noFontFallback=g.noFontFallback?g.noFontFallback:!1;for(var m=0;m1){c.nodeValue="";for(var v=0;v