PageSourceSearch

https://proofofship.web.app/_next/static/chunks/pages/campaigns-546f5fb0813747a8.js

js proofofship.web.app collected 2026-10-03 12:33:54 UTC 13,753 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6164],{59217:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/campaigns",function(){return a(91105)}])},20721:function(e,t,a){"use strict";a.d(t,{Z:function(){return d}});var s=a(85893),n=a(67294),r=a(6735),l=a(15307),i=a(85615),c=a(46162),o=a(30749);function d(e){var t,a,d,m,x;let{campaign:u,onJoin:g,showApplied:h=!1}=e,[p,b]=(0,n.useState)(!1),f=Math.ceil((new Date(u.deadline)-new Date)/864e5),v=f<=3,j=f<0,w=(null===(t=u.stats)||void 0===t?void 0:t.totalSubmissions)||0,y=u.maxSubmissions||50,N=Math.min(w/y*100,100);return(0,s.jsxs)(l.Zb,{className:"h-full flex flex-col overflow-hidden hover:shadow-lg transition-shadow",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[(0,s.jsxs)("div",{className:"p-4 pb-3",children:[(0,s.jsx)("h3",{className:"font-bold text-lg text-gray-900 dark:text-white mb-1 line-clamp-2",children:u.title}),(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 line-clamp-2",children:u.description})]}),(0,s.jsxs)("div",{className:"px-4 flex items-center gap-2 mb-3",children:[u.projectName&&(0,s.jsx)("span",{className:"text-xs px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded",children:u.projectName}),(null===(a=u.eligibility)||void 0===a?void 0:a.minLevel)&&(0,s.jsx)("span",{className:"text-xs px-2 py-1 rounded font-medium ".concat("expert"===u.eligibility.minLevel?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300":"intermediate"===u.eligibility.minLevel?"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300":"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300"),children:u.eligibility.minLevel.charAt(0).toUpperCase()+u.eligibility.minLevel.slice(1)})]}),(0,s.jsxs)("div",{className:"px-4 mb-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,s.jsx)("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Submissions"}),(0,s.jsxs)("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:[w,"/",y]})]}),(0,s.jsx)("div",{className:"w-full h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-blue-500 transition-all duration-300",style:{width:"".concat(N,"%")}})})]}),(0,s.jsx)("div",{className:"mx-4 my-3 h-px bg-gray-200 dark:bg-gray-700"}),(0,s.jsxs)("div",{className:"px-4 space-y-2 mb-4",children:[(null===(d=u.budget)||void 0===d?void 0:d.perSubmission)>0&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)(i.Z,{className:"w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0"}),(0,s.jsxs)("span",{className:"text-gray-700 dark:text-gray-300 font-medium",children:["$",u.budget.perSubmission.toLocaleString()," per submission"]}),u.budget.tokenAllocation>0&&(0,s.jsxs)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(+",u.budget.tokenAllocation,"% token)"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)(c.Z,{className:"w-4 h-4 flex-shrink-0 ".concat(j?"text-red-500":v?"text-orange-500":"text-gray-500 dark:text-gray-400")}),(0,s.jsx)("span",{className:"".concat(j?"text-red-600 dark:text-red-400 font-medium":v?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-700 dark:text-gray-300"),children:j?"Deadline passed":0===f?"Due today":"".concat(f," day").concat(1!==f?"s":""," left")})]})]}),h&&(0,s.jsx)("div",{className:"px-4 mb-3",children:(0,s.jsx)("div",{className:"text-xs px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded text-center",children:"✓ You applied"})}),(0,s.jsx)("div",{className:"px-4 mb-4",children:(0,s.jsxs)("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:[(null===(m=u.testScenarios)||void 0===m?void 0:m.length)||0," test scenario",(null===(x=u.testScenarios)||void 0===x?void 0:x.length)!==1?"s":""]})}),(0,s.jsx)("div",{className:"mx-4 mb-4 h-px bg-gray-200 dark:bg-gray-700"}),(0,s.jsx)("div",{className:"px-4 pb-4 mt-auto",children:(0,s.jsxs)(r.ZP,{onClick:()=>g&&g(u),variant:j?"disabled":"primary",disabled:j,className:"w-full flex items-center justify-center gap-2",children:[j?"Campaign Closed":h?"View Details":"Join Campaign",!j&&p&&(0,s.jsx)(o.Z,{className:"w-4 h-4"})]})})]})}},66284:function(e,t,a){"use strict";a.d(t,{TK:function(){return n}});var s=a(85893);a(67294);let n=e=>{let{size:t="medium",className:a=""}=e;return(0,s.jsx)("div",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-600 ".concat({small:"w-4 h-4",medium:"w-8 h-8",large:"w-12 h-12"}[t]," ").concat(a)})}},91105:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return f}});var s=a(85893),n=a(67294),r=a(9008),l=a.n(r),i=a(11163),c=a(71727);let o="activeCampaigns_cache";var d=a(28259),m=a(15307),x=a(6735),u=a(66284),g=a(20721),h=a(13431),p=a(80172),b=a(93069);function f(){let e=(0,i.useRouter)(),{currentUser:t}=(0,d.useAuth)(),{campaigns:a,loading:r,error:f,refresh:v}=function(){let{getCampaigns:e}
1=(0,c.Z)(),[t,a]=(0,n.useState)([]),[s,r]=(0,n.useState)(!0),[l,i]=(0,n.useState)(null),d=(0,n.useCallback)(()=>{var e;let t=null===(e=localStorage)||void 0===e?void 0:e.getItem(o);if(!t)return null;try{let{data:e,timestamp:a}=JSON.parse(t);if(Date.now()-a<3e5)return e}catch(e){console.warn("Cache parse error:",e)}return null},[]),m=(0,n.useCallback)(e=>{try{var t;null===(t=localStorage)||void 0===t||t.setItem(o,JSON.stringify({data:e,timestamp:Date.now()}))}catch(e){console.warn("Cache save error:",e)}},[]),x=(0,n.useCallback)(async()=>{r(!0),i(null);try{let t=await e({status:"open",sortBy:"deadline"});a(t||[]),m(t)}catch(e){console.error("Error loading campaigns:",e),i(e.message||"Failed to load campaigns")}finally{r(!1)}},[e,m]);return(0,n.useEffect)(()=>{let e=d();e&&(a(e),r(!1)),x()},[x,d]),{campaigns:t,loading:s,error:l,refresh:x}}(),[j,w]=(0,n.useState)(""),[y,N]=(0,n.useState)("newest"),k=(0,n.useMemo)(()=>{let e=a.filter(e=>{var t;let a=j.toLowerCase();return e.title.toLowerCase().includes(a)||e.description.toLowerCase().includes(a)||(null===(t=e.projectName)||void 0===t?void 0:t.toLowerCase().includes(a))});return e.sort((e,t)=>{switch(y){case"reward":return t.rewardAmount-e.rewardAmount;case"endDate":return new Date(e.endDate)-new Date(t.endDate);default:return new Date(t.createdAt)-new Date(e.createdAt)}}),e},[a,j,y]),C=a=>{if(!t){e.push("/login?redirectTo=/campaigns/".concat(a.id));return}e.push("/campaigns/".concat(a.id))};return f?(0,s.jsxs)("div",{className:"min-h-screen bg-gray-50 py-12",children:[(0,s.jsx)(l(),{children:(0,s.jsx)("title",{children:"Testing Campaigns"})}),(0,s.jsx)("div",{className:"max-w-6xl mx-auto px-4",children:(0,s.jsxs)(m.Zb,{className:"p-8 text-center",children:[(0,s.jsx)(h.Z,{className:"w-16 h-16 text-red-500 mx-auto mb-4"}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Failed to Load Campaigns"}),(0,s.jsx)("p",{className:"text-gray-600 mb-6",children:f}),(0,s.jsx)(x.ZP,{onClick:v,children:"Try Again"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:"Testing Campaigns - Earn by Testing"}),(0,s.jsx)("meta",{name:"description",content:"Discover and join testing campaigns to earn rewards"})]}),(0,s.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,s.jsxs)("div",{className:"mb-12",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,s.jsx)(p.Z,{className:"w-8 h-8 text-blue-600"}),(0,s.jsx)("h1",{className:"text-4xl font-bold text-gray-900",children:"Testing Campaigns"})]}),(0,s.jsx)("p",{className:"text-lg text-gray-600",children:"Discover active testing campaigns and earn rewards by finding bugs and providing feedback"})]}),!t&&(0,s.jsx)(m.Zb,{className:"mb-8 p-6 bg-blue-50 border border-blue-200",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-blue-900 mb-1",children:"Join the Testing Community"}),(0,s.jsx)("p",{className:"text-sm text-blue-800",children:"Sign in to submit your testing evidence and earn rewards"})]}),(0,s.jsx)(x.ZP,{onClick:()=>e.push("/login"),children:"Sign In"})]})}),(0,s.jsx)(m.Zb,{className:"mb-8 p-4",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Z,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,s.jsx)("input",{type:"text",placeholder:"Search campaigns by name or description...",value:j,onChange:e=>w(e.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Sort by:"}),(0,s.jsxs)("select",{value:y,onChange:e=>N(e.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[(0,s.jsx)("option",{value:"newest",children:"Newest First"}
1),(0,s.jsx)("option",{value:"reward",children:"Highest Reward"}),(0,s.jsx)("option",{value:"endDate",children:"Ending Soon"})]})]})]})}),r&&(0,s.jsx)("div",{className:"flex items-center justify-center py-24",children:(0,s.jsx)(u.TK,{size:"lg"})}),!r&&0===k.length&&(0,s.jsxs)(m.Zb,{className:"p-12 text-center",children:[(0,s.jsx)(p.Z,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:0===a.length?"No campaigns yet":"No matching campaigns"}),(0,s.jsx)("p",{className:"text-gray-600 mb-6",children:0===a.length?"Check back soon for new testing opportunities":"Try adjusting your search or filters"}),j&&(0,s.jsx)(x.ZP,{variant:"outline",onClick:()=>w(""),children:"Clear Search"})]}),!r&&k.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm text-gray-600 mb-4",children:[k.length," ",1===k.length?"campaign":"campaigns"," found"]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:k.map(e=>(0,s.jsx)(g.Z,{campaign:e,onJoin:C},e.id))})]})]})})]})}},30749:function(e,t,a){"use strict";var s=a(67294);let n=s.forwardRef(function(e,t){let{title:a,titleId:n,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},r),a?s.createElement("title",{id:n},a):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))});t.Z=n},46162:function(e,t,a){"use strict";var s=a(67294);let n=s.forwardRef(function(e,t){let{title:a,titleId:n,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},r),a?s.createElement("title",{id:n},a):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))});t.Z=n},85615:function(e,t,a){"use strict";var s=a(67294);let n=s.forwardRef(function(e,t){let{title:a,titleId:n,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},r),a?s.createElement("title",{id:n},a):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))});t.Z=n},93069:function(e,t,a){"use strict";var s=a(67294);let n=s.forwardRef(function(e,t){let{title:a,titleId:n,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},r),a?s.createElement("title",{id:n},a):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))});t.Z=n},80172:function(e,t,a){"use strict";var s=a(67294);let n=s.forwardRef(function(e,t){let{title:a,titleId:n,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},r),a?s.createElement("title",{id:n},a):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))});t.Z=n}},function(e){e.O(0,[4351,6809,2888,9774,179],function(){return e(e.s=59217)}),_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.