File: /var/www/html/toniolo/wp-content/plugins/arforms/js/arforms_sortable_resizable.js
function initialize_resizable(e){e=null==e?jQuery(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)"):e.find(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)");let a="",t="",i="",l="",_="",n="",s,d,o="",f="",p="",u="",c="",m,h="",y,w="",v,b;const g=15;let j=jQuery(".arf_inner_wrapper_sortable").width();j<1&&(j=447);var Q=j*g/100;let C=Q=Q<1?50:(Q+Number(1)).toFixed(0);e.each(function(){void 0!==jQuery(this).resizable("instance")&&jQuery(this).resizable("destroy")}),e.resizable({handles:"e",minWidth:Q,classes:{"ui-resizable":"arf_highlight_resizable"},start:function(e,r){e.stopPropagation(),ARF_ROW_WIDTH_CHECK=jQuery(r.element).parents(".arf_inner_wrapper_sortable").width(),ARF_ROW_WIDTH_CHECK!=j&&(j=ARF_ROW_WIDTH_CHECK),Q=j*g/100+Number(1),C=Q.toFixed(0),t=r.helper,n=jQuery(t).attr("data-width")-"0",n=ARFResizeConvertPercentToWidth(j,n),a=r.helper.parent().attr("data-id"),current_resizing_row_width=jQuery('[data-id="'+a+'"]').outerWidth(),i=jQuery(t).next(".sortable_inner_wrapper"),l=jQuery(t).prev(".sortable_inner_wrapper")},resize:function(e,r){e.stopPropagation(),_="",s=jQuery(t).outerWidth(),i.length?(d=i.attr("data-width"),d=ARFResizeConvertPercentToWidth(j,d),o=Number(d)-Number(C)+n,n>s?(f=Number(n)-Number(s),p=Number(d)+Number(f),u=100*Number(s)/j,jQuery(t).css("width",u.toFixed(3)+"%"),jQuery(t).find(".arf_field_width_overlay").html(u.toFixed(1)+"%").attr("data-side","right").css("display","block"),c=100*Number(p)/j,i.css("width",c.toFixed(3)+"%"),i.find(".arf_field_width_overlay").attr("data-side","left").html(c.toFixed(1)+"%").css("display","block")):(m=i.outerWidth(),f=Number(s)-Number(n),h=Number(d)-Number(f),m<=Number(C)?(_=1,u=100*Number(o)/j,jQuery(t).css("width",u.toFixed(3)+"%"),jQuery(t).find(".arf_field_width_overlay").html(u.toFixed(1)+"%").attr("data-side","right").css("display","block"),c=100*Number(C)/j,i.css("width",c.toFixed(3)+"%"),i.find(".arf_field_width_overlay").attr("data-side","left").html(c.toFixed(1)+"%").css("display","block")):(u=100*Number(s)/j,jQuery(t).css("width",u.toFixed(3)+"%"),jQuery(t).find(".arf_field_width_overlay").html(u.toFixed(1)+"%").attr("data-side","right").css("display","block"),c=100*Number(h)/j,i.css("width",c.toFixed(3)+"%"),i.find(".arf_field_width_overlay").html(c.toFixed(1)+"%").attr("data-side","left").css("display","block")))):l.length?(y=l.attr("data-width"),y=ARFResizeConvertPercentToWidth(j,y),o=Number(y)-Number(C)+n,c=n>s?(f=Number(n)-Number(s),w=l.attr("data-width"),w=ARFResizeConvertPercentToWidth(j,w),p=Number(w)+Number(f),u=100*Number(s)/j,jQuery(t).css("width",u.toFixed(3)+"%"),jQuery(t).find(".arf_field_width_overlay").html(u.toFixed(1)+"%").attr("data-side","right").css("display","block"),100*Number(p)/j):(v=l.outerWidth(),f=Number(s)-Number(n),w=l.attr("data-width"),w=ARFResizeConvertPercentToWidth(j,w),h=Number(w)-Number(f),v<=Number(C)?(y,_=2,u=100*Number(o)/j,jQuery(t).css("width",u.toFixed(3)+"%"),jQuery(t).find(".arf_field_width_overlay").html(u.toFixed(1)+"%").attr("data-side","right").css("display","block"),100*Number(C)/j):(l.css("width",h),u=100*Number(s)/j,jQuery(t).css("width",u.toFixed(3)+"%"),jQuery(t).find(".arf_field_width_overlay").html(u.toFixed(1)+"%").attr("data-side","right").css("display","block"),100*Number(h)/j)),l.css("width",c.toFixed(3)+"%"),l.find(".arf_field_width_overlay").html(c.toFixed(1)+"%").attr("data-side","left").css("display","block")):(jQuery(t).css("width","100%"),jQuery(t).find(".arf_field_width_overlay").html("100%").attr("data-side","right").css("display","block"))},stop:function(e,r){e.stopPropagation(),b=jQuery(t).attr("data-width"),b=ARFResizeConvertPercentToWidth(j,b),jQuery('[data-id="'+a+'"]').find(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)").each(function(){if(w=jQuery(this).width(),get_inner_column_outer_width=jQuery(this).outerWidth(),get_inner_column_attr_data_width=jQuery(this).attr("data-width"),u=100*Number(get_inner_column_outer_width)/j,u<g){if(i.length){let e=i.prev(),r=e.attr("data-width");0<e.length||(e=i.next(),r=e.attr("data-width")),Number(get_inner_column_attr_data_width)>=Number(g)?e.css("width",(Number(r)+(Number(get_inner_column_attr_data_width)-Number(g))).toFixed(3)+"%"):e.css("width",(Number(r)+(Number(g)-Number(get_inner_column_attr_data_width))).toFixed(3)+"%")}u=Number(g),jQuery(this).css("width",u.toFixed(3)+"%")}}),jQuery('[data-id="'+a+'"]').find(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater)").each(function(){w=jQuery(this).width();var e=jQuery(this).parents(".arf_inner_wrapper_sortable").width();e!=j&&(j=e),get_inner_column_outer_width=jQuery(this).outerWidth(),u=100*Number(get_inner_column_outer_width)/j,jQuery(this).attr("data-width",u.toFixed(3)),jQuery(this).css("width",u.toFixed(3)+"%")}),null!=jQuery(r.element).attr("id")?(e=jQuery(r.element).attr("id").replace("arfmainfieldid_",""),heightdiv("individual",e)):heightdiv("outerWrapper",r.element),jQuery(".arf_field_width_overlay").fadeOut("fast"),initialize_field_resize_width()}})}function ARFResizeConvertPercentToWidth(e,r){return e*Number(r)/100}function receive_on_common_sortable_func(e,r,f){if(jQuery(f.helper).hasClass("arf_form_element_item")){var p=jQuery(f.helper).attr("data-type");if(jQuery(f.helper).parent().hasClass("newfield_div")||"imagecontrol"==p){var u=document.getElementById("arfmainforminputstyle").value;let a;a="material"==u?arf_parse_json(convert_new_materialize_field_array_json()):"material_outlined"==u?arf_parse_json(convert_new_materialize_outline_field_array_json()):arf_parse_json(convert_new_field_array_json());var c=a[p];let t=arf_generate_field_id();var m=document.getElementById("id").value;let i=randomString(),l=c,_=document.getElementById("arf_editor_total_rows").value,n="",s="",d=[];if("arfcreditcard"==p){let e=a.select;var h=a.select;e=e.replace(/inner_class\=(\'|\")arf_1col(\'|\")/,"inner_class=$1arf31colclass$2");u=a.text+"<--br--\x3e";u+=a.number+"<--br--\x3e",u+=e+"<--br--\x3e",u+=h+"<--br--\x3e",c=u+=a.number,t=arf_generate_field_id(),l=c,i=randomString(),_=jQuery("#arf_editor_total_rows").val();var y=l.split("<--br--\x3e");let r="";arf_parse_json(__ARFCCFIELDOPTIONS);for(var w=0;w<y.length;w++){switch(t=arf_generate_field_id(),i=randomString(),_=parseInt(_)+1,w){case 0:n="text",s="cc_holder_name";break;case 1:n="number",s="cc_number";break;case 2:n="select",s="cc_expiry_month";break;case 3:n="select",s="cc_expiry_year";break;case 4:n="number",s="cc_cvc_number"}d[w]=t+"~!~"+n+"~!~"+s;let e=y[w];e=e.replace(/\{arf_field_id\}/gi,t),e=e.replace(/\{arf_form_id\}/gi,m),e=e.replace(/\{arf_unique_key\}/gi,i),e=e.replace(/\{arf_editor_index_row\}/gi,_),"cc_holder_name"==s||"cc_number"==s||"cc_cvc_number"==s?r=r+e+"</div>":r+=e}l=r.replace("<--br--\x3e"," ")}else l=l.replace(/\{arf_field_id\}/gi,t),l=l.replace(/\{arf_form_id\}/gi,m),l=l.replace(/\{arf_unique_key\}/gi,i),"arf_repeater"!=p&&(_=parseInt(_)+1,l=l.replace(/\{arf_editor_index_row\}/gi,_));if("imagecontrol"==p){var v=Number(f.offset.left)-Number(jQuery("#arfmainformeditorcontainer").offset().left),b=Number(f.offset.top)-Number(190);helper=jQuery(f.helper),v<0&&(v=0),l=l.replace("left:0px;","left:"+v+"px;"),l=l.replace("top:0px;","top:"+b+"px;"),jQuery("#new_fields").append(l)}else if(jQuery(f.helper).replaceWith(l),"arfcreditcard"==p){var g=Object.keys(d);window.is_loading=!0;for(var j=0;j<g.length;j++){var Q=(N=d[j].split("~!~"))[0],C=N[1],z=N[2];arf_init_cc_field(Q,C,z)}}if(1==document.getElementById("arfhidelabels").value&&jQuery("#arf_field_"+t).addClass("none_container"),document.getElementById("arf_editor_total_rows").value=_,SetDefaultColumnWidth(),"arfcreditcard"!=p)arf_load_bootstrap_js_css(p,t);else for(var x=Object.keys(d),j=0;j<x.length;j++){var N,Q=(N=d[j].split("~!~"))[0],C=N[1];arf_load_bootstrap_js_css(C,Q)}let o=arf_retrieve_field_data(t);c=o.name;if("imagecontrol"==p){o.image_left=v+"px",o.image_top=b+"px",o.editor_image_top=b+"px";var H=helper.offset().top,M=jQuery("#new_fields .edit_field_type_break").length;let r=1;if(0<M){let e=1;for(var A=0;A<M;A++){var k=jQuery(jQuery("#new_fields .edit_field_type_break")[A]).parent(".arf_inner_wrapper_sortable").offset().top;k<H&&(e++,r=e,o.image_top=H-k+"px")}}o.page_no=r;b=JSON.stringify(o);document.getElementById("arf_field_data_"+t).value=b,jQuery("#arf_field_data_"+t).trigger("change")}"arfcreditcard"!=p&&(window.is_add_new_field=!0,E={field_id:t,field_name:c,field_type:p},window.added_new_fields.push(E),window.loaded_settings=[])}}else if(jQuery(f.helper).hasClass("arfformfield")){jQuery(f.helper).removeAttr("style");let r=jQuery(f.helper).attr("id");c=r.replace("arf_field_","");arf_initialize_control(c,!0);let a=arf_retrieve_field_data(c);var p=a.id,E=a.type;if(null!=a){jQuery(f.helper).parent().find(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)").removeAttr("id"),jQuery(f.helper).parent().find(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)").removeClass("edit_field_type_"+E);var t=jQuery(f.helper).prop("outerHTML");let e="";"matrix"!=E&&"arf_wysiwyg"!=E&&(e=multicol_html());t="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+jQuery("#arf_editor_total_rows").val()+"'>"+e+"<div class='sortable_inner_wrapper edit_field_type_"+E+" arf_1col arf1columns' id='"+r+"' inner_class='arf_1col'>"+t+"</div></div>";jQuery(f.helper).replaceWith(t),arf_load_bootstrap_js_css(E,c)}else{t=jQuery(f.helper).prop("outerHTML");let e="";"matrix"!=E&&"arf_wysiwyg"!=E&&(e=multicol_html());t="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+jQuery("#arf_editor_total_rows").val()+"'>"+e+"<div class='sortable_inner_wrapper edit_field_type_"+E+" arf_1col arf1columns' id='"+r+"' inner_class='arf_1col'>"+t+"</div></div>";jQuery(f.helper).replaceWith(t)}if(0==jQuery("#arf_field_"+c).parents(".edit_field_type_arf_repeater").length){let e=!1;null!=a&&void 0!==a.has_parent&&(e=!0,delete a.has_parent),null!=a&&void 0!==a.parent_field&&(e=!0,delete a.parent_field),null!=a&&void 0!==a.parent_field_type&&(e=!0,delete a.parent_field_type),e&&jQuery("#arf_field_data_"+c).val(JSON.stringify(a))}if(0==jQuery("#arf_field_"+c).parents(".edit_field_type_arf_section").length){let e=!1;null!=a&&void 0!==a.has_parent&&(e=!0,delete a.has_parent),null!=a&&void 0!==a.parent_field&&(e=!0,delete a.parent_field),null!=a&&void 0!==a.parent_field_type&&(e=!0,delete a.parent_field_type),e&&jQuery("#arf_field_data_"+c).val(JSON.stringify(a))}arf_initialize_control(c),/[\d+](_confirm)/gi.test(c)||(field_name=a.name,arf_update_name_dropdown(c,E,field_name),arf_set_new_conditional_action(p,field_name)),arf_reset_single_field_ids(c)}removeBlankElm()}function initialize_element_sortable(e){var r="#new_fields,.two_column_wrapper .sortable_inner_wrapper, .three_column_wrapper .sortable_inner_wrapper, .four_column_wrapper .sortable_inner_wrapper, .five_column_wrapper .sortable_inner_wrapper, .six_column_wrapper .sortable_inner_wrapper,.edit_field_type_arf_repeater,.edit_field_type_arf_section",a={connectToSortable:r,helper:"clone",sort:function(e,r){e.stopPropagation()},receive:function(e,r){e.stopPropagation(),receive_on_common_sortable_func(jQuery(this),e,r)},over:function(e,r){e.stopPropagation(),e.preventDefault()},stop:function(e,r){e.stopPropagation(),initialize_field_resize_width()}},r={connectToSortable:r,revert:100,cancel:".arf_field_option_model_cloned,.arf_field_values_model,.arf_field_row_values_model,.arf_main_label,.controls,input,textarea,select,#required,#fieldoption,#duplicate,#delete,#edit_opt_icon,#running_total_icon,.arf_field_option_multicolumn,.arf_form_element_item:not(#imagecontrol)",forcePlaceholderSize:!0,refreshPositions:!0,stop:function(e,r){e.stopPropagation(),window.get_sender_arf_row="",jQuery(r.helper).removeAttr("style");var a,e=jQuery(r.helper).attr("id");jQuery("#"+e).hasClass("ui-draggable-dragging")&&(jQuery("#"+e).removeAttr("style").removeClass("ui-draggable-dragging").removeClass("ui-sortable-helper"),jQuery("#"+e).find(".arf_fieldiconbox").removeAttr("style"),jQuery("#"+e).find(".arf_field_action_iconbox").removeAttr("style")),a=r,setTimeout(function(){var e=a.helper[0].attributes.id.nodeValue.replace("arf_field_","");heightdiv("individual",e)},10),jQuery(".sortable_inner_wrapper").removeClass("current_sortable_class"),jQuery(".sortable_inner_wrapper").removeClass("receiver_sortable_class"),SetDefaultColumnWidth()}};jQuery(".arf_form_elements_container .arf_form_element_item:not(#imagecontrol)").draggable(a).sortable(a),jQuery(".sortable_inner_wrapper .arfformfield").draggable(r)}function addinnerclasses(){let e="";var r=document.getElementsByClassName("sortable_inner_wrapper"),a=r.length;if(0<a)for(var t=0;t<a;t++){var i,l=r[t],_=l.getAttribute("inner_class"),n="",n="arf_2col"==_||"arf21colclass"==_?"arf_2":"arf31colclass"==_||"arf_23col"==_||"arf_3col"==_?"arf_3":"arf41colclass"==_||"arf42colclass"==_||"arf43colclass"==_||"arf_4col"==_?"arf_4":"arf51colclass"==_||"arf52colclass"==_||"arf53colclass"==_||"arf54colclass"==_||"arf_5col"==_?"arf_5":"arf61colclass"==_||"arf62colclass"==_||"arf63colclass"==_||"arf64colclass"==_||"arf65colclass"==_||"arf_6col"==_?"arf_6":"arf_1",s=l.getElementsByClassName("arfformfield");0<s.length&&(null==(s=s[0])||null!=(s=s.id)&&(s=s.replace("arf_field_",""),1==l.getElementsByClassName("arf_confirm_field").length?(l=s.replace("_confirm",""),null!==(i=arf_retrieve_field_data(l))&&("email"==i.type?(i.confirm_email_inner_classes=_,i.confirm_email_classes=n):(i.confirm_password_inner_classes=_,i.confirm_password_classes=n),e=JSON.stringify(i),document.getElementById("arf_field_data_"+l).value=e)):null!==(i=arf_retrieve_field_data(s))&&(i.inner_class=_,i.classes=n,e=JSON.stringify(i),document.getElementById("arf_field_data_"+s).value=e)))}}function SetDefaultColumnWidth(r){if(void 0===r||0==r)for(var e=document.querySelectorAll(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)"),a=e.length,t=0;t<a;t++){var i=e[t],l=arfClosest(i,".arf_inner_wrapper_sortable");(o=void 0!==l&&null!=l?l.offsetWidth:447)<1&&(o=447),o-=10;var _=100*Number(i.offsetWidth)/Number(o);i.setAttribute("data-width",_.toFixed(3)),0==i.getElementsByClassName("arf_field_width_overlay").length&&(100<Number(_)&&(_=100),(l=document.createElement("div")).className="arf_field_width_overlay",l.setAttribute("data-side","left"),l.innerHTML=_.toFixed(1)+"%",i.appendChild(l))}else{let e=arfClosest(r,".arf_inner_wrapper_sortable");var n=e.querySelectorAll(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater):not(.edit_field_type_arf_section)"),s=n.length;if(0<s)for(var d=0;d<s;d++){var o,f=n[d];f.style.width="",(o=f.parentNode.offsetWidth)<1&&(o=447),o-=10;var p,_=100*Number(f.offsetWidth)/o;f.setAttribute("data-width",_.toFixed(3)),0==(i=f.getElementsByClassName("arf_field_width_overlay")).length&&(100<Number(_)&&(_=100),(p=document.createElement("div")).className="arf_field_width_overlay",p.setAttribute("data-side","left"),p.innerHTML=_+"%",f.appendChild(p))}}initialize_field_resize_width()}function sortable_inner(o,f,p){if(""!=o&&""!=p&&null!=o&&null!=p){let s="1",d="1";jQuery(".sortable_inner_wrapper.receiver_sortable_class").length&&jQuery(".sortable_inner_wrapper.current_sortable_class, .sortable_inner_wrapper.receiver_sortable_class").each(function(e,r){var a,t,i,l,_,n;if(jQuery(this).hasClass("current_sortable_class")&&"1"==s?(jQuery(this).append(p),jQuery(this).attr("id",o),t=jQuery(this).attr("inner_class"),a=o.replace("arfmainfieldid_",""),jQuery(this).addClass("sortable_inner_wrapper"),jQuery(this).addClass(t),null!=(t=arf_retrieve_field_data(a))&&(i=t.type),""!=f&&(n=f.replace("arf_field_","").replace("_confirm",""),_=arf_retrieve_field_data(n),l="",null!=_&&(l=_.type,setTimeout(function(){jQuery("#arfmainfieldid_"+n).removeClass("edit_field_type_"+i),jQuery("#arfmainfieldid_"+n).removeClass("edit_field_type_"+l),jQuery("#arfmainfieldid_"+n).addClass("edit_field_type_"+l),"email"!=l&&"password"!=l||jQuery("#arfmainfieldid_"+n).removeClass("arf_confirm_field")},200)),jQuery("#arfmainfieldid_"+a).hasClass("arf_confirm_field")?setTimeout(function(){null!=i&&(jQuery("#arfmainfieldid_"+n).removeClass("edit_field_type_"+i),jQuery("#arfmainfieldid_"+a).removeClass("edit_field_type_"+l),jQuery("#arfmainfieldid_"+a).addClass("edit_field_type_"+i)),jQuery("#arfmainfieldid_"+a).removeClass("arf_confirm_field")},10):setTimeout(function(){null!=i&&(jQuery("#arfmainfieldid_"+n).removeClass("edit_field_type_"+i),jQuery("#arfmainfieldid_"+a).removeClass("edit_field_type_"+l),jQuery("#arfmainfieldid_"+a).addClass("edit_field_type_"+i))},10)),jQuery(this).addClass("ui-resizable"),s="0",jQuery(this).removeClass("current_sortable_class")):jQuery(this).hasClass("receiver_sortable_class")&&"1"==d&&(_=o.replace("arfmainfieldid_",""),n=f.replace("arf_field_",""),jQuery(this).find("#arf_field_"+_).remove(),jQuery(this).hasClass("edit_field_type_arf_repeater")||jQuery(this).hasClass("edit_field_type_arf_section")||jQuery(this).attr("id","arfmainfieldid_"+n),jQuery(this).removeClass("receiver_sortable_class"),d="0",jQuery(this).removeClass("receiver_sortable_class")),"0"==s&&"0"==d)return!1})}}function removePlaceholder(e,r,a){var t,i=jQuery(e).attr("id");jQuery(a.placeholder).css({position:"relative",width:"inherit",height:"inherit",border:"inherit"}),null==i||""==i||null==i?jQuery(a.helper).hasClass("frm_tbreak")||jQuery(a.helper).hasClass("frm_tdivider")||jQuery(a.placeholder).css({position:"absolute",width:jQuery(a.placeholder).parent().width()-Number(0),height:jQuery(a.placeholder).parent().height()-Number(0)}):(t=jQuery(a.sender).find(".arfformfield").attr("id"),e=jQuery(a.item).attr("id"),jQuery(a.placeholder).css({position:"absolute",width:jQuery(a.placeholder).parent().width()-Number(0),height:jQuery(a.placeholder).parent().height()-Number(0)}),void 0===t?(jQuery("#"+i).hasClass("edit_field_type_arf_repeater")||jQuery("#"+i).hasClass("edit_field_type_arf_section"))&&jQuery(a.placeholder).css({position:"relative",height:jQuery(a.item).height()}):t!=e?jQuery("#"+i).hasClass("edit_field_type_arf_repeater")||jQuery("#"+i).hasClass("edit_field_type_arf_section")?jQuery(a.placeholder).css({position:"relative",height:jQuery(a.item).height()}):jQuery(a.placeholder).css({border:"0px solid"}):t==e&&(jQuery("#"+i).hasClass("edit_field_type_arf_section")||jQuery("#"+i).hasClass("edit_field_type_arf_repeater"))&&jQuery(a.placeholder).css({position:"relative",height:jQuery(a.item).height()}))}function initialize_on_sortable_focus_tipso(e,r){"0"==r?setTimeout(function(){jQuery(".arf_materialize_form #arf_field_"+e+" .arfhelptipfocus").tipso("destroy"),jQuery(".arf_materialize_form .edit_field_type_file #arf_field_"+e+", .arf_materialize_form .edit_field_type_radio #arf_field_"+e+", .arf_materialize_form .edit_field_type_checkbox #arf_field_"+e+", .arf_materialize_form .edit_field_type_select #arf_field_"+e+", .arf_materialize_form .edit_field_type_arf_multiselect #arf_field_"+e+", .arf_materialize_form .edit_field_type_scale #arf_field_"+e+", .arf_materialize_form .edit_field_type_arfslider #arf_field_"+e+", .arf_materialize_form .edit_field_type_colorpicker #arf_field_"+e+", .arf_materialize_form .edit_field_type_like #arf_field_"+e+", .arf_materialize_form .edit_field_type_arf_smiley #arf_field_"+e+", .arf_materialize_form .edit_field_type_arf_switch #arf_field_"+e).find(".arfhelptipfocus").each(function(){jQuery(this).tipso("destroy");var e,r,a,t=jQuery(this).attr("data-title");null!=t&&(e=document.getElementById("arf_tooltip_bg_color").value,r=document.getElementById("arf_tooltip_font_color").value,a=jQuery('input[name="arftippos"]:checked').val(),jQuery(this).tipso({position:a,width:"auto",useTitle:!1,content:t,background:e,color:r}))}),jQuery(".arf_materialize_form #arf_field_"+e+" .arfhelptipfocus input,.arf_materialize_form #arf_field_"+e+" .arfhelptipfocus textarea").on("focus",function(e){let r=document.getElementById("arf_tooltip_bg_color").value,a=document.getElementById("arf_tooltip_font_color").value;jQuery(this).parent().parent().each(function(){jQuery(this).tipso("destroy");var e=jQuery(this).attr("data-title");null!=e&&(e=jQuery(this).tipso({position:"top",width:"auto",useTitle:!1,content:e,background:r,color:a}),jQuery(this).tipso("show"),e.off("mouseover.tipso"),e.off("mouseout.tipso"))})}),jQuery(document).on("focusout",".arf_materialize_form #arf_field_"+e+" .arfhelptipfocus input,.arf_materialize_form #arf_field_"+e+" .arfhelptipfocus textarea",function(e){jQuery(this).parent().parent().each(function(){jQuery(this).tipso("hide"),jQuery(this).tipso("destroy")})})},300):setTimeout(function(){jQuery(".arf_materialize_form [data-id='"+e+"'] .arfhelptipfocus").tipso("destroy"),jQuery(".arf_materialize_form [data-id='"+e+"'] .edit_field_type_file, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_radio, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_checkbox, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_select, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_arf_multiselect, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_scale, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_arfslider, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_colorpicker, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_like, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_arf_smiley, .arf_materialize_form [data-id='"+e+"'] .edit_field_type_arf_switch").find(".arfhelptipfocus").each(function(){jQuery(this).tipso("destroy");var e,r,a,t=jQuery(this).attr("data-title");null!=t&&(e=document.getElementById("arf_tooltip_bg_color").value,r=document.getElementById("arf_tooltip_font_color").value,a=jQuery('input[name="arftippos"]:checked').val(),jQuery(this).tipso({position:a,width:"auto",useTitle:!1,content:t,background:e,color:r}))}),jQuery(".arf_materialize_form [data-id='"+e+"'] .arfhelptipfocus input,.arf_materialize_form [data-id='"+e+"'] .arfhelptipfocus textarea").on("focus",function(e){let r=document.getElementById("arf_tooltip_bg_color").value,a=document.getElementById("arf_tooltip_font_color").value;jQuery(this).parent().parent().each(function(){jQuery(this).tipso("destroy");var e=jQuery(this).attr("data-title");null!=e&&(e=jQuery(this).tipso({position:"top",width:"auto",useTitle:!1,content:e,background:r,color:a}),jQuery(this).tipso("show"),e.off("mouseover.tipso"),e.off("mouseout.tipso"))})}),jQuery(document).on("focusout",".arf_materialize_form [data-id='"+e+"'] .arfhelptipfocus input,.arf_materialize_form [data-id='"+e+"'] .arfhelptipfocus textarea",function(e){jQuery(this).parent().parent().each(function(){jQuery(this).tipso("hide"),jQuery(this).tipso("destroy")})})},300)}function getSingleHtml(e,r,a,t){let i="";return(r.hasClass("two_column_wrapper")||r.hasClass("three_column_wrapper")||r.hasClass("four_column_wrapper")||r.hasClass("five_column_wrapper")||r.hasClass("six_column_wrapper"))&&(i=r.find(".sortable_inner_wrapper").first().prop("outerHTML")),{single:i,others:""}}function getThreeHtml(e,r){let a="";return a=jQuery(r).hasClass("single_column_wrapper")||jQuery(r).hasClass("two_column_wrapper")||jQuery(r).hasClass("four_column_wrapper")||jQuery(r).hasClass("five_column_wrapper")||jQuery(r).hasClass("six_column_wrapper")?jQuery(r).find(".sortable_inner_wrapper").prop("outerHTML"):"<div class='sortable_inner_wrapper'></div>",a+"<div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div>"}function getFourHtml(e,r){let a="";return a=jQuery(r).hasClass("single_column_wrapper")||jQuery(r).hasClass("two_column_wrapper")||jQuery(r).hasClass("three_column_wrapper")||jQuery(r).hasClass("five_column_wrapper")||jQuery(r).hasClass("six_column_wrapper")?jQuery(r).find(".sortable_inner_wrapper").prop("outerHTML"):"<div class='sortable_inner_wrapper'></div>",a+"<div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div>"}function getFiveHtml(e,r){let a="";return a=jQuery(r).hasClass("single_column_wrapper")||jQuery(r).hasClass("two_column_wrapper")||jQuery(r).hasClass("three_column_wrapper")||jQuery(r).hasClass("four_column_wrapper")||jQuery(r).hasClass("six_column_wrapper")?jQuery(r).find(".sortable_inner_wrapper").prop("outerHTML"):"<div class='sortable_inner_wrapper'></div>",a+"<div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div>"}function getSixHtml(e,r){let a="";return a=jQuery(r).hasClass("single_column_wrapper")||jQuery(r).hasClass("two_column_wrapper")||jQuery(r).hasClass("three_column_wrapper")||jQuery(r).hasClass("four_column_wrapper")||jQuery(r).hasClass("five_column_wrapper")?jQuery(r).find(".sortable_inner_wrapper").prop("outerHTML"):"<div class='sortable_inner_wrapper'></div>",a+"<div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div><div class='sortable_inner_wrapper'></div>"}function make_inner_sortable_into_1_part(e){let r=arfClosest(e,".arf_inner_wrapper_sortable"),a=jQuery(r);if(hasClass(r,"single_column_wrapper"))return!1;var t=a.find(".sortable_inner_wrapper").droppable("instance"),i=a.find(".sortable_inner_wrapper").sortable("instance");if(void 0!==t&&void 0!==i&&a.find(".sortable_inner_wrapper").droppable("destroy").sortable("destroy"),null==r)return!1;var l=r.getElementsByClassName("sortable_inner_wrapper"),_=l.length;let n="";for(var s=0;s<_;s++){var d=l[s];hasClass(d,"sortable_inner_wrapper")&&jQuery(d).resizable("destroy");d=d.getAttribute("id");null!=d&&(d=d.replace("arfmainfieldid_",""),arf_initialize_control(d,!0))}let o="",f="",p="",u="",c="";let m=!1,h=!1,y=!1;let w=!1,v=!1;hasClass(r,"two_column_wrapper")?m=!0:hasClass(r,"three_column_wrapper")?h=!0:hasClass(r,"four_column_wrapper")?y=!0:hasClass(r,"five_column_wrapper")?w=!0:hasClass(r,"six_column_wrapper")&&(v=!0),m&&(c=arfgetcolumnhtmlfunction(a,3,1)),h&&(o=arfgetcolumnhtmlfunction(a,3,1),c=arfgetcolumnhtmlfunction(a,4,1)),y&&(o=arfgetcolumnhtmlfunction(a,3,1),f=arfgetcolumnhtmlfunction(a,4,1),c=arfgetcolumnhtmlfunction(a,5,1)),w&&(o=arfgetcolumnhtmlfunction(a,3,1),f=arfgetcolumnhtmlfunction(a,4,1),p=arfgetcolumnhtmlfunction(a,5,1),c=arfgetcolumnhtmlfunction(a,6,1)),v&&(o=arfgetcolumnhtmlfunction(a,3,1),f=arfgetcolumnhtmlfunction(a,4,1),p=arfgetcolumnhtmlfunction(a,5,1),u=arfgetcolumnhtmlfunction(a,6,1),c=arfgetcolumnhtmlfunction(a,7,1));e=getSingleHtml(e,a,!1,!1);a.find(".sortable_inner_wrapper").each(function(e,r){jQuery(this).remove()}),a.append(e.single),""!=c&&(arfgetnewrowfunction(c,a),set_height_elment_column_six=arf_field_elem_attr_id),""!=u&&(arfgetnewrowfunction(u,a),set_height_elment_column_five=arf_field_elem_attr_id),""!=p&&(arfgetnewrowfunction(p,a),set_height_elment_column_four=arf_field_elem_attr_id),""!=f&&(arfgetnewrowfunction(f,a),set_height_elment_column_three=arf_field_elem_attr_id),""!=o&&(arfgetnewrowfunction(o,a),set_height_elment_column_two=arf_field_elem_attr_id),h&&(removeClass(r,"three_column_wrapper"),addClass(r,"single_column_wrapper")),y&&(removeClass(r,"four_column_wrapper"),addClass(r,"single_column_wrapper")),w&&(removeClass(r,"five_column_wrapper"),addClass(r,"single_column_wrapper")),v&&(removeClass(r,"six_column_wrapper"),addClass(r,"single_column_wrapper")),m&&(removeClass(r,"two_column_wrapper"),addClass(r,"single_column_wrapper"));let b=r.getElementsByClassName("sortable_inner_wrapper")[0];addClass(b,"arf_1col"),b.setAttribute("inner_class","arf_1col"),n=b.getAttribute("id"),null!=n&&(n=n.replace("arfmainfieldid_",""),arf_initialize_control(n)),a.find(".sortable_inner_wrapper").each(function(e,r){1==jQuery(this).find(".arfformfield").length&&jQuery(this).find(".arfformfield").removeAttr("style")})}function make_inner_sortable_into_4_part(e){let r=arfClosest(e,".arf_inner_wrapper_sortable"),a=jQuery(r);if(hasClass(r,"four_column_wrapper"))return!1;var t=a.find(".sortable_inner_wrapper").droppable("instance"),i=a.find(".sortable_inner_wrapper").sortable("instance");void 0!==t&&void 0!==i&&a.find(".sortable_inner_wrapper").droppable("destroy").sortable("destroy");for(var l=r.getElementsByClassName("sortable_inner_wrapper"),_=l.length,n=0;n<_;n++){var s=l[n];hasClass(s,"ui-resizable")&&jQuery(s).resizable("destroy");s=s.getAttribute("id");null!=s&&(s=s.replace("arfmainfieldid_",""),arf_initialize_control(s,!0))}e=getFourHtml(e,a);let d="",o="",f="",p="",u="";hasClass(r,"two_column_wrapper")?(removeClass(r,"two_column_wrapper"),addClass(r,"four_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0)):hasClass(r,"three_column_wrapper")?(removeClass(r,"three_column_wrapper"),addClass(r,"four_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0)):hasClass(r,"five_column_wrapper")?(removeClass(r,"five_column_wrapper"),addClass(r,"four_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,0),p=arfgetcolumnhtmlfunction(a,6,1)):hasClass(r,"six_column_wrapper")?(removeClass(r,"six_column_wrapper"),addClass(r,"four_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,0),p=arfgetcolumnhtmlfunction(a,6,1),u=arfgetcolumnhtmlfunction(a,7,1)):hasClass(r,"single_column_wrapper")&&(removeClass(r,"single_column_wrapper"),addClass(r,"four_column_wrapper")),a.find(".sortable_inner_wrapper").each(function(e,r){jQuery(this).remove()}),a.append(e),""!=d&&a.find(".sortable_inner_wrapper").first().next().replaceWith(d),""!=o&&a.find(".sortable_inner_wrapper").first().next().next().replaceWith(o),""!=f&&a.find(".sortable_inner_wrapper").last().replaceWith(f),""!=u&&(arfgetnewrowfunction(u,a),set_height_elment_column_six=arf_field_elem_attr_id),""!=p&&(arfgetnewrowfunction(p,a),set_height_elment_column_five=arf_field_elem_attr_id);let c=r.getElementsByClassName("sortable_inner_wrapper")[0],m=r.getElementsByClassName("sortable_inner_wrapper")[1],h=r.getElementsByClassName("sortable_inner_wrapper")[2],y=r.getElementsByClassName("sortable_inner_wrapper")[3];addClass(c,"arf41colclass"),c.setAttribute("inner_class","arf41colclass"),addClass(m,"arf42colclass"),m.setAttribute("inner_class","arf42colclass"),addClass(h,"arf43colclass"),h.setAttribute("inner_class","arf43colclass"),addClass(y,"arf_4col"),y.setAttribute("inner_class","arf_4col"),a.find(".sortable_inner_wrapper").each(function(e,r){var a;1==jQuery(this).find(".arfformfield").length&&(jQuery(this).find(".arfformfield").removeAttr("style"),a=jQuery(this).attr("id").replace("arfmainfieldid_",""),arf_initialize_control(a))}),document.getElementById("arf_single_column_field_ids").value="",window.arf_sender_id="",window.arf_sender_parent={},window.arf_sender_previous={}}function make_inner_sortable_into_6_part(e){let r=arfClosest(e,".arf_inner_wrapper_sortable"),a=jQuery(r);if(hasClass(r,"six_column_wrapper"))return!1;var t=a.find(".sortable_inner_wrapper").droppable("instance"),i=a.find(".sortable_inner_wrapper").sortable("instance");void 0!==t&&void 0!==i&&a.find(".sortable_inner_wrapper").droppable("destroy").sortable("destroy");for(var l=r.getElementsByClassName("sortable_inner_wrapper"),_=l.length,n=0;n<_;n++){var s=l[n];hasClass(s,"ui-resizable")&&jQuery(s).resizable("destroy");s=s.getAttribute("id");null!=s&&(s=s.replace("arfmainfieldid_",""),arf_initialize_control(s,!0))}e=getSixHtml(e,a);let d="",o="",f="",p="";hasClass(r,"two_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),removeClass(r,"two_column_wrapper"),addClass(r,"six_column_wrapper")):hasClass(r,"three_column_wrapper")?(removeClass(r,"three_column_wrapper"),addClass(r,"six_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0)):hasClass(r,"four_column_wrapper")?(removeClass(r,"four_column_wrapper"),addClass(r,"six_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,0)):hasClass(r,"five_column_wrapper")?(removeClass(r,"five_column_wrapper"),addClass(r,"six_column_wrapper"),d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,0),p=arfgetcolumnhtmlfunction(a,6,0)):hasClass(r,"single_column_wrapper")&&(removeClass(r,"single_column_wrapper"),addClass(r,"six_column_wrapper")),a.find(".sortable_inner_wrapper").each(function(e,r){jQuery(this).remove()}),a.append(e),""!=d&&a.find(".sortable_inner_wrapper").first().next().replaceWith(d),""!=o&&a.find(".sortable_inner_wrapper").first().next().next().replaceWith(o),""!=f&&a.find(".sortable_inner_wrapper").first().next().next().next().replaceWith(f),""!=p&&a.find(".sortable_inner_wrapper").first().next().next().next().next().replaceWith(p);let u=r.getElementsByClassName("sortable_inner_wrapper")[0],c=r.getElementsByClassName("sortable_inner_wrapper")[1],m=r.getElementsByClassName("sortable_inner_wrapper")[2],h=r.getElementsByClassName("sortable_inner_wrapper")[3],y=r.getElementsByClassName("sortable_inner_wrapper")[4],w=r.getElementsByClassName("sortable_inner_wrapper")[5];addClass(u,"arf61colclass"),u.setAttribute("inner_class","arf61colclass"),addClass(c,"arf62colclass"),c.setAttribute("inner_class","arf62colclass"),addClass(m,"arf63colclass"),m.setAttribute("inner_class","arf63colclass"),addClass(h,"arf64colclass"),h.setAttribute("inner_class","arf64colclass"),addClass(y,"arf65colclass"),y.setAttribute("inner_class","arf65colclass"),addClass(w,"arf_6col"),w.setAttribute("inner_class","arf_6col"),a.find(".sortable_inner_wrapper").each(function(e,r){var a;1==jQuery(this).find(".arfformfield").length&&(jQuery(this).find(".arfformfield").removeAttr("style"),a=jQuery(this).attr("id").replace("arfmainfieldid_",""),arf_initialize_control(a))}),document.getElementById("arf_single_column_field_ids").value="",window.arf_sender_id="",window.arf_sender_parent={},window.arf_sender_previous={}}function make_inner_sortable_into_5_part(e){let r=arfClosest(e,".arf_inner_wrapper_sortable"),a=jQuery(r);if(hasClass(r,"five_column_wrapper"))return!1;var t=a.find(".sortable_inner_wrapper").droppable("instance"),i=a.find(".sortable_inner_wrapper").sortable("instance");void 0!==t&&void 0!==i&&a.find(".sortable_inner_wrapper").droppable("destroy").sortable("destroy");for(var l=r.getElementsByClassName("sortable_inner_wrapper"),_=l.length,n=0;n<_;n++){var s=l[n];hasClass(s,"ui-resizable")&&jQuery(s).resizable("destroy");s=s.getAttribute("id");null!=s&&(s=s.replace("arfmainfieldid_",""),arf_initialize_control(s,!0))}e=getFiveHtml(e,a);let d="",o="",f="",p="",u="";hasClass(r,"two_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),removeClass(r,"two_column_wrapper"),addClass(r,"five_column_wrapper")):hasClass(r,"three_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),removeClass(r,"three_column_wrapper"),addClass(r,"five_column_wrapper")):hasClass(r,"four_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,0),removeClass(r,"four_column_wrapper"),addClass(r,"five_column_wrapper")):hasClass(r,"six_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,0),p=arfgetcolumnhtmlfunction(a,6,0),u=arfgetcolumnhtmlfunction(a,7,1),removeClass(r,"six_column_wrapper"),addClass(r,"five_column_wrapper")):hasClass(r,"single_column_wrapper")&&(removeClass(r,"single_column_wrapper"),addClass(r,"five_column_wrapper")),a.find(".sortable_inner_wrapper").each(function(e,r){jQuery(this).remove()}),a.append(e),""!=d&&a.find(".sortable_inner_wrapper").first().next().replaceWith(d),""!=o&&a.find(".sortable_inner_wrapper").first().next().next().replaceWith(o),""!=f&&a.find(".sortable_inner_wrapper").first().next().next().next().replaceWith(f),""!=p&&a.find(".sortable_inner_wrapper").last().replaceWith(p),""!=u&&(arfgetnewrowfunction(u,a),set_height_elment_column_six=arf_field_elem_attr_id);let c=r.getElementsByClassName("sortable_inner_wrapper")[0],m=r.getElementsByClassName("sortable_inner_wrapper")[1],h=r.getElementsByClassName("sortable_inner_wrapper")[2],y=r.getElementsByClassName("sortable_inner_wrapper")[3],w=r.getElementsByClassName("sortable_inner_wrapper")[4];addClass(c,"arf51colclass"),c.setAttribute("inner_class","arf51colclass"),addClass(m,"arf52colclass"),m.setAttribute("inner_class","arf52colclass"),addClass(h,"arf53colclass"),h.setAttribute("inner_class","arf53colclass"),addClass(y,"arf54colclass"),y.setAttribute("inner_class","arf54colclass"),addClass(w,"arf_5col"),w.setAttribute("inner_class","arf_5col"),a.find(".sortable_inner_wrapper").each(function(e,r){var a;1==jQuery(this).find(".arfformfield").length&&(jQuery(this).find(".arfformfield").removeAttr("style"),a=jQuery(this).attr("id").replace("arfmainfieldid_",""),arf_initialize_control(a))}),document.getElementById("arf_single_column_field_ids").value="",window.arf_sender_id="",window.arf_sender_parent={},window.arf_sender_previous={}}function make_inner_sortable_into_3_part(e){let r=arfClosest(e,".arf_inner_wrapper_sortable"),a=jQuery(r);if(hasClass(r,"three_column_wrapper"))return!1;var t=a.find(".sortable_inner_wrapper").droppable("instance"),i=a.find(".sortable_inner_wrapper").sortable("instance");void 0!==t&&void 0!==i&&a.find(".sortable_inner_wrapper").droppable("destroy").sortable("destroy");for(var l=r.getElementsByClassName("sortable_inner_wrapper"),_=l.length,n=0;n<_;n++){var s=l[n];hasClass(s,"ui-resizable")&&jQuery(s).resizable("destroy");s=s.getAttribute("id");null!=s&&(s=s.replace("arfmainfieldid_",""),arf_initialize_control(s,!0))}e=getThreeHtml(e,a);let d="",o="",f="",p="",u="";hasClass(r,"two_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),removeClass(r,"two_column_wrapper"),addClass(r,"three_column_wrapper")):hasClass(r,"four_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,1),removeClass(r,"four_column_wrapper"),addClass(r,"three_column_wrapper")):hasClass(r,"five_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,1),p=arfgetcolumnhtmlfunction(a,6,1),removeClass(r,"five_column_wrapper"),addClass(r,"three_column_wrapper")):hasClass(r,"six_column_wrapper")?(d=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,0),f=arfgetcolumnhtmlfunction(a,5,1),p=arfgetcolumnhtmlfunction(a,6,1),u=arfgetcolumnhtmlfunction(a,7,1),removeClass(r,"six_column_wrapper"),addClass(r,"three_column_wrapper")):hasClass(r,"single_column_wrapper")&&(removeClass(r,"single_column_wrapper"),addClass(r,"three_column_wrapper")),a.find(".sortable_inner_wrapper").each(function(e,r){jQuery(this).remove()}),a.append(e),""!=d&&a.find(".sortable_inner_wrapper").first().next().replaceWith(d),""!=o&&a.find(".sortable_inner_wrapper").last().replaceWith(o),""!=u&&(arfgetnewrowfunction(u,a),set_height_elment_column_six=arf_field_elem_attr_id),""!=p&&(arfgetnewrowfunction(p,a),set_height_elment_column_five=arf_field_elem_attr_id),""!=f&&(arfgetnewrowfunction(f,a),set_height_elment_column_four=arf_field_elem_attr_id);let c=r.getElementsByClassName("sortable_inner_wrapper")[0],m=r.getElementsByClassName("sortable_inner_wrapper")[1],h=r.getElementsByClassName("sortable_inner_wrapper")[2];addClass(c,"arf31colclass"),c.setAttribute("inner_class","arf31colclass"),addClass(m,"arf_23col"),m.setAttribute("inner_class","arf_23col"),addClass(h,"arf_3col"),h.setAttribute("inner_class","arf_3col"),a.find(".sortable_inner_wrapper").each(function(e,r){var a;1==jQuery(this).find(".arfformfield").length&&(jQuery(this).find(".arfformfield").removeAttr("style"),a=jQuery(this).attr("id").replace("arfmainfieldid_",""),arf_initialize_control(a))}),document.getElementById("arf_single_column_field_ids").value="",window.arf_sender_id="",window.arf_sender_parent={},window.arf_sender_previous={}}function make_inner_sortable_into_2_part(e){let r=arfClosest(e,".arf_inner_wrapper_sortable"),a=jQuery(r);if(hasClass(r,"two_column_wrapper"))return!1;var t,i=a.find(".sortable_inner_wrapper").droppable("instance"),l=a.find(".sortable_inner_wrapper").sortable("instance");void 0!==i&&void 0!==l&&a.find(".sortable_inner_wrapper").droppable("destroy").sortable("destroy");for(t of r.getElementsByClassName("sortable_inner_wrapper")){hasClass(t,"ui-resizable")&&jQuery(t).resizable("destroy");let e=t.getAttribute("id");null!=e&&arf_initialize_control(e.replace("arfmainfieldid_",""),!0)}l=getTwoHtml(e,r);let _="",n="",s="",d="",o="";hasClass(r,"three_column_wrapper")?(removeClass(r,"three_column_wrapper"),addClass(r,"two_column_wrapper"),_=arfgetcolumnhtmlfunction(a,3,0),o=arfgetcolumnhtmlfunction(a,4,1)):hasClass(r,"four_column_wrapper")?(removeClass(r,"four_column_wrapper"),addClass(r,"two_column_wrapper"),_=arfgetcolumnhtmlfunction(a,3,0),n=arfgetcolumnhtmlfunction(a,4,1),o=arfgetcolumnhtmlfunction(a,5,1)):hasClass(r,"five_column_wrapper")?(removeClass(r,"five_column_wrapper"),addClass(r,"two_column_wrapper"),_=arfgetcolumnhtmlfunction(a,3,0),n=arfgetcolumnhtmlfunction(a,4,1),s=arfgetcolumnhtmlfunction(a,5,1),o=arfgetcolumnhtmlfunction(a,6,1)):hasClass(r,"six_column_wrapper")?(removeClass(r,"six_column_wrapper"),addClass(r,"two_column_wrapper"),_=arfgetcolumnhtmlfunction(a,3,0),n=arfgetcolumnhtmlfunction(a,4,1),s=arfgetcolumnhtmlfunction(a,5,1),d=arfgetcolumnhtmlfunction(a,6,1),o=arfgetcolumnhtmlfunction(a,7,1)):hasClass(r,"single_column_wrapper")&&(removeClass(r,"single_column_wrapper"),addClass(r,"two_column_wrapper")),a.find(".sortable_inner_wrapper").each(function(e,r){jQuery(this).remove()}),a.append(l),""!=_&&a.find(".sortable_inner_wrapper:nth-child(3)").replaceWith(_),""!=o&&(arfgetnewrowfunction(o,r),set_height_elment_column_six=arf_field_elem_attr_id),""!=d&&(arfgetnewrowfunction(d,r),set_height_elment_column_five=arf_field_elem_attr_id),""!=s&&(arfgetnewrowfunction(s,r),set_height_elment_column_four=arf_field_elem_attr_id),""!=n&&(arfgetnewrowfunction(n,r),set_height_elment_column_three=arf_field_elem_attr_id);e=r.getElementsByClassName("sortable_inner_wrapper")[0],l=r.querySelector(".sortable_inner_wrapper:last-child");addClass(e,"arf21colclass"),e.setAttribute("inner_class","arf21colclass"),addClass(l,"arf_2col"),l.setAttribute("inner_class","arf_2col");for(var f=r.getElementsByClassName("sortable_inner_wrapper"),p=f.length,u=0;u<p;u++){var c=f[u];1==c.getElementsByClassName("arfformfield").length&&c.getElementsByClassName("arfformfield")[0].removeAttribute("style");c=c.getAttribute("id");null!=c&&(c=c.replace("arfmainfieldid_",""),arf_initialize_control(c))}document.getElementById("arf_single_column_field_ids").value="",window.arf_sender_id="",window.arf_sender_parent={},window.arf_sender_previous={}}function initialize_field_order(){var e={},r=1,a=document.querySelectorAll("div.sortable_inner_wrapper,div.unsortable_inner_wrapper:not(.edit_field_type_section):not(.edit_field_type_repeater)"),t=a.length;if(0<t)for(var i=0;i<t;i++){var l,_,n,s=a[i],d=!1;jQuery(s).hasClass("edit_field_type_arf_repeater")&&(d=!0),0<jQuery(s).parents(".edit_field_type_arf_repeater").length||(l=!1,jQuery(s).hasClass("edit_field_type_arf_section")&&(l=!0),0<jQuery(s).parents(".edit_field_type_arf_section").length||(1==s.getElementsByClassName("arfformfield").length?(-1<(_=s.id.replace("arfmainfieldid_","")).indexOf("_confirm")&&(hasClass(s,"arf_confirm_field")||addClass(s,"arf_confirm_field")),e[_]=r,r++):d||l?(e[_=s.id.replace("arfmainfieldid_","")]=r,r++):hasClass(s,"arf_confirm_field")?null!=s.id&&""!=s.id?(e[_=s.id.replace("arfmainfieldid_","")]=r,r++):(removeClass(s,"arf_confirm_field"),null!=(n=s.getAttribute("inner_class"))&&"null"!=n&&(e[n+"|"+r]=r,r++)):null!=(n=s.getAttribute("inner_class"))&&"null"!=n&&(e[n+"|"+r]=r,r++)))}e=JSON.stringify(e),document.getElementById("arf_field_order").value=e,initialize_inner_field_order()}function initialize_inner_field_order(){for(var e={},r=document.querySelectorAll(".edit_field_type_arf_repeater"),a=r.length,t=0;t<a;t++){var i=r[t];void 0===e[c=jQuery(i).attr("id").replace("arfmainfieldid_","")]&&(e[c]=[]);for(var l=(h=jQuery(i).find(".sortable_inner_wrapper")).length,_=1,n=0;n<l;n++){var s=(w=(y=h[n]).getElementsByClassName("arfformfield")).length;if(0<s)for(var d=0;d<w.length;d++){var o=w[d].id.replace("arf_field_","");e[c].push(o+"|"+_),_++}else null!=(v=y.getAttribute("inner_class"))&&"null"!=v&&(e[c].push(v+"|"+_),_++)}}for(var f=document.querySelectorAll(".edit_field_type_arf_section"),p=f.length,u=0;u<p;u++){var c,m=f[u];void 0===e[c=jQuery(m).attr("id").replace("arfmainfieldid_","")]&&(e[c]=[]);for(var h,l=(h=jQuery(m).find(".sortable_inner_wrapper")).length,_=1,n=0;n<l;n++){var y,w,v,s=(w=(y=h[n]).getElementsByClassName("arfformfield")).length;if(0<s)for(d=0;d<w.length;d++){o=w[d].id.replace("arf_field_","");e[c].push(o+"|"+_),_++}else null!=(v=y.getAttribute("inner_class"))&&"null"!=v&&(e[c].push(v+"|"+_),_++)}}e=JSON.stringify(e),document.getElementById("arf_inner_field_order").value=e}function initialize_field_resize_width(){var e={},r=document.querySelectorAll("div.sortable_inner_wrapper,div.unsortable_inner_wrapper:not(.edit_field_type_section):not(.edit_field_type_repeater)"),a=r.length;if(0<a)for(var t=0,i=0;i<a;i++){var l=r[i],_=l.getAttribute("data-width");(100<_||null==_||void 0===_)&&(_=100),0==jQuery(l).parents(".edit_field_type_arf_repeater").length&&0==jQuery(l).parents(".edit_field_type_arf_section").length&&(e[t+1]=_,t++)}e=JSON.stringify(e),jQuery("input#arf_field_resize_width").val(e),arf_initialize_field_resize_width()}function arf_initialize_field_resize_width(){for(var e={},r=document.querySelectorAll(".edit_field_type_arf_repeater"),a=r.length,t=0;t<a;t++){var i=r[t];if(void 0===e[o=jQuery(i).attr("id").replace("arfmainfieldid_","")]&&(e[o]=[]),0<(p=(f=jQuery(i).find("div.sortable_inner_wrapper,div.unsortable_inner_wrapper:not(.edit_field_type_section):not(.edit_field_type_repeater)")).length))for(var l=1,_=0;_<p;_++){var n=(c=f[_]).getAttribute("data-width");""==(m=c.id.replace("arfmainfieldid_",""))&&(m=c.getAttribute("inner_class")),(100<n||null==n||void 0===n)&&(n=100),e[o].push(m+"|"+n+"|"+l),l++}}for(var s=document.querySelectorAll(".edit_field_type_arf_section"),d=s.length,t=0;t<d;t++){var o,f,p,u=s[t];if(void 0===e[o=jQuery(u).attr("id").replace("arfmainfieldid_","")]&&(e[o]=[]),0<(p=(f=jQuery(u).find("div.sortable_inner_wrapper,div.unsortable_inner_wrapper:not(.edit_field_type_section):not(.edit_field_type_repeater)")).length))for(l=1,_=0;_<p;_++){var c,m,n=(c=f[_]).getAttribute("data-width");""==(m=c.id.replace("arfmainfieldid_",""))&&(m=c.getAttribute("inner_class")),(100<n||null==n||void 0===n)&&(n=100),e[o].push(m+"|"+n+"|"+l),l++}}e=JSON.stringify(e),jQuery("input#arf_inner_field_resize_width").val(e)}function multicol_html(){var e="",r=jQuery("#arf_editor_total_rows").val();return""==(r=parseInt(r)+1)&&null==r&&"undefined"==r||(e+='<div class="arf_multiiconbox">',e+='<div class="arf_field_option_multicolumn" id="arf_multicolumn_wrapper">',e+='<input type="hidden" name="multicolumn" />',e+='<div class="arf_multicolumn_opt" id="single_column" data-value="arf_1" >',e+='<input type="radio" class="rdostandard multicolfield" name="classes" onclick="makeNewSortable(1,this);" data-id="'+r+'" id="classes_'+r+'_1" value="arf_1" checked="checked" style="display:none;" /><label for="classes_'+r+'_1"><span class="lblsubtitle_span_column"></span><svg id="multicolumn_one" height="24" width="18"><path fill-rule="evenodd" fill="#ffffff" clip-rule="evenodd" d="M1.059,14.666v-2h17v2H1.059z M1.059,6.666h17v2h-17V6.666z M1.059,0.666h17v2h-17V0.666z"/></svg></label>',e+="</div>",e+='<div class="arf_multicolumn_opt" id="two_column" data-value="arf_2">',e+='<input type="radio" class="rdostandard multicolfield" name="classes" onclick="makeNewSortable(2,this);" data-id="'+r+'" id="classes_'+r+'_2" value="arf_2" style="display:none;" /><label for="classes_'+r+'_2"><span class="lblsubtitle_span_column"></span><svg id="multicolumn_two" height="24" width="24"><path fill-rule="evenodd" fill="#ffffff" clip-rule="evenodd" d="M15.047,14.714v-2H27.03v2H15.047z M15.047,6.714H27.03v2H15.047V6.714z M15.047,0.714H27.03v2H15.047V0.714z M1.031,12.714h12.015v2H1.031V12.714z M1.03,6.714h12.015v2H1.03V6.714z M1.03,0.714h12.015v2 H1.03V0.714z"/></svg></label>',e+="</div>",e+='<div class="arf_multicolumn_opt" id="three_column" data-value="arf_3">',e+='<input type="radio" class="rdostandard multicolfield" name="classes" onclick="makeNewSortable(3,this);" data-id="'+r+'" id="classes_'+r+'_3" value="arf_3" style="display:none;" /><label for="classes_'+r+'_3"><span class="lblsubtitle_span_column"></span><svg id="multicolumn_three" height="24" width="35"><path fill-rule="evenodd" fill="#ffffff" clip-rule="evenodd" d="M18.07,14.615v-2h6.853v2H18.07z M18.069,6.615h6.853v2h-6.853V6.615zM18.069,0.615h6.853v2h-6.853V0.615z M9.497,12.615h6.853v2H9.497V12.615z M9.496,6.615h6.853v2H9.496V6.615z M9.496,0.615h6.853v2H9.496V0.615z M0.923,12.615h6.853v2H0.923V12.615z M0.922,6.615h6.853v2H0.922V6.615z M0.922,0.615h6.853v2H0.922V0.615z"/></svg></label>',e+="</div>",e+='<div class="arf_multicolumn_opt" id="four_column" data-value="arf_4">',e+='<input type="radio" class="rdostandard multicolfield" name="classes" onClick="makeNewSortable(4,this);" data-id="'+r+'" id="classes_'+r+'_4" value="arf_4" style="display:none;" /><label for="classes_'+r+'_4"><span class="lblsubtitle_span_column"></span><svg id="multicolumn_four" height="24" width="35"><path fill-rule="evenodd" fill="#ffffff" clip-rule="evenodd" d="M27.928,14.646v-2h6.995v2H27.928z M27.927,6.646h6.995v2h-6.995V6.646z M27.927,0.646h6.995v2h-6.995V0.646z M18.927,12.646h6.995v2h-6.995V12.646z M18.926,6.646h6.995v2h-6.995V6.646z M18.926,0.646 h6.995v2h-6.995V0.646z M9.925,12.646h6.995v2H9.925V12.646z M9.924,6.646h6.995v2H9.924V6.646z M9.924,0.646h6.995v2H9.924V0.646z M0.924,12.646h6.996v2H0.924V12.646z M0.923,6.646h6.996v2H0.923V6.646z M0.923,0.646h6.996v2H0.923V0.646z"/></svg></label>',e+="</div>",e+='<div class="arf_multicolumn_opt" id="five_column" data-value="arf_5">',e+='<input type="radio" class="rdostandard multicolfield" name="classes" onClick="makeNewSortable(5,this);" data-id="'+r+'" id="classes_'+r+'_5" value="arf_5" style="display:none;" /><label for="classes_'+r+'_5"><span class="lblsubtitle_span_column"></span><svg id="multicolumn_five" height="24" width="45"><path fill-rule="evenodd" fill="#ffffff" clip-rule="evenodd" d="M34.931,14.599v-2h6.056v2H34.931z M34.93,6.599h6.056v2H34.93V6.599z M34.93,0.599h6.056v2H34.93V0.599z M26.445,12.599h6.057v2h-6.057V12.599z M26.444,6.599H32.5v2h-6.056V6.599z M26.444,0.599H32.5 v2h-6.056V0.599z M17.959,12.599h6.057v2h-6.057V12.599z M17.958,6.599h6.056v2h-6.056V6.599z M17.958,0.599h6.056v2h-6.056V0.599z M9.474,12.599h6.057v2H9.474V12.599z M9.473,6.599h6.056v2H9.473V6.599z M9.473,0.599h6.056v2H9.473V0.599z M0.988,12.599h6.057v2 H0.988V12.599z M0.987,6.599h6.057v2H0.987V6.599z M0.987,0.599h6.057v2H0.987V0.599z"/></svg></label>',e+="</div>",e+='<div class="arf_multicolumn_opt" id="six_column" data-value="arf_6">',e+='<input type="radio" class="rdostandard multicolfield" name="classes" onClick="makeNewSortable(6,this);" data-id="'+r+'" id="classes_'+r+'_6" value="arf_6" style="display:none;" /><label for="classes_'+r+'_6"><span class="lblsubtitle_span_column"></span><svg id="multicolumn_six" height="24" width="50"><path fill-rule="evenodd" fill="#ffffff" clip-rule="evenodd" d="M36.022,14.568v-2h4.996v2H36.022z M36.021,6.568h4.996v2h-4.996V6.568z M36.021,0.568h4.996v2h-4.996V0.568z M29.021,12.568h4.996v2h-4.996V12.568z M29.021,6.568h4.996v2h-4.996V6.568z M29.021,0.568 h4.996v2h-4.996V0.568z M22.021,12.568h4.996v2h-4.996V12.568z M22.02,6.568h4.996v2H22.02V6.568z M22.02,0.568h4.996v2H22.02V0.568 z M15.021,12.568h4.996v2h-4.996V12.568z M15.02,6.568h4.996v2H15.02V6.568z M15.02,0.568h4.996v2H15.02V0.568z M8.02,12.568h4.996 v2H8.02V12.568z M8.019,6.568h4.996v2H8.019V6.568z M8.019,0.568h4.996v2H8.019V0.568z M1.019,12.568h4.997v2H1.019V12.568z M1.018,6.568h4.997v2H1.018V6.568z M1.018,0.568h4.997v2H1.018V0.568z"/></svg></label>',e+="</div>",e+="</div>",e+='<div class="arf_multi_column_expand_icon">',e+='<svg width="11px" height="20px">',e+="<g>",e+='<path xmlns="http://www.w3.org/2000/svg" fill="#ffffff" d="M8.88,8.166c0-0.269-0.096-0.538-0.287-0.742L2.549,0.977c-0.383-0.41-1.007-0.41-1.392,0 c-0.382,0.411-0.382,1.075,0,1.485l5.348,5.704L1.16,13.87c-0.385,0.409-0.385,1.075,0,1.485c0.383,0.411,1.007,0.411,1.39,0 l6.043-6.447C8.784,8.704,8.88,8.435,8.88,8.166z"/>',e+="</g>",e+="</svg>",e+="</div>",e+="</div>"),jQuery("#arf_editor_total_rows").val(r),e}function makeNewSortable(l,e){set_height_elment_column_two=set_height_elment_column_three=set_height_elment_column_four=set_height_elment_column_five=set_height_elment_column_six="",arf_field_elem_attr_id="";jQuery("#arfmainforminputstyle").val();1==l?make_inner_sortable_into_1_part(e):2==l?make_inner_sortable_into_2_part(e):3==l?make_inner_sortable_into_3_part(e):4==l?make_inner_sortable_into_4_part(e):5==l?make_inner_sortable_into_5_part(e):6==l&&make_inner_sortable_into_6_part(e);var r=jQuery(e).parents(".arf_inner_wrapper_sortable");jQuery(r).find(".sortable_inner_wrapper").each(function(e,r){var a,t,i;1==jQuery(this).find(".arfformfield").length&&(arf_class="arf_"+l,a=jQuery(this).attr("id").replace("arfmainfieldid_",""),i="",1==jQuery(this).find(".arf_confirm_field").length?(t=a.replace("_confirm",""),null!=(i=arf_retrieve_field_data(t))&&("email"==i.type?i.confirm_email_classes=arf_class:i.confirm_password_classes=arf_class,new_field_data=JSON.stringify(i),jQuery("#arf_field_data_"+t).val(new_field_data).trigger("change"))):null!=(i=arf_retrieve_field_data(a))&&(i.classes=arf_class,new_field_data=JSON.stringify(i),jQuery("#arf_field_data_"+a).val(new_field_data).trigger("change"),null!=i.type&&"colorpicker"==i.type?(t=document.getElementById("itemmeta_"+a),"material_outlined"==jQuery("#arfmainforminputstyle").val()&&(t=document.querySelector('.arfcolorvalue[data-fid="itemmeta_'+a+'"]')),arf_initialize_colorpicker(t)):void 0!==(i=i.placeholdertext)&&""!=i&&jQuery('[name="item_meta['+a+']"]').attr("placeholder",i)))}),initialize_sortable(".sortable_inner_wrapper"),initialize_element_sortable(),initialize_resizable(jQuery(e).parents(".arf_inner_wrapper_sortable")),removeBlankElm(),initialize_field_order(),SetDefaultColumnWidth(e),heightdiv("outerWrapper",e),jQuery(e).parents(".arfmainformfield").find(".arftootltip_position").each(function(){jQuery(this).tipso("destroy");var e=document.getElementById("arf_tooltip_bg_color").value,r=document.getElementById("arf_tooltip_font_color").value,a=jQuery(this).attr("data-title");jQuery(this).tipso({position:"top",width:"auto",useTitle:!1,content:a,background:e,color:r})}),jQuery(".arf_materialize_form .edit_field_type_file, .arf_materialize_form .edit_field_type_radio, .arf_materialize_form .edit_field_type_checkbox, .arf_materialize_form .edit_field_type_arf_multiselect, .arf_materialize_form .edit_field_type_select, .arf_materialize_form .edit_field_type_scale, .arf_materialize_form .edit_field_type_arfslider, .arf_materialize_form .edit_field_type_colorpicker, .arf_materialize_form .edit_field_type_like, .arf_materialize_form .edit_field_type_arf_smiley, .arf_materialize_form .edit_field_type_arf_switch").find(".arfhelptipfocus").each(function(){jQuery(this).tipso("destroy");var e,r,a,t=jQuery(this).attr("data-title");null!=t&&(e=document.getElementById("arf_tooltip_bg_color").value,r=document.getElementById("arf_tooltip_font_color").value,a=jQuery('input[name="arftippos"]:checked').val(),jQuery(this).tipso({position:a,width:"auto",useTitle:!1,content:t,background:e,color:r}))}),""!=set_height_elment_column_two&&heightdiv("individual",set_height_elment_column_two),""!=set_height_elment_column_three&&heightdiv("individual",set_height_elment_column_three),""!=set_height_elment_column_four&&heightdiv("individual",set_height_elment_column_four),""!=set_height_elment_column_five&&heightdiv("individual",set_height_elment_column_five),""!=set_height_elment_column_six&&heightdiv("individual",set_height_elment_column_six),0<jQuery(".tipso_bubble").length&&jQuery(".tipso_bubble").remove(),jQuery(r).find(".arf_field_option_hidden").removeClass("arfactive")}function arf_replace_common_html(e){var r,a="";return""==e&&null==e&&"undefined"==e||(r=multicol_html(),a='<div class="arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 single_column_wrapper ui-sortable-handle" data-id="arf_editor_main_row_'+jQuery("#arf_editor_total_rows").val()+'">'+r+e+"</div>"),a}function removeBlankElm(){jQuery("#new_fields").find(".sortable_inner_wrapper").each(function(){return!!jQuery(this).hasClass("edit_field_type_arf_repeater")||(!!jQuery(this).hasClass("edit_field_type_arf_section")||void(0==jQuery(this).find(".arfformfield").length&&0==jQuery(this).find(".arfformfield").length?(e=jQuery(this).attr("inner_class"),jQuery(this).removeAttr("id"),jQuery(this).addClass("sortable_inner_wrapper"),jQuery(this).addClass("ui-droppable"),jQuery(this).addClass("ui-sortable"),jQuery(this).addClass(e),jQuery(this).attr("inner_class",e),e=jQuery(this).attr("class").replace(/(.*?)(edit_field_type_[a-zA-Z]+)(.*?)/g,"$1"),jQuery(this).attr("class",e)):(jQuery(this).find(".arfformfield").attr("style"),e=jQuery(this).find(".arfformfield").attr("id").replace("arf_field_",""),jQuery(this).attr("id","arfmainfieldid_"+e),null!=(e=arf_retrieve_field_data(e))&&(e=e.type,jQuery(this).addClass("edit_field_type_"+e)))));var e});var a=!0,t=!1;jQuery(".arf_inner_wrapper_sortable").each(function(){t=!(a=!0),jQuery(this).find(".sortable_inner_wrapper:not(.edit_field_type_arf_repeater)").not(".unsortable_inner_wrapper").each(function(){t=!0,null!=jQuery(this).attr("id")&&1==a&&(a=!1)}),jQuery(this).find(".sortable_inner_wrapper:not(.edit_field_type_arf_section)").not(".unsortable_inner_wrapper").each(function(){t=!0,null!=jQuery(this).attr("id")&&1==a&&(a=!1)}),0==t&&0==jQuery(this).find(".sortable_inner_wrapper").length&&0==jQuery(this).find(".unsortable_inner_wrapper:not(.edit_field_type_section):not(.edit_field_type_repeater)").length&&(t=!0);var e=!1;"arf_repeater"==this.id&&(e=!0);var r=!1;"arf_section"==this.id&&(r=!0),a&&1==t&&0==e&&0==r&&jQuery(this).remove()}),initialize_sortable(".sortable_inner_wrapper"),initialize_element_sortable(!0),initialize_resizable()}function getTwoHtml(e,r){return drag_items=jQuery(r).hasClass("single_column_wrapper")||jQuery(r).hasClass("three_column_wrapper")||jQuery(r).hasClass("four_column_wrapper")||jQuery(r).hasClass("five_column_wrapper")||jQuery(r).hasClass("six_column_wrapper")?jQuery(r).find(".sortable_inner_wrapper").prop("outerHTML"):"<div class='sortable_inner_wrapper'></div>",drag_items+"<div class='sortable_inner_wrapper'></div>"}function initialize_sortable(e){(null==e||""==e||null==e)&&(e="#new_fields");var r={placeholder:"arf-sortable-placeholder",tolerance:"pointer",cancel:".arfformfield label,.ui-resizable-handle,.arf_field_option_model,.arf_field_values_model,arf_field_row_values_model,.controls,input,textarea,select,#required,#fieldoption,#duplicate,#delete,#edit_opt_icon,#running_total_icon,.arf_field_option_multicolumn,.arf_form_element_item:not(#imagecontrol)",sort:function(e,r){e.stopPropagation(),r.item.css("position","absolute")},receive:function(e,r){e.stopPropagation(),receive_on_common_sortable_func(jQuery(this),e,r)},stop:function(e,r){e.stopPropagation(),initialize_field_resize_width(),0<jQuery(".tipso_bubble").length&&jQuery(".tipso_bubble").remove()}};"#new_fields"!=e?(r.activate=function(e,r){e.stopPropagation(),jQuery(".sortable_inner_wrapper.ui-resizable").addClass("ui-resizable-temp"),jQuery(".sortable_inner_wrapper.ui-resizable").removeClass("ui-resizable")},r.receive=function(e,r){e.stopPropagation(),hasClass(r.helper[0],"arfformfield")&&(t=r.helper[0].getAttribute("id").replace("arf_field_",""),jQuery(".sortable_inner_wrapper").removeClass("current_sortable_class"),jQuery(".sortable_inner_wrapper").removeClass("receiver_sortable_class"),addClass(document.getElementById("arfmainfieldid_"+t),"current_sortable_class"),jQuery(r.helper[0].parentNode).hasClass("current_sortable_class")||addClass(r.helper[0].parentNode,"receiver_sortable_class"),null==document.getElementById("arfmainfieldid_"+t)||jQuery("#arfmainfieldid_"+t).hasClass("edit_field_type_arf_repeater")||document.getElementById("arfmainfieldid_"+t).removeAttribute("id"));var a=jQuery(this).hasClass("edit_field_type_arf_repeater")||0<jQuery(this).parents(".edit_field_type_arf_repeater").length,t=jQuery(this).hasClass("edit_field_type_arf_section")||0<jQuery(this).parents(".edit_field_type_arf_section").length;""==window.restrict_replacing_between_row||a||t||(a=document.getElementById("arf_field_"+sender_attr_id_id),arf_retrieve_field_data(sender_attr_id_id),null!=a&&(t=a.outerHTML,(a=document.getElementById("arf_field_"+sender_attr_id_id)).parentNode.removeChild(a),document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML="",document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML=t)),jQuery(".sortable_inner_wrapper").addClass("ui-resizable"),recieve_on_inner_sortable_func(jQuery(this),e,r)},r.start=function(e,r){e.stopPropagation(),window.arf_start_width_item=r.item.outerWidth(),0<jQuery("#arf_sortable_custom_class").length&&jQuery("#arf_sortable_custom_class").remove(),jQuery("body").append('<style type="text/css" id="arf_sortable_custom_class">.arfformfield.ui-draggable-dragging:not(.arf_form_element_item), .arfformfield.ui-sortable-helper:not(.arf_form_element_item) { width:'+window.arf_start_width_item+"px !important;}</style>"),"undefined"!=typeof $sender&&""!=$sender&&null!=$sender||($sender=jQuery(this)),hasClass(r.helper[0],"arfformfield")&&0<r.helper[0].getElementsByClassName("arf_fieldiconbox").length&&0<r.helper[0].getElementsByClassName("arf_field_action_iconbox").length&&(r.helper[0].getElementsByClassName("arf_fieldiconbox")[0].style.display="none",r.helper[0].getElementsByClassName("arf_field_action_iconbox")[0].style.display="none")},r.over=function(e,r){e.stopPropagation(),jQuery(".arf_current_check_row").removeClass("arf_current_check_row"),jQuery(".arfformfield").css("display","block"),window.sender_attr_id=jQuery(r.sender).attr("id"),window.restrict_replacing_between_row="",window.receiver_attr_id=jQuery(r.helper).attr("id"),removePlaceholder(jQuery(this),e,r),window.sender_attr_id!=receiver_attr_id&&(null!=window.sender_attr_id&&(""==window.get_sender_arf_row&&(window.sender_attr_id_id=window.sender_attr_id.replace("arfmainfieldid_",""),window.get_sender_arf_inner_sortable_class=jQuery("#"+sender_attr_id).attr("inner_class"),window.get_sender_arf_row=jQuery("#"+sender_attr_id).parent().attr("data-id")),jQuery("#"+sender_attr_id).parent().addClass("arf_current_check_row").attr("moved-data-id",sender_attr_id),window.obj_html=jQuery("#"+sender_attr_id).find(".arfformfield").prop("outerHTML")),"undefined"!=typeof sender_attr_id&&"undefined"!=typeof receiver_attr_id&&(receiver_attr_id.replace("arf_field_",""),void 0===(e=jQuery("#"+receiver_attr_id).parent().parent().attr("data-id"))&&jQuery(this).hasClass("edit_field_type_arf_repeater")?jQuery(r.sender).hasClass("edit_field_type_arf_repeater")&&(e=jQuery(r.helper).parents(".arf_inner_wrapper_sortable").attr("data-id"),window.arf_sender_id=jQuery(r.helper).attr("id").replace("arf_field_","")):void 0===e&&0<jQuery(this).parents(".edit_field_type_arf_repeater").length&&0<jQuery(r.sender).parents(".edit_field_type_arf_repeater").length&&(e=jQuery(r.helper).parents(".arf_inner_wrapper_sortable").attr("data-id"),window.arf_sender_id=jQuery(r.helper).attr("id").replace("arf_field_","")),get_sender_arf_row!=e?window.restrict_replacing_between_row="1":get_sender_arf_row==e&&window.sender_attr_id.replace("arfmainfieldid_",""))),jQuery(r.helper).removeAttr("style")},r.opacity=.65,r.stop=function(e,r){e.stopPropagation(),jQuery(".sortable_inner_wrapper.ui-resizable").removeClass("ui-resizable-temp"),jQuery(".sortable_inner_wrapper.ui-resizable").addClass("ui-resizable"),jQuery("#arf_sortable_custom_class").remove(),"undefined"!=typeof $sender&&0<$sender.length&&setTimeout(function(){"undefined"!=typeof $sender&&0<$sender.length?(heightdiv("outerWrapper",$sender),delete $sender):heightdiv("all")},11),jQuery(r.item).removeAttr("style"),window.get_sender_arf_row="",removeBlankElm(),initialize_field_order(),initialize_field_resize_width(),0<jQuery(".tipso_bubble").length&&jQuery(".tipso_bubble").remove()},r.deactivate=function(e,r){jQuery(".sortable_inner_wrapper.ui-resizable-temp").addClass("ui-resizable"),jQuery(".sortable_inner_wrapper").removeClass("ui-resizable-temp")}):(r.axis="y",r.cursor="move",r.opacity=.65,r.tolerance="instersect",r.activate=function(e,r){e.stopPropagation(),jQuery(".sortable_inner_wrapper.ui-resizable").addClass("ui-resizable-temp"),jQuery(".sortable_inner_wrapper.ui-resizable").removeClass("ui-resizable")},r.start=function(e,r){e.stopPropagation();e=jQuery(r.helper).height();jQuery(r.placeholder).css({height:e+"px"})},r.stop=function(e,i){e.stopPropagation(),jQuery("#arf_sortable_custom_class").remove(),"undefined"!=typeof $sender&&0<$sender.length&&(heightdiv("outerWrapper",$sender),delete $sender),jQuery(i.item).hasClass("arf_inner_wrapper_sortable")&&jQuery(i.item).removeAttr("style"),setTimeout(function(){var e,r,a,t=jQuery(i.item).attr("id");void 0!==t&&!/[\d+](_confirm)/gi.test(t)&&/[\d+]/.test(t)?(e=t.replace("arf_field_",""),jQuery("#arf_field_data_"+e).trigger("change"),a=jQuery("#arf_field_data_"+e).val(),"colorpicker"==(a=arf_parse_json(a)).type?(r=document.getElementById("itemmeta_"+e),"material_outlined"==jQuery("#arfmainforminputstyle").val()&&(r=document.querySelector('.arfcolorvalue[data-fid="itemmeta_'+e+'"]')),arf_initialize_colorpicker(r)):void 0!==(a=a.placeholdertext)&&""!=a&&jQuery('[name="item_meta['+e+']"]').attr("placeholder",a),initialize_on_sortable_focus_tipso(e,"0")):0<jQuery(i.item).find(".edit_field_type_break").length&&(t=jQuery(i.item).find(".edit_field_type_break").attr("id").replace("arfmainfieldid_",""),arf_load_bootstrap_js_css("break",t))},300),initialize_field_order(),initialize_field_resize_width()},r.deactivate=function(e,r){e.stopPropagation(),jQuery(".sortable_inner_wrapper.ui-resizable-temp").addClass("ui-resizable"),jQuery(".sortable_inner_wrapper").removeClass("ui-resizable-temp"),pagebreak_pagcount()}),null!=window.sender_attr_id&&""==restrict_replacing_between_row&&sortable_inner(window.sender_attr_id,window.receiver_attr_id,window.obj_html),jQuery(".sortable_inner_wrapper.ui-resizable-temp").addClass("ui-resizable"),jQuery(".sortable_inner_wrapper").removeClass("ui-resizable-temp"),jQuery(e).droppable({accept:".arf_form_element_item:not(#imagecontrol)",placeholder:"arf-draggable-placeholder"}).sortable(r),"#new_fields"==e&&(e={accept:".arf_form_element_item#imagecontrol",placeholder:"arf-draggable-placeholder1",drop:function(e,r){receive_on_common_sortable_func(jQuery(this),e,r),initialize_field_order(),initialize_field_resize_width()}},jQuery("#arfmainformeditorcontainer").droppable(e)),void 0!==window.arf_tcrecitcard_parent&&""!=window.arf_tcrecitcard_parent&&null!=window.arf_tcrecitcard_parent&&(window.is_loading=!1),0==window.is_loading&&addinnerclasses(),initialize_field_order()}function recieve_on_inner_sortable_func(t,e,r){var i=jQuery(t).attr("id"),l=t.hasClass("edit_field_type_arf_repeater"),_=t.hasClass("edit_field_type_arf_section"),a=document.getElementById("arfmainforminputstyle").value,n=!1;l&&jQuery(r.helper).hasClass("arf_form_element_item")?(jQuery(r.helper).hasClass("frm_tbreak")||jQuery(r.helper).hasClass("frm_tsection")||jQuery(r.helper).hasClass("frm_tarfcreditcard")||jQuery(r.helper).hasClass("frm_thtml")||jQuery(r.helper).hasClass("frm_tpassword")||jQuery(r.helper).hasClass("frm_tfile")||jQuery(r.helper).hasClass("frm_tmatrix")||jQuery(r.helper).hasClass("frm_tarf_wysiwyg"))&&(n=!0):l||(n=!0),n&&_&&(n=!1,jQuery(r.helper).hasClass("arf_form_element_item")&&(jQuery(r.helper).hasClass("frm_tbreak")||jQuery(r.helper).hasClass("frm_section")||jQuery(r.helper).hasClass("frm_tarf_repeater"))&&(n=!0));var s,d,o,f,p,u,c,m,h,y,w,v=jQuery(t).hasClass("edit_field_type_arf_repeater")||0<jQuery(t).parents(".edit_field_type_arf_repeater").length,b=jQuery(t).hasClass("edit_field_type_arf_section")||0<jQuery(t).parents(".edit_field_type_arf_section").length;if(null!=i&&jQuery(r.helper).hasClass("arf_form_element_item")&&n)jQuery(r.helper).replaceWith("");else if("1"!=window.restrict_replacing_between_row||v||b){if(!jQuery(t).parent().hasClass("single_column_wrapper")&&(jQuery(r.helper).hasClass("frm_tdivider")||jQuery(r.helper).hasClass("frm_tsection")||jQuery(r.helper).hasClass("frm_tarf_repeater")||jQuery(r.helper).hasClass("frm_tbreak")||!b&&jQuery(r.helper).hasClass("frm_tmatrix")||!b&&jQuery(r.helper).hasClass("frm_tarf_wysiwyg"))){jQuery(r.helper).replaceWith("");var g=jQuery(r.item).attr("data-type"),j=jQuery(r.item).attr("data-field-id");return jQuery(r.helper).hasClass("frm_tarfcreditcard")&&(window.arf_tcrecitcard_parent=jQuery(t).attr("id").replace("arfmainfieldid_","")),addnewfrmfield(j,g),initialize_field_resize_width(),!1}if(!jQuery(t).parent().hasClass("single_column_wrapper")&&(jQuery(t).hasClass("edit_field_type_arf_repeater")||0<jQuery(t).parents(".edit_field_type_arf_repeater").length)&&(jQuery(r.helper).hasClass("frm_tdivider")||jQuery(r.helper).hasClass("frm_tsection")||jQuery(r.helper).hasClass("frm_tbreak")||jQuery(r.helper).hasClass("frm_timagecontrol")||jQuery(r.helper).hasClass("frm_tarfcreditcard")||jQuery(r.helper).hasClass("frm_tarf_repeater")||jQuery(r.helper).hasClass("frm_tfile")||jQuery(r.helper).hasClass("frm_tcaptcha")||jQuery(r.helper).hasClass("frm_tpassword")||jQuery(r.helper).hasClass("frm_tarf_product")||jQuery(r.helper).hasClass("frm_tsignature")||jQuery(r.helper).hasClass("frm_thtml")||jQuery(r.helper).hasClass("frm_tmatrix")||jQuery(r.helper).hasClass("frm_tarf_wysiwyg"))){jQuery(r.helper).replaceWith("");g=jQuery(r.item).attr("data-type"),j=jQuery(r.item).attr("data-field-id");return addnewfrmfield(j,g),initialize_field_resize_width(),!1}if(jQuery(r.helper).hasClass("arf_form_element_item")){var Q=jQuery(r.helper).attr("data-type"),v=jQuery("#arfmainforminputstyle").val();if(b="material"==v?arf_parse_json(convert_new_materialize_field_array_json()):"material_outlined"==v?arf_parse_json(convert_new_materialize_outline_field_array_json()):arf_parse_json(convert_new_field_array_json()),(jQuery(t).hasClass("edit_field_type_arf_section")||0<jQuery(t).parents(".edit_field_type_arf_section").length)&&"arfcreditcard"==Q){var v=b.select,C=b.select,v=v.replace(/inner_class\=(\'|\")arf_1col(\'|\")/,"inner_class=$1arf31colclass$2"),z=b.text+"<--br--\x3e";z+=b.number+"<--br--\x3e",z+=v+"<--br--\x3e",z+=C+"<--br--\x3e";for(var C=z+=b.number,x=arf_generate_field_id(),z=C,N=randomString(),H=jQuery("#arf_editor_total_rows").val(),M=z.split("<--br--\x3e"),A="",k=(arf_parse_json(__ARFCCFIELDOPTIONS),""),E="",T=[],B=0;B<M.length;B++){switch(x=arf_generate_field_id(),N=randomString(),H=parseInt(H)+1,B){case 0:k="text",E="cc_holder_name";break;case 1:k="number",E="cc_number";break;case 2:k="select",E="cc_expiry_month";break;case 3:k="select",E="cc_expiry_year";break;case 4:k="number",E="cc_cvc_number"}T[B]=x+"~!~"+k+"~!~"+E;var W=M[B];W=(W=(W=(W=W.replace(/\{arf_field_id\}/gi,x)).replace(/\{arf_form_id\}/gi,O)).replace(/\{arf_unique_key\}/gi,N)).replace(/\{arf_editor_index_row\}/gi,H),"cc_holder_name"==E||"cc_number"==E||"cc_cvc_number"==E?A=A+W+"</div>":A+=W}z=A.replace("<--br--\x3e"," "),0<jQuery(t).parents(".edit_field_type_arf_section").length?jQuery(t).parents(".edit_field_type_arf_section").append(z):jQuery(r.helper).replaceWith(z);var S=Object.keys(T);window.is_loading=!0;for(var V=0;V<S.length;V++){var I=T[V].split("~!~"),L=I[0],F=I[1],I=I[2];arf_init_cc_field(L,F,I),window.arf_cc_fields_ids.push(L)}}else if("matrix"==Q&&0<jQuery(t).parents(".edit_field_type_arf_section").length){g=jQuery(r.item).attr("data-type"),j=jQuery(r.item).attr("data-field-id");jQuery(t).parents(".edit_field_type_arf_section").append(r.helper);var C=b[Q],x=arf_generate_field_id(),O=jQuery("#id").val(),N=randomString();z=(z=(z=(z=C).replace(/\{arf_field_id\}/gi,x)).replace(/\{arf_form_id\}/gi,O)).replace(/\{arf_unique_key\}/gi,N);var q=jQuery(z).find("#arf_field_"+x).prop("outerHTML");q=be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'><div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+q+"</div></div>"}else{if("arfcreditcard"==Q){jQuery(r.helper).replaceWith("");g=jQuery(r.item).attr("data-type"),j=jQuery(r.item).attr("data-field-id");return addnewfrmfield(j,g),initialize_field_resize_width(),!1}C=b[Q],x=arf_generate_field_id(),O=jQuery("#id").val(),N=randomString();z=(z=(z=(z=C).replace(/\{arf_field_id\}/gi,x)).replace(/\{arf_form_id\}/gi,O)).replace(/\{arf_unique_key\}/gi,N);q=jQuery(z).find("#arf_field_"+x).prop("outerHTML");l||_?(we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),q=be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+q+"</div></div>"):jQuery(r.helper).parent().attr("id","arfmainfieldid_"+x)}jQuery(r.helper).replaceWith(q),m=Q,h=x,setTimeout(function(){initialize_sortable(".sortable_inner_wrapper"),initialize_element_sortable(!0),initialize_resizable(),arf_load_bootstrap_js_css(m,h);var e,r,a=arf_retrieve_field_data(h);null!=a&&(e={field_id:h,field_name:a.name,field_type:a.type},window.added_new_fields.push(e)),l?(a.has_parent=!0,a.parent_field=i.replace("arfmainfieldid_",""),a.parent_field_type="arf_repeater"):0<jQuery(t).parents(".edit_field_type_arf_repeater").length?(a.has_parent=!0,r=jQuery(t).parents(".edit_field_type_arf_repeater").attr("id"),a.parent_field=r.replace("arfmainfieldid_",""),a.parent_field_type="arf_repeater"):_?(a.has_parent=!0,a.parent_field=i.replace("arfmainfieldid_",""),a.parent_field_type="section"):0<jQuery(t).parents(".edit_field_type_arf_section").length?(a.has_parent=!0,r=jQuery(t).parents(".edit_field_type_arf_section").attr("id"),a.parent_field=r.replace("arfmainfieldid_",""),a.parent_field_type="section"):(void 0!==a.has_parent&&delete a.has_parent,void 0!==a.parent_field&&delete a.parent_field,void 0!==a.parent_field_type&&delete a.parent_field_type),jQuery("#arf_field_data_"+h).val(JSON.stringify(a)),arf_update_name_dropdown(h,m,a.name),arf_set_new_conditional_action(h,a.name)},10),c=x,setTimeout(function(){heightdiv("individual",c)},10),setTimeout(function(){initialize_field_resize_width()},200)}var P,J,R,$,D,K,Z,G,U,X,Y,ee,re,ae,te,ie,le,_e,ne,se,z=jQuery(t).hasClass("edit_field_type_arf_repeater")||0<jQuery(t).parents(".edit_field_type_arf_repeater").length,q=jQuery(t).hasClass("edit_field_type_arf_section")||0<jQuery(t).parents(".edit_field_type_arf_section").length;if(!jQuery(r.helper).hasClass("arfformfield")||q||z||(0<t.find(".arfformfield").length?(P=t.find(".arfformfield").length,J=jQuery(r.helper).attr("id").replace("arf_field_",""),null!=(oe=arf_retrieve_field_data(J))&&void 0!==oe.type2&&"ccfield"==oe.type2&&(window.arf_tcrecitcard_parent=jQuery(r.helper).attr("id").replace("arfmainfieldid_","")),1<P?(J=jQuery(r.helper).attr("id").replace("arf_field_",""),$=!1,($=void 0!==(R=document.getElementById("arf_single_column_field_ids").value)&&""!=R&&-1<arf_parse_json(R).indexOf(J)?!0:$)&&""!=window.arf_sender_id&&void 0!==window.arf_sender_id&&window.arf_sender_id==J?(Z=(ue=t.find(".arfformfield")[1]).getAttribute("id").replace("arf_field_",""),(void 0===ue||void 0!==ue&&Z==window.arf_sender_id)&&(ue=t.find(".arfformfield")[0]),l=t.hasClass("edit_field_type_arf_repeater"),G=(ue=l?jQuery(r.helper)[0]:ue).getAttribute("id").replace("arf_field_",""),0<jQuery(r.sender).parents(".edit_field_type_arf_repeater").length?(we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+ue.outerHTML+"</div></div>",jQuery(r.helper).replaceWith(be)):jQuery(r.helper).replaceWith(ue.outerHTML),p=ue,u="arfmainfieldid_"+G,setTimeout(function(){var e;0==jQuery(p).parent().length?(e=void 0===jQuery(p).parent().context?jQuery(p).attr("id"):jQuery(p).parent().context.getAttribute("id"),0<jQuery("#"+e).length&&jQuery("#"+e).parent().attr("id",u)):jQuery(p).parent().attr("id",u),initialize_field_order(),initialize_field_resize_width()},10),U=window.arf_sender_previous[window.arf_sender_id],X=window.arf_sender_parent[window.arf_sender_id],jQuery(X).find(".arfformfield").hasClass("arf_confirm_field")&&setTimeout(function(){jQuery(ue).parent().removeClass("arf_confirm_field")},20),void 0===U||null==U?jQuery("#new_fields").prepend(X):jQuery(X).insertAfter(U),null!=(Y=arf_retrieve_field_data(window.arf_sender_id))&&(Q=Y.type,setTimeout(function(){arf_initialize_control(window.arf_sender_id)},100))):(jQuery(r.helper).removeAttr("style"),de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id"),D=i.replace("arfmainfieldid_",""),ne=arf_retrieve_field_data(de),z=arf_retrieve_field_data(D),null!=ne?("email"!=(Q=ne.type)&&"password"!=Q||!jQuery(r.helper).hasClass("arf_confirm_field")?jQuery(r.helper).parent(".sortable_inner_wrapper").removeClass("arf_confirm_field"):jQuery(r.helper).parent(".sortable_inner_wrapper").addClass("arf_confirm_field"),se=jQuery(r.helper).prop("outerHTML"),r.helper.parent().hasClass("edit_field_type_arf_repeater")&&(we="matrix"==ne.type||"arf_wysiwyg"==Q?"":multicol_html(),se=be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+de+"' inner_class='arf_1col'>"+se+"</div></div>"),jQuery(r.helper).replaceWith(se),Q=ne.type,null!=z&&z.type,setTimeout(function(){arf_initialize_control(D),arf_initialize_control(de)},500)):jQuery(r.helper).hasClass("arf_confirm_field")?jQuery(r.helper).parent(".sortable_inner_wrapper").addClass("arf_confirm_field"):jQuery(r.helper).parent(".sortable_inner_wrapper").removeClass("arf_confirm_field"),setTimeout(function(){heightdiv()},500)),initialize_on_sortable_focus_tipso(get_sender_arf_row,"1")):(l=0<t.parents(".edit_field_type_arf_repeater").length,de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id"),K=document.getElementById("arf_single_column_field_ids").value,oe=arf_retrieve_field_data(de),1==l&&null!=oe&&("file"==oe.type||"break"==oe.type||"section"==oe.type||"divider"==oe.type||"html"==oe.type||"password"==oe.type||"captcha"==oe.type||"arf_product"==oe.type)||"matrix"==oe.type||"arf_wysiwyg"==oe.type?(Z=(ue=t.find(".arfformfield")[0]).getAttribute("id").replace("arf_field_",""),(void 0===ue||void 0!==ue&&Z==window.arf_sender_id)&&(ue=t.find(".arfformfield")[0]),jQuery(r.helper).replaceWith(""),G=ue.getAttribute("id").replace("arf_field_",""),o=ue,f="arfmainfieldid_"+G,setTimeout(function(){var e;0==jQuery(o).parent().length?(e="matrix"==oe.type||"arf_wysiwyg"==oe.type?jQuery(o).attr("id"):jQuery(o).parent().context.getAttribute("id"),0<jQuery("#"+e).length&&jQuery("#"+e).parent().attr("id",f)):jQuery(o).parent().attr("id",f),initialize_field_order(),initialize_field_resize_width()},10),U=window.arf_sender_previous[window.arf_sender_id],X=window.arf_sender_parent[window.arf_sender_id],jQuery(X).find(".arfformfield").hasClass("arf_confirm_field")&&setTimeout(function(){jQuery(ue).parent().removeClass("arf_confirm_field")},20),void 0===U||null==U?jQuery("#new_fields").prepend(X):jQuery(X).insertAfter(U),null!=(Y=arf_retrieve_field_data(window.arf_sender_id))&&(Q=Y.type,setTimeout(function(){"arf_wysiwyg"==Q&&arf_initialize_control(window.arf_sender_id,!0),arf_initialize_control(window.arf_sender_id)},100))):(ee=document.getElementById("arf_field_"+de),null==(ge=arfClosest(ee,".arf_inner_wrapper_sortable"))&&/_confirm/.test(de)&&(ge=jQuery(r.helper)[0]),""!=K&&(ee=document.getElementById("arf_field_"+de),ge=arfClosest(ee,".arf_inner_wrapper_sortable"),hasClass(ge,"single_column_wrapper")||(-1<(ae=(re=arf_parse_json(K)).indexOf(de))&&re.splice(ae,1),te=JSON.stringify(re),document.getElementById("arf_single_column_field_ids").value=te)),null==ge&&jQuery(ee).parent().hasClass("edit_field_type_arf_repeater")?(ie=jQuery(ee).parent().attr("id").replace("arfmainfieldid_",""),/(_confirm)/.test(de)?(null!=(le=r.helper.parent().attr("inner_class"))&&void 0!==le||(le="arf_1col"),se=jQuery(r.helper).prop("outerHTML"),we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),ve=jQuery("#arf_editor_total_rows").val(),be="arf_1col"==le?"<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+ve+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+de+"' inner_class='arf_1col'>"+se+"</div></div>":se,jQuery(r.helper).replaceWith(be),initialize_sortable(),initialize_element_sortable(),initialize_resizable()):(_e=arf_retrieve_field_data(de),"arf_1col"==(le=null==(le=r.helper.parent().attr("inner_class"))||void 0===le?"arf_1col":le)&&(fe=jQuery(r.helper).prop("outerHTML"),we="matrix"==_e.type||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+de+"' inner_class='arf_1col'>"+fe+"</div></div>",jQuery(r.helper).replaceWith(be)),_e.has_parent=1,_e.parent_field=ie,_e.parent_field_type="arf_repeater",fe=_e,jQuery("#arf_field_data_"+de).val(JSON.stringify(fe)),d=de,setTimeout(function(){arf_initialize_control(d),heightdiv("individual",d)},100))):null!=ge&&!jQuery(ee).parent().hasClass("edit_field_type_arf_repeater")&&0<jQuery(ee).parents(".edit_field_type_arf_repeater").length?(ie=jQuery(ee).parents(".edit_field_type_arf_repeater").attr("id").replace("arfmainfieldid_",""),/(_confirm)/.test(de)?(null!=(le=r.helper.parent().attr("inner_class"))&&void 0!==le||(le="arf_1col"),se=jQuery(r.helper).prop("outerHTML"),we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),ve=jQuery("#arf_editor_total_rows").val(),be="arf_1col"==le?"<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+ve+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+de+"' inner_class='arf_1col'>"+se+"</div></div>":se,jQuery(r.helper).replaceWith(be),initialize_sortable(),initialize_element_sortable(),initialize_resizable()):((_e=arf_retrieve_field_data(de)).has_parent=1,_e.parent_field=ie,_e.parent_field_type="arf_repeater",fe=_e,jQuery("#arf_field_data_"+de).val(JSON.stringify(fe)),s=de,setTimeout(function(){arf_initialize_control(s),heightdiv("individual",s)},100))):null!=(ne=arf_retrieve_field_data(de))&&(void 0!==ne.has_parent&&delete ne.has_parent,void 0!==ne.parent_field&&delete ne.parent_field,void 0!==ne.parent_field_type&&delete ne.parent_field_type,jQuery("#arf_field_data_"+de).val(JSON.stringify(ne)))))):(jQuery(r.helper).removeAttr("style"),de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id"),null!=(ne=arf_retrieve_field_data(de))&&("email"==(Q=ne.type)&&jQuery(r.helper).hasClass("arf_confirm_field")&&jQuery(r.helper).parent(".sortable_inner_wrapper").addClass("arf_confirm_field"),void 0!==ne.has_parent&&delete ne.has_parent,void 0!==ne.parent_field&&delete ne.parent_field,void 0!==ne.parent_field_type&&delete ne.parent_field_type,jQuery("#arf_field_data_"+x).val(JSON.stringify(ne)),se=jQuery(r.helper).prop("outerHTML"),jQuery(r.helper).replaceWith(se))),setTimeout(function(){initialize_field_resize_width()},200)),jQuery(r.helper).hasClass("arfformfield")&&jQuery(t).hasClass("edit_field_type_arf_repeater")){var de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id");if(/(_confirm)/.test(de))return arf_initialize_control(de.replace("_confirm","")),jQuery(r.helper).replaceWith(""),initialize_field_order(),initialize_field_resize_width(),!1;var oe=arf_retrieve_field_data(de),x=de,Q=oe.type;-1<["arf_repeater","section","divider","break","captcha","html","imagecontrol","confirm_password","signature","file","password","matrix","arf_wysiwyg"].indexOf(Q)?(ge=jQuery(r.helper).parent()).hasClass("edit_field_type_arf_repeater")&&(pe=ge.attr("id").replace("arfmainfieldid_",""),we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",jQuery(r.helper).replaceWith(""),jQuery(be).insertAfter(ge.parents(".edit_field_type_arf_repeater_wrapper"))):(ge=jQuery(r.helper).parent()).hasClass("edit_field_type_arf_repeater")&&(we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",jQuery(r.helper).replaceWith(be),pe=ge.attr("id").replace("arfmainfieldid_",""),null!=oe&&(oe.has_parent=1,oe.parent_field=pe,oe.parent_field_type="arf_repeater",jQuery("#arf_field_data_"+x).val(JSON.stringify(oe))))}if(jQuery(r.helper).hasClass("arfformfield")&&0<jQuery(t).parents(".edit_field_type_arf_repeater").length){de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id");if(/(_confirm)/.test(de))return initialize_field_order(),initialize_field_resize_width(),!1;var fe,oe=arf_retrieve_field_data(de),x=de,Q=oe.type;1<t.find(".arfformfield").length?(ue=t.find(".arfformfield")[0],t.find(".arfformfield")[0].getAttribute("id").replace("arf_field_","")==x&&(ue=t.find(".arfformfield")[1]),ce=jQuery(t).parents(".edit_field_type_arf_repeater").attr("id").replace("arfmainfieldid_",""),pe=(ge=jQuery(r.helper).parent()).attr("id").replace("arfmainfieldid_",""),fe=arf_retrieve_field_data(x),we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",me=t.parents(".arf_inner_wrapper_sortable").attr("data-id"),t.attr("inner_class"),he=window.get_sender_arf_row==me,null==document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']")?(void 0!==fe.has_parent&&void 0!==fe.parent_field&&fe.parent_field==ce?jQuery(t).parents(".edit_field_type_arf_repeater").append(be):jQuery(be).insertAfter(ge.parents(".edit_field_type_arf_repeater_wrapper")),jQuery(r.helper).replaceWith("")):jQuery(document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']")).parents(".edit_field_type_arf_repeater")&&he?void 0!==fe.has_parent&&void 0!==fe.parent_field&&fe.parent_field==ce||jQuery(be).insertAfter(ge.parents(".edit_field_type_arf_repeater_wrapper")):(document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML="",document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML=jQuery(r.helper)[0].outerHTML,jQuery(r.helper).replaceWith(""))):1==t.find(".arfformfield").length&&(-1<["arf_repeater","section","divider","break","captcha","html","imagecontrol","confirm_password","password","signature","file","matrix","arf_wysiwyg"].indexOf(Q)?(null==document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']")?(we="matrix"!=Q&&"arf_wysiwyg"!=Q?multicol_html():"",be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",ye=jQuery(t).parents(".edit_field_type_arf_repeater_wrapper"),jQuery(be).insertAfter(ye)):(document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML="",document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML=jQuery(r.helper)[0].outerHTML),jQuery(r.helper).replaceWith("")):null!=oe&&(pe=(ge=jQuery(t).parents(".edit_field_type_arf_repeater")).attr("id").replace("arfmainfieldid_",""),oe.has_parent=1,oe.parent_field=pe,oe.parent_field_type="arf_repeater",jQuery("#arf_field_data_"+x).val(JSON.stringify(oe))))}if(jQuery(r.helper).hasClass("arfformfield")&&jQuery(t).hasClass("edit_field_type_arf_section")){de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id");if(/(_confirm)/.test(de))return arf_initialize_control(de.replace("_confirm","")),jQuery(r.helper).replaceWith(""),initialize_field_order(),initialize_field_resize_width(),!1;oe=arf_retrieve_field_data(de),x=de;null!=oe&&void 0!==oe.type2&&"ccfield"==oe.type2&&(window.arf_tcrecitcard_parent=jQuery(r.helper).attr("id").replace("arfmainfieldid_",""));var pe=(ge=jQuery(r.helper).parent()).attr("id").replace("arfmainfieldid_",""),Q=oe.type;-1<["break","section","divider","arf_repeater"].indexOf(Q)?ge.hasClass("edit_field_type_arf_section")&&(we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",jQuery(r.helper).replaceWith(""),jQuery(be).insertAfter(ge.parents(".edit_field_type_arf_section_wrapper")),null!=oe&&(delete oe.has_parent,delete oe.parent_field,delete oe.parent_field_type,jQuery("#arf_field_data_"+x).val(JSON.stringify(oe)))):(ge=jQuery(r.helper).parent()).hasClass("edit_field_type_arf_section")&&(we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",jQuery(r.helper).replaceWith(be),null!=oe&&(oe.has_parent=1,oe.parent_field=pe,oe.parent_field_type="section",jQuery("#arf_field_data_"+x).val(JSON.stringify(oe))))}if(jQuery(r.helper).hasClass("arfformfield")&&0<jQuery(t).parents(".edit_field_type_arf_section").length){de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id");if(/(_confirm)/.test(de))return initialize_field_order(),initialize_field_resize_width(),!1;var ue,ce,me,he,ye,we,ve,be,ge,oe=arf_retrieve_field_data(de),x=de,Q=oe.type;null!=oe&&void 0!==oe.type2&&"ccfield"==oe.type2&&(window.arf_tcrecitcard_parent=jQuery(r.helper).attr("id").replace("arfmainfieldid_","")),1<t.find(".arfformfield").length?(ue=t.find(".arfformfield")[0],t.find(".arfformfield")[0].getAttribute("id").replace("arf_field_","")==x&&(ue=t.find(".arfformfield")[1]),ce=jQuery(t).parents(".edit_field_type_arf_section").attr("id").replace("arfmainfieldid_",""),pe=(ge=jQuery(r.helper).parent()).attr("id").replace("arfmainfieldid_",""),we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",me=t.parents(".arf_inner_wrapper_sortable").attr("data-id"),t.attr("inner_class"),he=window.get_sender_arf_row==me,null==document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']")?(void 0!==oe.has_parent&&void 0!==oe.parent_field&&oe.parent_field==ce?jQuery(t).parents(".edit_field_type_arf_section").append(be):jQuery(be).insertAfter(ge.parents(".edit_field_type_arf_section_wrapper")),jQuery(r.helper).replaceWith("")):jQuery(document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']")).parents(".edit_field_type_arf_section")&&he?void 0!==oe.has_parent&&void 0!==oe.parent_field&&oe.parent_field==ce||jQuery(be).insertAfter(ge.parents(".edit_field_type_arf_section_wrapper")):(document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML="",document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML=jQuery(r.helper)[0].outerHTML,jQuery(r.helper).replaceWith(""))):1==t.find(".arfformfield").length&&(-1<["arf_repeater","section","divider","break","matrix"].indexOf(Q)?(x=parseInt(x),void 0!==window.get_sender_arf_row&&void 0!==window.get_sender_arf_inner_sortable_class?(null==document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']")?(we="matrix"==Q||"arf_wysiwyg"==Q?"":multicol_html(),be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",ye=jQuery(t).parents(".edit_field_type_arf_section_wrapper"),jQuery(be).insertAfter(ye)):(document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML="",document.querySelector("[data-id='"+window.get_sender_arf_row+"'] [inner_class='"+window.get_sender_arf_inner_sortable_class+"']").innerHTML=jQuery(r.helper)[0].outerHTML),jQuery(r.helper).replaceWith("")):"matrix"==Q&&null!=window.arf_matrix_field_ids&&-1<window.arf_matrix_field_ids.indexOf(x)&&(0<(ye=jQuery(t).parents(".edit_field_type_arf_section").find(".arf_inner_wrapper_sortable").first()).length&&(we="",be="<div class='arf_inner_wrapper_sortable arfmainformfield edit_form_item arffieldbox ui-state-default 1 ui-sortable-handle single_column_wrapper' data-id='arf_editor_main_row_"+(ve=jQuery("#arf_editor_total_rows").val())+"'>"+we+"<div class='sortable_inner_wrapper edit_field_type_"+Q+" arf_1col arf1columns' id='arfmainfieldid_"+x+"' inner_class='arf_1col'>"+jQuery(r.helper).prop("outerHTML")+"</div></div>",jQuery(be).insertAfter(ye),jQuery(r.helper).replaceWith("")))):null!=oe&&(pe=(ge=jQuery(t).parents(".edit_field_type_arf_section")).attr("id").replace("arfmainfieldid_",""),oe.has_parent=1,oe.parent_field=pe,oe.parent_field_type="section",jQuery("#arf_field_data_"+x).val(JSON.stringify(oe))))}}else jQuery(r.helper).hasClass("arfformfield")&&(0<t.find(".arfformfield").length?1<(P=t.find(".arfformfield").length)?(J=jQuery(r.helper).attr("id").replace("arf_field_",""),$=!1,($=void 0!==(R=document.getElementById("arf_single_column_field_ids").value)&&""!=R&&-1<arf_parse_json(R).indexOf(J)?!0:$)&&""!=window.arf_sender_id&&void 0!==window.arf_sender_id&&window.arf_sender_id==J?(Z=(ue=t.find(".arfformfield")[1]).getAttribute("id").replace("arf_field_",""),(void 0===ue||void 0!==ue&&Z==window.arf_sender_id)&&(ue=t.find(".arfformfield")[0]),jQuery(r.helper).replaceWith(""),G=ue.getAttribute("id").replace("arf_field_",""),y=ue,w="arfmainfieldid_"+G,setTimeout(function(){var e;0==jQuery(y).parent().length?(e=jQuery(y).parent().context.getAttribute("id"),0<jQuery("#"+e).length&&jQuery("#"+e).parent().attr("id",w)):jQuery(y).parent().attr("id",w),initialize_field_order(),initialize_field_resize_width()},10),U=window.arf_sender_previous[window.arf_sender_id],X=window.arf_sender_parent[window.arf_sender_id],jQuery(X).find(".arfformfield").hasClass("arf_confirm_field")&&setTimeout(function(){jQuery(ue).parent().removeClass("arf_confirm_field")},20),void 0===U||null==U?jQuery("#new_fields").prepend(X):jQuery(X).insertAfter(U),Y=arf_retrieve_field_data(window.arf_sender_id),"select"!=(Q=Y.type)&&"arf_multiselect"!=Q||jQuery("#arf_field_"+window.arf_sender_id).find(".bootstrap-select").remove(),arf_initialize_control(window.arf_sender_id)):(jQuery(r.helper).removeAttr("style"),de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id"),null!=(ne=arf_retrieve_field_data(de))?("email"!=(Q=ne.type)&&"password"!=Q||!jQuery(r.helper).hasClass("arf_confirm_field")?jQuery(r.helper).parent(".sortable_inner_wrapper").removeClass("arf_confirm_field"):jQuery(r.helper).parent(".sortable_inner_wrapper").addClass("arf_confirm_field"),se=jQuery(r.helper).prop("outerHTML"),jQuery(r.helper).replaceWith(se),""!=window.arf_sender_id&&(Y=arf_retrieve_field_data(window.arf_sender_id),"select"!=(Q=Y.type)&&"arf_multiselect"!=Q||("material"!=a?jQuery("#arf_field_"+window.arf_sender_id).find(".bootstrap-select").remove():(jQuery("#arf_field_"+window.arf_sender_id).find(".select-wrapper").find("span").remove(),"arf_multiselect"==Q?(jQuery("#arf_field_"+window.arf_sender_id).find(".select-wrapper").find(".arf-multiple-select-dropdown").remove(),jQuery("#arf_field_"+window.arf_sender_id).find('select[name="item_meta['+window.arf_sender_id+'][]"]').unwrap()):(jQuery("#arf_field_"+window.arf_sender_id).find(".select-wrapper").find(".arf-select-dropdown").remove(),jQuery("#arf_field_"+window.arf_sender_id).find('select[name="item_meta['+window.arf_sender_id+']"]').unwrap()))),setTimeout(function(){arf_initialize_control(window.arf_sender_id)},100))):jQuery(r.helper).hasClass("arf_confirm_field")?jQuery(r.helper).parent(".sortable_inner_wrapper").addClass("arf_confirm_field"):jQuery(r.helper).parent(".sortable_inner_wrapper").removeClass("arf_confirm_field"))):(de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id"),""!=(K=document.getElementById("arf_single_column_field_ids").value)&&(ee=document.getElementById("arf_field_"+de),ge=arfClosest(ee,".arf_inner_wrapper_sortable"),hasClass(ge,"single_column_wrapper")||(-1<(ae=(re=arf_parse_json(K)).indexOf(de))&&re.splice(ae,1),te=JSON.stringify(re),document.getElementById("arf_single_column_field_ids").value=te)),Y=arf_retrieve_field_data(de),"select"==(Q=Y.type)&&("material"!=a?jQuery("#arf_field_"+de).find(".bootstrap-select").remove():(jQuery("#arf_field_"+de).find(".select-wrapper").find("span").remove(),jQuery("#arf_field_"+de).find(".select-wrapper").find(".arf-select-dropdown").remove(),jQuery("#arf_field_"+de).find('select[name="item_meta['+de+']"]').unwrap())),"arf_multiselect"==Q&&("material"!=a?jQuery("#arf_field_"+de).find(".bootstrap-select").remove():(jQuery("#arf_field_"+de).find(".select-wrapper").find("span").remove(),jQuery("#arf_field_"+de).find(".select-wrapper").find(".arf-multiple-select-dropdown").remove(),jQuery("#arf_field_"+de).find('select[name="item_meta['+de+'][]"]').unwrap())),arf_initialize_control(de)):(jQuery(r.helper).removeAttr("style"),de=jQuery(r.helper).find(".arf_fieldiconbox").attr("data-field_id"),null!=(ne=arf_retrieve_field_data(de))&&("email"!=(Q=ne.type)&&"password"!=Q||!jQuery(r.helper).hasClass("arf_confirm_field")?jQuery(r.helper).parent(".sortable_inner_wrapper").removeClass("arf_confirm_field"):jQuery(r.helper).parent(".sortable_inner_wrapper").addClass("arf_confirm_field"),se=jQuery(r.helper).prop("outerHTML"),jQuery(r.helper).replaceWith(se))),setTimeout(function(){initialize_field_resize_width()},200))}window.sender_attr_id="",window.receiver_attr_id="",window.obj_html="",window.get_sender_arf_row="",window.get_sender_arf_inner_sortable_class="",window.sender_attr_id_id="",window.restrict_replacing_between_row="",window.sender_attr_id_id_row="",window.arf_sender_id="",window.arf_sender_parent={},window.arf_sender_previous={},window.arf_start_width_item=0,window.arf_cc_fields_ids=[],window.prevent_setting_class=!1;