// source --> https://www.travpart.com/Chinese/wp-includes/js/wp-util.min.js?ver=5.4 /*! This file is auto-generated */ window.wp=window.wp||{},function(i){var e="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(t){var n,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return(n=n||_.template(i("#tmpl-"+t).html(),s))(e)}}),wp.ajax={settings:e.ajax||{},post:function(e,t){return wp.ajax.send({data:_.isObject(e)?e:_.extend(t||{},{action:e})})},send:function(e,n){var t,s;return _.isObject(e)?n=e:(n=n||{}).data=_.extend(n.data||{},{action:e}),n=_.defaults(n||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(t=(s=i.Deferred(function(t){n.success&&t.done(n.success),n.error&&t.fail(n.error),delete n.success,delete n.error,t.jqXHR=i.ajax(n).done(function(e){"1"!==e&&1!==e||(e={success:!0}),_.isObject(e)&&!_.isUndefined(e.success)?t[e.success?"resolveWith":"rejectWith"](this,[e.data]):t.rejectWith(this,[e])}).fail(function(){t.rejectWith(this,arguments)})})).promise()).abort=function(){return s.jqXHR.abort(),this},t}}}(jQuery); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-modal.min.js?ver=5.4 jQuery(document).ready(function(){jQuery(document).on("click",".um-popup-overlay",function(){remove_Modal()}),jQuery(document).on("click",'.um-modal-overlay, a[data-action="um_remove_modal"]',function(){um_remove_modal()}),jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"], .um-modal a',function(e){return e.preventDefault(),!1}),jQuery(document).on("click",".um-modal .um-single-file-preview a.cancel",function(e){e.preventDefault();var a=jQuery(this).parents(".um-modal-body"),t=jQuery(this).parents(".um-modal-body").find(".um-single-fileinfo a").attr("href");return a.find(".um-single-file-preview").hide(),a.find(".ajax-upload-dragdrop").show(),a.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:t}}),!1}),jQuery(document).on("click",".um-modal .um-single-image-preview a.cancel",function(e){e.preventDefault();var a=jQuery(this).parents(".um-modal-body"),t=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview img").attr("src");return jQuery("img.cropper-hidden").cropper("destroy"),a.find(".um-single-image-preview img").attr("src",""),a.find(".um-single-image-preview").hide(),a.find(".ajax-upload-dragdrop").show(),a.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:t}}),!1}),jQuery(document).on("click",".um-finish-upload.file:not(.disabled)",function(){var e=jQuery(this).attr("data-key"),a=jQuery(this).parents(".um-modal-body").find(".um-single-file-preview").html();um_remove_modal(),jQuery(".um-single-file-preview[data-key="+e+"]").fadeIn().html(a);var t=jQuery(".um-field[data-key="+e+"]").find(".um-single-fileinfo a").data("file");jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find(".um-btn-auto-width").html(jQuery(this).attr("data-change")),jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find('input[type="hidden"]').val(t)}),jQuery(document).on("click",".um-finish-upload.image:not(.disabled)",function(){var e=jQuery(this),a=jQuery(this).attr("data-key"),t=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview"),i=t.find("img").attr("src"),r=t.attr("data-coord"),u=t.find("img").data("file"),m=0;jQuery(this).parents("#um_upload_single").data("user_id")&&(m=jQuery(this).parents("#um_upload_single").data("user_id")),r?(jQuery(this).html(jQuery(this).attr("data-processing")).addClass("disabled"),jQuery.ajax({url:wp.ajax.settings.url,type:"POST",dataType:"json",data:{action:"um_resize_image",src:i,coord:r,user_id:m,key:a},success:function(t){1==t.success&&(d=new Date,"profile_photo"==a&&jQuery(".um-profile-photo-img img").attr("src",t.data.image.source_url+"?"+d.getTime()),"cover_photo"==a&&(jQuery(".um-cover-e").empty().html(''),jQuery(".um").hasClass("um-editing")&&jQuery(".um-cover-overlay").show()),jQuery(".um-single-image-preview[data-key="+a+"]").fadeIn().find("img").attr("src",t.data.image.source_url+"?"+d.getTime()),um_remove_modal(),jQuery(".um-single-image-preview[data-key="+a+"]").parents(".um-field").find(".um-btn-auto-width").html(e.attr("data-change")),jQuery(".um-single-image-preview[data-key="+a+"]").parents(".um-field").find('input[type="hidden"]').val(t.data.image.filename))}})):(d=new Date,jQuery(".um-single-image-preview[data-key="+a+"]").fadeIn().find("img").attr("src",i+"?"+d.getTime()),um_remove_modal(),jQuery(".um-single-image-preview[data-key="+a+"]").parents(".um-field").find(".um-btn-auto-width").html(e.attr("data-change")),jQuery(".um-single-image-preview[data-key="+a+"]").parents(".um-field").find("input[type=hidden]").val(u))}),jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"]',function(e){var a=jQuery(this).attr("data-modal"),t="normal";if(jQuery(this).data("modal-size"))var t=jQuery(this).data("modal-size");jQuery(this).data("modal-copy")?(jQuery("#"+a).html(jQuery(this).parents(".um-field").find(".um-modal-hidden-content").html()),jQuery(this).parents(".um-profile-photo").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-profile-photo").attr("data-user_id")),jQuery(this).parents(".um-cover").attr("data-ratio")&&jQuery("#"+a).attr("data-ratio",jQuery(this).parents(".um-cover").attr("data-ratio")),jQuery(this).parents(".um-cover").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-cover").attr("data-user_id")),jQuery("input[type=hidden][name='user_id']").length>0&&jQuery("#"+a).attr("data-user_id",jQuery("input[type=hidden][name='user_id']").val()),um_new_modal(a,t)):um_new_modal(a,t)})}); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-jquery-form.min.js?ver=5.4 !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;a').val(d.extraData[m].value).appendTo(w)[0]):l.push(e('').val(d.extraData[m]).appendTo(w)[0]));d.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(e){var h=document.createElement("form").submit;h.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(M&&M.location.href!=d.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==d.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(d.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":d.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(d.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||d.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,d)}catch(e){i="parsererror",x.error=r=e||i}}catch(e){a("error caught: ",e),i="error",x.error=r=e||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(d.success&&d.success.call(d.context,E,"success",x),S.resolve(x.responseText,"success",x),m&&e.event.trigger("ajaxSuccess",[x,d])):i&&(void 0===r&&(r=x.statusText),d.error&&d.error.call(d.context,x,i,r),S.reject(x,"error",r),m&&e.event.trigger("ajaxError",[x,d,r])),m&&e.event.trigger("ajaxComplete",[x,d]),m&&!--e.active&&e.event.trigger("ajaxStop"),d.complete&&d.complete.call(d.context,x,i),F=!0,d.timeout&&clearTimeout(j),setTimeout(function(){d.iframeTarget?v.attr("src",d.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,d,m,p,v,g,x,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(e){}v.attr("src",d.iframeSrc),x.error=r,d.error&&d.error.call(d.context,x,r,t),m&&e.event.trigger("ajaxError",[x,d,r]),d.complete&&d.complete.call(d.context,x,r)}},m=d.global,m&&0===e.active++&&e.event.trigger("ajaxStart"),m&&e.event.trigger("ajaxSend",[x,d]),d.beforeSend&&d.beforeSend.call(d.context,x,d)===!1)return d.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(d.extraData=d.extraData||{},d.extraData[b]=y.value,"image"==y.type&&(d.extraData[b+".x"]=w.clk_x,d.extraData[b+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(d.extraData=d.extraData||{},d.extraData[L]=A),d.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var d={};if(this.trigger("form-pre-serialize",[this,t,d]),d.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var m=t.traditional;void 0===m&&(m=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,m)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,d]),d.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,m);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;i0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;E https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-fileupload.min.js?ver=5.4 !function(e){void 0==e.fn.ajaxForm;var r={};r.fileapi=void 0!==e("").get(0).files,r.formdata=void 0!==window.FormData,e.fn.uploadFile=function(t){function o(){c.afterUploadAll&&!v&&(v=!0,function e(){0!=f.sCounter&&f.sCounter+f.fCounter==f.tCounter?(c.afterUploadAll(f),v=!1):window.setTimeout(e,100)}())}function a(r,t,o){o.on("dragenter",function(r){r.stopPropagation(),r.preventDefault(),e(this).css("border","2px dashed #ddd")}),o.on("dragover",function(e){e.stopPropagation(),e.preventDefault()}),o.on("drop",function(o){e(this).css("border","2px dashed #ddd"),o.preventDefault(),r.errorLog.html("");var a=o.originalEvent.dataTransfer.files;return!t.multiple&&a.length>1?void(t.showError&&e("
"+t.multiDragErrorStr+"
").appendTo(r.errorLog)):void(0!=t.onSelect(a)&&i(t,r,a))}),e(document).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}),e(document).on("dragover",function(e){e.stopPropagation(),e.preventDefault(),o.css("border","2px dashed #ddd")}),e(document).on("drop",function(e){e.stopPropagation(),e.preventDefault(),o.css("border","2px dashed #ddd")})}function s(r){var t=[];t="string"==jQuery.type(r)?r.split("&"):e.param(r).split("&");var o,a,s=t.length,i=[];for(o=0;or.maxFileSize)r.showError&&e("
"+r.sizeErrorStr+"
").appendTo(t.errorLog);else if(r.maxFileCount!=-1&&t.selectedFiles>=r.maxFileCount)r.showError&&e("
"+r.maxFileCountErrorStr+"
").appendTo(t.errorLog);else{t.selectedFiles++;var i=r,l=new FormData,d=r.fileName.replace("[]","");l.append(d,o[a]);var c=r.formData;if(c)for(var h=s(c),f=0;f");g.appendTo("body");var b=[];b.push(o[a].name),p(g,i,m,b,t),t.fileCounter++}else r.showError&&e("
"+r.extErrorStr+"
").appendTo(t.errorLog)}function n(e,r,t){var o=r.allowedTypes.toLowerCase().split(","),a=t.split(".").pop().toLowerCase();return!("*"!=r.allowedTypes&&jQuery.inArray(a,o)<0)}function l(r,t){if(r.showFileCounter){var o=e(".upload-filename").length;t.fileCounter=o+1,e(".upload-filename").each(function(t,a){var s=e(this).html().split(r.fileCounterStyle),i=(parseInt(s[0])-1,o+r.fileCounterStyle+s[1]);e(this).html(i),o--})}}function d(t,o,a,s){var c="ajax-upload-id-"+(new Date).getTime(),h=e("
"),f="";a.multiple&&(a.fileName.indexOf("[]")!=a.fileName.length-2&&(a.fileName+="[]"),f="");var m=e(f).appendTo(h);m.change(function(){t.errorLog.html("");var c=(a.allowedTypes.toLowerCase().split(","),[]);if(this.files){for(b=0;b"+a.extErrorStr+"").appendTo(t.errorLog));if(m.push({name:f,size:"NA"}),0==a.onSelect(m))return}if(l(a,t),s.unbind("click"),h.hide(),d(t,o,a,s),h.addClass(o),r.fileapi&&r.formdata){h.removeClass(o);var v=this.files;i(a,t,v)}else{for(var g="",b=0;b":c[b]+"
",t.fileCounter++;if(a.maxFileCount!=-1&&t.selectedFiles+c.length>a.maxFileCount)return void(a.showError&&e("
"+a.maxFileCountErrorStr+"
").appendTo(t.errorLog));t.selectedFiles+=c.length;var w=new u(t,a);w.filename.html(g),p(h,a,w,c,t)}}),h.css({margin:0,padding:0});var v=e(s).width()+10;10==v&&(v=120);var g=s.height()+10;10==g&&(g=35),s.css({position:"relative",overflow:"hidden",cursor:"default"}),m.css({position:"absolute",cursor:"pointer",top:"0px",width:"100%",height:"34px",left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"}),h.appendTo(s)}function u(r,t){return this.statusbar=e("
"),this.filename=e("
").appendTo(this.statusbar),this.progressDiv=e("
").appendTo(this.statusbar).hide(),this.progressbar=e("
").appendTo(this.progressDiv),this.abort=e("
"+t.abortStr+"
").appendTo(this.statusbar).hide(),this.cancel=e("
"+t.cancelStr+"
").appendTo(this.statusbar).hide(),this.done=e("
"+t.doneStr+"
").appendTo(this.statusbar).hide(),this.del=e("
"+t.deletelStr+"
").appendTo(this.statusbar).hide(),r.errorLog.after(this.statusbar),this}function p(e,t,a,i,n){var d={cache:!1,contentType:!1,processData:!1,forceSync:!1,data:t.formData,formData:t.fileData,dataType:t.returnType,beforeSubmit:function(r,l,d){if(0!=t.onSubmit.call(this,i)){var u=t.dynamicFormData();if(u){var p=s(u);if(p)for(var c=0;c"+t.uploadErrorStr+"
"),a.cancel.show(),e.remove(),a.cancel.click(function(){a.statusbar.remove()}),!1},beforeSend:function(e,o){a.progressDiv.show(),a.cancel.hide(),a.done.hide(),t.showAbort&&(a.abort.show(),a.abort.click(function(){e.abort(),n.selectedFiles-=i.length})),r.formdata?a.progressbar.width("1%"):a.progressbar.width("5%")},uploadProgress:function(e,r,o,s){s>98&&(s=98);var i=s+"%";s>1&&a.progressbar.width(i),t.showProgress&&(a.progressbar.html(i),a.progressbar.css("text-align","center"))},success:function(r,o,s){n.responses.push(r),a.progressbar.width("100%"),t.showProgress&&(a.progressbar.html("100%"),a.progressbar.css("text-align","center")),a.abort.hide(),t.onSuccess.call(this,i,r,s),t.showStatusAfterSuccess?(t.showDone?(a.done.show(),a.done.click(function(){a.statusbar.hide("slow"),a.statusbar.remove()})):a.done.hide(),t.showDelete?(a.del.show(),a.del.click(function(){a.statusbar.hide().remove(),t.deleteCallback&&t.deleteCallback.call(this,r,a),n.selectedFiles-=i.length,l(t,n)})):a.del.hide()):(a.statusbar.hide("slow"),a.statusbar.remove()),e.remove(),n.sCounter+=i.length},error:function(r,o,s){a.abort.hide(),"abort"==r.statusText?(a.statusbar.hide("slow").remove(),l(t,n)):(t.onError.call(this,i,o,s),t.showStatusAfterError?(a.progressDiv.hide(),a.statusbar.append("ERROR: "+s+"")):(a.statusbar.hide(),a.statusbar.remove()),n.selectedFiles-=i.length),e.remove(),n.fCounter+=i.length}};t.autoSubmit?e.ajaxSubmit(d):(t.showCancel&&(a.cancel.show(),a.cancel.click(function(){e.remove(),a.statusbar.remove(),n.selectedFiles-=i.length,l(t,n)})),e.ajaxForm(d))}var c=e.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:!0,dragDrop:!0,autoSubmit:!0,showCancel:!0,showAbort:!0,showDone:!0,showDelete:!1,showError:!0,showStatusAfterSuccess:!0,showStatusAfterError:!0,showFileCounter:!0,fileCounterStyle:"). ",showProgress:!1,onSelect:function(e){return!0},onSubmit:function(e,r){},onSuccess:function(e,r,t){},onError:function(e,r,t){},deleteCallback:!1,afterUploadAll:!1,uploadButtonClass:"upload",dragDropStr:"",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"",sizeErrorStr:"",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:""},t);this.fileCounter=1,this.selectedFiles=0,this.fCounter=0,this.sCounter=0,this.tCounter=0;var h="upload-"+(new Date).getTime();this.formGroup=h,this.hide(),this.errorLog=e("
"),this.after(this.errorLog),this.responses=[],r.formdata||(c.dragDrop=!1),r.formdata||(c.multiple=!1);var f=this,m=e("
"+e(this).html()+"
");e(m).addClass(c.uploadButtonClass),function r(){if(e.fn.ajaxForm){if(c.dragDrop){var t=e('
');e(f).before(t),e(t).append(m),e(t).prepend(e(c.dragDropStr)),a(f,c,t)}else e(f).before(m);d(f,h,c,m)}else window.setTimeout(r,10)}(),this.startUpload=function(){e("."+this.formGroup).each(function(r,t){e(this).is("form")&&e(this).submit()})},this.stopUpload=function(){e(".upload-red").each(function(r,t){e(this).hasClass(f.formGroup)&&e(this).click()})},this.getResponses=function(){return this.responses};var v=!1;return this}}(jQuery); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/pickadate/picker.js?ver=5.4 /*! * pickadate.js v3.5.6, 2015/04/20 * By Amsul, http://amsul.ca * Hosted on http://amsul.github.io/pickadate.js * Licensed under MIT */ (function ( factory ) { // AMD. if ( typeof define == 'function' && define.amd ) define( 'picker', ['jquery'], factory ) // Node.js/browserify. else if ( typeof exports == 'object' ) module.exports = factory( require('jquery') ) // Browser globals. else this.Picker = factory( jQuery ) }(function( $ ) { var $window = $( window ) var $document = $( document ) var $html = $( document.documentElement ) var supportsTransitions = document.documentElement.style.transition != null /** * The picker constructor that creates a blank picker. */ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) { // If there’s no element, return the picker constructor. if ( !ELEMENT ) return PickerConstructor var IS_DEFAULT_THEME = false, // The state of the picker. STATE = { id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) ) }, // Merge the defaults and options passed. SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {}, // Merge the default classes with the settings classes. CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ), // The element node wrapper into a jQuery object. $ELEMENT = $( ELEMENT ), // Pseudo picker constructor. PickerInstance = function() { return this.start() }, // The picker prototype. P = PickerInstance.prototype = { constructor: PickerInstance, $node: $ELEMENT, /** * Initialize everything */ start: function() { // If it’s already started, do nothing. if ( STATE && STATE.start ) return P // Update the picker states. STATE.methods = {} STATE.start = true STATE.open = false STATE.type = ELEMENT.type // Confirm focus state, convert into text input to remove UA stylings, // and set as readonly to prevent keyboard popup. ELEMENT.autofocus = ELEMENT == getActiveElement() ELEMENT.readOnly = !SETTINGS.editable ELEMENT.id = ELEMENT.id || STATE.id if ( ELEMENT.type != 'text' ) { ELEMENT.type = 'text' } // Create a new picker component with the settings. P.component = new COMPONENT(P, SETTINGS) // Create the picker root and then prepare it. P.$root = $( '
' ) prepareElementRoot() // Create the picker holder and then prepare it. P.$holder = $( createWrappedComponent() ).appendTo( P.$root ) prepareElementHolder() // If there’s a format for the hidden input element, create the element. if ( SETTINGS.formatSubmit ) { prepareElementHidden() } // Prepare the input element. prepareElement() // Insert the hidden input as specified in the settings. if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden ) else $ELEMENT.after( P._hidden ) // Insert the root as specified in the settings. if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root ) else $ELEMENT.after( P.$root ) // Bind the default component and settings events. P.on({ start: P.component.onStart, render: P.component.onRender, stop: P.component.onStop, open: P.component.onOpen, close: P.component.onClose, set: P.component.onSet }).on({ start: SETTINGS.onStart, render: SETTINGS.onRender, stop: SETTINGS.onStop, open: SETTINGS.onOpen, close: SETTINGS.onClose, set: SETTINGS.onSet }) // Once we’re all set, check the theme in use. IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] ) // If the element has autofocus, open the picker. if ( ELEMENT.autofocus ) { P.open() } // Trigger queued the “start” and “render” events. return P.trigger( 'start' ).trigger( 'render' ) }, //start /** * Render a new picker */ render: function( entireComponent ) { // Insert a new component holder in the root or box. if ( entireComponent ) { P.$holder = $( createWrappedComponent() ) prepareElementHolder() P.$root.html( P.$holder ) } else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) ) // Trigger the queued “render” events. return P.trigger( 'render' ) }, //render /** * Destroy everything */ stop: function() { // If it’s already stopped, do nothing. if ( !STATE.start ) return P // Then close the picker. P.close() // Remove the hidden field. if ( P._hidden ) { P._hidden.parentNode.removeChild( P._hidden ) } // Remove the root. P.$root.remove() // Remove the input class, remove the stored data, and unbind // the events (after a tick for IE - see `P.close`). $ELEMENT.removeClass( CLASSES.input ).removeData( NAME ) setTimeout( function() { $ELEMENT.off( '.' + STATE.id ) }, 0) // Restore the element state ELEMENT.type = STATE.type ELEMENT.readOnly = false // Trigger the queued “stop” events. P.trigger( 'stop' ) // Reset the picker states. STATE.methods = {} STATE.start = false return P }, //stop /** * Open up the picker */ open: function( dontGiveFocus ) { // If it’s already open, do nothing. if ( STATE.open ) return P // Add the “active” class. $ELEMENT.addClass( CLASSES.active ) aria( ELEMENT, 'expanded', true ) // * A Firefox bug, when `html` has `overflow:hidden`, results in // killing transitions :(. So add the “opened” state on the next tick. // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 setTimeout( function() { // Add the “opened” class to the picker root. P.$root.addClass( CLASSES.opened ) aria( P.$root[0], 'hidden', false ) }, 0 ) // If we have to give focus, bind the element and doc events. if ( dontGiveFocus !== false ) { // Set it as open. STATE.open = true // Prevent the page from scrolling. if ( IS_DEFAULT_THEME ) { $html. css( 'overflow', 'hidden' ). css( 'padding-right', '+=' + getScrollbarWidth() ) } // Pass focus to the root element’s jQuery object. focusPickerOnceOpened() // Bind the document events. $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) { var target = event.target // If the target of the event is not the element, close the picker picker. // * Don’t worry about clicks or focusins on the root because those don’t bubble up. // Also, for Firefox, a click on an `option` element bubbles up directly // to the doc. So make sure the target wasn't the doc. // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling, // which causes the picker to unexpectedly close when right-clicking it. So make // sure the event wasn’t a right-click. if ( target != ELEMENT && target != document && event.which != 3 ) { // If the target was the holder that covers the screen, // keep the element focused to maintain tabindex. P.close( target === P.$holder[0] ) } }).on( 'keydown.' + STATE.id, function( event ) { var // Get the keycode. keycode = event.keyCode, // Translate that to a selection change. keycodeToMove = P.component.key[ keycode ], // Grab the target. target = event.target // On escape, close the picker and give focus. if ( keycode == 27 ) { P.close( true ) } // Check if there is a key movement or “enter” keypress on the element. else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) { // Prevent the default action to stop page movement. event.preventDefault() // Trigger the key movement action. if ( keycodeToMove ) { PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] ) } // On “enter”, if the highlighted item isn’t disabled, set the value and close. else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) { P.set( 'select', P.component.item.highlight ) if ( SETTINGS.closeOnSelect ) { P.close( true ) } } } // If the target is within the root and “enter” is pressed, // prevent the default action and trigger a click on the target instead. else if ( $.contains( P.$root[0], target ) && keycode == 13 ) { event.preventDefault() target.click() } }) } // Trigger the queued “open” events. return P.trigger( 'open' ) }, //open /** * Close the picker */ close: function( giveFocus ) { // If we need to give focus, do it before changing states. if ( giveFocus ) { if ( SETTINGS.editable ) { ELEMENT.focus() } else { // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :| // The focus is triggered *after* the close has completed - causing it // to open again. So unbind and rebind the event at the next tick. P.$holder.off( 'focus.toOpen' ).focus() setTimeout( function() { P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent ) }, 0 ) } } // Remove the “active” class. $ELEMENT.removeClass( CLASSES.active ) aria( ELEMENT, 'expanded', false ) // * A Firefox bug, when `html` has `overflow:hidden`, results in // killing transitions :(. So remove the “opened” state on the next tick. // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 setTimeout( function() { // Remove the “opened” and “focused” class from the picker root. P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused ) aria( P.$root[0], 'hidden', true ) }, 0 ) // If it’s already closed, do nothing more. if ( !STATE.open ) return P // Set it as closed. STATE.open = false // Allow the page to scroll. if ( IS_DEFAULT_THEME ) { $html. css( 'overflow', '' ). css( 'padding-right', '-=' + getScrollbarWidth() ) } // Unbind the document events. $document.off( '.' + STATE.id ) // Trigger the queued “close” events. return P.trigger( 'close' ) }, //close /** * Clear the values */ clear: function( options ) { return P.set( 'clear', null, options ) }, //clear /** * Set something */ set: function( thing, value, options ) { var thingItem, thingValue, thingIsObject = $.isPlainObject( thing ), thingObject = thingIsObject ? thing : {} // Make sure we have usable options. options = thingIsObject && $.isPlainObject( value ) ? value : options || {} if ( thing ) { // If the thing isn’t an object, make it one. if ( !thingIsObject ) { thingObject[ thing ] = value } // Go through the things of items to set. for ( thingItem in thingObject ) { // Grab the value of the thing. thingValue = thingObject[ thingItem ] // First, if the item exists and there’s a value, set it. if ( thingItem in P.component.item ) { if ( thingValue === undefined ) thingValue = null P.component.set( thingItem, thingValue, options ) } // Then, check to update the element value and broadcast a change. if ( thingItem == 'select' || thingItem == 'clear' ) { $ELEMENT. val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ). trigger( 'change' ) } } // Render a new picker. P.render() } // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`. return options.muted ? P : P.trigger( 'set', thingObject ) }, //set /** * Get something */ get: function( thing, format ) { // Make sure there’s something to get. thing = thing || 'value' // If a picker state exists, return that. if ( STATE[ thing ] != null ) { return STATE[ thing ] } // Return the submission value, if that. if ( thing == 'valueSubmit' ) { if ( P._hidden ) { return P._hidden.value } thing = 'value' } // Return the value, if that. if ( thing == 'value' ) { return ELEMENT.value } // Check if a component item exists, return that. if ( thing in P.component.item ) { if ( typeof format == 'string' ) { var thingValue = P.component.get( thing ) return thingValue ? PickerConstructor._.trigger( P.component.formats.toString, P.component, [ format, thingValue ] ) : '' } return P.component.get( thing ) } }, //get /** * Bind events on the things. */ on: function( thing, method, internal ) { var thingName, thingMethod, thingIsObject = $.isPlainObject( thing ), thingObject = thingIsObject ? thing : {} if ( thing ) { // If the thing isn’t an object, make it one. if ( !thingIsObject ) { thingObject[ thing ] = method } // Go through the things to bind to. for ( thingName in thingObject ) { // Grab the method of the thing. thingMethod = thingObject[ thingName ] // If it was an internal binding, prefix it. if ( internal ) { thingName = '_' + thingName } // Make sure the thing methods collection exists. STATE.methods[ thingName ] = STATE.methods[ thingName ] || [] // Add the method to the relative method collection. STATE.methods[ thingName ].push( thingMethod ) } } return P }, //on /** * Unbind events on the things. */ off: function() { var i, thingName, names = arguments; for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) { thingName = names[i] if ( thingName in STATE.methods ) { delete STATE.methods[thingName] } } return P }, /** * Fire off method events. */ trigger: function( name, data ) { var _trigger = function( name ) { var methodList = STATE.methods[ name ] if ( methodList ) { methodList.map( function( method ) { PickerConstructor._.trigger( method, P, [ data ] ) }) } } _trigger( '_' + name ) _trigger( name ) return P } //trigger } //PickerInstance.prototype /** * Wrap the picker holder components together. */ function createWrappedComponent() { // Create a picker wrapper holder return PickerConstructor._.node( 'div', // Create a picker wrapper node PickerConstructor._.node( 'div', // Create a picker frame PickerConstructor._.node( 'div', // Create a picker box node PickerConstructor._.node( 'div', // Create the components nodes. P.component.nodes( STATE.open ), // The picker box class CLASSES.box ), // Picker wrap class CLASSES.wrap ), // Picker frame class CLASSES.frame ), // Picker holder class CLASSES.holder, 'tabindex="-1"' ) //endreturn } //createWrappedComponent /** * Prepare the input element with all bindings. */ function prepareElement() { $ELEMENT. // Store the picker data by component name. data(NAME, P). // Add the “input” class name. addClass(CLASSES.input). // If there’s a `data-value`, update the value of the element. val( $ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value ) // Only bind keydown events if the element isn’t editable. if ( !SETTINGS.editable ) { $ELEMENT. // On focus/click, open the picker. on( 'focus.' + STATE.id + ' click.' + STATE.id, function(event) { event.preventDefault() P.open() }). // Handle keyboard event based on the picker being opened or not. on( 'keydown.' + STATE.id, handleKeydownEvent ) } // Update the aria attributes. aria(ELEMENT, { haspopup: true, expanded: false, readonly: false, owns: ELEMENT.id + '_root' }) } /** * Prepare the root picker element with all bindings. */ function prepareElementRoot() { aria( P.$root[0], 'hidden', true ) } /** * Prepare the holder picker element with all bindings. */ function prepareElementHolder() { P.$holder. on({ // For iOS8. keydown: handleKeydownEvent, 'focus.toOpen': handleFocusToOpenEvent, blur: function() { // Remove the “target” class. $ELEMENT.removeClass( CLASSES.target ) }, // When something within the holder is focused, stop from bubbling // to the doc and remove the “focused” state from the root. focusin: function( event ) { P.$root.removeClass( CLASSES.focused ) event.stopPropagation() }, // When something within the holder is clicked, stop it // from bubbling to the doc. 'mousedown click': function( event ) { var target = event.target // Make sure the target isn’t the root holder so it can bubble up. if ( target != P.$holder[0] ) { event.stopPropagation() // * For mousedown events, cancel the default action in order to // prevent cases where focus is shifted onto external elements // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120). // Also, for Firefox, don’t prevent action on the `option` element. if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) { event.preventDefault() // Re-focus onto the holder so that users can click away // from elements focused within the picker. P.$holder[0].focus() } } } }). // If there’s a click on an actionable element, carry out the actions. on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() { var $target = $( this ), targetData = $target.data(), targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ), // * For IE, non-focusable elements can be active elements as well // (http://stackoverflow.com/a/2684561). activeElement = getActiveElement() activeElement = activeElement && ( activeElement.type || activeElement.href ) // If it’s disabled or nothing inside is actively focused, re-focus the element. if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) { P.$holder[0].focus() } // If something is superficially changed, update the `highlight` based on the `nav`. if ( !targetDisabled && targetData.nav ) { P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } ) } // If something is picked, set `select` then close with focus. else if ( !targetDisabled && 'pick' in targetData ) { P.set( 'select', targetData.pick ) if ( SETTINGS.closeOnSelect ) { P.close( true ) } } // If a “clear” button is pressed, empty the values and close with focus. else if ( targetData.clear ) { P.clear() if ( SETTINGS.closeOnClear ) { P.close( true ) } } else if ( targetData.close ) { P.close( true ) } }) //P.$holder } /** * Prepare the hidden input element along with all bindings. */ function prepareElementHidden() { var name if ( SETTINGS.hiddenName === true ) { name = ELEMENT.name ELEMENT.name = '' } else { name = [ typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit' ] name = name[0] + ELEMENT.name + name[1] } P._hidden = $( '' )[0] $ELEMENT. // If the value changes, update the hidden input with the correct format. on('change.' + STATE.id, function() { P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '' }) } // Wait for transitions to end before focusing the holder. Otherwise, while // using the `container` option, the view jumps to the container. function focusPickerOnceOpened() { if (IS_DEFAULT_THEME && supportsTransitions) { P.$holder.find('.' + CLASSES.frame).one('transitionend', function() { P.$holder[0].focus() }) } else { P.$holder[0].focus() } } function handleFocusToOpenEvent(event) { // Stop the event from propagating to the doc. event.stopPropagation() // Add the “target” class. $ELEMENT.addClass( CLASSES.target ) // Add the “focused” class to the root. P.$root.addClass( CLASSES.focused ) // And then finally open the picker. P.open() } // For iOS8. function handleKeydownEvent( event ) { var keycode = event.keyCode, // Check if one of the delete keys was pressed. isKeycodeDelete = /^(8|46)$/.test(keycode) // For some reason IE clears the input value on “escape”. if ( keycode == 27 ) { P.close( true ) return false } // Check if `space` or `delete` was pressed or the picker is closed with a key movement. if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) { // Prevent it from moving the page and bubbling to doc. event.preventDefault() event.stopPropagation() // If `delete` was pressed, clear the values and close the picker. // Otherwise open the picker. if ( isKeycodeDelete ) { P.clear().close() } else { P.open() } } } // Return a new picker instance. return new PickerInstance() } //PickerConstructor /** * The default classes and prefix to use for the HTML classes. */ PickerConstructor.klasses = function( prefix ) { prefix = prefix || 'picker' return { picker: prefix, opened: prefix + '--opened', focused: prefix + '--focused', input: prefix + '__input', active: prefix + '__input--active', target: prefix + '__input--target', holder: prefix + '__holder', frame: prefix + '__frame', wrap: prefix + '__wrap', box: prefix + '__box' } } //PickerConstructor.klasses /** * Check if the default theme is being used. */ function isUsingDefaultTheme( element ) { var theme, prop = 'position' // For IE. if ( element.currentStyle ) { theme = element.currentStyle[prop] } // For normal browsers. else if ( window.getComputedStyle ) { theme = getComputedStyle( element )[prop] } return theme == 'fixed' } /** * Get the width of the browser’s scrollbar. * Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js */ function getScrollbarWidth() { if ( $html.height() <= $window.height() ) { return 0 } var $outer = $( '
' ). appendTo( 'body' ) // Get the width without scrollbars. var widthWithoutScroll = $outer[0].offsetWidth // Force adding scrollbars. $outer.css( 'overflow', 'scroll' ) // Add the inner div. var $inner = $( '
' ).appendTo( $outer ) // Get the width with scrollbars. var widthWithScroll = $inner[0].offsetWidth // Remove the divs. $outer.remove() // Return the difference between the widths. return widthWithoutScroll - widthWithScroll } /** * PickerConstructor helper methods. */ PickerConstructor._ = { /** * Create a group of nodes. Expects: * ` { min: {Integer}, max: {Integer}, i: {Integer}, node: {String}, item: {Function} } * ` */ group: function( groupObject ) { var // Scope for the looped object loopObjectScope, // Create the nodes list nodesList = '', // The counter starts from the `min` counter = PickerConstructor._.trigger( groupObject.min, groupObject ) // Loop from the `min` to `max`, incrementing by `i` for ( ; counter <= PickerConstructor._.trigger( groupObject.max, groupObject, [ counter ] ); counter += groupObject.i ) { // Trigger the `item` function within scope of the object loopObjectScope = PickerConstructor._.trigger( groupObject.item, groupObject, [ counter ] ) // Splice the subgroup and create nodes out of the sub nodes nodesList += PickerConstructor._.node( groupObject.node, loopObjectScope[ 0 ], // the node loopObjectScope[ 1 ], // the classes loopObjectScope[ 2 ] // the attributes ) } // Return the list of nodes return nodesList }, //group /** * Create a dom node string */ node: function( wrapper, item, klass, attribute ) { // If the item is false-y, just return an empty string if ( !item ) return '' // If the item is an array, do a join item = $.isArray( item ) ? item.join( '' ) : item // Check for the class klass = klass ? ' class="' + klass + '"' : '' // Check for any attributes attribute = attribute ? ' ' + attribute : '' // Return the wrapped item return '<' + wrapper + klass + attribute + '>' + item + '' }, //node /** * Lead numbers below 10 with a zero. */ lead: function( number ) { return ( number < 10 ? '0': '' ) + number }, /** * Trigger a function otherwise return the value. */ trigger: function( callback, scope, args ) { return typeof callback == 'function' ? callback.apply( scope, args || [] ) : callback }, /** * If the second character is a digit, length is 2 otherwise 1. */ digits: function( string ) { return ( /\d/ ).test( string[ 1 ] ) ? 2 : 1 }, /** * Tell if something is a date object. */ isDate: function( value ) { return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() ) }, /** * Tell if something is an integer. */ isInteger: function( value ) { return {}.toString.call( value ).indexOf( 'Number' ) > -1 && value % 1 === 0 }, /** * Create ARIA attribute strings. */ ariaAttr: ariaAttr } //PickerConstructor._ /** * Extend the picker with a component and defaults. */ PickerConstructor.extend = function( name, Component ) { // Extend jQuery. $.fn[ name ] = function( options, action ) { // Grab the component data. var componentData = this.data( name ) // If the picker is requested, return the data object. if ( options == 'picker' ) { return componentData } // If the component data exists and `options` is a string, carry out the action. if ( componentData && typeof options == 'string' ) { return PickerConstructor._.trigger( componentData[ options ], componentData, [ action ] ) } // Otherwise go through each matched element and if the component // doesn’t exist, create a new picker using `this` element // and merging the defaults and options with a deep copy. return this.each( function() { var $this = $( this ) if ( !$this.data( name ) ) { new PickerConstructor( this, name, Component, options ) } }) } // Set the defaults. $.fn[ name ].defaults = Component.defaults } //PickerConstructor.extend function aria(element, attribute, value) { if ( $.isPlainObject(attribute) ) { for ( var key in attribute ) { ariaSet(element, key, attribute[key]) } } else { ariaSet(element, attribute, value) } } function ariaSet(element, attribute, value) { element.setAttribute( (attribute == 'role' ? '' : 'aria-') + attribute, value ) } function ariaAttr(attribute, data) { if ( !$.isPlainObject(attribute) ) { attribute = { attribute: data } } data = '' for ( var key in attribute ) { var attr = (key == 'role' ? '' : 'aria-') + key, attrVal = attribute[key] data += attrVal == null ? '' : attr + '="' + attribute[key] + '"' } return data } // IE8 bug throws an error for activeElements within iframes. function getActiveElement() { try { return document.activeElement } catch ( err ) { } } // Expose the picker constructor. return PickerConstructor })); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/pickadate/picker.date.js?ver=5.4 /*! * Date picker for pickadate.js v3.5.6 * http://amsul.github.io/pickadate.js/date.htm */ (function ( factory ) { // AMD. if ( typeof define == 'function' && define.amd ) define( ['picker', 'jquery'], factory ) // Node.js/browserify. else if ( typeof exports == 'object' ) module.exports = factory( require('./picker.js'), require('jquery') ) // Browser globals. else factory( Picker, jQuery ) }(function( Picker, $ ) { /** * Globals and constants */ var DAYS_IN_WEEK = 7, WEEKS_IN_CALENDAR = 6, _ = Picker._ /** * The date picker constructor */ function DatePicker( picker, settings ) { var calendar = this, element = picker.$node[ 0 ], elementValue = element.value, elementDataValue = picker.$node.data( 'value' ), valueString = elementDataValue || elementValue, formatString = elementDataValue ? settings.formatSubmit : settings.format, isRTL = function() { return element.currentStyle ? // For IE. element.currentStyle.direction == 'rtl' : // For normal browsers. getComputedStyle( picker.$root[0] ).direction == 'rtl' } calendar.settings = settings calendar.$node = picker.$node // The queue of methods that will be used to build item objects. calendar.queue = { min: 'measure create', max: 'measure create', now: 'now create', select: 'parse create validate', highlight: 'parse navigate create validate', view: 'parse create validate viewset', disable: 'deactivate', enable: 'activate' } // The component's item object. calendar.item = {} calendar.item.clear = null calendar.item.disable = ( settings.disable || [] ).slice( 0 ) calendar.item.enable = -(function( collectionDisabled ) { return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1 })( calendar.item.disable ) calendar. set( 'min', settings.min ). set( 'max', settings.max ). set( 'now' ) // When there’s a value, set the `select`, which in turn // also sets the `highlight` and `view`. if ( valueString ) { calendar.set( 'select', valueString, { format: formatString, defaultValue: true }) } // If there’s no value, default to highlighting “today”. else { calendar. set( 'select', null ). set( 'highlight', calendar.item.now ) } // The keycode to movement mapping. calendar.key = { 40: 7, // Down 38: -7, // Up 39: function() { return isRTL() ? -1 : 1 }, // Right 37: function() { return isRTL() ? 1 : -1 }, // Left go: function( timeChange ) { var highlightedObject = calendar.item.highlight, targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange ) calendar.set( 'highlight', targetDate, { interval: timeChange } ) this.render() } } // Bind some picker events. picker. on( 'render', function() { picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() { var value = this.value if ( value ) { picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] ) picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' ) } }) picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() { var value = this.value if ( value ) { picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] ) picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' ) } }) }, 1 ). on( 'open', function() { var includeToday = '' if ( calendar.disabled( calendar.get('now') ) ) { includeToday = ':not(.' + settings.klass.buttonToday + ')' } picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false ) }, 1 ). on( 'close', function() { picker.$root.find( 'button, select' ).attr( 'disabled', true ) }, 1 ) } //DatePicker /** * Set a datepicker item object. */ DatePicker.prototype.set = function( type, value, options ) { var calendar = this, calendarItem = calendar.item // If the value is `null` just set it immediately. if ( value === null ) { if ( type == 'clear' ) type = 'select' calendarItem[ type ] = value return calendar } // Otherwise go through the queue of methods, and invoke the functions. // Update this as the time unit, and set the final value as this item. // * In the case of `enable`, keep the queue but set `disable` instead. // And in the case of `flip`, keep the queue but set `enable` instead. calendarItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = calendar.queue[ type ].split( ' ' ).map( function( method ) { value = calendar[ method ]( type, value, options ) return value }).pop() // Check if we need to cascade through more updates. if ( type == 'select' ) { calendar.set( 'highlight', calendarItem.select, options ) } else if ( type == 'highlight' ) { calendar.set( 'view', calendarItem.highlight, options ) } else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) { if ( calendarItem.select && calendar.disabled( calendarItem.select ) ) { calendar.set( 'select', calendarItem.select, options ) } if ( calendarItem.highlight && calendar.disabled( calendarItem.highlight ) ) { calendar.set( 'highlight', calendarItem.highlight, options ) } } return calendar } //DatePicker.prototype.set /** * Get a datepicker item object. */ DatePicker.prototype.get = function( type ) { return this.item[ type ] } //DatePicker.prototype.get /** * Create a picker date object. */ DatePicker.prototype.create = function( type, value, options ) { var isInfiniteValue, calendar = this // If there’s no value, use the type as the value. value = value === undefined ? type : value // If it’s infinity, update the value. if ( value == -Infinity || value == Infinity ) { isInfiniteValue = value } // If it’s an object, use the native date object. else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) { value = value.obj } // If it’s an array, convert it into a date and make sure // that it’s a valid date – otherwise default to today. else if ( $.isArray( value ) ) { value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] ) value = _.isDate( value ) ? value : calendar.create().obj } // If it’s a number or date object, make a normalized date. else if ( _.isInteger( value ) || _.isDate( value ) ) { value = calendar.normalize( new Date( value ), options ) } // If it’s a literal true or any other case, set it to now. else /*if ( value === true )*/ { value = calendar.now( type, value, options ) } // Return the compiled object. return { year: isInfiniteValue || value.getFullYear(), month: isInfiniteValue || value.getMonth(), date: isInfiniteValue || value.getDate(), day: isInfiniteValue || value.getDay(), obj: isInfiniteValue || value, pick: isInfiniteValue || value.getTime() } } //DatePicker.prototype.create /** * Create a range limit object using an array, date object, * literal “true”, or integer relative to another time. */ DatePicker.prototype.createRange = function( from, to ) { var calendar = this, createDate = function( date ) { if ( date === true || $.isArray( date ) || _.isDate( date ) ) { return calendar.create( date ) } return date } // Create objects if possible. if ( !_.isInteger( from ) ) { from = createDate( from ) } if ( !_.isInteger( to ) ) { to = createDate( to ) } // Create relative dates. if ( _.isInteger( from ) && $.isPlainObject( to ) ) { from = [ to.year, to.month, to.date + from ]; } else if ( _.isInteger( to ) && $.isPlainObject( from ) ) { to = [ from.year, from.month, from.date + to ]; } return { from: createDate( from ), to: createDate( to ) } } //DatePicker.prototype.createRange /** * Check if a date unit falls within a date range object. */ DatePicker.prototype.withinRange = function( range, dateUnit ) { range = this.createRange(range.from, range.to) return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick } /** * Check if two date range objects overlap. */ DatePicker.prototype.overlapRanges = function( one, two ) { var calendar = this // Convert the ranges into comparable dates. one = calendar.createRange( one.from, one.to ) two = calendar.createRange( two.from, two.to ) return calendar.withinRange( one, two.from ) || calendar.withinRange( one, two.to ) || calendar.withinRange( two, one.from ) || calendar.withinRange( two, one.to ) } /** * Get the date today. */ DatePicker.prototype.now = function( type, value, options ) { value = new Date() if ( options && options.rel ) { value.setDate( value.getDate() + options.rel ) } return this.normalize( value, options ) } /** * Navigate to next/prev month. */ DatePicker.prototype.navigate = function( type, value, options ) { var targetDateObject, targetYear, targetMonth, targetDate, isTargetArray = $.isArray( value ), isTargetObject = $.isPlainObject( value ), viewsetObject = this.item.view/*, safety = 100*/ if ( isTargetArray || isTargetObject ) { if ( isTargetObject ) { targetYear = value.year targetMonth = value.month targetDate = value.date } else { targetYear = +value[0] targetMonth = +value[1] targetDate = +value[2] } // If we’re navigating months but the view is in a different // month, navigate to the view’s year and month. if ( options && options.nav && viewsetObject && viewsetObject.month !== targetMonth ) { targetYear = viewsetObject.year targetMonth = viewsetObject.month } // Figure out the expected target year and month. targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 ) targetYear = targetDateObject.getFullYear() targetMonth = targetDateObject.getMonth() // If the month we’re going to doesn’t have enough days, // keep decreasing the date until we reach the month’s last date. while ( /*safety &&*/ new Date( targetYear, targetMonth, targetDate ).getMonth() !== targetMonth ) { targetDate -= 1 /*safety -= 1 if ( !safety ) { throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.' }*/ } value = [ targetYear, targetMonth, targetDate ] } return value } //DatePicker.prototype.navigate /** * Normalize a date by setting the hours to midnight. */ DatePicker.prototype.normalize = function( value/*, options*/ ) { value.setHours( 0, 0, 0, 0 ) return value } /** * Measure the range of dates. */ DatePicker.prototype.measure = function( type, value/*, options*/ ) { var calendar = this // If it’s anything false-y, remove the limits. if ( !value ) { value = type == 'min' ? -Infinity : Infinity } // If it’s a string, parse it. else if ( typeof value == 'string' ) { value = calendar.parse( type, value ) } // If it's an integer, get a date relative to today. else if ( _.isInteger( value ) ) { value = calendar.now( type, value, { rel: value } ) } return value } ///DatePicker.prototype.measure /** * Create a viewset object based on navigation. */ DatePicker.prototype.viewset = function( type, dateObject/*, options*/ ) { return this.create([ dateObject.year, dateObject.month, 1 ]) } /** * Validate a date as enabled and shift if needed. */ DatePicker.prototype.validate = function( type, dateObject, options ) { var calendar = this, // Keep a reference to the original date. originalDateObject = dateObject, // Make sure we have an interval. interval = options && options.interval ? options.interval : 1, // Check if the calendar enabled dates are inverted. isFlippedBase = calendar.item.enable === -1, // Check if we have any enabled dates after/before now. hasEnabledBeforeTarget, hasEnabledAfterTarget, // The min & max limits. minLimitObject = calendar.item.min, maxLimitObject = calendar.item.max, // Check if we’ve reached the limit during shifting. reachedMin, reachedMax, // Check if the calendar is inverted and at least one weekday is enabled. hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter( function( value ) { // If there’s a date, check where it is relative to the target. if ( $.isArray( value ) ) { var dateTime = calendar.create( value ).pick if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true } // Return only integers for enabled weekdays. return _.isInteger( value ) }).length/*, safety = 100*/ // Cases to validate for: // [1] Not inverted and date disabled. // [2] Inverted and some dates enabled. // [3] Not inverted and out of range. // // Cases to **not** validate for: // • Navigating months. // • Not inverted and date enabled. // • Inverted and all dates disabled. // • ..and anything else. if ( !options || (!options.nav && !options.defaultValue) ) if ( /* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) || /* 2 */ ( isFlippedBase && calendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) || /* 3 */ ( !isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick) ) ) { // When inverted, flip the direction if there aren’t any enabled weekdays // and there are no enabled dates in the direction of the interval. if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabledAfterTarget && interval > 0 ) || ( !hasEnabledBeforeTarget && interval < 0 ) ) ) { interval *= -1 } // Keep looping until we reach an enabled date. while ( /*safety &&*/ calendar.disabled( dateObject ) ) { /*safety -= 1 if ( !safety ) { throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.' }*/ // If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval. if ( Math.abs( interval ) > 1 && ( dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month ) ) { dateObject = originalDateObject interval = interval > 0 ? 1 : -1 } // If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit. if ( dateObject.pick <= minLimitObject.pick ) { reachedMin = true interval = 1 dateObject = calendar.create([ minLimitObject.year, minLimitObject.month, minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1) ]) } else if ( dateObject.pick >= maxLimitObject.pick ) { reachedMax = true interval = -1 dateObject = calendar.create([ maxLimitObject.year, maxLimitObject.month, maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1) ]) } // If we’ve reached both limits, just break out of the loop. if ( reachedMin && reachedMax ) { break } // Finally, create the shifted date using the interval and keep looping. dateObject = calendar.create([ dateObject.year, dateObject.month, dateObject.date + interval ]) } } //endif // Return the date object settled on. return dateObject } //DatePicker.prototype.validate /** * Check if a date is disabled. */ DatePicker.prototype.disabled = function( dateToVerify ) { var calendar = this, // Filter through the disabled dates to check if this is one. isDisabledMatch = calendar.item.disable.filter( function( dateToDisable ) { // If the date is a number, match the weekday with 0index and `firstDay` check. if ( _.isInteger( dateToDisable ) ) { return dateToVerify.day === ( calendar.settings.firstDay ? dateToDisable : dateToDisable - 1 ) % 7 } // If it’s an array or a native JS date, create and match the exact date. if ( $.isArray( dateToDisable ) || _.isDate( dateToDisable ) ) { return dateToVerify.pick === calendar.create( dateToDisable ).pick } // If it’s an object, match a date within the “from” and “to” range. if ( $.isPlainObject( dateToDisable ) ) { return calendar.withinRange( dateToDisable, dateToVerify ) } }) // If this date matches a disabled date, confirm it’s not inverted. isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( dateToDisable ) { return $.isArray( dateToDisable ) && dateToDisable[3] == 'inverted' || $.isPlainObject( dateToDisable ) && dateToDisable.inverted }).length // Check the calendar “enabled” flag and respectively flip the // disabled state. Then also check if it’s beyond the min/max limits. return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch || dateToVerify.pick < calendar.item.min.pick || dateToVerify.pick > calendar.item.max.pick } //DatePicker.prototype.disabled /** * Parse a string into a usable type. */ DatePicker.prototype.parse = function( type, value, options ) { var calendar = this, parsingObject = {} // If it’s already parsed, we’re good. if ( !value || typeof value != 'string' ) { return value } // We need a `.format` to parse the value with. if ( !( options && options.format ) ) { options = options || {} options.format = calendar.settings.format } // Convert the format into an array and then map through it. calendar.formats.toArray( options.format ).map( function( label ) { var // Grab the formatting label. formattingLabel = calendar.formats[ label ], // The format length is from the formatting label function or the // label length without the escaping exclamation (!) mark. formatLength = formattingLabel ? _.trigger( formattingLabel, calendar, [ value, parsingObject ] ) : label.replace( /^!/, '' ).length // If there's a format label, split the value up to the format length. // Then add it to the parsing object with appropriate label. if ( formattingLabel ) { parsingObject[ label ] = value.substr( 0, formatLength ) } // Update the value as the substring from format length to end. value = value.substr( formatLength ) }) // Compensate for month 0index. return [ parsingObject.yyyy || parsingObject.yy, +( parsingObject.mm || parsingObject.m ) - 1, parsingObject.dd || parsingObject.d ] } //DatePicker.prototype.parse /** * Various formats to display the object in. */ DatePicker.prototype.formats = (function() { // Return the length of the first word in a collection. function getWordLengthFromCollection( string, collection, dateObject ) { // Grab the first word from the string. // Regex pattern from http://stackoverflow.com/q/150033 var word = string.match( /[^\x00-\x7F]+|\w+/ )[ 0 ] // If there's no month index, add it to the date object if ( !dateObject.mm && !dateObject.m ) { dateObject.m = collection.indexOf( word ) + 1 } // Return the length of the word. return word.length } // Get the length of the first word in a string. function getFirstWordLength( string ) { return string.match( /\w+/ )[ 0 ].length } return { d: function( string, dateObject ) { // If there's string, then get the digits length. // Otherwise return the selected date. return string ? _.digits( string ) : dateObject.date }, dd: function( string, dateObject ) { // If there's a string, then the length is always 2. // Otherwise return the selected date with a leading zero. return string ? 2 : _.lead( dateObject.date ) }, ddd: function( string, dateObject ) { // If there's a string, then get the length of the first word. // Otherwise return the short selected weekday. return string ? getFirstWordLength( string ) : this.settings.weekdaysShort[ dateObject.day ] }, dddd: function( string, dateObject ) { // If there's a string, then get the length of the first word. // Otherwise return the full selected weekday. return string ? getFirstWordLength( string ) : this.settings.weekdaysFull[ dateObject.day ] }, m: function( string, dateObject ) { // If there's a string, then get the length of the digits // Otherwise return the selected month with 0index compensation. return string ? _.digits( string ) : dateObject.month + 1 }, mm: function( string, dateObject ) { // If there's a string, then the length is always 2. // Otherwise return the selected month with 0index and leading zero. return string ? 2 : _.lead( dateObject.month + 1 ) }, mmm: function( string, dateObject ) { var collection = this.settings.monthsShort // If there's a string, get length of the relevant month from the short // months collection. Otherwise return the selected month from that collection. return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ] }, mmmm: function( string, dateObject ) { var collection = this.settings.monthsFull // If there's a string, get length of the relevant month from the full // months collection. Otherwise return the selected month from that collection. return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ] }, yy: function( string, dateObject ) { // If there's a string, then the length is always 2. // Otherwise return the selected year by slicing out the first 2 digits. return string ? 2 : ( '' + dateObject.year ).slice( 2 ) }, yyyy: function( string, dateObject ) { // If there's a string, then the length is always 4. // Otherwise return the selected year. return string ? 4 : dateObject.year }, // Create an array by splitting the formatting string passed. toArray: function( formatString ) { return formatString.split( /(d{1,4}|m{1,4}|y{4}|yy|!.)/g ) }, // Format an object into a string using the formatting options. toString: function ( formatString, itemObject ) { var calendar = this return calendar.formats.toArray( formatString ).map( function( label ) { return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' ) }).join( '' ) } } })() //DatePicker.prototype.formats /** * Check if two date units are the exact. */ DatePicker.prototype.isDateExact = function( one, two ) { var calendar = this // When we’re working with weekdays, do a direct comparison. if ( ( _.isInteger( one ) && _.isInteger( two ) ) || ( typeof one == 'boolean' && typeof two == 'boolean' ) ) { return one === two } // When we’re working with date representations, compare the “pick” value. if ( ( _.isDate( one ) || $.isArray( one ) ) && ( _.isDate( two ) || $.isArray( two ) ) ) { return calendar.create( one ).pick === calendar.create( two ).pick } // When we’re working with range objects, compare the “from” and “to”. if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) { return calendar.isDateExact( one.from, two.from ) && calendar.isDateExact( one.to, two.to ) } return false } /** * Check if two date units overlap. */ DatePicker.prototype.isDateOverlap = function( one, two ) { var calendar = this, firstDay = calendar.settings.firstDay ? 1 : 0 // When we’re working with a weekday index, compare the days. if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) { one = one % 7 + firstDay return one === calendar.create( two ).day + 1 } if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) { two = two % 7 + firstDay return two === calendar.create( one ).day + 1 } // When we’re working with range objects, check if the ranges overlap. if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) { return calendar.overlapRanges( one, two ) } return false } /** * Flip the “enabled” state. */ DatePicker.prototype.flipEnable = function(val) { var itemObject = this.item itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1) } /** * Mark a collection of dates as “disabled”. */ DatePicker.prototype.deactivate = function( type, datesToDisable ) { var calendar = this, disabledItems = calendar.item.disable.slice(0) // If we’re flipping, that’s all we need to do. if ( datesToDisable == 'flip' ) { calendar.flipEnable() } else if ( datesToDisable === false ) { calendar.flipEnable(1) disabledItems = [] } else if ( datesToDisable === true ) { calendar.flipEnable(-1) disabledItems = [] } // Otherwise go through the dates to disable. else { datesToDisable.map(function( unitToDisable ) { var matchFound // When we have disabled items, check for matches. // If something is matched, immediately break out. for ( var index = 0; index < disabledItems.length; index += 1 ) { if ( calendar.isDateExact( unitToDisable, disabledItems[index] ) ) { matchFound = true break } } // If nothing was found, add the validated unit to the collection. if ( !matchFound ) { if ( _.isInteger( unitToDisable ) || _.isDate( unitToDisable ) || $.isArray( unitToDisable ) || ( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to ) ) { disabledItems.push( unitToDisable ) } } }) } // Return the updated collection. return disabledItems } //DatePicker.prototype.deactivate /** * Mark a collection of dates as “enabled”. */ DatePicker.prototype.activate = function( type, datesToEnable ) { var calendar = this, disabledItems = calendar.item.disable, disabledItemsCount = disabledItems.length // If we’re flipping, that’s all we need to do. if ( datesToEnable == 'flip' ) { calendar.flipEnable() } else if ( datesToEnable === true ) { calendar.flipEnable(1) disabledItems = [] } else if ( datesToEnable === false ) { calendar.flipEnable(-1) disabledItems = [] } // Otherwise go through the disabled dates. else { datesToEnable.map(function( unitToEnable ) { var matchFound, disabledUnit, index, isExactRange // Go through the disabled items and try to find a match. for ( index = 0; index < disabledItemsCount; index += 1 ) { disabledUnit = disabledItems[index] // When an exact match is found, remove it from the collection. if ( calendar.isDateExact( disabledUnit, unitToEnable ) ) { matchFound = disabledItems[index] = null isExactRange = true break } // When an overlapped match is found, add the “inverted” state to it. else if ( calendar.isDateOverlap( disabledUnit, unitToEnable ) ) { if ( $.isPlainObject( unitToEnable ) ) { unitToEnable.inverted = true matchFound = unitToEnable } else if ( $.isArray( unitToEnable ) ) { matchFound = unitToEnable if ( !matchFound[3] ) matchFound.push( 'inverted' ) } else if ( _.isDate( unitToEnable ) ) { matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ] } break } } // If a match was found, remove a previous duplicate entry. if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) { if ( calendar.isDateExact( disabledItems[index], unitToEnable ) ) { disabledItems[index] = null break } } // In the event that we’re dealing with an exact range of dates, // make sure there are no “inverted” dates because of it. if ( isExactRange ) for ( index = 0; index < disabledItemsCount; index += 1 ) { if ( calendar.isDateOverlap( disabledItems[index], unitToEnable ) ) { disabledItems[index] = null break } } // If something is still matched, add it into the collection. if ( matchFound ) { disabledItems.push( matchFound ) } }) } // Return the updated collection. return disabledItems.filter(function( val ) { return val != null }) } //DatePicker.prototype.activate /** * Create a string for the nodes in the picker. */ DatePicker.prototype.nodes = function( isOpen ) { var calendar = this, settings = calendar.settings, calendarItem = calendar.item, nowObject = calendarItem.now, selectedObject = calendarItem.select, highlightedObject = calendarItem.highlight, viewsetObject = calendarItem.view, disabledCollection = calendarItem.disable, minLimitObject = calendarItem.min, maxLimitObject = calendarItem.max, // Create the calendar table head using a copy of weekday labels collection. // * We do a copy so we don't mutate the original array. tableHead = (function( collection, fullCollection ) { // If the first day should be Monday, move Sunday to the end. if ( settings.firstDay ) { collection.push( collection.shift() ) fullCollection.push( fullCollection.shift() ) } // Create and return the table head group. return _.node( 'thead', _.node( 'tr', _.group({ min: 0, max: DAYS_IN_WEEK - 1, i: 1, node: 'th', item: function( counter ) { return [ collection[ counter ], settings.klass.weekdays, 'scope=col title="' + fullCollection[ counter ] + '"' ] } }) ) ) //endreturn })( ( settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysShort ).slice( 0 ), settings.weekdaysFull.slice( 0 ) ), //tableHead // Create the nav for next/prev month. createMonthNav = function( next ) { // Otherwise, return the created month tag. return _.node( 'div', ' ', settings.klass[ 'nav' + ( next ? 'Next' : 'Prev' ) ] + ( // If the focused month is outside the range, disabled the button. ( next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month ) || ( !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ) ? ' ' + settings.klass.navDisabled : '' ), 'data-nav=' + ( next || -1 ) + ' ' + _.ariaAttr({ role: 'button', controls: calendar.$node[0].id + '_table' }) + ' ' + 'title="' + (next ? settings.labelMonthNext : settings.labelMonthPrev ) + '"' ) //endreturn }, //createMonthNav // Create the month label. createMonthLabel = function() { var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull // If there are months to select, add a dropdown menu. if ( settings.selectMonths ) { return _.node( 'select', _.group({ min: 0, max: 11, i: 1, node: 'option', item: function( loopedMonth ) { return [ // The looped month and no classes. monthsCollection[ loopedMonth ], 0, // Set the value and selected index. 'value=' + loopedMonth + ( viewsetObject.month == loopedMonth ? ' selected' : '' ) + ( ( ( viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month ) || ( viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month ) ) ? ' disabled' : '' ) ] } }), settings.klass.selectMonth, ( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' + 'title="' + settings.labelMonthSelect + '"' ) } // If there's a need for a month selector return _.node( 'div', monthsCollection[ viewsetObject.month ], settings.klass.month ) }, //createMonthLabel // Create the year label. createYearLabel = function() { var focusedYear = viewsetObject.year, // If years selector is set to a literal "true", set it to 5. Otherwise // divide in half to get half before and half after focused year. numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 ) // If there are years to select, add a dropdown menu. if ( numberYears ) { var minYear = minLimitObject.year, maxYear = maxLimitObject.year, lowestYear = focusedYear - numberYears, highestYear = focusedYear + numberYears // If the min year is greater than the lowest year, increase the highest year // by the difference and set the lowest year to the min year. if ( minYear > lowestYear ) { highestYear += minYear - lowestYear lowestYear = minYear } // If the max year is less than the highest year, decrease the lowest year // by the lower of the two: available and needed years. Then set the // highest year to the max year. if ( maxYear < highestYear ) { var availableYears = lowestYear - minYear, neededYears = highestYear - maxYear lowestYear -= availableYears > neededYears ? neededYears : availableYears highestYear = maxYear } return _.node( 'select', _.group({ min: lowestYear, max: highestYear, i: 1, node: 'option', item: function( loopedYear ) { return [ // The looped year and no classes. loopedYear, 0, // Set the value and selected index. 'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' ) ] } }), settings.klass.selectYear, ( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' + 'title="' + settings.labelYearSelect + '"' ) } // Otherwise just return the year focused return _.node( 'div', focusedYear, settings.klass.year ) } //createYearLabel // Create and return the entire calendar. return _.node( 'div', ( settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel() ) + createMonthNav() + createMonthNav( 1 ), settings.klass.header ) + _.node( 'table', tableHead + _.node( 'tbody', _.group({ min: 0, max: WEEKS_IN_CALENDAR - 1, i: 1, node: 'tr', item: function( rowCounter ) { // If Monday is the first day and the month starts on Sunday, shift the date back a week. var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0 return [ _.group({ min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index max: function() { return this.min + DAYS_IN_WEEK - 1 }, i: 1, node: 'td', item: function( targetDate ) { // Convert the time date from a relative date to a target date. targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ]) var isSelected = selectedObject && selectedObject.pick == targetDate.pick, isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick, isDisabled = disabledCollection && calendar.disabled( targetDate ) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick, formattedDate = _.trigger( calendar.formats.toString, calendar, [ settings.format, targetDate ] ) return [ _.node( 'div', targetDate.date, (function( klasses ) { // Add the `infocus` or `outfocus` classes based on month in view. klasses.push( viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus ) // Add the `today` class if needed. if ( nowObject.pick == targetDate.pick ) { klasses.push( settings.klass.now ) } // Add the `selected` class if something's selected and the time matches. if ( isSelected ) { klasses.push( settings.klass.selected ) } // Add the `highlighted` class if something's highlighted and the time matches. if ( isHighlighted ) { klasses.push( settings.klass.highlighted ) } // Add the `disabled` class if something's disabled and the object matches. if ( isDisabled ) { klasses.push( settings.klass.disabled ) } return klasses.join( ' ' ) })([ settings.klass.day ]), 'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({ role: 'gridcell', label: formattedDate, selected: isSelected && calendar.$node.val() === formattedDate ? true : null, activedescendant: isHighlighted ? true : null, disabled: isDisabled ? true : null }) ), '', _.ariaAttr({ role: 'presentation' }) ] //endreturn } }) ] //endreturn } }) ), settings.klass.table, 'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({ role: 'grid', controls: calendar.$node[0].id, readonly: true }) ) + // * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”. _.node( 'div', _.node( 'button', settings.today, settings.klass.buttonToday, 'type=button data-pick=' + nowObject.pick + ( isOpen && !calendar.disabled(nowObject) ? '' : ' disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id }) ) + _.node( 'button', settings.clear, settings.klass.buttonClear, 'type=button data-clear=1' + ( isOpen ? '' : ' disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id }) ) + _.node('button', settings.close, settings.klass.buttonClose, 'type=button data-close=true ' + ( isOpen ? '' : ' disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id }) ), settings.klass.footer ) //endreturn } //DatePicker.prototype.nodes /** * The date picker defaults. */ DatePicker.defaults = (function( prefix ) { return { // The title label to use for the month nav buttons labelMonthNext: 'Next month', labelMonthPrev: 'Previous month', // The title label to use for the dropdown selectors labelMonthSelect: 'Select a month', labelYearSelect: 'Select a year', // Months and weekdays monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ], weekdaysFull: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ], weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ], // Today and clear today: 'Today', clear: 'Clear', close: 'Close', // Picker close behavior closeOnSelect: true, closeOnClear: true, // The format to show on the `input` element format: 'd mmmm, yyyy', // Classes klass: { table: prefix + 'table', header: prefix + 'header', navPrev: prefix + 'nav--prev', navNext: prefix + 'nav--next', navDisabled: prefix + 'nav--disabled', month: prefix + 'month', year: prefix + 'year', selectMonth: prefix + 'select--month', selectYear: prefix + 'select--year', weekdays: prefix + 'weekday', day: prefix + 'day', disabled: prefix + 'day--disabled', selected: prefix + 'day--selected', highlighted: prefix + 'day--highlighted', now: prefix + 'day--today', infocus: prefix + 'day--infocus', outfocus: prefix + 'day--outfocus', footer: prefix + 'footer', buttonClear: prefix + 'button--clear', buttonToday: prefix + 'button--today', buttonClose: prefix + 'button--close' } } })( Picker.klasses().picker + '__' ) /** * Extend the picker to add the date picker. */ Picker.extend( 'pickadate', DatePicker ) })); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/pickadate/picker.time.js?ver=5.4 /*! * Time picker for pickadate.js v3.5.6 * http://amsul.github.io/pickadate.js/time.htm */ (function ( factory ) { // AMD. if ( typeof define == 'function' && define.amd ) define( ['picker', 'jquery'], factory ) // Node.js/browserify. else if ( typeof exports == 'object' ) module.exports = factory( require('./picker.js'), require('jquery') ) // Browser globals. else factory( Picker, jQuery ) }(function( Picker, $ ) { /** * Globals and constants */ var HOURS_IN_DAY = 24, MINUTES_IN_HOUR = 60, HOURS_TO_NOON = 12, MINUTES_IN_DAY = HOURS_IN_DAY * MINUTES_IN_HOUR, _ = Picker._ /** * The time picker constructor */ function TimePicker( picker, settings ) { var clock = this, elementValue = picker.$node[ 0 ].value, elementDataValue = picker.$node.data( 'value' ), valueString = elementDataValue || elementValue, formatString = elementDataValue ? settings.formatSubmit : settings.format clock.settings = settings clock.$node = picker.$node // The queue of methods that will be used to build item objects. clock.queue = { interval: 'i', min: 'measure create', max: 'measure create', now: 'now create', select: 'parse create validate', highlight: 'parse create validate', view: 'parse create validate', disable: 'deactivate', enable: 'activate' } // The component's item object. clock.item = {} clock.item.clear = null clock.item.interval = settings.interval || 30 clock.item.disable = ( settings.disable || [] ).slice( 0 ) clock.item.enable = -(function( collectionDisabled ) { return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1 })( clock.item.disable ) clock. set( 'min', settings.min ). set( 'max', settings.max ). set( 'now' ) // When there’s a value, set the `select`, which in turn // also sets the `highlight` and `view`. if ( valueString ) { clock.set( 'select', valueString, { format: formatString }) } // If there’s no value, default to highlighting “today”. else { clock. set( 'select', null ). set( 'highlight', clock.item.now ) } // The keycode to movement mapping. clock.key = { 40: 1, // Down 38: -1, // Up 39: 1, // Right 37: -1, // Left go: function( timeChange ) { clock.set( 'highlight', clock.item.highlight.pick + timeChange * clock.item.interval, { interval: timeChange * clock.item.interval } ) this.render() } } // Bind some picker events. picker. on( 'render', function() { var $pickerHolder = picker.$root.children(), $viewset = $pickerHolder.find( '.' + settings.klass.viewset ), vendors = function( prop ) { return ['webkit', 'moz', 'ms', 'o', ''].map(function( vendor ) { return ( vendor ? '-' + vendor + '-' : '' ) + prop }) }, animations = function( $el, state ) { vendors( 'transform' ).map(function( prop ) { $el.css( prop, state ) }) vendors( 'transition' ).map(function( prop ) { $el.css( prop, state ) }) } if ( $viewset.length ) { animations( $pickerHolder, 'none' ) $pickerHolder[ 0 ].scrollTop = ~~$viewset.position().top - ( $viewset[ 0 ].clientHeight * 2 ) animations( $pickerHolder, '' ) } }, 1 ). on( 'open', function() { picker.$root.find( 'button' ).attr( 'disabled', false ) }, 1 ). on( 'close', function() { picker.$root.find( 'button' ).attr( 'disabled', true ) }, 1 ) } //TimePicker /** * Set a timepicker item object. */ TimePicker.prototype.set = function( type, value, options ) { var clock = this, clockItem = clock.item // If the value is `null` just set it immediately. if ( value === null ) { if ( type == 'clear' ) type = 'select' clockItem[ type ] = value return clock } // Otherwise go through the queue of methods, and invoke the functions. // Update this as the time unit, and set the final value as this item. // * In the case of `enable`, keep the queue but set `disable` instead. // And in the case of `flip`, keep the queue but set `enable` instead. clockItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = clock.queue[ type ].split( ' ' ).map( function( method ) { value = clock[ method ]( type, value, options ) return value }).pop() // Check if we need to cascade through more updates. if ( type == 'select' ) { clock.set( 'highlight', clockItem.select, options ) } else if ( type == 'highlight' ) { clock.set( 'view', clockItem.highlight, options ) } else if ( type == 'interval' ) { clock. set( 'min', clockItem.min, options ). set( 'max', clockItem.max, options ) } else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) { if ( clockItem.select && clock.disabled( clockItem.select ) ) { clock.set( 'select', value, options ) } if ( clockItem.highlight && clock.disabled( clockItem.highlight ) ) { clock.set( 'highlight', value, options ) } if ( type == 'min' ) { clock.set( 'max', clockItem.max, options ) } } return clock } //TimePicker.prototype.set /** * Get a timepicker item object. */ TimePicker.prototype.get = function( type ) { return this.item[ type ] } //TimePicker.prototype.get /** * Create a picker time object. */ TimePicker.prototype.create = function( type, value, options ) { var clock = this // If there’s no value, use the type as the value. value = value === undefined ? type : value // If it’s a date object, convert it into an array. if ( _.isDate( value ) ) { value = [ value.getHours(), value.getMinutes() ] } // If it’s an object, use the “pick” value. if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) { value = value.pick } // If it’s an array, convert it into minutes. else if ( $.isArray( value ) ) { value = +value[ 0 ] * MINUTES_IN_HOUR + (+value[ 1 ]) } // If no valid value is passed, set it to “now”. else if ( !_.isInteger( value ) ) { value = clock.now( type, value, options ) } // If we’re setting the max, make sure it’s greater than the min. if ( type == 'max' && value < clock.item.min.pick ) { value += MINUTES_IN_DAY } // If the value doesn’t fall directly on the interval, // add one interval to indicate it as “passed”. if ( type != 'min' && type != 'max' && (value - clock.item.min.pick) % clock.item.interval !== 0 ) { value += clock.item.interval } // Normalize it into a “reachable” interval. value = clock.normalize( type, value, options ) // Return the compiled object. return { // Divide to get hours from minutes. hour: ~~( HOURS_IN_DAY + value / MINUTES_IN_HOUR ) % HOURS_IN_DAY, // The remainder is the minutes. mins: ( MINUTES_IN_HOUR + value % MINUTES_IN_HOUR ) % MINUTES_IN_HOUR, // The time in total minutes. time: ( MINUTES_IN_DAY + value ) % MINUTES_IN_DAY, // Reference to the “relative” value to pick. pick: value % MINUTES_IN_DAY } } //TimePicker.prototype.create /** * Create a range limit object using an array, date object, * literal “true”, or integer relative to another time. */ TimePicker.prototype.createRange = function( from, to ) { var clock = this, createTime = function( time ) { if ( time === true || $.isArray( time ) || _.isDate( time ) ) { return clock.create( time ) } return time } // Create objects if possible. if ( !_.isInteger( from ) ) { from = createTime( from ) } if ( !_.isInteger( to ) ) { to = createTime( to ) } // Create relative times. if ( _.isInteger( from ) && $.isPlainObject( to ) ) { from = [ to.hour, to.mins + ( from * clock.settings.interval ) ]; } else if ( _.isInteger( to ) && $.isPlainObject( from ) ) { to = [ from.hour, from.mins + ( to * clock.settings.interval ) ]; } return { from: createTime( from ), to: createTime( to ) } } //TimePicker.prototype.createRange /** * Check if a time unit falls within a time range object. */ TimePicker.prototype.withinRange = function( range, timeUnit ) { range = this.createRange(range.from, range.to) return timeUnit.pick >= range.from.pick && timeUnit.pick <= range.to.pick } /** * Check if two time range objects overlap. */ TimePicker.prototype.overlapRanges = function( one, two ) { var clock = this // Convert the ranges into comparable times. one = clock.createRange( one.from, one.to ) two = clock.createRange( two.from, two.to ) return clock.withinRange( one, two.from ) || clock.withinRange( one, two.to ) || clock.withinRange( two, one.from ) || clock.withinRange( two, one.to ) } /** * Get the time relative to now. */ TimePicker.prototype.now = function( type, value/*, options*/ ) { var interval = this.item.interval, date = new Date(), nowMinutes = date.getHours() * MINUTES_IN_HOUR + date.getMinutes(), isValueInteger = _.isInteger( value ), isBelowInterval // Make sure “now” falls within the interval range. nowMinutes -= nowMinutes % interval // Check if the difference is less than the interval itself. isBelowInterval = value < 0 && interval * value + nowMinutes <= -interval // Add an interval because the time has “passed”. nowMinutes += type == 'min' && isBelowInterval ? 0 : interval // If the value is a number, adjust by that many intervals. if ( isValueInteger ) { nowMinutes += interval * ( isBelowInterval && type != 'max' ? value + 1 : value ) } // Return the final calculation. return nowMinutes } //TimePicker.prototype.now /** * Normalize minutes to be “reachable” based on the min and interval. */ TimePicker.prototype.normalize = function( type, value/*, options*/ ) { var interval = this.item.interval, minTime = this.item.min && this.item.min.pick || 0 // If setting min time, don’t shift anything. // Otherwise get the value and min difference and then // normalize the difference with the interval. value -= type == 'min' ? 0 : ( value - minTime ) % interval // Return the adjusted value. return value } //TimePicker.prototype.normalize /** * Measure the range of minutes. */ TimePicker.prototype.measure = function( type, value, options ) { var clock = this // If it’s anything false-y, set it to the default. if ( !value ) { value = type == 'min' ? [ 0, 0 ] : [ HOURS_IN_DAY - 1, MINUTES_IN_HOUR - 1 ] } // If it’s a string, parse it. if ( typeof value == 'string' ) { value = clock.parse( type, value ) } // If it’s a literal true, or an integer, make it relative to now. else if ( value === true || _.isInteger( value ) ) { value = clock.now( type, value, options ) } // If it’s an object already, just normalize it. else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) { value = clock.normalize( type, value.pick, options ) } return value } ///TimePicker.prototype.measure /** * Validate an object as enabled. */ TimePicker.prototype.validate = function( type, timeObject, options ) { var clock = this, interval = options && options.interval ? options.interval : clock.item.interval // Check if the object is disabled. if ( clock.disabled( timeObject ) ) { // Shift with the interval until we reach an enabled time. timeObject = clock.shift( timeObject, interval ) } // Scope the object into range. timeObject = clock.scope( timeObject ) // Do a second check to see if we landed on a disabled min/max. // In that case, shift using the opposite interval as before. if ( clock.disabled( timeObject ) ) { timeObject = clock.shift( timeObject, interval * -1 ) } // Return the final object. return timeObject } //TimePicker.prototype.validate /** * Check if an object is disabled. */ TimePicker.prototype.disabled = function( timeToVerify ) { var clock = this, // Filter through the disabled times to check if this is one. isDisabledMatch = clock.item.disable.filter( function( timeToDisable ) { // If the time is a number, match the hours. if ( _.isInteger( timeToDisable ) ) { return timeToVerify.hour == timeToDisable } // If it’s an array, create the object and match the times. if ( $.isArray( timeToDisable ) || _.isDate( timeToDisable ) ) { return timeToVerify.pick == clock.create( timeToDisable ).pick } // If it’s an object, match a time within the “from” and “to” range. if ( $.isPlainObject( timeToDisable ) ) { return clock.withinRange( timeToDisable, timeToVerify ) } }) // If this time matches a disabled time, confirm it’s not inverted. isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( timeToDisable ) { return $.isArray( timeToDisable ) && timeToDisable[2] == 'inverted' || $.isPlainObject( timeToDisable ) && timeToDisable.inverted }).length // If the clock is "enabled" flag is flipped, flip the condition. return clock.item.enable === -1 ? !isDisabledMatch : isDisabledMatch || timeToVerify.pick < clock.item.min.pick || timeToVerify.pick > clock.item.max.pick } //TimePicker.prototype.disabled /** * Shift an object by an interval until we reach an enabled object. */ TimePicker.prototype.shift = function( timeObject, interval ) { var clock = this, minLimit = clock.item.min.pick, maxLimit = clock.item.max.pick/*, safety = 1000*/ interval = interval || clock.item.interval // Keep looping as long as the time is disabled. while ( /*safety &&*/ clock.disabled( timeObject ) ) { /*safety -= 1 if ( !safety ) { throw 'Fell into an infinite loop while shifting to ' + timeObject.hour + ':' + timeObject.mins + '.' }*/ // Increase/decrease the time by the interval and keep looping. timeObject = clock.create( timeObject.pick += interval ) // If we've looped beyond the limits, break out of the loop. if ( timeObject.pick <= minLimit || timeObject.pick >= maxLimit ) { break } } // Return the final object. return timeObject } //TimePicker.prototype.shift /** * Scope an object to be within range of min and max. */ TimePicker.prototype.scope = function( timeObject ) { var minLimit = this.item.min.pick, maxLimit = this.item.max.pick return this.create( timeObject.pick > maxLimit ? maxLimit : timeObject.pick < minLimit ? minLimit : timeObject ) } //TimePicker.prototype.scope /** * Parse a string into a usable type. */ TimePicker.prototype.parse = function( type, value, options ) { var hour, minutes, isPM, item, parseValue, clock = this, parsingObject = {} // If it’s already parsed, we’re good. if ( !value || typeof value != 'string' ) { return value } // We need a `.format` to parse the value with. if ( !( options && options.format ) ) { options = options || {} options.format = clock.settings.format } // Convert the format into an array and then map through it. clock.formats.toArray( options.format ).map( function( label ) { var substring, // Grab the formatting label. formattingLabel = clock.formats[ label ], // The format length is from the formatting label function or the // label length without the escaping exclamation (!) mark. formatLength = formattingLabel ? _.trigger( formattingLabel, clock, [ value, parsingObject ] ) : label.replace( /^!/, '' ).length // If there's a format label, split the value up to the format length. // Then add it to the parsing object with appropriate label. if ( formattingLabel ) { substring = value.substr( 0, formatLength ) parsingObject[ label ] = substring.match(/^\d+$/) ? +substring : substring } // Update the time value as the substring from format length to end. value = value.substr( formatLength ) }) // Grab the hour and minutes from the parsing object. for ( item in parsingObject ) { parseValue = parsingObject[item] if ( _.isInteger(parseValue) ) { if ( item.match(/^(h|hh)$/i) ) { hour = parseValue if ( item == 'h' || item == 'hh' ) { hour %= 12 } } else if ( item == 'i' ) { minutes = parseValue } } else if ( item.match(/^a$/i) && parseValue.match(/^p/i) && ('h' in parsingObject || 'hh' in parsingObject) ) { isPM = true } } // Calculate it in minutes and return. return (isPM ? hour + 12 : hour) * MINUTES_IN_HOUR + minutes } //TimePicker.prototype.parse /** * Various formats to display the object in. */ TimePicker.prototype.formats = { h: function( string, timeObject ) { // If there's string, then get the digits length. // Otherwise return the selected hour in "standard" format. return string ? _.digits( string ) : timeObject.hour % HOURS_TO_NOON || HOURS_TO_NOON }, hh: function( string, timeObject ) { // If there's a string, then the length is always 2. // Otherwise return the selected hour in "standard" format with a leading zero. return string ? 2 : _.lead( timeObject.hour % HOURS_TO_NOON || HOURS_TO_NOON ) }, H: function( string, timeObject ) { // If there's string, then get the digits length. // Otherwise return the selected hour in "military" format as a string. return string ? _.digits( string ) : '' + ( timeObject.hour % 24 ) }, HH: function( string, timeObject ) { // If there's string, then get the digits length. // Otherwise return the selected hour in "military" format with a leading zero. return string ? _.digits( string ) : _.lead( timeObject.hour % 24 ) }, i: function( string, timeObject ) { // If there's a string, then the length is always 2. // Otherwise return the selected minutes. return string ? 2 : _.lead( timeObject.mins ) }, a: function( string, timeObject ) { // If there's a string, then the length is always 4. // Otherwise check if it's more than "noon" and return either am/pm. return string ? 4 : MINUTES_IN_DAY / 2 > timeObject.time % MINUTES_IN_DAY ? 'a.m.' : 'p.m.' }, A: function( string, timeObject ) { // If there's a string, then the length is always 2. // Otherwise check if it's more than "noon" and return either am/pm. return string ? 2 : MINUTES_IN_DAY / 2 > timeObject.time % MINUTES_IN_DAY ? 'AM' : 'PM' }, // Create an array by splitting the formatting string passed. toArray: function( formatString ) { return formatString.split( /(h{1,2}|H{1,2}|i|a|A|!.)/g ) }, // Format an object into a string using the formatting options. toString: function ( formatString, itemObject ) { var clock = this return clock.formats.toArray( formatString ).map( function( label ) { return _.trigger( clock.formats[ label ], clock, [ 0, itemObject ] ) || label.replace( /^!/, '' ) }).join( '' ) } } //TimePicker.prototype.formats /** * Check if two time units are the exact. */ TimePicker.prototype.isTimeExact = function( one, two ) { var clock = this // When we’re working with minutes, do a direct comparison. if ( ( _.isInteger( one ) && _.isInteger( two ) ) || ( typeof one == 'boolean' && typeof two == 'boolean' ) ) { return one === two } // When we’re working with time representations, compare the “pick” value. if ( ( _.isDate( one ) || $.isArray( one ) ) && ( _.isDate( two ) || $.isArray( two ) ) ) { return clock.create( one ).pick === clock.create( two ).pick } // When we’re working with range objects, compare the “from” and “to”. if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) { return clock.isTimeExact( one.from, two.from ) && clock.isTimeExact( one.to, two.to ) } return false } /** * Check if two time units overlap. */ TimePicker.prototype.isTimeOverlap = function( one, two ) { var clock = this // When we’re working with an integer, compare the hours. if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) { return one === clock.create( two ).hour } if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) { return two === clock.create( one ).hour } // When we’re working with range objects, check if the ranges overlap. if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) { return clock.overlapRanges( one, two ) } return false } /** * Flip the “enabled” state. */ TimePicker.prototype.flipEnable = function(val) { var itemObject = this.item itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1) } /** * Mark a collection of times as “disabled”. */ TimePicker.prototype.deactivate = function( type, timesToDisable ) { var clock = this, disabledItems = clock.item.disable.slice(0) // If we’re flipping, that’s all we need to do. if ( timesToDisable == 'flip' ) { clock.flipEnable() } else if ( timesToDisable === false ) { clock.flipEnable(1) disabledItems = [] } else if ( timesToDisable === true ) { clock.flipEnable(-1) disabledItems = [] } // Otherwise go through the times to disable. else { timesToDisable.map(function( unitToDisable ) { var matchFound // When we have disabled items, check for matches. // If something is matched, immediately break out. for ( var index = 0; index < disabledItems.length; index += 1 ) { if ( clock.isTimeExact( unitToDisable, disabledItems[index] ) ) { matchFound = true break } } // If nothing was found, add the validated unit to the collection. if ( !matchFound ) { if ( _.isInteger( unitToDisable ) || _.isDate( unitToDisable ) || $.isArray( unitToDisable ) || ( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to ) ) { disabledItems.push( unitToDisable ) } } }) } // Return the updated collection. return disabledItems } //TimePicker.prototype.deactivate /** * Mark a collection of times as “enabled”. */ TimePicker.prototype.activate = function( type, timesToEnable ) { var clock = this, disabledItems = clock.item.disable, disabledItemsCount = disabledItems.length // If we’re flipping, that’s all we need to do. if ( timesToEnable == 'flip' ) { clock.flipEnable() } else if ( timesToEnable === true ) { clock.flipEnable(1) disabledItems = [] } else if ( timesToEnable === false ) { clock.flipEnable(-1) disabledItems = [] } // Otherwise go through the disabled times. else { timesToEnable.map(function( unitToEnable ) { var matchFound, disabledUnit, index, isRangeMatched // Go through the disabled items and try to find a match. for ( index = 0; index < disabledItemsCount; index += 1 ) { disabledUnit = disabledItems[index] // When an exact match is found, remove it from the collection. if ( clock.isTimeExact( disabledUnit, unitToEnable ) ) { matchFound = disabledItems[index] = null isRangeMatched = true break } // When an overlapped match is found, add the “inverted” state to it. else if ( clock.isTimeOverlap( disabledUnit, unitToEnable ) ) { if ( $.isPlainObject( unitToEnable ) ) { unitToEnable.inverted = true matchFound = unitToEnable } else if ( $.isArray( unitToEnable ) ) { matchFound = unitToEnable if ( !matchFound[2] ) matchFound.push( 'inverted' ) } else if ( _.isDate( unitToEnable ) ) { matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ] } break } } // If a match was found, remove a previous duplicate entry. if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) { if ( clock.isTimeExact( disabledItems[index], unitToEnable ) ) { disabledItems[index] = null break } } // In the event that we’re dealing with an overlap of range times, // make sure there are no “inverted” times because of it. if ( isRangeMatched ) for ( index = 0; index < disabledItemsCount; index += 1 ) { if ( clock.isTimeOverlap( disabledItems[index], unitToEnable ) ) { disabledItems[index] = null break } } // If something is still matched, add it into the collection. if ( matchFound ) { disabledItems.push( matchFound ) } }) } // Return the updated collection. return disabledItems.filter(function( val ) { return val != null }) } //TimePicker.prototype.activate /** * The division to use for the range intervals. */ TimePicker.prototype.i = function( type, value/*, options*/ ) { return _.isInteger( value ) && value > 0 ? value : this.item.interval } /** * Create a string for the nodes in the picker. */ TimePicker.prototype.nodes = function( isOpen ) { var clock = this, settings = clock.settings, selectedObject = clock.item.select, highlightedObject = clock.item.highlight, viewsetObject = clock.item.view, disabledCollection = clock.item.disable return _.node( 'ul', _.group({ min: clock.item.min.pick, max: clock.item.max.pick, i: clock.item.interval, node: 'li', item: function( loopedTime ) { loopedTime = clock.create( loopedTime ) var timeMinutes = loopedTime.pick, isSelected = selectedObject && selectedObject.pick == timeMinutes, isHighlighted = highlightedObject && highlightedObject.pick == timeMinutes, isDisabled = disabledCollection && clock.disabled( loopedTime ), formattedTime = _.trigger( clock.formats.toString, clock, [ settings.format, loopedTime ] ) return [ _.trigger( clock.formats.toString, clock, [ _.trigger( settings.formatLabel, clock, [ loopedTime ] ) || settings.format, loopedTime ] ), (function( klasses ) { if ( isSelected ) { klasses.push( settings.klass.selected ) } if ( isHighlighted ) { klasses.push( settings.klass.highlighted ) } if ( viewsetObject && viewsetObject.pick == timeMinutes ) { klasses.push( settings.klass.viewset ) } if ( isDisabled ) { klasses.push( settings.klass.disabled ) } return klasses.join( ' ' ) })( [ settings.klass.listItem ] ), 'data-pick=' + loopedTime.pick + ' ' + _.ariaAttr({ role: 'option', label: formattedTime, selected: isSelected && clock.$node.val() === formattedTime ? true : null, activedescendant: isHighlighted ? true : null, disabled: isDisabled ? true : null }) ] } }) + // * For Firefox forms to submit, make sure to set the button’s `type` attribute as “button”. _.node( 'li', _.node( 'button', settings.clear, settings.klass.buttonClear, 'type=button data-clear=1' + ( isOpen ? '' : ' disabled' ) + ' ' + _.ariaAttr({ controls: clock.$node[0].id }) ), '', _.ariaAttr({ role: 'presentation' }) ), settings.klass.list, _.ariaAttr({ role: 'listbox', controls: clock.$node[0].id }) ) } //TimePicker.prototype.nodes /** * Extend the picker to add the component with the defaults. */ TimePicker.defaults = (function( prefix ) { return { // Clear clear: 'Clear', // The format to show on the `input` element format: 'h:i A', // The interval between each time interval: 30, // Picker close behavior closeOnSelect: true, closeOnClear: true, // Classes klass: { picker: prefix + ' ' + prefix + '--time', holder: prefix + '__holder', list: prefix + '__list', listItem: prefix + '__list-item', disabled: prefix + '__list-item--disabled', selected: prefix + '__list-item--selected', highlighted: prefix + '__list-item--highlighted', viewset: prefix + '__list-item--viewset', now: prefix + '__list-item--now', buttonClear: prefix + '__button--clear' } } })( Picker.klasses().picker ) /** * Extend the picker to add the time picker. */ Picker.extend( 'pickatime', TimePicker ) })); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/pickadate/legacy.js?ver=5.4 /*jshint asi: true, unused: true, boss: true, loopfunc: true, eqnull: true */ /*! * Legacy browser support */ // Map array support if ( ![].map ) { Array.prototype.map = function ( callback, self ) { var array = this, len = array.length, newArray = new Array( len ) for ( var i = 0; i < len; i++ ) { if ( i in array ) { newArray[ i ] = callback.call( self, array[ i ], i, array ) } } return newArray } } // Filter array support if ( ![].filter ) { Array.prototype.filter = function( callback ) { if ( this == null ) throw new TypeError() var t = Object( this ), len = t.length >>> 0 if ( typeof callback != 'function' ) throw new TypeError() var newArray = [], thisp = arguments[ 1 ] for ( var i = 0; i < len; i++ ) { if ( i in t ) { var val = t[ i ] if ( callback.call( thisp, val, i, t ) ) newArray.push( val ) } } return newArray } } // Index of array support if ( ![].indexOf ) { Array.prototype.indexOf = function( searchElement ) { if ( this == null ) throw new TypeError() var t = Object( this ), len = t.length >>> 0 if ( len === 0 ) return -1 var n = 0 if ( arguments.length > 1 ) { n = Number( arguments[ 1 ] ) if ( n != n ) { n = 0 } else if ( n !== 0 && n != Infinity && n != -Infinity ) { n = ( n > 0 || -1 ) * Math.floor( Math.abs( n ) ) } } if ( n >= len ) return -1 var k = n >= 0 ? n : Math.max( len - Math.abs( n ), 0 ) for ( ; k < len; k++ ) { if ( k in t && t[ k ] === searchElement ) return k } return -1 } } /*! * Cross-Browser Split 1.1.1 * Copyright 2007-2012 Steven Levithan * Available under the MIT License * http://blog.stevenlevithan.com/archives/cross-browser-split */ var nativeSplit = String.prototype.split, compliantExecNpcg = /()??/.exec('')[1] === undefined String.prototype.split = function(separator, limit) { var str = this if (Object.prototype.toString.call(separator) !== '[object RegExp]') { return nativeSplit.call(str, separator, limit) } var output = [], flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.extended ? 'x' : '') + (separator.sticky ? 'y' : ''), lastLastIndex = 0, separator2, match, lastIndex, lastLength separator = new RegExp(separator.source, flags + 'g') str += '' if (!compliantExecNpcg) { separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags) } limit = limit === undefined ? -1 >>> 0 : limit >>> 0 while (match = separator.exec(str)) { lastIndex = match.index + match[0].length if (lastIndex > lastLastIndex) { output.push(str.slice(lastLastIndex, match.index)) if (!compliantExecNpcg && match.length > 1) { match[0].replace(separator2, function () { for (var i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) { match[i] = undefined } } }) } if (match.length > 1 && match.index < str.length) { Array.prototype.push.apply(output, match.slice(1)) } lastLength = match[0].length lastLastIndex = lastIndex if (output.length >= limit) { break } } if (separator.lastIndex === match.index) { separator.lastIndex++ } } if (lastLastIndex === str.length) { if (lastLength || !separator.test('')) { output.push('') } } else { output.push(str.slice(lastLastIndex)) } return output.length > limit ? output.slice(0, limit) : output }; // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-raty.min.js?ver=5.4 !function(t){"use strict";var a={init:function(e){return this.each(function(){this.self=t(this),a.destroy.call(this.self),this.opt=t.extend(!0,{},t.fn.um_raty.defaults,e),a._adjustCallback.call(this),a._adjustNumber.call(this),"img"!==this.opt.starType&&a._adjustStarType.call(this),a._adjustPath.call(this),a._createStars.call(this),this.opt.cancel&&a._createCancel.call(this),this.opt.precision&&a._adjustPrecision.call(this),a._createScore.call(this),a._apply.call(this,this.opt.score),a._target.call(this,this.opt.score),this.opt.readOnly?a._lock.call(this):(this.style.cursor="pointer",a._binds.call(this)),this.self.data("options",this.opt)})},_adjustCallback:function(){for(var t=["number","readOnly","score","scoreName","target"],a=0;a0&&this.score.val(a._between(t,0,this.opt.number)),a._roundStars.call(this,t))},_between:function(t,a,e){return Math.min(Math.max(parseFloat(t),a),e)},_binds:function(){this.cancel&&(a._bindOverCancel.call(this),a._bindClickCancel.call(this),a._bindOutCancel.call(this)),a._bindOver.call(this),a._bindClick.call(this),a._bindOut.call(this)},_bindClick:function(){var a=this;a.stars.on("click.um_raty",function(e){var s=t(this);a.score.val(a.opt.half||a.opt.precision?a.self.data("score"):this.alt||s.data("alt")),a.opt.click&&a.opt.click.call(a,+a.score.val(),e)})},_bindClickCancel:function(){var t=this;t.cancel.on("click.um_raty",function(a){t.score.removeAttr("value"),t.opt.click&&t.opt.click.call(t,null,a)})},_bindOut:function(){var t=this;t.self.on("mouseleave.um_raty",function(e){var s=+t.score.val()||void 0;a._apply.call(t,s),a._target.call(t,s,e),t.opt.mouseout&&t.opt.mouseout.call(t,s,e)})},_bindOutCancel:function(){var t=this;t.cancel.on("mouseleave.um_raty",function(e){var s=t.opt.cancelOff;if("img"!==t.opt.starType&&(s=t.opt.cancelClass+" "+s),a._setIcon.call(t,this,s),t.opt.mouseout){var i=+t.score.val()||void 0;t.opt.mouseout.call(t,i,e)}})},_bindOver:function(){var t=this,e=t.opt.half?"mousemove.um_raty":"mouseover.um_raty";t.stars.on(e,function(e){var s=a._getScoreByPosition.call(t,e,this);a._fill.call(t,s),t.opt.half&&(a._roundStars.call(t,s),t.self.data("score",s)),a._target.call(t,s,e),t.opt.mouseover&&t.opt.mouseover.call(t,s,e)})},_bindOverCancel:function(){var t=this;t.cancel.on("mouseover.um_raty",function(e){var s=t.opt.path+t.opt.starOff,i=t.opt.cancelOn;"img"===t.opt.starType?t.stars.attr("src",s):(i=t.opt.cancelClass+" "+i,t.stars.attr("class",s)),a._setIcon.call(t,this,i),a._target.call(t,null,e),t.opt.mouseover&&t.opt.mouseover.call(t,null)})},_buildScoreField:function(){return t("",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var a=this.opt.path+this.opt.cancelOff,e=t("<"+this.opt.starType+" />",{title:this.opt.cancelHint,class:this.opt.cancelClass});"img"===this.opt.starType?e.attr({src:a,alt:"x"}):e.attr("data-alt","x").addClass(a),"left"===this.opt.cancelPlace?this.self.prepend(" ").prepend(e):this.self.append(" ").append(e),this.cancel=e},_createScore:function(){var e=t(this.opt.targetScore);this.score=e.length?e:a._buildScoreField.call(this)},_createStars:function(){for(var e=1;e<=this.opt.number;e++){var s=a._nameForIndex.call(this,e),i={alt:e,src:this.opt.path+this.opt[s]};"img"!==this.opt.starType&&(i={"data-alt":e,class:i.src}),i.title=a._getHint.call(this,e),t("<"+this.opt.starType+" />",i).appendTo(this),this.opt.space&&this.self.append(ee){var n=this.opt.iconRange[e];i=a._getRangeIcon.call(this,n,r),s<=n.range&&a._setIcon.call(this,o,i),s===n.range&&e++}else i=this.opt[r?"starOn":"starOff"],a._setIcon.call(this,o,i)}},_getRangeIcon:function(t,a){return a?t.on||this.opt.starOn:t.off||this.opt.starOff},_getScoreByPosition:function(e,s){var i=parseInt(s.alt||s.getAttribute("data-alt"),10);if(this.opt.half){var o=a._getSize.call(this),r=parseFloat((e.pageX-t(s).offset().left)/o);i=this.opt.precision?i-1+r:i-1+(r>.5?1:.5)}return i},_getSize:function(){var t;return t="img"===this.opt.starType?this.stars[0].width:parseFloat(this.stars.eq(0).css("font-size")),t||a._error.call(this,"Could not be possible get the icon size!"),t},_turnOn:function(t,a){return this.opt.single?t===a:t<=a},_getHint:function(t){var a=this.opt.hints[t-1];return""===a?"":a||t},_lock:function(){var t=parseInt(this.score.val(),10),e=t?a._getHint.call(this,t):this.opt.noRatedMsg;this.style.cursor="",this.title=e,this.score.prop("readonly",!0),this.stars.prop("title",e),this.cancel&&this.cancel.hide(),this.self.data("readonly",!0)},_nameForIndex:function(t){return this.opt.score&&this.opt.score>=t?"starOn":"starOff"},_roundStars:function(t){var e=(t%1).toFixed(2);if(e>this.opt.round.down){var s="starOn";this.opt.halfShow&&e1?a:a[0]},move:function(e){return this.each(function(){var s=parseInt(e,10),i=t(this).data("options"),o=(+e).toFixed(1).split(".")[1];s>=i.number&&(s=i.number-1,o=10);var r=a._getSize.call(this),n=r/10,l=t(this.stars[s]),c=l.offset().left+n*parseInt(o,10),h=t.Event("mousemove",{pageX:c});l.trigger(h)})},readOnly:function(e){return this.each(function(){var s=t(this);s.data("readonly")!==e&&(e?(s.off(".um_raty").children("img").off(".um_raty"),a._lock.call(this)):(a._binds.call(this),a._unlock.call(this)),s.data("readonly",e))})},reload:function(){return a.set.call(this,{})},score:function(){var e=t(this);return arguments.length?a.setScore.apply(e,arguments):a.getScore.call(e)},set:function(a){return this.each(function(){var e=t(this),s=e.data("options"),i=t.extend({},s,a);e.um_raty(i)})},setScore:function(e){return this.each(function(){t(this).data("readonly")!==!0&&(a._apply.call(this,e),a._target.call(this,e))})}};t.fn.um_raty=function(e){return a[e]?a[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error("Method "+e+" does not exist!"):a.init.apply(this,arguments)},t.fn.um_raty.defaults={cancel:!1,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:void 0,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:void 0,targetFormat:"{score}",targetKeep:!1,targetScore:void 0,targetText:"",targetType:"hint"}}(jQuery); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-scrollto.min.js?ver=5.4 !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";function t(t){return!t.nodeName||e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!==-1}function o(t){return e.isFunction(t)||e.isPlainObject(t)?t:{top:t,left:t}}var n=e.scrollTo=function(t,o,n){return e(window).scrollTo(t,o,n)};return n.defaults={axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(r,i,s){"object"==typeof i&&(s=i,i=0),"function"==typeof s&&(s={onAfter:s}),"max"===r&&(r=9e9),s=e.extend({},n.defaults,s),i=i||s.duration;var a=s.queue&&s.axis.length>1;return a&&(i/=2),s.offset=o(s.offset),s.over=o(s.over),this.each(function(){function f(t){var o=e.extend({},s,{queue:!0,duration:i,complete:t&&function(){t.call(l,m,s)}});d.animate(p,o)}if(null!==r){var u,c=t(this),l=c?this.contentWindow||window:this,d=e(l),m=r,p={};switch(typeof m){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(m)){m=o(m);break}if(m=c?e(m):e(m,l),!m.length)return;case"object":(m.is||m.style)&&(u=(m=e(m)).offset())}var h=e.isFunction(s.offset)&&s.offset(l,m)||s.offset;e.each(s.axis.split(""),function(e,t){var o="x"===t?"Left":"Top",r=o.toLowerCase(),i="scroll"+o,x=d[i](),v=n.max(l,t);if(u)p[i]=u[r]+(c?0:x-d.offset()[r]),s.margin&&(p[i]-=parseInt(m.css("margin"+o),10)||0,p[i]-=parseInt(m.css("border"+o+"Width"),10)||0),p[i]+=h[r]||0,s.over[r]&&(p[i]+=m["x"===t?"width":"height"]()*s.over[r]);else{var w=m[r];p[i]=w.slice&&"%"===w.slice(-1)?parseFloat(w)/100*v:w}s.limit&&/^\d+$/.test(p[i])&&(p[i]=p[i]<=0?0:Math.min(p[i],v)),!e&&s.axis.length>1&&(x===p[i]?p={}:a&&(f(s.onAfterFirst),p={}))}),f(s.onAfter)}})},n.max=function(o,n){var r="x"===n?"Width":"Height",i="scroll"+r;if(!t(o))return o[i]-e(o)[r.toLowerCase()]();var s="client"+r,a=o.ownerDocument||o.document,f=a.documentElement,u=a.body;return Math.max(f[i],u[i])-Math.min(f[s],u[s])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var o=this.get(t);if(t.options.interrupt&&t._last&&t._last!==o)return e(t.elem).stop();var n=Math.round(t.now);o!==n&&(e(t.elem)[t.prop](n),t._last=this.get(t))}},n}); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-scrollbar.min.js?ver=5.4 !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var r=t||window.event,l=s.call(arguments,1),c=0,u=0,f=0,h=0,m=0,p=0;if(t=e.event.fix(r),t.type="mousewheel","detail"in r&&(f=-1*r.detail),"wheelDelta"in r&&(f=r.wheelDelta),"wheelDeltaY"in r&&(f=r.wheelDeltaY),"wheelDeltaX"in r&&(u=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(u=-1*f,f=0),c=0===f?u:f,"deltaY"in r&&(f=-1*r.deltaY,c=f),"deltaX"in r&&(u=r.deltaX,0===f&&(c=-1*u)),0!==f||0!==u){if(1===r.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,f*=g,u*=g}else if(2===r.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,f*=v,u*=v}if(h=Math.max(Math.abs(f),Math.abs(u)),(!i||i>h)&&(i=h,n(r,h)&&(i/=40)),n(r,h)&&(c/=40,u/=40,f/=40),c=Math[c>=1?"floor":"ceil"](c/i),u=Math[u>=1?"floor":"ceil"](u/i),f=Math[f>=1?"floor":"ceil"](f/i),d.settings.normalizeOffset&&this.getBoundingClientRect){var x=this.getBoundingClientRect();m=t.clientX-x.left,p=t.clientY-x.top}return t.deltaX=u,t.deltaY=f,t.deltaFactor=i,t.offsetX=m,t.offsetY=p,t.deltaMode=0,l.unshift(t,c,u,f),a&&clearTimeout(a),a=setTimeout(o,200),(e.event.dispatch||e.event.handle).apply(this,l)}}function o(){i=null}function n(e,t){return d.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var a,i,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],l="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],s=Array.prototype.slice;if(e.event.fixHooks)for(var c=r.length;c;)e.event.fixHooks[r[--c]]=e.event.mouseHooks;var d=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var o=l.length;o;)this.addEventListener(l[--o],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",d.getLineHeight(this)),e.data(this,"mousewheel-page-height",d.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var o=l.length;o;)this.removeEventListener(l[--o],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var o=e(t),n=o["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(o.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,n="undefined"!=typeof module&&module.exports,a="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";o||(n?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+a+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",n="mCS",a=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||a,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(n)){o.data(n,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null});var a=o.data(n),i=a.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),e("#mCSB_"+a.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var a=t||f.call(this);return e(a).each(function(){var t=e(this);if(t.data(n)){var a=t.data(n),i=a.opt,r=e("#mCSB_"+a.idx+"_container"),l=[e("#mCSB_"+a.idx+"_dragger_vertical"),e("#mCSB_"+a.idx+"_dragger_horizontal")];if(!r.length)return;a.tweenRunning&&V(t),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),S.call(this),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r.children())),a.overflowed=B.call(this),O.call(this),i.autoDraggerLength&&b.call(this),C.call(this),M.call(this);var s=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(a.overflowed[0]?l[0].height()>l[0].parent().height()?T.call(this):(Q(t,s[0].toString(),{dir:"y",dur:0,overwrite:"none"}),a.contentReset.y=null):(T.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&a.overflowed[1]&&Q(t,s[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(a.overflowed[1]?l[1].width()>l[1].parent().width()?T.call(this):(Q(t,s[1].toString(),{dir:"x",dur:0,overwrite:"none"}),a.contentReset.x=null):(T.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&a.overflowed[0]&&Q(t,s[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&a&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),F.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var a=f.call(this);return e(a).each(function(){var a=e(this);if(a.data(n)){var i=a.data(n),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=j.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=q.call(this,c[0],"y"),c[1]=q.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",Q(a,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",Q(a,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(n)&&V(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);o.data(n)&&(o.data(n),F.call(this,"remove"),k.call(this),t&&T.call(this),O.call(this,!0),o.addClass(d[3]))})},destroy:function(){var t=f.call(this);return e(t).each(function(){var a=e(this);if(a.data(n)){var i=a.data(n),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),F.call(this,"remove"),k.call(this),T.call(this),a.removeData(n),K(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),a.removeClass(o+" _"+n+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?a:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],n=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],a=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=!(e.inArray(t.theme,o)>-1)&&t.autoDraggerLength,t.autoExpandScrollbar=!(e.inArray(t.theme,n)>-1)&&t.autoExpandScrollbar,t.scrollButtons.enable=!(e.inArray(t.theme,a)>-1)&&t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1||t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),K(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),a=t.data(n),i=a.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["
","
"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"
":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===a.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===a.langDir?"989999px":i.setLeft,t.addClass(o+" _"+n+"_"+a.idx+f+h).wrapInner("
");var m=e("#mCSB_"+a.idx),p=e("#mCSB_"+a.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p.children())),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+a.idx+"_dragger_vertical"),e("#mCSB_"+a.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){return Math.max.apply(Math,t.map(function(){return e(this).outerWidth(!0)}).get())},_=function(){var t=e(this),o=t.data(n),a=o.opt,i=e("#mCSB_"+o.idx+"_container");a.advanced.autoExpandHorizontalScroll&&"y"!==a.axis&&i.css({position:"absolute",width:"auto"}).wrap("
").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),position:"relative"}).unwrap()},w=function(){var t=e(this),o=t.data(n),a=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=te(a.scrollButtons.tabindex)?"tabindex='"+a.scrollButtons.tabindex+"'":"",l=["","","",""],s=["x"===a.axis?l[2]:l[0],"x"===a.axis?l[3]:l[1],l[2],l[3]];a.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(n),a=e("#mCSB_"+o.idx),i=t.css("max-height")||"none",r=-1!==i.indexOf("%"),l=t.css("box-sizing");if("none"!==i){var s=r?t.parent().height()*parseInt(i)/100:parseInt(i);"border-box"===l&&(s-=t.innerHeight()-t.height()+(t.outerHeight()-t.innerHeight())),a.css("max-height",Math.round(s))}},b=function(){var t=e(this),o=t.data(n),a=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[a.height()/i.outerHeight(!1),a.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]a.height(),l>a.width()]},T=function(){var t=e(this),o=t.data(n),a=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(V(t),("x"!==a.axis&&!o.overflowed[0]||"y"===a.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),Q(t,"_resetY")),"y"!==a.axis&&!o.overflowed[1]||"x"===a.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),Q(t,"_resetX")}},M=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),L.call(o[0])):t()},100)}var o=e(this),a=o.data(n),i=a.opt;if(!a.bindEvents){if(D.call(this),i.contentTouchScroll&&R.call(this),E.call(this),i.mouseWheel.enable){var r;t()}P.call(this),H.call(this),i.advanced.autoScrollOnFocus&&z.call(this),i.scrollButtons.enable&&X.call(this),i.keyboard.enable&&Y.call(this),a.bindEvents=!0}},k=function(){var t=e(this),o=t.data(n),a=o.opt,i=n+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");a.advanced.releaseDraggableSelectors&&l.add(e(a.advanced.releaseDraggableSelectors)),o.bindEvents&&(e(document).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),K(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),K(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),K(s[0],"onCompleteTimeout"),o.bindEvents=!1)},O=function(t){var o=e(this),a=o.data(n),i=a.opt,r=e("#mCSB_"+a.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+a.idx+"_container"),s=[e("#mCSB_"+a.idx+"_scrollbar_vertical"),e("#mCSB_"+a.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(a.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(a.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),a.overflowed[0]||a.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},I=function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return e.target.ownerDocument!==document?[e.originalEvent.screenY,e.originalEvent.screenX,!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],n=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[o.screenY,o.screenX,n>1]:[o.pageY,o.pageX,n>1];default:return[e.pageY,e.pageX,!1]}},D=function(){function t(e){var t=m.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}}function o(e,t,o,n){if(m[0].idleTimer=u.scrollInertia<233?250:0,a.attr("id")===h[1])var i="x",r=(a[0].offsetLeft-t+n)*d.scrollRatio.x;else var i="y",r=(a[0].offsetTop-e+o)*d.scrollRatio.y;Q(l,r.toString(),{dir:i,drag:!0})}var a,i,r,l=e(this),d=l.data(n),u=d.opt,f=n+"_"+d.idx,h=["mCSB_"+d.idx+"_dragger_vertical","mCSB_"+d.idx+"_dragger_horizontal"],m=e("#mCSB_"+d.idx+"_container"),p=e("#"+h[0]+",#"+h[1]),g=u.advanced.releaseDraggableSelectors?p.add(e(u.advanced.releaseDraggableSelectors)):p;p.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(o){if(o.stopImmediatePropagation(),o.preventDefault(),$(o)){c=!0,s&&(document.onselectstart=function(){return!1}),t(!1),V(l),a=e(this);var n=a.offset(),d=I(o)[0]-n.top,f=I(o)[1]-n.left,h=a.height()+n.top,m=a.width()+n.left;h>d&&d>0&&m>f&&f>0&&(i=d,r=f),y(a,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=a.offset(),n=I(e)[0]-t.top,l=I(e)[1]-t.left;o(i,r,n,l)}),e(document).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(a){var t=a.offset(),n=I(e)[0]-t.top,l=I(e)[1]-t.left;if(i===n)return;o(i,r,n,l)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){a&&(y(a,"active",u.autoExpandScrollbar),a=null),c=!1,s&&(document.onselectstart=null),t(!0)})},R=function(){function o(e){if(!ee(e)||c||I(e)[2])return void(t=0);t=1,S=0,b=0;var o=k.offset();d=I(e)[0]-o.top,u=I(e)[1]-o.left,A=[I(e)[0],I(e)[1]]}function a(e){if(ee(e)&&!c&&!I(e)[2]&&(e.stopImmediatePropagation(),!b||S)){p=G();var t=M.offset(),o=I(e)[0]-t.top,n=I(e)[1]-t.left,a="mcsLinearOut";if(D.push(o),R.push(n),A[2]=Math.abs(I(e)[0]-A[0]),A[3]=Math.abs(I(e)[1]-A[1]),y.overflowed[0])var i=O[0].parent().height()-O[0].height(),r=d-o>0&&o-d>-(i*y.scrollRatio.y)&&(2*A[3]0&&n-u>-(l*y.scrollRatio.x)&&(2*A[2]30)){x=1e3/(g-m);var a="mcsEaseOut",i=2.5>x,r=i?[D[D.length-2],R[R.length-2]]:[0,0];v=i?[o-r[0],n-r[1]]:[o-f,n-h];var d=[Math.abs(v[0]),Math.abs(v[1])];x=i?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[x,x];var u=[Math.abs(k[0].offsetTop)-v[0]*l(d[0]/x[0],x[0]),Math.abs(k[0].offsetLeft)-v[1]*l(d[1]/x[1],x[1])];_="yx"===B.axis?[u[0],u[1]]:"x"===B.axis?[null,u[1]]:[u[0],null],w=[4*d[0]+B.scrollInertia,4*d[1]+B.scrollInertia];var C=parseInt(B.contentTouchScroll)||0;_[0]=d[0]>C?_[0]:0,_[1]=d[1]>C?_[1]:0,y.overflowed[0]&&s(_[0],w[0],a,"y",L,!1),y.overflowed[1]&&s(_[1],w[1],a,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,n,a,i){e&&Q(C,e.toString(),{dur:t,scrollEasing:o,dir:n,overwrite:a,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C=e(this),y=C.data(n),B=y.opt,T=n+"_"+y.idx,M=e("#mCSB_"+y.idx),k=e("#mCSB_"+y.idx+"_container"),O=[e("#mCSB_"+y.idx+"_dragger_vertical"),e("#mCSB_"+y.idx+"_dragger_horizontal")],D=[],R=[],E=0,L="yx"===B.axis?"none":"all",A=[],P=k.find("iframe"),z=["touchstart."+T+" pointerdown."+T+" MSPointerDown."+T,"touchmove."+T+" pointermove."+T+" MSPointerMove."+T,"touchend."+T+" pointerup."+T+" MSPointerUp."+T];k.bind(z[0],function(e){o(e)}).bind(z[1],function(e){a(e)}),M.bind(z[0],function(e){i(e)}).bind(z[2],function(e){r(e)}),P.length&&P.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(z[0],function(e){o(e),i(e)}).bind(z[1],function(e){a(e)}).bind(z[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function a(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,U(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(n),s=l.opt,d=l.sequential,u=n+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var n=f.offset(),r=I(e)[0]-n.top+f[0].offsetTop,c=I(e)[1]-n.left+f[0].offsetLeft;r>0&&r0&&cr?a("on",38):r>h.height()&&a("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?a("on",37):c>h.width()&&a("on",39)))}}).bind("mouseup."+u,function(){t||(i&&(i=0,a("off",null)),c=!1)})},L=function(){function t(t,n){if(V(o),!A(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100;if("x"===i.axis||"x"===i.mouseWheel.axis)var d="x",u=[Math.round(r*a.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],f="auto"!==i.mouseWheel.scrollAmount?u[1]:u[0]>=l.width()?.9*l.width():u[0],h=Math.abs(e("#mCSB_"+a.idx+"_container")[0].offsetLeft),m=c[1][0].offsetLeft,p=c[1].parent().width()-c[1].width(),g=t.deltaX||t.deltaY||n;else var d="y",u=[Math.round(r*a.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],f="auto"!==i.mouseWheel.scrollAmount?u[1]:u[0]>=l.height()?.9*l.height():u[0],h=Math.abs(e("#mCSB_"+a.idx+"_container")[0].offsetTop),m=c[0][0].offsetTop,p=c[0].parent().height()-c[0].height(),g=t.deltaY||n;"y"===d&&!a.overflowed[0]||"x"===d&&!a.overflowed[1]||(i.mouseWheel.invert&&(g=-g),i.mouseWheel.normalizeDelta&&(g=0>g?-1:1),(g>0&&0!==m||0>g&&m!==p||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),Q(o,(h-g*f).toString(),{dir:d}))}}var o=e(this),a=o.data(n),i=a.opt,r=n+"_"+a.idx,l=e("#mCSB_"+a.idx),c=[e("#mCSB_"+a.idx+"_dragger_vertical"),e("#mCSB_"+a.idx+"_dragger_horizontal")],d=e("#mCSB_"+a.idx+"_container").find("iframe");a&&(d.length&&d.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)}))},W=function(e){var t=null;try{var o=e.contentDocument||e.contentWindow.document;t=o.body.innerHTML}catch(e){}return null!==t},A=function(t,o){var a=o.nodeName.toLowerCase(),i=t.data(n).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(a,i)>-1&&!(e.inArray(a,r)>-1&&!e(o).is(":focus"))},P=function(){var t=e(this),o=t.data(n),a=n+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container"),r=i.parent(),l=e(".mCSB_"+o.idx+"_scrollbar ."+d[12]);l.bind("touchstart."+a+" pointerdown."+a+" MSPointerDown."+a,function(){c=!0}).bind("touchend."+a+" pointerup."+a+" MSPointerUp."+a,function(){c=!1}).bind("click."+a,function(n){if(e(n.target).hasClass(d[12])||e(n.target).hasClass("mCSB_draggerRail")){V(t);var a=e(this),l=a.find(".mCSB_dragger");if(a.parent(".mCSB_scrollTools_horizontal").length>0){if(!o.overflowed[1])return;var s="x",c=n.pageX>l.offset().left?-1:1,u=Math.abs(i[0].offsetLeft)-.9*c*r.width()}else{if(!o.overflowed[0])return;var s="y",c=n.pageY>l.offset().top?-1:1,u=Math.abs(i[0].offsetTop)-.9*c*r.height()}Q(t,u.toString(),{dir:s,scrollEasing:"mcsEaseInOut"})}})},z=function(){var t=e(this),o=t.data(n),a=o.opt,i=n+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),n=r.find(".mCustomScrollBox").length,i=0;o.is(a.advanced.autoScrollOnFocus)&&(V(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=n?(i+17)*n:0,t[0]._focusTimeout=setTimeout(function(){var e=[oe(o)[0],oe(o)[1]],n=[r[0].offsetTop,r[0].offsetLeft],s=[n[0]+e[0]>=0&&n[0]+e[0]=0&&n[0]+e[1]a");s.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(n){function r(e,o){i.scrollAmount=a.snapAmount||a.scrollButtons.scrollAmount,U(t,e,o)}if(n.preventDefault(),$(n)){var l=e(this).attr("class");switch(i.type=a.scrollButtons.scrollType,n.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},Y=function(){function t(t){function n(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.snapAmount||i.keyboard.scrollAmount,"stepped"===r.type&&a.tweenRunning||U(o,e,t)}switch(t.type){case"blur":a.tweenRunning&&r.dir&&n("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!a.overflowed[0]||(37===l||39===l)&&!a.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),n(s,l))}else if(33===l||34===l){if((a.overflowed[0]||a.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){V(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&a.overflowed[1]&&!a.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var h="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((a.overflowed[0]||a.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&a.overflowed[1]&&!a.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),a=o.data(n),i=a.opt,r=a.sequential,l=n+"_"+a.idx,s=e("#mCSB_"+a.idx),c=e("#mCSB_"+a.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},U=function(t,o,a,i,r){function l(e){var o="stepped"!==f.type,n=r?r:e?o?p/1.5:g:1e3/60,a=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],u="x"===f.dir[0]?s[1]+f.dir[1]*d[1]*a:s[0]+f.dir[1]*d[0]*a,m="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),v="auto"!==f.scrollAmount?m:u,x=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",_=!!e;return e&&17>n&&(v="x"===f.dir[0]?s[1]:s[0]),Q(t,v.toString(),{dir:f.dir[0],scrollEasing:x,dur:n,onComplete:_}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},n)))}function s(){clearTimeout(f.step),K(f,"step"),V(t)}var c=t.data(n),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[a===d[16]||a===d[15]||39===a||37===a?"x":"y",a===d[13]||a===d[15]||38===a||37===a?-1:1],V(t),te(a)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},j=function(t){var o=e(this).data(n).opt,a=[];return"function"==typeof t&&(t=t()),t instanceof Array?a=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(a[0]=t.y?t.y:t.x||"x"===o.axis?null:t,a[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof a[0]&&(a[0]=a[0]()),"function"==typeof a[1]&&(a[1]=a[1]()),a},q=function(t,o){if(null!=t&&"undefined"!=typeof t){var a=e(this),i=a.data(n),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1):l.outerHeight(!1),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?oe(m)[1]:oe(m)[0];case"string":case"number":if(te(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&te(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?oe(m)[1]:oe(m)[0]}return e(t).length?"x"===o?oe(e(t))[1]:oe(e(t))[0]:(l.css(h,t),void u.update.call(null,a[0]))}}},F=function(t){function o(){clearTimeout(h[0].autoUpdate),h[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(m=r(),m!==w)?(l(3),void(w=m)):(f.advanced.updateOnContentResize&&(p=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),_()[0],_()[1]], (p[0]!==S[0]||p[1]!==S[1]||p[2]!==S[2]||p[3]!==S[3]||p[4]!==S[4]||p[5]!==S[5])&&(l(p[0]!==S[0]||p[1]!==S[1]),S=p)),f.advanced.updateOnImageLoad&&(g=a(),g!==b&&(h.find("img").each(function(){i(this)}),b=g)),void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&o()))},60)}function a(){var e=0;return f.advanced.updateOnImageLoad&&(e=h.find("img").length),e}function i(t){function o(e,t){return function(){return t.apply(e,arguments)}}function n(){this.onload=null,e(t).addClass(d[2]),l(2)}if(e(t).hasClass(d[2]))return void l();var a=new Image;a.onload=o(a,n),a.src=t.src}function r(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var t=0,o=h.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&o.length>0&&o.each(function(){t+=e(this).height()+e(this).width()}),t}function l(e){clearTimeout(h[0].autoUpdate),u.update.call(null,s[0],e)}var s=e(this),c=s.data(n),f=c.opt,h=e("#mCSB_"+c.idx+"_container");if(t)return clearTimeout(h[0].autoUpdate),void K(h[0],"autoUpdate");var m,p,g,v=h.parent(),x=[e("#mCSB_"+c.idx+"_scrollbar_vertical"),e("#mCSB_"+c.idx+"_scrollbar_horizontal")],_=function(){return[x[0].is(":visible")?x[0].outerHeight(!0):0,x[1].is(":visible")?x[1].outerWidth(!0):0]},w=r(),S=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),_()[0],_()[1]],b=a();o()},N=function(e,t,o){return Math.round(e/t)*t-o},V=function(t){var o=t.data(n),a=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");a.each(function(){J.call(this)})},Q=function(t,o,a){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||_>=w[0]+b,c.callbacks.alwaysTriggerOffsets||-C>=_]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[v[0].offsetTop,v[0].offsetLeft],n=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(n[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(n[1])-i[1])),direction:a.dir}}var s=t.data(n),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},a=e.extend(d,a),u=[a.dur,a.drag?0:a.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?j.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?j.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=a.trigger,(0!==m.scrollTop()||0!==m.scrollLeft())&&(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){switch(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount&&(o=N(o,c.snapAmount,c.snapOffset)),a.dir){case"x":var v=e("#mCSB_"+s.idx+"_dragger_horizontal"),x="left",_=h[0].offsetLeft,w=[f.width()-h.outerWidth(!1),v.parent().width()-v.width()],S=[o,0===o?0:o/s.scrollRatio.x],b=p[1],C=g[1],B=b>0?b/s.scrollRatio.x:0,T=C>0?C/s.scrollRatio.x:0;break;case"y":var v=e("#mCSB_"+s.idx+"_dragger_vertical"),x="top",_=h[0].offsetTop,w=[f.height()-h.outerHeight(!1),v.parent().height()-v.height()],S=[o,0===o?0:o/s.scrollRatio.y],b=p[0],C=g[0],B=b>0?b/s.scrollRatio.y:0,T=C>0?C/s.scrollRatio.y:0}S[1]<0||0===S[0]&&0===S[1]?S=[0,0]:S[1]>=w[1]?S=[w[0],w[1]]:S[0]=-S[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),(s.tweenRunning||!(0===_&&S[0]>=0||_===w[0]&&S[0]<=w[0]))&&(Z(v[0],x,Math.round(S[1]),u[1],a.scrollEasing),Z(h[0],x,Math.round(S[0]),u[0],a.scrollEasing,a.overwrite,{onStart:function(){a.callbacks&&a.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,y(v),s.cbOffsets=r())},onUpdate:function(){a.callbacks&&a.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(a.callbacks&&a.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&S[1]>=w[1]-B&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&S[1]<=T&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,y(v,"hide")},e)}}}))}},Z=function(e,t,o,n,a,i,r){function l(){S.stop||(x||m.call(),x=G()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time0?(S.currVal=u(S.time,_,b,n,a),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,n,a){switch(a){case"linear":case"mcsLinear":return o*e/n+t;case"mcsLinearOut":return e/=n,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=n/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=n/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=n/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=n,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/n)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=n)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=G(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},G=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},J=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o=0&&n[0]+oe(a)[0]=0&&n[1]+oe(a)[1] https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-crop.min.js?ver=5.4 !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){"use strict";var i=t(window),e=t(document),h=window.location,a=!0,s=!1,r=null,n=NaN,o=1/0,d="undefined",g="directive",l=".cropper",p=/^(e|n|w|s|ne|nw|sw|se|all|crop|move|zoom)$/,c=/^(x|y|width|height)$/,f=/^(naturalWidth|naturalHeight|width|height|aspectRatio|ratio|rotate)$/,m="cropper-modal",u="cropper-hidden",w="cropper-invisible",v="cropper-move",x="cropper-crop",b="cropper-disabled",y="mousedown touchstart",$="mousemove touchmove",D="mouseup mouseleave touchend touchleave touchcancel",W="wheel mousewheel DOMMouseScroll",H="resize"+l,C="dblclick",k="build"+l,R="built"+l,z="dragstart"+l,L="dragmove"+l,Y="dragend"+l,X=function(t){return"number"==typeof t},M=function(t,i){var e=[];return"number"==typeof i&&e.push(i),e.slice.apply(t,e)},T=function(t,i){var e=M(arguments,2);return function(){return t.apply(i,e.concat(M(arguments)))}},I=function(i,e){this.element=i,this.$element=t(i),this.defaults=t.extend({},I.DEFAULTS,t.isPlainObject(e)?e:{}),this.$original=r,this.ready=s,this.built=s,this.cropped=s,this.rotated=s,this.disabled=s,this.replaced=s,this.init()},E=Math.sqrt,_=Math.min,P=Math.max,O=Math.abs,U=Math.sin,j=Math.cos,A=parseFloat;I.prototype={constructor:I,support:{canvas:t.isFunction(t("")[0].getContext)},init:function(){var i=this.defaults;t.each(i,function(t,e){switch(t){case"aspectRatio":i[t]=O(A(e))||n;break;case"autoCropArea":i[t]=O(A(e))||.8;break;case"minWidth":case"minHeight":i[t]=O(A(e))||0;break;case"maxWidth":case"maxHeight":i[t]=O(A(e))||o}}),this.image={rotate:0},this.load()},load:function(){var i,e,h=this,s=this.$element,r=this.element,n=this.image,o="";s.is("img")?e=s.prop("src"):s.is("canvas")&&this.support.canvas&&(e=r.toDataURL()),e&&(this.replaced&&(n.rotate=0),this.defaults.checkImageOrigin&&(s.prop("crossOrigin")||this.isCrossOriginURL(e))&&(o=" crossOrigin"),this.$clone=i=t("'),i.one("load",function(){n.naturalWidth=this.naturalWidth||i.width(),n.naturalHeight=this.naturalHeight||i.height(),n.aspectRatio=n.naturalWidth/n.naturalHeight,h.url=e,h.ready=a,h.build()}),i.addClass(w).prependTo("body"))},isCrossOriginURL:function(t){var i=t.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return!i||i[1]===h.protocol&&i[2]===h.hostname&&i[3]===h.port?s:a},build:function(){var i,e,h=this.$element,r=this.defaults;this.ready&&(this.built&&this.unbuild(),h.one(k,r.build),i=t.Event(k),h.trigger(i),i.isDefaultPrevented()||(this.$cropper=e=t(I.TEMPLATE),h.addClass(u),this.$clone.removeClass(w).prependTo(e),this.rotated||(this.$original=this.$clone.clone(),this.$original.addClass(u).prependTo(this.$cropper),this.originalImage=t.extend({},this.image)),this.$container=h.parent(),this.$container.append(e),this.$canvas=e.find(".cropper-canvas"),this.$dragger=e.find(".cropper-dragger"),this.$viewer=e.find(".cropper-viewer"),r.autoCrop?this.cropped=a:this.$dragger.addClass(u),r.dragCrop&&this.setDragMode("crop"),r.modal&&this.$canvas.addClass(m),!r.dashed&&this.$dragger.find(".cropper-dashed").addClass(u),!r.movable&&this.$dragger.find(".cropper-face").data(g,"move"),!r.resizable&&this.$dragger.find(".cropper-line, .cropper-point").addClass(u),this.addListeners(),this.initPreview(),this.built=a,this.update(),this.replaced=s,h.one(R,r.built),h.trigger(R)))},unbuild:function(){this.built&&(this.built=s,this.removeListeners(),this.$preview.empty(),this.$preview=r,this.$dragger=r,this.$canvas=r,this.$container=r,this.$cropper.remove(),this.$cropper=r)},update:function(t){this.initContainer(),this.initCropper(),this.initImage(),this.initDragger(),t?(this.setData(t,a),this.setDragMode("crop")):this.setData(this.defaults.data)},resize:function(){clearTimeout(this.resizing),this.resizing=setTimeout(t.proxy(this.update,this,this.getData()),200)},preview:function(){var i=this.image,e=this.dragger,h=i.width,a=i.height,s=e.left-i.left,r=e.top-i.top;this.$viewer.find("img").css({width:h,height:a,marginLeft:-s,marginTop:-r}),this.$preview.each(function(){var i=t(this),n=i.width()/e.width;i.find("img").css({width:h*n,height:a*n,marginLeft:-s*n,marginTop:-r*n})})},addListeners:function(){var h=this.defaults;this.$element.on(z,h.dragstart).on(L,h.dragmove).on(Y,h.dragend),this.$cropper.on(y,t.proxy(this.dragstart,this)).on(C,t.proxy(this.dblclick,this)),h.zoomable&&this.$cropper.on(W,t.proxy(this.wheel,this)),h.multiple?this.$cropper.on($,t.proxy(this.dragmove,this)).on(D,t.proxy(this.dragend,this)):e.on($,this._dragmove=T(this.dragmove,this)).on(D,this._dragend=T(this.dragend,this)),i.on(H,this._resize=T(this.resize,this))},removeListeners:function(){var t=this.defaults;this.$element.off(z,t.dragstart).off(L,t.dragmove).off(Y,t.dragend),this.$cropper.off(y,this.dragstart).off(C,this.dblclick),t.zoomable&&this.$cropper.off(W,this.wheel),t.multiple?this.$cropper.off($,this.dragmove).off(D,this.dragend):e.off($,this._dragmove).off(D,this._dragend),i.off(H,this._resize)},initPreview:function(){var i='';this.$preview=t(this.defaults.preview),this.$viewer.html(i),this.$preview.html(i).find("img").css("cssText","min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;")},initContainer:function(){var t=this.$container;t!==r&&(this.container={width:P(t.width(),300),height:P(t.height(),150)})},initCropper:function(){var t,i=this.container,e=this.image;e.naturalWidth*i.height/e.naturalHeight-i.width>=0?(t={width:i.width,height:i.width/e.aspectRatio,left:0},t.top=(i.height-t.height)/2):(t={width:i.height*e.aspectRatio,height:i.height,top:0},t.left=(i.width-t.width)/2),this.$cropper&&this.$cropper.css({width:t.width,height:t.height,left:t.left,top:t.top}),this.cropper=t},initImage:function(){var i=this.image,e=this.cropper,h={_width:e.width,_height:e.height,width:e.width,height:e.height,left:0,top:0,ratio:e.width/i.naturalWidth};this.defaultImage=t.extend({},i,h),i._width!==e.width||i._height!==e.height?t.extend(i,h):(i=t.extend({},h,i),this.replaced&&(i.ratio=h.ratio)),this.image=i,this.renderImage()},renderImage:function(t){var i=this.image;"zoom"===t&&(i.left-=(i.width-i.oldWidth)/2,i.top-=(i.height-i.oldHeight)/2),i.left=_(P(i.left,i._width-i.width),0),i.top=_(P(i.top,i._height-i.height),0),this.$clone.css({width:i.width,height:i.height,marginLeft:i.left,marginTop:i.top}),t&&(this.defaults.done(this.getData()),this.preview())},initDragger:function(){var i,e=this.defaults,h=this.cropper,a=e.aspectRatio||this.image.aspectRatio,s=this.image.ratio;i=h.height*a-h.width>=0?{height:h.width/a,width:h.width,left:0,top:(h.height-h.width/a)/2,maxWidth:h.width,maxHeight:h.width/a}:{height:h.height,width:h.height*a,left:(h.width-h.height*a)/2,top:0,maxWidth:h.height*a,maxHeight:h.height},i.minWidth=0,i.minHeight=0,e.aspectRatio?(isFinite(e.maxWidth)?(i.maxWidth=_(i.maxWidth,e.maxWidth*s),i.maxHeight=i.maxWidth/a):isFinite(e.maxHeight)&&(i.maxHeight=_(i.maxHeight,e.maxHeight*s),i.maxWidth=i.maxHeight*a),e.minWidth>0?(i.minWidth=P(0,e.minWidth*s),i.minHeight=i.minWidth/a):e.minHeight>0&&(i.minHeight=P(0,e.minHeight*s),i.minWidth=i.minHeight*a)):(i.maxWidth=_(i.maxWidth,e.maxWidth*s),i.maxHeight=_(i.maxHeight,e.maxHeight*s),i.minWidth=P(0,e.minWidth*s),i.minHeight=P(0,e.minHeight*s)),i.minWidth=_(i.maxWidth,i.minWidth),i.minHeight=_(i.maxHeight,i.minHeight),i.height*=e.autoCropArea,i.width*=e.autoCropArea,i.left=(h.width-i.width)/2,i.top=(h.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.defaultDragger=i,this.dragger=t.extend({},i)},renderDragger:function(){var t=this.dragger,i=this.cropper;t.width>t.maxWidth?(t.width=t.maxWidth,t.left=t.oldLeft):t.widtht.maxHeight?(t.height=t.maxHeight,t.top=t.oldTop):t.height').one("load",function(){o.width=this.width,o.height=this.height,h.clearRect(0,0,o.width,o.height),h.drawImage(this,0,0),r.load()})))},setData:function(i,e){var h=this.cropper,a=this.dragger,s=this.image,n=this.defaults.aspectRatio;this.built&&typeof i!==d&&((i===r||t.isEmptyObject(i))&&(a=t.extend({},this.defaultDragger)),t.isPlainObject(i)&&!t.isEmptyObject(i)&&(e||(this.defaults.data=i),i=this.transformData(i),X(i.x)&&i.x<=h.width-s.left&&(a.left=i.x+s.left),X(i.y)&&i.y<=h.height-s.top&&(a.top=i.y+s.top),n?X(i.width)&&i.width<=a.maxWidth&&i.width>=a.minWidth?(a.width=i.width,a.height=a.width/n):X(i.height)&&i.height<=a.maxHeight&&i.height>=a.minHeight&&(a.height=i.height,a.width=a.height*n):(X(i.width)&&i.width<=a.maxWidth&&i.width>=a.minWidth&&(a.width=i.width),X(i.height)&&i.height<=a.maxHeight&&i.height>=a.minHeight&&(a.height=i.height))),this.dragger=a,this.renderDragger())},getData:function(t){var i=this.dragger,e=this.image,h={};return this.built&&(h={x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height},h=this.transformData(h,a,t)),h},transformData:function(i,e,h){var a=this.image.ratio,s={};return t.each(i,function(t,i){i=A(i),c.test(t)&&!isNaN(i)&&(s[t]=e?h?Math.round(i/a):i/a:i*a)}),s},setAspectRatio:function(t){var i="auto"===t;t=A(t),(i||!isNaN(t)&&t>0)&&(this.defaults.aspectRatio=i?n:t,this.built&&(this.initDragger(),this.renderDragger()))},getImageData:function(){var i={};return this.ready&&t.each(this.image,function(t,e){f.test(t)&&(i[t]=e)}),i},getDataURL:function(i,e,h){var a,s=t("")[0],r=this.getData(),n="";return t.isPlainObject(i)||(h=e,e=i,i={}),i=t.extend({width:r.width,height:r.height},i),this.cropped&&this.support.canvas&&(s.width=i.width,s.height=i.height,a=s.getContext("2d"),"image/jpeg"===e&&(a.fillStyle="#fff",a.fillRect(0,0,i.width,i.height)),a.drawImage(this.$clone[0],r.x,r.y,r.width,r.height,0,0,i.width,i.height),n=s.toDataURL(e,h)),n},setDragMode:function(t){var i=this.$canvas,e=this.defaults,h=s,r=s;if(this.built&&!this.disabled){switch(t){case"crop":e.dragCrop&&(h=a,i.data(g,t));break;case"move":r=a,i.data(g,t);break;default:i.removeData(g)}i.toggleClass(x,h).toggleClass(v,r)}},enable:function(){this.built&&(this.disabled=s,this.$cropper.removeClass(b))},disable:function(){this.built&&(this.disabled=a,this.$cropper.addClass(b))},rotate:function(t){var i=this.image;t=A(t)||0,this.built&&0!==t&&!this.disabled&&this.defaults.rotatable&&this.support.canvas&&(this.rotated=a,t=i.rotate=(i.rotate+t)%360,this.replace(this.getRotatedDataURL(t),!0))},getRotatedDataURL:function(i){var e=t("")[0],h=e.getContext("2d"),a=i*Math.PI/180,s=O(i)%180,r=s>90?180-s:s,n=r*Math.PI/180,o=this.originalImage,d=o.naturalWidth,g=o.naturalHeight,l=O(d*j(n)+g*U(n)),p=O(d*U(n)+g*j(n));return e.width=l,e.height=p,h.save(),h.translate(l/2,p/2),h.rotate(a),h.drawImage(this.$original[0],-d/2,-g/2,d,g),h.restore(),e.toDataURL()},zoom:function(t){var i,e,h,a=this.image;t=A(t),this.built&&t&&!this.disabled&&this.defaults.zoomable&&(i=a.width*(1+t),e=a.height*(1+t),h=i/a._width,h>10||(h<1&&(i=a._width,e=a._height),h<=1?this.setDragMode("crop"):this.setDragMode("move"),a.oldWidth=a.width,a.oldHeight=a.height,a.width=i,a.height=e,a.ratio=a.width/a.naturalWidth,this.renderImage("zoom")))},dblclick:function(){this.disabled||(this.$canvas.hasClass(x)?this.setDragMode("move"):this.setDragMode("crop"))},wheel:function(t){var i,e=t.originalEvent,h=117.25,a=5,s=166.66665649414062,r=.1;this.disabled||(t.preventDefault(),e.deltaY?(i=e.deltaY,i=i%a===0?i/a:i%h===0?i/h:i/s):i=e.wheelDelta?-e.wheelDelta/120:e.detail?e.detail/3:0,this.zoom(i*r))},dragstart:function(i){var e,h,r,n=i.originalEvent.touches,o=i;if(!this.disabled){if(n){if(r=n.length,r>1){if(!this.defaults.zoomable||2!==r)return;o=n[1],this.startX2=o.pageX,this.startY2=o.pageY,e="zoom"}o=n[0]}if(e=e||t(o.target).data(g),p.test(e)){if(i.preventDefault(),h=t.Event(z),this.$element.trigger(h),h.isDefaultPrevented())return;this.directive=e,this.cropping=s,this.startX=o.pageX,this.startY=o.pageY,"crop"===e&&(this.cropping=a,this.$canvas.addClass(m))}}},dragmove:function(i){var e,h,a=i.originalEvent.touches,s=i;if(!this.disabled){if(a){if(h=a.length,h>1){if(!this.defaults.zoomable||2!==h)return;s=a[1],this.endX2=s.pageX,this.endY2=s.pageY}s=a[0]}if(this.directive){if(i.preventDefault(),e=t.Event(L),this.$element.trigger(e),e.isDefaultPrevented())return;this.endX=s.pageX,this.endY=s.pageY,this.dragging()}}},dragend:function(i){var e;if(!this.disabled&&this.directive){if(i.preventDefault(),e=t.Event(Y),this.$element.trigger(e),e.isDefaultPrevented())return;this.cropping&&(this.cropping=s,this.$canvas.toggleClass(m,this.cropped&&this.defaults.modal)),this.directive=""}},dragging:function(){var t,i=this.directive,e=this.image,h=this.cropper,r=h.width,n=h.height,o=this.dragger,d=o.width,g=o.height,l=o.left,p=o.top,c=l+d,f=p+g,m=a,w=this.defaults,v=w.aspectRatio,x={x:this.endX-this.startX,y:this.endY-this.startY};switch(v&&(x.X=x.y*v,x.Y=x.x/v),i){case"all":l+=x.x,p+=x.y;break;case"e":if(x.x>=0&&(c>=r||v&&(p<=0||f>=n))){m=s;break}d+=x.x,v&&(g=d/v,p-=x.Y/2),d<0&&(i="w",d=0);break;case"n":if(x.y<=0&&(p<=0||v&&(l<=0||c>=r))){m=s;break}g-=x.y,p+=x.y,v&&(d=g*v,l+=x.X/2),g<0&&(i="s",g=0);break;case"w":if(x.x<=0&&(l<=0||v&&(p<=0||f>=n))){m=s;break}d-=x.x,l+=x.x,v&&(g=d/v,p+=x.Y/2),d<0&&(i="e",d=0);break;case"s":if(x.y>=0&&(f>=n||v&&(l<=0||c>=r))){m=s;break}g+=x.y,v&&(d=g*v,l-=x.X/2),g<0&&(i="n",g=0);break;case"ne":if(v){if(x.y<=0&&(p<=0||c>=r)){m=s;break}g-=x.y,p+=x.y,d=g*v}else x.x>=0?c0&&(g-=x.y,p+=x.y):(g-=x.y,p+=x.y);g<0&&(i="sw",g=0,d=0);break;case"nw":if(v){if(x.y<=0&&(p<=0||l<=0)){m=s;break}g-=x.y,p+=x.y,d=g*v,l+=x.X}else x.x<=0?l>0?(d-=x.x,l+=x.x):x.y<=0&&p<=0&&(m=s):(d-=x.x,l+=x.x),x.y<=0?p>0&&(g-=x.y,p+=x.y):(g-=x.y,p+=x.y);g<0&&(i="se",g=0,d=0);break;case"sw":if(v){if(x.x<=0&&(l<=0||f>=n)){m=s;break}d-=x.x,l+=x.x,g=d/v}else x.x<=0?l>0?(d-=x.x,l+=x.x):x.y>=0&&f>=n&&(m=s):(d-=x.x,l+=x.x),x.y>=0?f=0&&(c>=r||f>=n)){m=s;break}d+=x.x,g=d/v}else x.x>=0?c=0&&f>=n&&(m=s):d+=x.x,x.y>=0?f0?x.y>0?i="se":(i="ne",p-=g):x.y>0?(i="sw",l-=d):(i="nw",l-=d,p-=g),this.cropped||(this.cropped=a,this.$dragger.removeClass(u)))}m&&(o.width=d,o.height=g,o.left=l,o.top=p,this.directive=i,this.renderDragger()),this.startX=this.endX,this.startY=this.endY}},I.TEMPLATE=function(t,i){return i=i.split(","),t.replace(/\d+/g,function(t){return i[t]})}('<0 6="5-container"><0 6="5-canvas"><0 6="5-dragger"><1 6="5-viewer"><1 6="5-8 8-h"><1 6="5-8 8-v"><1 6="5-face" 3-2="all"><1 6="5-7 7-e" 3-2="e"><1 6="5-7 7-n" 3-2="n"><1 6="5-7 7-w" 3-2="w"><1 6="5-7 7-s" 3-2="s"><1 6="5-4 4-e" 3-2="e"><1 6="5-4 4-n" 3-2="n"><1 6="5-4 4-w" 3-2="w"><1 6="5-4 4-s" 3-2="s"><1 6="5-4 4-ne" 3-2="ne"><1 6="5-4 4-nw" 3-2="nw"><1 6="5-4 4-sw" 3-2="sw"><1 6="5-4 4-se" 3-2="se">',"div,span,directive,data,point,cropper,class,line,dashed"),I.DEFAULTS={aspectRatio:"auto",autoCropArea:.8,data:{},done:t.noop,preview:"",multiple:s,autoCrop:a,dragCrop:a,dashed:a,modal:a,movable:a,resizable:a,zoomable:a,rotatable:a,checkImageOrigin:a,minWidth:0,minHeight:0,maxWidth:o,maxHeight:o,build:r,built:r,dragstart:r,dragmove:r,dragend:r},I.setDefaults=function(i){t.extend(I.DEFAULTS,i)},I.other=t.fn.cropper,t.fn.cropper=function(i){var e,h=M(arguments,1);return this.each(function(){var a,s=t(this),r=s.data("cropper");r||s.data("cropper",r=new I(this,i)),"string"==typeof i&&t.isFunction(a=r[i])&&(e=a.apply(r,h))}),typeof e!==d?e:this},t.fn.cropper.Constructor=I,t.fn.cropper.setDefaults=I.setDefaults,t.fn.cropper.noConflict=function(){return t.fn.cropper=I.other,this}}); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-tipsy.min.js?ver=5.4 !function(t){function e(t,e){return"function"==typeof t?t.call(e):t}function i(t){for(;t=t.parentNode;)if(t==document)return!0;return!1}function s(e,i){this.$element=t(e),this.options=i,this.enabled=!0,this.fixTitle()}s.prototype={show:function(){var i=this.getTitle();if(i&&this.enabled){var s=this.tip();s.find(".tipsy-inner")[this.options.html?"html":"text"](i),s[0].className="tipsy",s.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var n,o=t.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),a=s[0].offsetWidth,l=s[0].offsetHeight,f=e(this.options.gravity,this.$element[0]);switch(f.charAt(0)){case"n":n={top:o.top+o.height+this.options.offset,left:o.left+o.width/2-a/2};break;case"s":n={top:o.top-l-this.options.offset,left:o.left+o.width/2-a/2};break;case"e":n={top:o.top+o.height/2-l/2,left:o.left-a-this.options.offset};break;case"w":extra_gap=0,t("body").css("position").length>0&&"relative"==t("body").css("position")&&t("#wpadminbar").length&&(extra_gap=t("#wpadminbar").height()),n={top:o.top+o.height/2-l/2-extra_gap,left:o.left+o.width+this.options.offset}}2==f.length&&("w"==f.charAt(1)?n.left=o.left+o.width/2-15:n.left=o.left+o.width/2-a+15),s.css(n).addClass("tipsy-"+f),s.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+f.charAt(0),this.options.className&&s.addClass(e(this.options.className,this.$element[0])),this.options.fade?s.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):s.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){t(this).remove()}):this.tip().remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("original-title"))&&t.attr("original-title",t.attr("title")||"").removeAttr("title")},getTitle:function(){var t,e=this.$element,i=this.options;this.fixTitle();var t,i=this.options;return"string"==typeof i.title?t=e.attr("title"==i.title?"original-title":i.title):"function"==typeof i.title&&(t=i.title.call(e[0])),t=(""+t).replace(/(^\s*|\s*$)/,""),t||i.fallback},tip:function(){return this.$tip||(this.$tip=t('
').html('
'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},t.fn.tipsy=function(e){function i(i){var n=t.data(i,"tipsy");return n||(n=new s(i,t.fn.tipsy.elementOptions(i,e)),t.data(i,"tipsy",n)),n}function n(){var t=i(this);t.hoverState="in",0==e.delayIn?t.show():(t.fixTitle(),setTimeout(function(){"in"==t.hoverState&&t.show()},e.delayIn))}function o(){var t=i(this);t.hoverState="out",0==e.delayOut?t.hide():setTimeout(function(){"out"==t.hoverState&&t.hide()},e.delayOut)}if(e===!0)return this.data("tipsy");if("string"==typeof e){var a=this.data("tipsy");return a&&a[e](),this}if(e=t.extend({},t.fn.tipsy.defaults,e),e.live||this.each(function(){i(this)}),"manual"!=e.trigger){var l="hover"==e.trigger?"mouseenter":"focus",f="hover"==e.trigger?"mouseleave":"blur";e.live?t(document).on(l,this.selector,n).on(f,this.selector,o):this.bind(l,n).bind(f,o)}return this},t.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},t.fn.tipsy.revalidate=function(){t(".tipsy").each(function(){var e=t.data(this,"tipsy-pointee");e&&i(e)||t(this).remove()})},t.fn.tipsy.elementOptions=function(e,i){return t.metadata?t.extend({},i,t(e).metadata()):i},t.fn.tipsy.autoNS=function(){return t(this).offset().top>t(document).scrollTop()+t(window).height()/2?"s":"n"},t.fn.tipsy.autoWE=function(){return t(this).offset().left>t(document).scrollLeft()+t(window).width()/2?"e":"w"},t.fn.tipsy.autoBounds=function(e,i){return function(){var s={ns:i[0],ew:i.length>1&&i[1]},n=t(document).scrollTop()+e,o=t(document).scrollLeft()+e,a=t(this);return a.offset().top https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-functions.min.js?ver=5.4 function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),a=jQuery("input[data-key=confirm_user_password]").val(),o=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||a?t!==a?o.removeClass("um-validate-matched").addClass("um-validate-not-matched"):o.removeClass("um-validate-not-matched").addClass("um-validate-matched"):o.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function UM_hide_menus(){menu=jQuery(".um-dropdown"),menu.parents("div").find("a").removeClass("active"),menu.hide()}function UM_domenus(){jQuery(".um-dropdown").each(function(){var e=jQuery(this),t=jQuery(this).attr("data-element"),a=jQuery(this).attr("data-position");jQuery(t).addClass("um-trigger-menu-on-"+e.attr("data-trigger")),jQuery(window).width()<=1200&&"div.um-profile-edit"==t&&(a="lc"),"lc"==a&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),gap_right=jQuery(t).width()+17,e.css({top:0,width:200,left:"auto",right:gap_right+"px","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-right-b"),e.find(".um-dropdown-arr").css({top:"4px",left:"auto",right:"-17px"})),"bc"==a&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),e.css({top:top_p,width:200,left:left_p+left_gap,right:"auto","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-up-b"),e.find(".um-dropdown-arr").css({top:"-17px",left:e.width()/2-12,right:"auto"}))})}function um_responsive(){jQuery(".um").each(function(){element_width=jQuery(this).width(),element_width<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):element_width>960&&(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960")),jQuery(".um-account-nav").length>0&&jQuery(".um-account-side").is(":visible")&&0==jQuery(".um-account-tab:visible").length&&jQuery(".um-account-side li a.current").trigger("click"),jQuery(this).css("opacity",1)}),jQuery(".um-cover, .um-member-cover, .um-cover-e").each(function(){var e=jQuery(this),t=e.data("ratio"),a=e.width(),o=t.split(":");calcHeight=Math.round(a/o[0])+"px",e.height(calcHeight),e.find(".um-cover-add").height(calcHeight)}),jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),UM_domenus()}function UM_Member_Grid(e){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"})}function initImageUpload_UM(e){e.data("upload_help_text")?upload_help_text=''+e.data("upload_help_text")+"":upload_help_text="",e.data("icon")?icon='':icon="",e.data("upload_text")?upload_text=''+e.data("upload_text")+"":upload_text="";var t=0;jQuery("#um_upload_single:visible").data("user_id")&&(t=jQuery("#um_upload_single:visible").data("user_id")),e.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode"),_wpnonce:e.data("nonce"),timestamp:e.data("timestamp"),user_id:t},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,a,o){e.selectedFiles=0,a.success&&0==a.success||"undefined"!=typeof a.data.error?(e.parents(".um-modal-body").append('
'+a.data.error+"
"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(a.data,function(t,a){var o=e.parents(".um-modal-body").find(".um-single-image-preview img"),i=e.parents(".um-modal-body").find(".um-single-image-preview"),r=new Date;o.attr("src",a.url+"?"+r.getTime()),o.data("file",a.file),o.load(function(){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),i.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(e){e.data("upload_help_text")?upload_help_text=''+e.data("upload_help_text")+"":upload_help_text="",e.data("icon")?icon='':icon="",e.data("upload_text")?upload_text=''+e.data("upload_text")+"":upload_text="",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),e.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:e.data("key"),set_id:e.data("set_id"),user_id:e.data("user_id"),set_mode:e.data("set_mode"),_wpnonce:e.data("nonce"),timestamp:e.data("timestamp")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,a,o){e.selectedFiles=0,a.success&&0==a.success||"undefined"!=typeof a.data.error?(e.parents(".um-modal-body").append('
'+a.data.error+"
"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),setTimeout(function(){um_modal_responsive()},1e3)):(jQuery.each(a.data,function(t,a){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),e.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==t?e.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(a):"icon_bg"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":a}):"filename"==t?e.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",a):"original_name"==t?(e.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",a),e.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(a)):"url"==t&&e.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",a)}),setTimeout(function(){um_modal_responsive()},1e3))},onError:function(e){console.log(e)}})}function initCrop_UM(){var e=jQuery(".um-modal .um-single-image-preview img").first(),t=jQuery(".um-modal .um-single-image-preview"),a=e.parent().attr("data-crop"),o=e.parent().attr("data-min_width"),i=e.parent().attr("data-min_height"),r=e.parent().attr("data-ratio");if(jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"))var r=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"),u=r.split(":"),r=u[0];if(e.length&&""!=e.attr("src")){var d=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height();if(e.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),e.css({height:"auto"})):(e.css({height:"auto","max-height":d+"px"}),t.css({height:e.height(),"max-height":d+"px"})),"square"==a)var s={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};else if("cover"==a){Math.round(o/r)>0&&(i=Math.round(o/r));var s={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:r,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}}}else if("user"==a)var s={minWidth:o,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};0!=a&&(e.cropper(s),jQuery(".um-single-image-preview img.cropper-hidden").cropper("destroy"),jQuery(".um-single-image-preview img.lazyloaded").addClass("cropper-hidden"),jQuery(".um-single-image-preview img.lazyloaded").removeClass("lazyloaded"),jQuery(".um-single-image-preview .cropper-container").append('
'))}}function um_new_modal(e,t,a,o){var i=jQuery("body").find(".um-modal-overlay");if(0==i.length)if(jQuery(".tipsy").hide(),UM_hide_menus(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),a?jQuery("body").append('
'):jQuery("body").append('
'),jQuery("#"+e).prependTo(".um-modal"),a){jQuery(".um-modal").find(".um-modal-photo").html("");var r=jQuery(".um-modal-photo img"),u=jQuery(window).width()-60,d=jQuery(window).height()-.25*jQuery(window).height();r.attr("src",o),r.load(function(){jQuery("#"+e).show(),jQuery(".um-modal").show(),r.css({opacity:0}),r.css({"max-width":u}),r.css({"max-height":d}),jQuery(".um-modal").css({width:r.width(),"margin-left":"-"+r.width()/2+"px"}),r.animate({opacity:1},1e3),um_modal_responsive()})}else jQuery("#"+e).show(),jQuery(".um-modal").show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible").find(".um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible").find(".um-single-file-upload")),um_modal_responsive()}function um_modal_responsive(){var e=jQuery(".um-modal:visible"),t=jQuery(".um-modal-body.photo:visible");if(t.length){e.removeClass("uimob340"),e.removeClass("uimob500");var a=jQuery(".um-modal-photo img"),o=jQuery(window).width()-60,i=jQuery(window).height()-.25*jQuery(window).height();a.css({opacity:0}),a.css({"max-width":o}),a.css({"max-height":i}),jQuery(".um-modal").css({width:a.width(),"margin-left":"-"+a.width()/2+"px"}),a.animate({opacity:1},1e3);var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(e.length){var u=jQuery(window).width();if(e.removeClass("uimob340"),e.removeClass("uimob500"),u<=340)e.addClass("uimob340"),initCrop_UM(),e.animate({bottom:0},300);else if(u<=500)e.addClass("uimob500"),initCrop_UM(),e.animate({bottom:0},300);else if(u<=800){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(u<=960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(u>960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}}}function um_remove_modal(){jQuery("img.cropper-hidden").cropper("destroy"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('.um-modal div[id^="um_"]').hide().appendTo("body"),jQuery(".um-modal,.um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('
'),jQuery("body").append('
'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(jQuery(document).trigger("um_before_modal_removed"),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").mCustomScrollbar("destroy"):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").mCustomScrollbar("destroy"),jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(ag_height=jQuery(window).height()-jQuery(".um-popup um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80,ag_height>350&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?(jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}),jQuery(".um-popup-autogrow:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})):jQuery(".um-popup-autogrow2:visible").length&&(jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}),jQuery(".um-popup-autogrow2:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").removeAttr("checked").removeAttr("selected")}function um_selected(e,t){if(e==t)return"selected='selected'"}jQuery(function(){jQuery(".um-search form *").keypress(function(e){if(13==e.which)return jQuery(".um-search form").submit(),!1}),2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()}); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-gdpr.min.js?ver=2.0.25 !function(t){"use strict";t(document).on("click","a.um-toggle-gdpr",function(){var e=jQuery(this);t(".um-gdpr-content").toggle("fast",function(){t(".um-gdpr-content").is(":visible")&&e.text(e.data("toggle-hide")),t(".um-gdpr-content").is(":hidden")&&e.text(e.data("toggle-show"))})})}(jQuery); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-responsive.min.js?ver=5.4 jQuery(window).load(function(){um_responsive(),um_modal_responsive()}),jQuery(window).resize(function(){responsive_Modal(),jQuery("img.cropper-hidden").cropper("destroy"),um_responsive(),um_modal_responsive()}); // source --> https://www.travpart.com/Chinese/wp-content/plugins/ultimate-member/assets/js/um-conditional.min.js?ver=5.4 jQuery(document).ready(function(){function e(e){var n="",t=i(e);switch(t){case"text":case"number":case"date":case"textarea":case"select":n=e.find("input:text,input[type=number],textarea,select").val();break;case"multiselect":n=e.find("select").val();break;case"radio":e.find("input[type=radio]:checked").length>=1&&(n=e.find("input[type=radio]:checked").val());break;case"checkbox":e.find("input[type=checkbox]:checked").length>=1&&(e.find("input[type=checkbox]:checked").length>1?e.find("input[type=checkbox]:checked").each(function(){n=n+jQuery(this).val()+" "}):n=e.find("input[type=checkbox]:checked").val())}return{type:t,value:n}}function n(e){var n=i(e);switch(n){case"text":case"number":case"date":case"textarea":case"select":case"multiselect":case"radio":case"checkbox":return e.find("input,textarea,select")}return""}function i(e){var n="",i=e.attr("class");return jQuery.each(i.split(" "),function(e,i){i.indexOf("um-field-type")!=-1&&(n=i.split("_")[1])}),n}function t(e){var n=[];return jQuery.each(h,function(i,t){t.field.parent==e&&n.push(t.field.condition)}),n}function a(e){return um_live_field=e.parents(".um-field").data("key"),um_live_value=e.val(),e.is(":checkbox")&&(um_live_value="",e.parents(".um-field").find("input:checked").length>1?e.parents(".um-field").find("input:checked").each(function(){um_live_value=um_live_value+jQuery(this).val()+" "}):e.parents(".um-field").find("input:checked").length>=1&&(um_live_value=e.parents(".um-field").find("input:checked").val())),e.is(":radio")&&(um_live_value=e.parents(".um-field").find("input[type=radio]:checked").val()),um_live_value}function c(e,n,i){var t,a=!1,i=!!i;for(t in n)if(i&&n[t]===e||!i&&n[t]==e){a=!0;break}return a}function r(e,n){var t=e.parents(".um-field[data-key]").data("key"),r=p[t],o=a(e),d={},s={},l={};jQuery.each(r,function(e,n){"undefined"==typeof s[n.owner]&&(s[n.owner]=[],l[n.owner]={}),s[n.owner].push(n.value),l[n.owner]=n}),jQuery.each(r,function(n,t){"undefined"==typeof d[t.owner]&&(d[t.owner]={}),"empty"==t.operator&&(!o||""==o&&c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1),"not empty"==t.operator&&(o&&""!=o&&!c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1),"equals to"==t.operator&&(t.value==o&&c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1),"not equals"==t.operator&&(jQuery.isNumeric(t.value)&&parseInt(o)!=parseInt(t.value)&&o&&!c(o,s[t.owner])?d[t.owner][n]=!0:t.value==o||c(o,s[t.owner])?d[t.owner][n]=!1:d[t.owner][n]=!0),"greater than"==t.operator&&(jQuery.isNumeric(t.value)&&parseInt(o)>parseInt(t.value)?d[t.owner][n]=!0:d[t.owner][n]=!1),"less than"==t.operator&&(jQuery.isNumeric(t.value)&&parseInt(o)=0&&c(t.value,o)?d[t.owner][n]=!0:d[t.owner][n]=!1:"checkbox"==i(e.parents(".um-field[data-key]"))?o&&o.indexOf(t.value)>=0?d[t.owner][n]=!0:d[t.owner][n]=!1:o&&o.indexOf(t.value)>=0&&c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1)}),jQuery.each(d,function(n,i){c(!0,i)?u(e,l[n],!0):u(e,l[n],!1)}),e.trigger("um_fields_change")}function u(e,n,i){var t=jQuery('div.um-field[data-key="'+n.owner+'"]');"show"==n.action&&i&&(t.show(),l(t),o(t)),"show"!=n.action||i||(t.hide(),s(t)),"hide"==n.action&&i&&(t.hide(),s(t)),"hide"!=n.action||i||(t.show(),l(t),o(t)),e.removeClass("um-field-has-changed")}function o(e){var t=i(e),a=e.data("key"),c=v[a];switch(t){case"text":case"number":case"date":case"textarea":e.find("input:text,input[type=number],textareas").val(c.value);break;case"select":e.find("select").find("option").prop("selected",!1),e.find("select").val(c.value),e.find("select").trigger("change");break;case"multiselect":e.find("select").find("option").prop("selected",!1),jQuery.each(c.value,function(n,i){e.find("select").find('option[value="'+i+'"]').attr("selected",!0)}),e.find("select").trigger("change");break;case"checkbox":if(e.find("input[type=checkbox]:checked").length>=1)if(e.find("input[type=checkbox]:checked").removeAttr("checked"),e.find("span.um-field-checkbox-state i").removeClass("um-icon-android-checkbox-outline"),e.find("span.um-field-checkbox-state i").addClass("um-icon-android-checkbox-outline-blank"),e.find(".um-field-checkbox.active").removeClass("active"),jQuery.isArray(c.value))jQuery.each(c.value,function(n,i){var t=e.find('input[type=checkbox][value="'+i+'"]');t.attr("checked",!0),t.closest(".um-field-checkbox").find("i").removeClass("um-icon-android-checkbox-outline-blank"),t.closest(".um-field-checkbox").find("i").addClass("um-icon-android-checkbox-outline"),t.closest(".um-field-checkbox").addClass("active")});else{var r=e.find('input[type=checkbox][value="'+c.value+'"]');r.attr("checked",!0),r.closest(".um-field-checkbox").find("i").removeClass("um-icon-android-checkbox-outline-blank"),r.closest(".um-field-checkbox").find("i").addClass("um-icon-android-checkbox-outline"),r.closest(".um-field-checkbox").addClass("active")}break;case"radio":e.find("input[type=radio]:checked").length>=1&&setTimeout(function(){e.find("input[type=radio]:checked").removeAttr("checked"),e.find("span.um-field-radio-state i").removeClass("um-icon-android-radio-button-on"),e.find("span.um-field-radio-state i").addClass("um-icon-android-radio-button-off"),e.find(".um-field-radio.active").removeClass("active");var n=e.find("input[type=radio][value='"+c.value+"']");n.attr("checked",!0),n.closest(".um-field-radio").find("i").removeClass("um-icon-android-radio-button-off"),n.closest(".um-field-radio").find("i").addClass("um-icon-android-radio-button-on"),n.closest(".um-field-radio").addClass("active")},100)}if(!e.hasClass("um-field-has-changed")){var u=n(e);"radio"!=t&&"checkbox"!=t||(u=u.find(":checked")),u&&(u.trigger("change"),e.addClass("um-field-has-changed"))}}function d(){jQuery.each(p,function(e,n){(jQuery('.um-field[data-key="'+e+'"]:hidden').length>=1||"none"==jQuery('.um-field[data-key="'+e+'"]').css("display"))&&jQuery.each(n,function(e,n){jQuery('.um-field[data-key="'+n.owner+'"]').hide()})})}function s(e){"undefined"!=typeof jQuery.browser&&jQuery.browser.msie&&e.css({visibility:"hidden"})}function l(e){"undefined"!=typeof jQuery.browser&&jQuery.browser.msie&&e.css({visibility:"visible"})}function f(){var i=[];jQuery(".um-field[data-key]").each(function(){var n=jQuery(this).data("key");i.push(n);var t={};jQuery.each(jQuery(this)[0].attributes,function(e,n){if(n.name.indexOf("data-cond")!=-1){var i=n.name.slice(10),a=i.substring(1,0),c=i.slice(2);"undefined"==typeof t[a]&&(t[a]={}),t[a][c]=n.value}}),jQuery.each(t,function(e,i){var t={field:{owner:n,action:i.action,parent:i.field,operator:i.operator,value:i.value,condition:{owner:n,action:i.action,operator:i.operator,value:i.value}}};h.push(t)}),v[jQuery(this).data("key")]=e(jQuery(this))}),jQuery.each(i,function(e,n){p[n]=t(n)}),jQuery(".um-field[data-key]:visible").each(function(){var e=jQuery(this),i=n(e);"undefined"!=typeof i.trigger&&i.trigger("change")})}var h=[],p={},v={};jQuery(document).on("change",'.um-field select, .um-field input[type="radio"], .um-field input[type="checkbox"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",'.um-field input[type="text"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",'.um-field input[type="number"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",'.um-field input[type="password"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("um_fields_change",function(){d(),d()}),f()});