PageSourceSearch

https://mahadulabrar.com/_next/static/chunks/29094.6abb46aaf2a6ab6b.js

js mahadulabrar.com collected 2026-10-06 23:52:19 UTC 9,616 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29094],{6132:(e,a,r)=>{r.d(a,{A:()=>s});let s=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},23327:(e,a,r)=>{r.d(a,{A:()=>s});let s=(0,r(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},29094:(e,a,r)=>{r.r(a),r.d(a,{default:()=>y});var s=r(95155),t=r(12115),l=r(52619),d=r.n(l),i=r(90960),n=r(93014),o=r(66630),c=r(95740),x=r(23327),u=r(35299),m=r(24033),g=r(27937),p=r(61362);function y(){let e=(0,n.d)(),[a,r]=(0,t.useState)([]),[l,y]=(0,t.useState)([]),[h,b]=(0,t.useState)(null),[f,v]=(0,t.useState)(!0),[k,j]=(0,t.useState)(null),[N,w]=(0,t.useState)({}),_=(0,t.useCallback)(async()=>{v(!0);try{var a,s,t;let e=await i.api.get("/v1/grading-mapping");y(null!=(a=e.year_levels)?a:[]),r(null!=(s=e.scales)?s:[]),b(null!=(t=e.default_scale)?t:null)}catch(a){e.error(a instanceof Error?a.message:"Could not load the mapping.")}finally{v(!1)}},[e]);(0,t.useEffect)(()=>{_()},[_]);let A=(0,t.useMemo)(()=>{let e={};return a.forEach(a=>{e[a.id]=a.name}),e},[a]);async function C(a,r){j(a.year_level);try{let s=await i.api.post("/v1/grading-mapping/bulk",{course_ids:a.courses.map(e=>e.id),grading_scale_id:r});e.success("".concat(a.year_level,": ").concat(s.updated," course").concat(1===s.updated?"":"s"," → ").concat(r?A[r]:"school default",".")),await _()}catch(a){e.error(a instanceof Error?a.message:"Could not update.")}finally{j(null)}}async function z(a,r,s){j(s);try{await i.api.post("/v1/grading-mapping/bulk",{course_ids:[a],grading_scale_id:r}),await _()}catch(a){e.error(a instanceof Error?a.message:"Could not update.")}finally{j(null)}}return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsx)("div",{children:(0,s.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Decide how grades are expressed across your school — mastery bands, NC sublevels, IGCSE letters — and which year uses which."})}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(d(),{href:"/dashboard/school-admin/grading-scales",className:"inline-flex items-center gap-1.5 rounded-lg border border-gray-200 dark:border-gray-700 px-3 py-1.5 text-xs font-semibold hover:bg-gray-50 dark:hover:bg-gray-800",children:[(0,s.jsx)(o.A,{size:13})," Edit scales & thresholds"]}),(0,s.jsxs)(d(),{href:"/dashboard/school-admin/grading-reports/cambridge",className:"inline-flex items-center gap-1.5 rounded-lg border border-indigo-200 dark:border-indigo-800 bg-indigo-50 dark:bg-indigo-950/30 px-3 py-1.5 text-xs font-semibold text-indigo-700 dark:text-indigo-300 hover:border-indigo-400",children:[(0,s.jsx)(c.A,{size:13})," Import Cambridge thresholds"]})]})]}),h&&(0,s.jsxs)("p",{className:"flex items-start gap-2 rounded-lg border border-gray-200 dark:border-gray-800 bg-gray-50/60 dark:bg-gray-900/40 p-3 text-xs text-gray-600 dark:text-gray-300",children:[(0,s.jsx)(x.A,{size:13,className:"mt-0.5 shrink-0 text-gray-400"}),"Courses left on ",(0,s.jsx)("strong",{children:"Inherit"})," use your school default, ",(0,s.jsx)("strong",{children:h.name}),". Set a year level below to override it for every course at that level at once."]}),f?(0,s.jsxs)("div",{className:"flex items-center gap-2 py-10 text-sm text-gray-500",children:[(0,s.jsx)(u.A,{className:"h-4 w-4 animate-spin"})," Loading your courses…"]}):0===l.length?(0,s.jsx)("p",{className:"rounded-xl border border-dashed border-gray-300 dark:border-gray-700 p-8 text-center text-sm text-gray-500",children:"No courses yet."}):(0,s.jsx)("div",{className:"space-y-2",children:l.map(e=>{var r;let t=N[e.year_level];return(0,s.jsxs)("div",{className:"rounded-xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 p-3",children:[(0,s.jsxs)("button",{onClick:()=>w(a=>({...a,[e.year_level]:!a[e.year_level]})),className:"flex items-center gap-2 text-left",children:[t?(0,s.jsx)(m.A,{size:15,className:"text-gray-400"}):(0,s.jsx)(g.A,{size:15,className:"text-gray-400"}),(0,s.jsx)("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e.year_level}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[e.course_count," course",1===e.course_count?"":"s"]}),null===e.common_scale&&e.courses.some(e=>e.scale_id)&&(0,s.jsx)("span",{className:"rounded-full bg-amber-100 dar
1k:bg-amber-900/40 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300",children:"mixed"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-gray-500",children:"Grade all on"}),(0,s.jsxs)("select",{value:null!=(r=e.common_scale)?r:"",disabled:k===e.year_level,onChange:a=>void C(e,a.target.value||null),className:"rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 px-2 py-1.5 text-xs disabled:opacity-50",children:[(0,s.jsx)("option",{value:"",children:"Inherit (school default)"}),a.map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.name,e.is_default?" ★":""]},e.id))]}),k===e.year_level&&(0,s.jsx)(u.A,{size:13,className:"animate-spin text-gray-400"})]})]}),t&&(0,s.jsx)("div",{className:"border-t border-gray-100 dark:border-gray-800 divide-y divide-gray-50 dark:divide-gray-800/60",children:e.courses.map(r=>{var t;return(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700 dark:text-gray-200 truncate",children:r.title}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[r.scale_id?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] text-gray-500",children:[(0,s.jsx)(p.A,{size:11,className:"text-emerald-500"})," ",r.scale_name]}):(0,s.jsx)("span",{className:"text-[11px] text-gray-400",children:"inherits default"}),(0,s.jsxs)("select",{value:null!=(t=r.scale_id)?t:"",onChange:a=>void z(r.id,a.target.value||null,e.year_level),className:"rounded-md border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 px-1.5 py-1 text-[11px]",children:[(0,s.jsx)("option",{value:"",children:"Inherit"}),a.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]},r.id)})})]},e.year_level)})})]})}},61362:(e,a,r)=>{r.d(a,{A:()=>s});let s=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},65229:(e,a,r)=>{r.d(a,{A:()=>s});let s=(0,r(71847).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},93014:(e,a,r)=>{r.d(a,{ToastProvider:()=>u,d:()=>c,q:()=>x});var s=r(95155),t=r(12115),l=r(61362),d=r(6132),i=r(23327),n=r(65229);let o=(0,t.createContext)(null);function c(){let e=(0,t.useContext)(o);return e||{success:()=>{},error:()=>{},info:()=>{},dismiss:()=>{}}}function x(e,a){window.dispatchEvent(new CustomEvent("app-toast",{detail:{kind:e,message:a}}))}function u(e){let{children:a}=e,[r,c]=(0,t.useState)([]),x=(0,t.useRef)(0),u=(0,t.useCallback)((e,a)=>{if(!a)return;let r=++x.current;c(s=>[...s,{id:r,kind:e,message:a}]),setTimeout(()=>{c(e=>e.filter(e=>e.id!==r))},"error"===e?6e3:"info"===e?4e3:3e3)},[]),m=(0,t.useMemo)(()=>({success:e=>u("success",e),error:e=>u("error",e),info:e=>u("info",e),dismiss:e=>c(a=>a.filter(a=>a.id!==e))}),[u]);return(0,t.useEffect)(()=>{function e(e){var a;let r=e.detail;(null==r?void 0:r.message)&&u(null!=(a=r.kind)?a:"info",r.message)}return window.addEventListener("app-toast",e),()=>window.removeEventListener("app-toast",e)},[u]),(0,s.jsxs)(o.Provider,{value:m,children:[a,(0,s.jsx)("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm pointer-events-none","aria-live":"polite","aria-atomic":"true",children:r.map(e=>(0,s.jsxs)("div",{className:["pointer-events-auto rounded-lg border px-3 py-2.5 text-sm shadow-lg","flex items-start gap-2 animate-slide-in-right","success"===e.kind&&"bg-emerald-50 border-emerald-200 text-emerald-900 dark:bg-emerald-950 dark:border-emerald-800 dark:text-emerald-100","error"===e.kind&&"bg-red-50 border-red-200 text-red-900 dark:bg-red-950 dark:border-red-800 dark:text-red-100","info"===e.kind&&"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-950 dark:border-blue-800 dark:text-blue-100"].filter(Boolean).join(" "),role:"error"===e.kind?"alert":"status",children:["success"===e.kind&&(0,s.jsx)(l.A,{size:16,className:"shrink-0 mt-0.5"}),"error"===e.kind&&(0,s.jsx)(d.A,{size:16,className:"shrink-0 mt-0.5"}),"info"===e.kind&&(0,s.jsx)(i.A,{size:16,className:"shrink-0 mt-0.5"}),(0,s.jsx)("p",{className:"flex-1 min-w-0 leading-snug",children:e.message}),(0,s.jsx)("button",{onClick:()=>m.dismiss(e.id),className:"shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,s.jsx)(n.A,{size:14})})]},e.id))})]})}},95740:(e,a,r)=>{r.d(a,{A:()=>s});let s=(0,r(71847).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])}}]);

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.