PageSourceSearch

https://fikraevents.com/build/assets/_slug_-DaR1zrCw.js

js fikraevents.com collected 2026-10-04 06:31:40 UTC 8,133 bytes, 1 lines download raw bytes

1import{j as e,a as s}from"./ui-Dz5CFnta.js";import{I as r}from"./input-error-Co6ldkHn.js";import{B as a}from"./button-DtWFyvMW.js";import{C as t}from"./checkbox-yaiDPXje.js";import{I as i}from"./input-Cyx6eXPZ.js";import{L as l}from"./label-BGISOLnw.js";import{S as n,a as d,b as c,c as o,e as m}from"./select-BTNsx7am.js";import{T as x}from"./textarea-BemDCX5B.js";import{S as p}from"./site-layout-CcKq8DYZ.js";import{a as u,u as h,H as j,L as g}from"./app-CWNYW_tK.js";import{A as f}from"./arrow-left-3XkDYAnm.js";import{U as v}from"./upload-BX2sG35O.js";import{S as b}from"./star-Bvwwl_nI.js";import"./index-dsp9MoVC.js";import"./check-B1ij4JZM.js";import"./createLucideIcon-Ca3eeypX.js";import"./index-ipYlkjID.js";import"./index-B2pkL5vp.js";import"./chevron-up-DYRXlY5J.js";import"./vendor-CSnzqfkr.js";import"./circle-check-big-IZQ4k49B.js";import"./circle-alert-DLBJvvPh.js";import"./loader-circle-BMjpsBbC.js";import"./index-_cYmSVT0.js";/* empty css            */function N({value:r,onChange:a}){const[t,i]=s.useState(0);return e.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(s=>e.jsx("button",{type:"button",className:"focus:outline-none",onMouseEnter:()=>i(s),onMouseLeave:()=>i(0),onClick:()=>a(s),children:e.jsx(b,{className:"h-8 w-8 transition-colors "+(s<=(t||r)?"fill-yellow-400 text-yellow-400":"text-gray-400")})},s))})}function y({field:a,value:t,onChange:i,error:n,processing:d}){const[c,o]=s.useState(!1);return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{htmlFor:a.id,children:[a.label,a.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsxs("div",{className:`relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 transition-colors ${c?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-muted-foreground/50"} ${d?"pointer-events-none opacity-50":"cursor-pointer"}`,onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:e=>{e.preventDefault(),o(!1);const s=e.dataTransfer.files[0];s&&i(s)},onClick:()=>{d||document.getElementById(a.id)?.click()},children:[e.jsx("input",{id:a.id,type:"file",className:"sr-only",accept:".pdf,.png,.jpeg,.jpg,.mp3,.mp4",disabled:d,onChange:e=>i(e.target.files?.[0]??null)}),e.jsx(v,{className:"text-muted-foreground mb-2 h-8 w-8"}),t?e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:t.name}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:[(t.size/1048576).toFixed(2)," MB"]}),e.jsx("button",{type:"button",className:"text-primary mt-1 text-xs underline",onClick:e=>{e.stopPropagation(),i(null)},children:"Remove"})]}):e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Drop file here or click to upload"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"PDF, PNG, JPEG, JPG, MP3, MP4 — max 20MB"})]})]}),n&&e.jsx(r,{message:n})]})}function C({field:s,value:a,onChange:p,error:u,processing:h}){switch(s.type){case"text":case"email":case"number":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{htmlFor:s.id,children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsx(i,{id:s.id,type:s.type,value:a||"",onChange:e=>p(e.target.value),placeholder:s.placeholder||"",required:s.required,disabled:h}),u&&e.jsx(r,{message:u})]});case"textarea":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{htmlFor:s.id,children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsx(x,{id:s.id,value:a||"",onChange:e=>p(e.target.value),placeholder:s.placeholder||"",rows:4,required:s.required,disabled:h}),u&&e.jsx(r,{message:u})]});case"date":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{htmlFor:s.id,children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsx(i,{id:s.id,type:"date",value:a||"",onChange:e=>p(e.target.value),required:s.required,disabled:h}),u&&e.jsx(r,{message:u})]});case"select":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{htmlFor:s.id,children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsxs(n,{value:a||"",onValueChange:p,disabled:h,children:[e.jsx(d,{children:e.jsx(c,{placeholder:s.placeholder||"Select an option"})}),e.jsx(o,{children:s.options?.map(s=>e.jsx(m,{value:s,children:s},s))})]}),u&&e.jsx(r,{message:u})]});case"radio":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsx("div",{className:"space-y-2",children:s.options?.map(r=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[e.jsx("input",{type:"radio",name:s.id,value:r,checked:a===r,onChange:()=>p(r),disabled:h,className:"text-primary h-4 w-4"}),e.jsx("span",{className:"text-sm",children:r})]},r))}),u&&e.jsx(r,{message:u})]});case"checkbox":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsx("div",{className:"space-y-2",children:s.options?.map(s=>{const r=a||[],i=r.includes(s);return e.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[e.jsx(t,{checked:i,onCheckedChange:e=>{p(e?[...r,s]:r.filter(e=>e!==s))},disabled:h}),e.jsx("span",{className:"text-sm",children:s})]},s)})}),u&&e.jsx(r,{message:u})]});case"rating":return e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(l,{children:[s.label,s.required&&e.jsx("span",{className:"text-red-500",children:" *"})]}),e.jsx(N,{value:a||0,onChange:e=>p(e)}),u&&e.jsx(r,{message:u})]});case"file":return e.jsx(y,{field:s,value:a,onChange:e=>p(e),error:u,processing:h});default:return null}}function w({event:s,survey:r,submitted:t}){const{auth:i}=u().props,l=[...r.fields].sort((e,s)=>e.order-s.order),n={};
1l.forEach(e=>{"checkbox"===e.type?n[e.id]=[]:"file"===e.type?n[e.id]=null:n[e.id]=""});const{data:d,setData:c,post:o,processing:m,errors:x}=h({responses:n});return e.jsxs(p,{children:[e.jsxs(j,{children:[e.jsx("title",{children:r?.title?`${r.title}`:"Survey"}),e.jsx("meta",{"head-key":"description",name:"description",content:r?.description||""})]}),e.jsx("div",{className:"mt-4 py-8 pb-24 md:py-4 md:pb-48 lg:px-6",children:e.jsx("div",{className:"3xl:px-24 mx-auto w-full md:px-4 2xl:max-w-none 2xl:px-16",children:e.jsxs("div",{className:"bg-muted p-4 md:rounded-3xl md:p-8 2xl:p-12",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"mb-2 text-2xl font-black md:text-2xl 2xl:text-3xl",children:r.title}),r.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:r.description})]}),e.jsx(a,{variant:"secondary",className:"size-10",asChild:!0,children:e.jsxs(g,{href:route("events.show",s.slug),className:"flex w-50 items-center gap-2 text-white",children:[e.jsx(f,{className:"h-4 w-4"})," Back to Event"]})})]}),t?e.jsxs("div",{className:"col-12 mb-5 text-center",children:[e.jsx("h2",{children:"Thank you! You have already submitted this survey."}),e.jsx(a,{asChild:!0,className:"mt-4",children:e.jsx(g,{href:route("events.show",s.slug),children:"Back to Event"})})]}):e.jsx("section",{className:"rounded-3xl md:h-fit",children:i?.user?e.jsxs("form",{className:"space-y-6",onSubmit:e=>{e.preventDefault(),o(route("events.survey.store",{event:s.slug,survey:r.slug}),{forceFormData:!0})},children:[e.jsx("div",{className:"grid gap-4",children:l.map(s=>e.jsx(C,{field:s,value:d.responses[s.id],onChange:e=>c("responses",{...d.responses,[s.id]:e}),error:x[`responses.${s.id}`],processing:m},s.id))}),e.jsx(a,{type:"submit",className:"w-full",disabled:m,children:m?"Submitting...":"Submit Survey"})]}):e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"mb-4 text-lg",children:"Please log in to submit this survey."}),e.jsx(a,{type:"button",className:"w-full",variant:"secondary",onClick:()=>window.location.href=route("login"),children:"Login to submit survey"})]})})]})})})]})}export{w 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.