jQuery(document).ready(function($){if(Issl.iscu_facebook_appid!==''&&($('#iscu_signup_facebook').length||$('.iscu_prereg_signin_form_facebook').length)){$.getScript('https://connect.facebook.net/en_US/sdk.js',function(){window.fbAsyncInit=function(){FB.init({appId:Issl.iscu_facebook_appid,cookie:!1,status:!0,xfbml:!0,version:'v22.0'})}});$(document).on('click','#iscu_signup_facebook, .iscu_prereg_signin_form_facebook',function(e){e.preventDefault();FB.getLoginStatus(function(response){if(response.status==='connected'){var iscu_access_token=response.authResponse.accessToken;FB.api('/me?fields=id,first_name,last_name,email',{access_token:iscu_access_token},function(fbResponse){if(fbResponse&&!fbResponse.error){var iscu_sl_email=fbResponse.email;$.ajax({url:Issl.ajaxurl,type:'POST',data:{action:'iscu_facebook_login',id:iscu_access_token,first_name:fbResponse.first_name,last_name:fbResponse.last_name,email:fbResponse.email,},success:function(response){var res=JSON.parse(response);var iscu_user_id=res.iscu_user_id;if(res.success){if(res.is_new=='yes'){var iscu_pre_registration=Cookies.get('iscu_pre_registration');iscu_pre_registration=JSON.parse(iscu_pre_registration);iscu_pre_registration.iscu_signup_email=iscu_sl_email;iscu_pre_registration.iscu_signup_password=iscu_sl_email;iscu_pre_registration.iscu_social_user=iscu_user_id;Cookies.set('iscu_pre_registration',JSON.stringify(iscu_pre_registration),{expires:2,path:''});setTimeout(()=>{window.location.href=Issl.site_url+'/voranmeldung/?nest_konto_bestaetigt=1&verify='+iscu_user_id},1000)}else{window.location.href=Issl.site_url}}},error:function(xhr,status,error){console.error('AJAX error:',error)}})}else{console.error('Error fetching Facebook user data')}})}else{FB.login(function(response){if(response.authResponse){var iscu_access_token=response.authResponse.accessToken;FB.api('/me?fields=id,first_name,last_name,email',{access_token:iscu_access_token},function(fbResponse){if(fbResponse&&!fbResponse.error){var iscu_sl_email=fbResponse.email;$.ajax({url:Issl.ajaxurl,type:'POST',data:{action:'iscu_facebook_login',id:iscu_access_token,first_name:fbResponse.first_name,last_name:fbResponse.last_name,email:fbResponse.email,},success:function(response){var res=JSON.parse(response);var iscu_user_id=res.iscu_user_id;if(res.success){if(res.is_new=='yes'){var iscu_pre_registration=Cookies.get('iscu_pre_registration');iscu_pre_registration=JSON.parse(iscu_pre_registration);iscu_pre_registration.iscu_signup_email=iscu_sl_email;iscu_pre_registration.iscu_signup_password=iscu_sl_email;iscu_pre_registration.iscu_social_user=iscu_user_id;Cookies.set('iscu_pre_registration',JSON.stringify(iscu_pre_registration),{expires:2,path:''});setTimeout(()=>{window.location.href=Issl.site_url+'/voranmeldung/?nest_konto_bestaetigt=1&verify='+iscu_user_id},1000)}else{window.location.href=Issl.site_url}}},error:function(xhr,status,error){console.error('AJAX error:',error)}})}else{console.error('Error fetching Facebook user data')}})}else{console.log('User cancelled login or did not fully authorize.')}},{scope:'email, public_profile'})}})})}
function iscu_edit_user_profile(iscu_system_user_id){$(document).find('.iscu_system_content_wrapper').removeClass('active');$(document).find('.iscu_system_edit_profile').addClass('active');$(document).find('.iscu_system_edit_profile .iscu_system_content').html('<div class="iscu_buttons_spinner"><div class="Ellipse26"></div><div class="Ellipse27"></div></div>');$(document).find('.iscu_system_edit_profile .iscu_system_content').addClass('iscu_ajaxing');$.ajax({url:Issl.ajaxurl,type:'POST',data:{action:'iscu_get_system_edit_user_profile',iscu_system_user_id:iscu_system_user_id},success:function(response){var res=JSON.parse(response);if(res.success){$(document).find('.iscu_system_edit_profile .iscu_system_content').html(res.html);$(document).find('.iscu_system_edit_profile .iscu_system_title').html(Issl.iscu_edit_text+' '+res.iscu_display_name+' '+Issl.iscu_profile_text)}
$(document).find('.iscu_system_edit_profile .iscu_system_content').removeClass('iscu_ajaxing');$(document).find('body').trigger('iscu_system_edit_user_load')}})}
var iscu_url_params=new URLSearchParams(window.location.search);var iscu_system_user_id=iscu_url_params.get('user');if(iscu_system_user_id){iscu_url_params.delete('user');var iscu_new_url=window.location.pathname;var iscu_query=iscu_url_params.toString();if(iscu_query){iscu_new_url+='?'+iscu_query}
window.history.replaceState({},'',iscu_new_url);$(document).find('.iscu_system_menu_items .iscu_system_menu_item').removeClass('active');var iscu_menu_item=$(document).find('.iscu_system_menu_items .iscu_system_menu_item.benutzerprofil');iscu_menu_item.removeClass('disabled').addClass('active');iscu_edit_user_profile(iscu_system_user_id)}
$(document).on('click','.iscu_system_menu_items .iscu_system_menu_item.benutzerprofil',function(e){e.preventDefault();var iscu_system_user_id=$(document).find('.iscu_select_user:checked').data('user-id');iscu_edit_user_profile(iscu_system_user_id)});$(document).on('click','.iscu_sidebar_collapse',function(e){e.preventDefault();var $this=$(this);$this.closest('.iscu_system_sidebar').toggleClass('iscu_sidebar_close')});if($(window).width()<=860)$(document).find('.iscu_sidebar_collapse').click();$(document).on('input','#iscu_search_user',function(e){e.preventDefault();if($(this).val().trim()!=''){$(document).find('.iscu_search_cancel').show();$(this).parent('.iscu_system_table_search').addClass('iscu_filled')}else{$(document).find('.iscu_search_cancel').hide();$(this).parent('.iscu_system_table_search').removeClass('iscu_filled')}
$(this).val($(this).val().trim())});$(document).on('click','.iscu_system_table_search',function(e){e.preventDefault();$(this).find('input').focus()});var iscu_rows_per_page=10;if($('#iscu_system_user_table').length){var iscu_system_user_table=$('#iscu_system_user_table').DataTable({processing:!0,serverSide:!0,ajax:{url:Issl.ajaxurl,type:'GET',data:function(d){d.action='iscu_get_all_users';d.paged=Math.ceil(d.start/d.length)+1;d.per_page=d.length;d.draw=d.draw;d.search_value=$(document).find('#iscu_search_user').val();d.search_user_by_date=$(document).find('.iscu_sort_user_field').attr('data-value');d.sort_by=$(document).find('#iscu_system_child_count').attr('data-value');d.active_menu=$(document).find('.iscu_system_menu_item.active').data('active');d.membership_type=$(document).find('.iscu_system_table_tab.active').data('membership-type');if(d.order.length>0){var iscu_sorted_column=d.order[0].column;var iscu_sorting_order=d.order[0].dir;if(iscu_sorted_column===1){d.sort_username=iscu_sorting_order}else if(iscu_sorted_column===3){d.sort_datum=iscu_sorting_order}}},dataSrc:function(json){$(document).find('[data-active="neu-registriert"] .iscu_system_menu_item_notification_count').html(json.iscu_new_user_count);$(document).find('[data-active="neu-registriert"] .iscu_system_menu_item_image').attr('data-notificaction',json.iscu_new_user_count);return json.data}},columns:[{data:'id',render:function(data,type,row){return `<label class="iscu_checkbox_item">
<input type="checkbox" class="iscu_select_user" data-user-id="${row.id}">
<span class="iscu_checkbox"></span>
</label> `},orderable:!1,searchable:!1},{data:'display_name',render:function(data,type,row){return'<span class="iscu_system_user_display_name" data-name="'+row.display_name+'">'+row.user_avatar+'<span class="iscu_system_user_display_name_text"> #'+row.id+' '+row.display_name+'</span></span>'}},{data:'placement_status',orderable:!1,searchable:!1,},{data:'registration_date'},{data:'data_completion',orderable:!1,searchable:!1,},{data:'membership_type',orderable:!1,searchable:!1,},{data:'financial_status',orderable:!1,searchable:!1,},{data:'user_actions',orderable:!1,searchable:!1,},{data:'more_actions',orderable:!1,searchable:!1,},],"pageLength":iscu_rows_per_page,"lengthChange":!1,searching:!1,pagingType:'full',language:{info:"",infoEmpty:"",infoFiltered:"",zeroRecords:"<div class='iscu_empty_record_msg'>"+Issl.iscu_empty_record+"</div>",paginate:{first:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.21621 8.00024L7.79954 10.6002C7.92177 10.7225 7.98566 10.8752 7.99121 11.0586C7.99677 11.2419 7.93288 11.4002 7.79954 11.5336C7.67732 11.6558 7.52177 11.7169 7.33288 11.7169C7.14399 11.7169 6.98843 11.6558 6.86621 11.5336L3.79954 8.4669C3.73288 8.40024 3.68566 8.32801 3.65788 8.25024C3.6301 8.17246 3.61621 8.08912 3.61621 8.00024C3.61621 7.91135 3.6301 7.82801 3.65788 7.75024C3.68566 7.67246 3.73288 7.60024 3.79954 7.53357L6.86621 4.4669C6.98843 4.34468 7.14121 4.28079 7.32454 4.27524C7.50788 4.26968 7.66621 4.33357 7.79954 4.4669C7.92177 4.58912 7.98288 4.74468 7.98288 4.93357C7.98288 5.12246 7.92177 5.27801 7.79954 5.40024L5.21621 8.00024ZM9.61621 8.00024L12.1995 10.6002C12.3218 10.7225 12.3857 10.8752 12.3912 11.0586C12.3968 11.2419 12.3329 11.4002 12.1995 11.5336C12.0773 11.6558 11.9218 11.7169 11.7329 11.7169C11.544 11.7169 11.3884 11.6558 11.2662 11.5336L8.19954 8.4669C8.13288 8.40024 8.08566 8.32801 8.05788 8.25024C8.0301 8.17246 8.01621 8.08912 8.01621 8.00024C8.01621 7.91135 8.0301 7.82801 8.05788 7.75024C8.08566 7.67246 8.13288 7.60024 8.19954 7.53357L11.2662 4.4669C11.3884 4.34468 11.5412 4.28079 11.7245 4.27524C11.9079 4.26968 12.0662 4.33357 12.1995 4.4669C12.3218 4.58912 12.3829 4.74468 12.3829 4.93357C12.3829 5.12246 12.3218 5.27801 12.1995 5.40024L9.61621 8.00024Z" fill="black" fill-opacity="0.45"/></svg>',previous:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.86621 11.5332L5.79954 8.46654C5.73288 8.39987 5.68577 8.32765 5.65821 8.24987C5.63021 8.17209 5.61621 8.08876 5.61621 7.99987C5.61621 7.91098 5.63021 7.82765 5.65821 7.74987C5.68577 7.67209 5.73288 7.59987 5.79954 7.5332L8.86621 4.46654C8.98843 4.34431 9.14399 4.2832 9.33288 4.2832C9.52177 4.2832 9.67732 4.34431 9.79954 4.46654C9.92177 4.58876 9.98288 4.74431 9.98288 4.9332C9.98288 5.12209 9.92177 5.27765 9.79954 5.39987L7.19954 7.99987L9.79954 10.5999C9.92177 10.7221 9.98288 10.8776 9.98288 11.0665C9.98288 11.2554 9.92177 11.411 9.79954 11.5332C9.67732 11.6554 9.52177 11.7165 9.33288 11.7165C9.14399 11.7165 8.98843 11.6554 8.86621 11.5332Z" fill="black" fill-opacity="0.45"/></svg>',next:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.46654 11.5332C6.34431 11.411 6.2832 11.2554 6.2832 11.0665C6.2832 10.8776 6.34431 10.7221 6.46654 10.5999L9.06654 7.99987L6.46654 5.39987C6.34431 5.27765 6.2832 5.12209 6.2832 4.9332C6.2832 4.74431 6.34431 4.58876 6.46654 4.46654C6.58876 4.34431 6.74431 4.2832 6.9332 4.2832C7.12209 4.2832 7.27765 4.34431 7.39987 4.46654L10.4665 7.5332C10.5332 7.59987 10.5805 7.67209 10.6085 7.74987C10.6361 7.82765 10.6499 7.91098 10.6499 7.99987C10.6499 8.08876 10.6361 8.17209 10.6085 8.24987C10.5805 8.32765 10.5332 8.39987 10.4665 8.46654L7.39987 11.5332C7.27765 11.6554 7.12209 11.7165 6.9332 11.7165C6.74431 11.7165 6.58876 11.6554 6.46654 11.5332Z" fill="#F76B15"/></svg>',last:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.38373 7.99987L3.8004 5.39987C3.67818 5.27765 3.61429 5.12487 3.60873 4.94154C3.60318 4.7582 3.66707 4.59987 3.8004 4.46654C3.92262 4.34431 4.07818 4.2832 4.26707 4.2832C4.45595 4.2832 4.61151 4.34431 4.73373 4.46654L7.8004 7.5332C7.86707 7.59987 7.91429 7.67209 7.94207 7.74987C7.96984 7.82765 7.98373 7.91098 7.98373 7.99987C7.98373 8.08876 7.96984 8.17209 7.94207 8.24987C7.91429 8.32765 7.86707 8.39987 7.8004 8.46654L4.73373 11.5332C4.61151 11.6554 4.45873 11.7193 4.2754 11.7249C4.09207 11.7304 3.93373 11.6665 3.8004 11.5332C3.67818 11.411 3.61707 11.2554 3.61707 11.0665C3.61707 10.8776 3.67818 10.7221 3.8004 10.5999L6.38373 7.99987ZM10.7837 7.99987L8.2004 5.39987C8.07818 5.27765 8.01429 5.12487 8.00873 4.94154C8.00318 4.7582 8.06707 4.59987 8.2004 4.46654C8.32262 4.34431 8.47818 4.2832 8.66707 4.2832C8.85595 4.2832 9.01151 4.34431 9.13373 4.46654L12.2004 7.5332C12.2671 7.59987 12.3143 7.67209 12.3421 7.74987C12.3698 7.82765 12.3837 7.91098 12.3837 7.99987C12.3837 8.08876 12.3698 8.17209 12.3421 8.24987C12.3143 8.32765 12.2671 8.39987 12.2004 8.46654L9.13373 11.5332C9.01151 11.6554 8.85873 11.7193 8.6754 11.7249C8.49206 11.7304 8.33373 11.6665 8.2004 11.5332C8.07818 11.411 8.01707 11.2554 8.01707 11.0665C8.01707 10.8776 8.07818 10.7221 8.2004 10.5999L10.7837 7.99987Z" fill="#F76B15"/></svg>'},aria:{paginate:'Page navigation'}},drawCallback:function(settings){var iscu_datatable_api=this.api();var iscu_total_records=Number(iscu_datatable_api.page.info().recordsTotal)||0;var iscu_current_page=Number(iscu_datatable_api.page.info().page+1)||0;var iscu_total_pages=Number(iscu_datatable_api.page.info().pages)||1;$('#iscu_system_user_table_first').before('<span class="iscu_total_records">'+iscu_total_records+' Items</span>');$('#iscu_system_user_table_previous').after('<span class="iscu_current_page">'+iscu_current_page+' of '+iscu_total_pages+'</span>');if(iscu_total_records==0){$(document).find('#iscu_system_user_table_paginate').css('visibility','hidden')}else{$(document).find('#iscu_system_user_table_paginate').css('visibility','visible')}}})}
$(document).on('iscu_filter_change','body',function(e){$(document).find('.iscu_system_menu_item.benutzerprofil').addClass('disabled');if($('#iscu_system_user_table').length){iscu_system_user_table.ajax.reload()}});var iscu_typing_timer;var iscu_complete_typing_timer=300;$(document).on('keyup','#iscu_search_user',function(e){clearTimeout(iscu_typing_timer);iscu_typing_timer=setTimeout(function(){$(document).find('.iscu_system_menu_item.benutzerprofil').addClass('disabled');if($('#iscu_system_user_table').length){iscu_system_user_table.ajax.reload()}},iscu_complete_typing_timer)});$(document).on('change','#iscu_select_all_users',function(e){var iscu_is_checked=$(this).prop('checked');$(document).find('.iscu_select_user').each(function(){$(this).prop('checked',iscu_is_checked).trigger('change')})});$(document).on('change','.iscu_select_user',function(e){var iscu_total_checkboxes=$(document).find('.iscu_select_user').length;var iscu_checked_checkboxes=$(document).find('.iscu_select_user:checked').length;$(document).find('#iscu_select_all_users').prop('checked',iscu_total_checkboxes==iscu_checked_checkboxes);$(document).find('.iscu_system_menu_item.benutzerprofil').addClass('disabled');if($(this).is(':checked')){$(this).closest('tr').addClass('iscu_user_selected')}else{$(this).closest('tr').removeClass('iscu_user_selected')}
if(iscu_checked_checkboxes==1)$(document).find('.iscu_system_menu_item.benutzerprofil').removeClass('disabled');});$(document).on('click','.iscu_search_cancel',function(e){e.preventDefault();$(document).find('#iscu_search_user').val('');$(document).find('.iscu_search_cancel').hide();$(this).parent('.iscu_system_table_search').removeClass('iscu_filled');$(document).find('.iscu_system_menu_item.benutzerprofil').addClass('disabled');if($('#iscu_system_user_table').length){iscu_system_user_table.ajax.reload()}});$(document).on('click','.iscu_more_actions_icon',function(e){e.stopPropagation();const iscu_moreActions=$(this).closest('.iscu_more_actions');const iscu_dropdown=iscu_moreActions.find('.iscu_more_actions_dropdown');if(iscu_moreActions.hasClass('iscu_dropdown_open')){$(document).find('.iscu_more_actions').removeClass('iscu_dropdown_open')}else{$(document).find('.iscu_more_actions').removeClass('iscu_dropdown_open');iscu_dropdown.css({top:'',bottom:''});const offsetTop=iscu_moreActions.offset().top;const dropdownHeight=iscu_dropdown.outerHeight();const windowHeight=$(window).height();if(offsetTop+iscu_moreActions.outerHeight()+dropdownHeight>windowHeight){iscu_dropdown.css('bottom','17px');iscu_dropdown.css('top','unset')}else{iscu_dropdown.css('top','17px');iscu_dropdown.css('bottom','unset')}
iscu_moreActions.addClass('iscu_dropdown_open')}});$(document).click(function(e){if(!$(e.target).closest('.iscu_more_actions').length){$(document).find('.iscu_more_actions').removeClass('iscu_dropdown_open')}});$(document).on('click','.iscu_more_actions_dropdown, .iscu_user_actions',function(e){e.stopPropagation()});$(document).on('click','.iscu_system_table tr',function(e){if($(e.target).closest('.iscu_select_user').length)return;if(!$(e.target).closest('a').length){var iscu_select_user=$(this).find('.iscu_select_user');iscu_select_user.prop('checked',!iscu_select_user.prop('checked')).trigger('change')}});window.iscu_click_count=0;window.iscu_change_count=0;$(document).on('click','.iscu_system_content_wrapper.iscu_system_edit_profile.active .iscu_system_user_profile_section .iscu_system_select_field_wrap',function(e){iscu_click_count++});$(document).on('change','.iscu_system_content_wrapper.iscu_system_edit_profile.active :input:not(#iscu_profile_comment)',function(){iscu_change_count++});var targetHref=null;var targetDiv=null;$('.iscu_main_header a, .iscu_system_header a, .iscu_sidebar_logout a').on('click',function(e){e.preventDefault();var iscu_editor=$('.iscu_system_content_wrapper.iscu_system_edit_profile.active').length>0;var iscu_activity=(iscu_click_count+iscu_change_count)>0;targetHref=$(this).attr('href');targetDiv=null;if(iscu_editor&&iscu_activity>0){e.preventDefault();e.stopImmediatePropagation();$('.iscu_system_model_leave_saving').addClass('iscu_system_model_leave_saving_visibility');return!1}else{window.location.href=targetHref}});$(document).on('click','.iscu_close_system_leave_modal',function(e){if(targetHref){window.location.href=targetHref}else if(targetDiv){var targetSelector=`.iscu_system_menu_item[data-active="${targetDiv}"]`;var targetToClick=$(targetSelector);if(targetToClick.length>0){iscu_click_count=0;iscu_change_count=0;targetToClick.trigger('click')}}
iscu_click_count=0;iscu_change_count=0;targetHref=null;targetDiv=null});$(document).on('click','.iscu_confirm_system_leave_mdoal',function(){$('.iscu_system_model_leave_saving').removeClass('iscu_system_model_leave_saving_visibility')});$(document).on('click','.iscu_system_table_tab, .iscu_system_menu_items .iscu_system_menu_item',function(e){var $this=$(this);var iscu_editor=$('.iscu_system_content_wrapper.iscu_system_edit_profile.active').length>0;var iscu_activity=(iscu_click_count+iscu_change_count);targetHref=null;targetDiv=$(this).data('active');if(iscu_editor&&iscu_activity>0){e.preventDefault();e.stopImmediatePropagation();$('.iscu_system_model_leave_saving').addClass('iscu_system_model_leave_saving_visibility');return!1}else if(iscu_activity==0&&iscu_editor){$('.iscu_system_model_leave_saving').removeClass('iscu_system_model_leave_saving_visibility')}
var iscu_siblings=$this.siblings();iscu_siblings.removeClass('active');$this.addClass('active');if(!$(this).hasClass('benutzerprofil')){$(document).find('.iscu_system_content_wrapper').removeClass('active');$(document).find('.iscu_system_user_records').addClass('active');$(document).find('.iscu_system_menu_item.benutzerprofil').addClass('disabled');if($('#iscu_system_user_table').length){iscu_system_user_table.ajax.reload()}}});$(document).on('click','.iscu_system_dashboard a',function(e){e.preventDefault();$(document).find('.iscu_system_menu_items .iscu_system_menu_item:first-child').trigger('click')});$(document).on('click','.iscu_more_action',function(e){e.preventDefault();var iscu_user_id=$(this).parents('tr').find('.iscu_select_user').data('user-id');var iscu_action=$(this).hasClass('platzierung-genehmigen')?'approve-placement':$(this).hasClass('platzierung-ablehnen')?'reject-placement':$(this).hasClass('in-bearbeitung')?'progress-placement':$(this).hasClass('bezahlt')?'paid-payment':$(this).hasClass('vollständig')?'complete-status':$(this).hasClass('unvollständig')?'incomplete-status':$(this).hasClass('anfrage-archivieren')?'request-archive':$(this).hasClass('nicht-bezahlt')?'not-paid-payment':null;if(iscu_action){var iscu_modal_heading='';var iscu_modal_description='';switch(iscu_action){case 'approve-placement':case 'reject-placement':case 'progress-placement':iscu_modal_heading=Issl.iscu_placement_status_heading;iscu_modal_description=Issl.iscu_placement_status_description;break;case 'complete-status':case 'incomplete-status':iscu_modal_heading=Issl.iscu_complete_status_heading;iscu_modal_description=Issl.iscu_complete_status_description;break;case 'paid-payment':case 'not-paid-payment':iscu_modal_heading=Issl.iscu_payment_status_heading;iscu_modal_description=Issl.iscu_payment_status_description;break;case 'request-archive':iscu_modal_heading=Issl.iscu_archive_request_heading;iscu_modal_description=Issl.iscu_archive_request_description;break}
iscu_show_system_modal(iscu_modal_heading,iscu_modal_description,iscu_action,iscu_user_id)}});$(document).on('click','.iscu_delete_user',function(e){e.preventDefault();$(this).addClass('iscu_set_outline');var iscu_user_id=$(this).parents('tr').find('.iscu_select_user').data('user-id');iscu_show_system_modal(Issl.iscu_delete_user_heading,Issl.iscu_delete_user_description,'delete',iscu_user_id)});function iscu_show_system_modal(heading,description,action,user_id){$(document).find('.iscu_system_modal_heading').html(heading);$(document).find('.iscu_system_modal_description').html(description);$(document).find('.iscu_confirm_system_mdoal').attr('data-action',action);$(document).find('.iscu_confirm_system_mdoal').attr('data-user-id',user_id);$(document).find('.iscu_system_modal_container').addClass('iscu_show_system_modal')}
function iscu_close_system_modal(){$(document).find('.iscu_system_modal_container').removeClass('iscu_show_system_modal');$(document).find('.iscu_system_modal_heading').html('');$(document).find('.iscu_system_modal_description').html('');$(document).find('.iscu_system_modal_content').attr('data-action','')}
$(document).on('click','.iscu_close_system_modal',function(e){iscu_close_system_modal()});$(document).on('click','.iscu_edit_user',function(e){e.preventDefault();$(this).addClass('iscu_set_outline');$(this).parents('tr').find('.iscu_select_user').prop('checked',!0).trigger('change');$(document).find('.iscu_system_menu_item.benutzerprofil').trigger('click')});$(document).on('click',function(e){if(!$(e.target).closest('.iscu_edit_user, .iscu_delete_user').length){$('.iscu_edit_user.iscu_set_outline').removeClass('iscu_set_outline');$('.iscu_delete_user.iscu_set_outline').removeClass('iscu_set_outline')}});$(document).on('click','#iscu_profile_comment, .iscu_profile_comment_edit',function(e){$(document).find('#iscu_profile_comment').removeAttr('readonly').focus();$('.iscu_profile_comment_cancel, .iscu_profile_comment_save').show();$('.iscu_profile_comment_edit').hide()});$(document).on('contextmenu','#iscu_profile_comment',function(e){return!1});$(document).on('click','.iscu_profile_comment_cancel',function(e){$(document).find('#iscu_profile_comment').val($(document).find('#iscu_profile_comment').data('comment'));$('#iscu_profile_comment').attr('readonly',!0);$('.iscu_profile_comment_cancel, .iscu_profile_comment_save').hide();$('.iscu_profile_comment_edit').show()});$(document).on('click','.iscu_profile_comment_save',function(e){var $this=$(this);var iscu_profile_comment=$(document).find('#iscu_profile_comment').val().trim()
var iscu_system_user_id=$(document).find('#iscu_system_user_id').val();$(document).find('#iscu_profile_comment').attr('data-comment',iscu_profile_comment);$this.addClass('iscu_ajaxing');$this.prop('disabled',!0);$.ajax({url:Issl.ajaxurl,type:'POST',data:{action:'iscu_update_profile_comment',iscu_profile_comment:iscu_profile_comment,iscu_system_user_id:iscu_system_user_id},success:function(response){$this.removeClass('iscu_ajaxing');$this.prop('disabled',!1);$('#iscu_profile_comment').attr('readonly',!0);$('.iscu_profile_comment_cancel, .iscu_profile_comment_save').hide();$('.iscu_profile_comment_edit').show()}})});$(document).on('input','#iscu_profile_comment',function(e){var iscu_profile_comment_length=$(this).val().trim().length;$(document).find('.iscu_profile_comment_length').html(iscu_profile_comment_length+'/400')});function iscu_trigger_system_ajax(data,$button){$button.addClass('iscu_ajaxing');$.ajax({url:Issl.ajaxurl,type:'POST',data:data,success:function(response){var res=JSON.parse(response);if(res.success){iscu_close_system_modal();if($('#iscu_system_user_table').length){iscu_system_user_table.ajax.reload()}}
$button.removeClass('iscu_ajaxing')}})}
$(document).on('click','.iscu_confirm_system_mdoal[data-action="delete"]',function(e){e.preventDefault();iscu_trigger_system_ajax({action:'iscu_system_delete_user',iscu_user_id:$(this).attr('data-user-id'),},$(this))});$(document).on('click','.iscu_confirm_system_mdoal[data-action="approve-placement"], .iscu_confirm_system_mdoal[data-action="reject-placement"], .iscu_confirm_system_mdoal[data-action="progress-placement"], .iscu_confirm_system_mdoal[data-action="paid-payment"], .iscu_confirm_system_mdoal[data-action="not-paid-payment"], .iscu_confirm_system_mdoal[data-action="request-archive"], .iscu_confirm_system_mdoal[data-action="complete-status"], .iscu_confirm_system_mdoal[data-action="incomplete-status"]',function(e){e.preventDefault();var iscu_system_meta_value='';var iscu_system_meta_key='';if($(this).attr('data-action')=='approve-placement'){iscu_system_meta_value='Accepted';iscu_system_meta_key='iscu_placement_status'}else if($(this).attr('data-action')=='reject-placement'){iscu_system_meta_value='Rejected';iscu_system_meta_key='iscu_placement_status'}else if($(this).attr('data-action')=='progress-placement'){iscu_system_meta_value='In Progress';iscu_system_meta_key='iscu_placement_status'}else if($(this).attr('data-action')=='paid-payment'){iscu_system_meta_value='Paid';iscu_system_meta_key='iscu_financial_status'}else if($(this).attr('data-action')=='not-paid-payment'){iscu_system_meta_value='Not Paid';iscu_system_meta_key='iscu_financial_status'}else if($(this).attr('data-action')=='request-archive'){iscu_system_meta_value='Archived';iscu_system_meta_key='iscu_placement_status'}else if($(this).attr('data-action')=='complete-status'){iscu_system_meta_value='completed';iscu_system_meta_key='iscu_data_completion'}else if($(this).attr('data-action')=='incomplete-status'){iscu_system_meta_value='incomplete';iscu_system_meta_key='iscu_data_completion'}
iscu_trigger_system_ajax({action:'iscu_update_system_user_meta',iscu_user_id:$(this).attr('data-user-id'),iscu_system_meta_value:iscu_system_meta_value,iscu_system_meta_key:iscu_system_meta_key,},$(this))})
$(document).on('click','.iscu_add_new_child',function(){$(document).find('.iscu_system_edit_profile .iscu_system_content').empty();$(document).find('.iscu_system_content_wrapper').removeClass('active');$(document).find('.iscu_system_add_profile').addClass('active');$(document).find('.iscu_system_add_profile .iscu_system_content').html('<div class="iscu_buttons_spinner"><div class="Ellipse26"></div><div class="Ellipse27"></div></div>');$(document).find('.iscu_system_add_profile .iscu_system_content').addClass('iscu_ajaxing');$.ajax({url:Issl.ajaxurl,type:'POST',data:{action:'iscu_get_system_add_user_profile',},success:function(response){var res=JSON.parse(response);if(res.success){$(document).find('.iscu_system_add_profile .iscu_system_content').html(res.html);$(document).find('body').trigger('iscu_system_add_user_load')}
setTimeout(()=>{$(document).find('.iscu_system_add_profile .iscu_system_content').removeClass('iscu_ajaxing')},1000)}})});function iscu_sys_resize_calender($this){var iscu_calendar=$('.flatpickr-calendar');if($this.length&&iscu_calendar.length){var iscu_input_width=$this.outerWidth();var iscu_input_offset=$this.offset();var iscu_inline_style='left: '+iscu_input_offset.left+'px; '+'box-sizing: border-box; '+'position: absolute;';iscu_calendar.attr('style',iscu_inline_style)}}
$(document).on('iscu_system_add_user_load','body',function(e){$(document).find('.iscu_system_sidebar .iscu_system_menu_item.active').removeClass('active');$(document).find('#iscu_new_user_start_date').flatpickr({dateFormat:"d/m/Y",allowInput:!0,disableMobile:!0,onReady:function(selectedDates,dateStr,instance){}});$(document).find('.iscu_sys_user_date_field').flatpickr({dateFormat:"d/m/Y",allowInput:!0,disableMobile:!0,onReady:function(selectedDates,dateStr,instance){const $input=$(instance.input);const $wrap=$input.closest('.iscu_up_date_field_wrap');const $calendarContainer=$(instance.calendarContainer);$wrap.append($calendarContainer)}});iscu_check_initial_care_preference();$(document).find('.iscu_up_show_password_wrap').on('click',function(e){$(this).toggleClass('iscu_user_show_password_wrap');let iscu_input=$(this).closest('.iscu_up_field_wrap').find('input');if($(this).hasClass('iscu_user_show_password_wrap')){$(this).find('.iscu_up_show_password_img').css('display','block');$(this).find('.iscu_up_hide_password_img').css('display','none');iscu_input.attr('type','text')}else{$(this).find('.iscu_up_show_password_img').css('display','none');$(this).find('.iscu_up_hide_password_img').css('display','block');iscu_input.attr('type','password')}});$(document).find('.iscu_new_user_generate_random_pass_btn').on('click',function(e){let iscu_password=iscu_generate_password();$(this).parent().prev('.iscu_up_field_wrap').find('input').val(iscu_password);$(this).parent().prev('.iscu_up_field_wrap').find('input').trigger('change')});$(document).find('.iscu_sys_user_date_field').on('input',function(){var iscu_ci_this=$(this);var $this=$(this);$this.siblings('.iscu_signup_input_error_show').remove();var iscu_ci_date_value=iscu_ci_this.val().replace(/\D/g,'').slice(0,8);var iscu_ci_formatted='';if(iscu_ci_date_value.length>=2){iscu_ci_formatted+=iscu_ci_date_value.substr(0,2)+'/'}else{iscu_ci_formatted+=iscu_ci_date_value}
if(iscu_ci_date_value.length>=4){iscu_ci_formatted+=iscu_ci_date_value.substr(2,2)+'/'}else if(iscu_ci_date_value.length>2){iscu_ci_formatted+=iscu_ci_date_value.substr(2)}
if(iscu_ci_date_value.length>4){iscu_ci_formatted+=iscu_ci_date_value.substr(4)}
iscu_ci_this.val(iscu_ci_formatted)})});$(document).on('iscu_sys_user_account_type_change','body',function(e){let iscu_account_type=$(document).find('#iscu_sys_user_account_type').attr('data-value');if(iscu_account_type==''){$(document).find('.iscu_new_user_child_section .iscu_sys_user_time_wrap').css('display','none');$(document).find('.iscu_system_add_profile_form_wrapper .iscu_new_user_child_section .iscu_add_user_profile_container').css('display','none');$(document).find('.iscu_system_add_profile_form_wrapper .iscu_new_user_child_section .iscu_new_user_alternative_care_wrap').css('display','none')}else{$(document).find('.iscu_new_user_child_section .iscu_sys_user_time_wrap').css('display','block');$(document).find('.iscu_system_add_profile_form_wrapper .iscu_new_user_child_section .iscu_add_user_profile_container').css('display','flex')}
if(iscu_account_type=='kita'){$(document).find('.iscu_system_add_profile_form_wrapper .iscu_new_user_child_section .iscu_new_user_alternative_care_wrap').css('display','flex')}else{$(document).find('.iscu_system_add_profile_form_wrapper .iscu_new_user_child_section .iscu_new_user_alternative_care_wrap').css('display','none')}});$(document).on('input','.iscu_sys_user_date_field',function(){var iscu_ci_this=$(this);var $this=$(this);$this.siblings('.iscu_signup_input_error_show').remove();var iscu_ci_date_value=iscu_ci_this.val().replace(/\D/g,'').slice(0,8);var iscu_ci_formatted='';if(iscu_ci_date_value.length>=2){iscu_ci_formatted+=iscu_ci_date_value.substr(0,2)+'/'}else{iscu_ci_formatted+=iscu_ci_date_value}
if(iscu_ci_date_value.length>=4){iscu_ci_formatted+=iscu_ci_date_value.substr(2,2)+'/'}else if(iscu_ci_date_value.length>2){iscu_ci_formatted+=iscu_ci_date_value.substr(2)}
if(iscu_ci_date_value.length>4){iscu_ci_formatted+=iscu_ci_date_value.substr(4)}
iscu_ci_this.val(iscu_ci_formatted)});function iscu_generate_password(){let iscu_small_letters="abcdefghijklmnopqrstuvwxyz";let iscu_capital_letters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";let iscu_numbers="0123456789";let iscu_all_chars=iscu_small_letters+iscu_capital_letters+iscu_numbers;let iscu_password="";iscu_password+=iscu_small_letters[Math.floor(Math.random()*iscu_small_letters.length)];iscu_password+=iscu_capital_letters[Math.floor(Math.random()*iscu_capital_letters.length)];iscu_password+=iscu_numbers[Math.floor(Math.random()*iscu_numbers.length)];for(let i=3;i<8;i++){iscu_password+=iscu_all_chars[Math.floor(Math.random()*iscu_all_chars.length)]}
iscu_password=iscu_password.split('').sort(()=>Math.random()-0.5).join('');return iscu_password}
function iscu_check_initial_care_preference(){$(document).find('.iscu_sys_user_time_tagesfamilien .iscu_up_weekday_wrap').each(function(){$(this).find('.iscu_up_weekday_time_wrap .iscu_up_field').each(function(){$(this).prop('disabled',!0).val('')})});$(document).find('.iscu_sys_user_time_kita .iscu_up_weekday_field').each(function(){$(this).prop('disabled',!0).prop('checked',!1)});$(document).find('.iscu_sys_user_time_kita .iscu_up_weekday_status_wrap .iscu_up_weekday_field').each(function(){$(this).prop('disabled',!1)})}});
var wpa_field_name, wpa_unique_id, wpa_add_test, wpa_hidden_field;
jQuery(document).ready(function(){
wpa_field_name=wpa_field_info.wpa_field_name;
wpa_unique_id=wpa_field_info.wpa_field_value;
wpa_add_test=wpa_field_info.wpa_add_test;
wpa_hidden_field="<div id='altEmail_container' class='altEmail_container'><label for='alt_s'>Alternative:</label><input type='text' id='alt_s' name='alt_s' ></div><span class='wpa_hidden_field' style='display:none;height:0;width:0;'><label>WPA <input type='text' name='"+wpa_field_name+"' value='"+wpa_unique_id+"' /></label></span>";
wpa_add_honeypot_field();
if(typeof wpae_add_honeypot_field=='function'){
wpae_add_honeypot_field();
}
if(wpa_add_test=='yes'){
wpa_add_test_block();
}});
function wpa_act_as_spam(){
actiontype=jQuery('span.wpa-button').data('actiontype');
if(actiontype=='remove'){
wpa_remove_honeypot_field();
jQuery('span.wpa-button').data('actiontype','add');
jQuery('span.wpa-button').html('Acting as Spam Bot');
}else{
wpa_add_honeypot_field();
jQuery('span.wpa-button').data('actiontype','remove');
jQuery('span.wpa-button').html('Act as Spam Bot');
}}
function wpa_add_honeypot_field(){
var allFormSelectors=[
'form.wpcf7-form, .wpcf7 form',
'form.wpforms-form',
'.gform_wrapper form',
'.frm_forms form',
'.caldera-grid form',
'.wp-block-toolset-cred-form form',
'form.cred-user-form',
'form.cred-form',
'form.et_pb_contact_form',
'form.fb_form',
'form.elementor-form',
'form.form-contribution',
'form.cart',
'form#learn-press-checkout-form',
'form.wpa_form',
'.wpa_form form',
'.um-form form',
'form.spectra-pro-login-form',
'form#loginform',
'form#edd_login_form',
'form.uwp-login-form',
'.et_pb_login_form form',
'form.eael-login-form',
'form.user-registration-form-login',
'form#lostpasswordform',
'form.lost_reset_password',
'form.ur_lost_reset_password',
'form.register',
'form#commentform',
'form.ast-commentform',
'form#fl-comment-form',
'form.comment-form',
'.review-form form',
'form#edd-reviews-form',
'form.wpr-comment-form',
'.bbp-topic-form form',
'.bbp-reply-form form'
];
jQuery(allFormSelectors.join(', ')).append(wpa_hidden_field);
jQuery('form.frm-fluent-form').append(wpa_hidden_field);
jQuery('.ff_conv_app').append(wpa_hidden_field);
if(typeof fluent_forms_global_var_1!=='undefined'){
fluent_forms_global_var_1.extra_inputs[wpa_field_name]=wpa_unique_id;
fluent_forms_global_var_1.extra_inputs['alt_s']='';
}
jQuery('input.wpa_initiator').each(function(){
var $form=jQuery(this).closest('form');
if($form.find('.wpa_hidden_field').length===0){
jQuery(wpa_hidden_field).insertAfter(this);
}});
}
function wpa_add_test_block(){
checkingTest='<div class="wpa-test-msg"><strong>WP Armour(Only visible to site administrators. Not visible to other users.)</strong><br />This form has a honeypot trap enabled. If you want to act as spam bot for testing purposes, please click the button below.<br/><span class="wpa-button" onclick="wpa_act_as_spam()" data-actiontype="remove">Act as Spam Bot</span></div>';
jQuery('.wpa-test-msg').remove();
jQuery('span.wpa_hidden_field').after(checkingTest);
}
function wpa_remove_honeypot_field(){
jQuery('.wpa_hidden_field').remove();
jQuery('#altEmail_container, .altEmail_container').remove();
if(typeof fluent_forms_global_var_1!=='undefined'){
delete fluent_forms_global_var_1.extra_inputs[wpa_field_name];
delete fluent_forms_global_var_1.extra_inputs['alt_s'];
}};