/**handles:um_scripts**/
function um_sanitize_value(e,t){var a=document.createElement("div"),e=(a.innerText=e,a.innerHTML);return t&amp;&amp;jQuery(t).val(e),e}function um_unsanitize_value(e){var t=document.createElement("textarea");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}function um_init_datetimepicker(){jQuery(".um-datepicker:not(.picker__input)").each(function(){var e=jQuery(this),t=!1,a=(void 0!==e.attr("data-disabled_weekdays")&amp;&amp;""!==e.attr("data-disabled_weekdays")&amp;&amp;(t=JSON.parse(e.attr("data-disabled_weekdays"))),null),i=(void 0!==e.attr("data-years")&amp;&amp;(a=e.attr("data-years")),e.attr("data-date_min")),n=e.attr("data-date_max"),r=[],u=[],i=(void 0!==i&amp;&amp;(r=i.split(",")),void 0!==n&amp;&amp;(u=n.split(",")),r.length?new Date(r):null),n=r.length?new Date(u):null,u=(i&amp;&amp;"Invalid Date"==i.toString()&amp;&amp;3==r.length&amp;&amp;(r=r[1]+"/"+r[2]+"/"+r[0],i=new Date(Date.parse(r))),n&amp;&amp;"Invalid Date"==n.toString()&amp;&amp;3==u.length&amp;&amp;(r=u[1]+"/"+u[2]+"/"+u[0],n=new Date(Date.parse(r))),{disable:t,format:e.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){e.blur()},onClose:function(){e.blur()}});null!==a&amp;&amp;(u.selectYears=a),null!==i&amp;&amp;(u.min=i),null!==n&amp;&amp;(u.max=n),e.pickadate(u)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){var e=jQuery(this);e.pickatime({format:e.attr("data-format"),interval:parseInt(e.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){e.blur()},onClose:function(){e.blur()}})})}function init_tipsy(){"function"==typeof jQuery.fn.tipsy&amp;&amp;(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))}jQuery(document).ready(function(){function i(e){var a=jQuery(e.currentTarget),e=a.find(":selected");1&lt;e.length&amp;&amp;e.each(function(e,t){&quot;&quot;===t.value&amp;&amp;(t.selected=!1,a.trigger(&quot;change&quot;))})}jQuery(document.body).on(&quot;click&quot;,&quot;.um-dropdown a.real_url&quot;,function(){window.location=jQuery(this).attr(&quot;href&quot;)}),jQuery(document.body).on(&quot;click&quot;,&quot;.um-trigger-menu-on-click&quot;,function(){var e=jQuery(this).find(&quot;.um-dropdown&quot;);return UM.dropdown.show(e),!1}),jQuery(document.body).on(&quot;click&quot;,&quot;.um-dropdown-hide&quot;,function(){return UM.dropdown.hideAll(),!1}),jQuery(document.body).on(&quot;click&quot;,&quot;a.um-manual-trigger&quot;,function(){var e=jQuery(this).attr(&quot;data-child&quot;),t=jQuery(this).attr(&quot;data-parent&quot;);return jQuery(this).parents(t).find(e).trigger(&quot;click&quot;),UM.dropdown.hideAll(),!1}),jQuery(&quot;.um-s1,.um-s2&quot;).css({display:&quot;block&quot;}),&quot;function&quot;==typeof jQuery.fn.select2&amp;&amp;(jQuery(&quot;.um-s1&quot;).each(function(e){var t=jQuery(this);t.select2({allowClear:!0,dropdownParent:t.parent()}).on(&quot;change&quot;,i)}),jQuery(&quot;.um-s2&quot;).each(function(e){var t=jQuery(this),a={},a=t.parents(&quot;.um-custom-shortcode-tab&quot;).length?{allowClear:!1}:{allowClear:!1,minimumResultsForSearch:10,dropdownParent:t.parent()};t.select2(a).on(&quot;change&quot;,i)}),jQuery(&quot;.um-s3&quot;).each(function(e){var t=jQuery(this);t.select2({allowClear:!1,minimumResultsForSearch:-1,dropdownParent:t.parent()}).on(&quot;change&quot;,i)})),init_tipsy(),&quot;function&quot;==typeof jQuery.fn.um_raty&amp;&amp;(jQuery(&quot;.um-rating&quot;).um_raty({half:!1,starType:&quot;i&quot;,number:function(){return jQuery(this).attr(&quot;data-number&quot;)},score:function(){return jQuery(this).attr(&quot;data-score&quot;)},scoreName:function(){return jQuery(this).attr(&quot;data-key&quot;)},hints:!1,click:function(e,t){um_live_field=this.id,um_live_value=e,um_apply_conditions(jQuery(this),!1)}}),jQuery(&quot;.um-rating-readonly&quot;).um_raty({half:!1,starType:&quot;i&quot;,number:function(){return jQuery(this).attr(&quot;data-number&quot;)},score:function(){return jQuery(this).attr(&quot;data-score&quot;)},scoreName:function(){return jQuery(this).attr(&quot;data-key&quot;)},hints:!1,readOnly:!0})),jQuery(document).on(&quot;change&quot;,&#039;.um-field-area input[type=&quot;radio&quot;]&#039;,function(){var e=jQuery(this).parents(&quot;.um-field-area&quot;),t=jQuery(this).parents(&quot;label&quot;);e.find(&quot;.um-field-radio&quot;).removeClass(&quot;active&quot;),e.find(&quot;.um-field-radio&quot;).find(&quot;i&quot;).removeAttr(&quot;class&quot;).addClass(&quot;um-icon-android-radio-button-off&quot;),t.addClass(&quot;active&quot;),t.find(&quot;i&quot;).removeAttr(&quot;class&quot;).addClass(&quot;um-icon-android-radio-button-on&quot;)}),jQuery(document).on(&quot;change&quot;,&#039;.um-field-area input[type=&quot;checkbox&quot;]&#039;,function(){var e=jQuery(this).parents(&quot;label&quot;);e.hasClass(&quot;active&quot;)?(e.removeClass(&quot;active&quot;),e.find(&quot;i&quot;).removeAttr(&quot;class&quot;).addClass(&quot;um-icon-android-checkbox-outline-blank&quot;)):(e.addClass(&quot;active&quot;),e.find(&quot;i&quot;).removeAttr(&quot;class&quot;).addClass(&quot;um-icon-android-checkbox-outline&quot;))}),um_init_datetimepicker(),jQuery(document).on(&quot;click&quot;,&quot;.um .um-single-image-preview a.cancel&quot;,function(e){e.preventDefault();var t=jQuery(this).parents(&quot;.um-field&quot;),e=t.find(&#039;input[type=&quot;hidden&quot;]#&#039;+t.data(&quot;key&quot;)+&quot;-&quot;+jQuery(this).parents(&quot;form&quot;).find(&#039;input[type=&quot;hidden&quot;][name=&quot;form_id&quot;]&#039;).val()).val(),a=jQuery(this).parents(&quot;.um-field&quot;).find(&quot;.um-single-image-preview img&quot;).attr(&quot;src&quot;),i=t.data(&quot;mode&quot;),e={data:{mode:i,filename:e,src:a,nonce:um_scripts.nonce},success:function(){t.find(&quot;.um-single-image-preview img&quot;).attr(&quot;src&quot;,&quot;&quot;),t.find(&quot;.um-single-image-preview&quot;).hide(),t.find(&quot;.um-btn-auto-width&quot;).html(t.data(&quot;upload-label&quot;)),t.find(&#039;input[type=&quot;hidden&quot;]&#039;).val(&quot;empty_file&quot;)}};return&quot;register&quot;!==i&amp;&amp;(e.data.user_id=jQuery(this).parents(&quot;form&quot;).find(&quot;#user_id&quot;).val()),wp.ajax.send(&quot;um_remove_file&quot;,e),!1}),jQuery(document).on(&quot;click&quot;,&quot;.um .um-single-file-preview a.cancel&quot;,function(e){e.preventDefault();var t=jQuery(this).parents(&quot;.um-field&quot;),e=t.find(&#039;input[type=&quot;hidden&quot;]#&#039;+t.data(&quot;key&quot;)+&quot;-&quot;+jQuery(this).parents(&quot;form&quot;).find(&#039;input[type=&quot;hidden&quot;][name=&quot;form_id&quot;]&#039;).val()).val(),a=jQuery(this).parents(&quot;.um-field&quot;).find(&quot;.um-single-fileinfo a&quot;).attr(&quot;href&quot;),i=t.data(&quot;mode&quot;),e={data:{mode:i,filename:e,src:a,nonce:um_scripts.nonce},success:function(){t.find(&quot;.um-single-file-preview&quot;).hide(),t.find(&quot;.um-btn-auto-width&quot;).html(t.data(&quot;upload-label&quot;)),t.find(&quot;input[type=hidden]&quot;).val(&quot;empty_file&quot;)}};return&quot;register&quot;!==i&amp;&amp;(e.data.user_id=jQuery(this).parents(&quot;form&quot;).find(&quot;#user_id&quot;).val()),wp.ajax.send(&quot;um_remove_file&quot;,e),!1}),jQuery(document).on(&quot;click&quot;,&quot;.um-field-group-head:not(.disabled)&quot;,function(){var e=jQuery(this).parents(&quot;.um-field-group&quot;),t=e.data(&quot;max_entries&quot;),a=(e.find(&quot;.um-field-group-body&quot;).is(&quot;:hidden&quot;)?e.find(&quot;.um-field-group-body&quot;).show():e.find(&quot;.um-field-group-body:first&quot;).clone().appendTo(e),0);e.find(&quot;.um-field-group-body&quot;).each(function(){a++,jQuery(this).find(&quot;input&quot;).each(function(){var e=jQuery(this);e.attr(&quot;id&quot;,e.data(&quot;key&quot;)+&quot;-&quot;+a),e.attr(&quot;name&quot;,e.data(&quot;key&quot;)+&quot;-&quot;+a),e.parent().parent().find(&quot;label&quot;).attr(&quot;for&quot;,e.data(&quot;key&quot;)+&quot;-&quot;+a)})}),0&lt;t&amp;&amp;e.find(&quot;.um-field-group-body&quot;).length==t&amp;&amp;jQuery(this).addClass(&quot;disabled&quot;)}),jQuery(document).on(&quot;click&quot;,&quot;.um-field-group-cancel&quot;,function(e){e.preventDefault();var e=jQuery(this).parents(&quot;.um-field-group&quot;),t=e.data(&quot;max_entries&quot;);return 1&lt;e.find(&quot;.um-field-group-body&quot;).length?jQuery(this).parents(&quot;.um-field-group-body&quot;).remove():jQuery(this).parents(&quot;.um-field-group-body&quot;).hide(),0&lt;t&amp;&amp;e.find(&quot;.um-field-group-body&quot;).length&lt;t&amp;&amp;e.find(&quot;.um-field-group-head&quot;).removeClass(&quot;disabled&quot;),!1}),jQuery(document.body).on(&quot;click&quot;,&quot;.um-ajax-paginate&quot;,function(e){e.preventDefault();var t,a,i=jQuery(this),n=i.parent(),r=(n.addClass(&quot;loading&quot;),+i.data(&quot;pages&quot;)),u=+i.data(&quot;page&quot;)+1,e=i.data(&quot;hook&quot;);&quot;um_load_posts&quot;===e?jQuery.ajax({url:wp.ajax.settings.url,type:&quot;post&quot;,data:{action:&quot;um_ajax_paginate_posts&quot;,author:jQuery(this).data(&quot;author&quot;),page:u,nonce:um_scripts.nonce},complete:function(){n.removeClass(&quot;loading&quot;)},success:function(e){n.before(e),u==r?n.remove():i.data(&quot;page&quot;,u)}}):&quot;um_load_comments&quot;===e?jQuery.ajax({url:wp.ajax.settings.url,type:&quot;post&quot;,data:{action:&quot;um_ajax_paginate_comments&quot;,user_id:jQuery(this).data(&quot;user_id&quot;),page:u,nonce:um_scripts.nonce},complete:function(){n.removeClass(&quot;loading&quot;)},success:function(e){n.before(e),u==r?n.remove():i.data(&quot;page&quot;,u)}}):(t=jQuery(this).data(&quot;args&quot;),a=jQuery(this).parents(&quot;.um&quot;).find(&quot;.um-ajax-items&quot;),jQuery.ajax({url:wp.ajax.settings.url,type:&quot;post&quot;,data:{action:&quot;um_ajax_paginate&quot;,hook:e,args:t,nonce:um_scripts.nonce},complete:function(){n.removeClass(&quot;loading&quot;)},success:function(e){n.remove(),a.append(e)}}))}),jQuery(document).on(&quot;click&quot;,&quot;.um-ajax-action&quot;,function(e){e.preventDefault();var t=jQuery(this).data(&quot;hook&quot;),a=jQuery(this).data(&quot;user_id&quot;),arguments=jQuery(this).data(&quot;arguments&quot;);return jQuery(this).data(&quot;js-remove&quot;)&amp;&amp;jQuery(this).parents(&quot;.&quot;+jQuery(this).data(&quot;js-remove&quot;)).fadeOut(&quot;fast&quot;),jQuery.ajax({url:wp.ajax.settings.url,type:&quot;post&quot;,data:{action:&quot;um_muted_action&quot;,hook:t,user_id:a,arguments:arguments,nonce:um_scripts.nonce},success:function(e){}}),!1}),jQuery(document.body).on(&quot;click&quot;,&quot;#um-search-button&quot;,function(){var e,t=jQuery(this).parents(&quot;.um-search-form&quot;).data(&quot;members_page&quot;),a=[],i=(jQuery(this).parents(&quot;.um-search-form&quot;).find(&#039;input[name=&quot;um-search-keys[]&quot;]&#039;).each(function(){a.push(jQuery(this).val())}),jQuery(this).parents(&quot;.um-search-form&quot;).find(&quot;.um-search-field&quot;).val());if(&quot;&quot;===i)e=t;else{for(var n=&quot;?&quot;,r=0;r&lt;a.length;r++)n+=a[r]+&quot;=&quot;+i,r!==a.length-1&amp;&amp;(n+=&quot;&amp;&quot;);e=t+n}window.location=e}),jQuery(document.body).on(&quot;keypress&quot;,&quot;.um-search-field&quot;,function(e){if(13===e.which){var t,e=jQuery(this).parents(&quot;.um-search-form&quot;).data(&quot;members_page&quot;),a=[],i=(jQuery(this).parents(&quot;.um-search-form&quot;).find(&#039;input[name=&quot;um-search-keys[]&quot;]&#039;).each(function(){a.push(jQuery(this).val())}),jQuery(this).val());if(&quot;&quot;===i)t=e;else{for(var n=&quot;?&quot;,r=0;r&lt;a.length;r++)n+=a[r]+&quot;=&quot;+i,r!==a.length-1&amp;&amp;(n+=&quot;&amp;&quot;);t=e+n}window.location=t}}),jQuery(&#039;.um-form input[class=&quot;um-button&quot;][type=&quot;submit&quot;]&#039;).prop(&quot;disabled&quot;,!1),jQuery(document).one(&quot;click&quot;,&#039;.um:not(.um-account) .um-form input[class=&quot;um-button&quot;][type=&quot;submit&quot;]:not(.um-has-recaptcha)&#039;,function(){jQuery(this).attr(&quot;disabled&quot;,&quot;disabled&quot;),jQuery(this).parents(&quot;form&quot;).trigger(&quot;submit&quot;)});var o={};function d(t,e,a){var i,n,r=t.parents(&quot;.um-directory&quot;),u=t.attr(&quot;name&quot;),o=(t.find(&#039;option[value!=&quot;&quot;]&#039;).remove(),t.hasClass(&quot;um-child-option-disabled&quot;)||t.prop(&quot;disabled&quot;,!1),[]);&quot;yes&quot;===e.post.members_directory&amp;&amp;o.push({id:&quot;&quot;,text:&quot;&quot;,selected:1}),jQuery.each(e.items,function(e,t){o.push({id:e,text:t,selected:&quot;&quot;===t})}),t.select2(&quot;destroy&quot;),t.select2({data:o,allowClear:!0,minimumResultsForSearch:10}),&quot;yes&quot;===e.post.members_directory&amp;&amp;(t.find(&quot;option&quot;).each(function(){&quot;&quot;!==jQuery(this).html()&amp;&amp;jQuery(this).data(&quot;value_label&quot;,jQuery(this).html()).attr(&quot;data-value_label&quot;,jQuery(this).html())}),void 0!==(i=um_get_data_for_directory(r,&quot;filter_&quot;+u))&amp;&amp;(i=i.split(&quot;||&quot;),n=[],jQuery.each(i,function(e){t.find(&#039;option[value=&quot;&#039;+i[e]+&#039;&quot;]&#039;).length&amp;&amp;n.push(i[e]),t.find(&#039;option[value=&quot;&#039;+i[e]+&#039;&quot;]&#039;).prop(&quot;disabled&quot;,!0).hide(),1===t.find(&quot;option:not(:disabled)&quot;).length&amp;&amp;t.prop(&quot;disabled&quot;,!0),t.select2(&quot;destroy&quot;).select2(),t.val(&quot;&quot;).trigger(&quot;change&quot;)}),n=n.join(&quot;||&quot;),i!==n)&amp;&amp;(um_set_url_from_data(r,&quot;filter_&quot;+u,n),um_ajax_get_members(r)),um_change_tag(r)),&quot;yes&quot;!==e.post.members_directory&amp;&amp;(void 0===e.field.default||t.data(&quot;um-original-value&quot;)?&quot;&quot;!==t.data(&quot;um-original-value&quot;)&amp;&amp;t.val(t.data(&quot;um-original-value&quot;)).trigger(&quot;change&quot;):t.val(e.field.default).trigger(&quot;change&quot;),0==e.field.editable)&amp;&amp;(t.addClass(&quot;um-child-option-disabled&quot;),t.attr(&quot;disabled&quot;,&quot;disabled&quot;))}jQuery(&quot;select[data-um-parent]&quot;).each(function(){var n=jQuery(this),r=n.data(&quot;um-parent&quot;),u=n.data(&quot;um-ajax-source&quot;);n.attr(&quot;data-um-init-field&quot;,!0),jQuery(document).on(&quot;change&quot;,&#039;select[name=&quot;&#039;+r+&#039;&quot;]&#039;,function(){var e,t,a=jQuery(this),i=a.closest(&quot;form&quot;).find(&#039;input[type=&quot;hidden&quot;][name=&quot;form_id&quot;]&#039;).val();if(void 0!==(t=&quot;yes&quot;===n.attr(&quot;data-member-directory&quot;)?(e=a.parents(&quot;.um-directory&quot;),void 0!==(t=um_get_data_for_directory(e,&quot;filter_&quot;+r))?t.split(&quot;||&quot;):&quot;&quot;):a.val())&amp;&amp;&quot;&quot;!==t&amp;&amp;&quot;object&quot;!=typeof o[t]){if(void 0!==n.um_wait&amp;&amp;!1!==n.um_wait)return;n.um_wait=!0,jQuery.ajax({url:wp.ajax.settings.url,type:&quot;post&quot;,data:{action:&quot;um_select_options&quot;,parent_option_name:r,parent_option:t,child_callback:u,child_name:n.attr(&quot;name&quot;),members_directory:n.attr(&quot;data-member-directory&quot;),form_id:i,nonce:um_scripts.nonce},success:function(e){&quot;success&quot;===e.status&amp;&amp;&quot;&quot;!==t&amp;&amp;d(n,o[t]=e),void 0!==e.debug&amp;&amp;console.log(e),n.um_wait=!1},error:function(e){console.log(e),n.um_wait=!1}})}void 0!==t&amp;&amp;&quot;&quot;!==t&amp;&amp;&quot;object&quot;==typeof o[t]&amp;&amp;setTimeout(d,10,n,o[t],t),void 0===t&amp;&amp;&quot;&quot;!==t||(n.find(&#039;option[value!=&quot;&quot;]&#039;).remove(),n.val(&quot;&quot;).trigger(&quot;change&quot;))}),jQuery(&#039;select[name=&quot;&#039;+r+&#039;&quot;]&#039;).trigger(&quot;change&quot;)}),jQuery(document.body).on(&quot;click&quot;,&quot;.um-toggle-password&quot;,function(){var e=jQuery(this).closest(&quot;.um-field-area-password&quot;),t=e.find(&quot;input&quot;);&quot;text&quot;===t.attr(&quot;type&quot;)?t.attr(&quot;type&quot;,&quot;password&quot;):t.attr(&quot;type&quot;,&quot;text&quot;),e.find(&quot;i&quot;).toggleClass(&quot;um-icon-eye um-icon-eye-disabled&quot;)})});