1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3369],{93369:function(e,s,t){t.r(s),t.d(s,{default:function(){return ModalCustomToolRequest}});var a=t(24246),l=t(27378),i=t(23615),r=t.n(i),o=t(83341),n=t(21726),m=t(45834),d=t(73949),c=t(81168),u=t(89046);function ModalCustomToolRequest(e){let{show:s,setShow:t,onCancel:i}=e,r=(0,l.useRef)(),x=(0,l.useRef)(),[h,f]=(0,l.useState)("initial"),[b,g]=(0,l.useState)({}),[y,p]=(0,l.useState)(""),setError=e=>{f("error"),p(e)},submitDetails=async()=>{if(!b)return setError("Please fill out the form before submitting.");if(!b.email||!b.email.includes("@"))return setError("Please enter a valid email.");if(!b.details)return setError("Please provide details about your custom tool request.");try{let e=await c.R2({type:"tool-request",name:b.name,email:b.email,company:b.company,details:b.details});e.success?f("submitted"):(f("error"),p(e.message))}catch(e){f("error"),p(e.message)}};return(0,l.useEffect)(()=>{s&&(f("initial"),g({}),p(""))},[s]),l.useEffect(()=>{"submitting"===h&&submitDetails()},[h]),(0,a.jsx)(o.u.Root,{show:s,as:l.Fragment,children:(0,a.jsx)(n.V,{as:"div",static:!0,className:"fixed z-10
1inset-0 overflow-y-auto",initialFocus:x,open:s,onClose:t,children:(0,a.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,a.jsx)(o.u.Child,{as:l.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)(n.V.Overlay,{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"â"}),(0,a.jsx)(o.u.Child,{as:l.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,a.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-5",children:[(0,a.jsx)(n.V.Title,{as:"h3",className:"text-lg leading-6 font-medium text-gray-900",children:"Custom Tool Request"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Tell us about your custom tool needs, and we'll get back to you with more information."})})]})}),(0,a.jsxs)("div",{className:"mt-5 sm:mt-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700",children:"Name"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("input",{type:"text",id:"name",className:"shadow-sm focus:ring-orange-500 focus:border-orange-500 block w-full sm:text-sm border-gray-300 rounded-md",disabled:"submitted"===h,value:b.name||"",onChange:e=>g({...b,name:e.target.value})})})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Email"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("input",{type:"email",id:"email",className:"shadow-sm focus:ring-orange-500 focus:border-orange-500 block w-full sm:text-sm border-gray-300 rounded-md",disabled:"submitted"===h,value:b.email||"",onChange:e=>g({...b,email:e.target.value}),ref:x})})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{htmlFor:"company",className:"block text-sm font-medium text-gray-700",children:"Company (optional)"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("input",{type:"text",id:"company",className:"shadow-sm focus:ring-orange-500 focus:border-orange-500 block w-full sm:text-sm border-gray-300 rounded-md",disabled:"submitted"===h,value:b.company||"",onChange:e=>g({...b,company:e.target.value})})})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{htmlFor:"details",className:"block text-sm font-medium text-gray-700",children:"Custom Tool Details"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("textarea",{id:"details",rows:4,className:"shadow-sm focus:ring-orange-500 focus:border-orange-500 block w-full sm:text-sm border-gray-300 rounded-md",disabled:"submitted"===h,value:b.details||"",onChange:e=>g({...b,details:e.target.value}),placeholder:"Describe the custom tool you need. What problem does it solve? Any specific features or configuration you're looking for?"})})]}),y&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-600",children:y}),"submitted"===h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mt-5 sm:mt-6",children:(0,a.jsxs)("div",{className:"flex items-center justify-center",children:[(0,a.jsx)(d.Z,{className:"h-6 w-6 text-green-400","aria-hidden":"true"}),(0,a.jsx)("p",{className:"ml-3 text-base font-medium text-gray-900",children:"Request submitted successfully!"})]})}),(0,a.jsx)("button",{type:"button",className:"mt-5 w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-orange-600 text-base font-medium text-white hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 sm:text-sm",onClick:i,ref:r,children:"Close"})]}):(0,a.jsx)("button",{type:"button",className:"mt-5 w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-orange-500 text-base font-medium text-white hover:bg-orange-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-400 sm:text-sm",disabled:"submitting"===h,onClick:()=>f("submitting"),children:"submitting"===h?(0,a.jsx)(u.Z,{className:"animate-spin mx-3 h-5 w-5 text-white"}):(0,a.jsxs)("span",{className:"flex items-center",children:["Submit",(0,a.jsx)(m.Z,{className:"ml-2 -mr-1 h-5 w-5","aria-hidden":"true"})]})})]})]})})]})})})}ModalCustomToolRequest.propTypes={show:r().bool.isRequired,setShow:r().func.isRequired,onCancel:r().func.isRequired}}}]);
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.