$(document).ready((function(){$('#add-field-row button[name="custom_field_add"]').click((function(){void 0!==$(this).attr("update-id")?(botCommandFields[$(this).attr("update-id")].name=document.getElementById("custom_field_name").value,botCommandFields[$(this).attr("update-id")].placeholder=document.getElementById("custom_field_placeholder").value,botCommandFields[$(this).attr("update-id")].type=document.getElementById("custom_field_type").value,botCommandFields[$(this).attr("update-id")].rows=document.getElementById("custom_field_rows").value,botCommandFields[$(this).attr("update-id")].required=document.getElementById("custom_field_required").value,$(this).removeAttr("update-id"),document.getElementById("field-action-button").innerText=document.getElementById("field-action-button").getAttribute("data-add")):botCommandFields.push({name:document.getElementById("custom_field_name").value,placeholder:document.getElementById("custom_field_placeholder").value,type:document.getElementById("custom_field_type").value,rows:document.getElementById("custom_field_rows").value,required:document.getElementById("custom_field_required").value}),d()}));var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function t(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return e[t]}))}function d(){let e=document.getElementById("field-rows-container");e.innerHTML="",botCommandFields.forEach((d,i)=>{e.innerHTML+='<div class="row pt-1"><div class="col-3"><b>'+e.getAttribute("name-field")+"</b> - "+t(d.name)+'<br><span class="text-muted fs12"> {args.arg_'+(i+1)+"} or {arg_"+(i+1)+"} in bot, in Rest API {{args.arg_"+(i+1)+'}}</span></div><div class="col-2"><b>'+e.getAttribute("placeholder-field")+"</b> - "+t(d.placeholder)+'</div><div class="col-2"><b>'+e.getAttribute("type-field")+"</b> - "+t(d.type)+'</div><div class="col-2"><b>'+e.getAttribute("rows-field")+"</b> - "+t(d.rows?d.rows:1)+'</div><div class="col-2"><b>'+e.getAttribute("required-field")+"</b> - "+t(d.required?d.required:"required")+'</div><div class="col-1"><div class="btn-group w-100" role="group" aria-label="First group"><button class="btn btn-success btn-sm w-100" type="button" onclick="ee.emitEvent(\'edit_custom_command_field\',['+i+'])">'+e.getAttribute("edit-action")+'</button><button class="btn btn-danger btn-sm w-100" type="button" onclick="ee.emitEvent(\'delete_custom_command_field\',['+i+'])">'+e.getAttribute("remove-action")+'</button></div></div><input type="hidden" name="custom_field_name[]" value="'+t(d.name)+'"><input type="hidden" name="custom_field_placeholder[]" value="'+t(d.placeholder)+'"><input type="hidden" name="custom_field_type[]" value="'+t(d.type)+'"><input type="hidden" name="custom_field_rows[]" value="'+t(d.rows)+'"></div><input type="hidden" name="custom_field_required[]" value="'+t(d.required?d.required:"required")+'"></div>'})}ee.addListener("delete_custom_command_field",(function(e){botCommandFields.splice(e,1),d()})),ee.addListener("edit_custom_command_field",(function(e){document.getElementById("custom_field_name").value=botCommandFields[e].name,document.getElementById("custom_field_placeholder").value=botCommandFields[e].placeholder,document.getElementById("custom_field_type").value=botCommandFields[e].type,document.getElementById("custom_field_rows").value=botCommandFields[e].rows,document.getElementById("custom_field_required").value=botCommandFields[e].required,document.getElementById("field-action-button").innerText=document.getElementById("field-action-button").getAttribute("data-update"),document.getElementById("field-action-button").setAttribute("update-id",e)})),d()}));
//# sourceMappingURL=69dd0a45af3af232b46fb9ee986ca329.js.map
