PageSourceSearch

https://app.jungleai.com/assets/QuestionQualityUpsellModal-COeIPCTY.js

js jungleai.com collected 2026-09-24 12:17:00 UTC 16,507 bytes, 2 lines download raw bytes

1import{r as a,j as e,B as C,T as s,h as te,g as oe,a0 as pe,ap as rt}from"./MarketingSiteLoadingFallback-DF4Bevx8.js";import{u as xe,h as n,v as lt,az as U,a as it,c as at,b as st,t as ue,c4 as ct,aD as ke,w as Ne,c5 as dt,c6 as pt,aE as ut,aC as mt,aF as xt,aG as ht,aH as ft,aI as gt,B as Fe}from"./renderJungleWebApp-Bj6DEPtG.js";import{F as m,a as We}from"./landingHandoffUploadClaim-ZWzmhSYt.js";import{trackError as Be}from"./track-error-fzCnz4fY.js";import"./liveKitConversationSession---BmuIoa.js";import{U as h,a as f}from"./upsellCopyConstants-7GcPfyS8.js";import{g as Oe,T as Qe,P as bt}from"./ProToEliteUpgradeSuccessModal-D_LSF3jc.js";import{u as yt}from"./use-toast-CNa_0lX8.js";import{f as Ct}from"./stripe-price-details-Q-KLtuJy.js";import"./frontend-release-DHVEZwfg.js";import"./hub-CmyV34zS.js";import"./index-rQLcFmgX.js";import"./legacy-referrer-id-B23nat6c.js";import"./main-CR0pPclt.js";import"./document-upload-sentry-CwY_2GoS.js";import"./jungle_river-fkLKo0Re.js";import"./sentry-init-DYpmux4V.js";import"./client-environment-BMTHOZAb.js";import"./microphone-access-Bai3iDRY.js";const _t="/assets/quality-elite-bar-texture-CKQ-F7fE.png",D=h.quality,q=f.quality,Ie=70,St=50,jt=[49,43,41,40,37],Et=Ie,me=["#8B95A1","#9AA3AE","#A9B1BB","#B8BFC8","#C7CDD5"];function Tt({row:c}){return e.jsxs(m,{align:"center",gap:"10px",w:"100%",children:[e.jsx(s,{w:{base:"112px",md:"128px"},flexShrink:0,textAlign:"right",fontSize:"13px",fontWeight:c.isJungleRow?600:400,color:c.isJungleRow?n.accentColors.successStrong:n.text.label,children:c.label}),e.jsx(C,{flex:"1 1 0",minW:0,children:e.jsx(C,{width:`${Math.round(c.score/Et*100)}%`,height:"22px",borderRadius:"4px",bg:c.barColor,position:"relative",overflow:"hidden",children:c.hasTextureOverlay&&e.jsx(We,{src:_t,alt:"","aria-hidden":"true",position:"absolute",inset:"0",width:"100%",height:"100%",objectFit:"cover",opacity:.2,draggable:!1})})}),e.jsx(s,{w:"28px",flexShrink:0,fontSize:"14px",fontWeight:700,color:n.text.header,children:c.score})]})}const Pt=a.memo(function({eliteDisplayName:t}){const{t:x}=xe(),b=[{label:x(D.chartRowJungleElite,q.chartRowJungleElite,{eliteDisplayName:t}),score:Ie,barColor:n.primaryAction.hover,isJungleRow:!0,hasTextureOverlay:!0}
1,{label:x(D.chartRowJunglePro,q.chartRowJunglePro),score:St,barColor:n.primaryAction.default,isJungleRow:!0},...jt.map((_,T)=>({label:x(D.chartRowCompetitor,q.chartRowCompetitor,{index:T+1}),score:_,barColor:me[T]??me[me.length-1],isJungleRow:!1}))];return e.jsxs(C,{children:[e.jsx(m,{direction:"column",gap:"8px",children:b.map(_=>e.jsx(Tt,{row:_},_.label))}),e.jsx(s,{color:n.text.placeholder,fontSize:"11px",lineHeight:"1.5",mt:"14px",children:x(D.footnoteCompetitors,q.footnoteCompetitors)}),e.jsx(s,{color:n.text.placeholder,fontSize:"11px",lineHeight:"1.5",mt:"8px",children:x(D.footnoteMethodology,q.footnoteMethodology)})]})}),At="/assets/voice-call-monkey-DKeTijir.png",l=h.voiceQuota,i=f.voiceQuota,ne=h.quality,re=f.quality,ze=h.planCard,$e=f.planCard,F={monthlyPerMonth:"30",annualPerMonth:"15",annualTotal:"180",monthlyTimesTwelve:"360"};function Mt(){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",width:"18",height:"18",style:{flexShrink:0,marginTop:"3px"},"aria-hidden":"true",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:n.accentColors.successStrong,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function y({children:c}){return e.jsxs(m,{align:"flex-start",gap:"10px",w:"100%",children:[e.jsx(Mt,{}),e.jsx(s,{color:n.text.body,fontSize:"15px",lineHeight:"1.45",children:c})]})}function Lt({expiresAtMs:c}){const{t}=xe(),x=h.masteryOffer,b=f.masteryOffer,[_,T]=a.useState("");return a.useEffect(()=>{const g=()=>{const w=Math.max(0,c-Date.now()),j=Math.floor(w/36e5),o=Math.floor(w%36e5/6e4),E=Math.floor(w%6e4/1e3);T(`${j}:${o.toString().padStart(2,"0")}:${E.toString().padStart(2,"0")}`)};g();const v=window.setInterval(g,1e3);return()=>window.clearInterval(v)},[c]),e.jsxs(C,{mt:"14px",p:"14px 16px",borderRadius:"14px",border:`1.5px solid ${n.primaryAction.default}`,bg:n.primaryAction.light2,children:[e.jsx(s,{fontSize:"14px",fontWeight:700,color:n.primaryAction.hover,children:t(x.claimTitle,b.claimTitle)}),e.jsxs(s,{fontSize:"13px",color:n.text.body,mt:"4px",children:[t(x.claimExpiresPrefix,b.claimExpiresPrefix)," ",e.jsx(C,{as:"span",fontWeight:700,color:n.primaryAction.default,children:_||"24:00:00"}),". ",t(x.claimAppliesAtCheckout,b.claimAppliesAtCheckout)]})]})}function He({selected:c,onClick:t,ariaLabel:x,children:b}){return e.jsx(C,{as:"button",type:"button",onClick:t,"aria-pressed":c,"aria-label":x,w:"100%",textAlign:"left",borderRadius:"14px",padding:"14px 16px",bg:c?n.primaryAction.light2:n.surface.white,border:`${c?"1.5px":"1px"} solid ${c?n.primaryAction.default:n.surface.border}`,transition:"border-color 0.15s ease, background-color 0.15s ease",cursor:"pointer",_hover:{borderColor:c?n.primaryAction.default:n.surface.hoverBorder},_focusVisible:{outline:`2px solid ${n.primaryAction.default}`,outlineOffset:"2px"},children:b})}const Kt=a.memo(function(){var Ue,ve,we,Z,Re;const{t}=xe(),{onClickSubscriptionUpgradeButton:x,getProToEliteUpgradePreview:b,commitProToEliteUpgrade:_}=lt(),T=yt(),g=U(r=>r.isQuestionQualityUpsellModalOpen),v=U(r=>r.closeQuestionQualityUpsellModal),w=U(r=>r.hideSubscriptionUpsellModal),j=U(r=>r.entryPointForQuestionQualityUpsellModal),o=it(r=>r.currentUser);U(r=>r.openMasteryChallenge),U(r=>r.closeQuestionQualityUpsellModal);const E=at(r=>r.currentCardData),R=st(r=>r.currentReviewDeck),P=j==="voice_free_limit_reached_mid_call"||j==="voice_free_limit_blocked_pre_call",G=P?"voice free weekly limit upsell modal":j==="two_step_upsell_step_two"?"question quality upsell modal - see more from step two":"question quality upsell modal - generation options floating cta",[B,he]=a.useState(te.ANNUAL),A=B===te.ANNUAL;a.useEffect(()=>{le(!1)},[g,B]);const[fe,K]=a.useState(null),[Ye,J]=a.useState(null),[De,ge]=a.useState(!1),[O,le]=a.useState(!1),[ie,be]=a.useState(!1),[M,ye]=a.useState(null),Ce=a.useRef(b);Ce.current=b,a.useEffect(()=>{g&&ue(Qe.qualityModalViewed,{...Oe(o),context:G,upsell_view:"question_quality_modal",entry_point:j},o)},[g]);const[p,qe]=a.useState(null);a.useEffect(()=>{if(!g||!o)return;let r=!1;return ct(o).then(u=>{r||qe(u)}).catch(()=>{}),()=>{r=!0}},[g,o]);const _e=(o==null?void 0:o.student_type)??null,Q=ke(oe.ELITE,_e),{userSubscriptionPlan:ae}=a.useMemo(()=>Ne(o),[o==null?void 0:o.subscription_information]),Se=ae===oe.SUPER_LEARNER,Ge=ke(ae,_e),se=ae===oe.FREE,S=o==null?void 0:o.subscription_information,Ke=(S==null?void 0:S.subscription_period_type)==="annual"?"annual"
1:"monthly",Je=(S==null?void 0:S.manager_subscription_account)===pe.Stripe,k=Se&&Je;((E==null?void 0:E.card_key_concept_name)||"").trim(),((R==null?void 0:R.name)||"").trim(),R!=null&&R.id||E!=null&&E.deck_id,(Ue=o==null?void 0:o.voice_mastery_challenge)==null||Ue.attempts_used;const je=S==null?void 0:S.manager_subscription_account,Ve=je!==pe.Apple&&je!==pe.Google,z=(ve=o==null?void 0:o.voice_mastery_challenge)==null?void 0:ve.discount,ce=z&&!z.consumed&&typeof z.expires_at=="number"&&z.expires_at*1e3>Date.now()?z.expires_at*1e3:null,Xe=P&&ce!=null&&Ve,Ee=k&&Ke==="annual",N=A||Ee?"annual":"monthly";a.useEffect(()=>{if(!g||!k||!o){K(null),J(null);return}let r=!1;return K(null),J(null),Ce.current(o,N).then(u=>{r||(u.status==="ok"&&u.proratedAmountInCents!=null?(K(u.proratedAmountInCents),J(u.currency??null)):(K(null),J(null),u.status==="error"&&Be(new Error(`pro_to_elite_preview_failed:${u.errorCode}`),{scope:"pro-to-elite-preview",userId:o.id,extra:{errorCode:u.errorCode,targetPeriod:N}})))}),()=>{r=!0}},[g,k,o==null?void 0:o.id,N]);const $=(we=o==null?void 0:o.subscription_information)==null?void 0:we.ai_voice_quota_information,Ze=Math.max(1,Math.round((($==null?void 0:$.free_seconds_per_week)??dt)/60)),Te=a.useMemo(()=>{const r=pt($,Date.now());if(!r||Number.isNaN(r))return null;try{return new Date(r).toLocaleDateString(void 0,{weekday:"long"})}catch{return null}},[$]),d=p==null?void 0:p.priceDetails,H=((Re=(Z=d==null?void 0:d.currency)==null?void 0:Z.toString)==null?void 0:Re.call(Z))??"USD",et=H==="USD"||H==="usd",L=ut((d==null?void 0:d.symbol)??"$",H),V=r=>et?r:null,de=(p==null?void 0:p.formattedEliteMonthlyPrice)??V(F.monthlyPerMonth),Pe=(p==null?void 0:p.formattedEliteAnnualPriceProratedMonthly)??V(F.annualPerMonth),X=(p==null?void 0:p.formattedEliteFullAnnualPrice)??V(F.annualTotal),Ae=(p==null?void 0:p.formattedElitePriceOfMonthlyIfPaidForFullYear)??V(F.monthlyTimesTwelve),Me=A?X:de,W=fe==null?null:`${L}${Ct(fe,Ye??H)}`,Le=O?W?t(h.proToEliteConfirmation.armedChargeNotice,f.proToEliteConfirmation.armedChargeNotice,{amount:W}):t(h.proToEliteConfirmation.degradedModeGenericCharge,f.proToEliteConfirmation.degradedModeGenericCharge):W==null?null:Me?t(l.payTodayProratedWithRecurring,i.payTodayProratedWithRecurring,{today:W,recurring:`${L}${Me}`,period:A?t("year","year"):t("month","month")}):t(l.payTodayProrated,i.payTodayProrated,{amount:W});a.useEffect(()=>{},[]);const tt=a.useMemo(()=>{const r=Number(d==null?void 0:d.monthlyElitePrice),u=Number(d==null?void 0:d.annualElitePrice);if(r>0&&u>0&&r*12>u)return Math.round((r*12-u)/(r*12)*100);const I=Number(F.monthlyTimesTwelve),ee=Number(F.annualTotal);return Math.round((I-ee)/I*100)},[d==null?void 0:d.monthlyElitePrice,d==null?void 0:d.annualElitePrice]),ot=a.useCallback(async()=>{const{userVoiceFreeLimitDepletedCount:r,userSubscriptionPlan:u}=Ne(o),I=k&&!!o,ee=I&&O;if(ee||ue("Upgrade Subscription Upsell Clicked",{...mt(),context:G,reason_for_upsell:P?rt.VoiceCallFreeUsageLimitReached:U.getState().reasonForUpsell,...P?{number_of_times_free_voice_limit_depleted:r}:{},user_subscription_plan_at_time_of_click:u,selected_plan_period:B},o),ee||ue(Qe.upgradeToEliteFromQualityModalClicked,{...Oe(o),context:G,upsell_view:"question_quality_modal",entry_point:j,period_type_selected:A?"annual":"monthly",user_subscription_plan_at_time_of_click:u},o),I){if(!O){le(!0);return}le(!1),ge(!0);try{const Y=await _(o,N);if(Y.status==="error"){Be(new Error(`pro_to_elite_commit_failed:${Y.errorCode}`),{scope:"pro-to-elite-commit",userId:o.id,extra:{errorCode:Y.errorCode,targetPeriod:N}}),T({title:t(h.proToEliteConfirmation.commitFailedToastTitle,f.proToEliteConfirmation.commitFailedToastTitle),description:t(h.proToEliteConfirmation.commitFailedToastDescription,f.proToEliteConfirmation.commitFailedToastDescription),status:"error",duration:6e3,isClosable:!0});return}ye({chargedCents:Y.proratedAmountInCents??null,chargedCurrency:Y.currency??null}),v(),w()}finally{ge(!1)}return}if(!ie){be(!0);try{await x(o,oe.ELITE,B,p)}catch{}finally{be(!1)}}},[o,B,p,x,v,w,k,N,_,T,j,G,P,A,ie,O]),nt=n.surface.primary;return e.jsxs(e.Fragment,{children:[e.jsxs(xt,{isCentered:!0,isOpen:g,onClose:v,size:{base:"full",md:"4xl"},scrollBehavior:"inside",children:[e.jsx(ht,{bg:"rgba(18, 18, 18, 0.45)"}),e.jsx(ft,{borderRadius:{base:"0",md:"20px"}
1,overflow:"hidden",w:"100%",maxW:{base:"100%",md:"760px"},minH:{base:"100dvh",md:"auto"},maxH:{base:"100dvh",md:"90vh"},overflowY:"auto",boxShadow:"0px 12px 48px 0px rgba(6, 38, 6, 0.18)",m:{base:"0",md:void 0},children:e.jsx(gt,{padding:"0px",children:e.jsxs(m,{direction:{base:"column",md:"row"},align:"stretch",minH:{base:"100dvh",md:"auto"},justify:{base:"space-between",md:"flex-start"},children:[P?e.jsxs(C,{flex:{base:"none",md:"1 1 55%"},bg:n.surface.white,padding:{base:"26px 24px 8px",md:"40px 36px"},children:[e.jsx(s,{color:n.text.header,fontSize:"20px",fontWeight:600,lineHeight:"1.3",children:t(l.modalTitle,i.modalTitle,{minutes:Ze})}),Te&&e.jsx(s,{color:n.text.placeholder,fontSize:"12px",lineHeight:"1.4",mt:"6px",children:t(l.resetsLine,i.resetsLine,{when:Te})}),e.jsxs(m,{align:"flex-start",gap:"14px",mt:"20px",mb:"22px",children:[e.jsx(We,{src:At,alt:"","aria-hidden":"true",h:{base:"140px",md:"160px"},w:"auto",maxW:"164px",objectFit:"contain",flexShrink:0,draggable:!1}),e.jsx(C,{bg:n.secondaryAction.light,borderRadius:"14px 14px 14px 0px",padding:"12px 16px",children:e.jsx(s,{color:n.text.body,fontSize:"14px",lineHeight:"1.3",children:t(l.companionBubble,i.companionBubble)})})]}),e.jsx(s,{color:n.text.label,fontSize:"15px",fontWeight:500,lineHeight:"1.45",mb:"12px",children:Se?t(l.valueHeaderFromPlan,i.valueHeaderFromPlan,{currentPlanName:Ge,planName:Q}):t(l.valueHeaderDirect,i.valueHeaderDirect,{planName:Q})}),e.jsxs(m,{direction:"column",gap:"10px",children:[e.jsx(y,{children:t(l.bulletStep1Templates,i.bulletStep1Templates)}),se&&e.jsx(y,{children:t(l.bulletUnlimitedGenerations,i.bulletUnlimitedGenerations)}),e.jsx(y,{children:t(l.bulletQualityBoost,i.bulletQualityBoost)}),se&&e.jsxs(e.Fragment,{children:[e.jsx(y,{children:t(l.bulletUnlimitedChat,i.bulletUnlimitedChat)}),e.jsx(y,{children:t(l.bulletMoreQuestionsPerUpload,i.bulletMoreQuestionsPerUpload)})]})]})]}):e.jsxs(C,{flex:{base:"none",md:"1 1 55%"},bg:n.surface.white,padding:{base:"26px 24px 8px",md:"40px 36px"},children:[e.jsx(s,{color:n.text.header,fontSize:"20px",fontWeight:600,lineHeight:"1.3",children:t(ne.title,re.title)}),e.jsx(s,{color:n.text.placeholder,fontSize:"13px",lineHeight:"1.4",mt:"8px",mb:"18px",children:t(ne.subtitle,re.subtitle)}),e.jsx(Pt,{eliteDisplayName:Q}),e.jsx(s,{color:n.text.label,fontSize:"15px",fontWeight:500,mt:"18px",mb:"10px",children:t(ne.plusLine,re.plusLine)}),e.jsxs(m,{direction:"column",gap:"10px",mb:"12px",children:[e.jsx(y,{children:t(ze.eliteAiVoiceMode,$e.eliteAiVoiceMode)}),e.jsx(y,{children:t(ze.eliteStep1Templates,$e.eliteStep1Templates)}),se&&e.jsxs(e.Fragment,{children:[e.jsx(y,{children:t(l.bulletUnlimitedGenerations,i.bulletUnlimitedGenerations)}),e.jsx(y,{children:t(l.bulletUnlimitedChat,i.bulletUnlimitedChat)}),e.jsx(y,{children:t(l.bulletMoreQuestionsPerUpload,i.bulletMoreQuestionsPerUpload)})]})]})]}),e.jsxs(m,{direction:"column",flex:{base:"none",md:"1 1 45%"},bg:nt,padding:{base:"8px 24px 28px",md:"40px 36px"},gap:{base:"28px",md:"20px"},justify:"space-between",children:[e.jsx(m,{direction:"column",gap:"10px",pb:"24px",children:e.jsxs(m,{direction:"column",gap:"12px",children:[e.jsxs(He,{selected:A,onClick:()=>he(te.ANNUAL),ariaLabel:t(l.planYearlyLabel,i.planYearlyLabel),children:[e.jsxs(m,{justify:"space-between",align:"center",mb:X?"4px":"0",children:[e.jsx(s,{color:n.text.header,fontSize:"16px",fontWeight:600,children:t(l.planYearlyLabel,i.planYearlyLabel)}),e.jsx(C,{bg:n.primaryAction.light2,borderRadius:"8px",padding:"3px 10px",children:e.jsx(s,{color:n.accentColors.successStrong,fontSize:"13px",fontWeight:600,children:t(l.annualSavingsBadge,i.annualSavingsBadge,{discount:tt})})})]}),e.jsxs(m,{justify:"space-between",align:"baseline",gap:"8px",children:[e.jsxs(m,{align:"baseline",gap:"8px",children:[Ae&&e.jsx(s,{color:n.text.placeholder,fontSize:"15px",textDecoration:"line-through",children:`${L}${Ae}`}),e.jsx(s,{color:n.text.header,fontSize:"16px",fontWeight:600,children:X?`${L}${X}`:t(h.planCard.priceLoading,f.planCard.priceLoading)})]}),Pe&&e.jsx(s,{color:n.text.label,fontSize:"14px",children:t(l.pricePerMonth,i.pricePerMonth,{price:`${L}${Pe}`})})]})]}),!Ee&&e.jsx(He,{selected:!A,onClick:()=>he(te.MONTHLY),ariaLabel:t(l.planMonthlyLabel,i.planMonthlyLabel),children:e.jsxs(m,{justify:"space-between",align:"center",children:[e.jsx(s,{color:n.text.header,fontSize:"16px",fontWeight:600,children:t(l.planMonthlyLabel,i.planMonthlyLabel)}),e.jsx(s,{color:n.text.label,fontSize:"14px",children:de?t(l.pricePerMonth,i.pricePerMonth,{price:`${L}${de}`}):t(h.planCard.priceLoading,f.planCard.priceLoading)})]})})]})}),e.jsxs(m,{direction:"column",align:"center",gap:"14px",children:[Le&&e.jsx(s,{color:n.text.label,fontSize:"14px",textAlign:"center",children:Le}),null,Xe&&ce!=null?e.jsx(Lt,{expiresAtMs:ce}):null,e.jsx(Fe,{title:k&&O?t(h.proToEliteConfirmation.armedCta,f.proToEliteConfirmation.armedCta):P?t(l.cta,i.cta):t(ne.upgradeCta,re.upgradeCta,{eliteDisplayName:Q.toLowerCase()}),onClick:ot,size:"large",w:"100%",isLoading:De||ie,shouldAllowTitleToWrap:!0,shouldAddButtonGlowingRaysEffect:!0}),e.jsx(Fe,{title:t(l.dismiss,i.dismiss),onClick:v,buttonStyleType:"text",buttonPrimaryOrSecondaryType:"primary",size:"medium"})]})]})]})})})]}),e.jsx(bt,{isOpen:M!=null,onClose:()=>ye(null),planName:Q,chargedCents:(M==null?void 0:M.chargedCents)??null,currencySymbol:L,currencyCode:(M==null?void 0:M.chargedCurrency)??H})]})});export{Kt as QuestionQualityUpsellModal};
2//# sourceMappingURL=QuestionQualityUpsellModal-COeIPCTY.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.