1import{a as e,t}from"./jsx-runtime-D_MnEzuy.js";import{t as n}from"./react-DBEjWt7A.js";import{n as r,t as i}from"./createServerFn-VTmtgM-o.js";import{t as a}from"./fileRoute-BoNWulra.js";import{i as o,n as s}from"./dist-DT2jQ2P_.js";import{t as c}from"./button-CUnEcMYq.js";import{n as l}from"./pwa-dialog-C_54NOEc.js";var u=e(n(),1),d=i({method:`POST`}).handler(r(`089baddf080659c82a803c70f73fbc730fd23295fb0df879f6755b916fbf9e72`));a(`/api/feedback`)({});var f=t(),p=u.forwardRef(({className:e,...t},n)=>(0,f.jsx)(`textarea`,{className:o(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));p.displayName=`Textarea`;var m=({onFinish:e,className:t})=>{let[n,r]=(0,u.useState)(!1),[i,a]=(0,u.useState)(0),o=(0,u.useRef)(null),l=(0,u.useCallback)(async t=>{let{feedback:n,rating:i}=t;if(!n.trim()&&!i){o.current?.classList.add(`animate-shake`),setTimeout(()=>{o.current?.classList.remove(`animate-shake`)},500);return}r(!0);try{let{ok:t}=await d({data:{text:n,rating:i}});if(!t)return;s.success(`Thanks for your feedback! ð`),e?.()}finally{r(!1)}},[d,r]);return(0,f.jsx)(`div`,{className:t,children:(0,f.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=e.target.feedback.value;l({feedback:t,rating:i})},children:[(0,f.jsxs)(`div`,{className:`flex items-center max-sm:justify-between`,children:[(0,f.jsx)(`label`,{htmlFor:`rating`,className:`block font-medium text-foreground/60`,children:`Rating`}),(0,f.jsx)(`div`,{className:`flex`,children:[1,2,3,4,5].map(e=>(0,f.jsx)(`button`,{type:`button`,className:`outline-none text-2xl pl-4 transition-all duration-200 hover:scale-110 ${e<=i?`text-yellow-400 hover:text-yellow-300`:`text-foreground/20 hover:text-foreground/40`}`,onClick:()=>a(e),children:`â `},e))})]}),(0,f.jsx)(p,{className:`w-full mt-3 min-h-[120px] bg-background/50 border-none 2 placeholder:text-foreground/40 transition-all`,placeholder:`Share your thoughts with us! We'd love to hear from you :)`,name:`feedback`}),(0,f.jsx)(`div`,{className:`flex justify-end`,children:(0,f.jsx)(c,{ref:o,type:`submit`,className:`mt-4 transition-all duration-200 rounded-full font-medium`,disabled:n,loading:n,children:`Send feedback`})})]})})},h=()=>{let{renderDialog:e,openDialog:t,closeDialog:n}=l({title:(0,f.jsx)(`div`,{className:`text-left`,children:`Feedback`}),render:()=>(0,f.jsx)(m,{className:`-mt-5`,onFinish:n})});return{renderFeedbackDialog:e,openFeedbackDialog:t}};export{h as n,m as t};
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.