PageSourceSearch

https://p-b-a.jp/_next/static/chunks/pages/test/[shindanname]/do-d7083cc7ae50eb16.js

js p-b-a.jp collected 2026-10-07 06:24:51 UTC 63,051 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7596],{20163:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/test/[shindanname]/do",function(){return s(21)}])},5006:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var l=s(85893),a=s(11163),n=s(67294);function c(){let{asPath:e}=(0,a.useRouter)();return(0,n.useEffect)(()=>{try{(window.adsbygoogle=window.adsbygoogle||[]).push({})}catch(e){}},[e]),(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsx)("ins",{className:"adsbygoogle",style:{display:"block"},"data-ad-client":"ca-pub-3168887009007651","data-ad-slot":"1719333207","data-ad-format":"auto","data-full-width-responsive":"true"})},e)}},94898:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var l=s(85893),a=s(11163),n=s(67294);function c(){let{asPath:e}=(0,a.useRouter)();return(0,n.useEffect)(()=>{let e=document.createElement("script");e.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",e.async=!0,document.body.appendChild(e);try{(window.adsbygoogle=window.adsbygoogle||[]).push({})}catch(e){console.error(e)}return()=>{document.body.removeChild(e)}},[e]),(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsx)("ins",{className:"adsbygoogle",style:{display:"block"},"data-ad-client":"ca-pub-3168887009007651","data-ad-slot":"7710026485","data-ad-format":"auto","data-full-width-responsive":"true"})},e)}},46937:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var l=s(85893),a=s(11163),n=s(67294);function c(){let{asPath:e}=(0,a.useRouter)();return(0,n.useEffect)(()=>{let e=document.createElement("script");e.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",e.async=!0,document.body.appendChild(e);try{(window.adsbygoogle=window.adsbygoogle||[]).push({})}catch(e){console.error(e)}return()=>{document.body.removeChild(e)}},[e]),(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsx)("ins",{className:"adsbygoogle",style:{display:"block"},"data-ad-client":"ca-pub-3168887009007651","data-ad-slot":"6698221357","data-ad-format":"auto","data-full-width-responsive":"true"})},e)}},2106:function(e,t,s){"use strict";s.d(t,{Z:function(){return i}});var l=s(85893),a=s(42523),n=s(89618),c=s(17524);function i(e){let{pages:t}=e;return(0,l.jsx)("nav",{className:"flex","aria-label":"Breadcrumb",children:(0,l.jsxs)("ol",{role:"list",className:"inline-flex items-center space-x-1 w-full bg-slate-50/80 py-0.5 px-2 overflow-x-scroll whitespace-nowrap hide-scrollbar",children:[(0,l.jsx)("li",{className:"text-slate-500/90",children:(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsxs)("a",{href:"/",onClick:()=>{(0,a.Eq)("BREADCRUMBS",{name:"Home"})},children:[(0,l.jsx)(n.Z,{className:"h-5 w-5","aria-hidden":"true"}),(0,l.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map(e=>(0,l.jsx)("li",{className:"text-slate-500/90",children:(0,l.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[(0,l.jsx)(c.Z,{className:"h-4 w-4","aria-hidden":"true"}),(0,l.jsx)("a",{onClick:()=>{(0,a.Eq)("BREADCRUMBS",{name:e.name})},href:e.href,className:"ml-1 text-sm font-medium","aria-current":e.current?"page":void 0,children:e.name})]})},e.name))]})})}},16485:function(e,t,s){"use strict";s.d(t,{d:function(){return r},z:function(){return o}});var l=s(85893),a=s(67294),n=s(88426),c=s(12003),i=s(31040);let r=(0,c.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-base font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-40",{variants:{variant:{default:"bg-sky-400 text-white font-semibold hover:bg-sky-400/90",destructive:"bg-white border-red-500 border text-red-500  hover:bg-destructive/90",outline:"border border-input border-sky-500 text-sky-500 bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-amber-500 text-white font-semibold hover:bg-amber-500/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),o=a.forwardRef((e,t)=>
1{let{className:s,variant:a,size:c,asChild:o=!1,...u}=e,d=o?n.g7:"button";return(0,l.jsx)(d,{className:(0,i.cn)(r({variant:a,size:c,className:s})),ref:t,...u})});o.displayName="Button"},21:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSG:function(){return eZ},default:function(){return eE}});var l=s(85893),a=s(16850),n=s(2106),c=s(13742),i=s(87536),r=s(56312),o=s(1604),u=s(67294),d=s(88426),x=s(31040),m=s(49102);let f=(0,s(12003).j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),p=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(m.f,{ref:t,className:(0,x.cn)(f(),s),...a})});p.displayName=m.f.displayName;let h=i.RV,v=u.createContext({}),j=e=>{let{...t}=e;return(0,l.jsx)(v.Provider,{value:{name:t.name},children:(0,l.jsx)(i.Qr,{...t})})},y=()=>{let e=u.useContext(v),t=u.useContext(g),{getFieldState:s,formState:l}=(0,i.Gc)(),a=s(e.name,l);if(!e)throw Error("useFormField should be used within <FormField>");let{id:n}=t;return{id:n,name:e.name,formItemId:"".concat(n,"-form-item"),formDescriptionId:"".concat(n,"-form-item-description"),formMessageId:"".concat(n,"-form-item-message"),...a}},g=u.createContext({}),w=u.forwardRef((e,t)=>{let{className:s,...a}=e,n=u.useId();return(0,l.jsx)(g.Provider,{value:{id:n},children:(0,l.jsx)("div",{ref:t,className:(0,x.cn)("space-y-2",s),...a})})});w.displayName="FormItem";let b=u.forwardRef((e,t)=>{let{className:s,...a}=e,{error:n,formItemId:c}=y();return(0,l.jsx)(p,{ref:t,className:(0,x.cn)(n&&"text-destructive",s),htmlFor:c,...a})});b.displayName="FormLabel";let N=u.forwardRef((e,t)=>{let{...s}=e,{error:a,formItemId:n,formDescriptionId:c,formMessageId:i}=y();return(0,l.jsx)(d.g7,{ref:t,id:n,"aria-describedby":a?"".concat(c," ").concat(i):"".concat(c),"aria-invalid":!!a,...s})});N.displayName="FormControl",u.forwardRef((e,t)=>{let{className:s,...a}=e,{formDescriptionId:n}=y();return(0,l.jsx)("p",{ref:t,id:n,className:(0,x.cn)("text-sm text-muted-foreground",s),...a})}).displayName="FormDescription";let T=u.forwardRef((e,t)=>{let{className:s,children:a,...n}=e,{error:c,formMessageId:i}=y(),r=c?String(null==c?void 0:c.message):a;return r?(0,l.jsx)("p",{ref:t,id:i,className:(0,x.cn)("text-sm font-medium text-destructive",s),...n,children:r}):null});T.displayName="FormMessage";var Z=s(16485),E=s(11163),k=s(59961),q=s(89532);let z=q.fC,C=q.xz,R=q.h_,O=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(q.aV,{className:(0,x.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...a,ref:t})});O.displayName=q.aV.displayName;let I=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsxs)(R,{children:[(0,l.jsx)(O,{}),(0,l.jsx)(q.VY,{ref:t,className:(0,x.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...a}
1)]})});I.displayName=q.VY.displayName;let D=e=>{let{className:t,...s}=e;return(0,l.jsx)("div",{className:(0,x.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...s})};D.displayName="AlertDialogHeader";let S=e=>{let{className:t,...s}=e;return(0,l.jsx)("div",{className:(0,x.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};S.displayName="AlertDialogFooter";let F=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(q.Dx,{ref:t,className:(0,x.cn)("text-lg font-semibold",s),...a})});F.displayName=q.Dx.displayName;let _=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(q.dk,{ref:t,className:(0,x.cn)("text-sm text-muted-foreground",s),...a})});_.displayName=q.dk.displayName;let B=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(q.aU,{ref:t,className:(0,x.cn)((0,Z.d)(),s),...a})});B.displayName=q.aU.displayName;let A=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(q.$j,{ref:t,className:(0,x.cn)((0,Z.d)({variant:"outline"}),"mt-2 sm:mt-0",s),...a})});A.displayName=q.$j.displayName;var L=s(51526),G=s(52951),U=s(90512);function V(e){let{isDisplayOk:t,onClickDone:s}=e,[a,n]=(0,u.useState)(!1),c=()=>{let e=window.scrollY,t=document.documentElement.scrollHeight-document.documentElement.clientHeight;n(e>2e3&&e<t-300)};return(0,u.useEffect)(()=>(window.addEventListener("scroll",c),()=>window.removeEventListener("scroll",c)),[]),(0,l.jsx)(L.M,{children:a&&(0,l.jsxs)(G.E.div,{initial:"hidden",animate:"visible",exit:"hidden",variants:{hidden:{y:2e3,opacity:1},visible:{y:0,opacity:1}},transition:{duration:.5},className:(0,U.Z)(!t&&"hidden","bg-white z-50 fixed bottom-0 left-0 right-0 h-[90px] flex flex-col w-full justify-center items-center px-6"),children:[(0,l.jsx)("p",{className:"text-xs text-slate-500 my-1",children:"回答の途中でも診断結果を取得できます"}),(0,l.jsxs)(z,{children:[(0,l.jsx)(C,{type:"button",className:(0,U.Z)((0,Z.d)({variant:"secondary",size:"lg"}),"w-full bg-green-500/80 hover:bg-green-600 max-w-2xl"),children:"診断結果を取得"}),(0,l.jsxs)(I,{className:"bg-white",children:[(0,l.jsxs)(D,{children:[(0,l.jsx)(F,{children:"まだ全ての項目に回答していませんが、診断結果を取得しますか?"}),(0,l.jsx)(_,{children:"精度を求める場合には、最後まで診断することをオススメします"})]}),(0,l.jsxs)(S,{children:[(0,l.jsx)(A,{className:"border-slate-500 text-slate-500",children:"キャンセル"}),(0,l.jsx)(B,{className:"bg-emerald-600 hover:bg-emerald-700",onClick:()=>{s()}
1,children:"診断結果へ"})]})]})]})]})})}var M=s(42523),H=s(71257),Y=s(50316);let Q=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(H.fC,{className:(0,x.cn)("grid gap-2",s),...a,ref:t})});Q.displayName=H.fC.displayName;let X=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(H.ck,{ref:t,className:(0,x.cn)("aspect-square h-4 w-4 rounded-full border border-sky-600 text-sky-600 ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:(0,l.jsx)(H.z$,{className:"flex items-center justify-center",children:(0,l.jsx)(Y.Z,{className:"h-2.5 w-2.5 fill-current text-current"})})})});X.displayName=H.ck.displayName;let P=u.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,l.jsx)(H.ck,{ref:t,className:(0,x.cn)("aspect-square h-4 w-4 rounded-full border border-sky-600 text-sky-600 ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a})});function $(e){let{questions:t,form:s,scrollToTarget:a}=e;return(0,l.jsx)(l.Fragment,{children:t.map(e=>(0,l.jsx)(j,{control:s.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:s}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==s.value.value&&"opacity-40"),children:["Q",e.index+1,": ",e.title]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"h-auto w-full object-contain my-3 py-3"}),(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{s.onChange({index:e.index,value:t}),a("q-".concat(e.index+1))},className:"flex flex-col space-y-0 py-2",children:e.values&&e.values.map(t=>(0,l.jsx)(w,{children:(0,l.jsxs)("label",{htmlFor:"".concat(e.index).concat(t.title),className:(0,U.Z)("flex items-center gap-3 w-full p-3 border",t.value===s.value.value?"bg-amber-200 hover:bg-amber-300 font-bold":"bg-slate-50 hover:bg-slate-200/50 "),children:[(0,l.jsx)(X,{id:"".concat(e.index).concat(t.title),value:t.value}),(0,l.jsx)("span",{children:t.title})]})},"".concat(e.index).concat(t.title)))})}),(0,l.jsx)(T,{})]})}},e.index))})}P.displayName=H.ck.displayName;var J=s(97234),K=s(97369);function W(e){let{questions:t,form:s,scrollToTarget:a}=e;return(0,l.jsx)(l.Fragment,{children:t.map(e=>(0,l.jsx)(j,{control:s.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:s}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==s.value.value&&"opacity-40"),children:["Q",e.index+1,": ",e.title]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"h-auto w-full object-contain my-3 py-3"}),(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{s.onChange({index:e.index,value:t}),a("q-".concat(e.index+1))},className:"grid grid-flow-row grid-cols-3 sm:grid-cols-4 py-2",children:e.values&&e.values.map(t=>{let a=ee(t.value),n=(0,J.Z)(a).isLight();return(0,l.jsx)(w,{style:{backgroundColor:a},className:(0,U.Z)(s.value.value?s.value.value===t.value?"opacity-100":"opacity-40":"opacity-100","w-full col-span-1 bg-red-50 border"),children:(0,l.jsxs)(P,{className:(0,U.Z)("w-full h-full flex flex-col items-center justify-center border-none"),id:"".concat(e.index).concat(t.title),value:t.value,children:[(0,l.jsx)("span",{className:(0,U.Z)(n?"text-black":"text-white"),children:t.title}),s.value.value===t.value&&(0,l.jsx)(K.Z,{size:20,color:n?"black":"white"})]})},"".concat(e.index).concat(t.title))})})}),(0,l.jsx)(T,{})]})}},e.index))})}let ee=e=>{switch(e){case"red":return"#C51111";case"pink":return"#FF4077";case"rose":return"#FFCDD5";case"coral":return"#EC7578";case"orange":return"#FF5426";case"yellow":return"#FFDB2B";case"banana":return"#FFFFBE";case"lime":return"#50EF39";case"green":return"#117F2D";case"cyan":return"#2FCDD5";case"blue":return"#132ED1";case"purple":return"#654AED";case"gray":return"#555555";case"brown":return"#71491E";case"white":return"#FFFFFF";case"black":return"#000000";default:return"#000"}},et=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),value:o.z.string().optional()}))});function es(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(et)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.3*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"".concat(t.data.title,"の質問・回答"),description:"".concat(t.data.title,"の質問・回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"text-slate-800 p-4 max-w-2xl mx-auto 
1space-y-6",onSubmit:d.handleSubmit(e=>{if("jung"===t.prefix){var s,l,a,n,c,i,r,u;let d=function(e){let t={};return e.forEach(e=>{e.value&&(e.index<20?t[e.value]=(t[e.value]||0)+1:t[e.value]=(t[e.value]||0)-1)}),Object.entries(t).map(e=>{let[t,s]=e;return{value:t,count:s}}).sort((e,t)=>t.count-e.count)}(e.answers);if(d.length<=1)return(0,k.Am)({variant:"destructive",title:"診断結果が取得できませんでした"});let x=(null===(s=d.find(e=>"ne"===e.value))||void 0===s?void 0:s.count)||0,m=(null===(l=d.find(e=>"ni"===e.value))||void 0===l?void 0:l.count)||0,f=(null===(a=d.find(e=>"se"===e.value))||void 0===a?void 0:a.count)||0,p=(null===(n=d.find(e=>"si"===e.value))||void 0===n?void 0:n.count)||0,h=(null===(c=d.find(e=>"fe"===e.value))||void 0===c?void 0:c.count)||0,v=(null===(i=d.find(e=>"fi"===e.value))||void 0===i?void 0:i.count)||0,j=(null===(r=d.find(e=>"te"===e.value))||void 0===r?void 0:r.count)||0,y=(null===(u=d.find(e=>"ti"===e.value))||void 0===u?void 0:u.count)||0,g="ne=".concat(x,"&ni=").concat(m,"&se=").concat(f,"&si=").concat(p,"&fe=").concat(h,"&fi=").concat(v,"&te=").concat(j,"&ti=").concat(y),w=d[0].value;o.push("/result/".concat(t.prefix,"/").concat(w)+"?"+g+"&share=true")}else{let s=function(e){let t={};e.forEach(e=>{e.value&&(t[e.value]=(t[e.value]||0)+1)});let s=Object.entries(t).map(e=>{let[t,s]=e;return{value:t,count:s}}).sort((e,t)=>t.count-e.count);return s.length>=2?s[0].count!==s[1].count?s[0].value:Math.random()>=.5?s[0].value:s[1].value:s[0].value}(e.answers);if("undefined"===s)return(0,k.Am)({variant:"destructive",title:"診断結果ã
1Œå–得できませんでした"});o.push("/result/".concat(t.prefix,"/").concat(s,"?share=true"))}}),children:["amongus"===t.prefix?(0,l.jsx)(W,{form:d,questions:s.questions,scrollToTarget:e=>{p("amongus")}}):(0,l.jsx)($,{form:d,questions:s.questions,scrollToTarget:e=>{p(e)}}),"amongus"===t.prefix&&(0,l.jsx)("div",{id:"amongus"}),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"SELECT",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:(0,U.Z)("w-full my-3"),variant:"secondary",children:"診断結果へ"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"SELECT",ui:"DIALOG"}))}})]})})]})}var el=s(53219),ea=s(82701),en=s(94898),ec=s(5006),ei=s(46937);let er=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function eo(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(er)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{try{var l,a,n,c,i,r,u,d,x,m,f,p,h,v,j,y,g,w,b,N,T,Z,E,q,z;if("enneagram"===t.prefix){let s=eu(e.answers,15),m="",f=(null===(l=s.find(e=>"1"===e.resultType))||void 0===l?void 0:l.sum)||.1,p=(null===(a=s.find(e=>"2"===e.resultType))||void 0===a?void 0:a.sum)||.1,h=(null===(n=s.find(e=>"3"===e.resultType))||void 0===n?void 0:n.sum)||.1,v=(null===(c=s.find(e=>"4"===e.resultType))||void 0===c?void 0:c.sum)||.1,j=(null===(i=s.find(e=>"5"===e.resultType))||void 0===i?void 0:i.sum)||.1,y=(null===(r=s.find(e=>"6"===e.resultType))||void 0===r?void 0:r.sum)||.1,g=(null===(u=s.find(e=>"7"===e.resultType))||void 0===u?void 0:u.sum)||.1,w=(null===(d=s.find(e=>"8"===e.resultType))||void 0===d?void 0:d.sum)||.1,b=(null===(x=s.find(e=>"9"===e.resultType))||void 0===x?void 0:x.sum)||.1;m="t1=".concat(f,"&t2=").concat(p,"&t3=").concat(h,"&t4=").concat(v,"&t5=").concat(j,"&t6=").concat(y,"&t7=").concat(g,"&t8=").concat(w,"&t9=").concat(b),o.push("/result/".concat(t.prefix,"/").concat(s[0].resultType)+"?"+m+"&share=true")}else if("tritype"===t.prefix){let s=eu(e.answers,15),l="",a=(null===(m=s.find(e=>"1"===e.resultType))||void 0===m?void 0:m.sum)||.1,n=(null===(f=s.find(e=>"2"===e.resultType))||void 0===f?void 0:f.sum)||.1,c=(null===(p=s.find(e=>"3"===e.resultType))||void 0===p?void 0:p.sum)||.1,i=(null===(h=s.find(e=>"4"===e.resultType))||void 0===h?void 0:h.sum)||.1,r=(null===(v=s.find(e=>"5"===e.resultType))||void 0===v?void 0:v.sum)||.1,u=(null===(j=s.find(e=>"6"===e.resultType))||void 0===j?void 0:j.sum)||.1,d=(null===(y=s.find(e=>"7"===e.resultType))||void 0===y?void 0:y.sum)||.1,x=(null===(g=s.find(e=>"8"===e.resultType))||void 0===g?void 0:g.sum)||.1,Z=(null===(w=s.find(e=>"9"===e.resultType))||void 0===w?void 0:w.sum)||.1,E=(null===(b=s.find(e=>"sp"===e.resultType))||void 0===b?void 0:b.sum)||.1,k=(null===(N=s.find(e=>"sx"===e.resultType))||void 0===N?void 0:N.sum)||.1,q=(null===(T=s.find(e=>"so"===e.resultType))||void 0===T?void 0:T.sum)||.1;l="t1=".concat(a,"&t2=").concat(n,"&t3=").concat(c,"&t4=").concat(i,"&t5=").concat(r,"&t6=").concat(u,"&t7=").concat(d,"&t8=").concat(x,"&t9=").concat(Z,"&sp=").concat(E,"&so=").concat(q,"&sx=").concat(k);let z=function(e){let t=e.reduce((e,t)=>
1(e[t.resultType]=t.sum,e),{}),s=e=>e.reduce((e,s)=>((!e||(t[s]||0)>(t[e]||0))&&(e=s),e),""),l=s(["1","8","9"]),a=s(["2","3","4"]),n=[l,a,s(["5","6","7"])];return n.sort(),n.join("")}(s);o.push("/result/".concat(t.prefix,"/").concat(z)+"?"+l+"&share=true")}else if("psychosophia"===t.prefix){let s=[...eu(e.answers,15)].sort((e,t)=>t.sum-e.sum),l=s.map(e=>e.resultType).join(""),a=(null===(Z=s.find(e=>"e"===e.resultType))||void 0===Z?void 0:Z.sum)||.1,n=(null===(E=s.find(e=>"f"===e.resultType))||void 0===E?void 0:E.sum)||.1,c=(null===(q=s.find(e=>"l"===e.resultType))||void 0===q?void 0:q.sum)||.1,i=(null===(z=s.find(e=>"v"===e.resultType))||void 0===z?void 0:z.sum)||.1,r="/result/".concat(t.prefix,"/").concat(l,"?e=").concat(a,"&f=").concat(n,"&l=").concat(c,"&v=").concat(i,"&share=true");o.push(r);return}else{let l=eu(e.answers,Math.floor(.5*s.questions.length));o.push("/result/".concat(t.prefix,"/").concat(l[0].resultType,"?share=true"))}}catch(e){e instanceof Error?(0,k.Am)({description:e.message,variant:"destructive"}):(0,k.Am)({description:"診断結果を取得できません",variant:"destructive"})}}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:s}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==s.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",s.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{s.onChange({index:e.index+1,value:t,resultType:e.value}),p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,1.5,0,-1.5,-3].map(t=>(0,l.jsx)(w,{children:(0,l.jsx)(P,{className:(0,U.Z)("w-[52px] h-[52px] flex flex-col items-center justify-center bg-slate-200 border border-slate-300",s.value.value==="".concat(t)&&t>0&&"bg-green-500",s.value.value==="".concat(t)&&t<0&&"bg-rose-400",s.value.value==="".concat(t)&&0===t&&"bg-amber-400"),id:"".concat(e.index).concat(t),value:"".concat(t),children:(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==s.value.value&&s.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")})})},"".concat(e.index).concat(t)))})}),(0,l.jsxs)("div",{className:(0,U.Z)("w-full flex flex-row items-center justify-center text-xs text-slate-500",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)(el.Z,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"当てはまる"}),(0,l.jsx)("div",{className:"w-[70px] h-[30px]"}),(0,l.jsx)("span",{children:"当てはまらない"}),(0,l.jsx)(ea.Z,{className:"w-4 h-4"})]})]}),(0,l.jsx)(T,{})]})}}),1===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),3===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),4===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),6===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),12===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"ADDITION",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>=30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"ADDITION",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}function eu(e,t){let s=e.filter(e=>e.value&&e.resultType&&e.index);if(t&&s.length<t)throw Error("回答が不正です。正しく回答してください。(回答数が少ない)");let l={};return e.forEach(e=>{e.resultType&&(l["".concat(e.resultType)]||(l["".concat(e.resultType)]=0),l["".concat(e.resultType)]+=Number(e.value))}),Object.keys(l).map(e=>({resultType:e,sum:l[e]})).sort((e,t)=>t.sum-e.sum)}let ed=e=>{if(["t1","t2","t3","t4","t5","t6","t7","t8"].includes(e))return e;let t=[["ntp","t1"],["ntj","t2"],["nfp","t3"],["nfj","t4"],["stp","t5"],["stj","t6"],["sfp","t7"],["sfj","t8"]].find(t=>t[0]===e);return t?t[1]:"t1"},ex=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function em(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(ex)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{try{let s=function(e){let t={};e.forEach(e=>{e.resultType&&(t["".concat(e.resultType)]||(t["".concat(e.resultType)]=0),t["".concat(e.resultType)]+=Number(e.value))});let s=t.n-t.s,l=t.f-t.t,a=t.p-t.j;return(s>=0?"n":"s")+(l>=0?"f":"t")+(a>=0?"p":"j")}
1(e.answers),l=ed(s);o.push("/result/".concat(t.prefix,"/").concat(l,"?share=true"))}catch(e){e instanceof Error?(0,k.Am)({description:e.message,variant:"destructive"}):(0,k.Am)({description:"診断結果を取得できません",variant:"destructive"})}}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:a}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==a.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==a.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",a.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{a.onChange({index:e.index,value:t,resultType:e.value}),e.index===s.questions.length-1?p("result-button"):p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,1.5,0,-1.5,-3].map(t=>(0,l.jsx)(w,{children:(0,l.jsx)(P,{className:(0,U.Z)("w-[52px] h-[52px] flex flex-col items-center justify-center bg-slate-200 border border-slate-300",a.value.value==="".concat(t)&&t>0&&"bg-green-500",a.value.value==="".concat(t)&&t<0&&"bg-rose-400",a.value.value==="".concat(t)&&0===t&&"bg-amber-400"),id:"".concat(e.index).concat(t),value:"".concat(t),children:(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==a.value.value&&a.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")})})},"".concat(e.index).concat(t)))})}),(0,l.jsxs)("div",{className:(0,U.Z)("w-full flex flex-row items-center justify-center text-xs text-slate-500",void 0!==a.value.value&&"opacity-40"),children:[(0,l.jsx)(el.Z,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"当てはまる"}),(0,l.jsx)("div",{className:"w-[70px] h-[30px]"}),(0,l.jsx)("span",{children:"当てはまらない"}),(0,l.jsx)(ea.Z,{className:"w-4 h-4"})]})]}),(0,l.jsx)(T,{})]})}}),1===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),3===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),4===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),6===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)("div",{id:"result-button",className:"mb-6"}),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"EIGHT",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"EIGHT",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}let ef=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function ep(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(ef)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{try{let s=function(e){let t={};e.forEach(e=>{e.resultType&&(t["".concat(e.resultType)]||(t["".concat(e.resultType)]=0),t["".concat(e.resultType)]+=Number(e.value))});let s=t.e||0,l=t.i||0,a=t.n||0,n=t.s||0,c=t.f||0,i=t.t||0,r=t.p||0,o=t.j||0;return{type:(s-l>=0?"e":"i")+(a-n>=0?"n":"s")+(c-i>=0?"f":"t")+(r-o>=0?"p":"j"),e:s,i:l,n:a,s:n,f:c,t:i,p:r,j:o}}(e.answers),l="e=".concat(s.e,"&i=").concat(s.i,"&n=").concat(s.n,"&s=").concat(s.s,"&t=").concat(s.t,"&f=").concat(s.f,"&p=").concat(s.p,"&j=").concat(s.j),a="/result/".concat(t.prefix,"/").concat(s.type,"?")+l+"&share=true";o.push(a)}catch(e){e instanceof Error?(0,k.Am)({description:e.message,variant:"destructive"}):(0,k.Am)({description:"診断結果を取得できません",variant:"destructive"})}}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:s}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==s.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",s.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{s.onChange({index:e.index,value:t,resultType:e.value}),p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,1.5,0,-1.5,-3].map(t=>(0,l.jsx)(w,{children:(0,l.jsx)(P,{className:(0,U.Z)("w-[52px] h-[52px] flex flex-col items-center justify-center bg-slate-200 border border-slate-300",s.value.value==="".concat(t)&&t>0&&"bg-green-500",s.value.value==="".concat(t)&&t<0&&"bg-rose-400",s.value.value==="".concat(t)&&0===t&&"bg-amber-400"),id:"".concat(e.index).concat(t),value:"".concat(t),children:(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==s.value.value&&s.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")})})},"".concat(e.index).concat(t)))})}),(0,l.jsxs)("div",{className:(0,U.Z)("w-full flex flex-row items-center justify-center text-xs text-slate-500",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)(el.Z,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"当てはまる"}),(0,l.jsx)("div",{className:"w-[70px] h-[30px]"}),(0,l.jsx)("span",{children:"当てはまらない"}),(0,l.jsx)(ea.Z,{className:"w-4 h-4"})]})]}),(0,l.jsx)(T,{})]})}}),4===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"SIXTEEN",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"SIXTEEN",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}let eh=e=>{if(["t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13","t14","t15","t16"].includes(e))return e;let t=[["entp","t1"],["entj","t2"],["intp","t3"],["intj","t4"],["enfp","t5"],["enfj","t6"],["infp","t7"],["infj","t8"],["estp","t9"],["estj","t10"],["istp","t11"],["istj","t12"],["esfp","t13"],["esfj","t14"],["isfp","t15"],["isfj","t16"]].find(t=>t[0]===e);return t?t[1]:"t1"},ev=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function ej(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(ev)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{try{let s=function(e){let t={};e.forEach(e=>{e.resultType&&(t["".concat(e.resultType)]||(t["".concat(e.resultType)]=0),t["".concat(e.resultType)]+=Number(e.value))});let s=t.e||0,l=t.i||0,a=t.n||0,n=t.s||0,c=t.f||0,i=t.t||0,r=t.p||0,o=t.j||0;return{type:(s-l>=0?"e":"i")+(a-n>=0?"n":"s")+(c-i>=0?"f":"t")+(r-o>=0?"p":"j"),e:s,i:l,n:a,s:n,f:c,t:i,p:r,j:o}}(e.answers),l=eh(s.type);if(["socionics"].includes(t.prefix)){let e="v1=".concat(s.e,"&v2=").concat(s.i,"&v3=").concat(s.n,"&v4=").concat(s.s,"&v5=").concat(s.t,"&v6=").concat(s.f,"&v7=").concat(s.p,"&v8=").concat(s.j),a="/result/".concat(t.prefix,"/").concat(l,"?")+e+"&share=true";return o.push(a)}let a="/result/".concat(t.prefix,"/").concat(l,"?")+"share=true";o.push(a)}catch(e){e instanceof Error?(0,k.Am)({description:e.message,variant:"destructive"}):(0,k.Am)({description:"診断結果を取得できません",variant:"destructive"})}}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:a}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==a.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==a.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",a.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{a.onChange({index:e.index,value:t,resultType:e.value}),e.index===s.questions.length-1?p("result-button"):p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,1.5,0,-1.5,-3].map(t=>(0,l.jsx)(w,{children:(0,l.jsx)(P,{className:(0,U.Z)("w-[52px] h-[52px] flex flex-col items-center justify-center bg-slate-200 border border-slate-300",a.value.value==="".concat(t)&&t>0&&"bg-green-500",a.value.value==="".concat(t)&&t<0&&"bg-rose-400",a.value.value==="".concat(t)&&0===t&&"bg-amber-400"),id:"".concat(e.index).concat(t),value:"".concat(t),children:(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==a.value.value&&a.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")})})},"".concat(e.index).concat(t)))})}),(0,l.jsxs)("div",{className:(0,U.Z)("w-full flex flex-row items-center justify-center text-xs text-slate-500",void 0!==a.value.value&&"opacity-40"),children:[(0,l.jsx)(el.Z,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"当てはまる"}),(0,l.jsx)("div",{className:"w-[70px] h-[30px]"}),(0,l.jsx)("span",{children:"当てはまらない"}),(0,l.jsx)(ea.Z,{className:"w-4 h-4"})]})]}),(0,l.jsx)(T,{})]})}}),1===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),3===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),4===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),6===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)("div",{id:"result-button",className:"mb-6"}),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"SIXTEEN_ENTERTAIN",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"SIXTEEN",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}let ey=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function eg(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(ey)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{try{let l=function(e,t){let s=e.filter(e=>e.value&&e.resultType&&e.index);if(t&&s.length<t)throw Error("回答が不正です。正しく回答してください");let l={};return e.forEach(e=>{e.resultType&&(l.p||(l.p=0),"-point"===e.resultType?l.p=l.p-Number(e.value):l.p+=Number(e.value))}),Object.keys(l).map(e=>({resultType:e,sum:l.p})).sort((e,t)=>t.sum-e.sum)}(e.answers,Math.floor(.5*s.questions.length)),a=6*s.questions.length,n=(l[0].sum+3*s.questions.length)/(a+.001);if(s.results.length<=5){if(n>=.75){o.push("/result/".concat(t.prefix,"/lv5?share=true"));return}if(n>=.65){o.push("/result/".concat(t.prefix,"/lv4?share=true"));return}if(n>=.45){o.push("/result/".concat(t.prefix,"/lv3?share=true"));return}if(n>=.25){o.push("/result/".concat(t.prefix,"/lv2?share=true"));return}o.push("/result/".concat(t.prefix,"/lv1?share=true"));return}if(s.results.length<=7){if(n>=.85){o.push("/result/".concat(t.prefix,"/lv7?share=true"));return}if(n>=.725){o.push("/result/".concat(t.prefix,"/lv6?share=true"));return}if(n>=.625){o.push("/result/".concat(t.prefix,"/lv5?share=true"));return}if(n>=.45){o.push("/result/".concat(t.prefix,"/lv4?share=true"));return}if(n>=.325){o.push("/result/".concat(t.prefix,"/lv3?share=true"));return}if(n>=.165){o.push("/result/".concat(t.prefix,"/lv2?share=true"));return}o.push("/result/".concat(t.prefix,"/lv1?share=true"));return}if(n>=.87){o.push("/result/".concat(t.prefix,"/lv9?share=true"));return}if(n>=.79){o.push("/result/".concat(t.prefix,"/lv8?share=true"));return}if(n>=.7){o.push("/result/".concat(t.prefix,"/lv7?share=true"));return}if(n>=.63){o.push("/result/".concat(t.prefix,"/lv6?share=true"));return}if(n>=.45){o.push("/result/".concat(t.prefix,"/lv5?share=true"));return}if(n>=.37){o.push("/result/".concat(t.prefix,"/lv4?share=true"));return}if(n>=.29){o.push("/result/".concat(t.prefix,"/lv3?share=true"));return}if(n>=.2){o.push("/result/".concat(t.prefix,"/lv2?share=true"));return}o.push("/result/".concat(t.prefix,"/lv1?share=true"));return}catch(e){e instanceof Error?(0,k.Am)({description:e.message,variant:"destructive"}):(0,k.Am)({description:"診断結果を取得できません",variant:"destructive"})}}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:a}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==a.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==a.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",a.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsx)("div",{children:(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{a.onChange({index:e.index+1,value:t,resultType:e.value}),e.index===s.questions.length-1?p("result-button"):p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,0,-3].map(t=>(0,l.jsx)(w,{className:(0,U.Z)(void 0!==a.value.value&&"opacity-40","w-full max-h-[80px] items-center justify-center flex",3===t&&"bg-emerald-500",0===t&&"bg-amber-500",-3===t&&"bg-rose-500",a.value.value==="".concat(t)&&"border-slate-800 border-4"),children:(0,l.jsxs)(P,{className:(0,U.Z)("w-full h-full flex flex-col items-center justify-center border-none"),id:"".concat(e.index).concat(t),value:"".concat(t),children:[(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==a.value.value&&a.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")}),(0,l.jsx)("p",{className:"text-sm text-white font-bold",children:3===t?"当てはまる":0===t?"分からない":"当てはまらない"})]})},"".concat(e.index).concat(t)))})})}),(0,l.jsx)(T,{})]})}}),1===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),3===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),4===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),6===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})}),12===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)("div",{className:"mb-6",id:"result-button"}),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"ADDITION",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",type:"submit",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"ADDITION",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}let ew=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function eb(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(ew)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{try{let l=function(e,t){let s=e.filter(e=>e.value&&e.resultType&&e.index);if(t&&s.length<t)throw Error("回答が不正です。正しく回答してください");let l={};return e.forEach(e=>{e.resultType&&(l["".concat(e.resultType)]||(l["".concat(e.resultType)]=0),l["".concat(e.resultType)]+=Number(e.value))}),Object.keys(l).map(e=>({resultType:e,sum:l[e]})).sort((e,t)=>t.sum-e.sum)}(e.answers,Math.floor(.5*s.questions.length)),a=l.find(e=>"x"===e.resultType).sum,n=l.find(e=>"y"===e.resultType).sum;if(4===s.results.length&&o.push("/result/".concat(t.prefix,"/").concat((a>=0?"rx":"lx")+(n>=0?"ry":"ly"),"?share=true")),16===s.results.length){let e=(a>=0?"rx":"lx")+(n>=0?"ry":"ly"),l=3*s.questions.length*.5,c=Math.abs(a),i=Math.abs(n),r="";"rxry"===e&&(c>=l&&i>=l&&(r="rr"),c>=l&&i<l&&(r="rl"),c<l&&i>=l&&(r="lr"),c<l&&i<l&&(r="ll")),"rxly"===e&&(c>=l&&i<l&&(r="rr"),c>=l&&i>=l&&(r="rl"),c<l&&i<l&&(r="lr"),c<l&&i>=l&&(r="ll")),"lxry"===e&&(c<l&&i>=l&&(r="rr"),c<l&&i<l&&(r="rl"),c>=l&&i>=l&&(r="lr"),c>=l&&i<l&&(r="ll")),"lxly"===e&&(c<l&&i<l&&(r="rr"),c<l&&i>=l&&(r="rl"),c>=l&&i<l&&(r="lr"),c>=l&&i>=l&&(r="ll"));let u=e+"-"+r;o.push("/result/".concat(t.prefix,"/").concat(u,"?share=true"))}}catch(e){e instanceof Error?(0,k.Am)({description:e.message,variant:"destructive"}):(0,k.Am)({description:"診断結果を取得できません",variant:"destructive"})}}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:s}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==s.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",s.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{s.onChange({index:e.index+1,value:t,resultType:e.value}),p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,1.5,0,-1.5,-3].map(t=>(0,l.jsx)(w,{children:(0,l.jsx)(P,{className:(0,U.Z)("w-[52px] h-[52px] flex flex-col items-center justify-center bg-slate-200 border border-slate-300",s.value.value==="".concat(t)&&t>0&&"bg-green-500",s.value.value==="".concat(t)&&t<0&&"bg-rose-400",s.value.value==="".concat(t)&&0===t&&"bg-amber-400"),id:"".concat(e.index).concat(t),value:"".concat(t),children:(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==s.value.value&&s.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")})})},"".concat(e.index).concat(t)))})}),(0,l.jsxs)("div",{className:(0,U.Z)("w-full flex flex-row items-center justify-center text-xs text-slate-500",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)(el.Z,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"当てはまる"}),(0,l.jsx)("div",{className:"w-[70px] h-[30px]"}),(0,l.jsx)("span",{children:"当てはまらない"}),(0,l.jsx)(ea.Z,{className:"w-4 h-4"})]})]}),(0,l.jsx)(T,{})]})}}),7===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),12===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"ADDITION",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"ADDITION",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}let eN=o.z.object({answers:o.z.array(o.z.object({index:o.z.number(),resultType:o.z.string().optional(),value:o.z.string().optional()}))});function eT(e){let{shindan:t,test:s}=e,o=(0,E.useRouter)(),d=(0,i.cI)({resolver:(0,r.F)(eN)}),x=(0,u.useRef)(null),m=d.watch("answers"),f=m?m.filter(e=>e.resultType&&e.value).length:0,p=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=.45*window.innerHeight;window.scrollTo({top:e.bottom+s-l,behavior:"smooth"})}};return(0,l.jsxs)(a.Z,{seo:{title:"質問・回答 | ".concat(t.data.title),description:"".concat(t.data.title,"の質問と回答を行うページです"),images:[{url:t.data.ogp,width:1200,height:630,alt:"".concat(t.data.title,"の画像"),type:"Image/jpeg"}]},children:[(0,l.jsx)(n.Z,{pages:[{name:t.data.title,href:"/test/".concat(t.prefix),current:!1},{name:"診断ページ",href:"/test/".concat(t.prefix,"/do"),current:!0}]}),(0,l.jsxs)("div",{className:"bg-sky-50/80 flex flex-col items-center justify-center px-3 py-2 space-y-1",children:[(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsxs)("p",{children:["全部で",s.questions.length,"問あります"]})]}),(0,l.jsxs)("span",{className:"text-sky-700 text-sm inline-flex items-center justify-center gap-1",children:[(0,l.jsx)(c.Z,{className:"w-4 h-4"}),(0,l.jsx)("p",{children:"悩まずにサクサク答えましょう"})]})]}),(0,l.jsx)(h,{...d,children:(0,l.jsxs)("form",{className:"p-4 max-w-2xl mx-auto space-y-6",onSubmit:d.handleSubmit(e=>{let s=function(e){let t={};return e.forEach(e=>{e.resultType&&(t["".concat(e.resultType)]||(t["".concat(e.resultType)]=0),t["".concat(e.resultType)]+=Number(e.value))}),(t.e-t.i>=0?"e":"i")+(t.n-t.s>=0?"n":"s")}
1(e.answers);o.push("/result/".concat(t.prefix,"/").concat(s,"?share=true"))}),children:[s.questions.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{control:d.control,name:"answers.".concat(e.index),defaultValue:{index:e.index},render:t=>{let{field:s}=t;return(0,l.jsxs)(w,{className:"space-y-3",children:[(0,l.jsxs)(b,{id:"q-".concat(e.index),className:(0,U.Z)("text-lg font-semibold",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)("div",{className:(0,U.Z)("w-full text-center my-1",void 0!==s.value.value&&"opacity-40"),children:(0,l.jsxs)("span",{className:"bg-sky-500 p-1 mr-2  rounded-full text-white text-base",children:["Q",e.index+1]})}),(0,l.jsx)("p",{className:(0,U.Z)("text-center",s.value.resultType?"text-slate-400":"text-slate-800"),children:e.title})]}),e.image&&(0,l.jsx)("img",{src:e.image,className:"max-h-48 w-full object-contain my-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(N,{children:(0,l.jsx)(Q,{onValueChange:t=>{s.onChange({index:e.index,value:t,resultType:e.value}),p("q-".concat(e.index+1))},className:"inline-flex space-y-0 pt-3 pb-1 w-full items-center justify-center",children:[3,1.5,0,-1.5,-3].map(t=>(0,l.jsx)(w,{children:(0,l.jsx)(P,{className:(0,U.Z)("w-[52px] h-[52px] flex flex-col items-center justify-center bg-slate-200 border border-slate-300",s.value.value==="".concat(t)&&t>0&&"bg-green-500",s.value.value==="".concat(t)&&t<0&&"bg-rose-400",s.value.value==="".concat(t)&&0===t&&"bg-amber-400"),id:"".concat(e.index).concat(t),value:"".concat(t),children:(0,l.jsx)(c.Z,{className:(0,U.Z)(void 0!==s.value.value&&s.value.value==="".concat(t)?"block":"hidden","w-5 h-5 text-white")})})},"".concat(e.index).concat(t)))})}),(0,l.jsxs)("div",{className:(0,U.Z)("w-full flex flex-row items-center justify-center text-xs text-slate-500",void 0!==s.value.value&&"opacity-40"),children:[(0,l.jsx)(el.Z,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"当てはまる"}),(0,l.jsx)("div",{className:"w-[70px] h-[30px]"}),(0,l.jsx)("span",{children:"当てはまらない"}),(0,l.jsx)(ea.Z,{className:"w-4 h-4"})]})]}),(0,l.jsx)(T,{})]})}}),4===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ec.Z,{})}),9===t&&(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(ei.Z,{})})]},e.index)),(0,l.jsx)(Z.z,{onClick:()=>{(0,M.Eq)("GET_RESULT",{testType:"EIGHT",ui:"BOTTOM_BUTTON"})},disabled:s.questions.length>30?f<20:f<.5*s.questions.length,ref:x,size:"lg",className:"w-full",variant:"secondary",children:"診断結果ã
1¸"}),(0,l.jsx)("div",{className:"pt-3"}),s.questions.length>30&&m&&f<s.questions.length&&f>=20&&(0,l.jsx)(V,{isDisplayOk:!0,onClickDone:()=>{x.current&&(x.current.click(),(0,M.Eq)("GET_RESULT",{testType:"EIGHT",ui:"DIALOG"}))}})]})}),(0,l.jsx)("div",{className:"w-full max-w-7xl mx-auto flex flex-col items-center my-12",children:(0,l.jsx)(en.Z,{})})]})}var eZ=!0;function eE(e){let{shindan:t,test:s}=e;switch((0,u.useEffect)(()=>{(0,M.Eq)("DISPLAY_TEST",{prefix:t.prefix})},[]),s.logic){case"select":return(0,l.jsx)(es,{shindan:t,test:s});case"addition":return(0,l.jsx)(eo,{shindan:t,test:s});case"fourtype":return(0,l.jsx)(eT,{shindan:t,test:s});case"eighttype":return(0,l.jsx)(em,{shindan:t,test:s});case"sixteentype":return(0,l.jsx)(ep,{shindan:t,test:s});case"sixteenEntertaiment":return(0,l.jsx)(ej,{shindan:t,test:s});case"addpoint":return(0,l.jsx)(eg,{shindan:t,test:s});case"xyfocus":return(0,l.jsx)(eb,{shindan:t,test:s});default:return null}}}},function(e){e.O(0,[2016,3662,1404,2190,7454,2539,9728,6850,9774,2888,179],function(){return e(e.s=20163)}),_N_E=e.O()}]);

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.