function updateThemeWithAppSkinInfo(a){var b=a.panelBackgroundColor.color;document.body.bgColor=toHex(b);var d=(new CSInterface).hostEnvironment.appName;"PHXS"==d&&addRule("ppstyle","button, select, input[type=button], input[type=submit]","border-radius:3px;");if("PHXS"==d||"PPRO"==d||"PRLD"==d){var d="background-image: -webkit-linear-gradient(top, "+toHex(b,40)+" , "+toHex(b,10)+");",c="background-image: -webkit-linear-gradient(top, "+toHex(b,15)+" , "+toHex(b,5)+");",e,g,h,f,k;127<b.red?(e="#000000;",
g="color:"+toHex(b,-70)+";",h="border-color: "+toHex(b,-90)+";",f=toHex(b,54)+";",k="background-image: -webkit-linear-gradient(top, "+toHex(b,-40)+" , "+toHex(b,-50)+");"):(e="#ffffff;",g="color:"+toHex(b,100)+";",h="border-color: "+toHex(b,-45)+";",f=toHex(b,-20)+";",k="background-image: -webkit-linear-gradient(top, "+toHex(b,-20)+" , "+toHex(b,-30)+");");addRule("ppstyle",".default","font-size:"+a.baseFontSize+"px; color:"+e+"; background-color:"+toHex(b)+";");addRule("ppstyle","button, select, input[type=text], input[type=button], input[type=submit]",
h);addRule("ppstyle","button.default, select, input[type=button], input[type=submit]",d);addRule("ppstyle","button, select, input[type=button], input[type=submit]","-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);");addRule("ppstyle","button:enabled:active, input[type=button]:enabled:active, input[type=submit]:enabled:active",k);addRule("ppstyle","button:enabled:active, input[type=button]:enabled:active, input[type=submit]:enabled:active","-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);");
addRule("ppstyle","[disabled]",c);addRule("ppstyle","[disabled]",g);addRule("ppstyle","input[type=text]","padding:1px 3px;");addRule("ppstyle","input[type=text]","background-color: "+f+";");addRule("ppstyle","input[type=text]:focus","background-color: #ffffff;");addRule("ppstyle","input[type=text]:focus","color: #000000;");addRule("ppstyle","select","color: "+e+";");addRule("ppstyle","select","background:"+f+";");addRule("ppstyle",".modal-content","color: "+e+";");addRule("ppstyle",".modal-content",
"background-color: "+f+";");addRule("ppstyle",".settings-modal-content","color: "+e+";");addRule("ppstyle",".settings-modal-content","background-color: "+f+";")}else addRule("ppstyle",".default","font-size:"+a.baseFontSize+"px; color:"+reverseColor(b)+"; background-color:"+toHex(b,20)),addRule("ppstyle","button","border-color: "+toHex(panelBgColor,-50))}
function addRule(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 reverseColor(a,b){return toHex({red:Math.abs(255-a.red),green:Math.abs(255-a.green),blue:Math.abs(255-a.blue)},b)}function toHex(a,b){function d(a,b){var c=!isNaN(b)?a+b:a;0>c?c=0:255<c&&(c=255);c=c.toString(16);return 1==c.length?"0"+c:c}var c="";if(a)with(a)c=d(red,b)+d(green,b)+d(blue,b);return"#"+c}
function onAppThemeColorChanged(a){a=JSON.parse(window.__adobe_cep__.getHostEnvironment()).appSkinInfo;updateThemeWithAppSkinInfo(a)}function loadJSX(){var a=new CSInterface,b=a.getSystemPath(SystemPath.EXTENSION)+"/jsx/";a.evalScript('$._ext.evalFiles("'+b+'")')}function evalScript(a,b){(new CSInterface).evalScript(a,b)}
function onClickButton(a){"FLPR"==a?evalScript('fl.createDocument(); fl.getDocumentDOM().addNewText({left:100, top:100, right:300, bottom:300} , "Hello Flash!"); '):evalScript("$._ext_"+a+".run()")}function onLoaded(){var a=new CSInterface;"FLPR"!=a.hostEnvironment.appName&&loadJSX();updateThemeWithAppSkinInfo(a.hostEnvironment.appSkinInfo);a.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,onAppThemeColorChanged)}
$(document).ready(function(){var a=null===localStorage.getItem("sliderValueRapidMask")||void 0===localStorage.getItem("sliderValueRapidMask")?1:localStorage.getItem("sliderValueRapidMask"),b=null===localStorage.getItem("tkLANGDEFAULT")||void 0===localStorage.getItem("tkLANGDEFAULT")?"EN":localStorage.getItem("tkLANGDEFAULT"),d=null===localStorage.getItem("autoApplyCheckValue")||void 0===localStorage.getItem("autoApplyCheckValue")?!1:localStorage.getItem("autoApplyCheckValue"),d="true"===d||!0===d?
!0:!1,c=null===localStorage.getItem("selectionIndicatorSetting")||void 0===localStorage.getItem("selectionIndicatorSetting")?"fixed":localStorage.getItem("selectionIndicatorSetting");$("#Slider").val(a);$("#checkboxAUTOAPPLY").prop("checked",d);changeAutoApply();TKResetLang(b);updateSlider(a);$("#selectSELECTIONINDICATOR").val(c);("fixed"===c||"animated"===c)&&startActiveSelectionIndicator(c)});
function updateSlider(a){var b=document.getElementsByClassName("default"),d,c,e;for(d=0;d<b.length;d++)c=document.getElementsByClassName("default")[d].style.border,c=c.split(" "),6==c.length?(c.pop(),c.push(a+")"),c=c.join(" "),document.getElementsByClassName("default")[d].style.border=c):5==c.length&&(e=c[c.length-1],e=e.slice(0,-1),c.pop(),c.push(e+","),c.push(a+")"),e=c[2],e=e.split(""),e.splice(3,0,"a"),e=e.join(""),c[2]=e,c=c.join(" "),document.getElementsByClassName("default")[d].style.border=
c);document.getElementById("tktips").style.border="1px solid rgba(255, 204, 51, "+a+")";localStorage.setItem("sliderValueRapidMask",a)}function createAdjustLayer(a){evalScript("$._ext_"+this.options[this.selectedIndex].value+".run()");document.getElementById("selectADJUST").selected="selected"}$("#English, #Italian, #German, #Spanish, #Chinese").click(function(){var a=this.value;localStorage.setItem("tkLANGDEFAULT",a);TKResetLang(a)});
function TKResetLang(a){"object"===typeof lang_IT&&"object"===typeof lang_DE&&"object"===typeof lang_ES&&"object"===typeof lang_EN?$(".default").css("display","block"):$(".default").css("display","none");tkLANG="IT"==a?lang_IT:"DE"==a?lang_DE:"ES"==a?lang_ES:lang_EN;TKTT("tipCLEAR");$("#spanAUTOAPPLY").html(tkLANG.spanAUTOAPPLY);$("#spanLIGHTS").html(tkLANG.spanLIGHTS);$("#spanDARKS").html(tkLANG.spanDARKS);$("#spanMIDTONES").html(tkLANG.spanMIDTONES);$("#buttonCOMPOSITE").html(tkLANG.buttonCOMPOSITE);
$("#buttonREDL").html(tkLANG.buttonREDL);$("#buttonGREENA").html(tkLANG.buttonGREENA);$("#buttonBLUEB").html(tkLANG.buttonBLUEB);$("#buttonSATURATION").html(tkLANG.buttonSATURATION);$("#buttonPAINT").html(tkLANG.buttonPAINT);$("#buttonCR").html(tkLANG.buttonCR);$("#buttonCRREDS").html(tkLANG.buttonCRREDS);$("#buttonCRGREENS").html(tkLANG.buttonCRGREENS);$("#buttonCRBLUES").html(tkLANG.buttonCRBLUES);$("#buttonCRCYANS").html(tkLANG.buttonCRCYANS);$("#buttonCRMAGENTAS").html(tkLANG.buttonCRMAGENTAS);
$("#buttonCRYELLOWS").html(tkLANG.buttonCRYELLOWS);$("#buttonPICK").html(tkLANG.buttonPICK);$("#buttonAUTO").html(tkLANG.buttonAUTO);$("#buttonFOCUS").html(tkLANG.buttonFOCUS);$("#buttonEXPAND").html(tkLANG.buttonEXPAND);$("#buttonIMAGE").html(tkLANG.buttonIMAGE);$("#buttonINVERT").html(tkLANG.buttonINVERT);$("#buttonBLUR").html(tkLANG.buttonBLUR);$("#buttonCONTRACT").html(tkLANG.buttonCONTRACT);$("#buttonMASK").html(tkLANG.buttonMASK);$("#CURVES").html(tkLANG.CURVES);$("#LEVELS").html(tkLANG.LEVELS);
$("#BRIGHTNESSCONTRAST").html(tkLANG.BRIGHTNESSCONTRAST);$("#HUESAT").html(tkLANG.HUESAT);$("#BLACKANDWHITE").html(tkLANG.BLACKANDWHITE);$("#PHOTOFILTER").html(tkLANG.PHOTOFILTER);$("#SELECTIVECOLOR").html(tkLANG.SELECTIVECOLOR);$("#VIBRANCE").html(tkLANG.VIBRANCE);$("#COLORBALANCE").html(tkLANG.COLORBALANCE);$("#CHANNELMIXER").html(tkLANG.CHANNELMIXER);$("#EXPOSURE").html(tkLANG.EXPOSURE);$("#ADJUSTINVERT").html(tkLANG.ADJUSTINVERT);$("#SOLIDCOLOR").html(tkLANG.SOLIDCOLOR);$("#buttonADJUST").html(tkLANG.buttonADJUST);
$("#buttonSELECT").html(tkLANG.buttonSELECT);$("#buttonCHANNEL").html(tkLANG.buttonCHANNEL);$("#buttonPIXELS").html(tkLANG.buttonPIXELS);$("#buttonAPPLY").html(tkLANG.buttonAPPLY);$("#LMspanLIGHTS").html(tkLANG.LMspanLIGHTS);$("#LMspanDARKS").html(tkLANG.LMspanDARKS);$("#LMspanMIDTONES").html(tkLANG.LMspanMIDTONES);$("#LMspanCOLOR").html(tkLANG.LMspanCOLOR);$("#LMbuttonCOMPOSITE").html(tkLANG.LMbuttonCOMPOSITE);$("#LMbuttonREDL").html(tkLANG.LMbuttonREDL);$("#LMbuttonGREENA").html(tkLANG.LMbuttonGREENA);
$("#LMbuttonBLUEB").html(tkLANG.LMbuttonBLUEB);$("#LMbuttonSATURATION").html(tkLANG.LMbuttonSATURATION);$("#LMbuttonPAINT").html(tkLANG.LMbuttonPAINT);$("#LMbuttonCR").html(tkLANG.LMbuttonCR);$("#LMbuttonCRREDS").html(tkLANG.LMbuttonCRREDS);$("#LMbuttonCRGREENS").html(tkLANG.LMbuttonCRGREENS);$("#LMbuttonCRBLUES").html(tkLANG.LMbuttonCRBLUES);$("#LMbuttonCRCYANS").html(tkLANG.LMbuttonCRCYANS);$("#LMbuttonCRMAGENTAS").html(tkLANG.LMbuttonCRMAGENTAS);$("#LMbuttonCRYELLOWS").html(tkLANG.LMbuttonCRYELLOWS);
$("#LMbuttonPICK").html(tkLANG.LMbuttonPICK);$("#LMbuttonAUTO").html(tkLANG.LMbuttonAUTO);$("#LMbuttonFOCUS").html(tkLANG.LMbuttonFOCUS);$("#LMbuttonEXPAND").html(tkLANG.LMbuttonEXPAND);$("#LMbuttonIMAGE").html(tkLANG.LMbuttonIMAGE);$("#LMbuttonINVERT").html(tkLANG.LMbuttonINVERT);$("#LMbuttonBLUR").html(tkLANG.LMbuttonBLUR);$("#LMbuttonCONTRACT").html(tkLANG.LMbuttonCONTRACT);$("#LMbuttonMASK").html(tkLANG.LMbuttonMASK);$("#LMbuttonADJUST").html(tkLANG.LMbuttonADJUST);$("#LMbuttonSELECT").html(tkLANG.LMbuttonSELECT);
$("#LMbuttonCHANNEL").html(tkLANG.LMbuttonCHANNEL);$("#LMbuttonPIXELS").html(tkLANG.LMbuttonPIXELS);$("#LMbuttonAPPLY").html(tkLANG.LMbuttonAPPLY);$("#spanCOLORSETTING").html(tkLANG.spanCOLORSETTING);$("#spanSELECTIONINDICATOR").html(tkLANG.spanSELECTIONINDICATOR);$("#optionFIXED").html(tkLANG.optionFIXED);$("#optionANIMATED").html(tkLANG.optionANIMATED);$("#optionOFF").html(tkLANG.optionOFF)}
function TKTT(a){"tipCLEAR"===a?$("#tktips").css({"font-size":"18px","font-family":"Verdana","text-align":"center","vertical-align":"middle","line-height":"29px",color:"#ffffff"}):$("#tktips").css({"font-size":"11px","font-family":"Arial","text-align":"left","vertical-align":"baseline","line-height":"10px",color:"#000000"});$("#tktips").html(tkLANG[a])}
function modalForAdjustButton(){var a=document.getElementById("adjustModal");a.style.display="block";window.onclick=function(b){b.target==a&&(a.style.display="none")}}function createAdjustLayer(a){$("#adjustModal").hide();evalScript("$._ext_"+a+".run()")}
function changeAutoApply(){var a=$("#checkboxAUTOAPPLY").is(":checked");localStorage.setItem("autoApplyCheckValue",a);!0===a?($("#RapidMaskButtons").css("display","none"),$("#LayerMaskButtons").css("display","block"),$("#spanAUTOAPPLY").css("color","#ffffff")):($("#RapidMaskButtons").css("display","block"),$("#LayerMaskButtons").css("display","none"),$("#spanAUTOAPPLY").css("color","#000000"))}
function openSettings(){var a=document.getElementById("settingsModal"),b=document.getElementById("spanCLOSESETTINGS");a.style.display="block";b.onclick=function(){a.style.display="none"};window.onclick=function(b){b.target==a&&(a.style.display="none")}}$("#selectSELECTIONINDICATOR").change(function(){var a=$("#selectSELECTIONINDICATOR").val();localStorage.setItem("selectionIndicatorSetting",a)});
function startActiveSelectionIndicator(a){var b;"fixed"===a&&(b="activeSelectionImg");"animated"===a&&(b="activeSelectionGIF");(new PSSelectEvent).start(function(){document.getElementById(b).style.visibility="visible"},function(){document.getElementById(b).style.visibility="hidden"})};
