PageSourceSearch

https://www.purplebunny.ai/_next/static/chunks/4100-2e893f988f3ad5cd.js

js purplebunny.ai collected 2026-10-05 14:28:56 UTC 11,937 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4100],{6527:function(e,t,a){a.d(t,{Dx:function(){return d},P8:function(){return o},Xs:function(){return h},Zp:function(){return i},hA:function(){return c},jy:function(){return l},pi:function(){return x},v_:function(){return n}});var s=a(7066);let r="".concat("https://www.purplebunny.ai","/gamification"),n=async(e,t)=>{var a,n,l,c;let o=(await s.Z.get("".concat(r,"/status/").concat(t),{headers:{"Content-Type":"application/json",Authorization:e}})).data.data,i=o.xp_for_next_level||0,d=o.current_xp||0,x=(null===(a=o.weekly_progress)||void 0===a?void 0:a.goal)||3,h=(null===(n=o.weekly_progress)||void 0===n?void 0:n.current)||0;return{user_id:o.user_id,current_level:o.current_level||1,current_xp:d,total_xp:o.total_xp||0,xp_to_next_level:i,xp_progress_percent:i>0?Math.floor(d/i*100):0,current_streak:o.current_streak||0,longest_streak:o.longest_streak||0,last_activity_date:o.last_activity_date||null,weekly_sessions_goal:x,weekly_sessions_current:h,weekly_progress_percent:x>0?Math.floor(h/x*100):0,total_achievements_unlocked:o.total_achievements||0,total_sessions_completed:o.total_sessions||0,total_minutes_practiced:o.total_minutes||0,show_on_leaderboard:null===(l=o.show_on_leaderboard)||void 0===l||l,notifications_enabled:null===(c=o.notifications_enabled)||void 0===c||c,leaderboard_nickname:o.leaderboard_nickname||null}},l=async(e,t)=>(await s.Z.get("".concat(r,"/achievements/").concat(t),{headers:{"Content-Type":"application/json",Authorization:e}})).data.data,c=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(await s.Z.get("".concat(r,"/xp-history?limit=").concat(t,"&offset=").concat(a),{headers:{"Content-Type":"application/json",Authorization:e}})).data.data},o=async(e,t)=>(await s.Z.put("".concat(r,"/settings"),null,{headers:{"Content-Type":"application/json",Authorization:t},params:e})).data.data,i=async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return(await s.Z.get("".concat(r,"/leaderboard/").concat(e,"?limit=").concat(a),{headers:{"Content-Type":"application/json",Authorization:t}})).data.data},d=e=>{switch(e){case"bronze":return"text-orange-600";case"silver":return"text-gray-400";case"gold":return"text-yellow-500";case"platinum":return"text-purple-500";default:return"text-gray-600"}},x=e=>{switch(e){case"bronze":return"bg-orange-100 border-orange-300";case"silver":return"bg-slate-200 border-slate-400";case"gold":return"bg-yellow-100 border-yellow-300";case"platinum":return"bg-purple-100 border-purple-300";default:return"bg-gray-100 border-gray-300"}},h=e=>null==e?"0":e.toLocaleString()},6731:function(e,t,a){a.d(t,{Z:function(){return c}});var s=a(5893);a(7294);var r=a(5675),n=a.n(r);let l={releaseStage:"beta",alphaTag:{text:"ALPHA",bgClass:"bg-gradient-to-r from-purple-600 to-pink-600",textClass:"text-yellow-100 text-sm font-extrabold tracking-wider drop-shadow-sm",animation:"",rotation:"-rotate-12"},betaTag:{text:"BETA",bgClass:"bg-gradient-to-r from-purple-600 to-pink-600",textClass:"text-yellow-100 text-sm font-extrabold tracking-wider drop-shadow-sm",animation:"",rotation:"-rotate-12"}};function c(e){let{src:t,alt:a="PurpleBunny Logo",width:r,height:c,className:o="",onClick:i,priority:d=!1,showReleaseTag:x=!0,style:h}=e,{releaseStage:p,alphaTag:u,betaTag:m}=l,g={src:t,alt:a,width:r||120,height:c||60,className:o,priority:d,...i&&{onClick:i},...h&&{style:h}};if(!x||!p)return(0,s.jsx)("div",{className:"inline-block",children:(0,s.jsx)(n(),{...g})});let b="alpha"===p?u:m;return(0,s.jsxs)("div",{className:"relative flex items-center gap-0.5",children:[(0,s.jsx)(n(),{...g}),(0,s.jsx)("div",{className:"".concat(b.bgClass," ").concat(b.textClass," px-3 py-1.5 rounded-full shadow-lg transform ").concat(b.rotation," ").concat(b.animation," z-10 flex-shrink-0"),children:b.text})]})}},4100:function(e,t,a){a.d(t,{I:function(){return f}});var s=a(5893),r=a(3606),n=a(7294),l=a(1664),c=a.n(l),o=a(3950),i=a(4931),d=a(8654),x=a(56),h=a(4573),p=a(2201),u=a(3854),m=a(9481),g=a(6731),b=a(6527),v=a(4273);function f(e){let{isInConversation:t=!1}=e,{user:a}=(0,r.aF)(),{accessToken:l}=(0,v.a)(),{isSidebarOpen:f,setSidebarOpen:j}=(0,m.V)(),w=(0,n.useRef)(null),N=(0,n.useRef)(null),[y,_]=(0,n.use
1State)(!1),[k,Z]=(0,n.useState)(null),[C,S]=(0,n.useState)(null),z=e=>({platinum:4,gold:3,silver:2,bronze:1})[e]||0;return(0,n.useEffect)(()=>{(async()=>{if(a&&a.sub&&l)try{let e=await (0,b.v_)(l,a.sub);Z(e);let t=await (0,b.jy)(l,a.sub);if(t.unlocked.length>0){let e=[...t.unlocked].sort((e,t)=>{let a=z(t.tier)-z(e.tier);return 0!==a?a:t.xp_reward-e.xp_reward});S(e[0])}}catch(e){console.error("Error fetching gamification data:",e)}})()},[a,l]),(0,n.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&N.current&&!N.current.contains(e.target)&&_(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,s.jsxs)("div",{className:"text-chatgpt-text w-full px-4 py-2 flex justify-between items-start border-b border-chatgpt-border bg-white",children:[!f&&!t&&(0,s.jsx)(g.Z,{src:"/logo5c.png",className:"h-auto max-h-[60px] w-auto cursor-pointer",onClick:()=>j(!0)}),(f||t)&&(0,s.jsx)("div",{}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[a&&k&&(0,s.jsxs)(c(),{href:"/achievements",className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-chatgpt-border rounded-lg hover:bg-chatgpt-hover hover:border-bunny-300 transition-colors cursor-pointer",children:[C&&(0,s.jsx)("span",{className:"text-xl",title:C.name,children:C.icon}),(0,s.jsxs)("span",{className:"text-sm font-medium text-chatgpt-text",children:["Level ",k.current_level," • ",k.total_xp.toLocaleString()," XP"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 relative",children:[(0,s.jsxs)("button",{ref:N,onClick:()=>_(!y),className:"flex items-center gap-1 hover:bg-chatgpt-hover rounded-md p-1 transition-colors duration-200",children:[(null==a?void 0:a.picture)?(0,s.jsx)("img",{src:a.picture,className:"rounded-full h-10 w-10 object-cover",alt:"User profile",onError:e=>{let t=e.target;t.style.display="none";let a=t.parentElement;if(a){let e=document.createElement("div");e.className="rounded-full h-10 w-10 bg-gray-200 flex items-center justify-center",e.innerHTML='<svg class="w-6 h-6 text-gray-500" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd"></path></svg>',a.insertBefore(e,t)}}}):(0,s.jsx)("div",{className:"rounded-full h-10 w-10 bg-gray-200 flex items-center justify-center",children:(0,s.jsx)("svg",{className:"w-6 h-6 text-gray-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),(0,s.jsx)("svg",{className:"w-4 h-4 text-chatgpt-text transition-transform duration-200 ".concat(y?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&(0,s.jsxs)("div",{ref:w,className:"absolute right-0 mt-2 w-40 bg-white rounded-md shadow-sm border border-chatgpt-border py-1 z-[1001] top-full",children:[(0,s.jsx)("div",{children:(0,s.jsx)("p",{className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover",children:(0,s.jsxs)("b",{children:["Welcome, ",(null==a?void 0:a.given_name)||"User","!"]})})}),t?(0,s.jsx)("div",{className:"block px-4 py-2 text-base text-chatgpt-muted cursor-not-allowed",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(o.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Profile"})]})}):(0,s.jsx)(c(),{href:"/profile",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(o.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Profile"})]})}),t?(0,s.jsx)("div",{className:"block px-4 py-2 text-base text-chatgpt-muted cursor-not-allowed",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Documents"})]})}):(0,s.jsx)(c(),{href:"/documents",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Documents"})]})}),t?(0,s.jsx)("div",{className:"block px-4 py-2 text-base text-chatgpt-muted cursor-not-allowed",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Usage"})]})}):(0,s.jsx)(c(),{href:"/usage",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Usage"})]})}),t?(0,s.jsx)("div",{className:"block px-4 py-2 text-base text-chatgpt-muted cursor-not-allowed",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(x.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Achievements"})]})}):(0,s.jsx)(c(),{href:"/achievements",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(x.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Achievements"})]})}),!1,t?(0,s.jsx)("div",{className:"block px-4 py-2 text-base text-chatgpt-muted cursor-not-allowed",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(h.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Share"})]})}):(0,s.jsx)(c(),{href:"/share",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(h.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Share"})]})}),t?(0,s.jsx)("div",{className:"block px-4 py-2 text-base text-chatgpt-muted cursor-not-allowed",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Feedback"})]})}):(0,s.jsx)(c(),{href:"/feedback",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Feedback"})]})}),(0,s.jsx)("a",{href:"/api/auth/logout?returnTo=/&federated=true",className:"block px-4 py-2 text-base text-chatgpt-text hover:bg-chatgpt-hover transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"text-base",children:"Logout"})]})})]})]})]})]})}},9481:function(e,t,a){a.d(t,{V:function(){return n}});var s=a(1993),r=a(782);let n=(0,s.U)()((0,r.tJ)(e=>({isEditScreen:!1,isSaved:!0,isSidebarOpen:!0,selectedMenu:"agents",shouldDisconnectFlag:!1,setIsEditScreen:t=>e({isEditScreen:t}),setIsSaved:t=>e({isSaved:t}),setSidebarOpen:t=>e({isSidebarOpen:t}),setSelectedMenu:t=>e({selectedMenu:t}),setShouldDisconnectFlag:t=>e({shouldDisconnectFlag:t})}),{name:"screen-state-storage",partialize:e=>({isSidebarOpen:e.isSidebarOpen})}))}}]);

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.