"use strict";$(document).ready(function(){console.log("ready!");var i,a=new CSInterface,t="000";$("#app-progress").hide(),themeManager.init();var e=new Vue({el:"#app",data:{numCopies:1,angleVariation:0,scaleVariation:100,hueVariation:0,satVariation:0,lightVariation:0},methods:{isValidNumber:function(i){return!isNaN(parseInt(i))&&isFinite(i)}},computed:{isDisabled:function(){return this.numCopies<1||500<this.numCopies||this.angleVariation<0||360<this.angleVariation||this.scaleVariation<1||100<this.scaleVariation||this.hueVariation<-180||180<this.hueVariation||this.satVariation<-100||100<this.satVariation||this.lightVariation<-100||100<this.lightVariation||(!1===this.isValidNumber(this.numCopies)||!1===this.isValidNumber(this.angleVariation)||!1===this.isValidNumber(this.scaleVariation)||!1===this.isValidNumber(this.hueVariation)||!1===this.isValidNumber(this.satVariation)||!1===this.isValidNumber(this.lightVariation)||void 0)}}});function n(){$(".circle-loader").toggleClass("load-complete"),$(".checkmark").toggle(),$("#app-progress").delay(1e3).fadeOut(300),$("#app").delay(1300).fadeIn(300),setTimeout(function(){$(".circle-loader").toggleClass("load-complete"),$(".checkmark").toggle()},1600)}$("#addLayer").click(function(){a.evalScript("addMaskLayer()",function(i){i=i.split(","),t=i[1],$("#layerName").val(i[0])})}),$("#removeLayer").click(function(){t="000",$("#layerName").val("")}),$("#btnExecute").click(function(){i=document.getElementById("mergeGroup").checked,$("#app").hide(),$("#app-progress").show(),!0===i?a.evalScript('main(" '+e.numCopies+' ", " '+e.angleVariation+' ", " '+e.scaleVariation+' ", " '+e.hueVariation+' ", " '+e.satVariation+' ", " '+e.lightVariation+' ", " '+t+' ", true)',function(i){"finished"===i&&n()}):a.evalScript('main(" '+e.numCopies+' ", " '+e.angleVariation+' ", " '+e.scaleVariation+' ", " '+e.hueVariation+' ", " '+e.satVariation+' ", " '+e.lightVariation+' ", " '+t+' ", false)',function(i){"finished"===i&&n()})})});