PageSourceSearch

https://peterteszary.com/wp-content/plugins/support-genix/assets/apps/portal/js/Guest.DY7VIppx.js

js peterteszary.com collected 2026-10-06 23:56:02 UTC 14,844 bytes, 1 lines download raw bytes

1import{u as Ue,j as s,b as es,d as ss,E as ts,_ as p,s as rs,f as ns,F as ee,G as is,t as n,g as be,q as as}from"../main.DReQ1qny.js";import{j as w,r as T,f as W,s as D,L as He,F as se,d as z,C as d,l as ls,I as os,Q as we,z as ke,B as H,T as cs,q as $,k as te,o as E,u as Te,v as Fe,n as re,p as ds,U as ie,w as us,x as ne,y as Ce}from"./antd.DN0Ff4E-.js";import{h as ps,u as ms}from"./useReCaptcha.DFMFOOuJ.js";import{T as hs,t as Ee,g as xs,b as _s,c as Re,a as Be}from"./withQuillEditorConfig.BI0p_GPJ.js";import{u as js,Q as ys}from"./QuillEditor.DmInve9R.js";import{R as Ie,g as gs}from"./copy-text.DCJskiW5.js";import{f as Ne}from"./field-conditions.BhHFwLWY.js";import{i as fs}from"./lite-edition.DDQkBk6c.js";import{a as qe}from"./toast.CEOGYC2u.js";import{w as ze}from"./weekend-notice.C97X71Q5.js";import{a as bs}from"./vendor.D7Gu7QHv.js";import{R as ws}from"./UserAddOutlined.DqM5ZIjj.js";import{R as ks}from"./UserOutlined.CPbYLTbC.js";const{Content:Ts}=He,{Text:L,Title:Le,Paragraph:Fs}=cs,{Dragger:Cs}=ie,Ye=gs(),Es=_s(),Me=fs(),G=as(),O="YYYY-MM-DD",As=()=>{const{getBasicSettings:Y}=Ue(),M=Y(),R=M==null?void 0:M.captcha;return R.status?s.jsxs(s.Fragment,{children:[R!=null&&R.hide_badge?s.jsx("style",{children:".grecaptcha-badge {visibility: hidden !important;}"}):null,s.jsx(ps,{reCaptchaKey:R.site_key,scriptProps:{async:!1,defer:!1,appendTo:"head",nonce:void 0},children:s.jsx(Se,{})})]}):s.jsx(Se,{})};function Se(){var he,xe;const Y=es(),M=bs(),R=js(),[B]=w.useForm(),[Pe,Ae]=T.useState(""),[P,Q]=T.useState([]),[Ve,v]=T.useState(""),[K,J]=T.useState([]),{getBasicSettings:We}=Ue(),{handleReCaptchaVerify:De}=ms(),[ae,le]=T.useState(null),[oe,F]=T.useState(""),[$e,C]=T.useState(!1),[Ge,S]=ss(),[Oe,U]=ts(),ce=T.useRef(null),a=We(),X=(a==null?void 0:a.disable_registration_form)!=="Y"&&(a==null?void 0:a.disable_guest_ticket_creation)!=="Y",de=a==null?void 0:a.captcha,o=a==null?void 0:a.file_upload,Qe=a==null?void 0:a.enable_docs_suggestions,A=a==null?void 0:a.categories,N=((he=a==null?void 0:a.custom_fields)==null?void 0:he.reg_form)||[],ue={};for(const e of N){const t=(e==null?void 0:e.field_type)||"",i=(e==null?void 0:e.input_name)||"",r=(e==null?void 0:e.field_value)||"";if(t==="E")continue;let l=r;t==="N"?l=r?p.toNumber(r):"":t==="D"?l=r?W(r):"":t==="S"?l=r?!!r:!1:l=p.trim(r),ue[i]=l}const q=((xe=a==null?void 0:a.custom_fields)==null?void 0:xe.ticket_form)||[],pe={};for(const e of q){const t=(e==null?void 0:e.field_type)||"",i=(e==null?void 0:e.input_name)||"",r=(e==null?void 0:e.field_value)||"";if(t==="E")continue;let l=r;t==="N"?l=r?p.toNumber(r):"":t==="D"?l=r?W(r):"":t==="S"?l=r?!!r:!1:l=p.trim(r),pe[i]=l}const ve={...ue,...pe,email:"",first_name:"",last_name:"",cat_id:"",is_public:!1},me=(e,t)=>
1{if(p.has(e,"cat_id")&&Ae((e==null?void 0:e.cat_id)||""),Qe==="Y"&&p.has(e,"title")){const i=e.title;R(()=>{if(!i){v(""),J([]);return}Ve!==i&&(v(i),Ge({action:"ticket_suggested_docs",keyword:i}))},1e3)}le(t||{})},Ke=async e=>{var g,_e,je,ye,ge,fe;const t=((g=e==null?void 0:e.email)==null?void 0:g.trim())||"",i=((_e=e==null?void 0:e.first_name)==null?void 0:_e.trim())||"",r=((je=e==null?void 0:e.last_name)==null?void 0:je.trim())||"",l=((ye=e==null?void 0:e.cat_id)==null?void 0:ye.trim())||"0",j=((ge=e==null?void 0:e.title)==null?void 0:ge.trim())||"",y=Ee(((fe=e==null?void 0:e.ticket_body)==null?void 0:fe.trim())||""),k=e!=null&&e.is_public?"Y":"N";if(!y){B.setFieldValue("ticket_body",""),C(!1),F(n("%s is not valid.",n("Description")));return}let I="";if(de.status&&de.on_create_ticket&&(I=await De(),!I)){D.error(n("reCAPTCHA verification failed"));return}const f={email:t,first_name:i,last_name:r},u={};for(const m in e){const h=N.find(b=>(b==null?void 0:b.input_name)===m);if(h&&(p.has(h,"is_editable")?(h==null?void 0:h.is_editable)||!1:!0)){const V=(h==null?void 0:h.field_type)||"";V==="N"?u[m]=p.toString(e[m]):V==="D"?u[m]=W(e[m]).format(O):V==="S"?u[m]=e[m]?1:0:u[m]=p.trim(e[m])}}f.custom_fields=u;const x={cat_id:l,title:j,ticket_body:y,is_public:k},_={};for(const m in e){const h=q.find(b=>(b==null?void 0:b.input_name)===m);if(h){const b=(h==null?void 0:h.categories)||"";if(!p.isEmpty(b)&&!p.includes(b,l)&&!p.includes(b,"0"))return null;if(p.has(h,"is_editable")?(h==null?void 0:h.is_editable)||!1:!0){const Z=(h==null?void 0:h.field_type)||"";Z==="N"?_[m]=p.toString(e[m]):Z==="D"?_[m]=W(e[m]).format(O):Z==="S"?_[m]=e[m]?1:0:_[m]=p.trim(e[m])}}}x.custom_fields=_;const c=new FormData;c.append("grcToken",I),c.append("user",JSON.stringify(f)),c.append("ticket",JSON.stringify(x)),P.forEach(m=>{c.append("attached[]",m.originFileObj)}),Oe({params:{action:"users_add_guest"},data:c,headers:{"Content-Type":"multipart/form-data"}})},Je=e=>{const t=e.size,i=e.type,r=Re(o==null?void 0:o.file_upload_size);return Be(o==null?void 0:o.allowed_type).includes(i)?t>r?(C(!1),F(n("File size must be smaller than %s.",((o==null?void 0:o.file_upload_size)||2)+" MB")),ie.LIST_IGNORE):!0:(C(!1),F(n("Invalid file type.")),ie.LIST_IGNORE)},Xe=({fileList:e,file:t})=>{const i=t.size,r=t.type,l=Re(o==null?void 0:o.file_upload_size);if(!Be(o==null?void 0:o.allowed_type).includes(r)){C(!1),F(n("Invalid file type."));return}if(i>l){C(!1),F(n("File size must be smaller than %s.",((o==null?void 0:o.file_upload_size)||2)+" MB"));return}Q(e)},Ze=e=>{const t=P.indexOf(e),i=P.slice().splice(t,1);Q(i)};return T.useEffect(()=>{var l,j;const{data:e,isFetching:t,isError:i,error:r}=S;!t&&i&&D.error((j=(l=r==null?void 0:r.data)==null?void 0:l.errors)==null?void 0:j.message),!t&&!i&&e&&(J((e==null?void 0:e.data)||[]),ce.current.focus({cursor:"end"}))},[S]),T.useEffect(()=>{var l,j,y,k;const{data:e,isLoading:t,isError:i,error:r}=U;Y(t?rs():ns()),!t&&i&&((j=(l=r==null?void 0:r.data)==null?void 0:l.errors)!=null&&j.message)&&D.error((k=(y=r==null?void 0:r.data)==null?void 0:y.errors)==null?void 0:k.message),!t&&!i&&e&&(e!=null&&e.msg&&(e!=null&&e.status?(F(""),D.success(e==null?void 0:e.msg)):(C(!1),F(e==null?void 0:e.msg),qe())),e!=null&&e.status&&(B.resetFields(),Q([]),v(""),J([]),le(null),C(!0),qe()))},[U,M,Y,B]),s.jsx(He,{style:{background:"transparent",minHeight:G?"auto":"calc(100vh - 48px)",padding:"8px 0"},children:s.jsx(Ts,{style:{padding:"0 8px"},children:s.jsx(se,{vertical:!0,justify:"center",align:"center",style:{minHeight:G?"auto":"calc(100vh - 64px)"},children:s.jsx(z,{justify:"space-around",style:{width:"100%"},children:s.jsx(d,{span:24,style:{maxWidth:"620px"},children:s.jsx(z,{children:s.jsxs(d,{span:24,children:[s.jsxs(ls,{size:"small",styles:{header:{background:"#fafafa"},body:{padding:"24px"}},style:{width:"100%"},children:[s.jsxs(z,{children:[G?null:s.jsx(d,{span:24,style:{textAlign:"center",marginBottom:"24px"},children:s.jsx("a",{href:ee(),style:{display:"inline-block",lineHeight:0},children:s.jsx(os,{src:is(),preview:!1,width:"auto",height:34})})}),s.jsxs(d,{span:24,children:[G?null:s.jsx(we,{style:{margin:"0 0 12px 0"}}),s.jsxs(z,{gutter:16,justify:"space-between",align:"middle",style:{marginBottom:"4px"},children:[s.jsx(d,{style:{paddingBottom:"8px"},children:X?s.jsx(s.Fragment,{children:s.jsxs(se,{gap:"0 8px",wrap:!0,children:[s.jsx(ke,{title:n("Home"),children:s.jsx(H,{href:ee(),icon:s.jsx(Ie,{})})}),s.jsx(H,{href:"#/register",icon:s.jsx(ws,{}),children:n("Register")})]})}):s.jsx(Le,{level:5,style:{fontSize:"16px",margin:0},children:n("Create Ticket as a Guest")})}),s.jsx(d,{style:{paddingBottom:"8px"},children:s.jsxs($,{children:[(a==null?void 0:a.disable_guest_ticket_creation)!=="Y"?s.jsx(H,{color:"primary",variant:"outlined",href:"#/login",icon:s.jsx(ks,{}),children:n("Returning User? Login")}):null,X?null:s.jsx(ke,{title:n("Home"),children:s.jsx(H,{href:ee(),icon:s.jsx(Ie,{})})})]})})]}),s.jsx(we,{style:{margin:"0 0 24px 0"}})]})]}),s.jsxs(z,{children:[!Me&&ze?s.jsx(d,{span:24,children:s.jsx(te,{message:s.jsx("div",{className:"sg-reply-text",dangerouslySetInnerHTML:{__html:be(ze)}}),type:"warning",style:{marginBottom:"24px"}})}):null,X?s.jsx(d,{span:24,children:s.jsx(Le,{level:5,style:{fontSize:"16px",margin:"0 0 24px 0"},children:n("Create Ticket as a Guest")})}
1):null,s.jsx(d,{span:24,children:s.jsx(w,{form:B,name:"guestTicket",layout:"vertical",onFinish:Ke,onValuesChange:me,initialValues:ve,autoComplete:"off",children:s.jsxs(z,{gutter:16,children:[oe?s.jsx(d,{span:24,children:s.jsx(te,{message:oe,type:"error",showIcon:!0,closable:!0,afterClose:()=>F(""),style:{marginBottom:"24px"}})}):null,$e?s.jsx(d,{span:24,children:s.jsx(te,{message:s.jsx(s.Fragment,{children:s.jsxs(L,{children:[n("Success! Your ticket has been created."),s.jsx("br",{}),n("Our support team will review it and respond soon."),s.jsx("br",{}),n("Thank you for reaching out!")]})}),type:"success",showIcon:!1,closable:!0,afterClose:()=>C(!1),style:{marginBottom:"24px"}})}):null,s.jsx(d,{span:12,children:s.jsx(w.Item,{label:n("First Name"),name:"first_name",rules:[{required:!0,message:n("%s is required.",n("First name")),whitespace:!0}],children:s.jsx(E,{})})}),s.jsx(d,{span:12,children:s.jsx(w.Item,{label:n("Last Name"),name:"last_name",rules:[{required:!0,message:n("%s is required.",n("Last name")),whitespace:!0}],children:s.jsx(E,{})})}),s.jsx(d,{span:24,children:s.jsx(w.Item,{label:n("Email Address"),name:"email",rules:[{required:!0,message:n("%s is required.",n("Email address")),whitespace:!0}],children:s.jsx(E,{})})}),N==null?void 0:N.map(e=>{if(!Ne(e,N,ae))return null;const t=(e==null?void 0:e.field_type)||"",i=(e==null?void 0:e.input_name)||"",r=(e==null?void 0:e.field_label)||"",l=(e==null?void 0:e.field_value)||"",j=(e==null?void 0:e.fld_option)||"",y=(e==null?void 0:e.help_text)||"",k=(e==null?void 0:e.is_required)==="Y",I=(e==null?void 0:e.is_half_field)==="Y",f=p.has(e,"is_editable")?(e==null?void 0:e.is_editable)||!1:!0;let u=[];i==="wc_store_id"?u=j==null?void 0:j.map(c=>({value:p.toString(c==null?void 0:c.id),label:c==null?void 0:c.title})):u=j?j.split(",").map(c=>({value:c,label:c})):[],t==="W"&&!u.find(c=>(c==null?void 0:c.value)===l)&&(u=[{value:"",label:`-- ${n("Select")} ---`},...u]);let x=null;t==="T"?x=s.jsx(E,{placeholder:y,disabled:!f}):t==="N"?x=s.jsx(Ce,{placeholder:y,disabled:!f,style:{width:"100%"}}):t==="D"?x=s.jsx(Te,{placeholder:y||n("Select date"),format:O,disabled:!f,style:{width:"100%"}}):t==="S"?x=s.jsx(ne,{disabled:!f}):t==="R"?x=s.jsx(Fe.Group,{options:u,disabled:!f}):t==="W"?x=s.jsx(re,{placeholder:y||n("Select option"),options:u,disabled:!f,style:{width:"100%"}}):t==="U"&&(x=s.jsx(E,{disabled:!f}));const _={};return t==="S"&&(_.valuePropName="checked"),t==="R"&&(_.htmlFor=null),s.jsx(d,{span:I?12:24,children:t==="E"?s.jsx(L,{style:{display:"block",marginBottom:"24px"},children:j}):s.jsx(w.Item,{label:r,name:i,rules:[{required:!!(f&&k),message:n("This field is required.")}],..._,children:x})},i)}),1<((A==null?void 0:A.length)||0)?s.jsx(d,{span:24,children:s.jsx(w.Item,{label:n("Category"),name:"cat_id",children:s.jsx(re,{options:A})})}):null,s.jsx(d,{span:24,children:s.jsx(w.Item,{label:n("Subject"),name:"title",rules:[{required:!0,message:n("%s is required.",n("Subject")),whitespace:!0}],children:s.jsx(E,{ref:ce,suffix:S!=null&&S.isFetching?s.jsx(ds,{}):null,className:"sg-input-loading"})})}),K==null?void 0:K.map((e,t)=>{var i;return s.jsx(d,{span:24,children:s.jsxs($,{direction:"vertical",style:{marginBottom:"24px"},children:[s.jsx(L,{children:(e==null?void 0:e.heading)||""}),s.jsx(Fs,{style:{margin:0},children:s.jsx("ul",{style:{margin:0},children:(i=e==null?void 0:e.docs)==null?void 0:i.map((r,l)=>s.jsx("li",{children:s.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:(r==null?void 0:r.link)||"#",children:(r==null?void 0:r.title)||""})},l))})})]})},t)}),q==null?void 0:q.map(e=>{const t=(e==null?void 0:e.categories)||"";if(!p.isEmpty(t)&&!p.includes(t,Pe)&&!p.includes(t,"0")||!Ne(e,q,ae))return null;const i=(e==null?void 0:e.field_type)||"",r=(e==null?void 0:e.input_name)||"",l=(e==null?void 0:e.field_label)||"",j=(e==null?void 0:e.field_value)||"",y=(e==null?void 0:e.fld_option)||"",k=(e==null?void 0:e.help_text)||"",I=(e==null?void 0:e.is_required)==="Y",f=(e==null?void 0:e.is_half_field)==="Y",u=p.has(e,"is_editable")?(e==null?void 0:e.is_editable)||!1:!0;let x=[];r==="wc_store_id"?x=y==null?void 0:y.map(g=>({value:p.toString(g==null?void 0:g.id),label:g==null?void 0:g.title})):x=y?y.split(",").map(g=>({value:g,label:g})):[],i==="W"&&!x.find(g=>(g==null?void 0:g.value)===j)&&(x=[{value:"",label:`-- ${n("Select")} ---`},...x]);let _=null;i==="T"?_=s.jsx(E,{placeholder:k,disabled:!u}):i==="N"?_=s.jsx(Ce,{placeholder:k,disabled:!u,style:{width:"100%"}}):i==="D"?_=s.jsx(Te,{placeholder:k||n("Select date"),format:O,disabled:!u,style:{width:"100%"}}):i==="S"?_=s.jsx(ne,{disabled:!u}):i==="R"?_=s.jsx(Fe.Group,{options:x,disabled:!u}):i==="W"?_=s.jsx(re,{placeholder:k||n("Select option"),options:x,disabled:!u,style:{width:"100%"}}):i==="U"&&(_=s.jsx(E,{disabled:!u}));const c={};return i==="S"&&(c.valuePropName="checked"),i==="R"&&(c.htmlFor=null),s.jsx(d,{span:f?12:24,children:i==="E"?s.jsx(L,{style:{display:"block",marginBottom:"24px"},children:y}):s.jsx(w.Item,{label:l,name:r,rules:[{required:!!(u&&I),message:n("This field is required.")}],...c,children:_})},r)}),s.jsx(d,{span:24,children:s.jsx(w.Item,{label:n("Description"),name:"ticket_body",rules:[{required:!0,message:n("%s is required.",n("Description")),whitespace:!0},{validator:(e,t)=>
1{const i=Ee(t||"");return!t||i?Promise.resolve():Promise.reject(new Error(n("%s is not valid.",n("Description"))))}}],htmlFor:null,children:!Me&&Es==="quill"?s.jsx(ys,{onModal:!0}):s.jsx(hs,{id:"guest-ticket"})})}),o!=null&&o.ticket_file_upload?s.jsx(d,{span:24,children:s.jsx(w.Item,{name:"attached",children:s.jsx(Cs,{multiple:!0,name:"attached",fileList:P,onChange:Xe,onRemove:Ze,beforeUpload:Je,accept:xs((o==null?void 0:o.allowed_type)||[],!0,!0),children:s.jsxs(se,{align:"center",justify:"center",gap:4,wrap:!0,children:[s.jsx(us,{}),n("Click or drag file to upload")]})})})}):null,(a==null?void 0:a.is_public_ticket_opt_on_creation)==="Y"?s.jsx(d,{span:24,children:s.jsxs($,{align:"center",style:{marginBottom:"24px"},children:[s.jsx(w.Item,{name:"is_public",valuePropName:"checked",style:{marginBottom:0},children:s.jsx(ne,{size:"small"})}),s.jsx(L,{onClick:()=>{B.setFieldValue("is_public",!B.getFieldValue("is_public")),me(null,B.getFieldsValue())},style:{cursor:"pointer"},children:n("Make this ticket public.")})]})}):null,s.jsx(d,{span:24,style:{textAlign:"right"},children:s.jsx($,{children:s.jsx(H,{type:"primary",htmlType:"submit",loading:U==null?void 0:U.isLoading,children:n("Create")})})})]})})})]})]}),Ye?s.jsx(L,{style:{display:"block",background:"transparent",color:"rgba(0, 0, 0, 0.75)",textAlign:"center",padding:"20px 0 0 0"},children:s.jsx("span",{dangerouslySetInnerHTML:{__html:be(Ye)}})}):null]})})})})})})})}export{As 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.