var themeManager=function(){function g(a,b){function d(a,b){var c=!isNaN(b)?a+b:a;0>c?c=0:255<c&&(c=255);c=Math.floor(c);c=c.toString(16);return 1===c.length?"0"+c:c}var f="";a&&(f=d(a.red,b)+d(a.green,b)+d(a.blue,b));return f}function b(a,b,d){if(a=document.getElementById(a))a=a.sheet,a.addRule?a.addRule(b,d):a.insertRule&&a.insertRule(b+" { "+d+" }",a.cssRules.length)}function k(a){var e=a.panelBackgroundColor.color,d=g(e),f=g(e,20),h="F0F0F0";122<e.red&&(h="000000");e=g(e,-100);b("hostStyle","body",
"background-color:#"+d);b("hostStyle","body","font-size:"+a.baseFontSize+"px;");b("hostStyle","body","font-family:"+a.baseFontFamily);b("hostStyle","body","color:#"+h);b("hostStyle","button","background-color:#"+f);b("hostStyle","button:hover","background-color:#"+d);b("hostStyle","button:active","background-color:#"+f);b("hostStyle","button","border-color: #"+e);b("hostStyle",".hostFont","font-size:"+a.baseFontSize+"px;");b("hostStyle",".hostFont","font-family:"+a.baseFontFamily);b("hostStyle",".hostFont",
"color:#"+h);b("hostStyle",".hostBgd","background-color:#"+d);b("hostStyle",".hostElt","background-color:#"+f);b("hostStyle",".hostElt","border-color: #"+e)}function l(a){a=JSON.parse(window.__adobe_cep__.getHostEnvironment()).appSkinInfo;k(a)}return{init:function(){var a=new CSInterface;k(a.hostEnvironment.appSkinInfo);a.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,l)}}}();
