PageSourceSearch

https://buddicarsv.lovable.app/assets/survey-DJyczL8D.js

js buddicarsv.lovable.app collected 2026-10-03 03:24:48 UTC 9,287 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visits.functions-BsFZ1OZG.js","assets/sonner-D-yLv_Jo.js","assets/index-jOKgC_H_.js"])))=>i.map(i=>d[i]);
2import{r as l,_ as T,j as e}from"./index-jOKgC_H_.js";import{u as p,T as _,t as d}from"./sonner-D-yLv_Jo.js";import{i as I}from"./liff-Y5tXGdX_.js";import{S as E,a as C,g as R,u as P,s as z}from"./survey.functions-CAUNIaNC.js";const D="/__l5e/assets-v1/289f4321-1f00-47b6-87cf-3e64eb69f455/survey-hero.png",F={url:D},L="/__l5e/assets-v1/8c7c2990-54e5-49fd-bd98-dfff6a83e985/survey-complete.png",M={url:L};function v({className:a=""}){return e.jsx("div",{className:`absolute inset-0 -z-10 ${a}`,style:{background:"repeating-conic-gradient(from 0deg at 50% 50%, #ff7a1a 0deg 8deg, #ff9a3d 8deg 16deg)"},"aria-hidden":!0})}function Q(){const a=p(z),f=p(R),[o,u]=l.useState(null),[b,m]=l.useState(!0),[x,r]=l.useState(null),[c,h]=l.useState(null),[n,y]=l.useState(""),[j,w]=l.useState(new Set),[g,N]=l.useState(!1);l.useEffect(()=>{I().then(async t=>{if(u(t),t?.idToken){try{const s=await f({data:{lineIdToken:t.idToken}});s.ok&&s.response&&r(s.response)}catch{}T(async()=>{const{recordVisit:s}=await import("./visits.functions-BsFZ1OZG.js");return{recordVisit:s}},__vite__mapDeps([0,1,2])).then(({recordVisit:s})=>{s({data:{lineIdToken:t.idToken,path:"/survey"}}).catch(()=>{})})}m(!1)})},[]);const k=t=>{w(s=>{const i=new Set(s);return i.has(t)?i.delete(t):i.add(t),i})},S=async t=>{if(t.preventDefault(),!o?.idToken){d.error("LINEログインが必要です");return}if(!c){d.error("来場のきっかけを選択してください");return}N(!0);try{const s=n.trim()?Number(n):null,i=await a({data:{lineIdToken:o.idToken,source:c,partySize:s&&Number.isFinite(s)&&s>=1?Math.floor(s):null,interests:Array.from(j)}});if(!i.ok){d.error(i.error);return}r(i.response)}catch{d.error("通信エラーが発生しました")}finally{N(!1)}};return b?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[#ff7a1a]",children:e.jsx("div",{className:"text-sm text-white font-bold animate-pulse",children:"読み込み中..."})}):x?e.jsx(O,{row:x,displayName:o?.displayName,idToken:o?.idToken??void 0,onUpdate:r}):e.jsxs("div",{className:"relative min-h-screen overflow-hidden",children:[e.jsx(v,{}),e.jsx(_,{}),e.jsx("div",{className:"max-w-xl mx-auto px-4 pt-4",children:e.jsx("img",{src:F.url,alt:"BUDDICA 大阪堺支社 イベント受付",className:"w-full h-auto rounded-2xl shadow-[0_8px_0_rgba(0,0,0,0.15)]"})}),e.jsx("main",{className:"max-w-xl mx-auto p-4 pb-10",children:e.jsxs("form",{onSubmit:S,className:"bg-white rounded-3xl p-5 space-y-6 shadow-[0_6px_0_rgba(0,0,0,0.15)] border-4 border-white",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block bg-[#ff7a1a] text-white text-xs font-black tracking-widest px-4 py-1 rounded-full",children:"受付フォーム"}),e.jsxs("h1",{className:"mt-3 text-2xl font-black text-neutral-900",children:["かんたん3ステップで",e.jsx("br",{}),e.jsx("span",{className:"text-[#ff7a1a]",children:"1,000円分コイン"}),"ゲット!"]})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"font-black text-sm mb-2 text-neutral-900",children:["Q1. 何を見てご来場いただきましたか? ",e.jsx("span",{className:"text-[#ff3b30]",children:"*"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:E.map(t=>{const s=c===t;return e.jsx("button",{type:"button",onClick:()=>h(t),className:`p-3 rounded-xl border-2 text-sm font-black transition ${s?"bg-[#ff7a1a] text-white border-[#ff7a1a] shadow-[0_3px_0_rgba(0,0,0,0.15)]":"bg-white border-neutral-200 text-neutral-800 hover:border-[#ff7a1a]"}`,children:t},t)})})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"font-black text-sm mb-2 text-neutral-900",children:["Q2. ご来場人数 ",e.jsx("span",{className:"text-xs text-neutral-500 font-bold",children:"(任意)"})]}),e.jsx("input",{type:"number",inputMode:"numeric",min:1,max:20,value:n,onChange:t=>y(t.target.value),placeholder:"例: 2",className:"w-full px-3 py-2.5 rounded-xl border-2 border-neutral-200 bg-white font-bold focus:border-[#ff7a1a] outline-none"})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"font-black text-sm mb-2 text-neutral-900",children:["Q3. 今後興味がある内容"," ",e.jsx("span",{className:"text-xs text-neutral-500 font-bold",children:"(複数選択可)"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:C.map(t=>{const s=j.has(t);return e.jsx("button",{type:"button",onClick:()=>k(t),className:`p-3 rounded-xl border-2 text-sm font-black transition ${s?"bg-[#ff7a1a] text-white border-[#ff7a1a] shadow-[0_3px_0_rgba(0,0,0,0.15)]":"bg-white border-neutral-200 text-neutral-800 hover:border-[#ff7a1a]"}`,children:t},t)})})]}),e.jsx("button",{type:"submit",disabled:g||!c,className:"w-full py-4 rounded-2xl bg-[#ff7a1a] text-white font-black text-lg disabled:opacity-60 shadow-[0_4px_0_#c85300] active:translate-y-[2px] active:shadow-[0_2px_0_#c85300] transition",children:g?"送信中...":"回答してコインを受け取る 🎟"}),e.jsxs("p",{className:"text-[11px] text-neutral-500 leading-relaxed font-bold",children:["※おひとりさま1回限り",e.jsx("br",{}),"※ご家族でお越しの場合は代表者様がご回答ください",e.jsx("br",{}),"※フードコインはイベント当日/会場内のみ利用可(換金・払い戻し・おつり不可)"]})]})})]})}function O({row:a,displayName:f,idToken:o,onUpdate:u}){const b=p(P),[m,x]=l.useState(!1),r=!!a.redeemed_at,c=a.id.slice(0,8).toUpperCase(),h=async()=>
2{if(!r){if(!o){d.error("LINEログインが必要です");return}if(confirm(`受付スタッフの目の前で押してください。
3押すと「使用済み」になり、元に戻せません。よろしいですか?`)){x(!0);try{const n=await b({data:{lineIdToken:o,id:a.id}});n.ok?(u(n.response),d.success("使用済みにしました")):(d.error(n.error),n.response&&u(n.response))}catch{d.error("通信エラーが発生しました")}finally{x(!1)}}}};return e.jsxs("div",{className:"relative min-h-screen overflow-hidden",children:[e.jsx(v,{className:r?"opacity-40 grayscale":""}),e.jsx(_,{}),e.jsxs("main",{className:"max-w-xl mx-auto p-4 space-y-4 pb-10",children:[r?e.jsxs("div",{className:"bg-white rounded-3xl p-8 text-center shadow-[0_8px_0_rgba(0,0,0,0.18)] border-4 border-neutral-300",children:[e.jsx("div",{className:"text-6xl mb-3",children:"✅"}),e.jsx("div",{className:"text-3xl font-black text-neutral-500",children:"使用済み"}),e.jsx("div",{className:"text-sm font-bold text-neutral-500 mt-2",children:"ご利用ありがとうございました"})]}):e.jsx("img",{src:M.url,alt:"受付完了",className:"w-full h-auto rounded-3xl shadow-[0_8px_0_rgba(0,0,0,0.18)]"}),e.jsxs("div",{className:"bg-white rounded-3xl p-5 shadow-[0_6px_0_rgba(0,0,0,0.15)] border-4 border-white text-center space-y-3",children:[e.jsx("div",{className:"text-xs font-black tracking-[0.3em] text-[#ff7a1a]",children:"FOOD COIN TICKET"}),e.jsx("div",{className:"text-lg font-black text-neutral-900",children:r?"受け取り済み":"1,000円分(500円 × 2枚)"}),e.jsxs("div",{className:"pt-2 border-t-2 border-dashed border-neutral-200 space-y-1",children:[e.jsx("div",{className:"text-[11px] text-neutral-500 font-bold",children:"引換番号"}),e.jsx("div",{className:"font-mono text-2xl tracking-widest font-black text-neutral-900",children:c})]}),e.jsxs("div",{className:"text-xs text-neutral-600 font-bold",children:[f??a.line_display_name??"ゲスト"," 様"]}),r&&a.redeemed_at&&e.jsxs("div",{className:"text-[11px] text-neutral-500 font-bold",children:["使用日時:",new Date(a.redeemed_at).toLocaleString("ja-JP")]})]}),!r&&e.jsxs("div",{className:"bg-white rounded-3xl p-5 space-y-3 shadow-[0_6px_0_rgba(0,0,0,0.15)] border-4 border-white",children:[e.jsx("div",{className:"text-sm font-black text-neutral-900",children:"受付でコインを受け取ったら"}),e.jsx("p",{className:"text-xs text-neutral-600 leading-relaxed font-bold",children:"スタッフの目の前で下のボタンを押してください。押すã
3¨ã€Œä½¿ç”¨æ¸ˆã¿ã€ã«ãªã‚Šã€å…ƒã«æˆ»ã›ã¾ã›ã‚“。"}),e.jsx("button",{type:"button",onClick:h,disabled:m,className:"w-full py-4 rounded-2xl bg-[#ff7a1a] text-white font-black text-base disabled:opacity-60 shadow-[0_4px_0_#c85300] active:translate-y-[2px] active:shadow-[0_2px_0_#c85300] transition",children:m?"処理中...":"コインを受け取った(使用済みにする)"})]}),e.jsxs("div",{className:"bg-white/95 rounded-3xl p-5 text-sm space-y-2 shadow-[0_6px_0_rgba(0,0,0,0.15)] border-4 border-white",children:[e.jsx("div",{className:"font-black text-neutral-900",children:"回答内容"}),e.jsxs("div",{className:"text-neutral-500 font-bold",children:["きっかけ:",e.jsx("span",{className:"text-neutral-900",children:a.source})]}),a.party_size&&e.jsxs("div",{className:"text-neutral-500 font-bold",children:["来場人数:",e.jsxs("span",{className:"text-neutral-900",children:[a.party_size," 名"]})]}),a.interests.length>0&&e.jsxs("div",{className:"text-neutral-500 font-bold",children:["興味:",e.jsx("span",{className:"text-neutral-900",children:a.interests.join("、")})]})]})]})]})}export{Q as component};

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.