function ap_default(a,b){return"undefined"!=typeof a?a:b}function apLoadingDot(){i=0,setInterval(function(){jQuery(".ap-loading-dot").html(Array(++i%4+1).join("."))},300)}function apAjaxData(a){return a+="&action=ap_ajax"}function apQueryStringToJSON(a){var b=a.split("&"),c={};return b.forEach(function(a){a=a.split("="),c[a[0]]=encodeURIComponent(a[1]||"")}),JSON.parse(JSON.stringify(c))}function apGetValueFromStr(a,b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+b+"=([^&#]*)"),d=c.exec(a);return null==d?!1:decodeURIComponent(d[1].replace(/\+/g," "))}function apCenterBox(a){var a=jQuery(a),b=a.parent();b.css({position:"relative"}),a.css("left",(b.width()-a.width())/2),a.css("top",(b.height()-a.height())/2)}function apIsJsonString(a){try{JSON.parse(a)}catch(b){return!1}return!0}function apLoadTemplate(a,b,c){c=c||!1,0===jQuery("#template-"+a).length?jQuery.get(b,function(b){jQuery('").appendTo("body"),jQuery(a).trigger(a,b),c&&c(b)}):c&&c(jQuery("#template-"+a).html())}function apParseAjaxResponse(a){if(apIsJsonString(a))return{};if(a=jQuery(a),"undefined"==typeof a.filter("#ap-response"))return console.log("Not a valid AnsPress ajax response."),{};var b=a.filter("#ap-response").html();return"undefined"!=typeof b&&b.length>2?JSON.parse(b):{}}function apCamelize(a){return a.replace(/(?:^\w|[A-Z]|\b\w)/g,function(a,b){return 0==b?a.toLowerCase():a.toUpperCase()}).replace(/\s+/g,"")}function apMergeObj(a,b){for(var c in b)try{b[c].constructor==Object?a[c]=MergeRecursive(a[c],b[c]):a[c]=b[c]}catch(d){a[c]=b[c]}return a}function apLaodAvatar(){jQuery("img[src*='ANSPRESS_AVATAR_SRC']").each(function(a,b){var c=jQuery(b).attr("src").replace("http://ANSPRESS_AVATAR_SRC::","");jQuery(b).initial({fontSize:30,fontWeight:600,name:c})})}!function(a){a.fn.aptip=function(b){function c(b){"undefined"!=typeof a(b).attr("title")&&(a(b).data("aptiptitle",a(b).attr("title")),a(b).removeAttr("title"))}function d(b){var c=a(window).height(),d=a(b).offset(),e=a(b).outerHeight(),g=a(b).outerWidth(),h=a(b).data("tipposition")||!1,i=f.position.split(/ +/);h&&(i=h.split(/ +/));var j="top";switch(i[0]){case"bottom":j=d.top+e+10;break;case"center":j=d.top+e/2-tip.outerHeight()/2;break;default:j=d.top-tip.outerHeight()-10}var k="right";switch(i[1]){case"left":k=d.left-g;break;case"center":k=d.left+g/2-tip.outerWidth()/2;break;default:k=d.left+g}tip.addClass("x-"+i[0]+" y-"+i[1]);var l=a(document).scrollTop();0>k&&(k=5),l>j&&(j=d.top+g);var m=a(window).scrollTop()+c-tip.outerHeight();j>m&&(j-=tip.outerHeight()),tip.css({overflow:"absolute",top:j,left:k}),tip.find(".arrow").css({top:j,left:k})}function e(b){var e=a(b),h=e.data("userid")||e.data("catid")||!1,i=(e.data("action")||!1,e.data("tipquery")||!1);if(h&&!i){var j=e.data("catid")||!1;j=j?"&type=cat":"",e.data("tipquery","action=ap_ajax&ap_ajax_action=hover_card&id="+h+j),i=e.data("tipquery")}if(i!==!1&&(f.ajax=i),c(b),""==f.title)var k=e.data("aptiptitle");else var k=f.title;if(0!=k.length){if(tip=a('
'+k+"
"),""!=f.ajax&&!g.ajax_running)if(0==a(e.attr("data-ajax")).length&&0==a("#"+h+"_card").length)g.ajax_running=!0,a.ajax({type:"POST",url:ajaxurl,data:f.ajax+"&ap_ajax_nonce="+ap_nonce,success:function(c){var f=a(c),c={},h=f.filter("#ap-response").html();"undefined"!=typeof h&&h.length>2&&(c=JSON.parse(h)),c.apTemplate&&"object"==typeof c.apTemplate&&apLoadTemplate(c.apTemplate.name,c.apTemplate.template,function(f){var h=a(Ta.render(f,c.apData));console.log(h);var i=parseInt(a(".aptip-data").length);g.data_id="aptipd-"+(i+1),h.addClass("aptip-data "+g.data_id),e.attr("data-ajax","."+g.data_id),a("body").append(h.clone()),tip.find(".ap-tooltip-in").html(h.show()),d(b)}),g.ajax_running=!1}});else{var l=a("#"+h+"_card").html();tip.find(".ap-tooltip-in").html(a(l).show())}if(""!=f.before){var m=f.before;m(tip,b,function(){d(b)})}tip.appendTo("body"),d(b)}}var f=a.extend({theme:"",delay:"",title:"",before:"",ajax:"",position:"top center"},b);this.ajax_running=!1;var g=this;return this.each(function(){$this=a(this);var b=this;$this.mouseenter(function(){""!=f.delay?delay=setTimeout(function(){e(b)},f.delay):e(this)}).mouseleave(function(){"undefined"!=typeof tip&&tip.remove(),"undefined"!=typeof delay&&clearTimeout(delay)})}),this},a.fn.autogrow=function(b){function c(c){var d,e=a(this),f=e.innerHeight(),g=this.scrollHeight,h=e.data("autogrow-start-height")||0;if(g>f)this.scrollTop=0,b.animate?e.stop().animate({height:g},b.speed):e.innerHeight(g);else if(!c||8==c.which||46==c.which||c.ctrlKey&&88==c.which)if(f>h){d=e.clone().addClass(b.cloneClass).css({position:"absolute",zIndex:-10,height:""}).val(e.val()),e.after(d);do g=d[0].scrollHeight-1,d.innerHeight(g);while(g===d[0].scrollHeight);g++,d.remove(),e.focus(),h>g&&(g=h),f>g&&b.animate?e.stop().animate({height:g},b.speed):e.innerHeight(g)}else e.innerHeight(h)}var d=a(this).css({overflow:"hidden",resize:"none"}),e=d.selector,f={context:a(document),animate:!0,speed:50,fixMinHeight:!0,cloneClass:"autogrowclone",onInitialize:!1};return b=a.isPlainObject(b)?b:{context:b?b:a(document)},b=a.extend({},f,b),d.each(function(d,e){var f,g;e=a(e),e.is(":visible")||parseInt(e.css("height"),10)>0?f=parseInt(e.css("height"),10)||e.innerHeight():(g=e.clone().addClass(b.cloneClass).val(e.val()).css({position:"absolute",visibility:"hidden",display:"block"}),a("body").append(g),f=g.innerHeight(),g.remove()),b.fixMinHeight&&e.data("autogrow-start-height",f),e.css("height",f),b.onInitialize&&e.length&&c.call(e[0])}),b.context.on("keyup paste",e,c),d},a.fn.center=function(){return this.css({position:"fixed"}),a(window).height()>a(this).outerHeight()?this.css("top",Math.max(0,(a(window).height()-a(this).outerHeight())/2)+"px"):(this.css("top",50),this.css("height",a(window).height()-80)),this.css("left",Math.max(0,(a(window).width()-a(this).outerWidth())/2+a(window).scrollLeft())+"px"),this},a.fn.apAjaxQueryString=function(){var b=a(this).data("query").split("::"),c={};c.action="ap_ajax",c.ap_ajax_action=b[0],c.__nonce=b[1],c.args={};var d=0;return a.each(b,function(a){0!=a&&1!=a&&(c.args[d]=b[a],d++)}),c},a.fn.apGetSelector=function(){var b=a(this);return b.attr("id")?"#"+b.attr("id"):b.attr("secondary_id")?"[secondary_id="+b.attr("secondary_id")+"]":(a(b).attr("secondary_id",(new Date).getTime()),"[secondary_id="+b.attr("secondary_id")+"]")}}(jQuery);var Tangular={};Tangular.helpers={},Tangular.version="v1.5.2",Tangular.cache={},Tangular.debug=!1,Tangular.settings={delimiters:["{{","}}"]},Tangular.register=function(a,b){return Tangular.helpers[a]=b,Tangular},Tangular.compile=function(a){a||(a="");for(var b,c=-1,d=[],e=-1,f=0,g=a.length,h=0,i=Tangular.settings.delimiters[0].length;g>c++;){var j=a.substring(c,c+i);if(-1===e)if(j!==Tangular.settings.delimiters[0]);else{if(-1!==e){h++;continue}b=a.substring(f,c),d.push(b?'unescape("'+escape(b)+'")':'""'),e=c+i}else if(j===Tangular.settings.delimiters[1]){if(h>0){h--;continue}d.push(a.substring(e,c).trim()),f=c+i,e=-1;continue}}b=a.substring(f,g),d.push(b?'unescape("'+escape(b)+'")':'""'),g=d.length;for(var k="$output+=",l='var $s=this,$output="",$t,$v;',m=[],n=!1,o=0,p=0;g>p;p++)if(p%2!==0){var q=d[p],r=!1,c=q.lastIndexOf("|"),s=null,t=q.substring(0,3);"if "===t&&(q="if( "+q.substring(3)+"){",r=!0),"foreach "===q.substring(0,8)&&(s=q.split(" "),"var"===s[1]&&s.splice(1,1),m.push(s[1]),r=!0,n=!0,o++);var u=q.substring(0,5);if("endif"===u||"fi"===q?(q="}",r=!0):"else"===u?(q="} else {",r=!0):"else if"===q.substring(0,7)?(q="}else if( "+q.substring(8)+"){",r=!0):("end"===t||"endfor"===q.substring(0,6))&&(q=m.length?"}})()}":"}}",m.pop(),r=!0,o--,0===o&&(n=!1)),q=r?Tangular.append(q,m,n,"$s").trim():Tangular.helper(q,m,n,"$s"),r){if(s){var v=Tangular.append(s[3],m,n,"$s");q="if ("+v+"&&"+v+".length){(function(){for(var i=0,length="+v+".length;ig;g++){var i,j=a[g].trim().replace("()","");e=j.indexOf("("),-1===e?(i=j,j=".call($s,$t)"):(i=j.substring(0,e),j=".call($s,$t,"+j.substring(e+1)),j='$t=helpers("'+i+'")'+j,f+=j+";"}return'"";$t='+d+";"+f+"$output+=$t"},Tangular.append=function(a,b,c,d){return void 0===b&&(b=[]),a?a.replace(/[\_\$a-zá-žÁ-ŽA-Z0-9\s\.]+/g,function(a,c,e){var f=e.substring(c-1,c),g=!1,h=a.trim();switch(('"'===f||"'"===f||"."===f)&&(g=!0),a.trim()){case"else":case"end":case"endfor":case"endif":case"fi":case"foreach":case"if":case"else if":return a;case"$index":if(!g)return a}if(""===h)return"";if(g)return a;g=!1;for(var i=0,j=b.length;j>i;i++){var k=b[i].length;if(h.substring(0,k)===b[i]){if(h.length!==k){var f=h.substring(k,k+1);if("."!==f&&"+"!==f)continue}g=!0;break}}if("$"===h)return"Tangular.$wrap($)";if("$."===h.substring(0,2)&&(d="$",h=h.substring(2)),g)return h;f=h.substring(0,1);var l=f.charCodeAt(0);return l>47&&58>l?h:"Tangular.$wrap("+(d||"$s")+',"'+h+'")'}):"Tangular.$wrap("+(d||"$s")+")"},Tangular.$wrap=function(a,b,c){if(!a)return a;if(!b)return a;var d=Tangular.cache[b];if(null===d)return a[b];if(d||(d=b.split("."),Tangular.cache[b]=1===d.length?null:d),1===d.length)return a[b];for(var e=a,f=0,g=d.length;g>f;f++){var h=d[f];if(e=e[h],!e)return f+1===g?e:c}return e},Tangular.render=function(a,b,c){return(void 0===b||null===b)&&(b={}),"string"==typeof a&&(a=Tangular.compile(a)),a(b,c)},Tangular.register("encode",function(a){return(void 0===a||null===a)&&(a=""),a.toString().replace(/[<>&"]/g,function(a){switch(a){case"&":return"&";case"<":return"<";case">":return">";case'"':return"""}return a})}),Tangular.register("raw",function(a){return(void 0===a||null===a)&&(a=""),a}),"undefined"!=typeof global?global.Tangular=global.Ta=Tangular:"undefined"!=typeof window&&(window.Tangular||(window.Tangular=Tangular),window.Ta=Tangular),Ta.register("objLength",function(a){return Object.keys(a).length}),function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):(window.WatchJS=a(),window.watch=window.WatchJS.watch,window.unwatch=window.WatchJS.unwatch,window.callWatchers=window.WatchJS.callWatchers)}(function(){function a(){v=null;for(var a=0;a0)for(var e=0;e0)&&p(a[b],c,void 0!==d?d-1:d),A(a,b,c,d),e&&(void 0===d||d>0)&&K(a,b,c,d))},s=function(a,b){if(!(a instanceof String)&&(a instanceof Object||i(a)))if(i(a)){for(var c=["__watchall__"],d=0;dg;g++)if("splice"!==d)p(f,b[g],void 0===e?e:e-1);else for(h=0;hk;k++)p(a[c],a.watchers[c][k],void 0===e?e:e-1)}a.watchers&&(a.watchers.__wjs_suspend__||a.watchers["__wjs_suspend__"+c])?G(a,c):b.noMore||g===d||(f?I(a,c,"set",d,g):B(a,c,"set",d,g),b.noMore=!1)},b.useDirtyCheck?o(a,c,f):m(a,c,d,f)}},B=function(a,b,c,d,e){if(void 0!==b){var f,g=a.watchers[b];(f=a.watchers.__watchall__)&&(g=g?g.concat(f):f),f=g?g.length:0;for(var h=0;f>h;h++)g[h].call(a,b,c,d,e)}else for(b in a)a.hasOwnProperty(b)&&B(a,b,c,d,e)},C="pop push reverse shift sort slice unshift splice".split(" "),D=function(a,b,c,d){n(a,c,function(){var e,f,g,h=0;if("splice"===c){for(g=arguments[0],f=a.slice(g,g+arguments[1]),e=[],h=2;h