1"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[3455,8032],{3455(e,s,t){t.r(s),t.d(s,{default:()=>W});var a=t(5043),l=t(5621),r=t(3974),i=t(4980),o=t(6328),c=t(3390),n=t(1140),d=t(2264),u=t(556),m=t(5949),h=t(3416),x=t(5732),p=t(3084),v=t(4204),j=t(7040),g=t(1351),b=t(5440),y=t(7719),_=t(2626),f=t(8326),N=t(7673),C=t(1360),w=t(8971),A=t(9292),k=t(6401),D=t(579);const S=["Foundation","1","2","3","4","5","6","7","8","9","10"],T=["English","Mathematics","Science","History","Geography","Health & PE","Technology","Visual Arts","Music","Drama","HASS","Design & Technology","Digital Technologies"],P=["Mother's Day","Father's Day","Easter","Christmas","Halloween","NAIDOC Week","ANZAC Day","Harmony Day","Back to School","End of Year","Valentine's Day","Book Week","Science Week"],$=[{id:"colouring_page",label:"Colouring Page",description:"AI-generated line-art scene for students to colour in",icon:N.A,colour:"bg-amber-50 border-amber-200 text-amber-800",activeColour:"bg-amber-500 text-white border-amber-500"},{id:"cut_and_assemble",label:"Cut & Assemble",description:"Printable template with numbered assembly steps",icon:w.A,colour:"bg-sky-50 border-sky-200 text-sky-800",activeColour:"bg-sky-600 text-white border-sky-600"},{id:"tech_project",label:"Tech Project Guide",description:"D&T project guide \u2014 tools, materials, PPE, step-by-step",icon:k.A,colour:"bg-slate-50 border-slate-200 text-slate-700",activeColour:"bg-slate-700 text-white border-slate-700"}],E=[4,6,8,10,12],L=["colouring_page","cut_and_assemble","tech_project"],W=function(){var e;let{lockedMode:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.Zp)(),[N]=(0,l.ok)(),{user:k}=(0,r.As)(),[W,J]=(0,a.useState)(!1),[M,R]=(0,a.useState)([]),[I,V]=(0,a.useState)("create"),[F,Y]=(0,a.useState)(!1),[B,G]=(0,a.useState)(""),H=s||(L.includes(N.get("mode"))?N.get("mode"):"colouring_page"),[Z,O]=(0,a.useState)({title:"",craft_mode:H,year_levels:[],subject:"",seasonal_theme:"",num_steps:6,outcome_codes:"",curriculum_notes:"",project_description:""}),q=(0,a.useCallback)(async()=>{try{const e=await i.A.get(`${i.n}/craft/`,{params:{search:B||void 0,craft_mode:s||void 0}});R(e.data.craft_activities||[])}catch{}},[B,s]);(0,a.useEffect)(()=>{q()},[q]);const X=M.filter(e=>{var s,t,a;return!B||(null===(s=e.title)||void 0===s?void 0:s.toLowerCase().includes(B.toLowerCase()))||(null===(t=e.subject)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))||(null===(a=e.seasonal_theme)||void 0===a?void 0:a.toLowerCase().includes(B.toLowerCase()))}),K=$.find(e=>e.id===Z.craft_mode),U="tech_project"===Z.craft_mode,z=(null===K||void 0===K?void 0:K.icon)||w.A,Q=e=>{const s=$.find(s=>s.id===e);return s?s.label:e};return(0,D.jsxs)(v.A,{children:[(0,D.jsx)(b.A,{}),(0,D.jsxs)("div",{className:"p-6 max-w-5xl mx-auto",children:[(0,D.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,D.jsx)("div",{className:`p-2 rounded-lg ${s&&(null===K||void 0===K||null===(e=K.colour)||void 0===e?void 0:e.split(" ")[0])||"bg-rose-100"}`,children:(0,D.jsx)(z,{className:"w-6 h-6"})}),(0,D.jsxs)("div",{className:"min-w-0",children:[(0,D.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:s?null===K||void 0===K?void 0:K.label:"Maker Studio"}),(0,D.jsx)("p",{className:"text-sm text-muted-foreground",children:s?null===K||void 0===K?void 0:K.description:"Colouring pages, cut-and-assemble templates, and D&T project guides"})]}),(0,D.jsx)(m.E,{variant:"secondary",className:"ml-auto",children:"5 credits"})]}),!s&&(0,D.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-6",children:$.map(e=>{let{id:s,label:t,description:a,icon:l,colour:r,activeColour:i}=e;return(0,D.jsxs)("button",{type:"button",onClick:()=>O(e=>({...e,craft_mode:s})),className:`flex items-start gap-2 rounded-lg border p-3 text-left transition-colors ${Z.craft_mode===s?i:r}`,children:[(0,D.jsx)(l,{className:"w-4 h-4 mt-0.5 shrink-0"}),(0,D.jsxs)("div",{children:[(0,D.jsx)("p",{className:"text-xs font-semibold",children:t}),(0,D.jsx)("p",{className:"text-xs opacity-75 mt-0.5",children:a})]})]},s)})}
1),(0,D.jsxs)(x.tU,{value:I,onValueChange:V,children:[(0,D.jsxs)(x.j7,{className:"mb-6",children:[(0,D.jsxs)(x.Xi,{value:"create",children:[(0,D.jsx)(C.A,{className:"w-4 h-4 mr-1"})," Create"]}),(0,D.jsxs)(x.Xi,{value:"library",children:[(0,D.jsx)(_.A,{className:"w-4 h-4 mr-1"})," My Activities (",M.length,")"]})]}),(0,D.jsx)(x.av,{value:"create",children:W?(0,D.jsx)(j.A,{title:`Creating your ${(null===K||void 0===K?void 0:K.label)||"craft activity"}\u2026`,steps:["Designing activity content",U?"Building step-by-step project guide":"Generating scene description",U?"Preparing materials and tools list":"Creating reference image","Finalising your PDF"]}):(0,D.jsxs)(n.Zp,{children:[(0,D.jsx)(n.aR,{children:(0,D.jsxs)(n.ZB,{className:"text-base",children:[(null===K||void 0===K?void 0:K.label)||"Craft"," details"]})}),(0,D.jsxs)(n.Wu,{className:"space-y-5",children:[(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsxs)(u.J,{children:["Title ",(0,D.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,D.jsx)(d.p,{placeholder:U?"e.g. Year 9 Timber Toolbox Project":"e.g. Mother's Day Colouring Page",value:Z.title,onChange:e=>O(s=>({...s,title:e.target.value}))})]}),(0,D.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsxs)(u.J,{children:["Year Level ",(0,D.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,D.jsxs)(p.l6,{value:Z.year_levels[0]||"",onValueChange:e=>O(s=>({...s,year_levels:e?[e]:[]})),children:[(0,D.jsx)(p.bq,{children:(0,D.jsx)(p.yv,{placeholder:"Select year level"})}),(0,D.jsx)(p.gC,{children:S.map(e=>(0,D.jsx)(p.eb,{value:e,children:"Foundation"===e?"Foundation (Prep / Kindy)":`Year ${e}`},e))})]})]}),(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsx)(u.J,{children:"Subject"}),(0,D.jsxs)(p.l6,{value:Z.subject,onValueChange:e=>O(s=>({...s,subject:e})),children:[(0,D.jsx)(p.bq,{children:(0,D.jsx)(p.yv,{placeholder:"Select subject (optional)"})}),(0,D.jsx)(p.gC,{children:T.map(e=>(0,D.jsx)(p.eb,{value:e,children:e},e))})]})]})]}),(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsx)(u.J,{children:"Seasonal / Cultural Theme"}),(0,D.jsxs)(p.l6,{value:Z.seasonal_theme,onValueChange:e=>O(s=>({...s,seasonal_theme:"__none__"===e?"":e})),children:[(0,D.jsx)(p.bq,{children:(0,D.jsx)(p.yv,{placeholder:"Select a theme (optional)"})}),(0,D.jsxs)(p.gC,{children:[(0,D.jsx)(p.eb,{value:"__none__",children:"No theme"}),P.map(e=>(0,D.jsx)(p.eb,{value:e,children:e},e))]})]}),"NAIDOC Week"===Z.seasonal_theme&&(0,D.jsxs)("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded p-2 mt-1 flex gap-1.5 items-start",children:[(0,D.jsx)(y.A,{className:"w-3.5 h-3.5 mt-0.5 shrink-0"}),"NAIDOC Week activities will produce a text-only teacher guide following cultural protocols. No AI-generated imagery will be used."]})]}),"colouring_page"!==Z.craft_mode&&(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsx)(u.J,{children:"Number of Steps"}),(0,D.jsx)("div",{className:"flex gap-2",children:E.map(e=>(0,D.jsx)("button",{type:"button",onClick:()=>O(s=>({...s,num_steps:e})),className:"px-3 py-1.5 rounded-md text-sm border transition-colors "+(Z.num_steps===e?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-muted"),children:e},e))})]}),U&&(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsx)(u.J,{children:"Project Description"}),(0,D.jsx)(h.T,{placeholder:"Describe what students will build (e.g. 'A timber toolbox using butt joints, nails, and sandpaper finish')",value:Z.project_description,onChange:e=>O(s=>({...s,project_description:e.target.value})),rows:2})]}),(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsx)(u.J,{children:"Curriculum Outcome Codes"}),(0,D.jsx)(d.p,{placeholder:"e.g. ACTDEP023, ACTDEP029 (comma-separated, optional)",value:Z.outcome_codes,onChange:e=>O(s=>({...s,outcome_codes:e.target.value}))}),(0,D.jsx)("p",{className:"text-xs text-muted-foreground",children:"ACARA, NSW, VIC, WA codes supported. Leave blank to use free-text notes below."})]}),(0,D.jsxs)("div",{className:"space-y-1",children:[(0,D.jsx)(u.J,{children:"Curriculum Notes"}),(0,D.jsx)(h.T,{placeholder:"Add any curriculum context, state-specific outcomes, or learning intentions (optional)",value:Z.curriculum_notes,onChange:e=>O(s=>({...s,curriculum_notes:e.target.value})),rows:2})]}),(0,D.jsxs)(c.$,{onClick:async()=>{const e=[];
1if(Z.title.trim()||e.push("Title"),0===Z.year_levels.length&&e.push("Year Level"),e.length>0)return void o.oR.error(`Please fill in: ${e.join(", ")}.`);const s=Z.outcome_codes?Z.outcome_codes.split(",").map(e=>e.trim()).filter(Boolean):[],a={title:Z.title,craft_mode:Z.craft_mode,year_levels:Z.year_levels,subject:Z.subject||"",seasonal_theme:Z.seasonal_theme||null,num_steps:Z.num_steps,outcome_codes:s,curriculum_notes:Z.curriculum_notes||"",project_description:Z.project_description||""};J(!0);try{const e=await i.A.post(`${i.n}/craft/generate`,a);o.oR.success("Craft activity created!"),t(`/activity-studio/craft/${e.data.activity_id}`)}catch(m){var l,r,c;if(403===(null===(l=m.response)||void 0===l?void 0:l.status)){var n;const e=(null===(n=m.response.data)||void 0===n?void 0:n.detail)||"";e.toLowerCase().includes("credit")?Y(!0):o.oR.error(e||"Access denied.")}else if(400===(null===(r=m.response)||void 0===r?void 0:r.status)){var d;o.oR.error((null===(d=m.response.data)||void 0===d?void 0:d.detail)||"Invalid outcome codes. Please check and try again.")}else if(422===(null===(c=m.response)||void 0===c?void 0:c.status)){var u;o.oR.error((null===(u=m.response.data)||void 0===u?void 0:u.detail)||"Could not generate craft activity. Try adjusting the settings.")}else o.oR.error("Generation failed. Please try again.")}finally{J(!1)}},disabled:W,className:"w-full",children:[(0,D.jsx)(w.A,{className:"w-4 h-4 mr-2"}),"Generate ",(null===K||void 0===K?void 0:K.label)||"Craft Activity"]})]})]})}),(0,D.jsx)(x.av,{value:"library",children:(0,D.jsxs)("div",{className:"space-y-4",children:[(0,D.jsxs)("div",{className:"relative",children:[(0,D.jsx)(A.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),(0,D.jsx)(d.p,{placeholder:"Search craft activities\u2026",value:B,onChange:e=>G(e.target.value),className:"pl-9"})]}),0===X.length?(0,D.jsxs)("div",{className:"text-center py-12 text-muted-foreground",children:[(0,D.jsx)(w.A,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),(0,D.jsx)("p",{className:"font-medium",children:"No craft activities yet"}),(0,D.jsx)("p",{className:"text-sm mt-1",children:"Create your first one on the Create tab."})]}):(0,D.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:X.map(e=>{var s;return(0,D.jsx)(n.Zp,{className:"cursor-pointer hover:shadow-md transition-shadow",onClick:()=>t(`/activity-studio/craft/${e.activity_id}`),children:(0,D.jsx)(n.Wu,{className:"p-4",children:(0,D.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,D.jsxs)("div",{className:"min-w-0",children:[(0,D.jsx)("p",{className:"font-semibold text-sm truncate",children:e.title}),(0,D.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:[Q(e.craft_mode),e.subject?` \xb7 ${e.subject}`:"",null!==(s=e.year_levels)&&void 0!==s&&s.length?` \xb7 Year ${e.year_levels.join(", ")}`:""]}),e.seasonal_theme&&(0,D.jsx)(m.E,{variant:"outline",className:"mt-1 text-xs",children:e.seasonal_theme})]}),(0,D.jsx)(f.A,{className:"w-4 h-4 text-muted-foreground shrink-0 mt-0.5"})]})})},e.activity_id)})})]})})]})]}),F&&(0,D.jsx)(g.A,{open:F,onClose:()=>Y(!1),user:k})]})}},8032(e,s,t){t.r(s),t.d(s,{default:()=>r});var a=t(3455),l=t(579);const r=()=>(0,l.jsx)(a.default,{lockedMode:"cut_and_assemble"})}}]); 2//# sourceMappingURL=8032.9de3eb8b.chunk.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.