"use strict";Number.isNaN=Number.isNaN||function(value){return typeof value==="number"&&value!==value;} var frslib=frslib||{};frslib.global=this;frslib.isDef=function(val){return val!==undefined;};frslib.exportPath_=function(name,opt_object,opt_objectToExportTo){var parts=name.split('.');var cur=opt_objectToExportTo||frslib.global;if(!(parts[0]in cur)&&cur.execScript){cur.execScript('var '+parts[0]);} for(var part;parts.length&&(part=parts.shift());){if(!parts.length&&frslib.isDef(opt_object)){cur[part]=opt_object;}else if(cur[part]){cur=cur[part];}else{cur=cur[part]={};}}};frslib.provide=function(name){return frslib.exportPath_(name);};frslib.provide('frslib.identificators');frslib.identificators._lastGeneratedId=null;frslib.identificators.generateUnique=function(){var number=new Date().getTime()-new Date('2016-01-01').getTime();if(frslib.identificators._lastGeneratedId!=null&&frslib.identificators._lastGeneratedId>=number){number=frslib.identificators._lastGeneratedId+1;} var newId=number.toString(32);frslib.identificators._lastGeneratedId=number;return newId;};frslib.provide('frslib.htmlforms');(function($){frslib.htmlforms.writeValueToCode=function($selector){$selector.find('input').each(function(){var val=$(this).val();$(this).attr('value',val);if($(this).attr('type')=='checkbox'){var checked=$(this).is(':checked');if(checked){$(this).attr('checked','checked');} else{$(this).prop('checked',false);$(this).removeAttr('checked');}}});}})(jQuery);frslib.provide('frslib.callbacks');frslib.clone=function(object){return JSON.parse(JSON.stringify(object));};frslib.stringToId=function(string){return string.replace(/[^A-Za-z0-9]/g,'');};(function($){frslib.callbacks.functions=new Array();frslib.callbacks.addCallback=function(eventName,callback){frslib.provide('frslib.callbacks.functions.'+eventName);if(!(frslib.callbacks.functions[eventName]instanceof Array)){frslib.callbacks.functions[eventName]=new Array();} frslib.callbacks.functions[eventName].push(callback);} frslib.callbacks.doCallback=function(eventName){if(!(eventName in frslib.callbacks.functions)){return false;} var newArguments=new Array();for(var argumentsKey in arguments){if(!Number.isNaN(argumentsKey)&&argumentsKey>0){newArguments[argumentsKey-1]=arguments[argumentsKey];}} var output={};for(var key in frslib.callbacks.functions[eventName]){output[key]=frslib.callbacks.functions[eventName][key].apply(this,newArguments);} return output;} frslib.callbacks.callAllFunctionsFromArray=function(arrayOfFunctions){var newArguments=Array();for(var argumentsKey in arguments){if(!Number.isNaN(argumentsKey)&&argumentsKey>0){newArguments[argumentsKey-1]=arguments[argumentsKey];}} var oneFunction;if(arrayOfFunctions){for(oneFunction in arrayOfFunctions){if(arrayOfFunctions[oneFunction]){arrayOfFunctions[oneFunction].apply(this,newArguments);}}}}})(jQuery);frslib.provide('frslib.colors');frslib.provide('frslib.colors.convert');frslib.provide('frslib.colors.type');(function($){frslib.colors.convert.hexToRgb=function(hex){var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}:null;};frslib.colors.convert.hslToRgb=function(h,s,l){var r,g,b,m,c,x if(!isFinite(h))h=0 if(!isFinite(s))s=0 if(!isFinite(l))l=0 h/=60 if(h<0)h=6-(-h%6) h%=6 s=Math.max(0,Math.min(1,s/100)) l=Math.max(0,Math.min(1,l/100)) c=(1-Math.abs((2*l)-1))*s x=c*(1-Math.abs((h%2)-1)) if(h<1){r=c g=x b=0}else if(h<2){r=x g=c b=0}else if(h<3){r=0 g=c b=x}else if(h<4){r=0 g=x b=c}else if(h<5){r=x g=0 b=c}else{r=c g=0 b=x} m=l-c/2 r=Math.round((r+m)*255) g=Math.round((g+m)*255) b=Math.round((b+m)*255) return{r:r,g:g,b:b}};frslib.colors.convert.rgbToHsl=function(r,g,b){r/=255,g/=255,b/=255;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2;if(max==min){h=s=0;}else{var d=max-min;s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g=140/255)?'black':'white';}})(jQuery);frslib.provide('frslib.attr');frslib.attr.helper=function(){this.attributes={};};frslib.attr.helper.prototype={setParam:function(name,value){this.attributes[name]=new Array();if(value instanceof Array){this.attributes[name]=this.attributes[name].concat(value);}else{this.attributes[name].push(value);}},addParam:function(name,value){if(this.isParamSet(name)){if(value instanceof Array){this.attributes[name]=this.attributes[name].concat(value);}else{this.attributes[name].push(value);}}else{this.setParam(name,value);}},addParamEsc:function(name,value){value=this._escAttr(value);return this.addParam(name,value);},_escAttr:function(s,preserveCR){preserveCR=preserveCR?' ':'\n';return(''+s).replace(/&/g,'&').replace(/'/g,''').replace(/"/g,'"').replace(//g,'>').replace(/\r\n/g,preserveCR).replace(/[\r\n]/g,preserveCR);;},isParamSet:function(name){return this.attributes.hasOwnProperty(name)&&this.attributes[name]!=null;},removeParam:function(){this.attributes[name]=null;},getParamValueAsArray:function(name){return this.attributes[name];},getParamValueAsString:function(name,separator){if(separator==undefined){separator=' ';} return this.attributes[name].join(separator);},getParamString:function(name,separator){return name+'="'+this.getParamValueAsString(name,separator)+'"';},getAttrString:function(separator){if(separator==undefined){separator=' ';} var name;var toReturn=new Array();for(name in this.attributes){toReturn.push(this.getParamString(name,separator));} return toReturn.join(' ');},};frslib.attr.createHelper=function(){return new frslib.attr.helper();} frslib.attr.escAttr=function(s,preserveCR){preserveCR=preserveCR?' ':'\n';return(''+s).replace(/&/g,'&').replace(/'/g,''').replace(/"/g,'"').replace(//g,'>').replace(/\r\n/g,preserveCR).replace(/[\r\n]/g,preserveCR);;};frslib.provide('frslib.ajax');(function($){frslib.ajax.frameworkRequest=function(owner,specification,data,callback,completeCallback){var processData=true;if(specification!=null&&specification.processData!=undefined){processData=specification.processData;} $.ajax({type:'POST',url:ajaxurl,data:{'action':'ff_ajax','owner':owner,'specification':specification,'data':data,},processData:processData,success:function(response){if(response.indexOf('ff_ajax_dispatcher_response')!=-1){var responseJSON=response.replace('ff_ajax_dispatcher_response','');var responseArray=JSON.parse(responseJSON);callback(responseArray);}else{callback(response);}},error:function(response,status,error){console.log(response,status,error);},complete:completeCallback});};frslib.ajax.frameworkAdminScreenRequest=function(data,callback){var specification={adminScreenName:$('.ff-view-identification').find('.admin-screen-name').html(),adminViewName:$('.ff-view-identification').find('.admin-view-name').html(),};frslib.ajax.frameworkRequest('ffAdminScreenManager',specification,data,function(response){callback(response);});};frslib.ajax.adminScreenRequest=function(specification,data,callback){var adminScreenName=$('.ff-view-identification').find('.admin-screen-name').html();var adminViewName=$('.ff-view-identification').find('.admin-view-name').html();var data={'adminScreenName':adminScreenName,'adminViewName':adminViewName,'specification':specification,'action':'ff_ajax_admin','data':data} $.post(ajaxurl,data,callback);}})(jQuery);frslib.provide('frslib.selectors');(function($){frslib.selectors.findButNotInside=function($element,selector){var origElement=$element;return origElement.find(selector).filter(function(){var nearestMatch=$(this).parent().closest(selector);return nearestMatch.length==0||origElement.find(nearestMatch).length==0;});};})(jQuery);frslib.provide('frslib.array');(function($){frslib.array.next=function(items,oneItem){var position=items.indexOf(oneItem);var newPosition=0;if(position+1=0){newPosition=position-1;} return items[newPosition];};frslib.array.prevKey=function(items,oneItem){var keys=Object.keys(items);return frslib.array.prev(keys,oneItem);};frslib.array.prevKeyValue=function(items,oneItem){var prevKey=frslib.array.prevKey(items,oneItem);return items[prevKey];};frslib.array.objectToArray=function(item){return Object.keys(item).map(function(key){return item[key]}).join('');};frslib.array.array_replace_recursive=function(arr){var i=0 var p='' var argl=arguments.length var retObj if(argl<2){throw new Error('There should be at least 2 arguments passed to array_replace_recursive()')} if(Object.prototype.toString.call(arr)==='[object Array]'){retObj=[] for(p in arr){retObj.push(arr[p])}}else{retObj={} for(p in arr){retObj[p]=arr[p]}} for(i=1;i>6,0x80|cc&0x3f);}).replace(/[\u0800-\uffff]/g,function(c){var cc=c.charCodeAt(0);return String.fromCharCode(0xe0|cc>>12,0x80|cc>>6&0x3F,0x80|cc&0x3f);});return strUtf;},decode:function(strUtf){var strUni=strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(c){var cc=((c.charCodeAt(0)&0x0f)<<12)|((c.charCodeAt(1)&0x3f)<<6)|(c.charCodeAt(2)&0x3f);return String.fromCharCode(cc);}).replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(c){var cc=(c.charCodeAt(0)&0x1f)<<6|c.charCodeAt(1)&0x3f;return String.fromCharCode(cc);});return strUni;}};while(i<256){var c=String.fromCharCode(i);a256+=c;r256[i]=i;r64[i]=b64.indexOf(c);++i;} function code(s,discard,alpha,beta,w1,w2){s=String(s);var buffer=0,i=0,length=s.length,result='',bitsInBuffer=0;while(i=w2){bitsInBuffer-=w2;var tmp=buffer>>bitsInBuffer;result+=beta.charAt(tmp);buffer^=tmp<0)result+=beta.charAt(buffer<<(w2-bitsInBuffer));return result;} var Plugin=$.base64=function(dir,input,encode){return input?Plugin[dir](input,encode):dir?null:this;};Plugin.btoa=Plugin.encode=function(plain,utf8encode){plain=Plugin.raw===false||Plugin.utf8encode||utf8encode?UTF8.encode(plain):plain;plain=code(plain,false,r256,b64,8,6);return plain+'===='.slice((plain.length%4)||4);};Plugin.atob=Plugin.decode=function(coded,utf8decode){coded=coded.replace(/[^A-Za-z0-9\+\/\=]/g,"");coded=String(coded).split('=');var i=coded.length;do{--i;coded[i]=code(coded[i],true,r64,a256,6,8);}while(i>0);coded=coded.join('');return Plugin.raw===false||Plugin.utf8decode||utf8decode?UTF8.decode(coded):coded;};}(jQuery));jQuery.fn.serializeObject=function(){var json={};jQuery.map(jQuery(this).serializeArray(),function(n,i){var _=n.name.indexOf('[');if(_>-1){var o=json;var _name=n.name.replace(/\]/gi,'').split('[');for(var i=0,len=_name.length;i