PageSourceSearch

https://portal.eafghans.com/assets/form-39b78aed.js

js eafghans.com collected 2026-10-02 21:19:59 UTC 2,943 bytes, 1 lines download raw bytes

1import{q as w,t as d,e as B,m as q,k as z,a8 as F,W as L,j as e,a9 as E,B as i,a2 as M,V as n,x as I,L as O,aa as R,T as U,D as V,ab as m,a0 as h,w as p,p as W}from"./index-a4468079.js";import{u as _,m as $,g as A,T as r}from"./constant-fe2832e2.js";import{c as H}from"./data-ca5ed7de.js";const N=w().shape({subject:d().required("Subject is required.").min(2,"Subject has to contain at least 2 characters.").max(50,"Subject length must not exceed 50 characters."),description:d().required("Description is required.").min(2,"Description has to contain at least 2 characters.").max(1024,"Description length must not exceed 1024 characters.")}),Q={subject:"",description:"",submit:null};function P(x){let{api:j,openSnackbar:o,closeSnackbar:b,user_id:g}=x,[k,f]=B.useState(!1),{t:c}=_(),v=q(),s=z(),t=F({initialValues:Q,validationSchema:N,onSubmit:async(T,{setSubmitting:a,setErrors:C})=>{a(!0);try{if((await H(j,g||"",T)).data.status=="ok")a(!1),f(!0),o({open:!0,message:c("Ticket submitted Successfully!",{ns:["common","translation"]}),variant:"alert",anchorOrigin:{vertical:"bottom",horizontal:"center"},alert:{color:"success"},close:!1}),setTimeout(()=>{b(),v("/support-services")},2500);else throw new Error("Unable to create Ticket.")}catch(u){let D=u.message;a(!1),C({submit:D}),o({open:!0,message:c("Unable to create ticket, please contact your Administrator.",{ns:["common","translation"]}),variant:"alert",anchorOrigin:{vertical:"bottom",horizontal:"center"},alert:{color:"error"},close:!1})}}}),S=L(s.breakpoints.down("md")),l="800px";S&&(l="98%");const y={background:s.palette.mode==="dark"?s.palette.dark.main:s.palette.grey[50],border:"1px solid #BCBCBC"};return e.jsx(E,{open:!0,children:e.jsx(i,{sx:{width:l,...$,...y},children:e.jsxs("form",{onSubmit:t.handleSubmit,children:[t.isSubmitting&&e.jsx(M,{}),e.jsxs(n,{direction:"column",spacing:A,children:[e.jsxs(i,{children:[e.jsx(I,{component:O,to:"..",relative:"path",sx:{float:"right"},children:e.jsx(R,{})}),e.jsx(U,{variant:"h3",children:e.jsx(r,{children:"Raise a ticket"})})]}),e.jsx(V,{sx:{mt:0}}),e.jsxs(n,{direction:"column",children:[e.jsxs(m,{children:[e.jsx(r,{children:"Subject"})," *"]}),e.jsx(h,{name:"subject",size:"small",type:"text",value:t.values.subject,onChange:t.handleChange}),t.touched.subject&&t.errors.subject&&e.jsx(p,{error:!0,children:t.errors.subject})]}),e.jsxs(n,{direction:"column",children:[e.jsxs(m,{children:[e.jsx(r,{children:"Description"})," *"]}),e.jsx(h,{rows:4,fullWidth:!0,multiline:!0,name:"description",size:"small",type:"text",value:t.values.description,onChange:t.handleChange}),t.touched.description&&t.errors.description&&e.jsx(p,{error:!0,children:t.errors.description})]}),!k&&e.jsx(i,{mt:2,children:e.jsx(W,{variant:"contained",size:"large",onClick:t.submitForm,disabled:t.isSubmitting,sx:{backgroundColor:"#16B572","&:hover":{backgroundColor:"#13a463"}},children:e.jsx(r,{children:"Submit"})})})]})]})})})}export{P 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.