PageSourceSearch

https://scholarlyhelp.com/_next/static/chunks/2579.de259fbf71330b0b.js

js scholarlyhelp.com collected 2026-10-03 20:41:28 UTC 25,321 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2579],{22579:function(e,r,t){"use strict";t.r(r);var a=t(61943),n=t(25788),s=t(11735),l=t(57437),o=t(2265),i=t(41942),c=t(98920),d=t(94962),u=t(48388);t(7395);var g=t(69660),b=t(93587),m=t(26806),f=t(7883),x=t(98120),h=t(93239),p=t(62181),y=t(40170),v=t(35089),k=t(85092),j=[{id:"auto",label:"Auto-detect",subject:"general"},{id:"college-algebra",label:"College algebra",subject:"math"},{id:"statistics",label:"Statistics",subject:"math"},{id:"dosage-calc",label:"Dosage calc",subject:"math"},{id:"business-math",label:"Business math",subject:"math"},{id:"calculus",label:"Calculus",subject:"math"}],w=[{id:"basic",label:"Basic",keys:[{label:"x\xb2",insert:"^2"},{label:"xⁿ",insert:"^()",back:1},{label:"√",insert:"√()",back:1},{label:"ⁿ√",insert:"root()()",back:3},{label:"a/b",insert:"()/()",back:4},{label:"(",insert:"("},{label:")",insert:")"},{label:"+",insert:" + "},{label:"−",insert:" - "},{label:"\xd7",insert:" \xd7 "},{label:"\xf7",insert:" \xf7 "},{label:"=",insert:" = "},{label:"\xb1",insert:"\xb1"},{label:"\xb7",insert:"\xb7"},{label:"%",insert:"%"}]},{id:"trig",label:"sin cos",keys:[{label:"sin",insert:"sin()",back:1},{label:"cos",insert:"cos()",back:1},{label:"tan",insert:"tan()",back:1},{label:"cot",insert:"cot()",back:1},{label:"sec",insert:"sec()",back:1},{label:"csc",insert:"csc()",back:1},{label:"sin⁻\xb9",insert:"arcsin()",back:1},{label:"cos⁻\xb9",insert:"arccos()",back:1},{label:"tan⁻\xb9",insert:"arctan()",back:1},{label:"sinh",insert:"sinh()",back:1},{label:"cosh",insert:"cosh()",back:1},{label:"tanh",insert:"tanh()",back:1},{label:"log",insert:"log()",back:1},{label:"ln",insert:"ln()",back:1},{label:"logₐ",insert:"log_()",back:1}]},{id:"symbols",label:"≥ ≠",keys:[{label:"≤",insert:"≤"},{label:"≥",insert:"≥"},{label:"≠",insert:"≠"},{label:"≈",insert:"≈"},{label:"∞",insert:"∞"},{label:"\xb0",insert:"\xb0"},{label:"∝",insert:"∝"},{label:"→",insert:" → "},{label:"∑",insert:"∑"},{label:"∏",insert:"∏"},{label:"∫",insert:"∫()",back:1},{label:"∂",insert:"∂"},{label:"∇",insert:"∇"},{label:"∈",insert:"∈"},{label:"≅",insert:"≅"}]},{id:"greek",label:"αβγ",keys:[{label:"α",insert:"α"},{label:"β",insert:"β"},{label:"γ",insert:"γ"},{label:"δ",insert:"δ"},{label:"θ",insert:"θ"},{label:"λ",insert:"λ"},{label:"μ",insert:"μ"},{label:"π",insert:"π"},{label:"ρ",insert:"ρ"},{label:"σ",insert:"σ"},{label:"τ",insert:"τ"},{label:"φ",insert:"φ"},{label:"ω",insert:"ω"},{label:"Δ",insert:"Δ"},{label:"Ω",insert:"Ω"}]}];function N(e,r){try{return u.ZP.renderToString(e.trim(),{displayMode:r,throwOnError:!1,output:"html"})}catch(r){return e}}var _=function(e){var r=e.tex;return(0,l.jsx)("div",{className:"my-1 overflow-x-auto",dangerouslySetInnerHTML:{__html:N(r,!0)}})},S=function(e){var r=e.tex;return(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:N(r,!1)}})},R=" DOLLAR ",$=function(e){var r=e.text,t=e.className,a=(function(e){if(!e||e.includes("$")||!/\\[a-zA-Z]+|[\^_]/.test(e))return e;for(var r=function(r){for(var t=0,a=r;a<e.length;a++)if("{"===e[a])t++;else if("}"===e[a]&&0==--t)return a+1;return e.length},t=function(t){var a=e[t];if("\\"===a){var n=/^\\[a-zA-Z]+/.exec(e.slice(t));if(!n)return Math.min(t+2,e.length);for(var s=t+n[0].length;"{"===e[s];)s=r(s);return s}if("^"===a||"_"===a){var l=t+1;return"{"===e[l]?r(l):Math.min(l+1,e.length)}return -1},a=function(e){return/[0-9.+\-=×*/()]/.test(e)},n="",s=0;s<e.length;)!function(){var r=e[s];if("\\"!==r&&"^"!==r&&"_"!==r)return n+=r,s++;var l="";n=n.replace(/([0-9.]+\s*)$/,function(e){return l=e,""});for(var o=l,i=s;i<e.length;){var c=t(i);if(c>i){o+=e.slice(i,c),i=c;continue}if(a(e[i])){o+=e[i++];continue}if(" "===e[i]){for(var d=i;" "===e[d];)d++;if(t(d)>d||e[d]&&a(e[d])){o+=e.slice(i,d),i=d;continue}}break}n+="$".concat(o.trim(),"$"),s=i}();return n})((r||"").replace(/\\\$/g,R).replace(/\\\[([\s\S]+?)\\\]/g,function(e,r){return"$$".concat(r,"$$")}).replace(/\\\(([\s\S]+?)\\\)/g,function(e,r){return"$".concat(r,"$")})).split(/(\$\$[\s\S]+?\$\$|\$[^$\n]+?\$)/g);return(0,l.jsx)("span",{className:t,children:a.map(function(e,r){return e.startsWith("$$")&&e.endsWith("$$")?(0,l.jsx)(_,{tex:e.slice(2,-2)},r):e.startsWith("$")&&e.endsWith("$")&&e.length>2?(0,l.jsx)(S,{tex:e.slice(1,-1)},r):(0,l.jsx)("span",{children:e.split(R).join("$")},r)})})};r.default=function(e){var r,u,N,S,R,C=e.setFlag,L=(0,n._)((0,o.useState)(null),2),P=L[0],U=L[1],E=(0,n._)((0,o.useState)("text"),2),O=E[0],A=E[1],D=(0,n._)((0,o.useState)("auto"),2),Z=D[0],I=D[1],T=(0,n._)((0,o.useState)("general"),2),F=T[0],z=T[1],J=(0,n._)((0,o.useState)(""),2),M=J[0],B=J[1],q=(0,n._)((0,o.useState)(null),2),G=q[0],W=q[1],H=(0,n._)((0,o.useState)(""),2),V=H[0],K=H[1],Q=(0,n._)((0,o.useState)(!1),2),X=Q[0],Y=Q[1],ee=(0,n._)((0,o.useState)(null),2),er=ee[0],et=ee[1],ea=(0,n._)((0,o.useState)(""),2),en=ea[0],es=ea[1],el=(0,n._)((0,o.useState)(!1),2),eo=el[0],ei=el[1],ec=(0,n._)((0,o.useState)("basic"),2),ed=ec[0],eu=ec[1],eg=(0,p.P)("math-solver",function(e){e.problem&&B(e.problem),e.subject&&(z(e.subject),I("general"===e.subject?"auto":"college-algebra"))}).stashDraft;(0,y.d)("math-solver",function(){return{problem:M,subject:F}});var eb=(0,f.N)({getDraft:function(){return{problem:M,subject:F}},stashDraft:eg}),em=eb.gateOpen,ef=eb.closeGate,ex=eb.guardAiClick,eh=(0,o.useRef)(null),ep=(0,o.useRef)(null),ey=(0,o.useRef)(null),ev=(0,o.useRef)(null),ek=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=ep.current,a=t?t.selectionStart:M.length,n=t?t.selectionEnd:M.length;B(M.slice(0,a)+e+M.slice(n));var s=a+e.length-r;requestAnimationFrame(function(){ep.current&&(ep.current.focus(),ep.current.setSelectionRange(s,s))})};(0,o.useEffect)(function(){U((0,k.hP)())},[]),(0,o.useEffect)(function(){return function(){V&&URL.revokeObjectURL(V)}},[V]),(0,o.useEffect)(function(){var e=function(){B(h.J),I("statistics"),z("math"),et(null),es(""),requestAnimationFrame(function(){var e,r;null===(e=ep.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"}),null===(r=ep.current)||void 0===r||r.focus()})};return window.addEventListener(h.O,e),function(){return window.removeEventListener(h.O,e)}},[]);var ej="https://api.scholarlyhelp.com/v1",ew=function(e){if(e){if(!e.type.startsWith("image/")){d.ZP.error("Please choose an image file.");return}W(e),V&&URL.revokeObjectURL(V),K(URL.createObjectURL(e)),A("image")}},eN=(r=(0,a._)(function(){return(0,s.Jh)(this,function(e){return"text"!==O||M.trim()?"image"!==O||G?ex((0,a._)(function(){var e,r,t,a,n,l,o,i,u,b,m,f,x,h;return(0,s.Jh)(this,function(s){switch(s.label){case 0:(0,g.a)({toolName:"STEM Solver"}),Y(!0),es(""),et(null),s.label=1;case 1:if(s.trys.push([1,6,7,8]),"image"!==O)return[3,3];return(t=new FormData).append("image",G),M.trim()&&t.append("problem",M.trim()),t.append("subject",F),[4,c.Z.post("".concat(ej,"/tools/stem-solver/image"),t,{headers:{Authorization:"Bearer ".concat(P)}})];case 2:return e=null!==(n=null===(r=(a=s.sent()).data)||void 0===r?void 0:r.data)&&void 0!==n?n:a.data,[3,5];case 3:return[4,c.Z.post("".concat(ej,"/tools/stem-solver/text"),{problem:M.trim(),subject:F},{headers:{Authorization:"Bearer ".concat(P),"Content-Type":"application/json"}})];case 4:e=null!==(i=null===(l=(o=s.sent()).data)||void 0===l?void 0:l.data)&&void 0!==i?i:o.data,s.label=5;case 5:return(null==e?void 0:e.status)==="success"&&e.solution?(et(e.solution),C(!0),d.ZP.success("Solved!")):(es("Could not solve this problem. Please try again."),d.ZP.error("Could not solve this problem.")),[3,8];case 6:return es(h=(null==(u=s.sent())?void 0:null===(m=u.response)||void 0===m?void 0:null===(b=m.data)||void 0===b?void 0:b.message)||(Array.isArray(null==u?void 0:null===(x=u.response)||void 0===x?void 0:null===(f=x.data)||void 0===f?void 0:f.message)?u.response.data.message.join(", "):null==u?void 0:u.message)||"Something went wrong. Please try again."),d.ZP.error(h),[3,8];case 7:return Y(!1),[7];case 8:return[2]}})})):(es("Please upload an image of the problem."),d.ZP.error("Please upload an image.")):(es("Please enter a problem to solve."),d.ZP.error("Please enter a problem.")),[2]})}),function(){return r.apply(this,arguments)}),e_=(u=(0,a._)(function(e){return(0,s.Jh)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(e)];case 1:return r.sent(),d.ZP.success("Copied!"),[3,3];case 2:return r.sent(),d.ZP.error("Failed to copy."),[3,3];case 3:return[2]}})}),function(e){return u.apply(this,arguments)}),eS=function(e,r){var t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download=r,a.click(),URL.revokeObjectURL(t)},eR=function(e){return new Promise(function(r,t){var a=new Image,n=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),s=URL.createObjectURL(n);a.onload=function(){var e=document.createElement("canvas");e.width=2*(a.width||320),e.height=2*(a.height||320);var n=e.getContext("2d");if(!n)return URL.revokeObjectURL(s),t(Error("Canvas unsupported"));n.fillStyle="#ffffff",n.fillRect(0,0,e.width,e.height),n.drawImage(a,0,0,e.width,e.height),URL.revokeObjectURL(s),r(e)},a.onerror=function(){URL.revokeObjectURL(s),t(Error("Could not render SVG"))},a.src=s})},e$=(N=(0,a._)(function(){return(0,s.Jh)(this,function(e){switch(e.label){case 0:if(!(null==er?void 0:er.diagram))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,eR(er.diagram.svg)];case 2:return e.sent().toBlob(function(e){e&&eS(e,"diagram.png")},"image/png"),[3,4];case 3:return e.sent(),d.ZP.error("PNG export failed."),[3,4];case 4:return[2]}})}),function(){return N.apply(this,arguments)}),eC=(S=(0,a._)(function(){var e,r,a,n,l;return(0,s.Jh)(this,function(s){switch(s.label){case 0:if(!(null==er?void 0:er.diagram))return[2];s.label=1;case 1:return s.trys.push([1,4,,5]),[4,eR(er.diagram.svg)];case 2:return e=s.sent(),[4,Promise.all([t.e(2505),t.e(9213),t.e(729)]).then(t.bind(t,97501))];case 3:return n=Math.min((a=(r=new(s.sent()).default({orientation:"portrait",unit:"pt",format:"a4"})).internal.pageSize.getWidth())-80,400),l=e.height/e.width*n,r.addImage(e.toDataURL("image/png"),"PNG",(a-n)/2,60,n,l),er.diagram.caption&&(r.setFontSize(11),r.text(er.diagram.caption,a/2,60+l+24,{align:"center"})),r.save("diagram.pdf"),[3,5];
1case 4:return s.sent(),d.ZP.error("PDF export failed."),[3,5];case 5:return[2]}})}),function(){return S.apply(this,arguments)}),eL=function(e){var r=[];return r.push("Problem: ".concat(e.problem_restatement)),r.push("Final answer: ".concat(e.final_answer)),e.methods.forEach(function(e){r.push("\n".concat(e.name," (").concat(e.level,"):")),e.steps.forEach(function(e,t){r.push("  ".concat(t+1,". ").concat(e.explanation).concat(e.math?" [".concat(e.math,"]"):""))})}),e.tutorial&&r.push("\nTutorial: ".concat(e.tutorial)),e.common_mistakes.length&&r.push("\nCommon mistakes:\n".concat(e.common_mistakes.map(function(e){return"  - ".concat(e)}).join("\n"))),r.join("\n")};return(0,l.jsxs)("div",{children:[(0,l.jsx)(b.Z,{show:X}),(0,l.jsx)("h2",{className:"mb-4 text-sm font-semibold text-gray-900 dark:text-gray-100",children:"Snap, upload or type your math problem"}),(0,l.jsx)("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(function(e){return(0,l.jsx)("button",{type:"button",onClick:function(){I(e.id),z(e.subject)},className:"rounded-full border px-4 py-2 text-sm font-medium transition-colors ".concat(Z===e.id?"border-[#565add] bg-[#565add]/10 text-[#565add] dark:bg-[#565add]/20 dark:text-[#8b8ff5]":"border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:border-[#565add]"),children:e.label},e.id)})}),V&&(0,l.jsxs)("div",{className:"mb-3 flex items-center gap-3 rounded-md border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40 px-3 py-2",children:[(0,l.jsx)("img",{src:V,alt:"Attached problem",className:"h-10 w-10 rounded object-cover"}),(0,l.jsx)("span",{className:"flex-1 truncate text-xs text-gray-600 dark:text-gray-300",children:"Image attached"}),(0,l.jsx)("button",{type:"button",onClick:function(){W(null),V&&URL.revokeObjectURL(V),K(""),A("text"),ey.current&&(ey.current.value=""),ev.current&&(ev.current.value="")},"aria-label":"Remove attached image",className:"rounded-md p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-200",children:(0,l.jsx)(i.aHS,{className:"h-3.5 w-3.5"})})]}),(0,l.jsx)("textarea",{ref:ep,value:M,onChange:function(e){return B(e.target.value)},onPaste:function(e){var r,t,a=e.clipboardData.getData("text");if(a&&/\$|\\[a-zA-Z]+|[\^_]/.test(a)){e.preventDefault();var s=function(e){var r=e,t=!0,a=!1,s=void 0;try{for(var l,o=[[/\\text\s*\{([^{}]*)\}/g,"$1"],[/\\mathrm\s*\{([^{}]*)\}/g,"$1"],[/\\sqrt\s*\{([^{}]*)\}/g,"√($1)"],[/\\frac\s*\{([^{}]*)\}\s*\{([^{}]*)\}/g,"($1)/($2)"],[/\^\s*\{\s*\\circ\s*\}/g,"\xb0"],[/\^\s*\\circ/g,"\xb0"],[/\\circ/g,"\xb0"],[/\\times/g,"\xd7"],[/\\cdot/g,"\xb7"],[/\\div/g,"\xf7"],[/\\pm/g,"\xb1"],[/\\leq/g,"≤"],[/\\geq/g,"≥"],[/\\neq/g,"≠"],[/\\approx/g,"≈"],[/\\infty/g,"∞"],[/\\to/g,"→"],[/\\rightarrow/g,"→"],[/\\pi/g,"π"],[/\\theta/g,"θ"],[/\\alpha/g,"α"],[/\\beta/g,"β"],[/\\mu/g,"μ"],[/\\lambda/g,"λ"],[/\\Delta/g,"Δ"],[/\\degree/g,"\xb0"],[/\\,/g," "],[/\\;/g," "],[/\\!/g,""]][Symbol.iterator]();!(t=(l=o.next()).done);t=!0){var i=(0,n._)(l.value,2),c=i[0],d=i[1];r=r.replace(c,d)}}catch(e){a=!0,s=e}finally{try{t||null==o.return||o.return()}finally{if(a)throw s}}return(r=(r=(r=(r=r.replace(/\$\$?/g,"")).replace(/\^\{([^{}]*)\}/g,"^$1").replace(/_\{([^{}]*)\}/g,"_$1")).replace(/\\([a-zA-Z]+)/g,"$1")).replace(/[{}]/g,"")).replace(/[ \t]{2,}/g," ")}(a),l=e.currentTarget,o=null!==(r=l.selectionStart)&&void 0!==r?r:M.length,i=null!==(t=l.selectionEnd)&&void 0!==t?t:M.length;B(M.slice(0,o)+s+M.slice(i));var c=o+s.length;requestAnimationFrame(function(){l.focus(),l.setSelectionRange(c,c)})}},placeholder:"Type your problem here, or drop a screenshot from ALEKS, MyMathLab or your textbook…",rows:5,className:"w-full p-3 rounded-md focus:outline-none text-gray-800 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-600 focus:ring-2 focus:ring-[#565add] transition-colors duration-300"}),eo&&(0,l.jsxs)("div",{className:"mt-2 rounded-md border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40 p-2",children:[(0,l.jsx)("div",{className:"mb-2 flex flex-wrap gap-1 border-b border-gray-200 dark:border-gray-700 pb-2",children:w.map(function(e){return(0,l.jsx)("button",{type:"button",onClick:function(){return eu(e.id)},className:"rounded px-2.5 py-1 text-xs font-medium transition-colors ".concat(ed===e.id?"bg-[#565add] text-white":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"),children:e.label},e.id)})}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(null!==(R=w.find(function(e){return e.id===ed}))&&void 0!==R?R:w[0]).keys.map(function(e){return(0,l.jsx)("button",{type:"button",onClick:function(){var r;return ek(e.insert,null!==(r=e.back)&&void 0!==r?r:0)},className:"min-w-9 rounded-md border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-2.5 py-1.5 text-sm text-gray-700 dark:text-gray-200 hover:border-[#565add] hover:text-[#565add] transition-colors",title:"Insert ".concat(e.label),children:e.label},e.label)})})]}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsxs)("button",{type:"button",onClick:function(){var e;return null===(e=ey.current)||void 0===e?void 0:e.click()},className:"flex items-center gap-2 rounded-md border border-gray-300 dark:border-gray-600 px-3 py-1.5 text-sm font-medium text-gray-700 dark:text-gray-200 hover:border-[#565add] transition-colors",children:[(0,l.jsx)(i.Dmm,{className:"h-3.5 w-3.5"}),"Take photo"]}),(0,l.jsxs)("button",{type:"button",onClick:function(){var e;return null===(e=ev.current)||void 0===e?void 0:e.click()},className:"flex items-center gap-2 rounded-md border border-gray-300 dark:border-gray-600 px-3 py-1.5 text-sm font-medium text-gray-700 dark:text-gray-200 hover:border-[#565add] transition-colors",children:[(0,l.jsx)(i.DUB,{className:"h-3.5 w-3.5"}),"Upload screenshot"]}),(0,l.jsxs)("button",{type:"button",onClick:function(){return ei(function(e){return!e})},"aria-pressed":eo,className:"flex items-center gap-2 rounded-md border px-3 py-1.5 text-sm font-medium transition-colors ".concat(eo?"border-[#565add] bg-[#565add]/10 text-[#565add] dark:bg-[#565add]/20 dark:text-[#8b8ff5]":"border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:border-[#565add]"),children:[(0,l.jsx)(i.Ivf,{className:"h-3.5 w-3.5"}),"Symbols"]}
1)]}),(0,x.nJ)()&&!(0,x.pH)()?(0,l.jsx)("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:"1 free solve \xb7 no signup"}):null]}),(0,l.jsx)("input",{ref:ey,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",capture:"environment",className:"hidden",onChange:function(e){var r;return ew(null===(r=e.target.files)||void 0===r?void 0:r[0])}}),(0,l.jsx)("input",{ref:ev,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",className:"hidden",onChange:function(e){var r;return ew(null===(r=e.target.files)||void 0===r?void 0:r[0])}}),en&&(0,l.jsx)("div",{className:"mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-md",children:(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:en})}),(0,l.jsxs)("div",{className:"mt-4 flex flex-col gap-3 border-t border-gray-100 pt-4 dark:border-gray-800 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsx)("p",{className:"max-w-sm text-xs text-gray-400 dark:text-gray-500",children:"Explanations are for learning. Always check final answers against your course's rounding and format rules. We don't store your problems."}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,l.jsx)("button",{onClick:function(){B(""),W(null),V&&URL.revokeObjectURL(V),K(""),A("text"),et(null),es(""),ey.current&&(ey.current.value=""),ev.current&&(ev.current.value="")},disabled:X,className:"text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white disabled:opacity-50",children:"Clear"}),(0,l.jsx)("button",{onClick:eN,disabled:X,className:"px-6 py-3 rounded-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#565add] transition-colors duration-300 ".concat(X?"bg-[#565add] cursor-not-allowed":"bg-[#565add] hover:bg-[#656aff]"),children:X?"Solving...":"Solve my problem free"})]})]}),er&&(0,l.jsxs)("div",{ref:eh,className:"mt-6 space-y-5",children:[(0,l.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsxs)("h3",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:["Solution"," ",(0,l.jsxs)("span",{className:"text-sm font-normal text-gray-400 capitalize",children:["(",er.subject,")"]})]}),(0,l.jsxs)("button",{onClick:function(){return e_(eL(er))},className:"flex items-center gap-2 px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 rounded-md",title:"Copy full solution",children:[(0,l.jsx)(i.Dup,{})," Copy"]})]}),er.problem_restatement&&(0,l.jsx)($,{text:er.problem_restatement,className:"block text-gray-700 dark:text-gray-300 mb-2 leading-relaxed"}),er.final_answer&&(0,l.jsxs)("div",{className:"mt-2 rounded-md bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-[#193cb8] p-3",children:[(0,l.jsxs)("span",{className:"text-sm font-semibold text-[#193cb8] dark:text-blue-300",children:["Final answer:"," "]}),(0,l.jsx)($,{text:er.final_answer,className:"text-gray-800 dark:text-gray-100 font-medium"})]})]}),er.methods.map(function(e,r){return(0,l.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[(0,l.jsxs)("h4",{className:"text-base font-semibold text-gray-800 dark:text-gray-100 mb-3 flex items-center gap-2",children:[e.name,(0,l.jsx)("span",{className:"text-[10px] uppercase tracking-wide px-2 py-0.5 rounded-full ".concat("advanced"===e.level?"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300":"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"),children:e.level})]}),(0,l.jsx)("div",{className:"space-y-2",children:e.steps.map(function(e,r){return(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md",children:[(0,l.jsx)("span",{className:"flex-shrink-0 w-6 h-6 flex items-center justify-center rounded-full bg-blue-100 dar
1k:bg-blue-900 text-[#193cb8] dark:text-blue-200 text-sm font-semibold",children:r+1}),(0,l.jsxs)("div",{className:"flex-1 text-gray-700 dark:text-gray-300",children:[e.explanation&&(0,l.jsx)($,{text:e.explanation,className:"block leading-relaxed"}),e.math&&(0,l.jsx)(_,{tex:e.math})]})]},r)})})]},r)}),er.tutorial&&(0,l.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[(0,l.jsx)("h4",{className:"text-base font-semibold text-gray-800 dark:text-gray-100 mb-2",children:"Understanding the concept"}),(0,l.jsx)($,{text:er.tutorial,className:"block text-gray-700 dark:text-gray-300 leading-relaxed"})]}),er.common_mistakes.length>0&&(0,l.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/10 border border-amber-200 dark:border-amber-800 rounded-md p-4",children:[(0,l.jsx)("h4",{className:"text-base font-semibold text-amber-800 dark:text-amber-300 mb-2",children:"Common mistakes to avoid"}),(0,l.jsx)("ul",{className:"list-disc pl-5 space-y-1 text-gray-700 dark:text-gray-300",children:er.common_mistakes.map(function(e,r){return(0,l.jsx)("li",{children:(0,l.jsx)($,{text:e})},r)})})]}),er.diagram&&(0,l.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,l.jsx)("h4",{className:"text-base font-semibold text-gray-800 dark:text-gray-100",children:"Diagram"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{onClick:e$,className:"px-3 py-1.5 text-xs border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 rounded-md",children:"PNG"}),(0,l.jsx)("button",{onClick:function(){(null==er?void 0:er.diagram)&&eS(new Blob([er.diagram.svg],{type:"image/svg+xml"}),"diagram.svg")},className:"px-3 py-1.5 text-xs border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 rounded-md",children:"SVG"}),(0,l.jsx)("button",{onClick:eC,className:"px-3 py-1.5 text-xs border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 rounded-md",children:"PDF"})]})]}),(0,l.jsx)("div",{className:"flex justify-center bg-white rounded-md p-3 overflow-auto",dangerouslySetInnerHTML:{__html:(0,m.Z)(er.diagram.svg)}}),er.diagram.caption&&(0,l.jsx)("p",{className:"mt-2 text-center text-sm text-gray-500 dark:text-gray-400",children:er.diagram.caption})]})]}),(0,l.jsx)(v.Z,{open:em,onClose:ef})]})}},93239:function(e,r,t){"use strict";t.d(r,{J:function(){return n},O:function(){return a}});var a="math-solver:load-sample-problem",n="A class of 9 students scored the following on a quiz: 72, 85, 90, 65, 78, 88, 91, 76, 82. Find the mean, median, and mode of these scores."},40170:function(e,r,t){"use strict";t.d(r,{d:function(){return n}});var a=t(2265);function n(e,r){var t=(0,a.useRef)(r);t.current=r,(0,a.useEffect)(function(){var r="tool_draft_".concat(e),a=function(){try{window.localStorage.setItem(r,JSON.stringify(t.current()))}catch(e){}};return window.addEventListener("billing:free-run-limit-exceeded",a),function(){return window.removeEventListener("billing:free-run-limit-exceeded",a)}},[e])}},62181:function(e,r,t){"use strict";t.d(r,{P:function(){return n}});var a=t(2265);function n(e,r){var t="tool_draft_".concat(e),n=(0,a.useRef)(!1),s=(0,a.useRef)(r);return s.current=r,(0,a.useEffect)(function(){if(!n.current){n.current=!0;try{var e=window.localStorage.getItem(t);if(!e)return;window.localStorage.removeItem(t);var r=JSON.parse(e);s.current(r)}catch(e){}}},[t]),{stashDraft:(0,a.useCallback)(function(e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch(e){}},[t])}}},26806:function(e,r,t){"use strict";t.d(r,{Z:function(){return n}});var a=t(1581);function n(e){var r="string"==typeof e?e:"";return r?a.default.sanitize(r,{USE_PROFILES:{html:!0,svg:!0,mathMl:!0},ADD_ATTR:["target"],FORBID_TAGS:["script","style","iframe","object","embed"],FORB
1ID_ATTR:["onerror","onload","onclick"]}):""}},7395:function(){}}]);

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.