1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5343],{16288:(e,t,a)=>{"use strict";a.d(t,{gG:()=>n,hI:()=>s,rI:()=>l});var i=a(67788);let l=(e,t)=>{let a=new Date,i=new Date(e),l=new Date(t);return a>l?{key:"FINISHED",value:"éå¬çµäº"}:a>=i&&a<=l?{key:"IN_PROGRESS",value:"éå¬ä¸"}:{key:"BEFORE_START",value:"éå¬å"}},s=[{key:"ALL",value:"ãã¹ã¦"},{key:"BEFORE_START",value:"éå¬å"},{key:"IN_PROGRESS",value:"éå¬ä¸"},{key:"FINISHED",value:"éå¬çµäº"}],n=e=>{let t=s.find(t=>t.key===e);return t?i.f[t.key]:null}},16625:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/projects/[projectId]/vote-setting",function(){return a(42965)}])},42965:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>Q,default:()=>$});var i=a(37876),l=a(14232),s=a(21382),n=a(92221),r=a(14214),o=a(36012),c=a(84629),d=a(95677),u=a(89099),p=a(98284);async function h(e,t){let a=await (0,p.A)(t);return(await a.get("/api/vote",{params:e})).data}var m=a(38710),v=a(75656);let j=function(e){var t,a;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fallbackData:null,revalidateOnFocus:!1},{user:l}=(0,m.A)(e=>[e.user]),s=null==l||null==(a=l.getSignInUserSession())||null==(t=a.getAccessToken())?void 0:t.getJwtToken(),n="getProjectVote?projectId=".concat(e.projectId,"&publicStatus=").concat(e.publicStatus,"&status=").concat(e.status,"&isPublicVoting=").concat(e.isPublicVoting,"&limit=").concat(e.limit,"&offset=").concat(e.offset,"&accessToken=").concat(s),{data:r,mutate:o,error:c,isLoading:d}=(0,v.Ay)(e.projectId?n:null,()=>h(e,l),i),u=!d&&(null==r?void 0:r.total)===0;return{voteList:r,mutate:o,error:c,isLoading:d,isNotFound:u}};var x=a(93674),y=a(31638),b=a(28258),f=a(80007),g=a(13518),A=a(39505),k=a(87155),S=a(16288),w=a(35848),I=a(3305),N=a(31101),E=a(39813),C=a(12829),R=a(30002),_=a(28192),O=a(28022),D=a(14534),P=a(2583),L=a(49955),T=a(48230),F=a.n(T),B=a(88091);let q=e=>{let{customUrlOrProjectId:t,projectId:a,voteId:s,voteName:n,status:r,discordShared:o,popperRef:c,announceClick:d,handleDeleteButton:p}=e,h=(0,u.useRouter)(),{t:m}=(0,b.Bd)(),v="https://sbinft-mits.com/project/".concat(t,"/vote/").concat(s),j=[{label:m("ç·¨é"),icon:(0,i.jsx)(_.A,{className:"h-5 w-5"}),onClick:()=>{h.push({pathname:"/projects/".concat(a,"/vote-setting/edit/"),query:{voteId:s}})}},{label:m("è¤è£½"),icon:(0,i.jsx)(D.A,{className:"h-5 w-5"}),onClick:()=>{h.push({pathname:"/projects/".concat(a,"/vote-setting/create"),query:{voteId:s,isCopy:"true"}})}},{label:m("ã¢ãã¦ã³ã¹"),icon:(0,i.jsx)(P.EI,{size:"S",color:"BLACK"}),onClick:()=>{d(a,s)}},{label:m("X(Twitter)ã§ã·ã§ã¢"),icon:(0,i.jsx)(P.Fi,{size:"S",color:"BLACK"}),onClick:()=>{window.open("https://x.com/intent/tweet?url=".concat(v,"&text=").concat(encodeURIComponent(n),"&hashtags=Mits"),"_blank")}},{label:m("åé¤"),icon:(0,i.jsx)(O.A,{className:"h-5 w-5"}),onClick:()=>{p(a,s,n)}}],x=e=>(0,i.jsx)("li",{className:"min-w-[100px]",children:(0,i.jsx)(C.A,{type:"button",full:!0,justify:"start",onClick:e.onClick,startIcon:e.icon,children:e.label})});return(0,i.jsx)("div",{className:"text-right",children:(0,i.jsx)(R.A,{ref:c,ariaControls:"vote-item-popover",placement:"left-start",disablePortal:!0,content:(0,i.jsx)("ul",{children:j.map(e=>(0,i.jsx)(l.Fragment,{children:(e=>{switch(e.label){case m("åé¤"):if(r===m("éå¬å"))return x(e);break;case m("ã¢ãã¦ã³ã¹"):if(o&&r!==m("éå¬çµäº"))return x(e);break;case m("X(Twitter)ã§ã·ã§ã¢"):if(r!==m("éå¬çµäº"))return x(e);break;default:return x(e)}})(e)},e.label))}),children:(0,i.jsx)(L.A,{size:"medium"})})})};var W=a(55920);async function V(e){let t=await (0,p.A)();return(await t.delete("/api/project/".concat(e.projectId,"/vote/").concat(e.voteId))).data}var G=a(36594),z=a(24396),H=a(45286);let M=()=>{let{t:e}=(0,b.Bd)(),{getErrorMessage:t}=(0,W.n)(),a=[{key:"ALL",value:e("ãã¹ã¦")},{key:"ANYONE",value:e("誰ã§ã")},{key:"HOLDER",value:e("ãã«ãã¼éå®")}],s=(0,u.useRouter)(),{project:p,voteList:h,voteIsLoading:m,voteIsNotFound:v,voteMutate:C,voteError:R,publicStatus:_,status:O,participationCondition:D,setIsLoading:P,setToast:L,nextPage:T,prevPage:M,handleChangeFetchCondition:U,customUrl:X}=((e,t,a)=>{let i=(0,u.useRouter)(),[s]=(0,A.B)({projectId:e}),[n,r]=(0,l.useState)(null),[o,c]=(0,l.useState)(null),d="string"==typeof i.query.participationCondition?i.query.participationCondition:"ALL",p=(0,w.k)(i.query.publicStatus)?i.query.publicStatus:"ALL",h=String(i.query.status||"ALL"),[m,v]=(0,l.useState)(!1),[I,N]=(0,l.useState)(null),{eventPublicStatusLabel:E,convertApiPublicStatus:C}=(0,k.R)(),{offset:R,nextPage:_,prevPage:O}=(0,y.A)({limit:a,dataList:null==o?void 0:o.votes}),{voteList:D,mutate:P,error:L,isLoading:T,isNotFound:F}=j({projectId:e,publicStatus:C(p),status:(0,S.gG)(h),isPublicVoting:(e=>"HOLDER"!==e&&("ANYONE"===e||null))(d),orderType:g.Prisma.SortOrder.desc,offset:R,limit:a}),{setToast:B}=(0,l.useContext)(f.$),{t:q}=(0,b.Bd)();return(0,l.useEffect)(()=>{T||N(D)},[D,T]),(0,l.useEffect)(()=>{s&&r(s.customUrl)},[s]),(0,l.useEffect)(()=>
1{if(!(null==I?void 0:I.votes))return;let t=new Date;c({id:e,votes:null==I?void 0:I.votes.map(e=>({projectId:e.projectId,voteId:e.id,title:e.title,participationCondition:e.isPublicVoting?q("ä¸è¬å
¬é"):q("ãã«ãã¼éå®"),publicStatus:E(e.publicStatus),status:new Date(e.startAt)>t?q("éå¬å"):new Date(e.endAt)<t?q("éå¬çµäº"):q("éå¬ä¸"),expirationDate:e.startAt&&e.endAt?(0,x.t)(new Date(e.startAt),new Date(e.endAt)):q("æªå®"),discordShared:e.discordShared}))})},[e,I,q]),{project:o,voteList:I,voteIsLoading:T,voteIsNotFound:F,voteMutate:P,voteError:L,publicStatus:p,status:h,participationCondition:d,isLoading:m,setIsLoading:v,setToast:B,offset:R,nextPage:_,prevPage:O,t:q,handleChangeFetchCondition:(e,t)=>{let a={...i.query,[e]:t};delete a.page,delete a.projectId,i.push({pathname:i.asPath.split("?")[0],query:a})},customUrl:n}})(Number(s.query.projectId),S.hI,12),K=(0,l.useRef)(null),[Y,J]=(0,l.useState)(null),Q=(0,l.useRef)(),{createSelectOptionsForEventPublicStatus:$}=(0,k.R)();if(R)return(0,i.jsx)(N.M,{isBasicLayout:!1});let Z=async(t,a)=>{P(!0);try{await (0,d.r)(t,{resource:"vote",id:a}),L({isOpen:!0,message:e("Discordã«ã¢ãã¦ã³ã¹ãè¡ãã¾ãã")})}catch(t){L({isOpen:!0,message:e("Discordã¸ã®ã¢ãã¦ã³ã¹ã«å¤±æãã¾ãã"),color:"DANGER"})}finally{P(!1),ee()}},ee=(0,l.useCallback)(()=>{ea.current&&ea.current.onClose()},[]),et=(a,i,l)=>{J({name:l,approve:async()=>{try{await V({projectId:a,voteId:i}),await C({...ei}),L({isOpen:!0,message:"ã".concat(l,"ã").concat(e("åé¤ã«æåãã¾ãã"))})}catch(a){var s,n;L({isOpen:!0,message:(null==(s=a.response)?void 0:s.data.isDisplay)?t(null==(n=a.response)?void 0:n.data.errorCode):e("æç¥¨ã®åé¤ã«å¤±æãã¾ãã"),color:"DANGER"})}}}),K.current.open()},ea=(0,l.useRef)(null),[ei,el]=(0,l.useState)([]);if((0,l.useEffect)(()=>{p&&p.votes&&el(((e,t,a,l,s)=>t.map(t=>({projectId:t.projectId,voteId:t.voteId,title:(0,i.jsx)(F(),{href:"/project/".concat(e,"/vote/").concat(t.voteId),target:"_blank",className:"text-brand-secondary underline",children:(0,i.jsx)(B.A,{title:t.title,placement:"bottom",children:(0,i.jsx)("span",{children:t.title})})}),participationCondition:t.participationCondition,publicStatus:t.publicStatus,status:t.status,expirationDate:t.expirationDate,popper:(0,i.jsx)(q,{customUrlOrProjectId:e,projectId:t.projectId,voteId:t.voteId,voteName:t.title,status:t.status,discordShared:t.discordShared,popperRef:a,announceClick:l,handleDeleteButton:s})})))(X||String(p.id),p.votes,ea,Z,et))},[p,X]),!p)return(0,i.jsx)(i.Fragment,{});let es=[{key:"title",name:e("ã¿ã¤ãã«")},{key:"publicStatus",name:e("å
¬éè¨å®")},{key:"participationCondition",name:e("åå æ¡ä»¶")},{key:"status",name:e("ã¹ãã¼ã¿ã¹")},{key:"expirationDate",name:e("æç¥¨æé")},{key:"popper",name:""}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G.A,{children:(0,i.jsx)(n.jn,{href:(0,I.parse)(s.asPath).pathname+"/create",children:e("æç¥¨ã使")})}),(0,i.jsxs)(H.A,{children:[(0,i.jsx)(z.A,{filters:[(0,i.jsx)("div",{children:(0,i.jsx)(r.l6,{labelId:"status",label:e("å
¬éè¨å®"),value:_,options:$(!0),onChange:e=>U("publicStatus",e)})},"publicStatus"),(0,i.jsx)("div",{children:(0,i.jsx)(r.l6,{labelId:"status",label:e("ã¹ãã¼ã¿ã¹"),value:O,options:S.hI,onChange:e=>U("status",e)})},"status"),(0,i.jsx)("div",{children:(0,i.jsx)(r.l6,{labelId:"participationCondition",label:e("åå æ¡ä»¶"),value:D,options:a,onChange:e=>U("participationCondition",e)})},"participationCondition")]}),(0,i.jsx)("div",{ref:Q,children:(0,i.jsxs)("div",{className:"py-2",children:[(0,i.jsx)(o.A,{totalPage:null==h?void 0:h.total,perPage:12,nextPage:T,prevPage:M,scrollTarget:Q}),(0,i.jsx)("div",{className:"min-h-[32.5rem] py-3",children:(0,i.jsx)(c.A,{columns:es,rows:ei,minWidth:"700px",columnsSetting:[{maxWidth:"20em",sticky:!0,left:0,disabledSmallViewport:!0},{sticky:!0,left:"auto",disabledSmallViewport:!0},{maxWidth:"20em"},{maxWidth:"20em"},{maxWidth:"20em"},{sticky:!0,right:0}],noData:(0,i.jsx)(E.A,{}),loading:m,isNotFound:v})}),(0,i.jsx)(o.A,{totalPage:null==h?void 0:h.total,perPage:12,nextPage:T,prevPage:M,scrollTarget:Q})]})})]}),(0,i.jsx)(N.qE,{ref:K,title:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("span",{className:"flex items-center justify-center",children:[e("æç¥¨å"),"ã",null==Y?void 0:Y.name,"ã"]}),(0,i.jsx)("span",{className:"block",children:e("åé¤ãã¦ããããã§ããï¼")})]}),message:(0,i.jsx)(i.Fragment,{children:e("æç¥¨ãåé¤ããã¨å
ã«æ»ããã¨ã¯ã§ãã¾ãã")}),approveText:e("åé¤ãã"),approve:null==Y?void 0:Y.approve})]})};var U=a(62629),X=a(92869),K=a(48166),Y=a(99620);let J=()=>{var e;let t=null==(e=(0,u.useRouter)().query)?void 0:e.projectId,{t:a}=(0,b.Bd)(),{hasPermission:s}=(0,K._)(g.SubscriptionFeature.VOTE),n=(0,l.useMemo)(()=>(0,i.jsx)(X.BI,{list:[(0,i.jsx)(X.pi,{projectId:t},"projectAdmin"),(0,i.jsx)(X.fQ,{projectId:t,labelOnly:!0},"projectAdminVoteSetting")]}),[t]);return s?(0,i.jsx)(U.A,{title:a("æç¥¨"),breadcrumbs:n,children:(0,i.jsx)(M,{})}):(0,i.jsx)(U.A,{breadcrumbs:n,children:(0,i.jsx)(Y.A,{})})};J.getLayout=e=>(0,i.jsx)(s.A,{children:e});var Q=!0;let $=J},67788:(e,t,a)=>{"use strict";a.d(t,{f:()=>i});let i={BEFORE_START:"BEFORE_START",IN_PROGRESS:"IN_PROGRESS",FINISHED:"FINISHED"}},84629:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var i=a(37876),l=a(14232),s=a(75774),n=a(37161),r=a(8085),o=a(58836),c=a(56952),d=a(40532);let u=["top-0"],p=l.memo(e=>{let{minWidth:t,height:a="hasMin",columns:p,rows:h,columnsSetting:m,noData:v,loading:j=!1,isNotFound:x=!1}=e,y=(0,l.useRef)(null),[b,f]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=()=>{var e;let t=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=e.previousElementSibling;return i?t(i,a+i.clientWidth):a};(null==y||null==(e=y.current)?void 0:e.querySelectorAll("[data-sticky=left]")).forEac
1h(e=>{e.style.left="".concat(t(e),"px"),e.classList.add("bg-area-primary")})};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[p]),(0,i.jsxs)(o.A,{className:"custom-scrollbar ".concat("hasMin"===a&&"min-h-[380px]"),children:[(0,i.jsxs)(s.A,{className:"border-separate",sx:{minWidth:t||"200px",width:"100%"},"aria-label":"table",ref:y,children:[(0,i.jsx)(c.A,{children:(0,i.jsx)(d.A,{children:p.map((e,t)=>{let a=m[t],l=["text-content-primary","border-divider","break-all","p-2","font-medium"],s=a.wrap?l:[...l,"whitespace-nowrap"],n={};return(null==a?void 0:a.maxWidth)&&(n.maxWidth=null==a?void 0:a.maxWidth),(null==a?void 0:a.sticky)&&(s.push(...u),(null==a?void 0:a.disabledSmallViewport)?s.push("xl:sticky"):s.push("sticky"),n.left=null==a?void 0:a.left,n.right=null==a?void 0:a.right),(0,i.jsx)(r.A,{component:"th",scope:"col",className:s.join(" "),style:n,"data-sticky":Object.hasOwn(a,"left")&&"left",children:(0,i.jsx)("div",{className:a.wrap?"":"truncate",children:e.name})},"column_".concat(t))})})}),(0,i.jsxs)(n.A,{children:[j&&(0,i.jsx)(d.A,{children:p.map((e,t)=>(0,i.jsx)(r.A,{children:(0,i.jsx)("div",{className:"bg-area-tertiary h-3 animate-pulse rounded-md"})},t))}),h.map((e,t)=>(0,i.jsx)(d.A,{className:"relative ".concat(b===t?"z-10":"z-auto"),onClick:()=>f(t),children:p.map((a,l)=>{let s=m[l],n=["text-content-primary","border-divider","break-all","p-2","font-medium"],o=s.wrap?n:[...n,"whitespace-nowrap"],c={};return(null==s?void 0:s.maxWidth)&&(c.maxWidth=null==s?void 0:s.maxWidth),(null==s?void 0:s.sticky)&&(o.push(...u),(null==s?void 0:s.disabledSmallViewport)?o.push("xl:sticky"):o.push("sticky"),c.left=null==s?void 0:s.left,c.right=null==s?void 0:s.right),(0,i.jsx)(r.A,{component:0===l?"th":"td",scope:"row",className:o.join(" "),style:c,"data-sticky":Object.hasOwn(s,"left")&&"left",children:(0,i.jsx)("div",{className:s.wrap?"":"truncate",children:e[a.key]})},"row_col_".concat(t,"_").concat(l))})},t))]})]}),x&&(0,i.jsx)("div",{className:"py-8",children:v})]})})},95677:(e,t,a)=>{"use strict";a.d(t,{r:()=>l});var i=a(5214);let l=async(e,t)=>await (0,i.A)(e,t)}},e=>{e.O(0,[3442,915,9833,784,6576,117,6467,7459,5244,1101,4214,7494,5890,636,6593,8792],()=>e(e.s=16625)),_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.