1import{a as Rt}from"./chunk-P7XRPASY.js";import{a as Bt,b as K,c as Lt,d as $t}from"./chunk-TNSP2JE6.js";import{a as Vt,b as Dt}from"./chunk-H4GXQUWR.js";import"./chunk-6KM35DQA.js";import"./chunk-UFHJOX2D.js";import"./chunk-I5SUBAXL.js";import"./chunk-3BDQUNHN.js";import{a as Ht}from"./chunk-JGCRN4O4.js";import{a as Gt}from"./chunk-CJEFVAXA.js";import"./chunk-HQTT4VE3.js";import"./chunk-RMURHLP6.js";import"./chunk-V77LSHTI.js";import"./chunk-OMXFITVG.js";import"./chunk-WY52553B.js";import"./chunk-BVVYHPK5.js";import"./chunk-ZUFKGSZH.js";import"./chunk-PHDJEOGH.js";import{c as Nt}from"./chunk-WKWEMQXG.js";import"./chunk-GGXVIKE5.js";import{g as wt,h as Ot,k as Et,l as Mt,p as Pt,s as It}from"./chunk-4XRLQYKO.js";import"./chunk-T5I2N3PP.js";import"./chunk-4F3AFLZA.js";import"./chunk-4TPXBHVW.js";import"./chunk-BP5XV45E.js";import{b as At}from"./chunk-V46N6H7E.js";import"./chunk-UGVE6YXJ.js";import"./chunk-BPCH5QQL.js";import"./chunk-PPMQE2JW.js";import{o as bt,p as Tt}from"./chunk-T2OPVJ5Z.js";import"./chunk-S67CWVU3.js";import"./chunk-UNY2DPAG.js";import"./chunk-ZHIQ2TBV.js";import{a as Ft}from"./chunk-OD4X62ZJ.js";import{a as ft}from"./chunk-PN56XZHR.js";import{a as yt,b as j}from"./chunk-GTTTZCRC.js";import{a as kt}from"./chunk-ERZRSWAB.js";import{a as xt,b as St}from"./chunk-ELSBIOH2.js";import"./chunk-PRCAIWPZ.js";import{c as Ct,e as ht,f as vt}from"./chunk-MS7NACE6.js";import"./chunk-ATFNEUVQ.js";import{Ca as ot,Eb as c,Fb as l,Hb as U,Ib as w,Jb as O,Jc as $,Kb as b,L as H,Lb as d,Mb as m,Nb as x,Ob as C,Pb as k,Pc as ut,Qb as y,Rb as st,S as nt,Sb as rt,Ub as E,V as X,Va as A,Wa as Y,Wb as M,Xb as P,Yb as a,_a as s,ac as ct,bc as G,cc as B,ea as T,ed as gt,gc as lt,hc as J,ic as I,jc as dt,ka as h,kc as mt,l as Q,la as v,lc as _,ma as g,mb as z,mc as V,na as F,nc as S,oc as D,p as W,qc as pt,rc as _t,sb as at,xc as p,ya as it,yc as u,zc as L}from"./chunk-MFXMOPXL.js";import{a as tt,b as et,h as R}from"./chunk-7BXBZ5JU.js";var Z=(e,n)=>n.id;function qt(e,n){e&1&&(g(),y(0,"use",9))}function Qt(e,n){e&1&&(g(),y(0,"use",10))}function Wt(e,n){e&1&&(g(),C(0,"svg",12),y(1,"use",15),k())}function Xt(e,n){e&1&&(g(),y(0,"use",9))}function Yt(e,n){e&1&&(g(),y(0,"use",10))}function Jt(e,n){e&1&&(g(),C(0,"svg",12),y(1,"use",15),k())}function Kt(e,n){if(e&1&&_(0),e&2){let t=a().$implicit,i=a(3).$implicit;D(" ",i.asTask().taskNumber," ",t.taskNumber," ")}}function Zt(e,n){if(e&1&&_(0),e&2){let t=a(4).$implicit;S(" ",t.asTask().taskNumber+")"," ")}}function te(e,n){e&1&&(g(),C(0,"svg",12),y(1,"use",15),k())}function ee(e,n){e&1&&(_(0),p(1,"translate")),e&2&&S(" ",u(1,1,"studentSet.continue")," ")}function ne(e,n){if(e&1){let t=E();C(0,"li",19),c(1,Kt,1,2)(2,Zt,1,1),C(3,"span",20),P("keydown.enter",function(){let o=h(t).$implicit,r=a(3).$implicit,f=a(2).$implicit,N=a();return N.selectNavTargets()(f,r.asTask(),o),v(N.close()())})("click",function(){let o=h(t).$implicit,r=a(3).$implicit,f=a(2).$implicit,N=a();return N.selectNavTargets()(f,r.asTask(),o),v(N.close()())}),c(4,te,2,0,":svg:svg",12)(5,ee,2,3),g(),C(6,"svg",21),y(7,"use",14),k()()()}if(e&2){let t=n.$implicit,i=a(3).$implicit,o=a(3);s(),l(i.asTask().subTasks.length>1?1:2),s(3),l(t.solved?4:t.id===o.continueId?5:-1)}}function ie(e,n){if(e&1&&(C(0,"ul"),w(1,ne,8,2,"li",19,Z),k()),e&2){let t=a(2).$implicit;s(),O(t.asTask().subTasks)}}function oe(e,n){if(e&1){let t=E();C(0,"li",16),g(),C(1,"svg",17),P("keydown.enter",function(){h(t);let o=a().$implicit,r=a(3);return v(r.toggleVisibility(o.id))})("click",function(){h(t);let o=a().$implicit,r=a(3);return v(r.toggleVisibility(o.id))}),c(2,Xt,1,0,":svg:use",9)(3,Yt,1,0,":svg:use",10),k(),_(4),p(5,"translate"),F(),C(6,"span",11),c(7,Jt,2,0,":svg:svg",12),g(),C(8,"svg",18),P("keydown.enter",function(){h(t);let o=a().$implicit,r=a(2).$implicit,f=a();return f.selectNavTargets()(r,o.asTask()),v(f.close()())})("click",function(){h(t);let o=a().$implicit,r=a(2).$implicit,f=a();return f.selectNavTargets()(r,o.asTask()),v(f.close()())}),y(9,"use",14),k()()(),c(10,ie,3,0,"ul")}if(e&2){let t=a().$implicit,i=a(3);s(2),l(i.hiddenSections.has(t.id)?2:3),s(2),D(" ",u(5,5,"assignments.assignment")," ",t.asTask().taskNumber," "),s(3),l(t.solved?7:-1),s(3),l(i.hiddenSections.has(t.asTask().id)?-1:10)}}function ae(e,n){if(e&1&&c(0,oe,11,7),e&2){let t=n.$implicit;l(t.type==="task"?0:-1)}}function se(e,n){if(e&1&&(C(0,"ul"),w(1,ae,1,1,null,null,Z),k()),e&2){let t=a().$implicit;s(),O(t.contentBlocks)}}function re(e,n){if(e&1){let t=E();C(0,"div",7),g(),C(1,"svg",8),P("keydown.enter",function(){let o=h(t).$implicit,r=a();return v(r.toggleVisibility(o.id))})("click",function(){let o=h(t).$implicit,r=a();return v(r.toggleVisibility(o.id))}),c(2,qt,1,0,":svg:use",9)(3,Qt,1,0,":svg:use",10),k(),_(4),F(),C(5,"span",11),c(6,Wt,2,0,":svg:svg",12),g(),C(7,"svg",13),P("keydown.enter",function(){let o=h(t).$implicit,r=a();return r.selectNavTargets()(o),v(r.close()())})("click",function(){let o=h(t).$implicit,r=a();return r.selectNavTargets()(o),v(r.close()())}),y(8,"use",14),k()()(),c(9,se,3,0,"ul")}if(e&2){let t=n.$implicit,i=a();s(2),l(i.hiddenSections.has(t.id)?2:3),s(2),S(" ",t.title," "),s(2),l(t.solved?6:-1),s(3),l(i.hiddenSections.has(t.id)?-1:9)}}var q=class e{set=$();selectNavTargets=$();close=$();activeSection=$();activeTask=$();hiddenSections=new Set;continueId=null;idToSection=new Map;ngOnInit(){this.continueId=this.getContinueId(),this.setInitiallyHiddenElements()}toggleVisibility(n){this.hiddenSections.has(n)?this.hiddenSections.delete(n):this.idToSection.has(n)?this.hideSection(this.idToSection.get(n)):this.hiddenSections.add(n)}getContinueId(){for(let n of this.set()?.sections??[])for(let t of n.tasks)for(let i of t.subTasks)if(!i.solved)return i.id;return null}hideSection(n){this.hiddenSections.add(n.id);for(let t of n.tasks)this.hiddenSections.add(t.id)}setInitiallyHiddenElements(){for(let n of this.set()?.sections??[]){this.idToSection.set(n.id,n),this.activeSection()?.id!==n.id&&this.hiddenSections.add(n.id);for(let t of n.tasks)this.activeTask()?.id!==t.id&&this.hiddenSections.add(t.id)}}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=z({type:e,selectors:[["app-assignment-set-navigation"]],inputs:{set:[1,"set"],selectNavTargets:[1,"selectNavTargets"],close:[1,"close"],activeSection:[1,"activeSection"],activeTask:[1,"activeTask"]},decls:14,vars:6,consts:[[1,"assignment-set-navigation"],[1,"nav-title"],["tabindex","0",1,"close-icon","action-icon",3,"keydown.enter","click"],["href","#icon-close"],[1,"nav-content"],[1,"buttons"],["type","button",1,"btn","btn-secondary",3,"click"],["data-cy","set-nav-section",1,"nav-element"],["tabindex","0","data-cy","set-nav-toggle-section",1,"svg-icon","small","action-icon","chevron",3,"keydown.enter","click"],["href","#icon-chevron-down"],["href","#icon-chevron-up"],[1,"right-blue"],[1,"solved-icon"],["tabindex","0","data-cy","set-nav-select-section",1,"arrow-icon",3,"keydown.enter","click"],["href","#icon-arrow-right"],["href","#icon-tick-circle"],["data-cy","set-nav-task",1,"nav-element","nav-indent-1"],["tabindex","0","data-cy","set-nav-toggle-task",1,"svg-icon","small","mr-2","not-in-pdf","action-icon","chevron",3,"keydown.enter","click"],["tabindex","0",1,"arrow-icon",3,"keydown.enter","click"],["data-cy","set-nav-subtask",1,"nav-element","nav-indent-2"],["tabindex","0",1,"right-blue",3,"keydown.enter","click"],[1,"arrow-icon"]],template:function(t,i){if(t&1&&(C(0,"div",0)(1,"h2",1)(2,"span"),_(3),p(4,"translate"),k(),g(),C(5,"svg",2),P("keydown.enter",function(){return i.close()()})("click",function(){return i.close()()}),y(6,"use",3),k()(),F(),C(7,"div",4),w(8,re,10,4,null,null,Z),k(),C(10,"div",5)(11,"button",6),P("click",function(){return i.close()()}),_(12),p(13,"translate"),k()()()),t&2){let o;s(3),S(" ",u(4,2,"studentSet.navigation.title")," "),s(5),O((o=i.set())==null?null:o.sections),s(4),S(" ",u(13,4,"labels.close")," ")}},dependencies:[j],styles:[".assignment-set-navigation[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;height:99vh;width:440px;max-width:calc(100vw - 20px);border-radius:1rem 0 0 1rem;border-left:1px solid var(--iconomix-blue-finest);background-color:var(--iconomix-white);padding:2.5rem 2rem;box-shadow:0 0 1rem #0000001a}.nav-content[_ngcontent-%COMP%]{height:auto;overflow:auto}.nav-element[_ngcontent-%COMP%]{border-bottom:1px solid rgba(203,203,203,.5019607843);display:flex;gap:.5rem;transition:max-height ease-in-out .2s;padding:.25rem 0}.nav-element.nav-indent-1[_ngcontent-%COMP%]{padding-left:1.5rem}.nav-element.nav-indent-2[_ngcontent-%COMP%]{padding-left:3rem}.right-blue[_ngcontent-%COMP%]{margin-left:auto;cursor:pointer;display:flex;gap:.5rem;color:var(--iconomix-pelican-blue);align-items:center}.nav-title[_ngcontent-%COMP%]{display:flex;height:2.75rem;padding:.5rem 0;font-size:1.125rem}.close-icon[_ngcontent-%COMP%]{height:.875rem!important;width:.875rem!important;margin-left:auto}.chevron[_ngcontent-%COMP%]{min-width:1rem!important;width:1rem!important}.action-icon[_ngcontent-%COMP%]{cursor:pointer;position:relative;top:3px}.arrow-icon[_ngcontent-%COMP%]{height:1.5rem!important;width:.875rem!important}.solved-icon[_ngcontent-%COMP%]{height:.75rem!important;width:.75rem!important}.buttons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;height:2.75rem;margin-top:auto}ul[_ngcontent-%COMP%]{padding-inline-start:0;margin-bottom:0}"],changeDetection:0})};var ce=["completedBar"],le=["progressValue"],de=["overlayNavigation"],me=["overlayHook"],pe=(e,n)=>n.id;function _e(e,n){if(e&1&&x(0,"app-assignment-set-navigation",17),e&2){let t=a(2);b("set",t.set)("selectNavTargets",t.setSectionAndTaskAndSubTask)("close",t.closeNavigation)("activeSection",t.activeSection)("activeTask",t.activeTask)}}function ue(e,n){e&1&&(d(0,"div",15),_(1),p(2,"translate"),m()),e&2&&(s(),S(" ",u(2,1,"studentSet.completed")," "))}function ge(e,n){if(e&1&&(_(0),p(1,"translate")),e&2){let t=a().$implicit;D(" ",t.nTasks," ",u(1,2,"assignments."+(t.nTasks===1?"assignment":"assignments"))," ")}}function Ce(e,n){if(e&1){let t=E();d(0,"li")(1,"div",20)(2,"h2",21),_(3),m(),d(4,"div",22),c(5,ge,2,4),m()(),d(6,"button",23),M("click",function(){let o=h(t).$implicit,r=a(4);return v(r.startSection(o))}),g(),d(7,"svg",7),x(8,"use",24),m(),_(9),p(10,"translate"),m()()}if(e&2){let t=n.$implicit,i=a(4);s(3),V(t.title),s(2),l(i.areNotOnlyTextsAndImages(t.contentBlocks)?5:-1),s(),mt(_t("btn btn-sm ",t.id===(i.nextSection==null?null:i.nextSection.id)?"btn-primary":"btn-secondary")),s(3),S(" ",u(10,6,"studentSet.start")," ")}}
1function he(e,n){if(e&1&&(d(0,"h1",18),_(1),m(),d(2,"ul",19),w(3,Ce,11,8,"li",null,pe),m()),e&2){let t=a(3);s(),V(t.set.moduleName??t.module.title),s(2),O(t.set.sections)}}function ve(e,n){if(e&1&&(d(0,"h3"),_(1),m()),e&2){let t=a(2).$implicit,i=a(4);I("black-title",i.onlyTextsAndGraphics),s(),V(t.asText().title)}}function xe(e,n){if(e&1&&(x(0,"div",27),p(1,"resolvePageLinks"),p(2,"async"),p(3,"tooltipHtml")),e&2){let t=a(2).$implicit;b("innerHTML",u(3,6,u(2,4,L(1,1,t.asText().text,!0))),A)}}function Se(e,n){if(e&1&&(c(0,ve,2,3,"h3",26),c(1,xe,4,8,"div",27)),e&2){let t=a().$implicit;l(t.asText().title?0:-1),s(),l(t.asText().text?1:-1)}}function fe(e,n){if(e&1&&(x(0,"div",30),p(1,"resolvePageLinks"),p(2,"async")),e&2){let t=a(2).$implicit;b("innerHTML",u(2,4,L(1,1,t.asGraphic().legend,!0)),A)}}function ke(e,n){if(e&1&&(d(0,"div",28),x(1,"img",29),c(2,fe,3,6,"div",30),m()),e&2){let t=a().$implicit;J("max-width",t.asGraphic().maxGraphicWidth,"%"),I("right",t.asGraphic().alignment==="right")("center",t.asGraphic().alignment==="center"),s(),I("rounded",!t.asGraphic().noRoundedCorners),b("src",t.asGraphic().graphicUrl,Y)("alt",t.asGraphic().graphicTitle),s(),l(t.asGraphic().legend?2:-1)}}function be(e,n){if(e&1&&c(0,Se,2,2)(1,ke,3,11,"div",25),e&2){let t=n.$implicit;l(t.type==="text"?0:t.type==="graphic"?1:-1)}}function Te(e,n){if(e&1&&w(0,be,2,1,null,null,U),e&2){let t=a(3);O(t.activeTextAndGraphicContentBlocks)}}function ye(e,n){if(e&1&&(d(0,"h3"),_(1),m()),e&2){let t=a(2).$implicit;s(),V(t.title)}}function we(e,n){if(e&1&&(x(0,"div",43),p(1,"resolvePageLinks"),p(2,"async"),p(3,"tooltipHtml")),e&2){let t=a(2).$implicit;b("innerHTML",u(3,6,u(2,4,L(1,1,t.text,!0))),A)}}function Oe(e,n){if(e&1&&(c(0,ye,2,1,"h3"),c(1,we,4,8,"div",43)),e&2){let t=a().$implicit;l(t.title?0:-1),s(),l(t.text?1:-1)}}function Ee(e,n){if(e&1&&(x(0,"div",30),p(1,"resolvePageLinks"),p(2,"async")),e&2){let t=a(2).$implicit;b("innerHTML",u(2,4,L(1,1,t.legend,!0)),A)}}function Me(e,n){if(e&1&&(d(0,"div",44),x(1,"img",29),c(2,Ee,3,6,"div",30),m()),e&2){let t=a().$implicit;J("max-width",t.asGraphic().maxGraphicWidth?t.asGraphic().maxGraphicWidth+"%":null),I("center",t.asGraphic().alignment==="center")("right",t.asGraphic().alignment==="right"),s(),I("rounded",!t.noRoundedCorners)("right",t.alignment==="right")("center",t.alignment==="center"),b("src",t.graphicUrl,Y)("alt",t.graphicTitle),s(),l(t.legend?2:-1)}}function Pe(e,n){if(e&1&&c(0,Oe,2,2)(1,Me,3,15,"div",42),e&2){let t=n.$implicit,i=a(5);l(t instanceof i.TextSectionContentBlock?0:1)}}function Ie(e,n){if(e&1){let t=E();d(0,"div",36)(1,"a",37),M("click",function(){h(t);let o=a(4);return v(o.toggleIntro(!0))}),_(2),p(3,"translate"),m()(),d(4,"div",38)(5,"button",39),M("click",function(){h(t);let o=a(4);return v(o.toggleIntro(!1))}),g(),d(6,"svg",40),x(7,"use",41),m()(),w(8,Pe,2,1,null,null,U),m()}if(e&2){let t=a(4);s(2),V(u(3,3,"studentSet.showIntro")),s(2),I("active",t.showIntro),s(4),O(t.introTexts)}}function Ne(e,n){if(e&1&&(x(0,"div",31),p(1,"resolvePageLinks"),p(2,"async"),p(3,"tooltipHtml")),e&2){let t=a(4);b("innerHTML",u(3,6,u(2,4,L(1,1,t.activeTask.text,!0))),A)}}function Fe(e,n){if(e&1&&_(0),e&2){let t=a(4);S(" ",t.activeTask.taskNumber+" "+t.activeSubTask.taskNumber," ")}}function Ae(e,n){if(e&1&&_(0),e&2){let t=a(4);S(" ",t.activeTask.taskNumber+")"," ")}}function Ge(e,n){if(e&1&&x(0,"app-assignment-task",35),e&2){let t=n.$implicit,i=n.$index,o=a(4);b("task",t)("parentAssignmentId",o.activeSubTask.id)("taskIndex",i)("isStudentView",!0)("controls",o.form.controls.subTasks.at(o.activeSubTaskIndex).controls.contentBlocks.at(i))("showErrors",o.showErrors)}}function Be(e,n){if(e&1&&(c(0,Ie,10,5),c(1,Ne,4,8,"div",31),d(2,"div",32)(3,"div",33),c(4,Fe,1,1)(5,Ae,1,1),m(),d(6,"div",34),w(7,Ge,1,6,"app-assignment-task",35,U),m()()),e&2){let t=a(3);l(t.introTexts.length?0:-1),s(),l(t.activeSubTask.number===0&&(t.activeTask!=null&&t.activeTask.text)?1:-1),s(3),l(((t.activeTask==null||t.activeTask.subTasks==null?null:t.activeTask.subTasks.length)||0)>1?4:5),s(3),O(t.activeSubTask.contentBlocks)}}function Ve(e,n){if(e&1&&(c(0,he,5,1),c(1,Te,2,0),c(2,Be,9,3)),e&2){let t=a(2);l(!t.activeSubTask&&!(t.activeTextAndGraphicContentBlocks!=null&&t.activeTextAndGraphicContentBlocks.length)?0:-1),s(),l(t.activeTextAndGraphicContentBlocks!=null&&t.activeTextAndGraphicContentBlocks.length?1:-1),s(),l(t.activeSubTask?2:-1)}}
1function De(e,n){if(e&1&&(d(0,"span",47),_(1),m()),e&2){let t=a(3);s(),D(" ",t.activeSubTask.number+1,"/",t.activeTask.subTasks.length," ")}}function Le(e,n){if(e&1){let t=E();d(0,"button",45),M("click",function(){h(t);let o=a(2);return v(o.back())}),g(),d(1,"svg",7),x(2,"use",46),m(),_(3),p(4,"translate"),m(),c(5,De,2,2,"span",47),F(),d(6,"button",48),M("click",function(){h(t);let o=a(2);return v(o.continue())}),g(),d(7,"svg",7),x(8,"use",24),m(),_(9),p(10,"translate"),m()}if(e&2){let t=a(2);s(3),S(" ",u(4,3,"studentSet.back")," "),s(2),l(t.activeSubTask?5:-1),s(4),S(" ",u(10,5,"studentSet.continue")," ")}}function $e(e,n){if(e&1&&(x(0,"div",49),d(1,"button",50),g(),d(2,"svg",7),x(3,"use",24),m(),_(4),p(5,"translate"),m()),e&2){let t=a(2);s(),b("routerLink",t.setsLink),s(3),S(" ",u(5,2,"studentSet.toSets")," ")}}function Re(e,n){if(e&1){let t=E();x(0,"app-breadcrumb",3),d(1,"main",4)(2,"div",5)(3,"button",6,0),M("click",function(){h(t);let o=a();return v(o.toggleNavigation())}),g(),d(6,"svg",7),x(7,"use",8),m(),_(8),p(9,"translate"),F(),st(10),at(11,_e,1,5,"ng-template",9),M("backdropClick",function(){h(t);let o=a();return v(o.showNavigation=!1)}),rt(),m(),d(12,"div",10),x(13,"div",11,1),d(15,"div",12,2),_(17),m()(),d(18,"form",13)(19,"div",14),c(20,ue,3,3,"div",15)(21,Ve,3,3),m(),d(22,"div",16),c(23,Le,11,7),c(24,$e,6,4),m()()()()}if(e&2){let t=lt(5),i=a();b("overriddenTitle",pt(i.module.title)),s(8),S(" ",u(9,16,"studentSet.contents")," "),s(3),b("cdkConnectedOverlayPositions",i.overlayPositions)("cdkConnectedOverlayHasBackdrop",!0)("cdkConnectedOverlayOrigin",t)("cdkConnectedOverlayOpen",i.showNavigation),s(2),dt(i.completedWidth()),s(2),I("highlight",i.highlightProgressValue),s(2),S(" ",i.studentSet.progress,"% "),s(),b("formGroup",i.form),s(2),l(i.completed?20:21),s(3),l(i.activeSubTask||i.activeTextAndGraphicContentBlocks!=null&&i.activeTextAndGraphicContentBlocks.length?23:-1),s(),l(i.completed?24:-1)}}var zt=class e{studentSetDataService=T(Rt);route=T(Ct);notificationService=T(Nt);magnoliaService=T(St);authDataService=T(kt);changeDetectoRef=T(ut);translateService=T(yt);linkUtils=T(ft);router=T(ht);el=T(ot);analyticsService=T(Ht);studentSet;set;module;activeTask;activeSubTask;activeTextAndGraphicContentBlocks;activeSection;nextSection;onlyTextsAndGraphics=!1;activeSectionSteps=[];activeStepIndex=0;showErrors=!1;completedBarElement;progressValueElement;overlayNavigationElement;assignmentTaskComponents;get activeSubTaskIndex(){let n=0;for(let t of this.set?.sections??[])for(let i of t.tasks)for(let o of i.subTasks){if(this.activeSubTask?.id===o.id)return n;n++}return 0}form;completed=!1;showIntro=!1;showNavigation=!1;overlayNavigation;get overlayPositions(){let n=this.overlayNavigation?.nativeElement?.getBoundingClientRect()?.x+this.overlayNavigation?.nativeElement?.getBoundingClientRect()?.width,t=window.innerWidth;return[{originX:"end",offsetX:n?t-n:0,originY:"top",overlayX:"end",overlayY:"top",offsetY:this.navigationOffset}]}get navigationOffset(){return-(this.overlayNavigation?.nativeElement.getBoundingClientRect().top??0)}constructor(){this.form=new Ot({subTasks:new Mt([])}),it(()=>{this.authDataService.currentStudent()?this.set||this.getOrCreateSet():this.navigateToLogin()})}navigateToLogin(){return R(this,null,function*(){let n=yield this.magnoliaService.fetchPageContent(et(tt({},this.magnoliaService.getMagnoliaContext()),{nodePath:"/home/edu"}),xt.pageBase),t=this.router.url,i=n.loginLink,o=yield this.linkUtils.getInternalLink(i);this.router.navigateByUrl(o+"?returnUrl="+t)})}getOrCreateSet(){if(this.route.snapshot.queryParams.teacherSetId){let n=+this.route.snapshot.queryParams.teacherSetId;this.studentSetDataService.getByTeacherAssignmentSetId(n).pipe(H(),nt(t=>t?Q(t):this.studentSetDataService.create({teacherSetId:n}))).subscribe({next:t=>{this.studentSet=t,this.loadSet().then(i=>this.analyticsService.trackAssignmentSetStarted(i.moduleName,i.name,t.schoolLevel,this.translateService.getCurrentLang())),this.loadModule(),this.router.navigate([this.router.url.split("?")[0]],{queryParams:{teacherSetId:void 0,setId:this.studentSet.id}})},error:()=>{this.notificationService.error(this.translateService.instant("studentSet.creationError"))}})}
1else this.route.snapshot.queryParams.setId&&this.studentSetDataService.getById(+this.route.snapshot.queryParams.setId).subscribe({next:n=>{this.studentSet=n,this.loadSet(),this.loadModule()},error:()=>{this.notificationService.error(this.translateService.instant("studentSet.loadingError"))}})}loadSet(){return R(this,null,function*(){return yield this.magnoliaService.fetchSet(this.studentSet.magnoliaAssignmentSetId).then(n=>(this.set=new Lt(n.results?.[0],void 0,this.studentSet),Bt(this.set,this.studentSet,this.form),this.nextSection=this.set.sections.find(t=>!t.solved),this.set))})}loadModule(){this.magnoliaService.fetchPage(this.studentSet.magnoliaModuleId).then(n=>{this.module=n.results?.[0],this.changeDetectoRef.markForCheck()})}completedWidth(){return`width: ${this.studentSet?.progress||0}%`}startSection(n){this.activeSection=n,this.onlyTextsAndGraphics=!this.areNotOnlyTextsAndImages(n.contentBlocks),this.activeSectionSteps=this.buildSectionSteps(n),this.activeStepIndex=0,this.activeSectionSteps.length&&this.applyStep(this.activeSectionSteps[0])}buildSectionSteps(n){let t=[],i=[],o=()=>{i.length&&(t.push({type:"textGraphic",blocks:i}),i=[])};for(let r of n.contentBlocks)if(r.type==="text"||r.type==="graphic")i.push(r);else if(r.type==="task"){o();let f=r.asTask();for(let N of f.subTasks)t.push({type:"subTask",task:f,subTask:N})}return o(),t}applyStep(n){n.type==="textGraphic"?(this.activeTextAndGraphicContentBlocks=n.blocks,delete this.activeTask,delete this.activeSubTask):(this.activeTask=n.task,this.activeSubTask=n.subTask,delete this.activeTextAndGraphicContentBlocks)}clearActiveSection(){delete this.activeSection,delete this.activeTask,delete this.activeSubTask,delete this.activeTextAndGraphicContentBlocks,this.activeSectionSteps=[],this.activeStepIndex=0}setSectionAndTaskAndSubTask=(n,t,i)=>{this.saveAnswers().subscribe(()=>{if(this.showErrors=!1,this.completed=!1,!t)return this.startSection(n),this.changeDetectoRef.markForCheck();this.activeSection=n,this.onlyTextsAndGraphics=!this.areNotOnlyTextsAndImages(n.contentBlocks),this.activeSectionSteps=this.buildSectionSteps(n);let o=i??t.subTasks[0],r=this.activeSectionSteps.findIndex(f=>f.type==="subTask"&&f.subTask.id===o?.id);this.activeStepIndex=r>=0?r:0,this.applyStep(this.activeSectionSteps[this.activeStepIndex]),this.changeDetectoRef.markForCheck()})};closeNavigation=()=>{this.showNavigation=!1,this.changeDetectoRef.markForCheck()};saveAnswers(){if(this.activeSubTask){let n=this.assignmentTaskComponents?.some(o=>o.getTouchedAndMarkAsUntouched())||!1,t=this.form.controls.subTasks.at(this.activeSubTaskIndex).controls.contentBlocks.getRawValue().map(o=>({magnoliaId:o.id??"",solutions:o.solutions.map(r=>r??""),freeTextSolutions:o.freeTextSolutions.map(r=>({magnoliaOptionId:r.id??"",solution:r.solution??""}))})),i={magnoliaTaskId:this.activeSubTask?.id,parentTaskId:this.activeTask?.id,solved:this.currentTaskValid,solutions:t};return this.studentSetDataService.updateSubTask(this.studentSet.id,i).pipe(H(),X(o=>{this.trackIfCompletionEvent(this.studentSet,o),this.studentSet=o,this.loadSet().then(r=>{n&&this.analyticsService.trackAssignmentSetTaskSolved(r.moduleName,r.name,i.magnoliaTaskId,o.schoolLevel,this.translateService.getCurrentLang())})}))}else if(this.activeSection?.nTasks===0){let n={magnoliaTaskId:this.activeSection.contentBlocks[0].id,solved:!0};return this.studentSetDataService.updateSection(this.studentSet.id,n).pipe(H(),X(t=>{this.trackIfCompletionEvent(this.studentSet,t),this.studentSet=t,this.loadSet()}))}else return Q(null)}continue(){return R(this,null,function*(){if(!this.currentTaskValid&&!this.showErrors){this.showErrors=!0,Gt.focusFirstInvalidField(this.el);return}else this.showErrors=!1;yield W(this.saveAnswers()),this.activeStepIndex<this.activeSectionSteps.length-1?(this.activeStepIndex++,this.applyStep(this.activeSectionSteps[this.activeStepIndex])):this.advanceToNextSection(),this.changeDetectoRef.markForCheck()})}advanceToNextSection(){let n=this.set.sections.map(t=>t.id).indexOf(this.activeSection.id);n===this.set.sections.length-1?this.completed=!0:this.nextSection=this.set.sections[n+1],this.clearActiveSection()}backOutOfSection(){let n=Math.max(1,this.set.sections.map(t=>
1t.id).indexOf(this.activeSection.id));this.nextSection=this.set.sections[n-1],this.clearActiveSection()}back(){return R(this,null,function*(){yield W(this.saveAnswers()),this.showErrors=!1,this.activeStepIndex>0?(this.activeStepIndex--,this.applyStep(this.activeSectionSteps[this.activeStepIndex])):this.backOutOfSection(),this.changeDetectoRef.markForCheck()})}get setsLink(){let t=this.router.url.split("?")[0].split("/");return t.slice(0,t.length-1).join("/")}get introTexts(){if(!this.activeSection||!this.activeTask)return[];let n=this.activeSection.contentBlocks,t=n.findIndex(o=>o.id===this.activeTask.id);if(t<0)return[];let i=[];for(let o=t-1;o>=0;o--){let r=n[o];if(r.type==="text")i.unshift(r.asText());else if(r.type==="graphic")i.unshift(r.asGraphic());else break}return i}toggleIntro(n){this.showIntro=n,this.changeDetectoRef.markForCheck()}toggleNavigation(){this.showNavigation=!this.showNavigation}areNotOnlyTextsAndImages(n){return n.some(t=>t.type!=="text"&&t.type!=="graphic")}get currentTaskValid(){return this.activeSubTask?this.form.controls.subTasks.at(this.activeSubTaskIndex).valid:!0}get highlightProgressValue(){let n=this.completedBarElement?.nativeElement.getBoundingClientRect(),t=this.progressValueElement?.nativeElement.getBoundingClientRect();return!!n&&!!t&&n.right>=t.left}trackIfCompletionEvent(n,t){n&&n.progress<100&&t.progress===100&&this.analyticsService.trackAssignmentSetCompleted(this.set?.moduleName,this.set?.name,t.schoolLevel,this.translateService.getCurrentLang())}TextSectionContentBlock=$t;static \u0275fac=function(t){return new(t||e)};static \u0275cmp=z({type:e,selectors:[["app-edu-set"]],viewQuery:function(t,i){if(t&1&&ct(ce,5)(le,5)(de,5)(me,5)(K,5),t&2){let o;G(o=B())&&(i.completedBarElement=o.first),G(o=B())&&(i.progressValueElement=o.first),G(o=B())&&(i.overlayNavigationElement=o.first),G(o=B())&&(i.overlayNavigation=o.first),G(o=B())&&(i.assignmentTaskComponents=o)}},decls:1,vars:1,consts:[["overlayHook","","overlayNavigation","cdkOverlayOrigin"],["completedBar",""],["progressValue",""],[3,"overriddenTitle"],[1,"main-container"],[1,"container-fluid","top-container"],["type","button","cdkOverlayOrigin","","data-cy","edu-set-nav-button",1,"btn","btn-sm","btn-secondary","content-menu-btn",3,"click"],[1,"svg-icon","small","mr-2","not-in-pdf"],["href","#icon-menu"],["cdk-connected-overlay","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"backdropClick","cdkConnectedOverlayPositions","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen"],[1,"progress-bar"],[1,"complete"],[1,"progress-value"],[1,"task-set",3,"formGroup"],[1,"task-content"],[1,"completed"],[1,"button-bar"],[3,"set","selectNavTargets","close","activeSection","activeTask"],["data-cy","edu-set-module-title"],[1,"sections"],[1,"text"],[1,"h3"],[1,"subtitle"],["type","button","data-cy","edu-set-start-section",3,"click"],["href","#icon-arrow-right"],[1,"edu-set-image-wrapper",3,"right","center","max-width"],[3,"black-title"],["appInitTooltips","",3,"innerHTML"],[1,"edu-set-image-wrapper"],[3,"src","alt"],[1,"legend",3,"innerHTML"],["appInitTooltips","",1,"text",3,"innerHTML"],[1,"sub-assignment"],["data-cy","accordion-assignment-enumerator",1,"sub-left"],[1,"sub-right"],[3,"task","parentAssignmentId","taskIndex","isStudentView","controls","showErrors"],[1,"intro"],["href","javascript:void(0)","data-cy","edu-set-toggle-intro",3,"click"],["data-cy","intro-popup",1,"intro-popup"],["type","button",3,"click"],[1,"inner-svg-icon"],["href","#icon-close"],[1,"inner-graphic-container","intro-graphic-container",3,"center","right","max-width"],["appInitTooltips","",1,"intro-popup-text",3,"innerHTML"],[1,"inner-graphic-container","intro-graphic-container"],["type","button","data-cy","edu-set-button-back",1,"btn","btn-sm","btn-secondary",3,"click"],["href","#icon-arrow-left"],["data-cy","edu-set-task-enumeration",1,"task-enumeration"],["type","button","data-cy","edu-set-button-next",1,"btn","btn-sm","btn-primary",3,"click"],[1,"dummy"],["type","button",1,"btn","btn-sm","btn-primary",3,"routerLink"]],template:function(t,i){t&1&&c(0,Re,25,18),t&2&&l(i.studentSet&&i.set&&i.module?0:-1)},dependencies:[At,It,Et,wt,Pt,Dt,K,vt,bt,Tt,q,j,Vt,Ft,gt],styles:[".legend[_ngcontent-%COMP%]{font-size:.75rem;margin-top:1rem}.rounded[_ngcontent-%COMP%]{border-radius:1rem}
1.progress-bar[_ngcontent-%COMP%]{width:100%;height:25px;border-radius:.25rem;background:var(--iconomix-blue-finest);position:relative;margin-bottom:1.5rem}.progress-bar[_ngcontent-%COMP%] .complete[_ngcontent-%COMP%]{height:100%;background:var(--iconomix-pelican-blue)}.progress-bar[_ngcontent-%COMP%] .progress-value[_ngcontent-%COMP%]{position:absolute;right:13px;font-size:.875rem;line-height:25px}.progress-bar[_ngcontent-%COMP%] .progress-value.highlight[_ngcontent-%COMP%]{color:var(--iconomix-white);text-shadow:1px 1px 2.5px rgba(0,0,0,.75)}.task-set[_ngcontent-%COMP%]{box-shadow:2px 2px 8px #0003;margin-top:2rem;border-radius:1rem;margin-bottom:1rem}@media all and (min-width:1024px){.task-set[_ngcontent-%COMP%]{margin-top:4.5rem}}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{padding:1rem;height:calc(100vh - 387px);position:relative;overflow-y:auto!important;overflow-x:hidden}@media all and (max-height:1100px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{min-height:calc(100vh - 387px);height:auto}}@media all and (min-width:780px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{padding:2rem;height:calc(100vh - 360px);min-height:0}}@media all and (min-width:780px)and (max-height:1100px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{min-height:calc(100vh - 360px);height:auto}}@media all and (min-width:1024px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{height:calc(100vh - 500px)}}@media all and (min-width:1024px)and (max-height:1100px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{min-height:calc(100vh - 500px);height:auto}}@media all and (min-width:1024px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%]{padding:2.5rem 5rem}}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style-type:none;padding:0}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:1rem 0;border-top:1px solid var(--iconomix-blue-finest);display:flex;flex-flow:column;align-items:flex-start}@media all and (min-width:780px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{flex-flow:row;justify-content:space-between;align-items:center;padding:1rem 1.5rem}}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-bottom:1px solid var(--iconomix-blue-finest)}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{margin-top:1rem;flex:0 0 auto}@media all and (min-width:780px){.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{margin-top:0}}.task-set[_ngcontent-%COMP%] .task-content[_ngcontent-%COMP%] .black-title[_ngcontent-%COMP%]{color:var(--iconomix-black)}
1.task-set[_ngcontent-%COMP%] .button-bar[_ngcontent-%COMP%]{background:var(--iconomix-blue-finest);height:5.75rem;border-bottom-left-radius:1rem;border-bottom-right-radius:1rem;padding:1rem;display:flex;justify-content:space-between;align-items:center}@media all and (min-width:780px){.task-set[_ngcontent-%COMP%] .button-bar[_ngcontent-%COMP%]{padding:1.5rem 5rem}}h1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.8rem;margin-bottom:1.5rem}@media all and (min-width:780px){h1[_ngcontent-%COMP%]{font-size:2rem;line-height:2.5rem;margin-bottom:2rem}}h2[_ngcontent-%COMP%]{margin:0;font-family:AauxNext-Medium}.content-menu-btn[_ngcontent-%COMP%]{right:15px;top:-4.2rem}@media all and (min-width:780px){.content-menu-btn[_ngcontent-%COMP%]{position:absolute}}.container-fluid[_ngcontent-%COMP%]{position:relative}.sub-assignment[_ngcontent-%COMP%]{display:flex;gap:.75rem}.sub-assignment[_ngcontent-%COMP%] .sub-left[_ngcontent-%COMP%]{flex:0 0 auto}.sub-assignment[_ngcontent-%COMP%] .sub-right[_ngcontent-%COMP%]{flex:1 1 auto;max-width:calc(100% - 36px)}@media all and (min-width:780px){.sub-assignment[_ngcontent-%COMP%] .sub-right[_ngcontent-%COMP%]{max-width:100%}}.text[_ngcontent-%COMP%] + .sub-assignment[_ngcontent-%COMP%]{margin-top:1rem}.completed[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--iconomix-pelican-blue);font-family:AauxNext-Black;font-size:1.25rem;line-height:1.5rem}.intro[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-bottom:1rem}.intro-popup[_ngcontent-%COMP%]{position:absolute;right:0;top:0;height:auto;background:#fff;width:100%;border-radius:1rem;box-shadow:2px 2px 8px #0003;z-index:1;transform:translate(100%);transition:all .3s ease;border-bottom-right-radius:0;border-bottom-left-radius:0;padding:2.5rem 1rem 1rem}@media all and (min-width:780px){.intro-popup[_ngcontent-%COMP%]{width:66%;padding:3.75rem 5rem;border-bottom-left-radius:1rem;font-size:1.25rem;line-height:1.75rem}}.intro-popup.active[_ngcontent-%COMP%]{transform:translate(0)}.intro-popup[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background:transparent;width:24px;height:24px;padding:0;display:flex;justify-content:center;align-items:center;border:none;position:absolute;right:1rem;top:1rem}@media all and (min-width:780px){.intro-popup[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{right:30px;top:30px}}.intro-popup[_ngcontent-%COMP%] button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px}.intro-popup[_ngcontent-%COMP%] .intro-popup-text[_ngcontent-%COMP%]{font-size:1rem}.edu-set-image-wrapper[_ngcontent-%COMP%]{width:100%;display:flex;flex-flow:column}.edu-set-image-wrapper.right[_ngcontent-%COMP%]{margin-left:auto}.edu-set-image-wrapper.center[_ngcontent-%COMP%]{margin-left:auto;margin-right:auto}.intro-graphic-container.right[_ngcontent-%COMP%]{margin-left:auto}.intro-graphic-container.center[_ngcontent-%COMP%]{margin-left:auto;margin-right:auto}"],changeDetection:0})};export{zt as EduSetComponent};
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.