1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="eb9a0c34-f671-43a0-bb51-5cb67d56e158",e._sentryDebugIdIdentifier="sentry-dbid-eb9a0c34-f671-43a0-bb51-5cb67d56e158")}()}catch(e){}!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];if(null!=t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:ns-web":!0})}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95121],{15779:(e,a,t)=>{t.d(a,{A:()=>d});var r=t(29152),s=t(13356),n=t(78733),l=t(49788),i=t(57453);function d(e){var{entryId:a,currentPlace:t,taskRewards:d,assignedPlaces:o,onPlaceSelect:c,disabled:m=!1}=e,u=(0,s.useMemo)(()=>{var e=[];return d.forEach(a=>{for(var t=a.count||1,r=0;r<t;r++)e.push(a.place)}),e.sort((e,a)=>e-a)},[d]),f=(0,s.useMemo)(()=>{var e=new Map;return o.forEach((t,r)=>{r!==a&&null!==t&&0!==t&&e.set(t,(e.get(t)||0)+1)}),e},[o,a]),x=(0,s.useMemo)(()=>{var e=new Map;return u.forEach(a=>{e.set(a,(e.get(a)||0)+1)}),Array.from(e.entries()).sort((e,a)=>e[0]-a[0])},[u]),p=e=>"".concat(e).concat(1===e?"st":2===e?"nd":3===e?"rd":"th"),h=null!==t&&0!==t;return(0,r.jsxs)(n.l6,{value:null===t||0===t?"none":t.toString(),onValueChange:e=>{if(!e||"string"!=typeof e)return void i.v.error("Invalid value provided to rank assignment",Error("Invalid value type"),{feature:"rank_assignment",entryId:a,valueType:typeof e});if("none"===e)c(a,0);else{var t=parseInt(e,10);if(isNaN(t)||t<1||t>1e3)return void i.v.error("Invalid place number for rank assignment",Error("Invalid place: ".concat(e)),{feature:"rank_assignment",entryId:a,value:e,placeNumber:t});if(!u.includes(t))return void i.v.error("Place not available in task rewards",Error("Place ".concat(t," not available")),{feature:"rank_assignment",entryId:a,placeNumber:t,availablePlaces:u});c(a,t)}},disabled:m,children:[(0,r.jsx)(n.bq,{className:"flex h-8 w-12 justify-center rounded-full border-black bg-black px-2 text-white hover:bg-gray-900 focus:bg-gray-900",hideArrow:!0,children:(0,r.jsx)("div",{className:"flex items-center justify-center text-sm font-medium",children:h?(0,r.jsx)("span",{children:null===t||0===t?"":p(t)}):(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})})}),(0,r.jsxs)(n.gC,{children:[(0,r.jsx)(n.eb,{value:"none",children:(0,r.jsx)("span",{className:"text-gray-400",children:"No ranking"})}),x.map(e=>{var a,[t,s]=e,l=f.get(t)||0,i=(a=u.filter(e=>e===t).length,(f.get(t)||0)>=a);return(0,r.jsx)(n.eb,{value:t.toString(),disabled:i,children:(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsx)("span",{className:i?"text-gray-400":"",children:p(t)}),s>1&&(0,r.jsxs)("span",{className:"ml-3 text-xs text-gray-400",children:[s-l,"/",s]})]})},t)})]})]})}},20144:(e,a,t)=>{t.d(a,{A:()=>l});var r=t(29152),s=t(13356),n=t(84213);class l extends s.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,a){console.error("RankAssignment Error:",e,a)}render(){return this.state.hasError?this.props.fallback||(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-md bg-red-50 px-3 py-2 text-sm text-red-600",children:[(0,r.jsx)(n.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:"Unable to load rank assignment"})]}):this.props.children}constructor(e){super(e),this.state={hasError:!1,error:null}}}},35590:(e,a,t)=>{t.d(a,{AlertDialog:()=>m,AlertDialogAction:()=>b,AlertDialogCancel:()=>w,AlertDialogContent:()=>p,AlertDialogDescription:()=>y,AlertDialogFooter:()=>v,AlertDialogHeader:()=>h,AlertDialogTitle:()=>g,AlertDialogTrigger:()=>u});var r=t(81463),s=t(97320),n=t(62839),l=t(29152),i=t(13356),d=t(96967),o=t(72457),c=t(8193),m=d.bL,u=d.l9,f=d.ZL,x=i.forwardRef((e,a)=>{var{className:t}=e,i=(0,n._)(e,["className"]);return(0,l.jsx)(d.hJ,(0,s._)((0,r._)({className:(0,o.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",t)},i),{ref:a}))});x.displayName=d.hJ.displayName;var p=i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsxs)(f,{children:[(0,l.jsx)(x,{}),(0,l.jsx)(d.UC,(0,r._)({ref:a,className:(0,o.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:rou
1nded-lg",t)},s))]})});p.displayName=d.UC.displayName;var h=e=>{var{className:a}=e,t=(0,n._)(e,["className"]);return(0,l.jsx)("div",(0,r._)({className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",a)},t))};h.displayName="AlertDialogHeader";var v=e=>{var{className:a}=e,t=(0,n._)(e,["className"]);return(0,l.jsx)("div",(0,r._)({className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a)},t))};v.displayName="AlertDialogFooter";var g=i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsx)(d.hE,(0,r._)({ref:a,className:(0,o.cn)("text-lg font-semibold",t)},s))});g.displayName=d.hE.displayName;var y=i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsx)(d.VY,(0,r._)({ref:a,className:(0,o.cn)("text-sm text-muted-foreground",t)},s))});y.displayName=d.VY.displayName;var b=i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsx)(d.rc,(0,r._)({ref:a,className:(0,o.cn)((0,c.r)(),t)},s))});b.displayName=d.rc.displayName;var w=i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsx)(d.ZD,(0,r._)({ref:a,className:(0,o.cn)((0,c.r)({variant:"outline"}),"mt-2 sm:mt-0",t)},s))});w.displayName=d.ZD.displayName},38802:(e,a,t)=>{t.d(a,{A:()=>f});var r=t(85468),s=t(29152),n=t(13356),l=t(23668),i=t(76102),d=t(646),o=t(45894),c=t(84190),m=t(85282),u=t(57453);function f(e){var{entry:a,taskTitle:t,isLoggedIn:f=!1,className:x="text-gray-400 hover:text-gray-700 transition-colors disabled:opacity-50",iconSize:p="w-6 h-6",showTooltip:h=!0}=e,{showLoginModal:v}=(0,o.GD)(),[g,y]=(0,n.useState)(!1),{isAvailable:b,downloadUrl:w}=(0,d.t)({playbackId:"video"===a.entryType?a.src:void 0,brandedPlaybackId:a.brandedPlaybackId,brandedAssetReady:a.brandedAssetReady});if("video"!==a.entryType)return null;var j=b&&w,N=(0,s.jsx)("button",{onClick:()=>(0,r._)(function*(){if(w&&t&&(null==(e=a.entrant)?void 0:e.username)){if(!f)return void v({title:"Sign in to download",description:"You need to be logged in to download videos",redirectTo:window.location.pathname});y(!0);try{var e,r,s=(0,c.C)(t),n="".concat(a.entrant.username,"-").concat(s,"-earn-ns.com.mp4"),l="".concat(w,"?download=").concat(encodeURIComponent(n)),i=document.createElement("a");i.href=l,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i)}catch(e){u.v.error("Video download failed",e,{feature:"video_download",entryId:a.id,username:null==(r=a.entrant)?void 0:r.username,taskTitle:t})}finally{setTimeout(()=>y(!1),1e3)}}})(),disabled:g||!j,className:x,title:h?void 0:j?"Download video":"Download not available yet",children:g?(0,s.jsx)(l.A,{className:"".concat(p," animate-spin")}):(0,s.jsx)(i.A,{className:p})});return h?(0,s.jsxs)(m.m_,{children:[(0,s.jsx)(m.k$,{asChild:!0,children:N}),(0,s.jsx)(m.ZI,{children:(0,s.jsx)("p",{children:"Download video"})})]}):N}},59532:(e,a,t)=>{t.d(a,{A:()=>n,Y:()=>l});var r=t(29152),s=e=>"".concat(e).concat(["st","nd","rd","th","th"][e-1]||"th");function n(e){var{place:a,isSettled:t,reward:n,paidIn:l}=e;return a&&!(a>5)&&t?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("div",{className:"text-md bg-gold-gradient-vertical px-2 pb-1.5 pt-2 font-semibold text-white",children:[a,s(a).slice(1)]}),(0,r.jsx)("div",{className:"clip-banner-bottom absolute -bottom-2 left-0 right-0 h-2 bg-gold-500"})]}):null}function l(e){var{place:a,isSettled:t,reward:n,paidIn:l}=e;return a&&!(a>5)&&t?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("div",{className:"text-md bg-gold-gradient-vertical px-2 pb-1.5 pt-2 font-semibold text-white",children:[a,s(a).slice(1)]}),(0,r.jsx)("div",{className:"clip-banner-bottom absolute -bottom-2 left-0 right-0 h-2 bg-gold-500"})]}):null}},64759:(e,a,t)=>{t.d(a,{A:()=>r});var r=(0,t(61598).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},70047:(e,a,t)=>{t.d(a,{A:()=>r});var r=(0,t(61598).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},78733:(e,a,t)=>{t.d(a,{bq:()=>p,eb:()=>y,gC:()=>
1g,l6:()=>f,yv:()=>x});var r=t(81463),s=t(97320),n=t(62839),l=t(29152),i=t(13356),d=t(9263),o=t(54876),c=t(96829),m=t(99038),u=t(72457),f=e=>{var{onOpenChange:a}=e,t=(0,n._)(e,["onOpenChange"]),s=i.useCallback(e=>{"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("ns-floating-layer-open-change",{detail:{open:e,layer:"select"}})),null==a||a(e)},[a]);return(0,l.jsx)(d.bL,(0,r._)({onOpenChange:s},t))};d.YJ;var x=d.WT,p=i.forwardRef((e,a)=>{var{className:t,children:i,hideArrow:c=!1}=e,m=(0,n._)(e,["className","children","hideArrow"]);return(0,l.jsxs)(d.l9,(0,s._)((0,r._)({ref:a,className:(0,u.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t)},m),{children:[i,!c&&(0,l.jsx)(d.In,{asChild:!0,children:(0,l.jsx)(o.A,{className:"h-4 w-4 opacity-50"})})]}))});p.displayName=d.l9.displayName;var h=i.forwardRef((e,a)=>{var{className:t}=e,i=(0,n._)(e,["className"]);return(0,l.jsx)(d.PP,(0,s._)((0,r._)({ref:a,className:(0,u.cn)("flex cursor-default items-center justify-center py-1",t)},i),{children:(0,l.jsx)(c.A,{className:"h-4 w-4"})}))});h.displayName=d.PP.displayName;var v=i.forwardRef((e,a)=>{var{className:t}=e,i=(0,n._)(e,["className"]);return(0,l.jsx)(d.wn,(0,s._)((0,r._)({ref:a,className:(0,u.cn)("flex cursor-default items-center justify-center py-1",t)},i),{children:(0,l.jsx)(o.A,{className:"h-4 w-4"})}))});v.displayName=d.wn.displayName;var g=i.forwardRef((e,a)=>{var{className:t,children:i,position:o="popper",hideScrollButtons:c=!1}=e,m=(0,n._)(e,["className","children","position","hideScrollButtons"]);return(0,l.jsx)(d.ZL,{children:(0,l.jsxs)(d.UC,(0,s._)((0,r._)({ref:a,"data-ns-floating-layer-content":"select",className:(0,u.cn)("relative z-[70] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o},m),{children:[!c&&(0,l.jsx)(h,{}),(0,l.jsx)(d.LM,{className:(0,u.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),!c&&(0,l.jsx)(v,{})]}))})});g.displayName=d.UC.displayName,i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsx)(d.JU,(0,r._)({ref:a,className:(0,u.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t)},s))}).displayName=d.JU.displayName;var y=i.forwardRef((e,a)=>{var{className:t,children:i}=e,o=(0,n._)(e,["className","children"]);return(0,l.jsxs)(d.q7,(0,s._)((0,r._)({ref:a,className:(0,u.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t)},o),{children:[(0,l.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(d.VF,{children:(0,l.jsx)(m.A,{className:"h-4 w-4"})})}),(0,l.jsx)(d.p4,{children:i})]}))});y.displayName=d.q7.displayName,i.forwardRef((e,a)=>{var{className:t}=e,s=(0,n._)(e,["className"]);return(0,l.jsx)(d.wv,(0,r._)({ref:a,className:(0,u.cn)("-mx-1 my-1 h-px bg-muted",t)},s))}).displayName=d.wv.displayName},87471:(e,a,t)=>{t.d(a,{A:()=>r});var r=(0,t(61598).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},90571:(e,a,t)=>{t.d(a,{WQ:()=>d,Wu:()=>m,Zp:()=>o,aR:()=>c});var r=t(81463),s=t(62839),n=t(29152),l=t(13356),i=t(72457),d=l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("div",(0,r._)({ref:a,className:(0,i.cn)("rounded-xl border border-ns-gray bg-card text-card-foreground",t)},l))});
1d.displayName="Card";var o=l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("div",(0,r._)({ref:a,className:(0,i.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t)},l))});o.displayName="Card";var c=l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("div",(0,r._)({ref:a,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",t)},l))});c.displayName="CardHeader",l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("h3",(0,r._)({ref:a,className:(0,i.cn)("text-2xl font-semibold leading-none tracking-tight",t)},l))}).displayName="CardTitle",l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("p",(0,r._)({ref:a,className:(0,i.cn)("text-sm text-muted-foreground",t)},l))}).displayName="CardDescription";var m=l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("div",(0,r._)({ref:a,className:(0,i.cn)("p-6 pt-0",t)},l))});m.displayName="CardContent",l.forwardRef((e,a)=>{var{className:t}=e,l=(0,s._)(e,["className"]);return(0,n.jsx)("div",(0,r._)({ref:a,className:(0,i.cn)("flex items-center p-6 pt-0",t)},l))}).displayName="CardFooter"},95121:(e,a,t)=>{t.r(a),t.d(a,{default:()=>B});var r=t(85468),s=t(81463),n=t(97320),l=t(29152),i=t(13356),d=t(90571),o=t(8193),c=t(59891),m=t(69016),u=t(84710),f=t(15880),x=t(23668),p=t(64759),h=t(70047),v=t(87471),g=t(56950),y=t(1850),b=t(62705),w=t(55992),j=t(74723),N=t(59532),_=t(15779),A=t(20144),k=t(95306),D=t(40268),C=t(72457),R=t(63887),I=t(85282),E=t(45894),S=t(93602),T=t(45282),P=t(83559),M=t(54620),H=t(20536),z=t(6454),L=t(86160),O=t.n(L),V=t(35590),U=t(38802),Z=(0,y.default)(()=>Promise.resolve().then(t.bind(t,3382)),{loadableGenerated:{webpack:()=>[3382]},ssr:!1,loading:()=>null});function F(e){var a,{entry:t,place:r,taskTitle:s,isLoggedIn:n,isSettled:i}=e,d=t.entryType.startsWith("referral_")?t.entryType.replace("referral_",""):t.entryType;return"link"===d||"code"===d?(0,l.jsx)("div",{className:"relative h-[400px] w-full shrink-0 md:h-[600px] md:w-[337px]",children:(0,l.jsxs)("div",{className:"h-full w-full overflow-hidden rounded-t-lg bg-gray-50 md:rounded-l-lg md:rounded-tr-none",children:[(0,l.jsxs)("div",{className:"relative flex h-full w-full items-center justify-center",children:[(0,l.jsx)("div",{className:"absolute inset-0 h-full w-full",children:(0,l.jsx)(H.default,{src:(0,P.iM)("tasks/link-frame-desktop-white.svg"),alt:"Link frame",fill:!0,className:"object-fill object-right",priority:!0,draggable:!1})}),t.src&&(0,l.jsx)("div",{className:"z-10 w-full max-w-[280px] md:max-w-[300px]",children:(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)("div",{className:"[&>div]:!sm:w-full w-full [&>div]:!flex [&>div]:!w-full [&>div]:!min-w-0 [&>div]:!max-w-none [&>div]:!flex-col",children:(0,l.jsx)(w.A,{url:t.src,showThirdPartyModal:!0,className:"h-[243px]",fillContainer:!0,previewData:t.linkPreviewData})})})})]}),r&&(0,l.jsx)("div",{className:"absolute left-4 top-0 z-20",children:(0,l.jsx)(N.A,{place:r,isSettled:i,reward:t.reward})})]})}):"image"===d?(0,l.jsxs)("div",{className:"relative h-[400px] w-full shrink-0 md:h-[600px] md:w-[337px]",children:[(0,l.jsx)(z.A,{src:t.src||"",alt:t.comment||"Entry image",width:337,height:600}),r&&(0,l.jsx)("div",{className:"absolute left-4 top-0 z-20",children:(0,l.jsx)(N.A,{place:r,isSettled:i,reward:t.reward})})]}):(0,l.jsx)("div",{className:"relative h-[400px] w-full shrink-0 md:h-[600px] md:w-[337px]",children:(0,l.jsxs)("div",{className:"relative h-full w-full overflow-hidden rounded-t-lg bg-gray-900 md:rounded-l-lg md:rounded-tr-none",children:[(0,l.jsx)(Z,{src:t.src,assetReady:t.assetReady,entryId:t.id,playbackId:"video"===d?t.src:void 0,brandedPlaybackId:t.brandedPlaybackId,brandedAssetReady:t.brandedAssetReady,taskTitle:s,username:(null==(a=t.entrant)?void 0:a.username)||"unknown",isLoggedIn:n,showDownloadButton:!0,tempStorageId:t.tempStorageId}),r&&(0,l.jsx)("div",{className:"absolute left-4 top-0 z-20",children:(0,l.jsx)(N.A,{place:r,isSettled:i,reward:t.reward})})]})})}function $(e){var a,t,r,s,{entry:n,place:i,isSettled:d,hideShare:o,taskTitle:c,taskPaidIn:f,isLoggedIn:x,isAdmin:p,taskRewards:h,assignedPlaces:v,onPlaceSelect:g}=e,y=window.location.origin;return(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsx)(j.A,{userId:null==(a=n.entrant)?void 0:a.id,name:null==(t=n.entrant)?void 0:t.name,username:null==(r=n.entrant)?void 0:r.username,profileImage:null==(s=n.entrant)?void 0:s.profileImage,enableNavigation:!0,className:"md:gap-3"}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-3 p-2",children:[p&&h&&v&&g&&!d&&(0,l.jsx)(A.A,{children:(0,l.jsx)(_.A,{entryId:n.id,currentPlace:v.get(n.id)||null,taskRewards:h,assignedPlaces:v,onPlaceSelect:g,disabled:!1})}),!o&&(0,l.jsx)(U.A,{entry:n,taskTitle:c,isLoggedIn:x,className:"pr-1.5 text-gray-iron-300 transition-colors hover:text-gold-300"}),!o&&(0,l.jsxs)(I.m_,{children:[(0,l.jsx)(I.k$,{asChild:!0,children:(0,l.jsx)(O(),{href:"/entry/".concat(n.id.slice(0,8)),className:"text-gray-300 transition-colors hover:text-gold-300","aria-label":"View entry page",children:(0,l.jsx)(m.A,{className:"h-6 w-6"})})}),(0,l.jsx)(I.ZI,{children:(0,l.jsx)("p",{children:"View entry page"})})]}),!o&&(0,l.jsx)(R.default,{url:"".concat(y,"/entry/").concat(n.id.slice(0,8)),entryId:n.id,showTooltip:!0,tooltipText:"Share this entry",customTrigger:(0,l.jsx)("button",{className:"flex items-center text-gray-300 ring-0 transition-colors hover:text-gold-300 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0",style:{outline:"none",boxShadow:"none"},children:(0,l.jsx)(u.A,{className:"h-6 w-6"})})})]})]})}function W(e){var a,{entry:t}=e,[r,s]=(0,i.useState)(!1),n=t.comment||"",d=n.length>100,o=d&&!r?"".concat(n.substring(0,100),"..."):n;return(0,l.jsxs)("div",{className:"pb-2",children:[(0,l.jsxs)("p",{className:"overflow-wrap-anywhere break-words pb-0.5 pt-1 text-sm text-gray-700",children:[o,d&&!r&&(0,l.jsx)("button",{onClick:()=>s(!0),className:"ml-1 font-semibold text-gray-500 hover:text-gray-800",children:"more"})]}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:null==(a=t.createdAt)?void 0:a.toLocaleStr
1ing("en-US",{hour:"2-digit",minute:"2-digit",day:"numeric",month:"short",year:"numeric"})})]})}function J(e){var{comments:a,onShowMore:t}=e;return(0,l.jsxs)("div",{className:"relative flex min-h-0 w-full flex-1 flex-col overflow-hidden rounded-xl p-3 ".concat(0===a.length?"bg-white":"bg-gray-50"),children:[(0,l.jsx)("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 h-[100px] rounded-b-lg bg-gradient-to-t from-white to-transparent"}),a.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"mb-3 mt-1 flex shrink-0 items-center justify-between px-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(f.A,{className:"h-4 w-4 text-gray-400"}),(0,l.jsx)("span",{className:"text-xs font-medium text-gray-400",children:"Latest comments"})]}),(0,l.jsx)("button",{onClick:t,className:"text-xs font-medium text-gray-400 hover:text-gray-700",children:"See all"})]}),(0,l.jsx)("div",{className:"flex-1 space-y-2.5",children:a.map(e=>(0,l.jsx)("div",{className:"rounded-xl border border-gray-100 bg-white p-1",style:{boxShadow:"0 4px 8px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.04)"},children:(0,l.jsx)(c.A,{comment:e,onDelete:()=>{},isDeleting:!1,hideDeleteButton:!0})},e.id))})]}),0===a.length&&(0,l.jsx)("div",{className:"flex w-full flex-1 flex-col items-center justify-center",children:(0,l.jsxs)("button",{onClick:t,className:"group flex flex-col items-center justify-center",children:[(0,l.jsx)(f.A,{className:"mb-2 h-28 w-28 text-gray-iron-200 transition-colors group-hover:text-gold-300",strokeWidth:.6}),(0,l.jsx)("span",{className:"text-md pr-2 font-medium text-gray-300 transition-colors group-hover:text-gold-300",children:"Add a comment"})]})})]})}function Y(e){var{entry:a,handleReview:t,isOwnEntry:r,onDelete:s,isDeleting:n,isActive:i,isSettled:d,onCommentClick:c,onReviewsClick:m,hideComments:u,hideCommentButton:y,isAdmin:w,onToggleVisibility:j,isTogglingVisibility:N}=e;return(0,l.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsx)(b.A,{avatars:a.reviewers,countText:"Upvotes",avatarSize:"md",textSize:"sm",blackAndWhite:!0,enableNavigation:!0,onCountClick:m})}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[w&&j&&(0,l.jsx)(o.$,{variant:"ns",size:"sm",onClick:j,disabled:N,className:(0,C.cn)("relative h-12 w-12 shrink-0 border-none bg-transparent p-0 shadow-none after:pointer-events-auto after:absolute after:-inset-1 after:rounded-lg after:content-[''] hover:bg-transparent",{"text-red-400 hover:text-red-700":a.isHidden,"text-gray-iron-600 hover:text-gold-300":!a.isHidden}),title:a.isHidden?"Make entry visible":"Hide entry",children:N?(0,l.jsx)(x.A,{className:"h-4 w-4 animate-spin"}):a.isHidden?(0,l.jsx)(p.A,{className:"h-6 w-6"}):(0,l.jsx)(h.A,{className:"h-6 w-6"})}),r&&!d&&(0,l.jsx)(o.$,{variant:"ns",size:"sm",onClick:s,disabled:n||!i,className:(0,C.cn)("relative mr-2 h-12 w-12 shrink-0 border-none bg-transparent text-gray-600 shadow-none after:pointer-events-auto after:absolute after:-inset-1 after:rounded-lg after:content-[''] hover:bg-transparent hover:text-gold-300",{"cursor-not-allowed opacity-50":!i}),children:n?(0,l.jsx)(x.A,{className:"h-6 w-6 animate-spin"}):(0,l.jsx)(v.A,{className:"h-6 w-6"})}),!y&&(0,l.jsxs)(I.m_,{children:[(0,l.jsx)(I.k$,{asChild:!0,children:(0,l.jsxs)(o.$,{variant:"ns",size:"sm",onClick:c,className:"relative flex shrink-0 items-center gap-0.5 border-none bg-transparent px-2 py-3 text-gray-600 shadow-none after:pointer-events-auto after:absolute after:-inset-1 after:rounded-lg after:content-[''] hover:bg-transparent hover:text-gold-300 md:gap-2 md:px-2 md:py-6",children:[(0,l.jsx)(f.A,{className:"h-4 w-4 md:h-6 md:w-6"}),(0,l.jsx)("span",{className:"text-base font-medium md:text-xl",children:a.commentCount||0})]})}),(0,l.jsx)(I.ZI,{children:(0,l.jsx)("p",{children:"Leave a comment"})})]}),(0,l.jsxs)(I.m_,{children:[(0,l.jsx)(I.k$,{asChild:!0,children:(0,l.jsxs)(o.$,{variant:"ns",size:"sm",onClick:t,disabled:!i,className:(0,C.cn)("relative flex shrink-0 items-center gap-0.5 px-2 py-3 transition-all duration-200 after:pointer-events-auto after:absolute after:-inset-1 after:rounded-lg after:content-[''] md:px-2 md:py-6",{"border-none bg-transparent text-gray-600 shadow-none hover:bg-transparent":a.userHasReviewed||!i,"border-none bg-transparent text-gray-600 shadow-none hover:bg-transparent hover:text-gold-300":!a.userHasReviewed&&i,"curs
1or-not-allowed opacity-50":!i}),children:[(0,l.jsx)(g.A,{strokeWidth:1.5*!a.userHasReviewed,className:(0,C.cn)("h-5 w-5 flex-shrink-0 transition-transform md:h-8 md:w-8",{"fill-gold-300":a.userHasReviewed,"fill-none":!a.userHasReviewed,"hover:scale-110":i})}),(0,l.jsx)("span",{className:(0,C.cn)("text-base font-medium md:text-xl",{"text-gold-300":a.userHasReviewed,"text-gray-iron-600":!a.userHasReviewed}),children:a.reviewCount||0})]})}),(0,l.jsx)(I.ZI,{children:(0,l.jsx)("p",{children:"Leave a positive vote"})})]})]})]})}function B(e){var a,{entry:t,taskSlug:o,taskTitle:c,taskSponsorId:m,taskPaidIn:u,isLoggedIn:f,place:x,isSettled:h,isActive:v,className:g,hideShare:y,hideComments:b,hideCommentButton:w,onCommentsToggle:j,onReviewsToggle:N,taskRewards:_,assignedPlaces:A,onPlaceSelect:R,showGoldHighlight:P,onDelete:H}=e,{user:z,userProfileAbbreviated:L,authenticated:O}=(0,S.Jd)(),U=i.useMemo(()=>O?t:(0,n._)((0,s._)({},t),{userHasReviewed:!1,isOwnEntry:!1}),[t,O]),{showLoginModal:Z}=(0,E.GD)(),{showCommentsModal:B}=(0,E.hv)(),{showReviewsModal:q}=(0,E.IM)(),G=(0,D.mW)(o,L),K=(0,D.Du)(o,L),Q=(0,k.jR)(o),X=(0,k.GC)(o),{createPendingReview:ee,clearPendingAction:ea}=(0,E.qz)(),[et,er]=(0,i.useState)(!1),[es,en]=(0,i.useState)(!!P),[el,ei]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(P)en(!0),ei(!1);else if(es){ei(!0);var e=setTimeout(()=>{en(!1),ei(!1)},300);return()=>clearTimeout(e)}},[P,es]);var ed=(null==z?void 0:z.type)===T.$o.core,eo=()=>{j?j():B({entryId:U.id,taskSlug:o})};return(0,l.jsx)(I.Bc,{children:(0,l.jsxs)("div",{className:"relative",children:[es&&(0,l.jsx)("div",{className:(0,C.cn)("absolute -inset-[1px] transition-opacity duration-300",el?"opacity-0":"opacity-100"),style:{borderRadius:"12px",background:"linear-gradient(to right, #9E7A45, #E6C79A)",padding:"1px",animation:"gold-pulse 3s ease-in-out infinite"}}),(0,l.jsxs)(d.WQ,{className:(0,C.cn)("relative mx-auto flex w-full flex-col overflow-hidden md:flex-row",g,U.isHidden&&ed&&"border-2 border-red-500"),children:[(0,l.jsx)(V.AlertDialog,{open:et,onOpenChange:er,children:(0,l.jsxs)(V.AlertDialogContent,{className:"bg-white",children:[(0,l.jsxs)(V.AlertDialogHeader,{children:[(0,l.jsx)(V.AlertDialogTitle,{children:"Delete entry"}),(0,l.jsx)(V.AlertDialogDescription,{children:"Are you sure you want to delete this entry? This action cannot be undone."})]}),(0,l.jsxs)(V.AlertDialogFooter,{children:[(0,l.jsx)(V.AlertDialogCancel,{disabled:Q.isPending,children:"Cancel"}),(0,l.jsx)(V.AlertDialogAction,{className:"bg-red-600 text-white hover:bg-red-700",disabled:Q.isPending,onClick:()=>{null==H||H(U.id),Q.mutate({entryId:U.id},{onSuccess:()=>{(0,M.trackEvent)("entry_deleted",{feature:"earn",task_slug:o,entry_id:U.id,entry_type:U.entryType})},onError:e=>{(0,M.trackError)("entry_deletion_failed",e,{feature:"earn",task_slug:o,entry_id:U.id})},onSettled:()=>er(!1)})},children:Q.isPending?"Deletingâ¦":"Delete"})]})]})}),U.isHidden&&ed&&(0,l.jsxs)("div",{className:"absolute right-2 top-2 z-10 flex items-center gap-1 rounded-md bg-red-500 px-2 py-1 text-xs font-medium text-white",children:[(0,l.jsx)(p.A,{className:"h-3 w-3"}),"Hidden"]}),(0,l.jsx)(F,{entry:U,place:x,taskTitle:c,taskSlug:o,isLoggedIn:f,isSettled:h}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col p-4 md:h-[600px]",children:[(0,l.jsxs)("div",{className:"flex min-w-0 shrink-0 flex-col gap-4",children:[(0,l.jsx)($,{entry:U,place:x,isSettled:h,hideShare:y,taskTitle:c,taskPaidIn:u,isLoggedIn:f,isAdmin:ed,taskRewards:_,assignedPlaces:A,onPlaceSelect:R}),(0,l.jsx)(W,{entry:U})]}),!b&&(0,l.jsx)("div",{className:"mt-4 hidden min-h-0 flex-1 md:flex",children:(0,l.jsx)(J,{comments:(null==(a=U.commentsPreview)?void 0:a.slice(0,3))||[],onShowMore:eo})}),(0,l.jsx)("div",{className:"mt-4 shrink-0",children:(0,l.jsx)(Y,{entry:U,handleReview:()=>(0,r._)(function*(){if(!O){ee({entryId:U.id,entry:U},{taskSlug:o,entryId:U.id}),Z({title:"Sign in to vote",description:"Sign in to vote for entries and help determine the winners",redirectTo:window.location.pathname,onCancel:()=>{ea()}});return}U.userHasReviewed?K.mutate({entryId:U.id},{onSuccess:()=>{(0,M.trackEvent)("review_removed",{feature:"earn",task_slug:o,entry_id:U.id})},onError:e=>{(0,M.trackError)("review_removal_failed",e,{feature:"earn",task_slug:o,entry_id:U.id})}}):G.mutate({entryId:U.id},{onSuccess:()=>{(0,M.trackEvent)("review_submitted",{feature:"earn",task_slug:o,entry_id:U.id})},onError:e=>{(0,M.trackError)("review_submission_failed",e,{feature:"earn",task_slug:o,entry_id:U.id})}})})(),isOwnEntry:U.isOwnEntry,onDelete:()=>(0,r._)(function*(){U.isOwnEntry&&!Q.isPending&&er(!0)})(),isDeleting:Q.isPending,isActive:v,isSettled:h,onCommentClick:eo,onReviewsClick:()=>{N?N():q({entryId:U.id,taskSlug:o})},hideComments:b,hideCommentButton:w,isAdmin:ed,onToggleVisibility:()=>(0,r._)(function*(){if(ed&&!X.isPending){var e=U.isHidden?"Are you sure you want to make this entry visible to all users?":"Are you sure you want to hide this entry from non-admin users?";window.confirm(e)&&X.mutate({entryId:U.id})}})(),isTogglingVisibility:X.isPending})})]})]})]})})}},96829:(e,a,t)=>{t.d(a,{A:()=>r});var r=(0,t(61598).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},96967:(e,a,t)=>{t.d(a,{UC:()=>L,VY:()=>Z,ZD:()=>V,ZL:()=>H,bL:()=>P,hE:()=>U,hJ:()=>z,l9:()=>M,rc:()=>O});var r=t(81463),s=t(97320),n=t(62839),l=t(13356),i=t(81304),d=t(89994),o=t(60675),c=t(83969),m=t(72984),u=t(29152),f="AlertDialog",[x,p]=(0,i.A)(f,[o.Hs]),h=(0,o.Hs)(),v=e=>{var{__scopeAlertDialog:a}=e,t=(0,n._)(e,["__scopeAlertDialog"]),l=h(a);return(0,u.jsx)(o.bL,(0,s._)((0,r._)({},l,t),{modal:!0}))};v.displayName=f;var g=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t}=e,l=(0,n._)(e,["__scopeAlertDialog"]),i=h(t);return(0,u.jsx)(o.l9,(0,s._)((0,r._)({},i,l),{ref:a}))});g.displayName="AlertDialogTrigger";var y=e=>{var{__scopeAlertDialog:a}=e,t=(0,n._)(e,["__scopeAlertDialog"]),s=h(a);return(0,u.jsx)(o.ZL,(0,r._)({},s,t))};y.displayName="AlertDialogPortal";var b=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t}=e,l=(0,n._)(e,["__scopeAlertDialog"]),i=h(t);return(0,u.jsx)(o.hJ,(0,s._)((0,r._)({},i,l),{ref:a}))});b.displayName="AlertDialogOverlay";var w="AlertDialogContent",[j,N]=x(w),_=(0,m.Dc)("AlertDialogContent"),A=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t,children:i}=e,m=(0,n._)(e,["__scopeAlertDialog","children"]),f=h(t),x=l.useRef(null),p=(0,d.s)(a,x),v=l.useRef(null);return(0,u.jsx)(o.G$,{contentName:w,titleName:k,docsSlug:"alert-dialog",children:(0,u.jsx)(j,{scope:t,cancelRef:v,children:(0,u.jsxs)(o.UC,(0,s._)((0,r._)({role:"alertdialog"},f,m),{ref:p,onOpenAutoFocus:(0,c.mK)(m.onOpenAutoFocus,e=>{var a;e.preventDefault(),null==(a=v.current)||a.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,u.jsx)(_,{children:i}),(0,u.jsx)(T,{contentRef:x})]}))})})});A.displayName=w;var k="AlertDialogTitle",D=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t}=e,l=(0,n._)(e,["__scopeAlertDialog"]),i=h(t);return(0,u.jsx)(o.hE,(0,s._)((0,r._)({},i,l),{ref:a}))});D.displayName=k;var C="AlertDialogDescription",R=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t}=e,l=(0,n._)(e,["__scopeAlertDialog"]),i=h(t);return(0,u.jsx)(o.VY,(0,s._)((0,r._)({},i,l),{ref:a}))});R.displayName=C;var I=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t}=e,l=(0,n._)(e,["__scopeAlertDialog"]),i=h(t);return(0,u.jsx)(o.bm,(0,s._)((0,r._)({},i,l),{ref:a}))});I.displayName="AlertDialogAction";var E="AlertDialogCancel",S=l.forwardRef((e,a)=>{var{__scopeAlertDialog:t}=e,l=(0,n._)(e,["__scopeAlertDialog"]),{cancelRef:i}=N(E,t),c=h(t),m=(0,d.s)(a,i);return(0,u.jsx)(o.bm,(0,s._)((0,r._)({},c,l),{ref:m}))});S.displayName=E;var T=e=>{var{contentRef:a}=e,t="`".concat(w,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a de
1scription to the `").concat(w,"` by passing a `").concat(C,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in `").concat(w,"`. If the description is confusing or duplicative for sighted users, you can use the `@radix-ui/react-visually-hidden` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return l.useEffect(()=>{var e;document.getElementById(null==(e=a.current)?void 0:e.getAttribute("aria-describedby"))||console.warn(t)},[t,a]),null},P=v,M=g,H=y,z=b,L=A,O=I,V=S,U=D,Z=R}}]); 2//# sourceMappingURL=95121-c05915680f864a5f.js.map
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.