1"use strict";(globalThis.webpackChunkedupark_client||=[]).push([[3691],{36009(e,t,r){r.d(t,{A:()=>h});var s=r(58878),n=r(1060),l=r(65852),a=r(94409),i=r(94731),o=r(4329),d=r(97307),c=r(98639),u=r(90782);const m=e=>{switch(e){case"ADMIN":return"bg-purple-100 text-purple-700";case"CONTENT_REVIEWER":return"bg-teal-100 text-teal-700";default:return"bg-surface-sunken text-text-muted"}},x=e=>{let{itemType:t,selectedIds:r,onClose:x,onAssigned:g}=e;const[h,p]=(0,s.useState)([]),[b,v]=(0,s.useState)(""),[f,y]=(0,s.useState)(""),[j,w]=(0,s.useState)(null),{data:N,loading:k}=(0,n.IT)(a.mn,{...(0,c.X)("session")}),C=(null===N||void 0===N?void 0:N.getContentReviewers)||[],[P,{loading:L,error:S}]=(0,l.n)(a.Jz,{update:e=>(0,i.jl)(e)}),E=(0,s.useMemo)(()=>`Assign ${r.length} item${1===r.length?"":"s"} to ${h.length} reviewer${1===h.length?"":"s"}`,[r.length,h.length]);return(0,u.jsx)(d.A,{children:(0,u.jsx)("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-neutral-900/50 backdrop-blur-sm p-4",onClick:x,children:(0,u.jsxs)("div",{className:"bg-surface-raised rounded-lg shadow-xl w-full max-w-md max-h-[90vh] flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,u.jsxs)("div",{className:"px-5 py-4 border-b border-border-subtle flex items-center justify-between",children:[(0,u.jsx)("h2",{className:"text-lg font-semibold text-text",children:"Assign for review"}),(0,u.jsx)("button",{onClick:x,className:"text-text-subtle hover:text-text-muted","aria-label":"Close",children:(0,u.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,u.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),j?(0,u.jsxs)("div",{className:"px-5 py-6 flex-1 overflow-y-auto",children:[(0,u.jsxs)("div",{className:"rounded-lg bg-success-50 border border-success-200 p-4 text-sm text-success-800",children:[(0,u.jsxs)("div",{className:"font-medium",children:["Assigned ",j.createdCount," assignment",1===j.createdCount?"":"s","."]}),j.skippedCount>0&&(0,u.jsxs)("div",{className:"mt-1 text-success-700",children:[j.skippedCount," skipped (already open for that reviewer)."]})]}),(0,u.jsx)("div",{className:"mt-5 flex justify-end",children:(0,u.jsx)(o.$,{variant:"primary",size:"md",onClick:x,children:"Done"})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"px-5 py-4 flex-1 overflow-y-auto space-y-4",children:[(0,u.jsxs)("div",{children:[(0,u.jsx)("label",{className:"block text-sm font-medium text-text-muted mb-2",children:"Reviewers"}),k&&0===C.length?(0,u.jsx)("div",{className:"text-sm text-text-subtle",children:"Loading reviewers\u2026"}):0===C.length?(0,u.jsx)("div",{className:"text-sm text-text-subtle",children:"No reviewers available."}):(0,u.jsx)("div",{className:"border border-border rounded-md divide-y divide-neutral-50 max-h-48 overflow-y-auto",children:C.map(e=>(0,u.jsxs)("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-surface-sunken cursor-pointer",children:[(0,u.jsx)("input",{type:"checkbox",checked:h.includes(e.id),onChange:()=>{return t=e.id,void p(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t},className:"h-4 w-4 rounded border-border-strong text-primary-600 focus:ring-primary-500"}),(0,u.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,u.jsx)("span",{className:"block text-sm text-text truncate",children:e.email}),e.displayName&&(0,u.jsx)("span",{className:"block text-xs text-text-subtle truncate",children:e.displayName})]}),(0,u.jsx)("span",{className:`px-1.5 py-0.5 rounded text-xs font-medium flex-shrink-0 ${m(e.type)}`,children:e.type})]},e.id))})]}),(0,u.jsxs)("div",{children:[(0,u.jsxs)("label",{className:"block text-sm font-medium text-text-muted mb-1",children:["Note ",(0,u.jsx)("span",{className:"text-text-subtle font-normal",children:"(optional)"})]}),(0,u.jsx)("textarea",{value:b,onChange:e=>v(e.target.value),rows:2,placeholder:"Context for the reviewer\u2026",className:"w-full text-sm border border-border-strong rounded-md px-3 py-2 outline-none focus:ring-1 focus:ring-primary-500"})]}),(0,u.jsxs)("div",{children:[(0,u.jsxs)("label",{className:"block text-sm font-medium text-text-muted mb-1",children:["Due date ",(0,u.jsx)("span",{className:"text-text-subtle font-normal",children:"(optional)"})]}),(0,u.jsx)("input",{type:"date",value:f,onChange:e=>y(e.target.value),className:"text-sm border border-border-strong rounded-md px-3 py-2 outline-none focus:ring-1 focus:ring-primary-500"})]}),(0,u.jsx)("div",{className:"text-sm font-medium text-text-muted",children:E}),S&&(0,u.jsxs)("div",{className:"text-sm text-error-600",children:["Failed to assign: ",S.message]})]}),(0,u.jsxs)("div",{className:"px-5 py-4 border-t border-border-subtle flex justify-end gap-2",children:[(0,u.jsx)("button",{onClick:x,className:"px-4 py-2 text-sm font-medium rounded-md bg-surface-sunken text-text-muted hover:bg-neutral-200",children:"Cancel"}),(0,u.jsx)(o.$,{variant:"primary",size:"md",onClick:async()=>{var e;if(0===h.length||0===r.length)return;const s=null===(e=(await P({variables:{input:{items:r.map(e=>({itemType:t,itemId:e})),reviewerIds:h,note:b.trim()||null,dueDate:f||null}}})).data)||void 0===e?void 0:e.assignContentForReview;s&&(w(s),g())},disabled:L||0===h.length||0===r.length,children:L?"Assigning\u2026":"Assign"})]})]})]})})})},g=()=>(0,u.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,u.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2"}),(0,u.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,u.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 11l2 2 4-4"})]}),h=e=>{let{itemType:t,selectedIds:r,onClearSelection:n,onSelectAll:l}=e;
1const[a,i]=(0,s.useState)(null);return(0,u.jsxs)(u.Fragment,{children:[r.length>0&&(0,u.jsx)("div",{className:"sticky bottom-4 z-40 mx-auto max-w-3xl px-3 sm:px-0",children:(0,u.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-2xl bg-surface-raised px-4 py-3 shadow-lg ring-1 ring-neutral-100",children:[(0,u.jsxs)("div",{className:"flex items-center gap-3",children:[(0,u.jsxs)("span",{className:"font-semibold text-text",children:[r.length," selected"]}),l&&(0,u.jsx)("button",{type:"button",onClick:l,className:"text-sm font-medium text-text-muted hover:text-text",children:"Select all"})]}),(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsx)(o.$,{variant:"outline",size:"sm",onClick:n,children:"Clear"}),(0,u.jsx)(o.$,{variant:"primary",size:"sm",leftIcon:(0,u.jsx)(g,{}),onClick:()=>i(r),children:"Assign to reviewer"})]})]})}),a&&(0,u.jsx)(x,{itemType:t,selectedIds:a,onClose:()=>i(null),onAssigned:n})]})}},83691(e,t,r){r.r(t);var s=r(58878),n=r(43681),l=r(39018),a=r(36297),i=r(69576),o=r(5663),d=r(36961),c=r(36009),u=r(97307),m=r(90782);const x=["vocabulary","grammar","comprehension"],g=["foundation","intermediate","advanced"],h=()=>{const e=(0,l.Zp)(),t=(0,i.n)(),{hasPermission:r}=(0,o.S)(),h=r(d.Jj.MANAGE_CONTENT_REVIEW),[p,b]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[y,j]=(0,s.useState)([]),[w,N]=(0,s.useState)(null),[k,C]=(0,s.useState)(0),[P,L]=(0,s.useState)(!1),[S,E]=(0,s.useState)(!0),[$,T]=(0,s.useState)(!0),[I,A]=(0,s.useState)({}
1),[F,M]=(0,s.useState)(""),[q,R]=(0,s.useState)(""),[G,D]=(0,s.useState)(!1),[_,z]=(0,s.useState)(1),[V]=(0,s.useState)(20),[B,U]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{U(new Set)},[I,F,_]);const[W,O]=(0,s.useState)(!1),[J,X]=(0,s.useState)(null),[H,K]=(0,s.useState)({show:!1,type:"success",message:""}),Q=(0,s.useRef)(null);(0,s.useEffect)(()=>()=>{Q.current&&clearTimeout(Q.current)},[]),(0,s.useEffect)(()=>{(async()=>{try{const e=await(0,a.Ce)();f(e)}catch(e){console.error("Failed to fetch skill tags:",e)}})()},[]),(0,s.useEffect)(()=>{(async()=>{try{const e=await(0,a.rv)();j(e)}catch(e){console.error("Failed to fetch learning modules:",e)}})()},[]),(0,s.useEffect)(()=>{(async()=>{T(!0);try{const e=await(0,a.RF)();N(e)}catch(e){console.error("Failed to fetch stats:",e)}finally{T(!1)}})()},[]);const Z=(0,s.useCallback)(async()=>{E(!0);try{const e=(_-1)*V,t={...I,searchQuery:F||void 0},r=await(0,a.zL)(t,V,e);b(r.problems),C(r.total),L(r.hasMore)}catch(e){console.error("Failed to fetch problems:",e),Y("error","Failed to fetch learning problems")}finally{E(!1)}},[I,_,V,F]);(0,s.useEffect)(()=>{Z()},[Z]);const Y=(e,t)=>{Q.current&&clearTimeout(Q.current),K({show:!0,type:e,message:t}),Q.current=setTimeout(()=>K(e=>({...e,show:!1})),3e3)},ee=(e,t)=>{A(r=>({...r,[e]:""===t?void 0:t})),z(1)},te=()=>{z(1),Z()},re=e=>{switch(e){case"foundation":return"bg-success-100 text-success-800";case"intermediate":return"bg-warning-100 text-warning-800";case"advanced":return"bg-purple-100 text-purple-800";default:return"bg-surface-sunken text-text"}},se=e=>{if(!e||0===e.length)return"No content";let t,r,s;for(const i of e){var n;if(null!==(n=i.description)&&void 0!==n&&n.trim()){if("question"===i.type){t=i;break}"passage"!==i.type||r?"text"!==i.type||s||(s=i):r=i}}const l=t||r||s;if(l){const e=l.description;return e.length>200?e.substring(0,200)+"...":e}const a=e[0];return"image"===a.type?`[Image: ${a.image_alt||"No alt text"}]`:"svg"===a.type?`[SVG: ${a.svg_description||a.svg_title||"Graphic"}]`:`[${a.type} block]`},ne=e=>{switch(e){case"vocabulary":return"bg-primary-100 text-primary-800";case"grammar":return"bg-teal-100 text-teal-800";case"comprehension":return"bg-indigo-100 text-indigo-800";default:return"bg-surface-sunken text-text"}};return(0,m.jsxs)("div",{className:"p-6 max-w-7xl mx-auto",children:[(0,m.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("h1",{className:"text-2xl font-bold text-text",children:"Learning Problems"}),(0,m.jsx)("p",{className:"text-sm text-text-subtle mt-1",children:"Manage practice problems for progressive skill building"})]}),(0,m.jsxs)(l.N_,{to:`${t}/learning-hub/problems/create`,className:"px-4 py-2 bg-brand text-white rounded-lg hover:bg-brand-hover transition-colors flex items-center gap-2",children:[(0,m.jsx)("span",{children:"+"}),"Create Problem"]})]}),!$&&w&&(0,m.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[(0,m.jsxs)("div",{className:"bg-surface-raised rounded-lg border p-4",children:[(0,m.jsx)("div",{className:"text-2xl font-bold text-text",children:w.totalProblems}),(0,m.jsx)("div",{className:"text-sm text-text-subtle",children:"Total Problems"})]}),(0,m.jsxs)("div",{className:"bg-surface-raised rounded-lg border p-4",children:[(0,m.jsx)("div",{className:"text-2xl font-bold text-success-600",children:w.verifiedCount}),(0,m.jsx)("div",{className:"text-sm text-text-subtle",children:"Verified"})]}),(0,m.jsxs)("div",{className:"bg-surface-raised rounded-lg border p-4",children:[(0,m.jsx)("div",{className:"text-2xl font-bold text-warning-600",children:w.unverifiedCount}),(0,m.jsx)("div",{className:"text-sm text-text-subtle",children:"Pending Review"})]}),(0,m.jsxs)("div",{className:"bg-surface-raised rounded-lg border p-4",children:[(0,m.jsx)("div",{className:"text-sm font-medium text-text-muted mb-2",children:"By Category"}),(0,m.jsx)("div",{className:"flex flex-wrap gap-1",children:w.byCategory.map(e=>(0,m.jsxs)("span",{className:`text-xs px-2 py-0.5 rounded ${ne(e.category)}`,children:[e.category,": ",e.count]},e.category))})]})]}),(0,m.jsxs)("div",{className:"bg-surface-raised rounded-lg border p-4 mb-6",children:[(0,m.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-6 gap-4",children:[(0,m.jsxs)("div",{className:"md:col-span-2",children:[(0,m.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1",children:"Search"}),(0,m.jsxs)("div",{className:"flex gap-2",children:[(0,m.jsx)("input",{type:"text",value:F,onChange:e=>M(e.target.value),onKeyPress:e=>"Enter"===e.key&&te(),placeholder:"Search description or explanation...",className:"flex-1 text-sm border-border-strong rounded"}),(0,m.jsx)("button",{onClick:te,className:"px-3 py-2 bg-surface-sunken text-text-muted rounded hover:bg-neutral-200",children:"Search"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1",children:"Category"}),(0,m.jsxs)("select",{value:I.skillCategory||"",onChange:e=>ee("skillCategory",e.target.value),className:"w-full text-sm border-border-strong rounded",children:[(0,m.jsx)("option",{value:"",children:"All Categories"}),x.map(e=>(0,m.jsx)("option",{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1",children:"Tier"}),(0,m.jsxs)("select",{value:I.difficultyTier||"",onChange:e=>ee("difficultyTier",e.target.value),className:"w-full text-sm border-border-strong rounded",children:[(0,m.jsx)("option",{value:"",children:"All Tiers"}),g.map(e=>(0,m.jsx)("option",{value:e,children:e.replace("_"," ").replace(/\b\w/g,e=>e.toUpperCase())},e))]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1",children:"Status"}),(0,m.jsxs)("select",{value:void 0===I.verified?"":I.verified.toString(),onChange:e=>ee("verified",""===e.target.value?void 0:"true"===e.target.value),className:"w-full text-sm border-border-strong rounded",children:[(0,m.jsx)("option",{value:"",children:"All"}),(0,m.jsx)("option",{value:"true",children:"Verified"}),(0,m.jsx)("option",{value:"false",children:"Unverified"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1",children:"Module"}),(0,m.jsxs)("select",{value:I.learningModuleId||"",onChange:e=>ee("learningModuleId",e.target.value),className:"w-full text-sm border-border-strong rounded",children:[(0,m.jsx)("option",{value:"",children:"All Modules"}),y.map(e=>(0,m.jsx)("option",{value:e.id,children:e.title},e.id))]})]})]}),v.length>0&&(0,m.jsxs)("div",{className:"mt-4",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,m.jsx)("label",{className:"block text-xs font-medium text-text-muted",children:"Skill Tags"}),v.length>20&&(0,m.jsx)("button",{onClick:()=>D(!G),className:"text-xs text-primary-600 hover:text-primary-700 font-medium",children:G?"Show Less":`Show All (${v.length})`})]}),v.length>10&&(0,m.jsx)("input",{type:"text",value:q,onChange:e=>R(e.target.value),placeholder:"Search skill tags...",className:"w-full px-3 py-2 text-sm border border-border-strong rounded-md mb-2 focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),(0,m.jsxs)("div",{className:"flex flex-wrap gap-2",children:[v.filter(e=>!q||e.toLowerCase().includes(q.toLowerCase())).slice(0,G?void 0:20).map(e=>{var t;return(0,m.jsx)("button",{onClick:()=>{var t;return ee("skillTags",null!==(t=I.skillTags)&&void 0!==t&&t.includes(e)?I.skillTags.filter(t=>t!==e):[...I.skillTags||[],e])},className:"px-2 py-1 text-xs rounded-full transition-colors "+(null!==(t=I.skillTags)&&void 0!==t&&t.includes(e)?"bg-brand text-white":"bg-surface-sunken text-text-muted hover:bg-neutral-200"),children:e},e)}),!G&&v.filter(e=>!q||e.toLowerCase().includes(q.toLowerCase())).length>20&&(0,m.jsxs)("button",{onClick:()=>D(!0),className:"px-3 py-1 text-xs text-primary-600 hover:text-primary-700 font-medium",children:["+",v.filter(e=>!q||e.toLowerCase().includes(q.toLowerCase())).length-20," more"]})]})]}),(Object.keys(I).length>0||F)&&(0,m.jsx)("div",{className:"mt-4 flex justify-end",children:(0,m.jsx)("button",{onClick:()=>{A({}),M(""),z(1)},className:"text-sm text-text-muted hover:text-text",children:"Clear all filters"})})]}),(0,m.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,m.jsxs)("span",{className:"text-sm text-text-muted",children:["Showing ",p.length," of ",k," problems"]})}),S?(0,m.jsxs)("div",{className:"text-center py-12",children:[(0,m.jsx)(n.k,{size:"md"}),(0,m.jsx)("p",{className:"mt-2 text-sm text-text-subtle",children:"Loading problems..."})]}):0===p.length?(0,m.jsxs)("div",{className:"text-center py-12 bg-surface-raised rounded-lg border",children:[(0,m.jsx)("p",{className:"text-text-subtle",children:"No learning problems found"}),(0,m.jsx)(l.N_,{to:`${t}/learning-hub/problems/create`,className:"inline-block mt-4 text-primary-600 hover:text-primary-700",children:"Create your first problem"})]}):(0,m.jsx)("div",{className:"space-y-3",children:p.map(r=>(0,m.jsx)("div",{className:"bg-surface-raised rounded-lg border p-4 hover:shadow-sm transition-shadow",children:(0,m.jsxs)("div",{className:"flex items-start justify-between",children:[h&&(0,m.jsx)("input",{type:"checkbox",checked:B.has(r.id),onChange:()=>{return e=r.id,U(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r});var e},className:"h-4 w-4 mt-1 mr-3 rounded border-border-strong text-primary-600 focus:ring-primary-500","aria-label":"Select learning problem for assignment"}),(0,m.jsxs)("div",{className:"flex-1",children:[(0,m.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[(0,m.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${ne(r.skillCategory)}`,children:r.skillCategory}),(0,m.jsxs)("span",{className:`text-xs px-2 py-0.5 rounded ${re(r.difficultyTier)}`,children:[r.difficultyTier.replace("_"," ")," (L",r.difficultyLevel,")"]}),r.verified?(0,m.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-success-100 text-success-800",children:"Verified"}):(0,m.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-warning-100 text-warning-800",children:"Pending"}),r.source&&(0,m.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-surface-sunken text-text-muted",children:r.source.replace("_"," ")})]}),(0,m.jsx)("p",{className:"text-sm text-text mb-2",children:se(r.content)}),r.skillTags.length>0&&(0,m.jsx)("div",{className:"flex flex-wrap gap-1",children:r.skillTags.map(e=>(0,m.jsx)("span",{className:"text-xs px-1.5 py-0.5 bg-surface-sunken text-text-muted rounded",children:e},e))}),(0,m.jsxs)("p",{className:"text-xs text-text-subtle mt-2",children:["Answer: ",(0,m.jsx)("span",{className:"font-medium",children:r.correctAnswer})]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,m.jsx)("button",{onClick:()=>(async e=>{try{const t=await(0,a.VC)(e.id,!e.verified);b(e=>e.map(e=>e.id===t.id?t:e)),Y("success",`Problem ${t.verified?"verified":"unverified"} successfully`)}catch(t){Y("error","Failed to update verification status")}})(r),className:"p-2 rounded transition-colors "+(r.verified?"text-warning-600 hover:bg-warning-50":"text-success-600 hover:bg-success-50"),title:r.verified?"Unverify":"Verify",children:r.verified?"\u2717":"\u2713"}),(0,m.jsx)("button",{onClick:()=>e(`${t}/learning-hub/problems/edit/${r.id}`),className:"p-2 text-primary-600 hover:bg-primary-50 rounded transition-colors",title:"Edit",children:"Edit"}),(0,m.jsx)("button",{onClick:()=>{X(r),O(!0)},className:"p-2 text-error-600 hover:bg-error-50 rounded transition-colors",title:"Delete",children:"Delete"})]})]})},r.id))}),k>V&&(0,m.jsxs)("div",{className:"flex justify-center items-center gap-4 mt-6",children:[(0,m.jsx)("button",{onClick:()=>z(e=>Math.max(1,e-1)),disabled:1===_,className:"px-4 py-2 text-sm bg-surface-raised border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-surface-sunken",children:"Previous"}),(0,m.jsxs)("span",{className:"text-sm text-text-muted",children:["Page ",_," of ",Math.
1ceil(k/V)]}),(0,m.jsx)("button",{onClick:()=>z(e=>e+1),disabled:!P,className:"px-4 py-2 text-sm bg-surface-raised border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-surface-sunken",children:"Next"})]}),W&&J&&(0,m.jsx)(u.A,{children:(0,m.jsx)("div",{className:"fixed inset-0 bg-neutral-900/50 backdrop-blur-sm flex items-center justify-center z-[200]",children:(0,m.jsxs)("div",{className:"bg-surface-raised rounded-lg p-6 max-w-md w-full mx-4",children:[(0,m.jsx)("h3",{className:"text-lg font-semibold text-text mb-2",children:"Delete Problem"}),(0,m.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Are you sure you want to delete this learning problem? This action cannot be undone."}),(0,m.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,m.jsx)("button",{onClick:()=>{O(!1),X(null)},className:"px-4 py-2 text-sm text-text-muted hover:bg-surface-sunken rounded",children:"Cancel"}),(0,m.jsx)("button",{onClick:async()=>{if(J)try{await(0,a.dn)(J.id),Y("success","Learning problem deleted successfully"),O(!1),X(null),Z();const e=await(0,a.RF)();N(e)}catch(e){Y("error","Failed to delete learning problem")}},className:"px-4 py-2 text-sm bg-error-600 text-white rounded hover:bg-error-700",children:"Delete"})]})]})})}),H.show&&(0,m.jsx)("div",{className:"fixed bottom-4 right-4 px-4 py-3 rounded-lg shadow-lg z-50 "+("success"===H.type?"bg-success-600 text-white":"bg-error-600 text-white"),children:H.message}),h&&(0,m.jsx)(c.A,{itemType:"LEARNING_PROBLEM",selectedIds:Array.from(B),onClearSelection:()=>U(new Set)})]})};r.d(t,["default",0,h])},36297(e,t,r){var s=r(5879);const n=(0,r(21926).X)("undefined"!==typeof window?window.location.hostname:""),l=new s.l4(n,{credentials:"include"}),a="\n id\n content\n description\n explanation\n explanationBlocks\n visualExplanation {\n steps {\n stepNumber\n title\n instruction\n highlights {\n target\n ranges {\n start\n end\n text\n }\n answerIndex\n color\n style\n }\n concept\n conceptExplanation\n }\n wrongAnswerExplanations {\n answerIndex\n label\n explanation\n commonMisconception\n }\n correctAnswerExplanation {\n answerIndex\n label\n explanation\n keyInsight\n }\n }\n skillCategory\n skillTags\n conceptTagIds\n difficultyTier\n difficultyLevel\n correctAnswer\n answerOptions\n relatedSatProblemId\n relatedGrammarRule\n relatedVocabularyWordId\n learningModuleIds\n source\n verified\n createdBy\n createdAt\n updatedAt\n";r.d(t,["Ce",0,async()=>{try{return(await l.request("\n query GetLearningProblemSkillTags {\n learningProblemSkillTags\n }\n ",{})).learningProblemSkillTags}catch(s){var e,t,r;throw console.error("Error fetching skill tags:",s),new Error((null===(e=s.response)||void 0===e||null===(t=e.errors)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.message)||"Failed to fetch skill tags")}},"Co",0,async()=>{try{return(await l.request("\n query GetLearningProblemGrammarRules {\n learningProblemGrammarRules\n }\n ",{})).learningProblemGrammarRules}catch(s){var e,t,r;throw console.error("Error fetching grammar rules:",s),new Error((null===(e=s.response)||void 0===e||null===(t=e.errors)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.message)||"Failed to fetch grammar rules")}},"Il",0,async e=>{const t=`\n query GetLearningProblem($id: ID!) {\n learningProblem(id: $id) {\n ${a}\n }\n }\n `;try{return(await l.request(t,{id:e})).learningProblem}catch(i){var r,s,n;throw console.error("Error fetching learning problem:",i),new Error((null===(r=i.response)||void 0===r||null===(s=r.errors)||void 0===s||null===(n=s[0])||void 0===n?void 0:n.message)||"Failed to fetch learning problem")}},"RF",0,async()=>{try{const e=await l.request("\n query GetLearningProblemStats {\n learningProblemStats {\n success\n totalProblems\n verifiedCount\n unverifiedCount\n byCategory {\n category\n count\n }\n byTier {\n tier\n count\n }\n error\n }\n }\n ",{});if(!e.learningProblemStats.success)throw new Error(e.learningProblemStats.error);return e.learningProblemStats}catch(s){var e,t,r;throw console.error("Error fetching stats:",s),new Error((null===(e=s.response)||void 0===e||null===(t=e.errors)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.message)||"Failed to fetch stats")}
1},"VC",0,async(e,t)=>{const r=`\n mutation VerifyLearningProblem($id: ID!, $verified: Boolean!) {\n verifyLearningProblem(id: $id, verified: $verified) {\n success\n problem {\n ${a}\n }\n error\n }\n }\n `;try{const s=await l.request(r,{id:e,verified:t});if(!s.verifyLearningProblem.success)throw new Error(s.verifyLearningProblem.error);return s.verifyLearningProblem.problem}catch(o){var s,n,i;throw console.error("Error verifying learning problem:",o),new Error((null===(s=o.response)||void 0===s||null===(n=s.errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||"Failed to verify learning problem")}},"c3",0,async()=>{try{return(await l.request("\n query GetLearningModuleStats {\n learningModuleStats {\n id\n title\n examTypeId\n estimatedDuration\n parentModuleId\n isPublic\n hierarchyLevel\n orderIndex\n orderWithinParent\n isLeafNode\n totalProblems\n foundationCount\n intermediateCount\n advancedCount\n verifiedCount\n unverifiedCount\n }\n }\n ",{})).learningModuleStats}catch(s){var e,t,r;throw console.error("Error fetching learning module stats:",s),new Error((null===(e=s.response)||void 0===e||null===(t=e.errors)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.message)||"Failed to fetch module stats")}},"dn",0,async e=>{try{const t=await l.request("\n mutation DeleteLearningProblem($id: ID!) {\n deleteLearningProblem(id: $id) {\n success\n error\n }\n }\n ",{id:e});if(!t.deleteLearningProblem.success)throw new Error(t.deleteLearningProblem.error);return!0}catch(n){var t,r,s;throw console.error("Error deleting learning problem:",n),new Error((null===(t=n.response)||void 0===t||null===(r=t.errors)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.message)||"Failed to delete learning problem")}},"fd",0,async(e,t)=>{const r=`\n mutation UpdateLearningProblem($id: ID!, $input: UpdateLearningProblemInput!) {\n updateLearningProblem(id: $id, input: $input) {\n success\n problem {\n ${a}\n }\n error\n }\n }\n `;try{const s=await l.request(r,{id:e,input:t});if(!s.updateLearningProblem.success)throw new Error(s.updateLearningProblem.error);return s.updateLearningProblem.problem}catch(o){var s,n,i;throw console.error("Error updating learning problem:",o),new Error((null===(s=o.response)||void 0===s||null===(n=s.errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||"Failed to update learning problem")}},"rv",0,async()=>{try{return(await l.request("\n query GetLearningProblemModules {\n learningProblemModules {\n id\n title\n }\n }\n ",{})).learningProblemModules}catch(s){var e,t,r;throw console.error("Error fetching learning problem modules:",s),new Error((null===(e=s.response)||void 0===e||null===(t=e.errors)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.message)||"Failed to fetch modules")}},"w",0,async e=>{const t=`\n mutation CreateLearningProblem($input: CreateLearningProblemInput!) {\n createLearningProblem(input: $input) {\n success\n problem {\n ${a}\n }\n error\n }\n }\n `;try{const r=await l.request(t,{input:e});if(!r.createLearningProblem.success)throw new Error(r.createLearningProblem.error);return r.createLearningProblem.problem}catch(i){var r,s,n;throw console.error("Error creating learning problem:",i),new Error((null===(r=i.response)||void 0===r||null===(s=r.errors)||void 0===s||null===(n=s[0])||void 0===n?void 0:n.message)||"Failed to create learning problem")}},"zL",0,async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const s=`\n query GetLearningProblems($filters: LearningProblemFilters, $limit: Int, $offset: Int) {\n learningProblems(filters: $filters, limit: $limit, offset: $offset) {\n problems {\n ${a}\n }\n total\n hasMore\n }\n }\n `;try{return(await l.request(s,{filters:e,limit:t,offset:r})).learningProblems}catch(d){var n,i,o;throw console.error("Error fetching learning problems:",d),new Error((null===(n=d.response)||void 0===n||null===(i=n.errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"Failed to fetch learning problems")}}])}}]);
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.