"use strict";(self.webpackChunkWebComponents=self.webpackChunkWebComponents||[]).push([[412],{76412:(e,n,t)=>{t.r(n);var o=t(78673);function a(e,n){let t=new o.A;e.domRoot.find("#jmpFirstInstr").click((function(){t.logBookEvent({event:"codelens",act:"first",div_id:n})})),e.domRoot.find("#jmpLastInstr").click((function(){t.logBookEvent({event:"codelens",act:"last",div_id:n})})),e.domRoot.find("#jmpStepBack").click((function(){t.logBookEvent({event:"codelens",act:"back",div_id:n})})),e.domRoot.find("#jmpStepFwd").click((function(){t.logBookEvent({event:"codelens",act:"fwd",div_id:n})})),e.domRoot.find("#executionSlider").bind("slide",(function(e,o){t.logBookEvent({event:"codelens",act:"slide",div_id:n})})),t.containerDiv=document.getElementById(n),t.indicate_component_ready()}function i(e){var n=$("#"+e);$(n).find("#jmpFirstInstr").addClass("btn btn-default"),$(n).find("#jmpStepBack").addClass("btn btn-danger"),$(n).find("#jmpStepFwd").addClass("btn btn-success"),$(n).find("#jmpLastInstr").addClass("btn btn-default")}t(60764),"undefined"==typeof allVsualizers&&(window.allVisualizers=[]),void 0===window.component_factory&&(window.component_factory={}),window.component_factory.codelens=function(e){let n=e.orig.querySelector(".pytutorVisualizer"),t=n.id,d=JSON.parse(n.dataset.params).lang;try{let e=allTraceData[t].startingInstruction||0,n=addVisualizerToPage(allTraceData[t],t,{startingInstruction:e,editCodeBaseURL:null,hideCode:!1,lang:d});a(n,t),i(t),window.allVisualizers.push(n)}catch(e){console.log(`Error rendering CodeLens Problem ${t}`),console.log(e)}window.addEventListener("codelens:answer",(function(e){(new o.A).logBookEvent({event:"codelens",div_id:e.detail.divid,act:"answer",answer:e.detail.answer,correct:e.detail.correct,percent:e.detail.percent||0}),console.log(e)}))},$(document).on("runestone:login-complete",(function(){if("undefined"!=typeof allTraceData){for(let n in allTraceData){let t=document.getElementById(n);if(null===t)return void console.log(`Could not find element with id ${n}`);let o=$(t).data("params").lang;try{if(n in window.allTraceData){let t=allTraceData[n].startingInstruction||0;var e=addVisualizerToPage(allTraceData[n],n,{startingInstruction:t,editCodeBaseURL:null,hideCode:!1,lang:o})}else alert(`${n} is missing trace data.  This is probably a build error. Please report it on github.`);a(e,n),i(n),window.allVisualizers.push(e)}catch(e){console.log(`Error rendering CodeLens Problem ${n}`),console.log(e)}}window.addEventListener("codelens:answer",(function(e){(new o.A).logBookEvent({event:"codelens",div_id:e.detail.divid,act:"answer",answer:e.detail.answer,correct:e.detail.correct,percent:e.detail.percent||0}),console.log(e)}))}}))}}]);
//# sourceMappingURL=412.5965503d81003593.js.map