1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[22897],{8141:(e,t,a)=>{a.d(t,{_N:()=>n,yI:()=>r});let n="support-widget-unread-changed";function r(){window.dispatchEvent(new Event(n))}},21535:(e,t,a)=>{a.d(t,{Hb:()=>l,nj:()=>s,np:()=>r,xt:()=>o});var n=a(91262);let r=[{id:"under_review",label:"Under Review",dot:"#0f766e"},{id:"planned",label:"Planned",dot:"#2563eb"},{id:"in_progress",label:"In Progress",dot:"#7c3aed"},{id:"shipped",label:"Shipped",dot:"#15803d"}];function s(){return n.G.map(e=>({id:e.id,label:e.label,products:e.links.filter(e=>!e.adminOnly).map(t=>({id:t.id,label:t.label,href:t.href,groupId:e.id,groupLabel:e.label}))})).filter(e=>e.products.length>0)}r.map(e=>e.id);let i=s().flatMap(e=>e.products);function l(e){return i.find(t=>t.id===e)}function o(e){var t;let a;try{a=new URL(e,"http://local")}catch(e){return null}let n=null;for(let e of i){let t;try{t=new URL(e.href,"http://local")}catch(e){continue}if(!(a.pathname===t.pathname||a.pathname.startsWith("".concat(t.pathname,"/"))))continue;if(t.search){let e=!0;if(t.searchParams.forEach((t,n)=>{a.searchParams.get(n)!==t&&(e=!1)}),!e)continue}let r=t.pathname.length+100*!!t.search;(!n||r>n.score)&&(n={id:e.id,score:r})}return null!=(t=null==n?void 0:n.id)?t:null}},29081:(e,t,a)=>{a.d(t,{w:()=>o});var n=a(95155),r=a(12115),s=a(61011),i=a(16880);let l="upgraded_referral_processed";function o(e){let{children:t}=e,[a,o]=(0,r.useState)(null),[c,d]=(0,r.useState)(!0),[u,m]=(0,r.useState)(null),h=(0,s.createClient)(),x=(0,r.useCallback)(async e=>{if(sessionStorage.getItem(l))return;let t=(0,i.SO)();if(t)try{let e=await fetch("/api/referrals/process-signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({referralCode:t})}),a=await e.json();e.ok&&a.success&&a.bonusCredits>0&&(m({credits:a.bonusCredits,message:a.message||"You received ".concat(a.bonusCredits," bonus credits!")}),setTimeout(()=>m(null),1e4)),(0,i.H9)(),sessionStorage.setItem(l,"true")}catch(e){console.error("Error processing referral:",e)}},[]),p=(0,r.useCallback)(async e=>{if(sessionStorage.getItem("signup_notified_"+e.id))return;let t=new Date(e.created_at);if(!((new Date().getTime()-t.getTime())/6e4>5)){sessionStorage.setItem("signup_notified_"+e.id,"true");try{await fetch("/api/signup-notification",{method:"POST",headers:{"Content-Type":"application/json"}})}catch(e){console.error("Error sending signup notification:",e)}}},[]);return(0,r.useEffect)(()=>{let e=null;h.auth.getSession().then(t=>{var a;let{data:{session:n}}=t;o(e=null!=(a=null==n?void 0:n.user)?a:null),d(!1),(null==n?void 0:n.user)&&(x(n.user),fetch("/api/referrals/ensure-code",{method:"POST"}).catch(e=>console.error("Error ensuring referral code:",e)),p(n.user))});let{data:{subscription:t}}=h.auth.onAuthStateChange((t,a)=>{var n;let r=null===e;if(o(e=null!=(n=null==a?void 0:a.user)?n:null),d(!1),r&&(null==a?void 0:a.user)){x(a.user),fetch("/api/referrals/ensure-code",{method:"POST"}).catch(e=>console.error("Error ensuring referral code:",e)),p(a.user);{let e=sessionStorage.getItem("auth_redirect_to");e&&e!==window.location.pathname?(sessionStorage.removeItem("auth_redirect_to"),window.location.href=e):sessionStorage.removeItem("auth_redirect_to")}}});return()=>t.unsubscribe()},[h.auth,x,p]),(0,n.jsx)(n.Fragment,{children:t(a,c,u)})}},39561:(e,t,a)=>{a.d(t,{B:()=>et});var n=a(95155),r=a(12115),s=a(52619),i=a.n(s),l=a(20063),o=a(22670),c=a(70348),d=a(67909),u=a(24287),m=a(49537),h=a(10194),x=a(93216),p=a(17349),g=a(51915),f=a(36834),y=a(59893),b=a(13948),v=a(69240),w=a(32187),j=a(65361),N=a(42589),k=a(35821),C=a(86302),S=a(57218),E=a(41715),A=a(64516),T=a(77016),L=a(43569),M=a(93925),_=a(15239),F=a(83306),R=a(29632),I=a(45748);let U=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M12 0L14.59 8.41L23 11L14.59 13.59L12 22L9.41 13.59L1 11L9.41 8.41L12 0Z"})})};function q(e){var t;let{isOpen:a,onClose:s}=e,[i,l]=(0,r.useState)("main"),[o,c]=(0,r.useState)(null),[d,u]=(0,r.useState)([]),[h,x]=(0,r.useState)([]),[p,g]=(0,r.useState)(null),[f,y]=(0,r.useState)(null),[b,v]=(0,r.useState)(!1),[w,j]=(0,r.useState)(!0),[N,k]=(0,r.useState)(!1),[C,S]=(0,r.useState)(""),[E,A]=(0,r.useState)(""),[T,M]=(0,r.useState)(null),[_,F]=(0,r.useState)(null),[q,z]=(0,r.useState)(""),[O,G]=(0,r.useState)("credits"),[P,B]=(0,r.useState)(""),[D,V]=(0,r.useState)("");(0,r.useEffect)(()=>{a&&(H(),l("main"),F(null))},[a]);let W=async e=>{let t=("email"===e?C:E).trim();if(t&&!T){M(e),F(null);try{let a=await fetch("/api/referrals/invite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,to:t})}),n=await a.json().catch(()=>null);if(!a.ok)return void F({tone:"error",text:(null==n?void 0:n.error)||("email"===e?"Couldn't send the email":"Couldn't send the text")});
1"email"===e?S(""):A(""),F({tone:"success",text:"email"===e?"Invite sent to ".concat(t):"Text sent to ".concat(t)})}catch(t){F({tone:"error",text:"email"===e?"Couldn't send the email":"Couldn't send the text"})}finally{M(null)}}},H=async()=>{try{j(!0);let[s,i,l,o]=await Promise.all([fetch("/api/referrals/stats"),fetch("/api/referrals/my-referrals"),fetch("/api/referrals/reward-structures"),fetch("/api/referrals/preferences")]);if(s.ok){let e=await s.json();c(e)}if(i.ok){let e=await i.json();u(e.referrals||[])}if(l.ok){let e=await l.json();x(e.structures||[])}if(o.ok){var e,t,a,n,r;let s=await o.json();g(s.preferences),y((null==(e=s.preferences)?void 0:e.selectedRewardStructureId)||null),z((null==(t=s.preferences)?void 0:t.payoutCountry)||""),G((null==(a=s.preferences)?void 0:a.payoutMethod)||"credits"),B((null==(n=s.preferences)?void 0:n.payoutEmail)||""),V((null==(r=s.preferences)?void 0:r.payoutHandle)||"")}}catch(e){console.error("Error fetching referral data:",e)}finally{j(!1)}},Y=async()=>{if(null==o?void 0:o.inviteLink)try{await navigator.clipboard.writeText(o.inviteLink),v(!0),setTimeout(()=>v(!1),2e3)}catch(e){console.error("Error copying to clipboard:",e)}},J=async e=>{k(!0);try{(await fetch("/api/referrals/preferences",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedRewardStructureId:e,payoutCountry:q,payoutMethod:O,payoutEmail:P,payoutHandle:D})})).ok&&(y(e),l("main"))}catch(e){console.error("Error saving preferences:",e)}finally{k(!1)}},K=async()=>{k(!0);try{(await fetch("/api/referrals/preferences",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedRewardStructureId:f,payoutCountry:q,payoutMethod:O,payoutEmail:P,payoutHandle:D})})).ok&&l("main")}catch(e){console.error("Error saving payment details:",e)}finally{k(!1)}},Q=()=>f?h.find(e=>e.id===f):h.find(e=>e.isDefault)||h[0],Z=()=>{var e;let t=Q();if(!t)return{you:"You both get rewarded",them:"when they sign up",full:"You both get rewarded when they sign up through your link."};let a=t.name.toLowerCase().trim(),n=(null==(e=t.rewardType)?void 0:e.toLowerCase())||"";if(a.includes("free month")||a.includes("1 month"))return{you:"Give & Get 1 Month Free",them:"when they subscribe",full:"You both get 1 month of Upgraded Pro free when they subscribe."};if(a.includes("credits give-get")||a.includes("give")&&a.includes("get")&&a.includes("credit"))return{you:"You both get 10 credits",them:"when they publish a workflow",full:"You both get 10 credits when they publish their first workflow."};if(a.includes("welcome bonus")||a.includes("welcome"))return{you:"They get 10 credits instantly",them:"you get 10 on activation",full:"They get 10 credits on signup, you get 10 when they start using Upgraded."};if(a.includes("give-get equal")||a.includes("equal")||a.includes("instant"))return{you:"You both get 10 credits",them:"instantly on signup",full:"You both get 10 credits instantly when they sign up."};if(a.includes("milestone"))return{you:"Earn up to 20 credits",them:"at each milestone",full:"Earn credits at each stage: 5 at signup, 5 at activation, 10 at conversion."};if(a.includes("tiered")||a.includes("tier"))return{you:"Earn 10â15â20 credits",them:"more as you refer more",full:"Start at 10 credits, unlock 15 after 5 referrals, then 20 credits each."};if((a.includes("30%")||a.includes("30 "))&&(a.includes("off")||a.includes("discount")))return{you:"You earn 30% commission",them:"they get 30% off \xd7 3mo",full:"You earn 30% of what they spend. They get 30% off their first 3 months."};if(a.includes("20%")||a.includes("commission")||"commission_recurring"===n){let e=t.commissionPct||20;return{you:"Earn ".concat(e,"% of their spend"),them:"ongoing commission",full:"Earn ".concat(e,"% of everything they spend, paid as credits to your account.")}}if(t.commissionPct&&t.commissionPct>0)return{you:"Earn ".concat(t.commissionPct,"% commission"),them:"on their subscription",full:"Earn ".concat(t.commissionPct,"% of what your referrals spend.")};if(t.discountPct&&t.discountPct>0)return{you:"They get ".concat(t.discountPct,"% off"),them:"you get ".concat(t.referrerReward," credits"),full:"They get ".concat(t.discountPct,"% off, you get ").concat(t.referrerReward," credits.")};if(t.milestoneRewards&&Object.keys(t.milestoneRewards).length>0){let e=Object.values(t.milestoneRewards).reduce((e,t)=>
1e+t,0);return{you:"Earn up to ".concat(e," credits"),them:"at each milestone",full:"Earn credits at each stage as they progress through Upgraded."}}if(t.tierThresholds&&Object.keys(t.tierThresholds).length>0)return{you:"Unlock higher rewards",them:"as you refer more",full:"Earn more credits per referral as you hit referral milestones."};let r=t.referrerReward||0,s=t.refereeReward||0;return r===s&&r>0?{you:"You both get ".concat(r," credits"),them:"when they join",full:"You both get ".concat(r," credits when they sign up.")}:{you:r>0?"You get ".concat(r," credits"):"Earn rewards",them:s>0?"they get ".concat(s," credits"):"when they join",full:"You get ".concat(r," credits and they get ").concat(s," credits.")}};return a?"reward-settings"===i?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-lg w-full mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 p-5 border-b border-gray-100",children:[(0,n.jsx)("button",{onClick:()=>l("main"),className:"p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(R.A,{className:"h-5 w-5 text-gray-400"})}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Choose Reward"}),(0,n.jsx)("button",{onClick:s,className:"ml-auto p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(L.A,{className:"h-5 w-5 text-gray-400"})})]}),(0,n.jsx)("div",{className:"p-5 max-h-[60vh] overflow-y-auto",children:(0,n.jsx)("div",{className:"space-y-3",children:h.map(e=>(0,n.jsx)("button",{onClick:()=>J(e.id),disabled:N,className:"w-full p-4 text-left rounded-xl border transition-all ".concat(f===e.id||!f&&e.isDefault?"border-gray-900 bg-gray-50":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"),children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900",children:e.name}),(0,n.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description})]}),(f===e.id||!f&&e.isDefault)&&(0,n.jsx)(I.A,{className:"w-5 h-5 text-gray-900 flex-shrink-0 mt-0.5"})]})},e.id))})})]})]}):"payment-settings"===i?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 p-5 border-b border-gray-100",children:[(0,n.jsx)("button",{onClick:()=>l("main"),className:"p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(R.A,{className:"h-5 w-5 text-gray-400"})}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Payment Details"}),(0,n.jsx)("button",{onClick:s,className:"ml-auto p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(L.A,{className:"h-5 w-5 text-gray-400"})})]}),(0,n.jsxs)("div",{className:"p-5 space-y-5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:"Country"}),(0,n.jsxs)("select",{value:q,onChange:e=>z(e.target.value),className:"w-full px-3 py-2.5 border border-gray-200 rounded-xl focus:ring-2 focus:ring-gray-900/20 focus:border-gray-900 transition-colors bg-white",children:[(0,n.jsx)("option",{value:"",children:"Select country"}),(0,n.jsx)("option",{value:"US",children:"United States"}),(0,n.jsx)("option",{value:"CA",children:"Canada"}),(0,n.jsx)("option",{value:"GB",children:"United Kingdom"}),(0,n.jsx)("option",{value:"AU",children:"Australia"}),(0,n.jsx)("option",{value:"OTHER",children:"Other"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:"Payout Method"}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:["venmo","paypal","credits"].map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>G(e),className:"px-3 py-2.5 rounded-xl border text-sm font-medium transition-all ".concat(O===e?"border-gray-900 bg-gray-50 text-gray-900":"border-gray-200 text-gray-600 hover:border-gray-300"),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),"credits"!==O&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:"venmo"===O?"Venmo Handle":"PayPal Email"}),(0,n.jsx)("input",{type:"paypal"===O?"email":"text",value:"venmo"===O?D:P,onChange:e=>{"venmo"===O?V(e.target.value):B(e.target.value)},placeholder:"venmo"===O?"@username":"[email protected]",className:"w-full px-3 py-2.5 border border-gray-200 rounded-xl focus:ring-2 focus:ring-gray-900/20 focus:border-gray-900 transition-colors"})]}),"credits"===O&&(0,n.jsx)("p",{className:"text-sm text-gray-500 bg-gray-50 rounded-xl p-3",children:"Earnings will be automatically added to your credit balance."}),(0,n.jsx)("button",{onClick:K,disabled:N,className:"w-full py-3 bg-gray-900 text-white font-medium rounded-xl hover:bg-gray-800 transition-colors disabled:opacity-50",children:N?"Saving...":"Save"})]})]})]}):"referrals"===i?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 p-5 border-b border-gray-100",children:[(0,n.jsx)("button",{onClick:()=>l("main"),className:"p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(R.A,{className:"h-5 w-5 text-gray-400"})}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Your Referrals"}),(0,n.jsx)("button",{onClick:s,className:"ml-auto p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(L.A,{className:"h-5 w-5 text-gray-400"})})]}),o&&(0,n.jsx)("div",{className:"px-5 pt-4 pb-2",children:(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,n.jsxs)("div",{className:"text-center p-3 bg-gray-50 rounded-xl",children:[(0,n.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:o.stats.totalSignups}),(0,n.jsx)("div",{className:"text-xs text-gray-500",children:"Signups"})]}),(0,n.jsxs)("div",{className:"text-center p-3 bg-gray-50 rounded-xl",children:[(0,n.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:o.stats.totalConversions}),(0,n.jsx)("div",{className:"text-xs text-gray-500",children:"Converted"})]}),(0,n.jsxs)("div",{className:"text-center p-3 bg-gray-50 rounded-xl",children:[(0,n.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:o.creditsEarned}),(0,n.jsx)("div",{className:"text-xs text-gray-600",children:"Earned"})]})]})}),(0,n.jsx)("div",{className:"p-5 max-h-[50vh] overflow-y-auto",children:w?(0,n.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,n.jsx)("div",{className:"animate-spin h-6 w-6 border-2 border-gray-900 border-t-transparent roun
1ded-full"})}):0===d.length?(0,n.jsxs)("div",{className:"text-center py-12",children:[(0,n.jsx)("div",{className:"w-12 h-12 mx-auto mb-3 bg-gray-100 rounded-full flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-xl",children:"\uD83D\uDC4B"})}),(0,n.jsx)("p",{className:"text-gray-500 text-sm",children:"No referrals yet"}),(0,n.jsx)("p",{className:"text-gray-400 text-xs mt-1",children:"Share your link to get started"})]}):(0,n.jsx)("div",{className:"space-y-2",children:d.map(e=>(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-xl hover:bg-gray-50 transition-colors",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,n.jsx)("div",{className:"w-9 h-9 rounded-full bg-gradient-to-br from-gray-700 to-gray-900 flex items-center justify-center text-white text-sm font-medium flex-shrink-0",children:(e.email||e.displayName).charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e.email||e.displayName}),(0,n.jsx)("div",{className:"text-xs text-gray-400",children:new Date(e.signedUpAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(e=>{switch(e){case"converted":return(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-green-50 text-green-600",children:"Converted"});case"activated":return(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-blue-50 text-blue-600",children:"Active"});default:return(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-gray-100 text-gray-500",children:"Signed Up"})}})(e.status),e.creditsEarned>0&&(0,n.jsxs)("span",{className:"text-sm font-medium text-green-600",children:["+",e.creditsEarned]})]})]},e.userId))})})]})]}):"terms"===i?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 p-5 border-b border-gray-100",children:[(0,n.jsx)("button",{onClick:()=>l("main"),className:"p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(R.A,{className:"h-5 w-5 text-gray-400"})}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Terms & Conditions"}),(0,n.jsx)("button",{onClick:s,className:"ml-auto p-1 hover:bg-gray-100 rounded-lg transition-colors",children:(0,n.jsx)(L.A,{className:"h-5 w-5 text-gray-400"})})]}),(0,n.jsx)("div",{className:"p-5 max-h-[70vh] overflow-y-auto",children:(0,n.jsxs)("div",{className:"space-y-4 text-sm text-gray-700 leading-relaxed",children:[(0,n.jsx)("h3",{className:"font-semibold text-gray-900 mb-3",children:"General Referral Guidelines"}),(0,n.jsx)("p",{children:"This promotion is available to new Upgraded users who sign up through your link only - we want to share the Upgraded magic with fresh eyes and grow Upgraded community!"}),(0,n.jsx)("p",{children:"Rewards are earned once your invitee creates a new account and publishes an app. No credit for inactive or incomplete referrals will be granted."}),(0,n.jsx)("p",{children:"We do not grant credits to user with disposable or high-risk email accounts. All referral emails are checked by a third-party email reputation service to ensure high-quality participation and no referral fraud."}),(0,n.jsx)("p",{children:"Each new user can generate only one (1) reward. No stacking or loophole hunting."}),(0,n.jsx)("p",{children:"Please avoid spamming or misusing your referral link to get credits without bringing legitimate users to the platform. Our algorithms actively monitor referral engagement and alert us on unusual activity."}),(0,n.jsx)("p",{children:"If we detect suspicious or non-compliant activity, we have a right to withhold rewards or deactivate your referral link."}),(0,n.jsx)("p",{children:"We may update, pause, or discontinue this program at any time as we continue to experiment and improve."}),(0,n.jsxs)("p",{children:["For complete terms of service and referral rules, see"," ",(0,n.jsx)("a",{href:"https://getupgraded.ca/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-gray-900 underline hover:text-gray-700",children:"Upgraded Terms"}),"."]})]})})]})]}):(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-xl w-full mx-4 overflow-hidden",children:[(0,n.jsx)("button",{onClick:s,className:"absolute top-4 right-4 p-1 hover:bg-gray-100 rounded-lg transition-colors z-10","aria-label":"Close",children:(0,n.jsx)(L.A,{className:"h-5 w-5 text-gray-400"})}),(0,n.jsxs)("div",{className:"p-6 pt-8",children:[(0,n.jsxs)("div",{className:"relative mb-6",children:[(0,n.jsx)("div",{className:"absolute -top-2 right-0 w-28 h-28 opacity-90",children:(0,n.jsxs)("div",{className:"relative w-full h-full",children:[(0,n.jsx)("div",{className:"absolute top-0 right-0 w-16 h-16 bg-gradient-to-br from-purple-400 to-purple-500 rounded-full blur-sm"}),(0,n.jsx)("div",{className:"absolute top-4 right-8 w-12 h-12 bg-gradient-to-br from-pink-400 to-rose-400 rounded-full blur-sm"}
1),(0,n.jsx)("div",{className:"absolute top-8 right-2 w-10 h-10 bg-gradient-to-br from-orange-300 to-amber-400 rounded-full blur-sm"}),(0,n.jsx)(U,{className:"absolute top-6 right-10 w-6 h-6 text-white drop-shadow-lg"})]})}),(0,n.jsx)("h2",{className:"text-2xl font-bold text-gray-900 pr-24",children:"Invite a Friend"}),(0,n.jsx)("p",{className:"text-gray-900 font-medium mt-1",children:Z().you})]}),(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-gray-500 mb-3",children:"How it works:"}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-900 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),(0,n.jsx)("p",{className:"text-sm text-gray-700",children:"Share your unique referral link"})]}),(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-900 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),(0,n.jsx)("p",{className:"text-sm text-gray-700",children:"Your friend signs up and verifies their email"})]}),(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-900 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"})}),(0,n.jsxs)("p",{className:"text-sm text-gray-700",children:[(0,n.jsx)("span",{className:"font-semibold text-gray-900",children:Z().you})," â ",Z().them]})]})]})]}),(0,n.jsx)("div",{className:"mb-6",children:(0,n.jsxs)("button",{onClick:()=>l("referrals"),className:"w-full text-left text-sm text-gray-500 hover:text-gray-700 transition-colors flex items-center justify-between group",children:[(0,n.jsxs)("span",{children:["Your invite link has been used by ",(0,n.jsx)("strong",{className:"text-gray-700",children:(null==o?void 0:o.stats.totalSignups)||0})," user",(null==o?void 0:o.stats.totalSignups)!==1?"s":"",", viewed ",(0,n.jsx)("strong",{className:"text-gray-700",children:(null==o?void 0:o.stats.totalClicks)||0})," time",(null==o?void 0:o.stats.totalClicks)!==1?"s":""]}),(0,n.jsx)(m.A,{className:"w-4 h-4 opacity-0 group-hover:opacity-100 transition-opacity"})]})}),(0,n.jsxs)("div",{className:"mb-6 space-y-2.5",children:[(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),W("email")},className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"email",inputMode:"email",autoComplete:"email",value:C,onChange:e=>S(e.target.value),placeholder:"[email protected]","aria-label":"Friend's email",className:"min-w-0 flex-1 px-3 py-2.5 text-sm border border-gray-200 rounded-xl focus:ring-2 focus:ring-gray-900/20 focus:border-gray-900 transition-colors"}),(0,n.jsx)("button",{type:"submit",disabled:!C.trim()||null!==T,className:"px-4 py-2.5 bg-gray-900 text-white text-sm font-medium rounded-xl hover:bg-gray-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"email"===T?"Sendingâ¦":"Send"})]}),(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),W("sms")},className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"tel",inputMode:"tel",autoComplete:"tel",value:E,onChange:e=>A(e.target.value),placeholder:"Phone number","aria-label":"Friend's phone number",className:"min-w-0 flex-1 px-3 py-2.5 text-sm border border-gray-200 rounded-xl focus:ring-2 focus:ring-gray-900/20 focus:border-gray-900 transition-colors"}),(0,n.jsx)("button",{type:"submit",disabled:!E.trim()||null!==T,className:"px-4 py-2.5 bg-white text-gray-900 text-sm font-medium rounded-xl border border-gray-200 hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"sms"===T?"Sendingâ¦":"Text"})]}),_&&(0,n.jsx)("p",{className:"text-sm ".concat("success"===_.tone?"text-green-600":"text-red-600"),children:_.text})]}),(0,n.jsx)("div",{className:"mb-6",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 rounded-xl border border-gray-100",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),(0,n.jsx)("span",{className:"text-sm text-gray-600 truncate flex-1 font-mono",children:w?"Loading...":(null==o?void 0:o.inviteLink)||"No link available"}),(0,n.jsxs)("button",{onClick:Y,disabled:w||!(null==o?void 0:o.inviteLink),className:"flex items-center gap-1.5 px-3 py-1.5 bg-gray-900 text-white text-sm font-medium rounded-lg hover:bg-gray-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),b?"Copied!":"Copy"]})]})}),(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 mb-6",children:[(0,n.jsx)("button",{onClick:()=>
1{if(!(null==o?void 0:o.inviteLink))return;let e=encodeURIComponent("I've been using Upgraded to automate workflows with AI. Sign up with my link and we both get 1 free month! \uD83D\uDE80"),t=encodeURIComponent(o.inviteLink);window.open("https://twitter.com/intent/tweet?text=".concat(e,"&url=").concat(t),"_blank")},disabled:w||!(null==o?void 0:o.inviteLink),className:"p-2.5 rounded-full border border-gray-200 hover:bg-gray-50 hover:border-gray-300 transition-all disabled:opacity-50",title:"Share on X",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),(0,n.jsx)("button",{onClick:()=>{if(!(null==o?void 0:o.inviteLink))return;let e=encodeURIComponent("Get 1 free month of Upgraded"),t=encodeURIComponent("Hey!\n\nI've been using Upgraded to automate workflows with AI. Sign up with my link and we both get 1 free month!\n\n".concat(o.inviteLink,"\n\nCheers!"));window.location.href="mailto:?subject=".concat(e,"&body=").concat(t)},disabled:w||!(null==o?void 0:o.inviteLink),className:"p-2.5 rounded-full border border-gray-200 hover:bg-gray-50 hover:border-gray-300 transition-all disabled:opacity-50",title:"Share via Email",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),(0,n.jsx)("button",{onClick:()=>{if(!(null==o?void 0:o.inviteLink))return;let e=encodeURIComponent(o.inviteLink);window.open("https://www.linkedin.com/sharing/share-offsite/?url=".concat(e),"_blank")},disabled:w||!(null==o?void 0:o.inviteLink),className:"p-2.5 rounded-full border border-gray-200 hover:bg-gray-50 hover:border-gray-300 transition-all disabled:opacity-50",title:"Share on LinkedIn",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"})})}),"undefined"!=typeof navigator&&navigator.share&&(0,n.jsx)("button",{onClick:()=>{(null==o?void 0:o.inviteLink)&&navigator.share({title:"Get 1 free month of Upgraded",text:"Sign up with my link and we both get 1 free month!",url:o.inviteLink})},disabled:w||!(null==o?void 0:o.inviteLink),className:"p-2.5 rounded-full border border-gray-200 hover:bg-gray-50 hover:border-gray-300 transition-all disabled:opacity-50",title:"More options",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})})})]})]}),(0,n.jsxs)("div",{className:"px-6 py-4 border-t border-gray-100 flex items-center justify-between",children:[(0,n.jsxs)("button",{onClick:()=>l("reward-settings"),className:"text-sm text-gray-400 hover:text-gray-600 transition-colors flex items-center gap-1",children:[(null==(t=Q())?void 0:t.name)||"Change reward",(0,n.jsx)(m.A,{className:"w-3 h-3"})]}),(0,n.jsx)("button",{onClick:()=>l("terms"),className:"text-sm text-gray-400 hover:text-gray-600 transition-colors underline",children:"View Terms & Conditions"})]})]})]}):null}var z=a(90909),O=a(61011),G=a(92959),P=a(46660),B=a(57677),D=a(91262),V=a(20218);let W=(0,d.default)(()=>Promise.all([a.e(4251),a.e(18720),a.e(1919),a.e(99612),a.e(33589),a.e(7032),a.e(41463)]).then(a.bind(a,56353)).then(e=>e.SettingsModal),{loadableGenerated:{webpack:()=>[56353]},ssr:!1}),H={width:1757,height:410};function Y(e,t){var a,n;return t||((null==(a=e.user_metadata)?void 0:a.avatar_url)?e.user_metadata.avatar_url:(null==(n=e.user_metadata)?void 0:n.picture)?e.user_metadata.picture:null)}function J(e){let t=Math.abs(e);if(t>=1e3){let a=t>=1e6,n=t/(a?1e6:1e3),r=n>=100?Math.round(n):Math.round(10*n)/10,s=Number.isInteger(r)?String(r):r.toFixed(1);return"".concat(e<0?"-":"").concat(s).concat(a?"m":"k")}return Number.isInteger(e)?String(e):e.toFixed(2)}function K(e){return"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left text-[14px] font-medium tracking-[-0.011em] transition-colors duration-100 cursor-pointer ".concat(e?"text-gray-100 hover:bg-white/[0.06]":"text-gray-800 hover:bg-gray-900/[0.045]")}function Q(e){return"h-[18px] w-[18px] shrink-0 ".concat(e?"text-gray-400":"text-gray-500")}function Z(e){let{keys:t,className:a="",tone:r="nav"}=e;return 0===t.length?null:(0,n.jsx)("span",{className:"pointer-events-none absolute right-1.5 top-1/2 z-10 hidden -translate-y-1/2 items-center gap-0.5 pl-1 group-hover:flex ".concat({nav:"bg-[#F5F5F4] group-hover:bg-[#eee] group-aria-[current=page]:bg-[#e8e7e5] dark:bg-gray-950 dark:group-aria-[current=page]:bg-gray-900",panel:"bg-white group-hover:bg-[#f6f6f5] group-aria-[current=page]:bg-[#f3f3f2] dark:bg-gray-950",chat:"bg-[#e7e7e5] group-hover:bg-[#dededd] dark:bg-gray-800"}[r]," ").concat(a),children:t.map((e,t)=>(0,n.jsx)("kbd",{className:"inline-flex h-4 min-w-4 items-center justify-center rounded border border-[#e5e5e3] bg-white/95 px-1 text-[10px] font-medium leading-none text-gray-400 shadow-sm dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300",children:e},"".concat(e,"-").concat(t)))})}function X(e){let{isDark:t}=e;return(0,n.jsx)("div",{className:"my-1 h-px ".concat(t?"bg-white/10":"bg-[#ececea]")})}function $(e){let{isDark:t,actions:a,onClose:s}=e,[l,o]=(0,r.useState)(!1),c=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{c.current&&window.clearTimeout(c.current)},[]);let d=()=>{c.current&&window.clearTimeout(c.current),o(!0)},p=K(t),g=Q(t);return(0,n.jsxs)("div",{className:"relative px-1.5",onMouseEnter:d,onMouseLeave:()=>{c.current=window.setTimeout(()=>
1o(!1),140)},children:[(0,n.jsxs)("button",{type:"button",onClick:d,"aria-haspopup":"menu","aria-expanded":l,className:p,children:[(0,n.jsx)(u.A,{className:g}),(0,n.jsx)("span",{className:"flex-1",children:"Admin"}),(0,n.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 ".concat(t?"text-gray-500":"text-gray-400")})]}),l&&(0,n.jsx)("div",{className:"absolute bottom-0 left-full z-30 pl-1.5",children:(0,n.jsxs)("div",{role:"menu",className:"min-w-[220px] overflow-hidden rounded-xl border p-1.5 shadow-[0_12px_40px_rgba(0,0,0,0.12)] ".concat(t?"border-white/10 bg-gray-900":"border-[#e5e5e3] bg-white"),children:[(0,n.jsxs)(i(),{href:"/users",onClick:s,className:p,role:"menuitem",children:[(0,n.jsx)(h.A,{className:g}),"Users"]}),(0,n.jsxs)(i(),{href:"/dev/usage",onClick:s,className:p,role:"menuitem",children:[(0,n.jsx)(x.A,{className:g}),"Usage & Tokens"]}),a.map(e=>{let{label:t,icon:a,onSelect:r}=e;return(0,n.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{s(),r()},className:p,children:[(0,n.jsx)(a,{className:g}),t]},t)})]})})]})}function ee(e){let{isDark:t,placement:a,email:r,credits:s,supportHref:l,supportWaiting:c,supportLive:d,isAdmin:u,actions:m,onClose:h,onOpenSettings:x,onSignOut:k}=e,C=K(t),S=Q(t);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-10 cursor-pointer",onClick:h}),(0,n.jsxs)("div",{role:"menu",className:"".concat("side"===a?"absolute bottom-full left-full z-20 mb-2 ml-2 w-[280px]":"absolute bottom-full left-0 z-20 mb-2 w-[280px]"," rounded-xl border py-1.5 shadow-[0_12px_40px_rgba(0,0,0,0.12)] ").concat(t?"border-white/10 bg-gray-900":"border-[#e5e5e3] bg-white"),children:[r&&(0,n.jsx)("div",{className:"truncate px-3.5 pb-1.5 pt-1 text-[13px] ".concat(t?"text-gray-400":"text-gray-500"),children:r}),s&&(0,n.jsx)("div",{className:"px-1.5",children:(0,n.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg px-2 py-2",children:[(0,n.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ".concat(t?"bg-white/10":"bg-[#f4f4f2]"),children:(0,n.jsx)(p.A,{className:"h-4 w-4 text-amber-500"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"truncate text-[14px] font-medium tracking-[-0.011em] ".concat(t?"text-white":"text-gray-900"),children:[s.tier," plan"]}),(0,n.jsxs)("div",{className:"truncate text-[12px] ".concat(t?"text-gray-400":"text-gray-500"),children:[J(s.monthlyUsage)," / ",J(s.monthlyLimit)," this month"]})]}),(0,n.jsx)("span",{className:"shrink-0 text-[13px] font-medium tabular-nums ".concat(t?"text-gray-200":"text-gray-700"),children:J(s.totalAvailable)})]})}),(0,n.jsx)(X,{isDark:t}),(0,n.jsxs)("div",{className:"px-1.5",children:[(0,n.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>x("account"),className:C,children:[(0,n.jsx)(g.A,{className:S}),"Settings"]}),(0,n.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>x("activity"),className:C,children:[(0,n.jsx)(f.A,{className:S}),"Activity"]}),(0,n.jsxs)(i(),{href:"/pricing",role:"menuitem",onClick:e=>{(0,o.M)(e)||h()},className:C,children:[(0,n.jsx)(y.A,{className:S}),"Upgrade plan"]})]}),(0,n.jsx)(X,{isDark:t}),(0,n.jsxs)("div",{className:"px-1.5",children:[(0,n.jsxs)(i(),{href:l,role:"menuitem",onClick:h,className:C,children:[(0,n.jsx)(D.m,{className:S}),(0,n.jsx)("span",{className:"flex-1",children:"Support"}),(0,n.jsx)(B.n,{waiting:c,live:d})]}),(0,n.jsxs)(i(),{href:"/models",role:"menuitem",onClick:h,className:C,children:[(0,n.jsx)(b.A,{className:S}),"AI Models"]}),(0,n.jsxs)(i(),{href:"/prompt",role:"menuitem",onClick:e=>{(0,o.M)(e)||h()},className:C,children:[(0,n.jsx)(v.A,{className:S}),"Brain AI"]}),(0,n.jsxs)(i(),{href:"/feedback",role:"menuitem",onClick:h,className:C,children:[(0,n.jsx)(w.A,{className:S}),"Feedback"]}),(0,n.jsxs)(i(),{href:"/roadmap",role:"menuitem",onClick:h,className:C,children:[(0,n.jsx)(j.A,{className:S}),"Roadmap"]})]}),u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{isDark:t}),(0,n.jsx)($,{isDark:t,actions:m,onClose:h})]}),(0,n.jsx)(X,{isDark:t}),(0,n.jsx)("div",{className:"px-1.5",children:(0,n.jsxs)("button",{type:"button",role:"menuitem",onClick:k,className:C,children:[(0,n.jsx)(N.A,{className:S}),"Sign out"]})})]})]})}function et(e){var t,a,s,d;let{user:u,activeTab:x,onTabChange:g,onUpgradeClick:f,userEmail:y,userName:b,sidebarOpen:v=!1,onToggleSidebar:N,useCaseListVisible:R=!1,onToggleUseCaseList:I,isCollapsed:U,onCollapseChange:J}=e,K=(0,l.useRouter)(),Q=(0,l.usePathname)(),X=(0,O.createClient)(),[$,et]=(0,r.useState)(!1),[ea]=(0,r.useState)(!1),[en,er]=(0,r.useState)(!1),[es,ei]=(0,r.useState)(!1),[el,eo]=(0,r.useState)(!1),[ec,ed]=(0,r.useState)("account"),[eu,em]=(0,r.useState)(!1),[eh,ex]=(0,r.useState)(null),[ep,eg]=(0,r.useState)(!0),[ef,ey]=(0,r.useState)("light"),[eb,ev]=(0,r.useState)(null),[ew,ej]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{"compact"===window.localStorage.getItem("sidebar-upgrade-card")&&ej(!0)}catch(e){}},[]),(0,r.useEffect)(()=>{let e=localStorage.getItem("app-theme");e&&(ey(e),"dark"===e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"))},[]);let eN=e=>{ey(e),localStorage.setItem("app-theme",e),"dark"===e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),window.dispatchEvent(new CustomEvent("themeChanged",{detail:{theme:e}}))};(0,r.useEffect)(()=>
1{if(u){let e=setTimeout(()=>{eC(),ek()},3e3),t=setInterval(eC,6e4),a=()=>eC(),n=()=>ek();window.addEventListener("creditsUpdated",a),window.addEventListener("profileUpdated",n);let r=()=>{ed("integrations"),eo(!0)};return window.addEventListener("openSettingsIntegrations",r),()=>{clearTimeout(e),clearInterval(t),window.removeEventListener("creditsUpdated",a),window.removeEventListener("openSettingsIntegrations",r),window.removeEventListener("profileUpdated",n)}}},[u]),(0,r.useEffect)(()=>{let e=()=>et(!0),t=()=>{ed("account"),eo(!0)};return window.addEventListener("openFeedback",e),window.addEventListener("openSettings",t),()=>{window.removeEventListener("openFeedback",e),window.removeEventListener("openSettings",t)}},[]);let ek=async()=>{try{let e=await fetch("/api/settings/profile");if(e.ok){let t=await e.json();ev(t.avatar_url||null)}}catch(e){console.error("Error fetching profile:",e)}},eC=async()=>{try{let e=await fetch("/api/credits");if(e.ok){let t=await e.json();ex(t)}}catch(e){console.error("Error fetching credits:",e)}finally{eg(!1)}},eS=void 0!==U?U:eu,eE=e=>{J?J(e):em(e),e&&N&&N(!1)},eA=async()=>{await X.auth.signOut(),window.location.href="/auth"},eT=()=>{ei(!0)},eL=()=>{window.location.href="/chat"},eM=()=>{window.dispatchEvent(new CustomEvent("openCommandPalette"))},e_=()=>{window.dispatchEvent(new CustomEvent("openShortcuts"))},eF=[{label:"Create with Chat",icon:k.A,onSelect:()=>{K.push("/chat?message=".concat(encodeURIComponent("Hey Upgraded AI, I want to create a new automation recipe. Here are some examples to guide you:\n\n**Example 1: Daily Email Digest**\n- What it does: Send me a daily digest of unread Gmail emails\n- Apps: Gmail\n- Inputs: Email address, Time of day\n- Output: Summary email sent\n\n**Example 2: GitHub to Slack Notifications**\n- What it does: Post GitHub issues to Slack channel\n- Apps: GitHub, Slack\n- Inputs: GitHub repository, Slack channel\n- Output: Slack message posted\n\n**Example 3: Dropbox to Trello Automation**\n- What it does: When a new file is added in Dropbox, create a Trello card and notify Slack\n- Apps: Dropbox, Trello, Slack\n- Inputs: Dropbox folder path, Trello board/list, Slack channel\n- Output: Trello card created + Slack notification sent\n\n**Example 4: Notion to Google Sheets Sync**\n- What it does: Save new Notion pages to Google Sheets\n- Apps: Notion, Google Sheets\n- Inputs: Notion database, Google Sheet URL\n- Output: New row added to spreadsheet\n\nPlease guide me through creating a recipe. Ask me one question at a time:\n1. What should this recipe do? (describe the automation goal)\n2. Which apps are involved?\n3. What inputs should it need?\n4. What should the output be?\n\n**Important:** As soon as you have the recipe name, description, and at least one app, create the recipe in the database immediately using CREATE_RECIPE tool. Don't wait for all details - create a draft recipe early, then we can refine it and build the workflow code together.")))}},{label:"Create with Social",icon:C.A,onSelect:()=>{K.push("/ai-responsibilities")}},{label:"Create with Form",icon:S.A,onSelect:()=>{K.push("/ai-responsibilities")}}],eR=(0,r.useRef)(!1),eI=(0,r.useCallback)(()=>{eR.current||"ai-inbox"===x||(eR.current=!0,fetch("/api/inbox/init").catch(()=>{}),fetch("/api/inbox/chats?channel=all&view=conversations&limit=50").catch(()=>{}))},[x]),eU="transform-gpu hover:scale-[1.03] active:scale-[0.98]",eq="dark"===ef,ez=(e,t)=>{let a=e?eq?"bg-white/[0.10] text-white":"bg-gray-900/[0.07] text-gray-900":"collapsed"===t?eq?"text-gray-400 hover:bg-white/[0.06] hover:text-gray-100":"text-gray-500 hover:bg-gray-900/[0.05] hover:text-gray-900":eq?"text-gray-300 hover:bg-white/[0.05] hover:text-gray-100":"text-gray-600 hover:bg-gray-900/[0.04] hover:text-gray-900";return"".concat("expanded"===t?"group relative w-full flex items-center gap-x-2.5 whitespace-nowrap rounded-md px-2.5 py-1.5 text-[13.5px] font-medium tracking-[-0.011em] transition-colors duration-100 cursor-pointer":"group relative flex size-10 items-center justify-center rounded-lg transition-colors duration-100 cursor-pointer"," ").concat(a)},eO=e=>{let{show:t}=e;
1return t?(0,n.jsx)("span",{"aria-hidden":!0,className:"absolute left-0 top-1/2 h-5 w-[3px] -translate-y-1/2 rounded-r-full ".concat(eq?"bg-white/70":"bg-gray-900/70")}):null},eG=e=>"flex items-center justify-center rounded-lg p-2 transition-colors duration-150 cursor-pointer ".concat(e?eq?"bg-white/[0.10] text-white":"bg-gray-900/[0.065] text-gray-900":eq?"text-gray-500 hover:bg-white/[0.05] hover:text-gray-200":"text-gray-500 hover:bg-gray-900/[0.04] hover:text-gray-900"),eP="animate-in fade-in motion-reduce:animate-none",eB=e=>({animationDelay:"".concat(30*e,"ms"),animationDuration:"200ms",animationFillMode:"backwards"}),eD=(0,G.Z)(null==u?void 0:u.email),{waiting:eV,live:eW}=(0,B.s)(!!u),eH=eV>0?"/support-widget?tab=conversations":"/support-widget",[eY,eJ]=(0,r.useState)(null),[eK,eQ]=(0,r.useState)(null),[eZ,eX]=(0,r.useState)({}),[e$,e0]=(0,r.useState)(null),[e1,e2]=(0,r.useState)(!1),[e5,e4]=(0,r.useState)(!1),e3=(0,r.useRef)(!1),e6=(0,r.useRef)(null),e9=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=new URLSearchParams(window.location.search);eJ(Q.startsWith("/ai-content-calendar")?e.get("tab"):null),eQ(Q.startsWith("/ai-inbox")?e.get("panel"):null)},[Q]),(0,r.useEffect)(()=>{let e=e=>{var t;eJ(null!=(t=e.detail)?t:null)},t=e=>{var t;eQ(null!=(t=e.detail)?t:null)};return window.addEventListener("content-os-tab",e),window.addEventListener("inbox-panel",t),()=>{window.removeEventListener("content-os-tab",e),window.removeEventListener("inbox-panel",t)}},[]),(0,r.useEffect)(()=>{try{let e={};for(let t of D.G)e[t.id]="0"!==window.localStorage.getItem("sidebar-group-".concat(t.id));eX(e)}catch(e){}},[]);let e8=(0,r.useCallback)(e=>"content-community"===e.id?"ai-content-calendar"===x&&"paperboy"===eY:"content-newsletter"===e.id?"ai-content-calendar"===x&&"newsletters"===eY:"content-social"===e.id?"ai-content-calendar"===x&&"paperboy"!==eY&&"newsletters"!==eY:"revenue-sequences"===e.id?"sequences"===x||"ai-inbox"===x&&"sequences"===eK:"revenue-bdr"===e.id?"ai-inbox"===x&&"sequences"!==eK:e.activeTab?x===e.activeTab:Q===e.href.split("?")[0],[x,eY,eK,Q]),e7=null!=(d=null==(t=D.G.find(e=>e.links.some(e8)))?void 0:t.id)?d:null;(0,r.useEffect)(()=>{e7&&eX(e=>!1===e[e7]?{...e,[e7]:!0}:e)},[e7]);let te=()=>{null!=e6.current&&(window.clearTimeout(e6.current),e6.current=null)},tt=e=>{te(),e0(e),e2(!0)},ta=()=>{te(),e6.current=window.setTimeout(()=>{e3.current||e2(!1)},120)},tn=()=>{te(),e3.current=!1,e4(!1),e2(!1)};(0,r.useEffect)(()=>{eS||tn()},[eS]),(0,r.useEffect)(()=>{if(e1||e5)return;let e=window.setTimeout(()=>e0(null),200);return()=>window.clearTimeout(e)},[e1,e5]),(0,r.useEffect)(()=>{if(!e1)return;let e=e=>{"Escape"===e.key&&tn()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[e1]),(0,r.useEffect)(()=>{if(!e5)return;let e=e=>{var t,a;let n=e.target;if(!(n instanceof Node)||(null==(t=e9.current)?void 0:t.contains(n)))return;let r=null==(a=e9.current)?void 0:a.parentElement;null!=r&&r.contains(n)||tn()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[e5]),(0,r.useEffect)(()=>()=>te(),[]);let tr=e=>"revenue-support"===e.id?eH:e.href,[ts,ti]=(0,r.useState)(!1),tl=(0,r.useRef)(null);return(0,r.useEffect)(()=>{ti((0,c.J1)())},[]),(0,n.jsxs)("div",{style:{fontFamily:'"SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif',letterSpacing:"-0.011em",fontFeatureSettings:'"cv02", "cv03", "cv04", "cv11"',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},className:"flex h-screen flex-col border-r fixed left-0 top-0 z-50 overflow-visible sidebar-slide-anim ".concat(eS?"w-16":"w-64"," ").concat(eq?"bg-gray-950 border-white/10":"bg-[#F5F5F4] border-[#e7e5e4]"),children:[(0,n.jsx)("div",{className:"relative flex shrink-0 flex-col ".concat(eS?"px-0":"px-4"),children:(0,n.jsx)("div",{className:"flex items-center ".concat(eS?"justify-center py-3":"justify-between gap-2 px-1 pb-2 pt-5"),children:eS?(0,n.jsxs)("div",{className:"relative group",children:[(0,n.jsx)(i(),{href:"/",className:"hover:opacity-80 transition-opacity",children:(0,n.jsx)(_.default,{src:"/palm-tree-transparent.png",alt:"Upgraded",width:24,height:24,className:"h-7 w-7 object-contain",unoptimized:!0})}),(0,n.jsx)("button",{onClick:()=>{(0,c.y1)(),eE(!1)},className:"pointer-events-none absolute inset-0 flex cursor-pointer items-center justify-center rounded-md opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100 ".concat(eq?"bg-gray-950/90 text-white":"bg-[#F5F5F4]/95 text-gray-900"),"aria-label":"Expand sidebar",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"cursor-pointer text-gray-900",children:[(0,n.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"15",x2:"15",y1:"3",y2:"21"})]})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i(),{href:"/",className:"min-w-0 flex-1 cursor-pointer hover:opacity-80 transition-opacity ".concat(eP),style:eB(0),children:(0,n.jsx)(_.default,{src:eq?"/Upgraded-Logo-White.png":"/Upgraded-Logo-Light.png",alt:"Upgraded",width:H.width,height:H.height,className:"h-auto w-full object-contain object-left",unoptimized:!0})}),(0,n.jsx)("button",{type:"button",onClick:()=>{(0,c.Gm)(),eE(!0)},className:"shrink-0 cursor-pointer rounded-md p-2 transition duration-100 ease-linear ".concat(eq?"text-gray-400 hover:bg-white/10 hover:text-white":"text-gray-400 hover:bg-gray-50 hover:text-gray-700"),"aria-label":"Collapse sidebar",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"cursor-pointer",children:[(0,n.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"9",x2:"9",y1:"3",y2:"21"})]})})]})})}),(0,n.jsxs)("nav",{className:"flex flex-1 flex-col gap-y-0.5 overflow-y-auto py-3 ".concat(eS?"px-2":"px-3"),children:[!eS&&
1(0,n.jsxs)("div",{className:"space-y-2 mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 ".concat(eP),style:eB(0),children:[(0,n.jsx)(P.m,{content:"Search (âK)",side:"bottom",children:(0,n.jsx)("button",{type:"button",onClick:eM,className:eG(!1),"aria-label":"Search (âK)",children:(0,n.jsx)(E.A,{className:"h-[18px] w-[18px]"})})}),(0,n.jsx)(P.m,{content:"Shortcuts (â/)",side:"bottom",children:(0,n.jsx)("button",{type:"button",onClick:e_,className:eG(!1),"aria-label":"Keyboard shortcuts (â/)",children:(0,n.jsx)("span",{className:"text-[11px] font-medium leading-none tracking-tight",children:"â/"})})}),N&&(0,n.jsx)(P.m,{content:"Chats",side:"bottom",children:(0,n.jsx)("button",{onClick:()=>N(!v),className:eG(!!v),"aria-label":"Toggle chat list","aria-pressed":!!v,children:(0,n.jsx)(w.A,{className:"h-[18px] w-[18px]"})})}),I&&(0,n.jsx)(P.m,{content:"Prompts",side:"bottom",children:(0,n.jsx)("button",{onClick:()=>I(!R),className:eG(!!R),"aria-label":"Toggle prompts","aria-pressed":!!R,children:(0,n.jsx)(j.A,{className:"h-[18px] w-[18px]"})})}),(0,n.jsx)(P.m,{content:"Community",side:"bottom",children:(0,n.jsx)("a",{href:"https://join.slack.com/t/upgraded-community/shared_invite/zt-3u4rq9jon-OddEhP9JyDIbd6eNva2R8w",target:"_blank",rel:"noopener noreferrer",className:eG(!1),"aria-label":"Community on Slack",children:(0,n.jsx)(_.default,{src:"https://img.logo.dev/slack.com?token=pk_acnHOju_S3KawCcUE6Ek2Q",alt:"",width:18,height:18,className:"h-[18px] w-[18px] shrink-0 rounded-full",unoptimized:!0})})}),(0,n.jsx)(P.m,{content:ts?"Unmute sounds":"Mute sounds",side:"bottom",children:(0,n.jsx)("button",{ref:tl,type:"button",onClick:()=>{let e=!ts;(0,c.Zc)(e),ti(e),(0,c.E_)();let t=tl.current;t&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&t.animate([{transform:"scale(1)"},{transform:"scale(0.82)",offset:.3},{transform:"scale(1.14)",offset:.6},{transform:"scale(1)"}],{duration:340,easing:"ease-out"})},className:eG(!1),"aria-label":ts?"Unmute all sounds":"Mute all sounds","aria-pressed":ts,children:ts?(0,n.jsx)(A.A,{className:"h-[18px] w-[18px]"}):(0,n.jsx)(T.A,{className:"h-[18px] w-[18px]"})})})]}),(0,n.jsxs)(i(),{href:"/chat",onClick:e=>{(0,o.M)(e)||(e.preventDefault(),eL())},className:"group relative w-full flex items-center gap-x-2.5 rounded-md px-2.5 py-1.5 text-[13.5px] font-medium tracking-[-0.011em] transition-colors duration-100 cursor-pointer ".concat(eq?"bg-white/[0.09] text-gray-100 hover:bg-white/[0.14]":"bg-gray-900/[0.06] text-gray-900 hover:bg-gray-900/[0.09]"," ").concat(eP),style:eB(1),children:[(0,n.jsx)(S.A,{className:"h-4 w-4 shrink-0"}),(0,n.jsx)("span",{children:"New Chat"}),(0,n.jsx)(Z,{keys:V.vU.newChat.keys,tone:"chat"})]}),D.G.map((e,t)=>{let a=!1!==eZ[e.id],r=e.icon,s=e.links.some(e8);return(0,n.jsxs)("div",{className:eP,style:eB(3+t),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void eX(e=>{var a;let n=!(null==(a=e[t])||a);try{window.localStorage.setItem("sidebar-group-".concat(t),n?"1":"0")}catch(e){}return{...e,[t]:n}})},"aria-expanded":a,className:"flex w-full items-center gap-x-2 rounded-md px-2.5 py-1.5 text-left cursor-pointer transition-colors duration-100 ".concat(s?eq?"text-white":"text-gray-900":eq?"text-gray-300 hover:text-white":"text-gray-800 hover:text-gray-900"),children:[(0,n.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-semibold tracking-[-0.011em]",children:e.label}),(0,n.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform duration-150 ".concat(a?"rotate-90":"")})]}),a&&(0,n.jsx)("div",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1.5 ".concat(eq?"border-white/10":"border-gray-900/10"),children:e.links.filter(e=>!e.adminOnly||eD).map(e=>{var t,a;let r=e8(e),s=r?e.iconSolid:e.icon,l=tr(e),c="revenue-support"===e.id&&eV>0?eW>0?"".concat(eV," live"):"".concat(eV," waiting"):null;return(0,n.jsxs)(i(),{href:l,onClick:t=>{(0,o.M)(t)||"revenue-support"===e.id&&eV>0||l.includes("?")||g(l.replace(/^\//,""))},onMouseEnter:()=>{K.prefetch(l.split("?")[0]),("revenue-bdr"===e.id||"revenue-sequences"===e.id)&&eI()},"aria-current":r?"page":void 0,className:"".concat(ez(r,"expanded")," !py-1.5 !whitespace-normal"),children:[(0,n.jsx)(eO,{show:r}),(0,n.jsx)(s,{className:"h-4 w-4 shrink-0 ".concat(r?"":eq?"text-gray-500":"text-gray-400")}),(0,n.jsx)("span",{className:"min-w-0 leading-snug",children:e.label}),(0,n.jsx)(Z,{keys:null!=(a=null==(t=(0,V.Iu)(e.id))?void 0:t.keys)?a:[],className:"revenue-support"===e.id&&eV>0?"right-9":""}),"revenue-support"===e.id&&(0,n.jsx)(B.n,{waiting:eV,live:eW}),c?(0,n.jsx)("span",{className:"sr-only",children:c}):null]},e.id)})})]},e.id)})]}),eS&&(0,n.jsxs)("div",{className:"mb-3 flex flex-col items-center gap-1 animate-in fade-in duration-300 motion-reduce:animate-none",children:[(0,n.jsx)(P.m,{content:"New Chat",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)(i(),{href:"/chat",onMouseEnter:ta,onFocus:ta,onClick:e=>{(0,o.M)(e)||(e.preventDefault(),eL())},className:"flex size-10 items-center justify-center rounded-lg transition-colors duration-100 cursor-pointer ".concat(eq?"bg-white text-gray-950 hover:bg-gray-100":"bg-gray-900 text-white hover:bg-gray-800"),"aria-label":"New Chat",children:(0,n.jsx)(S.A,{className:"h-5 w-5"})})}),(0,n.jsx)(P.m,{content:"Search (âK)",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("button",{type:"button",onMouseEnter:ta,onFocus:ta,onClick:eM,className:ez(!1,"collapsed"),"aria-label":"Search",children:(0,n.jsx)(E.A,{className:"h-5 w-5"})})}),(0,n.jsx)(P.m,{content:"Shortcuts (â/)",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("button",{type:"button",onMouseEnter:ta,onFocus:ta,onClick:e_,className:ez(!1,"collapsed"),"aria-label":"Keyboard shortcuts",children:(0,n.jsx)("span",{className:"text-[11px] font-medium leading-none tracking-tight",children:"â/"})})}),D.G.map(e=>{let t=e.icon,a=e.links.some(e8),r=e1&&e$===e.id,s="revenue"===e.id&&eV>0?eW>0?"".concat(e.label," \xb7 ").concat(eV," live"):"".concat(e.label," \xb7 ").concat(eV," waiting"):e.label;return(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(P.m,{content:s,side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsxs)("button",{type:"button",onMouseEnter:()=>tt(e.id),onMouseLeave:ta,onFocus:()=>tt(e.id),onClick:()=>(e=>{if(e3.current&&e$===e)return void tn();e3.current=!0,e4(!0),tt(e)})(e.id),onKeyDown:t=>{"ArrowRight"===t.key&&(t.preventDefault(),tt(e.id),window.requestAnimationFrame(()=>{var e;let t=null==(e=e9.current)?void 0:e.querySelector("a");t instanceof HTMLAnchorElement&&t.focus()}))},className:ez(a||r,"collapsed"),"aria-label":s,"aria-expanded":r,"aria-haspopup":"true","aria-controls":"sidebar-secondary",children:[(0,n.jsx)(t,{className:"h-5 w-5"}),"revenue"===e.id&&(0,n.jsx)(B.n,{waiting:eV,live:eW,collapsed:!0})]})})},e.id)})]}),eS&&(0,n.jsxs)("div",{className:"mt-auto flex flex-col items-center gap-1 pt-4",children:[(0,n.jsx)(P.m,{content:"Join community",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("a",{href:"https://join.slack.com/t/upgraded-community/shared_invite/zt-3u4rq9jon-OddEhP9JyDIbd6eNva2R8w",target:"_blank",rel:"noopener noreferrer",className:ez(!1,"collapsed"),"aria-label":"Join community",children:(0,n.jsx)(_.default,{src:"https://img.logo.dev/slack.com?token=pk_acnHOju_S3KawCcUE6Ek2Q",alt:"Slack",width:20,height:20,className:"w-5 h-5 shrink-0 cursor-pointer rounded-full",unoptimized:!0})})}),(0,n.jsx)(P.m,{content:"Invite a Friend",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("button",{type:"button",onClick:eT,className:ez(!1,"collapsed"),"aria-label":"Invite a Friend",children:(0,n.jsx)("svg",{className:"h-5 w-5 cursor-pointer text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"})})})}),(0,n.jsx)(P.m,{content:"Upgrade to Modern Retire",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("button",{type:"button",onClick:f,className:ez(!1,"collapsed"),"aria-label":"Upgrade to Modern Retire",children:(0,n.jsx)(p.A,{className:"h-5 w-5 cursor-pointer",style:{color:"goldenrod"}})})})]})]}),!eS&&(0,n.jsx)("div",{className:"shrink-0 px-3 pb-2",children:ew?(0,n.jsxs)("button",{type:"button",onClick:f,className:"flex w-full cursor-pointer items-center gap-2 rounded-xl px-3 py-2 text-left text-sm font-semibold ring-1 ring-inset transition-shadow hover:shadow-md ".concat(eq?"bg-gray-900 text-white ring-gray-800":"bg-gray-50 text-gray-900 ring-[#E9EAEB]"),children:[(0,n.jsx)(p.A,{className:"h-4 w-4 shrink-0",style:{color:"goldenrod"}}),"Upgrade to Modern Retire"]}):(0,n.jsxs)("div",{className:"relative flex flex-col gap-3 rounded-xl p-3 ring-1 ring-inset ".concat(eq?"bg-gray-900 ring-gray-800":"bg-gray-50 ring-[#E9EAEB]"),children:[(0,n.jsx)("button",{type:"button",onClick:()=>{ej(!0);try{window.localStorage.setItem("sidebar-upgrade-card","compact")}catch(e){}},className:"absolute right-2 top-2 cursor-pointer rounded-md p-1 transition-colors ".concat(eq?"text-gray-500 hover:bg-white/10 hover:text-gray-200":"text-gray-400 hover:bg-gray-200/70 hover:text-gray-700"),"aria-label":"Show smaller upgrade card",children:(0,n.jsx)(L.A,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"pr-6",children:[(0,n.jsx)("p",{className:"text-sm font-semibold ".concat(eq?"text-white":"text-gray-900"),children:"Upgrade to Modern Retire"}),(0,n.jsx)("p",{className:"mt-1 text-sm leading-snug ".concat(eq?"text-gray-400":"text-gray-600"),children:eh?"You've used ".concat(Math.min(100,Math.round(eh.monthlyUsage/Math.max(eh.monthlyLimit,1)*100)),"% of this month's credits. Need more?"):"Unlock more benefits for your team."})]}),eh&&(0,n.jsx)("div",{className:"h-2 w-full overflow-hidden rounded-full ".concat(eq?"bg-gray-800":"bg-gray-200"),"aria-hidden":!0,
1children:(0,n.jsx)("div",{className:"h-full rounded-full ".concat(eq?"bg-gray-100":"bg-gray-900"),style:{width:"".concat(Math.min(100,Math.max(4,eh.monthlyUsage/Math.max(eh.monthlyLimit,1)*100)),"%")}})}),(0,n.jsx)("button",{type:"button",onClick:f,className:"w-full cursor-pointer rounded-lg px-3 py-2 text-sm font-semibold shadow-sm ring-1 ring-inset transition-shadow hover:shadow-md ".concat(eq?"bg-gray-800 text-gray-100 ring-gray-700":"bg-white text-gray-700 ring-[#E9EAEB]"),children:"Upgrade plan"})]})}),(0,n.jsx)("div",{className:"shrink-0 ".concat(eS?"flex flex-col items-center gap-1 px-2 py-1":"px-3 py-1"),children:eS?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.m,{content:"AI Engineer Chat",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("a",{href:"https://www.getupgraded.ai/earnings-strategy-estimate",target:"_blank",rel:"noopener noreferrer",className:ez(!1,"collapsed"),"aria-label":"AI Engineer Chat",children:(0,n.jsx)(k.A,{className:"h-5 w-5 shrink-0"})})}),(0,n.jsx)(P.m,{content:"Feedback (ââ§F)",side:"right",triggerClassName:"flex items-center justify-center",disabled:e1,children:(0,n.jsx)("button",{type:"button",onClick:()=>et(!0),className:ez(!1,"collapsed"),"aria-label":"Feedback (ââ§F)",children:(0,n.jsx)(M.A,{className:"h-5 w-5 shrink-0"})})})]}):(0,n.jsxs)("div",{className:"flex flex-col gap-0.5 pb-1",children:[(0,n.jsxs)("button",{type:"button",onClick:eT,className:"".concat(ez(!1,"expanded")," relative"),children:[ea&&(0,n.jsx)("span",{className:"pointer-events-none absolute -top-8 left-2 z-10 whitespace-nowrap rounded bg-green-600 px-2 py-1 text-xs text-white shadow-sm",children:"Link copied!"}),(0,n.jsx)(h.A,{className:"h-5 w-5 shrink-0 text-gray-400"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:"Invite a Friend"})]}),(0,n.jsxs)("a",{href:"https://www.getupgraded.ai/earnings-strategy-estimate",target:"_blank",rel:"noopener noreferrer",className:ez(!1,"expanded"),children:[(0,n.jsx)(k.A,{className:"h-5 w-5 shrink-0 text-gray-400"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"AI Engineer Chat"})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>et(!0),className:ez(!1,"expanded"),children:[(0,n.jsx)(M.A,{className:"h-5 w-5 shrink-0 text-gray-400"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:"Feedback"}),(0,n.jsxs)("span",{className:"flex shrink-0 items-center gap-0.5 text-[11px] text-gray-400",children:[(0,n.jsx)("kbd",{className:"font-sans",children:"â"}),(0,n.jsx)("kbd",{className:"font-sans",children:"F"})]})]})]})}),(0,n.jsx)("div",{className:"flex shrink-0 items-center border-t ".concat(eq?"border-white/10":"border-[#E9EAEB]"," ").concat(eS?"justify-center px-2 py-3":"gap-x-3 px-4 py-3"),children:u&&(0,n.jsx)(n.Fragment,{children:eS?(0,n.jsxs)("div",{className:"relative flex flex-col items-center gap-y-2 w-full",children:[(0,n.jsx)(P.m,{content:b||(null==(a=u.email)?void 0:a.split("@")[0])||"Account",side:"right",triggerClassName:"flex w-full flex-col items-center",disabled:en,children:(0,n.jsxs)("button",{type:"button",onClick:()=>er(!en),className:"relative w-full flex cursor-pointer flex-col items-center gap-y-1 p-2 rounded-lg transition-all duration-200 ".concat(eU," ").concat(eq?"hover:bg-gray-700":"hover:bg-gray-50"),"aria-label":"Account menu",children:[Y(u,eb)?(0,n.jsx)(_.default,{src:Y(u,eb),alt:b||u.email||"User",width:32,height:32,className:"h-8 w-8 rounded-full",unoptimized:!0}):(0,n.jsx)("span",{className:"inline-block h-8 w-8 overflow-hidden rounded-full bg-gray-100 outline -outline-offset-1 outline-black/5",children:(0,n.jsx)("svg",{fill:"currentColor",viewBox:"0 0 24 24",className:"h-full w-full text-gray-300",children:(0,n.jsx)("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})}),eh&&(0,n.jsx)("div",{className:"w-full px-1",children:(0,n.jsx)("div",{className:"h-1 w-full rounded-full overflow-hidden ".concat(eq?"bg-gray-700":"bg-gray-200"),children:(0,n.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-cyan-400 to-cyan-500 transition-all duration-300",style:{width:"".concat(Math.min(100,Math.max(0,eh.totalAvailable/eh.monthlyLimit*100)),"%")}
1})})})]})}),(0,n.jsx)("div",{className:"flex justify-end w-full",children:(0,n.jsx)(z.U,{theme:ef,onThemeChange:eN,size:"sm"})}),en&&(0,n.jsx)(ee,{isDark:eq,placement:"side",email:u.email,credits:eh,supportHref:eH,supportWaiting:eV,supportLive:eW,isAdmin:eD,actions:eF,onClose:()=>er(!1),onOpenSettings:e=>{er(!1),ed(e),eo(!0)},onSignOut:eA})]}):(0,n.jsxs)("div",{className:"flex flex-1 items-center gap-x-3 min-w-0 relative",children:[(0,n.jsxs)("div",{className:"relative flex-1 min-w-0",children:[(0,n.jsxs)("button",{onClick:()=>er(!en),className:"w-full flex items-center gap-x-3 rounded-lg p-2 transition-all duration-200 text-left cursor-pointer ".concat(eU," ").concat(eq?"hover:bg-gray-700":"hover:bg-gray-50"),children:[Y(u,eb)?(0,n.jsx)(_.default,{src:Y(u,eb),alt:b||u.email||"User",width:32,height:32,className:"h-8 w-8 flex-shrink-0 rounded-full",unoptimized:!0}):(0,n.jsx)("span",{className:"inline-block h-8 w-8 overflow-hidden rounded-full bg-gray-100 outline -outline-offset-1 outline-black/5 flex-shrink-0",children:(0,n.jsx)("svg",{fill:"currentColor",viewBox:"0 0 24 24",className:"h-full w-full text-gray-300",children:(0,n.jsx)("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})}),!eS&&(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium truncate ".concat(eq?"text-white":"text-gray-900"),children:b||(null==(s=u.email)?void 0:s.split("@")[0])}),eh&&(0,n.jsx)("span",{className:"text-xs font-medium ".concat("Free"===eh.tier?"text-emerald-600":"Pro"===eh.tier?"text-blue-600":"text-purple-600"),children:eh.tier})]}),ep?(0,n.jsx)("div",{className:"text-xs ".concat(eq?"text-gray-400":"text-gray-500"),children:"Loading..."}):eh?(0,n.jsx)("div",{className:"mt-1.5",children:(0,n.jsx)("div",{className:"h-1 w-full rounded-full overflow-hidden ".concat(eq?"bg-gray-700":"bg-gray-200"),children:(0,n.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-cyan-400 to-cyan-500 transition-all duration-300",style:{width:"".concat(Math.min(100,Math.max(0,eh.totalAvailable/eh.monthlyLimit*100)),"%")}})})}):null]})]}),en&&(0,n.jsx)(ee,{isDark:eq,placement:"above",email:u.email,credits:eh,supportHref:eH,supportWaiting:eV,supportLive:eW,isAdmin:eD,actions:eF,onClose:()=>er(!1),onOpenSettings:e=>{er(!1),ed(e),eo(!0)},onSignOut:eA})]}),(0,n.jsx)("div",{className:"flex-shrink-0",onClick:e=>e.stopPropagation(),children:(0,n.jsx)(z.U,{theme:ef,onThemeChange:eN,size:"sm"})})]})})}),eS&&e$&&(()=>{let e=D.G.find(e=>e.id===e$);return e?(0,n.jsx)("aside",{id:"sidebar-secondary",ref:e9,onMouseEnter:()=>{te(),e2(!0)},onMouseLeave:ta,className:"absolute top-0 z-40 h-full w-[260px] ".concat(e1?"":"pointer-events-none"),style:{left:"100%",marginLeft:-8}
1,children:(0,n.jsxs)("div",{className:"ml-2 flex h-full w-[248px] flex-col border-r shadow-lg ring-1 transition-[transform,opacity] duration-200 ease-out motion-reduce:transition-none ".concat(e1?"translate-x-0 opacity-100":"-translate-x-2 opacity-0"," ").concat(eq?"border-white/10 bg-gray-950 ring-white/10":"border-[#E9EAEB] bg-white ring-[#E9EAEB]"),children:[(0,n.jsx)("div",{className:"px-5 pb-2 pt-5 ".concat(eq?"text-white":"text-gray-900"),children:(0,n.jsx)("p",{className:"text-[15px] font-semibold tracking-[-0.02em]",children:e.label})}),(0,n.jsx)("nav",{className:"flex flex-1 flex-col gap-0.5 overflow-y-auto px-3 pb-4",children:e.links.filter(e=>!e.adminOnly||eD).map(e=>{var t,a;let r=e8(e),s=e.icon,l=tr(e);return(0,n.jsxs)(i(),{href:l,"aria-current":r?"page":void 0,onMouseEnter:()=>{K.prefetch(l.split("?")[0]),("revenue-bdr"===e.id||"revenue-sequences"===e.id)&&eI()},onClick:t=>{if(!(0,o.M)(t))tn(),("revenue-support"!==e.id||!(eV>0))&&(l.includes("?")||g(l.replace(/^\//,"")))},className:"group relative flex items-center gap-3 rounded-md px-2.5 py-2 text-[14px] font-medium tracking-[-0.011em] transition-colors duration-100 ".concat(r?eq?"bg-white/[0.10] text-white":"bg-gray-900/[0.06] text-gray-900":eq?"text-gray-300 hover:bg-white/[0.06] hover:text-white":"text-gray-600 hover:bg-gray-900/[0.04] hover:text-gray-900"),children:[(0,n.jsx)(s,{className:"h-5 w-5 shrink-0 ".concat(r?"":eq?"text-gray-500":"text-gray-400")}),(0,n.jsx)("span",{className:"min-w-0 flex-1 leading-snug",children:e.label}),(0,n.jsx)(Z,{keys:null!=(a=null==(t=(0,V.Iu)(e.id))?void 0:t.keys)?a:[],tone:"panel",className:"revenue-support"===e.id&&eV>0?"right-9":""}),"revenue-support"===e.id&&(0,n.jsx)(B.n,{waiting:eV,live:eW})]},e.id)})})]})}):null})(),(0,n.jsx)(q,{isOpen:es,onClose:()=>ei(!1),userEmail:y}),(0,n.jsx)(F.B,{isOpen:$,onClose:()=>et(!1),userEmail:y,userName:b}),u&&(0,n.jsx)(W,{isOpen:el,onClose:()=>{eo(!1),ed("account")},user:u,initialTab:ec,onUpgradeClick:()=>{eo(!1),f()}})]})}},46660:(e,t,a)=>{a.d(t,{m:()=>i});var n=a(95155),r=a(12115),s=a(47650);function i(e){let{content:t,children:a,side:i="top",triggerClassName:l="inline-flex",disabled:o=!1,multiline:c=!1,clickToToggle:d=!1}=e,[u,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[p,g]=(0,r.useState)({}),f=(0,r.useRef)(null),y=(0,r.useRef)(null),b=u||h,v=()=>{var e,t;let a=f.current,n=y.current;if(!a)return;let r=a.getBoundingClientRect(),s=window.innerWidth,l=null!=(e=null==n?void 0:n.offsetWidth)?e:150,o=null!=(t=null==n?void 0:n.offsetHeight)?t:28;if("right"===i){let e=r.right+8,t=r.top+r.height/2;e+l>s-8&&(e=Math.max(8,s-8-l)),g({position:"fixed",left:e,top:t,transform:"translate(0, -50%)"});return}if("left"===i){let e=r.left-l-8;e<8&&(e=8),g({position:"fixed",left:e,top:r.top+r.height/2,transform:"translate(0, -50%)"});return}let c=r.left+r.width/2;g({position:"fixed",left:c=Math.max(8+l/2,Math.min(s-8-l/2,c)),top:"top"===i?r.top-o-6:r.bottom+6,transform:"translate(-50%, 0)"})};return((0,r.useEffect)(()=>{if(!b)return;v();let e=setTimeout(v,0),t=()=>v();return window.addEventListener("scroll",t,!0),window.addEventListener("resize",t),()=>{clearTimeout(e),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}},[b,t,i]),(0,r.useEffect)(()=>{if(!h)return;let e=e=>{var t;null!=(t=f.current)&&t.contains(e.target)||x(!1)},t=e=>{"Escape"===e.key&&x(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[h]),o)?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{ref:f,className:"".concat(l," cursor-pointer"),onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onClick:e=>{d&&(e.preventDefault(),e.stopPropagation(),x(e=>!e))},children:a}),b&&"undefined"!=typeof document&&(0,s.createPortal)((0,n.jsx)("span",{ref:y,role:"tooltip",className:"z-[9999] rounded-md bg-gray-900 px-2.5 py-1.5 text-xs font-semibold text-white shadow-lg pointer-events-none ".concat(c?"max-w-xs whitespace-pre-line text-left leading-snug font-medium":"whitespace-nowrap"),style:p,children:t}),document.body)]})}},57677:(e,t,a)=>{a.d(t,{n:()=>l,s:()=>i});var n=a(95155),r=a(12115),s=a(8141);
1function i(e){let[t,a]=(0,r.useState)({waiting:0,live:0}),n=(0,r.useCallback)(async()=>{if(!e)return void a({waiting:0,live:0});try{let e=await fetch("/api/support-widget/conversations/unread");if(!e.ok)return;let t=await e.json();a({waiting:"number"==typeof t.waiting&&t.waiting>0?t.waiting:0,live:"number"==typeof t.live&&t.live>0?t.live:0})}catch(e){}},[e]);return(0,r.useEffect)(()=>{if(!e)return void a({waiting:0,live:0});n();let t=window.setInterval(()=>{"visible"===document.visibilityState&&n()},2e4),r=()=>{"visible"===document.visibilityState&&n()},i=()=>void n();return document.addEventListener("visibilitychange",r),window.addEventListener(s._N,i),()=>{window.clearInterval(t),document.removeEventListener("visibilitychange",r),window.removeEventListener(s._N,i)}},[e,n]),t}function l(e){let{waiting:t,live:a,collapsed:r=!1,inline:s=!1}=e;if(t<=0)return null;let i=t>9?"9+":String(t);return r?(0,n.jsxs)("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-gray-900 px-0.5 text-[9px] font-semibold tabular-nums leading-none text-white dark:bg-white dark:text-gray-900",children:[a>0&&(0,n.jsx)("span",{"aria-hidden":!0,className:"absolute -left-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-amber-400"}),i]}):(0,n.jsxs)("span",{className:"".concat(s?"ml-1.5":"ml-auto"," flex items-center gap-1.5"),children:[a>0&&(0,n.jsxs)("span",{className:"relative flex h-2 w-2","aria-hidden":!0,title:"Live conversation",children:[(0,n.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-60"}),(0,n.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-amber-500"})]}),(0,n.jsx)("span",{className:"min-w-[1.25rem] rounded-full bg-gray-900 px-1.5 py-0.5 text-center text-[10px] font-semibold tabular-nums leading-none text-white dark:bg-white dark:text-gray-900",children:i})]})}},70348:(e,t,a)=>{a.d(t,{Bp:()=>b,E_:()=>C,Gm:()=>_,HW:()=>R,J1:()=>h,JM:()=>j,P5:()=>m,WT:()=>w,Zc:()=>x,ab:()=>v,q7:()=>U,y1:()=>M});let n=[0,2,4,7,9,12],r=null,s=null,i=null,l=null,o=null,c="app-sound-muted",d=(()=>{try{return"1"===localStorage.getItem(c)}catch(e){return!1}})();function u(){if(r)return r;let e=window.AudioContext||window.webkitAudioContext;if(!e)return null;(s=(r=new e).createGain()).gain.value=1.25*!d,s.connect(r.destination);let t=r.createDynamicsCompressor();t.threshold.value=-18,t.knee.value=24,t.ratio.value=4,t.attack.value=.003,t.release.value=.2,t.connect(s),(i=r.createGain()).gain.value=.3,i.connect(t),(l=r.createGain()).gain.value=.6,l.connect(t),(o=r.createGain()).gain.value=.8;let a=r.createDynamicsCompressor();return a.threshold.value=-3,a.knee.value=24,a.ratio.value=4,a.attack.value=.003,a.release.value=.15,o.connect(a),a.connect(s),r}function m(){let e=u();e&&"suspended"===e.state&&e.resume()}function h(){return d}function x(e){d=e;try{localStorage.setItem(c,e?"1":"0")}catch(e){}let t=r;if(t&&s){let a=1.25*!e;try{s.gain.cancelScheduledValues(t.currentTime),s.gain.setTargetAtTime(a,t.currentTime,.02)}catch(e){s.gain.value=a}}}function p(){return!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}let g=-1/0,f=-1/0,y={base:500,cutoff:700,q:.7,attack:.007,decay:.12,tri:.5,cents:11,bend:.15,peak:.28},b=7,v=3;function w(e,t,a){if(e<=0||p())return;let n=u();if(!n||!o||"running"!==n.state||n.currentTime-f<.45)return;f=n.currentTime;let r=Math.min(e,42,null!=a?a:42),s=n.currentTime+.03,i=t/1e3;for(let e=0;e<r;e++){let t=(e%7/6*2-1)*.28;!function(e,t,a,n){let r=e.createBiquadFilter();r.type="lowpass",r.frequency.value=y.cutoff,r.Q.value=y.q;let s=e.createGain();s.gain.setValueAtTime(1e-4,a),s.gain.exponentialRampToValueAtTime(y.peak,a+y.attack),s.gain.exponentialRampToValueAtTime(1e-4,a+y.attack+y.decay),r.connect(s);let i=s;if(0!==n){let t=e.createStereoPanner();
1t.pan.value=n,s.connect(t),i=t}i.connect(t);let l=(2*Math.random()-1)*y.cents,o=a+y.attack+y.decay+.03,c=e.createOscillator();c.type="sine",c.detune.value=l,c.frequency.setValueAtTime(Math.max(y.base*(1+y.bend),20),a),c.frequency.exponentialRampToValueAtTime(Math.max(y.base,20),a+y.attack+.7*y.decay);let d=e.createGain();d.gain.value=.72,c.connect(d),d.connect(r),c.start(a),c.stop(o);let u=e.createOscillator();u.type="triangle",u.detune.value=l,u.frequency.value=y.base;let m=e.createGain();m.gain.value=.5*y.tri,u.connect(m),m.connect(r),u.start(a),u.stop(o)}(n,o,s+e*i,t)}}function j(){!function(e,t){if(p())return;let a=u();if(!a||!i||"running"!==a.state||a.currentTime-g<.45)return;g=a.currentTime;let r=Math.min(Math.max(1,e),n.length),s=a.currentTime+.03;for(let e=0;e<r;e++)!function(e,t,a,n){let r=e.createBiquadFilter();r.type="lowpass",r.Q.value=.5,r.frequency.setValueAtTime(Math.min(4*n,5e3),a),r.frequency.exponentialRampToValueAtTime(Math.max(1.2*n,400),a+.3);let s=e.createGain();s.gain.setValueAtTime(1e-4,a),s.gain.exponentialRampToValueAtTime(.19,a+.01),s.gain.exponentialRampToValueAtTime(1e-4,a+.6);let i=e.createOscillator();i.type="sine",i.frequency.value=n;let l=e.createOscillator();l.type="triangle",l.frequency.value=n;let o=e.createGain();o.gain.value=.16,i.connect(r),l.connect(o),o.connect(r),r.connect(s),s.connect(t),i.start(a),l.start(a),i.stop(a+.6+.05),l.stop(a+.6+.05)}(a,i,s+.3*e,261.63*Math.pow(2,n[e]/12))}(n.length,0)}let N=[130.81,196,293.66,329.63,493.88],k=-1/0;function C(){let e=u();if(!e||!l)return;let t=()=>{if("running"===e.state&&l&&!(e.currentTime-k<.12)){k=e.currentTime;var t=l;let a=e.currentTime+.02;N.forEach((n,r)=>{let s=a+.012*r,i=(r%2==0?-1:1)*(3+1.5*r),l=e.createGain();l.gain.setValueAtTime(1e-4,s),l.gain.exponentialRampToValueAtTime(.1*(1-.07*r),s+.08),l.gain.exponentialRampToValueAtTime(1e-4,s+.08+1.5),l.connect(t);let o=s+.08+1.5+.1,c=e.createOscillator();c.type="sine",c.frequency.value=n,c.detune.value=i;let d=e.createGain();d.gain.value=.6,c.connect(d),d.connect(l),c.start(s),c.stop(o);let u=e.createOscillator();u.type="triangle",u.frequency.value=n,u.detune.value=-i;let m=e.createBiquadFilter();m.type="lowpass",m.frequency.value=700,m.Q.value=.5;let h=e.createGain();h.gain.value=.4,u.connect(m),m.connect(h),h.connect(l),u.start(s),u.stop(o)})}};"running"===e.state?t():e.resume().then(t).catch(()=>{})}let S=[{freqs:[196],peak:.16},{freqs:[392],peak:.13}],E=[{freqs:[392],peak:.14},{freqs:[164.81,196,261.63],peak:.15}],A=-1/0,T=-1/0;function L(e,t,a){let n=u();if(!n||!l)return;let r=()=>{let r=l;if("running"!==n.state||!r||n.currentTime-t()<.09)return;a(n.currentTime);let s=n.currentTime+.03;e.forEach((e,t)=>(function(e,t,a,n,r){let s=e.createGain();s.gain.setValueAtTime(1e-4,a),s.gain.exponentialRampToValueAtTime(r,a+.04),s.gain.exponentialRampToValueAtTime(1e-4,a+.04+1.5),s.connect(t);let i=a+.04+1.5+.1,l=1/Math.sqrt(n.length),o=n.map((e,t)=>[e,(0===t?.6:.5)*l]);for(let[t,r]of(1===n.length&&o.push([1.5*n[0],.22]),o)){let n=e.createOscillator();n.type="sine",n.frequency.value=t;let l=e.createGain();l.gain.value=r,n.connect(l),l.connect(s),n.start(a),n.stop(i)}for(let t of n){let n=e.createOscillator();n.type="triangle",n.frequency.value=t;let r=e.createBiquadFilter();r.type="lowpass",r.frequency.value=1e3,r.Q.value=.5;let o=e.createGain();o.gain.value=.5*l,n.connect(r),r.connect(o),o.connect(s),n.start(a),n.stop(i)}})(n,r,s+.12*t,e.freqs,e.peak))};"running"===n.state?r():n.resume().then(r).catch(()=>{})}function M(){L(S,()=>A,e=>{A=e})}function _(){L(E,()=>T,e=>{T=e})}let F=-1/0;function R(){let e=u();if(e&&"suspended"===e.state&&e.resume(),!e||!l||"running"!==e.state)return!1;if(e.currentTime-F<.6)return!0;F=e.currentTime;let t=l,a=e.currentTime+.03,n=[],r=e.createGain();r.gain.value=.5;let s=(a,s)=>{let i=e.createDelay(1);i.delayTime.value=a;let l=e.createGain();l.gain.value=.36;let o=e.createBiquadFilter();o.type="lowpass",o.frequency.value=1800;let c=e.createStereoPanner();c.pan.value=s,r.connect(i),i.connect(c),c.connect(t),i.connect(o),o.connect(l),l.connect(i),n.push(i,l,o,c)};s(.21,-.6),s(.29,.6),n.push(r);let i=e.createGain();i.gain.setValueAtTime(1e-4,a),i.gain.exponentialRampToValueAtTime(.32,a+.16),i.gain.setValueAtTime(.32,a+.36),i.gain.exponentialRampToValueAtTime(1e-4,a+.36+1.1),i.connect(t);let o=e.createOscillator();o.type="sine",o.frequency.value=164.81;let c=e.createOscillator();c.type="triangle",c.frequency.value=82.41;let d=e.createBiquadFilter();d.type="lowpass",d.frequency.value=400;let m=e.createGain();m.gain.value=.6,o.connect(i),c.connect(d),d.connect(m),m.connect(i),o.start(a),c.start(a),o.stop(a+.36+1.2),c.stop(a+.36+1.2),n.push(i,o,c,d,m);let h=a+.36,x=e.createGain();x.gain.setValueAtTime(1e-4,h),x.gain.exponentialRampToValueAtTime(.18,h+.002),x.gain.exponentialRampToValueAtTime(1e-4,h+1.7);let p=e.createBiquadFilter();p.type="lowpass",p.frequency.value=2e3,p.Q.value=.7,p.connect(x),x.connect(t),x.connect(r);let g=e.createOscillator();g.type="triangle",g.frequency.value=880;let f=e.createGain();f.gain.value=.6;let y=e.createOscillator();y.type="triangle",y.frequency.value=1320,y.detune.value=4;let b=e.createGain();
1b.gain.value=.4,g.connect(f),f.connect(p),y.connect(b),b.connect(p),g.start(h),y.start(h),g.stop(h+1.8),y.stop(h+1.8),n.push(x,p,g,f,y,b);let v=e.createOscillator();return v.frequency.value=1e-4,v.start(a),v.stop(a+.36+3.4),v.onended=()=>{for(let e of n)try{e.disconnect()}catch(e){}},!0}let I=-1/0;function U(){let e=u();if(e&&"suspended"===e.state&&e.resume(),!e||!l||"running"!==e.state)return!1;if(e.currentTime-I<1)return!0;I=e.currentTime;let t=e.currentTime+.05,a=l,n=t+2,r=[],s=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return r.push(...t)};{let r=e.createGain();r.gain.setValueAtTime(1e-4,t),r.gain.exponentialRampToValueAtTime(.24,t+.5),r.gain.setValueAtTime(.24,n+.4),r.gain.exponentialRampToValueAtTime(1e-4,n+2.8);let i=e.createBiquadFilter();i.type="lowpass",i.frequency.value=150,i.connect(r),r.connect(a);let l=e.createOscillator();l.type="sine",l.frequency.value=65.41,l.connect(i),l.start(t),l.stop(n+3),s(r,i,l)}[261.63,329.63,392,493.88].forEach((n,r)=>{let i=t+.5*r,l=e.createGain();l.gain.setValueAtTime(1e-4,i),l.gain.exponentialRampToValueAtTime(.12+.02*r,i+.04),l.gain.exponentialRampToValueAtTime(1e-4,i+.9);let o=e.createBiquadFilter();o.type="lowpass",o.frequency.value=1400;let c=e.createStereoPanner();for(let t of(c.pan.value=r%2?.25:-.25,o.connect(l),l.connect(c),c.connect(a),[-4,4])){let a=e.createOscillator();a.type="sine",a.frequency.value=n,a.detune.value=t;let r=e.createGain();r.gain.value=.5,a.connect(r),r.connect(o),a.start(i),a.stop(i+1),s(a,r)}s(l,o,c)});let i=[130.81,261.63,329.63,392,523.25];i.forEach((t,r)=>{let l=e.createGain();l.gain.setValueAtTime(1e-4,n),l.gain.exponentialRampToValueAtTime(.085,n+.08),l.gain.exponentialRampToValueAtTime(1e-4,n+3);let o=e.createBiquadFilter();o.type="lowpass",o.frequency.value=2e3;let c=e.createStereoPanner();for(let d of(c.pan.value=r/(i.length-1)*1.2-.6,o.connect(l),l.connect(c),c.connect(a),[-7,7])){let a=e.createOscillator();a.type="sawtooth",a.frequency.value=t,a.detune.value=d;let r=e.createGain();r.gain.value=.28,a.connect(r),r.connect(o),a.start(n),a.stop(n+3.1),s(a,r)}let d=e.createOscillator();d.type="sine",d.frequency.value=t;let u=e.createGain();u.gain.value=.5,d.connect(u),u.connect(o),d.start(n),d.stop(n+3.1),s(l,o,c,d,u)});let o=e.createOscillator();return o.frequency.value=1e-4,o.start(t),o.stop(n+3.2),o.onended=()=>{for(let e of r)try{e.disconnect()}catch(e){}},!0}},83306:(e,t,a)=>{a.d(t,{B:()=>h});var n=a(95155),r=a(12115),s=a(52619),i=a.n(s),l=a(96059),o=a(45748),c=a(43569),d=a(26614),u=a(21535);function m(e){let{value:t,onChange:a,disabled:s}=e,[i,c]=(0,r.useState)(!1),[d,m]=(0,r.useState)(null),h=(0,r.useRef)(null),x=(0,r.useRef)(null),p=t?(0,u.Hb)(t):void 0,g=(0,u.nj)();return(0,r.useEffect)(()=>{if(!i)return;let e=()=>{var e;let t=null==(e=x.current)?void 0:e.getBoundingClientRect();t&&m({top:t.bottom+4,left:t.left,width:t.width})};e();let t=e=>{var t;(null==(t=h.current)?void 0:t.contains(e.target))||c(!1)},a=e=>{"Escape"===e.key&&(e.stopPropagation(),c(!1))};return document.addEventListener("mousedown",t),document.addEventListener("keydown",a,!0),window.addEventListener("resize",e),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("keydown",a,!0),window.removeEventListener("resize",e)}},[i]),(0,n.jsxs)("div",{ref:h,className:"relative",children:[(0,n.jsxs)("button",{id:"feedback-product",ref:x,type:"button",disabled:s,"aria-haspopup":"listbox","aria-expanded":i,onClick:()=>c(e=>!e),className:"flex w-full items-center justify-between gap-2 rounded-md border border-gray-300 bg-white px-3 py-2 text-left text-sm text-gray-900 shadow-sm transition-shadow hover:shadow-md focus:outline-none focus:ring-2 focus:ring-gray-400 disabled:opacity-50",children:[p?(0,n.jsxs)("span",{className:"min-w-0 truncate",children:[(0,n.jsx)("span",{className:"text-gray-400",children:p.groupLabel}),(0,n.jsx)("span",{className:"text-gray-300",children:" / "}),p.label]}):(0,n.jsx)("span",{className:"text-gray-400",children:"Select a product"}),(0,n.jsx)(l.A,{className:"h-4 w-4 shrink-0 text-gray-400 transition-transform ".concat(i?"rotate-180":"")})]}),i&&d&&(0,n.jsx)("div",{role:"listbox","aria-label":"Product",style:{to
1p:d.top,left:d.left,width:d.width},className:"fixed z-[60] max-h-64 overflow-y-auto rounded-lg border border-[#e5e5e3] bg-white py-1 shadow-[0_12px_40px_rgba(0,0,0,0.12)]",children:g.map(e=>(0,n.jsxs)("div",{className:"pb-1",children:[(0,n.jsx)("div",{className:"px-3 pb-1 pt-2 text-[11px] font-medium uppercase tracking-wider text-gray-400",children:e.label}),e.products.map(e=>{let r=e.id===t;return(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":r,onClick:()=>{a(e.id),c(!1)},className:"flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-sm ".concat(r?"bg-gray-50 font-medium text-gray-900":"text-gray-700 hover:bg-gray-50"),children:[(0,n.jsx)("span",{className:"min-w-0 truncate",children:e.label}),r&&(0,n.jsx)(o.A,{className:"h-4 w-4 shrink-0 text-gray-500"})]},e.id)})]},e.id))})]})}function h(e){let{isOpen:t,onClose:a,userEmail:s,userName:l,messageId:o,initialRating:h=null,initialFeedback:x,feedbackContext:p,onSubmit:g}=e,[f,y]=(0,r.useState)(""),[b,v]=(0,r.useState)(""),[w,j]=(0,r.useState)(""),[N,k]=(0,r.useState)(null),[C,S]=(0,r.useState)(h),[E,A]=(0,r.useState)(!1),[T,L]=(0,r.useState)(!1),M=(0,r.useRef)(null),_=!o&&!g&&!p;(0,r.useEffect)(()=>{S(h)},[h]),(0,r.useEffect)(()=>{t&&x&&y(x)},[t,x]),(0,r.useEffect)(()=>{var e;t&&(j(null!=(e=(0,u.xt)(window.location.href))?e:""),k(null),M.current&&!_&&M.current.focus())},[t,_]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&a()};return t&&(document.addEventListener("keydown",e),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.body.style.overflow="unset"}},[t,a]);let F=async()=>{if(g){if(!C)return;A(!0);try{await g(C,f),y(""),L(!0),setTimeout(()=>{L(!1),a()},1500)}catch(e){console.error("Error submitting feedback:",e),alert("Failed to submit feedback. Please try again.")}finally{A(!1)}return}if(_){if(!w)return void k("Choose a product.");if(b.trim().length<3)return void k("Add a short title.");A(!0),k(null);try{let e=await fetch("/api/feedback/board",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.trim(),details:f.trim(),productId:w,pageUrl:window.location.href})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error("string"==typeof t.error?t.error:"Failed to submit feedback")}"function"==typeof(null===d.Ay||void 0===d.Ay?void 0:d.Ay.capture)&&d.Ay.capture("feedback_submitted",{source:"modal",product_id:w,page_url:window.location.href}),v(""),y(""),L(!0),setTimeout(()=>{L(!1),a()},1500)}catch(e){console.error("Error submitting feedback:",e),k(e instanceof Error?e.message:"Failed to submit feedback. Please try again.")}finally{A(!1)}return}if(f.trim()){A(!0);try{let e="function"==typeof(null===d.Ay||void 0===d.Ay?void 0:d.Ay.get_session_id)?d.Ay.get_session_id():void 0,t="function"==typeof(null===d.Ay||void 0===d.Ay?void 0:d.Ay.get_distinct_id)?d.Ay.get_distinct_id():void 0;if(!(await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:f,pageUrl:window.location.href,userEmail:s,userName:l,posthogSessionId:e,posthogDistinctId:t,...p})})).ok)throw Error("Failed to submit feedback");"function"==typeof(null===d.Ay||void 0===d.Ay?void 0:d.Ay.capture)&&d.Ay.capture("feedback_submitted",{source:"modal",page_url:window.location.href,has_session_context:!!(e||t)}),y(""),L(!0),setTimeout(()=>{L(!1),a()},1500)}catch(e){console.error("Error submitting feedback:",e),alert("Failed to submit feedback. Please try again.")}finally{A(!1)}}};return t?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:a}),(0,n.jsxs)("div",{className:"relative bg-white rounded-lg shadow-xl border border-gray-200 w-full max-w-md max-h-[90vh] overflow-hidden flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 flex-shrink-0",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:o?"Message Feedback":"Feedback"}),(0,n.jsx)("button",{onClick:a,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close feedback",children:(0,n.jsx)(c.A,{className:"w-5 h-5"})})]}),(0,n.jsxs)("div",{className:"p-4 overflow-y-auto flex-1",children:[o&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"How was this response?"}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsxs)("button",{onClick:()=>S("thumbs_up"),className:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg border-2 transition-all ".concat("thumbs_up"===C?"border-green-500 bg-green-50 text-green-700":"border-gray-300 bg-white text-gray-700 hover:border-gray-400"),children:[(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.
1163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"})}),(0,n.jsx)("span",{className:"font-medium",children:"Helpful"})]}),(0,n.jsxs)("button",{onClick:()=>S("thumbs_down"),className:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg border-2 transition-all ".concat("thumbs_down"===C?"border-red-500 bg-red-50 text-red-700":"border-gray-300 bg-white text-gray-700 hover:border-gray-400"),children:[(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 019.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"})}),(0,n.jsx)("span",{className:"font-medium",children:"Not helpful"})]})]})]}),_&&(0,n.jsxs)("div",{className:"mb-4 space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"feedback-product",className:"block text-sm font-medium text-gray-700 mb-2",children:"Product"}),(0,n.jsx)(m,{value:w,onChange:j,disabled:E})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"feedback-title",className:"block text-sm font-medium text-gray-700 mb-2",children:"Title"}),(0,n.jsx)("input",{id:"feedback-title",value:b,onChange:e=>v(e.target.value),maxLength:140,placeholder:"Short, descriptive title",disabled:E,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-400"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:o?"Additional feedback (optional)":_?"Details":"Ideas to improve your experience with UpgradedAI"}),(0,n.jsx)("textarea",{ref:M,value:f,onChange:e=>y(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),F()),"Escape"===e.key&&a()},placeholder:o?"Tell us more about your experience...":_?"Anything else that would help":"Ideas to improve this page...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md resize-none focus:outline-none focus:ring-2 focus:ring-gray-400 focus:border-transparent text-sm text-gray-900 placeholder-gray-400",disabled:E})]}),N&&(0,n.jsx)("p",{className:"mt-2 text-sm text-red-600",children:N}),(0,n.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,n.jsxs)("div",{className:"text-xs text-gray-500",children:["Need help?"," ",(0,n.jsx)("a",{href:"https://join.slack.com/share/enQtMTAxMjU2MjM1NzIwMzQtYWZmMTJlMGQ5MjhmMGEyNTBjZjFkOWUxNDE5MTBmN2RhNDFiM2EzOTEwYjBkOTMzZjhjZGUyOTA2MWFjNGRlMA",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 underline",children:"Contact us"})," \xb7 ",(0,n.jsx)(i(),{href:"/learn",className:"text-blue-600 hover:text-blue-700 underline",children:"Learn"})," \xb7 ",(0,n.jsx)(i(),{href:"/feedback",className:"text-blue-600 hover:text-blue-700 underline",children:"Feedback"})," \xb7 ",(0,n.jsx)(i(),{href:"/roadmap",className:"text-blue-600 hover:text-blue-700 underline",children:"Roadmap"})]}),(0,n.jsx)("button",{onClick:F,disabled:E||T||(o?!C:_?!w||b.trim().length<3:!f.trim()),className:"px-4 py-2 bg-gray-800 text-white text-sm font-medium rounded-md hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",children:E?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Sending..."]}):T?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"
1currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Sent!"]}):(0,n.jsxs)(n.Fragment,{children:["Send",(0,n.jsxs)("kbd",{className:"hidden sm:inline-flex items-center px-1.5 py-0.5 text-xs font-semibold text-gray-500 bg-gray-100 border border-gray-200 rounded",children:[(0,n.jsx)("span",{className:"text-xs",children:"â"}),(0,n.jsx)("span",{className:"ml-0.5",children:"âµ"})]})]})})]})]})]})]}):null}}}]);
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.