1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9904],{163:(e,t,s)=>{"use strict";s.d(t,{d:()=>i});var r=s(7876),n=s(6978),a=s(3655),l=s(7209);function i(e){let{t}=(0,l.Bd)(["base-modal"]);return(0,r.jsxs)(n.lG,{className:"relative z-10",open:e.isOpen,onClose:e.onClose,children:[(0,r.jsx)(n.Xi,{transition:!0,className:"fixed inset-0 bg-black/30 duration-300 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"}),(0,r.jsx)("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto p-4",children:(0,r.jsx)("div",{className:"flex min-h-full items-center justify-center",children:(0,r.jsxs)(n.Lj,{transition:!0,className:"relative w-full max-w-2xl overflow-hidden rounded-lg bg-white p-6 shadow-xl data-closed:scale-95 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in",children:[(0,r.jsx)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block",children:(0,r.jsxs)("button",{type:"button",className:"cursor-pointer rounded-md bg-white text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 focus:outline-hidden active:text-gray-600",onClick:e.onClose,children:[(0,r.jsx)("span",{className:"sr-only",children:t("base-modal:close-sr")}),(0,r.jsx)(a.A,{className:"h-6 w-6","aria-hidden":"true"})]})}),e.children]})})})]})}},195:(e,t,s)=>{"use strict";s.d(t,{y:()=>c});var r=s(7876),n=s(5797),a=s(1211),l=s(5499),i=s(4594),o=s(7209),d=s(4232);function c(e){let{show:t,setShow:s,type:c,heading:u,text:p}=e,{t:x}=(0,o.Bd)("common");return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 z-50 flex items-end px-4 py-6 sm:items-start sm:p-6",children:(0,r.jsx)("div",{className:"flex w-full flex-col items-center space-y-4 sm:items-end",children:(0,r.jsx)(n.e,{show:t,as:d.Fragment,enter:"transform ease-out duration-300 transition",enterFrom:"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-0 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)("div",{className:"ring-opacity-5 pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black",children:(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsxs)("div",{className:"shrink-0",children:["success"===c&&(0,r.jsx)(a.A,{className:"h-6 w-6 text-green-400","aria-hidden":"true"}),"error"===c&&(0,r.jsx)(l.A,{className:"h-6 w-6 text-red-400","aria-hidden":"true"})]}),(0,r.jsxs)("div",{className:"ml-3 w-0 flex-1 pt-0.5",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:null!=u?u:""}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:null!=p?p:""})]}),(0,r.jsx)("div",{className:"ml-4 flex shrink-0",children:(0,r.jsxs)("button",{type:"button",className:"focus:ring-ppblue-default inline-flex cursor-pointer rounded-md bg-white text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-offset-2 focus:outline-hidden",onClick:()=>{s(!1)},children:[(0,r.jsx)("span",{className:"sr-only",children:x("toast.close-sr")}),(0,r.jsx)(i.A,{className:"h-5 w-5","aria-hidden":"true"})]})})]})})})})})})})}},1041:(e,t,s)=>{"use strict";s.d(t,{$8:()=>l,Po:()=>a,TS:()=>i});var r=s(4574);s(8004),s(7556),s(5654);let n={activeBooster:!1,polltaxFactor:r.Ay.polltaxFactor};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e<0)throw RangeError("surveyCost must be non-negative");let{activeBooster:s,polltaxFactor:a}={...n,...t},l=s?e*r.Ay.booster.costMultiplier:e;return l+i(l,a)}function l(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e<0)throw RangeError("surveyCost must be non-negative");return Math.max(Math.floor(t/a(e,s)),0)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ay.polltaxFactor;return Math.round(e*t)}},1211:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(4232);let n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))})},1625:()=>{},3108:(e,t,s)=>{"use strict";s.d(t,{m:()=>a});var r=s(7876),n=s(4232);function a(e){let{elementRef:t,children:s}=e,a=(0,n.useRef)(null),{position:l,isVisible:i,onMouseEnter:o,onMouseLeave:d}=function(e){var t,s,r;let{ref:a,tooltipRef:l}
1=e,[i,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)({});(0,n.useEffect)(()=>{if(a.current)if(i){var e,t;let{left:s,width:r,bottom:n}=a.current.getBoundingClientRect();c({top:n+12,left:s+r/2-(null!=(t=null==l||null==(e=l.current)?void 0:e.getBoundingClientRect().width)?t:0)/2,width:r})}else c({})},[a,i,l]);let u=(0,n.useCallback)(()=>{o(!0)},[]),p=(0,n.useCallback)(()=>{o(!1)},[]);return{position:{top:null!=(t=d.top)?t:0,left:null!=(s=d.left)?s:0,width:null!=(r=d.width)?r:0},isVisible:i,onMouseEnter:u,onMouseLeave:p}}({ref:t,tooltipRef:a});return((0,n.useEffect)(()=>{let e=null==t?void 0:t.current;return e&&(e.addEventListener("mouseenter",o),e.addEventListener("mouseleave",d)),()=>{e&&(e.removeEventListener("mouseenter",o),e.removeEventListener("mouseleave",d))}},[t,o,d]),i)?(0,r.jsx)("div",{ref:a,className:"absolute rounded-lg bg-[#2c3a43] px-[12px] py-[8px] text-[14px] leading-[20px] text-white before:absolute before:-top-[12px] before:left-1/2 before:h-0 before:w-0 before:-translate-x-1/2 before:border-x-16 before:border-b-18 before:border-x-transparent before:border-b-[#2c3a43] before:content-['']",style:{to
1p:l.top,left:l.left},children:s}):null}},4594:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(4232);let n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))})},4883:(e,t,s)=>{"use strict";s.d(t,{$m:()=>c,As:()=>d,nD:()=>o,ub:()=>u});var r=s(7876),n=s(8221),a=s(1164),l=s(4232),i=s(1257);let o=n.bL,d=l.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.q7,{ref:t,className:(0,i.cn)("border-b",s),...a})});d.displayName="AccordionItem";let c=l.forwardRef((e,t)=>{let{className:s,children:l,...o}=e;return(0,r.jsx)(n.Y9,{className:"flex",children:(0,r.jsxs)(n.l9,{ref:t,className:(0,i.cn)("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",s),...o,children:[l,(0,r.jsx)(a.A,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});c.displayName=n.l9.displayName;let u=l.forwardRef((e,t)=>{let{className:s,children:a,...l}=e;return(0,r.jsx)(n.UC,{ref:t,className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",...l,children:(0,r.jsx)("div",{className:(0,i.cn)("pt-0 pb-4",s),children:a})})});u.displayName=n.UC.displayName},5499:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(4232);let n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))})},5654:(e,t,s)=>{"use strict";s.d(t,{yr:()=>r}),s(4574),s(1041);let r=[{name:"Astronaut",bonusFactor:.05,requiredPollcoinsEarned:0,picture:"/icons/astrodog.webp",altText:"level1",statusInfo:"You get the highest status as a freebie until receiving your first answer!"},{name:"Owl",bonusFactor:.01,requiredPollcoinsEarned:0,picture:"/icons/owl.webp",altText:"level2",statusInfo:"Everyone starts out as an ugly bird â hurry to your next status!"},{name:"Panda",bonusFactor:.02,requiredPollcoinsEarned:2e3,picture:"/icons/panda.webp",altText:"level3",statusInfo:"Thatâs a first step! Pandas are cute â but is this all you aim for?"},{name:"Bear",bonusFactor:.03,requiredPollcoinsEarned:1e4,picture:"/icons/bear.webp",altText:"level4",statusInfo:"Bears roar and scare off the little ones â but its only a milestone for bigger things"},{name:"Elephant",bonusFactor:.04,requiredPollcoinsEarned:25e3,picture:"/icons/elephant.webp",altText:"level5",statusInfo:"Impressive stuff â only few in the wilderness match your power!"},{name:"Lion",bonusFactor:.05,requiredPollcoinsEarned:5e4,picture:"/icons/lion.webp",altText:"level6",statusInfo:"You have reached the highest possible status and are now the king of the jungle!"}]},5776:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/dashboard",function(){return s(7379)}])},7379:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>q,default:()=>M});var r=s(7876),n=s(1731),a=s(163),l=s(7209),i=s(4883);function o(){let{t:e}=(0,l.Bd)("common");return(0,r.jsxs)(i.nD,{type:"single",collapsible:!0,className:"flex w-full flex-col gap-[10px]",defaultValue:"item-1",children:[(0,r.jsxs)(i.As,{value:"item-1",className:"rounded-[6px] border border-slate-200 bg-white px-[10px]",children:[(0,r.jsx)(i.$m,{className:"text-left text-[#303c42]",children:e("helpPanel.faq.addSurvey.q")}),(0,r.jsx)(i.ub,{className:"text-balance text-[#575757]",children:e("helpPanel.faq.addSurvey.a")})]}),(0,r.jsxs)(i.As,{value:"item-2",className:"rounded-[6px] border border-slate-200 bg-white px-[10px]",children:[(0,r.jsx)(i.$m,{className:"text-left text-[#303c42]",children:e("helpPanel.faq.getAnswers.q")}
1),(0,r.jsx)(i.ub,{className:"text-balance text-[#575757]",children:e("helpPanel.faq.getAnswers.a")})]}),(0,r.jsxs)(i.As,{value:"item-3",className:"rounded-[6px] border border-slate-200 bg-white px-[10px]",children:[(0,r.jsx)(i.$m,{className:"text-left text-[#303c42]",children:e("helpPanel.faq.moreParticipants.q")}),(0,r.jsx)(i.ub,{className:"text-balance text-[#575757]",children:e("helpPanel.faq.moreParticipants.a")})]})]})}var d=s(553),c=s(7328),u=s.n(c),p=s(8230),x=s.n(p),f=s(4232);s(1625);var h=s(6978),m=s(6345),b=s(8194);function g(e){let{t}=(0,l.Bd)(["survey-delete-modal"]),[s,n]=(0,f.useState)(""),[a,i]=(0,f.useState)(!1),[o,d]=(0,f.useState)(!1),c="delete";async function u(s){let r=await fetch("/api/survey/deleteSurvey",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({surveyId:s})});if(200===r.status)b.Bd&&location.reload();else if(401===r.status)window.location.href="/app/login";else{let s=await r.json();e.setNotification(e=>({...e,type:"error",heading:t("notifications.heading"),text:t("notifications.".concat(s.message))})),e.setShowNotification(!0),d(!1)}}return(0,r.jsxs)("form",{onSubmit:function(t){t.preventDefault(),o||(d(!0),u(e.survey.id))},children:[(0,r.jsx)(h.L3,{as:"h3",className:"text-pptext-default text-xl font-semibold",children:t("survey-delete-modal:heading")}),(0,r.jsxs)("div",{className:"mt-2 flex flex-col gap-4",children:["external"===e.survey.type?(0,r.jsx)(m.VY,{className:"text-base text-gray-600",children:t("survey-delete-modal:external-survey.text")}):(0,r.jsx)(m.VY,{className:"text-base text-gray-600",children:t("survey-delete-modal:internal-survey.text")}),(0,r.jsxs)(m.VY,{className:"text-base text-gray-600",children:[t("survey-delete-modal:confirmation-prompt-part1")," ",(0,r.jsx)("span",{className:"font-semibold text-red-600 italic",children:"delete "}),t("survey-delete-modal:confirmation-prompt-part2")]}),(0,r.jsx)("input",{type:"text",id:"survey-delete-confirmation-input",className:"text-pptext-default overflow-hidden rounded-[12px] border border-gray-300 px-[15px] py-[10px] text-[15px] leading-[21px] shadow-xs outline-hidden 2xl:pt-[12px] 2xl:pb-[9px] 2xl:text-[18px] 2xl:leading-[25px]","data-autofocus":!0,autoComplete:"off",value:s,onChange:function(e){n(e.target.value),c===e.target.value?i(!0):i(!1)},placeholder:c})]}),(0,r.jsxs)("div",{className:"mt-5 sm:mt-8 sm:flex sm:flex-row-reverse",children:[(0,r.jsx)("button",{type:"submit",className:"inline-flex w-full cursor-pointer items-center justify-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-base font-medium whitespace-nowrap text-white shadow-xs hover:bg-red-700 focus:ring-2 focus:ring-red-600 focus:ring-offset-2 focus:outline-hidden active:bg-red-800 disabled:cursor-not-allowed disabled:bg-gray-300 sm:ml-3 sm:w-auto 2xl:text-[16px] 2xl:leading-[22px] 2xl:font-semibold",disabled:!a,children:t("survey-delete-modal:delete-button")}),(0,r.jsx)("button",{type:"button",className:"border-ppblue-default text-ppblue-default focus:ring-ppblue-default mt-3 inline-flex w-full cursor-pointer items-center justify-center rounded-md border bg-white px-4 py-2 text-base font-medium whitespace-nowrap shadow-xs hover:bg-[#F7F8FC] focus:ring-2 focus:ring-offset-2 focus:outline-hidden active:bg-[#E8EBF7] sm:mt-0 sm:w-auto 2xl:text-[16px] 2xl:leading-[22px] 2xl:font-semibold",onClick:e.setClosed,children:t("survey-delete-modal:cancel-button")})]})]})}function v(e){let{survey:t,setNotification:s,setShowNotification:n}=e,{t:a}=(0,l.Bd)(["survey-results-download-modal"]),[i,o]=(0,f.useState)(!1),[d,c]=(0,f.useState)(!1);async function u(){if(i)return;o(!0);let e=await fetch("/api/survey/getResultsCsv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({surveyId:t.id})});return o(!1),x(e,"survey-results.csv")}async function p(){if(d)return;c(!0);let e=await fetch("/api/survey/getResultsXlsx",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({surveyId:t.id})});return c(!1),x(e,"survey-results.xlsx")}async function x(e,t){if(200===e.status){let s=await e.blob();(0,b.RJ)(s,t)}else if(401===e.status)window.location.href="/app/login";else{let t=await e.json();s(e=>({...e,type:"error",heading:a("notifications.heading"),text:a("notifications.".concat(t.message))})),n(!0)}}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.L3,{as:"h3",className:"text-pptext-default text-xl font-semibold",children:a("survey-results-download-modal:heading")}),(0,r.jsxs)("div",{className:"mt-8 flex flex-col gap-4 sm:flex-row",children:[(0,r.jsx)("button",{type:"button",className:"border-ppblue-default text-ppblue-default focus:ring-ppblue-default inline-flex w-full cursor-pointer items-center justify-center rounded-md border bg-white px-4 py-2 text-base font-medium whitespace-nowrap shadow-xs hover:bg-[#F7F8FC] focu
1s:ring-2 focus:ring-offset-2 focus:outline-hidden active:bg-[#E8EBF7] sm:w-auto 2xl:text-[16px] 2xl:leading-[22px] 2xl:font-semibold",onClick:u,children:a("survey-results-download-modal:download-csv")}),(0,r.jsx)("button",{type:"button",className:"bg-ppblue-default hover:bg-ppblue-hover focus:ring-ppblue-default active:bg-ppblue-active inline-flex w-full cursor-pointer items-center justify-center rounded-md border border-transparent px-4 py-2 text-base font-medium whitespace-nowrap text-white shadow-xs focus:ring-2 focus:ring-offset-2 focus:outline-hidden sm:w-auto 2xl:text-[16px] 2xl:leading-[22px] 2xl:font-semibold",onClick:p,children:a("survey-results-download-modal:download-xlsx")})]})]})}var w=s(3149),y=s(1041),j=s(4587),N=s.n(j),C=s(5654),k=s(3108);function R(e){let{survey:t,user:s,setDownloadModalOpen:n,setDeleteModalOpen:a,isBoosterActive:i}=e,{t:o}=(0,l.Bd)("survey-overview-card"),d=(0,f.useRef)(null),c=(0,f.useRef)(null),u=(0,f.useRef)(null),p=s.level-1;return(0,r.jsx)("section",{"aria-labelledby":"survey-overview",children:(0,r.jsx)("div",{className:"bg-ppblue-default overflow-hidden rounded-3xl p-6 shadow-sm",children:(0,r.jsxs)("div",{className:"flex flex-col gap-5 sm:flex-row sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center justify-between sm:flex-row sm:justify-normal sm:gap-[20px]",children:[C.yr[p]&&(0,r.jsx)(N(),{src:C.yr[p].picture,alt:"",width:240,height:240,"aria-hidden":!0,className:"size-[72px] shrink-0"}),(0,r.jsx)("div",{className:"mt-4 text-center sm:mt-0 sm:pt-1",children:(0,r.jsx)("p",{className:"text-left text-lg font-semibold text-white sm:text-xl",children:t.title})})]}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:gap-[20px]",children:[(0,r.jsx)("div",{className:"mt-5 flex items-center justify-center sm:mt-0",children:(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex items-center gap-[5px] rounded-[100px] border border-solid border-[#FFC700] bg-[#FFF9E4] py-[3px] pr-4 pl-[3px]",children:[(0,r.jsx)("div",{className:"inline-flex size-[32px] items-center justify-center rounded-full bg-[#faedc2]",children:(0,r.jsx)(N(),{src:"/icons/coins.webp",alt:"PollCoins",width:240,height:240,className:"size-[18px]"})}),(0,r.jsx)("p",{className:"text-2xl text-neutral-500",children:new Date(t.createdAt)>new Date("2026-04-22")?t.cost+(0,y.TS)(t.cost):t.cost})]})})}),(0,r.jsxs)("div",{className:"mt-5 flex shrink-0 flex-row justify-center gap-4 sm:mt-0 sm:items-center",children:[(0,r.jsxs)("button",{type:"button",className:"inline-flex size-[44px] cursor-pointer items-center justify-center rounded-md border border-transparent bg-white text-base font-medium shadow-xs hover:bg-gray-200 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 focus:outline-hidden active:bg-gray-300",ref:d,onClick:()=>a(!0),children:[(0,r.jsx)(N(),{src:"/icons/trash-light.svg",alt:"Delete survey - opens confirmation dialog",width:25,height:25,unoptimized:!0}),(0,r.jsx)(k.m,{elementRef:d,children:(0,r.jsx)("span",{children:o("delete-button")})})]}),!i&&(0,r.jsxs)(x(),{href:"/app/credits/share",children:[(0,r.jsx)("div",{ref:c,className:"inline-flex size-[44px] cursor-pointer items-center justify-center rounded-md border border-transparent bg-white text-base font-medium shadow-xs hover:bg-gray-200 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 focus:outline-hidden active:bg-gray-300",children:(0,r.jsx)(N(),{src:"/icons/edit-light.svg",alt:"Edit survey",width:25,height:25,unoptimized:!0})}),(0,r.jsx)(k.m,{elementRef:c,children:(0,r.jsx)("span",{children:o("edit-button")})})]}),"internal"===t.type&&(0,r.jsxs)("button",{type:"button",className:"inline-flex size-[44px] cursor-pointer items-center justify-center rounded-md border border-transparent bg-white text-base font-medium shadow-xs hover:bg-gray-200 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 focus:outline-hidden active:bg-gray-300",ref:u,onClick:()=>n(!0),children:[(0,r.jsx)(N(),{src:"/icons/download-light.svg",alt:"Download survey results",width:24,height:24,unoptimized:!0}),(0,r.jsx)(k.m,{elementRef:u,children:(0,r.jsx)("span",{children:o("download-button")})})]})]})]})]})})})}let E=f.forwardRef(function(e,t){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),f.createElement("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"}))});var A=function(e,t){return(A=Object.setPrototypeOf||({__proto__:[]}
1)instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(e,t)},P=function(){return(P=Object.assign||function(e){for(var t,s=1,r=arguments.length;s<r;s++)for(var n in t=arguments[s])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function O(e){var t,s,r,n,a,l,i,o,d=e.className,c=e.counterClockwise,u=e.dashRatio,p=e.pathRadius,x=e.strokeWidth,h=e.style;return(0,f.createElement)("path",{className:d,style:Object.assign({},h,(s=(t={pathRadius:p,dashRatio:u,counterClockwise:c}).counterClockwise,r=t.dashRatio,a=(1-r)*(n=2*Math.PI*t.pathRadius),{strokeDasharray:n+"px "+n+"px",strokeDashoffset:(s?-a:a)+"px"})),d:(i=(l={pathRadius:p,counterClockwise:c}).pathRadius,"\n M 50,50\n m 0,-"+i+"\n a "+i+","+i+" "+(o=+!!l.counterClockwise)+" 1 1 0,"+2*i+"\n a "+i+","+i+" "+o+" 1 1 0,-"+2*i+"\n "),strokeWidth:x,fillOpacity:0})}var _=function(e){function t(){this.constructor=s}function s(){return null!==e&&e.apply(this,arguments)||this}return A(s,e),s.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),s.prototype.getBackgroundPadding=function(){return this.props.background?this.props.backgroundPadding:0},s.prototype.getPathRadius=function(){return 50-this.props.strokeWidth/2-this.getBackgroundPadding()},s.prototype.getPathRatio=function(){var e=this.props,t=e.value,s=e.minValue,r=e.maxValue;return(Math.min(Math.max(t,s),r)-s)/(r-s)},s.prototype.render=function(){var e=this.props,t=e.circleRatio,s=e.className,r=e.classes,n=e.counterClockwise,a=e.styles,l=e.strokeWidth,i=e.text,o=this.getPathRadius(),d=this.getPathRatio();return(0,f.createElement)("svg",{className:r.root+" "+s,style:a.root,viewBox:"0 0 100 100","data-test-id":"CircularProgressbar"},this.props.background?(0,f.createElement)("circle",{className:r.background,style:a.background,cx:50,cy:50,r:50}):null,(0,f.createElement)(O,{className:r.trail,counterClockwise:n,dashRatio:t,pathRadius:o,strokeWidth:l,style:a.trail}),(0,f.createElement)(O,{className:r.path,counterClockwise:n,dashRatio:d*t,pathRadius:o,strokeWidth:l,style:a.path}),i?(0,f.createElement)("text",{className:r.text,style:a.text,x:50,y:50},i):null)},s.defaultProps={background:!1,backgroundPadding:0,circleRatio:1,classes:{root:"CircularProgressbar",trail:"CircularProgressbar-trail",path:"CircularProgressbar-path",text:"CircularProgressbar-text",background:"CircularProgressbar-background"},counterClockwise:!1,className:"",maxValue:100,minValue:0,strokeWidth:8,styles:{root:{},trail:{},path:{},text:{},background:{}},text:""},s}(f.Component);function S(e){e.children;var t=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)0>t.indexOf(r[n])&&(s[r[n]]=e[r[n]]);return s}(e,["children"]);return(0,f.createElement)("div",{"data-test-id":"CircularProgressbarWithChildren"},(0,f.createElement)("div",{style:{position:"relative",width:"100%",height:"100%"}},(0,f.createElement)(_,P({},t)),e.children?(0,f.createElement)("div",{"data-test-id":"CircularProgressbarWithChildren__children",style:{position:"absolute",width:"100%",height:"100%",marginTop:"-100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.children):null))}function F(e){var t=e.rotation,s=e.strokeLinecap,r=e.textColor,n=e.textSize,a=e.pathColor,l=e.pathTransition,i=e.pathTransitionDuration,o=e.trailColor,d=e.backgroundColor,c=null==t?void 0:"rotate("+t+"turn)",u=null==t?void 0:"center center";return{root:{},path:B({stroke:a,strokeLinecap:s,transform:c,transformOrigin:u,transition:l,transitionDuration:null==i?void 0:i+"s"}),trail:B({stroke:o,strokeLinecap:s,transform:c,transformOrigin:u}),text:B({fill:r,fontSize:n}),background:B({fill:d})}}function B(e){return Object.keys(e).forEach(function(t){null==e[t]&&delete e[t]}),e}function D(e){let{survey:t,numAnswersOwnerCanPay:s,paymentWarningLimit:n}=e,{t:a}=(0,l.Bd)("survey-responses-overview"),i=t.answers.filter(e=>"accepted"===e.status).length;return(0,r.jsx)("section",{"aria-labelledby":"survey-responses-overview",children:(0,r.jsxs)("div",{className:"mt-8 overflow-hidden rounded-lg p-6 shadow-sm",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6 rounded-xl bg-slate-100/50 px-7 py-5 shadow-xs",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("p",{className:"text-[16px] leading-[22px] font-semibold text-[#303C42]",children:a("responses-received-heading")}),(0,r.jsxs)("p",{className:"text-ppblue-default text-[15px] leading-[20px]",children:[(0,r.jsx)("span",{className:"text-[50px] leading-[68px] font-semibold",children:i}),"/",t.respondentsNeeded]})]}),(0,r.jsx)("div",{className:"w-24 shrink-0",children:(0,r.jsx)(S,{value:i,maxValue:t.respondentsNeeded,styles:F({pathColor:"#3F51B5",trailColor:"#ABB3DE"})})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6 rounded-xl bg-slate-100/50 px-7 py-5 shadow-xs",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("p",{className:"text-[16px] leading-[22px] font-semibold text-[#303C42]",children:a("payable-responses-heading")}),(0,r.jsxs)("div",{className:"flex flex-wrap items-end ".concat(s<n?"text-[#DDAE06]":"text-[#49BCFF]"),children:[(0,r.jsx)("p",{className:"mr-4 text-[50px] leading-[50px] font-semibold",children:s}),(0,r.jsx)("p",{className:"text-[15px] leading-[24px] whitespace-nowrap",children:a("payable-responses-text")})]})]}),(0,r.jsx)("div",{className:"w-24 shrink-0",children:(0,r.jsx)(S,{value:i+s,maxValue:t.respondentsNeeded,styles:F({pathColor:s<n?"#DDAE06":"#49BCFF",trailColor:"rgba(171, 179, 222, 0.4)",strokeLinecap:"butt"}),children:(0,r.jsx)(S,{value:i,maxValue:t.respondentsNeeded,styles:F({pathColor:"#3F51B5",trailColor:"transparent",strokeLinecap:"butt"})})})})]})]}),(0,r.jsxs)("div",{className:"mt-6 flex flex-col gap-7",children:[s<n&&s>0&&(0,r.jsxs)("div",{className:"flex items-center gap-7 rounded-3xl border border-[#DDAE06] bg-yellow-50 p-7",children:[(0,r.jsx)(E,{className:"h-10 w-10 shrink-0 text-yellow-400","aria-hidden":"true"}),(0,r.jsx)("p",{className:"text-[16px] leading-[22px] text-yellow-700",children:"".concat(a("pollcoins-low-warning-part1")," ").concat(s,"\n ").concat(a("pollcoins-low-warning-part2"))})]}),s<=0&&(0,r.jsxs)("div",{className:"flex items-center gap-7 rounded-3xl border border-red-500 bg-red-50 p-7",children:[(0,r.jsx)(E,{className:"h-10 w-10 shrink-0 text-red-400","aria-hidden":"true"}),(0,r.jsx)("p",{className:"text-[16px] leading-[22px] text-red-700",children:a("out-of-pollcoins-warning")})]})]})]})})}var I=s(195),L=s(7556);function T(e){let{user:t}=e,{t:s}=(0,l.Bd)("welcome-screen");return"fellow"===t.role?(0,r.jsx)("div",{className:"mt-[48px] flex items-center justify-center pb-[20px]",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-12 px-[16px] sm:px-[40px] md:w-[814px] md:px-[72px]",children:[(0,r.jsx)(N(),{src:"/icons/gesture-clap.webp",alt:"",width:92,height:92,className:"size-[92px]","aria-hidden":!0}),(0,r.jsx)("h3",{className:"text-ppblue-default text-center text-4xl font-bold",children:s("heading")}),(0,r.jsx)("p",{className:"text-left text-[18px] leading-[32px] font-light text-[#303C42]",children:s("fellow.text")}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-6 sm:flex-row",children:[(0,r.jsx)("button",{type:"button",className:"bg-ppblue-default hover:bg-ppblue-hover focus:ring-ppblue-default active:bg-ppblue-active inline-flex w-full cursor-pointer justify-center rounded-[100px] border border-transparent px-4 py-2 text-base font-medium text-white shadow-xs focus:ring-2 focus:ring-offset-2 focus:outline-hidden sm:w-80 sm:py-4 sm:text-[16
1px] sm:leading-[22px] sm:font-semibold",onClick:()=>window.open("/app/credits/answer","_self"),children:s("fellow.answer-surveys-button")}),(0,r.jsx)("button",{type:"button",className:"border-ppblue-default text-ppblue-default focus:ring-ppblue-default inline-flex w-full cursor-pointer justify-center rounded-[100px] border bg-white px-4 py-2 text-base font-medium shadow-xs hover:bg-gray-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden active:bg-gray-200 sm:w-80 sm:py-4 sm:text-[16px] sm:leading-[22px] sm:font-semibold",onClick:()=>window.open("/app/credits/purchase","_self"),children:s("fellow.buy-pollcoins-button")})]})]})}):(0,r.jsx)("div",{className:"mt-[48px] flex items-center justify-center pb-[20px]",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-12 px-[16px] sm:px-[40px] md:w-[814px] md:px-[72px]",children:[(0,r.jsx)(N(),{src:"/icons/gesture-clap.webp",alt:"",width:92,height:92,className:"size-[92px]","aria-hidden":!0}),(0,r.jsx)("h3",{className:"text-ppblue-default text-center text-4xl font-bold",children:s("heading")}),(0,r.jsx)("p",{className:"text-left text-[18px] leading-[32px] font-light text-[#303C42]",children:s("text")}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-6 sm:flex-row",children:[(0,r.jsx)("button",{type:"button",className:"bg-ppblue-default hover:bg-ppblue-hover focus:ring-ppblue-default active:bg-ppblue-active inline-flex w-full cursor-pointer justify-center rounded-[100px] border border-transparent px-4 py-2 text-base font-medium text-white shadow-xs focus:ring-2 focus:ring-offset-2 focus:outline-hidden sm:w-80 sm:py-4 sm:text-[16px] sm:leading-[22px] sm:font-semibold",onClick:()=>window.open("/app/credits/share","_self"),children:s("share-survey-button")}),L.q["survey-creator"].isEnabled&&(0,r.jsx)("button",{type:"button",className:"border-ppblue-default text-ppblue-default focus:ring-ppblue-default inline-flex w-full cursor-pointer justify-center rounded-[100px] border bg-white px-4 py-2 text-base font-medium shadow-xs hover:bg-gray-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden active:bg-gray-200 sm:w-80 sm:py-4 sm:text-[16px] sm:leading-[22px] sm:font-semibold",children:s("create-survey-button")})]})]})})}var z=s(7645),q=!0;function M(e){var t,s,i;let{user:c,numAnswersOwnerCanPay:p,isBoosterActive:h}=e,{t:m}=(0,l.Bd)("dashboard"),[b,y]=(0,f.useState)(!1),[j,N]=(0,f.useState)(!1),[C,k]=(0,f.useState)({type:null,heading:null,text:null}),[E,A]=(0,f.useState)(!1),{status:P}=(0,d.useSession)();if("unauthenticated"===P)return(0,r.jsx)(x(),{href:"/login",children:"Sign in"});function O(){y(!1)}return(0,r.jsxs)(n.A,{title:m("title"),user:c,survey:null!=(t=c.survey)?t:void 0,sidebar:(0,r.jsx)(w.A,{children:(0,r.jsx)(o,{})}),children:[(0,r.jsx)(u(),{children:(0,r.jsx)("title",{children:m("title")})}),c.survey&&null!=p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.A,{children:m("subheading")}),(0,r.jsx)(R,{survey:c.survey,user:c,setDownloadModalOpen:N,setDeleteModalOpen:y,isBoosterActive:h}),(0,r.jsx)(D,{survey:c.survey,numAnswersOwnerCanPay:p,paymentWarningLimit:5}),(0,r.jsx)(a.d,{isOpen:b,onClose:O,children:(0,r.jsx)(g,{survey:c.survey,setClosed:O,setNotification:k,setShowNotification:A})}),(0,r.jsx)(a.d,{isOpen:j,onClose:function(){N(!1)},children:(0,r.jsx)(v,{survey:c.survey,setNotification:k,setShowNotification:A})})]}):(0,r.jsx)(T,{user:c}),E&&(0,r.jsx)(I.y,{show:E,setShow:A,type:C.type,heading:null!=(s=C.heading)?s:"",text:null!=(i=C.text)?i:""})]})}},7556:(e,t,s)=>{"use strict";s.d(t,{q:()=>r});let r={"survey-creator":{isEnabled:!1},"suggested-cost":{isEnabled:!0},"clickworker-booster":{isEnabled:!0}}},7645:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(7876);function n(e){return(0,r.jsx)("h2",{className:"mt-[20px] mb-[12px] text-lg font-semibold text-neutral-500",children:e.children})}},8221:(e,t,s)=>{"use strict";s.d(t,{UC:()=>el,Y9:()=>en,q7:()=>er,bL:()=>es,l9:()=>ea});var r=s(4232),n=s(1844),a=s(3134),l=s(714),i=s(3716),o=s(8162),d=s(7797),c=s(1285),u=s(6822),p=s(294),x=s(7876),f="Collapsible",[h,m]=(0,n.A)(f),[b,g]=h(f),v=r.forwardRef((e,t)=>
1{let{__scopeCollapsible:s,open:n,defaultOpen:a,disabled:l,onOpenChange:i,...c}=e,[u,h]=(0,o.i)({prop:n,defaultProp:a??!1,onChange:i,caller:f});return(0,x.jsx)(b,{scope:s,disabled:l,contentId:(0,p.B)(),open:u,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),children:(0,x.jsx)(d.sG.div,{"data-state":k(u),"data-disabled":l?"":void 0,...c,ref:t})})});v.displayName=f;var w="CollapsibleTrigger",y=r.forwardRef((e,t)=>{let{__scopeCollapsible:s,...r}=e,n=g(w,s);return(0,x.jsx)(d.sG.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":k(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...r,ref:t,onClick:(0,i.mK)(e.onClick,n.onOpenToggle)})});y.displayName=w;var j="CollapsibleContent",N=r.forwardRef((e,t)=>{let{forceMount:s,...r}=e,n=g(j,e.__scopeCollapsible);return(0,x.jsx)(u.C,{present:s||n.open,children:({present:e})=>(0,x.jsx)(C,{...r,ref:t,present:e})})});N.displayName=j;var C=r.forwardRef((e,t)=>{let{__scopeCollapsible:s,present:n,children:a,...i}=e,o=g(j,s),[u,p]=r.useState(n),f=r.useRef(null),h=(0,l.s)(t,f),m=r.useRef(0),b=m.current,v=r.useRef(0),w=v.current,y=o.open||u,N=r.useRef(y),C=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,c.N)(()=>{let e=f.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();m.current=t.height,v.current=t.width,N.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),p(n)}},[o.open,n]),(0,x.jsx)(d.sG.div,{"data-state":k(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y,...i,ref:h,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:y&&a})});function k(e){return e?"open":"closed"}var R=s(4966),E="Accordion",A=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[P,O,_]=(0,a.N)(E),[S,F]=(0,n.A)(E,[_,m]),B=m(),D=r.forwardRef((e,t)=>{let{type:s,...r}=e;return(0,x.jsx)(P.Provider,{scope:e.__scopeAccordion,children:"multiple"===s?(0,x.jsx)(M,{...r,ref:t}):(0,x.jsx)(q,{...r,ref:t})})});D.displayName=E;var[I,L]=S(E),[T,z]=S(E,{collapsible:!1}),q=r.forwardRef((e,t)=>{let{value:s,defaultValue:n,onValueChange:a=()=>{},collapsible:l=!1,...i}=e,[d,c]=(0,o.i)({prop:s,defaultProp:n??"",onChange:a,caller:E});return(0,x.jsx)(I,{scope:e.__scopeAccordion,value:r.useMemo(()=>d?[d]:[],[d]),onItemOpen:c,onItemClose:r.useCallback(()=>l&&c(""),[l,c]),children:(0,x.jsx)(T,{scope:e.__scopeAccordion,collapsible:l,children:(0,x.jsx)(Y,{...i,ref:t})})})}),M=r.forwardRef((e,t)=>{let{value:s,defaultValue:n,onValueChange:a=()=>{},...l}=e,[i,d]=(0,o.i)({prop:s,defaultProp:n??[],onChange:a,caller:E}),c=r.useCallback(e=>d((t=[])=>[...t,e]),[d]),u=r.useCallback(e=>d((t=[])=>t.filter(t=>t!==e)),[d]);return(0,x.jsx)(I,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:(0,x.jsx)(T,{scope:e.__scopeAccordion,collapsible:!0,children:(0,x.jsx)(Y,{...l,ref:t})})})}),[V,W]=S(E),Y=r.forwardRef((e,t)=>{let{__scopeAccordion:s,disabled:n,dir:a,orientation:o="vertical",...c}=e,u=r.useRef(null),p=(0,l.s)(u,t),f=O(s),h="ltr"===(0,R.jH)(a),m=(0,i.mK)(e.onKeyDown,e=>{if(!A.includes(e.key))return;let t=e.target,s=f().filter(e=>!e.ref.current?.disabled),r=s.findIndex(e=>e.ref.current===t),n=s.length;if(-1===r)return;e.preventDefault();let a=r,l=n-1,i=()=>{(a=r+1)>l&&(a=0)},d=()=>{(a=r-1)<0&&(a=l)};switch(e.key){case"Home":a=0;break;case"End":a=l;break;case"ArrowRight":"horizontal"===o&&(h?i():d());break;case"ArrowDown":"vertical"===o&&i();break;case"ArrowLeft":"horizontal"===o&&(h?d():i());break;case"ArrowUp":"vertical"===o&&d()}let c=a%n;s[c].ref.current?.focus()});return(0,x.jsx)(V,{scope:s,disabled:n,direction:a,orientation:o,children:(0,x.jsx)(P.Slot,{scope:s,children:(0,x.jsx)(d.sG.div,{...c,"data-orientation":o,ref:p,onKeyDown:n?void 0:m})})})}),$="AccordionItem",[G,H]=S($),U=r.forwardRef((e,t)=>
1{let{__scopeAccordion:s,value:r,...n}=e,a=W($,s),l=L($,s),i=B(s),o=(0,p.B)(),d=r&&l.value.includes(r)||!1,c=a.disabled||e.disabled;return(0,x.jsx)(G,{scope:s,open:d,disabled:c,triggerId:o,children:(0,x.jsx)(v,{"data-orientation":a.orientation,"data-state":et(d),...i,...n,ref:t,disabled:c,open:d,onOpenChange:e=>{e?l.onItemOpen(r):l.onItemClose(r)}})})});U.displayName=$;var J="AccordionHeader",K=r.forwardRef((e,t)=>{let{__scopeAccordion:s,...r}=e,n=W(E,s),a=H(J,s);return(0,x.jsx)(d.sG.h3,{"data-orientation":n.orientation,"data-state":et(a.open),"data-disabled":a.disabled?"":void 0,...r,ref:t})});K.displayName=J;var X="AccordionTrigger",Q=r.forwardRef((e,t)=>{let{__scopeAccordion:s,...r}=e,n=W(E,s),a=H(X,s),l=z(X,s),i=B(s);return(0,x.jsx)(P.ItemSlot,{scope:s,children:(0,x.jsx)(y,{"aria-disabled":a.open&&!l.collapsible||void 0,"data-orientation":n.orientation,id:a.triggerId,...i,...r,ref:t})})});Q.displayName=X;var Z="AccordionContent",ee=r.forwardRef((e,t)=>{let{__scopeAccordion:s,...r}=e,n=W(E,s),a=H(Z,s),l=B(s);return(0,x.jsx)(N,{role:"region","aria-labelledby":a.triggerId,"data-orientation":n.orientation,...l,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function et(e){return e?"open":"closed"}ee.displayName=Z;var es=D,er=U,en=K,ea=Q,el=ee}},e=>{e.O(0,[144,887,8947,5513,8950,4026,3001,1351,2387,636,6593,8792],()=>e(e.s=5776)),_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.