1var t=Object.defineProperty,e=(e,o,a)=>((e,o,a)=>o in e?t(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a)(e,"symbol"!=typeof o?o+"":o,a);import{H as o}from"./http-C5AlXx9p.js";import{F as a,a as r}from"./formStates-Do5QcTL9.js";import"./navigationMenu-BZWkZTou.js";import"./lodash-DBmoo9tr.js";const s=new class extends o{constructor(){super("".concat("/dt-api/"),{headers:{"Content-Type":"multipart/form-data"}})}async postForm(t,e={}){return await this.post(t,e).then(t=>t.data).catch(t=>t.response.data)}};class n{constructor(){e(this,"count",1),document.querySelectorAll("form.with-validation").forEach(t=>{const e=t,o="form_".concat(this.count);null==e||e.setAttribute("novalidate",""),e.getAttribute("id")||null==e||e.setAttribute("id",o),this.count++,this.initForm(e)})}initForm(t){t.addEventListener("submit",e=>{e.preventDefault(),t.checkValidity()?(t.dataset.formState=a.VALID,this.onSumbit(t)):t.dataset.formState=a.INVALID})}async onSumbit(t){const e=new FormData(t),o=await s.postForm(t.action,e);o.isSuccessful?this.onSuccess(t):this.onError(t,o.message||"")}onSuccess(t){t.dataset.formState=r.SUCCESS,location.reload()}onError(t,e=""){t.dataset.formState=r.ERROR;const o=t.querySelector(".form-error");o&&(o.textContent=e)}}export{n as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.