@license:ThisfileissubjecttotheGeoGebraNon-CommercialLicenseAgreement,seehttp://www.geogebra.org/license. For questions please write us at office@geogebra.org.
(function(){if(typeofwindow.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}varisRenderGGBElementEnabled=false;varscriptLoadStarted=false;varhtml5AppletsToProcess=null;varggbHTML5LoadedCodebaseIsWebSimple=false;varggbHTML5LoadedCodebaseVersion=null;varggbHTML5LoadedScript=null;varGGBApplet=function(){"use strict";varapplet={};varggbVersion="5.0";varparameters={};varviews=null;varhtml5NoWebSimple=false;varhtml5NoWebSimpleParamExists=false;varappletID=null;varinitComplete=false;varhtml5OverwrittenCodebaseVersion=null;varhtml5OverwrittenCodebase=null;for(vari=0;i<arguments.length;i++){varp=arguments[i];if(p!==null){switch(typeofp){case"number":ggbVersion=p.toFixed(1);break;case"string":if(p.match(newRegExp("^[0-9]\\.[0-9]+$"))){ggbVersion=p}else{appletID=p}break;case"object":if(typeofp.is3D!=="undefined"){views=p}else{parameters=p}break;case"boolean":html5NoWebSimple=p;html5NoWebSimpleParamExists=true;break}}}if(views===null){views={is3D:false,AV:false,SV:false,CV:false,EV2:false,CP:false,PC:false,DA:false,FI:false,PV:false,macro:false};if(parameters.material_id!==undefined&&!html5NoWebSimpleParamExists){html5NoWebSimple=true}}if(appletID!==null&¶meters.id===undefined){parameters.id=appletID}varjnlpFilePath="";varhtml5Codebase="";varisHTML5Offline=false;varloadedAppletType=null;varhtml5CodebaseVersion=null;varhtml5CodebaseScript=null;varhtml5CodebaseIsWebSimple=false;varpreviewImagePath=null;varpreviewLoadingPath=null;varpreviewPlayPath=null;varfonts_css_url=null;varjnlpBaseDir=null;if(parameters.height!==undefined){parameters.height=Math.round(parameters.height)}if(parameters.width!==undefined){parameters.width=Math.round(parameters.width)}varparseVersion=function(d){returnparseFloat(d)>4?parseFloat(d):5};applet.setHTML5Codebase=function(codebase,offline){html5OverwrittenCodebase=codebase;setHTML5CodebaseInternal(codebase,offline)};applet.setJavaCodebase=applet.setJavaCodebaseVersion=applet.isCompiledInstalled=applet.setPreCompiledScriptPath=applet.setPreCompiledResourcePath=function(){};applet.setHTML5CodebaseVersion=function(version,offline){varnumVersion=parseFloat(version);if(numVersion!==NaN&&numVersion<5){console.log("The GeoGebra HTML5 codebase version "+numVersion+" is deprecated. Using version latest instead.");return}html5OverwrittenCodebaseVersion=version;setDefaultHTML5CodebaseForVersion(version,offline)};applet.getHTML5CodebaseVersion=function(){returnhtml5CodebaseVersion};applet.getParameters=function(){returnparameters};applet.setFontsCSSURL=function(url){fonts_css_url=url};applet.setGiacJSURL=function(url){};applet.setJNLPFile=function(newJnlpFilePath){jnlpFilePath=newJnlpFilePath};applet.setJNLPBaseDir=function(baseDir){};applet.inject=function(){functionisOwnIFrame(){returnwindow.frameElement&&window.frameElement.getAttribute("data-singleton")}vartype="auto";varcontainer_ID=parameters.id;varcontainer;varnoPreview=false;for(vari=0;i<arguments.length;i++){varp=arguments[i];if(typeofp==="string"){p=p.toLowerCase();if(p.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)){type=p}else{container_ID=arguments[i]}}elseif(typeofp==="boolean"){noPreview=p}elseif(pinstanceofHTMLElement){container=p}}continueInject();functioncontinueInject(){if(!initComplete){setTimeout(continueInject,200);return}type=detectAppletType(type);varappletElem=container||document.getElementById(container_ID);if(!appletElem){console.log("possibly bug on ajax loading? ");return}applet.removeExistingApplet(appletElem,false);if(parameters.width===undefined&&appletElem.clientWidth){parameters.width=appletElem.clientWidth}if(parameters.height===undefined&&appletElem.clientHeight){parameters.height=appletElem.clientHeight}if(!(parameters.width&¶meters.height)&&type==="html5"){deleteparameters.width;deleteparameters.height}loadedAppletType=type;if(type==="screenshot"){injectScreenshot(appletElem,parameters)}else{varplayButton=false;if(parameters.hasOwnProperty("playButton")&¶meters.playButton||parameters.hasOwnProperty("clickToLoad")&¶mete