PageSourceSearch

https://www.educative.io/static/_next/static/chunks/506821-05ad9b2ad8487038.js

js educative.io collected 2026-09-24 08:39:57 UTC 244,684 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[506821,257397,553314],{268624:function(e,t,o){"use strict";var n,i=o(44194);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",r({width:16,height:16,viewBox:"0 0 16 16",fill:"current",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=i.createElement("path",{d:"M12 5.67h-.67V4.33a3.33 3.33 0 0 0-6.66 0v1.34H4c-.73 0-1.33.6-1.33 1.33v6.67c0 .73.6 1.33 1.33 1.33h8c.73 0 1.33-.6 1.33-1.33V7c0-.73-.6-1.33-1.33-1.33Zm-4 6A1.34 1.34 0 0 1 8 9c.73 0 1.33.6 1.33 1.33 0 .74-.6 1.34-1.33 1.34Zm2.07-6H5.93V4.33a2.07 2.07 0 0 1 4.14 0v1.34Z",fill:"current"})))}},336636:function(e,t,o){"use strict";var n,i=o(44194);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",r({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=i.createElement("path",{d:"m6.47027 4-.94.94L8.58361 8l-3.05334 3.06.94.94 4.00003-4-4.00003-4Z",fill:"currentColor"})))}},384465:function(e,t,o){"use strict";var n,i=o(44194);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-chevron-left"},e),n||(n=i.createElement("polyline",{points:"15 18 9 12 15 6"})))}},681860:function(e,t,o){"use strict";var n,i=o(44194);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 96 960 960",width:24},e),n||(n=i.createElement("path",{d:"m424 760 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197 859q-54-54-85.5-127T80 576q0-83 31.5-156T197 293q54-54 127-85.5T480 176q83 0 156 31.5T763 293q54 54 85.5 127T880 576q0 83-31.5 156T763 859q-54 54-127 85.5T480 976Z"})))}},387619:function(e,t,o){"use strict";var n,i,r=o(44194);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return r.createElement("svg",a({width:24,height:24,viewBox:"0 0 24 24",stroke:"currentColor",className:"fill-current",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=r.createElement("g",{clipPath:"url(#clip0_86_9282)"},r.createElement("path",{d:"M22 7h-9v2h9V7Zm0 8h-9v2h9v-2ZM5.5 11 2 7.5 3.4 6l2.1 2L9.8 4l1.4 1.4L5.5 11Zm0 8L2 15.5 3.4 14l2.1 2L9.8 12l1.4 1.4L5.5 19Z",fill:"current"}))),i||(i=r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_86_9282"},r.createElement("path",{d:"M0 0h24v24H0z"})))))}},962276:function(e,t,o){"use strict";var n,i=o(44194);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",r({width:20,height:20,viewBox:"0 0 20 20",fill:"current",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.2 5.8V2.5h.8A7.5 7.5 0 115.5 4l5.7 5.7-1.2 1.1-4.5-4.5a5.8 5.8 0 105.3-2v1.5H9.2zM10 15a.8.8 0 01-.8-.8c0-.5.3-.9.8-.9s.8.4.8.9c0 .4-.3.8-.8.8zm5-5c0-.5-.4-.8-.8-.8-.5 0-.9.3-.9.8s.4.8.9.8c.4 0 .8-.3.8-.8zm-9.2.8A.8.8 0 015 10c0-.5.4-.8.8-.8.5 0 .9.3.9.8s-.4.8-.9.8z",fill:"
1current"})))}},603173:function(e,t,o){"use strict";var n,i=o(44194);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",r({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0533 0C8.23178 0 6.89962 0.70496 6.10195 1.77452C5.60862 2.43599 5.34697 3.20198 5.28561 3.94842H3.08336C1.41475 3.94842 0.0259637 5.27933 0.0259637 6.95706V12.0217H1.02596C1.50895 12.0217 2.20596 12.1114 2.74347 12.3922C3.21781 12.64 3.53995 13.0049 3.53995 13.7073C3.53995 14.8258 3.09819 15.2861 2.66306 15.5331C2.13929 15.8304 1.47459 15.8907 1.02596 15.8907H0.0294409L0.0259698 16.8872C0.0208575 18.3549 0.0182714 19.3806 0.0169633 20.0395C0.0163093 20.3689 0.0159747 20.6067 0.0158036 20.7622L0.015625 20.9914C0.015625 22.6755 1.42136 24 3.08336 24H16.5237C18.1857 24 19.5914 22.6755 19.5914 20.9914V17.8856C20.0579 17.8408 20.5712 17.7187 21.0597 17.4766C21.5858 17.2157 22.098 16.8074 22.4737 16.1967C22.8493 15.586 23.0526 14.831 23.0526 13.9327C23.0526 12.1163 22.2604 10.9195 21.1705 10.3059C20.6693 10.0238 20.1171 9.87454 19.5914 9.84059V6.95706C19.5914 5.27289 18.1857 3.94842 16.5237 3.94842H14.274C14.2582 3.84011 14.2382 3.73275 14.2149 3.62731C14.0967 3.09395 13.874 2.52838 13.544 2.00625C12.8818 0.958344 11.7195 0 10.0533 0ZM7.31793 4.72902C7.1978 4.19481 7.30297 3.5095 7.70517 2.97021C8.08062 2.46678 8.78442 2 10.0533 2C10.8548 2 11.4507 2.43758 11.8534 3.07474C12.0559 3.39514 12.1923 3.74439 12.2622 4.05979C12.3356 4.39125 12.3197 4.61042 12.2977 4.69364L11.9671 5.94842H16.5237C17.1362 5.94842 17.5914 6.43173 17.5914 6.95706V12.5113L18.9966 11.8886C19.1598 11.8162 19.6933 11.7695 20.1894 12.0487C20.5914 12.275 21.0526 12.7689 21.0526 13.9327C21.0526 14.5245 20.9212 14.9033 20.7701 15.1489C20.6191 15.3944 20.4127 15.565 20.1714 15.6847C19.6433 15.9465 19.025 15.9248 18.8327 15.877L17.5914 15.5683V20.9914C17.5914 21.5167 17.1362 22 16.5237 22H3.08336C2.47086 22 2.01562 21.516 2.01562 20.9907L2.0158 20.7644C2.01597 20.6095 2.01631 20.3724 2.01696 20.0434C2.01797 19.5334 2.01975 18.8028 2.02288 17.8166C2.52427 17.7389 3.10397 17.5825 3.65031 17.2724C4.72301 16.6636 5.53995 15.5322 5.53995 13.7073C5.53995 12.1201 4.66986 11.1422 3.6696 10.6196C3.12826 10.3367 2.54592 10.1812 2.02596 10.1002V6.95706C2.02596 6.42529 2.47746 5.94842 3.08336 5.94842H7.59215L7.31793 4.72902ZM14.4448 12.9744L10.029 8.58582L8.61914 10.0044L11.6327 12.9994L8.69868 16.0208L10.1335 17.4141L14.4448 12.9744Z",fill:"current"})))}},969099:function(e,t){"use strict";t.Z="enable_minimap_for_non_pal_courses"},425750:function(e,t,o){"use strict";o.d(t,{Q:function(){return n}});let n=3072},483264:function(e,t,o){"use strict";o.d(t,{M:function(){return n}});let n=30},237329:function(e,t,o){"use strict";var n,i;o.d(t,{v:function(){return n}}),(i=n||(n={})).PROJECTS="projects",i.ASSESSMENTS="assessments",i.CLOUDLABS="cloudlabs"},102871:function(e,t,o){"use strict";o.d(t,{N:function(){return n}});let n={CONTAINER_LAUNCH_SUCCESS:"CONTAINER_LAUNCH_SUCCESS",CONTAINER_LAUNCH_FAILURE:"CONTAINER_LAUNCH_FAILURE",EMULATOR_LAUNCH_SUCCESS:"EMULATOR_LAUNCH_SUCCESS",EMULATOR_LAUNCH_FAILURE:"EMULATOR_LAUNCH_FAILURE",CONNECTED:"CONNECTED",DISCONNECTED:"DISCONNECTED",WORKSPACE_SIZE_CHANGED:"WORKSPACE_SIZE_CHANGED",WORKSPACE_LIMIT_EXCEEDED:"WORKSPACE_LIMIT_EXCEEDED",HTTP_DIAGNOSE_RESULT:"HTTP_DIAGNOSE_RESULT",WS_DIAGNOSE_RESULT:"WS_DIAGNOSE_RESULT"}},432538:function(e,t,o){"use strict";var n,i;o.d(t,{b:function(){return n}}),(i=n||(n={}))[i.IN_PROGRESS=2e3]="IN_PROGRESS",i[i.COMPLETED=2001]="COMPLETED"},851222:function(e,t,o){"use strict";o.d(t,{Q:function(){return n}});let n={IN_PROGRESS:1e3,COMPLETED:1001,ABANDONED:1002}},179424:function(e,t,o){"use strict";o.d(t,{H:function(){return n}});let n={AUTHOR_PROJECT:"AuthorProject",LEARNER_PROJECT:"LearnerProject",AUTHOR_CLOUD_LAB:"AuthorCloudLab",LEARNER_CLOUD_LAB:"LearnerCloudLab"}}
1,553314:function(e,t,o){"use strict";o.d(t,{titles:function(){return n}});let n={assembly:"Assembly (GAS x86)",boto3:"boto3",c:"C","c#":"C#","c#12":"C# 12.0","c#14":"C# 14.0","c#9":"C# 9.0","c++":"C++","c++-sll":"C++ 17","c++17":"C++ 17",clojure:"Clojure","cpp-23":"C++ 23","cpp17-gcc11":"C++ 17 (GCC 11)","cpp17-gcc11-debug-code":"C++ 17 (GCC 11) (Debug)",css:"CSS",d:"D",dart:"Dart",diff:"Diff",Dockerfile:"Dockerfile",elixir:"Elixir",erlang:"Erlang",go:"Go (1.6.2)","go-1165":"Go (1.16.5)","go-1182":"Go (1.18.2)","go-1190":"Go (1.19.0)","go-1242":"Go (1.24.2)",haskell:"Haskell",html:"HTML",java:"Java","java-21":"Java 21","java-21-main":"Java 21-M","java-25":"Java 25",javascript:"Javascript (babel-node)","javascript-babel-v1":"Javascript (babel-node v1)","javascript-es2024":"Javascript (babel-node-es2024)","javascript-es2024-debug-code":"Javascript (babel-node-es2024) (Debug)","javascript-sll":"Javascript (babel-node-es2024)",jsx:"JavaScript (JSX)",junit5:"JUnit5 (Java 1.8)",junit58:"JUnit5 v5.8",kotlin:"Kotlin",kotlin15:"Kotlin 1.5",markdown:"Markdown",nodejs:"Node.js",ocaml:"OCaml",perl:"Perl",php:"PHP",postgresql:"PostgreSQL",python:"Python","python-3-14":"Python 3.14.0","python-sll":"Python 3.13.5",python3:"Python 3.5",python310:"Python 3.10.4","python310-debug-code":"Python 3.10.4 (Debug)",python38:"Python 3.8",r:"R",reason:"Reason",ruby:"Ruby","ruby-3-1-2":"Ruby 3.1.2",rust:"Rust 1.40.0","rust-1-57-0":"Rust 1.57.0",sass:"Sass",scala:"Scala",scheme:"Scheme",scss:"Scss",shell:"Shell","shell-20":"Shell-20",solidity:"Solidity",sql:"MySQL","sql-8":"MySQL 8.0",swift:"Swift",typescript:"TypeScript 3.3.4","typescript-4-9-5":"TypeScript 4.9.5","typescript-5-8-3":"TypeScript 5.8.3",xml:"XML",yaml:"YAML"}},85638:function(e,t,o){"use strict";o.d(t,{h:function(){return m}});var n=o(881762),i=o(219808);let r="user_tag_interests",a=null,l=!1,s=()=>{try{let e=(0,i.rV)(r);return e?JSON.parse(e):{}}catch(e){return{}}},d=e=>{try{(0,i.LS)(r,JSON.stringify(e))}catch(e){}},c=()=>{try{(0,i.cl)(r)}catch(e){}},u=e=>{let t=Object.entries(e).flatMap(e=>{let[t,o]=e;return Array(o).fill(t)});return 0===t.length?Promise.resolve():(0,n.Z)({type:"POST",url:"/api/userdata/tag-interests",data:{tags:JSON.stringify(t)}})},p=()=>{let e=s();return 0===Object.keys(e).length?Promise.resolve():(c(),a&&clearTimeout(a),u(e))},h=()=>{let e=s();if(0===Object.keys(e).length)return;let t=Object.entries(e).flatMap(e=>{let[t,o]=e;return Array(o).fill(t)});if(0===t.length)return;let o=new FormData;o.append("tags",JSON.stringify(t)),navigator.sendBeacon("/api/userdata/tag-interests",o),c()},v=()=>{l||(l=!0,c(),window.addEventListener("beforeunload",h),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&h()}))},g=()=>{a||(a=setTimeout(()=>{p().catch(()=>{}),a=null},9e5))},m=e=>{if(!e||0===e.length)return Promise.resolve();v();let t=s();return e.forEach(e=>{t[e]=(t[e]||0)+1}),d(t),g(),Promise.resolve()}},744603:function(e,t,o){"use strict";o.d(t,{r:function(){return a}});var n=o(881762),i=o(653014),r=o(426477);let a=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=Date.now();try{let a=await (0,n.Z)({url:"/api/code/execute",type:"POST",data:e});try{let n=JSON.parse(a);t?(0,i.$U)({newRequestId:n.request_id,requestLabel:i.Y6.RUN,touchPoint:i.MD.RUN,requestTime:Date.now()-o,status:200}):(0,r._b)({...e,requestId:n.request_id,errorText:n.stderr,requestTime:Date.now()-o,status:200,touchPoint:r.MY.RUN})}catch(e){}return a}catch(n){var a,l,s,d;throw t?(0,i.$U)({newRequestId:null==n?void 0:null===(a=n.responseJSON)||void 0===a?void 0:a.request_id,requestLabel:i.Y6.RUN,touchPoint:i.MD.RUN,requestTime:Date.now()-o,status:n.status,errorText:null==n?void 0:null===(l=n.responseJSON)||void 0===l?void 0:l.errorText}):(0,r._b)({...e,requestId:null==n?void 0:null===(s=n.responseJSON)||void 0===s?void 0:s.request_id,requestTime:Date.now()-o,status:n.status||500,errorText:null==n?void 0:null===(d=n.responseJSON)||void 0===d?void 0:d.errorText}),n}}},833635:function(e,t,o){"use strict";o.d(t,{$:function(){return i}});var n=o(881762);let i=(e,t,o)=>{let i="/api/project/begin/".concat(e,"/").concat(t,"/").concat(o);return(0,n.Z)({url:i,type:"POST"})}},761499:function(e,t,o){"use strict";o.d(t,{J:function(){return i}});var n=o(881762);let i=(e,t,o,i)=>(0,n.Z)({url:"/api/author/".concat(e,"/collection/").concat(t,"/collaborators?considerSelf=").concat(o,"&status=").concat(i),type:"GET"})},32144:function(e,t,o){"use strict";o.d(t,{_:function(){return C}});var n=o(226142),i=o(520649),r=o(237329);let a={[i.dL.SKILL_ASSESSMENT]:r.v.ASSESSMENTS,[i.dL.STANDALONE_PROJECT]:r.v.PROJECTS,[i.dL.STANDALONE_CLOUD_LAB]:r.v.CLOUDLABS};var l=o(161514),s=o(255049),d=o(991608),c=o(865546),u=o(428405),p=o(468518),h=o(389392),v=o(242075),g=o(621062),m=o(836753),_=o(493415),f=o(810343),y=o(822616);let C=e=>{let{userInfoState:t,params:o,router:r,collectionActions:C,ignoreLoadingState:S=!1,disableAllRedirections:E=!1,isModulePreview:T=!1,rethrowError:x=!1,setLoaderStateDispatch:L=e=>{},setNotFound:N=e=>{},shouldSetDocker:b=!0,resolvedPath:w=""}=e;return e=>{var O,I,P,A;let j=null==r?void 0:null===(O=r.query)||void 0===O?void 0:O.test_lab;L({isLoading:!0,isLoaded:!1});let k=w||(null==r?void 0:r.asPath),D=(null==r?void 0:null===(I=r.query)||void 0===I?void 0:I.work_type)||(0,_.Z)(k),R=k.includes("/plan/"),U=new n.Z,M=U.decode(null==r?void 0:null===(P=r.query)||void 0===P?void 0:P.encodedPathInfo),F=(0,p.M)(k);o.work_type||(o=(null==r?void 0:null===(A=r.query)||void 0===A?void 0:A.palGroupSlug)?{...o,work_type:i.dL.COLLECTION}:{...o,work_type:D});let Z=/(collection|path|module)editor\/([0-9]{1,16})\/([0-9]{1,16})$/;return(0,s.D)({...o,isModulePreview:T,cloudCourseTestMode:j,isPAL:F}).then(async n=>{var s,d,c;let{data:h}=n,v=JSON.parse(h),g=null==v?void 0:null===(s=v.instance)||void 0===s?void 0:s.details,_=g.work_type,f=g.author_id,x=g.collection_id,L=g.collection_type,N=[i.Lc.APPROVED,i.Lc.APPROVED_FOR_EARLY_ACCESS].includes(g.approval_status);D!==_&&o.is_draft_page&&Z.test(null==r?void 0:r.asPath)&&!E&&r.replace("/".concat(_,"editor/").concat(f,"/").concat(x)),v={...v,collectionId:x,authorId:f};let w=k.includes("/mock-interview")||k.includes("/coaching-session"),O=(0,p.i)(k,!1)&&w,I=F&&k.includes("/project"),P=F&&k.includes("/assessment");
1if(o.author_id&&!o.course_url_slug&&g.url_slug&&!(o.is_draft_page||T)&&(N||L!==i.dL.COLLECTION)&&!O&&!I&&!P){let e;(0,l.Z)("REDIRECTION","FRIENDLY_URL_REDIRECTION");let t=[i.dL.SKILL_ASSESSMENT,i.dL.STANDALONE_PROJECT,i.dL.STANDALONE_CLOUD_LAB].includes(L);if(t&&!M)e="/".concat(a[L],"/").concat(g.url_slug);else if(!t){let t=(0,m.Z)(D,!!o.page_id);e="/".concat(t,"/").concat(g.url_slug),w?e+="/".concat(o.page_id,"/").concat(k.includes("/mock-interview")?"mock-interview":"coaching-session"):o.page_id&&(e+="/".concat("courses"===t&&r.query.page_url_slug?r.query.page_url_slug:U.encode(parseInt(o.page_id,10)))),k.split("#")[0].endsWith("/assessment")&&(e+="/assessment"),k.endsWith("/project")&&(e+="/project"),k.endsWith("/cloudlab")&&(e+="/cloudlab"),k.split("#")[0].endsWith("/certificate")&&(e+="/certificate"),k.split("#")[1]&&(e+="#".concat(k.split("#")[1]))}!E&&e&&r.replace(e)}let A=null==o?void 0:o.skipLiveInstanceFetch;return await e((0,y.dp)(v,null==o?void 0:o.is_draft_page,t,C,S,!A,b)),(null==v?void 0:null===(c=v.instance)||void 0===c?void 0:null===(d=c.details)||void 0===d?void 0:d.user_course_cloud_lab)&&(0,u.Q)(v,v.instance.details.user_course_cloud_lab,v.instance.details.course_cloud_lab.active_group_id,v.instance.details.course_cloud_lab.active_page_id),v}).then(()=>L({isLoaded:!0,isLoading:!1})).catch(t=>{if(t.message===d.pX.failedToFetch){(0,f.u)(t);return}if(t.toString()!==d.pX.requestAborted&&(t.message!==d.pX.programmaticallyCancelled&&(0,v.rU)(t,e,void 0,void 0,R),403===t.status?(N({notFoundPageStatus:!0}),L({isLoaded:!0,isLoading:!1})):t instanceof Response&&401!==t.status&&(L({isLoaded:!1,isLoading:!1,isError:!0}),e(h.n.show(c.ad,{status:"ERROR",text:(0,g.n)(t)||"Unable to load Collection"}))),x))throw t})}}},972729:function(e,t,o){"use strict";o.d(t,{F$:function(){return a},g3:function(){return i},hL:function(){return r}});var n=o(881762);let i=e=>(0,n.Z)({url:"/api/update-user-attendance",type:"PUT",data:{author_id:e.authorId,work_id:e.workId,timezone:e.timezone}}),r=e=>(0,n.Z)({url:"/api/learn-calendar/weekly-data?timezone=".concat(e),type:"GET"}),a=(e,t,o)=>(0,n.Z)({url:"/api/learn-calendar/monthly-data?timezone=".concat(e,"&page_number=").concat(t,"&fetch_all=").concat(o),type:"GET"})},254264:function(e,t,o){"use strict";o.d(t,{l:function(){return i}});var n=o(342015);let i=(e,t)=>o=>{t.reset(),n.E.getState().reset(),e({isLoading:!1,isLoaded:!1,isError:!1})}},822616:function(e,t,o){"use strict";o.d(t,{Uv:function(){return c},cv:function(){return u},dp:function(){return p}});var n=o(128839),i=o(823481),r=o(991608),a=o(783682),l=o(198144),s=o(699402),d=o(273650);let c=(0,n.ZP)((e,t)=>{var o,n,i;let r=null==e?void 0:null===(n=e.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.docker;r?((0,a.w)(r),r.envs=null!==(i=r.envs)&&void 0!==i?i:[],r.container.liveInstance=t):e.instance.details.docker=l.s4}),u=(0,n.ZP)(e=>{var t,o,n;let r=null==e?void 0:null===(o=e.instance)||void 0===o?void 0:null===(t=o.details)||void 0===t?void 0:t.toc;null==r||null===(n=r.categories)||void 0===n||n.forEach(e=>{e.id!==i.s||e.title||(e.title="Recovered Lessons")})}),p=function(e,t,n,i){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=!(arguments.length>5)||void 0===arguments[5]||arguments[5],p=!(arguments.length>6)||void 0===arguments[6]||arguments[6];return async h=>{var v;let g=o.g.loaderContext.stateLoader,m=!!(null===(v=n.data)||void 0===v?void 0:v.user_id)||(null==e?void 0:e.is_user_loggedin)||t,_=l&&(m||e.instance.details.allow_logged_out_executions)?await (0,s.w)(e.collectionId,e.authorId):{},f=c(e,_);if(f=u(f),!(a||g.isLoading))throw Error(r.pX.programmaticallyCancelled);if(i.set(f),p)return d.Z.getState().setObject(f.instance.details.docker)}}},795123:function(e,t,o){"use strict";var n=o(931549),i=o(44194),r=o(329140),a=o.n(r),l=o(881756),s=o(687610),d=o(510334);t.Z=e=>{let{children:t,backdropOnDesktop:o=!1,handleWidthChange:r=!0,sidebarWidth:c="20rem",backgroundColor:u="bg-gray-L50 dark:bg-gray-D1400",onSidebarToggle:p,zIndex:h=null}=e;(0,i.useLayoutEffect)(()=>{if(!r)return;let e=e=>{let t=(0,s.e)();t&&!e.matches&&(t.style.setProperty("--sidebar-open","0"),null==p||p(!1))},t=window.matchMedia("(min-width: 960px)");return t.addEventListener?t.addEventListener("change",e):t.addListener(e),()=>{t.removeEventListener?t.removeEventListener("change",e):t.removeListener(e)}},[]);let v=(0,d.T)();return(0,n.jsxs)("div",{id:a().container,className:"major-second lg:minor-third",...c?{style:{"--lesson-page-sidebar-width":c}}:{},children:[(0,n.jsx)("div",{className:"sidebar-overlay fixed backdrop-blur-sm ".concat(a().overlay," ").concat(o?"backdrop-brightness-50":a()["overlay-mobile"]),onClick:()=>{(0,l.X)(),null==p||p(!1)},style:{zIndex:7}}),(0,n.jsx)("nav",{className:"no-scrollbar flex flex-col overflow-x-hidden overscroll-y-contain border-0 ".concat(v?"border-l":"border-r"," border-solid border-gray-L200 dark:border-gray-D1200 ").concat(u),id:a()[v?"rtlSidebar":"sidebar"],style:h?{zIndex:h}:{},children:(0,n.jsx)("div",{className:"relative flex h-full w-full flex-col",style:{width:"min(".concat(c,", 100vw)")},children:t})})]})}},749708:function(e,t,o){"use strict";o.d(t,{Z:function(){return l}});var n=o(931549),i=o(44194),r=e=>{let{dir:t="ltr"}=e;return(0,n.jsx)("div",{dir:t,className:"p-4",children:(0,n.jsx)("div",{className:"flex h-6 w-full items-center",children:(0,n.jsx)("div",{className:"bg-neutral-tertiary h-3 w-3/5 animate-pulse rounded-full"})})})},a=o(836005),l=e=>{let{dir:t="ltr"}=e;return(0,n.jsx)(n.Fragment,{children:Array.from({length:9},(e,o)=>(0,n.jsxs)(i.Fragment,{children:[0!==o&&(0,n.jsx)(a.Z,{}),(0,n.jsx)(r,{dir:t})]},o))})}},836005:function(e,t,o){"use strict";var n=o(931549);t.Z=()=>
1(0,n.jsx)("div",{className:"s-gray-disabled w-full border border-solid"})},667241:function(e,t,o){"use strict";o.d(t,{Z:function(){return c}});var n=o(931549),i=o(836005),r=e=>{let{dir:t="ltr"}=e;return(0,n.jsx)("div",{dir:t,className:"px-4 py-8",children:(0,n.jsxs)("div",{className:"flex h-14 w-full flex-col justify-center gap-y-3",children:[(0,n.jsx)("div",{className:"bg-neutral-tertiary h-3 w-full animate-pulse rounded-full"}),(0,n.jsx)("div",{className:"bg-neutral-tertiary h-3 w-1/2 animate-pulse rounded-full"})]})})};o(44194);var a=e=>{let{dir:t="ltr"}=e;return(0,n.jsx)("div",{dir:t,className:"p-4",children:(0,n.jsx)("div",{className:"flex h-7 w-full items-center",children:(0,n.jsx)("div",{className:"bg-neutral-tertiary h-3 w-full animate-pulse rounded-full"})})})},l=o(246143),s=e=>{let{dir:t="ltr"}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r,{dir:t}),(0,n.jsx)(i.Z,{}),(0,n.jsx)(a,{dir:t}),(0,n.jsx)(i.Z,{}),(0,n.jsx)(l.Z,{dir:t})]})},d=o(749708),c=e=>{let{dir:t="ltr"}=e;return(0,n.jsx)("div",{className:"w-full",children:(0,n.jsxs)("div",{className:"flex w-full flex-col",children:[(0,n.jsx)(s,{dir:t}),(0,n.jsx)(i.Z,{}),(0,n.jsx)(d.Z,{dir:t})]})})}},246143:function(e,t,o){"use strict";var n=o(931549);o(44194),t.Z=e=>{let{dir:t="ltr",outerClassName:o="p-4"}=e;return(0,n.jsx)("div",{dir:t,className:o,children:(0,n.jsx)("div",{className:"flex h-6 w-full items-center",children:(0,n.jsx)("div",{className:"bg-neutral-tertiary h-3 w-full animate-pulse rounded-full"})})})}},784190:function(e,t,o){"use strict";o.d(t,{y:function(){return i}});var n=o(853224);let i=()=>(0,n.P)("enable_minimap_for_courses",!0)},263025:function(e,t,o){"use strict";o.d(t,{H:function(){return r}});var n=o(881762),i=o(520649);let r=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.dL.COLLECTION;return(0,n.Z)({url:"/api/user-certificate/".concat(e,"/").concat(t,"?work_type=").concat(o),type:"POST"})}},891905:function(e,t,o){"use strict";o.d(t,{_:function(){return i}});var n=o(881762);let i=(e,t)=>(0,n.Z)({type:"POST",url:"/api/userdata/last-viewed-collections",data:{author_id:e,collection_id:t}})},36507:function(e,t,o){"use strict";o.d(t,{Z:function(){return n}});let n=e=>{let{authorId:t,collectionId:o,isInterviewPrepPage:n=!1,variableIds:i=[],values:r=[]}=e;return"/api/collection/".concat(t,"/").concat(o,"?work_type=module").concat(i.length>0&&r.length>0&&n?"&variable_ids=".concat(i.join(","),"&values=").concat(r.join(",")):"")}},881756:function(e,t,o){"use strict";o.d(t,{X:function(){return i}});var n=o(687610);let i=()=>{var e;return null===(e=(0,n.e)())||void 0===e?void 0:e.style.setProperty("--sidebar-open","0")}},309234:function(e,t,o){"use strict";o.d(t,{w:function(){return i}});var n=o(687610);let i=()=>{var e;return null===(e=(0,n.e)())||void 0===e?void 0:e.style.setProperty("--sidebar-open","1")}},510334:function(e,t,o){"use strict";o.d(t,{T:function(){return i}});var n=o(332936);let i=()=>{let e=(0,n.usePathname)();return!!(null==e?void 0:e.includes("/ar/courses/"))}},350434:function(e,t,o){"use strict";var n=o(931549),i=o(4313);o(44194);var r=o(937374),a=o(311680),l=o(389919);t.Z=e=>{let{steps:t,showPrevNextButtons:o=!1,showCloseButton:s=!1,showBadge:d=!1,showNavigation:c=!1,disableDotsNavigation:u=!0,afterOpen:p=()=>document.documentElement.style.overflow="hidden",beforeClose:h=()=>document.documentElement.style.overflow="auto",className:v="b-sm w-48 rounded !bg-indigo-500 text-base !text-white",disabledActions:g=!1,disableInteraction:m=!1,disableFocusLock:_=!1,disableKeyboardNavigation:f=!1,maskClassName:y="",params:C={}}=e,{isTourOpen:S,currentStep:E,setCurrentStep:T,endTour:x,nextStep:L}=(0,l.r)();return(0,n.jsx)(i.Oj,{steps:t(x,{currentStep:E,onNextClick:L,...C}),isOpen:S,currentStep:E,showPrevNextButtons:o,showCloseButton:s,showBadge:d,showNavigation:c,disableDotsNavigation:u,disableInteraction:m,afterOpen:p,beforeClose:h,className:"reactour__popover ".concat(v),styles:{...(0,a.W)(r.colors.indigo[500]),maskWrapper:e=>({opacity:0})},setIsOpen:()=>{},setCurrentStep:T,setSteps:()=>{},disabledActions:g,setDisabledActions:()=>{},disableFocusLock:_,highlightedMaskClassName:"!opacity-0 pointer-events-none",disableKeyboardNavigation:f,maskClassName:"pointer-events-none ".concat(y),onClickMask:e=>{let{setCurrentStep:t,currentStep:o,steps:n}=e;3===o&&t(e=>e===n.length-1?0:e+1)}})}},389919:function(e,t,o){"use strict";o.d(t,{r:function(){return n}});let n=(0,o(466483).Ue)(e=>({isTourOpen:!1,currentStep:0,setIsTourOpen:t=>e({isTourOpen:t}),startTour:()=>e({isTourOpen:!0,currentStep:0}),openTour:()=>e({isTourOpen:!0}),nextStep:()=>e(e=>({currentStep:e.currentStep+1})),hideTour:()=>e({isTourOpen:!1}),endTour:()=>e({isTourOpen:!1,currentStep:6}),setCurrentStep:t=>e({currentStep:t})}))},912355:function(e,t,o){"use strict";var n,i;o.d(t,{k:function(){return n}}),(i=n||(n={}))[i.NONE=9009]="NONE",i[i.SEVEN_DAY_MILESTONE=9010]="SEVEN_DAY_MILESTONE",i[i.ASSESSMENT_OR_FIRST_INCREMENT_TOUR=9011]="ASSESSMENT_OR_FIRST_INCREMENT_TOUR",i[i.FIRST_STREAK_INCREMENT_TOUR=9012]="FIRST_STREAK_INCREMENT_TOUR",i[i.FIRST_BREAK_INTACT=9013]="FIRST_BREAK_INTACT"},975371:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return em},getWorkToTotalLessonsMapping:function(){return ep},sanitizePathCompletionMaps:function(){return ev}});var n=o(931549),i=o(746931),r=o.n(i),a=o(503346),l=o(44194),s=o(336449),d=o(520649),c=o(221726),u=o(677658),p=o(959893),h=o(791127),v=o(629099),g=o(602108),m=o(244710),_=o(851222),f=o(970179),y=o(378958),C=o(704373),S=o(963716),E=o(10020),T=o(436139),x=o(641789),L=o(290016),N=o(837948),b=o(473511),w=o(681860),O=o(575536),I=o(387619),P=o(962276),A=o(559915),j=o(823481),k=o(865546),D=o(603173),R=o(97713),U=o(389392),M=o(262603),F=o(184492),Z=o(264937),q=o(723804),W=o(358957),G=o(77753);let H=e=>{let{index:t}=e;return(0,n.jsx)("div",{className:"flex flex-shrink-0 items-center justify-center rounded-full border border-solid border-gray-L400 bg-gray-L50 dark:bg-gray-D1000",style:{letterSpacing:"0.25px",width:"30px"},children:t+1})},J=e=>{let{completionTime:t=null}=e;if(!t)return(0,n.jsx)(n.Fragment,{});let o=t.split(" "),i=parseInt(null==o?void 0:o[0]),r=parseInt(null==o?void 0:o[2]);return(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(P.Z,{className:"mr-2 flex-shrink-0 fill-indigo-500 dark:fill-indigo-200"}),(0,n.jsxs)("span",{className:"text-sm font-normal",children:["Est. Completion Time: ",!isNaN(i)&&i>0&&"".concat(i," hours")," ",!isNaN(r)&&r>0&&"".concat(r," minutes")]})]})},B=e=>{let{index:t,parentWorkType:o,title:i}=e;return o===d.dL.PLAN?(0,n.jsxs)("div",{className:"flex items-start space-x-2 text-xl font-semibold",children:[(0,n.jsx)(H,{index:t}),(0,n.jsx)("p",{className:"m-0",children:i})]}):(0,n.jsx)("p",{className:"m-0 bg-gray-L50 text-base font-bold dark:bg-gray-D1400",style:{letterSpacing:"0.5px"},children:"".concat(t+1,". ").concat(i)})},V=e=>{let{dataTestid:t,invertVisibleStatus:o,visible:i,visibleMapKey:r}=e,a=i?N.Z:L.Z;return(0,n.jsx)(a,{className:"cursor-pointer dark:text-gray-D200 flex-shrink-0 hover:bg-gray-L50 dark:hover:text-indigo-400 dark:hover:bg-gray-D1000 h-6 rounded-full select-none text-black w-6","data-testid":t,onClick:e=>{e.preventDefault(),e.stopPropagation(),o(r)}})},z=(e,t,o,n)=>{var i,r;return e&&(!!(null===(i=e["".concat(t,"_").concat(o)])||void 0===i?void 0:i[n])||!!(null===(r=e["".concat(t,"_").concat(o)])||void 0===r?void 0:r.ALL_DONE))},K=(e,t,o,n)=>e&&e["".concat(t,"_").concat(o,"_").concat(n)]===_.Q.COMPLETED,Y=e=>{var t;let{currentUrl:o,markAsCompleted:i,level:a,redirectUrl:l,title:s,isOptional:d,isStandaloneAssessment:c,isStandAloneProject:u,checklistLength:p}=e,m=u||c,_=(null===(t=o.split("#"))||void 0===t?void 0:t[0])===l;return(0,n.jsx)(r(),{prefetch:!1,href:l,passHref:!0,className:"".concat(_?"bg-gray-L200 dark:bg-gray-D1000 ":"".concat(m?"bg-gray-L50 dark:bg-gray-D1300 ":""),"dark:visited:text-gray-D200 flex select-none items-center space-x-2 p-2 leading-6 visited:text-black ").concat(m?"my-1 py-4":""),style:{letterSpacing:"0.15px",paddingLeft:"".concat(32+24*a,"px")},children:(0,n.jsxs)("div",{className:"flex w-full",children:[(0,n.jsx)("div",{className:"".concat(m?"mt-px":"mt-1"),children:(0,n.jsx)(x.Z,{...i?{background:"bg-green-500",border:"border-gray-L400 border-solid border",size:"14px"}:{border:"border-gray-L400 dark:border-gray-D700 border",background:"border border-solid bg-white ".concat(_?"dark:bg-gray-D700":"dark:bg-gray-D1400"),size:"14px"}})}),(0,n.jsxs)("div",{className:"ml-2 flex h-full w-full items-center justify-between",children:[m?(0,n.jsxs)("div",{className:"-mt-px flex flex-col",children:[(0,n.jsxs)("span",{className:"flex",children:[c?(0,n.jsx)(O.Z,{className:"h-4 w-4 fill-current text-black dark:text-gray-D200"}):(0,n.jsx)(D.Z,{className:"h-4 w-4 fill-current text-black dark:text-gray-D200"}),(0,n.jsx)("p",{className:"m-0 ml-2 font-sans text-xs font-bold uppercase leading-5 text-gray-L700 dark:text-gray-D200",style:{letterSpacing:"2.5px"},children:c?"Assessment":"Project"})]}),(0,n.jsx)("p",{className:"m-0 mt-2 break-words text-base font-bold leading-6",style:{letterSpacing:"0.5px"},children:s})]}):(0,n.jsx)("p",{className:"m-0 break-words text-sm leading-6",style:{letterSpacing:"0.15px"},children:s||g.V}),(0,n.jsxs)("div",{className:"flex gap-x-1",children:[!m&&d&&(0,n.jsx)("div",{className:"flex h-6 w-16 items-center justify-center rounded-sm border border-solid bg-gray-L50 p-1 text-xs font-semibold tracking-wide text-gray-L600 dark:border-gray-D900 dark:bg-gray-D1400 dark:text-gray-D500 ".concat(_?"border-gray-D200 bg-gray-L200 dark:bg-gray-D1200":"border-gray-L200 bg-gray-L50 dark:bg-gray-D1400"),children:"Optional"}),!!p&&(0,n.jsx)(v.default,{overlay:"This task has ".concat(p," subtask").concat(p>1?"s":""),position:h.ZJ,overlayParentClasses:"ml-2",parentClasses:"h-6",trigger:"hover",children:(0,n.jsxs)("div",{className:"caption-text flex items-center justify-center text-gray-L500",children:[(0,n.jsx)(I.Z,{className:"ml-2 mr-1 fill-current"}),p]})})]})]})]})})},Q=e=>{let{completionMaps:t,assessmentProjectMaps:o,currentUrl:i,invertVisibleStatus:r,level:a,moduleAuthorId:l,moduleId:c,planAuthorId:u,planId:p,redirectUrl:h,visibleMap:v,title:g,workToTotalLessonsMap:m,isOptional:_,isParentOptional:y,type:C,isPath:S,estimatedTime:E,urlSlug:T}=e,{planTitle:x,optionalItems:L,widgetStats:N,...b}=(0,M.ix)(e=>e.paths.moduleCategories.data||{}),w="".concat(l,"_").concat(c),O=b[w]||[],I=O.filter(e=>e.id!==j.s),P=v[w],{optionalLessons:A,mandatoryLessons:k}=(0,q.QO)(O,!0),D=[...A,...k],R=_||!k.length?(0,G.hv)(D,t[w]):(0,Z.ZP)(k,t[w]).percentCompleted;return(0,n.jsxs)("div",{className:"my-1 flex flex-col",children:[(0,n.jsx)(X,{completionPercentage:R,currentUrl:i,hasContent:O.some(e=>!!e.pages.length),invertVisibleStatus:r,level:a,moduleMapKey:w,moduleVisible:P,redirectUrl:h,title:g,isOptional:_||y,estimatedTime:E}),(0,n.jsx)("div",{className:"flex flex-col",children:!!P&&I.map((e,h)=>(0,q.gA)(e.type)&&e.type!==s.j.COLLECTION_CATEGORY?(0,n.jsx)($,{authorId:l,collectionId:c,completionMaps:t,assessmentProjectMaps:o,currentUrl:i,invertVisibleStatus:r,level:a,planAuthorId:u,planId:p,taskContent:{authorId:String(e.author_id),collectionId:String(e.collection_id),id:String(e.id),pageId:String(e.page_id),title:e.title,type:e.type,isParentOptional:_||y},visibleMap:v,workToTotalLessonsMap:m,workType:d.dL.MODULE,isPath:S,urlSlug:T}):(0,n.jsx)(et,{authorId:l,categoryContent:{authorId:null,collectionId:null,id:null,pageId:null,pages:e.pages.map(e=>{var t;return{authorId:e.author_id?String(e.author_id):null,collectionId:e.collection_id?String(e.collection_id):null,id:String(e.id),pageId:e.page_id?String(e.page_id):null,title:null!==(t=(0,F.hL)(O,e))&&void 0!==t?t:e.title,type:(0,q.gA)(e.type)?e.type:f.q.COLLECTION_LESSON,isOptional:e.is_optional,isParentOptional:_||y,checklist_length:e.checklist_length}}),title:e.title,type:(0,q.gA)(e.type)?e.type:s.j.COLLECTION_CATEGORY},collectionId:c,completionMaps:t,currentUrl:i,index:h,invertVisibleStatus:r,level:a,parentWorkType:d.dL.MODULE,planAuthorId:u,planId:p,visibleMap:v,workToTotalLessonsMap:m,isPath:S,urlSlug:T},e.id))})]})},X=e=>{let{completionPercentage:t,currentUrl:o,hasContent:i,invertVisibleStatus:l,level:s,moduleMapKey:d,moduleVisible:c,redirectUrl:u,title:p,isOptional:h,estimatedTime:v}=e,g=(0,a.useRouter)(),m=(0,R.$)(g,!0),_=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(b.Z,{height:"14px",width:"14px"}),(0,n.jsx)("p",{className:"m-0 ml-2 text-xs font-bold leading-5",style:{letterSpacing:"2.5px"},children:"MODULE"})]}),(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsx)("p",{className:"m-0 mr-4 text-base font-bold",style:{letterSpacing:"0.5px"},children:p}),i&&(0,n.jsx)(V,{dataTestid:d,invertVisibleStatus:l,visible:c,visibleMapKey:d})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("div",{className:"flex items-center",children:t>0||0===t&&!v?(0,n.jsxs)(n.Fragment,{children:[t<100?(0,n.jsx)(S.Z,{counterClockwise:!0,progress:t,radius:10,strokeWidth:4}):(0,n.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-green-700",children:(0,n.jsx)(A.Z,{width:"16px",height:"16px",fill:"white"})}),(0,n.jsx)("p",{className:"m-0 ml-2 text-sm leading-6 text-black dark:text-gray-D200",style:{letterSpacing:"0.15px"},children:"".concat(t<100?t+"% completed":"Completed")})]}):(0,n.jsx)(J,{completionTime:v})}),h&&(0,n.jsx)("div",{className:"flex h-6 w-16 items-center justify-center rounded-sm border border-solid bg-gray-L50 p-1 text-xs font-semibold tracking-wide text-gray-L600 dark:border-gray-D900 dark:bg-gray-D1400 dark:text-gray-D500 ".concat(o===u?"border-gray-D200 bg-gray-L200 dark:bg-gray-D1200":"border-gray-L200 bg-gray-L50 dark:bg-gray-D1400"),children:"Optional"})]})]}),f={prefetch:!1,href:u,passHref:!0,className:"".concat(o===u?"bg-gray-L200 dark:bg-gray-D1200 ":"bg-gray-L50 dark:bg-gray-D1300 ","dar
1k:visited:text-gray-D200 flex flex-col justify-start space-y-2 p-4 visited:text-black dark:active:text-gray-D200 ").concat(c&&"mb-2"),style:{paddingLeft:"".concat(32+24*s,"px")}};return m?(0,n.jsx)("div",{onClick:()=>l(d),className:f.className,style:f.style,children:_}):(0,n.jsx)(r(),{...f,children:_})},$=e=>{let{authorId:t,collectionId:o,completionMaps:i,assessmentProjectMaps:r,currentUrl:l,invertVisibleStatus:c,level:u,planAuthorId:p,planId:h,taskContent:v,visibleMap:g,workToTotalLessonsMap:m,workType:_,isPath:f,urlSlug:S}=e,E=(0,a.useRouter)(),T=(0,q.FW)(v.type),x=(0,q.g6)(v.type),L=(0,q.Tf)(v.type),N=v.type===y.R.PATH_EXTERNAL_ASSESSMENT,b=(0,q.qq)(v.type),w=v.type===y.R.PATH_EXTERNAL_PROJECT,O=v.type===s.j.PROJECT,I=v.type===s.j.ASSESSMENT,P=b||x||L,A=w||N||O||I,j=(0,R.$)(E,!0),k=T?(0,W.Z)({authorId:v.authorId,collectionId:v.collectionId,courseUrlSlug:v.url_slug,workType:d.dL.MODULE,pathAuthorId:p,pathId:h}):(0,C.Z)({authorId:t,collectionId:o,assessmentId:(0,q.nM)(v.type)?v.id:null,id:(0,q.mz)(v.type)?v.id:null,courseUrlSlug:S,customWorkType:j?"interview-prep":_,parentWorkAuthorId:_===d.dL.MODULE?p:null,parentWorkId:_===d.dL.MODULE?h:null}).viewUrl.href;return T?(0,n.jsx)(Q,{completionMaps:i,assessmentProjectMaps:r,currentUrl:l,invertVisibleStatus:c,level:u+1,moduleAuthorId:v.authorId,moduleId:v.collectionId,planAuthorId:p,planId:h,redirectUrl:k,visibleMap:g,title:v.title,workToTotalLessonsMap:m,isOptional:v.isOptional,isParentOptional:v.isParentOptional,type:v.type,isPath:f,estimatedTime:v.estimatedTime,urlSlug:v.url_slug}):(0,n.jsx)(Y,{currentUrl:l,markAsCompleted:P||A?K(r,v.authorId,v.collectionId,v.pageId.toString()):z(i,t,o,v.id),level:u,redirectUrl:P?(0,C.Z)({authorId:v.authorId,collectionId:v.collectionId,assessmentId:x||L?v.pageId:null,projectId:b?v.pageId:null,customWorkType:d.dL.MODULE,parentWorkAuthorId:t,parentWorkId:o}).viewUrl.href:A?(()=>{let e=_===d.dL.PATH;return(0,C.Z)({authorId:e?p:t,collectionId:e?h:o,assessmentId:N||I?v.id:null,projectId:w||O?v.id:null,customWorkType:e?d.dL.PATH:d.dL.MODULE,parentWorkAuthorId:e?null:p,parentWorkId:e?null:h}).viewUrl.href})():k,title:v.title,isOptional:!v.isParentOptional&&v.isOptional,isStandaloneAssessment:x||L||N||I,isStandAloneProject:b||w||O,checklistLength:v.checklist_length})},ee=e=>{let{connectData:t,is_plan_assigned:o,organizationId:i,planAuthorId:r,planId:a}=e,l=(0,M.TL)(),s=null==t?void 0:t.connect_info.filter(e=>e.status===m.B.PENDING),d=null==s?void 0:s.map(e=>({image:e.contact_image_url,name:e.full_name}));return t&&(0,n.jsxs)("div",{className:"my-1 flex cursor-pointer border-0 border-b border-t border-solid border-gray-L200 bg-gray-L50 py-4 pl-6 pr-4 dark:border-gray-D1200 dark:bg-gray-D1300",onClick:()=>{l(U.n.show(k.L0,{orgId:i,authorId:r,planId:a,data:t,disabled:!o},"w-full h-full sm:h-44 sm:-mt-52 sm:w-120"))},children:[(0,n.jsx)(T.Z,{className:"text-indigo-500 dark:text-indigo-200"}),(0,n.jsxs)("div",{className:"flex flex-grow flex-col pl-2",children:[(0,n.jsx)("h6",{className:"m-0 text-gray-L700 dark:text-gray-D200",children:"Connects This Week"}),(null==s?void 0:s.length)?(0,n.jsxs)("div",{className:"mt-3 flex flex-grow justify-between text-base",children:[(0,n.jsxs)("div",{children:[s.length," connects to go "]}),(0,n.jsx)(E.Z,{users:d})]}):(0,n.jsxs)("div",{className:"mt-3 flex justify-start text-green-500",children:[(0,n.jsx)(w.Z,{className:"fill-current"}),(0,n.jsx)("p",{className:"m-0 ml-2 text-base",children:"Completed"})]})]})]})},et=e=>{let{authorId:t,categoryContent:o,connectData:i,is_plan_assigned:r=!1,collectionId:l,completionMaps:c,assessmentProjectMaps:u,currentUrl:p,index:h,invertVisibleStatus:v,level:g,parentWorkType:m,organizationId:_,planAuthorId:f,planId:y,visibleMap:C,workToTotalLessonsMap:S,isPath:E,urlSlug:T}=e,x=(0,a.useRouter)(),L="".concat(t,"_").concat(l,"_").concat(h),N=C[L],b=!o.title||o.title===s.V,w=(0,R.$)(x,!0);return m!==d.dL.PATH?(0,n.jsxs)("div",{className:"flex flex-col",children:[!b&&(0,n.jsxs)("div",{className:"flex items-center justify-between p-4",style:{paddingLeft:"".concat(m===d.dL.PLAN?24+16*g:32+24*g,"px")},onClick:()=>w?v(L):null,children:[(0,n.jsx)(B,{index:h,parentWorkType:m,title:o.title}),(!!o.pages.length||i)&&(0,n.jsx)(V,{dataTestid:L,invertVisibleStatus:e=>v(e),visible:N,visibleMapKey:L})]}),(N||b)&&(0,n.jsxs)(n.Fragment,{children:[i&&(0,n.jsx)(ee,{connectData:i,is_plan_assigned:r,organizationId:_,planAuthorId:f,planId:y}),o.pages.map((e,o)=>(0,n.jsx)($,{authorId:t,collectionId:l,completionMaps:c,assessmentProjectMaps:u,currentUrl:p,invertVisibleStatus:e=>v(e),level:g,planAuthorId:f,planId:y,taskContent:e,visibleMap:C,workToTotalLessonsMap:S,workType:m,isPath:E,urlSlug:T},e.id))]})]}):(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsx)($,{authorId:t,collectionId:l,completionMaps:c,assessmentProjectMaps:u,currentUrl:p,invertVisibleStatus:e=>v(e),level:m===d.dL.PLAN?g+1:g,planAuthorId:f,planId:y,taskContent:o,visibleMap:C,workToTotalLessonsMap:S,workType:m,isPath:E,urlSlug:T},o.id)})};var eo=o(72281),en=o(257397),ei=o(301284),er=o(395124),ea=o(115172),el=o(225329),es=o(384913);let ed=e=>{let{planLink:t}=e;return(0,n.jsx)(r(),{prefetch:!1,href:t,passHref:!0,className:"m-0 flex w-full select-none flex-row items-center p-4 pl-6 font-bold hover:bg-gray-buttonHover dark:hover:bg-gray-D1000",style:{letterSpacing:"0.35px"},children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.Z,{className:"mr-4 fill-current text-gray-L400"}),(0,n.jsx)("span",{children:"Back to Path Home"})]})})},ec=e=>{let{completionPercentage:t=0}=e;return(0,n.jsxs)("div",{className:"!mb-4 mt-3.5 flex flex-col space-y-1 px-6",children:[(0,n.jsx)("p",{className:"m-0 text-xs font-semibold leading-5",style:{letterSpacing:"0.5px"},children:"".concat(Math.round(t),"% completed")}),(0,n.jsx)(es.Z,{percentCompleted:t})]})},eu=(e,t)=>
1!!(null==t?void 0:t.filter(e=>!(0,q.gA)(e.type)||e.type===s.j.COLLECTION_CATEGORY).find(t=>t.pages.find(t=>String(t.id)===String(e)))),ep=e=>{let{planTitle:t,connects:o,is_assigned:n,optionalItems:i,optionalItemsCount:r,widgetStats:a,...l}=e;return Object.entries(null!=l?l:{}).reduce((e,t)=>{var o,n;let[i,r]=t;return{...e,[i]:null!==(n=null==r?void 0:null===(o=r.filter(e=>(!(0,q.gA)(e.type)||e.type===s.j.COLLECTION_CATEGORY)&&e.id!==j.s))||void 0===o?void 0:o.reduce((e,t)=>{var o;return e+(null===(o=t.pages)||void 0===o?void 0:o.filter(e=>!(0,q.gA)(e.type)||(0,q.mz)(e.type)).length)},0))&&void 0!==n?n:0}},{})},eh=e=>{let{planLink:t,planTitle:o}=e;return(0,n.jsx)(r(),{prefetch:!1,href:t,passHref:!0,className:"m-0 block select-none px-6 text-xl font-semibold hover:text-indigo-500 dark:hover:text-indigo-400",style:{letterSpacing:"0.25px"},children:o})},ev=(e,t,o,n,i)=>{let r={},a=0,l=null!=i?i:0;e&&t&&(r=Object.entries(e).reduce((e,i)=>{let[r,s]=i,[,d,c]=r.split("_"),u="".concat(d,"_").concat(c),p=t[u],h=!s.ALL_DONE;return(null==n?void 0:n.includes(u))||0!==l||(a+=Number(!h)*o[u]),e[u]=Object.entries(s).reduce((e,t)=>{let[o,i]=t,r=Number(o),s=eu(r,p);return i&&s&&(0!==l||h&&0===l)&&!((null==n?void 0:n.includes(u))||(null==n?void 0:n.includes("".concat(u,"_").concat(o))))&&a++,(isNaN(r)||s)&&i&&(e[o]=i),e},{}),e},{}));let s=Object.values(o).reduce((e,t)=>e+t,0)-l;return{sanitizedMaps:r,completionPercentage:s?100*a/s:0}},eg=e=>{var t;return e&&1===e.length&&e[0].type===s.j.COLLECTION_CATEGORY&&"__default"===e[0].title?null===(t=e[0])||void 0===t?void 0:t.pages:e};var em=e=>{var t,o,i;let{isParentPlan:r,isPlan:p,planAuthorId:h,planId:v,pathSlug:g,moduleAuthorId:m,moduleCollectionId:_,pageId:f}=e,y=(0,M.TL)(),C=(0,a.useRouter)(),[S,E]=l.useState({showSidebarCaret:!1,stateUpdatedOnNavigation:!1}),{planTitle:T,connects:x,is_assigned:L,optionalItems:N,optionalItemsCount:b,widgetStats:w,...O}=(0,M.ix)(e=>e.paths.moduleCategories.data||{}),I=(0,M.ix)(e=>e.paths.moduleCategories.loaded),P=(0,M.ix)(e=>e.paths.moduleCategories.loading),A=(0,en.usePathCompletionState)(),k=A.data,D=A.loaded,U=A.loading,{userInfoState:F}=(0,er.su)(),Z=F.data,G=!!F.loaded||F.loggedOut,H=null===(o=(0,eo.q6)().instance)||void 0===o?void 0:null===(t=o.details)||void 0===t?void 0:t.organization_id,J=C.asPath.split("?")[0],B=I&&!P,V=D&&!U,z=(0,en.usePathCompletionActions)(),K=O||{},Y=p||r?K["".concat(h,"_").concat(v)]:eg(K["".concat(h,"_").concat(v)]),Q=(0,W.Z)({authorId:h,collectionId:v,workType:r?d.dL.PLAN:d.dL.PATH}),X=ep(K),$=ev(null==k?void 0:k.maps,K,X,N,b);l.useEffect(()=>{E(e=>({...e,showSidebarCaret:!0}))},[]),l.useEffect(()=>{B||y(ea.W.load(h,v,!1,!0))},[B]),l.useEffect(()=>{!V&&B&&G&&(null==Z?void 0:Z.user_id)&&Y&&z.load(h,v,JSON.stringify(Y),null,null)},[V,B,G]),l.useEffect(()=>{if(B){let e=document.querySelector('[href="'.concat(J,'"]'));if(e){let t=e.getBoundingClientRect();t.top+t.height>window.innerHeight&&e.scrollIntoView()}}},[B,S.stateUpdatedOnNavigation]);let ee=()=>C.query.courseUrlSlug?"".concat(m||h,"/").concat(_||v).concat(f?"/".concat(f):""):J;l.useEffect(()=>{B&&E(e=>({...e,...Object.entries(K).reduce((e,t)=>{let[o,n]=t;return{...e,...n.reduce((e,t,n)=>({...e,[o]:ee().includes(o.replace("_","/")),["".concat(o,"_").concat(n)]:t.pages.some(e=>ee().includes((0,q.FW)(e.type)||(0,q.g6)(e.type)||(0,q.Tf)(e.type)||(0,q.qq)(e.type)?"".concat(e.author_id,"/").concat(e.collection_id):"".concat(o.replace("_","/"),"/").concat(e.id)))}),{})}},{}),stateUpdatedOnNavigation:!e.stateUpdatedOnNavigation}))},[B,J]);let es=(0,R.$)(C,!0);return(0,n.jsx)(u.C,{sidebarClass:"ed-grid-sidebar2",className:"flex flex-col bg-gray-L50 dark:bg-gray-D1400 ".concat(es?"whitespace-normal text-left text-black dark:text-gray-D200":""),mainSidebar:!1,sidebarType:ei.mQ.PLAN,overlayType:u.Z.BLUR,addBorderWhenExpanded:!0,showCaret:!es,children:(0,n.jsxs)("div",{className:"no-scrollbar flex flex-col overflow-y-auto ".concat(es?"text-black dark:text-gray-D200":""),children:[!es&&(0,n.jsx)(ed,{planLink:Q}),(0,n.jsx)(el.Z,{className:"w-full"}),B?(0,n.jsxs)("div",{className:"no-scrollbar py-4",children:[(0,n.jsx)(eh,{planLink:es?"/interview-prep":Q,planTitle:es?"Your Personalized Roadmap":T}),(0,n.jsx)(ec,{completionPercentage:$.completionPercentage}),null==Y?void 0:null===(i=Y.filter(e=>e.id!==j.s))||void 0===i?void 0:i.map((e,t)=>{var o;return(0,n.jsx)(et,{authorId:h,categoryContent:{authorId:r?null:e.author_id,collectionId:r?null:e.collection_id,id:r?null:e.id,pageId:String(e.page_id),pages:r||e.type===s.j.COLLECTION_CATEGORY?e.pages.map(e=>{var t,o;return{authorId:String(e.author_id),collectionId:String(e.collection_id),id:String(e.id),pageId:e.page_id?String(e.page_id):null,title:null!==(t=e.instance_page_title)&&void 0!==t?t:e.title,type:e.type,isOptional:e.is_optional,checklist_length:null!==(o=null==e?void 0:e.checklist_length)&&void 0!==o?o:null,url_slug:e.course_url_slug,estimatedTime:e.estimatedTime}}):null,title:e.title,type:e.type,estimatedTime:null!==(o=e.estimatedTime)&&void 0!==o?o:null,url_slug:e.course_url_slug},connectData:null==x?void 0:x.find(t=>t.week_id===e.id),is_plan_assigned:L,organizationId:H,collectionId:v,completionMaps:$.sanitizedMaps,assessmentProjectMaps:null==k?void 0:k.assessment_project_maps,currentUrl:J,index:t,invertVisibleStatus:e=>E(t=>({...t,[e]:!t[e]})),level:0,parentWorkType:r||p?d.dL.PLAN:d.dL.PATH,planAuthorId:h,planId:v,visibleMap:S,workToTotalLessonsMap:X,isPath:!r,urlSlug:g},e.id)})]}):(0,n.jsx)(c.Z,{className:"mt-4"})]})})}},386684:function(e,t,o){"use strict";var n=o(931549);o(44194);var i=o(791127),r=o(629099),a=o(820915);t.Z=e=>{let{children:t,tooltipText:o,className:l=""}=e;return o?(0,n.jsx)(r.default,{element:"div",overlay:o,position:i.YS,trigger:a.dQ,overlayParentClasses:"z-30 text-xs py-1.5 px-4 font-normal ml-0.5 ".concat(l),showPointer:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})}},595385:function(e,t,o){"use strict";o.d(t,{E:function(){return v},t:function(){return d}});var n=o(861028),i=o(912355),r=o(250198),a=o(865546),l=o(389392),s=o(171483);let d=e=>{var t,o;return null===(o=e.value.data.userGamification)||void 0===o?void 0:null===(t=o.userStreak)||void 0===t?void 0:t.streakIncremented},c=(e,t)=>e===r.X9.FIRST_STREAK&&1===t,u=e=>7===e,p=function(e,t,o){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return o?u(t)?i.k.SEVEN_DAY_MILESTONE:n?i.k.ASSESSMENT_OR_FIRST_INCREMENT_TOUR:i.k.NONE:c(e,t)?i.k.FIRST_STREAK_INCREMENT_TOUR:i.k.ASSESSMENT_OR_FIRST_INCREMENT_TOUR},h=e=>{let{callBack:t,modalToShow:o,ctaText:n,closeable:i,showFrontEnd:r,dispatch:s,workType:d,streakCount:c}=e;r&&s(l.n.show(a.Oy,{onConfirm:()=>{t(!0)},streakCount:c,statusType:o,ctaText:n,closeable:i,workType:d}
1))},v=e=>{var t,o,a,l;let{userGamificationContext:d,userGamificationFeatureFlag:c,callBack:u,userInfo:v,isAssessment:g=!1,isWorkCompleted:m=!1,isCourse:_=!1,isLastTask:f=!1,workType:y,dispatch:C}=e,S=(0,n.n)(c,null==v?void 0:null===(t=v.email)||void 0===t?void 0:t.endsWith("educative.io"),(0,s.s)(v),!0),E=d.value.data.userGamification,T=S?p(E.streakRevision,null==E?void 0:null===(o=E.userStreak)||void 0===o?void 0:o.count,E.viewedIncrementTour,g):i.k.NONE;if((null==E?void 0:null===(a=E.userStreak)||void 0===a?void 0:a.streakIncremented)&&T!==i.k.NONE&&!m)h({callBack:u,modalToShow:T,ctaText:_?"Continue to Next Lesson":g?"View Results":"Continue to Next Task",closeable:f,showFrontEnd:S,dispatch:C,workType:y,streakCount:null==E?void 0:null===(l=E.userStreak)||void 0===l?void 0:l.count}),d.updateStreakIncrementedFlag(!1),d.setStreakTour(r.kZ.INCREMENT);else if(u&&u(!1),T===i.k.NONE&&S&&!m)return d.updateStreakIncrementedFlag(!1),d.setStreakTour(r.kZ.INCREMENT),!0;return!1}},148910:function(e,t,o){"use strict";o.d(t,{$:function(){return n},E:function(){return i}});let n="-1",i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(t?Object.keys(null!=e?e:{}).length>0:null==e?void 0:e.key)&&e.key!==n}},10020:function(e,t,o){"use strict";o.d(t,{Z:function(){return h}});var n,i,r=o(931549),a=o(44194),l=o(791127),s=o(629099),d=o(443118);function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}var u=function(e){return a.createElement("svg",c({width:14,height:14,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a.createElement("mask",{id:"mask0_1511_48799",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:15,height:14},n||(n=a.createElement("path",{fill:"currentColor",d:"M.5 0h14v14H.5z"}))),i||(i=a.createElement("g",{mask:"url(#mask0_1511_48799)"},a.createElement("path",{d:"M11.073 8.02V6.27h-1.75v-.874h1.75v-1.75h.875v1.75h1.75v.875h-1.75v1.75h-.875ZM5.75 6.826a1.955 1.955 0 0 1-1.444-.605 1.974 1.974 0 0 1-.598-1.437c0-.564.2-1.045.598-1.443.399-.399.88-.598 1.444-.598s1.045.199 1.444.598c.398.398.598.88.598 1.443 0 .555-.2 1.033-.598 1.437-.399.403-.88.605-1.444.605Zm-4.375 4.433V9.96c0-.282.078-.544.233-.787a1.61 1.61 0 0 1 .627-.569 8.375 8.375 0 0 1 1.743-.634 7.584 7.584 0 0 1 3.544 0 8.379 8.379 0 0 1 1.743.634c.262.136.471.326.627.569.155.243.233.505.233.787v1.298h-8.75Zm.875-.875h7V9.96a.547.547 0 0 0-.102-.32.86.86 0 0 0-.277-.248 8.162 8.162 0 0 0-1.538-.562 6.455 6.455 0 0 0-3.166 0 8.162 8.162 0 0 0-1.538.562.86.86 0 0 0-.277.248.547.547 0 0 0-.102.32v.423Zm3.5-4.433c.32 0 .596-.114.824-.343.229-.228.343-.503.343-.824 0-.32-.114-.595-.343-.824a1.125 1.125 0 0 0-.824-.342c-.32 0-.595.114-.824.342a1.124 1.124 0 0 0-.343.824c0 .321.115.596.343.824.229.229.503.343.824.343Z",fill:"currentColor"}))))};let p=e=>e.map(e=>e.name).join(", ");var h=e=>{let{users:t,enableTeamMemberProfileLink:o=!1,maxThreshold:n=3,picSize:i=32,borderColor:a="border-indigo-200 hover:border-none",ThresholdStyling:c={backgroundColor:"bg-indigo-500",fontColor:"text-white",fontSize:12},onPlusIconClick:h=()=>null,addPerson:v=!1,hideTitle:g=!1,isInNavbar:m=!1}=e,_=t.length>n?t.slice(0,n):t,f=t.slice(n),y="-".concat(.625/32*i,"rem"),C=(0,r.jsx)("div",{className:"flex",style:{zIndex:_.length,marginLeft:_.length?y:0},children:(0,r.jsx)("div",{className:"flex flex-shrink-0 ".concat(m?"":"cursor-pointer"," items-center justify-center rounded-full ").concat(c.backgroundColor," border-2 border-solid dark:bg-gray-D1100 ").concat(a," dark:border-gray-D500"),style:{width:i,height:i},children:(0,r.jsx)("p",{className:"m-0".concat(v?" flex items-center justify-center":""," capitalize ").concat(c.fontColor," dark:text-gray-D200 ").concat(m?"cursor-default":""),style:{fontSize:c.fontSize,lineHeight:"32px"},onClick:()=>h(),children:v?(0,r.jsx)(u,{className:"h-[0.875] w-[0.875]"}):"+".concat(f.length)})})});return t?(0,r.jsxs)("div",{className:"flex",children:[_.map((e,t)=>{var n,a;return(0,r.jsx)("div",{className:"flex",style:{marginLeft:t?y:0},children:(0,r.jsx)(d.Z,{size:i,image:e.image,name:e.name,id:null===(n=e.id)||void 0===n?void 0:n.toString(),className:"border-2 border-solid border-white dark:border-gray-D1500".concat(m?" !bg-white dark:!bg-gray-D1500":""),styles:m?{borderColor:e.color}:{},isLetterAvatar:null==e.letterAvatar||e.letterAvatar,enableTeamMemberProfileLink:o,hideTitle:g,isInNavbar:m})},null!==(a=e.id)&&void 0!==a?a:t)}),(t.length>n||v)&&(m?(0,r.jsx)(s.default,{overlay:p(f),position:l.xR,showPointer:!1,overlayParentClasses:"max-w-[250px]",element:"div",children:C}):C)]}):null}},677658:function(e,t,o){"use strict";o.d(t,{Z:function(){return _},C:function(){return S}});var n=o(931549),i=o(503346),r=o(44194),a=o(764412),l=o(791127),s=o(629099),d=o(384465),c=o(301284);let u=e=>{switch(e){case c.mQ.LEGACY:return 12;case c.mQ.ENTERPRISE:return 44;case c.mQ.LESSON:case c.mQ.PROJECT:return 32;case c.mQ.PLAN:case c.mQ.CLOUDLAB:case c.mQ.ASSESSMENT_EDITOR:return 40;case c.mQ.WORKFLOWS:return -20;default:return 12}};var p=e=>{let{mainSidebar:t,sidebarType:o,sidebarWidth:i,caretClasses:a="",isB2BNavigation:p=!1,hideCaretOnCollapse:h,transitionDuration:v="200ms"}=e,[g,m]=r.useState(!1),_=()=>m(!0),f=()=>m(!1),y="".concat(parseFloat(i)-1).concat(i.replace(/[0-9.]/g,"")),{toggleSidebar:C,sidebarCollapsed:S}=(0,c.pY)(),E=!S;return(r.useEffect(()=>{let e=document.getElementById("sidebar-caret-collapse-".concat(t?"main":"2"));if(null===e)return;let o=e.nextElementSibling;return o.addEventListener("mouseover",_),o.addEventListener("mouseleave",f),()=>{o.removeEventListener("mouseover",_),o.removeEventListener("mouseleave",f)}},[t]),h&&S)?null:(0,n.jsx)(s.default,{overlay:(0,n.jsx)("span",{className:"text-xs leading-5",children:"".concat(E?"Collapse":"Expand"," Sidebar")}),overlayParentClasses:E?"ml-2":"ml-6",position:l.ZJ,padding:"px-4 py-1.5",parentClasses:"".concat(a,"  \n      fixed cursor-pointer bg-gray-L50 items-center rounded-full dark:bg-gray-D1400 border border-solid border-gray-L200 dark:border-gray-D1000 h-7 stroke-current\n        ").concat(E?" justify-center w-7":"overflow-hidden transform hover:scale-x-110 justify-end \n            ".concat(o===c.mQ.ENTERPRISE?"-ml-2.5 w-7":"-ml-4 w-11 hover:w-14"),"\n        ").concat(g||!E?"":p?"sm:opacity-0":"lg:opacity-0 opacity-100"),id:"sidebar-caret-collapse-".concat(t?"main":"2"),onClick:C,onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),overlayParentStyles:{borderWidth:"0.5px"},"aria-label":"toggle sidebar",style:{left:"0",transform:"translateX(calc(".concat(y," * var(--sidebar)))"),transition:"width ".concat(v," ease-in-out, transform ").concat(v," ease-in-out"),top:"calc(var(--header-height) + var(--site-wide-banner-height) + ".concat(u(o),"px)"),zIndex:12},role:"navigation",delayShow:500,showPointer:!1,overlayParentTextColorClasses:"dark:text-gray-D1300 text-white",backgroundColor:"bg-gray-L1000 border-gray-L1000 dark:bg-gray-D50 dark:border-gray-D50",children:(0,n.jsx)(d.Z,{className:"h-4 w-4 transform transition duration-500 ".concat(p?"":"text-gray-L500 dark:text-gray-D100"," ").concat(E?"rotate-0":"mr-1 rotate-180")}
1)})},h=o(468518),v=o(989648),g=o(395124),m=o(171483);let _={NONE:"none",BLUR:"backdrop-blur-sm",DARK:"bg-alphas-black5"},f={"ed-grid-sidebar":"6rem","ed-grid-sidebar2":"20rem","ed-grid-sidebar4":"22.88rem","ed-grid-interview-prep-minimap":"22.88rem"},y={"ed-grid-sidebar":"0rem","ed-grid-sidebar2":"0rem","ed-grid-sidebar4":"0rem","ed-grid-interview-prep-minimap":"0rem"},C=(e,t)=>({transition:"transform ".concat(e," ease-in-out"),left:"-".concat(t),maxWidth:t,width:t,transform:"translateX(calc(".concat(t," * var(--sidebar)))")});var S=e=>{let{mainSidebar:t,sidebarClass:o,sidebarType:l,className:s,backdropClasses:d="",visibilityClasses:u="tailwind-hidden sm:flex",children:S,transitionDuration:E="200ms",showCaret:T=!0,sidebarMinWidth:x=y[o],sidebarMaxWidth:L=f[o],overlayType:N=_.NONE,hideCaretOnCollapse:b=!1,isResizing:w=!1,addBorderWhenOverlay:O=!1,addBorderWhenExpanded:I=!1,collapseOnFocus:P=!1,rightSidebarBorder:A="lg:border-r-0",alwaysOverlay:j=!1}=e,k=(0,c.pY)(),D=(0,i.useRouter)(),R=k.sidebarCollapsed,U=k.sidebarType,{userInfoState:M}=(0,g.su)(),F=(0,m.s)(M.data),Z=k.toggleSidebar,q=r.useRef(null),W=()=>{var e,t;return!(null===(t=window)||void 0===t?void 0:null===(e=t.matchMedia)||void 0===e?void 0:e.call(t,"(min-width: ".concat(c.sl[l].TOGGLE_BREAKPOINT,")")).matches)},G=()=>!!(j||W())||l===U&&R,H=!(0,a.a)("lg"),J=(0,a.a)("sm"),B=[c.mQ.LESSON,c.mQ.LEGACY,c.mQ.PLAN,c.mQ.ADAPTIVE].includes(U);r.useEffect(()=>{l&&k.setSidebarState({sidebarType:l,sidebarCollapsed:G()})},[l]),r.useEffect(()=>{if(!J)return;let e=e=>{!q.current||q.current.contains(e.target)||k.sidebarCollapsed||k.setSidebarCollapsed(!0)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[J,k,q,Z]);let V=(0,v.Z)(),z=(0,h.i)(V||D.asPath,!0,!0);return(0,n.jsxs)(n.Fragment,{children:[!R&&N!==_.NONE&&(0,n.jsx)("div",{className:"".concat(j||W()?d||"fixed z-10 h-screen w-screen":"h-0 w-0"," ").concat(N),onClick:()=>P&&Z()}),T&&!w&&(0,n.jsx)(p,{mainSidebar:t,sidebarType:l,caretClasses:u,sidebarWidth:L,isB2BNavigation:F,hideCaretOnCollapse:b,transitionDuration:E}),(0,n.jsx)("nav",{className:"no-scrollbar overflow-x-hidden overscroll-y-contain ".concat(o," ").concat(s," ").concat(z?"max-w-auto w-auto":""," ").concat((N!==_.NONE||I)&&!R&&(O||I)?"border-0 border-r border-solid border-gray-L200 dark:border-gray-D1200 ".concat(I?"":A):""),style:{...w?{transitionDuration:"0s"}:{},...B&&!H?C(E,L):z?{}:{transition:"max-width ".concat(E,", width ").concat(E," ease-in-out"),maxWidth:"calc(".concat(L," * var(--sidebar))"),width:"calc(".concat(L," * var(--sidebar))")}},ref:q,children:(0,n.jsx)("div",{className:"flex h-full w-full flex-col ".concat(z?"w-full text-black":""),style:{width:"".concat(0!==parseInt(x)||z?"inherit":L)},children:S})})]})}},645759:function(e,t,o){"use strict";var n=o(425750),i=o(483264),r=o(553314),a=o(766898);let l={version:o(592459).w,caption:"",language:"c++",title:"",theme:"default",additionalContent:[],selectedIndex:0,runnable:!1,judge:!1,staticEntryFileName:!0,judgeContent:null,judgeHints:null,allowDownload:!1,treatOutputAsHTML:!1,enableHiddenCode:!1,enableStdin:!1,evaluateWithoutExecution:!1,showSolution:!1,widgetTitle:r.titles["c++"],timeLimit:i.M,stdoutLimit:n.Q,hiddenCodeContent:{prependCode:"\n\n",appendCode:"\n\n",codeSelection:"prependCode"},dockerJob:{},selectedApiKeys:{},selectedEnvVars:{},specialInput:a.Zs,solutionContent:"\n\n\n",judgeContentPrepend:"\n\n\n",evaluateLanguage:"c++",isCodeDrawing:!1,content:'#include <iostream>\nusing namespace std;\n\nint main() {\n  // your code goes here\n  cout << "Hello World";\n  return 0;\n}'};t.Z=l},781894:function(e,t){"use strict";t.Z={version:"12",filename:"",active:"html",jotted:{pane:"result",height:null,heightCodepanel:null,showBlank:!1,hints:null,hideResult:!1,hideHtml:!1,hideCss:!1,hideJs:!1,hideNav:!1,showBabelTransformPane:!1,codePlaygroundTemplate:"jottedTabs",showLineNumbers:!0,autoRun:!0,runOnLoad:!1,theme:"default",exercise:!1,showSolution:!1,disableScss:!0,caption:"",toggleState:{result:!0,html:!0,css:!0,js:!0},readOnlyState:{html:!1,css:!1,js:!1},solutionPanels:{js:"",html:"",css:""},panelsHighlightedLines:{js:"",html:"",css:"",hiddenjs:""},plugins:[{name:"codemirror",options:{lineNumbers:!0}}],files:[{type:"html",content:'<html>\r\n <head>\r\n </head>\r\n <body>\r\n   <div id="content"/>\r\n </body>\r\n</html>'},{type:"js",content:'document.addEventListener("DOMContentLoaded", function () {\r\n  pTag = document.querySelector("div");\r\n  newVal = document.createElement("p");\r\n  newVal.innerHTML = \'Hello, Hello\';\r\n  pTag.appendChild(newVal);\r\n});\r\n\r\n// Async Tests Example\r\n/*\r\nwindow.onModulesLoaded = new Promise( function( resolve, reject ) {\r\n  setTimeout(function() {\r\n    pTag = document.querySelector("div");\r\n    pTag.innerHTML = \'\';\r\n    newVal = document.createElement("p");\r\n    newVal.innerHTML = \'Hello World\';\r\n    pTag.appendChild(newVal);\r\n    resolve();\r\n  }, 100)\r\n});\r\n*/'},{type:"hiddenjs",content:"\n\n"},{type:"exercise",content:'var TestResult = function() {\r\n  this.succeeded = false;\r\n  this.reason = "";\r\n  this.input = "";\r\n  this.expected_output = "";\r\n  this.actual_output = "";\r\n};\r\n\r\nvar executeTests = function(\r\n  userJsCode,\r\n  userCssCode,\r\n  userHtmlCode,\r\n  userHtmlPage\r\n) {\r\n  var results = [];\r\n\r\n  const jsdom = require("jsdom");\r\n  const { JSDOM } = jsdom;\r\n  const dom2 = new JSDOM(userHtmlPage, { runScripts: "dangerously" });\r\n\r\n  const pTag = dom2.window.document.querySelector("p");\r\n\r\n  const result = new TestResult();\r\n  result.expected_output = "Hello World";\r\n  result.input = "Html page";\r\n\r\n  if (!pTag) {\r\n    result.actual_output = "null";\r\n    result.succeeded = false;\r\n    result.reason = "No p tag found";\r\n  } else {\r\n    const pTagText = pTag ? pTag.textContent : "";\r\n    result.actual_output = pTagText;\r\n    if (pTagText.trim() != "Hello World") {\r\n      result.reason = "
1Expected output (Hello World in a p tag) did not match";\r\n      result.succeeded = false;\r\n    } else {\r\n      result.succeeded = true;\r\n      result.reason = "Found p tag with Hello World";\r\n    }\r\n  }\r\n\r\n  results.push(result);\r\n\r\n  return results;\r\n};\r\n\r\n// Async Tests Example\r\n/*\r\nvar executeTestsAsync = function(\r\n  userJsCode,\r\n  userCssCode,\r\n  userHtmlCode,\r\n  userHtmlPage\r\n) {\r\n  var results = [];\r\n  return new Promise(resolve => {\r\n\r\n    const jsdom = require("jsdom");\r\n    const { JSDOM } = jsdom;\r\n    const dom2 = new JSDOM(userHtmlPage, { runScripts: "dangerously" });\r\n\r\n    if (!dom2.window.onModulesLoaded) {\r\n      console.log("window.onModulesLoaded not found!");\r\n    	resolve(results);\r\n    }\r\n    dom2.window.onModulesLoaded.then(()=>{\r\n      const pTag = dom2.window.document.querySelector("p");\r\n\r\n      const result = new TestResult();\r\n      result.expected_output = "Hello World";\r\n      result.input = "Html page";\r\n\r\n      if (!pTag) {\r\n        result.actual_output = "null";\r\n        result.succeeded = false;\r\n        result.reason = "No p tag found";\r\n      } else {\r\n        const pTagText = pTag ? pTag.textContent : "";\r\n        result.actual_output = pTagText;\r\n        if (pTagText.trim() != "Hello World") {\r\n          result.reason = "Expected output (Hello World in a p tag) did not match";\r\n          result.succeeded = false;\r\n        } else {\r\n          result.succeeded = true;\r\n          result.reason = "Found p tag with Hello World";\r\n        }\r\n      }\r\n\r\n      results.push(result);\r\n      resolve(results);\r\n    });\r\n  });\r\n};\r\n*/'},{type:"css",content:""}]},selectedApiKeys:{}}},934559:function(e,t,o){"use strict";o.d(t,{$:function(){return a}});var n=o(386898),i=o(62107),r=o(488643);let a=6,l={version:6,theme:"default",showLineNumbers:!0,openFileTree:!1,showConsole:!1,disableExecution:!1,hideResultOutput:!1,hideOutputUrl:!1,hideCodeView:!1,loaders:new i.Z().loaders,npmPackages:r.Z.react,outputHeight:300,selectedApiKeys:{},selectedEnvVars:{},outputLayout:"desktop",codeContents:{canAddNpmPackages:!0,judge:{judgeDisabled:!1,judgeActive:!1,evaluationContent:n.y.authorCode,hintsContent:[],solutionContent:"",showSolution:!1,exerciseTabsVisible:!1,version:n.y.version},module:"/",id:0,maxId:3,selectedId:2,children:[{id:1,module:"index.js",leaf:!0,data:{content:"import React from 'react';\r\nrequire('./style.css');\r\n\r\nimport ReactDOM from 'react-dom';\r\nimport App from './app.js';\r\n\r\nReactDOM.render(\r\n  <App />, \r\n  document.getElementById('root')\r\n);\r\n",language:"jsx",staticFile:!0,hidden:!1,highlightedLines:null}},{id:2,module:"app.js",leaf:!0,data:{content:"import React from 'react';\r\n\r\nexport default class App extends React.Component {\r\n  render() {\r\n    return (\r\n      <span>Hello World</span>\r\n    );\r\n  }\r\n}\r\n",language:"jsx",staticFile:!1,hidden:!1,highlightedLines:null}},{module:"style.css",id:3,leaf:!0,data:{content:"p {\r\n  color: blue;\r\n}",language:"css",staticFile:!1,hidden:!1,highlightedLines:null}}]}};t.Z=l},386898:function(e,t,o){"use strict";o.d(t,{y:function(){return n}});let n={authorCode:'import React from \'react\';\r\nimport { shallow, configure } from \'enzyme\';\r\nimport Adapter from \'enzyme-adapter-react-16\';\r\n\r\nconfigure({ adapter: new Adapter() });\r\n\r\nimport HelloWorld from \'./app\';\r\n\r\nvar TestResult = function() {\r\n    this.succeeded = false;\r\n    this.reason = "";\r\n    this.input = "";\r\n    this.expected_output = "";\r\n    this.actual_output = "";\r\n}\r\n\r\nexport const executeTests = function() {\r\n\r\n  var results = [];\r\n\r\n  result = new TestResult();\r\n  result.input = \'HelloWorld Component\';\r\n  result.expected_output = "span containing text \'Hello World\'"\r\n\r\n  let wrapper = shallow(<HelloWorld />);\r\n\r\n  // Call your Challenge function here.\r\n\r\n  let type = wrapper.type();\r\n  let testSuccessful = true;\r\n  let failureReason;\r\n\r\n  if (type !== \'span\') {\r\n    testSuccessful = false;\r\n    failureReason = "You need to render exactly one span HTML element";\r\n  } else if (wrapper.props().children != "Hello World") {\r\n     testSuccessful = false;
1\r\n     failureReason = "You have rendered wrong message in your span element";\r\n  }\r\n\r\n  result.actual_output = wrapper.html();\r\n\r\n  if (testSuccessful) {\r\n    result.succeeded = true;\r\n    result.reason = "Succeeded"\r\n  } else {\r\n    result.succeeded = false;\r\n    result.reason = failureReason;\r\n  }\r\n\r\n  results.push(result);\r\n\r\n  return results;\r\n}\r\n',edCode:'import { executeTests } from \'./ed_spa_test_code.js\'; var main = function() {\r\n let results = executeTests();\r\n  let test_results = []\r\n\r\n  for (let result in results) {\r\n    let jres = {}\r\n    jres["succeeded"] = results[result].succeeded\r\n    jres["reason"] = results[result].reason\r\n    jres["input"] = results[result].input\r\n    jres["expected_output"] = results[result].expected_output\r\n    jres["actual_output"] = results[result].actual_output\r\n\r\n    test_results.push(jres)\r\n  }\r\n\r\n  let output = {"test_results": test_results};\r\n  let json_output = JSON.stringify(output);\r\n\r\n  console.log("<__educative_test_results__>" + json_output + "</__educative_test_results__>");\r\n}\r\n\r\nmain();\r\n',version:"1.1"}},62107:function(e,t){"use strict";class o{constructor(){this.loaders={babel:{title:"React",config:{es2015:!0,react:!0},enabled:!0},dart:{title:"Dart",config:{dart:!0},enabled:!1},"ts-react":{title:"Typescript React",config:{"ts-react":!0},enabled:!1},elm:{title:"Elm",config:{elm:!0},enabled:!1},vue:{title:"Vue.js",config:{vue:!0},enabled:!1},"gojs-react":{title:"GoJS React",config:{"gojs-react":!0},enabled:!1}}}}t.Z=o},488643:function(e,t){"use strict";t.Z={react:{react:"15.6.1","react-dom":"15.6.1"}}},907209:function(e,t,o){"use strict";o.d(t,{Ac:function(){return l},FG:function(){return c},Fo:function(){return a},Oq:function(){return i},Tt:function(){return r},_Y:function(){return s},af:function(){return u},jv:function(){return d}});var n=o(626548);let i="testfiles",r="usercode",a="/?folder=/".concat(r),l=e=>e.substring(0,e.indexOf("://")),s=e=>e.replace(/^(https?:\/\/)/,""),d=(e,t)=>e.startsWith(t),c=(e,t)=>{let o=new n.diff_match_patch,i=o.patch_make(e,t);return o.patch_toText(i)},u=(e,t)=>{let o=new n.diff_match_patch,i=o.patch_fromText(t);return o.patch_apply(i,e)[0]}},535330:function(e,t){"use strict";var o,n;(n=o||(o={})).LESSON_IN_PROGRESS="LESSON_IN_PROGRESS",n.LESSON_COMPLETED="LESSON_COMPLETED",t.Z=o},45543:function(e,t,o){"use strict";o.d(t,{BC:function(){return l},hf:function(){return i},nD:function(){return r},rZ:function(){return a}});var n=o(179424);let i={SPA:"ProjectWebpackBin",CODE:"ProjectCodingWidget",RUNJS:"ProjectRunJS",WORKSPACE:"ProjectWorkspace",TERMINAL:"ProjectTerminal",CODE_EVALUATION:"ProjectCodeEvaluation",URLIframe:"ProjectURLIframe"},r=[i.RUNJS,i.CODE_EVALUATION],a=[i.URLIframe,i.WORKSPACE],l=(e,t)=>({authorId:String(e.data.author_id),workId:String(e.data.collection_id),workType:e.data.work_type,workspaceCompId:String(e.data.project_id),workspaceCompType:t?n.H.LEARNER_PROJECT:n.H.AUTHOR_PROJECT})},826796:function(e,t,o){"use strict";var n=o(520649);t.Z=e=>e===n.dL.STANDALONE_PROJECT},275184:function(e,t,o){"use strict";o.d(t,{O:function(){return c},w:function(){return u}});
1var n=o(336449),i=o(987941),r=o(144022);let a=e=>{var t;let o=[],n=null===(t=e.content)||void 0===t?void 0:t.entities;return n&&(Object.values(n).forEach(e=>{e.type&&o.push(e)}),e.content={description:o}),e.content||(e.content={description:i.tp}),e},l=e=>(e.summary&&(e.content={entities:{1:{hash:1,type:"MarkdownEditor",content:e.summary}},ids:[1],selectedHash:1}),e),s=e=>{let{toc:t}=e;return t&&!Object.keys(t).length&&(e={...e,toc:(0,r.qH)(n.j.PROJECT_CATEGORY)}),e},d=e=>(e.content||(e.content=i.DW),e),c=e=>{let{data:t,isDataPropJson:o=!0}=e;var n=o?JSON.parse(t):t;return a(n=d(n=s(n=l(n))))},u=(e,t,o)=>{if(t<0&&o<0)return e;let n=(e=e.slice(0,t>-1?t:o))[e.length-1];return(null==n?void 0:n.type)==="MarkdownEditor"?e[e.length-1]={...n,content:{...n.content,mdHtml:n.content.mdHtml.replace(/If you(?:’re| are) unsure [\s\S]*?<\/p>/,"If you’re not sure how to proceed, check the Hint tab or the Solution tab.</p>")}}:(null==n?void 0:n.type)==="SlateHTML"&&(e[e.length-1]={...n,content:{...n.content,html:n.content.html.replace(/If you(?:’re| are) unsure [\s\S]*?<\/p>/,"If you’re not sure how to proceed, check the Hint tab or the Solution tab.</p>")}}),e}},881871:function(e,t,o){"use strict";o.d(t,{$z:function(){return E},Dc:function(){return Z},Fg:function(){return C},GD:function(){return _},GX:function(){return b},JM:function(){return k},NI:function(){return A},Qk:function(){return x},Ux:function(){return N},Vn:function(){return P},W2:function(){return R},Wm:function(){return L},Ys:function(){return U},a7:function(){return D},de:function(){return h.Z},f4:function(){return I},hQ:function(){return F},sA:function(){return w},v5:function(){return O},xb:function(){return S},yu:function(){return j}});var n=o(494296),i=o(454378),r=o(161514),a=o(744603),l=o(704373),s=o(632086),d=o(934559),c=o(865546),u=o(987941),p=o(45543),h=o(826796),v=o(144022),g=o(389392),m=o(726803);let _=e=>{let t=[];return Object.values(e).forEach(e=>{e.type&&t.push(e)}),t},f=e=>{var t,o;let n=null===(o=e.content)||void 0===o?void 0:null===(t=o.descriptionWidgets)||void 0===t?void 0:t.entities;n&&(e.content.descriptionWidgets=_(n))},y=e=>{var t,o,n,r,a,l;(null===(o=e.content)||void 0===o?void 0:null===(t=o.descriptionWidgets)||void 0===t?void 0:t.length)!==1||null!==(a=e.content)&&void 0!==a&&null!==(r=a.descriptionWidgets)&&void 0!==r&&null!==(n=r[0])&&void 0!==n&&n.type||(e.content.descriptionWidgets={entities:{0:{hash:0,type:"SlateHTML",content:null===(l=e.content.descriptionWidgets[0])||void 0===l?void 0:l.mdHtml}},ids:[0],selectedHash:i.K})},C=e=>e.categories.flatMap(e=>{let{pages:t}=e;return t}),S=e=>(null==e?void 0:e.length)>0&&e[0],E=e=>""!==e?e:"Untitled Category",T=e=>{let{projectId:t,authorId:o,collectionId:n,componentId:i,pathAuthorId:r,pathId:a}=e;return w({projectId:t,authorId:o,collectionId:n,componentId:i,pathAuthorId:r,pathId:a})},x=function(e,t,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return T({projectId:o,authorId:e,collectionId:t,pathAuthorId:n,pathId:i,componentId:null}).viewUrl.href},L=(e,t)=>e in t&&t[e].completed?u.jf.COMPLETED:u.jf.DEFAULT,N=e=>{let{autoComplete:t,map:o,toc:n,GAEventLabel:i,isStandardUser:a,previewAbleProjectEventLabel:l,projectTitle:s}=e;(0,r.Z)("STANDALONE_PROJECT","PROJECT_TASK_COMPLETED",i),(0,v.Mk)(o,n)&&(0,r.Z)("STANDALONE_PROJECT","PROJECT_ALL_TASKS_COMPLETED",s),t||(0,r.Z)("STANDALONE_PROJECT","PROJECT_TASK_MARKED_AS_COMPLETED",i),a&&(0,r.Z)("PREVIEW_ABLE_STANDALONE_PROJECT","PREVIEW_ABLE_TASK_COMPLETED",l)},b=()=>new Date().toLocaleString("en-US",{day:"numeric",year:"numeric",month:"short",hour:"numeric",minute:"numeric"}),w=e=>{let{projectId:t,authorId:o,collectionId:n,pathAuthorId:i,pathId:r,componentId:a,isStandaloneProject:s=!1,courseUrlSlug:d=null,palGroupSlug:c=null}=e;return(0,l.Z)({authorId:o,collectionId:n,id:a,projectId:t,isDraft:!0,courseUrlSlug:d,parentWorkAuthorId:i,parentWorkId:r,isStandaloneProject:s,palGroupSlug:c})},O=e=>{var t,o,i,r,a,l,s,c;return y(e),f(e),{...e,content:{...e.content,descriptionWidgets:null!==(a=null===(t=e.content)||void 0===t?void 0:t.descriptionWidgets)&&void 0!==a?a:u.tp,co
1deContent:{comp_id:(0,n.x0)(),...null!==(l=null===(o=e.content)||void 0===o?void 0:o.codeContent)&&void 0!==l?l:d.Z,isProject:!0},type:null!==(s=null===(i=e.content)||void 0===i?void 0:i.type)&&void 0!==s?s:p.hf.SPA,url:null===(r=e.content)||void 0===r?void 0:r.url},difficulty:null!==(c=e.difficulty)&&void 0!==c?c:u.FJ}},I=e=>{var t;let o=e.udata_files.map(e=>{let{file_id:t}=e;return t});o=JSON.stringify(o);let n=JSON.stringify(e.toc),i=JSON.stringify(e.relevant_courses.filter(e=>e)),r=JSON.stringify(null===(t=e.pre_requisite_projects)||void 0===t?void 0:t.filter(e=>e)),a=JSON.stringify(e.pre_reqs);return{...e,relevant_courses:i,pre_requisite_projects:r,udata_files:o,pre_reqs:a,toc:n}},P=(e,t)=>{let o="horizontal"===t,n=o?"4px":"9px",i=o?"9px":"5px",r=document.createElement("div");return r.innerHTML='<div style="display: flex; flex-direction: '.concat(o?"column":"row",';"> <svg style="height:').concat(i,"; width:").concat(n,';" fillColor="none" class="content-default"> <ellipse cx="2" cy="2.2444" rx="2" ry="1.84889" fill="currentColor"/> </svg> <svg style="height:').concat(i,"; width:").concat(n,';" fillColor="none" class="content-default"> <ellipse cx="2" cy="2.2444" rx="2" ry="1.84889" fill="currentColor"/> </svg> <svg style="height:').concat(i,"; width:").concat(n,';" fillColor="none" class="content-default"> <ellipse cx="2" cy="2.2444" rx="2" ry="1.84889" fill="currentColor"/> </svg> </div>'),r.className="gutter gutter-".concat(t," ").concat(o?"w-3":"h-3"," bg-neutral-secondary border border-y-0 border-solid s-gray-default ").concat(o?"cursor-col-resize":"cursor-row-resize"),r},A=e=>{let{type:t,componentId:o}=e;return t&&p.rZ.includes(t)?"PC-Key":o},j=function(e,t){var o;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,r=JSON.parse(null!==(o=m.rV("projects_user_preferences"))&&void 0!==o?o:"{}");r[e]||(r[e]={}),r[e][t]||(r[e][t]={}),r[e][t][null!=i?i:"project"]||(r[e][t][i]={});let a=r[e][t][i];r[e][t][i]={...a,...n},m.LS("projects_user_preferences",JSON.stringify(r))},k=(e,t,o)=>{var n;let i=JSON.parse(null!==(n=m.rV("projects_user_preferences"))&&void 0!==n?n:"{}");return i[e]&&i[e][t]&&i[e][t][null!=o?o:"project"]?i[e][t][null!=o?o:"project"]:{}},D=(e,t)=>{var o;let n=JSON.parse(null!==(o=m.rV("projects_user_preferences"))&&void 0!==o?o:"{}");n[e]&&n[e][t]&&(delete n[e][t],m.LS("projects_user_preferences",JSON.stringify(n)))},R=e=>({display:e?"flex":"none","align-items":"center","justify-content":"center"}),U=(e,t,o)=>{e(g.n.show(c._0,{onCloseGAEvent:{eventCategory:"PREVIEW_ABLE_STANDALONE_PROJECT",eventAction:"PREMIUM_MODAL_CLOSED_ON_TASK_PAGE",eventLabel:"".concat(t," | ").concat(o)},onCTAClickedGAEvent:{eventCategory:"PREVIEW_ABLE_STANDALONE_PROJECT",eventAction:"PREMIUM_MODAL_CTA_CLICKED_ON_TASK_PAGE",eventLabel:"".concat(t," | ").concat(o)}})),(0,r.Z)("PREVIEW_ABLE_STANDALONE_PROJECT","PREMIUM_MODAL_OPENED_ON_TASK_PAGE","".concat(t," | ").concat(o))},M=e=>{let t="sed -i '/";return e.forEach((e,o)=>{o>0&&(t+="\\|"),t+="^export[[:blank:]]".concat(e.name,"=")}),t+="/d' ~/.bashrc && echo '",e.forEach(e=>{t+="export ".concat(e.name,"=").concat(e.value,"\n")}),t+="' >> ~/.bashrc"},F=async(e,t,o,n,i,r,l)=>{let s=M(r),d={instance_id:i.container.liveInstance.id,container_image_name:i.container.imageName,envs:i.envs,ports:null==i?void 0:i.jobs.ports,run_script:s},c={language:"bash",source_code:"terminal",additional_files:[],entry_filename:"foo",author_id:e,work_id:t,page_id:String(o),is_draft_page:l,docker_container:JSON.stringify(d),comp_id:o,is_workspace:n===p.hf.WORKSPACE};(0,a.r)(c,!0)},Z=e=>{if(e.status){let t={envs:e.envs};s.YB.dispatch(s.lx.UPDATE_ENV_VARS,t)}e.dispatch(g.n.close())}},694473:function(e,t,o){"use strict";var n=o(931549);o(44194);var i=o(768615),r=o.n(i),a=o(795123),l=o(667241);t.Z=()=>(0,n.jsx)("div",{id:r()["root-container"],children:(0,n.jsx)(a.Z,{sidebarWidth:"24rem",backgroundColor:"bg-neutral-default",children:(0,n.jsx)(l.Z,{})})})},506821:function(e,t,o){"use strict";o.r(t),o.d(t,{ViewCollectionArticlesPage:function(){return oN},ViewCollectionArticlesPageWithoutTimeSpentDecorator:function(){return oO},ViewCollectionArticlesPageWrapperForTest:function(){return oI},default:function(){return ow}});var n,i,r,a,l,s,d=o(931549),c=o(44194),u=o(947447),p=o(784190),h=o(881756),v=o(309234),g=o(336636),m=o(386684),_=o(687233),f=()=>{let{isMiniMapSidebarOpen:e,setIsMiniMapSidebarOpen:t,isMinimapHover:o,setIsMinimapHover:n}=(0,_.Z)();return(0,d.jsx)("div",{className:"tailwind-hidden sticky top-32 z-20 h-0 lg:block",children:(0,d.jsx)("div",{className:"pointer-events-auto absolute h-5 w-5 transition-all duration-500 ".concat(e?"-left-3":"-left-0"),children:(0,d.jsx)(m.Z,{tooltipText:e?"Close Minimap":"Open Minimap",children:(0,d.jsx)("button",{className:"bg-neutral-tertiary flex h-5 w-5 cursor-pointer items-center justify-center transition-all duration-300 ".concat(e?"rounded-full":"rounded-l-none rounded-r-full"," ").concat(o?"opacity-100":e?"opacity-0":"opacity-100"),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onClick:()=>{e?(t(!1),(0,h.X)()):(t(!0),(0,v.w)())},"aria-label":e?"Close Minimap":"Open Minimap",children:(0,d.jsx)("div",{className:"content-secondary flex items-center justify-center",children:(0,d.jsx)(g.Z,{className:"content-secondary h-4 w-4 transform fill-current stroke-current transition-transform duration-300 ".concat(e?"rotate-180":"rotate-0")})})})})})})},y=o(36507),C=o(226142),S=o(78044),E=o.n(S),T=o(503346),x=o(551987),L=o(62945),N=o(156321),b=o(373516),w=o(917144),O=o(107565),I=o(431319),P=o(891905),A=o(336449),j=o(520649),k=o(112648),D=o(969099),R=o(555148),U=o(573199),M=o(794218),F=o(437297),Z=o(752021),q=o(970179),W=o(81223),G=o(378958),H=o(161514),J=o(32144),B=o(972729),V=o(254264),z=o(881762);let K=e=>(0,z.Z)({url:"/api/features/user-data/update",type:"PUT",data:{KV_to_update:e}});var Y=o(85638),Q=o(174246),X=o(554911),$=o(699853),ee=o(404340),et=o(343987),eo=o(687335),en=o(764412),ei=o(350434),er=o(389919),ea=o(975371),el=o(250198),es=o(595385),ed=o(747741),ec=o(682923),eu=o(849155),ep=o(64506),eh=o(230348),ev=o(761499);let eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,z.Z)({url:"/api/author/collaborator/".concat(e)+"?considerSelf=".concat(t),type:"GET"})};var em=o(60513),e_=o(791127),ef=o(629099),ey=o(443118),eC=o(6335),eS=e=>{let{removeTag:t,data:o}=e;return(0,d.jsxs)(ef.default,{backgroundColor:"bg-white border-white dark:bg-gray-D1400 dark:border-gray-D1400",padding:"px-4 py-2",parentClasses:"bg-gray-L50 cursor-pointer dark:bg-gray-D1300 dark:hover:bg-gray-D1200 dark:text-gray-D200 duration-200 flex hover:bg-indigo-50 items-center px-3 py-1 rounded space-x-4 text-black transition whitespace-nowrap",position:e_.xR,overlayParentClasses:"z-[200]",overlay:(0,d.jsxs)("div",{className:"flex h-20 w-60 items-center justify-center space-x-3",children:[(0,d.jsx)(ey.Z,{image:o.profile_image_serving_url,name:o.full_name,size:50}),(0,d.jsx)("p",{className:"m-0 font-normal text-black dark:text-gray-D200",children:o.full_name})]}),children:[(0,d.jsx)("span",{children:o.full_name}),(0,d.jsx)(eC.Z,{className:"h-3 w-3 hover:text-indigo-500 dark:hover:text-indigo-400",onClick:()=>t(o)})]})};class eE extends c.Component{componentDidMount(){this.updateSortedSuggestions()}componentDidUpdate(e){this.updateSortedSuggestions()}isValid(e){let t=null;return this.isInList(e)&&(t="".concat(e," has already been added.")),this.isEmail(e)||(t="".concat(e," is not a valid email address.")),!t||(this.setState({value:"",error:t}),!1)}isInList(e){let{tags:t}=this.props;return t.some(t=>t.email===e)}getSuggestedEmails(){return this.sortedSuggestions.filter(e=>{let{email:t}=e;return!this.isInList(t)}).map(e=>{let{name:t,email:o,emailRequired:n}=e,i=n?"".concat(t," (").concat(o,")"):"".concat(t);return(0,d.jsx)("option",{value:i},o)})}render(){let{value:e,error:t,loading:o}=this.state,{maxTags:n,tags:i,customPlaceholder:r,borderless:a,type:l,viewOnly:s,collectionType:c}=this.props,u=r||"Add ".concat(l,"s to this ").concat((0,em.e)(c)," by entering emails");return s?u="":this.hasMaxTags()?u="Maximum ".concat(n," ").concat(l,"s are allowed"):t?u=t:o&&(u="Adding ".concat(l,"...")),(0,d.jsxs)("div",{className:"mb-2.5 flex w-full flex-col flex-wrap justify-center border-gray-L200 px-2.5 py-0.5 duration-200 hover:border-gray-L300 focus:border-gray-L300 dark:border-gray-D900 dark:hover:border-gray-D800 dark:focus:border-gray-D800 sm:flex-row sm:justify-between ".concat(a?"rounded-none border-0 border-b":"rounded border border-solid"),style:{alignItems:"inherit",minHeight:"47px"},children:[(0,d.jsx)("ul",{className:"flex-s m-0 inline-flex w-full shrink-0 list-none flex-wrap items-center p-0",children:i.map(e=>(0,d.jsx)("li",{className:"my-1.5 ml-0 mr-2.5",children:(0,d.jsx)(eS,{data:e,removeTag:this.handleDelete},e.email)},e.email))}),(0,d.jsx)("input",{className:"w-full rounded border-none bg-white p-1.5 outline-none dark:bg-gray-D1500 sm:pl-3.5 ".concat(t?"placeholder-red-500":"placeholder-gray-L400"),"data-testid":"tags-input-test",type:"text",name:"".concat(l,"tags"),disabled:this.hasMaxTags(),placeholder:u,onCh
1ange:this.handleChange,onKeyUp:this.handleKeyUp,onFocus:this.addTag,onBlur:this.addTag,value:e,list:"email_suggestions",autoComplete:"off"}),(0,d.jsx)("datalist",{id:"email_suggestions",children:this.getSuggestedEmails()})]})}constructor(...e){super(...e),this.state={value:"",error:null,loading:!1},this.sortedSuggestions=[],this.updateSortedSuggestions=()=>{let e=[...this.props.suggestions].sort((e,t)=>e.name<t.name?-1:e.name>t.name?1:0);this.sortedSuggestions=e.map((t,o)=>{let{name:n}=t,i=o>0&&e[o-1].name===n,r=o<e.length-1&&e[o+1].name===n;return{...t,emailRequired:i||r}})},this.resolveSuggestion=e=>{let t=null;return{result:(e=>{let t=e.match(/\((\S+)\)/);return null==t?void 0:t[1]})(e)||(e=>{let{suggestions:o,type:n}=this.props,i=o.filter(t=>{let{name:o}=t;return o===e});return i.length>1?(t="Ambiguous reference to collaborator ".concat(e),null):0===i.length?(t="No ".concat(n||"collaborator"," named ").concat(e),null):i[0].email})(e),error:t}},this.addTag=()=>{let{value:e}=this.state;if((e=e.trim().replace(",",""))&&!this.isEmail(e)){let{result:t,error:o}=this.resolveSuggestion(e);if(o){this.setState({value:"",error:o});return}e=t}if(e&&this.isValid(e)){let{getUser:t,onChange:o,tags:n,type:i}=this.props;this.setState({value:"",loading:!0}),t(e,i).then(e=>{this.setState({loading:!1});let{error:t}=e;t?this.setState({error:t}):o([...n,e])})}},this.handleKeyUp=e=>{["Enter","Tab",","].includes(e.key)&&(e.preventDefault(),this.addTag())},this.handleChange=e=>{this.setState({value:e.target.value,error:null})},this.handleDelete=e=>{let{tags:t}=this.props,{onChange:o}=this.props;t=t.filter(t=>t.email!==e.email),this.setState({error:null}),o(t)},this.isEmail=e=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),this.hasMaxTags=()=>{let{maxTags:e,tags:t}=this.props;return t.length>=e}}}eE.defaultProps={suggestions:[],collectionType:j.dL.COLLECTION};var eT=o(489758),ex=o(408593);function eL(){return(eL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}var eN=function(e){return c.createElement("svg",eL({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-minus-circle"},e),n||(n=c.createElement("circle",{cx:12,cy:12,r:10})),i||(i=c.createElement("line",{x1:8,y1:12,x2:16,y2:12})))};function eb(){return(eb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}var ew=function(e){return c.createElement("svg",eb({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-plus-circle"},e),r||(r=c.createElement("circle",{cx:12,cy:12,r:10})),a||(a=c.createElement("line",{x1:12,y1:8,x2:12,y2:16})),l||(l=c.createElement("line",{x1:8,y1:12,x2:16,y2:12})))},eO=o(122508),eI=o.n(eO),eP=o(427391),eA=o.n(eP),ej=o(95010),ek=e=>(0,d.jsx)("span",{className:"cursor-pointer text-indigo-500 no-underline hover:underline dark:text-indigo-400",onClick:t=>{t.stopPropagation(),e.clickHandler()},title:e.description,children:e.text});class eD extends c.Component{componentDidUpdate(e,t){e.title!==this.props.title&&this.setState({internalTitle:this.props.title,editRevisionName:!1,isNamedRevision:null!==this.props.title})}menuOptions(){let e=[],{restoreSnapshot:t,snapshotKey:o,selected:n}=this.props,{editRevisionName:i,isNamedRevision:r,focusInput:a}=this.state;return e=i?[...e,{title:"Submit Title",clickEvent:this.updateTitle}]:r?[...e,{title:"Edit Revision Name",clickEvent:()=>{this.setState({editRevisionName:!0},()=>{a.current.focus()})}}]:[...e,{title:"Name This Revision",clickEvent:()=>{this.setState({editRevisionName:!0},()=>{a.current.focus()})}}],t&&(e=[...e,{title:"Restore This Verison",clickEvent:()=>{t(n?null:o)}}]),e.map(e=>{let{title:t,clickEvent:o}=e;return(0,d.jsx)("li",{className:"h-12 w-full pl-3 pt-4 hover:bg-gray-L50 dark:hover:bg-gray-D1300",onClick:o,children:t},t)})}render(){let{createdTime:e,isDisabled:t,authorName:o,authorId:n,onCollaboratorClick:i,index:r,isLast:a,revisionId:l}=this.props,{editRevisionName:s,internalTitle:c,isNamedRevision:u,focusInput:p,dropDownOpen:h}=this.state,v="revision_".concat(l,"_snapshot_").concat(r+1);return(0,d.jsxs)("div",{className:"-mt-4 flex",children:[(0,d.jsx)("div",{"data-testid":"snapshot",onClick:this.snapshotClick,className:"mb-6 mr-2 w-64 cursor-pointer border-l-0 pl-3 hover:text-indigo-500 dark:hover:text-indigo-400 ".concat(t?"text-gray-L500 dark:text-gray-D400":""),children:(0,d.jsxs)("div",{className:"font-normal",children:[s&&(0,d.jsx)("input",{type:"text",value:c,onChange:this.handleInternalTitleChange,onKeyDown:this.handleInputSubmit,onBlur:this.updateTitle,placeholder:"Title",maxLength:20,ref:p,className:"mt-2 rounded border-indigo-500 outline-none"}),!s&&u&&(0,d.jsx)("div",{children:(0,d.jsx)("h6",{children:c})}),(0,d.jsx)("div",{className:"flex",children:(0,d.jsxs)("span",{id:v,className:"font-normal",children:[(0,d.jsx)(ex.Z,{format:"ddd, MMM D, YYYY",timestamp:e}),"\xa0",(0,d.jsx)("span",{className:"ml-auto",children:(0,d.jsx)(ex.Z,{format:"h:mm a",timestamp:e})})]})}),o?(0,d.jsx)("div",{children:(0,d.jsx)("span",{className:"font-normal",children:(0,d.jsx)(ek,{clickHandler:()=>{i(n)},description:"Only show ".concat(o,"'s"),text:o})})}):null]})}),(0,d.jsx)("div",{children:(0,d.jsxs)(eA(),{onRootClose:()=>{this.setState({dropDownOpen:!1})},children:[(0,d.jsx)("button",{className:"h-12 w-12 rounded-none border-none hover:bg-gray-L50 dark:bg-gray-D1500 dark:hover:bg-gray-D1400 ".concat(h?"bg-gray-L50 shadow-inner dark:bg-gray-D1400":"bg-transparent"),onClick:()=>{this.setState({dropDownOpen:!h})},children:(0,d.jsx)(ej.Z,{className:"text-black dark:text-gray-D200"})}),(0,d.jsx)("ul",{className:"relative",children:(0,d.jsx)("div",{className:"absolute left-auto right-0 w-40 list-none rounded-none border-none bg-white py-0 shadow-md dark:bg-gray-D1400 ".concat(a?"bottom-12":"bottom-auto"," ").concat(h?"flex":"tailwind-hidden"),children:(0,d.jsx)("div",{className:"w-full cursor-pointer text-xs font-semibold tracking-wide",children:this.menuOptions()})})})]})})]})}constructor(e){super(e),this.snapshotClick=()=>{let{onSnapshotChange:e,snapshotKey:t,selected:o}=this.props;o||e({key:t})},this.updateTitle=e=>{let{index:t}=this.props;this.props.saveTitle(e,t,this.state.internalTitle).then(e=>{e||this.setState({editRevisionName:!1,internalTitle:this.props.title})})},this.handleInputSubmit=e=>{e.keyCode===eI().codes.enter&&this.updateTitle(e),e.keyCode===eI().codes.esc&&this.setState({editRevisionName:!1,internalTitle:this.props.title})},this.handleInternalTitleChange=e=>{this.setState({internalTitle:e.target.value})},this.state={editRevisionName:!1,isNamedRevision:null!==e.title&&""!==e.title,internalTitle:e.title,focusInput:c.createRef(),dropDownOpen:!1}}}var eR=o(869481),eU=o(72281),eM=o(60882);function eF(){return(eF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(null,arguments)}var eZ=function(e){return c.createElement("svg",eF({width:12,height:12,xmlns:"http://www.w3.org/2000/svg"},e),s||(s=c.createElement("circle",{cx:140.5,cy:357,r:5,transform:"translate(-135 -351)",stroke:"#000"})))};class eq extends c.Component{componentDidMount(){let e=this.getCurrentRevision();if(!e||!e.snapshots){let{actions:e,authorId:t,collectionId:o,pageId:n,editorPageId:i,revisionId:r,collaboratorWhitelist:a,documentType:l}=this.props;e.loadArticleSnapshots(t,o,n,i,l,r,a)}}render(){let{revisionId:e,selectedSnapshot:t,onSnapshotChange:o,isFirstRevision:n,onCollaboratorClick:i,closed:r,isCollaborativePage:a}=this.props,l=this.getCurrentRevision(),s=null==l?void 0:l.snapshots,c=null==l?void 0:l.hasMore;return s?0===s.length?(0,d.jsx)("div",{className:"ml-10 text-sm italic text-gray-L500 dark:text-gray-D400",style:{marginTop:"5px"},children:"(No snapshots)"}):(0,d.jsx)("div",{className:"max-h-full flex-auto list-none overflow-y-auto px-0 pb-0 pt-6",style:{overflowY:"visible",margin:"3px 15px 0px 10px"},children:(0,d.jsxs)("div",{className:"mb-4 flex flex-shrink-0 flex-col",children:[(0,d.jsx)("div",{id:"revision_".concat(e,"_snapshots"),style:{...r?{height:0,opacity:0,transition:"height 0.3s ease-out, opacity 0.3s ease-out"}:{opacity:1,transition:"height 0.3s ease-out, opacity 0.3s ease-out"}},children:s.map((r,l)=>{var c;return(0,d.jsxs)("div",{className:"mr-4 flex flex-nowrap items-start justify-start overflow-visible border-0 border-l border-solid border-black py-3 last:border-transparent dark:border-gray-D800",children:[(0,d.jsx)("div",{className:"-ml-1.5 -mt-4 w-4 flex-shrink-0",children:(0,d.jsx)(eZ,{className:"".concat(t.key===r.key?"text-black dark:text-gray-D200":"text-white dark:text-gray-D700"," fill-current")})}),(0,d.jsx)(eD,{createdTime:r.created,snapshotKey:r.key,authorId:r.updated_by_id,authorName:r.updated_by,selected:t.key===r.key,isDisabled:0===l&&n,onSnapshotChange:o,onCollaboratorClick:i,title:r.title,saveTitle:this.handleTitleUpdate,index:l,restoreSnapshot:(null===(c=this.props.firstSnapshot)||void 0===c?void 0:c.key)!==r.key||this.props.editorPageId||a?this.props.restoreSnapshot:null,isLast:l===s.length-1&&0!==l,revisionId:e},r.key)]},r.key)})}),c&&!r&&(0,d.jsx)("div",{className:"mb-4 ml-4",children:(0,d.jsx)("button",{className:"outlined-default m-2 py-2",onClick:this.loadMore,children:"Show More"})})]})}):(0,d.jsx)("div",{id:"revision_".concat(e,"_snapshots"),className:"m-0 max-h-full flex-auto list-none overflow-y-auto pb-2 pt-0",style:{paddingLeft:"22px"},children:(0,d.jsx)("div",{className:"mt-2.5",children:(0,d.jsx)(eT.default,{size:30})})})}constructor(...e){super(...e),this.loadMore=()=>{let{actions:e,authorId:t,collectionId:o,pageId:n,editorPageId:i,revisionId:r,collaboratorWhitelist:a,documentType:l}=this.props;e.loadArticleSnapshots(t,o,n,i,l,r,a)},this.getCurrentRevision=()=>{var e,t,o;return null!==(o=null===(t=this.props.revisions)||void 0===t?void 0:null===(e=t.revisions)||void 0===e?void 0:e[this.props.revisionId])&&void 0!==o?o:null},this.handleTitleChange=(e,t)=>
1{var o;let{actions:n}=this.props,i=this.getCurrentRevision(),r=(null==i?void 0:null===(o=i.snapshots)||void 0===o?void 0:o.map((o,n)=>n===t?{...o,title:e}:o))||null;n.updateTitle({snapshots:r,revisionId:this.props.revisionId})},this.handleTitleUpdate=async(e,t,o)=>{let{actions:n,isCollaborativePage:i,documentType:r}=this.props,a=this.getCurrentRevision(),l=null==a?void 0:a.snapshots;return await n.saveTitle(l[t].key,o,!i,r).then(e=>{e&&this.handleTitleChange(o,t)})}}}let eW=e=>{let{articleRevisionsState:t}=(0,eR.iI)(),{articleRevisionsActions:o}=(0,eR.MR)(),{firstSnapshot:n}=(0,eM.H)(t.data),i={...e,actions:{loadArticleSnapshots:o.load,updateTitle:o.updateSnapShotTitle,saveTitle:o.saveTitle},revisions:t.data,firstSnapshot:n};return(0,d.jsx)(eq,{...i})};var eG=function(e){var t;let o=null!==(t=(0,eU.q6)().use_collaborative_editor)&&void 0!==t&&t;return(0,d.jsx)(eW,{...e,isCollaborativePage:o})},eH=o(599456),eJ=o.n(eH),eB=o(173656);class eV extends c.Component{render(){let{authorId:e,collectionId:t,pageId:o,editorPageId:n,revisionId:i,selectedSnapshot:r,isFirstRevision:a,lastSavedTime:l,isDraft:s,selected:c,onSnapshotChange:u,onRevisionChange:p,onCollaboratorClick:h,collaboratorWhitelist:v,restoreSnapshot:g,documentType:m}=this.props,{expanded:_}=this.state,f=null;f=_?(0,d.jsx)(eN,{className:"-mb-0.5 h-4 w-4"}):(0,d.jsx)(ew,{className:"-mb-0.5 h-4 w-4"});let y=(0,d.jsxs)("div",{"data-testid":"revision-title",className:"w-max cursor-pointer hover:text-indigo-500 dark:hover:text-indigo-400",onClick:this.toggleExpand,id:"revision_".concat(i),children:[(0,d.jsx)("span",{"data-testid":"revision-title-text",className:eJ().revision_title_text,id:eB.env.REACT_APP_STANDALONE&&s&&c?"selenium-revision_loaded":"",children:(0,d.jsxs)("p",{className:"text-base",children:[f," ",s?"Draft":"Published"," Revision"]})}),(0,d.jsx)("span",{className:"ml-5 block",children:(0,d.jsxs)("span",{className:"font-normal",children:[s?"Saved ":"Published "," ",(0,d.jsx)(ex.Z,{timestamp:l,relative:!0,filter:e=>e.toLowerCase(),interval:60})]})})]});return(0,d.jsxs)("div",{"data-testid":"revision-container",className:"mt-2 overflow-hidden ".concat(a&&_?"-mb-7":""),children:[y,(0,d.jsx)(eG,{authorId:e,pageId:o,editorPageId:n,revisionId:i,collectionId:t,selectedSnapshot:r,isFirstRevision:a,onSnapshotChange:e=>{u(e),p({id:i})},onCollaboratorClick:h,collaboratorWhitelist:v,restoreSnapshot:g,documentType:m,closed:!_})]})}constructor(e){super(e),this.toggleExpand=()=>{this.state.expanded?this.setState(e=>({...e,expanded:!1})):this.setState(e=>({...e,expanded:!0}))},this.state={expanded:!!e.expand}}}eV.defaultProps={isDraft:!1,expand:!1};class ez extends c.Component{componentDidMount(){let{actions:e,authorId:t,collectionId:o,pageId:n,editorPageId:i,documentType:r}=this.props;(t&&o&&n&&r||[ep.s.BLOGS,ep.s.NEWSLETTER,ep.s.GUIDE].includes(r)&&i)&&e.loadArticleRevisions(t,o,n,i,r)}componentDidUpdate(e){let{actions:t,authorId:o,collectionId:n,pageId:i,editorPageId:r,documentType:a}=this.props;(this.props.router.query.pageId!==e.router.query.pageId||this.props.revisions&&e.pageId&&i&&e.pageId!==i)&&t.clearArticleRevisions(),!this.props.revisions&&e.pageId!==i&&i&&t.loadArticleRevisions(o,n,i,r,a)}componentWillUnmount(){let{actions:e}=this.props;e.clearArticleRevisions()}render(){let{authorId:e,collectionId:t,pageId:o,editorPageId:n,selectedRevision:i,revisions:r,selectedSnapshot:a,onRevisionChange:l,onSnapshotChange:s,onCollaboratorClick:c,collaboratorWhitelist:u,restoreSnapshot:p,documentType:h}=this.props,v=null==r?void 0:r.revisions;if(!v)return(0,d.jsx)(eT.default,{size:50});let g=null==r?void 0:r.hasMore,m=[...Object.keys(v)].sort((e,t)=>t-e);return(0,d.jsxs)("div",{className:"mx-0 max-h-full flex-auto list-none overflow-y-auto pb-2 pl-4 pt-0",style:{marginTop:"15px",marginBottom:"25px"},children:[m.map((r,g)=>{let m=v[r],_={authorId:e,pageId:o,editorPageId:n,collectionId:t,documentType:h,onRevisionChange:l,selectedSnapshot:a,onSnapshotChange:s,key:r,revisionId:m.revisionId,lastSavedTime:m.lastModified,isDraft:m.isDraft,expand:0===g,isFirstRevision:0===g,selected:parseInt(i.id,10)===parseInt(r,10),onCollaboratorClick:c,collaboratorWhitelist:u,restoreSnapshot:p};return(0,d.jsx)(eV,{..._})}),g&&(0,d.jsx)("button",{className:"outlined-default m-2 ml-4 py-2",onClick:this.loadMore,children:"Show More Revisions"})]})}constructor(...e){super(...e),this.loadMore=()=>{let{actions:e,authorId:t,collectionId:o,pageId:n,editorPageId:i,documentType:r}=this.props;e.loadArticleRevisions(t,o,n,i,r)}}}var eK=(0,T.withRouter)(e=>{let{articleRevisionsState:t}=(0,eR.iI)(),{articleRevisionsActions:o}=(0,eR.MR)(),n={...e,actions:{loadArticleRevisions:o.load,clearArticleRevisions:o.clear},revisions:t.data};return(0,d.jsx)(ez,{...n})}),eY=o(438618),eQ=o.n(eY),eX=o(125110),e$=o(218442),e0=o(987941),e1=o(508438),e2=o(93473),e4=o(354978),e3=o(420426),e5=o(343949),e9=o(395124),e6=o(300670),e8=o(389392),e7=o(63106),te=o(621062);let tt=(0,b.$j)(null,e=>({actions:{...(0,ec.DE)({restoreCollectionArticle:eh.Z,closeModal:e8.
1n.close},e),dispatch:e},dispatch:e}),null,{forwardRef:!0});class to extends c.Component{componentDidUpdate(e){let{authorId:t,collectionId:o,editorPageId:n,firstSnapshot:i,firstRevision:r,actions:a}=this.props,l=!this.props.allCollaborators.loading&&!this.props.allCollaborators.loaded;!e.firstSnapshot&&i&&(n?this.selectedSnapshotChanged(i):this.props.selectedSnapshotChanged(i),this.props.selectedRevisionChanged(r)),(this.props.router.query.pageId!==e.router.query.pageId||this.props.pageId&&e.pageId&&this.props.pageId!==e.pageId)&&this.props.isCollaborativePage&&a.closeModal();let s=(e,t)=>e!==t&&!(isNaN(e)&&isNaN(t));l&&t&&o&&this.props.loadCollaborators(t,o,!0),s(e.authorId,t)&&s(e.collectionId,o)&&this.props.clearCollaborators()}componentWillUnmount(){this.props.clearCollaborators()}render(){let{onFilterChange:e,getUser:t,setSingleFilter:o}=this,{collaboratorTags:n}=this.state,{authorId:i,collectionId:r,pageId:a,documentType:l,selectedSnapshot:s,selectedRevision:c,editorPageId:u}=this.props,p=this.props.allCollaborators.data||{},h=(0,d.jsxs)("div",{"data-testid":"version-history-title-container",className:"flex items-center justify-center bg-gray-L50 dark:bg-gray-D1400 ".concat(eQ()["version-history-title-container"]),children:[(0,d.jsx)(eC.Z,{className:"h-6 w-6",onClick:this.closeSidebar}),(0,d.jsx)("h4",{className:"m-2 text-center",children:"Version History"})]}),v=n.map(e=>{let{author_id:t}=e;return t}),g=Object.values(p).map(e=>{let{full_name:t,email:o}=e;return{name:t,email:o}});return(0,d.jsxs)("nav",{style:{zIndex:200,width:eX.oU,...l===q.q.ASSESSMENT_QUESTION?{height:"calc(100vh - ".concat(e0.jw,"px)"),marginTop:"".concat(e0.jw,"px"),paddingBottom:"0px"}:{height:"100%",paddingBottom:"100px",margin:"0"}},className:"tailwind-hidden fixed right-0 max-h-full shrink grow-0 basis-96 flex-col overflow-hidden border-0 border-l border-solid border-gray-L300 bg-white p-0 duration-500 dark:border-gray-D1200 dark:bg-gray-D1500 sm:flex ",children:[h,!u&&(0,d.jsx)(eE,{onChange:e,tags:n,maxTags:64,getUser:t,customPlaceholder:"Filter by collaborator",borderless:!0,suggestions:g,type:eu.Q.COLLABORATOR}),(0,d.jsx)(eK,{authorId:i,collectionId:r,pageId:a,editorPageId:u,documentType:l,onSnapshotChange:this.selectedSnapshotChanged,selectedRevision:c,selectedSnapshot:s,onRevisionChange:this.selectedRevisionChanged,collaboratorWhitelist:v,onCollaboratorClick:o,restoreSnapshot:this.restoreSelected})]})}constructor(...e){var t;super(...e),t=this,this.state={collaboratorTags:[]},this.selectedSnapshotChanged=e=>{let{dispatch:t,authorId:n,collectionId:i,pageId:r,documentType:a,loadCollectionArticle:l,loadComponentSnapshot:s,clearRestoredComponent:d}=this.props;if(a===q.q.ASSESSMENT_QUESTION?this.props.clearRestoredQuestion():a===q.q.PROJECT_COMPONENT?d():a===q.q.CLOUD_LAB_TASK?(this.props.cloudLabActions.clearRestoredTask(),this.props.clearWidgets()):a===q.q.CLOUD_LAB?this.props.cloudLabActions.clearRestoredLab():([ep.s.BLOGS,ep.s.NEWSLETTER,ep.s.GUIDE].includes(a)&&o.g.editorPage.actions.clear(),this.props.clearWidgets()),this.props.selectedSnapshotChanged(e),a===q.q.COLLECTION_LESSON){var c;t(l(n,i,r,null===(c=this.props.userInfo.userInfoState.data)||void 0===c?void 0:c.user_id,this.props.collectionArticlePreview,e.key))}else if(a===q.q.ASSESSMENT_QUESTION)this.props.loadQuestionSnapshot(n,i,r,e.key);else if(a===q.q.PROJECT_COMPONENT)s(n,i,e.key);else if(a===q.q.CLOUD_LAB_TASK)this.props.cloudLabActions.loadTaskSnapshot(n,i,e.key);else if(a===q.q.CLOUD_LAB)this.props.cloudLabActions.loadLabSnapshot(n,i,e.key);else if([ep.s.BLOGS,ep.s.NEWSLETTER,ep.s.GUIDE].includes(a)){let t=this.props.router.query.pageType,n=e$.Mq[t];o.g.editorPage.actions.loadSnapshot(e.key,n)}},this.selectedRevisionChanged=e=>{this.props.selectedRevisionChanged(e)},this.isOnboardingContext=()=>(0,e7.ME)(this.props.collectionDetails),this.restoreSelected=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{actions:o,authorId:n,collectionId:i,pageId:r,router:a,documentType:l,workType:s,clearProject:d,firstSnapshot:c,selectedSnapshot:u,editorPageId:p}=t.props;if(c.key!==u.key||p||e){var h;o.restoreCollectionArticle(a,n,i,a.query.assessmentId||a.query.projectId||a.query.cloudLabId,r,e||u.key,l,s,t.props.clearAssessment,t.isOnboardingContext(),d,null===(h=t.props.cloudLabActions)||void 0===h?void 0:h.clear,p)}},this.closeSidebar=()=>{let{authorId:e,collectionId:t,pageId:o,router:n,editorPageId:i,isCollaborativePage:r}=this.props,{planAuthorId:a,planId:l,moduleAuthorId:s,moduleId:d,pageType:c}=n.query,u=this.props.documentType===q.q.PROJECT_COMPONENT,p=this.props.documentType===q.q.CLOUD_LAB_TASK||this.props.documentType===q.q.CLOUD_LAB;if(r&&!u)this.props.actions.closeModal();else if(a&&l)s&&d?n.push("/plan/".concat(a,"/").concat(l,"/module/").concat(e,"/").concat(t,"/").concat(o,"/edit")):n.push("/plan/".concat(e,"/").concat(t,"/page/").concat(o,"/edit"));else if(this.props.documentType===q.q.ASSESSMENT_QUESTION){let o=n.query.assessment_id,i=n.query.question_id,r=n.query.assessment_type===M.Q.ENTERPRISE_ASSESSMENT;n.push("".concat(r?"/enterprise":"","/assessmenteditor/").concat(e,"/").concat(t,"/").concat(o,"/").concat(i))}else u||p?this.props.setCloseSidebar():[ep.s.BLOGS,ep.s.NEWSLETTER,ep.s.GUIDE].includes(this.props.documentType)?n.push("/editor-page/".concat(c,"/").concat(i)):n.push("/pageeditor/".concat(e,"/").concat(t,"/").concat(o))},this.onFilterChange=e=>{let{authorId:t,collectionId:o,pageId:n,editorPageId:i,documentType:r}=this.props;e=e.length?[e[e.length-1]]:[],ed.Z(this.state.collaboratorTags,e)||this.setState({collaboratorTags:e},()=>{this.props.loadArticleRevisions(t,o,n,i,r,null,[],!0)})},this.getUser=async e=>{try{return JSON.parse(await eg(e,!0))}catch(e){var t;return{error:(null==e?void 0:null===(t=e.responseJSON)||void 0===t?void 0:t.errorText)||"Failed to retrieve user details."}}},this.setSingleFilter=e=>{this.getUser(e).then(e=>[e]).then(this.onFilterChange)}}}let tn=(0,e9.cP)(to);var ti=(0,T.withRouter)(tt(e=>{var t,n,i,r,a;let l=null!==(r=(0,e5.jc)())&&void 0!==r?r:o.g.projectActions,s=(0,e2.Xz)(),{collectionArticlePreview:u}=(0,e3.nF)(),{collectionArticleActions:p}=(0,e4.SF)(),[h,v]=(0,c.useState)({loaded:!1}),g=o.g.authorCollection,m=null==g?void 0:null===(t=g.instance)||void 0===t?void 0:t.details,_=null!==(a=null==g?void 0:g.use_collaborative_editor)&&void 0!==a&&a,{articleRevisionsState:f}=(0,eR.iI)(),{articleRevisionsActions:y}=(0,eR.MR)(),C=(0,e1.Vo)(),S=f.data,{firstSnapshot:E,firstRevision:T}=(0,eM.H)(S),x=(0,e6.Ud)()().clear,L={...e,collectionArticlePreview:u,allCollaborators:h,loadCollaborators:(e,t,o,n)=>{v(e=>({...e,loading:!0})),(0,ev.J)(e,t,o,n).then(e=>{v({data:JSON.parse(e),loaded:!0,loading:!1,error:void 0})}).catch(e=>{v({loaded:!1,loading:!1,error:(0,te.n)(e)})})},clearCollaborators:()=>{v({loaded:!1})}
1,loadCollectionArticle:p.load,collectionDetails:m,isCollaborativePage:_,loadComponentSnapshot:null==l?void 0:l.loadComponentSnapshot,clearRestoredComponent:null==l?void 0:l.clearRestoredComponent,clearProject:null==l?void 0:l.clear,cloudLabActions:s,loadArticleRevisions:y.load,selectedSnapshotChanged:y.selectedSnapshotChanged,selectedRevisionChanged:y.selectedRevisionChanged,loadQuestionSnapshot:C.loadQuestionSnapshot,clearRestoredQuestion:C.clearRestoredQuestion,clearAssessment:C.clear,firstSnapshot:E,firstRevision:T,selectedSnapshot:(null===(n=f.data)||void 0===n?void 0:n.selectedSnapshot)||{key:null},selectedRevision:(null===(i=f.data)||void 0===i?void 0:i.selectedRevision)||{key:null},clearWidgets:x};return(0,d.jsx)(tn,{...L})})),tr=o(399887),ta=o(535330),tl=o(865546),ts=o(15096),td=o(468518),tc=o(611522),tu=o(300883),tp=o(68189),th=o(525623),tv=o(127987),tg=o(709730),tm=o(919660),t_=o(958412),tf=o(312668),ty=o(257397),tC=o(610345),tS=o(989648),tE=o(20534),tT=o(301284),tx=o(810456),tL=o(349196),tN=o(436303),tb=o(115172),tw=o(262603),tO=o(398361),tI=o(347879),tP=o(634888),tA=o(253094),tj=o(184492),tk=o(264937),tD=o(723804),tR=o(173583),tU=o(171483),tM=o(487054),tF=o(878018),tZ=o(493415),tq=o(291166),tW=o(244305),tG=o(967285),tH=o(342015),tJ=o(878459),tB=o(729133),tV=o(539538),tz=o(888438),tK=o(834138),tY=o(445374),tQ=o(602461),tX=o(810343),t$=o(853224),t0=o(707128),t1=o(332936);let t2=e=>e.includes("/courses")&&e.includes("/assessment");var t4=o(837948),t3=o(268624);let t5=e=>{let{dimensionClasses:t}=e;return(0,d.jsx)("div",{className:"".concat(t," bg-neutral-pressed animate-pulse rounded-3xl")})},t9=()=>(0,d.jsx)("div",{className:"bg-neutral-pressed max-h-3.5 w-3.5 animate-pulse rounded-full"}),t6=e=>{let{isArabicURL:t}=e;return(0,d.jsx)("div",{className:"s-gray-default absolute ".concat(t?"right-1.5":"left-1.5"," top-3.5 h-5 border border-solid")})};var t8=e=>{let{isArabicURL:t=!1}=e,o=t?"rtl":"ltr";return(0,d.jsxs)("div",{className:"no-scrollbar flex h-full flex-col overflow-y-auto px-6 pt-5",children:[(0,d.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"h-5 w-full"}),(0,d.jsx)(t5,{dimensionClasses:"h-5 w-full"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-4 flex gap-3",children:[(0,d.jsx)(t5,{dimensionClasses:"w-6 h-3.5"}),(0,d.jsx)(t5,{dimensionClasses:"w-24 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-4 flex justify-between gap-3",children:[(0,d.jsx)(t5,{dimensionClasses:"w-36 h-3.5"}),(0,d.jsx)(t5,{dimensionClasses:"w-7 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-8 flex gap-9",children:[(0,d.jsx)(t5,{dimensionClasses:"w-18 h-3.5"}),(0,d.jsx)(t5,{dimensionClasses:"w-28 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex gap-6",children:[(0,d.jsx)(t5,{dimensionClasses:"w-28 h-4"}),(0,d.jsx)(t5,{dimensionClasses:"w-11 h-3.5"})]}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"relative m-2 mt-7 flex gap-2",children:[(0,d.jsx)(t9,{}),(0,d.jsx)(t6,{isArabicURL:t}),(0,d.jsx)(t5,{dimensionClasses:"w-28 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"relative m-2 mt-3 flex gap-2",children:[(0,d.jsx)(t9,{}),(0,d.jsx)(t6,{isArabicURL:t}),(0,d.jsx)(t5,{dimensionClasses:"w-18 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"relative m-2 mt-3 flex gap-2",children:[(0,d.jsx)(t9,{}),(0,d.jsx)(t6,{isArabicURL:t}),(0,d.jsx)(t5,{dimensionClasses:"w-20 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"relative m-2 mt-3 flex gap-2",children:[(0,d.jsx)(t9,{}),(0,d.jsx)(t6,{isArabicURL:t}),(0,d.jsx)(t5,{dimensionClasses:"w-40 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"relative m-2 mt-3 flex gap-2",children:[(0,d.jsx)(t3.Z,{className:"content-gray-default h-3.5 w-3.5 fill-current"}),(0,d.jsx)(t5,{dimensionClasses:"w-24 h-3.5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-full h-4"}),(0,d.jsx)(t5,{dimensionClasses:"w-full h-4"})]}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-44 h-4"}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-40 h-4"}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-48 h-4"}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-40 h-4"}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-9 flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-full h-4"}),(0,d.jsx)(t5,{dimensionClasses:"w-full h-4"})]}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mt-7 flex items-center justify-between gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-44 h-4"}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]}),(0,d.jsxs)("div",{dir:o,className:"mb-4 mt-7 flex items-center justify-between gap-2",children:[(0,d.jsx)(t5,{dimensionClasses:"w-40 h-4"}),(0,d.jsx)(t4.Z,{className:"content-gray-default h-5 w-5"})]})]})},t7=o(677658),oe=()=>(0,d.jsx)(t7.C,{sidebarClass:"ed-grid-sidebar2",className:"major-second lg:minor-third flex flex-col bg-gray-L50 dark:bg-gray-D1400",mainSidebar:!1,sidebarType:tT.mQ.LESSON,overlayType:t7.Z.BLUR,addBorderWhenOverlay:!0,children:(0,d.jsx)(t8,{})}),ot=o(694473);let oo=E()(()=>Promise.all([o.e(855310),o.e(235099),o.e(826825)]).then(o.bind(o,826825)),{loadableGenerated:{webpack:()=>[826825]},ssr:!1,loading:()=>(0,d.jsx)(oe,{})}),on=E()(()=>o.e(149148).then(o.bind(o,149148)),{loadableGenerated:{webpack:()=>[149148]},ssr:!1,loading:()=>(0,d.jsx)(ot.Z,{})});var oi=e=>{let t=(0,t1.usePathname)(),o=(0,tS.Z)();return(0,c.useMemo)(()=>{let n=o||t;return e.isMinimapEnabled&&((0,tc.H)(n)||t2(n))},[e.isMinimapEnabled,t,o])?(0,d.jsx)(on,{}):(0,d.jsx)(oo,{...e})},or=o(126323);let oa=E()(()=>o.e(15398).then(o.bind(o,272653)),{loadableGenerated:{webpack:()=>[272653]}}),ol=E()(()=>Promise.all([o.e(855310),o.e(182292),o.e(297156),o.e(762571),o.e(563420),o.e(782474),o.e(235099),o.e(245393),o.e(481979),o.e(785011),o.e(320558),o.e(480333),o.e(259626),o.e(215238),o.e(694266),o.e(687205)]).then(o.bind(o,595789)),{loadableGenerated:{webpack:()=>[595789]}}),os=E()(()=>Promise.all([o.e(855310),o.e(991577),o.e(297156),o.e(762571),o.e(782474),o.e(153679),o.e(869535),o.e(480333),o.e(104500),o.e(526610)]).then(o.bind(o,327374)),{loadableGenerated:{webpack:()=>[327374]}}),od=E()(()=>Promise.all([o.e(991577),o.e(682564),o.e(855310),o.e(297156),o.e(762571),o.e(782474),o.e(235099),o.e(245393),o.e(153679),o.e(480333),o.e(259626),o.e(215238),o.e(104500),o.e(780288),o.e(361920),o.e(630906)]).then(o.bind(o,986171)),{loadableGenerated:{webpack:()=>[986171]}}),oc=E()(()=>Promise.all([o.e(795962),o.e(628371)]).then(o.bind(o,367383)),{loadableGenerated:{webpack:()=>[367383]}}),ou=E()(()=>Promise.all([o.e(855310),o.e(991577),o.e(297156),o.e(762571),o.e(782474),o.e(235099),o.e(245393),o.e(153679),o.e(480333),o.e(259626),o.e(215238),o.e(104500),o.e(643454),o.e(740752)]).then(o.bind(o,547830)),{loadableGenerated:{webpack:()=>[547830]}}),op=E()(()=>Promise.all([o.e(795962),o.e(30946),o.e(453564)]).then(o.bind(o,918866)),{loadableGenerated:{webpack:()=>[918866]}}),oh=E()(()=>Promise.all([o.e(36003),o.e(855310),o.e(991577),o.e(297156),o.e(762571),o.e(782474),o.e(235099),o.e(245393),o.e(686420),o.e(480333),o.e(259626),o.e(215238),o.e(795962),o.e(595597),o.e(832990),o.e(805903),o.e(621803)]).then(o.bind(o,394584)),{loadableGenerated:{webpack:()=>[394584]}}),ov=E()(()=>Promise.all([o.e(937436),o.e(611632),o.e(626172)]).then(o.bind(o,991904)),{loadableGenerated:{webpack:()=>[991904]},ssr:!1}),og=E()(()=>Promise.all([o.e(991577),o.e(855310),o.e(895531),o.e(129246),o.e(222926),o.e(763898),o.e(297156),o.e(424281),o.e(762571),o.e(782474),o.e(235099),o.e(331040),o.e(420097),o.e(181087),o.e(138799),o.e(583314),o.e(153679),o.e(460625),o.e(699093),o.e(480333),o.e(581215),o.e(795962),o.e(2227),o.e(683644),o.e(104500),o.e(368890),o.e(761805),o.e(911192),o.e(460504),o.e(861424)
1]).then(o.bind(o,91877)),{loadableGenerated:{webpack:()=>[91877]}}),om=E()(()=>Promise.all([o.e(991577),o.e(310512),o.e(855310),o.e(297156),o.e(762571),o.e(782474),o.e(235099),o.e(245393),o.e(153679),o.e(480333),o.e(259626),o.e(215238),o.e(795962),o.e(104500),o.e(832990),o.e(349339)]).then(o.bind(o,561020)),{loadableGenerated:{webpack:()=>[561020]}}),o_=E()(()=>Promise.all([o.e(855310),o.e(190110)]).then(o.bind(o,190110)),{loadableGenerated:{webpack:()=>[190110]}}),of=E()(()=>Promise.all([o.e(855310),o.e(991577),o.e(182292),o.e(297156),o.e(762571),o.e(782474),o.e(235099),o.e(245393),o.e(153679),o.e(480333),o.e(259626),o.e(215238),o.e(104500),o.e(334979)]).then(o.bind(o,287377)),{loadableGenerated:{webpack:()=>[287377]}}),oy=E()(()=>o.e(192823).then(o.bind(o,192823)),{loadableGenerated:{webpack:()=>[192823]},loading:()=>(0,d.jsx)("div",{})}),oC=E()(()=>Promise.all([o.e(855310),o.e(486704)]).then(o.bind(o,694022)),{loadableGenerated:{webpack:()=>[694022]}}),oS=e=>{let{children:t,shouldUseContext:o}=e;return o?(0,d.jsx)(tC.eQ,{children:t}):t},oE=e=>[A.j.STANDALONE_ASSESSMENT,A.j.STANDALONE_PROJECT].includes(e),oT=function(e,t,o){var n,i;let r,a,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",d={next:null,previous:null},c=(null==e?void 0:null===(n=e.instance)||void 0===n?void 0:n.details)||{},u=c.author_id,p=c.collection_id,h=(null===(i=c.toc)||void 0===i?void 0:i.categories)||[],{flattenTree:v}=(0,tD.qp)(u,p,h,[],l),g=v.findIndex(e=>{let{id:o}=e;return String(t)===o});if(g<0)return null;let m=g===v.length-1,_=c.page_titles,f=v[g+1],y=v[g-1],C=c.is_plan?j.dL.PLAN:(0,tZ.Z)(s||(null==o?void 0:o.asPath));return C===j.dL.MODULE?(r=String(c.path_author_id),a=String(c.path_id)):(r=String(u),a=String(p)),f&&(d.next={...v[g+1],title:_[Number(f.id)],...(0,tD.FW)(v[g+1].type)?{workType:j.dL.MODULE}:{authorId:u,collectionId:p,workType:C}}),y&&(d.previous={...v[g-1],title:_[Number(y.id)],...(0,tD.FW)(v[g-1].type)?{workType:j.dL.MODULE}:{authorId:u,collectionId:p,workType:C}}),m&&C===j.dL.MODULE&&(d.next={authorId:String(c.next_content_author_id),collectionId:String(c.next_content_collection_id),id:String(c.next_content_id),type:c.next_content_type,title:c.next_content_title,workType:(0,tD.mz)(c.next_content_type)?j.dL.PLAN:j.dL.MODULE}),d.next&&(d.next={...d.next,pathAuthorId:r,pathId:a}),d.previous&&(d.previous={...d.previous,pathAuthorId:r,pathId:a}),d},ox=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=n?e+1:e-1;for(;i<t.length&&i>=0;){var r,a;if(!t[i])return null;if(null===(r=t[i])||void 0===r?void 0:r.is_preview){let e=null===(a=t[i])||void 0===a?void 0:a.id;if(e)return{id:e,title:o[e],showPreviewLink:!0,slug:t[i].slug};return null}n?i++:i--}},oL=(0,b.$j)((e,t)=>{let{userCollectionArticle:o,widgets:n,paths:{moduleCategories:i}}=e,{router:r,sidebarCollapsed:a}=t,l=(0,tz.Z)(r)?null:o,s=n.ids.map(e=>n.entities[e]),d=x.parseUrl(r.asPath).url;return{isSource:l,isVersions:(0,tz.Z)(r),comps:s,pageURL:d,isNonLessonPage:[q.q.ASSESSMENT,q.q.PROJECT,q.q.CLOUD_LAB].includes(r.query.page_type)||!r.query.page_type&&["/assessment","/project","/certificate","/cloudlab"].some(e=>d.endsWith(e)),moduleCategories:i,showSideBar:!a}},(e,t)=>{let{router:o}=t;return{setCollectionCompletion:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{};return(0,Q.NJ)(t,n,o)(e)},reset:function(t,n,i,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e=>{};return(0,Q.fy)(t,n,i,r,a,o)(e)},dispatch:e}});class oN extends c.Component{componentDidMount(){var e,t,o,n,i,r,a,l,s,d,c,u,p,h,v,g,m;(null===(o=this.props.collection)||void 0===o?void 0:null===(t=o.instance)||void 0===t?void 0:null===(e=t.details)||void 0===e?void 0:e.level_one_learner_tags)&&!(0,td.i)(this.props.resolvedPath||this.props.router.asPath)&&(0,Y.h)(null===(m=this.props.collection)||void 0===m?void 0:null===(g=m.instance)||void 0===g?void 0:null===(v=g.details)||void 0===v?void 0:v.level_one_learner_tags).catch(tX.u);let _=parseInt(this.props.router.query.author_id)||(null===(r=this.props.collection)||void 0===r?void 0:null===(i=r.instance)||void 0===i?void 0:null===(n=i.details)||void 0===n?void 0:n.author_id)||this.props.authorId,f=parseInt(this.props.router.query.collectionId)||(null===(s=this.props.collection)||void 0===s?void 0:null===(l=s.instance)||void 0===l?void 0:null===(a=l.details)||void 0===a?void 0:a.collection_id)||this.props.collectionId;(!(null===(d=this.props.userInfoState)||void 0===d?void 0:d.loggedOut)||(null===(c=this.props.userInfoState.data)||void 0===c?void 0:c.user_id
1))&&_&&f&&(0,P._)(_,f).catch(tX.u),(null===(u=this.props.userInfoState.data)||void 0===u?void 0:u.user_id)&&!(null===(p=this.props.userInfoState.data)||void 0===p?void 0:p.viewed_customize_fonts_feedback)&&window.addEventListener("beforeunload",this.onPageUnmount);let{query:y}=this.props.router,{isVersions:C,router:S,collectionActions:E}=this.props,T=this.state.is_draft_page||C,x={...y,is_draft_page:T};T&&(null===(h=S.asPath)||void 0===h?void 0:h.lastIndexOf("/preview"))!==-1&&S.replace(S.asPath.replace("/preview","")),!Object.keys(this.props.collection).length&&Object.keys(y).length?(this.props.dispatch((0,J._)({userInfoState:this.props.userInfoState,params:x,router:S,collectionActions:E,disableAllRedirections:this.props.disableAllRedirections,setLoaderStateDispatch:this.setLoaderStateDispatch,setNotFound:this.setNotFound,resolvedPath:this.props.resolvedPath})).then(()=>{var e,t,o,n,i;let{collection:r,pageProps:a}=this.props;this.purchaseFreeCollection();let l=!!a.page_id||this.props.isNonLessonPage||this.props.pageURL.endsWith("/certificate"),s=(null==r?void 0:null===(e=r.instance)||void 0===e?void 0:e.details.collection_id)||this.props.collectionId,d=(null==r?void 0:null===(t=r.instance)||void 0===t?void 0:t.details.author_id)||this.props.authorId,c=(null==r?void 0:null===(n=r.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.collection_type)||(null===(i=this.props.collectionDetailsSSR)||void 0===i?void 0:i.collection_type);this.loggedInUser()&&d&&s&&l&&c!==j.dL.SKILL_ASSESSMENT&&!(this.state.pageCompletionStatus.completionLoaded||this.state.pageCompletionStatus.completionLoading)&&this.setState(e=>({pageCompletionStatus:{...e.pageCompletionStatus,completionLoading:!0}}),()=>this.props.dispatch((0,Q.Os)({...y,author_id:d,collection_id:s,callback:this.courseCompletionCallback})))}),this.renderArticle=!0):Object.keys(this.props.collection).length&&this.purchaseFreeCollection()}componentDidUpdate(e,t){var o,n,i,r,a,l,s,d,c,u,p,h,v,g,m,_,f,y,C,S,E,T,x,L,N,b,w,O,I,P,k,D,R,U,M,F,Z,q,G,H,B,z,K,X,$,ee,eo,en,ei,er,ea,ed,ec,eu,ep,eh,ev,eg,em,e_,ef,ey,eC,eS,eE,eT,ex,eL,eN,eb,ew,eO,eI,eP,eA,ej,ek;let{collection:eD,userInfoState:eR,router:eU,pageProps:eM,loadingState:eF,isPrivateContent:eZ,collectionActions:eq}=this.props,eW=!!(null===(o=this.props.loadingState)||void 0===o?void 0:o.isLoaded),eG=!!(null===(n=e.loadingState)||void 0===n?void 0:n.isLoaded);((e.router.query.page_id!==this.props.router.query.page_id||e.router.query.page_url_slug!==this.props.router.query.page_url_slug)&&((null===(a=this.props.collection)||void 0===a?void 0:null===(r=a.instance)||void 0===r?void 0:null===(i=r.details)||void 0===i?void 0:i.collection_id)===this.props.router.query.collectionId&&(null===(d=this.props.collection)||void 0===d?void 0:null===(s=d.instance)||void 0===s?void 0:null===(l=s.details)||void 0===l?void 0:l.author_id)===this.props.router.query.authorId||this.props.router.query.course_url_slug===(null===(p=this.props.collection)||void 0===p?void 0:null===(u=p.instance)||void 0===u?void 0:null===(c=u.details)||void 0===c?void 0:c.url_slug))||eG!==eW)&&eW&&(null===(g=this.props.collection)||void 0===g?void 0:null===(v=g.instance)||void 0===v?void 0:null===(h=v.details)||void 0===h?void 0:h.level_one_learner_tags)&&!(0,td.i)(this.props.resolvedPath||this.props.router.asPath)&&(0,Y.h)(null===(ec=this.props.collection)||void 0===ec?void 0:null===(ed=ec.instance)||void 0===ed?void 0:null===(ea=ed.details)||void 0===ea?void 0:ea.level_one_learner_tags).catch(tX.u);let eH=eR.data,eJ=parseInt(eU.query.author_id)||(null==eD?void 0:null===(_=eD.instance)||void 0===_?void 0:null===(m=_.details)||void 0===m?void 0:m.author_id)||this.props.authorId;(null===(f=e.collection.instance)||void 0===f?void 0:f.owned_by_reader)!==(null===(y=eD.instance)||void 0===y?void 0:y.owned_by_reader)&&this.purchaseFreeCollection(),!this.updateOwnerShip||null==eF||!eF.isLoaded||(null==eF?void 0:eF.isLoading)||(null===(C=eD.instance)||void 0===C?void 0:C.owned_by_reader)||(this.updateOwnerShip(),this.updateOwnerShip=null),this.state.lessonLocked&&(e.pageId!==this.props.pageId||(null===(S=this.props.router.query)||void 0===S?void 0:S.pageId)!==(null===(E=e.router.query)||void 0===E?void 0:E.pageId)||(null===(T=this.props.router.query)||void 0===T?void 0:T.page_id)!==(null===(x=e.router.query)||void 0===x?void 0:x.page_id))&&this.setState({lessonLocked:!1});let eB=(0,tZ.Z)(this.props.resolvedPath||(null==eU?void 0:eU.asPath));if(eB===j.dL.COLLECTION&&(null===(N=eD.instance)||void 0===N?void 0:null===(L=N.details)||void 0===L?void 0:L.adaptive_learning_mode)&&e.pageProps.page_id!==eM.page_id&&(null===(w=eD.instance)||void 0===w?void 0:null===(b=w.details)||void 0===b?void 0:b.only_visually_Swapped_toc)&&(0,et.DL)(null===(P=eD.instance)||void 0===P?void 0:null===(I=P.details)||void 0===I?void 0:null===(O=I.adaptive_pathway_info)||void 0===O?void 0:O.in_active_toc,eM.page_id)&&(eq.swapTOC(),(0,et.sr)(String(eJ),String((null==eD?void 0:null===(ep=eD.instance)||void 0===ep?void 0:null===(eu=ep.details)||void 0===eu?void 0:eu.collection_id)||this.props.collectionId))),eM.page_id!==e.pageProps.page_id&&eM.page_id||!!Object.keys(eD).length!=!!Object.keys(e.collection).length&&Object.keys(eD).length||eB===j.dL.COLLECTION&&(null===(k=eD.instance)||void 0===k?void 0:k.details.adaptive_learning_mode)&&((null===(U=e.collection.instance)||void 0===U?void 0:null===(R=U.details)||void 0===R?void 0:null===(D=R.adaptive_pathway_info)||void 0===D?void 0:D.active_toc_mode)!==(null===(Z=eD.instance)||void 0===Z?void 0:null===(F=Z.details)||void 0===F?void 0:null===(M=F.adaptive_pathway_info)||void 0===M?void 0:M.active_toc_mode)||(null===(G=eD.instance)||void 0===G?void 0:null===(q=G.details)||void 0===q?void 0:q.only_visually_Swapped_toc)!==(null===(B=e.collection.instance)||void 0===B?void 0:null===(H=B.details)||void 0===H?void 0:H.only_visually_Swapped_toc))){let e=function(e,t,o,n,i,r){if(!Object.keys(e).length)return null;let a=(null==e?void 0:e.instance)||{},l=a.details||{},s=!(l.is_priced&&l.price&&l.discounted_price),d=l.toc||{},c=l.page_titles||{},u=d.categories||[],p=!!n&&n.user_id===o,h=!1,v=null;a.owned_by_reader||i||!l.is_priced||p||r||(h=!0,v={title:l.title,is_priced:l.is_priced,price:l.price,discounted_price:l.discounted_price,discounted_for_region:l.discounted_for_region||null});let g=u.reduce((e,t)=>
1t.type===A.j.ASSESSMENT||t.type===A.j.PROJECT||t.type===A.j.CLOUD_LAB||t.type===A.j.EXTERNAL_ASSESSMENT||t.type===A.j.EXTERNAL_PROJECT||t.type===A.j.LINKED_CLOUD_LAB||t.type===A.j.LINKED_MOCK_INTERVIEW?e.concat(t):e.concat(t.pages),[]),m=g.findIndex(e=>{let{id:o}=e;return o===t});if(m<0)return null;let _=void 0===g[m].is_lesson||!0===g[m].is_lesson,f=null,y=null;a.owned_by_reader||s||(f=ox(m,g,c,!0),y=ox(m,g,c,!1));let C=null,S=null;return 0===m?(g.length>1&&(C={id:oE(g[m+1].type)?g[m+1].page_id:g[m+1].id,title:c[g[m+1].id]||g[m+1].title,type:g[m+1].type,showPreviewLink:!!h&&!g[m+1].is_preview,author_id:g[m+1].author_id,collection_id:g[m+1].collection_id,slug:g[m+1].slug}),{previous:null,next:f||C,collection_meta:v,is_current_page_lesson:_}):m===g.length-1?(S={id:oE(g[m-1].type)?g[m-1].page_id:g[m-1].id,title:c[g[m-1].id]||g[m-1].title,type:g[m-1].type,showPreviewLink:!!h&&!g[m-1].is_preview,author_id:g[m-1].author_id,collection_id:g[m-1].collection_id,slug:g[m-1].slug},{previous:y||S,next:null,type:g[m].type,collection_meta:v,is_current_page_lesson:_}):{previous:y||{id:oE(g[m-1].type)?g[m-1].page_id:g[m-1].id,title:c[g[m-1].id]||g[m-1].title,type:g[m-1].type,showPreviewLink:!!h&&!g[m-1].is_preview,author_id:g[m-1].author_id,collection_id:g[m-1].collection_id,slug:g[m-1].slug},next:f||{id:oE(g[m+1].type)?g[m+1].page_id:g[m+1].id,title:c[g[m+1].id]||g[m+1].title,type:g[m+1].type,showPreviewLink:!!h&&!g[m+1].is_preview,author_id:g[m+1].author_id,collection_id:g[m+1].collection_id,slug:g[m+1].slug},collection_meta:v,is_current_page_lesson:_}}(eD,eM.page_id,eJ,eH,this.state.is_draft_page,this.props.isVersions);this.setState({previousNextArticles:e,...eZ?{enterprisePreviousNextContent:oT(eD,eM.page_id,eU,!!(null===(eh=this.getPlanInfo())||void 0===eh?void 0:eh.isPlanModule),this.props.resolvedPath)}:{}})}let{query:eV}=this.props.router,ez=(null==eD?void 0:null===(K=eD.instance)||void 0===K?void 0:null===(z=K.details)||void 0===z?void 0:z.collection_id)||this.props.collectionId,eK=(null===(ee=this.props.collection)||void 0===ee?void 0:null===($=ee.instance)||void 0===$?void 0:null===(X=$.details)||void 0===X?void 0:X.collection_type)||(null===(eo=this.props.collectionDetailsSSR)||void 0===eo?void 0:eo.collection_type);this.loggedInUser()&&eJ&&ez&&((null===(en=e.userInfoState.data)||void 0===en?void 0:en.user_id
1)!==(null==eH?void 0:eH.user_id)||eM.page_id!==e.pageProps.page_id)&&eM.page_id&&eK!==j.dL.SKILL_ASSESSMENT&&!this.state.pageCompletionStatus.completionLoading&&this.setState(e=>({pageCompletionStatus:{...e.pageCompletionStatus,completionLoading:!0,completionLoaded:!1}}),()=>this.props.dispatch((0,Q.Os)({...eV,author_id:eJ,collection_id:ez,callback:this.courseCompletionCallback})));let eY={...eV,is_draft_page:this.state.is_draft_page||this.props.isVersions},eQ=null===(er=this.props.collection)||void 0===er?void 0:null===(ei=er.instance)||void 0===ei?void 0:ei.details,eX=eV.courseUrlSlug?(null==eQ?void 0:eQ.url_slug)!==eV.courseUrlSlug:(null==eQ?void 0:eQ.author_id)!==eV.authorId||(null==eQ?void 0:eQ.collection_id)!==eV.collectionId,e$=eQ&&eX;Object.keys(e.collection).length>0&&0===Object.keys(this.props.collection).length&&Object.keys(eV).length?(this.props.dispatch((0,J._)({userInfoState:eR,params:eY,router:eU,collectionActions:eq,disableAllRedirections:this.props.disableAllRedirections,setLoaderStateDispatch:this.setLoaderStateDispatch,setNotFound:this.setNotFound,resolvedPath:this.props.resolvedPath})).then(()=>{var e,t,o,n,i;let{collection:r}=this.props,a=(null==r?void 0:null===(e=r.instance)||void 0===e?void 0:e.details.collection_id)||this.props.collectionId,l=(null==r?void 0:null===(t=r.instance)||void 0===t?void 0:t.details.author_id)||this.props.authorId,s=(null==r?void 0:null===(n=r.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.collection_type)||(null===(i=this.props.collectionDetailsSSR)||void 0===i?void 0:i.collection_type);this.loggedInUser()&&l&&a&&(this.props.isNonLessonPage||this.props.pageURL.endsWith("/certificate"))&&s!==j.dL.SKILL_ASSESSMENT&&!(this.state.pageCompletionStatus.completionLoaded||this.state.pageCompletionStatus.completionLoading)&&this.setState(e=>({pageCompletionStatus:{...e.pageCompletionStatus,completionLoading:!0}}),()=>this.props.dispatch((0,Q.Os)({...eV,author_id:l,collection_id:a,callback:this.courseCompletionCallback})))}),this.renderArticle=!0):e$&&this.props.dispatch((0,V.l)(this.setLoaderStateDispatch,this.props.collectionActions));let e0=null==eQ?void 0:eQ.url_slug,e1=!!(null==eQ?void 0:eQ.is_global)||eV.encodedPathInfo&&!!(null==eQ?void 0:eQ.is_standalone_module),e2=this.props.resolvedPath||this.props.router.asPath,e4=(0,td.M)(e2)&&W.u.slice(0,3).some(e=>e2.includes(e)),e3=String(null==eQ?void 0:eQ.path_author_id),e5=String(null==eQ?void 0:eQ.path_id),e9=!this.props.moduleCategories.loaded&&!this.props.moduleCategories.loading;if(Object.keys(this.props.collection).length>0&&e9&&(String(ez)===this.props.router.query.collection_id&&String(eJ)===this.props.router.query.author_id||e0===this.props.router.query.course_url_slug)&&(e1||e4)&&eV.encodedPathInfo&&this.props.dispatch(tb.W.load(e3,e5,!1,!1,null)),(0,es.t)(this.props.userGamificationContext)!==(0,es.t)(e.userGamificationContext)&&(0,es.t)(this.props.userGamificationContext)){let{previousNextArticles:e,userGamificationProperties:{completionCallBack:t,workCompleted:o}}=this.state,{userGamificationFeatureFlag:n,isPath:i,pathType:r}=this.props,a=(0,es.E)({userGamificationContext:this.props.userGamificationContext,userInfo:eH,isLastTask:!(null==e?void 0:e.next),userGamificationFeatureFlag:isNaN(Number(n))?0:Number(n),isWorkCompleted:o,workType:i?eZ?j.dL.PRIVATE_PATH:"path_".concat(r):null==eD?void 0:null===(eg=eD.instance)||void 0===eg?void 0:null===(ev=eg.details)||void 0===ev?void 0:ev.work_type,callBack:t,isCourse:!0,dispatch:this.props.dispatch});this.setState({userGamificationProperties:{...this.state.userGamificationProperties,showStreakToast:a,workCompleted:!1}})}if(t.workCompleted!==this.state.workCompleted&&this.state.workCompleted){this.updateUserAttendance();let e=null===(em=this.props.userGamificationContext.value.data)||void 0===em?void 0:em.userGamification,t=String(null!==(eA=this.props.pageId)&&void 0!==eA?eA:(null===(e_=this.props.router)||void 0===e_?void 0:e_.query.pageId)||(null===(ef=this.props.router)||void 0===ef?void 0:ef.query.page_id));this.props.dispatch(e8.n.show(tl.fL,{title:(null===(ey=this.props.meta)||void 0===ey?void 0:ey.title)||"",url:(0,tM.l4)().toString()+this.props.router.asPath,authorId:eJ,collectionId:ez,pathId:null!==(ej=null===(eE=this.props.collection)||void 0===eE?void 0:null===(eS=eE.instance)||void 0===eS?void 0:null===(eC=eS.details)||void 0===eC?void 0:eC.path_id)&&void 0!==ej?ej:null===(eL=this.props.collection)||void 0===eL?void 0:null===(ex=eL.instance)||void 0===ex?void 0:null===(eT=ex.details)||void 0===eT?void 0:eT.collection_id,pathAuthorId:null!==(ek=null===(ew=this.props.collection)||void 0===ew?void 0:null===(eb=ew.instance)||void 0===eb?void 0:null===(eN=eb.details)||void 0===eN?void 0:eN.path_author_id)&&void 0!==ek?ek:null===(eP=this.props.collection)||void 0===eP?void 0:null===(eI=eP.instance)||void 0===eI?void 0:null===(eO=eI.details)||void 0===eO?void 0:eO.author_id,workType:this.getContentType(eQ||this.props.collectionDetail
1sSSR,eU),pageId:t,callback:()=>{var t;(null==e?void 0:null===(t=e.userStreak)||void 0===t?void 0:t.streakIncremented)&&this.setState({userGamificationProperties:{...this.state.userGamificationProperties,showStreakToast:!0,streakToastType:el.rS.CURRENT_LESSON}})},progressStatus:100})),this.state.userGamificationProperties.completionCallBack||this.setState({workCompleted:!1})}}componentWillUnmount(){var e,t;(null===(e=this.props.userInfoState.data)||void 0===e?void 0:e.user_id)&&!(null===(t=this.props.userInfoState.data)||void 0===t?void 0:t.viewed_customize_fonts_feedback)&&window.removeEventListener("beforeunload",this.onPageUnmount),this.setLoaderStateDispatch({isLoading:!1,isLoaded:!1,isError:!1}),this.props.authorConceptsClear(),this.props.bannerActions.hide(u.ZP.DEPRECATED_CONTENT_BANNER),(0,td.i)(this.props.resolvedPath||this.props.router.asPath)&&this.props.dispatch(tb.W.clear())}getFetchPageAction(){return this.props.isVersions?this.props.loadCollectionArticle:(e,t)=>tO.m.load(e,t,this.props.abortControllerFetch)}render(){var e,t,o,n,i,r,a,l,s,u,p,h,v,g,m,_,y,S,E,T,x,L,N,b,w,I,P,A,k,D,R,U,M,Z,W,J,B,V,z,K,Y,X,$,et,en,er,ea,es;let{isVersions:ed,isMobileAgent:ec,isNewOnboardingEditor:eu,isPrivateContent:ep}=this.props,{markAsCompleteLoading:eh,enterprisePreviousNextContent:ev,previousNextArticles:eg,pageCompletionStatus:em,resetCourseCompletionLoading:e_}=this.state,{collection:ef,userInfoState:ey,showSideBar:eC,snapshotProperties:eS,snapshotPropertiesLoading:eE,snapshotPropertiesLoaded:eT,pageURL:ex,router:eL,lessonContent:eN,pageProps:eb,pageSummarySSR:ew,collectionDetailsSSR:eO,pageTocSSR:eI,enableStandaloneCloudLabHomepage:eP,enableCloudLabsB2BUpsell:eA,meta:ej}=this.props,ek=ey.data,eD=ey.loaded,eR=ey.loggedOut,{query:eU}=eL,eM=ex.endsWith("/mock-interview")||ex.endsWith("/coaching-session"),eF=(0,td.i)(this.props.resolvedPath||eL.asPath,!0,!0),eZ=(0,td.M)(this.props.resolvedPath||eL.asPath),eq=eZ&&eM,eW=ex.endsWith("/project"),eG=eZ&&eW,eH=ex.endsWith("/assessment"),eJ=eZ&&eH,eB=ex.endsWith("/cloudlab"),eV=eZ&&eB,ez=eG||eJ||eV,eK=eL.asPath.startsWith("/courses/")&&eH,eY=eb.author_id||parseInt(null==eU?void 0:eU.authorId),eQ=eb.collection_id||parseInt(null==eU?void 0:eU.collectionId),eX=parseInt(null==eU?void 0:eU.pageId)||parseInt(null==eU?void 0:eU.page_id)||eb.page_id,e$=(null==ef?void 0:null===(e=ef.instance)||void 0===e?void 0:e.details)||eO||{},e0=this.getContentType(e$,eL),e1=e$.CodeThemes,e4=null==ef?void 0:null===(t=ef.instance)||void 0===t?void 0:t.owned_by_reader,e3=e1?{Code:null===(o=e$.CodeThemes)||void 0===o?void 0:o.Code,Markdown:null===(n=e$.CodeThemes)||void 0===n?void 0:n.Markdown,RunJS:null===(i=e$.CodeThemes)||void 0===i?void 0:i.RunJS,SPA:null===(r=e$.CodeThemes)||void 0===r?void 0:r.SPA,isForced:null!==(es=null===(a=e$.CodeThemes)||void 0===a?void 0:a.isForced)&&void 0!==es?es:tr.Z}:{},e9=(null===(l=e$.toc)||void 0===l?void 0:l.categories)||[],e6=(0,tD.QO)(e9).mandatoryLessons,e8=!eU.encodedPathInfo&&!!(null==ef?void 0:null===(u=ef.instance)||void 0===u?void 0:null===(s=u.details)||void 0===s?void 0:s.is_standalone_module),e7="review"===(null==ef?void 0:null===(h=ef.instance)||void 0===h?void 0:null===(p=h.details)||void 0===p?void 0:p.collaboration_mode),te={metaData:null===(v=this.props.ssrContent)||void 0===v?void 0:v.metaData,collection:null===(g=this.props.ssrContent)||void 0===g?void 0:g.collection,cloudLab:null===(m=this.props.ssrContent)||void 0===m?void 0:m.cloudLab,enableStandaloneCloudLab:null===(_=this.props.ssrContent)||void 0===_?void 0:_.enableStandaloneCloudLab,enableCloudLabsB2BUpsell:null===(y=this.props.ssrContent)||void 0===y?void 0:y.enableCloudLabsB2BUpsellSsr,faqStatus:null===(S=this.props.ssrContent)||void 0===S?void 0:S.faqStatus,faqSet:null===(E=this.props.ssrContent)||void 0===E?void 0:E.faqSet,collectionTestimonials:null===(T=this.props.ssrContent)||void 0===T?void 0:T.collectionTestimonials},tt=eP||te.enableStandaloneCloudLab,to=isNaN(Number(tt))?0:Number(tt),tn=!!(null==ek?void 0:null===(x=ek.email)||void 0===x?void 0:x.endsWith("educative.io")),ta=(0,tU.s)(ek),tl=!!(0,tR.mg)(ek,tR.e2.CAN_ACCESS_CLOUDLABS),{percentCompleted:ts}=(0,tk.ZP)(e6,(null===(L=this.props.courseCompletion)||void 0===L?void 0:L["CourseCompletion_".concat(eb.author_id,"_").concat(eb.collection_id)])||{}),tc=this.getPlanInfo(),tu=null===(N=e$.page_titles)||void 0===N?void 0:N[null==eX?void 0:eX.toString()],tg={canToggleSidebar:!0,fetchPageAction:this.getFetchPageAction(),clearPageAction:this.clearPageAction(),previousNextArticles:eg&&{...eg,setCompletion:this.setPageCompletionStatus,manageCompletion:this.manageCompletion,...em},enterprisePreviousNextContent:ev,default_themes:e3,collapsed:eC,pageTitle:tu,logWidgetInteraction:this.logWidgetInteraction,collectionSideBarVisible:eC,isInReviewerMode:e7,buyCertificate:this.buyCertificateLocal,handleClaimCertificate:this.handleClaimCertificateLocal,onNotesClick:this.onNotesClick,navigateToHighlight:e=>
1{(0,tI.Gj)(eU,e),delete eU.scrollParams},handleSaveWidgetUserData:this.handleSaveWidgetUserData,planInfo:tc,lessonContent:eN,pageSummarySSR:ew,collectionDetailsSSR:eO,pageTocSSR:eI},tm=this.props.resolvedPath||(null==eL?void 0:eL.asPath),t_=(eL.asPath.startsWith("/modules/page")||eL.asPath.startsWith("/module/page")||eL.asPath.startsWith("/plan/page"))&&eL.asPath.endsWith("/template"),tf=new C.Z,ty=null;try{ty=[j.dL.PATH,j.dL.MODULE].includes(e$.work_type)&&!(0,td.i)(tm)&&this.getPathShot(e9,eU.page_url_slug&&!ex.endsWith("/certificate")?tf.decode(String(eU.page_url_slug))[0].toString():eX)}catch(e){(0,tX.u)(Error("Invalid Page Slug for Non-Courses: "),{workType:e$.work_type,pageSlug:eU.page_url_slug})}if(!(this.props.isStandaloneCloudLab&&Object.keys(te.cloudLab||{}).length||this.props.isStandaloneProject||(null==eN?void 0:null===(b=eN.content)||void 0===b?void 0:b.length))&&(!Object.keys(ef).length||!this.renderArticle))return null;let tC=e$.is_priced,tS=(null==ef?void 0:null===(w=ef.instance)||void 0===w?void 0:w.owned_by_reader)&&!this.state.lessonLocked,tT=eD&&Number(null==ek?void 0:ek.user_id)===eY,tL=(0,tZ.Z)(tm);if((null==ej?void 0:ej.noIndex)&&!(null==ej?void 0:ej.isForcedNoIndex)&&tL===j.dL.COLLECTION&&(eD||eR)&&!(tn||tT))return(0,d.jsx)("div",{className:"ed-grid-main",children:(0,d.jsx)(oC,{})});let tb=tg.pageTitle;eT?tb=(null==eS?void 0:eS.title)||"":eE&&(tb="");let tw=e$.collection_type||(null===(k=this.props.ssrContent)||void 0===k?void 0:null===(A=k.collection)||void 0===A?void 0:null===(P=A.instance)||void 0===P?void 0:null===(I=P.details)||void 0===I?void 0:I.collection_type),tO=e9.some(e=>e.pages.some(e=>(eX?e.id===eX:(e.slug||tf.encode(e.id))===eU.page_url_slug)&&e.is_preview)),tA=e9.some(e=>e.pages.some(e=>(eX?e.id===eX:(e.slug||tf.encode(e.id))===eU.page_url_slug)&&e.is_intro_blog)),tM=tL===j.dL.PATH&&e9.some(e=>[G.R.PATH_EXTERNAL_ASSESSMENT,G.R.PATH_EXTERNAL_PROJECT].includes(e.type));eM||ez||(0,tP.Wc)(this.props,!0);let tF=!!(null===(D=this.props.loadingState)||void 0===D?void 0:D.isLoaded),tq={...this.props,...tg,updateCollectionProgressCallback:()=>{let{query:e}=this.props.router;this.loggedInUser()&&this.props.dispatch((0,Q.Os)({...e,author_id:eY,collection_id:eQ,callback:this.courseCompletionCallback}))},isCollectionPriced:tC,isCollectionOwnedByReader:tS,isCollectionOwnedByAuthor:tT,contentType:e0,completionLoaded:null===(R=this.state.pageCompletionStatus)||void 0===R?void 0:R.completionLoaded,collectionLoaded:tF,updateNextButtonPageIdClicked:this.updateNextButtonPageIdClicked,nextButtonPageIdClicked:this.state.nextButtonPageIdClicked,updateHloDetails:this.updateHloDetails,hloDetails:this.state.hloDetails,isLessonSignUpWalled:null===(U=this.props.ssrContent)||void 0===U?void 0:U.isLessonSignUpWalled,isLessonPayWalled:null===(M=this.props.ssrContent)||void 0===M?void 0:M.isLessonPayWalled,onAdaptiveOnboardTourConfirm:this.onAdaptiveOnboardTourConfirm,onAdaptiveOnboardTourSeenInteraction:this.onAdaptiveOnboardTourSeenInteraction,setIsLockedLesson:this.props.setIsLockedLesson},tW={metaData:null===(Z=this.props.ssrContent)||void 0===Z?void 0:Z.metaData,collection:null===(W=this.props.ssrContent)||void 0===W?void 0:W.collection,project:null===(J=this.props.ssrContent)||void 0===J?void 0:J.project,projectSubTypesEnabled:null===(B=this.props.ssrContent)||void 0===B?void 0:B.projectSubTypesEnabled,faqStatus:null===(V=this.props.ssrContent)||void 0===V?void 0:V.faqStatus,faqSet:null===(z=this.props.ssrContent)||void 0===z?void 0:z.faqSet,collectionTestimonials:null===(K=this.props.ssrContent)||void 0===K?void 0:K.collectionTestimonials},tG=eA||te.enableCloudLabsB2BUpsell,tH={pageId:this.props.pageId,adaptivePageId:eX,contentLoading:null===(Y=this.props.pageData)||void 0===Y?void 0:Y.loading,isInReviewerMode:e7,markAsCompleteLoading:eh,resetCourseCompletionLoading:e_,resetCollectionCompletionStatus:this.resetCollectionCompletionStatus,setCollectionCompletionStatus:this.setCollectionCompletionStatus,useModularTypescale:!0,collectionDetailsSSR:eO,updateNextButtonPageIdClicked:this.updateNextButtonPageIdClicked,hloDetails:this.state.hloDetails,updateHloDetails:this.updateHloDetails,ltcPathwayWallsInfo:null===(X=this.props.ssrContent)||void 0===X?void 0:X.ltcPathwayWallsInfo,isL2CPathway:this.props.isL2CPathway,showPreviousModule:this.props.showPreviousModule,currentStep:this.props.currentStep,isTourOpen:this.props.isTourOpen,endTour:this.props.endTour,onAdaptiveOnboardTourSeenInteraction:this.onAdaptiveOnboardTourSeenInteraction,adaptiveLearningConfigConstantSSR:this.props.adaptiveLearningConfigConstantSSR,isMockInterview:eM,isPALSpecialModule:ez,isMinimapEnabled:this.props.isMinimapEnabled};return(0,d.jsx)(tx.ZP,{children:(0,d.jsxs)(tN.ZP,{children:[!this.props.isSplitView&&!t_&&!tM&&!ec&&
1!tc.isPlanLesson&&!tc.isPlanModule&&!eL.query.menteeId&&!ep&&!(0,tj.VF)(tw)&&!eu&&!(tA&&!this.props.isMobile)&&(eF&&eM?(0,d.jsx)(ov,{interviewPrepProps:this.props.interviewPrepProps}):(0,d.jsx)(oi,{...tH})),(0,d.jsxs)("main",{className:"learner-mode ed-grid-main ".concat((null===($=this.props)||void 0===$?void 0:$.isSplitView)?tY.k:tK.Vl," ").concat((null===(et=this.props)||void 0===et?void 0:et.isSplitView)?"h-auto min-h-full":""),children:[(this.props.isMinimapForCoursesEnabled&&(eG||eJ||eq)||this.props.isMinimapForNonPalCoursesEnabled&&eK)&&(0,d.jsx)(f,{}),(0,d.jsxs)("div",{id:"view-collection-article-content-root",className:"relative flex flex-1 flex-col ".concat(eG||eJ||eV||eK||eq?"overflow-y-auto":"overflow-hidden"),style:{minWidth:"1px"},children:[this.state.userGamificationProperties.showStreakToast&&(0,d.jsx)(oa,{lessonsVisited:this.state.lessonsVisited,toastType:this.state.userGamificationProperties.streakToastType,onClose:()=>{this.setState({userGamificationProperties:{showStreakToast:!1,workCompleted:!1,streakToastType:el.rS.NONE,completionCallBack:null}})}}),ty?(0,d.jsx)(th.ZP,{children:(0,d.jsx)(tv.ZP,{children:(0,d.jsx)(tE.Z,{children:(0,c.createElement)(of,{...tg,key:eL.asPath,collection:ef,pathType:this.props.pathType,userApiKeys:this.props.userApiKeys,ssrContent:this.props.ssrContent,moduleCategories:this.props.moduleCategories,shotId:ty.page_id,shotUrl:ty.url,authorId:eY,collectionId:eQ,pageId:eX,workType:tL,isCollectionPriced:tC,isCollectionOwnedByReader:tS,isCollectionOwnedByAuthor:tT,percentCompleted:ts,widgetsData:this.props.widgetsData,handleTimer:this.handleTimer,customizeFontCountdown:this.customizeFontCountdown,lessonsVisited:this.state.lessonsVisited,updateLessonsVisited:this.updateLessonsVisited,contentType:e0})})})}):eG?(0,c.createElement)(ou,{...this.props,...tg,key:eL.asPath}):eJ?(0,c.createElement)(od,{...this.props,...tg,key:eL.asPath,mode:"view",useModularTypescale:!0}):eM?(0,c.createElement)(og,{...this.props,...tg,key:eL.asPath}):eL.query.page_type===q.q.ASSESSMENT||!eL.query.page_type&&ex.endsWith("/assessment")||this.props.isSkillAssessment?(0,c.createElement)(oc,{...this.props,...tg,key:eL.asPath,mode:"view",useModularTypescale:!0}):eL.query.page_type===q.q.PROJECT||!eL.query.page_type&&ex.endsWith("/project")||this.props.isStandaloneProject?(0,d.jsx)(e5.ZP,{children:(0,c.createElement)(op,{...this.props,...tg,key:eL.asPath,ssrContent:tW,mode:"view",useModularTypescale:!0,isExternalContent:this.props.isExternalContent,setPageCompletion:this.setPageCompletionStatus})}):(eL.query.page_type===q.q.CLOUD_LAB||!eL.query.page_type&&ex.endsWith("/cloudlab")||this.props.isStandaloneCloudLab)&&(!eD||(0,F.S)(tn,ta,to,O.iw.IS_B2B,tl,tG,eR))&&tw===j.dL.STANDALONE_CLOUD_LAB?(0,d.jsx)(e2.ZP,{children:(0,d.jsx)(oh,{ssrContent:te})}):(eL.query.page_type===q.q.CLOUD_LAB||!eL.query.page_type&&ex.endsWith("/cloudlab"))&&tw===j.dL.STANDALONE_CLOUD_LAB&&ta&&!tl&&!tG&&tF&&!e4?(0,d.jsx)(oC,{heading:"Cloud Lab is not included in your subscription.",message:"Please contact us at ".concat(O.iw.IS_B2B?"[email protected]":"[email protected]")}):(eL.query.page_type===q.q.CLOUD_LAB||!eL.query.page_type&&ex.endsWith("/cloudlab"))&&tw===j.dL.STANDALONE_CLOUD_LAB&&O.iw.IS_B2B?(0,d.jsx)(oC,{heading:"Page not found!"}):eL.query.page_type===q.q.CLOUD_LAB||!eL.query.page_type&&ex.endsWith("/cloudlab")||eV?(0,d.jsx)(e2.ZP,{children:(0,d.jsx)(om,{isExternalContent:this.props.isExternalContent,setPageCompletion:this.setPageCompletionStatus,pageId:this.props.pageId})}):ex.endsWith("/certificate")?(0,d.jsx)(o_,{...this.props,...tg,percentCompleted:ts}):(0,tz.Z)(eL)?(0,c.createElement)(ol,{...tq,key:eL.asPath,pageTitle:tb,percentCompleted:ts,showVersionHistory:!0,isTemplateView:t_,handleTimer:this.handleTimer,customizeFontCountdown:this.customizeFontCountdown,lessonsCompleted:this.state.lessonsCompleted,lessonsVisited:this.state.lessonsVisited,updateLessonsVisited:this.updateLessonsVisited,isIntroBlog:tA}):!tS&&!tO&&tC&&["/modules/page/[authorId]/[collectionId]/[pageId]","/plan/page/[authorId]/[collectionId]/[pageId]"].includes(eL.pathname)?(0,c.createElement)(os,{...this.props,...tg,key:eL.asPath,isCollectionPriced:tC,isCollectionOwnedByReader:tS,isCollectionOwnedByAuthor:tT,isStandaloneModule:e8,purchasingFreeCollection:this.state.purchasingFreeCollection,contentWidth:null===(en=this.props.readerPreferences)||void 0===en?void 0:en.contentWidth,contentType:e0}):!tS&&!tO&&tC&&["/collection/page/[authorId]/[collectionId]/[pageId]","/collection/page/lta/[authorId]/[collectionId]/[pageId]","/courses/[courseUrlSlug]/[pageUrlSlug]","/courses/lta/[courseUrlSlug]/[pageUrlSlug]","/path/page/[authorId]/[collectionId]/[pageId]","/path/lesson/[courseUrlSlug]/[pageUrlSlug]","/module/page/[encodedPathInfo]/[authorId]/[collectionId]/[pageId]","/interview-prep/encodedPath/[encodedPathInfo]/[authorId]/[collectionId]/[pageId]","/pal/encodedPath/[encodedPathInfo]/[authorId]/[collectionId]/[pageId]","/module/lesson/[courseUrlSlug]/[pageUrlSlug]","/interview-prep/[pathUrlSlug]/[pageUrlSlug]","/pal/[pathUrlSlug]/[pageUrlSlug]"].includes(eL.pathname)?(0,c.createElement)(ol,{...tq,key:eL.asPath,mode:"view",percentCompleted:null,isStandaloneModule:!1,useModularTypescale:!0,isTemplateView:!1,customizeFontCountdown:null,lockedLesson:!0,purchasingFreeCollection:this.state.purchasingFreeCollection,isPreviewableLesson:tO,isIntroBlog:tA,ask
1ForSignup:this.isAskForSignup()}):["/collection/page/[authorId]/[collectionId]/[pageId]","/collection/page/lta/[authorId]/[collectionId]/[pageId]","/courses/[courseUrlSlug]/[pageUrlSlug]","/courses/lta/[courseUrlSlug]/[pageUrlSlug]","/path/page/[authorId]/[collectionId]/[pageId]","/path/lesson/[courseUrlSlug]/[pageUrlSlug]","/module/page/[encodedPathInfo]/[authorId]/[collectionId]/[pageId]","/interview-prep/encodedPath/[encodedPathInfo]/[authorId]/[collectionId]/[pageId]","/pal/encodedPath/[encodedPathInfo]/[authorId]/[collectionId]/[pageId]","/interview-prep/[pathUrlSlug]/[pageUrlSlug]","/pal/[pathUrlSlug]/[pageUrlSlug]","/module/lesson/[courseUrlSlug]/[pageUrlSlug]","/modules/page/[authorId]/[collectionId]/[pageId]","/plan/page/[authorId]/[collectionId]/[pageId]","/plan/[planAuthorId]/[planId]/preview","/module/standalone/[moduleAuthorId]/[moduleId]/draft","/[marketingPageUrl]/[guidePageUrl]","/daily-coding-challenge"].includes(eL.pathname)&&(0,d.jsx)(tp.ZP,{children:(0,c.createElement)(ol,{...tq,key:eL.asPath,mode:"view",percentCompleted:ts,isStandaloneModule:e8,useModularTypescale:!0,isTemplateView:t_,handleTimer:this.handleTimer,customizeFontCountdown:this.customizeFontCountdown,lessonsCompleted:this.state.lessonsCompleted,lessonsVisited:this.state.lessonsVisited,updateLessonsVisited:this.updateLessonsVisited,askForSignup:this.isAskForSignup(),isPreviewableLesson:tO,isIntroBlog:tA,setLessonAsLocked:()=>this.setState({lessonLocked:!0})})})]}),ed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(oy,{}),(0,d.jsx)(ti,{authorId:parseInt(String(eY),10),collectionId:parseInt(String(eQ),10),pageId:this.props.pageProps.page_id,documentType:q.q.COLLECTION_LESSON,workType:null==ef?void 0:null===(ea=ef.instance)||void 0===ea?void 0:null===(er=ea.details)||void 0===er?void 0:er.work_type})]})]}),this.props.isTourOpen&&(0,d.jsx)(ei.Z,{disableDotsNavigation:!1,steps:ee.Z,params:{onTourSeen:()=>{this.onAdaptiveOnboardTourSeenInteraction(),(0,eo.P)(()=>(0,H.Z)("AIAdaptiveLearning","AdaptiveTourClosed","",null,{url:"educative.io/collection/".concat(this.props.pageProps.author_id||this.props.authorId,"/").concat(this.props.pageProps.collection_id||this.props.collectionId)}))}},maskClassName:"p-0"})]})})}constructor(...e){var t;super(...e),t=this,this.state={is_draft_page:!1,previousNextArticles:null,pageCompletionStatus:{completionLoaded:!1,completionLoading:!1,completionStatus:{},markAsCompleted:{},showCompletingLoader:!1,previousPercentCompleted:0},page_id:null,mobileViewToggle:!1,markAsCompleteLoading:!1,resetCourseCompletionLoading:!1,enterprisePreviousNextContent:null,purchasingFreeCollection:!1,lessonsVisited:0,lessonsCompleted:0,workCompleted:!1,lessonLocked:!1,userGamificationProperties:{completionCallBack:null,streakToastType:el.rS.NONE,showStreakToast:!1,workCompleted:!1},nextButtonPageIdClicked:null,hloDetails:et.Cv},this.defaultCustomizeFontCountdown=1200,this.customizeFontCountdown=this.defaultCustomizeFontCountdown,this.timerId=null,this.customizeFontCountdownStartTime=new Date,this.renderArticle=!1,this.setNotFound=e=>{this.props.setNotFound(e)},this.setLoaderStateDispatch=e=>{this.props.setLoaderStateDispatch(e)},this.handleTimer=()=>{this.props.cookies.get("customizeFontCountdown")?0>=this.props.cookies.get("customizeFontCountdown")&&this.props.cookies.set("customizeFontCountdown",this.defaultCustomizeFontCountdown,{path:"/"}):this.props.cookies.set("customizeFontCountdown",this.defaultCustomizeFontCountdown,{path:"/"});let e=this.props.cookies.get("customizeFontCountdown");if(this.customizeFontCountdown=e,e>0){this.customizeFontCountdownStartTime=new Date;let t=setTimeout(()=>{this.props.cookies.get("viewed_customize_fonts_feedback")||(this.customizeFontCountdown=0,this.props.cookies.set("viewed_customize_fonts_feedback",!0))},1e3*e);this.timerId=t}},this.calculatePercentage=()=>{var e,t,o,n,i,r,a,l;let{collection:s,router:d}=this.props,c=parseInt(d.query.author_id)||(null==s?void 0:null===(t=s.instance)||void 0===t?void 0:null===(e=t.details)||void 0===e?void 0:e.author_id)||this.props.authorId,u=(null==s?void 0:null===(n=s.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.collection_id)||this.props.collectionId,p=(null===(i=this.props.courseCompletion)||void 0===i?void 0:i["CourseCompletion_".concat(c,"_").concat(u)])||{},h=null===(l=this.props.collection)||void 0===l?void 0:null===(a=l.instance)||void 0===a?void 0:null===(r=a.details.toc)||void 0===r?void 0:r.categories,{mandatoryCloudlabs:v,mandatoryLessons:g,mandatoryProjects:m}=(0,tD.QO)(h,this.props.isPrivateContent);return(0,tk.ZP)(g,p,v,m).percentCompleted},this.courseCompletionCallback=function(){var e,o,n,i,r;let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{collection:l,pageProps:s}=t.props,d=null==l?void 0:null===(o=l.instance)||void 0===o?void 0:null===(e=o.details)||void 0===e?void 0:e.collection_id,c=null==l?void 0:null===(i=l.instance)||void 0===i?void 0:null===(n=i.details)||void 0===n?void 0:n.author_id,u=t.getPlanInfo(),p=null!==(r=null==a?void 0:a["CourseCompletion_".concat(c,"_").concat(d)])&&void 0!==r?r:t.setFakeLessons();t.setState(e=>({pageCompletionStatus:{markAsCompleted:{...e.pageCompletionStatus.markAsCompleted,[s.page_id]:!((null==u?void 0:u.isPlanLesson)||(null==u?void 0:u.isPlanModule))||t.getPageCompletionStatus(p)===ta.Z.LESSON_COMPLETED},completionStatus:{...e.pageCompletionStatus.completionStatus,[s.page_id]:t.getPageCompletionStatus(p)},previousPercentCompleted:t.calculatePercentage(),completionLoaded:!0,completionLoading:!1,showCompletingLoader:!1}}))},this.getPrivatePathTOC=e=>{var t;return e&&1===e.length&&e[0].type===A.j.COLLECTION_CATEGORY&&"__default"===e[0].title?null===(t=e[0])||void 0===t?void 0:t.pages:e},this.updateLessonsVisited=()=>{this.setState(e=>({lessonsVisited:e.lessonsVisited+1}))},this.manageCompletion=e=>{var t,o,n,i,r,a,l,s,d,c,u,p,h,v,g,m,_,f,y,C,S,E,T,x,L,N,b,w,O,I,P,A;let{loaderValue:k,onlyLoader:D=!1,onlyMarkAsCompleted:R=!1,pageId:U}=e;U&&this.setState(e=>{var t;
1let o=null===(t=e.pageCompletionStatus.markAsCompleted)||void 0===t?void 0:t[U];return{pageCompletionStatus:{...e.pageCompletionStatus,showCompletingLoader:k,...D?R?{markAsCompleted:{...e.pageCompletionStatus.markAsCompleted,[U]:!o},previousPercentCompleted:this.calculatePercentage()}:{}:{markAsCompleted:{...e.pageCompletionStatus.markAsCompleted,[U]:!o},completionStatus:{...e.pageCompletionStatus.completionStatus,[U]:o?ta.Z.LESSON_IN_PROGRESS:ta.Z.LESSON_COMPLETED},previousPercentCompleted:this.calculatePercentage()}}}});let M=this.calculatePercentage(),F=(null===(o=this.props.collection)||void 0===o?void 0:null===(t=o.instance)||void 0===t?void 0:t.details.collection_type)===j.dL.COLLECTION,Z=null===(r=this.props.collection)||void 0===r?void 0:null===(i=r.instance)||void 0===i?void 0:null===(n=i.details.toc)||void 0===n?void 0:n.categories,{previousPercentCompleted:q}=this.state.pageCompletionStatus,W=(null==Z?void 0:Z.length)>10?[70,30]:[50],G=M<100&&W.find(e=>q<e&&M>=e)||0;if(F&&G){let e=null===(a=this.props.userGamificationContext.value.data)||void 0===a?void 0:a.userGamification,{collection:t,router:o}=this.props,n=parseInt(o.query.author_id)||(null==t?void 0:null===(s=t.instance)||void 0===s?void 0:null===(l=s.details)||void 0===l?void 0:l.author_id)||this.props.authorId,i=(null==t?void 0:null===(c=t.instance)||void 0===c?void 0:null===(d=c.details)||void 0===d?void 0:d.collection_id)||this.props.collectionId,r=null===(p=this.props.collection)||void 0===p?void 0:null===(u=p.instance)||void 0===u?void 0:u.details,j=String(null!==(I=this.props.pageId)&&void 0!==I?I:(null===(h=this.props.router)||void 0===h?void 0:h.query.pageId)||(null===(v=this.props.router)||void 0===v?void 0:v.query.page_id));null===(O=this.props)||void 0===O||null===(w=O.dispatch)||void 0===w||w.call(O,e8.n.show(tl.fL,{title:(null===(g=this.props.meta)||void 0===g?void 0:g.title)||"",url:(0,tM.l4)().toString()+this.props.router.asPath,authorId:n,collectionId:i,pathId:null!==(P=null===(f=this.props.collection)||void 0===f?void 0:null===(_=f.instance)||void 0===_?void 0:null===(m=_.details)||void 0===m?void 0:m.path_id)&&void 0!==P?P:null===(S=this.props.collection)||void 0===S?void 0:null===(C=S.instance)||void 0===C?void 0:null===(y=C.details)||void 0===y?void 0:y.collection_id,pathAuthorId:null!==(A=null===(x=this.props.collection)||void 0===x?void 0:null===(T=x.instance)||void 0===T?void 0:null===(E=T.details)||void 0===E?void 0:E.path_author_id)&&void 0!==A?A:null===(b=this.props.collection)||void 0===b?void 0:null===(N=b.instance)||void 0===N?void 0:null===(L=N.details)||void 0===L?void 0:L.author_id,workType:this.getContentType(r||this.props.collectionDetailsSSR,o),pageId:j,callback:()=>{var t;(null==e?void 0:null===(t=e.userStreak)||void 0===t?void 0:t.streakIncremented)&&this.setState({userGamificationProperties:{...this.state.userGamificationProperties,showStreakToast:!0,streakToastType:el.rS.CURRENT_LESSON}})},progressStatus:G}))}},this.onPageUnmount=()=>{var e;let t=(new Date().getTime()-this.customizeFontCountdownStartTime.getTime())/1e3;null===(e=this.props.cookies)||void 0===e||e.set("customizeFontCountdown",this.customizeFontCountdown-t,{path:"/"}),clearTimeout(this.timerId)},this.clearPageAction=()=>this.props.isVersions?this.props.clearCollectionArticle:tO.m.clear,this.loggedInUser=()=>{var e;return null===(e=this.props.userInfoState.data)||void 0===e?void 0:e.user_id},this.goBackToCollectionEditor=()=>{let e=this.props.router.query.author_id,t=this.props.router.query.collection_id,o=this.props.router.query.page_id;this.props.isVersions?this.props.router.push("/pageeditor/".concat(e,"/").concat(t,"/").concat(o)):this.props.router.push("/collectioneditor/".concat(e,"/").concat(t))},this.getPageCompletionStatus=e=>{let{page_id:t}=this.props.pageProps;if(t){if(null==e?void 0:e.ALL_DONE)return ta.Z.LESSON_COMPLETED;let o=t.toString();if(({}).hasOwnProperty.call(e,o)){let t=e[o];if(t&&t.length>1&&!isNaN(Date.parse(t)))return ta.Z.LESSON_COMPLETED}}return ta.Z.LESSON_IN_PROGRESS},this.isPathCompleted=function(){var e,o,n,i;let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{dispatch:a,collection:l}=t.props;a(tb.W.load(String(null==l?void 0:null===(o=l.instance)||void 0===o?void 0:null===(e=o.details)||void 0===e?void 0:e.path_author_id),String(null==l?void 0:null===(i=l.instance)||void 0===i?void 0:null===(n=i.details)||void 0===n?void 0:n.path_id),!1,!0,null)).then(()=>
1{var e,o,n,i,a,s,d,c;let{...u}=t.props.moduleCategories.data||{},p=t.getPrivatePathTOC((u||{})["".concat(null==l?void 0:null===(o=l.instance)||void 0===o?void 0:null===(e=o.details)||void 0===e?void 0:e.path_author_id,"_").concat(null==l?void 0:null===(i=l.instance)||void 0===i?void 0:null===(n=i.details)||void 0===n?void 0:n.path_id)]);p?t.props.pathCompletionActions.load(String(null==l?void 0:null===(s=l.instance)||void 0===s?void 0:null===(a=s.details)||void 0===a?void 0:a.path_author_id),String(null==l?void 0:null===(c=l.instance)||void 0===c?void 0:null===(d=c.details)||void 0===d?void 0:d.path_id),JSON.stringify(p),null,null).then(()=>{(0,N.flushSync)(()=>{var e,o;return t.setState({workCompleted:!r&&(null===(o=t.props.pathCompletionState)||void 0===o?void 0:null===(e=o.data)||void 0===e?void 0:e.completion_percentage)===100})})}):(0,N.flushSync)(()=>t.setState({workCompleted:!r}))})},this.setPageCompletionStatus=function(e,o){var n,i,r,a,l,s,d,c,u,p,h,v,g,m,_,f,y,C,S,E,T,x,L,N;let b=arguments.length>2&&void 0!==arguments[2]&&arguments[2],w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,{author_id:O,collection_id:I,page_id:P,work_type:A}=t.props.pageProps,{collection:k,pathCompletionState:D,router:R,userInfoState:U,moduleCategories:M,isPrivateContent:F,isPath:q}=t.props,W=U.data,G=A===j.dL.COLLECTION,J=(null==k?void 0:null===(n=k.instance)||void 0===n?void 0:n.owned_by_reader)||!(null==k?void 0:null===(r=k.instance)||void 0===r?void 0:null===(i=r.details)||void 0===i?void 0:i.is_priced),B=(null==W?void 0:W.user_id)===O,V=(null==k?void 0:null===(a=k.instance)||void 0===a?void 0:a.details)||{},z=V.path_id,K=V.path_author_id||O,Y="".concat(P),X=new Date().toString(),$=e===ta.Z.LESSON_COMPLETED?X:null,ee=null===(l=V.toc)||void 0===l?void 0:l.categories,et=(null===(s=t.props.courseCompletion)||void 0===s?void 0:s["CourseCompletion_".concat(O,"_").concat(I)])||{},eo=!et[Y],en=!!et.ALL_DONE;P||(Y=o||(null==R?void 0:R.query.pageId)||(null==R?void 0:R.query.page_id));let ei={...et,[Y]:$,ALL_DONE:e===ta.Z.LESSON_IN_PROGRESS?null:et.ALL_DONE},er=t.props.resolvedPath||(null==R?void 0:R.asPath),es=(0,tZ.Z)(er),{mandatoryCloudlabs:ed,mandatoryLessons:ec,mandatoryProjects:eu}=(0,tD.QO)(ee,F),ep=100===(0,tk.ZP)(ec,ei,ed,eu).percentCompleted,eh=!!(null==W?void 0:null===(u=W.enterprise)||void 0===u?void 0:null===(c=u.organizations)||void 0===c?void 0:null===(d=c.find)||void 0===d?void 0:d.call(c,e=>e.has_active_trial)),ev={[Y]:$,resumable:J&&!B&&!ep};ev.ALL_DONE=ep?X:null;let eg={},em=!!V.path_id&&!!V.path_author_id&&V.work_type===j.dL.COLLECTION,e_=!1,ef=t.getContentType(null==k?void 0:null===(p=k.instance)||void 0===p?void 0:p.details,t.props.router);(ef===Z.Y.LEARNING_PLAN||ef===Z.Y.PATH)&&ep&&t.isPathCompleted(en),(null==k?void 0:null===(v=k.instance)||void 0===v?void 0:null===(h=v.details)||void 0===h?void 0:h.work_type)===j.dL.COLLECTION&&ep&&!em&&((0,H.Z)("LEARNING_CONTENT_COMPLETION","SUCCESS_COMPLETE_COURSE",null!==(C=null==k?void 0:null===(y=k.instance)||void 0===y?void 0:null===(f=y.details)||void 0===f?void 0:f.url_slug)&&void 0!==C?C:"".concat(O,"_").concat(I)),e_=!0),es===j.dL.MODULE?(eg={resumable_work_id:z,resumable_work_author_id:K,module_id:I,author_id:O},em&&(eg={...eg,has_external_work:"true"}),ep&&(0,H.Z)("ENTERPRISE","CLICKED_COMPLETED_MODULE","",null,{trial_active:eh,content_id:"".concat(O,"-").concat(I),is_assigned:!(null==k?void 0:null===(E=k.instance)||void 0===E?void 0:null===(S=E.details)||void 0===S?void 0:S.is_assigned)})):eg={resumable_work_id:I,resumable_work_author_id:O,author_id:O};let ey=V.work_type,eC={author_id:O,collection_id:I,payload:ev,workType:em?j.dL.MODULE:ey||es,sendInteractionCall:![...ed||[],...eu||[]].includes(o),resolvedPath:t.props.resolvedPath};eC.workType||(0,tX.u)(Error("Invalid Work Type for Interaction"),{workTypeInCollection:null==V?void 0:V.work_type,workTypeInRouter:es}),t.props.dispatch((0,Q.hy)(eC,eg,()=>t.setState(t=>({pageCompletionStatus:{...t.pageCompletionStatus,completionStatus:{...t.pageCompletionStatus.completionStatus,[o]:e}},workCompleted:ef===Z.Y.LEARNING_PLAN||ef===Z.Y.PATH?t.workCompleted:e_&&!en}),()=>t.manageCompletion({onlyLoader:!0,onlyMarkAsCompleted:!0,loaderValue:!1,pageId:o})),e=>t.updatePathCompletionMaps(e,Y,q,D.loaded,D.loading,$),R));let eS=t.getPlanInfo();if((eS.isPlanModule||eS.isPlanLesson||q)&&Object.keys(null!==(T=M.data)&&void 0!==T?T:{}).length&&Object.keys(null!==(x=null===(g=D.data)||void 0===g?void 0:g.maps)&&void 0!==x?x:{}).length){let{planTitle:t,connects:o,is_assigned:n,optionalItems:i,optionalItemsCount:r,...a}=M.data,l={...D.data.maps,["CourseCompletion_".concat(O,"_").concat(I
1)]:{...D.data.maps["CourseCompletion_".concat(O,"_").concat(I)],["".concat(P)]:e===ta.Z.LESSON_IN_PROGRESS?null:new Date().toString()}};100===(0,ea.sanitizePathCompletionMaps)(l,a,(0,ea.getWorkToTotalLessonsMapping)(a),null===(L=M.data)||void 0===L?void 0:L.optionalItems,null===(N=M.data)||void 0===N?void 0:N.optionalItemsCount).completionPercentage&&(0,H.Z)("ONBOARDING","PLAN_COMPLETED")}else!(eS.isPlanModule||eS.isPlanLesson)&&ep&&es!==j.dL.MODULE&&(0,H.Z)("ENTERPRISE",G?"CLICKED_COMPLETED_COURSE":"CLICKED_COMPLETED_SKILL_PATH","",null,{trial_active:eh,content_id:"".concat(O,"-").concat(I),is_assigned:!!(null==k?void 0:null===(_=k.instance)||void 0===_?void 0:null===(m=_.details)||void 0===m?void 0:m.is_assigned)});eo?(t.streakIncrementCall(w),t.setState({userGamificationProperties:{completionCallBack:w,showStreakToast:!1,streakToastType:b?el.rS.NEXT_LESSON:el.rS.CURRENT_LESSON,workCompleted:e_&&!en}})):w&&w(!1)},this.logWidgetInteraction=e=>t=>o=>n=>{var i,r,a,l,s,d;let{collection:c,pageProps:u,router:p}=this.props,{author_id:h,collection_id:v,page_id:g,external_author_id:m,external_collection_id:_,external_page_id:f}=u,y=(0,tZ.Z)(this.props.resolvedPath||(null==p?void 0:p.asPath))===j.dL.MODULE&&(null==c?void 0:null===(i=c.instance)||void 0===i?void 0:i.details.work_type)===j.dL.COLLECTION;if(!h)return setTimeout(()=>this.logWidgetInteraction(e)(t)(o)(n),3e3);let[C,S]=(0,tF.$)(null==h?void 0:h.toString(),v.toString(),null===(r=this.props.userInfoState)||void 0===r?void 0:r.data),E={author_id:C||f?m:h,collection_id:S||f?_:v,page_id:g,is_draft_page:e,comp_id:t,comp_type:o,interaction_map:JSON.stringify(n),path_author_id:y?null==c?void 0:null===(a=c.instance)||void 0===a?void 0:a.details.path_author_id:Number(null==c?void 0:null===(l=c.instance)||void 0===l?void 0:l.details.author_id),path_id:y?null==c?void 0:null===(s=c.instance)||void 0===s?void 0:s.details.path_id:Number(null==c?void 0:null===(d=c.instance)||void 0===d?void 0:d.details.collection_id)};return this.props.dispatch((0,Q.sn)(E))},this.resetCollectionCompletionStatus=(e,t)=>{var o,n,i,r,a,l;let{collection:s,pageProps:d,pathCompletionState:c}=this.props,{author_id:u}=d,p=!!(null==s?void 0:null===(o=s.instance)||void 0===o?void 0:o.details.path_id)&&!!(null==s?void 0:null===(n=s.instance)||void 0===n?void 0:n.details.path_author_id)&&(null==s?void 0:null===(i=s.instance)||void 0===i?void 0:i.details.work_type)===j.dL.COLLECTION,h=(null==s?void 0:null===(a=s.instance)||void 0===a?void 0:null===(r=a.details)||void 0===r?void 0:r.is_plan)||(null==s?void 0:null===(l=s.instance)||void 0===l?void 0:l.details.is_parent_plan);this.props.dispatch(e8.n.show(tl.zN,{onConfirm:()=>{var o,n;this.setState({resetCourseCompletionLoading:!0}),this.props.reset({...d,resumable_work_author_id:(null==s?void 0:null===(o=s.instance)||void 0===o?void 0:o.details.path_author_id)||u,workType:p?j.dL.MODULE:null==s?void 0:null===(n=s.instance)||void 0===n?void 0:n.details.work_type,resolvedPath:this.props.resolvedPath},e,t,p,e=>{this.setState(e=>({resetCourseCompletionLoading:!1,pageCompletionStatus:{...e.pageCompletionStatus,completionStatus:{}}})),this.updatePathCompletionMaps(e,"ALL_DONE",h,c.loaded,c.loading,null),e||this.props.collectionActions.resetAdaptiveCompletion()})()},cancelText:"Cancel",confirmText:"Reset",title:"Warning",description:"Resetting will set the course completion percentage to zero. This will not reset your saved changes e.g. code in the lessons."}))},this.updateOwnerShip=null,this.updateUserAttendance=()=>{var e,t,o,n,i,r,a,l,s,d,c,u,p,h,v,g;let m={timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,authorId:Number(null!==(h=null!==(p=null===(o=this.props.collection)||void 0===o?void 0:null===(t=o.instance)||void 0===t?void 0:null===(e=t.details)||void 0===e?void 0:e.path_author_id)&&void 0!==p?p:null===(r=this.props.collection)||void 0===r?void 0:null===(i=r.instance)||void 0===i?void 0:null===(n=i.details)||void 0===n?void 0:n.author_id)&&void 0!==h?h:this.props.authorId),workId:Number(null!==(g=null!==(v=null===(s=this.props.collection)||void 0===s?void 0:null===(l=s.instance)||void 0===l?void 0:null===(a=l.details)||void 0===a?void 0:a.path_id)&&void 0!==v?v:null===(u=this.props.collection)||void 0===u?void 0:null===(c=u.instance)||void 0===c?void 0:null===(d=c.details)||void 0===d?void 0:d.collection_id)&&void 0!==g?g:this.props.collectionId)};(0,B.g3)(m)},this.streakIncrementCall=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{userGamificationFeatureFlag:o,userInfoState:{data:n}}=t.props;t.props.userGamificationContext.incrementStreak({userInfo:n,userGamificationFeatureFlag:isNaN(Number(o))?0:Number(o),callBack:e})},this.purchaseFreeCollection=async()=>{var e,t,o,n,i;
1let{collection:r,userInfoState:a,router:l}=this.props,s=a.data,d=(null===(e=r.instance)||void 0===e?void 0:e.details.price)===0||(null===(t=r.instance)||void 0===t?void 0:t.details.discounted_price)===0,c=null===(o=r.instance)||void 0===o?void 0:o.owned_by_reader;if(this.loggedInUser()&&d&&!c&&!this.state.purchasingFreeCollection){if(!(0,I.YK)(s)){let e=null===(n=r.instance)||void 0===n?void 0:n.details.author_id,t=null===(i=r.instance)||void 0===i?void 0:i.details.collection_id;this.setState({purchasingFreeCollection:!0}),(0,H.Z)("BUY","BUY_INIT_COURSE_HOME");let o=(0,t0.We)(),a=(0,t0.bB)(),s={checkout_type:ts.vl.COURSE_PURCHASE,author_id:e,work_id:t,expected_price:0,last_referral_site:(0,tQ.rT)(),referral_site:(0,tQ.Ar)(),is_zero_priced_course_buy:!0,work_type:"collection",...o,...a};return(0,$.eJ)(s).then(()=>{this.props.collectionActions.updateOwnership(),this.updateOwnerShip=()=>{this.props.collectionActions.updateOwnership()}}).catch(e=>{var t;this.props.dispatch(e8.n.show(tl.ad,{status:"ERROR",text:null===(t=e.responseJSON)||void 0===t?void 0:t.errorText})),this.setState({purchasingFreeCollection:!1}),l.push(l.query.course_url_slug?"/courses/".concat(l.query.course_url_slug):"/collection/".concat(l.query.author_id,"/").concat(l.query.collection_id))})}this.props.collectionActions.updateOwnership()}},this.setCollectionCompletionStatus=function(){var e,o,n,i,r,a,l,s;let d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{pathCompletionState:c,setCollectionCompletion:u,userInfoState:p,collection:h}=t.props,v=p.data,{author_id:g,collection_id:m}=t.props.pageProps,_=(null==h?void 0:null===(e=h.instance)||void 0===e?void 0:e.details)||{},f=(0,tZ.Z)(t.props.resolvedPath||(null===(o=t.props.router)||void 0===o?void 0:o.asPath)),y=_.work_type||f,C=!!(null==_?void 0:_.path_id)&&!!(null==_?void 0:_.path_author_id)&&y===j.dL.COLLECTION,S={ALL_DONE:new Date().toString(),resumable:!1,resumable_work_id:null!=d?d:m,resumable_work_author_id:(null==_?void 0:_.path_author_id)||g,author_id:g};d&&(S=C?Object.assign({},S,{module_id:m,has_external_work:(!0).toString()}):Object.assign({},S,{module_id:m}));let E={author_id:g,collection_id:m,payload:S,workType:C?j.dL.MODULE:y,resolvedPath:t.props.resolvedPath};E.workType||(0,tX.u)(Error("Invalid Work Type for Interaction"),{workTypeInCollection:null==h?void 0:null===(s=h.instance)||void 0===s?void 0:s.details.work_type,workTypeInRouter:f});let T=null==h?void 0:null===(n=h.instance)||void 0===n?void 0:n.owned_by_reader,x=!!v&&v.user_id===g,L=(null==h?void 0:null===(r=h.instance)||void 0===r?void 0:null===(i=r.details)||void 0===i?void 0:i.is_plan)||(null==h?void 0:null===(a=h.instance)||void 0===a?void 0:a.details.is_parent_plan),N=t.getContentType(null==h?void 0:null===(l=h.instance)||void 0===l?void 0:l.details,t.props.router);(null==v?void 0:v.user_id)&&(_.is_priced&&T||!_.is_priced||x)&&t.props.dispatch(e8.n.show(tl.zN,{onConfirm:()=>{var e,o,n,i,r,a;N===Z.Y.LEARNING_PLAN||N===Z.Y.PATH?t.isPathCompleted():t.setState({workCompleted:!C&&!(null==h?void 0:null===(e=h.instance)||void 0===e?void 0:e.details.is_plan)&&N!==Z.Y.ONBOARDING_PLAN&&N!==Z.Y.MODULE}),t.setState({markAsCompleteLoading:!0,userGamificationProperties:{...t.state.userGamificationProperties,workCompleted:!0}}),t.updateUserAttendance(),t.streakIncrementCall(),u(E,e=>{var o,n;t.setState({markAsCompleteLoading:!1,workCompleted:(null==h?void 0:null===(n=h.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.work_type)===j.dL.COLLECTION&&!C}),t.updatePathCompletionMaps(e,"ALL_DONE",L,c.loaded,c.loading,new Date().toString())})(),(null==h?void 0:null===(n=h.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.work_type)!==j.dL.COLLECTION||C||(0,H.Z)("LEARNING_CONTENT_COMPLETION","SUCCESS_COMPLETE_COURSE",null!==(a=null==h?void 0:null===(r=h.instance)||void 0===r?void 0:null===(i=r.details)||void 0===i?void 0:i.url_slug)&&void 0!==a?a:"".concat(g,"_").concat(m))},cancelText:"Cancel",confirmText:"Complete",title:"Confirmation",description:"Are you sure you want to mark this course as 100% completed?"}))},this.setFakeLessons=()=>{let{collection:e}=this.props;if(Object.keys(e).length){var t;let o=null===(t=e.instance)||void 0===t?void 0:t.details.page_titles;if(o)return Object.keys(o).reduce((e,t)=>
1({...e,[t]:null}),{})}return{}},this.handleClaimCertificateLocal=()=>{var e,t,o,n;let i=this.props.userInfoState.data;return(0,tA.ZI)(null===(e=this.props.collection.instance)||void 0===e?void 0:e.details.author_id,null===(t=this.props.collection.instance)||void 0===t?void 0:t.details.collection_id,this.props.router,null===(o=this.props.collection.instance)||void 0===o?void 0:o.details.work_type,null==i?void 0:null===(n=i.user_id)||void 0===n?void 0:n.toString())},this.buyCertificateLocal=()=>(0,tA.lV)(this.props.collection,this.props.router),this.getPathShot=(e,t)=>{for(let o of e)for(let e of o.pages)if(t&&e.id===t&&e.type===G.R.SHOT)return e;return null},this.getSelections=(e,t,o,n,i,r,a,l)=>{var s,d;let{dispatch:c,collection:u,router:p,isPath:h}=this.props,{query:v}=p,g=null==u?void 0:u.is_guide,m=!v.encodedPathInfo&&!!(null==u?void 0:null===(d=u.instance)||void 0===d?void 0:null===(s=d.details)||void 0===s?void 0:s.is_standalone_module);c(e8.n.show(tl.dq,{externalLessons:e,categories:t,collectionId:o,authorId:n,url_slug:i,pathId:r,pathAuthorId:a,navigateToHighlight:tI.Gj,isStandaloneModule:m,collectionIsGuide:g,dispatch:c,isPath:h,logWidgetInteraction:this.logWidgetInteraction(this.state.is_draft_page||this.props.isVersions),confirmHighlightOrNoteDeletion:e=>{c(e8.n.show(tl.zN,e))},shotId:l})),(0,H.Z)("COURSE","VIEW_USER_HIGHLIGHTS","OPEN")},this.onNotesClick=()=>{var e,t,o,n,i,r;let{collection:a,collectionDetailsSSR:l,pageURL:s,router:d,pageProps:c}=this.props,u=this.props.collectionId||a.collectionId,p=a.authorId,h=null==a?void 0:null===(e=a.instance)||void 0===e?void 0:e.details.path_id,v=null==a?void 0:null===(t=a.instance)||void 0===t?void 0:t.details.path_author_id,g=null==a?void 0:null===(o=a.instance)||void 0===o?void 0:o.details.url_slug,m=(null==a?void 0:null===(i=a.instance)||void 0===i?void 0:null===(n=i.details.toc)||void 0===n?void 0:n.categories)||[],_=null==m?void 0:m.reduce((e,t)=>e.concat(t.pages.reduce((e,t)=>e.concat([G.R.LESSON,G.R.SHOT].includes(null==t?void 0:t.type)?[{...t.type===G.R.LESSON?{author_id:t.author_id,collection_id:t.collection_id,page_id:t.page_id}:{shot_id:t.page_id}}]:[]),[])),[]),f=(null==a?void 0:null===(r=a.instance)||void 0===r?void 0:r.details)||l||{},{query:y}=d,S=new C.Z,E=parseInt(null==y?void 0:y.pageId)||parseInt(null==y?void 0:y.page_id)||c.page_id,T=[j.dL.PATH,j.dL.MODULE].includes(f.work_type)&&!(0,td.i)(this.props.resolvedPath||d.asPath)&&this.getPathShot(m,y.page_url_slug&&!s.endsWith("/certificate")?S.decode(String(y.page_url_slug))[0].toString():E);this.getSelections(JSON.stringify(_),m,u,p,g,h,v,null==T?void 0:T.page_id)},this.isAskForSignup=()=>{var e,t,o,n,i,r,a,l;let{collectionDetailsSSR:s,allowAllLessonPreview:d}=this.props,c=null===(t=this.props.collection)||void 0===t?void 0:null===(e=t.instance)||void 0===e?void 0:e.details,u=Object.keys(c||{}).length?c:s,p=null!==(a=null!==(r=null===(o=this.props.collection)||void 0===o?void 0:o.allow_all_lessons_preview)&&void 0!==r?r:d)&&void 0!==a&&a,h=Number(null!==(l=this.props.pageId)&&void 0!==l?l:(null===(n=this.props.router)||void 0===n?void 0:n.query.pageId)||(null===(i=this.props.router)||void 0===i?void 0:i.query.page_id));return(0,tV.r)(p,u,h)},this.handleSaveWidgetUserData=function(e,o){var n;let{compId:i,reset:r}=o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{userInfoState:l,router:s,pageProps:d,collection:c,comps:u,dispatch:p}=t.props;return(0,tI.uN)(e,i,r,null===(n=l.data)||void 0===n?void 0:n.user_id,s,d,c,u,p,a,t.props.isSplitView,t.props.isSDPal)},this.viewedAdaptiveOnboardingTour=()=>K(JSON.stringify({show_adaptive_onboarding_tour:!1})),this.onAdaptiveOnboardTourSeenInteraction=async()=>{var e,t;this.viewedAdaptiveOnboardingTour(),null===(e=(t=this.props).featuresUserDataDispatch)||void 0===e||e.call(t,{type:"viewed_adaptive_onboarding_tour"}),await this.props.dispatch(e8.n.close())},this.onAdaptiveOnboardTourConfirm=async()=>{this.props.startTour(),await this.props.dispatch(e8.n.close())},this.getPlanInfo=()=>{var e,t;let o=Object.keys(this.props.collection).length?this.props.collection:this.props.ssrContent;return{isPlanLesson:null==o?void 0:null===(e=o.instance)||void 0===e?void 0:e.details.is_plan,isPlanModule:null==o?void 0:null===(t=o.instance)||void 0===t?void 0:t.details.is_parent_plan}},this.updatePathCompletionMaps=(e,t,o,n,i,r)=>o&&!e&&n&&!i&&this.props.pathCompletionActions.updateMap({authorId:String(this.props.pageProps.author_id),collectionId:String(this.props.pageProps.collection_id),key:t,value:r}),this.getContentType=(e,t)=>e.path_type?e.is_parent_plan||e.is_plan?Z.Y.ONBOARDING_PLAN:e.is_global&&t.query.encodedPathInfo?Z.Y.LEARNING_PLAN:e.is_standalone_module&&!t.query.encodedPathInfo?Z.Y.MODULE:Z.Y.PATH:e.collection_type===j.dL.COLLECTION?Z.Y.COURSE:e.collection_type===j.dL.SKILL_ASSESSMENT?M.Q.SKILL_ASSESSMENT:e.collection_type===j.dL.ENTERPRISE_ASSESSMENT?M.Q.ENTERPRISE_ASSESSMENT:Z.Y.COURSE,this.updateNextButtonPageIdClicked=e=>{this.setState(t=>({...t,nextButtonPageIdClicked:e}))},this.updateHloDetails=e=>this.setState(t=>({...t,hloDetails:{...t.hloDetails||{},...e||{}}}))}}oN.defaultProps={disableAllRedirections:!1,isMobile:!1};let ob=e=>{var t,o,n,i,r,a,l,s,u;let{shouldUseReaderPreferences:h=!0,...v}=e,[g,m]=c.useState(!0),{state:_}=(0,tH.E)(),f=(0,eU.sX)().set,C=(0,tG.G)().data,S=(0,eU._P)(),{collectionArticleActions:E,collectionArticle:x}=(0,e4.SF)(),L=(0,t_.ZP)().setNotFound,N=c.useContext(tL.UserGamificationContext),{userInfoState:b}=(0,e9.su)(),O=!!(null===(t=b.data)||void 0===t?void 0:t.user_id),I=(0,tT.pY)().sidebarCollapsed,{collectionArticlePreview:P}=(0,e3.nF)(),A=(0,tJ.h)(e=>e.userConfig),M=(0,eU.q6)(),F=(0,eU.Ed)(),Z=(0,ty.usePathCompletionActions)(),q=(0,ty.usePathCompletionState)(),W=(0,tB.ZP)(),G=(0,tW.W)(),H=(0,tq.z)().fetch,J=v.isSource?v.isSource:x,B=x.loaded?null==x?void 0:null===(o=x.data)||void 0===o?void 0:o.summary:null,{isTourOpen:V,startTour:z,currentStep:K,endTour:Y}=(0,er.r)(),{featuresUserDataDispatch:Q}=c.useContext(tg.Mq),$=(0,en.a)("sm"),ee=(0,tw.TL)(),et=(0,T.useRouter)(),eo=(0,p.y)(),ei=(0,t$.P)(D.Z)||(0,tM.hN)(),ea=!!x.loading,el=!!x.loaded,es=!1===P.loading&&!0===P.loaded?P.data:{page_id:void 0,item_type:void 0,author_id:Number((null==M?void 0:null===(i=M.instance)||void 0===i?void 0:null===(n=i.details)||void 0===n?void 0:n.author_id)||v.authorId),collection_id:Number((null==M?void 0:null===(a=M.instance)||void 0===a?void 0:null===(r=a.details)||void 0===r?void 0:r.collection_id)||v.collectionId),work_type:void 0,external_author_id:void 0,external_collection_id:void 0,external_page_id:void 0,created:void 0,page_key:void 0,modified:void 0,page_table_of_content_is_enabled:void 0,summary:void 0,tags:void 0,title:void 0,read_time:void 0,recommendations:void 0,is_recommended_by_reader:void 0,owned_by_reader:void 0,author_name:void 0},ed=(0,tu.x0)(),ec=null!==(u=null==M?void 0:null===(s=M.instance)||void 0===s?void 0:null===(l=s.details)||void 0===l?void 0:l.api_keys)&&void 0!==u?u:[],eu=null==M?void 0:M.is_published,ep={...v,comps:v.filterWidgets?v.filterWidgets(v.comps):v.comps,setLoaderStateDispatch:f,loadingState:S,userInfoState:b,userGamificationContext:N,sidebarCollapsed:I,pageProps:es,setNotFound:L,apiKeys:ec,isPublished:eu,collection:M,collectionActions:F,pathCompletionActions:Z,pathCompletionState:q,widgetsData:W},eh=(0,tm.x)(),ev=(0,tS.Z)();return(0,c.useEffect)(()=>{!g&&v.pathType===j.Ss.L2C_PATHWAY&&$&&ee(e8.n.show(tl.v_)),v.pathType===j.Ss.L2C_PATHWAY&&(!$||g)&&ee(e8.n.close())},[g,$]),(0,c.useEffect)(()=>{let e=ev||(null==et?void 0:et.asPath);(async()=>{O&&(null==e?void 0:e.startsWith("/interview-prep/"))&&await (0,X.tT)(e)})()},[O,et.asPath,ev]),(0,c.useEffect)(()=>{var e,t,o,n;if(!v.isMinimapEnabled||!M)return;let i=null==M?void 0:null===(t=M.instance)||void 0===t?void 0:null===(e=t.details)||void 0===e?void 0:e.author_id,r=null==M?void 0:null===(n=M.instance)||void 0===n?void 0:null===(o=n.details)||void 0===o?void 0:o.collection_id;i&&r&&(0,tc.H)(ev||et.asPath)&&(0,w.JG)((0,y.Z)({authorId:i,collectionId:r}),M,{revalidate:!1})},[M,et.asPath,v.isMinimapEnabled,ev]),(0,d.jsx)(e6.ZP,{children:(0,d.jsx)(tf.ZP,{children:(0,d.jsx)(eR.Up,{children:(0,d.jsx)(oS,{shouldUseContext:h,children:(0,d.jsx)(tg.BQ,{children:(0,d.jsx)(tC.fX.Consumer,{children:e=>{var t,o,n,i,r;return(0,d.jsx)(oN,{...ep,userGamificationFeatureFlag:null!==(r=null==A?void 0:null===(o=A.data)||void 0===o?void 0:null===(t=o.constants)||void 0===t?void 0:t[U.Z])&&void 0!==r?r:0,enableStandaloneCloudLabHomepage:null===(n=A.data)||void 0===n?void 0:n.constants[R.Z],enableCloudLabsB2BUpsell:(null===(i=A.data)||void 0===i?void 0:i.constants[k.Z])==="true",startTour:z,currentStep:K,endTour:Y,isTourOpen:V,featuresUserDataDispatch:Q,readerPreferences:e,bannerActions:ed,loadCollectionArticle:E.load,clearCollectionArticle:E.clear,pageData:J,snapshotProperties:B,snapshotPropertiesLoading:ea,snapshotPropertiesLoaded:el,authorConceptsClear:G.clear,courseCompletion:C,userApiKeys:_,setIsLockedLesson:m,abortControllerFetch:H,isMobile:$,isSDPal:eh,isMinimapForCoursesEnabled:eo,isMinimapForNonPalCoursesEnabled:ei,resolvedPath:ev})}})})})})})})};var ow=(0,or.Z)((0,T.withRouter)((0,L.Z)(oL(ob))));let oO=(0,T.withRouter)((0,L.Z)(oL(ob))),oI=oL(e=>{var t,o,n,i,r,a,l,s,u,p,h,v,g;let[m,_]=c.useState(!0),{state:f}=(0,tH.E)(),y=(0,tC.ET)(),C=(0,tG.G)().data,S=(0,eU._P)(),{collectionArticleActions:E,collectionArticle:T}=(0,e4.SF)(),x=c.useContext(tL.UserGamificationContext),{userInfoState:L}
1=(0,e9.su)(),{collectionArticlePreview:N}=(0,e3.nF)(),b=(0,eU.q6)(),w=(0,eU.Ed)(),O=(0,ty.usePathCompletionActions)(),I=(0,ty.usePathCompletionState)(),P=(0,tB.ZP)(),A=(0,tW.W)(),D=(0,tJ.h)(e=>e.userConfig),M=null!==(v=null==b?void 0:null===(o=b.instance)||void 0===o?void 0:null===(t=o.details)||void 0===t?void 0:t.api_keys)&&void 0!==v?v:[],F=null==b?void 0:b.is_published,Z=e.isSource?e.isSource:T,q=(0,en.a)("sm"),W=(0,tw.TL)(),G=(0,tq.z)().fetch;(0,c.useEffect)(()=>{!m&&e.pathType===j.Ss.L2C_PATHWAY&&q&&W(e8.n.show(tl.v_)),e.pathType===j.Ss.L2C_PATHWAY&&(!q||m)&&W(e8.n.close())},[m,q]);let H=T.loaded?null==T?void 0:null===(n=T.data)||void 0===n?void 0:n.summary:null,J=!!T.loading,B=!!T.loaded,V=!1===N.loading&&!0===N.loaded?N.data:{page_id:void 0,author_id:Number(null==b?void 0:null===(r=b.instance)||void 0===r?void 0:null===(i=r.details)||void 0===i?void 0:i.author_id),collection_id:Number(null==b?void 0:null===(l=b.instance)||void 0===l?void 0:null===(a=l.details)||void 0===a?void 0:a.collection_id),external_collection_id:void 0,created:void 0,page_key:void 0,modified:void 0,page_table_of_content_is_enabled:void 0,summary:void 0,tags:void 0,title:void 0,read_time:void 0,recommendations:void 0,is_recommended_by_reader:void 0,owned_by_reader:void 0,author_name:void 0},z=(0,tu.x0)(),K=(0,t_.ZP)().setNotFound,Y={...e,loadingState:S,widgetsData:P};return(0,d.jsx)(oN,{...Y,userGamificationFeatureFlag:null!==(g=null==D?void 0:null===(u=D.data)||void 0===u?void 0:null===(s=u.constants)||void 0===s?void 0:s[U.Z])&&void 0!==g?g:0,enableStandaloneCloudLabHomepage:null===(p=D.data)||void 0===p?void 0:p.constants[R.Z],enableCloudLabsB2BUpsell:(null===(h=D.data)||void 0===h?void 0:h.constants[k.Z])==="true",readerPreferences:y,userInfoState:L,userGamificationContext:x,pageProps:V,bannerActions:z,setNotFound:K,collection:b,collectionActions:w,pathCompletionActions:O,pathCompletionState:I,apiKeys:M,isPublished:F,loadCollectionArticle:E.load,clearCollectionArticle:E.clear,pageData:Z,snapshotProperties:H,snapshotPropertiesLoading:J,snapshotPropertiesLoaded:B,authorConceptsClear:A.clear,courseCompletion:C,userApiKeys:f,setIsLockedLesson:_,abortControllerFetch:G})})},311680:function(e,t,o){"use strict";o.d(t,{W:function(){return r}}),o(386602);let n={top:"bottom",bottom:"top",right:"left",left:"right"},i=function(e,t,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#191892";if(!e||"custom"===e)return{};let r="top"===e||"bottom"===e,a={[r?"borderLeft":"borderTop"]:"".concat(8,"px solid transparent"),[r?"borderRight":"borderBottom"]:"".concat(8,"px solid transparent"),["border".concat(e[0].toUpperCase()).concat(e.substring(1))]:"".concat(12,"px solid ").concat(i),[r?n[o]:t]:"".concat(22,"px"),[n[e]]:"".concat(-10,"px")};return{"--rtp-arrow-top":a.top,"--rtp-arrow-bottom":a.bottom,"--rtp-arrow-left":a.left,"--rtp-arrow-right":a.right,"--rtp-arrow-border-top":a.borderTop,"--rtp-arrow-border-bottom":a.borderBottom,"--rtp-arrow-border-left":a.borderLeft,"--rtp-arrow-border-right":a.borderRight}},r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#191892";return{dot:e=>({...e,display:"none"}),button:e=>({...e,cursor:"default",height:"3rem"}),controls:e=>({...e,position:"absolute",marginTop:0,marginRight:"auto",marginLeft:"auto",width:"100%",padding:"0 0.875rem",left:0,right:0,bottom:0,display:"flex",justifyContent:"space-between"}),popover:(t,o)=>({...t,maxWidth:"48rem",minWidth:"18rem",...i(o.position,o.verticalAlign,o.horizontalAlign,e)}),badge:e=>({...e,width:"3rem",zIndex:10,padding:0,margin:0,top:"calc(100% - 2.25rem)",left:"calc(50% - 0.875rem)",background:"none",boxShadow:"none",font:"inherit"})}}},876921:function(e,t){"use strict";t.Z=(e,t,o,n)=>"/pal/g/".concat(e,"/project/").concat(t,"/").concat(o,"/").concat(n)},611522:function(e,t,o){"use strict";o.d(t,{H:function(){return i}});var n=o(468518);let i=e=>(0,n.M)(e,!0)&&(e.includes("/project")||e.includes("/assessment")||e.includes("/mock-interview")||e.includes("/coaching-session")||e.includes("/cloudlab"))},525623:function(e,t,o){"use strict";o.d(t,{L6:function(){return k},cg:function(){return D},oh:function(){return R},zy:function(){return i}});var n,i,r=o(931549),a=o(881762),l=o(44194),s=o(333012),d=o(64506),c=o(378958),u=o(801674),p=o(162402),h=o(991608),v=o(766898),g=o(127987),m=o(101026),_=o(300670),f=o(911808),y=o(262603),C=o(198144),S=o(699402),E=o(621062),T=o(273650),x=o(342015),L=o(810343);let N={loaded:!1}
1,b=l.createContext(N),w=l.createContext({pending:()=>{},fulfilled:e=>{},rejected:e=>{},clear:e=>{},load:function(e,t){let{shot_id:o,shot_url:n}=e;arguments.length>2&&void 0!==arguments[2]&&arguments[2]},prepareDockerOnSetShot:(e,t)=>{},updateReadTime:e=>{},updateTags:e=>{},updateContent:e=>{},updateETag:e=>{}}),O=(e,t,o,n)=>{var i,r;let a={shotId:"",compIds:[]};a.shotId=e.shotId;let l=null===(i=e.docker)||void 0===i?void 0:i.envs;l&&l.length&&e.content&&(a.compIds=e.content.map(e=>e.content.comp_id).filter(Boolean),(null===(r=a.compIds)||void 0===r?void 0:r.length)&&a.shotId&&(null==o?void 0:o.user_id)&&!n.loading&&!n.loaded&&t((0,u.$6)({params:a,apiKeys:[],envKeys:l})))};(n=i||(i={})).UPDATE_READ_TIME="UPDATE_READ_TIME",n.UPDATE_TAGS="UPDATE_TAGS",n.UPDATE_TOPIC_TAGS="UPDATE_TOPIC_TAGS",n.UPDATE_PROGRAMMING_TAGS="UPDATE_PROGRAMMING_TAGS",n.UPDATE_CONTENT="UPDATE_CONTENT",n.PREPARE_DOCKER_ON_SETSHOT="PREPARE_DOCKER_ON_SETSHOT",n.UPDATE_ETAG="UPDATE_ETAG";let I=(e,t,n,i)=>{let r=async(e,t)=>{var o;let n=(null==e?void 0:e.docker)?{...e.docker,envs:null!==(o=e.docker.envs)&&void 0!==o?o:[]}:C.s4,i=t?await (0,S.w)():{},r={...n,container:{...n.container,liveInstance:i}};T.Z.getState().setObject(r)};return{...(0,m.nR)(e),updateETag:t=>{e({type:"UPDATE_ETAG",payload:t})},clear:t=>{t&&t(),x.E.getState().reset(),e({type:m.Et.CLEAR})},updateReadTime:t=>e({type:"UPDATE_READ_TIME",payload:t}),updateTags:t=>e({type:"UPDATE_TAGS",payload:t}),updateProgrammingTags:t=>e({type:"UPDATE_PROGRAMMING_TAGS",payload:t}),updateTopicTags:t=>e({type:"UPDATE_TOPIC_TAGS",payload:t}),updateContent:t=>e({type:"UPDATE_CONTENT",payload:t}),load:async function(a,l){let{shot_id:u,shot_url:h}=a,v=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e({type:m.Et.PENDING});let g=await P(u,h);if(g.shot){var _,f;o.g.shotSummaryDispatch({type:"change",payload:g.shot}),e({type:m.Et.FULFILLED,payload:g.shot}),g.etag&&e({type:"UPDATE_ETAG",payload:g.etag});let a=null===(_=o.g.userInfoContext)||void 0===_?void 0:_.userInfoState.data,u=l.data,h=g.shot.content;if((null==a?void 0:a.user_id)&&l.loaded&&h&&u&&u.item_type===c.R.SHOT){let e={compIds:h.map(e=>e.content.comp_id).filter(Boolean),authorId:u.author_id,userId:a.user_id,pageId:u.page_id,shotId:u.shot_id};(null===(f=e.compIds)||void 0===f?void 0:f.length)&&e.authorId&&e.userId&&e.pageId&&(0,p.Sh)(e)}O(g.shot,t,a,n);let y=g.shot;if(y&&v&&r(y,!0),!(null==y?void 0:y.shotId)&&!v)throw Error("SHOT_CLEARED");let{content:C}=await (0,s.T)({content:null==y?void 0:y.content,normalizeHeadingsForAllWidgets:!v,processNormalizeHeadings:!0,workType:d.s.SHOT});i(C,!0,!1),e({type:"UPDATE_CONTENT",payload:C})}else e({type:m.Et.REJECTED,payload:(0,E.n)(g.error)})},prepareDockerOnSetShot:r}},P=async(e,t)=>{try{let o=await (0,a.Z)({url:"/api/edpresso/shot/".concat(null!=e?e:"url/".concat(t)),type:"GET"},!0),{tags:n,...i}=(0,f.u)(o);return{shot:i,etag:o.xhr.headers.get(v.Zq)}}catch(t){t.status===h.Wy.notFoundException&&(0,o.g.setNotFound)({notFoundPageStatus:!0});let e=null==t?void 0:t.message;return"SHOT_CLEARED"!==e&&"SHOT_NOT_LOADED"!==e&&(0,L.u)(t),{error:t}}},A=(e,t)=>{switch(t.type){case"UPDATE_READ_TIME":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,readTime:t.payload}};case"UPDATE_ETAG":if(!e.loaded||!e.data)return e;return o.g.shotETag=t.payload,{...e,data:{...e.data,"X-ETag":t.payload}};case"UPDATE_TAGS":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,tags:t.payload}};case"UPDATE_PROGRAMMING_TAGS":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,programming_tags:t.payload}};case"UPDATE_TOPIC_TAGS":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,topic_tags:t.payload}};case"UPDATE_CONTENT":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,content:t.payload}};case m.Et.REJECTED:return{...e,error:t.payload};default:return(0,m.I4)(e,t)}},j=e=>{let{children:t}=e,[n,i]=(0,l.useReducer)(A,N),a=(0,y.TL)(),s=(0,_.Ud)()().load,{state:d}=(0,x.E)(),c=I(i,a,d,s);return o.g.shotContextDispatch=i,(0,r.jsx)(b.Provider,{value:n,children:(0,r.jsx)(w.Provider,{value:c,children:t})})};t.ZP=j;let k=()=>l.useContext(b),D=()=>l.useContext(w),R=e=>t=>(0,r.jsx)(_.ZP,{children:(0,r.jsx)(j,{children:(0,r.jsx)(g.ZP,{children:(0,r.jsx)(e,{...t})})})})},127987:function(e,t,o){"use strict";o.d(t,{BV:function(){return S},HM:function(){return E}});var n,i,r=o(931549),a=o(881762),l=o(44194),s=o(101026),d=o(262603),c=o(621062),u=o(689073),p=o(525623);let h={loaded:!1}
1,v=l.createContext(h),g=l.createContext({pending:()=>{},fulfilled:e=>{},rejected:e=>{},clear:()=>{},load:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]},setBookmarkStatus:e=>{},updateDraftViewers:e=>{},updateLicense:e=>{},updateDifficulty:e=>{},invertIsShotApproved:e=>{},setLikeStatus:e=>{},updateShotAttribution:(e,t)=>{},updateSummary:e=>{}});(n=i||(i={})).SET_BOOKMARK_STATUS="SET_BOOKMARK_STATUS",n.UPDATE_ATTRIBUTES="UPDATE_ATTRIBUTES",n.UPDATE_DRAFT_VIEWERS="UPDATE_DRAFT_VIEWERS",n.UPDATE_LICENSE="UPDATE_LICENSE",n.UPDATE_DIFFICULTY="UPDATE_DIFFICULTY",n.INVERT_IS_SHOT_APPROVED="INVERT_IS_SHOT_APPROVED",n.SET_LIKE_STATUS="SET_LIKE_STATUS",n.UPDATE_SUMMARY="UPDATE_SUMMARY";let m=e=>(0,u.Z)(JSON.parse(e)),_=(e,t)=>({...(0,s.nR)(e),setBookmarkStatus:t=>{e({type:"SET_BOOKMARK_STATUS",payload:t})},updateSummary:t=>{e({type:"UPDATE_SUMMARY",payload:t})},updateAttributions:t=>{e({type:"UPDATE_ATTRIBUTES",payload:t})},updateDraftViewers:t=>{e({type:"UPDATE_DRAFT_VIEWERS",payload:t})},updateLicense:t=>{e({type:"UPDATE_LICENSE",payload:t})},updateDifficulty:t=>{e({type:"UPDATE_DIFFICULTY",payload:t})},invertIsShotApproved:t=>{e({type:"INVERT_IS_SHOT_APPROVED",payload:t})},setLikeStatus:t=>{e({type:"SET_LIKE_STATUS",payload:t})},load:async function(t){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e({type:s.Et.PENDING});let i=await y(t,n);if(i.data){var r;o.g.shotContextDispatch&&(o.g.shotContextDispatch({type:p.zy.UPDATE_TAGS,payload:i.data.tags}),o.g.shotContextDispatch({type:p.zy.UPDATE_PROGRAMMING_TAGS,payload:i.data.programmingTags}),o.g.shotContextDispatch({type:p.zy.UPDATE_TOPIC_TAGS,payload:i.data.topicTags})),o.g.shotSummaryDispatch({type:"change",payload:{dirty:!0,summary:i.data.summary}}),o.g.shotSummaryDispatch({type:"updateShotTags",payload:i.data.tags}),o.g.shotSummaryDispatch({type:"change",payload:{draft_viewers:JSON.parse(null!==(r=i.data.draftViewers)&&void 0!==r?r:"[]").map(e=>e.author_id)}}),e({type:s.Et.FULFILLED,payload:i.data})}else e({type:s.Et.REJECTED})},updateShotAttribution:async(t,o)=>{(await f(t,o)).success&&e({type:"UPDATE_ATTRIBUTES",payload:(0,u.Z)(o)})}}),f=async(e,t)=>{try{return await (0,a.Z)({url:"/api/edpresso/editor/shot/".concat(e,"/update-attributions"),type:"POST",data:{attributions:JSON.stringify(t)}}),{success:!0}}catch(e){return{error:(0,c.n)(e)}}},y=async function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];try{let o=await (0,a.Z)({url:"/api/edpresso/shot/".concat(e,"/props?status=").concat(t?"published":"draft"),type:"GET"});return{data:m(o)}}catch(e){return{error:(0,c.n)(e)}}},C=(e,t)=>{switch(t.type){case"SET_BOOKMARK_STATUS":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,isBookmarkedByReader:t.payload}};case"UPDATE_ATTRIBUTES":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,attributions:t.payload}};case"UPDATE_DRAFT_VIEWERS":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,draftViewers:t.payload}};case"UPDATE_LICENSE":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,license:t.payload}};case"UPDATE_DIFFICULTY":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,difficulty:t.payload}};case"UPDATE_SUMMARY":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,summary:t.payload}};case"INVERT_IS_SHOT_APPROVED":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,isShotApprovedForPublish:t.payload}};case"SET_LIKE_STATUS":if(!e.loaded||!e.data)return e;return{...e,data:{...e.data,isLikedByReader:t.payload.like,shotLikes:t.payload.shotLikes}};default:return(0,s.I4)(e,t)}};t.ZP=e=>{let{children:t}=e,[o,n]=(0,l.useReducer)(C,h),i=_(n,(0,d.TL)());return(0,r.jsx)(v.Provider,{value:o,children:(0,r.jsx)(g.Provider,{value:i,children:t})})};let S=()=>l.useContext(v),E=()=>l.useContext(g)},257397:function(e,t,o){"use strict";o.r(t),o.d(t,{PathCompletionActionsContext:function(){return g},PathCompletionStateContext:function(){return v},usePathCompletionActions:function(){return _},usePathCompletionState:function(){return m}});var n,i,r=o(931549),a=o(881762),l=o(44194),s=o(156321),d=o(432538),c=o(621062);(n=i||(i={}
1))[n.PENDING=0]="PENDING",n[n.FULFILLED=1]="FULFILLED",n[n.REJECTED=2]="REJECTED",n[n.CLEAR=3]="CLEAR",n[n.UPDATE_MAP=4]="UPDATE_MAP",n[n.UPDATE_PROGRESS=5]="UPDATE_PROGRESS",n[n.UPDATE_MENTOR_FEEDBACK=6]="UPDATE_MENTOR_FEEDBACK";let u=(e,t)=>"CourseCompletion_".concat(e,"_").concat(t),p={loaded:!1},h=(e,t,o)=>({...JSON.parse(o),pathAuthorId:Number(e),pathId:Number(t)}),v=l.createContext(p),g=l.createContext(null),m=()=>l.useContext(v),_=()=>l.useContext(g);function f(e,t){var o,n,i;switch(t.type){case 0:return{loaded:!1,loading:!0};case 1:return{error:void 0,loading:!1,loaded:!0,data:{...e.data,...t.payload}};case 2:return{loading:!1,loaded:!1,error:t.payload.error};case 3:return p;case 4:let{authorId:r,collectionId:a,key:l,value:s}=t.payload,c=u(r,a);return{...e,data:{...e.data,maps:{...null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.maps,[c]:{...null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.maps[c],[l]:s}}}};case 5:let{manager_name:h}=t.payload;return{...e,data:{...e.data,mentee_info:{...null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.mentee_info,progress_status:d.b.COMPLETED,force_completed_by:h}}};case 6:let{mentorFeedback:v}=t.payload;return{...e,data:{...e.data,mentor_feedback:v}};default:return e}}t.default=e=>{let{children:t}=e,[o,n]=l.useReducer(f,p),i={pending:()=>{n({type:0})},fulfilled:e=>{(0,s.flushSync)(()=>{n({type:1,payload:e})})},rejected:e=>{n({type:2,payload:{error:e}})},clear:()=>{n({type:3})},updateMap:e=>{n({type:4,payload:e})},updateProgress:e=>{n({type:5,payload:{manager_name:e}})},updateMentorFeedback:e=>{n({type:6,payload:e})}};return(0,r.jsx)(v.Provider,{value:o,children:(0,r.jsx)(g.Provider,{value:{...i,load:(e,t,o,n,r)=>(i.pending(),(0,a.Z)({url:"/api/userdata/map/path/".concat(e,"/").concat(t).concat(r?"?organization_id=".concat(n,"&mentee_id=").concat(r):""),type:"POST",data:{categories_json_string:o}}).then(o=>{i.fulfilled(h(e,t,o))}).catch(e=>{i.rejected((0,c.n)(e))}))},children:t})})}},343949:function(e,t,o){"use strict";o.d(t,{hC:function(){return B},SR:function(){return z},ZP:function(){return X},ms:function(){return et},Ym:function(){return en},Q_:function(){return ei},PY:function(){return $},jc:function(){return ee},eQ:function(){return V}});var n=o(931549),i=o(494296),r=o(881762),a=o(503346),l=o.n(a),s=o(44194),d=o(156321),c=o(33454),u=o(336449),p=o(611440),h=o(970179),v=o(833635);let g=e=>{let{authorId:t,collectionId:o,projectId:n,projectComponentId:i,mode:a}=e,l="view"===a?"/api/project/".concat(t,"/").concat(o,"/").concat(n,"/").concat(i):"/api/author/".concat(t,"/collection/").concat(o,"/project/").concat(n,"/project_component/").concat(i);return(0,r.Z)({url:l,type:"GET"},!0)};var m=o(786394);let _=e=>{let{authorId:t,collectionId:o,projectId:n,projectComponentId:i}=e,a="/api/project/".concat(t,"/").concat(o,"/").concat(n,"/").concat(i,"/progress");return(0,r.Z)({url:a,type:"GET"},!0)};var f=o(766898);let y=e=>(0,r.Z)({url:"/api/author/".concat(e.author_id,"/collection/").concat(e.collection_id,"/project/").concat(e.project_id,"/project_component/").concat(e.project_component_id),contentType:"application/json",processData:!1,type:"PUT",data:JSON.stringify(e),headers:{[f.Zq]:e[f.Zq]}},!0),C=e=>(0,r.Z)({url:"/api/author/".concat(e.author_id,"/collection/").concat(e.collection_id,"/project/").concat(e.project_id),contentType:"application/json",processData:!1,type:"PUT",data:JSON.stringify(e),headers:{[f.Zq]:e[f.Zq]}},!0),S=e=>{let{authorId:t,collectionId:o,projectId:n,projectComponentId:i,sourceCode:a,attemptCount:l}=e,s="/api/project/".concat(t,"/").concat(o,"/").concat(n,"/").concat(i,"/progress");return(0,r.Z)({url:s,type:"POST",data:{current_attempt:l,source_code:JSON.stringify(a)}},!0)};var E=o(704373),T=o(645759),x=o(781894),L=o(934559),N=o(991608),b=o(865546),w=o(45543),O=o(275184),I=o(881871),P=o(483264);let A={protectedContent:{evaluationInputFileId:"",evaluationOutputFileId:""},content:{version:o(592459).w,projectCodeEvaluationVersion:1,caption:"",language:"python3",title:"",imageId:"",theme:"default",additionalContent:[],selectedIndex:0,runnable:!1,judge:!0,staticEntryFileName:!0,judgeContent:null,judgeHints:null,allowDownload:!1,treatOutputAsHTML:!1,enableHiddenCode:!1,enableStdin:!1,evaluateWithoutExecution:!1,showSolution:!1,timeLimit:P.M,hiddenCodeContent:{prependCode:"\n\n",appendCode:"\n\n",codeSelection:"prependCode"},dockerJob:{},selectedApiKeys:{},selectedEnvVars:{},specialInput:f.Zs,solutionContent:"\n\n",judgeContentPrepend:"\n\n\n",evaluateLanguage:"python3",isProject:!0,entryFileName:"main.py",content:""}};var j=o(144022),k=o(876921),D=o(884297),R=o(389392),U=o(262603),M=o(631141),F=o(198144),Z=o(699402),q=o(487054),W=o(242075),G=o(621062),H=o(273650),J=o(463316);
1let B=s.createContext({results:null,setResults:()=>{}}),V=e=>{let t=t=>(0,n.jsx)(B.Consumer,{children:o=>{let{results:i,setResults:r}=o;return(0,n.jsx)(e,{testResult:i,setTestResultContext:r,...t})}});return Object.getOwnPropertyNames(e).forEach(o=>{"function"==typeof e[o]&&(t[o]=e[o])}),t},z=s.createContext(null),K=(e,t)=>{var o,n,r,a,l,s,d,c,p,v,g,m,_,y,C,S,E,N,b,O,P,k,D,R,U,M,F,Z;switch(t.type){case"pending":return{...e,loading:!0};case"clearAndPending":return{loaded:!1,loading:!0};case"fulfilled":return{error:void 0,loaded:!0,loading:!1,data:{...e.data,...t.payload}};case"rejected":return{loading:!1,loaded:!1,error:t.payload};case"clear":return{loaded:!1};case"updateEtag":return{...e,data:{...e.data,[f.Zq]:t.payload}};case"updateProjectTitle":return{...e,dirty:!0,data:{...e.data,title:t.payload}};case"addUserDataResourceFile":return e.data.udata_files.push(t.payload),e.dirty=!0,e;case"updateUserDataResourceFile":{let{index:o,payload:n}=t.payload;return e.data.udata_files[o]={...e.data.udata_files[o],...n},e.dirty=!0,e}case"removeUserDataResourceFile":return e.data.udata_files.splice(t.payload.index,1),e.dirty=!0,e;case"addComponent":{let{category_id:i,component:r,index:a}=t.payload,l=(0,j.QY)(null==e?void 0:null===(n=e.data)||void 0===n?void 0:null===(o=n.toc)||void 0===o?void 0:o.categories,i);return(0,j.WL)(e,null==r?void 0:r.project_component_id,l,a,h.q.PROJECT_COMPONENT),e}case"addCategory":{let{index:o,parentIndex:n}=t.payload,i=null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(r=a.toc)||void 0===r?void 0:r.categories;return(0,j.oW)(i)?(e.data.toc.categories[0].title="Untitled category",e.data.toc.categories[0].editMode=!0):(0,j.SK)(e.data,!0,!1,o,n,u.j.PROJECT_CATEGORY),e}case"toggleTaskVisibility":{let{categoryId:o,projectComponentId:n}=t.payload;if(!e.data)return;if(o){let t=(0,j.QY)(e.data.toc.categories,o),i=(0,j.QY)(e.data.toc.categories[t].pages,n);e.data.toc.categories[t].pages[i].is_preview=!e.data.toc.categories[t].pages[i].is_preview}break}case"updateCategoryTitle":{let{id:o,title:n}=t.payload,i=(0,j.QY)(null==e?void 0:null===(s=e.data)||void 0===s?void 0:null===(l=s.toc)||void 0===l?void 0:l.categories,o);return e.data.toc.categories[i].title="__default"!==n?n:"",e.data.toc.categories[i].editMode=!1,e}case"updateComponentTitle":{let{categoryId:o,projectComponentId:n,title:i}=t.payload;if(!e.data)return e;if(o){let t=(0,j.QY)(e.data.toc.categories,o),r=(0,j.QY)(e.data.toc.categories[t].pages,n);e.data.toc.categories[t].pages[r].title=i,e.data.toc.categories[t].pages[r].editMode=!1}return e}case"updateComponentComps":if(!e.data||!e.component)return;e.component.content.descriptionWidgets=t.payload.comps;break;case"moveComponentWithinOrigin":{let{from:o,to:n}=t.payload,i=null==e?void 0:null===(v=e.data)||void 0===v?void 0:null===(p=v.toc)||void 0===p?void 0:null===(c=p.categories)||void 0===c?void 0:null===(d=c[o.parentIndex])||void 0===d?void 0:d.pages;return i.splice(n.itemIndex,0,i.splice(o.itemIndex,1)[0]),e.dirty=!0,e}case"moveCategory":{let{from:o,to:n}=t.payload,i=null==e?void 0:null===(_=e.data)||void 0===_?void 0:null===(m=_.toc)||void 0===m?void 0:null===(g=m.categories)||void 0===g?void 0:g[o.itemIndex];return e.data.toc.categories.splice(o.itemIndex,1),e.data.toc.categories.splice(n.itemIndex,0,i),e.dirty=!0,e}case"moveComponentToNotEmptyCategory":{let{from:o,to:n}=t.payload,i=null==e?void 0:null===(y=e.data.toc)||void 0===y?void 0:y.categories;return i[n.parentIndex].pages.splice(n.itemIndex,0,i[o.parentIndex].pages.splice(o.itemIndex,1)[0]),e.dirty=!0,e}case"removeComponent":{let{category_id:o,article_id:n}=t.payload,i=(0,j.QY)(null==e?void 0:null===(S=e.data)||void 0===S?void 0:null===(C=S.toc)||void 0===C?void 0:C.categories,o),r=(0,j.QY)(null==e?void 0:null===(O=e.data)||void 0===O?void 0:null===(b=O.toc)||void 0===b?void 0:null===(N=b.categories)||void 0===N?void 0:null===(E=N[i])||void 0===E?void 0:E.pages,n);return e.data.toc.categories[i].pages.splice(r,1),e}case"removeCategory":{let o=(0,j.QY)(null==e?void 0:null===(k=e.data)||void 0===k?void 0:null===(P=k.toc)||void 0===P?void 0:P.categories,t.payload.id);if(-1===o)return;return e.data.toc.categories.splice(o,1),(null==e?void 0:null===(U=e.data)||void 0===U?void 0:null===(R=U.toc)||void 0===R?void 0:null===(D=R.categories)||void 0===D?void 0:D.length)||(e.data.toc=(0,j.qH)(u.j.PROJECT_CATEGORY)),e}case"updateProjectDetails":return e.data.content=t.payload,e;
1case"updateComponentETag":{let{[f.Zq]:o,saved:n}=t.payload;return e.component=null!==(M=e.component)&&void 0!==M?M:null,null!=e.component&&(e.component[f.Zq]=o),n&&(e.dirty=!1),e}case"setComponent":{let{data:o,[f.Zq]:n}=t.payload;return e.component=(0,I.v5)(o),e.component[f.Zq]=n,e}case"setRestoredComponent":e.component&&(e.component=(0,I.v5)({content:t.payload.data}),e.component.snapshot_loaded=!0);break;case"clearRestoredComponent":e.component=(0,I.v5)({}),e.component.snapshot_loaded=!1;break;case"clearSnapshotLoaded":e.component&&(e.component.snapshot_loaded=!1);break;case"postProjectSave":return e.data[f.Zq]=t.payload,e;case"setDirty":e.dirty=t.payload;break;case"clearComponent":return e.component=null,e;case"updateETag":e.data||(e.data={}),e.data[f.Zq]=t.payload;break;case"updateComponentCode":{let{payload:o}=t;if(!e.component)return e;if(e.dirty=!0,"function"==typeof o)return o(e.component.content.codeContent),e;return e.component.content.codeContent={...e.component.content.codeContent,...o,comp_id:(null===(F=e.component.content.codeContent)||void 0===F?void 0:F.comp_id)||(0,i.x0)()},e}case"updateProtectedContent":return e.dirty=!0,e.component&&(e.component.content.protected_content=t.payload),e;case"updateComponentURL":return e.dirty=!0,e.component&&(e.component.content.url=t.payload),e;case"updateCodeContentInViewMode":{let o=e.component.content.codeContent;return e.component.content.codeContent={...o,...t.payload},e}case"updateCodingEnv":{let{payload:o}=t;switch(e.component.content.type=o,o){case w.hf.SPA:e.component.content.codeContent={...L.Z,isProject:!0},e.component.content.url=null;break;case w.hf.CODE:e.component.content.codeContent={...T.Z,isProject:!0},e.component.content.url=null;break;case w.hf.WORKSPACE:e.component.content.codeContent={},e.component.content.url=null;break;case w.hf.TERMINAL:e.component.content.codeContent={selectedEnvVars:{}},e.component.content.url=null;break;case w.hf.RUNJS:e.component.content.codeContent={...x.Z,isProject:!0},e.component.content.url=null;break;case w.hf.CODE_EVALUATION:e.component.content.codeContent={...A.content,isProject:!0},e.component.content.protected_content=A.protectedContent,e.component.content.url=null;break;default:e.component.content.codeContent={},e.component.content.url=""}return e.component.content.codeContent.comp_id=(0,i.x0)(),e.dirty=!0,e}case"updateProjectDifficulty":e.component.difficulty=t.payload,e.dirty=!0;break;case"updateProjectWidgetComponent":{let{component:o,index:n}=t.payload;e.data.content.description[n]=o;break}case"updateProjectComponentWidget":{let{component:o,index:n}=t.payload;e.component.content.descriptionWidgets[n]=o;break}case"clearProjectComponentWidgets":if(!e.loaded||!(null==e?void 0:null===(Z=e.component)||void 0===Z?void 0:Z.content))return;e.component.content.descriptionWidgets=[];break;case"updateRelevantCourses":return e.data.relevant_courses=t.payload,e.dirty=!0,e;case"updatePreReqProjects":e.data.pre_requisite_projects=t.payload,e.dirty=!0;break;case"updatePreReqs":return e.data.pre_reqs=t.payload,e.dirty=!0,e;case"updateProjectSubType":e.data.sub_type=t.payload,e.dirty=!0;break;case"setProject":e.data=t.payload.data,e.component=t.payload.component,e.loaded=!0}},Y=s.createContext({loaded:!1}),Q=s.createContext(null);function X(e){let{children:t}=e,[i,a]=(0,c.C)(K,{loaded:!1}),l=(0,U.TL)(),u={clear:()=>a({type:"clear"}),rejected:e=>a({type:"rejected",payload:e}),pending:()=>a({type:"pending"}),fulfilled:e=>a({type:"fulfilled",payload:e}),updateETag:e=>a({type:"updateETag",payload:e}),updateProjectTitle:e=>a({type:"updateProjectTitle",payload:e}),addUserDataResourceFile:e=>a({type:"addUserDataResourceFile",payload:e}),updateUserDataResourceFile:e=>a({type:"updateUserDataResourceFile",payload:e}),removeUserDataResourceFile:e=>a({type:"removeUserDataResourceFile",payload:e}),addComponent:e=>a({type:"addComponent",payload:e}),addCategory:e=>a({type:"addCategory",payload:e}),toggleTaskVisibility:e=>a({type:"toggleTaskVisibility",payload:e}),updateCategoryTitle:e=>a({type:"updateCategoryTitle",payload:e}),updateComponentTitle:e=>a({type:"updateComponentTitle",payload:e}),updateComponentComps:e=>a({type:"updateComponentComps",payload:e}
1),moveComponentWithinOrigin:e=>a({type:"moveComponentWithinOrigin",payload:e}),moveCategory:e=>a({type:"moveCategory",payload:e}),moveComponentToNotEmptyCategory:e=>a({type:"moveComponentToNotEmptyCategory",payload:e}),removeComponent:e=>a({type:"removeComponent",payload:e}),removeCategory:e=>a({type:"removeCategory",payload:e}),updateProjectDetails:e=>a({type:"updateProjectDetails",payload:e}),updateComponentETag:e=>a({type:"updateComponentETag",payload:e}),setComponent:e=>a({type:"setComponent",payload:e}),setRestoredComponent:e=>a({type:"setRestoredComponent",payload:e}),clearRestoredComponent:()=>a({type:"clearRestoredComponent"}),clearSnapshotLoaded:()=>a({type:"clearSnapshotLoaded"}),postProjectSave:e=>a({type:"postProjectSave",payload:e}),setDirty:e=>a({type:"setDirty",payload:e}),clearComponent:()=>a({type:"clearComponent"}),updateComponentCode:e=>a({type:"updateComponentCode",payload:e}),updateProtectedContent:e=>a({type:"updateProtectedContent",payload:e}),updateComponentURL:e=>a({type:"updateComponentURL",payload:e}),updateCodeContentInViewMode:e=>a({type:"updateCodeContentInViewMode",payload:e}),updateCodingEnv:e=>a({type:"updateCodingEnv",payload:e}),updateProjectDifficulty:e=>a({type:"updateProjectDifficulty",payload:e}),updateProjectWidgetComponent:e=>a({type:"updateProjectWidgetComponent",payload:e}),updateProjectComponentWidget:e=>a({type:"updateProjectComponentWidget",payload:e}),clearProjectComponentWidgets:()=>a({type:"clearProjectComponentWidgets"}),updateRelevantCourses:e=>a({type:"updateRelevantCourses",payload:e}),updatePreReqProjects:e=>a({type:"updatePreReqProjects",payload:e}),updatePreReqs:e=>a({type:"updatePreReqs",payload:e}),updateProjectSubType:e=>a({type:"updateProjectSubType",payload:e}),setProject:e=>a({type:"setProject",payload:e})},p={load:e=>{let{authorId:t,collectionId:n,projectId:i,courseUrlSlug:a="",pageUrlSlug:l="",mode:s,lockedPreview:d=!1}=e,c=a&&l?"project/".concat(a,"/").concat(l):"project/".concat(t,"/").concat(n,"/").concat(i),p="view"===s?c:"author/".concat(t,"/collection/").concat(n,"/project/").concat(i);return d&&(p+="?lockedPreview=true"),u.pending(),(0,r.Z)({url:"/api/".concat(p),type:"GET"},!0).then(e=>{let{data:t,xhr:o}=e;u.fulfilled((0,O.O)({data:t})),t&&u.updateETag(o.headers.get(f.Zq))}).catch(e=>{e.status===N.Wy.unauthorizedException?(0,W.xc)():e.status===N.Wy.notFoundException&&(0,o.g.setNotFound)({notFoundPageStatus:!0}),u.rejected((0,G.n)(e))})},save:e=>{let{project:t}=e;return C((0,I.f4)(t)).then(e=>{e&&u.postProjectSave(e.xhr.headers.get(f.Zq))})},prepareDockerOnSetProject:async(e,t,o)=>{var n,i;let r=(null==e?void 0:e.docker)?{...e.docker,envs:null!==(n=e.docker.envs)&&void 0!==n?n:[]}:F.s4,a=await (0,Z.w)(o,t),s={...r,container:{...r.container,liveInstance:a}};H.Z.getState().setObject(s);let d=(null==e?void 0:e.testing_docker)?{...e.testing_docker,envs:null!==(i=e.testing_docker.envs)&&void 0!==i?i:[]}:F.s4;l(D.h.setObject(d))},saveComponent:e=>{let{component:t}=e;return y(t).then(e=>{e&&u.updateComponentETag({[f.Zq]:e.xhr.headers.get(f.Zq),saved:!0})})},loadComponent:e=>g(e).then(e=>{if(null==e?void 0:e.data){let t=(0,I.v5)(JSON.parse(e.data));return(0,d.flushSync)(()=>u.setComponent({data:t,[f.Zq]:e.xhr.headers.get(f.Zq)})),t}}),loadComponentSnapshot:(e,t,o)=>{(0,m.v)(e,t,o,h.q.PROJECT_COMPONENT).then(e=>{if(null==e?void 0:e.data){let t=JSON.parse(e.data);return u.setRestoredComponent({data:t}),t}})},loadUserProgress:e=>_(e).then(e=>(null==e?void 0:e.data)?JSON.parse(e.data):null).catch(e=>console.log("Error loading user code",e)),saveUserProgress:e=>S(e).catch(e=>{l(R.n.show(b.ad,{status:"ERROR",text:"Failed to Save User Project"}))})};return s.useEffect(()=>(o.g.project=i,()=>{delete o.g.project}),[i]),s.useEffect(()=>(o.g.project=i,()=>{delete o.g.project}),[i]),s.useEffect(()=>{o.g.projectActions={...u,...p}}),(0,n.jsx)(Q.Provider,{value:{...u,...p},children:(0,n.jsx)(Y.Provider,{value:i,children:t})})}let $=()=>s.useContext(Y),ee=()=>s.useContext(Q),et=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(i,r)=>{t&&(n?i(t):t()),i(R.n.show(b.ad,{status:"WAIT",text:"Saving"}));let a=null==e?void 0:e.copyWidgets,l=null==e?void 0:e.slateComps,s=o.g.project.data.content.description;if(a){var d;s=l||(0,I.GD)(null!==(d=r().widgets.entities)&&void 0!==d?d:{})}let c=o.g.projectActions;return c.save({project:{...o.g.project.data,content:{description:s},docker:JSON.stringify((0,F.qZ)(H.Z.getState())),testing_docker:JSON.stringify((0,F.qZ)(r().testingDockerDetails)),is_landing_page_containing_link:(0,J.U)(l)}}).then(()=>{i(R.n.show(b.ad,{status:"SUCCESS",text:"Saved"})),a&&c.updateProjectDetails({description:s}),(null==e?void 0:e.resetDirty)&&c.setDirty(!1),i(M.o.resetDirtyBit())}).catch(e=>{var o;(0,W.rU)(e,i,void 0,[N.Wy.notFoundException]);let n=null==e?void 0:null===(o=e.responseJSON)||void 0===o?void 0:o.errorText;e.status===N.Wy.AlreadyExistsException&&n===N.pX.versionOutDatedMessage?i(eo(()=>{c.updateETag(p.F),i(et(void 0,t))})):i(R.n.show(b.ad,{status:"ERROR",text:n||"Failed to save project"}))})}},eo=e=>t=>{t(R.n.close()),t(R.n.show(b.zN,{onConfirm:e,cancelText:"Cancel",confirmText:"Save",title:"Conflicts",description:"The content you are editing has changed. The previous changes will be overwritten. Are you sure you want to save?"}))},en=function(e,t,o,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7?arguments[7]:void 0;return s=>{s(R.n.show(b.fL,{title:e,url:"".concat((0,q.zw)()).concat(a?(0,k.Z)(a,t,o,n):i&&r?"/projects/".concat(r):(0,I.Qk)(t,o,n,void 0,void 0)),authorId:t,collectionId:o,callback:l,workId:n,palGroupSlug:a}))}},ei=e=>{let{firstProjectComponentId:t,projectId:o,authorId:n,collectionId:i,pathAuthorId:r,pathId:a,isReview:s,courseUrlSlug:d=null,isStandaloneProject:c=!1}=e;return e=>(0,v.$)(n,i,o).then(()=>{let e=(0,E.Z)({authorId:n,collectionId:i,id:t,projectId:o,courseUrlSlug:d,parentWorkAuthorId:r,parentWorkId:a,isCollaboratorReviewMode:s,isStandaloneProject:c}).projectComponentViewUrl.href;l().push(e)})}},20534:function(e,t,o){"use strict";o.d(t,{L:function(){return l}});var n=o(931549),i=o(44194);let r={},a=(e,t)=>{switch(t.type){case"change":return{...e,...t.payload};case"fulfilled":return t.payload;case"clear":return r;case"updateShotTags":return{...e,tags:t.payload};default:return e}},l=i.createContext({shotSummary:{}
1,shotSummaryDispatch:e=>{let{type:t,payload:o}=e}});t.Z=e=>{let{children:t}=e,[s,d]=(0,i.useReducer)(a,r);return o.g.shotSummaryDispatch=d,(0,n.jsx)(l.Provider,{value:{shotSummary:s,shotSummaryDispatch:d},children:t})}},810456:function(e,t,o){"use strict";o.d(t,{Gq:function(){return a},J3:function(){return r}});var n=o(931549),i=o(44194);let r=i.createContext({activeTermID:"",setActiveTermID:e=>{}});t.ZP=e=>{let{children:t}=e,[o,a]=i.useState("");return(0,n.jsx)(r.Provider,{value:{activeTermID:o,setActiveTermID:e=>{a(e)}},children:t})};let a=()=>(0,i.useContext)(r)},592459:function(e,t,o){"use strict";o.d(t,{w:function(){return r},z:function(){return s}});var n=o(128839);let i={v5:"5.0",v6:"6.0",v7:"7.0"},r="8.0",a=(0,n.ZP)((e,t)=>{e.entryFileName=t,e.version=i.v6}),l=(0,n.ZP)((e,t)=>{var o,n,r,a;let l=null==e?void 0:e.docker;0===Object.keys(null!=l?l:{}).length&&(e.docker=t);let s=null==e?void 0:null===(o=e.dockerJob)||void 0===o?void 0:o.inputFileName,d=null==e?void 0:null===(n=e.dockerJob)||void 0===n?void 0:n.key;if(s)e.entryFileName=s;else if(d){let t=null==e?void 0:null===(a=e.docker)||void 0===a?void 0:null===(r=a.jobs)||void 0===r?void 0:r.find(e=>e.key===d);t&&(e.entryFileName=t.inputFileName)}e.version=i.v7}),s=(e,t,o)=>{let{version:n}=e;return n===r||parseFloat(n)===parseFloat(i.v7)?e:parseFloat(n)===parseFloat(i.v6)?l(e,t):parseFloat(n)<=parseFloat(i.v5)?l(a(e,o),t):e}},929819:function(e,t,o){"use strict";o.d(t,{h:function(){return n}});let n=(e,t)=>100*Number(e.some(e=>(null==t?void 0:t[e])&&!1!==t[e].completed))},253094:function(e,t,o){"use strict";o.d(t,{DS:function(){return d},TW:function(){return p},ZI:function(){return u},lV:function(){return c}});var n=o(226142),i=o(263025),r=o(520649),a=o(161514),l=o(15096);let s=(e,t)=>"/checkout/".concat(l.vl.CERTIFICATE_PURCHASE,"?plan=").concat(e,"_").concat(t),d=e=>{var t;return!!e&&(!e.is_priced||0===(null!==(t=e.discounted_price)&&void 0!==t?t:e.price))},c=(e,t,o,n)=>{var i,r,l,d;let c=null!==(l=null==e?void 0:null===(i=e.instance)||void 0===i?void 0:i.details.author_id)&&void 0!==l?l:o,u=null!==(d=null==e?void 0:null===(r=e.instance)||void 0===r?void 0:r.details.collection_id)&&void 0!==d?d:n;(0,a.Z)("BUY","BUY_CERTIFICATE_INIT_LESSON_PAGE"),t.push(s(c,u))},u=(e,t,o,a,l,s,d)=>(0,i.H)(e,t,a).then(i=>{let c=JSON.parse(i),u="/certificates?showModal=open";if(l){var p;let o=null!==(p=c.short_id)&&void 0!==p?p:new n.Z().encode(parseInt(e),parseInt(t),parseInt(l),c.revision);u+="&certificateHash=".concat(o)}let h=a===r.dL.PATH?s===r.Ss.LEARNING_PLAN?"#learning-plan":"#path":d===r.dL.STANDALONE_PROJECT?"#standalone-project":d===r.dL.STANDALONE_CLOUD_LAB?"#cloud-lab":"";o.push(u+h)}).catch(()=>o.push("/certificates?author_id=".concat(e,"&work_id=").concat(t,"&work_type=").concat(a))),p=e=>"".concat(e===r.dL.COLLECTION?"Course":e===r.dL.STANDALONE_PROJECT?"Project":e===r.dL.STANDALONE_CLOUD_LAB?"Cloud Lab":e===r.Ss.REGULAR?"Path":"Personalized Path")},918606:function(e,t,o){"use strict";o.d(t,{Ui:function(){return v},gZ:function(){return m},jh:function(){return h}});var n=o(210568),i=o(283490),r=o(102871),a=o(907209),l=o(198144),s=o(95992),d=o(290442);let c="/edu-diagnose-network",u={UNKNOWN_ERROR:"Something went wrong. "},p={NORMAL_MSG:"ed-diagnose-msg",NORMAL_RESPONSE:"ed-ws-close",ERROR_RESPONSE:"ed-ws-error"},h={OK:200,FORBIDDEN:418,TIMEOUT:455,SERVER_ERROR:500},v=(e,t)=>
1{if(!e)throw Error("Invalid host for reqId: ".concat(t));let o="Req Details host: ".concat(e,", reqId: ").concat(t),n=new URL(c,"https://"+(0,a._Y)(e)),r=i.operation({retries:3,factor:1});return new Promise((e,i)=>{r.attempt(async()=>{let a=new AbortController;setTimeout(()=>a.abort(),3e3);try{let i=await fetch(n.href,{method:"GET",referrerPolicy:"no-referrer-when-downgrade",headers:{"X-Ed-Diagnose-HTTP":t},signal:a.signal});if(i.ok||i.status===h.FORBIDDEN)try{let t=await i.json();return e(t)}catch(e){}let r=await i.text(),l=Error("Client Response:\n"+r+o+"\nstatus code:"+i.status);throw i.status===h.SERVER_ERROR?l.status=h.SERVER_ERROR:l.status=h.FORBIDDEN,l}catch(t){if(r.retry(t||!0))return;let e=t;t instanceof DOMException&&(null==t?void 0:t.name)==="AbortError"&&((e=Error("Request timed out."+o)).status=h.TIMEOUT),i(e)}})})},g=(e,t,o)=>{if(!e)throw Error("Invalid host for reqId: ".concat(t,", vmPass: ").concat(!!o));let i=(0,s.Z)()||(0,d.Z)()?console:{info:()=>{},error:()=>{}},r="wss://"+(0,a._Y)(e),h=new URL(c,r);h.searchParams.set("wsDiagnose",t);let v=(0,l.jw)(h.href,o),g=new n.Z(v,o,{minReconnectionDelay:2e3,maxRetries:3});return new Promise((e,n)=>{let a="Req Details host: ".concat(r,", \nreqId: ").concat(t,", \nvmPassword: ").concat(!!o,"\n"),l=setTimeout(()=>{g.close(),n(Error("Request timed out."+a))},18e3),{close:s}=g;g.close=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];clearTimeout(l),s.call(g,...t)};let d=0,c=0,v=!1,m=null;g.onopen=()=>{i.info("Connected to ",h.href)},g.onmessage=e=>{try{let{type:t,message:o}=JSON.parse(e.data);if(t===p.NORMAL_MSG){i.info("Received:",o),g.send(JSON.stringify({type:p.NORMAL_MSG,message:"count: ".concat(c++)}));return}if(t===p.ERROR_RESPONSE)v=!0,g.send(JSON.stringify({type:p.ERROR_RESPONSE}));else if(t===p.NORMAL_RESPONSE)i.info("Test Successful."),g.send(JSON.stringify({type:p.NORMAL_RESPONSE}));else{i.info("Unknown message:",e.data);return}m=o;return}catch(t){i.info(a+"Error:",t);let e=Error("Ws diagnostic failed."+a+t);g.close(),n(e)}},g.onclose=t=>{var o,r,l;let s="\ncode: ".concat((null==m?void 0:m.status)||t.code,", \nreason: ").concat(t.reason,", \nurl: ").concat(null===(o=t.target)||void 0===o?void 0:o.url,", \ncount: ").concat(c,", \nprotocol: ").concat(void 0===(null===(r=t.target)||void 0===r?void 0:r.protocol)?"none":!!(null===(l=t.target)||void 0===l?void 0:l.protocol));if(i.info("Closed:",s),4e3===t.code)return(g.close(),m)?(v?(m.error=s,m.status||(m.status=4001)):m.status=t.code,e(m)):n(Error("Expected a response."+a+s));3==++d&&(g.close(),n(Error(u.UNKNOWN_ERROR+a+s)))}})},m=e=>({status:e.status,reason:e.reason||u.UNKNOWN_ERROR,request_id:e.reqId,origin:e.origin,user_ip:e.userIP,host:e.host,referer:e.referer,forwarded_host:e.proxyHost,forwarded_for:e.forwardedFor,user_agent:e.userAgent,location:e.location,error:e.error}),_=async(e,t,o,n,i,a,s)=>{var d,c;let u=null===(c=window)||void 0===c?void 0:null===(d=c.location)||void 0===d?void 0:d.href,p={},_={};try{p=await v(e,o)}catch(e){p.status=e.status?e.status:h.FORBIDDEN,p.error=e.message}try{_=await g(e,o,t)}catch(e){_.status=4002,_.error=e.message}p.reqId=p.reqId||o,_.reqId=_.reqId||o,p.host=p.host||e,_.host=_.host||e,p.location=_.location=u,(0,l.Nb)(s,i,a,n,{[r.N.HTTP_DIAGNOSE_RESULT]:m(p),[r.N.WS_DIAGNOSE_RESULT]:m(_)})};t.ZP=_},653014:function(e,t,o){"use strict";o.d(t,{$5:function(){return U},$U:function(){return V},$Y:function(){return A},A:function(){return P},BA:function(){return Z},CF:function(){return L},DT:function(){return m},GN:function(){return eo},GR:function(){return z},Gg:function(){return b},Ho:function(){return K},Ik:function(){return F},Is:function(){return O},Lk:function(){return X},MD:function(){return B},Ni:function(){return D},OQ:function(){return Q},Ts:function(){return y},X7:function(){return j},Xo:function(){return I},Y6:function(){return J},YL:function(){return q},Yf:function(){return H},bO:function(){return _},bz:function(){return W},cf:function(){return Y},g9:function(){return G},gA:function(){return R},gk:function(){return N},kl:function(){return M},m_:function(){return en},mc:function(){return T},nW:function(){return k},oN:function(){return $},q6:function(){return x},s$:function(){return ee},vp:function(){return w},xE:function(){return f}});var n=o(494296),i=o(881762),r=o(283490),a=o(520649),l=o(970179),s=o(148910),d=o(198144),c=o(810343),u=o(219808);let p=function(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return(0,i.Z)(e,...o).then(JSON.parse)},h="ed-allocate-auth",v="ed-vm-pass",g="ed-allocate-auth-android",m={OFFLINE:"SOCKET_OFFLINE",CONNECTED:"SOCKET_CONNECTED",DISCONNECTED:"SOCKET_DISCONNECTED",TERMINATED:"SOCKET_TERMINATED",FORCE_CLOSED:"SOCKET_FORCE_CLOSED"},_={OFFLINE:"CONTAINER_OFFLINE",ALLOCATING:"ALLOCATING",ALLOCATED:"ALLOCATED",ALLOCATION_FAILED:"ALLOCATION_FAILED",WAITING_FOR_SOCKET_CONNECT:"WAITING_FOR_SOCKET_CONNECT",WAITING_FOR_DAEMON:"WAITING_FOR_DAEMON",PULLING_IMAGE:"PULLING",IMAGE_PULLED:"PULLED",PULL_FAILED:"PULL_FAILED",DAEMON_FAILED:"DAEMON_FAILED",UPDATING:"UPDATING",UPDATED:"UPDATED",UPDATE_FAILED:"UPDATE_FAILED",PING_APP_FAILED:"PING_APP_FAILED",NO_RESPONSE:"NO_RESPONSE",RUNNING:"RUNNING"},f={ALLOCATION_FAILED:"Resources allocation failed!",PULL_FAILED:"Failed to pull image!",DAEMON_FAILED:"Failed to configure live container!",UPDATE_FAILED:"Failed to update app with your code!",PING_APP_FAILED:"Failed to ping the app!",NO_RESPONSE:"App failed to respond!"},y={CONNECTION_FAILED:"\x1b[1;31mConnection Failed: Run again to reconnect.",TERMINAL_DISCONNECTED:"\x1b[1;31mTerminal Disconnected: Run again to reconnect."},C={COMPLETED:101,TIMED_OUT:102,ERRORED:103},S="ED_ALLOCATE_DATA",E="MISSING_REQUEST_ID",T="allocate-live-container",x="Test execution failure. Please try again.",L="educative",N="aws-cli",b=e=>e===_.ALLOCATING,w=e=>e===_.ALLOCATED,O=e=>e===_.ALLOCATION_FAILED,I=e=>e===_.PULLING_IMAGE,P=e=>e===_.IMAGE_PULLED,A=e=>e===_.PULL_FAILED,j=e=>e===_.WAITING_FOR_DAEMON,k=e=>e===_.DAEMON_FAILED,D=e=>e===_.UPDATING,R=e=>e===_.UPDATED,U=e=>e===_.UPDATE_FAILED,M=e=>e===_.RUNNING,F=e=>O(e)||k(e)||U(e),Z=e=>!F(e)&&!R(e)&&!M(e),q=e=>!M(e)&&e!==_.UPDATED,W=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,s.E)(e,t)&&(e.forceRelaunchOnCompChange||e.forceRelaunchOnRun)},G=e=>{var t;window.pendingFetchRequests||(window.pendingFetchRequests={}),null===(t=window.pendingFetchRequests[e])||void 0===t||t.abort();let o=(0,n.x0)();return window.pendingFetchRequests[e]=new AbortController,window.pendingFetchRequests[e].abortId=o,o},H=(e,t)=>{var o,n,i;return(null===(i=window)||void 0===i?void 0:null===(n=i.pendingFetchRequests)||void 0===n?void 0:null===(o=n[e])||void 0===o?void 0:o.abortId)!==t},J={ALLOCATE:"allocate_time",ALLOCATE_ANDROID:"allocate_android_time",RUN:"execution_time",TEST:"test_results_time",POLL_IND:"poll_ind_time",APP_LAUNCH:"app_launch_time",WS_CONNECT:"websocket_connect_time"},B={ALLOCATE:"ALLOCATE",ALLOCATE_ANDROID:"ALLOCATE_ANDROID",RUN:"RUN",TEST:"TEST",POLL_IND:"POLL_IND",APP_LAUNCH:"APP_LAUNCH",WS_CONNECT:"WS_CONNECT"},V=async e=>{let{requestLabel:t,touchPoint:o,status:n,attempt:r=null,requestTime:a=null,errorText:l=null,totalTests:s=null,passedTests:d=null,newRequestId:p=null}=e;try{let{requestId:e=p||E,allocateId:c,userId:h,authorId:v,workId:g,workType:m,pageId:_,compId:f,compType:y,isDraft:C,isSocketConnected:T,envCount:x,populatedEnvCount:L}=JSON.parse((0,u.rV)(S)||"{}");if(o===B.WS_CONNECT){if(T)return;(0,u.LS)(S,JSON.stringify({requestId:e,allocateId:c,userId:h,authorId:v,workId:g,workType:m,pageId:_,compId:f,compType:y,isDraft:C,isSocketConnected:!0,envCount:x,populatedEnvCount:L}))}let N={request_id:p||e||E,user_id:h,author_id:v,work_id:g,work_type:m,page_id:_,comp_id:f,comp_type:y,performance_report:JSON.stringify({[t]:a,attempt_count:r}),interaction_map:JSON.stringify({allocate_id:c,status:n,error_text:l,interaction_source:"WEBAPP",interaction_touch_point:o,is_draft:C,test_total_count:s,test_passed_count:d,env_count:x,populated_env_count:L})};await (0,i.Z)({url:"/api/instances/log-interaction",data:N,type:"POST"})}catch(e){(0,c.u)(Error("Could not log live interaction. Status: ".concat(e.status)))}},z=async function(e){var t,o,n,i,r;let{authorId:a,workId:l,workType:s,draft:d,containerInfo:c,pageType:g=null,pageId:m=null,subDocumentId:f=null,compType:y=null,attempt:C=null,userId:E=null,compId:x=null,allocateRequestId:L=null}=e,N=arguments.length>1&&void 0!==arguments[1]&&arguments[1],b=Date.now(),w=(null==c?void 0:null===(t=c.envs)||void 0===t?void 0:t.length)||0,O=(null==c?void 0:null===(o=c.envs)||void 0===o?void 0:o.filter(e=>e.value).length)||0;try{let e=null===(n=window.pendingFetchRequests)||void 0===n?void 0:n[T];if(!a||!l)return{};let{vm_status:t,request_id:o,vm_password:i,allocate_id:r,allocate_auth:_}=await p({url:"/api/instances/".concat(a,"/").concat(l,"/allocate"),type:"POST",data:{work_type:s,page_type:g,draft:d,container_info:JSON.stringify(c),page_id:m,sub_document_id:f,comp_type:y,request_id:L}},!1,!0,!0,!1,null==e?void 0:e.signal);return(0,u.LS)(h,_),(0,u.LS)(v,i),(0,u.LS)(S,JSON.stringify({requestId:L,allocateId:r,userId:E,authorId:a,workId:l,workType:s,pageId:f||m,compId:x,compType:y||g,isDraft:d,isSocketConnected:!1,envCount:w,populatedEnvCount:O})),V({requestLabel:J.ALLOCATE,touchPoint:B.ALLOCATE,requestTime:Date.now()-b,status:200,attempt:C}),{instanceStatus:t,requestId:o,vmPassword:i}}catch(e){if((0,u.LS)(S,JSON.stringify({requestId:L,allocateId:null==e?void 0:null===(i=e.responseJSON)||void 0===i?void 0:i.allocate_id,userId:E,authorId:a,workId:l,workType:s,pageId:f||m,compId:x,compType:y||g,isDraft:d,envCount:w,populatedEnvCount:O})),V({requestLabel:J.ALLOCATE,touchPoint:B.ALLOCATE,requestTime:Date.now()-b,status:e.status,errorText:null==e?void 0:null===(r=e.responseJSON)||void 0===r?void 0:r.errorText,attempt:C}),N)throw e;return{instanceStatus:_.ALLOCATION_FAILED}}},K=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let o=new URL(e);return o.searchParams.set(h,(0,u.rV)(t?g:h)),o.toString()}catch(t){return e}},Y=e=>{let t=(0,u.rV)(v);return{...e,[d.UL]:t}},Q=async e=>{let{authorId:t,workId:o,workType:n,draft:i,emulator:r,pageId:l,compId:s,compType:d}=e;try{if(!t||!o)return{};let e=await p({url:"/api/instances/".concat(null!=n?n:a.dL.COLLECTION,"/").concat(t,"/").concat(o,"/allocate-android"),type:"POST",data:{draft:i,emulator:r,page_id:l,comp_id:s,comp_type:d}});return e.allocate_auth&&(0,u.LS)(g,e.allocate_auth),e}catch(e){var c;return{status:_.ALLOCATION_FAILED,errorText:null==e?void 0:null===(c=e.responseJSON)||void 0===c?void 0:c.errorText}}},X=async e=>{let{instanceId:t,requestId:o}=e,n={url:"/api/instances/".concat(t,"/image/status?request_id=").concat(o||""),type:"GET"};try{return{instanceStatus:(await p(n)).status}}catch(e){return{instanceStatus:_.PULL_FAILED}}},$=async e=>{let{instanceId:t,requestId:o}=e;if(!t)return(0,c.u)(Error("InstanceId is undefined for the request ".concat(o))),{instanceStatus:_.DAEMON_FAILED};let n={url:"/api/instances/".concat(t,"/int-daemon/status?request_id=").concat(o||""),type:"GET"};try{return{instanceStatus:(await p(n)).status}}catch(e){return{instanceStatus:_.DAEMON_FAILED}}},ee=async e=>{let{authorId:t,inEditor:o,workId:n,pageId:i,docId:r,documentType:a,containerInfo:l,debugMode:s=!1}=e;if(!t||!n)throw Error("authorId , workId are required!");let d={type:"POST",url:"/api/instances/".concat(t,"/").concat(n,"/").concat(i,"/").concat(r,"/run_tests"),data:{document_type:a,is_editor:o,container_info:JSON.stringify(l),is_debug_mode:s}};try{let{testing_container_status:e,attempt_count:t,request_id:o}=await p(d);if(e!==_.ALLOCATED)return{testingContainerStatus:_.ALLOCATION_FAILED};return{attemptCount:t,requestId:o,testingContainerStatus:e}}catch(e){return(0,c.u)(Error("Request for Live Testing Container failed with Error:".concat(e))),{testingContainerStatus:_.ALLOCATION_FAILED}}},et=async e=>{let{authorId:t,workId:o,pageId:n,docId:i,documentType:r,attemptCount:a,inEditor:l}=e;try{if(!r||!a)throw Error("Document Type and Attempt Count are required!");let{live_test_status:e,results:s,request_id:d}=await p({url:"/api/instances/".concat(t,"/").concat(o,"/").concat(n,"/").concat(i,"/test-results?document_type=").concat(r,"&attempt_count=").concat(a,"&is_editor=").concat(l),type:"GET"});return{liveTestStatus:e,results:s,requestId:d}}catch(e){var s;throw(null==e?void 0:null===(s=e.responseJSON)||void 0===s?void 0:s.errorText.
1includes("Provided attempt count"))||(0,c.u)(Error("Request for Polling Live Test failed with Error:".concat(JSON.stringify(e)))),e}},eo=()=>r.operation({retries:150,minTimeout:2e3,factor:1}),en=async(e,t,o,n,i)=>{let{authorId:r,collectionId:a,pageId:s,docId:d,pageType:c,attemptCount:u,inEditor:p}=e,h=e=>{let{results:t,error:n}=e,r=i?Date.now()-i:null;V({requestLabel:J.TEST,touchPoint:B.TEST,requestTime:r,status:n?500:200,errorText:n,attempt:u,totalTests:null==t?void 0:t.total_tests,passedTests:null==t?void 0:t.passed_tests}),o({results:t,error:n})};t.attempt(async()=>{try{let{liveTestStatus:e,results:o}=await et({authorId:r,workId:a,pageId:s,docId:d,documentType:c,attemptCount:u,inEditor:p});e===C.COMPLETED?(h({results:o,error:null}),n&&c===l.q.ASSESSMENT_QUESTION&&n()):e===C.ERRORED?h({results:o,error:(null==o?void 0:o.failure_description)||"Something went wrong. Please Contact Support"}):e!==C.TIMED_OUT&&t.retry(!0)||h({results:null,error:"Max time-limit reached for Live Testing."})}catch(e){h({results:null,error:"Something went wrong. Please try again."})}})}},426477:function(e,t,o){"use strict";o.d(t,{MY:function(){return v},No:function(){return L},_b:function(){return x}});var n=o(881762),i=o(283490),r=o(102871),a=o(227595),l=o(198144),s=o(918606),d=o(290442),c=o(830006),u=o(286889),p=o(726803);let h={DEFAULT:"educative.run",DEVPATH:"devpath.run",PROXY:"proxy"},v={RUN:"RUN",JUDGE:"JUDGE",SUBMIT:"SUBMIT"},g="EXECUTIONS-AUTH-TOKEN",m=async()=>{try{let{token:e}=JSON.parse(await (0,n.Z)({url:"/api/code/authenticate",type:"GET"}));return(0,p.LS)(g,e),e}catch(e){}},_=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;if(!t){let e=(0,p.rV)(g);if(e)return e}return await m()},f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;let o=(0,p.rV)(g);return t||!o?(m(),null):o},y="EXECUTIONS_TARGET",C=()=>{try{let{target:e,expiry:t}=JSON.parse((0,p.rV)(y)||"{}");if(!e||e===h.DEFAULT)return h.DEFAULT;if(Date.now()<t)return e;return S(),h.DEFAULT}catch(e){return h.DEFAULT}},S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.DEFAULT;try{(0,p.LS)(y,JSON.stringify({target:e,expiry:e!==h.DEFAULT?Date.now()+36e5:0}))}catch(e){}},E=function(e,t,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return(0,n.Z)({url:"/api/code/proxy",data:{...t,endpoint:e},type:"POST"}).then(n=>(x({endpoint:e,...t,requestTime:Date.now()-o,status:200,attempt:r,isProxied:!0,result:n,touchPoint:i}),n)).catch(n=>{var a,l,s;throw n.responseText=(null===(a=n.responseJSON)||void 0===a?void 0:a.errorText)||"Something went wrong, please try again.",x({endpoint:e,requestId:null==n?void 0:null===(l=n.responseJSON)||void 0===l?void 0:l.request_id,requestTime:Date.now()-o,status:n.status,attempt:r,errorText:null==n?void 0:null===(s=n.responseJSON)||void 0===s?void 0:s.errorText,isProxied:!0,touchPoint:i,...t}),n})},T=async(e,t,o,n)=>{S(h.PROXY),await Promise.all([h.DEFAULT,h.DEVPATH].map(async i=>{let a="https://executions.".concat((0,d.Z)()||(0,c.ZP)()?"d.":"").concat(i);await (0,s.Ui)(a,"non-live-diagnostic: "+e).then(e=>e).catch(e=>({status:e.status?e.status:s.jh.FORBIDDEN,error:e.message})).then(i=>{i.host=i.host||a,i.reqId=i.reqId||"non-live-diagnostic: "+e,(0,l.Nb)(e,t,o,n,{[r.N.HTTP_DIAGNOSE_RESULT]:(0,s.gZ)(i)})})}))},x=async e=>{let{endpoint:t=null,requestId:o=null,status:i,attempt:r=null,requestTime:a,errorText:l=null,user_id:s=null,author_id:d=null,collection_id:c=null,work_id:u=null,work_type:p=null,page_id:h=null,question_id:v=null,comp_id:g=null,comp_type:m=null,is_draft_page:_=null,isProxied:f=null,result:y=null,touchPoint:C=null,language:S=null}=e;try{let e=null==t?void 0:t.endsWith("/code_test/execute"),E={request_id:o||(y?JSON.parse(y).request_id:"MISSING_REQUEST_ID"),user_id:s,author_id:d,work_id:u||c,work_type:p,page_id:v||h,comp_id:g,comp_type:m,is_draft_page:_,error_text:l,performance_report:JSON.stringify({execution_time:a,attempt_count:r,proxy:f}),interaction_map:JSON.stringify({status:i,interaction_source:"WEBAPP",interaction_touch_point:C,image_name:e?"".concat(S,"-test-code"):S})};await (0,n.Z)({url:"/api/code/log-interaction",data:E,type:"POST"})}catch(e){}},L=function(e,t){var r,l,s,c,p,g,m,y;let S=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,L=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,N=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,b=arguments.length>5&&void 0!==arguments[5]?arguments[5]:65e3,w=e.endsWith("/code/execute")?v.RUN:e.endsWith("/code/judge")?v.JUDGE:e.endsWith("/code_test/execute")?t.is_submit?v.SUBMIT:v.RUN:null;if(t.user_code&&t.user_code.length>32768){let e=Error();return e.responseText="Code is too long. Please reduce the code size to be within limit (".concat(32768," characters)."),Promise.reject(e)}let O=Date.now(),I=u.Z.getState(),P=o.g.userConfigState,{is_premium_user:A=!1,is_premium_plus_user:j=!1}=(null==I?void 0:null===(r=I.data)||void 0===r?void 0:r.subscription_feature_type)||{},k=parseInt((null==P?void 0:null===(s=P.data)||void 0===s?void 0:null===(l=s.constants)||void 0===l?void 0:l.enable_execution_traffic_split)||0),D=2===k||(null===(m=o.g.userInfoContext)||void 0===m?void 0:null===(g=m.userInfoState)||void 0===g?void 0:null===(p=g.data)||void 0===p?void 0:null===(c=p.email)||void 0===c?void 0:c.endsWith("@educative.io"))&&1===k,R="/api/code_test/execute"===e&&!t.assessment_id,U=e+"-"+t.comp_id;null===(y=window.pendingFetchRequests[U])||void 0===y||y.abort();let M=window.pendingFetchRequests[U]=new AbortController,F=i.operation({retries:S,factor:N,minTimeout:1e3});if(C()===h.PROXY)return E(e,t,O,w);let Z=(0,a.tg)();return new Promise((o,r)=>{F.attempt(async a=>{let{user_id:l,comp_id:s,comp_type:c,is_draft_page:u}=t,p=R?await _(l):f(A||j?l:null),h=!1,v=async function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=setTimeout(()=>{M.abort(),h=!0},b);return await (0,n.Z)({url:"".concat(Z).concat(e),type:"POST",headers:{...l&&{"X-User-Id":l},...(D||R)&&o&&!t.skipOwnershipVerification&&!u&&a<=2&&{"X-Proxy-Authorization":o},...R&&{"X-Use-Testbox":"true"},...(0,d.Z)()&&!R&&{"X-Use-Gencombox":"true"},"Content-type":"application/json"},data:JSON.stringify(t),referrerPolicy:"no-referrer-when-downgrade",processData:!1},!1,!0,!0,!1,M.signal,"omit").then(e=>(clearTimeout(i),e)).catch(async e=>{var t;if(511===e.status&&a<=S+1)return R?v(await _(l,!0)):(f(l,!0),v());throw e.responseText=(null===(t=e.responseJSON)||void 0===t?void 0:t.errorText)||"Something went wrong, please try again.",e})};try{let n=await v(p);try{x({endpoint:e,...t,requestTime:Date.now()-O,status:200,attempt:a,result:n,touchPoint:w})}catch(e){}o(n)}catch(d){let n=!d.status||d.status>=500||429===d.status;if(R&&503===d.status){F.stop();let e=i.operation({retries:L,factor:N,minTimeout:5e3,randomize:!1});await new Promise((t,o)=>{e.attempt(async()=>{try{let e=await v(p);t(e)}catch(t){e.retry(t)||(t.responseText="Something went wrong, please try again.",o(t))}})}).then(e=>o(e)).catch(e=>r(e))}if(d instanceof DOMException&&(null==d?void 0:d.name)==="AbortError"&&!h)F.stop(),d.responseText="Execution cancelled.",x({endpoint:e,...t,requestId:"CANCELLED",requestTime:Date.now()-O,status:460,attempt:a,touchPoint:w}),r(d);
1else if(h||n&&!F.retry(d))T(l,c,u,s),E(e,t,O,w,a).then(e=>o(e)).catch(e=>{var t;e.responseText=(null===(t=e.responseJSON)||void 0===t?void 0:t.errorText)||"Something went wrong, please try again.",r(e)});else if(!n){var g,m,y;d.responseText=(null===(g=d.responseJSON)||void 0===g?void 0:g.errorText)||"Something went wrong, please try again.",x({endpoint:e,...t,requestId:null==d?void 0:null===(m=d.responseJSON)||void 0===m?void 0:m.request_id,requestTime:Date.now()-O,status:d.status,attempt:a,errorText:null==d?void 0:null===(y=d.responseJSON)||void 0===y?void 0:y.errorText,touchPoint:w}),r(d)}}})})}},291166:function(e,t,o){"use strict";o.d(t,{z:function(){return r}});var n=o(881762),i=o(44194);let r=()=>{let e=i.useRef(null);return{fetch:async t=>{e.current&&e.current.abort();let o=new AbortController;return e.current=o,(0,n.Z)(t,!1,!0,!0,!0,o.signal)}}}},244305:function(e,t,o){"use strict";o.d(t,{W:function(){return h}});var n=o(494296),i=o(881762),r=o(466483),a=o(991608),l=o(242075),s=o(621062);let d=(e,t,o,n)=>"author/".concat(e,"/collection/").concat(t,"/concept/").concat(o||"all")+(n?"/published":""),c=e=>JSON.parse(e).reduce((e,t)=>{let{id:o,name:n,usage_count:i}=t;return{...e,[n]:{id:o,usageCount:i}}},{}),u=e=>e.map(e=>{var t;return(null===(t=e.content)||void 0===t?void 0:t.comp_id)?e:{...e,content:{...e.content,comp_id:(0,n.x0)()}}}),p=(e,t,o)=>{if(!o)return o;let n=Object.entries(o).find(t=>{let[o,n]=t;return n.id===e});if(!n)return o;let i=n&&n[0],r=n?n[1]:{},a=u(JSON.parse(t));return{[i]:{...r,comps:a}}},h=(0,r.Ue)((e,t)=>({error:void 0,loading:void 0,loaded:!1,data:void 0,pending:()=>e(e=>({...e,loading:!0})),fulfilled:t=>e(e=>({error:void 0,loading:!1,loaded:!0,data:{...e.data,...t}})),clear:()=>e({loaded:!1}),rejected:t=>e({loading:!1,loaded:!1,error:t}),update:o=>{let n=t(),i=n.data||{},{id:r,name:a,comps:l,usageCount:s}=o||{},d=Object.entries(i).find(e=>{let[t,o]=e;return o.id===r}),c=d&&d[0],u=d&&d[1].comps,p=d&&d[1].usageCount,h=a||c;if(h){let t=null!=l?l:u,o=null!=s?s:p,a={[h]:{id:r,...o&&{usageCount:o},...t&&{comps:t}}},{[c]:d,...v}=i;e({...n,data:{...v,...a}})}},remove:o=>{let n=t(),i=n.data||{},{id:r}=o||{},a=Object.entries(i).find(e=>{let[t,o]=e;return Number(o.id)===Number(r)}),l=a&&a[0],{[l]:s,...d}=i;e({...n,data:{...d}})},loadFail:o=>{let n=t();if(o){var i;let t=(null===(i=o.responseJSON)||void 0===i?void 0:i.errorText)||"Failed to retrieve";e({...n,error:t})}},loadMetadata:e=>{let{authorId:n,collectionId:r,published:u}=e;return t().pending(),(0,i.Z)({url:"/api/".concat(d(n,r,null,u)),type:"GET"},void 0,void 0,!1).then(e=>{t().fulfilled(c(e))}).catch(e=>{e.status===a.Wy.unauthorizedException?(0,l.xc)():e.status===a.Wy.notFoundException&&(0,o.g.setNotFound)({notFoundPageStatus:!0}),t().rejected((0,s.n)(e))})},load:e=>{let{authorId:n,collectionId:r,conceptId:c,published:u}=e;return t().pending(),(0,i.Z)({url:"/api/".concat(d(n,r,c,u)),type:"GET"},void 0,void 0,!1).then(e=>{t().fulfilled(p(c,e,t().data))}).catch(e=>{e.status===a.Wy.unauthorizedException?(0,l.xc)():e.status===a.Wy.notFoundException&&(0,o.g.setNotFound)({notFoundPageStatus:!0}),t().rejected((0,s.n)(e))})}}))},539538:function(e,t,o){"use strict";o.d(t,{r:function(){return i}});let n=(e,t)=>{if(e.id===t)return e;if("page_group"===e.type&&Array.isArray(e.pages_map)){let o=e.pages_map.find(e=>e.page.id===t);return o?o.page:null}return null},i=(e,t,o)=>{var i,r;let a=(null==t?void 0:t.is_priced)===!1&&(null==t?void 0:t.price)===null,l=(null==t?void 0:t.price)===0||(null==t?void 0:t.discounted_price)===0;if(e||l||a)return!1;let s=0,d=!1;return(null!==(r=null==t?void 0:null===(i=t.toc)||void 0===i?void 0:i.categories)&&void 0!==r?r:[]).some(e=>e.pages.some(e=>{e.is_preview&&s++;let t=n(e,o);return!!t&&(t.is_preview&&s>3&&(d=!0),!0)})),d}},77753:function(e,t,o){"use strict";o.d(t,{CZ:function(){return m},EL:function(){return f},Fk:function(){return y},JF:function(){return u},R6:function(){return S},SS:function(){return _},To:function(){return p},_I:function(){return E},dU:function(){return g},e8:function(){return h},hv:function(){return l.h},nM:function(){return c},tU:function(){return T},xc:function(){return C}});var n=o(494296),i=o(336449),r=o(520649),a=o(937374),l=o(929819),s=o(264937),d=o(723804);let c={TOP:"TOP",BOTTOM:"BOTTOM"},u=(e,t,o)=>Math.ceil(e.reduce((e,t)=>
1t.page_count+t.assessments_keys.length+e,0)/Math.max(Math.ceil(Math.max(Math.floor(t/3600),1)/o),1)),p=e=>e.flatMap(e=>{let{pages:t}=e;return t}).reduce((e,t)=>{let{id:o,division:n}=t;return{...e,[o]:Math.max(e[o]||0,n)}},{}),h=(e,t)=>t.map(t=>({...t,pages:t.pages.map(t=>({...t,maxDivision:e[t.id]}))})),v=(e,t,o)=>e.slice(t,o),g=(e,t,o)=>{let n=e.length,i=0,r=1,a=o,l=[];for(;i<n;){let n=0,{author_id:s,collection_id:d,id:c}=e[i],u=t["".concat(s,"_").concat(d)],p=0,h=u.length;for(;p<h;){let e=u[p],t=e.pages.map(e=>({...e,author_id:e.author_id||Number(s),collection_id:e.collection_id||Number(d)}));if(t.length<=a)l.push({authorId:s,category:{...e,pages:t},categoryIndex:i,division:n,id:c,moduleId:d,moduleIndex:i,week:r}),a-=t.length;else{l.push({authorId:s,category:{...e,pages:v(t,0,a)},categoryIndex:i,division:n,id:c,moduleId:d,moduleIndex:i,week:r});let o={...e,pages:v(t,a,t.length+1)};u=[...u.slice(0,p+1),o,...u.slice(p+1)],a=0,h+=1}a||(a=o,r+=1,n+=1),p+=1}i+=1}return l},m=e=>e.reduce((e,t)=>({...e,["".concat(t.authorId,"_").concat(t.moduleId,"_").concat(t.division)]:[...e["".concat(t.authorId,"_").concat(t.moduleId,"_").concat(t.division)]||[],t.category]}),{}),_=(e,t)=>{let o=[];return e.forEach(e=>{let n=e.pages.map(e=>{let o="".concat(e.author_id,"_").concat(e.collection_id,"_").concat(e.division);if(t.hasOwnProperty(o)){let n=t[o].flatMap(e=>{let{pages:t}=e;return t});return{...e,page_count:n.length}}return e});o=[...o,{...e,pages:n}]}),o},f=e=>{let{isDark:t,completion:o,isFirstCategory:n,isLastCategory:i,prevModuleCompletion:r,stripLevel:l}=e,s=t?a.colors.gray.L500:a.colors.gray.L300,d=t?a.colors.gray.L1200:a.colors.white,u=o;return u=l===c.TOP?n&&o>0?100:r<=50?0:2*(r-50):i?Math.min(100,o):2*Math.min(50,o),{height:"calc(50% - 8px)",backgroundImage:"linear-gradient(transparent 0 50%, ".concat(d," 50% 100%), linear-gradient(").concat(a.colors.green[500]," 0 ").concat(u,"%, ").concat(s," ").concat(u,"% 100%)"),backgroundSize:"100% 4%, 100% 100%"}},y=e=>({top:(null==e?void 0:e.maxDivision)>0&&(null==e?void 0:e.division)!==0,bottom:(null==e?void 0:e.maxDivision)>0&&(null==e?void 0:e.division)!==(null==e?void 0:e.maxDivision)}),C=(e,t,o)=>t&&(null==e?void 0:e.division)!==(null==e?void 0:e.maxDivision)&&(null==e?void 0:e.maxDivision)>0&&!o,S=(e,t)=>{let o=[];for(let r of t){let t=o.findIndex(e=>e.week===r.week);if(t<0&&(o.push({editMode:!1,id:(0,n.x0)(),pages:[],title:"Week ".concat(r.week),type:i.j.COLLECTION_CATEGORY,week:r.week}),t=o.length-1),0>o[t].pages.findIndex(e=>e.author_id===Number(r.authorId)&&e.collection_id===Number(r.moduleId)&&e.id===Number(r.id))){let n=e.find(e=>e.author_id===r.authorId&&e.collection_id===r.moduleId&&e.id===r.id);o[t].pages.push({...n,author_id:Number(n.author_id),collection_id:Number(n.collection_id),division:r.division,id:Number(n.id),is_preview:!1,moduleIndex:r.moduleIndex,page_id:n.page_id?Number(n.page_id):null})}}return o},E=(e,t)=>{let o={};return Object.entries(t).forEach(t=>{let[n,i]=t,[r,a]=n.split("_"),l="CourseCompletion_".concat(n),s=e["CourseCompletion_".concat(r,"_").concat(a)]||{},d=i.flatMap(e=>e.pages.map(e=>{let{id:t}=e;return t}));o[l]={},"ALL_DONE"in s&&(o[l].ALL_DONE=s.ALL_DONE),"LAST_VISITED"in s&&d.includes(Number(s.LAST_VISITED))&&(o[l].LAST_VISITED=s.LAST_VISITED),d.forEach(e=>e in s&&(o[l][e]=s[e]))}),o},T=function(e,t,o,n,i,a){let c=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],p=a===r.Ss.LEARNING_PLAN?"".concat(e,"_").concat(i,"_").concat(o):"".concat(e,"_").concat(i),h=t["CourseCompletion_".concat(p)],v=n[p],{mandatoryLessons:g,optionalLessons:m}=(0,d.QO)(v,c);return u||!g.length?(0,l.h)([...g,...m],h):(0,s.ZP)(g,h).percentCompleted}},445374:function(e,t,o){"use strict";o.d(t,{k:function(){return i}});var n=o(790484);let i=o.n(n)().problemTabContent},329140:function(e){e.exports={container:"Sidebar_container__Tjrfc",sidebar:"Sidebar_sidebar__FVvIC",rtlSidebar:"Sidebar_rtlSidebar__HcApK",overlay:"Sidebar_overlay__R9LxU","overlay-mobile":"Sidebar_overlay-mobile__68BFc"}},790484:function(e){e.exports={problemTabContent:"problemPage_problemTabContent__EvHVn",breadcrumbsContainer:"problemPage_breadcrumbsContainer__wZ9V3"}},599456:function(e){e.exports={revision_title_text:"Revision_revision_title_text__UKmaf"}},438618:function(e){e.exports={"version-history-title-container":"
1VersionHistorySidebar_version-history-title-container__rM075",dark:"dark"}}}]);

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.