/*
 Joel Espinosa Longi
 jlongi@im.unam.mx
 https://github.com/jlongi/DescartesJS
 LGPL - http://www.gnu.org/licenses/lgpl.html
 2023-08-02
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var g=0;return function(){return g<a.length?{done:!1,value:a[g++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var g="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return g?g.call(a):$jscomp.arrayIterator(a)};$jscomp.arrayFromIterator=function(a){for(var g,e=[];!(g=a.next()).done;)e.push(g.value);return e};
$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.objectCreate=$jscomp.ASSUME_ES5||"function"==typeof Object.create?Object.create:function(a){var g=function(){};g.prototype=a;return new g};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},g={};try{return g.__proto__=a,g.a}catch(e){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,g){a.__proto__=g;if(a.__proto__!==g)throw new TypeError(a+" is not extensible");return a}:null;
$jscomp.inherits=function(a,g){a.prototype=$jscomp.objectCreate(g.prototype);a.prototype.constructor=a;if($jscomp.setPrototypeOf){var e=$jscomp.setPrototypeOf;e(a,g)}else for(e in g)if("prototype"!=e)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(g,e);d&&Object.defineProperty(a,e,d)}else a[e]=g[e];a.superClass_=g.prototype};
$jscomp.checkStringArgs=function(a,g,e){if(null==a)throw new TypeError("The 'this' value for String.prototype."+e+" must not be null or undefined");if(g instanceof RegExp)throw new TypeError("First argument to String.prototype."+e+" must not be a regular expression");return a+""};$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,g,e){a!=Array.prototype&&a!=Object.prototype&&(a[g]=e.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,g,e,d){if(g){e=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var q=a[d];q in e||(e[q]={});e=e[q]}a=a[a.length-1];d=e[a];g=g(d);g!=d&&null!=g&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:g})}};
$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var e=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var d="";a;)if(a&1&&(d+=e),a>>>=1)e+=e;return d}},"es6","es3");$jscomp.owns=function(a,g){return Object.prototype.hasOwnProperty.call(a,g)};
$jscomp.assign="function"==typeof Object.assign?Object.assign:function(a,g){for(var e=1;e<arguments.length;e++){var d=arguments[e];if(d)for(var q in d)$jscomp.owns(d,q)&&(a[q]=d[q])}return a};$jscomp.polyfill("Object.assign",function(a){return a||$jscomp.assign},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(a,e,d){var g=this.length||0;0>e&&(e=Math.max(0,g+e));if(null==d||d>g)d=g;d=Number(d);0>d&&(d=Math.max(0,g+d));for(e=Number(e||0);e<d;e++)this[e]=a;return this}},"es6","es3");$jscomp.findInternal=function(a,g,e){a instanceof String&&(a=String(a));for(var d=a.length,q=0;q<d;q++){var p=a[q];if(g.call(e,p,q,a))return{i:q,v:p}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,e){return $jscomp.findInternal(this,a,e).v}},"es6","es3");$jscomp.polyfill("Array.prototype.flat",function(a){return a?a:function(a){a=void 0===a?1:Number(a);for(var e=[],d=0;d<this.length;d++){var g=this[d];Array.isArray(g)&&0<a?(g=Array.prototype.flat.call(g,a-1),e.push.apply(e,g)):e.push(g)}return e}},"es9","es5");
var babel=function(a){if(a.loadLib)return a;a.loadLib=!0;a.no=a.ez=a.non=a["n\u00e3o"]=a.falso=a["false"]=a.fals=a.gezurra=a.faux=a.fals="false";a["s\u00ed"]=a.yes=a.bai=a.oui=a.si=a.sim=a.verdadero=a["true"]=a.veritable=a.egia=a.vrai=a.verdadeiro=a.veritable="true";a.negro=a.black=a.negre=a.beltza=a.noir=a.preto=a["#000000"]="#000000";a.maxenta=a.magenta=a["#ff00ff"]="#ff00ff";a.azul=a.blue=a.blau=a.urdina=a.bleu=a["#0000ff"]="#0000ff";a.turquesa=a.cyan=a.turkesa=a.turquoise=a["#00ffff"]="#00ffff";
a.verde=a.green=a.verd=a.berdea=a.vert=a["#00ff00"]="#00ff00";a.amarillo=a.yellow=a.groc=a.horia=a.jaune=a.amarelo=a["#ffff00"]="#ffff00";a.naranja=a.orange=a.taronja=a.laranja=a.laranxa=a["#ffc800"]="#ffc800";a.rojo=a.red=a.vermell=a.gorria=a.rouge=a.vermello=a.vermelho=a["#ff0000"]="#ff0000";a.pink=a.rosa=a.arrosa=a.rose=a["#ffafaf"]="#ffafaf";a.grisObscuro=a.darkGray=a.grisFosc=a["gris iluna"]=a.grisObscur=a.grisEscuro=a.cinzaEscuro=a["#404040"]="#404040";a.gris=a.gray=a.grisa=a.cinza=a["#808080"]=
"#808080";a.grisClaro=a.lightGray=a.grisClar=a["gris argia"]=a.grisClair=a.cinzaClaro=a["#c0c0c0"]="#c0c0c0";a.blanco=a.white=a.blanc=a.zuria=a.branco=a["#ffffff"]="#ffffff";a.escala=a.scale=a.eskala=a["\u00e9chelle"]="scale";a.nombre=a.name=a.nom=a.izena=a.nome="name";a.ikusgai=a["vis\u00edvel"]=a.visible="visible";a.rastro=a.trace=a.rastre=a.arrastoa="trace";a.fondo=a.background=a.fons=a.hondoa=a.fond=a.fundo="background";a["par\u00e1metro"]=a.parameter=a.parametroa=a["par\u00e2metro"]=a["par\u00e0metre"]=
"parameter";a["sucesi\u00f3n"]=a.sequence=a["successi\u00f3"]=a.segida=a.succession=a["seq\u00fc\u00eancia"]="sequence";a["tama\u00f1o"]=a.size=a.neurria=a.taille=a.tamanho=a["grand\u00e0ria"]="size";a.decimales=a.decimals=a.hamartarra=a["d\u00e9cimales"]=a.decimais="decimals";a.red=a.net=a.xarxa=a.sarea=a["r\u00e9seau"]=a.rede=a.malha="net";a.red10=a.net10=a.xarxa10=a.sarea10=a["r\u00e9seau10"]=a.rede10=a.malha10="net10";a.ejes=a.axes=a.eixos=a.ardatzak=a.eixes="axes";a["cr\u00e9ditos"]=a.about=
a["cr\u00e8dits"]=a.kreditoak=a["cr\u00e9dits"]=a.sobre="about";a.config=a.konfig=a["configura\u00e7\u00e3o"]="config";a.inicio=a.init=a.inici=a.hasiera=a.commencement=a["in\u00edcio"]="init";a.limpiar=a.clear=a.neteja=a.ezabatu=a.nettoye=a.limpar="clear";a.incr=a.gehi=a.incremento="incr";a.min=a.inf="min";a.max=a.sup=a["m\u00e1x"]="max";a.relleno=a.fill=a.ple=a.betea=a.plein=a.recheo=a.preencher="fill";a["relleno+"]=a["fill+"]=a["ple+"]=a["betea+"]=a["plein+"]=a["recheo+"]=a["preencher+"]=a.fillP=
"fillP";a["relleno-"]=a["fill-"]=a["ple-"]=a["betea-"]=a["plein-"]=a["recheo-"]=a["preencher-"]=a.fillM="fillM";a.flecha=a.arrow=a.fletxa=a.gezia=a["fl\u00e8che"]=a.frecha=a.seta="arrow";a.punta=a.spear=a.muturra=a.pointe=a.ponta="spear";a["regi\u00f3n"]=a.region=a["regi\u00f3"]=a.eskualde=a["r\u00e9gion"]=a["rexi\u00f3n"]=a["regi\u00e3o"]="region";a.norte=a.north=a.nord=a.ipar="north";a.sur=a.south=a.sud=a.hego=a.sul="south";a.este=a.east=a.est=a.ekialde=a.leste="east";a.oeste=a.west=a.oest=a.hegoalde=
a.ouest="west";a.exterior=a.external=a.kanpoalde=a.externo="external";a["expresi\u00f3n"]=a.expresion=a["expresi\u00f3"]=a.adierazpen=a["express\u00e3o"]="expresion";a.tipo=a.type=a.tipus=a.mota="type";a["posici\u00f3n"]=a.position=a["posici\u00f3"]=a.posizio=a["posi\u00e7\u00e3o"]="position";a["constricci\u00f3n"]=a.constraint=a["constricci\u00f3"]=a.beharte=a.constriction=a["constrici\u00f3n"]=a["restri\u00e7\u00e3o"]="constraint";a.valor=a.value=a.balio=a.valeur="value";a["ecuaci\u00f3n"]=a.equation=
a["equaci\u00f3"]=a.ekuazio=a["\u00e9quation"]=a["equa\u00e7\u00e3o"]="equation";a.curva=a.curve=a.corba=a.kurba=a.courbe="curve";a.texto=a.text=a.testu=a.texte=a.testua="text";a.punto=a.point=a.punt=a.puntu=a.ponto=a.dot="point";a.segmento=a.segment=a.zuzenki="segment";a.arco=a.arc=a.arku="arc";a["pol\u00edgono"]=a.polygon=a["pol\u00edgon"]=a.poligono=a.polygone="polygon";a.imagen=a.image=a.imatge=a.irudi=a.imaxe=a.imagem=a.bg_image=a.irudia=a.imagem_de_fundo=a.irundia="image";a["Versi\u00f3n"]=
a.Version=a["Versi\u00f3"]=a["Vers\u00e3o"]=a.version="version";a.Idioma=a.Language=a.Hizkuntza=a.Langue=a.language="language";a["O.x"]="O.x";a["O.y"]="O.y";a.Botones=a.Buttons=a.Botons=a.Botoiak=a.Boutons=a["Bot\u00f3ns"]=a["Bot\u00f5es"]=a.Botons="Buttons";a["Animaci\u00f3n"]=a.Animation=a["Animaci\u00f3"]=a.Animazio=a["Anima\u00e7\u00e3o"]="Animation";a.constante=a.constant=a.Konstante="constant";a.fuente=a.font=a.iturri=a.source=a.fonte="font";a["num\u00e9rico"]=a.numeric=a["num\u00e8ric"]=a.zenbakizko=
a["num\u00e9rique"]="numeric";a["gr\u00e1fico"]=a.graphic=a["gr\u00e0fic"]=a.grafiko=a.graphique="graphic";a.hacer=a["do"]=a.fer=a.egin=a.faire=a.facer=a.fazer=a.doExpr="doExpr";a.mientras=a["while"]=a.mentre=a.bitartean=a["tandis que"]=a.mentres=a.enquanto=a.whileExpr="whileExpr";a.evaluar=a.evaluate=a.avalua=a.ebaluatu=a["\u00e9valuer"]=a.avaliar="evaluate";a.variable=a.aldagaia=a["vari\u00e1vel"]="variable";a["funci\u00f3n"]=a["function"]=a["funci\u00f3"]=a.funtzio=a.fonction=a["fun\u00e7\u00e3o"]=
"function";a.algoritmo=a.algorithm=a.algorisme=a.algorithme="algorithm";a.vector=a.array=a.bektore=a.vecteur=a.matriz="array";a["dibujar-si"]=a["draw-if"]=a["marraztu-baldin"]=a["dessiner-si"]=a["debuxar-se"]=a["desenhar-se"]=a["dibuixa-si"]=a.drawif="drawif";a.dominio=a.range=a.domini=a["izate-eremua"]=a.domain=a["dom\u00ednio"]="range";a.pausa=a.delay=a.eten="delay";a["eje-x"]=a["x-axis"]=a["eix-x"]=a["x-ardatza"]=a["axe-x"]=a["eixe-x"]=a["eixo-x"]=a.x_axis="x_axis";a["eje-y"]=a["y-axis"]=a["eix-y"]=
a["y-ardatza"]=a["axe-y"]=a["eixe-y"]=a["eixo-y"]=a.y_axis="y_axis";a["n\u00fameros"]=a.numbers=a.nombres=a.zenbakiak="numbers";a["exponencial-si"]=a["exponential-if"]=a["esponentzial-baldin"]=a["exponentiel-si"]=a["exponencial-se"]=a.exponentialif="exponentialif";a.familia=a.family=a["fam\u00edlia"]=a.famille="family";a.intervalo=a.interval=a.tarte=a.intervalle="interval";a.pasos=a.steps=a.passos=a.pausoak=a.pas="steps";a.centro=a.center=a.centre=a.zentro="center";a.radio=a.radius=a.radi=a.erradio=
a.rayon=a.raio="radius";a.fin=a.end=a.fi=a.bukaera=a.fim="end";a["una-sola-vez"]=a["only-once"]=a["una-sola-vegada"]=a["behin-bakarrik"]=a["une-seule-fois"]=a["unha-soa-vez"]=a["apenas-uma-vez"]=a.onlyOnce="onlyOnce";a.siempre=a.always=a.sempre=a.beti=a.toujours="always";a["color-int"]=a["int-colour"]=a["barruko-kolore"]=a["couleur-int"]=a["cor-int"]=a.colorInt="colorInt";a.repetir=a.loop=a.repeteix=a.errepikatu=a["r\u00e9p\u00e9ter"]="loop";a.controles=a.controls=a.kontrolak=a["contr\u00f4les"]=
a.controis="controls";a.animar=a.animate=a.anima=a.animatu=a.animer="animate";a.auto="auto";a.y=a.top="y";a.espacio=a.space=a.espai=a.espazio=a.espace=a.espazo=a["espa\u00e7o"]="space";a.Nu="Nu";a.Nv="Nv";a.alto=a.height=a.alt=a.altu=a.haut=a.altura=a["al\u00e7ada"]=a.hauteur=a.alto="height";a.ancho=a.depth=a.amplada=a.zabalera=a.largeur=a.profundidade=a.amplada=a.width=a.ample=a.large=a.largura="width";a.largo=a.length=a.llargada=a.luzera=a.longueur=a.longo=a.comprimento=a.llargada="length";a.color_reverso=
a.backcolor=a.color_revers=a["atzealde kolorea"]=a.couleur_revers=a.cor_reverso=a.cor_de_fundo="backcolor";a.aristas=a.edges=a.arestes=a.ertzak=a["ar\u00eates"]=a.arestas="edges";a.rotini=a.inirot="inirot";a.posini=a.inipos="inipos";a["tri\u00e1ngulo"]=a.triangle=a.hirukia=a["tri\u00e2ngulo"]="triangle";a.cara=a.face=a.aurpegi="face";a.polireg=a.regpoly=a["pol\u00edgonoRegular"]="polireg";a.superficie=a.surface=a["superf\u00edcie"]=a.azalera="surface";a.cubo=a.cube=a.cub=a.kubo="cube";a["paralelep\u00edpedo"]=
a.box=a["paral\u00b7lelep\u00edpede"]=a.paralelepipedo=a["parall\u00e9l\u00e9pip\u00e8de"]="box";a.cono=a.cone=a.con=a.kono=a["c\u00f4ne"]="cone";a.cilindro=a.cylinder=a.cilindre=a.zilindro=a.cylindre="cylinder";a.esfera=a.sphere=a["sph\u00e8re"]="sphere";a.tetraedro=a.tetrahedron=a.tetraedre=a["t\u00e9tra\u00e8dre"]="tetrahedron";a.octaedro=a.octahedron=a.octaedre=a.oktaedro=a["octa\u00e8dre"]="octahedron";a.dodecaedro=a.dodecahedron=a.dodecaedre=a.dodekaedro=a["dod\u00e9ca\u00e8dre"]="dodecahedron";
a.icosaedro=a.icosahedron=a.icosaedre=a.ikosaedro=a["icosa\u00e8dre"]="icosahedron";a.elipsoide=a.ellipsoid=a["el\u00b7lipsoide"]=a["ellipso\u00efde"]=a["elips\u00f3ide"]="ellipsoid";a.macro=a.makro="macro";a.id="id";a.modelo=a.model=a.eredu=a["mod\u00e8le"]="model";a.color=a.kolore=a.couleur=a.cor=a.colour=a.kolorea="color";a.luz=a.light=a.llum=a.argia=a["lumi\u00e8re"]="light";a.metal=a.metall=a["m\u00e9tal"]="metal";a.alambre=a.wire=a.filferro=a.alanbre=a["fil de fer"]=a.arame="wire";a.cortar=
a.split=a.talla=a.moztu=a.couper=a.dividir="split";a.despliegue=a.render=a.desplegament=a.zabaltze=a["d\u00e8ploiement"]=a.despregamento=a.processar="render";a.orden=a.sort=a.ordre=a.ordena=a.orde=a.ordenar="sort";a.pintor=a.painter=a.margolari=a.peintre="painter";a["trazado de rayos"]=a["ray trace"]=a["tra\u00e7at de raigs"]=a["izpi trazadura"]=a["trace de rayons"]=a["trazado de raios"]=a["tra\u00e7ado de raios"]=a.raytrace="raytrace";a.despl_imagen=a.bg_display=a.despl_imatge=a["irudi desplazamendu"]=
a.despl_image=a.despr_imaxe=a["apresenta\u00e7\u00e3o_de_imagem"]="bg_display";a["arr-izq"]=a.topleft=a["dalt-esq"]=a["goi-ezk"]=a["au-dessus-gau"]=a["arr-esq"]=a["acima-esquerda"]="topleft";a["expand."]=a.stretch=a.hedatu=a["expandir "]="stretch";a.mosaico=a.patch=a.mosaic=a.mosaiko=a["mosa\u00efque"]="patch";a.centrada=a.zentratu=a["centr\u00e9e"]=a.centrado=a.imgcenter="imgcenter";a.archivo=a.file=a.fitxer=a.artxibo=a.fichier=a.arquivo="file";a.filas_norte=a.rows_north=a.files_nord=a["HTML kodea"]=
a.files_nord=a.filas_norte=a.linhas_norte=a.files_nord=a.rowsNorth="rowsNorth";a.filas_sur=a.rows_south=a.files_sud=a.ipar_lerro=a.files_sud=a.filas_sur=a.linhas_sul=a.files_sud=a.rowsSouth="rowsSouth";a.ancho_este=a.width_east=a.ample_est=a.hego_lerro=a.ample_est=a.ancho_leste=a.largura_leste=a.ample_est=a.widthEast="widthEast";a.ancho_oeste=a.width_west=a.ample_oest=a.ekialde_zabalera=a.ample_ouest=a.ancho_oeste=a.largura_oeste=a.ample_oest=a.widthWest="widthWest";a.fijo=a.fixed=a.fix=a.hegoalde_zabalera=
a.fixe=a.fixo="fixed";a["Reiniciar Animaci\u00f3n"]=a["Init Animation"]=a["Reinicia Animaci\u00f3"]=a.finko=a["Recommencer l'Animation"]=a["Reiniciar Anima\u00e7\u00e3o"]=a.initAnimation="initAnimation";a["Explicaci\u00f3n"]=a.Explanation=a.Azalpena=a.Explication=a["Explica\u00e7\u00e3o"]=a["Explicaci\u00f3"]="Explanation";a.tooltip=a.dica="tooltip";a.discreto=a.discrete=a.discret=a.diskretu="discrete";a.interfaz=a.gui=a["interf\u00edcie"]=a.interfaze=a["interface"]="gui";a.pulsador=a.spinner=a.polsador=
a.pultsadore=a.bouton="spinner";a["campo de texto"]=a.textfield=a["camp de text"]=a["testu esarrua"]=a["champ de texte"]="textfield";a["men\u00fa"]=a.choice=a.menu=a.escolha="menu";a.barra=a.scrollbar=a.barre="scrollbar";a.opciones=a.options=a.opcions=a.aukerak=a["opci\u00f3ns"]=a["op\u00e7\u00f5es"]="options";a.interior=a.barruko=a["int\u00e9rieur"]="interior";a["condici\u00f3n"]=a.condition=a["condici\u00f3"]=a.baldintza=a["condi\u00e7\u00e3o"]="condition";a["acci\u00f3n"]=a.action=a["acci\u00f3"]=
a.ekintza=a["a\u00e7\u00e3o"]="action";a.evento=a.event=a.esdeveniment=a.gertaera=a["\u00e9v\u00e9nement"]="event";a["abrir URL"]=a["open URL"]=a["obre URL"]=a["URL zabaldu"]=a["ouvrir URL"]=a.openURL="openURL";a["abrir Escena"]=a["open Scene"]=a["obre Escena"]=a["eszena zabaldu"]=a["ouvrir Escena"]=a["abrir Cena"]=a.openScene="openScene";a["bot\u00f3n"]=a.button=a["bot\u00f3"]=a.botoi=a.bouton=a["bot\u00e3o"]="button";a.mensaje=a.message=a.mezua=a.mensaxe=a.mensagem=a.missatge="message";a.alternar=
a.alternate=a.alterna=a.txandakatu=a.alterner="alternate";a["ejecuci\u00f3n"]=a.execution=a["execuci\u00f3"]=a.gauzatze=a["ex\u00e9cution"]=a["execuci\u00f3n"]=a["execu\u00e7\u00e3o"]="execution";a.calcular=a.calculate=a.calcula=a.kalkulatu=a.calculer="calculate";a.coord_abs=a.abs_coord=a.koor_abs="abs_coord";a.negrita=a.bold=a.negreta=a.lodi=a["caract\u00e8re gras"]=a.negra=a.negrito="bold";a.cursiva=a.italics=a.etzana=a.italique=a["it\u00e1lico"]="italics";a.subrayada=a.underlined=a.subratllat=
a.azpimarratua=a.soulignement=a["subli\u00f1ada"]=a.sublinhado="underlined";a.pos_mensajes=a.msg_pos=a.pos_missatges=a.mezuen_pos=a.pos_messages=a.pos_mensaxes="msg_pos";a.izquierda=a.left=a.esquerra=a.eskerrean=a.gauche=a.esquerda=a.esquerda=a.esquerra=a.x="x";a.derecha=a.right=a.dreta=a.eskuinan=a.droite=a.dereita=a.direita=a.dreta="right";a["sensible_a_los_movimientos_del_rat\u00f3n"]=a.sensitive_to_mouse_movements=a["sensible_als_moviments_del_ratol\u00ed"]=a["xagu mugimenduarekiko sentikorra"]=
a.sensible_aux_mouvements_du_souris=a.sensible_aos_movementos_do_rato=a["sens\u00edvel_aos_movimentos_do_mouse"]="sensitive_to_mouse_movements";a.reproducir=a.play=a.reprodueix=a.erreproduzitu=a.reproduire=a.reproduzir=a.playAudio="playAudio";a["activo-si"]=a["active-if"]=a["actiu-si"]=a["altiboa-baldin"]=a["actif-si"]=a["activo-se"]=a["ativo-se"]=a.activeif="activeif";a.rotfin=a.finrot=a.bukrot=a.endrot="endrot";a.posfin=a.finpos=a.bukpos=a.endpos="endpos";a.editable=a.editagarria=a["edit\u00e1vel"]=
"editable";a.R2="2D";a.R3="3D";a.vectores=a.bektoreak=a.vecteurs=a.vetores=a.vectors="vectors";a["fuente puntos"]=a["font size"]=a["font punts"]=a["puntu iturria"]=a["source points"]=a["fonte puntos"]=a["fonte pontos"]=a.font_size="font_size";a.escenario=a.scenario=a.escenari=a.agertoki=a["sc\u00e8ne"]=a["cen\u00e1rio"]="scenario";a.cID="cID";a.matriz=a.matrix=a.matriu=a.matrice="matrix";a.filas=a.rows=a.files="rows";a.columnas=a.columns=a.colonnes="columns";a.solo_texto=a.only_text=a.seulement_texte=
a["s\u00f3_texto"]=a.tan_sols_texte=a.onlyText="onlyText";a.respuesta=a.answer="answer";a.peso=a.weight=a.pes="weight";a.decimal_symbol=a["signo decimal"]=a["decimal symbol"]="decimal_symbol";a.info="info";a.library="library";a.color_contorn_text=a.color_text_border=a.color_borde_texto=a.muga_testuaren_kolorea=a.couleur_contour_texte=a.cor_borde_texto=a.colore_bordo_testo=a.cor_borda_texto=a.color_contorn_text=a.border="border";a.video=a["vid\u00e9o"]="video";a.audio=a["\u00e0udio"]="audio";a.autoplay=
"autoplay";a.poster="poster";a.opacidad=a.opacity=a["opacit\u00e9"]=a.opacitat=a.opacidade="opacity";a.alinear=a.align=a["ali\u00f1ar"]=a.aligner="align";a.anchor="anchor";a.a_left="left";a.a_center="center";a.a_right="right";a.a_justify="justify";a.a_top_left="top_left";a.a_top_center="top_center";a.a_top_right="top_right";a.a_center_left="center_left";a.a_center_center="center_center";a.a_center_right="center_right";a.a_bottom_left="bottom_left";a.a_bottom_center="bottom_center";a.a_bottom_right=
"bottom_right";a.malla=a.mesh="mesh";a.local=a.Local="local";a.rectangle=a["rect\u00e1ngulo"]="rectangle";a.lineDash="lineDash";a.solid="solid";a.dot="dot";a.dash="dash";a.dash_dot="dash_dot";a.offset_dist="offset_dist";a.offset_angle="offset_angle";a.flat="flat";a.borderColor="borderColor";a.text_align="text_align";a.image_align="image_align";a.checkbox="checkbox";a.torus=a.toro="torus";a.R="R";a.r="r";a.border_radius="border_radius";a.radio_group="radio_group";a.font_family="font_family";a.resizable=
"resizable";a.antialias="antialias";a.image_loader="image_loader";a.expand="expand";a.cover=a.cubrir="cover";a.fit=a.escalar="fit";a.code="code";a.doc="doc";a.image_dec="image_dec";a.image_inc="image_inc";a.btn_pos="btn_pos";a.border_width="border_width";a.border_color="border_color";a.v_left="v_left";a.v_right="v_right";a.h_left="h_left";a.h_right="h_right";a.h_left_right="h_left_right";a.label_color="label_color";a.label_text_color="label_text_color";a.shadowColor="shadowColor";a.shadowBlur="shadowBlur";
a.shadowOffsetX="shadowOffsetX";a.shadowOffsetY="shadowOffsetY";a.border_size="border_size";a.clip="clip";a.keyboard="keyboard";a.kblayout="kblayout";a.kbexp="kbexp";a.extra_style="extra_style";return a}(babel||Object.create(null)),descartesJS=function(a){if(a.loadLib)return a;a.arimoBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.mathBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.mathRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.addFonts=function(){return"@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_monospace';src:url('"+
a.cousineBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_monospace';src:url('"+a.cousineBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_monospace';src:url('"+a.cousineIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_monospace';src:url('"+a.cousineRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_serif';src:url('"+
a.tinosBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_serif';src:url('"+a.tinosBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_serif';src:url('"+a.tinosIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_serif';src:url('"+a.tinosRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_math';src:url('"+a.mathBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_math';src:url('"+
a.mathBFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_math';src:url('"+a.mathRFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_math';src:url('"+a.mathRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n"};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.symbolFont=function(){return"data:font/woff2;charset=utf-8;base64, "};a.addSymbolFont=
function(){return"@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n"};
return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q={bold:"Bold",italic:"Italic",italics:"Italic","bold+italic":"Italic Bold"};a.serif_font="descartesJS_serif,DJS_symbol,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";a.sansserif_font="descartesJS_sansserif,DJS_symbol,DJS_sansserif,Helvetica,Arial,'Liberation Sans','Nimbus Sans L',sans-serif";a.monospace_font="descartesJS_monospace,DJS_symbol,DJS_monospace,'Courier New',Courier,'Liberation Mono','Nimbus Mono L',monospace";a.math_font=
"descartesJS_math,DJS_symbol,DJS_math,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";a.convertFont=function(d){if(""==d)return"";g=d.split(",");e="";e+=a.getFontStyle(g[1])+" ";e+=g[2]+"px ";return e+=a.getFontName(g[0].split(" ")[0])};a.getFontName=function(e){e=e.toLowerCase();d=a.monospace_font;if("serif"===e||"times new roman"===e||"timesroman"===e||"times"===e)d=a.serif_font;else if("sansserif"===e||"arial"===e||"helvetica"===e)d=a.sansserif_font;return d};
a.getFontStyle=function(a){return q[a.toLowerCase()]||""};a.getTextWidth=function(d,b){a.ctx.font=b;return Math.round(a.ctx.measureText(d).width)};a.getFieldFontSize=function(a){a=Math.min(50,a);return a=24<=a?Math.floor(a/2+2-a/16):20<=a?12:17<=a?11:15<=a?10:9};return a}(descartesJS||{});
descartesJS=function(a){function g(){var a,c,b,f,l,h,d;Number.prototype.oToFixed=Number.prototype.toFixed;Number.prototype.toFixed=function(e){e=e||0;e=0>e?0:parseInt(e);a=this.toString();-1!==a.indexOf("e")&&(f=a.split("e"),h="-"===f[0][0]?"-":"",l="-"===h?parseFloat(f[0].substring(1)).oToFixed(11):parseFloat(f[0]).oToFixed(11),d=parseInt(f[1]),c=l.indexOf("."),l=l.replace(".",""),0>c+d?(c=0>c?1:c,a=h+"0."+"0".repeat(Math.abs(c+d))+l):a=h+l+"0".repeat(d-l.length+1));c=a.indexOf(".");-1===c?0<e&&
(a+="."+"0".repeat(e)):(b=a.length-c-1,a=b>=e?11>=e?parseFloat(a).oToFixed(e):a.substring(0,c+e+1):a+"0".repeat(e-b));return a}}if(a.loadLib)return a;var e=2*Math.PI,d=360/e,q=e/360,p=Math.floor,b,k,m,c;a.rangeOK=1;a.cssScale=1;a.radToDeg=function(a){return a*d};a.degToRad=function(a){return a*q};a.drawLine=function(a,b,f,l,d,h,e){a.lineWidth=e||1;a.strokeStyle=h||"black";c=a.lineWidth%2*.5;a.beginPath();a.moveTo(p(b)+c,p(f)+c);a.lineTo(p(l)+c,p(d)+c);a.stroke()};a.getColor=function(a,c){if("string"===
typeof c)return c;b=a.eval(c);return"rgba("+p(255*b[0][0])+","+p(255*b[0][1])+","+p(255*b[0][2])+","+(1-b[0][3])+")"};a.getFeatures=function(){var c=navigator.appVersion.toLowerCase();a.hasTouchSupport=window.hasOwnProperty&&window.hasOwnProperty("ontouchstart")||"ontouchstart"in window||/android/i.test(c);a.isIOS=/iPad|iPhone/i.test(navigator.userAgent);a.isMsEdge=/Edge/i.test(navigator.userAgent);c=a.newHTML("canvas");a.hasCanvas=c.getContext&&c.getContext("2d");a.hasCanvas&&(c.width=c.height=1,
a.ctx=a.hasCanvas,a._ratio=2);g()};var l,f;a.removeNeedlessDecimals=function(a){if("string"==typeof a&&(l=a.indexOf("."),-1!==l)){f=a.substring(l);if(0==parseFloat(f))return a.substring(0,l);for(var c=f.length-1;0<c;c--)if("0"!==f.charAt(c))return a.substring(0,l+c+1)}return a};a.returnValue=function(a){return"number"===typeof a?parseFloat(a.toFixed(11)):a};a.whichBtn=function(a){return a.touches?"L":0===a.button?"L":1===a.button?"M":"R"};a.createGradient=function(a,c,b){a=void 0===a?0:a;c=void 0===
c?100:c;b="linear-gradient("+(void 0===b?0:b)+"deg,";for(var f=2*a,l=a;l<c;l++)a=p(100-l-35),b+="rgba(0,0,0,"+a*a*192/1E4/255+") "+(2*l-f)+"%, ";return b+"rgba(0,0,0,0.1) 100%)"};a.getCursorPosition=function(c,b){k=c.touches?c.touches[0]:c;m=b.getBoundingClientRect();return k?{x:(k.pageX-window.pageXOffset-m.left)/a.cssScale,y:(k.pageY-window.pageYOffset-m.top)/a.cssScale}:null};a.splitSeparator=function(a){a=a.replace(/\\n/g,"\n");for(var c=!1,b,f=[],l=0,h=0,d=a.length;h<d;h++)b=a.charAt(h),"'"===
b&&(c=!c),c||";"!==b&&"\n"!==b||(f.push(a.substring(l,h).replace(/\n/g,"\\n")),l=h+1);f.push(a.substring(l).replace(/\n/g,"\\n"));return f};a.preventDefault=function(a){a.preventDefault();return!1};a.convertHTMLEntities=function(c){var b=a.newHTML("textarea");b.innerHTML=c;return b.value};a.newHTML=function(a,c){a=document.createElement(a);for(var b in c)a.setAttribute(b,c[b]);return a};window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||
window.msRequestAnimationFrame;window.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame;a.setInterval=function(a,c){function b(){Date.now()-f>=c&&(a.call(),f=Date.now());l.value=requestAnimationFrame(b)}if(!requestAnimationFrame)return setInterval(a,c);var f=Date.now(),l={};l.value=requestAnimationFrame(b);return l};a.clearInterval=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearInterval(a))};a.setTimeout=function(a,c){function b(){Date.now()-
f>=c?a.call():l.value=requestAnimationFrame(b)}if(!requestAnimationFrame)return setTimeout(a,c);var f=Date.now(),l={};l.value=requestAnimationFrame(b);return l};a.clearTimeout=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearTimeout(a))};a.showAbout=function(){var c="<html>\n<head>\n<style>\nbody{text-align:center;}\niframe{width:650px;height:73px;overflow:hidden;border:1px solid black;}\ndt{font-weight:bold;margin-top:10px;}\n</style>\n</head>\n<body>\n<iframe src='http://arquimedes.matem.unam.mx/Descartes5/creditos/bannerPatrocinadores.html'></iframe>\n<h2><a href='http://proyectodescartes.org/' target='_blank'>ProyectoDescartes.org</a><br><a href='http://descartesjs.org' target='_blank'>DescartesJS.org</a></h2>\n<dl>\n<dt>Dise\u00f1o funcional:</dt>\n<dd>\n<nobr>Jos\u00e9 Luis Abreu Leon,</nobr>\n<nobr>Jos\u00e9 R. Galo Sanchez,</nobr>\n<nobr>Juan Madrigal Muga</nobr>\n</dd>\n<dt>Autores del software:</dt>\n<dd>\n<nobr>Jos\u00e9 Luis Abreu Leon,</nobr>\n<nobr>Marta Oliver\u00e1 Serrat,</nobr>\n<nobr>Oscar Escamilla Gonz\u00e1lez,</nobr>\n<nobr>Joel Espinosa Longi</nobr>\n</dd></dl>\n<p>\nEl software en Java est\u00e1 bajo la licencia\n<a href='https://joinup.ec.europa.eu/software/page/eupl/licence-eupl'>EUPL v.1.1</a>\n<br>\nEl software en JavaScript est\u00e1 bajo licencia\n<a href='http://www.gnu.org/licenses/lgpl.html'>LGPL</a>\n</p>\n<p>\nLa documentaci\u00f3n y el c\u00f3digo fuente se encuentran en :\n<br>\n<a href='http://descartes.matem.unam.mx/'>http://descartes.matem.unam.mx/</a>\n</p>";
a.ccLicense&&(c+="<p>\nEste objeto, creado con Descartes, est\u00e1 licenciado\npor sus autores como\n<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.es'><nobr>Creative Commons</nobr></a>\n<br>\n<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.es'><img src='https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png'></a>\n</p>");c+="</body> </html>";var b=window.open("","creditos","width=700,height=500,titlebar=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0");
b.document.write(c);b.document.close()};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.cacheFiles=Object.create(null);a.openExternalFile=function(g){if(a.cacheFiles[g])return a.cacheFiles[g];var e=null,d=new XMLHttpRequest;d.open("GET",g,!1);try{d.send(null),e=200===d.status||304===d.status?d.responseText:d.responseText||"",e=404===d.status?"":e,e.match(String.fromCharCode(65533))&&(d.open("GET",g,!1),d.overrideMimeType("text/plain;charset=ISO-8859-1"),d.send(null),e=d.responseText)}catch(q){e=null}return e};a.addExternalFileContent=function(g,
e){a.cacheFiles[g]=e};return a}(descartesJS||{});
descartesJS=function(a){function g(a){y=a.indexOf("--radial--");-1!=y&&(a=a.substring(0,y));a=a.replace(/\+/g,"\\+").replace(/\*/g,"\\*");p=a.trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};p[0]==p[p.length-1]&&"'"==p[0]&&(a.ignoreCaps=!0,p=p.substring(1,p.length-1),"`"==p[0]&&"\u00b4"==p[p.length-1]&&(a.ignoreAccents=!0,p=p.substring(1,p.length-1)));"`"==p[0]&&"\u00b4"==p[p.length-1]&&(a.ignoreAccents=!0,p=p.substring(1,p.length-1),p[0]==p[p.length-1]&&"'"==p[0]&&(a.ignoreCaps=!0,p=p.substring(1,
p.length-1)));"*"===p.charAt(0)&&"*"!==p.charAt(p.length-1)?p=p.substring(1)+"$":"*"!==p.charAt(0)&&"*"===p.charAt(p.length-1)?p="^"+p.substring(0,p.length-1):"*"!==p.charAt(0)&&"*"!==p.charAt(p.length-1)?p="^"+p+"$":"*"===p.charAt(0)&&"*"===p.charAt(p.length-1)&&(p=p.substring(1,p.length-1));a.regExp=p.replace(/\?/g,"[\\S\\s]{1}");return a}function e(a,c){p=(a||"").trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};a.expr=p.split(",");a.expr[0]=a.expr[0].trim();a.expr[0]={type:a.expr[0].charAt(0),
expr:c.parser.parse(a.expr[0].substring(1))};a.expr[1]=a.expr[1].trim();a.expr[1]={type:a.expr[1].charAt(a.expr[1].length-1),expr:c.parser.parse(a.expr[1].substring(0,a.expr[1].length-1))};return a}function d(a,h,b){h=parseFloat(h);c=a.expr[0];l=a.expr[1];f=b.eval(c.expr);v=b.eval(l.expr);r="("==c.type||"["==c.type;u=")"==l.type||"]"==l.type;return r&&h>f&&u&&h<=v?1:0}function q(a){return a.toString().replace(/\u00e1/g,"a").replace(/\u00e9/g,"e").replace(/\u00ed/g,"i").replace(/\u00f3/g,"o").replace(/\u00fa/g,
"u").replace(/\u00c1/g,"A").replace(/\u00c9/g,"E").replace(/\u00cd/g,"I").replace(/\u00d3/g,"O").replace(/\u00da/g,"U").replace(/\u00f1/g,"n").replace(/\u00d1/g,"N")}if(a.loadLib)return a;var p,b,k,m,c,l,f,v,r,u,y;a.buildRegularExpressionsPatterns=function(a,c){a=a||"";"("===a.charAt(0)&&")"===a.charAt(a.length-1)&&-1===a.indexOf(",")&&(a=a.substring(1,a.length-1));a=a.replace(/&squot;/g,"'").replace(/&amp;/g,"&").split("|");for(var h=0,f=a.length;h<f;h++){b=a[h].split("&");k=[];for(var l=0,d=b.length;l<
d;l++)p=b[l],-1===p.indexOf(",")||"("!==p.charAt(0)&&"["!==p.charAt(0)||")"!==p.charAt(p.length-1)&&"]"!==p.charAt(p.length-1)?k.push(g(p)):k.push(e(p,c));a[h]=k}return a};a.escorrecto=function(c,h,f,l){f=f||a.externalEvaluator;l=l||a.buildRegularExpressionsPatterns(c,f);h=q(h);c=0;for(var e=l.length;c<e;c++){b=l[c];m=!0;for(var k=0,r=b.length;k<r;k++)m=b[k].regExp?m&&!!h.match(new RegExp(q(b[k].regExp),"i")):m&&d(b[k],h,f);if(m)return 1}return 0};a.esCorrecto=function(c,h,f,l){f=f||a.externalEvaluator;
l=l||a.buildRegularExpressionsPatterns(c,f);h+="";c=0;for(var e=l.length;c<e;c++){b=l[c];m=!0;for(var k=0,r=b.length;k<r;k++)(p=b[k].regExp)?(b[k].ignoreAccents&&(h=q(h),p=q(p)),b[k].ignoreCaps&&(h=h.toLowerCase(),p=q(p).toLowerCase()),m=m&&!!h.match(p)):m=m=m&&d(b[k],h,f);if(m)return 1}return 0};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.loaderImg=new Image;a.loaderImg.src="data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='880' height='840' viewBox='0 0 880 840'><path d='M440 80c-132.5 0-240 107.5-240 240s107.5 240 240 240 240-107.5 240-240S572.5 80 440 80zm-11.1 462.2c-122.7 0-224.4-99.5-224.4-222.2S306.2 97.8 428.9 97.8 651.1 197.3 651.1 320s-99.5 222.2-222.2 222.2zm-11.1-426.6c-112.9 0-208.9 91.5-208.9 204.4s96 204.4 208.9 204.4S622.2 432.9 622.2 320s-91.5-204.4-204.4-204.4zm-11.1 391.1c-103.1 0-193.3-83.6-193.3-186.7s90.2-186.7 193.3-186.7S593.3 216.9 593.3 320s-83.5 186.7-186.6 186.7zm-11.1-355.6c-93.3 0-177.8 75.6-177.8 168.9s84.5 168.9 177.8 168.9S564.4 413.3 564.4 320c0-93.3-75.6-168.9-168.8-168.9zm-11.2 320c-83.5 0-162.2-67.7-162.2-151.1S301 168.9 384.4 168.9 535.6 236.5 535.6 320s-67.7 151.1-151.2 151.1zm-11.1-284.4c-73.6 0-146.7 59.7-146.7 133.3s73 133.3 146.7 133.3S506.7 393.6 506.7 320 447 186.7 373.3 186.7zm-11.1 248.9c-63.8 0-131.1-51.7-131.1-115.6s67.3-115.6 131.1-115.6S477.8 256.2 477.8 320 426 435.6 362.2 435.6zm-11.1-213.4c-54 0-115.6 43.8-115.6 97.8s61.6 97.8 115.6 97.8c54 0 97.8-43.8 97.8-97.8s-43.8-97.8-97.8-97.8zM340 400c-44.2 0-100-35.8-100-80s55.8-80 100-80 80 35.8 80 80-35.8 80-80 80z' fill='#2daae4'/><path d='M115.8 600.7c32.5 0 48.8 24.8 48.8 49.7 0 24.9-16.2 49.6-48.8 49.6H80.2v-99.3zm0 85c23 0 34.6-17.6 34.6-35.2s-11.6-35.4-34.6-35.4H94.5v70.6zm118.2 0V700h-60.6v-99.3h60.5V615h-46v28h45v14.5h-45l-.05 28.2zm42.2.9c10.6 0 22.3-6 22.3-16.2 0-1-.1-2.1-.4-3.4-1.7-7.5-11.9-8.8-21.9-9.8-15.5-1.6-33.7-5-35.2-25.65-.6-6.65 1.1-13.25 5.4-18.85 6.7-8.7 18.6-13.2 30.1-13.2 15.3 0 31.2 8 33.8 26.1l-14.3.7c-2-8.9-11.6-12.8-20.3-12.6-6.7.1-14.1 2.4-18 7.5-2 2.6-2.7 5.8-2.4 9.2.7 10.2 11.9 11.5 22.6 12.5 13.6 1.7 30.5 5.3 34.4 21.2.4 2.1.7 4.5.7 6.5 0 19.2-19 30.2-36.9 30.2-15.3 0-33.9-9.1-35.8-26.8l-.1-2.7 14.5-.3.1 1.8c1 8.9 12.2 13.8 21.4 13.8zm58-71.7c8.7-8.9 20.9-14.8 34.4-14.8 22.7 0 40.6 14.2 46.3 36.6h-14.2c-5.3-14.9-17.5-22.4-32.1-22.4-9.5 0-18.2 4.1-24.4 10.7-6.2 6.5-10.2 15.3-10.2 25.6 0 9.9 4 18.7 10.2 25.3 6.2 6.6 14.9 10.6 24.4 10.6 15.1 0 27.8-8.7 32.9-23.7h14.1c-5.7 22.6-23.9 37.9-47 37.9-13.5 0-25.7-5.7-34.4-14.8-8.5-9.1-14.2-21.6-14.2-35.4 0-14 5.7-26.5 14.2-35.6zm144.6 55.8h-35.6c-3.8 9.1-8.8 21-11.9 29.3h-15.5l39.9-100.7h10.5L506 700h-15.3zm-30.3-13.4h24.7L461 622.2zm96.9-7.7c12.1 0 18-8.7 18-17.3 0-8.5-6-17.2-18-17.2h-22V700h-14.2v-99.4h36.2c21.6 0 32.4 15.9 32.4 31.7 0 14.1-8.7 27.4-25.7 30.4l31.4 37.3h-18.6l-36.2-43.6-.05-6.8zm64.9 50.8v-85.3h-30.1v-14.5h74.4v14.5h-30v85.3zm112.2-14.7V700H662v-99.3h60.5V615h-46v28h45v14.5h-45l-.05 28.2zm42.3.9c10.6 0 22.3-6 22.3-16.2 0-1-.1-2.1-.4-3.4-1.7-7.5-11.9-8.8-21.9-9.8-15.5-1.6-33.7-5-35.2-25.65-.6-6.65 1.1-13.25 5.4-18.85 6.7-8.7 18.6-13.2 30.1-13.2 15.3 0 31.2 8 33.8 26.1l-14.3.7c-2-8.9-11.6-12.8-20.3-12.6-6.7.1-14.1 2.4-18 7.5-2 2.6-2.7 5.8-2.4 9.2.7 10.2 11.9 11.5 22.6 12.5 13.6 1.7 30.5 5.3 34.4 21.2.4 2.1.7 4.5.7 6.5 0 19.2-19 30.2-36.9 30.2-15.3 0-33.9-9.1-35.8-26.8l-.1-2.7 14.5-.3.1 1.8c1 8.9 12.2 13.8 21.4 13.8z' fill='#868686'/></svg>");a.getCCLImg=
function(){var a=new Image;a.src="data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='88' height='31' viewBox='0 0 120 42'><path fill='#aab2ab' stroke='#000' d='M.5.5h119v41H.5z'/><path d='M0 29.5h120V42H0z'/><circle cx='21' cy='19.5' r='18.25' fill='#aab2ab'/><path d='M49.935 33.105c.364.298.585.806.585 1.284 0 .403-.07.592-.228.833-.158.242-.377.405-.674.547.41.118.715.323.917.617.202.294.303.649.303 1.063 0 .68-.302 1.117-.721 1.465-.432.359-1.067.455-1.622.455H45.28v-6.622h3.122c.579 0 1.127.025 1.533.358zM48.8 35.24c.175-.141.307-.323.307-.6 0-.331-.126-.473-.307-.612-.188-.145-.351-.147-.697-.147H46.74v1.545h1.363c.26 0 .51-.035.697-.186zm-.5 2.996c.288 0 .553-.018.753-.181a.885.885 0 0 0 .325-.691c0-.34-.095-.552-.288-.727-.196-.177-.446-.218-.762-.218h-1.59v1.817zm2.795-5.489h1.633l1.55 2.616 1.543-2.616h1.623l-2.459 4.08v2.542h-1.46v-2.578zm21.34 6.622H71.07v-6.622h1.448l2.774 4.443.008-4.443h1.367v6.622H75.21l-2.765-4.433zm8.48-5.558c-1.07 0-1.893.887-1.893 2.224 0 1.336.91 2.263 1.893 2.263.823 0 1.503-.646 1.503-1.485h1.41c0 1.63-1.022 2.704-2.913 2.704-1.89 0-3.259-1.07-3.259-3.434 0-2.363 1.407-3.499 3.26-3.499 1.853 0 2.857.96 2.857 2.386h-1.41c0-.774-.755-1.159-1.448-1.159zm17.845 4.297c.27.228.68.283 1.023.283.485 0 .93-.072 1.157-.413.157-.235.118-.615-.043-.848-.223-.323-.713-.38-1.078-.474-.498-.129-.996-.18-1.437-.412-.411-.215-.835-.486-1.078-.881-.139-.225-.172-.506-.172-.775 0-.703.348-1.153.788-1.513.453-.371 1.11-.442 1.687-.49.698-.057 1.352.088 1.843.491.472.387.697 1.03.807 1.644h-1.414c.047-.386-.17-.615-.406-.798-.241-.188-.589-.207-.895-.204-.23.002-.486.028-.669.167-.177.135-.328.36-.328.584 0 .238.161.48.352.622.444.333 1.09.218 1.621.38.398.122.854.17 1.167.445.422.371.797.972.797 1.485 0 .672-.279 1.154-.701 1.517-.54.466-1.37.532-2.055.599-.756.021-1.449-.117-1.97-.558-.505-.427-.849-1.13-.849-1.792h1.413c0 .476.176.717.44.941zm7.886-5.361l2.477 6.622h-1.512l-.501-1.475h-2.477l-.52 1.475h-1.465l2.504-6.622zm-1.632 4.06h1.716l-.845-2.427z' fill='#fff'/><g stroke-width='2' fill='#fff' stroke='#000'><circle r='14.25' cy='19.5' cx='21' stroke-width='2.8'/><circle r='10.55' cx='52' cy='15'/><circle r='10.55' cy='15' cx='78'/><circle r='10.55' cx='104' cy='14.981'/></g><circle r='1.625' cy='9' cx='52'/><path d='M18.75 17.979c-.39-.852-.974-1.278-1.755-1.278-1.378 0-2.067.928-2.067 2.784 0 1.856.69 2.783 2.067 2.783.91 0 1.56-.452 1.951-1.357l1.91 1.017c-.91 1.618-2.277 2.428-4.098 2.428-1.406 0-2.531-.43-3.377-1.292-.846-.862-1.27-2.05-1.27-3.564 0-1.487.438-2.668 1.31-3.543.87-.875 1.958-1.312 3.259-1.312 1.926 0 3.304.759 4.14 2.275zm8.99 0c-.39-.852-.964-1.278-1.72-1.278-1.405 0-2.109.928-2.109 2.784 0 1.856.704 2.783 2.11 2.783.912 0 1.55-.452 1.915-1.357l1.953 1.017c-.91 1.618-2.274 2.428-4.092 2.428-1.404 0-2.526-.43-3.372-1.292-.843-.862-1.266-2.05-1.266-3.564 0-1.487.429-2.668 1.287-3.543.857-.875 1.947-1.312 3.273-1.312 1.923 0 3.3.759 4.13 2.275l-2.108 1.059zm27.381-5.862a.75.75 0 0 0-.75-.75h-4.743a.75.75 0 0 0-.749.75v4.742h1.324v5.617h3.594v-5.617h1.324zm13.779-.352l10.343 4.66a.867.867 0 0 1 .312.696c0 .887-.754 1.154-1.435 1.154-1.05 0-1.818-.324-2.588-1.048l-1.598 1.609c.962.84 2.22 1.374 3.52 1.389v1.789h1.332v-1.79c1.584-.115 2.895-1.108 3.191-2.58l4.471 2.048.852-2.129-10.391-4.682a.467.467 0 0 1-.106-.295c0-.723.814-.9 1.39-.9.71 0 1.42.281 1.983.68L81.7 10.8a5.005 5.005 0 0 0-2.914-1.065V7.95h-1.332v1.787c-1.417.083-2.587.83-2.987 2.059l-4.533-2.073zm29.88 1.58c.461-2.918 2.515-4.478 5.09-4.478 3.7 0 5.957 2.686 5.957 6.268 0 3.495-2.4 6.21-6.016 6.21-2.487 0-4.714-1.53-5.12-4.535h2.922c.087 1.56 1.1 2.109 2.546 2.109 1.648 0 2.718-1.53 2.718-3.87 0-2.456-.925-3.755-2.661-3.755-1.272 0-2.371.462-2.603 2.05l.85-.005-2.3 2.3-2.299-2.3.915.006z'/></svg>");
return a};a.getSvgArrowUp=function(a,e){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path transform="rotate('+(a?90:0)+',12,12)" fill="#'+(void 0===e?"24c":e)+'" d="m19.5 17.5-7.5-12-7.5 12z"/></svg>')};a.getSvgArrowDown=function(a,e){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path transform="rotate('+(a?90:0)+',12,12)" d="m19.5 5-7.5 12-7.5-12z" fill="#'+
(void 0===e?"d00018":e)+'"/></svg>')};a.getSvgMenu=function(){return"data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M6.64 8L12 12.962 17.36 8 19 9.519 12 16 5 9.519z'/></svg>")};a.getSvgCheckbox=function(){return"data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='45' height='45' viewBox='0 0 45 45'><path d='M37.095 6.284L15.473 27.905l-7.568-7.567L2.5 25.743l12.973 12.973L42.5 11.69z' fill='#1e272e'/></svg>")};
a.getSvgRadio=function(){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45" viewBox="0 0 45 45"><circle cx="22.5" cy="22.5" r="15" fill="#1e272e"/></svg>')};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=/[\w-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,e=Math.floor,d,q,p,b,k,m,c,l,f,v,r,u,y,n,h,x,w,z,A=function(c,h){this.r=this.g=this.b=0;this.a=1;this.evaluator=h;this.getColor=this.getColorStr;if(!c)this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")";else if(c.match(/^GradL/)){c=this.splitComa(c.substring(6,c.length-1));this.x1=this.evaluator.parser.parse(c[0]);this.y1=this.evaluator.parser.parse(c[1]);this.x2=this.evaluator.parser.parse(c[2]);
this.y2=this.evaluator.parser.parse(c[3]);this.stops=[];for(var f=4;f<c.length;f++)""!=c[f]&&(h=c[f].split("|"),this.stops.push({percentage:this.evaluator.parser.parse(h[1]),color:"#"+h[2]}));this.getColor=this.getLinearGradient}else if(c.match(/^Pattern/))this.img_src=c.substring(8,c.length-1),this.img_src.match(g)&&(this.img_src="'"+this.img_src+"'"),this.img_src=this.evaluator.parser.parse(this.img_src),this.getColor=this.getPattern;else if(babel[c])"net"===babel[c]&&(c="rojo"),c=babel[c],this.r=
a.toHex(c.substring(1,3)),this.g=a.toHex(c.substring(3,5)),this.b=a.toHex(c.substring(5,7)),this.colorStr=c;else if(6===c.length)this.r=a.toHex(c.substring(0,2)),this.g=a.toHex(c.substring(2,4)),this.b=a.toHex(c.substring(4,6)),this.colorStr="#"+c;else if(8===c.length)this.r=a.toHex(c.substring(2,4)),this.g=a.toHex(c.substring(4,6)),this.b=a.toHex(c.substring(6,8)),this.a=1-a.toHex(c.substring(0,2))/255,this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")";else if("("===c[0]){q=[];p=this.splitComa(c.substring(1,
c.length-1));c=0;for(h=p.length;c<h;c++)m=p[c],b=parseInt(m,16),m!==b.toString(16)&&m!=="0"+b.toString(16)?("["===m.charAt(0)&&"]"===m.charAt(m.length-1)&&(m=m.substring(1,m.length-1)),q.push(this.evaluator.parser.parse(m))):q.push(this.evaluator.parser.parse((b/255).toString()));this.rExpr=q[0];this.gExpr=q[1];this.bExpr=q[2];this.aExpr=q[3];this.getColor=this.getColorExp}};A.prototype.splitComa=function(a){k=[];for(var h=f=l=c=0,b=a.length;h<b;h++)v=a.charAt(h),"("===v?c++:")"===v?c--:"["===v?l++:
"]"===v?l--:","===v&&0===c&&0===l&&(k.push(a.substring(f,h)),f=h+1);k.push(a.substring(f));return k};A.prototype.getColorStr=function(){return this.colorStr};A.prototype.getColorExp=function(){d=this.evaluator;this.r=e(255*d.eval(this.rExpr));this.g=e(255*d.eval(this.gExpr));this.b=e(255*d.eval(this.bExpr));this.a=1-d.eval(this.aExpr);return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};A.prototype.getLinearGradient=function(){x=a.ctx.createLinearGradient(this.evaluator.eval(this.x1),this.evaluator.eval(this.y1),
this.evaluator.eval(this.x2),this.evaluator.eval(this.y2));for(var c=0;c<this.stops.length;c++)h=this.evaluator.eval(this.stops[c].percentage),h=0>h?0:1<h?1:h,x.addColorStop(h,this.stops[c].color);return x};A.prototype.getPattern=function(){z=this.evaluator.parent;if(w=z.getImage(this.evaluator.eval(this.img_src)))try{return a.ctx.createPattern(w,"repeat")}catch(E){}return"ff00ff"};A.prototype.borderColor=function(){return 380>this.r+this.g+this.b?"#ffffff":"#000000"};a.toHex=function(a){return parseInt("0x"+
a,16)};a.RGBAToHexColor=function(a){a=a.substring(5,a.length-1).split(",");r=parseInt(a[0]).toString(16);u=parseInt(a[1]).toString(16);y=parseInt(a[2]).toString(16);n=(255-parseInt(255*parseFloat(a[3]))).toString(16);1===r.length&&(r="0"+r);1===u.length&&(u="0"+u);1===y.length&&(y="0"+y);1===n.length&&(n="0"+n);return new A(n+r+u+y)};a.Color=A;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e){var d=this;this.parent=e;this.container=a.newHTML("div",{class:"DescartesKeyboardContainer"});this.container.oncontextmenu=function(){return!1};this.display=a.newHTML("textarea",{class:"DescartesKeyboardDisplay",spellcheck:"false",inputmode:"none"});this.container.appendChild(this.display);this.keyContainer=a.newHTML("div",{style:"position:absolute; padding-bottom:5px;",class:"DescartesKeysContainer"});this.container.appendChild(this.keyContainer);
this.aditionalKeys=a.newHTML("div",{style:"position:absolute; padding: 0 5px 5px 0; display:none;",class:"DescartesKeysContainer"});this.container.appendChild(this.aditionalKeys);this.newLine=a.newHTML("div",{style:"position:absolute; background-color:white; margin:0; font-family:DJS_sansserif; font-size:17px; font-weight:normal; line-height:38px",class:"new_line_btn"});this.newLine.textContent="\\n";this.newLine.addEventListener("pointerup",function(){d.insert("\n")});this.container.appendChild(this.newLine);
this.display.addEventListener("keydown",function(a){d.keypressed=!0;if(27===a.keyCode)d.close();else if(13===a.keyCode)d.onEnter()});this.key_pressed=!1;var g;this.delete_pressed=!1;var p;this.keyContainer.addEventListener("pointerdown",function(a){if("k_op"==a.target.id||"k_dot"==a.target.id||"k_a"==a.target.id||"k_e"==a.target.id||"k_i"==a.target.id||"k_o"==a.target.id||"k_u"==a.target.id){a.target.onpointerleave=function(){clearTimeout(g)};var b=a.target.textContent.trim().toLowerCase();g=setTimeout(function(){d.key_pressed=
!0;d.showAditionalKeys(b)},600)}else"k_delete"==a.target.id&&(a.target.onpointerleave=function(){clearTimeout(p)},p=setInterval(function(){d.delete_pressed=!0;d.delete()},200))});this.keyContainer.addEventListener("pointerup",function(a){if(a.target!=d.keyContainer&&a.target!=d.container)if(a.preventDefault(),a.stopPropagation(),"k_left"==a.target.id)d.display.selectionStart=d.display.selectionEnd=Math.max(0,d.display.selectionStart-1);else if("k_right"==a.target.id)d.display.selectionStart=d.display.selectionEnd=
Math.min(d.display.value.length,d.display.selectionStart+1);else if("k_delete"==a.target.id)d.delete_pressed||d.delete(),clearTimeout(p),d.delete_pressed=!1;else if("k_\u221a"==a.target.id)d.insert("\u221a(");else if("k_space"==a.target.id)d.insert(" ");else if("k_esc"==a.target.id)d.close();else if("k_shift"==a.target.id){a=d.keyContainer.querySelectorAll("div");var b=d.aditionalKeys.querySelectorAll("div");d.shift=!d.shift;d.shift?(a.forEach(function(a){1==a.textContent.trim().length&&(a.textContent=
a.textContent.toUpperCase());"k_point_comma"==a.getAttribute("id")&&(a.textContent=",")}),b.forEach(function(a){a.textContent=a.textContent.toUpperCase()})):(a.forEach(function(a){1==a.textContent.trim().length&&(a.textContent=a.textContent.toLowerCase());"k_point_comma"==a.getAttribute("id")&&(a.textContent=".")}),b.forEach(function(a){a.textContent=a.textContent.toLowerCase()}))}else if("k_num_layout"==a.target.id)d["setLayout_"+d.layout_mode.replace("alfa","num")]();else if("k_alfa_layout"==a.target.id)d["setLayout_"+
d.layout_mode.replace("num","alfa")]();else if("k_clear"==a.target.id)d.display.value="";else if("k_op"==a.target.id||"k_dot"==a.target.id||"k_a"==a.target.id||"k_e"==a.target.id||"k_i"==a.target.id||"k_o"==a.target.id||"k_u"==a.target.id)clearTimeout(g),d.key_pressed||(d.insert(a.target.textContent.trim()),d.aditionalKeys.style.display="none"),d.key_pressed=!1;else if("k_return"==a.target.id)d.onEnter();else a=a.target.textContent.trim(),d.insert(a),d.aditionalKeys.style.display="none";d.display.focus()});
this.keyContainer.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation()});var b=!1;this.aditionalKeys.addEventListener("pointerdown",function(a){b=!0});this.aditionalKeys.addEventListener("pointerup",function(a){b&&(a.target!=d.keyContainer&&a.target!=d.container&&(a.preventDefault(),a.stopPropagation(),a=a.target.textContent.trim(),d.insert(a)),d.key_pressed=!1,d.aditionalKeys.style.display="none");b=!1;d.display.focus()})};g.prototype.insert=function(a){this.display.setRangeText(a);
this.display.selectionStart+=a.length;this.display.selectionStart=this.display.selectionEnd};g.prototype.delete=function(){this.display.selectionStart==this.display.selectionEnd&&(this.display.selectionStart=Math.max(0,this.display.selectionStart-1));this.display.setRangeText("")};g.prototype.addKey=function(a,d,g){return"<div "+(d?"id='"+d+"'":"")+" "+(g?"style='"+g+"'":"")+">"+a+"</div>"};g.prototype.addKeys=function(a){var d=this,e="";a.forEach(function(a){e="object"===typeof a?e+d.addKey(a.val,
a.id,a.style):e+d.addKey(a)});return e};g.prototype.showAditionalKeys=function(a){var d=[];"."==a?d=",;:-_\u00bf?\u00a1!()".split(""):"+"==a?d=["-","\u00d7","\u00f7","^"]:"a"==a?d=["\u00e1","\u00e0","\u00e4","\u00e2"]:"e"==a?d=["\u00e9","\u00e8","\u00eb","\u00ea"]:"i"==a?d=["\u00ed","\u00ec","\u00ef","\u00ee"]:"o"==a?d=["\u00f3","\u00f2","\u00f6","\u00f4"]:"u"==a&&(d=["\u00fa","\u00f9","\u00fc","\u00fb"]);this.aditionalKeys.innerHTML=this.addKeys(d);this.shift&&(this.aditionalKeys.innerHTML=this.aditionalKeys.innerHTML.toUpperCase());
this.aditionalKeys.style.display="flex";this.aditionalKeys.style.left=this.keyContainer.style.left;this.aditionalKeys.style.top=parseFloat(this.keyContainer.style.top)-50+"px"};g.prototype.setLayout_14x1=function(){this.keyContainer.innerHTML=this.addKeys([1,2,3,4,5,6,7,8,9,0,{val:this.parent.decimal_symbol},"-",{val:"\u232b",id:"k_delete"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="635px"};g.prototype.setLayout_7x2=function(){this.keyContainer.innerHTML=this.addKeys([1,2,3,4,5,
{val:this.parent.decimal_symbol},{val:"\u232b",id:"k_delete"},6,7,8,9,0,"-",{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="320px"};g.prototype.setLayout_10x2=function(){this.keyContainer.innerHTML=this.addKeys(["(",1,2,3,4,5,"\u00b2","/","\u00d7",{val:"\u232b",id:"k_delete"},")",6,7,8,9,0,{val:this.parent.decimal_symbol},"-","+",{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="455px"};g.prototype.setLayout_4x4=function(){this.keyContainer.innerHTML=this.addKeys([7,8,9,
{val:"\u232b",id:"k_delete"},4,5,6,"+",1,2,3,"-",{val:0,style:"width:85px;"},{val:this.parent.decimal_symbol},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="185px"};g.prototype.setLayout_5x4=function(){this.keyContainer.innerHTML=this.addKeys([7,8,9,"\u00b2",{val:"\u232b",id:"k_delete"},4,5,6,"/","\u00d7",1,2,3,"\u2212","+",{val:0,style:"width:85px;"},".",{val:"\u21b5",id:"k_return",style:"margin-left:50px;"}]);this.keyContainer.style.width="230px"};g.prototype.setLayout_11x3=function(){this.keyContainer.innerHTML=
this.addKeys(["q","w",{val:"e",id:"k_e"},"r","t","y",{val:"u",id:"k_u"},{val:"i",id:"k_i"},{val:"o",id:"k_o"},"p",{val:"\u232b",id:"k_delete"},{val:"a",id:"k_a"},"s","d","f","g","h","j","k","l","\u00f1",{val:".",id:"k_dot"},{val:"\u21c5",id:"k_shift"},"z","x","c","v","b","n","m",{val:"",id:"k_space",style:"width:85px;"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="500px";this.shift=!1};g.prototype.setLayout_11x4=function(){this.keyContainer.innerHTML=this.addKeys([1,2,3,4,5,6,7,8,
9,0,{val:"\u232b",id:"k_delete"},"q","w",{val:"e",id:"k_e"},"r","t","y",{val:"u",id:"k_u"},{val:"i",id:"k_i"},{val:"o",id:"k_o"},"p",{val:"+",id:"k_op"},{val:"a",id:"k_a"},"s","d","f","g","h","j","k","l","\u00f1",{val:".",id:"k_dot"},{val:"\u21c5",id:"k_shift"},"z","x","c","v","b","n","m",{val:"",id:"k_space",style:"width:85px;"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="500px"};g.prototype.setLayout_10x4_alfa=function(){this.keyContainer.innerHTML=this.addKeys(["q","w",{val:"e",
id:"k_e"},"r","t","y",{val:"u",id:"k_u"},{val:"i",id:"k_i"},{val:"o",id:"k_o"},"p",{val:"a",id:"k_a"},"s","d","f","g","h","j","k","l","\u00f1",{val:"\u21c5",id:"k_shift",style:"width:62.5px;"},"z","x","c","v","b","n","m",{val:"\u232b",id:"k_delete",style:"width:62.5px;"},{val:"123",id:"k_num_layout",style:"width:85px;"},{val:"",id:"k_space",style:"width:220px;transform:none !important;"},{val:"/",id:"k_slash"},{val:".",id:"k_dot"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="455px"};
g.prototype.setLayout_10x4_num=function(){this.keyContainer.innerHTML=this.addKeys(["1","2","3","4","5","6","7","8","9","0","@",'"',"$","_","-","+","(",")","/","*","&","|","\u00ba",":",";","\u00a1","!","\u00bf","?",{val:"\u232b",id:"k_delete"},{val:"ABC",id:"k_alfa_layout",style:"width:85px;"},{val:"",id:"k_space",style:"width:220px;transform:none !important;"},{val:",",id:"k_slash"},{val:".",id:"k_dot"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="455px"};g.prototype.showCustomKB=
function(a){var d=a.querySelectorAll("div");a=parseInt(a.getAttribute("cols")||d.length);for(var e=[],g,b,k=0;k<d.length;k++){g={val:d[k].textContent};if(b=d[k].getAttribute("id"))g.id=b;if(b=d[k].getAttribute("size"))g.style="width:"+(40*parseInt(b)+5*(parseInt(b)-1))+"px;transform:none !important;";e.push(g)}this.keyContainer.innerHTML=this.addKeys(e);this.keyContainer.style.width=5+45*a+"px"};g.prototype.setLayout=function(a){this.layout_mode=a;var d=document.getElementById("kb_"+a);d?this.showCustomKB(d):
"14x1"==a?this.setLayout_14x1():"7x2"==a?this.setLayout_7x2():"10x2"==a?this.setLayout_10x2():"4x4"==a?this.setLayout_4x4():"5x4"==a?this.setLayout_5x4():"11x3"==a?this.setLayout_11x3():"11x4"==a?this.setLayout_11x4():"10x4_alfa"==a?this.setLayout_10x4_alfa():"10x4_num"==a?this.setLayout_10x4_num():this.setLayout_14x1()};g.prototype.show=function(a,d,g,p,b,k,m){this.ctr=a;this.var_id=b;this.onlyText=m;this.container.parentNode||this.parent.container.appendChild(this.container);this.container.style.display=
"block";this.setDisplay(k);this.setLayout(d);this.keyContainer.style.left=g+"px";this.keyContainer.style.top=p+"px";this.aditionalKeys.style.display="none"};g.prototype.close=function(){this.container.style.display="none"};g.prototype.setDisplay=function(e){if("custom"==e.type){var d=e.x;var g=e.y;var p=e.w;var b=e.h;var k=e.fs}else g=this.container.getBoundingClientRect(),b=e.getBoundingClientRect(),d=b.left/a.cssScale-g.left/a.cssScale,g=b.top/a.cssScale-g.top/a.cssScale,p=b.width/a.cssScale,b=
b.height/a.cssScale,k=e.style.fontSize;"textarea"==e.tagName.toLowerCase()?(this.display.setAttribute("style","left:"+d+"px;top:"+g+"px;width:"+p+"px;height:"+b+"px;font-size:"+k+";line-height:1.2em;padding:5px;font:"+e.style.font+";"),this.newLine.style.left=d+p-42+"px",this.newLine.style.top=g+b-42+"px",this.newLine.style.display="block"):(this.display.setAttribute("style","left:"+d+"px;top:"+g+"px;width:"+p+"px;height:"+b+"px;font-size:"+k+";line-height:"+b+"px;white-space:nowrap;"),this.newLine.style.display=
"none");this.display.value=e.value||"";this.display.focus();this.display.selectionStart=this.display.selectionEnd=this.display.value.length};g.prototype.onEnter=function(){var a=this.display.value;if(!this.onlyText){var d=this.parent.evaluator.parser.parse(a.replace(/\u221a/g,"sqrt"));try{d&&(a=this.parent.evaluator.eval(d))}catch(b){a=0}}if(this.ctr)this.ctr.changeValue(a,!0);else if(this.var_id=(this.var_id+"").trim(),d=this.var_id.indexOf("["),-1==d)this.parent.evaluator.setVariable(this.var_id,
a);else{var g=this.var_id.indexOf(","),p=this.var_id.substring(0,d);-1==g?this.parent.evaluator.setVector(p,parseInt(this.var_id.substring(d+1)),a):this.parent.evaluator.setMatrix(p,parseInt(this.var_id.substring(d+1)),parseInt(this.var_id.substring(g+1)),a)}this.parent.update();this.close()};a.Keyboard=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=document.head,e=a.newHTML("meta",{"http-equiv":"X-UA-Compatible",content:"IE=edge,chrome=1"});g.appendChild(e);e=a.newHTML("meta",{name:"viewport",content:"width=device-width,initial-scale=1.0,user-scalable=yes"});document.querySelector("meta[name=viewport]")||g.appendChild(e);e=a.newHTML("meta",{name:"mobile-web-app-capable",content:"yes"});g.appendChild(e);e=a.newHTML("meta",{name:"apple-mobile-web-app-capable",content:"yes"});g.appendChild(e);
e=a.newHTML("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"});g.appendChild(e);(g=document.getElementById("StyleDescartesApps2"))&&g.remove();g=a.newHTML("style",{rel:"stylesheet",type:"text/css",id:"StyleDescartesApps2"});document.head.insertBefore(g,document.head.firstChild);g.innerHTML="body{-webkit-font-smoothing:antialiased;}\n#descartesJS_north,#descartesJS_south,#descartesJS_east,#descartesJS_west{background:#c0c0c0;position:absolute;z-index:100;}\n.PBL{position:absolute;background-color:#f2f2f2;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;color:#2daae4;visibility:hidden;border-radius:100vw;}\n.PBL::-moz-progress-bar{background:#2daae4;border-radius:inherit;}\n.PBL::-webkit-progress-bar{background:#f2f2f2;border-radius:100vw;}\n.PBL::-webkit-progress-value{background:#2daae4;border-radius:inherit;}\n.PBL::-ms-fill{background:#2daae4;border-radius:inherit;}\n.DescartesAppContainer *,.DescartesAppContainer *:before,.DescartesAppContainer *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;transform:translate3d(0,0,0);}\n.DescartesAppContainer{border:none;overflow:hidden;position:relative;top:0;left:0;}\n.DescartesCatcher{background-color:rgba(0,0,0,0);cursor:pointer;position:absolute;}\n.DescartesLoader{background-color:#fff;overflow:hidden;position:absolute;top:0;left:0;z-index:1000;width:100%;height:100%;display:none;}\n.DescartesLoaderImage{position:absolute;background-repeat:no-repeat;background-position:center;overflow:hidden;top:0;left:0;width:100%;height:100%;}\n.DescartesSpace2DCanvas,.DescartesSpace3DCanvas,.blocker{touch-action:none;position:absolute;overflow:hidden;left:0;top:0;}\n.DescartesSpace2DContainer,.DescartesSpace3DContainer{position:absolute;overflow:hidden;line-height:0;}\n.DescartesCheckboxContainer input[type=checkbox],.DescartesCheckboxContainer input[type=radio]{display: none;}\n.DescartesCheckboxContainer input[type=checkbox]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:#fff;border:1px solid gray;}\n.DescartesCheckboxContainer input[type=checkbox]:checked+label::after{content:'';background:url("+
a.getSvgCheckbox()+") center center no-repeat;background-size:contain;background-color:#fff;}\n.DescartesCheckboxContainer input[type=radio]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:#fff;border:1px solid gray;border-radius:50%;}\n.DescartesCheckboxContainer input[type=radio]:checked+label::after{content:'';background:url("+a.getSvgRadio()+") center center no-repeat;background-size:contain;background-color:#fff;}\n.DescartesCheckbox{position:absolute;}\n.TextfieldCover{position:absolute;overflow:hidden;background-color:transparent;cursor:pointer;}\ninput[type=text]{-webkit-appearance:none;}\n.DescartesButton{position:absolute;cursor:pointer;}\n.DescartesButtonContainer,.DescartesSpinnerContainer,.DescartesCheckboxContainer,.DescartesTextFieldContainer,.DescartesMenuContainer{position:absolute;overflow:hidden;}\n.DescartesSpinnerContainer input,.DescartesCheckboxContainer,.DescartesTextFieldContainer input,.DescartesMenuContainer select{border-radius:0;}\n.DescartesSpinnerField,.DescartesTextFieldField,.DescartesMenuField,.DescartesScrollbarField{font-family:"+
a.sansserif_font+";padding:0 2px;border:solid #666 1px;position:absolute;}\ninput[type=text]:disabled,.DescartesMenuSelect:disabled{background-color:#e3e3e3;cursor:not-allowed;opacity:1;}\n.DescartesSpinnerLabel,.DescartesCheckboxLabel,.DescartesMenuLabel,.DescartesScrollbarLabel,.DescartesTextFieldLabel{font-family:"+a.sansserif_font+";font-weight:normal;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:absolute;left:0;top:0;}\n.DescartesGraphicControl{touch-action:none;border-style:none;position:absolute;}\n.DescartesTextAreaContainer{position:absolute;overflow:hidden;background:#F7F7F7;resize:none;}\n.DescartesMenuSelect{font-family:"+
a.sansserif_font+";padding-top:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:absolute;border:1px solid #7a8a99; background:#fff url('"+a.getSvgMenu()+"') 100%/22px no-repeat;padding:0 22px 0 5px;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;}\n.DescartesMenuSelect::-ms-expand{display:none;}\n.DescartesScrollbarContainer{touch-action:none;background:#eee;overflow:hidden;position:absolute;}\n.DJS_Up,.DJS_Down{cursor:pointer;position:absolute;border-width:1px 0 1px 1px;background-size:cover;background-repeat:none;background-position:center;}\n.DJS_Up[horizontal=false]{background-color:#f0f8ff;background-image:"+
a.createGradient(50,100)+", url('"+a.getSvgArrowUp()+"');}\n.DJS_Up[horizontal=true]{background-color:#f0f8ff;background-image:"+a.createGradient(50,100,90)+", url('"+a.getSvgArrowUp(!0)+"');}\n.DJS_Up[active=false]::after{cursor:not-allowed;content:'';position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(255,255,255,0.3);}\n.DJS_Down[horizontal=false]{background-color:#f0f8ff;background-image:"+a.createGradient(0,50)+", url('"+a.getSvgArrowDown()+"');}\n.DJS_Down[horizontal=true]{background-color:#f0f8ff;background-image:"+
a.createGradient(50,100,-90)+", url('"+a.getSvgArrowDown(!0)+"');}\n.DJS_Down[active=false]::after{cursor:not-allowed;content:'';position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(255,255,255,0.3);}\n.DescartesKeyboardContainer{position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0.1);z-index:1000;}\n.DescartesKeysContainer{display:flex;flex-direction:row;flex-wrap:wrap;background-color:#c0c0c0;border-radius:4px;border:1px solid rgba(0,0,0,0.3);box-shadow:0 0 8px 0 rgba(0,0,0,0.75);box-sizing: content-box;}\n.DescartesKeysContainer > div, .new_line_btn{margin:5px 0 0 5px;display:inline-block;min-width:40px;min-height:40px;max-height:40px;line-height:35px;background-color:#ebeff3;font-family:"+
a.math_font+";font-size:18px;font-weight:bold;color:black;cursor:pointer;text-align:center;border-radius:4px;border:1px solid rgba(0,0,0,0.3);box-shadow:0 1px 2px 0 rgba(0,0,0,0.25);transform-origin:center;user-select:none;}\n.DescartesKeysContainer > div:hover, .new_line_btn:hover{background-color:rgba(0,0,0,0.05);transform:scale(1.1);}\n.DescartesKeysContainer > div:active, .new_line_btn:active{transform:scale(0.95);}\n.DescartesKeyboardDisplay{font-family:"+a.sansserif_font+";padding:0 2px;border:solid #666 1px;text-align:left;background-color:white;position:absolute;overflow:hidden;outline:2px solid black; resize: none;}\n.custom_keyboard{display:none;}\n.DJS_Gradient{position:absolute;display:none;}\n"+
(a.addSymbolFont?a.addSymbolFont():"")+(a.addFonts?a.addFonts():"");return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.sin,e=Math.floor,d=Math.random,q=Math.round,p=Math.abs,b=String.fromCharCode,k,m,c,l,f,v,r,u,y,n,h=function(a){this.key=(void 0===a?0:a).toString()};h.prototype.getKey=function(a){k=[];for(var c=0;256>c;c++)k[c]=b(this.alfanum(e(p(7.5*(g(1*c-a)+g(1.4*c+a)+g(.6*c-a)+g(2.2*c+a))))));return k.join("")};h.prototype.encode=function(a){m=e(31*d());this.key=this.getKey(m);return b(this.alfanum(m))+this.encripta(a)};h.prototype.decode=function(a){m=
this.numalfa(a.charCodeAt(0));this.key=this.getKey(m);return this.desencripta(a.substring(1))};h.prototype.encripta=function(a){return this.bytesToString(this.encriptaAux(this.stringToBytes(a)))};h.prototype.encriptaAux=function(a){if(null==a||null==this.key)return null;v=Array(3*a.length);for(var c=0,h=a.length;c<h;c++)y=256*e(a[c]+128)+q(255*d())+65536*q(255*d()),n=e((y<<this.shift(c))/256),v[3*c]=this.alfanum(n%32),v[3*c+1]=this.alfanum(n/32%32),v[3*c+2]=this.alfanum(n/1024%32);return v};h.prototype.desencripta=
function(a){return this.bytesToString(this.desencriptaAux(this.stringToBytes(a)))};h.prototype.desencriptaAux=function(a){if(null==a||null==this.key)return null;r=Array(a.length/3);for(var c=0,h=r.length;c<h;c++)n=this.numalfa(a[3*c])+32*this.numalfa(a[3*c+1])+1024*this.numalfa(a[3*c+2]),y=e(256*n>>this.shift(c)),u=e(y/256)%256-128,0>u&&(u+=256),r[c]=u;return r};h.prototype.alfanum=function(a){return(10>a?48:87)+e(a)};h.prototype.numalfa=function(a){return a-(58>a?48:87)};h.prototype.stringToBytes=
function(a){l=[];for(var c=0,h=a.length;c<h;c++)l.push(a.charCodeAt(c));return l};h.prototype.bytesToString=function(a){for(var c=0,h=a.length;c<h;c++)a[c]=b(a[c]);return a.join("")};h.prototype.shift=function(a){c=this.key.charCodeAt(a%this.key.length);l=this.numalfa(c);f=e(l/2%8);0==f&&(f=4);return f};h.prototype.parseByte=function(a){a=parseInt(a);a=0>a?0:a;return 255<a?255:a};a.Krypto=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){this.parent=e;var g=e.evaluator,p=g.parser;e=new a.Auxiliary(e);var b=this;b.delay=d.delay?p.parse(d.delay):p.parse("60");b.loop=d.loop?d.loop:!1;b.auto=void 0==d.auto?!0:d.auto;b.controls=d.controls;b.init=e.splitInstructions(p,d.init);b.doExpr=e.splitInstructions(p,d.doExpr);d.whileExpr&&(b.whileExpr=p.parse(d.whileExpr));var k,m=b.doExpr.length;b.animExec=function(){for(k=0;k<m;k++)g.eval(b.doExpr[k]);b.parent.update();b.playing&&
(0<g.eval(b.whileExpr)||b.loop)?b.timer=a.setTimeout(b.animExec,g.eval(b.delay)):(b.stop(),b.pause=!1,b.parent.update())};b.playing=!1;b.auto&&b.play()};g.prototype.play=function(){this.playing?(this.pause=!0,this.stop()):(this.pause||this.reinit(),this.playing=!0,this.pause=!1,this.timer=a.setTimeout(this.animExec,Math.max(10,this.parent.evaluator.eval(this.delay))))};g.prototype.stop=function(){this.playing=!1;a.clearTimeout(this.timer)};g.prototype.reinit=function(){for(var a=0,d=this.init.length;a<
d;a++)this.parent.evaluator.eval(this.init[a])};a.Animation=g;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var g=function(a,d){this.parent=a;this.evaluator=this.parent.evaluator};g.prototype.execute=function(){};a.Action=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){e=a.Action.call(this,e,d)||this;e.parameter=(d||"").replace(/\\n/g,"\n").replace(/&squot;/g,"'");return e};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){alert(this.parameter)};a.Message=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){e=a.Action.call(this,e,d)||this;var g=e.evaluator,p=g.parser;d=a.splitSeparator((d||"").replace(/&squot;/g,"'"));for(var b=[],k,m=0,c=d.length;m<c;m++)(k=p.parse(d[m],!0))&&b.push(k);c=b.length;e.execute=function(){for(m=0;m<c;m++)g.eval(b[m])};return e};$jscomp.inherits(g,a.Action);a.Calculate=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){var g=a.Action.call(this,e,d)||this;g.parent=e;g.parser=e.evaluator.parser;g.evaluator=e.evaluator;g.parameter=d;g.target="_blank";return g};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){var e=this.parameter;e.match(/^\[.*\]?/)&&(e=this.evaluator.eval(this.parser.parse(e.substring(1,e.length-1))));var d=e.indexOf("target");-1!=d&&(this.target=e.substring(d),this.target=this.target.substring(this.target.indexOf("=")+1),
e=e.substring(0,d-1));if("javascript"==e.substring(0,10)){e=new a.SimpleText(this.parent,e.substring(11).replace(/&squot;/g,"'"));try{eval(e.toString())}catch(q){}}else"http"!=e.substring(0,4)&&(d=window.__dirname||window.location.href,e=d.substring(0,d.lastIndexOf("/")+1)+e),window.open(e,this.target)};a.OpenURL=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){var g=a.Action.call(this,e,d)||this;g.parser=e.evaluator.parser;g.evaluator=e.evaluator;g.parameter=d.trim();g.target="_blank";return g};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){var a=this.parameter;a.match(/^\[.*\]?/)&&(a=this.evaluator.eval(this.parser.parse(a.substring(1,a.length-1))));var d=a.indexOf("target");-1!=d&&(this.target=a.substring(d),this.target=this.target.substring(this.target.indexOf("=")+1),a=a.substring(0,
d-1));if("javascript"==a.substring(0,10)){a=a.substring(11).replace(/&squot;/g,"'");try{eval(a.toString())}catch(q){}}else"http"!=a.substring(0,4)&&(d=window.__dirname||window.location.href,a=d.substring(0,d.lastIndexOf("/")+1)+a),window.open(a,this.target,"width="+this.parent.width+",height="+this.parent.height+",left="+(window.screen.width-this.parent.width)/2+", top="+(window.screen.height-this.parent.height)/2+"location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0")};a.OpenScene=g;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){this.parent.editor?this.parent.editor.show():window.open("about:blank","_blank","width=800px,height=600px,location=no,menubar=no,scrollbars=yes").document.write("<xmp style='width:100%;height:100%;'><script type='text/javascript' src='http://arquimedes.matem.unam.mx/Descartes5/lib/descartes-min.js'>\x3c/script>"+this.parent.applet.outerHTML.replace(/<applet/g,"<ajs").replace(/<\/applet/g,
"</ajs")+"</xmp>")};a.Config=g;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){this.parent.init()};a.Init=g;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){this.parent.clear()};a.Clear=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){this.parent.play()};a.Animate=g;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(g,a.Action);g.prototype.execute=function(){this.parent.reinitAnimation()};a.InitAnimation=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi,e=function(d,e){d=a.Action.call(this,d,e)||this;e=e||"";e.match(g)?d.filenameExpr=d.evaluator.parser.parse("'"+e.match(g)+"'"):(e.match(/^\[.*\]?/)&&(e=e.substring(1,e.length-1)),d.filenameExpr=d.evaluator.parser.parse(e));return d};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){var a=this.theAudio=this.parent.getAudio(this.evaluator.eval(this.filenameExpr));a.paused?a.play():(a.pause(),a.currentTime=
0)};a.PlayAudio=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d=function(a,d){this.parent=a;this.evaluator=this.parent.evaluator;this.local=this.expresion=this.id="";this.evaluate="onlyOnce";Object.assign(this,d)};d.prototype.firstRun=function(){};d.prototype.update=function(){};d.prototype.splitInstructions=function(d,p){e=[];p=p?a.splitSeparator(p):[""];for(var b=0,k=p.length;b<k;b++)a.DEBUG.lineCount=b,(g=d.parse(p[b],!0))&&e.push(g);return e};d.prototype.getPrivateVariables=function(a,d){e=[];d=d?d.split(/;|,/):
[""];for(var b=0,k=d.length;b<k;b++)(g=a.parse(d[b],!0))&&e.push(g);b=0;for(k=e.length;b<k;b++)e[b]="assign"===e[b].type?e[b].childs[0].value:"identifier"===e[b].type?e[b].value:"";return e};d.prototype.parseExpressions=function(d){a.DEBUG.paramName="inicio";this.init=this.splitInstructions(d,this.init);a.DEBUG.paramName="local";this.privateVars=this.getPrivateVariables(d,this.local);a.DEBUG.paramName="hacer";this.doExpr=this.splitInstructions(d,this.doExpr);a.DEBUG.paramName="mientras";this.whileExpr=
d.parse(this.whileExpr)};a.Auxiliary=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){e=a.Auxiliary.call(this,e,d)||this;d=e.evaluator.parser;e.expresionString=e.expresion;e.expresion=d.parse(e.expresionString);e.expresion&&d.setVariable(e.id,e.expresion);e.editable&&(e.registerTextField(),e.parent.editableRegionVisible=!0);return e};$jscomp.inherits(g,a.Auxiliary);g.prototype.registerTextField=function(){var e=a.newHTML("div"),d=a.newHTML("label");d.appendChild(document.createTextNode("___"+this.id+"=___"));var g=a.newHTML("input");
g.value=this.expresionString;g.disabled=!this.editable;e.appendChild(d);e.appendChild(g);var p=this,b=p.evaluator.parser;g.onkeydown=function(a){13==a.keyCode&&(p.expresion=b.parse(this.value),b.setVariable(p.id,p.expresion),p.parent.update())};this.parent.editableRegion.textFields.push({container:e,type:"div"})};a.Variable=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){e=a.Auxiliary.call(this,e,d)||this;e.expresion=e.evaluator.parser.parse(e.expresion);e.update();return e};$jscomp.inherits(g,a.Auxiliary);g.prototype.update=function(){this.evaluator.setVariable(this.id,this.evaluator.eval(this.expresion))};a.Constant=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p=function(b,d){d=a.Auxiliary.call(this,b,d)||this;g=b.evaluator;e=g.parser;d.size=d.size||e.parse("3");d.expresion=d.expresion.split(";");d.parseFile=e.parse(d.file);d.update();return d};$jscomp.inherits(p,a.Auxiliary);p.prototype.update=function(){var b=this.expresion,k;g=this.evaluator;e=g.parser;this.oldFile=this.file;if(d=g.eval(this.parseFile))this.file=d;if(this.file){q=(k=document.getElementById(this.file))&&"descartes/vectorFile"==
k.type?k.text:a.openExternalFile(this.file);if(null!=q){q=q.replace(/\r/g,"").split("\n");k=[];for(var m=0,c=q.length;m<c;m++)""!=q[m]&&k.push(q[m]);q=k}null==q||1==q.length&&""==q[0]?(q=[],this.size=e.parse("0")):(b=q,this.size=null);null===this.size&&(this.size=e.parse(b.length+""))}var l;k=[];m=0;for(c=b.length;m<c;m++)(l=e.parse(b[m],!0))&&"assign"!=l.type&&(l=e.parse(this.id+"["+m+"]="+b[m],!0)),k.push(l);b=parseInt(Math.abs(g.eval(this.size)));b=Array(b).fill(0);b._size_=b.length;g.vectors[this.id]=
b;g.setVariable(this.id+".long",b._size_);m=0;for(c=k.length;m<c;m++)g.eval(k[m])};a.Vector=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b=function(b,m){m=a.Auxiliary.call(this,b,m)||this;g=b.evaluator;e=g.parser;m.rows=m.rows||e.parse("3");m.columns=m.columns||e.parse("3");m.expresion=m.splitInstructions(e,m.expresion);d=g.eval(m.rows);q=g.eval(m.columns);p=[];p.type="matrix";b=0;for(var c=q;b<c;b++)p[b]=Array(d).fill(0);g.matrices[m.id]=p;m.update();return m};$jscomp.inherits(b,a.Auxiliary);b.prototype.update=function(){g=this.evaluator;d=g.eval(this.rows);q=g.eval(this.columns);
g.setVariable(this.id+".filas",d);g.setVariable(this.id+".columnas",q);p=g.matrices[this.id];p.rows=d;p.cols=q;for(var a=0,b=this.expresion.length;a<b;a++)g.eval(this.expresion[a])};a.Matrix=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){var g=a.Auxiliary.call(this,e,d)||this;var p=g.evaluator;e=p.parser;d=g.id.indexOf("(");g.name=g.id.substring(0,d);g.params=g.id.substring(d+1,g.id.indexOf(")"));g.domain=g.range?e.parse(g.range):e.parse("1");g.params=""===g.params?[]:g.params.split(",");g.numberOfParams=g.params.length;g.algorithm||(g.init="",g.doExpr="",g.whileExpr="");g.parseExpressions(e);g.expresion=e.parse(g.expresion);var b;g.functionExec=function(){g.iterations=
0;if(g.numberOfParams<=arguments.length){for(var d=[],e=0,c=g.privateVars.length;e<c;e++)d.push(p.getVariable(g.privateVars[e])),p.setVariable(g.privateVars[e],0);var l=[];e=0;for(c=g.params.length;e<c;e++)l[e]=p.getVariable(g.params[e]),p.setVariable(g.params[e],arguments[e]);e=0;for(c=g.init.length;e<c;e++)p.eval(g.init[e]);do{e=0;for(c=g.doExpr.length;e<c;e++)p.eval(g.doExpr[e]);b=p.getVariable("_NUM_MAX_ITE_ALG_")||1E5;if(++g.iterations>b)return console.warn("se ha excedido el l\u00edmite de "+
b+" repeticiones en la funci\u00f3n << "+g.name+" >>"),0}while(0<p.eval(g.whileExpr));var f=p.eval(g.expresion);a.rangeOK=p.eval(g.domain);e=0;for(c=g.params.length;e<c;e++)p.setVariable(g.params[e],l[e]);e=0;for(c=g.privateVars.length;e<c;e++)p.setVariable(g.privateVars[e],d[e]);return f}return 0};p.setFunction(g.name,g.functionExec);return g};$jscomp.inherits(g,a.Auxiliary);a.Function=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){var g=a.Auxiliary.call(this,e,d)||this;var p=g.evaluator;g.parseExpressions(p.parser);var b;g.algorithmExec=function(){for(var a=g.iterations=0,d=g.init.length;a<d;a++)p.eval(g.init[a]);do{a=0;for(d=g.doExpr.length;a<d;a++)p.eval(g.doExpr[a]);b=p.getVariable("_NUM_MAX_ITE_ALG_")||1E5;if(++g.iterations>b)return console.warn("se ha excedido el l\u00edmite de "+b+" repeticiones en el algoritmo << "+g.name+" >>"),0}while(0<p.eval(g.whileExpr))};
g.update();return g};$jscomp.inherits(g,a.Auxiliary);g.prototype.update=function(){this.algorithmExec();"onlyOnce"===this.evaluate&&(this.update=function(){})};a.Algorithm=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){e=a.Auxiliary.call(this,e,d)||this;d=e.evaluator;delete e.evaluate;e.condition=d.parser.parse(e.condition);e.lastEvaluation=!1;e.action=e.parent.lessonParser.parseAction(e);"onlyOnce"==e.execution&&(e.eventExec=function(){0<this.evaluator.eval(this.condition)&&!this.lastEvaluation&&(this.lastEvaluation=!0,this.action.execute())});"alternate"==e.execution&&(e.eventExec=function(){var a=0<this.evaluator.eval(this.condition);a&&!this.lastEvaluation?
(this.action.execute(),this.lastEvaluation=!0):!a&&this.lastEvaluation&&(this.lastEvaluation=!1)});"always"==e.execution&&(e.eventExec=function(){0<this.evaluator.eval(this.condition)&&this.action.execute()});return e};$jscomp.inherits(g,a.Auxiliary);g.prototype.update=function(){this.eventExec()};a.Event=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(e,d){var g=a.Auxiliary.call(this,e,d)||this;if(d=d.file){var p=document.getElementById(d);p=p&&"descartes/library"===p.type?p.text:a.openExternalFile(d)}if(p){p=a.convertHTMLEntities(p).replace(/\r/g,"").split("\n");d=0;for(var b=p.length;d<b;d++)""!==p[d].trim()&&e.lessonParser.parseAuxiliar(p[d])}return g};$jscomp.inherits(g,a.Auxiliary);a.Library=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c=function(c,b){this.parent=c;this.evaluator=c.evaluator;var f=this.evaluator.parser;this.spaceID="";this.background=!1;this.type="";this.drawif=f.parse("1");this.abs_coord=b&&b.type&&"text"===b.type.toLowerCase()?!0:!1;this.color=new a.Color("20303a");this.trace="";this.expresion=f.parse("(0,0)");this.family="";this.family_interval=f.parse("[0,1]");this.family_steps=f.parse("8");this.editable=this.visible=!1;this.font="SansSerif,PLAIN,"+
(5<=this.parent.version?"18":"12");this.fixed=!0;this.text="";this.decimals=f.parse("2");Object.assign(this,b);this.space=this.getSpace();this.canvas=this.background?this.space.backCanvas:this.space.canvas;this.ctx=this.canvas.getContext("2d");this.trace&&(this.traceCtx=this.space.backCtx);this.font_str=this.font;this.font=a.convertFont(this.font);this.fontSize=(this.fontSize=this.font.match(/([\d\.]+)px/))?parseFloat(this.fontSize[1]):10;this.font_style=a.getFontStyle(this.font_str.split(",")[1]);
if("boolean"===typeof this.bold||"boolean"===typeof this.italics)this.bold&&!this.italics?this.font_style="Bold ":!this.bold&&this.italics?this.font_style="Italic ":this.bold&&this.italics?this.font_style="Italic Bold ":this.bold||this.italics||(this.font_style=" ");this.font_family||(this.font_family=this.font_str.split(",")[0]);this.font_family=a.getFontName(this.font_family);"undefined"===typeof this.font_size&&(this.font_size=c.evaluator.parser.parse(this.fontSize.toString()))};c.prototype.getSpace=
function(){var a=this;return this.parent.spaces.find(function(c){return c.id===a.spaceID})||this.parent.spaces[0]};c.prototype.getFamilyValues=function(){g=this.evaluator;e=g.eval(this.family_interval);this.familyInf=e[0][0];this.familySup=e[0][1];this.fSteps=Math.round(g.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};c.prototype.drawFamilyAux=function(a,c,b){g=this.evaluator;this.getFamilyValues();d=g.getVariable(this.family);if(0<=this.fSteps)for(var f=
0,l=this.fSteps;f<=l;f++)g.setVariable(this.family,this.familyInf+f*this.family_sep),0<g.eval(this.drawif)&&(this.update(),a.oldTextNode=null,this.drawAux(a,c,b));g.setVariable("_Text_H_",0);g.setVariable(this.family,d)};c.prototype.draw=function(a,c){""!==this.family?this.drawFamilyAux(this.ctx,a,c):0<this.evaluator.eval(this.drawif)&&(this.update(),this.drawAux(this.ctx,a,c));this.ctx.setLineDash([])};c.prototype.drawTrace=function(a,c){""!=this.family?this.drawFamilyAux(this.traceCtx,a,c):0<this.evaluator.eval(this.drawif)&&
(this.update(),this.drawAux(this.traceCtx,a,c))};c.prototype.rotate=function(a,c,b){k=Math.cos(b);m=Math.sin(b);return{x:a*k-c*m,y:a*m+c*k}};c.prototype.dashStyle=function(){b=this.ctx;"dot"===this.lineDash?(b.lineCap="butt",b.setLineDash([b.lineWidth,b.lineWidth])):"dash"===this.lineDash?(b.lineCap="butt",b.setLineDash([4*b.lineWidth,3*b.lineWidth])):"dash_dot"===this.lineDash?(b.lineCap="butt",b.setLineDash([4*b.lineWidth,2*b.lineWidth,b.lineWidth,2*b.lineWidth])):b.setLineDash([])};c.prototype.drawText=
function(a,c,b,d,e,k,m,h,x,w,z){a.textNode=c;if("rtfNode"===c.type)a.fillStyle=a.strokeStyle=e.getColor(),a.textBaseline="alphabetic",a.textNode.pos={x:b,y:d},c.update(a,b,d,x,w,m,z,e.getColor());else for("simpleText"===c.type&&(c=c.toString(x,w).split("\\n")),g=this.evaluator,a.fillStyle=e.getColor(),a.font=k,a.textAlign=m,a.textBaseline=h,p=1.2*this.fontSize||0,e=0,k=c.length;e<k;e++)q=c[e],this.border&&(a.strokeStyle=this.border.getColor(),a.lineWidth=4,a.lineJoin="round",a.miterLimit=2,a.strokeText(q,
b,d+p*e)),a.fillText(q,b,d+p*e)};a.Graphic=c;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m=function(a,l){this.text=l=l.replace("&#x2013","\u2013").replace(/&squot;/g,"'");this.textElements=[];this.textElementsMacros=[];this.parent=a;this.evaluator=a.evaluator;this.type="simpleText";g="'";q=d=0;for(p=-1;d<l.length;)b=l.charAt(d),k=l.charAt(d-1),"["===b&&"\\"===k?(this.textElements.push(l.substring(q,d-1)+"["),this.textElementsMacros.push("'"+l.substring(q,d-1)+"['"),q=d+1):"]"===b&&"\\"===k?(this.textElements.push(l.substring(q,
d-1)+"]"),this.textElementsMacros.push("'"+l.substring(q,d-1)+"]'"),q=d+1):"["===b&&-1===p?(this.textElements.push(l.substring(q,d)),this.textElementsMacros.push("'"+l.substring(q,d)+"'"),q=d,p++):"["===b?p++:"]"===b&&0===p?(this.textElements.push(this.evaluator.parser.parse(l.substring(q,d+1))),this.textElementsMacros.push("["+l.substring(q,d+1)+"]"),q=d+1,p--):("]"==l.charAt(d)&&(p=0>p?p:p-1),g+=l.charAt(d)),d++;this.textElements.push(l.substring(q,d));this.textElementsMacros.push("'"+l.substring(q,
d)+"'")};m.prototype.toString=function(c,b){g="";for(var f=0,l=this.textElements.length;f<l;f++)"string"===typeof this.textElements[f]?g+=this.textElements[f]:(e=this.evaluator.eval(this.textElements[f])[0][0],""!==e&&("string"===typeof e?g+=e:Infinity==e?g+="Infinity":-Infinity==e?g+="-Infinity":isNaN(e)||"NaN"==e?g+="NaN":(e=parseFloat(e),e=b?e.toFixed(c):a.removeNeedlessDecimals(e.toFixed(c)),g+=e.toString().replace(".",this.parent.decimal_symbol))));return g};a.SimpleText=m;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G,D,B,L,H,M,P,I,O,C,Q,K=function(c,h){h=a.Graphic.call(this,c,h)||this;h.width=h.width||c.evaluator.parser.parse("1");h.fillP=h.fillP||"";h.fillM=h.fillM||"";h.parseExpression();h.visible=2===h.parent.version&&void 0==h.visible?!0:h.visible;h.visible&&h.registerTextField();r=new a.R2;u=new a.R2;y=new a.R2;x=new a.R2;n=new a.R2;h.cInd=0;return h};$jscomp.inherits(K,a.Graphic);K.prototype.parseExpression=function(){if("compOperator"===
this.expresion.type){var c=this.expresion.childs[0],h=this.expresion.childs[1];"identifier"!=c.type||"y"!=c.value||h.contains("y")?"identifier"!=h.type||"y"!=h.value||c.contains("y")?"identifier"!=c.type||"x"!=c.value||h.contains("x")?"identifier"!=h.type||"x"!=h.value||c.contains("x")||(this.funExpr=h,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=h,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=c,this.of_y=!1,this.drawAux=this.drawAuxFun):(this.funExpr=h,this.of_y=!1,this.drawAux=
this.drawAuxFun)}this.newt=new a.R2Newton(this.evaluator,this.expresion)};K.prototype.update=function(){};K.prototype.draw=function(){""!=this.family?this.drawFamilyAux(this.ctx,this.fill,this.color):(this.update(),this.drawAux(this.ctx,this.fill,this.color))};K.prototype.drawFamilyAux=function(a,c,h){d=this.evaluator;this.getFamilyValues();e=d.getVariable(this.family);if(0<=this.fSteps)for(var b=0,f=this.fSteps;b<=f;b++)d.setVariable(this.family,this.familyInf+b*this.family_sep),this.update(),this.drawAux(a,
c,h);d.setVariable(this.family,e)};K.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};K.prototype.drawAux=function(e,N,S){if(!(0>=this.evaluator.eval(this.drawif))){this.cInd=0;d=this.evaluator;q=d.parser;p=this.space;b=d.eval(this.width);e.strokeStyle=this.color.getColor();e.lineWidth=b;k=q.getVariable("x");m=q.getVariable("y");c=p.w+24;l=p.h+24;f=c/9;3>f&&(f=3);v=l/7;3>v&&(v=3);0==this.cInd?(g=[],this.cInd++):this.cInd=(this.cInd+1)%1E7;r.set(0,0);u.set(0,
0);y.set(0,0);C=.25;Q=8;this.abs_coord||(C/=p.scale,Q/=p.scale);e.beginPath();for(L=parseInt(v/2);L<l;L+=v)for(B=parseInt(f/2);B<c;B+=f){if(this.abs_coord){x.set(B,L);h=this.newt.findZero(x,C);if(null==h)continue;d.setVariable("x",h.x);d.setVariable("y",h.y);n.set(h.x,h.y)}else{x.set(p.getRelativeX(B),p.getRelativeY(L));h=this.newt.findZero(x,C);if(null==h)continue;d.setVariable("x",h.x);d.setVariable("y",h.y);n.set(p.getAbsoluteX(h.x),p.getAbsoluteY(h.y))}w=n.ix();z=n.iy();if(-12<=w&&w<c+24&&-12<=
z&&z<l+24){if(g[w+12+(z+12)*p.w]===this.cInd)continue;g[w+12+(z+12)*p.w]=this.cInd}a.rangeOK&&(e.moveTo(w,z),e.lineTo(w,z));r.x=h.x;r.y=h.y;u.x=h.x;u.y=h.y;A=this.newt.getUnitNormal();if(0!=A.x||0!=A.y)for(A.rotL90(),y.x=A.x,y.y=A.y,J=E=0,F=!1;2>J;)if(F&&(y.x=-A.x,y.y=-A.y,h.x=r.x,h.y=r.y,u.x=h.x,u.y=h.y,this.abs_coord?n.set(h.x,h.y):n.set(p.getAbsoluteX(h.x),p.getAbsoluteY(h.y)),w=n.ix(),z=n.iy(),F=!1,E=0),h.x+=Q*y.x,h.y+=Q*y.y,h=this.newt.findZero(h,C),null!=h){d.setVariable("x",h.x);d.setVariable("y",
h.y);y.x=h.x-u.x;y.y=h.y-u.y;y.normalize();if(0==y.x&&0==y.y)break;u.x=h.x;u.y=h.y;this.abs_coord?n.set(h.x,h.y):n.set(p.getAbsoluteX(h.x),p.getAbsoluteY(h.y));G=parseInt(n.ix());D=parseInt(n.iy());if(G!=w||D!=z)if(H=w,M=z,w=G,z=D,-12<=w&&w<c+24&&-12<=z&&z<l+24){E=0;P=g[w+12+(z+12)*p.w];g[w+12+(z+12)*p.w]=this.cInd;for(N=1;8>N;N++)I=H+Math.round((w-H)*N/8),O=M+Math.round((z-M)*N/8),0<=I&&I<c&&0<=O&&O<l&&(g[I+12+(O+12)*p.w]=this.cInd);a.rangeOK&&(e.moveTo(H,M),e.lineTo(w,z));if(P===this.cInd)break}else F=
!0,J++;else 4<++E&&(F=!0,J++)}}e.stroke()}};K.prototype.X=function(a,c,h){h||(c=this.space.w/2+this.space.Ox+this.space.scale*c);c<-a&&(c=-a);c>this.space.w+a&&(c=this.space.w+a);return c};K.prototype.Y=function(a,c,h){h||(c=this.space.h/2+this.space.Oy-this.space.scale*c);c<-a&&(c=-a);c>this.space.h+a&&(c=this.space.h+a);return c};K.prototype.XX=function(a,c,h){return Math.round(this.X(a,c,h))};K.prototype.YY=function(a,c,h){return Math.round(this.Y(a,c,h))};K.prototype.extrapolate=function(c,h,
b,f,l,d){for(var e=this.evaluator.getVariable(h),g=d/2,k=0,m,r,u,p,n,v;1E-15<Math.abs(g);){m=this.evaluator.getVariable(h);r=this.evaluator.getVariable(h)+g;this.evaluator.setVariable(h,r);u=!0;try{p=l,l=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(b,l),0<this.evaluator.eval(c)?(n=new a.R2(Math.min(p,l),Math.max(p,l)),v=0,v=0<d?this.Singularity(Math.abs(g),h,f,m,p,r,l,n):this.Singularity(Math.abs(g),h,f,r,l,m,p,n),0<v&&(u=!1)):u=!1}catch(aa){u=!1}u?k+=g:this.evaluator.setVariable(h,
m);g/=2}this.evaluator.setVariable(h,e);return new a.R2(k/Math.abs(d),l)};K.prototype.extrapolateOnSingularity=function(c,h,b,f,l,d){f=this.evaluator.getVariable(h);for(var e=d/2,g=0,k=l,m;1E-15<Math.abs(e);){this.evaluator.setVariable(h,this.evaluator.getVariable(h)+e);m=!0;if(0<this.evaluator.eval(c))try{k=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(b,k),0>=this.evaluator.eval(c)&&(m=!1)}catch(X){m=!1}else m=!1;m?g+=e:this.evaluator.setVariable(h,this.evaluator.getVariable(h)-e);
e/=2}if(0==g)for(e=d/2,g=d,k=l;1E-15<Math.abs(e);){this.evaluator.setVariable(h,this.evaluator.getVariable(h)-e);m=!0;if(0<this.evaluator.eval(c))try{k=this.evaluator.eval(this.funExpr)}catch(X){m=!1}else m=!1;m?g+=-e:this.evaluator.setVariable(h,this.evaluator.getVariable(h)+e);e/=2}this.evaluator.setVariable(h,f);return new a.R2(g/Math.abs(d),k)};K.prototype.Singularity=function(a,c,h,b,f,l,d,e){if(isNaN(d)||isNaN(f)||isNaN(e.y)||isNaN(e.x)||b>=l)return 2;var g=this.evaluator.getVariable(c),k=0;
try{if(1E-15>Math.abs(l-b)||1E-12>Math.abs(l-b)&&Math.abs(d-f)>Math.abs(a))return this.evaluator.setVariable(c,g),1;var m=(b+l)/2;this.evaluator.setVariable(c,m);var r=NaN;try{r=this.evaluator.eval(this.funExpr)}catch(Y){return 2}if(isNaN(r))return 5;if(Math.abs(d-f)>a){this.evaluator.setVariable(c,b-1E-12);var u=this.evaluator.eval(this.funExpr);u=(f-u)/1E-12;this.evaluator.setVariable(c,l+1E-12);var p=(this.evaluator.eval(this.funExpr)-d)/1E-12;if((10>Math.abs(p)||10>Math.abs(u))&&(0<=p&&0<=u||
0>=p&&0>=u)&&4*Math.abs(p)<Math.abs((d-f)/(l-b)))return this.evaluator.setVariable(c,g),2}if(isNaN(e.x)||isNaN(e.y)||isNaN(r))return 2;if(!(e.x<=r&&r<=e.y)){this.evaluator.setVariable(c,m);e.x=Math.min(f,r);e.y=Math.max(f,r);var n=this.Singularity(a/2,c,h,b,f,m,r,e);this.evaluator.setVariable(c,l);e.x=Math.min(d,r);e.y=Math.max(d,r);var v=this.Singularity(a/2,c,h,m,r,l,d,e);k=Math.max(n,v)}}catch(Y){k=1}this.evaluator.setVariable(c,g);return k};K.prototype.discontLR=function(a,c,h,b){var f=c+h,l=
f+h,d=c-h;h=d-h;this.evaluator.setVariable("x",c);c=this.evaluator.eval(a);if(isNaN(c)||!isFinite(c)||Math.abs(c)>b)return!0;this.evaluator.setVariable("x",f);f=this.evaluator.eval(a);if(isNaN(f)||!isFinite(f)||Math.abs(f)>b)return!0;this.evaluator.setVariable("x",l);l=this.evaluator.eval(a);if(isNaN(l)||!isFinite(l)||Math.abs(l)>b)return!0;this.evaluator.setVariable("x",d);d=this.evaluator.eval(a);if(isNaN(d)||!isFinite(d)||Math.abs(d)>b)return!0;this.evaluator.setVariable("x",h);a=this.evaluator.eval(a);
if(isNaN(a)||!isFinite(a)||Math.abs(a)>b)return!0;b=3*c-4*f+l;a=3*c-4*d+a;return.8<Math.abs((b*b-a*a)/(b*b+a*a+1E-4))?!0:!1};K.prototype.drawAuxFun1=function(c,h,b){k=this.evaluator.parser.getVariable("x");m=this.evaluator.parser.getVariable("y");a.rangeOK=1;if(this.evaluator.eval(this.drawif)){h="x";this.of_y&&(h="y");c.beginPath();c.lineWidth=this.evaluator.eval(this.width);c.strokeStyle=b.getColor();for(var f=-1;f<=this.space.w;f+=1){b=this.space.getRelativeX(f);this.evaluator.setVariable(h,b);
var l=this.evaluator.eval(this.funExpr);var d=this.space.getAbsoluteX(b);l=this.space.getAbsoluteY(l);this.discontLR(this.funExpr,b,.001,100)?c.moveTo(d,l):c.lineTo(d,l)}c.stroke();this.evaluator.parser.setVariable("x",k);this.evaluator.parser.setVariable("y",m)}};K.prototype.drawAuxFun=function(c,h,b){k=this.evaluator.parser.getVariable("x");m=this.evaluator.parser.getVariable("y");a.rangeOK=1;h="x";var f="y";this.of_y&&(h="y",f="x");var l=this.drawif,d=this.evaluator.eval(this.width),e=!1,g=new a.R2(this.space.w/
2+this.space.Ox,this.space.h/2+this.space.Oy),r=this.of_y?g.ix():g.iy(),u=0,p=0,n=0,v=0,q=1/this.space.scale;g=q*(this.of_y?-this.space.h+g.y:-g.x);var E=0;this.abs_coord&&(g=0,q=1);for(var z,x,y,A,w,B,G,H,D,F=this.of_y?this.space.h+2:this.space.w+2;n<=F;){z=!0;x=0;this.evaluator.setVariable(h,g);try{y=this.evaluator.eval(this.funExpr),isNaN(y)||(this.evaluator.setVariable(f,y),0<this.evaluator.eval(this.drawif)&&a.rangeOK?(e?(A=Math.min(E,y),w=Math.max(E,y),B=new a.R2(A,w),x=this.Singularity(q,h,
0,g-q,E,g,y,B),0===x?(E<=y?(E=B.x,y=B.y):(y=B.x,E=B.y),G=parseInt(this.of_y?this.XX(d,E,this.abs_coord):this.YY(d,E,this.abs_coord)),u=this.abs_coord?Math.round(y):parseInt(this.of_y?this.XX(d,y,this.abs_coord):this.YY(d,y,this.abs_coord)),this.fillM&&u>r&&(c.lineWidth=1,c.strokeStyle=this.fillM.getColor(),c.beginPath(),this.of_y?(c.moveTo(r+1,this.space.h-n+.5),c.lineTo(u,this.space.h-n+.5)):(c.moveTo(n+.5,r+1),c.lineTo(n+.5,u)),c.stroke()),this.fillP&&u<r&&(c.lineWidth=1,c.strokeStyle=this.fillP.getColor(),
c.beginPath(),this.of_y?(c.moveTo(r-1,this.space.h-n+.5),c.lineTo(u,this.space.h-n+.5)):(c.moveTo(n+.5,r-1),c.lineTo(n+.5,u)),c.stroke()),c.lineWidth=d,c.strokeStyle=b.getColor(),c.beginPath(),this.of_y?(c.moveTo(G+.5,this.space.h-v),c.lineTo(u+.5,this.space.h-n)):(c.moveTo(v+.5,G),c.lineTo(n+.5,u)),c.stroke()):1===x?(this.evaluator.setVariable(h,g-q),H=this.extrapolate(l,h,f,0,E,q),u=this.of_y?this.XX(d,H.y,this.abs_coord):this.YY(d,H.y,this.abs_coord),c.lineWidth=d,c.strokeStyle=b.getColor(),c.beginPath(),
this.of_y?(c.moveTo(p+.5,this.space.h-v),c.lineTo(u+.5,this.space.h-v+Math.round(H.x))):(c.moveTo(v+.5,p),c.lineTo(v+Math.round(H.x)+.5,u)),this.evaluator.setVariable(h,g),D=this.extrapolate(l,h,f,0,y,-q),p=this.of_y?this.XX(d,D.y,this.abs_coord):this.YY(d,D.y,this.abs_coord),u=this.of_y?this.XX(d,y,this.abs_coord):this.YY(d,y,this.abs_coord),c.lineWidth=d,c.strokeStyle=b.getColor(),c.beginPath(),this.of_y?(c.moveTo(p+.5,this.space.h-n),c.lineTo(u+.5,this.space.h-n)):(c.moveTo(n+.5,p),c.lineTo(n+
.5,u)),c.stroke()):2===x&&(u=this.of_y?this.XX(d,y,this.abs_coord):this.YY(d,y,this.abs_coord),c.lineWidth=d,c.strokeStyle=b.getColor(),c.beginPath(),this.of_y?(c.moveTo(p+.5,this.space.h-n),c.lineTo(u+.5,this.space.h-n)):(c.moveTo(n+.5,p),c.lineTo(n+.5,u)))):(D=this.extrapolateOnSingularity(l,h,f,0,y,-q),p=this.of_y?this.XX(d,D.y,this.abs_coord):this.YY(d,D.y,this.abs_coord),u=this.of_y?this.XX(d,y,this.abs_coord):this.YY(d,y,this.abs_coord),c.lineWidth=d,c.strokeStyle=b.getColor(),c.beginPath(),
this.of_y?(c.moveTo(p,this.space.h-(n+Math.round(D.x))+.5),c.lineTo(u,this.space.h-n+.5)):(c.moveTo(n+Math.round(D.x),p),c.lineTo(n,u)),c.stroke()),E=y):z=!1)}catch(ba){z=!1}e&&!z&&(this.evaluator.setVariable(h,g-q),this.evaluator.setVariable(f,E),H=this.extrapolate(l,h,f,0,E,q),u=parseInt(this.of_y?this.XX(d,H.y,this.abs_coord):this.YY(d,H.y,this.abs_coord)),0<this.evaluator.eval(this.drawif)&&a.rangeOK&&(c.lineWidth=d,c.strokeStyle=b.getColor(),c.beginPath(),this.of_y?(c.moveTo(p,this.space.h-(v+
Math.round(H.x))+.5),c.lineTo(u,this.space.h-(v+Math.round(H.x))+.5)):(c.moveTo(v+Math.round(H.x)+.5,p),c.lineTo(v+Math.round(H.x)+.5,u)),c.stroke()),this.evaluator.setVariable(h,g));e=z;g+=q;p=u;v=n++}this.evaluator.parser.setVariable("x",k);this.evaluator.parser.setVariable("y",m)};K.prototype.registerTextField=function(){var c=a.newHTML("input");c.value=this.expresionString;c.disabled=!this.editable;var h=this;oncontextmenu=function(a){return!1};c.onkeydown=function(a){13==a.keyCode&&(h.expresion=
h.evaluator.parser.parse(this.value),h.parseExpression(),h.parent.update())};this.parent.editableRegion.textFields.push(c)};a.Equation=K;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.round,e,d,q,p,b,k,m,c=function(c,b){b=a.Graphic.call(this,c,b)||this;b.parameter=b.parameter||"t";b.parameter_interval=b.parameter_interval||c.evaluator.parser.parse("[0,1]");b.parameter_steps=b.parameter_steps||c.evaluator.parser.parse("8");b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.visible=2===b.parent.version&&void 0==b.visible?!0:b.visible;b.visible&&b.registerTextField();return b};$jscomp.inherits(c,a.Graphic);c.prototype.update=
function(){e=this.evaluator;d=e.eval(this.parameter_interval);this.paraInf=d[0][0];this.paraSup=d[0][1];this.pSteps=e.eval(this.parameter_steps);this.paraSep=0<this.pSteps?Math.abs(this.paraSup-this.paraInf)/this.pSteps:0};c.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};c.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};c.prototype.drawAux=function(c,f,d){e=this.evaluator;q=this.space;c.lineWidth=Math.max(1E-6,g(e.eval(this.width)));
c.lineCap=c.lineJoin="round";c.strokeStyle=d.getColor();p=e.getVariable(this.parameter);c.beginPath();e.setVariable(this.parameter,this.paraInf);b=e.eval(this.expresion);this.exprX=g(this.abs_coord?b[0][0]:q.getAbsoluteX(b[0][0]));this.exprY=g(this.abs_coord?b[0][1]:q.getAbsoluteY(b[0][1]));this.rotateExp&&(k=a.degToRad(e.eval(this.rotateExp)),m=this.rotate(b[0][0],b[0][1],k),this.exprX=g(this.abs_coord?m.x:q.getAbsoluteX(m.x)),this.exprY=g(this.abs_coord?m.y:q.getAbsoluteY(m.y)));c.moveTo(this.exprX+
.5,this.exprY+.5);for(d=1;d<=this.pSteps;d++)e.setVariable(this.parameter,this.paraInf+d*this.paraSep),b=e.eval(this.expresion),this.rotateExp&&(m=this.rotate(b[0][0],b[0][1],k),b[0][0]=m.x,b[0][1]=m.y),this.exprX=g(this.abs_coord?b[0][0]:q.getAbsoluteX(b[0][0])),this.exprY=g(this.abs_coord?b[0][1]:q.getAbsoluteY(b[0][1])),!isNaN(this.exprX)&&!isNaN(this.exprY)&&-1E6<this.exprX&&1E6>this.exprX&&-1E6<this.exprY&&1E6>this.exprY&&c.lineTo(this.exprX+.5,this.exprY+.5);this.fill&&(c.fillStyle=f.getColor(),
c.fill("evenodd"));this.dashStyle();c.stroke();c.setLineDash([]);e.setVariable(this.parameter,p)};c.prototype.registerTextField=function(){var c=a.newHTML("input");c.value=this.expresionString;c.disabled=!this.editable;var b=this;c.oncontextmenu=function(){return!1};c.onkeydown=function(a){13==a.keyCode&&(b.expresion=b.evaluator.parser.parse(this.value),b.parent.update())};this.parent.editableRegion.textFields.push(c)};a.Curve=c;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=2*Math.PI,e=Math.round,d,q,p,b,k,m,c,l,f,v,r=function(c,b){b=a.Graphic.call(this,c,b)||this;b.size=b.size||c.evaluator.parser.parse("2");b.range=b.range||c.evaluator.parser.parse("[1, 100]");b.visible=2===b.parent.version&&void 0==b.visible?!0:b.visible;b.visible&&b.registerTextField();return b};$jscomp.inherits(r,a.Graphic);r.prototype.update=function(){d=this.evaluator;p=d.eval(this.expresion);this.exprX=p[0][0];this.exprY=p[0][1];this.rotateExp&&
(b=this.rotate(p[0][0],p[0][1],a.degToRad(d.eval(this.rotateExp))),this.exprX=b.x,this.exprY=b.y);c=d.eval(this.range);this.rangeInf=c[0][0];this.rangeMax=c[0][1]};r.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};r.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};r.prototype.drawAux=function(c,b){d=this.evaluator;q=this.space;f=l=Math.ceil(d.eval(this.size)-.4);c.fillStyle=b.getColor();c.beginPath();this.rangeInf>
this.rangeMax&&(v=this.rangeInf,this.rangeInf=this.rangeMax,this.rangeMax=v);b=d.getVariable("n");for(var r=this.rangeInf,h=this.rangeMax;r<=h;r++)d.setVariable("n",r),p=d.eval(this.expresion),this.exprX=p[0][0],this.exprY=p[0][1],k=e(this.abs_coord?this.exprX:q.getAbsoluteX(this.exprX)),m=e(this.abs_coord?this.exprY:q.getAbsoluteY(this.exprY)),c.beginPath(),c.arc(k,m,l,0,g,!0),c.fill();c.fill();this.text!=[""]&&(this.fontSize=Math.max(5,d.eval(this.font_size)),this.font=this.font_style+" "+this.fontSize+
"px "+this.font_family,a.Graphic.prototype.drawText.call(this,c,this.text,k+f,m-f,this.color,this.font,"start","alphabetic",d.eval(this.decimals),this.fixed,!0));d.setVariable("n",b)};r.prototype.registerTextField=function(){var c=a.newHTML("input");c.value=this.expresionString;c.disabled=!this.editable;var b=this;oncontextmenu=function(a){return!1};c.onkeydown=function(a){13==a.keyCode&&(b.expresion=b.evaluator.parser.parse(this.value),b.parent.update())};this.parent.editableRegion.textFields.push(c)};
a.Sequence=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=2*Math.PI,e=Math.round,d,q,p,b,k,m,c,l=function(c,b){b=a.Graphic.call(this,c,b)||this;b.size=b.size||c.evaluator.parser.parse("2");b.text=new a.TextObject(b,b.text);return b};$jscomp.inherits(l,a.Graphic);l.prototype.update=function(){d=this.evaluator;p=d.eval(this.expresion);this.exprX=p[0][0];this.exprY=p[0][1];this.rotateExp&&(b=this.rotate(p[0][0],p[0][1],a.degToRad(d.eval(this.rotateExp))),this.exprX=b.x,this.exprY=b.y)};l.prototype.draw=function(){a.Graphic.prototype.draw.call(this,
this.color,this.color)};l.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};l.prototype.drawAux=function(a,b){q=this.space;a.fillStyle=b.getColor();k=e(this.abs_coord?this.exprX:q.getAbsoluteX(this.exprX));m=e(this.abs_coord?this.exprY:q.getAbsoluteY(this.exprY));c=e(this.evaluator.eval(this.size));0<c&&(a.beginPath(),a.arc(k,m,c,0,g),a.fill());this.text.hasContent&&this.text.draw(a,b,k,m)};a.Point=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.round,e=2*Math.PI,d,q,p,b,k,m,c,l,f,v,r=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.size=b.size||c.evaluator.parser.parse("2");b.text=new a.TextObject(b,b.text);return b};$jscomp.inherits(r,a.Graphic);r.prototype.update=function(){d=this.evaluator;p=d.eval(this.expresion);this.endPoints=[];for(var c=0,f=p.length;c<f;c++)this.endPoints[c]={x:p[c][0],y:p[c][1]};if(this.rotateExp)for(b=a.degToRad(d.eval(this.rotateExp)),
c=0,f=this.endPoints.length;c<f;c++)this.endPoints[c]=this.rotate(this.endPoints[c].x,this.endPoints[c].y,b)};r.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};r.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};r.prototype.drawAux=function(a,b,r){d=this.evaluator;q=this.space;a.lineWidth=Math.max(1E-6,g(d.eval(this.width)));k=d.eval(this.size);a.fillStyle=b.getColor();a.strokeStyle=r.getColor();a.lineCap="round";m=
0==a.lineWidth%2?0:.5;this.abs_coord?(c=g(this.endPoints[0].x),l=g(this.endPoints[0].y),f=g(this.endPoints[1].x),v=g(this.endPoints[1].y)):(c=g(q.getAbsoluteX(this.endPoints[0].x)),l=g(q.getAbsoluteY(this.endPoints[0].y)),f=g(q.getAbsoluteX(this.endPoints[1].x)),v=g(q.getAbsoluteY(this.endPoints[1].y)));a.beginPath();a.moveTo(c+m,l+m);a.lineTo(f+m,v+m);this.dashStyle();a.stroke();0<k&&(a.beginPath(),a.arc(c,l,k,0,e),a.arc(f,v,k,0,e),a.fill());a.setLineDash([]);this.text.hasContent&&this.text.draw(a,
r,parseInt((c+f)/2)-3,parseInt((l+v)/2)+3)};a.Segment=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.floor,e=Math.round,d,q,p,b,k,m,c,l,f,v,r,u,y,n=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("5");b.size=b.size||c.evaluator.parser.parse("2");b.spear=b.spear||c.evaluator.parser.parse("8");b.arrow=b.arrow||new a.Color("ee0022");b.text=new a.TextObject(b,b.text);b.endPoints=[];b.vect=new a.Vector2D(0,0);return b};$jscomp.inherits(n,a.Graphic);n.prototype.update=function(){d=this.evaluator;q=d.eval(this.expresion);
for(var c=0,b=q.length;c<b;c++)this.endPoints[c]={x:q[c][0],y:q[c][1]};if(this.rotateExp)for(p=a.degToRad(d.eval(this.rotateExp)),c=0,b=this.endPoints.length;c<b;c++)this.endPoints[c]=this.rotate(this.endPoints[c].x,this.endPoints[c].y,p)};n.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.arrow,this.color)};n.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.arrow,this.trace)};n.prototype.drawAux=function(a,p,n){d=this.evaluator;b=this.space;k=Math.max(0,
d.eval(this.width));m=Math.ceil(k/2);c=b.scale;this.vect.x=this.endPoints[1].x-this.endPoints[0].x;this.vect.y=this.endPoints[1].y-this.endPoints[0].y;l=this.vect.vectorLength();this.angle=Math.atan2(this.vect.y,this.vect.x);a.fillStyle=p.getColor();a.strokeStyle=n.getColor();a.lineWidth=2;this.abs_coord?(f=e(this.endPoints[0].x),v=e(this.endPoints[0].y),r=e(this.endPoints[1].x),u=e(this.endPoints[1].y)):(f=e(b.getAbsoluteX(this.endPoints[0].x)),v=e(b.getAbsoluteY(this.endPoints[0].y)),r=e(b.getAbsoluteX(this.endPoints[1].x)),
u=e(b.getAbsoluteY(this.endPoints[1].y)));y=Math.max(0,d.eval(this.spear));a.save();a.translate(f,v);this.abs_coord?a.rotate(this.angle):(l*=c,a.rotate(-this.angle));a.beginPath();a.moveTo(-m,g(-m));a.lineTo(g(l-y-k),g(-m));a.lineTo(g(l-2*y),g(-y-m));a.lineTo(g(l),0);a.lineTo(g(l-2*y),g(y+m));a.lineTo(g(l-y-k),g(m));a.lineTo(-m,g(m));a.closePath();a.stroke();a.fill();a.restore();this.text.hasContent&&this.text.draw(a,n,parseInt((f+r)/2)-3,parseInt((v+u)/2)+3)};a.Arrow=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.round,e,d,q,p,b,k,m=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.endPoints=[];return b};$jscomp.inherits(m,a.Graphic);m.prototype.update=function(){e=this.evaluator;q=e.eval(this.expresion);for(var c=0,b=q.length;c<b;c++)this.endPoints[c]={x:q[c][0],y:q[c][1]};if(this.rotateExp)for(p=a.degToRad(e.eval(this.rotateExp)),c=0,b=this.endPoints.length;c<b;c++)this.endPoints[c]=this.rotate(this.endPoints[c].x,
this.endPoints[c].y,p)};m.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};m.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};m.prototype.drawAux=function(a,l,f){e=this.evaluator;d=this.space;a.lineWidth=Math.max(1E-6,g(e.eval(this.width)));a.strokeStyle=f.getColor();a.lineCap=a.lineJoin="round";b=g(this.abs_coord?this.endPoints[0].x:d.getAbsoluteX(this.endPoints[0].x));k=g(this.abs_coord?this.endPoints[0].y:d.getAbsoluteY(this.endPoints[0].y));
a.beginPath();a.moveTo(b+0,k+0);f=1;for(var c=this.endPoints.length;f<c;f++)b=g(this.abs_coord?this.endPoints[f].x:d.getAbsoluteX(this.endPoints[f].x)),k=g(this.abs_coord?this.endPoints[f].y:d.getAbsoluteY(this.endPoints[f].y)),a.lineTo(b+0,k+0);this.fill&&(a.fillStyle=l.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Polygon=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.round,e=Math.min,d=Math.max,q=Math.abs,p,b,k,m,c,l,f,v,r,u,y=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.border_radius=b.border_radius||c.evaluator.parser.parse("0");b.endPoints=[];return b};$jscomp.inherits(y,a.Graphic);y.prototype.update=function(){p=this.evaluator;m=p.eval(this.expresion);this.exprX=m[0][0];this.exprY=m[0][1];this.w=150;this.h=100;this.rotateExp&&(k=this.rotate(m[0][0],
m[0][1],a.degToRad(p.eval(this.rotateExp))),this.exprX=k.x,this.exprY=k.y);4<=m[0].length&&(this.w=m[0][2],this.h=m[0][3]);m[1]&&2==m[1].length&&(this.w=m[1][0],this.h=m[1][1]);this.w=d(0,this.w);this.h=d(0,this.h)};y.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};y.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace,"trace")};y.prototype.drawAux=function(a,h,k,m){p=this.evaluator;b=this.space;a.lineWidth=Math.max(1E-6,g(p.eval(this.width)));
a.strokeStyle=k.getColor();a.lineCap="round";a.lineJoin="miter";c=g(this.abs_coord?this.exprX:b.getAbsoluteX(this.exprX))+0;l=g(this.abs_coord?this.exprY:b.getAbsoluteY(this.exprY))+0;f=this.abs_coord?this.w:this.w*b.scale;v=this.abs_coord?this.h:-this.h*b.scale;r=e(d(0,p.eval(this.border_radius)),.5*q(f),.5*q(v));u=this.abs_coord?1:-1;a.beginPath();0!==r?(a.moveTo(c+r,l),a.lineTo(c+f-r,l),a.quadraticCurveTo(c+f,l,c+f,l+u*r),a.lineTo(c+f,l+v-u*r),a.quadraticCurveTo(c+f,l+v,c+f-r,l+v),a.lineTo(c+r,
l+v),a.quadraticCurveTo(c,l+v,c,l+v-u*r),a.lineTo(c,l+u*r),a.quadraticCurveTo(c,l,c+r,l),a.lineTo(c+r,l)):(a.moveTo(c,l),a.lineTo(c+f,l),a.lineTo(c+f,l+v),a.lineTo(c,l+v),a.lineTo(c,l));this.fill&&(a.fillStyle=h.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Rectangle=y;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.round,e=Math.min,d=Math.max,q=Math.acos,p=Math.sqrt,b=Math.PI,k=b/2,m=2*b,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G,D,B,L,H=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.center=b.center||c.evaluator.parser.parse("(0,0)");b.radius=b.radius||c.evaluator.parser.parse("1");b.init=b.init||"0";b.end=b.end||"90";b.init.match(/^_\(/)&&(b.initFlag=!0,b.init=b.init.substring(1));b.end.match(/^_\(/)&&
(b.endFlag=!0,b.end=b.end.substring(1));b.initExpr=c.evaluator.parser.parse(b.init);b.endExpr=c.evaluator.parser.parse(b.end);b.text=new a.TextObject(b,b.text);return b};$jscomp.inherits(H,a.Graphic);H.prototype.update=function(){c=this.evaluator;l=c.eval(this.center);this.exprX=l[0][0];this.exprY=l[0][1];f=0;this.rotateExp&&(f=a.degToRad(c.eval(this.rotateExp)),v=Math.cos(f),r=Math.sin(f),u=this.exprX*v-this.exprY*r,y=this.exprX*r+this.exprY*v,this.exprX=u,this.exprY=y);var g=c.eval(this.initExpr),
B=c.eval(this.endExpr);/^(\(|\[)expr(\)|\])$/i.test(this.initExpr.type)&&/^(\(|\[)expr(\)|\])$/i.test(this.endExpr.type)?(n=g[0][0],h=g[0][1],x=B[0][0],w=B[0][1],this.vectors?this.abs_coord&&(h=-h,w=-w):(n-=this.exprX,h=-h+this.exprY,x-=this.exprX,w=-w+this.exprY,this.abs_coord||(h=-h,w=-w)),z=0==n?0>h?3*k:k:q(1*n/p(n*n+h*h)),A=0==x?0>w?3*k:k:q(1*x/p(x*x+w*w)),z+=f,A+=f,0<n&&0<h&&this.abs_coord&&(z=m-z),0<n&&0>h&&!this.abs_coord&&(z=m-z),0>n&&0>h&&!this.abs_coord&&(z=m-z),0>n&&0<h&&this.abs_coord&&
(z=m-z),0<x&&0<w&&this.abs_coord&&(A=m-A),0<x&&0>w&&!this.abs_coord&&(A=m-A),0>x&&0>w&&!this.abs_coord&&(A=m-A),0>x&&0<w&&this.abs_coord&&(A=m-A),this.initFlag?(E=z,z=A,A=E):(E=e(z,A),J=d(z,A),z=E,A=J,A-z>b&&this.abs_coord&&(z=J,A=E),A-z<=b&&!this.abs_coord&&(z=J,A=E)),this.iniAng=z,this.endAng=A,this.drawPoints=!0):(this.iniAng=a.degToRad(g)+f,this.endAng=a.degToRad(B)+f,this.drawAngle=!0)};H.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};H.prototype.drawTrace=
function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};H.prototype.drawAux=function(a,b,h){c=this.evaluator;F=this.space;B=Math.max(0,c.eval(this.radius));a.lineWidth=Math.max(1E-6,g(c.eval(this.width)));a.lineCap="round";a.strokeStyle=h.getColor();this.abs_coord?(G=g(this.exprX),D=g(this.exprY)):(G=g(F.getAbsoluteX(this.exprX)),D=g(F.getAbsoluteY(this.exprY)),B*=F.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng);this.drawAngle&&this.iniAng>this.endAng&&(L=this.iniAng,this.iniAng=
this.endAng,this.endAng=L);this.fill&&(a.fillStyle=b.getColor(),a.beginPath(),a.moveTo(G,D),a.arc(G,D,B,this.iniAng,this.endAng,void 0),a.fill());a.beginPath();a.arc(G,D,B,this.iniAng,this.endAng,void 0);this.dashStyle();a.stroke();this.text.hasContent&&this.text.draw(a,this.color,G,D)};a.Arc=H;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("0");d.align||(d.align="left");d.anchor||(d.anchor="top_left");d.shadowColor=d.shadowColor?d.shadowColor.getColor():"transparent";d.text=new a.TextObject(d,d.text);return d};$jscomp.inherits(b,a.Graphic);b.prototype.update=function(){g=this.evaluator;e=g.eval(this.expresion);this.exprX=e[0][0];this.exprY=e[0][1];this.rotateExp&&(d=this.rotate(e[0][0],
e[0][1],a.degToRad(g.eval(this.rotateExp))),this.exprX=d.x,this.exprY=d.y)};b.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color)};b.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace)};b.prototype.drawAux=function(a,b){this.abs_coord?(q=parseInt(this.exprX),p=parseInt(this.exprY)):(q=parseInt(this.space.getAbsoluteX(this.exprX)),p=parseInt(this.space.getAbsoluteY(this.exprY)));this.text.draw(a,b,q,p)};a.Text=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.round,e,d,q,p,b,k,m,c,l,f,v,r=function(c,b){b=a.Graphic.call(this,c,b)||this;b.file=b.file||"";b.inirot=b.inirot||c.evaluator.parser.parse("0");b.img=new Image;b.scaleX=b.scaleY=1;b.ratio=c.ratio;c=b.expresion.getChildren();b.x_e=c[0];b.y_e=c[1];2<c.length&&(b.centered=!0,b.s_x_e=c[2],b.s_y_e=3<c.length?c[3]:c[2]);b.evaluator.eval(b.clip)&&(b.clip=b.clip.getChildren());b.update();return b};$jscomp.inherits(r,a.Graphic);r.prototype.update=function(){e=
this.evaluator;var c=e.eval(this.x_e),b=e.eval(this.y_e);this.exprX=c;this.exprY=b;this.rotateExp&&(d=this.rotate(c,b,a.degToRad(e.eval(this.rotateExp))),this.exprX=d.x,this.exprY=d.y);this.centered&&(this.scaleX=e.eval(this.s_x_e),this.scaleY=e.eval(this.s_y_e),0==this.scaleX&&(this.scaleX=1E-5),0==this.scaleY&&(this.scaleY=1E-5));var f=this;if((q=e.eval(this.file))||""==q)this.img=this.parent.getImage(q),this.img.addEventListener("load",function(a){f.space.update(!0)})};r.prototype.draw=function(){a.Graphic.prototype.draw.call(this)};
r.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this)};r.prototype.drawAux=function(d){e=this.evaluator;p=this.space;this.img&&this.img.ready&&this.img.complete&&(this.clip?(f=e.eval(this.clip[2]),v=e.eval(this.clip[3])):(f=this.img.width,v=this.img.height,this.img.canvas&&(f=g(f/this.ratio),v=g(v/this.ratio))),b=this.centered?0:g(f/2),k=this.centered?0:g(v/2),m=g(this.abs_coord?this.exprX:p.getAbsoluteX(this.exprX)),c=g(this.abs_coord?this.exprY:p.getAbsoluteY(this.exprY)),l=
a.degToRad(-e.eval(this.inirot)),d.save(),d.translate(m+b,c+k),d.rotate(l),this.opacity&&(d.globalAlpha=e.eval(this.opacity)),d.scale(this.scaleX,this.scaleY),this.clip?this.img.canvas?d.drawImage(this.img,e.eval(this.clip[0])*this.ratio,e.eval(this.clip[1])*this.ratio,f*this.ratio,v*this.ratio,-f/2,-v/2,f,v):d.drawImage(this.img,e.eval(this.clip[0]),e.eval(this.clip[1]),f,v,-f/2,-v/2,f,v):d.drawImage(this.img,-f/2,-v/2,f,v),d.restore())};a.Image=r;return a}(descartesJS||{});
descartesJS=function(a){function g(a,c,b){m=4*(c+b*a.width);return{r:a.data[m],g:a.data[m+1],b:a.data[m+2],a:a.data[m+3]}}if(a.loadLib)return a;var e,d,q,p,b,k,m,c,l=function(c,b){return a.Graphic.call(this,c,b)||this};$jscomp.inherits(l,a.Graphic);l.prototype.update=function(){e=this.evaluator.eval(this.expresion);this.exprX=e[0][0];this.exprY=e[0][1]};l.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};l.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,
this.trace,this.trace)};l.prototype.drawAux=function(a,l){l.getColor();imageData=a.getImageData(0,0,this.space.w,this.space.h);this.abs_coord?(d=parseInt(this.exprX),q=parseInt(this.exprY)):(d=parseInt(this.space.getAbsoluteX(this.exprX)),q=parseInt(this.space.getAbsoluteY(this.exprY)));if(!(0>d||0>q||d>=this.space.w||q>=this.space.h)){p=[[d,q]];k=g(imageData,d,q);for(c=0;0<p.length;){c++;b=p.pop();d=b[0];q=b[1];var f=g(imageData,d,q);if(k.r===f.r&&k.g===f.g&&k.b===f.b&&k.a===f.a){f=imageData;var e=
l;m=4*(d+q*f.width);f.data[m+0]=e.r;f.data[m+1]=e.g;f.data[m+2]=e.b;f.data[m+3]=255*e.a;0<d&&p.push([d-1,q]);d<imageData.width-1&&p.push([d+1,q]);p.push([d,q-1]);p.push([d,q+1])}if(c>=this.space.w*this.space.h*3)break}a.putImageData(imageData,0,0)}};a.Fill=l;return a}(descartesJS||{});
descartesJS=function(a,g){if(a.loadLib)return a;var e=new String("-text-image-point-polygon-arc-segment-arrow-macro-curve-equation-sequence-rectangle-fill-"),d=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,q,p=function(b,k){var m=a.Graphic.call(this,b,k)||this;m.hasExpresion=m.hasExpresion||!1;m.inirot=m.inirot||b.evaluator.parser.parse("0");m.inipos=m.inipos||b.evaluator.parser.parse("(0,0)");Object.assign(m,k);m.hasExpresion=void 0!==m.expresion;m.graphics=[];b=b.lessonParser;var c=new a.Tokenizer;
if(!m.hasExpresion)return m;"'"!==m.expresion.charAt(0)&&(m.expresion="'"+m.expresion+"'");m.expresion=m.evaluator.parser.parse(m.expresion);k=m.evaluator.eval(m.expresion);if(k)var l=(l=document.getElementById(k))&&"descartes/macro"==l.type?l.text:a.openExternalFile(k);if(l){var f=a.convertHTMLEntities(l).replace(/\r/g,"").split("\n");l=[];k=0;for(var p=f.length;k<p;k++)if(f[k].trim()){var r=f[k].indexOf("=");if(-1!==r){r=b.split(f[k]);for(var u=0,q=r.length;u<q;u++)if(r[u]&&1<r.length&&("id"===
g[r[u][0]]||"type"===g[r[u][0]])){l.push(r);break}}}u=function(b,h){h=c.tokenize(h.replace(/&squot;/g,"'"));for(var f=0,l=h.length;f<l;f++)if("identifier"==h[f].type&&!a.reservedIds.match("-"+h[f].value+"-")||"R"===h[f].value||"G"===h[f].value||"B"===h[f].value)h[f].value=m.name+"."+h[f].value;return(b.match(/^\\expr/)?"\\expr ":"\\decimals ")+c.flatTokens(h)};k=0;for(p=l.length;k<p;k++){var n=(q=l[k]||[],q[0])&&"id"===q[0][0];f=0;for(r=q.length;f<r;f++){var h=q[f][0].indexOf(".");-1===h||n?h=g[q[f][0]]:
(h=g[q[f][0].substring(h+1)],q[f][0]=m.name+"."+q[f][0]);if(!("font"===h||"font_family"===h||("fill"===h||"color"===h||"border"===h||"arrow"===h)&&"("!==q[f][1].charAt(0)||"file"===h&&q[f][1].match(d)||"id"!==h&&void 0!==g[q[f][1]])||"radius"===h)if("text"==h)if(q[f][1].match(/\{\\rtf1/))h=q[f][1],h=h.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,u),h=h.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,u),q[f][1]=h;else{var x=b.parseText(q[f][1]).textElementsMacros;
for(var w=0,z=x.length;w<z;w++){h=c.tokenize(x[w].replace(/&squot;/g,"'"));for(var A=0,E=h.length;A<E;A++)if("identifier"===h[A].type&&!a.reservedIds.match("-"+h[A].value+"-")||"R"===h[A].value||"G"===h[A].value||"B"===h[A].value)h[A].value=m.name+"."+h[A].value;h=c.flatTokens(h).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]");x[w]=h.substring(1,h.length-1)}q[f][1]=x.join("")}else{x=q[f][1].replace(/&squot;/g,"'").split(";");w=0;for(z=x.length;w<z;w++){h=c.tokenize(x[w].replace(/\\n/g,
";"));A=0;for(E=h.length;A<E;A++)if("identifier"===h[A].type&&!a.reservedIds.match("-"+h[A].value+"-")||"R"===h[A].value||"G"===h[A].value||"B"===h[A].value)h[A].value=m.name+"."+h[A].value;x[w]=c.flatTokens(h)}q[f][1]=x.join(";")}}}k=0;for(p=l.length;k<p;k++)if(l[k][0]){u="";q=!1;f=0;for(r=l[k].length;f<r;f++)"type"===g[l[k][f][0]]&&e.match("-"+g[l[k][f][1]]+"-")&&(q=!0),u=u+l[k][f][0]+"='"+l[k][f][1]+"' ";l[k]=u+(q?" space='"+m.spaceID+"'":"");q?m.graphics.push(b.parseGraphic(l[k],m.abs_coord,m.background,
m.inirot)):b.parseAuxiliar(l[k])}}return m};$jscomp.inherits(p,a.Graphic);p.prototype.update=function(){q=this.evaluator.eval(this.inipos);this.iniPosX=q[0][0];this.iniPosY=q[0][1]};p.prototype.drawAux=function(a){for(var b=0,d=this.graphics.length;b<d;b++)this.graphics[b]&&(a.save(),this.graphics[b].abs_coord?a.translate(this.iniPosX,this.iniPosY):a.translate(this.iniPosX*this.space.scale,-this.iniPosY*this.space.scale),this.graphics[b].draw(),a.restore())};a.Macro=p;return a}(descartesJS||{},babel);
descartesJS=function(a){if(a.loadLib)return a;var g=Math.sqrt,e=Math.sin,d=Math.cos,q=Math.abs,p,b,k,m,c,l,f,v,r,u,y,n,h,x,w,z=function(a,c,b,h){this.x=a||0;this.y=c||0;this.z=b||0;this.w=h||0;this.adjustDec()};z.prototype.adjustDec=function(){this.x=parseInt(1E9*this.x)/1E9;this.y=parseInt(1E9*this.y)/1E9;this.z=parseInt(1E9*this.z)/1E9};var A=function(a,c,b,h,f,l,d,e,g,k,m,r,p,u,n,v){this.a00=a||0;this.a01=c||0;this.a02=b||0;this.a03=h||0;this.a10=f||0;this.a11=l||0;this.a12=d||0;this.a13=e||0;
this.a20=g||0;this.a21=k||0;this.a22=m||0;this.a23=r||0;this.a30=p||0;this.a31=u||0;this.a32=n||0;this.a33=v||0};A.prototype.setIdentity=function(){this.a00=1;this.a10=this.a03=this.a02=this.a01=0;this.a11=1;this.a21=this.a20=this.a13=this.a12=0;this.a22=1;this.a32=this.a31=this.a30=this.a23=0;this.a33=1;return this};A.prototype.multiplyVector4=function(a){return new z(a.x*this.a00+a.y*this.a10+a.z*this.a20+a.w*this.a30,a.x*this.a01+a.y*this.a11+a.z*this.a21+a.w*this.a31,a.x*this.a02+a.y*this.a12+
a.z*this.a22+a.w*this.a32,a.x*this.a03+a.y*this.a13+a.z*this.a23+a.w*this.a33)};A.prototype.translate=function(a){return new A(this.a00,this.a01,this.a02,this.a03,this.a10,this.a11,this.a12,this.a13,this.a20,this.a21,this.a22,this.a23,this.a00*a.x+this.a10*a.y+this.a20*a.z+this.a30,this.a01*a.x+this.a11*a.y+this.a21*a.z+this.a31,this.a02*a.x+this.a12*a.y+this.a22*a.z+this.a32,this.a03*a.x+this.a13*a.y+this.a23*a.z+this.a33)};A.prototype.rotateX=function(a){b=e(a);k=d(a);v=this.a10;r=this.a11;u=this.a12;
y=this.a13;n=this.a20;h=this.a21;x=this.a22;w=this.a23;return new A(this.a00,this.a01,this.a02,this.a03,v*k+n*b,r*k+h*b,u*k+x*b,y*k+w*b,v*-b+n*k,r*-b+h*k,u*-b+x*k,y*-b+w*k,this.a30,this.a31,this.a32,this.a33)};A.prototype.rotateY=function(a){b=e(a);k=d(a);m=this.a00;c=this.a01;l=this.a02;f=this.a03;n=this.a20;h=this.a21;x=this.a22;w=this.a23;return new A(m*k+n*-b,c*k+h*-b,l*k+x*-b,f*k+w*-b,this.a10,this.a11,this.a12,this.a13,m*b+n*k,c*b+h*k,l*b+x*k,f*b+w*k,this.a30,this.a31,this.a32,this.a33)};A.prototype.rotateZ=
function(a){b=e(a);k=d(a);m=this.a00;c=this.a01;l=this.a02;f=this.a03;v=this.a10;r=this.a11;u=this.a12;y=this.a13;return new A(m*k+v*b,c*k+r*b,l*k+u*b,f*k+y*b,m*-b+v*k,c*-b+r*k,l*-b+u*k,f*-b+y*k,this.a20,this.a21,this.a22,this.a23,this.a30,this.a31,this.a32,this.a33)};a.norm3D=function(a){return g(a.x*a.x+a.y*a.y+a.z*a.z)};a.normalize3D=function(c){p=a.norm3D(c);if(0===p)return{x:0,y:0,z:0};if(1===p)return{x:c.x,y:c.y,z:c.z};p=1/p;return{x:c.x*p,y:c.y*p,z:c.z*p}};a.dotProduct3D=function(a,c){return a.x*
c.x+a.y*c.y+a.z*c.z};a.crossProduct3D=function(a,c){return{x:a.y*c.z-a.z*c.y,y:a.z*c.x-a.x*c.z,z:a.x*c.y-a.y*c.x}};a.scalarProduct3D=function(a,c){return{x:a.x*c,y:a.y*c,z:a.z*c}};a.subtract3D=function(a,c){return{x:a.x-c.x,y:a.y-c.y,z:a.z-c.z}};a.add3D=function(a,c){return{x:a.x+c.x,y:a.y+c.y,z:a.z+c.z}};a.equals3DEpsilon=function(a,c,b){return q(a.x-c.x)<=b&&q(a.y-c.y)<=b&&q(a.z-c.z)<=b};a.Vector4D=z;a.Matrix4x4=A;return a}(descartesJS||{});
descartesJS=function(a){function g(a){a.textNode=null;0!==parseInt(this.size)&&(a.lineWidth=1,a.fillStyle=this.backColor,a.strokeStyle=this.frontColor,a.beginPath(),a.arc(this.projVert[0].x,this.projVert[0].y,this.size,0,b),a.fill(),a.stroke())}function e(a,c){a.textNode=null;a.lineCap=k;a.lineJoin=lineJoin;a.lineWidth=.4;a.beginPath();a.moveTo(this.projVert[0].x,this.projVert[0].y);r=1;for(u=this.projVert.length;r<u;r++)a.lineTo(this.projVert[r].x,this.projVert[r].y);a.closePath();"color"===this.model?
(a.fillStyle=0>this.direction?this.backColor:this.frontColor,a.strokeStyle=a.fillStyle,a.stroke(),a.fill()):"light"===this.model||"metal"===this.model?(a.fillStyle=c.computeColor(0>this.direction?this.backColor:this.frontColor,this,"metal"===this.model),a.strokeStyle=a.fillStyle,a.stroke(),a.fill()):"wire"===this.model&&(a.lineWidth=1.25,a.strokeStyle=this.frontColor,a.stroke());this.edges&&"wire"!==this.model&&(a.lineWidth=1,a.strokeStyle=this.edges,a.stroke())}function d(a){a.textNode=null;a.oldTextNode=
"_a1b2c3_";f=this.evaluator.getVariable(this.family);this.evaluator.setVariable(this.family,this.familyValue);this.fontSize=Math.max(5,this.evaluator.eval(this.font_size));this.font=this.font_style+" "+this.fontSize+"px "+this.font_family;this.drawText(a,this.text,this.projVert[0].x,this.projVert[0].y,this.frontColor,this.font,"left","alphabetic",this.decimals,this.fixed,!0);this.evaluator.setVariable(this.family,f)}function q(a){a.textNode=null;a.lineCap=k;a.lineJoin=lineJoin;a.lineWidth=this.lineWidth;
a.strokeStyle=this.frontColor;a.beginPath();a.moveTo(this.projVert[0].x,this.projVert[0].y);a.lineTo(this.projVert[1].x,this.projVert[1].y);"dot"===this.lineDash?(a.lineCap="butt",a.setLineDash([a.lineWidth,a.lineWidth])):"dash"===this.lineDash?(a.lineCap="butt",a.setLineDash([4*a.lineWidth,3*a.lineWidth])):"dash_dot"===this.lineDash?(a.lineCap="butt",a.setLineDash([4*a.lineWidth,2*a.lineWidth,a.lineWidth,2*a.lineWidth])):a.setLineDash([]);a.stroke()}function p(c,b,h){return a.normalize3D(a.crossProduct3D(a.subtract3D(c,
b),a.subtract3D(c,h)))}if(a.loadLib)return a;var b=2*Math.PI,k=lineJoin="round",m,c,l,f,v,r,u,y,n,h,x,w,z,A=function(a,c){Object.assign(this,a);this.space=c;this.projVert=[];this.spaceVertices=[];this.newProjVert=[];this.newSpaceVert=[];"vertex"===this.type?this.draw=g:"face"===this.type?(this.normal=p(this.vertices[0],this.vertices[1],this.vertices[2]),this.draw=e):"text"===this.type?this.draw=d:"edge"===this.type&&(this.draw=q);this.isText&&(this.computeDepth=function(){this.normal={x:0,y:0,z:0};
this.projVert=this.vertices;this.depth=this.vertices[0].z;this.average=this.vertices[0]})};A.prototype.computeDepth=function(c){this.space=c;this.average={x:0,y:0,z:0};this.removeDoubles();this.normal={x:0,y:1,z:0};this.direction={x:1,y:0,z:0};r=0;for(u=this.vertices.length;r<u;r++)this.spaceVertices[r]=c.rotateVertex(this.vertices[r]),this.average.x+=this.spaceVertices[r].x,this.average.y+=this.spaceVertices[r].y,this.average.z+=this.spaceVertices[r].z;this.average=a.scalarProduct3D(this.average,
1/u);this.average_proy=c.project(this.average);this.depth=a.norm3D(a.subtract3D(c.eye,this.average));2<this.vertices.length&&(this.normal=p(this.spaceVertices[0],this.spaceVertices[1],this.spaceVertices[2]));r=0;for(u=this.vertices.length;r<u;r++)this.newSpaceVert[r]=this.spaceVertices[r],this.projVert[r]=this.newProjVert[r]=c.project(this.spaceVertices[r]);2<this.vertices.length&&(this.direction=p(this.projVert[0],this.projVert[1],this.projVert[2]).z);this.minDistanceToEye=Infinity;this.maxDistanceToEye=
-Infinity;this.minx=Infinity;this.maxx=-Infinity;this.miny=Infinity;this.maxy=-Infinity;r=0;for(u=this.vertices.length;r<u;r++)y=a.norm3D(a.subtract3D(this.spaceVertices[r],c.eye)),this.minDistanceToEye=Math.min(this.minDistanceToEye,y),this.maxDistanceToEye=Math.max(this.maxDistanceToEye,y);r=0;for(u=this.vertices.length;r<u;r++)this.minx>this.projVert[r].x&&(this.minx=this.projVert[r].x),this.maxx<this.projVert[r].x&&(this.maxx=this.projVert[r].x),this.miny>this.projVert[r].y&&(this.miny=this.projVert[r].y),
this.maxy<this.projVert[r].y&&(this.maxy=this.projVert[r].y)};A.prototype.removeDoubles=function(){if("edge"!==this.type){v=[];r=0;for(u=this.vertices.length;r<u;r++)(1E-8<Math.abs(this.vertices[r].x-this.vertices[(r+1)%u].x)||1E-8<Math.abs(this.vertices[r].y-this.vertices[(r+1)%u].y)||1E-8<Math.abs(this.vertices[r].z-this.vertices[(r+1)%u].z)||1E-8<Math.abs(this.vertices[r].w-this.vertices[(r+1)%u].w))&&v.push(this.vertices[r]);0===v.length&&v.push(this.vertices[0]);this.vertices=v}};A.prototype.drawText=
function(b,h,f,d,e,g,k,r,p,u,n){m=this.evaluator;b.textNode=h;g=m.eval(this.offset_dist);k=-a.degToRad(m.eval(this.offset_angle));f+=g*Math.cos(k);d+=g*Math.sin(k);b.textNode.pos={x:f,y:d};h.hasContent&&(h.draw(b,e,f,d,!0),l=this.fromPoint?h.textNodes.metrics.w/2:0,c=this.fromPoint?h.textNodes.metrics.h/2:0,h.draw(b,e,f-l,d-c))};A.prototype.splitFace=function(c){if(this.intersects(c)){var b=i2=null,h=ix2=0,f,l;var d=this.vertices;var e=c.vertices;var g=0;for(l=e.length;g<l;g++){var k=this.intersection(e[g],
e[(g+1)%l]);if(null!==k)if(null===b){if(b=k,h=g,2===e.length){i2=b;break}}else if(!a.equals3DEpsilon(k,b,1E-8)){i2=k;ix2=g;break}}if(null!==b&&null!==i2){g=this.isInterior(b)||this.isInterior(i2);var m=f=null;if(!g&&3<=e.length)for(l=0,d=d.length;l<d;l++)if(k=c.intersection(this.vertices[l],this.vertices[(l+1)%d]),null!==k)if(null===f)f=k;else if(!a.equals3DEpsilon(k,f,1E-8)){m=k;break}if(g||null!==f&&null!==m&&c.isInterior(f)&&c.isInterior(m)){m=!0;d=k=null;if(2===e.length)a.equals3DEpsilon(b,e[0],
1E-8)||a.equals3DEpsilon(b,e[1],1E-8)?m=!1:(k=[],k[0]=e[0],k[1]=b,d=[],d[0]=b,d[1]=e[1]);else for(k=[],d=[],g=l=f=0;g<e.length;g++)g<h?k[f++]=e[g]:g==h?(k[f++]=e[g],k[f++]=b,d[l++]=b):g<ix2?d[l++]=e[g]:g==ix2?(d[l++]=e[g],d[l++]=i2,k[f++]=i2):k[f++]=e[g];if(m){b=[];b[0]=new A({vertices:k,type:"face",frontColor:c.frontColor,backColor:c.backColor,edges:c.edges,model:c.model},this.space);b[0].removeDoubles();b[0].normal=c.normal;b[1]=new A({vertices:d,type:"face",frontColor:c.frontColor,backColor:c.backColor,
edges:c.edges,model:c.model},this.space);b[1].removeDoubles();b[1].normal=c.normal;if(2<b[0].vertices.length)return 2<b[1].vertices.length?b:[b[0]];if(2<b[1].vertices.length)return[b[1]]}}}}return[c]};A.prototype.intersects=function(a){return this.intersectsPlane(a)&&a.intersectsPlane(this)};A.prototype.intersectsPlane=function(c){var b=this.vertices;var h=c.vertices;if(0<b.length){var f=a.dotProduct3D(h[0],c.normal);var l=a.dotProduct3D(b[0],c.normal);if(1E-8>Math.abs(f-l))return!0;for(var d=1,e=
b.length;d<e;d++)if(h=a.dotProduct3D(b[d],c.normal),1E-8>Math.abs(f-h)||h>f&&l<f||h<f&&l>f)return!0}return!1};A.prototype.intersection=function(c,b){var h=this.vertices;if(0<h.length){b=a.subtract3D(b,c);var f=a.dotProduct3D(b,this.normal);if(0!==f&&(h=a.dotProduct3D(a.subtract3D(h[0],c),this.normal)/f,-1E-8<h&&1.00000001>h))return a.add3D(c,a.scalarProduct3D(b,h))}return null};A.prototype.isInterior=function(c){var b=this.vertices;if(0<b.length)for(var h=0,f=a.subtract3D(b[0],c),l=0,d=b.length;l<
d;l++){var e=a.subtract3D(b[(l+1)%d],c),g=a.dotProduct3D(a.crossProduct3D(f,e),this.normal);if(1E-8>Math.abs(g)){if(0>a.dotProduct3D(f,e))break}else{if(0>h&&0<g||0<h&&0>g)return!1;f=e;h=g}}return!0};A.prototype.inFrontOf=function(a,c,b){if(this.minDistanceToEye>=c.maxDistanceToEye||this.maxx<=c.minx||this.minx>=c.maxx||this.maxy<=c.miny||this.miny>=c.maxy)return!1;for(w=0;3>w;w++)if(n=null,n=0===w?this.intersections(c):1===w?c.verticesContainedIn(this):this.verticesContainedIn(c),null!=n&&0<n.length){for(z=
0;z<n.length;z++)a.push(n[z]);r=0;for(u=n.length;r<u;r++){h=n[r];x=this.space.rayFromEye(h.x,h.y);try{t=this.distanceToEyeAlong(x)-c.distanceToEyeAlong(x);if(t<=-b)return!0;if(t>=b)return!1}catch(G){}}}return!1};A.prototype.intersections=function(c){for(var b=[],h,f,l,d=new a.R2,e=this.newSpaceVert,g=c.newSpaceVert,k=this.newProjVert,m=c.newProjVert,r=0,p=e.length;r<p;r++){c=e[r];h=e[(r+1)%p];for(var u=0,n=g.length;u<n;u++)f=g[u],l=g[(u+1)%n],c!=f&&c!=l&&h!=f&&h!=l&&(f=d.intersection(k[r],k[(r+1)%
p],m[u],m[(u+1)%n]),null!=f&&b.push(f))}return b};A.prototype.distanceToEyeAlong=function(c){c=a.dotProduct3D(this.normal,c);if(1E-6<Math.abs(c))return a.dotProduct3D(a.subtract3D(this.average,this.space.eye),this.normal)/c;throw new Exception("Face is invisible");};A.prototype.verticesContainedIn=function(a){for(var c=[],b=this.newSpaceVert,h=this.newProjVert,f=0,l=b.length;f<l;f++)!a.isVertex(b[f])&&a.appearsToContain(h[f])&&c.push(h[f]);return c};A.prototype.appearsToContain=function(a){for(var c=
0,b,h=this.newProjVert,f=0,l=this.newSpaceVert.length;f<l;f++){b=(h[f].x-a.x)*(h[(f+1)%l].y-a.y)-(h[(f+1)%l].x-a.x)*(h[f].y-a.y);if(0!=c)if(1E-8>Math.abs(b)){if(1E-8<Math.abs(h[f].x-h[(f+1)%l].x))return Math.min(h[f].x,h[(f+1)%l].x)<=a.x+1E-8&&a.x<=Math.max(h[f].x,h[(f+1)%l].x)+1E-8;if(1E-8<Math.abs(h[f].y-h[(f+1)%l].y))return Math.min(h[f].y,h[(f+1)%l].y)<=a.y+1E-8&&a.y<=Math.max(h[f].y,h[(f+1)%l].y)+1E-8}else if(0<c&&0>b||0>c&&0<b)return!1;c=b}return!0};A.prototype.isVertex=function(c){for(var b=
this.newSpaceVert,h=0,f=b.length;h<f;h++)if(a.equals3DEpsilon(c,b[h],1E-8))return!0;return!1};a.Primitive3D=A;return a}(descartesJS||{});
descartesJS=function(a){function g(a){for(var c=[],b=0,f,l=a.length,d=a.length-1;-1<d;d--)f=a.charAt(d),0==b?"="==f&&(b=1):1==b?" "!=f&&(b="<"===f||">"===f?0:2):2==b&&" "==f&&(c.unshift(a.substring(d+1,l)),l=d,b=0);c.unshift(a.substring(0,l));return c}if(a.loadLib)return a;var e={x:0,y:0,z:0},d,q,p,b,k,m=a.degToRad,c,l=function(c,b){this.parent=c;this.evaluator=c.evaluator;var f=c.evaluator.parser;this.spaceID="E0";this.background=!1;this.type="";this.color=new a.Color("eeffaa");this.backcolor=new a.Color("6090a0");
this.Nu=this.evaluator.parser.parse("7");this.Nv=this.evaluator.parser.parse("7");this.drawif=f.parse("1");this.abs_coord=!1;this.family="";this.family_interval=f.parse("[0,1]");this.family_steps=f.parse("8");this.font="SansSerif,PLAIN,18";this.fixed=!0;this.text="";this.decimals=f.parse("2");this.inirot="(0,0,0)";this.inirotEuler=!1;this.inipos=f.parse("(0,0,0)");this.endrot="(0,0,0)";this.endrotEuler=!1;this.endpos=f.parse("(0,0,0)");this.model="color";Object.assign(this,b);void 0==this.expresion&&
"macro"!=this.type&&(this.expresion=f.parse("(0,0)"));this.space=this.getSpace();this.canvas=this.background?this.space.backCanvas:this.space.canvas;this.ctx=this.canvas.getContext("2d");this.font_str=this.font;this.font=a.convertFont(this.font);this.fontSize=(this.fontSize=this.font.match(/([\d\.]+)px/))?parseFloat(this.fontSize[1]):10;this.font_style=a.getFontStyle(this.font_str.split(",")[1]);if("boolean"===typeof this.bold||"boolean"===typeof this.italics)this.bold&&!this.italics?this.font_style=
"Bold ":!this.bold&&this.italics?this.font_style="Italic ":this.bold&&this.italics?this.font_style="Italic Bold ":this.bold||this.italics||(this.font_style=" ");this.font_family||(this.font_family=this.font_str.split(",")[0]);this.font_family=a.getFontName(this.font_family);"undefined"===typeof this.font_size&&(this.font_size=c.evaluator.parser.parse(this.fontSize.toString()));this.inirot.match("Euler")&&(this.inirot=this.inirot.replace("Euler",""),this.inirotEuler=!0);this.endrot.match("Euler")&&
(this.endrot=this.endrot.replace("Euler",""),this.endrotEuler=!0);this.inirot=f.parse(this.inirot);this.endrot=f.parse(this.endrot);this.inirotM=new a.Matrix4x4;this.inirotM_X=new a.Matrix4x4;this.inirotM_Y=new a.Matrix4x4;this.inirotM_Z=new a.Matrix4x4;this.iniposM=new a.Matrix4x4;this.endrotM=new a.Matrix4x4;this.endrotM_X=new a.Matrix4x4;this.endrotM_Y=new a.Matrix4x4;this.endrotM_Z=new a.Matrix4x4;this.endposM=new a.Matrix4x4};l.prototype.getSpace=function(){for(var a=this.parent.spaces,c,b=0,
l=a.length;b<l;b++)if(c=a[b],c.id==this.spaceID)return c;return a[0]};l.prototype.getFamilyValues=function(){d=this.evaluator;q=d.eval(this.family_interval);this.familyInf=q[0][0];this.familySup=q[0][1];this.fSteps=Math.round(d.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};l.prototype.buildFamilyPrimitives=function(){d=this.evaluator;this.getFamilyValues();p=d.getVariable(this.family);if(0<=this.fSteps)for(var a=0,c=this.fSteps;a<=c;a++)d.setVariable(this.family,
this.familyInf+a*this.family_sep),this.familyValue=this.familyInf+a*this.family_sep,d.eval(this.drawif)&&this.buildPrimitives();d.setVariable(this.family,p)};l.prototype.update=function(){this.primitives=[];this.evaluator.eval(this.drawif)&&(this.family||this.buildPrimitives());this.family&&this.buildFamilyPrimitives()};l.prototype.updateMVMatrix=function(){b=this.evaluator.eval(this.inirot);this.inirotEuler?(this.inirotM=this.inirotM.setIdentity(),this.inirotM=this.inirotM.rotateZ(m(b[0][0])),this.inirotM=
this.inirotM.rotateX(m(b[0][1])),this.inirotM=this.inirotM.rotateZ(m(b[0][2]))):(this.inirotM_X=this.inirotM_X.setIdentity().rotateX(m(b[0][0])),this.inirotM_Y=this.inirotM_Y.setIdentity().rotateY(m(b[0][1])),this.inirotM_Z=this.inirotM_Z.setIdentity().rotateZ(m(b[0][2])));b=this.evaluator.eval(this.inipos);e={x:b[0][0],y:b[0][1],z:b[0][2]};this.iniposM=this.iniposM.setIdentity().translate(e);b=this.evaluator.eval(this.endrot);this.endrotEuler?(this.endrotM=this.endrotM.setIdentity(),this.endrotM=
this.endrotM.rotateZ(m(b[0][0])),this.endrotM=this.endrotM.rotateX(m(b[0][1])),this.endrotM=this.endrotM.rotateZ(m(b[0][2]))):(this.endrotM_X=this.endrotM_X.setIdentity().rotateX(m(b[0][0])),this.endrotM_Y=this.endrotM_Y.setIdentity().rotateY(m(b[0][1])),this.endrotM_Z=this.endrotM_Z.setIdentity().rotateZ(m(b[0][2])));b=this.evaluator.eval(this.endpos);e={x:b[0][0],y:b[0][1],z:b[0][2]};this.endposM=this.endposM.setIdentity().translate(e)};l.prototype.transformVertex=function(a){this.inirotEuler?k=
this.inirotM.multiplyVector4(a):(k=this.inirotM_X.multiplyVector4(a),k=this.inirotM_Y.multiplyVector4(k),k=this.inirotM_Z.multiplyVector4(k));k=this.iniposM.multiplyVector4(k);this.endrotEuler?k=this.endrotM.multiplyVector4(k):(k=this.endrotM_X.multiplyVector4(k),k=this.endrotM_Y.multiplyVector4(k),k=this.endrotM_Z.multiplyVector4(k));k=this.endposM.multiplyVector4(k);this.macroChildren&&(k=this.applyMacroTransform(k));k.adjustDec();return k};l.prototype.applyMacroTransform=function(a){this.macro_inirotEuler?
k=this.macro_inirotM.multiplyVector4(a):(k=this.macro_inirotM_X.multiplyVector4(a),k=this.macro_inirotM_Y.multiplyVector4(k),k=this.macro_inirotM_Z.multiplyVector4(k));k=this.macro_iniposM.multiplyVector4(k);this.macro_endrotEuler?k=this.macro_endrotM.multiplyVector4(k):(k=this.macro_endrotM_X.multiplyVector4(k),k=this.macro_endrotM_Y.multiplyVector4(k),k=this.macro_endrotM_Z.multiplyVector4(k));return k=this.macro_endposM.multiplyVector4(k)};l.prototype.parseExpression=function(){for(var a=this.expresion.split(";"),
c=[],b=0,l=a.length;b<l;b++)""!==a[b].trim()&&(c=c.concat(g(a[b])));b=0;for(l=c.length;b<l;b++)c[b]=this.evaluator.parser.parse(c[b],!0);return c};l.prototype.splitFace=function(a){for(var b=0,f=this.primitives.length;b<f;b++)if(c=[],"face"===this.primitives[b].type){for(var l=0,d=a.primitives.length;l<d;l++)"face"===a.primitives[l].type?c=c.concat(this.primitives[b].splitFace(a.primitives[l])):c.push(a.primitives[l]);a.primitives=c}};a.Graphic3D=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b=function(b,d){return a.Graphic3D.call(this,b,d)||this};$jscomp.inherits(b,a.Graphic3D);b.prototype.buildPrimitives=function(){g=this.evaluator;this.updateMVMatrix();e=g.eval(this.expresion);d=e[0][0];q=e[0][1];p=e[0][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(d,q,p,1))],type:"vertex",backColor:this.backcolor.getColor(),frontColor:this.color.getColor(),size:g.eval(this.width)}));""!==this.text&&
(this.offset_dist=this.offset_dist||g.parser.parse("10"),this.offset_angle=this.offset_angle||g.parser.parse("270"),this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(d,q,p,1))],type:"text",fromPoint:!0,frontColor:this.color.getColor(),font_size:this.font_size,font_style:this.font_style,font_family:this.font_family,decimals:g.eval(this.decimals),fixed:this.fixed,evaluator:g,text:new a.TextObject(this,this.text),family:this.family,familyValue:this.familyValue,offset_dist:this.offset_dist,
offset_angle:this.offset_angle},this.space)))};a.Point3D=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");return b};$jscomp.inherits(l,a.Graphic3D);l.prototype.buildPrimitives=function(){m=this.evaluator;this.updateMVMatrix();k=m.getVariable("u");m.setVariable("u",this.Nu);c=m.eval(this.expresion);g=c[0][0];e=c[0][1];d=c[0][2];q=c[1][0];p=c[1][1];b=c[1][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(g,
e,d,1)),this.transformVertex(new a.Vector4D(q,p,b,1))],type:"edge",lineDash:this.lineDash,frontColor:this.color.getColor(),lineWidth:m.eval(this.width)},this.space));m.setVariable("u",k)};a.Segment3D=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l,f,v,r,u,y=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.parameter=b.parameter||"t";b.parameter_interval=b.parameter_interval||c.evaluator.parser.parse("[0,1]");b.parameter_steps=b.parameter_steps||c.evaluator.parser.parse("8");b.expresion=b.parseExpression();return b};$jscomp.inherits(y,a.Graphic3D);y.prototype.buildPrimitives=function(){g=this.evaluator;this.updateMVMatrix();q=g.getVariable("x");p=g.getVariable("y");b=g.getVariable("z");
e=g.getVariable("u");d=g.getVariable("v");g.setVariable("u",0);g.setVariable("v",0);k=parseInt(g.eval(this.Nu));m=parseInt(g.eval(this.Nv));c=[];for(f=0;f<=k;f++)for(g.setVariable("u",f/k),v=0;v<=m;v++){g.setVariable("v",v/m);r=0;for(u=this.expresion.length;r<u;r++)g.eval(this.expresion[r]);c.push(this.transformVertex(new a.Vector4D(g.getVariable("x"),g.getVariable("y"),g.getVariable("z"),1)))}var n=this.color.getColor(),h=this.backcolor.getColor(),x=this.edges?this.edges.getColor():"";for(f=0;f<
k;f++)for(v=0;v<m;v++)l=[],l.push(c[v+f*m+f]),l.push(c[v+1+f*m+f]),l.push(c[v+2+(f+1)*m+f]),l.push(c[v+1+(f+1)*m+f]),this.primitives.push(new a.Primitive3D({vertices:l,type:"face",frontColor:n,backColor:h,edges:x,model:this.model},this.space));g.setVariable("x",q);g.setVariable("y",p);g.setVariable("z",b);g.setVariable("u",e);g.setVariable("v",d)};a.Surface3D=y;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");return b};$jscomp.inherits(c,a.Graphic3D);c.prototype.buildPrimitives=function(){k=this.evaluator;this.updateMVMatrix();m=k.eval(this.expresion);for(var c=this.color.getColor(),f=0,v=m.length-1;f<v;f++)g=m[f][0],e=m[f][1],d=m[f][2],q=m[f+1][0],p=m[f+1][1],b=m[f+1][2],this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(g,
e,d,1)),this.transformVertex(new a.Vector4D(q,p,b,1))],type:"edge",frontColor:c,lineWidth:k.eval(this.width)},this.space))};a.Polygon3D=c;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.expresion=b.parseExpression();return b};$jscomp.inherits(m,a.Graphic3D);m.prototype.buildPrimitives=function(){k=this.evaluator;this.updateMVMatrix();q=k.getVariable("x");p=k.getVariable("y");b=k.getVariable("z");d=k.getVariable("u");k.setVariable("u",0);e=k.eval(this.Nu);g=[];for(var c=0;c<=e;c++){k.setVariable("u",c/e);for(var l=0,f=
this.expresion.length;l<f;l++)k.eval(this.expresion[l]);g.push(this.transformVertex(new a.Vector4D(k.getVariable("x"),k.getVariable("y"),k.getVariable("z"),1)))}c=0;for(l=g.length-1;c<l;c++)this.primitives.push(new a.Primitive3D({vertices:[g[c],g[c+1]],type:"edge",frontColor:this.color.getColor(),lineWidth:k.eval(this.width)},this.space));this.fill&&2<g.length&&this.primitives.push(new a.Primitive3D({vertices:g,type:"face",frontColor:this.fill.getColor(),backColor:this.fill.getColor(),edges:"",model:this.model},
this.space));k.setVariable("x",q);k.setVariable("y",b);k.setVariable("z",p);k.setVariable("u",d)};a.Curve3D=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l,f,v=function(c,b){return a.Graphic3D.call(this,c,b)||this};$jscomp.inherits(v,a.Graphic3D);v.prototype.buildPrimitives=function(){l=this.evaluator;this.updateMVMatrix();f=l.eval(this.expresion);g=f[0][0];e=f[0][1];d=f[0][2];q=f[1][0];p=f[1][1];b=f[1][2];k=f[2][0];m=f[2][1];c=f[2][2];var r=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(g,e,d,1)),this.transformVertex(new a.Vector4D(k,
m,c,1)),this.transformVertex(new a.Vector4D(q,p,b,1))],type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),edges:r,model:this.model},this.space))};a.Triangle3D=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q=function(d,b){return a.Graphic3D.call(this,d,b)||this};$jscomp.inherits(q,a.Graphic3D);q.prototype.buildPrimitives=function(){e=this.evaluator;this.updateMVMatrix();d=e.eval(this.expresion);g=[];for(var p=d.length-1;0<=p;p--)g.push(this.transformVertex(new a.Vector4D(d[p][0],d[p][1],d[p][2],1)));p=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:g,type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),
edges:p,model:this.model},this.space))};a.Face3D=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k=function(b,c){c=a.Graphic3D.call(this,b,c)||this;c.width=c.width||b.evaluator.parser.parse("2");c.length=c.length||b.evaluator.parser.parse("2");return c};$jscomp.inherits(k,a.Graphic3D);k.prototype.buildPrimitives=function(){b=this.evaluator;this.updateMVMatrix();g=b.eval(this.Nu);e=[this.transformVertex(new a.Vector4D(0,0,0,1))];d=b.eval(this.width)/2;q=b.eval(this.length)/2;p=2*Math.PI/g;for(var k=0;k<g;k++)e.push(this.transformVertex(new a.Vector4D(d*
Math.cos(p*k),q*Math.sin(p*k),0,1)));var c=this.color.getColor(),l=this.backcolor.getColor(),f=this.edges?this.edges.getColor():"";for(k=0;k<g;k++)this.primitives.push(new a.Primitive3D({vertices:[e[0],k+2<=g?e[k+2]:e[1],e[k+1]],type:"face",frontColor:c,backColor:l,edges:f,model:this.model},this.space))};a.Polireg3D=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p=function(b,d){b=a.Graphic3D.call(this,b,d)||this;b.shadowColor=b.shadowColor?b.shadowColor.getColor():"transparent";return b};$jscomp.inherits(p,a.Graphic3D);p.prototype.buildPrimitives=function(){g=this.evaluator;e=g.eval(this.expresion);d=e[0][0];q=e[0][1];this.primitives.push(new a.Primitive3D({vertices:[new a.Vector4D(d,q,0,1)],type:"text",frontColor:this.color.getColor(),font_size:this.font_size,font_style:this.font_style,font_family:this.font_family,
decimals:g.eval(this.decimals),fixed:this.fixed,displace:0,isText:!0,evaluator:g,text:new a.TextObject(this,this.text),family:this.family,familyValue:this.familyValue},this.space))};a.Text3D=p;return a}(descartesJS||{});
descartesJS=function(a,g){if(a.loadLib)return a;var e=new String("-point-segment-polygon-curve-triangle-face-polireg-surface-text-cube-box-tetrahedron-octahedron-sphere-dodecahedron-icosahedron-ellipsoid-cone-cylinder-torus-mesh-macro-"),d=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,q,p,b=0,k=function(k,c){var l=a.Graphic.call(this,k,c)||this;l.expresion=l.expresion||void 0;l.inirot=l.inirot||"(0,0,0)";l.inirotEuler=l.inirotEuler||!1;l.inipos=l.inipos||k.evaluator.parser.parse("(0,0,0)");l.endrot=
l.endrot||"(0,0,0)";l.endrotEuler=l.endrotEuler||!1;l.endpos=l.endpos||k.evaluator.parser.parse("(0,0,0)");l.name=l.name||"_descartes_empty_name_"+b++;Object.assign(l,c);l.inirot.match("Euler")&&(l.inirot=l.inirot.replace("Euler",""),l.inirotEuler=!0);l.endrot.match("Euler")&&(l.endrot=l.endrot.replace("Euler",""),l.endrotEuler=!0);l.inirot=l.evaluator.parser.parse(l.inirot);l.endrot=l.evaluator.parser.parse(l.endrot);l.inirotM=new a.Matrix4x4;l.inirotM_X=new a.Matrix4x4;l.inirotM_Y=new a.Matrix4x4;
l.inirotM_Z=new a.Matrix4x4;l.iniposM=new a.Matrix4x4;l.endrotM=new a.Matrix4x4;l.endrotM_X=new a.Matrix4x4;l.endrotM_Y=new a.Matrix4x4;l.endrotM_Z=new a.Matrix4x4;l.endposM=new a.Matrix4x4;l.graphics=[];k=k.lessonParser;var f=new a.Tokenizer;if(void 0==l.expresion)return l;"'"!==l.expresion.charAt(0)&&(l.expresion="'"+l.expresion+"'");l.expresion=l.evaluator.parser.parse(l.expresion);c=l.evaluator.eval(l.expresion);if(c)var m=(m=document.getElementById(c))&&"descartes/macro"==m.type?m.text:a.openExternalFile(c);
if(m){var r=a.convertHTMLEntities(m).replace(/\r/g,"").split("\n");m=[];c=0;for(var p=r.length;c<p;c++){var q=r[c].indexOf("=");if(-1!==q){q=k.split(r[c]);for(var n=0,h=q.length;n<h;n++)if(q[n]&&1<q.length&&("id"===g[q[n][0]]||"type"===g[q[n][0]])){m.push(q);break}}}c=0;for(p=m.length;c<p;c++){h=(n=m[c]||[],n[0])&&"id"===n[0][0];var x=!1;r=0;for(q=n.length;r<q;r++){var w=n[r][0].indexOf(".");-1===w||h?w=g[n[r][0]]:(w=g[n[r][0].substring(w+1)],n[r][0]=l.name+"."+n[r][0]);"type"===w&&"surface"===g[n[r][1]]&&
(x=!0);if(!("font"===w||"font_family"===w||("fill"===w||"color"===w||"backcolor"===w||"arrow"===w)&&"("!==n[r][1].charAt(0)||"file"===w&&n[r][1].match(d)||"id"!==w&&void 0!==g[n[r][1]])||"width"===w||"height"===w||"length"===w)if(x&&"expresion"===w){var z=n[r][1].split(" ");for(var A="",E=0,J=z.length;E<J;E++){for(var F=z[E].replace(/&squot;/g,"'").split(";"),G=0,D=F.length;G<D;G++){w=f.tokenize(F[G].replace(/\\n/g,";"));for(var B=0,L=w.length;B<L;B++)if("identifier"===w[B].type&&!(a.reservedIds+
"-x-y-z-u-v-").match("-"+w[B].value+"-")||"R"===w[B].value||"G"===w[B].value||"B"===w[B].value)w[B].value=l.name+"."+w[B].value;F[G]=f.flatTokens(w)}A+=F.join(";")+" "}n[r][1]=A}else if("text"==w)if(n[r][1].match(/\{\\rtf1/)){w=n[r][1];var H=l;z=function(c,b){b=f.tokenize(b.replace(/&squot;/g,"'"));for(var h=0,l=b.length;h<l;h++)if("identifier"==b[h].type&&!a.reservedIds.match("-"+b[h].value+"-")||"R"===b[h].value||"G"===b[h].value||"B"===b[h].value)b[h].value=H.name+"."+b[h].value;return(c.match(/^\\expr/)?
"\\expr ":"\\decimals ")+f.flatTokens(b)};w=w.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,z);w=w.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,z);n[r][1]=w}else{z=k.parseText(n[r][1]).textElementsMacros;A=0;for(E=z.length;A<E;A++){w=f.tokenize(z[A].replace(/&squot;/g,"'"));J=0;for(F=w.length;J<F;J++)if("identifier"===w[J].type&&!a.reservedIds.match("-"+w[J].value+"-")||"R"===w[J].value||"G"===w[J].value||"B"===w[J].value)w[J].value=l.name+"."+w[J].value;
w=f.flatTokens(w).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]");z[A]=w.substring(1,w.length-1)}n[r][1]=z.join("")}else{F=n[r][1].replace(/&squot;/g,"'").split(";");G=0;for(D=F.length;G<D;G++){w=f.tokenize(F[G].replace(/\\n/g,";"));B=0;for(L=w.length;B<L;B++)if("identifier"===w[B].type&&!a.reservedIds.match("-"+w[B].value+"-")||"R"===w[B].value||"G"===w[B].value||"B"===w[B].value)w[B].value=l.name+"."+w[B].value;F[G]=f.flatTokens(w)}n[r][1]=F.join(";")}}}c=0;for(p=m.length;c<
p;c++)if(m[c][0]){n="";h=!1;r=0;for(q=m[c].length;r<q;r++)"type"===g[m[c][r][0]]&&e.match("-"+g[m[c][r][1]]+"-")&&(h=!0),n=n+m[c][r][0]+"='"+m[c][r][1]+"' ";m[c]=n+(h?" space='"+l.spaceID+"'":"");h?l.graphics.push(k.parse3DGraphic(m[c],l.abs_coord,l.background,l.inirot)):k.parseAuxiliar(m[c])}}c=0;for(p=l.graphics.length;c<p;c++)l.graphics[c].macroChildren=!0;return l};$jscomp.inherits(k,a.Graphic);k.prototype.buildFamilyPrimitives=function(){evaluator=this.evaluator;this.getFamilyValues();var a=
evaluator.getVariable(this.family);if(0<=this.fSteps)for(var c=0,b=this.fSteps;c<=b;c++)evaluator.setVariable(this.family,this.familyInf+c*this.family_sep),this.familyValue=this.familyInf+c*this.family_sep,evaluator.eval(this.drawif)&&this.updateMacro();evaluator.setVariable(this.family,a)};k.prototype.update=function(){this.primitives=[];this.evaluator.eval(this.drawif)&&(this.family||this.updateMacro());this.family&&this.buildFamilyPrimitives()};k.prototype.updateMacro=function(){this.updateTransformation();
if(this.inipos){var a=this.evaluator.eval(this.inipos);this.iniPosX=a[0][0];this.iniPosY=a[0][1]}a=0;for(var c=this.graphics.length;a<c;a++)q=this.graphics[a],q.macro_inirotEuler=this.inirotEuler,q.macro_inirotM=this.inirotM,q.macro_inirotM_X=this.inirotM_X,q.macro_inirotM_Y=this.inirotM_Y,q.macro_inirotM_Z=this.inirotM_Z,q.macro_iniposM=this.iniposM,q.macro_endrotEuler=this.endrotEuler,q.macro_endrotM=this.endrotM,q.macro_endrotM_X=this.endrotM_X,q.macro_endrotM_Y=this.endrotM_Y,q.macro_endrotM_Z=
this.endrotM_Z,q.macro_endposM=this.endposM,q.update();a=0;for(c=this.graphics.length;a<c;a++){q=this.graphics[a];if(q.split||this.split)for(var b=a+1;b<c;b++)p=this.graphics[b],(p.split||this.split)&&q.splitFace(p);this.primitives=this.primitives.concat(q.primitives||[])}};k.prototype.updateTransformation=function(){tmpExpr=this.evaluator.eval(this.inirot);this.inirotEuler?(this.inirotM=this.inirotM.setIdentity(),this.inirotM=this.inirotM.rotateZ(a.degToRad(tmpExpr[0][0])),this.inirotM=this.inirotM.rotateX(a.degToRad(tmpExpr[0][1])),
this.inirotM=this.inirotM.rotateZ(a.degToRad(tmpExpr[0][2]))):(this.inirotM_X=this.inirotM_X.setIdentity().rotateX(a.degToRad(tmpExpr[0][0])),this.inirotM_Y=this.inirotM_Y.setIdentity().rotateY(a.degToRad(tmpExpr[0][1])),this.inirotM_Z=this.inirotM_Z.setIdentity().rotateZ(a.degToRad(tmpExpr[0][2])));tmpExpr=this.evaluator.eval(this.inipos);translate={x:tmpExpr[0][0],y:tmpExpr[0][1],z:tmpExpr[0][2]};this.iniposM=this.iniposM.setIdentity().translate(translate);tmpExpr=this.evaluator.eval(this.endrot);
this.endrotEuler?(this.endrotM=this.endrotM.setIdentity(),this.endrotM=this.endrotM.rotateZ(a.degToRad(tmpExpr[0][0])),this.endrotM=this.endrotM.rotateX(a.degToRad(tmpExpr[0][1])),this.endrotM=this.endrotM.rotateZ(a.degToRad(tmpExpr[0][2]))):(this.endrotM_X=this.endrotM_X.setIdentity().rotateX(a.degToRad(tmpExpr[0][0])),this.endrotM_Y=this.endrotM_Y.setIdentity().rotateY(a.degToRad(tmpExpr[0][1])),this.endrotM_Z=this.endrotM_Z.setIdentity().rotateZ(a.degToRad(tmpExpr[0][2])));tmpExpr=this.evaluator.eval(this.endpos);
translate={x:tmpExpr[0][0],y:tmpExpr[0][1],z:tmpExpr[0][2]};this.endposM=this.endposM.setIdentity().translate(translate)};k.prototype.drawAux=function(a){};a.Macro3D=k;return a}(descartesJS||{},babel);
descartesJS=function(a){function g(a,c,b,h,f){e.call(this,a/n,a/n,a/n,h,f)}function e(a,c,b,f,l){a/=2;c/=2;b/=2;this.changeGeometry(a,c,b,f,l)||(this.vertices=[new h(a,b,c,1),new h(a,-b,c,1),new h(a,b,-c,1),new h(a,-b,-c,1),new h(-a,b,c,1),new h(-a,-b,c,1),new h(-a,b,-c,1),new h(-a,-b,-c,1)],this.faces=[[2,3,1,0],[1,5,4,0],[5,7,6,4],[6,7,3,2],[4,6,2,0],[3,7,5,1]],this.updateValues(a,c,b,f,l))}function d(a,c,b,f,l){a/=2;if(!this.changeGeometry(a,c,b,f,l)){var d=2*Math.PI/3,e=2*a*Math.sqrt(2)/3,g=-a/
3,k=e*Math.cos(d)+0*Math.sin(d);d=-e*Math.sin(d)+0*Math.cos(d);this.vertices=[new h(0,0,a,1),new h(k,d,g,1),new h(k,-d,g,1),new h(e,0,g,1)];this.faces=[[1,3,2],[0,1,2],[0,2,3],[0,3,1]];this.updateValues(a,c,b,f,l)}}function q(a,c,b,f,l){a/=2;this.changeGeometry(a,c,b,f,l)||(this.vertices=[new h(0,0,a,1),new h(a,0,0,1),new h(-a,0,0,1),new h(0,a,0,1),new h(0,-a,0,1),new h(0,0,-a,1)],this.faces=[[3,1,0],[2,3,0],[1,4,0],[4,2,0],[1,3,5],[3,2,5],[4,1,5],[2,4,5]],this.updateValues(a,c,b,f,l))}function p(c,
b,f,l,d){c/=Math.PI;if(!this.changeGeometry(c,b,f,l,d)){B=c/1.6180339887;L=1.6180339887*c;this.vertices=[new h(c,c,c,1),new h(c,c,-c,1),new h(c,-c,c,1),new h(c,-c,-c,1),new h(-c,c,c,1),new h(-c,c,-c,1),new h(-c,-c,c,1),new h(-c,-c,-c,1),new h(0,B,L,1),new h(0,B,-L,1),new h(0,-B,L,1),new h(0,-B,-L,1),new h(B,L,0,1),new h(B,-L,0,1),new h(-B,L,0,1),new h(-B,-L,0,1),new h(L,0,B,1),new h(L,0,-B,1),new h(-L,0,B,1),new h(-L,0,-B,1)];H=(new a.Matrix4x4).setIdentity().rotateY(-u/6);I=0;for(O=this.vertices.length;I<
O;I++)this.vertices[I]=H.multiplyVector4(this.vertices[I]);this.faces=[[0,16,2,10,8],[12,1,17,16,0],[8,4,14,12,0],[2,16,17,3,13],[13,15,6,10,2],[6,18,4,8,10],[3,17,1,9,11],[13,3,11,7,15],[1,12,14,5,9],[11,9,5,19,7],[5,14,4,18,19],[6,15,7,19,18]];this.updateValues(c,b,f,l,d)}}function b(c,b,f,l,d){c/=3.8;if(!this.changeGeometry(c,b,f,l,d)){L=1.6180339887*c;this.vertices=[new h(0,c,L,1),new h(0,c,-L,1),new h(0,-c,L,1),new h(0,-c,-L,1),new h(c,L,0,1),new h(c,-L,0,1),new h(-c,L,0,1),new h(-c,-L,0,1),
new h(L,0,c,1),new h(L,0,-c,1),new h(-L,0,c,1),new h(-L,0,-c,1)];this.faces=[[10,0,2],[0,8,2],[8,5,2],[5,7,2],[7,10,2],[6,0,10],[11,6,10],[7,11,10],[7,3,11],[5,3,7],[9,3,5],[8,9,5],[4,9,8],[0,4,8],[6,4,0],[11,3,1],[6,11,1],[4,6,1],[9,4,1],[3,9,1]];H=(new a.Matrix4x4).setIdentity().rotateY(-1.0285);I=0;for(O=this.vertices.length;I<O;I++)this.vertices[I]=H.multiplyVector4(this.vertices[I]);this.updateValues(c,b,f,l,d)}}function k(a,c,b,f,l){a/=2;this.isSphere?b=c=a:(c/=2,b/=2);if(!this.changeGeometry(a,
c,b,f,l)){this.vertices=[new h(0,0,c,1)];for(I=1;I<f;I++)for(F=I*u/f,C=0;C<l;C++)J=C*y/l,z=a*v(F)*r(J),A=b*v(F)*v(J),E=c*r(F),this.vertices.push(new h(z,A,E,1));this.vertices.push(new h(0,0,-c,1));this.faces=[];for(I=0;I<l;I++)this.faces.push([0,(I+1)%l+1,I%l+1]);for(I=1;I<f-1;I++)for(C=0;C<l;C++)this.faces.push([C+1+(I-1)*l,(C+1)%l+1+(I-1)*l,(C+1)%l+1+I*l,C+1+I*l]);for(I=0;I<l;I++)this.faces.push([this.vertices.length-1,this.vertices.length-1-l+I,this.vertices.length-1-l+(I+1)%l]);this.updateValues(a,
c,b,f,l)}}function m(a,c,b,f,l){a/=2;c/=2;b/=2;if(!this.changeGeometry(a,c,b,f,l)){this.vertices=[];for(I=0;I<l;I++)for(C=0;C<f;C++)z=a*(l-I)/l*r(C*y/f),A=b*(l-I)/l*v(C*y/f),E=c-2*I*c/l,this.vertices.push(new h(z,A,E,1));this.vertices.push(new h(0,0,-c,1));this.faces=[];for(I=0;I<l-1;I++)for(C=0;C<f;C++)this.faces.push([C+I*f,(C+1)%f+I*f,(C+1)%f+(I+1)*f,C+(I+1)*f]);for(I=0;I<f;I++)this.faces.push([this.vertices.length-1,this.vertices.length-1-f+I,this.vertices.length-1-f+(I+1)%f]);this.updateValues(a,
c,b,f,l)}}function c(a,c,b,f,l){a/=2;c/=2;b/=2;if(!this.changeGeometry(a,c,b,f,l)){this.vertices=[];for(I=0;I<l+1;I++)for(C=0;C<f;C++)z=a*r(C*y/f),A=b*v(C*y/f),E=c-2*I*c/l,this.vertices.push(new h(z,A,E,1));this.faces=[];for(I=0;I<l;I++)for(C=0;C<f;C++)this.faces.push([C+I*f,(C+1)%f+I*f,(C+1)%f+(I+1)*f,C+(I+1)*f]);this.updateValues(a,c,b,f,l)}}function l(a,c,b,f,l){a/=2;c/=2;b/=2;G=x.eval(this.R);D=x.eval(this.r);if(!this.changeGeometry(a,c,b,f,l)){this.vertices=[];for(I=0;I<l+1;I++)for(C=0;C<f;C++)z=
-(G+D*v(y*C/f))*v(y*I/l),A=(G+D*v(y*C/f))*r(y*I/l),E=D*r(y*C/f),this.vertices.push(new h(z,A,E,1));this.faces=[];for(I=0;I<l;I++)for(C=0;C<f;C++)this.faces.push([C+I*f,C+(I+1)*f,(C+1)%f+(I+1)*f,(C+1)%f+I*f]);this.updateValues(a,c,b,f,l)}}function f(){this.vertices=[];this.faces=[];I=0;for(O=this.fileData.length;I<O;I++)M=this.fileData[I],M.match(/^V\(/)?(P=M.substring(2,M.length-1).split(",").map(parseFloats),this.vertices.push(new h(P[0]||0,P[1]||0,P[2]||0,1))):M.match(/^F\(/)&&(P=M.substring(2,
M.length-1).split(",").map(parseInt),this.faces.push(P.reverse()))}if(a.loadLib)return a;var v=Math.sin,r=Math.cos,u=Math.PI,y=2*u,n=Math.sqrt(3),h,x,w,z,A,E,J,F,G,D,B,L,H,M,P,I,O,C,Q,K=function(r,n){n=a.Graphic3D.call(this,r,n)||this;n.width=n.width||r.evaluator.parser.parse("2");n.height=n.height||r.evaluator.parser.parse("2");n.length=n.length||r.evaluator.parser.parse("2");n.R=n.R||r.evaluator.parser.parse("2");n.r=n.r||r.evaluator.parser.parse("1");h=a.Vector4D;switch(n.subType){case "cube":n.buildGeometry=
g;break;case "box":n.buildGeometry=e;break;case "tetrahedron":n.buildGeometry=d;break;case "octahedron":n.buildGeometry=q;break;case "sphere":n.isSphere=!0;case "ellipsoid":n.buildGeometry=k;break;case "dodecahedron":n.buildGeometry=p;break;case "icosahedron":n.buildGeometry=b;break;case "cone":n.buildGeometry=m;break;case "cylinder":n.buildGeometry=c;break;case "torus":n.buildGeometry=l;break;case "mesh":n.fileData=a.openExternalFile(n.evaluator.eval(n.file)).split(/\r/),n.buildGeometry=f}return n};
$jscomp.inherits(K,a.Graphic3D);K.prototype.buildPrimitives=function(){x=this.evaluator;this.updateMVMatrix();this.buildGeometry(x.eval(this.width),x.eval(this.height),x.eval(this.length),x.eval(this.Nu),x.eval(this.Nv));var c=this.color.getColor(),b=this.backcolor.getColor(),h=this.edges?this.edges.getColor():"";I=0;for(O=this.faces.length;I<O;I++){w=[];C=0;for(Q=this.faces[I].length;C<Q;C++)w.push(this.transformVertex(this.vertices[this.faces[I][C]]));this.primitives.push(new a.Primitive3D({vertices:w,
type:"face",frontColor:c,backColor:b,edges:h,model:this.model},this.space))}};K.prototype.changeGeometry=function(a,c,b,h,f){return this.oldWidth===a&&this.oldHeight===c&&this.oldLength===b&&this.oldNu===h&&this.oldNv===f};K.prototype.updateValues=function(a,c,b,h,f){this.oldWidth=a;this.oldHeight=c;this.oldLength=b;this.oldNv=f;this.oldNu=h};a.OtherGeometry3D=K;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.max,e=Math.min,d=Math.PI,q=Math.cos,p=Math.sin,b=Math.abs,k=Math.round,m,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G,D=function(a,c){this.x=void 0===a?0:a;this.y=void 0===c?0:c};D.prototype.set=function(a,c){this.x=void 0===a?0:a;this.y=void 0===c?0:c;return this};D.prototype.copy=function(){return new D(this.x,this.y)};D.prototype.ix=function(){return k(g(e(this.x,32E3),-32E3))};D.prototype.iy=function(){return k(g(e(this.y,32E3),-32E3))};D.prototype.equals=
function(a){return this.x===a.x&&this.y===a.y};D.prototype.norm2=function(){return this.x*this.x+this.y*this.y};D.prototype.norm=function(){return Math.sqrt(this.norm2())};D.prototype.distance=function(a){c=this.copy();c.sub(a);return c.norm()};D.prototype.dot=function(a){return this.x*a.x+this.y*a.y};D.prototype.det=function(a){return this.x*a.y-this.y*a.x};D.prototype.mul=function(a){this.x*=a;this.y*=a};D.prototype.div=function(a){this.x/=a;this.y/=a};D.prototype.add=function(a){this.x+=a.x;this.y+=
a.y};D.prototype.sub=function(a){this.x-=a.x;this.y-=a.y};D.prototype.normalize=function(){m=this.norm();0!=m&&this.div(m)};D.prototype.rotR90=function(){m=this.x;this.x=this.y;this.y=-m};D.prototype.rotL90=function(){m=this.x;this.x=-this.y;this.y=m};D.prototype.rot=function(a){l=this.copy();r=q(a);u=p(a);this.x=l.x*r-l.y*u;this.y=l.x*u+l.y*r};D.prototype.rot2=function(a){this.rot(a*d/180)};D.prototype.intersection=function(a,c,l,d){y=c.x-a.x;n=l.x-d.x;h=l.x-a.x;x=c.y-a.y;w=l.y-d.y;z=l.y-a.y;G=y*
w-n*x;return 1E-6<b(G)?(f=(h*w-z*n)/G,v=(-h*x+z*y)/G,0<=f&&1>=f&&0<=v&&1>=v?new D(a.x+y*f,a.y+x*f):null):(c.x-l.x)*z!=(c.y-l.y)*h?null:a.x!=c.x?(A=e(a.x,c.x),E=g(a.x,c.x),A<=l.x&&l.x<=E?l:A<=d.x&&d.x<=E?d:null):l.x!=d.x?(J=e(l.x,d.x),F=g(l.x,d.x),J<=a.x&&a.x<=F?a:J<=c.x&&c.x<=F?c:null):a.y!=c.y?(A=e(a.y,c.y),E=g(a.y,c.y),A<=l.y&&l.y<=E?l:A<=d.y&&d.y<=E?d:null):l.y!=d.y?(J=e(l.y,d.y),F=g(l.y,d.y),J<=a.y&&a.y<=F?a:J<=c.y&&c.y<=F?c:null):a.x==l.x&&a.y==l.y?a:null};a.R2=D;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l=function(f,l){this.evaluator=f;this.constraint=l;if("=="==this.constraint.value||"<"==this.constraint.value||"<="==this.constraint.value||">"==this.constraint.value||">="==this.constraint.value)this.sign="<"==this.constraint.value||"<="==this.constraint.value?"menor":">"==this.constraint.value||">="==this.constraint.value?"mayor":"igual",this.constraint=this.constraint.equalToMinus(),this.constraint=this.constraint.childs[0];b=
new a.R2(0,0);p=new a.R2(0,0);c=new a.R2(0,0)};l.prototype.getUnitNormal=function(){this.normal.normalize();return c.set(this.normal.x,this.normal.y)};l.prototype.gradient=function(a){g=this.evaluator;b.x=0;b.y=0;k=g.getVariable("x");m=g.getVariable("y");g.setVariable("x",a.x);g.setVariable("y",a.y);this.f0=g.eval(this.constraint);g.setVariable("x",g.getVariable("x")+1E-6);e=g.eval(this.constraint);b.x=(e-this.f0)/1E-6;b.x=isNaN(b.x)?Infinity:b.x;g.setVariable("x",g.getVariable("x")-1E-6);g.setVariable("y",
g.getVariable("y")+1E-6);e=g.eval(this.constraint);b.y=(e-this.f0)/1E-6;b.y=isNaN(b.y)?Infinity:b.y;g.setVariable("x",k);g.setVariable("y",m);return b};l.prototype.findZero=function(a,c,b){g=this.evaluator;p.x=a.x;p.y=a.y;k=g.getVariable("x");m=g.getVariable("y");g.setVariable("x",a.x);g.setVariable("y",a.y);this.f0=g.eval(this.constraint);if("menor"===this.sign&&0>=this.f0||"mayor"===this.sign&&0<=this.f0)return p;g.setVariable("x",k);g.setVariable("y",m);for(var f=0;16>f;f++)if(d=p.x,q=p.y,this.normal=
this.gradient(p),0!=this.normal.norm2()&&this.normal.mul(-this.f0/this.normal.norm2()),p.x=d+this.normal.x,p.y=q+this.normal.y,this.normal.norm()<c)return 0===this.normal.x&&0===this.normal.y&&(this.normal.x=p.x-a.x,this.normal.y=p.y-a.y),p;return b?p:null};a.R2Newton=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(a,d){this.x=a;this.y=d};g.prototype.vectorLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};g.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};g.prototype.angleBetweenVectors=function(a){return Math.acos(this.dotProduct(a)/(this.vectorLength()*a.vectorLength()))};g.AXIS_X=new g(1,0);g.AXIS_Y=new g(0,1);a.Vector2D=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.floor,e=Math.round,d,q,p,b,k,m,c,l,f,v,r,u,y,n=function(c,b){this.parent=c;this.evaluator=c.evaluator;var h=this.parser=c.evaluator.parser;this.id="GraphicControl"!==b.type?"C":"G";this.gui=this.type="";this.region="south";this.y=this.x=0;this.w="Video"!==b.type?100:350;this.h="Video"!==b.type?23:120;this.keyboard=!1;this.kblayout="1x16";"GraphicControl"!==b.type&&"Audio"!==b.type&&"Video"!==b.type?"TextArea"!==b.type?this.expresion=h.parse("(0,0,100,23)"):
(this.expresion=h.parse("(0,0,300,200)"),this.w=300,this.h=200):this.expresion=h.parse("(0,0)");this.visible=this.fixed=!0;this.color=new a.Color("Scrollbar"==b.gui?"e0e4e8":"222222");this.colorInt="cc0022";"Scrollbar"==b.gui?this.colorInt="182C61":"GraphicControl"!==b.type&&(this.colorInt="f0f8ff");this.colorInt=new a.Color(this.colorInt);this.font_size=h.parse("0");this.cID=this.msg_pos=this.Explanation=this.tooltip=this.parameter=this.action=this.underlined=this.italics=this.bold="";this.parameterFont=
this.tooltipFont=this.ExplanationFont="Monospace 12px";this.drawif=h.parse("1");this.activeif=h.parse("1");this.valueExpr=h.parse("0");this.decimals=h.parse("2");this.min=h.parse("-Infinity");this.max=h.parse("Infinity");this.incr=h.parse("0.1");this.exponentialif=this.discrete=!1;this.zIndex=-1;Object.assign(this,b);"Video"!==this.type&&"Audio"!==this.type||"interior"===this.region||(this.region="interior");void 0==this.name&&(this.name=2==this.parent.version?this.id:"_nada_");this.name="_._"==this.name||
"_nada_"==this.name||"_void_"==this.name?"":this.name;b=this.evaluator.eval(this.expresion);this.x=e(b[0][0]);this.y=e(b[0][1]);4==b[0].length&&(this.w=e(b[0][2]),this.h=e(b[0][3]));this.actionExec=c.lessonParser.parseAction(this)};n.prototype.init=function(){};n.prototype.update=function(){};n.prototype.draw=function(){};n.prototype.getContainer=function(){var a=this.parent.spaces;if("interior"===this.region)for(var c=0,b=a.length;c<b;c++){var f=a[c];if(f.id===this.spaceID)return f.addCtr(this),
this.zIndex=f.zIndex,this.space=f,f.numericalControlContainer}else{if("external"===this.region)return this.parent.externalSpace.addCtr(this),this.parent.externalSpace.container;if("scenario"===this.region)return this.cID?(this.expresion=this.evaluator.parser.parse("(0,-1000,"+this.w+","+this.h+")"),this.parent.stage.stageSpace.addCtr(this),this.zIndex=this.parent.stage.stageSpace.zIndex,this.parent.stage.stageSpace.numericalControlContainer):this.parent.externalSpace.container;if(/north|south|east|west/.test(this.region))return this.parent[this.region+
"Space"].controls.push(this),this.parent[this.region+"Space"].container}a[0].addCtr(this);this.zIndex=a[0].zIndex;return a[0].numericalControlContainer};n.prototype.addControlContainer=function(a){var c=this.getContainer();c.childNodes[0]?c.insertBefore(a,c.childNodes[0]):c.appendChild(a)};n.prototype.updatePositionAndSize=function(){p=b=k=m=!1;c=this.evaluator.eval(this.expresion);l=e(c[0][0]);p=e(this.x)!==l;this.x=l;l=e(c[0][1]);b=e(this.y)!==l;this.y=l;4===c[0].length&&(l=e(c[0][2]),k=e(this.w)!==
l,this.w=l,l=e(c[0][3]),m=e(this.h)!==l,this.h=l);if(k||m||p||b)this.init(!0,!0),this.draw()};n.prototype.formatOutputValue=function(a){y=this.parent;f=a+"";v=this.evaluator.eval(this.decimals);r=f.indexOf(".");-1!=r&&(u=f.substring(r+1),u.length>v&&(f=parseFloat(f).toFixed(v)));this.fixed&&(2!==y.version||2===y.version&&!this.exponentialif)&&(f=parseFloat(a).toFixed(v));this.exponentialif&&0!=parseFloat(f)&&(f=this.fixed&&2!==y.version?parseFloat(f).toExponential(v):parseFloat(f).toExponential(),
f=f.toUpperCase().replace("+",""));return f.replace(".",y.decimal_symbol)};n.prototype.updateAndExecAction=function(){this.parent.updateControls();"init"===this.action&&(this.click=!1);this.actionExec.execute();this.parent.updateControls();"animate"!==this.action&&this.parent.update();this.parent.updateControls()};n.prototype.createGradient=function(a,c){this.linearGradient=this.ctx.createLinearGradient(0,0,0,c);d=c*c;for(a=0;a<c;a++)q=g(a-35*c/100),this.linearGradient.addColorStop(a/c,"rgba(0,0,0,"+
q*q*192/d/255+")")};a.Control=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.floor,e=Math.abs,d=/[\w\.\-//]*(\.gif)/gi,q,p,b,k,m,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G,D,B,L,H,M,P,I,O,C,Q,K,R,N,S=function(c,b){var h=a.Control.call(this,c,b)||this;h.imageSrc=b.imageSrc||"";h.image=b.image||new Image;h.imageOver=b.imageOver||new Image;h.imageDown=b.imageDown||new Image;h.flat=b.flat||!1;h.borderColor=b.borderColor||!1;h.text_align=b.text_align||"center_center";h.image_align=b.image_align||"center_center";h.font_family=a.getFontName(b.font_family||
"arial");h.ratio=c.ratio;-1===h.font_size&&(h.fontSizeNotSet=!0);h.borderColor&&(h.borderColor=new a.Color(h.borderColor));h.text_align=h.text_align.split("_");h.image_align=h.image_align.split("_");h.old_name=h.name;h.name.match(/^\[.*\]?/)?h.name=h.parser.parse(h.name.substring(1,h.name.length-1)):h.name=h.parser.parse("'"+h.name+"'");h.classContainer=h.cssClass?" "+h.cssClass+" ":"";h.extra_style=h.imageSrc.trim().match("^_STYLE_")?h.imageSrc.trim().substring(8):h.extra_style||"";h.imageSrc.trim().match("^_STYLE_")&&
(h.imageSrc="vacio.gif");if(h.extra_style){h.customStyle=!0;h.btnStyle=[];h.conStyle=[];h.conStyle.textBorder=3;c=h.extra_style.split("|");for(var f,l=0,d=c.length;l<d;l++)b=c[l],f=b.match(/rgb/g),b.match("class=")?h.classContainer=" "+b.substring(6):b.match("border=")?(h.btnStyle.push({type:"border-style",value:"solid"}),h.btnStyle.push({type:"border-width",value:b.substring(7).trim()+"px"})):b.match("borderRadius=")?(h.btnStyle.push({type:"border-radius",value:b.substring(13).trim()+"px"}),h.conStyle.push({type:"border-radius",
value:b.substring(13).trim()+"px"})):b.match("borderColor=")?h.btnStyle.push({type:"border-color",value:(f?"":"#")+b.substring(12).trim()}):b.match("overColor=")?h.conStyle.overColor=(f?"":"#")+b.substring(10).trim():b.match("downColor=")?h.conStyle.downColor=(f?"":"#")+b.substring(10).trim():b.match("font=")?h.conStyle.font=b.substring(5).trim().toLowerCase():b.match("inactiveColor=")?h.conStyle.inactiveColor=(f?"":"#")+b.substring(14).trim():b.match("inactiveColorBorder=")?h.conStyle.inactiveColorBorder=
(f?"":"#")+b.substring(20).trim():b.match("shadowTextBlur=")?h.conStyle.shadowTextBlur=parseFloat(b.substring(15).trim()):b.match("shadowTextOffsetX=")?h.conStyle.shadowTextOffsetX=parseFloat(b.substring(18).trim()):b.match("shadowTextOffsetY=")?h.conStyle.shadowTextOffsetY=parseFloat(b.substring(18).trim()):b.match("shadowTextColor=")?h.conStyle.shadowTextColor=(f?"":"#")+b.substring(16).trim():b.match("shadowBoxBlur=")?h.conStyle.shadowBoxBlur=parseFloat(b.substring(14).trim()):b.match("shadowBoxOffsetX=")?
h.conStyle.shadowBoxOffsetX=parseFloat(b.substring(17).trim()):b.match("shadowBoxOffsetY=")?h.conStyle.shadowBoxOffsetY=parseFloat(b.substring(17).trim()):b.match("shadowBoxColor=")?h.conStyle.shadowBoxColor=(f?"":"#")+b.substring(15).trim():b.match("shadowInsetBoxBlur=")?h.conStyle.shadowInsetBoxBlur=parseFloat(b.substring(19).trim()):b.match("shadowInsetBoxOffsetX=")?h.conStyle.shadowInsetBoxOffsetX=parseFloat(b.substring(22).trim()):b.match("shadowInsetBoxOffsetY=")?h.conStyle.shadowInsetBoxOffsetY=
parseFloat(b.substring(22).trim()):b.match("shadowInsetBoxColor=")?h.conStyle.shadowInsetBoxColor=(f?"":"#")+b.substring(20).trim():b.match("textBorder=")?h.conStyle.textBorder=parseFloat(b.substring(11).trim()):b.match("flat=")?h.flat=1==parseInt(b.substring(5).trim()):b.match("imgSizeW=")?h.imgSizeW=parseFloat(b.substring(9))||0:b.match("imgSizeH=")&&(h.imgSizeH=parseFloat(b.substring(9))||0)}h.imageSrc.match("_COLORES_")&&(c=h.imageSrc.split("_"),h.colorInt=new a.Color(c[2]),h.color=new a.Color(c[3]),
h.font_size=h.parser.parse(c[5]),h.imageSrc="");h.imageSrc.match(/^\[.*\]?/)?h.imageSrc=h.parser.parse(h.imageSrc.substring(1,h.imageSrc.length-1)):h.imageSrc=h.parser.parse("'"+h.imageSrc+"'");c=h.evaluator.eval(h.imageSrc).toString().trim();if(""!=c)if(b=c.substr(0,c.lastIndexOf(".")),f=c.substr(c.lastIndexOf(".")),c.match(/vacio.gif$/i))h.imageSrc=h.parser.parse("'vacio.gif'"),h.image.ready=1,3===h.parent.version&&(h.name=h.parser.parse("")),h.emptyImage={ready:!0},h.parser.parse("'vacio.gif'");
else if(h.image=h.parent.getImage(c),b)try{h.imageOver=h.parent.getImage(b+"_over"+f),h.imageDown=h.parent.getImage(b+"_down"+f)}catch(Z){}h.container=a.newHTML("div",{class:"DescartesButtonContainer"+h.classContainer,id:h.id,style:"width:"+h.w+"px;height:"+h.h+"px;left:"+h.x+"px;top:"+h.y+"px;z-index:"+h.zIndex+";"});h.btn=a.newHTML("canvas",{width:h.w*h.ratio,height:h.h*h.ratio,style:"position:absolute;left:0;top:0;width:"+h.w+"px;height:"+h.h+"px;"});h.ctx=h.btn.getContext("2d");h.ctx.imageSmoothingEnabled=
!1;h.tooltip&&(h.btn.title=h.tooltip);h.container.appendChild(h.btn);h.addControlContainer(h.container);h.addEvents();h.init();return h};$jscomp.inherits(S,a.Control);S.prototype.init=function(c){q=this.evaluator;E=this.container;p=this.btn;b=this.ctx;k=q.eval(this.expresion);this.x=k[0][0];this.y=k[0][1];4==k[0].length&&(this.w=parseInt(k[0][2]),this.h=parseInt(k[0][3]));p.width=this.w*this.ratio;p.height=this.h*this.ratio;p.setAttribute("style","position:absolute;left:0;top:0;width:"+this.w+"px;height:"+
this.h+"px;box-sizing:border-box;");E.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";display:block;");if(this.btnStyle)for(var h=0,f=this.btnStyle.length;h<f;h++)p.style[this.btnStyle[h].type]=this.btnStyle[h].value;if(this.conStyle){h=0;for(f=this.conStyle.length;h<f;h++)E.style[this.conStyle[h].type]=this.conStyle[h].value;if(this.conStyle.shadowBoxColor){h=this.conStyle.shadowBoxOffsetX||0;f=this.conStyle.shadowBoxOffsetY||
2;var l=this.conStyle.shadowBoxBlur||2;E.style.boxShadow=h+"px "+f+"px "+l+"px 1px "+this.conStyle.shadowBoxColor}this.conStyle.shadowInsetBoxColor&&(h=this.conStyle.shadowInsetBoxOffsetX||0,f=this.conStyle.shadowInsetBoxOffsetY||-2,l=this.conStyle.shadowInsetBoxBlur||1,p.style.boxShadow=h+"px "+f+"px "+l+"px 1px "+this.conStyle.shadowInsetBoxColor+" inset")}this.fontSizeNotSet&&(this.font_size=q.parser.parse(a.getFieldFontSize(this.h)+""));this.fs_evaluated=q.eval(this.font_size);this.createGradient(this.w,
this.h);E.style.display=0<q.eval(this.drawif)?"block":"none";b.lineJoin="round";b.font=this.italics+" "+this.bold+" "+this.fs_evaluated+"px "+this.font_family;this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.font_size,font_family:this.font_family,italics:this.italics,bold:this.bold,border:this.borderColor,border_size:this.conStyle?
this.conStyle.textBorder:void 0,shadowBlur:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextBlur||1:void 0,shadowOffsetX:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextOffsetX||0:void 0,shadowOffsetY:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextOffsetY||2:void 0,shadowColor:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextColor:void 0},this.old_name);this.draw(c)};S.prototype.update=function(){q=this.evaluator;E=
this.container;p=this.btn;this.activeIfValue=0<q.eval(this.activeif);this.drawIfValue=0<q.eval(this.drawif);(this.space?this.space.drawIfValue:1)&&this.drawIfValue?(E.style.display="block",this.draw(),E.style.cursor=p.style.cursor=this.activeIfValue?"pointer":"not-allowed",E.setAttribute("active",this.activeIfValue),this.updatePositionAndSize()):(E.style.display="none",this.buttonClick=!1)};S.prototype.draw=function(e){E=this.container;q=this.evaluator;p=this.btn;b=this.ctx;c=q.eval(this.name);this.text_object.draw(a.ctx,
"#000000",0,0);c=this.text_object.textNodes.toStr();l=this.evaluator.eval(this.imageSrc).toString().trim();if(!e&&(J=this.over===this.oldOver,F=this.buttonClick===this.oldButtonClick,G=this.activeIfValue===this.oldActiveIfValue,D=this.drawIfValue===this.oldDrawIfValue,B=c===this.oldName,L=l===this.oldImageSrc,H=this.colorInt.getColor()===this.oldBackColor,M=this.color.getColor()===this.oldTextColor,P=this.image.ready===this.oldImageReady,this.oldOver=this.over,this.oldButtonClick=this.buttonClick,
this.oldActiveIfValue=this.activeIfValue,this.oldDrawIfValue=this.drawIfValue,this.oldName=c,this.oldImageSrc=l,this.oldBackColor=this.colorInt.getColor(),this.oldTextColor=this.color.getColor(),this.oldImageReady=this.image.ready,J&&F&&G&&D&&B&&L&&H&&M&&P))return;b.save();b.setTransform(this.ratio,0,0,this.ratio,0,0);m=this.fs_evaluated;E.setAttribute("data-name",c);l?(f="vacio.gif"===l?this.emptyImage:this.parent.getImage(l),I=l.substr(0,l.lastIndexOf(".")),O=l.substr(l.lastIndexOf(".")),C=I+"_over"+
O,Q=I+"_down"+O,K="vacio.gif"===l?this.emptyImage:this.parent.getImage(C),R="vacio.gif"===l?this.emptyImage:this.parent.getImage(Q)):R=K=f=this.emptyImage;b.clearRect(0,0,this.w,this.h);v=r=0;this.buttonClick&&(v=r=1);this.text_object.draw(b,this.color.getColor(),0,0,!0);u=this.text_object.textNodes.metrics.w;y=this.text_object.textNodes.metrics.h;"center"==this.text_align[1]?z=g(this.w/2+v)-.5:"left"==this.text_align[1]?z=u/2+5+v:"right"==this.text_align[1]&&(z=this.w-u/2+v-5);"center"==this.text_align[0]?
A=g(this.h/2+r)-.5:"top"==this.text_align[0]?A=y/2+r+4:"bottom"==this.text_align[0]&&(A=this.h-y/2+r-3);if(f){if(n=this.imgSizeW?this.imgSizeW:f.width,h=this.imgSizeH?this.imgSizeH:f.height,"center"==this.image_align[1]?x=parseInt((this.w-n)/2)+v:"left"==this.image_align[1]?x=v:"right"==this.image_align[1]&&(x=this.w-n+v),"center"==this.image_align[0]?w=parseInt((this.h-h)/2)+r:"top"==this.image_align[0]?w=r:"bottom"==this.image_align[0]&&(w=this.h-h+r),f&&f.ready)if(f!==this.emptyImage&&f.complete)if(l.match(d))this.btn.style.backgroundRepeat=
"no-repeat",this.btn.style.backgroundImage="url('"+l+"')",this.btn.style.backgroundPosition=x+"px "+w+"px";else{if("center"!=this.image_align[0]||"center"!=this.image_align[1])N=this.colorInt.getColor(),!N||"CanvasGradient"!==N.constructor.name&&"CanvasPattern"!==N.constructor.name?E.style.backgroundColor=N:(b.fillStyle=N,b.fillRect(0,0,this.w,this.h));b.drawImage(f,0,0,f.width,f.height,x,w,n,h)}else this.emptyImage&&this.customStyle&&(N=this.colorInt.getColor(),!N||"CanvasGradient"!==N.constructor.name&&
"CanvasPattern"!==N.constructor.name?E.style.backgroundColor=N:(b.fillStyle=N,b.fillRect(0,0,this.w,this.h)))}else N=this.colorInt.getColor(),!N||"CanvasGradient"!==N.constructor.name&&"CanvasPattern"!==N.constructor.name?(E.style.backgroundColor=N,this.flat||(this.buttonClick||(a.drawLine(b,this.w-1,0,this.w-1,this.h,"rgba(0,0,0,0.5)"),a.drawLine(b,0,0,0,this.h,"rgba(0,0,0,0.09)"),a.drawLine(b,1,0,1,this.h,"rgba(0,0,0,0.03)")),b.fillStyle=this.linearGradient,b.fillRect(0,0,this.w,this.h))):(b.fillStyle=
N,b.fillRect(0,0,this.w,this.h));this.activeIfValue&&(K!==this.emptyImage&&this.over&&K.ready&&K.complete?C.match(d)?(this.btn.style.backgroundImage="url('"+C+"')",this.btn.style.backgroundPosition=x+"px "+w+"px"):b.drawImage(K,x,w):this.customStyle&&this.conStyle.overColor&&this.over&&(E.style.backgroundColor=this.conStyle.overColor));this.activeIfValue?R!==this.emptyImage&&this.buttonClick&&R.ready&&R.complete?Q.match(d)?(this.btn.style.backgroundImage="url('"+Q+"')",this.btn.style.backgroundPosition=
x+"px "+w+"px"):b.drawImage(R,x,w):this.customStyle&&this.conStyle.downColor&&this.buttonClick&&(E.style.backgroundColor=this.conStyle.downColor):this.buttonClick&&!f&&(b.fillStyle="rgba(0,0,0,0.09)",b.fillRect(0,0,this.w,this.h));b.fillStyle=this.color.getColor();this.customStyle&&this.conStyle.shadowTextColor&&0<this.conStyle.textBorder&&(b.lineWidth=this.conStyle.textBorder,b.strokeStyle=this.conStyle.shadowTextColor);this.borderColor&&(b.lineWidth=parseInt(m/6),b.strokeStyle=this.borderColor.getColor());
this.text_object.draw(b,this.color.getColor(),z,A);this.underlined&&(b.strokeStyle=this.color.getColor(),b.lineWidth=g(m/10)||2,b.lineCap="round",b.beginPath(),b.moveTo(z-u/2+v,A+g(m/2)+g(m/5)-1.5),b.lineTo(z+u/2+v,A+g(m/2)+g(m/5)-1.5),b.stroke());this.activeIfValue||(this.customStyle&&this.conStyle.inactiveColor?E.style.backgroundColor=this.conStyle.inactiveColor:(b.fillStyle="rgba(240,240,240,0.6)",b.fillRect(0,0,this.w,this.h)));b.restore();this._image_pos_x=x;this._image_pos_y=w};S.prototype.drawTextBorder=
function(){this.colorInt.getColor();this.color.getColor();return!(.5>(e(this.colorInt.r-this.color.r)+e(this.colorInt.g-this.color.g)+e(this.colorInt.b-this.color.b))/255)};S.prototype.buttonPressed=function(){this.updateAndExecAction()};S.prototype.addEvents=function(){function c(b,h,d){a.clearTimeout(l);f.buttonClick&&f.drawIfValue&&f.activeIfValue&&(h.call(f),b=d?b:100,l=a.setTimeout(function(){c(b,h,!1)},b))}function b(b){this.focus();b.preventDefault();b.stopPropagation();document.activeElement!=
document.body&&document.activeElement.blur();f.whichBtn=a.whichBtn(b);"L"==f.whichBtn&&f.activeIfValue&&(f.buttonClick=!0,f.draw(),"calculate"==f.action&&(f.evaluator.setVariable(f.id,f.evaluator.eval(f.valueExpr)),c(1E3,f.buttonPressed,!0)),f.btn.removeEventListener("touchend",h),f.btn.addEventListener("touchend",h),f.btn.removeEventListener("mouseup",h),f.btn.addEventListener("mouseup",h))}function h(c){a.newBlobContent=null;this.focus();c.preventDefault();c.stopPropagation();if(f.activeIfValue||
f.buttonClick)f.buttonClick=!1,f.draw(),"calculate"!=f.action&&(f.evaluator.setVariable(f.id,f.evaluator.eval(f.valueExpr)),f.buttonPressed()),f.btn.removeEventListener("touchend",h),f.btn.removeEventListener("mouseup",h);f.parent.update()}var f=this,l;f.btn.oncontextmenu=function(){return!1};this.over=this.buttonClick=!1;this.btn.addEventListener("touchstart",b);this.btn.addEventListener("mousedown",b);this.btn.addEventListener("mouseover",function(a){a.preventDefault();a.stopPropagation();f.over=
!0;f.draw()});this.btn.addEventListener("mouseout",function(c){a.newBlobContent=null;c.preventDefault();c.stopPropagation();f.over=!1;f.buttonClick=!1;f.draw()});document.addEventListener("visibilitychange",function(c){a.newBlobContent=null;f.buttonClick=!1})};a.Button=S;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l,f,v,r,u,y=function(c,b){b=a.Control.call(this,c,b)||this;b.flat=b.image_dec_src&&b.image_inc_src;b.btn_pos=b.btn_pos||"v_left";b.horizontal="h_left"===b.btn_pos||"h_right"===b.btn_pos||"h_left_right"===b.btn_pos;b.label_color=b.label_color||new a.Color("e0e4e8",c.evaluator);b.label_text_color=b.label_text_color||new a.Color("000000",c.evaluator);b.tabindex=++b.parent.tabindex;b.name_str=b.name;b.initial_value=0;try{b.initial_value=
b.evaluator.eval(b.parser.parse(b.valueExprString))}catch(x){console.log(x)}b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name+"'");b.container=a.newHTML("div",{class:"DescartesSpinnerContainer",id:b.id});b.divUp=a.newHTML("div",{class:"DJS_Up"});b.divDown=a.newHTML("div",{class:"DJS_Down"});b.field=a.newHTML("input",{type:"text",id:b.id+"_spinner",class:"DescartesSpinnerField",tabindex:b.tabindex});b.label=a.newHTML("canvas",{class:"DescartesSpinnerLabel"});
b.label_ctx=b.label.getContext("2d");b.ratio=c.ratio;b.container.appendChild(b.label);b.container.appendChild(b.field);b.container.appendChild(b.divUp);b.container.appendChild(b.divDown);b.cover=a.newHTML("div",{class:"TextfieldCover"});b.keyboard&&b.visible&&b.container.appendChild(b.cover);b.addControlContainer(b.container);f=b.evaluator.parser.parse("1");b.originalIncr=b.incr;if(0>b.evaluator.eval(b.decimals)||0===b.evaluator.eval(b.incr))c=b.evaluator.eval(b.incr),0<c?(b.incr=b.evaluator.parser.parse(parseInt(c).toString()),
b.originalIncr=b.incr):b.incr=f;b.image_dec_src&&(b.image_dec_src.match(/^\[.*\]?/)?b.image_dec_src=b.parser.parse(b.image_dec_src.substring(1,b.image_dec_src.length-1)):b.image_dec_src=b.parser.parse("'"+b.image_dec_src+"'"),b.old_image_dec_src=b.evaluator.eval(b.image_dec_src).toString().trim(),b.image_dec=b.parent.getImage(b.old_image_dec_src));b.image_inc_src&&(b.image_inc_src.match(/^\[.*\]?/)?b.image_inc_src=b.parser.parse(b.image_inc_src.substring(1,b.image_inc_src.length-1)):b.image_inc_src=
b.parser.parse("'"+b.image_inc_src+"'"),b.old_image_inc_src=b.evaluator.eval(b.image_inc_src).toString().trim(),b.image_inc=b.parent.getImage(b.old_image_inc_src));b.addEvents();b.init();return b};$jscomp.inherits(y,a.Control);y.prototype.init=function(c,b){g=this.evaluator;this.label.innerHTML=g.eval(this.name).toString();var h=this.label.textContent;b||(this.value=this.validateValue(g.eval(this.valueExpr)));b=this.formatOutputValue(this.value);this.fieldFontSize=0<g.eval(this.font_size)?g.eval(this.font_size):
a.getFieldFontSize(this.h);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);var f=2!==this.parent.version?"__":"_____",l=a.getTextWidth(b+
"_",this.fieldFontSize+"px "+a.sansserif_font);if(this.horizontal){c=parseInt(this.h);var d=parseInt(this.w/2-c);f=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);this.visible||(d=this.w-2*c,l=0);d<f&&(d=f);""==h&&(d=0);this.w-d-c<l&&(d=this.w-c-l);0>d&&(d=0);h=this.w-(d+2*c);this.container.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";background-color:transparent;");this.divUp.setAttribute("style","width:"+
c+"px;height:"+c+"px;"+("h_left"===this.btn_pos?"left:"+(d+c):"right:0")+"px;top:0;"+(this.flat?"border-width:0;":""));this.divDown.setAttribute("style","width:"+c+"px;height:"+c+"px;left:"+(d+("h_right"===this.btn_pos?h:0))+"px;top:0;"+(this.flat?"border-width:0;":""));this.field.setAttribute("style","font-family:"+a.sansserif_font+";font-size:"+this.fieldFontSize+"px;width:"+h+"px;height:"+this.h+"px;left:"+(c+d+("h_left"===this.btn_pos?c:"h_right"===this.btn_pos?-c:0))+"px;text-align:center;");
this.cover.setAttribute("style","width:"+h+"px;height:"+this.h+"px;left:"+(c+d+("h_left"===this.btn_pos?c:"h_right"===this.btn_pos?-c:0))+"px;text-align:center;")}else c=2+parseInt(this.h/2),d=parseInt(this.w/2-c/2),f=a.getTextWidth(h+f,this.fieldFontSize+"px "+a.sansserif_font),this.visible||(d=this.w-c,l=0),d<f&&(d=f),""==h&&(d=0),this.w-d-c<l&&(d=this.w-c-l),0>d&&(d=0),h=this.w-(d+c),this.container.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+
this.zIndex+";background-color:transparent;"),f="width:"+c+"px;left:"+(d+("v_right"===this.btn_pos?h:0))+"px;",this.divUp.setAttribute("style",f+";height:"+(this.h/2+1)+"px;top:0;"+(this.flat?"border-width:0;":"")),this.divDown.setAttribute("style",f+";height:"+(this.h/2-1)+"px;top:"+(this.h/2+1)+"px;"+(this.flat?"border-width:0;":"")),this.field.setAttribute("style","font-family:"+a.sansserif_font+";font-size:"+this.fieldFontSize+"px;width:"+h+"px;height:"+this.h+"px;left:"+(("v_left"===this.btn_pos?
c:0)+d)+"px;"),this.cover.setAttribute("style","width:"+h+"px;height:"+this.h+"px;left:"+(("v_left"===this.btn_pos?c:0)+d)+"px;");this.field.value=b;this.visible||(this.field.style.display="none");this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+d+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.label.width=d*this.ratio;this.label.height=this.h*this.ratio;this.image_dec&&
this.image_dec.ready&&(this.divDown.style["background-image"]="url("+this.image_dec.src+")");this.image_inc&&this.image_inc.ready&&(this.divUp.style["background-image"]="url("+this.image_inc.src+")");this.divUp.setAttribute("horizontal",this.horizontal?!0:!1);this.divDown.setAttribute("horizontal",this.horizontal?!0:!1);g.setVariable(this.id,this.value)};y.prototype.update=function(){g=this.evaluator;0>g.eval(this.decimals)?(e=g.eval(this.incr),0<e?this.originalIncr=this.incr=g.parser.parse(parseInt(e).toString()):
this.incr=f):this.incr=0!==g.eval(this.originalIncr)?this.originalIncr:f;this.activeIfValue=0<g.eval(this.activeif);this.drawIfValue=0<g.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.divUp.setAttribute("active",!this.field.disabled);this.divDown.setAttribute("active",!this.field.disabled);this.drawIfValue?(this.updateStyle(),this.container.style.display="block"):(this.click=!1,this.container.style.display="none");this.image_dec&&(v=this.evaluator.eval(this.image_dec_src).toString().trim(),
this.old_image_dec_src!==v&&(this.divDown.style["background-image"]="url("+v+")",this.old_image_dec_src=v));this.image_inc&&(r=this.evaluator.eval(this.image_inc_src).toString().trim(),this.old_image_inc_src!==r&&(this.divUp.style["background-image"]="url("+r+")",this.image_inc_src=r));this.updatePositionAndSize();this.parent.animation.playing&&document.activeElement==this.field||(d=this.field.value,q=this.value,this.value=this.validateValue(g.getVariable(this.id)),this.field.value=this.formatOutputValue(this.value),
this.value==q&&this.field.value!=d&&(this.value=this.validateValue(d),this.field.value=this.formatOutputValue(this.value)),g.setVariable(this.id,this.value));this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);!(u=this.label_color.getColor())||"CanvasGradient"!==u.constructor.name&&"CanvasPattern"!==u.constructor.name||(this.label_ctx.fillStyle=u,this.label_ctx.fillRect(0,
0,this.label_ctx.canvas.width,this.label_ctx.canvas.height));this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};y.prototype.updateStyle=
function(){this.divUp.style.borderStyle=this.up?"inset":"outset";this.divUp.style.borderColor=this.up?"gray":"#f0f8ff";this.divUp.style.backgroundColor=this.up?"#bfbfbf":"";this.divUp.style.backgroundColor=this.flat?"transparent":this.divUp.style.backgroundColor;this.divUp.style.backgroundPosition=this.up?"calc(50% + 1px) calc(50% + 1px)":"center";this.divDown.style.borderStyle=this.down?"inset":"outset";this.divDown.style.borderColor=this.down?"gray":"#f0f8ff";this.divDown.style.backgroundColor=
this.down?"#bfbfbf":"";this.divDown.style.backgroundColor=this.flat?"transparent":this.divDown.style.backgroundColor;this.divDown.style.backgroundPosition=this.down?"calc(50% + 1px) calc(50% + 1px)":"center"};y.prototype.validateValue=function(a){g=this.evaluator;isNaN(parseFloat(a))||a.toString().match("e")&&(a=parseFloat(a).toFixed(20));a=void 0!=a?a.toString():"0";a=a.replace(this.parent.decimal_symbol,".");p=a==parseFloat(a)?parseFloat(a):parseFloat(g.eval(g.parser.parse(a)));isNaN(p)&&(p=0);
m=g.eval(this.min);c=g.eval(this.max);""===m&&(m=-Infinity);""===c&&(c=Infinity);p=Math.min(Math.max(p,m),c);this.discrete&&(b=g.eval(this.incr),p=0==b?0:this.initial_value+b*Math.round((p-this.initial_value)/b));k=g.eval(this.decimals);0>=k&&(k=0);return p=parseFloat(parseFloat(p).toFixed(k))};y.prototype.increase=function(){this.changeValue(parseFloat(this.value)+this.evaluator.eval(this.incr))};y.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.evaluator.eval(this.incr))};
y.prototype.changeValue=function(a){this.activeIfValue&&(this.value=this.validateValue(a),this.field.value=this.formatOutputValue(this.value),this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};y.prototype.addEvents=function(){function c(b,h,f){a.clearTimeout(m);if(g.up||g.down)h.call(g),b=f?b:10,m=a.setTimeout(function(){c(b,h)},b)}function b(b){b.preventDefault();g.whichBtn=a.whichBtn(b);"L"==g.whichBtn&&g.activeIfValue&&(g.up=!0,c(k,g.increase,!0))}function f(b){b.preventDefault();
g.whichBtn=a.whichBtn(b);"L"==g.whichBtn&&g.activeIfValue&&(g.down=!0,c(k,g.decrease,!0))}function d(c){g.up=!1;a.clearTimeout(m);g.updateStyle()}function e(c){g.down=!1;a.clearTimeout(m);g.updateStyle()}l=a.hasTouchSupport;var g=this,k=l?500:200,m;g.divUp.oncontextmenu=g.divDown.oncontextmenu=g.field.oncontextmenu=g.label.oncontextmenu=g.cover.oncontextmenu=function(){return!1};this.label.addEventListener("touchstart",a.preventDefault);this.label.addEventListener("mousedown",a.preventDefault);this.field.addEventListener("keydown",
function(a){13==a.keyCode&&g.changeValue(g.field.value)});this.divUp.addEventListener("touchstart",b);this.divUp.addEventListener("mousedown",b);this.divDown.addEventListener("touchstart",f);this.divDown.addEventListener("mousedown",f);this.divUp.addEventListener("mouseout",function(c){g.up=!1;a.clearTimeout(m);c.preventDefault();g.updateStyle()});this.divDown.addEventListener("mouseout",function(c){g.down=!1;a.clearTimeout(m);c.preventDefault();g.updateStyle()});this.divUp.addEventListener("touchend",
d);window.addEventListener("touchend",d);this.divUp.addEventListener("mouseup",d);window.addEventListener("mouseup",d);this.divDown.addEventListener("touchend",e);window.addEventListener("touchend",e);this.divDown.addEventListener("mouseup",e);window.addEventListener("mouseup",e);document.addEventListener("visibilitychange",function(c){g.up=!1;g.down=!1;a.clearTimeout(m);g.updateStyle()});this.field.addEventListener("blur",function(a){g.drawIfValue&&g.changeValue(g.field.value,!0)});g.field.addEventListener("click",
function(a){this.focus()});g.cover.addEventListener("click",function(a){a=g.evaluator.eval(g.kbexp);g.activeIfValue&&g.parent.keyboard.show(g,g.kblayout,a[0][0]||0,a[0][1]||0,g.id,g.field,g.onlyText)})};a.Spinner=y;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d=function(d,e){var b=a.Control.call(this,d,e)||this;b.label_color=b.label_color||new a.Color("e0e4e8",d.evaluator);b.label_text_color=b.label_text_color||new a.Color("000000",d.evaluator);b.typeCtr="checkbox";b.pressed=e.pressed||!1;b.radio_group=(e.radio_group||"").trim();""!==b.radio_group&&(b.typeCtr="radio");b.name_str=b.name;b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name.trim()+
"'");b.tabindex=++b.parent.tabindex;b.containerControl=a.newHTML("div",{class:"DescartesCheckboxContainer",id:b.id});b.checkbox=a.newHTML("input",{type:b.typeCtr,id:b.id+b.typeCtr,class:"DescartesCheckbox",tabindex:b.tabindex});""!==b.radio_group&&b.checkbox.setAttribute("name",b.radio_group);b.checkbox.internalID=b.id;b.label=a.newHTML("canvas",{class:"DescartesCheckboxLabel"});b.label_ctx=b.label.getContext("2d");b.ratio=d.ratio;b.dummyLabel=a.newHTML("label",{"for":b.id+b.typeCtr});b.value=b.evaluator.eval(b.valueExpr);
b.evaluator.setVariable(b.id,b.value);b.containerControl.appendChild(b.label);b.containerControl.appendChild(b.checkbox);b.containerControl.appendChild(b.dummyLabel);b.addControlContainer(b.containerControl);b.addEvents();b.init();return b};$jscomp.inherits(d,a.Control);d.prototype.init=function(d){g=this.evaluator;this.label.innerHTML=g.eval(this.name).toString();this.labelFontSize=0<g.eval(this.font_size)?g.eval(this.font_size):a.getFieldFontSize(this.h);d=Math.max(this.w-this.h,0);this.text_object=
new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.labelFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+
this.y+"px;z-index:"+this.zIndex+";");"right"==this.position?(this.dummyLabel.setAttribute("style","position:absolute;width:"+this.h+"px;height:"+this.h+"px;left:"+d+"px;"),this.checkbox.setAttribute("style","width:"+this.h+"px;height:"+this.h+"px;left:"+d+"px;"),this.label.setAttribute("style","font-size:"+this.labelFontSize+"px;width:"+d+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";")):(this.dummyLabel.setAttribute("style",
"position:absolute;width:"+this.h+"px;height:"+this.h+"px;left:0;"),this.checkbox.setAttribute("style","width:"+this.h+"px;height:"+this.h+"px;left:0;"),this.label.setAttribute("style","font-size:"+this.labelFontSize+"px;width:"+d+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";left:"+this.h+"px"));this.checkbox.checked=0!=this.evaluator.getVariable(this.id);this.label.width=d*this.ratio;this.label.height=
this.h*this.ratio;this.update()};d.prototype.update=function(){g=this.evaluator;this.activeIfValue=0<g.eval(this.activeif);this.drawIfValue=0<g.eval(this.drawif);this.checkbox.disabled=!this.activeIfValue;this.containerControl.style.display=this.drawIfValue?"block":"none";if(!this.parent.animation.playing||document.activeElement!=this.checkbox){var a=0!==g.getVariable(this.id)?1:0;if(""===this.radio_group)this.pressed?(this.value=this.checkbox.checked?1:0,this.pressed=!1):(this.value=a,this.checkbox.checked=
0!==this.value),g.setVariable(this.id,this.value);else{this.value=g.getVariable(this.id);g.setVariable(this.radio_group,0);a=document.querySelectorAll("[name="+this.radio_group+"]");var d=-1;if(this.pressed){for(var b=a.length-1;0<=b;b--)g.setVariable(a[b].internalID,0),a[b].checked=!1;g.setVariable(this.id,1);this.checkbox.checked=!0;this.value=1;g.setVariable(this.radio_group,this.id);this.pressed=0}else{for(b=a.length-1;0<=b;b--)d=0!=g.getVariable(a[b].internalID)?b:d,g.setVariable(a[b].internalID,
0),a[b].checked=!1;0<=d&&(g.setVariable(a[d].internalID,1),a[d].checked=!0,g.setVariable(this.radio_group,a[d].internalID));this.value=this.checkbox.checked?1:0}}}this.updatePositionAndSize();this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);!(e=this.label_color.getColor())||"CanvasGradient"!==e.constructor.name&&"CanvasPattern"!==e.constructor.name||
(this.label_ctx.fillStyle=e,this.label_ctx.fillRect(0,0,this.label_ctx.canvas.width,this.label_ctx.canvas.height));this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,
0,0,1,0,0)};d.prototype.addEvents=function(){var d=this;d.checkbox.oncontextmenu=d.label.oncontextmenu=d.dummyLabel.oncontextmenu=function(){return!1};d.label.addEventListener("touchstart",a.preventDefault);d.label.addEventListener("mousedown",a.preventDefault);d.dummyLabel.addEventListener("mousedown",a.preventDefault);d.checkbox.addEventListener("click",function(a){d.pressed=!0;d.updateAndExecAction()})};a.Checkbox=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m=function(c,b){b=a.Control.call(this,c,b)||this;b.label_color=b.label_color||new a.Color("e0e4e8",c.evaluator);b.label_text_color=b.label_text_color||new a.Color("000000",c.evaluator);b.name_str=b.name;b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name.trim()+"'");void 0===b.valueExprString&&(b.valueExprString=b.onlyText?"0":"");b.emptyString=!1;b.ok=0;b.tabindex=++b.parent.tabindex;
b.regExpDecimalSymbol=new RegExp("\\"+b.parent.decimal_symbol,"g");if(b.answer)if(b.answer.match("krypto_")&&(b.answer=(new a.Krypto).decode(b.answer.substring(7))),b.answerPattern=b.answer,b.answer=a.buildRegularExpressionsPatterns(b.answer,b.evaluator),b.onlyText){var f=b.answerPattern.indexOf("|");b.firstAnswer=-1==f?b.answerPattern:b.answerPattern.substring(0,f)}else b.firstAnswer=b.parser.parse(b.answerPattern.substring(1,b.answerPattern.indexOf(",")));b.onlyText&&(b.valueExprString.match(/^'/)&&
b.valueExprString.match(/'$/)||(b.valueExpr=b.evaluator.parser.parse("'"+b.valueExprString+"'")),b.validateValue=function(a){a=a.toString();return"''"==a||"'"==a?"":a&&a.match(/^'/)&&a.match(/'$/)?a.substring(1,a.length-1):a},b.formatOutputValue=function(a){return a.toString()});b.containerControl=a.newHTML("div",{class:"DescartesTextFieldContainer",id:b.id});b.field=a.newHTML("input",{type:"text",id:b.id+"TextField",class:"DescartesTextFieldField",tabindex:b.tabindex});b.label=a.newHTML("canvas",
{class:"DescartesTextFieldLabel"});b.label_ctx=b.label.getContext("2d");b.ratio=c.ratio;b.containerControl.appendChild(b.label);b.containerControl.appendChild(b.field);b.cover=a.newHTML("div",{class:"TextfieldCover"});b.keyboard&&b.containerControl.appendChild(b.cover);b.addControlContainer(b.containerControl);b.addEvents();b.init();return b};$jscomp.inherits(m,a.Control);m.prototype.init=function(c){g=this.evaluator;this.label.innerHTML=g.eval(this.name).toString();var b=this.label.textContent;c||
(this.value=this.validateValue(g.eval(this.valueExpr)));c=this.formatOutputValue(this.value);this.fieldFontSize=0<g.eval(this.font_size)?g.eval(this.font_size):a.getFieldFontSize(this.h);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},
this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);var f=a.getTextWidth(c+"_",this.fieldFontSize+"px "+a.sansserif_font),d=parseInt(this.w/2),e=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);this.visible||(d=this.w,f=0);d<e&&(d=e);""==b&&(d=0);this.w-d<f&&(d=this.w-f);0>d&&(d=0);b=this.w-d;this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");this.field.setAttribute("style",
"font-size:"+this.fieldFontSize+"px;width:"+b+"px;height:"+this.h+"px;left:"+d+"px; font-family:"+("Serif"==this.font_family?a.serif_font:"Monospaced"==this.font_family?a.monospace_font:a.sansserif_font)+";");this.field.value=c;this.cover.setAttribute("style",";width:"+b+"px;height:"+this.h+"px;left:"+d+"px;");this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+d+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+
";");this.label.width=d*this.ratio;this.label.height=this.h*this.ratio;this.evaluate&&(this.ok=this.evaluateAnswer());this.evaluator.setVariable(this.id,this.value);this.evaluator.setVariable(this.id+".ok",this.ok);this.oldValue=this.value;this.update()};m.prototype.update=function(){g=this.evaluator;this.activeIfValue=0<g.eval(this.activeif);this.drawIfValue=0<g.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.containerControl.style.display=this.drawIfValue?"block":"none";this.parent.animation.playing&&
document.activeElement==this.field||(e=this.field.value,d=this.value,this.value=this.validateValue(g.getVariable(this.id)),this.field.value=this.formatOutputValue(this.value),this.value===d&&this.field.value!=e&&(this.value=this.validateValue(e),this.field.value=this.formatOutputValue(this.value)),g.setVariable(this.id,this.value));this.updatePositionAndSize();this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,
0,this.label.width,this.label.height);!(k=this.label_color.getColor())||"CanvasGradient"!==k.constructor.name&&"CanvasPattern"!==k.constructor.name||(this.label_ctx.fillStyle=k,this.label_ctx.fillRect(0,0,this.label_ctx.canvas.width,this.label_ctx.canvas.height));this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",
this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};m.prototype.validateValue=function(a){if(""===a||"''"==a)return"";g=this.evaluator;a=a.toString().replace(this.regExpDecimalSymbol,".","g");q=a==parseFloat(a)?parseFloat(a):parseFloat(g.eval(g.parser.parse(a)));isNaN(q)&&(q=0);p=g.eval(this.min);b=g.eval(this.max);""===p&&(p=-Infinity);""===b&&(b=Infinity);q<p&&(q=p);q>b&&(q=
b);this.discrete&&(a=g.eval(this.incr),q=0===a?0:a*Math.round(q/a));return q=parseFloat(parseFloat(q).toFixed(g.eval(this.decimals)))};m.prototype.formatOutputValue=function(c){return""===c?"":a.Control.prototype.formatOutputValue.call(this,c)};m.prototype.changeValue=function(a){this.activeIfValue&&(this.value=this.validateValue(a),this.field.value=this.formatOutputValue(this.value),this.evaluate&&(this.ok=this.evaluateAnswer()),this.evaluator.setVariable(this.id,this.value),this.evaluator.setVariable(this.id+
".ok",this.ok),this.updateAndExecAction())};m.prototype.evaluateAnswer=function(){return a.esCorrecto(this.answer,this.value,this.evaluator,this.answer)};m.prototype.getFirstAnswer=function(){return this.answer?this.onlyText?this.firstAnswer:this.evaluator.eval(this.firstAnswer):""};m.prototype.addEvents=function(){var c=this;c.field.oncontextmenu=c.label.oncontextmenu=c.cover.oncontextmenu=function(){return!1};c.label.addEventListener("touchstart",a.preventDefault);c.label.addEventListener("mousedown",
a.preventDefault);this.field.addEventListener("blur",function(a){c.drawIfValue&&c.changeValue(c.field.value,!0)});this.field.addEventListener("keydown",function(a){c.activeIfValue&&13==a.keyCode&&c.changeValue(c.field.value,!0)});c.field.addEventListener("click",function(a){this.focus()});c.cover.addEventListener("click",function(a){a=c.evaluator.eval(c.kbexp);c.activeIfValue&&c.parent.keyboard.show(c,c.kblayout,a[0][0]||0,a[0][1]||0,c.id,c.field,c.onlyText)})};a.TextField=m;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.abs,e,d,q,p,b,k,m,c,l,f,v,r=function(c,b){function f(c){l.options=c.split(",");l.menuOptions=[];l.strValue=[];c=0;for(var b=l.options.length;c<b;c++){var h=l.customSplit(l.options[c]);1==h.length?(l.menuOptions.push(h[0]),l.strValue.push(c.toString())):2==h.length&&(l.menuOptions.push(h[0]),""==h[1]?l.strValue.push(c.toString()):l.strValue.push(h[1]))}c=0;for(b=l.menuOptions.length;c<b;c++)l.menuOptions[c].match(/^\[/)&&l.menuOptions[c].match(/\]$/)?l.menuOptions[c]=
e.parse(l.menuOptions[c].substring(1,l.menuOptions[c].length-1)):l.menuOptions[c]=e.parse("'"+l.menuOptions[c]+"'");c=0;for(b=l.strValue.length;c<b;c++)l.strValue[c].match(/^\[/)&&l.strValue[c].match(/\]$/)?l.strValue[c]=e.parse(l.strValue[c].substring(1,l.strValue[c].length-1)):l.strValue[c]=e.parse(l.strValue[c]);l.select.innerHTML="";c=0;for(b=l.menuOptions.length;c<b;c++)h=a.newHTML("option"),h.innerHTML=d.eval(l.menuOptions[c]),l.select.appendChild(h);return 0}var h=a.Control.call(this,c,b)||
this;h.label_color=h.label_color||new a.Color("e0e4e8",c.evaluator);h.label_text_color=h.label_text_color||new a.Color("000000",c.evaluator);h.options=b.options||"";e=h.parser;d=h.evaluator;h.ok=0;h.tabindex=++h.parent.tabindex;h.answer&&(h.answer.match("krypto_")&&(h.answer=(new a.Krypto).decode(h.answer.substring(7))),h.answer=parseInt(h.answer.split(",")[0].replace("[",""))||0);h.name_str=h.name;h.name.match(/^\[.*\]?/)?h.name=h.parser.parse(h.name.substring(1,h.name.length-1)):h.name=h.parser.parse("'"+
h.name+"'");var l=h;h.evaluator.setFunction(h.id+".setOptions",f);h.containerControl=a.newHTML("div",{class:"DescartesMenuContainer",id:h.id});h.label=a.newHTML("canvas",{class:"DescartesMenuLabel"});h.label_ctx=h.label.getContext("2d");h.ratio=c.ratio;h.select=a.newHTML("select",{id:h.id+"_menuSelect",class:"DescartesMenuSelect",tabindex:h.tabindex});h.field=a.newHTML("input",{type:"text",id:h.id+"_menuField",class:"DescartesMenuField",tabindex:h.tabindex});f(h.options);h.containerControl.appendChild(h.label);
h.containerControl.appendChild(h.select);h.visible&&h.containerControl.appendChild(h.field);h.cover=a.newHTML("div",{class:"TextfieldCover"});h.keyboard&&h.visible&&h.containerControl.appendChild(h.cover);h.addControlContainer(h.containerControl);h.addEvents();h.init();return h};$jscomp.inherits(r,a.Control);r.prototype.init=function(c){d=this.evaluator;this.label.innerHTML=d.eval(this.name).toString();var b=this.label.textContent;this.fieldFontSize=0<d.eval(this.font_size)?d.eval(this.font_size):
a.getFieldFontSize(this.h);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);var f=0,h=0;this.value=c?this.value:d.eval(this.valueExpr);
this.indexValue=this.getIndex(this.value);for(var l=0,e=this.menuOptions.length;l<e;l++)c=a.getTextWidth(d.eval(this.menuOptions[l]).toString(),this.fieldFontSize+"px "+a.sansserif_font),c>f&&(f=c,h=l);f+=25;c=a.getTextWidth(this.formatOutputValue(d.eval(this.strValue[h])),this.fieldFontSize+"px "+a.sansserif_font)+7;h=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);""==b&&(h=0);this.visible||(c=0);for(b=this.w-c-h;b<f&&0<h;)h--,b++;for(;b<f&&0<c;)c--,b++;for(;h+b+c+1<this.w;)b++,
c++;f=h;l=f+b;c=this.w-l;e=this.formatOutputValue(d.eval(this.strValue[this.indexValue]));this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+h+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.label.width=h*this.ratio;this.label.height=
this.h*this.ratio;this.field.value=e;this.field.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+c+"px;height:"+this.h+"px;left:"+l+"px;");this.cover.setAttribute("style","width:"+c+"px;height:"+this.h+"px;left:"+l+"px;");this.select.setAttribute("style","text-align:left;font-size:"+this.fieldFontSize+"px;width:"+b+"px;height:"+this.h+"px;left:"+f+"px;");this.select.selectedIndex=this.indexValue;d.setVariable(this.id,parseFloat(e.replace(this.parent.decimal_symbol,".")));this.update()};
r.prototype.update=function(){d=this.evaluator;this.activeIfValue=0<d.eval(this.activeif);this.drawIfValue=0<d.eval(this.drawif);this.field.disabled=this.activeIfValue?!1:!0;this.select.disabled=this.activeIfValue?!1:!0;this.drawIfValue?this.containerControl.style.display="block":(this.click=!1,this.containerControl.style.display="none");if(!this.parent.animation.playing||document.activeElement!=this.select){for(var a=0,c=this.menuOptions.length;a<c;a++)this.select.options[a].innerHTML=d.eval(this.menuOptions[a]);
this.value=d.getVariable(this.id);isNaN(this.value)&&(this.value=0);this.field.value=this.formatOutputValue(this.value);d.setVariable(this.id,parseFloat(this.value));this.select.selectedIndex=parseFloat(this.getIndex(this.value))}this.ok=this.value==this.answer?1:0;this.evaluator.setVariable(this.id+".ok",this.ok);this.updatePositionAndSize();this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,
0,this.label.width,this.label.height);!(v=this.label_color.getColor())||"CanvasGradient"!==v.constructor.name&&"CanvasPattern"!==v.constructor.name||(this.label_ctx.fillStyle=v,this.label_ctx.fillRect(0,0,this.label_ctx.canvas.width,this.label_ctx.canvas.height));this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",
this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};r.prototype.customSplit=function(a){k=!1;m="";c=0;for(l=-1;c<a.length;){f=a.charAt(c);if("["===f&&-1===l){if(k||""!=m)m+="\u00a6";l++}else"["===f?l++:"]"===f&&0===l?(k=!0,l--):"]"==a.charAt(c)&&(l=0>l?l:l-1);m+=a.charAt(c);c++}return m.split("\u00a6")};r.prototype.getIndex=function(a){a=parseFloat(a.toString().replace(this.parent.decimal_symbol,
"."));q=-1;p=Infinity;for(var c=0,f=this.strValue.length;c<f;c++)b=g(a-parseFloat(this.evaluator.eval(this.strValue[c]))),b<=p&&(p=b,q=c);return q};r.prototype.changeValue=function(){this.activeIfValue&&(this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};r.prototype.addEvents=function(){var c=this;c.select.oncontextmenu=c.label.oncontextmenu=c.field.oncontextmenu=c.cover.oncontextmenu=function(){return!1};c.label.addEventListener("touchstart",a.preventDefault);c.label.addEventListener("mousedown",
a.preventDefault);this.select.addEventListener("change",function(a){c.value=c.evaluator.eval(c.strValue[this.selectedIndex]);c.field.value=c.formatOutputValue(c.value);c.evaluator.setVariable(c.id,c.field.value);c.changeValue();a.preventDefault()});this.field.addEventListener("keydown",function(a){13==a.keyCode&&(c.indexValue=c.getIndex(c.field.value),c.value=c.evaluator.eval(c.strValue[c.indexValue]),c.field.value=c.formatOutputValue(c.indexValue),c.select.selectedIndex=c.indexValue,c.changeValue())});
this.field.addEventListener("blur",function(a){c.drawIfValue&&c.changeValue(c.field.value,!0)});c.field.addEventListener("click",function(a){this.focus()});c.cover.addEventListener("click",function(a){a=c.evaluator.eval(c.kbexp);c.activeIfValue&&c.parent.keyboard.show(c,c.kblayout,a[0][0]||0,a[0][1]||0,c.id,c.field,c.onlyText)})};a.Menu=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.floor,e,d,q,p,b,k,m,c,l,f,v,r,u,y,n,h,x,w,z=function(c,b){b=a.Control.call(this,c,b)||this;b.label_color=b.label_color||new a.Color("e0e4e8",c.evaluator);b.label_text_color=b.label_text_color||new a.Color("000000",c.evaluator);b.name_str=b.name;b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name+"'");b.orientation=b.w>=b.h?"h":"v";b.container=a.newHTML("div",{class:"DescartesScrollbarContainer",
id:b.id});b.canvas=a.newHTML("canvas");b.divUp=a.newHTML("div",{class:"DescartesCatcher up"});b.divDown=a.newHTML("div",{class:"DescartesCatcher down"});b.field=a.newHTML("input",{type:"text",id:b.id+"scrollbar",class:"DescartesScrollbarField"});b.scrollHandler=a.newHTML("div",{class:"DescartesCatcher manipulator"});b.label=a.newHTML("canvas",{class:"DescartesScrollbarLabel"});b.label_ctx=b.label.getContext("2d");b.ratio=c.ratio;b.container.appendChild(b.canvas);b.container.appendChild(b.label);b.container.appendChild(b.divUp);
b.container.appendChild(b.divDown);b.container.appendChild(b.field);b.container.appendChild(b.scrollHandler);b.cover=a.newHTML("div",{class:"TextfieldCover"});b.keyboard&&b.visible&&b.container.appendChild(b.cover);b.addControlContainer(b.container);b.addEvents();b.init();return b};$jscomp.inherits(z,a.Control);z.prototype.init=function(){e=this.evaluator;0==e.eval(this.decimals)?this.incr=1:this.incr=(e.eval(this.max)-e.eval(this.min))/100;this.value=this.validateValue(e.eval(this.valueExpr));q=
this.formatOutputValue(this.value);p=this.evaluator.eval(this.expresion);this.x=p[0][0];this.y=p[0][1];4==p[0].length&&(this.w=p[0][2],this.h=p[0][3]);this.orientation=this.w>=this.h?"h":"v";this.initScroll(q);this.changeScrollPositionFromValue();this.prePos=this.pos;e.setVariable(this.id,this.value)};z.prototype.initScroll=function(c){d=this;e=d.evaluator;d.label.innerHTML=e.eval(d.name).toString();x=this.label.textContent;var b="v"===d.orientation?parseInt(19+5*(d.h-100)/100):d.h;d.fieldFontSize=
0<e.eval(d.font_size)?e.eval(d.font_size):"v"===d.orientation?b-parseInt(d.h/20)-1:a.getFieldFontSize(b);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},d.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),
0,0,!0);c=a.getTextWidth(c+"_",d.fieldFontSize+"px "+a.sansserif_font);var h=d.parent.getSpaceById(d.spaceID).h;d.labelHeight=""==x?0:b;d.fieldHeight=""==d.visible?0:b;if("v"===d.orientation)d.canvasWidth=d.w,d.canvasHeight=d.h-d.labelHeight-d.fieldHeight,18<=d.canvasHeight+d.y-h&&(d.canvasHeight=h),b=d.fieldHeight,c=b+d.canvasHeight,d.canvasX=0,d.canvasY=d.fieldHeight,d.labelWidth=d.w,d.labelY=c,d.upWidth=d.downW=d.w,d.upHeight=d.downH=d.w,d.upX=0,d.upY=d.fieldHeight,d.downX=0,d.downY=c-d.downH,
d.fieldWidth=d.w,d.fieldX=0,d.scrollHandlerW=d.w,d.scrollHandlerH=parseInt((d.canvasHeight-d.upHeight-d.downH-d.labelHeight-d.fieldHeight)/10),d.scrollHandlerH=d.canvasHeight-d.upHeight-d.downH-d.labelHeight-d.fieldHeight>2*d.w?d.w:d.scrollHandlerH,d.scrollHandlerH=15>d.scrollHandlerH?15:d.scrollHandlerH,d.limInf=c-d.downH-d.scrollHandlerH,d.limSup=b+d.downH;else{b=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);d.labelWidth=b;d.fieldWidth=c;""==x&&(d.labelWidth=0);d.visible||(d.fieldWidth=
0);for(c=d.w-d.fieldWidth-d.labelWidth;58>c&&0<d.labelWidth;)d.labelWidth--,c++;for(;58>c&&0<d.fieldWidth;)d.fieldWidth--,c++;b=d.labelWidth;h=b+c;d.fieldWidth=d.w-h;d.canvasWidth=c;d.canvasHeight=d.h;d.canvasX=d.labelWidth;d.canvasY=0;d.fieldX=d.canvasWidth+d.labelWidth;d.labelHeight=d.h;d.labelY=0;d.upWidth=d.downW=d.h;d.upHeight=d.downH=d.h;d.upX=h-d.downW;d.upY=0;d.downX=d.labelWidth;d.downY=0;d.scrollHandlerW=parseInt((d.canvasWidth-d.upWidth-d.downW)/10);d.scrollHandlerW=d.canvasWidth-d.upWidth-
d.downW>2*d.h?d.h:d.scrollHandlerW;d.scrollHandlerW=15>d.scrollHandlerW?15:d.scrollHandlerW;d.scrollHandlerH=d.h;d.limInf=b+d.downW;d.limSup=b+d.canvasWidth-d.downW-d.scrollHandlerW}d.container.setAttribute("style","width:"+d.w+"px;height:"+d.h+"px;left:"+d.x+"px;top:"+d.y+"px;z-index:"+d.zIndex+";");d.canvas.setAttribute("width",d.w+"px");d.canvas.setAttribute("height",d.h+"px");d.canvas.setAttribute("style","position:absolute;left:0;top:0;");d.ctx=d.canvas.getContext("2d");d.ctx.imageSmoothingEnabled=
!1;d.divUp.setAttribute("style","width:"+d.upWidth+"px;height:"+d.upHeight+"px;left:"+d.upX+"px;top:"+d.upY+"px;");d.divDown.setAttribute("style","width:"+d.downW+"px;height:"+d.downH+"px;left:"+d.downX+"px;top:"+d.downY+"px;");d.scrollHandler.setAttribute("style","width:"+d.scrollHandlerW+"px;height:"+d.scrollHandlerH+"px;left:"+("v"===d.orientation?0:d.limInf)+"px;top:"+("v"===d.orientation?d.limInf:0)+"px;");d.field.setAttribute("style","font-size:"+d.fieldFontSize+"px;width:"+d.fieldWidth+"px;height:"+
d.fieldHeight+"px;left:"+d.fieldX+"px;top:0;");d.cover.setAttribute("style","width:"+d.fieldWidth+"px;height:"+d.fieldHeight+"px;left:"+d.fieldX+"px;top:0;");0===d.fieldHeight&&(d.field.style.display="none");d.label.setAttribute("style","font-size:"+d.fieldFontSize+"px;width:"+d.labelWidth+"px;height:"+d.labelHeight+"px;line-height:"+d.labelHeight+"px;left:0;top:"+d.labelY+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.label.width=d.labelWidth*
this.ratio;this.label.height=d.labelHeight*this.ratio};z.prototype.update=function(){e=this.evaluator;0==e.eval(this.decimals)?this.incr=1:this.incr=(e.eval(this.max)-e.eval(this.min))/100;this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.drawIfValue?(this.container.style.display="block",this.draw()):this.container.style.display="none";this.updatePositionAndSize();var a=this.validateValue(e.getVariable(this.id));a==this.value||
0<Math.abs(a-this.value)&&1E-9>Math.abs(a-this.value)||(this.value=a,this.changeScrollPositionFromValue(),this.prePos=this.pos);this.value=a;this.field.value=this.formatOutputValue(this.value);e.setVariable(this.id,this.value);this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);!(w=this.label_color.getColor())||"CanvasGradient"!==w.constructor.name&&"CanvasPattern"!==
w.constructor.name||(this.label_ctx.fillStyle=w,this.label_ctx.fillRect(0,0,this.label_ctx.canvas.width,this.label_ctx.canvas.height));this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/
this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};z.prototype.draw=function(){d=this;b=d.ctx;m=g(this.w);k=g(this.h);b.fillStyle=this.color.getColor();b.fillRect(0,0,m,k);b.fillStyle="black";b.beginPath();"h"===d.orientation?(b.lineWidth=1,b.strokeStyle="rgba(0,0,0,0.3)",b.strokeRect(parseInt(d.labelWidth)+.5,.5,m-1-parseInt(d.labelWidth),k-1),b.lineWidth=Math.ceil(12*d.upWidth/100)||1,b.strokeStyle=d.colorInt.getColor(),b.moveTo(d.downX+62.215*d.upWidth/100,20*d.downH/100),b.lineTo(d.downX+
32.449*d.upWidth/100,d.downH/2),b.lineTo(d.downX+62.215*d.upWidth/100,80*d.downH/100),b.moveTo(d.upX+32.449*d.upWidth/100,20*d.downH/100),b.lineTo(d.upX+62.215*d.upWidth/100,d.downH/2),b.lineTo(d.upX+32.449*d.upWidth/100,80*d.downH/100),b.stroke(),l=g(d.pos),c=Math.ceil(k/10)||1,b.fillStyle=this.colorInt.getColor(),b.fillRect(l+.5,c,g(d.scrollHandlerW),k-2*c)):(b.lineWidth=1,b.strokeStyle="rgba(0,0,0,0.3)",b.strokeRect(.5,.5,m-1,k-parseInt(d.labelHeight)-.5),b.lineWidth=Math.ceil(12*d.upWidth/100)||
1,b.strokeStyle=d.colorInt.getColor(),b.moveTo(20*d.upWidth/100,d.h-d.labelHeight-70*d.downH/100),b.lineTo(50*d.upWidth/100,d.h-d.labelHeight-40.237*d.downH/100),b.lineTo(80*d.upWidth/100,d.h-d.labelHeight-70*d.downH/100),b.moveTo(20*d.upWidth/100,70*d.downH/100),b.lineTo(50*d.upWidth/100,40.237*d.downH/100),b.lineTo(80*d.upWidth/100,70*d.downH/100),b.stroke(),l=g(d.pos),c=Math.ceil(m/10)||1,b.fillStyle=this.colorInt.getColor(),b.fillRect(c,l+.5,m-2*c,g(d.scrollHandlerH)));d.activeIfValue||(b.fillStyle=
"rgba(255,255,255,0.5)",b.fillRect(0,0,b.canvas.width,b.canvas.height))};z.prototype.validateValue=function(a){e=this.evaluator;f=a.toString();f=parseFloat(f.replace(this.parent.decimal_symbol,"."));isNaN(f)&&(f=0);this.minimo=e.eval(this.min);f<this.minimo&&(this.value=null,f=this.minimo);this.maximo=e.eval(this.max);f>this.maximo&&(this.value=null,f=this.maximo);v=this.incr;f=0!=v?f*v/v:0;this.fixed&&(f=parseFloat(parseFloat(f).toFixed(e.eval(this.decimals))));return f};z.prototype.increase=function(){this.changeValue(parseFloat(this.value)+
this.incr)};z.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.incr)};z.prototype.increase10=function(){c=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x>this.prePos&&this.changeValue(parseFloat(this.value)+c):this.clickPos.y<this.prePos&&this.changeValue(parseFloat(this.value)+c)};z.prototype.decrease10=function(){c=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x<
this.prePos&&this.changeValue(parseFloat(this.value)-c):this.clickPos.y>this.prePos&&this.changeValue(parseFloat(this.value)-c)};z.prototype.changeValue=function(a){this.activeIfValue&&(r=this.validateValue(a),r!=this.value&&(this.value=r,this.field.value=this.formatOutputValue(r),this.changeScrollPositionFromValue(),this.prePos=this.pos,this.evaluator.setVariable(this.id,this.value)),this.updateAndExecAction())};z.prototype.changeValueForScrollMovement=function(){e=this.evaluator;u=this.limInf;y=
this.limSup;n=e.eval(this.min);h=e.eval(this.max);v=this.incr;r=g((this.pos-u)*(h-n)/(y-u)/v)*v+n;r!=this.value&&(this.value=r,this.field.value=this.formatOutputValue(r),e.setVariable(this.id,this.value),this.parent.updateControls(),this.actionExec.execute(),this.parent.update())};z.prototype.changeScrollPositionFromValue=function(){e=this.evaluator;u=this.limInf;y=this.limSup;n=e.eval(this.min);h=e.eval(this.max);v=this.incr;this.pos=(this.value-n)*(y-u)/(h-n)+u;this.scrollHandler.style["h"==this.orientation?
"left":"top"]=this.pos+"px"};z.prototype.addEvents=function(){function c(b,h,f,l){a.clearTimeout(u);(n.up||n.down||n.canvasClick)&&1E-7<Math.abs(n.value-l)&&(h.call(n),b=f?b:30,u=a.setTimeout(function(){c(b,h,!1,l)},b))}function b(b){b.preventDefault();n.whichBtn=a.whichBtn(b);"L"==n.whichBtn&&n.activeIfValue&&(n.clickPos=a.getCursorPosition(b,n.container),n.canvasClick=!0,"h"==n.orientation?n.clickPos.x<n.prePos?c(350,n.decrease10,!0,n.minimo):c(350,n.increase10,!0,n.maximo):n.clickPos.y<n.prePos?
c(350,n.increase10,!0,n.maximo):c(350,n.decrease10,!0,n.minimo))}function h(c){n.canvasClick=!1;a.clearTimeout(u)}function f(c){1==n.canvasClick&&(n.clickPos=a.getCursorPosition(c,n.container),c.preventDefault())}function l(a){n.scrollClick=!1;n.prePos=n.pos;window.removeEventListener("mouseup",l,!1);window.removeEventListener("mousemove",e,!1);a.preventDefault()}function d(a){n.scrollClick=!1;n.prePos=n.pos;window.removeEventListener("touchend",d,!1);window.removeEventListener("touchmove",e,!1);
a.preventDefault()}function e(c){var b=a.getCursorPosition(c,n.container);"h"==n.orientation?(n.pos=n.prePos-(n.initPos.x-b.x),n.pos<n.limInf&&(n.pos=n.limInf),n.pos>n.limSup&&(n.pos=n.limSup),n.scrollHandler.setAttribute("style","width:"+n.scrollHandlerW+"px;height:"+n.h+"px;left:"+n.pos+"px;top:0;")):(n.pos=n.prePos-(n.initPos.y-b.y),n.pos>n.limInf&&(n.pos=n.limInf),n.pos<n.limSup&&(n.pos=n.limSup),n.scrollHandler.setAttribute("style","width:"+n.w+"px;height:"+n.scrollHandlerH+"px;left:0;top:"+
n.pos+"px;"));n.changeValueForScrollMovement();c.preventDefault()}function g(b){b.preventDefault();n.whichBtn=a.whichBtn(b);"L"==n.whichBtn&&n.activeIfValue&&(n.up=!0,c(350,n.increase,!0,n.maximo))}function k(b){b.preventDefault();n.whichBtn=a.whichBtn(b);"L"==n.whichBtn&&n.activeIfValue&&(n.down=!0,c(350,n.decrease,!0,n.minimo))}function m(c){n.down=!1;a.clearTimeout(u);c.preventDefault()}function r(c){n.up=!1;a.clearTimeout(u);n.draw()}function p(c){n.down=!1;a.clearTimeout(u);n.draw()}var n=this,
u;n.canvas.oncontextmenu=n.divUp.oncontextmenu=n.divDown.oncontextmenu=n.label.oncontextmenu=n.field.oncontextmenu=n.scrollHandler.oncontextmenu=n.cover.oncontextmenu=function(){return!1};this.field.addEventListener("keydown",function(a){13==a.keyCode&&n.changeValue(n.field.value)});this.field.addEventListener("blur",function(a){n.drawIfValue&&n.changeValue(n.field.value,!0)});this.canvas.addEventListener("touchstart",b);this.canvas.addEventListener("mousedown",b);this.divDown.addEventListener("mouseout",
m);window.addEventListener("touchend",h);window.addEventListener("mouseup",h);this.canvas.addEventListener("touchmove",f);this.canvas.addEventListener("mousemove",f);this.scrollHandler.addEventListener("touchstart",function(c){n.activeIfValue&&(n.scrollClick=!0,n.initPos=a.getCursorPosition(c,n.container),window.addEventListener("touchend",d),window.addEventListener("touchmove",e),c.preventDefault())});this.scrollHandler.addEventListener("mousedown",function(c){n.activeIfValue&&(n.scrollClick=!0,
n.initPos=a.getCursorPosition(c,n.container),window.addEventListener("mouseup",l),window.addEventListener("mousemove",e),c.preventDefault())});this.divUp.addEventListener("touchstart",g);this.divUp.addEventListener("mousedown",g);this.divDown.addEventListener("touchstart",k);this.divDown.addEventListener("mousedown",k);this.divUp.addEventListener("mouseout",function(c){n.up=!1;a.clearTimeout(u);c.preventDefault()});this.divDown.addEventListener("mouseout",m);window.addEventListener("touchend",r);
window.addEventListener("mouseup",r);window.addEventListener("touchend",p);window.addEventListener("mouseup",p);n.cover.addEventListener("click",function(a){a=n.evaluator.eval(n.kbexp);n.activeIfValue&&n.parent.keyboard.show(n,n.kblayout,a[0][0]||0,a[0][1]||0,n.id,n.field,n.onlyText)})};a.Scrollbar=z;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d=function(d,e){var b=a.Control.call(this,d,e)||this;b.controls=e.controls||!0;b.file=e.file||"";b.oldDrawIf=0;d=b.evaluator.eval(b.expresion);4==d[0].length?(b.w=d[0][2],b.h=d[0][3]):(b.w=200,b.h=28);b.audio=b.parent.getAudio(b.file);b.oldFile=b.file;"]"===b.file.charAt(b.file.length-1)&&(b.file=b.evaluator.parser.parse(b.file.substring(1,b.file.length-1)));b.autoplay&&(b.audio.setAttribute("autoplay","autoplay"),b.audio.play());b.loop&&b.audio.setAttribute("loop",
"loop");b.controls&&b.audio.setAttribute("controls","controls");b.audio.setAttribute("style","position:absolute;width:"+b.w+"px;left:"+b.x+"px;top:"+b.y+"px;z-index:"+b.zIndex+";");b.addControlContainer(b.audio);b.evaluator.setFunction(b.id+".play",function(){try{b.audio.play()}catch(k){}return 0});b.evaluator.setFunction(b.id+".pause",function(){try{b.audio.pause()}catch(k){}return 0});b.evaluator.setFunction(b.id+".stop",function(){try{b.audio.pause(),b.audio.currentTime=0}catch(k){}return 0});
b.evaluator.setFunction(b.id+".currentTime",function(a){try{b.audio.currentTime=parseFloat(a)}catch(m){}return 0});b.audio.addEventListener("timeupdate",function(a){b.evaluator.setVariable(b.id+".currentTime",b.audio.currentTime);b.evaluator.setVariable(b.id+".playing",b.audio.paused?0:1);b.evaluator.setVariable(b.id+".duration",b.audio.duration)});return b};$jscomp.inherits(d,a.Control);d.prototype.init=function(){this.audio.style.left=this.x+"px";this.audio.style.top=this.y+"px";this.update()};
d.prototype.update=function(){g=this.evaluator;"string"!==typeof this.file&&(this.tmpFile=g.eval(this.file),this.oldFile!==this.tmpFile&&(this.oldFile=this.audio.src=this.tmpFile));(e=0<g.eval(this.drawif))?this.audio.style.display="block":(this.audio.style.display="none",e!==this.oldDrawIf&&this.audio.pause());this.oldDrawIf=e;this.updatePositionAndSize()};a.Audio=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d=function(d,e){var b=a.Control.call(this,d,e)||this;b.controls=e.controls||!0;b.file=e.file||"";b.oldDrawIf=0;g=b.evaluator;d=g.eval(b.expresion);4==d[0].length?(b.w=d[0][2],b.h=d[0][3]):(b.w=null,b.h=null);d=b.file;e=d.lastIndexOf(".");-1!=e&&(d=b.file.substring(0,e));b.video=a.newHTML("video",{poster:d+".png",style:"position:absolute;overflow:hidden;left:"+b.x+"px;top:"+b.y+"px;outline:none;background:rgba(0,0,0,0);"});b.autoplay&&b.video.setAttribute("autoplay",
"autoplay");b.loop&&b.video.setAttribute("loop","loop");b.controls&&b.video.setAttribute("controls","controls");b.w&&(b.video.setAttribute("width",b.w),b.video.setAttribute("height",b.h));b.video.canPlayType("video/mp4")&&(e=a.newHTML("source",{src:d+".mp4",type:"video/mp4"}),b.video.appendChild(e));b.video.canPlayType("video/ogg")&&(e=a.newHTML("source",{src:d+".ogg",type:"video/ogg"}),b.video.appendChild(e),e=a.newHTML("source",{src:d+".ogv",type:"video/ogg"}),b.video.appendChild(e));b.video.canPlayType("video/webm")&&
(e=a.newHTML("source",{src:d+".webm",type:"video/webm"}),b.video.appendChild(e));b.addControlContainer(b.video);g.setFunction(b.id+".play",function(){try{b.video.play()}catch(k){}return 0});g.setFunction(b.id+".pause",function(){try{b.video.pause()}catch(k){}return 0});g.setFunction(b.id+".stop",function(){try{b.video.pause(),b.video.currentTime=0}catch(k){}return 0});g.setFunction(b.id+".currentTime",function(a){try{b.video.currentTime=parseFloat(a)}catch(m){}return 0});b.video.addEventListener("timeupdate",
function(a){g.setVariable(b.id+".currentTime",b.video.currentTime)});return b};$jscomp.inherits(d,a.Control);d.prototype.init=function(){this.video.style.left=this.x+"px";this.video.style.top=this.y+"px";this.update()};d.prototype.update=function(){g=this.evaluator;(e=0<g.eval(this.drawif))?this.video.style.display="block":(this.video.style.display="none",e!==this.oldDrawIf&&this.video.pause());this.oldDrawIf=e;this.updatePositionAndSize()};a.Video=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q=function(d,b){var e=a.Control.call(this,d,b)||this;e.font_family=b.font_family||"Monospaced";e.style=b.style||",PLAIN,";e.font_size=b.font_size||12;typeof("number"!==e.font_size)&&(e.font_size=e.evaluator.eval(e.font_size));e.font=e.font_family+e.style+e.font_size;e.region="interior";e.tabindex=++e.parent.tabindex;if(e.answer){e.answer.match("krypto_")&&(e.answer=(new a.Krypto).decode(e.answer.substring(7)));var g=e.parent.lessonParser.parseText(e.answer)}e.containerControl=
a.newHTML("div",{class:"DescartesTextAreaContainer",id:e.id,spellcheck:"false"});e.textArea=a.newHTML("textarea",{class:"DescartesTextAreaContainer",spellcheck:"false"});e.textAreaAnswer=a.newHTML("div",{class:"DescartesTextAreaContainer"});e.showButton=a.newHTML("div",{class:"DJS_Gradient"});e.activeCover=a.newHTML("div");e.containerControl.appendChild(e.textArea);e.containerControl.appendChild(e.textAreaAnswer);e.containerControl.appendChild(e.showButton);e.containerControl.appendChild(e.activeCover);
e.cover=a.newHTML("div",{class:"TextfieldCover"});e.keyboard&&e.containerControl.appendChild(e.cover);e.addControlContainer(e.containerControl);e.showAnswer=!1;e.text=e.rawText||"";g&&"simpleText"!==g.type&&(e.answer=e.text.hasFormula?"":g.toHTML());e.evaluator.setVariable(e.id,e.text);var c;e.evaluator.setFunction(e.id+".insertAtCursor",function(a){c=e.textArea.selectionStart+a.length;e.textArea.value=e.textArea.value.substring(0,e.textArea.selectionStart)+a+e.textArea.value.substring(e.textArea.selectionEnd);
e.textArea.selectionStart=e.textArea.selectionEnd=c;e.textArea.focus();return 0});e.evaluator.setFunction(e.id+".update",function(){e.update()});e.addEvents();e.init();return e};$jscomp.inherits(q,a.Control);q.prototype.init=function(){e=this.answer?28:4;g=this.evaluator;var d=this.text.replace(/\\n/g,"\n");this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");var b="padding:5px;width:"+(this.w-4)+"px;height:"+
(this.h-e)+"px;left:2px;top:2px;background-color:white;text-align:left;font:"+a.convertFont(this.font)+";line-height:"+this.font_size+"px;";this.textArea.setAttribute("style",b);this.textArea.value=d;this.textAreaAnswer.setAttribute("style",b+"display:"+(this.showAnswer?"block":"none")+";");this.textAreaAnswer.innerHTML="<span>"+this.answer+"</span>";this.showButton.setAttribute("style","width:20px;height:16px;position:absolute;bottom:4px;right:4px;cursor:pointer;border:1px outset #f0f8ff;display:"+
(this.answer?"block":"none")+";");this.showButton.innerHTML='<span style="position:relative;top:1px;text-align:center;font:11px '+a.sansserif_font+';">S</span>';this.activeCover.setAttribute("style","position:absolute;width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;");this.cover.setAttribute("style",";position:absolute;width:"+this.w+"px;height:"+this.h+"px;left:0px;top:0px;");this.update()};q.prototype.update=function(){g=this.evaluator;this.activeIfValue=0<g.eval(this.activeif);
this.drawIfValue=0<g.eval(this.drawif);g.getVariable(this.id)!==this.oldValue&&(this.textArea.value=(g.getVariable(this.id)||"").replace(/\\n/g,"\n"));d=this.textArea.value||"";d="\n"===d.charAt(d.length-1)?d.substring(0,d.length-1):d;d=d.replace(/\n/g,"\\n").replace(/\s/g," ");g.setVariable(this.id,d);this.oldFieldValue=d;this.oldValue=g.getVariable(this.id);this.activeCover.style.display=this.activeIfValue?"none":"block";this.containerControl.style.display=this.drawIfValue?"block":"none";this.updatePositionAndSize()};
q.prototype.changeValue=function(a){this.textArea.value=a;this.update()};q.prototype.addEvents=function(){function a(a){a.preventDefault()}var b=this;b.cover.oncontextmenu=function(){return!1};b.showButton.addEventListener("mousedown",function(a){a.preventDefault();b.showAnswer=!b.showAnswer;b.textAreaAnswer.style.display=b.showAnswer?"block":"none";b.showButton.childNodes[0].childNodes[0].textContent=b.showAnswer?"T":"S"});b.showButton.addEventListener("mouseup",a);b.showButton.addEventListener("mouseout",
a);b.textArea.addEventListener("blur",function(){var a=window.getSelection();b.cursorInd=a.focusOffset});b.textArea.addEventListener("paste",function(a){a.preventDefault();document.execCommand("insertHTML",!1,a.clipboardData.getData("text/plain").replace(/\n/g,"<br>"))});b.textArea.addEventListener("keydown",function(a){if("PageDown"===a.key||"PageUp"===a.key)a.stopPropagation(),a.preventDefault()});b.cover.addEventListener("pointerdown",function(a){a=b.evaluator.eval(b.kbexp);console.log(a);b.activeIfValue&&
b.parent.keyboard.show(b,b.kblayout,a[0][0]||0,a[0][1]||0,b.id,b.textArea,!0)})};a.TextArea=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=2*Math.PI,e,d,q,p,b,k,m,c,l,f,v,r,u=function(c,b){var h=a.Control.call(this,c,b)||this;d=c.evaluator.parser;h.spaceID=b.spaceID||"";h.text=b.text||"";h.size=b.size||d.parse("4");h.font=b.font||"Serif,PLAIN,12";h.image=new Image;h.image.onload=function(){this.ready=1};h.imageSrc=b.imageSrc||"";h.imageSrc.match(/^\[.*\]?/)?h.imageSrc=h.parser.parse(h.imageSrc.substring(1,h.imageSrc.length-1)):h.imageSrc=h.parser.parse("'"+h.imageSrc+"'");h.font=a.convertFont(h.font);
if(h.constraintExpr){h.constraint=d.parse(h.constraintExpr);"(expr)"==h.constraint.type&&(h.constraint=d.parse(h.constraintExpr.substring(1,h.constraintExpr.length-1)));if("compOperator"==h.constraint.type){b=h.constraint.childs[0];var l=h.constraint.childs[1];"identifier"!=b.type||"y"!=b.value||l.contains("y")?"identifier"!=b.type||"x"!=b.value||l.contains("x")?h.newt=new a.R2Newton(h.evaluator,h.constraint):(h.constVar="y",h.noConstVar="x",h.evalConst=h.evalConstXoY,h.constraint=l):(h.constVar=
"x",h.noConstVar="y",h.evalConst=h.evalConstXoY,h.constraint=l)}else h.constraint=null;f=new a.R2(0,0)}h.container=h.getContainer();h.mouseCatcher=a.newHTML("div",{class:"DescartesGraphicControl",id:h.id,dragged:!0,tabindex:"-1",style:"cursor:pointer;background-color:transparent;z-index:"+h.zIndex+";"});h.ctx=h.space.ctx;h.container.appendChild(h.mouseCatcher);h.addEvents();h.xStr=h.id+".x";h.yStr=h.id+".y";h.activoStr=h.id+".activo";h.activeStr=h.id+".active";""!==h.space.id&&2!==c.version?(h.mxStr=
h.space.id+".mouse_x",h.myStr=h.space.id+".mouse_y",h.mclickedStr=h.space.id+".mouse_clicked",h.mclicizquierdoStr=h.space.id+".clic_izquierdo"):(h.mxStr="mouse_x",h.myStr="mouse_y",h.mclickedStr="mouse_clicked",h.mclicizquierdoStr="clic_izquierdo");h.init();return h};$jscomp.inherits(u,a.Control);u.prototype.init=function(c){e=this.evaluator;v=a.hasTouchSupport;c||(c=e.eval(this.expresion),this.x=c[0][0],this.y=c[0][1],e.setVariable(this.xStr,this.x),e.setVariable(this.yStr,this.y));this.img_src_eval=
e.eval(this.imageSrc).toString().trim();""==this.img_src_eval||this.img_src_eval.toLowerCase().match(/vacio.gif$/)?(this.width=2*e.eval(this.size),this.height=2*e.eval(this.size),this._w=v&&48>this.width?48:this.width,this._h=v&&48>this.height?48:this.height,this.mouseCatcher.style.borderRadius=parseInt(Math.min(this._w,this._h)/2)+"px"):(this.image=this.parent.getImage(this.img_src_eval),this.width=this.image.width,this.height=this.image.height,this._w=Math.max(this.width,32),this._h=Math.max(this.height,
32));this.mouseCatcher.style.width=this._w+"px";this.mouseCatcher.style.height=this._h+"px";this.mouseCatcher.style.left=parseInt(this.space.getAbsoluteX(this.x)-this._w/2)+"px";this.mouseCatcher.style.top=parseInt(this.space.getAbsoluteY(this.y)-this._h/2)+"px";e.setVariable(this.activoStr,0);e.setVariable(this.activeStr,0);this.setImage=!1;this.update()};u.prototype.update=function(){e=this.evaluator;e.eval(this.imageSrc).toString().trim()!==this.img_src_eval&&this.init(!0);this.activeIfValue=0<
e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);this.x=e.getVariable(this.xStr);this.y=e.getVariable(this.yStr);q=this.space.getAbsoluteX(this.x);p=this.space.getAbsoluteY(this.y);this.mouseCatcher.style.display=this.activeIfValue?"block":"none";this.mouseCatcher.style.left=parseInt(q-this._w/2)+"px";this.mouseCatcher.style.top=parseInt(p-this._h/2)+"px";this.constraint&&this.evalConst();this.draw()};u.prototype.draw=function(){e=this.evaluator;this.drawIfValue&&(c=this.ctx,l=this.space.backgroundCtx,
q=parseInt(this.space.getAbsoluteX(this.x))+.5,p=parseInt(this.space.getAbsoluteY(this.y))+.5,""!=this.text&&this.drawText(q,p),this.image.ready?(b=this.image.width/2,k=this.image.height/2,this.image.complete&&!this.setImage&&c.drawImage(this.image,parseInt(q-b),parseInt(p-k)),this.trace&&(l.save(),l.translate(q,p),l.scale(parseInt(b),parseInt(k)),l.beginPath(),l.arc(0,0,1,0,g),l.restore(),l.lineWidth=1,l.strokeStyle=this.trace.getColor(),l.stroke())):(b=parseInt(this.width/2),c.beginPath(),c.arc(q,
p,b,0,g),c.fillStyle=this.colorInt.getColor(),c.fill(),c.lineWidth=1,c.strokeStyle=this.color.getColor(),c.stroke(),this.active&&(c.strokeStyle=this.colorInt.borderColor(),c.beginPath(),c.arc(q,p,b-2,0,g),c.stroke()),this.trace&&(l.strokeStyle=this.trace.getColor(),l.beginPath(),l.arc(q,p,b,0,g),l.stroke())))};u.prototype.evalConst=function(){f.set(this.x,this.y);m=this.newt.findZero(f,1/this.space.scale,!0);this.x=m.x;this.y=m.y;this.evaluator.setVariable(this.xStr,this.x);this.evaluator.setVariable(this.yStr,
this.y)};u.prototype.evalConstXoY=function(){e=this.evaluator;r=e.getVariable(this.constVar);e.setVariable(this.constVar,this[this.constVar]);this[this.noConstVar]=e.eval(this.constraint);e.setVariable(this.xStr,this.x);e.setVariable(this.yStr,this.y);e.setVariable(this.constVar,r)};u.prototype.drawText=function(a,b){c=this.ctx;e=this.evaluator;"simpleText"==this.text.type?(c.fillStyle=this.color.getColor(),c.font=this.font,c.textBaseline="alphabetic",c.fillText(this.text.toString(e.eval(this.decimals),
this.fixed),parseInt(a+1+this.width/2),parseInt(b-1-this.height/2))):(c.fillStyle=this.color.getColor(),c.strokeStyle=this.color.getColor(),c.textBaseline="alphabetic",this.text.draw(c,parseInt(a+1+this.width/2),parseInt(b-1-this.height/2),this.decimals,this.fixed,"start",!0,this.color.getColor()))};u.prototype.getContainer=function(){for(var a=this.parent.spaces,c,b=0,f=a.length;b<f;b++)if(c=a[b],c.id==this.spaceID)return c.addCtr(this),this.zIndex=c.zIndex,this.space=c,c.graphicControlContainer;
a[0].addCtr(this);this.zIndex=a[0].zIndex;this.space=a[0];return a[0].graphicControlContainer};u.prototype.deactivate=function(){this.active=!1;this.evaluator.setVariable(this.activoStr,0);this.evaluator.setVariable(this.activeStr,0);this.evaluator.setVariable(this.mclicizquierdoStr,0)};u.prototype.addEvents=function(){function c(c){document.body.focus();c.preventDefault();d.whichBtn=a.whichBtn(c);"L"==d.whichBtn&&d.activeIfValue&&(d.parent.deactivateGraphicControls(),d.click=d.active=!0,d.evaluator.setVariable(d.activoStr,
1),d.evaluator.setVariable(d.activeStr,1),d.evaluator.setVariable(d.mclickedStr,0),d.evaluator.setVariable(d.mclicizquierdoStr,0),d.posAnte=a.getCursorPosition(c,d.container),d.prePos={x:d.space.getAbsoluteX(d.x),y:d.space.getAbsoluteY(d.y)},d.evaluator.setVariable(d.mxStr,d.space.getRelativeX(d.posAnte.x)),d.evaluator.setVariable(d.myStr,d.space.getRelativeY(d.posAnte.y)),d.parent.update(),window.addEventListener("touchend",b),window.addEventListener("touchmove",h),window.addEventListener("mouseup",
b),window.addEventListener("mousemove",h))}function b(c){document.body.focus();c.preventDefault();c.stopPropagation();d.evaluator.setVariable(d.mclickedStr,1);d.evaluator.setVariable(d.mclicizquierdoStr,1);if(d.activeIfValue||d.active)d.click=!1,window.removeEventListener("mouseup",b),window.removeEventListener("mousemove",h),window.removeEventListener("touchend",b),window.removeEventListener("touchmove",h),l=a.getCursorPosition(c,d.container)||l,d.posX=d.prePos.x-(d.posAnte.x-l.x),d.posY=d.prePos.y-
(d.posAnte.y-l.y),d.evaluator.setVariable(d.xStr,d.space.getRelativeX(d.posX)),d.evaluator.setVariable(d.yStr,d.space.getRelativeY(d.posY)),d.evaluator.setVariable(d.mxStr,d.space.getRelativeX(l.x)),d.evaluator.setVariable(d.myStr,d.space.getRelativeY(l.y)),d.parent.updateControls(),d.parent.update(),d.mouseCatcher.style.left=d.space.getAbsoluteX(d.x)-d._w/2+"px",d.mouseCatcher.style.top=d.space.getAbsoluteY(d.y)-d._h/2+"px";c=d.evaluator.getVariable(d.activeStr);d.parent.deactivateGraphicControls();
d.parent.updateControls();d.evaluator.setVariable(d.activoStr,c);d.evaluator.setVariable(d.activeStr,c);d.parent.update()}function h(c){c.preventDefault();d.evaluator.setVariable(d.mclickedStr,0);d.evaluator.setVariable(d.mclicizquierdoStr,0);l=a.getCursorPosition(c,d.container);d.posX=d.prePos.x-(d.posAnte.x-l.x);d.posY=d.prePos.y-(d.posAnte.y-l.y);d.evaluator.setVariable(d.xStr,d.space.getRelativeX(d.posX));d.evaluator.setVariable(d.yStr,d.space.getRelativeY(d.posY));d.evaluator.setVariable(d.mxStr,
d.space.getRelativeX(l.x));d.evaluator.setVariable(d.myStr,d.space.getRelativeY(l.y));80<Date.now()-f&&(d.parent.updateControls(),d.parent.update(),f=Date.now())}var f=0,l,d=this;this.active=this.over=this.click=!1;this.mouseCatcher.oncontextmenu=function(){return!1};this.mouseCatcher.addEventListener("touchstart",c);this.mouseCatcher.addEventListener("mousedown",c);this.mouseCatcher.addEventListener("mouseover",function(a){d.over=!0});this.mouseCatcher.addEventListener("mouseout",function(a){d.over=
!1;d.click=!1})};a.GraphicControl=u;return a}(descartesJS||{});
descartesJS=function(a,g){var e,d,q,p,b,k,m,c,l,f;function v(a){return a.charAt(0).toUpperCase()+a.substring(1)}if(a.loadLib)return a;var r=/[\w-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,u,y,n,h,x,w,z,A,E,J,F,G,D,B,L,H,M,P,I,O,C,Q,K,R,N,S,W,V,U,T=function(c){this.parent=c;this.parser=c.evaluator.parser;this.RTFparser=new a.RTFParser(c.evaluator)};T.prototype.parseButtonsConfig=function(a){var c={rowsNorth:0,rowsSouth:0,widthEast:125,widthWest:125,height:23};a=this.split(a);for(var b=0,f=a.length;b<
f;b++)switch(n=a[b][0],h=a[b][1],y=g[n],y){case "rowsNorth":case "rowsSouth":case "widthEast":case "widthWest":case "height":c[y]=parseInt(h);break;case "about":case "config":case "init":case "clear":c[y]="true"===g[h];break;default:console.warn("Propiedad de botones no identificada: <"+n+"> valor: <"+h+">")}return c};T.prototype.parseSpace=function(c){x={};c=this.split(c);for(var b=0,f=c.length;b<f;b++)switch(n=c[b][0],h=c[b][1],y=g[n],a.DEBUG.paramName=n,a.DEBUG.objectName="Space",y){case "type":if("R2"===
h||"R3"===h)h=g[h];x[y]=h;break;case "id":a.DEBUG.idName=h;case "x_axis":case "y_axis":case "cID":case "file":case "border_width":case "border_radius":case "info":x[y]=h;break;case "fixed":case "numbers":case "sensitive_to_mouse_movements":case "3D":case "split":case "resizable":x[y]="true"===g[h];break;case "bg_display":case "render":x[y]=g[h];break;case "border_color":case "net":case "net10":case "axes":case "text":x[y]=""!=h?"false"===g[h]?"":new a.Color(h,this.parent.evaluator):"";break;case "O.x":x.OxExpr=
h;break;case "O.y":x.OyExpr=h;break;case "image":x.imageSrc=h;break;case "x":u=h;"%"===u[u.length-1]?(x.xPercentExpr=u.trim(),u=(this.parent.container.width*parseFloat(u)/100).toString()):u=h;x.xExpr=this.parser.parse(u);break;case "y":u=h;"%"===u[u.length-1]?(x.yPercentExpr=u.trim(),u=(this.parent.container.height*parseFloat(u)/100).toString()):u=h;x.yExpr=this.parser.parse(u);break;case "width":u=h.trim();x.wModExpr=u;"%"===u[u.length-1]?(x.wExpr=u,u=this.parent.container.width*parseFloat(u)/100):
(u=parseFloat(h),u!=h&&(u=this.parent.container.width,x._w_=h.trim()));x.w=u;break;case "height":u=h.trim();x.hModExpr=u;"%"===u[u.length-1]?(x.hExpr=u,u=this.parent.container.height*parseFloat(u)/100):(u=parseFloat(h),u!=h&&(u=this.parent.container.height,x._h_=h.trim()));x.h=u;break;case "drawif":""!=h&&(x.drawif=this.parser.parse(h));break;case "scale":u=parseFloat(h);isNaN(u)&&(u=48);x.scale=u;break;case "background":x.background=new a.Color(h,this.parent.evaluator);break;default:console.warn("Propiedad del espacio no identificada: <"+
n+"> valor: <"+h+">")}return new a["Space"+x.type](this.parent,x)};T.prototype.parseControl=function(c){w={type:"Numeric",gui:"Spinner"};c=this.split(c);for(var b=0,f=c.length;b<f;b++)switch(n=c[b][0],h=c[b][1],y=g[n],a.DEBUG.paramName=n,a.DEBUG.objectName="Control",y){case "type":u=g[h.trim()];"graphic"===u?u="GraphicControl":"text"===u&&(u="TextArea");w.type=v(u);break;case "gui":u=g[h];"textfield"===u&&(u="TextField");w[y]=v(u);break;case "id":a.DEBUG.idName=h;case "name":case "parameter":case "tooltip":case "tooltipFont":case "Explanation":case "ExplanationFont":case "cID":case "options":case "font":case "font_family":case "file":case "answer":case "cssClass":case "radio_group":case "extra_style":case "kblayout":case "info":w[y]=
h;break;case "region":case "position":case "action":case "msg_pos":case "poster":case "text_align":case "image_align":case "btn_pos":w[y]=g[h];break;case "fixed":case "visible":case "discrete":case "onlyText":case "evaluate":case "autoplay":case "loop":case "controls":case "flat":case "keyboard":w[y]="true"===g[h];break;case "color":case "colorInt":case "label_color":case "label_text_color":case "trace":w[y]=new a.Color(h,this.parent.evaluator);break;case "font_size":case "drawif":case "activeif":case "decimals":case "min":case "max":case "size":""!==
h&&(w[y]=this.parser.parse(h));break;case "constraint":w.constraintExpr=h;break;case "image":w.imageSrc=h;break;case "image_dec":w.image_dec_src=h;break;case "image_inc":w.image_inc_src=h;break;case "space":w.spaceID=h;break;case "expresion":w.expresion=this.parser.parse(h.replace(")(",","));case "kbexp":w.kbexp=this.parser.parse(h.replace(")(",","));break;case "borderColor":w[y]="false"===g[h]?"":h;break;case "bold":"false"!=g[h]&&(w.bold="bold");break;case "italics":"false"!=g[h]&&(w.italics="italic");
break;case "underlined":"false"!=g[h]&&(w.underlined=!0);break;case "value":var d=h.replace(/&squot;/g,"'");d.match(/^\|/)&&(d="'"+d.substring(1),d.match(/\|$/)&&(d=d.substring(0,d.length-1)+"'"));w.valueExpr=this.parser.parse(d);w.valueExprString=d;break;case "incr":0!=h&&(w.incr=this.parser.parse(h));break;case "exponentialif":w.exponentialif=parseFloat(h);break;case "text":w.rawText=h;d=this.parseText(h);for(var l=0,e=d.length;l<e;l++)d[l]=this.parser.parse(d[l],!1);w.text=d;break;default:l=n.indexOf("."),
d=g[n.substring(0,l)],l=g[n.substring(l+1)],"parameter"===d&&"font"===l?w.parameterFont=h:"Explanation"===d&&"font"===l?w.ExplanationFont=h:"tooltip"===d&&"font"===l?w.tooltipFont=h:console.warn("Propiedad de control no identificada: <"+n+"> valor: <"+h+">")}return new a["Numeric"===w.type?w.gui:w.type](this.parent,w)};T.prototype.parseGraphic=function(c,b,f,d){z={rotateExp:d,parameter:"t"};c=this.split(c);d=0;for(var l=c.length;d<l;d++)if(n=c[d][0],h=c[d][1],y=g[n],a.DEBUG.paramName=n,a.DEBUG.objectName=
"Graphic",""!=h)switch(y){case "type":a.DEBUG.idName=h;z[y]=v(g[h]);break;case "align":case "anchor":case "lineDash":z[y]=g[h];break;case "background":case "abs_coord":case "visible":case "editable":case "fixed":case "vectors":case "bold":case "italics":case "underlined":z[y]="true"===g[h];break;case "shadowColor":case "color":case "fill":case "fillP":case "fillM":case "arrow":case "trace":z[y]="false"===g[h]?"":new a.Color(h,this.parent.evaluator);break;case "border_size":case "shadowBlur":case "shadowOffsetX":case "shadowOffsetY":case "family":case "parameter":case "info":case "font":case "font_family":case "name":case "init":case "end":z[y]=
h;break;case "drawif":case "width":case "decimals":case "size":case "spear":case "center":case "radius":case "border_radius":case "opacity":case "inirot":case "inipos":case "range":case "clip":""!==h&&(z[y]=this.parser.parse(h));break;case "font_size":h=h.trim();h.match(/^\[.*\]?/)&&(h=h.substring(1,h.length-1));""!==h&&(z[y]=this.parser.parse(h));break;case "space":z.spaceID=h;break;case "expresion":""!==h&&("Macro"!==z.type?(z.expresion=this.parser.parse(h),z.expresionString=h):z.expresion=h);break;
case "text":z.text=h;break;case "file":var e=h.replace(/&squot;/g,"'").trim();"["===e.charAt(0)&&"]"===e.charAt(e.length-1)&&(e=e.substring(1,e.length-1));e.match(r)&&(e="'"+e+"'");z.file=this.parser.parse(e);break;case "border":""!=h&&"false"!=g[h]&&(z.border=new a.Color(h,this.parent.evaluator));break;default:if(void 0!=z.family&&n.substring(0,z.family.length+1)===z.family+".")switch(g[n.substring(z.family.length+1)]){case "interval":""!=h&&(z.family_interval=this.parser.parse(h));break;case "steps":""!=
h&&(z.family_steps=this.parser.parse(h))}else if(void 0!=z.parameter&&n.match(z.parameter+"."))switch(z.parameter!==n.substring(0,n.indexOf(z.parameter)+z.parameter.length)&&(z.parameter=n.substring(0,n.indexOf(z.parameter)+z.parameter.length)),g[n.substring(z.parameter.length+1)]){case "interval":""!=h&&(z.parameter_interval=this.parser.parse(h));break;case "steps":""!=h&&(z.parameter_steps=this.parser.parse(h))}else console.warn("Propiedad del gr\u00e1fico no identificada: <"+n+"> valor: <"+h+">")}b&&
(z.abs_coord=b);f&&(z.background=f);return new a[z.type](this.parent,z)};T.prototype.parse3DGraphic=function(c,b,f,d){z={rotateExp:d,parameter:"t"};c=this.split(c);b=0;for(f=c.length;b<f;b++)switch(n=c[b][0],h=c[b][1],y=g[n],a.DEBUG.paramName=n,a.DEBUG.objectName="Graphic3D",y){case "type":a.DEBUG.idName=h;u=g[h];switch(u){case "cube":case "box":case "tetrahedron":case "octahedron":case "sphere":case "dodecahedron":case "icosahedron":case "ellipsoid":case "cone":case "cylinder":case "torus":case "mesh":z.subType=
u,u="OtherGeometry"}z[y]=v(u);break;case "model":case "align":case "anchor":case "lineDash":z[y]=g[h];break;case "shadowColor":case "fill":z[y]="false"===g[h]?"":new a.Color(h,this.parent.evaluator);break;case "background":case "fixed":case "split":case "bold":case "italics":case "underlined":z[y]="true"===g[h];break;case "edges":"false"===g[h]?z[y]="":("true"===g[h]&&(h="808080"),z[y]=new a.Color(h,this.parent.evaluator));break;case "border":""!=h&&"false"!=g[h]&&(z.border=new a.Color(h,this.parent.evaluator));
break;case "color":case "backcolor":z[y]=new a.Color(h,this.parent.evaluator);break;case "drawif":case "width":case "length":case "height":case "R":case "r":case "decimals":case "Nu":case "Nv":case "inipos":case "endpos":case "offset_angle":case "offset_dist":case "font_size":""!=h&&(z[y]=this.parser.parse(h));break;case "border_size":case "shadowBlur":case "shadowOffsetX":case "shadowOffsetY":case "family":case "parameter":case "font":case "font_family":case "name":case "inirot":case "endrot":case "info":z[y]=
h;break;case "space":z.spaceID=h;break;case "expresion":"Macro"!=z.type&&"Curve"!=z.type&&"Surface"!=z.type?(z.expresion=this.parser.parse(h),z.expresionString=h):z.expresion=h.replace(/\\n/g,";");break;case "text":z.text=h;break;case "file":d=h.replace(/&squot;/g,"'");"["===d.charAt(0)&&"]"===d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));d.match(/./)&&(d="'"+d+"'");z.file=this.parser.parse(d);break;default:void 0!==z.family&&n.substring(0,z.family.length+1)===z.family+"."?"interval"===g[n.substring(z.family.length+
1)]?""!=h&&(z.family_interval=this.parser.parse(h)):""!=h&&(z.family_steps=this.parser.parse(h)):console.warn("Propiedad del gr\u00e1fico 3D no identificada: <"+n+"> valor: <"+h+">")}return new a[z.type+"3D"](this.parent,z)};T.prototype.parseAuxiliar=function(c){A={};c=this.split(c);for(var b=0,f=c.length;b<f;b++)c[b][1]=c[b][1].replace(/&squot;/g,"'");b=0;for(f=c.length;b<f;b++)switch(n=c[b][0],h=c[b][1],y=g[n],a.DEBUG.paramName=n,a.DEBUG.objectName="Auxiliar",y){case "info":case "code":case "doc":break;
case "id":a.DEBUG.idName=h;case "file":case "init":case "doExpr":case "whileExpr":case "range":case "local":case "expresion":case "condition":case "parameter":A[y]=h.replace(/&squot;/g,"'");break;case "editable":case "constant":case "array":case "matrix":case "algorithm":case "event":case "sequence":A[y]="true"===g[h];break;case "size":case "rows":case "columns":case "x":case "y":case "width":case "height":A[y]=this.parser.parse(h);break;case "evaluate":case "execution":case "msg_pos":case "action":case "type":A[y]=
g[h];break;default:var d=n.indexOf("."),l=g[n.substring(0,d)];d=g[n.substring(d+1)];"parameter"===l&&"font"===d?A.parameterFont=h:console.warn("Propiedad del auxiliar no identificada: <"+n+"> valor: <"+h+">")}A.sequence?A.type="sequence":A.constant?A.type="constant":A.algorithm&&A.evaluate?A.type="algorithm":A.array&&!A.matrix&&")"!=A.id.charAt(A.id.length-1)?A.type="vector":A.matrix&&")"!=A.id.charAt(A.id.length-1)?A.type="matrix":A.event&&")"!=A.id.charAt(A.id.length-1)?A.type="event":"library"===
A.type?A.type="library":")"===A.id.charAt(A.id.length-1)?A.type="function":A.type="variable";a.DEBUG.typeName=A.type;switch(A.type){case "sequence":new a.Function(this.parent,A);break;case "constant":c=new a.Constant(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(c);break;case "algorithm":this.parent.auxiliaries.push(new a.Algorithm(this.parent,A));break;case "vector":c=new a.Vector(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(c);break;
case "matrix":c=new a.Matrix(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(c);break;case "event":this.parent.events.push(new a.Event(this.parent,A));break;case "library":new a.Library(this.parent,A);break;case "variable":new a.Variable(this.parent,A);break;default:new a.Function(this.parent,A)}};T.prototype.parseAction=function(c){E=c.action;J=c.parent;F=c.parameter;return E?new (a[v(E)])(J,F):{execute:function(){}}};T.prototype.parseAnimation=function(c){var b={};
c=this.split(c);for(var f=0,d=c.length;f<d;f++)switch(n=c[f][0],h=c[f][1],y=g[n],y){case "id":case "delay":case "init":case "doExpr":case "whileExpr":b[y]=h.replace(/&squot;/g,"'");break;case "controls":case "auto":case "loop":case "algorithm":case "evaluate":b[y]="true"===g[h];break;default:console.warn("Propiedad de la animaci\u00f3n no identificada: <"+n+">  <"+h+">")}return new a.Animation(this.parent,b)};T.prototype.parsePleca=function(g,r){g=this.split(g);d=e="";q=0;p="#536891";b="white";k=
"left";m="";c="SansSerif,BOLD,20";l="SansSerif,PLAIN,18";f=void 0;for(var u=0,v=g.length;u<v;u++)switch(n=g[u][0],h=g[u][1],n){case "title":e=h;break;case "subtitle":d=h;break;case "subtitlines":q=h;break;case "bgcolor":""!=h&&(p=(new a.Color(h,this.parent.evaluator)).getColor());break;case "fgcolor":""!=h&&(b=(new a.Color(h,this.parent.evaluator)).getColor());break;case "align":""!=h&&(k=h);break;case "titleimage":m=h;break;case "titlefont":c=""!=h?a.convertFont(h):a.convertFont(c);break;case "subtitlefont":l=
""!=h?a.convertFont(h):a.convertFont(l);break;default:console.warn("Propiedad de la pleca no identificada: <"+n+">  <"+h+">")}if(""===e&&""===d)return a.newHTML("div");P=l.substring(0,l.indexOf("px"));P=P.substring(P.lastIndexOf(" "));""!=m&&(I=this.parent.getImage(m),O=I.height);f=a.newHTML("div",{id:"descartesPleca"});O?(f.setAttribute("style","position:absolute;left:0;top:0;text-align:"+k+";width:"+r+"px;height:"+O+"px;background-color:"+p+";color:"+b+";padding-top:8px;padding:8px 15px 8px 15px;margin:0;overflow:hidden;z-index:1;"),
I.setAttribute("style","position: absolute;left:0;top:0;z-index:-1;width:100%;height:100%;"),f.appendChild(I)):f.setAttribute("style","position:absolute;left:0;top:0;text-align:"+k+";width:"+r+"px;background:"+p+";color:"+b+";padding:12px 15px 12px 15px;margin:0;z-index:100;");C=a.newHTML("div",{style:"padding:0;margin:0;font:"+c+";overflow:hidden;white-space:nowrap;"});C.innerHTML=e;Q=a.newHTML("div");if(1===parseInt(q)){W=0;K=a.newHTML("div");K.innerHTML=d;document.body.appendChild(K);N=P;do N-=
W,K.setAttribute("style","padding:0;margin:0;font:"+l+";font-size:"+N+"px;width:"+(r-30)+"px;line-height:"+N+"px;"),R=K.offsetHeight,S=R/N,W=1;while(1<S&&8<N);document.body.removeChild(K);Q.setAttribute("style","padding:0;margin:0;font:"+l+";font-size:"+N+"px;line-height:1em;overflow:hidden;white-space:nowrap;")}else Q.setAttribute("style","padding:0;margin:0;font:"+l+";line-height:1em;");Q.innerHTML=d;f.appendChild(C);f.appendChild(Q);f.imageHeight=O;return f};T.prototype.split=function(a){if("string"!==
typeof a)return[];G=[];a=(a||"").replace(/\\'/g,"\u2019");D=B=H=0;for(L=M=!1;D<a.length;)" "!==a.charAt(D)||L||D++," "===a.charAt(D)||L||(L=!0,H=D),"="!==a.charAt(D)||"'"!==a.charAt(D+1)||M||(M=!0,G[B]=[a.substring(H,D)],H=D+2,D+=2),M&&"'"===a.charAt(D)&&(L=M=!1,G[B].push(a.substring(H,D)),B++),"="!==a.charAt(D)||"'"===a.charAt(D+1)||M||(G[B]=[a.substring(H,D)],H=D+1,D++,V=a.substring(D).indexOf("="),-1===V?U=V=a.length:(V+=D,U=a.substring(D,V).lastIndexOf(" "),U=-1===U?a.length:U+D),G[B].push(a.substring(H,
U)),B++,L=!1,D=U),D++;return G};T.prototype.parseText=function(c){c=c||"";return c.match(/^\{\\rtf1/)?this.RTFparser.parse(c.substring(10)):new a.SimpleText(this.parent,c)};a.LessonParser=T;return a}(descartesJS||{},babel);
descartesJS=function(a){function g(a,c){if(0==c)return 1;if(0>c)return NaN;if(0<=a||k(c)===c)return Math.pow(a,c);if(0>a){var b=1/c,h=k(b);if(h===b&&1===h%2)return-Math.pow(-a,c)}return NaN}function e(a,c){y=[];y.type="matrix";y.rows=a;y.cols=c;h=0;for(x=c;h<x;h++)y[h]=Array(a).fill(0);return y}function d(a,c){r=a.rows;u=a.cols;y=e(r,u);var b;for(h=0;h<r;h++)for(n=0;n<u;n++){for(x=b=0;x<u;x++)b+=a[x][h]*c[n][x];y[n][h]=b}return y}function q(a,c,b){for(var h=e(b.length-1,b.length-1),f=0,d=h.length;f<
d;f++)for(var l=0;l<d;l++)h[f][l]=f<a?l<c?b[f][l]:b[f][l+1]:f<c?b[f+1][l]:b[f+1][l+1];return h}function p(a){if(1<a.cols){for(var c=0,b=1,h=0,f=a.cols;h<f;h++)c+=b*a[0][h]*p(q(0,h,a)),b=-b;return c}return a[0][0]}if(a.loadLib)return a;var b={},k=Math.floor,m,c,l,f,v,r,u,y,n,h,x,w=function(a,c){this.sep="";this.type=a;this.value=c;this.parent=null;this.childs=[]};w.prototype.getRoot=function(){return null===this.parent?this:this.parent.getRoot()};w.prototype.addChild=function(a){a.parent=this;this.childs.push(a)};
w.prototype.replaceLastChild=function(a){l=this.childs.length-1;c=this.childs[l];c.parent=null;this.childs[l]=a;a.parent=this;return a};w.prototype.contains=function(a){if(this.value===a)return!0;for(var c=0,b=this.childs.length;c<b;c++)if(this.childs[c].contains(a))return!0;return!1};w.prototype.equalToMinus=function(){return"compOperator"===this.type?(this.type="operator",this.value="-",v=new w("compOperator","=="),v.addChild(this),v.addChild(new w("number","0")),f=this.getRoot(),f.setAllEvalFun(),
f):this};w.prototype.getChildren=function(){if("(expr)"===this.type||"[expr]"===this.type){if(this.childArray)return this.childArray;this.childArray=[];for(var a=0,c=this.childs.length;a<c;a++)if("square_bracket"===this.childs[a].type||"parentheses"===this.childs[a].type)this.childArray=this.childArray.concat(this.childs[a].childs);return this.childArray}return null};w.prototype.setAllEvalFun=function(){this.setEvalFun();for(var a=0,c=this.childs.length;a<c;a++)this.childs[a].setAllEvalFun()};w.prototype.setEvalFun=
function(){if("number"===this.type)this.evaluate=function(){return parseFloat(this.value)};else if("string"===this.type)this.evaluate=function(){return this.value.replace(/\\u0027/g,"'")};else if("identifier"===this.type&&0===this.childs.length)if("rnd"===this.value)this.evaluate=function(){return Math.random()};else{var c;this.evaluate=function(a,b){c=a.variables[this.value];if("object"===typeof c&&void 0==c.length)return c.evaluate(a);void 0==c&&(b||a.matrices[this.value]?c=a.matrices[this.value]:
a.vectors[this.value]&&(c=a.vectors[this.value]));return void 0!==c?c:0}}else if("identifier"===this.type&&"square_bracket"===this.childs[0].type&&1===this.childs[0].childs.length){var f;this.evaluate=function(a){try{return f=a.getVector(this.value,this.childs[0].childs[0].evaluate(a)),void 0!==f?f:0}catch(M){return 0}}}else if("identifier"===this.type&&"square_bracket"===this.childs[0].type&&1<this.childs[0].childs.length)this.evaluate=function(a){try{return f=a.getMatrix(this.value,this.childs[0].childs[0].evaluate(a),
this.childs[0].childs[1].evaluate(a)),void 0!==f?f:0}catch(M){return 0}};else if("identifier"===this.type&&"parentheses"===this.childs[0].type){var l,v,x;this.evaluate=function(a){l=[];for(var c=0,h=this.childs[0].childs.length;c<h;c++)l[c]=this.childs[0].childs[c].evaluate(a);if("_Eval_"===this.value){m=0<l.length?l[0]:0;if("number"==typeof m)return"NaN";m.match(",")&&parseFloat(m.replace(",","."))==m.replace(",",".")&&(m=m.replace(",","."));if(void 0==b[m]){v=m.match(/:=/g)?!0:!1;if(m.match(";")){var f=
!1,d=[],e=0;c=0;for(h=m.length;c<h;c++){var g=m.charAt(c);"'"===g&&(f=!f);f||";"!==g||(d.push(m.substring(e,c)),e=c+1)}d.push(m.substring(e));m="("+d.join(")(")+")"}b[m]=a.parser.parse(m,v)}x=a.eval(b[m]);return void 0!=x?x:NaN}return a.functions[this.value].apply(a,l)}}else if("operator"===this.type)"+"===this.value?this.evaluate=function(c){var b=this.childs[0].evaluate(c,!0);c=this.childs[1].evaluate(c,!0);if("matrix"!==b.type||"matrix"!==c.type)return"number"==typeof b&&"string"==typeof c?b=a.removeNeedlessDecimals(b.toString()):
"string"==typeof b&&"number"==typeof c&&(c=a.removeNeedlessDecimals(c.toString())),b+c;r=b.rows;u=b.cols;y=e(r,u);for(h=0;h<r;h++)for(n=0;n<u;n++)y[n][h]=b[n][h]+c[n][h];return y}:"-"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==c.type||"matrix"!==a.type)return c-a;r=c.rows;u=c.cols;y=e(r,u);for(h=0;h<r;h++)for(n=0;n<u;n++)y[n][h]=c[n][h]-a[n][h];return y}:"*"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a,
!0);a=this.childs[1].evaluate(a,!0);return"matrix"!==c.type||"matrix"!==a.type?c*a:d(c,a)}:"/"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==c.type||"matrix"!==a.type)return c/a;var b=e(a.length,a.length),h=p(a);if(0===h)a=0;else{h=1/h;if(1<a.length)for(var f=0,l=a.length;f<l;f++){var g=h;for(var m=0;m<l;m++)b[m][f]=g*p(q(f,m,a)),g=-g;h=-h}else b[0][0]=h;a=b}c=0===a?e(c.rows,c.cols):d(c,a);return c}:"%"===this.value?this.evaluate=
function(a){var c=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return c-k(c/a)*a}:"^"===this.value&&(this.evaluate=function(a){var c=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return 0<=a?g(c,a):1/g(c,-a)});else if("compOperator"===this.type)"<"===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)<this.childs[1].evaluate(a))}:"<="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)<=this.childs[1].evaluate(a))}:">"===this.value?this.evaluate=
function(a){return+(this.childs[0].evaluate(a)>this.childs[1].evaluate(a))}:">="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)>=this.childs[1].evaluate(a))}:"=="===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return"number"==typeof c&&"number"==typeof a?+(1E-8>Math.abs(c-a)):+(c===a)}:"!="===this.value&&(this.evaluate=function(a){var c=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return"number"==typeof c&&
"number"==typeof a?+!(1E-8>Math.abs(c-a)):+(c!==a)});else if("boolOperator"===this.type)"&"===this.value?this.evaluate=function(a){return this.childs[0].evaluate(a)?this.childs[1].evaluate(a)?1:0:0}:"|"===this.value?this.evaluate=function(a){return this.childs[0].evaluate(a)?1:this.childs[1].evaluate(a)?1:0}:"!"===this.value&&(this.evaluate=function(a){return+!this.childs[0].evaluate(a)});else if("conditional"===this.type)this.evaluate=function(a){return 0<this.childs[0].evaluate(a)?this.childs[1].evaluate(a):
this.childs[2]?this.childs[2].evaluate(a):0};else if("sign"===this.type)this.evaluate="sign+"===this.value?function(a){return this.childs[0].evaluate(a)}:function(a){return-this.childs[0].evaluate(a)};else if("parentheses"===this.type)this.evaluate=function(a,c){return this.childs[0].evaluate(a,c)};else if("(expr)"===this.type||"[expr]"===this.type)this.evaluate=function(a){var c=this.childs.length,b=[];if(1===c&&1===this.childs[0].childs.length&&"(expr)"===this.type)b=this.childs[0].childs[0].evaluate(a);
else for(var h=0;h<c;h++){var f=[];for(var d=0,l=this.childs[h].childs.length;d<l;d++)f.push(this.childs[h].childs[d].evaluate(a));b[h]=f}return b};else if("assign"===this.type){var w,D=this.childs[0],B=this.childs[1],L=D.childs[0]?D.childs[0].childs:null;this.evaluate=1===D.childs.length&&"square_bracket"===D.childs[0].type&&1===L.length?function(a){w=B.evaluate(a);a.setVector(D.value,L[0].evaluate(a),w);return w}:1===D.childs.length&&"square_bracket"===D.childs[0].type&&2===L.length?function(a){w=
B.evaluate(a);a.setMatrix(D.value,L[0].evaluate(a),L[1].evaluate(a),w);return w}:function(a){w=B.evaluate(a);return w.type?a.matrices[D.value]=w:"object"!==typeof a.variables[D.value]?a.variables[D.value]=w:0}}};a.Node=w;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c=/^\s+/,l=/^[a-zA-Z_\u00C0-\u021B\u0391-\u03C9]+[a-zA-Z_0-9\u00C0-\u021B\u0391-\u03C9]*([.]*[0-9a-zA-Z_\u00C0-\u021B\u0391-\u03C9]+[0-9]*)*/,f=/^[0-9]+[.][0-9]+|^[.][0-9]+|^[0-9]+/,v=/^==|^!=|^<=|^<|^>=|^>|^#/,r=/^!|^~|^&&|^&|^\|\||^\|/,u=/^=|^:=/,y=/^[\?:]/,n=/^[\+\-\*\/%\^\u2212\u00b7\u00D7\u00F7]/,h=/^\[|^\]/,x=/^\(|^\)/,w=/^,/,z=/^;/,A=/\|/g,E=/\|\*/g,J=/\*\|/g,F,G=/rnd|pi|e|Infinity|-Infinity|sqr|sqrt|ra\u00edz|exp|log|log10|abs|ent|sgn|ind|sin|sen|cos|tan|cot|sec|csc|sinh|senh|cosh|tanh|coth|sech|csch|asin|asen|acos|atan|min|max/,
D=function(){};D.prototype.tokenize=function(B){function G(a,c,h){e.push({type:a,value:c});b=b.slice(h);q+=h;m=a}if(g=B){var D=B.indexOf("//");0<=D&&":"!==B[D-1]&&(B=B.substring(0,D));B=B.replace(/\\u(\S+) /g,function(a,c){return 39!==parseInt(c,16)?String.fromCharCode(parseInt(c,16)):a});B=B.replace(/&sup(.+?);/g,"^$1 ");B=B.replace(/&squot;/g,"'");B.match(/=\|\*/g)&&(B=B.replace(E,"'").replace(J,"'"));B.match(/=\|/g)&&(B=B.replace(A,"'"));D=B.trim();"|"==D.charAt(0)&&"|"==D.charAt(D.length-1)&&
(B=D.replace(A,"'"))}e=[];d=!1;q=0;b=B;for(m="";B&&q<B.length;)if(d=q,"'"==b[0]){for(k=1;"'"!=b[k];)if(k<b.length)k++;else{console.info(">Error, unknown symbol: ["+b+"], in the string \u300a"+g+"\u300b");return}p=b.substring(1,k);G("string",p,p.length+2)}else if(p=b.match(c))b=b.slice(p[0].length),q+=p[0].length;else if(p=b.match(n))p[0]=p[0].replace(/\u00F7/g,"/").replace(/\u2212/g,"-").replace(/\u00b7/g,"*").replace(/\u00D7/g,"*"),G("operator",p[0],p[0].length);else if(p=b.match(l))"number"===m&&
e.push({type:"operator",value:"*"}),G("identifier",p[0],p[0].length);else if(p=b.match(f))G("number",p[0],p[0].length);else if(p=b.match(v))D=p[0],"#"==D&&(D="!="),G("compOperator",D,p[0].length);else if(p=b.match(r))D=p[0],"||"==D?D="|":"&&"==D?D="&":"~"==D&&(D="!"),G("boolOperator",D,p[0].length);else if((p=b.match(u))&&!b.match(/^==/))G("assign",p[0],p[0].length);else if(p=b.match(y))G("conditional",p[0],p[0].length);else if(p=b.match(h))G("square_bracket",p[0],p[0].length);else if(p=b.match(x))"("==
p&&"number"===m&&e.push({type:"operator",value:"*"}),G("parentheses",p[0],p[0].length);else if(p=b.match(w))G("separator",p[0],p[0].length);else if(178===b.charCodeAt(0))e.push({type:"operator",value:"^"}),G("number",2,1);else if(179===b.charCodeAt(0))e.push({type:"operator",value:"^"}),G("number",3,1);else if(p=b.match(z))G("final_of_expression",p[0],p[0].length);else if(d==q){a.DEBUG.setError(a.DEBUG.EXPRESSION,g);return}return e};D.prototype.flatTokens=function(a,c){a=a||[];c=c||"";F="";for(var b=
0,h=a.length;b<h;b++)F="string"==a[b].type?F+"&squot;"+a[b].value+"&squot;":"identifier"!=a[b].type||a[b].value.match(G)?F+a[b].value:F+c+a[b].value;return F};a.Tokenizer=D;return a}(descartesJS||{});
descartesJS=function(a){function g(a){switch(a){case "=":return 1;case ":=":return 1;case "(":return 2;case "[":return 2;case "?":return 2;case ":":return 3;case "?:":return 3;case "|":return 6;case "&":return 7;case "<":return 5;case "<=":return 5;case ">":return 5;case ">=":return 5;case "==":return 5;case "!=":return 5;case "+":return 6;case "-":return 6;case "/":return 7;case "*":return 7;case "sign-":return 7;case "sign+":return 7;case "!":return 8;case "%":return 8;case "^":return 9;default:return 9}}
function e(a){return isNaN(parseFloat(a))?a.replace(/^\s|\s$/g,"").replace(/^'|'$/g,""):parseFloat(a)==a?parseFloat(a):a.replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")}if(a.loadLib)return a;a.reservedIds=new String("-_-rnd-pi-\u03c0-e-Infinity-isTouch-esT\u00e1ctil-device-dispositivo-screenOrientation-screenWidth-screenHeight-sqr-sqrt-ra\u00edz-exp-log-log10-abs-ent-sgn-ind-sin-sen-cos-tan-cot-sec-csc-sinh-senh-cosh-tanh-coth-sech-csch-asin-asen-acos-atan-atan2-floor-ceil-round-min-max-_Trace_-_Print_-_Num_-_Stop_Audios_-esCorrecto-escorrecto-parent.set-parent.update-parent.exec-toFixed-_NumToStr_-_NumACadena_-charAt-_charAt_-_letraEn_-substring-_substring_-_subcadena_-strLength-_length_-_longitud_-indexOf-_indexOf_-\u00edndiceDe-lastIndexOf-replace-_replace_-_reemplazar_-toLowerCase-toUpperCase-trim-_Load_-_GetValues_-_GetMatrix_-_MatrixToStr_-_StrToMatrix_-_GetVector_-_VectorToStr_-_StrToVector_-_ExecStr_-_ExecBlock_-_Save_-_Open_-_SaveState_-_OpenState_-_AnchoDeCadena_-_strWidth_-R-G-B-_Rojo_-_Red_-_Verde_-_Green_-_Azul_-_Blue_-DJS.typeof-");
var d=Date.now(),q,p,b,k,m,c,l,f,v,r,u,y,n=function(c){this.evaluator=c;this.tokenizer=new a.Tokenizer;this.vectors={};this.matrices={};this.variables={};this.functions={};this.definitions={};this.registerDefaultValues();this.registerExternalValues&&this.registerExternalValues()};n.prototype.setDefinition=function(a,c){this.definitions[a]=c};n.prototype.getDefinition=function(a){return this.definitions[a]};n.prototype.setVariable=function(a,c){this.variables[a]=c};n.prototype.getVariable=function(a){return this.variables[a]};
n.prototype.setVector=function(a,c,b){this.vectors[a][c]=b};n.prototype.getVector=function(a){this.vectors.hasOwnProperty(a)||(this.vectors[a]=[0,0,0]);return this.vectors[a]};n.prototype.setMatrix=function(a,c,b,f){this.matrices[a][c][b]=f};n.prototype.getMatrix=function(a){this.matrices.hasOwnProperty(a)||(this.matrices[a]=[[0,0,0],[0,0,0],[0,0,0]]);return this.matrices[a]};n.prototype.setFunction=function(a,c){this.functions[a]=c};n.prototype.getFunction=function(a){this.functions.hasOwnProperty(a)||
(this.functions[a]=function(){return 0});return this.functions[a]};n.prototype.parse=function(h,d){(b=this.tokenizer.tokenize(h))||(b=[]);k=null;d=!d||!1;q=f=l=c=0;for(p=b.length;q<p;q++){v=b[q];r=v.value;u=v.type;if("identifier"===u)if(q+1<p&&"parentheses"===b[q+1].type&&"("===b[q+1].value)this.getFunction(r);else if(q+1<p&&"square_bracket"===b[q+1].type&&"["===b[q+1].value)b[q+3]&&"square_bracket"===b[q+3].type&&"]"===b[q+3].value?this.getVector(r):this.getMatrix(r);else{var e=r.match(/(\w*)\.mouse_x|(\w*)\.mouse_y|(\w*)\.mouse_pressed|(\w*)\.mouse_clicked|(\w*)\.clic_izquierdo/);
e&&(this.variables[(e[1]||e[2]||e[3]||e[4]||e[5])+".DESCARTESJS_no_fixed"]=1);this.getVariable(r,!0)}"assign"===u&&d&&":="!=r&&(u="compOperator",r="==");if("assign"===u)if(m=new a.Node(u,r),null!=k)if("identifier"===k.type)k.parent&&k.parent.replaceLastChild(m),m.addChild(k),k=m,d=!0;else if("square_bracket"===k.type)m.addChild(k.parent),k=m,d=!0;else{m.type="compOperator";m.value="==";for(d=!0;k.parent&&g(k.parent.value)>=g(m.value);)k=k.parent;k.parent&&k.parent.replaceLastChild(m);m.addChild(k);
k=m}else{console.info("Error1: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}else if("parentheses"===u&&"("===r||"square_bracket"===u&&"["===r)if(m=new a.Node(u,r),"("===r&&c++,"["===r&&l++,null===k)"("===r&&(new a.Node("(expr)","(expr)")).addChild(m),"["===r&&(new a.Node("[expr]","[expr]")).addChild(m),k=m;else if("operator"===k.type||"boolOperator"===k.type||"compOperator"===k.type||"conditional"===k.type||"assign"===k.type)k.addChild(m),k=m;else if("sign"===
k.type)k.addChild(m),k=m;else if("parentheses"===k.type&&"("===k.value)k.addChild(m),k=m;else if("square_bracket"===k.type&&"["===k.value)k.addChild(m),k=m;else if("parentheses"===k.type&&"()"===k.value)k.parent.addChild(m),k=m;else if("square_bracket"===k.type&&"[]"===k.value)k.parent.addChild(m),k=m;else if("identifier"===k.type)k.addChild(m),k=m;else{console.info("Error2: en la expresi\u00f3n \u300a "+h+" \u300b, en el token ["+q+"] {valor: "+r+", tipo: "+u+"}");break}else if("parentheses"===u&&
")"===r)if(c--,null===k)console.info("Error3: en la expresi\u00f3n \u300a "+h+" \u300b, en el token (valor:"+r+", tipo:"+u);else{for(;k&&k.parent&&("("!=k.value||"("==k.value&&"parentheses"!=k.type);)k=k.parent;if(k&&"("===k.value)k.value="()";else break}else if("square_bracket"===u&&"]"===r)if(l--,null===k)console.info("Error5: en la expresi\u00f3n \u300a "+h+" \u300b, en el token (valor:"+r+", tipo:"+u);else{for(;k&&k.parent&&("["!=k.value||"["==k.value&&"square_bracket"!=k.type);)k=k.parent;if(k&&
"["===k.value)k.value="[]";else{console.info("Error6: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}}else if("number"===u||"string"===u||"identifier"===u)if(m=new a.Node(u,r),null===k)k=m;else if("operator"===k.type||"compOperator"===k.type||"boolOperator"===k.type||"parentheses"===k.type&&"("===k.value||"square_bracket"===k.type&&"["===k.value||"sign"===k.type||"conditional"===k.type||"assign"===k.type)k.addChild(m),k=m;else{a.DEBUG.setError(a.DEBUG.EXPRESSION,
h);break}else if("operator"===u||"compOperator"===u||"boolOperator"===u)if(m=new a.Node(u,r),null===k)if("-"===r||"+"===r)m.type="sign",m.value="sign"+r,k=m;else if("!"===r)k=m;else{console.info("Error8: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}else if("operator"===k.type||"compOperator"===k.type||"boolOperator"===k.type||"assign"===k.type||"conditional"===k.type||"square_bracket"===k.type&&"["===k.value&&("-"===r||"+"===r||"!"===r)||"parentheses"===
k.type&&"("===k.value&&("-"===r||"+"===r||"!"===r)){if("-"===r||"+"===r)m.type="sign",m.value="sign"+r;k.addChild(m);k=m}else if("number"===k.type||"parentheses"===k.type&&"()"===k.value||"square_bracket"===k.type&&"[]"===k.value||"string"===k.type||"identifier"===k.type||"conditional"===k.type||"assign"===k.type){for(;k.parent&&g(k.parent.value)>=g(m.value);)k=k.parent;k.parent&&k.parent.replaceLastChild(m);m.addChild(k);k=m}else{console.info("Error9: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+
r+", tipo: "+u+"}");break}else if("conditional"===u)if(m=new a.Node(u,r),null!=k)if("?"===m.value){for(f++;k.parent&&g(k.parent.value)>g(m.value);)k=k.parent;k.parent&&k.parent.replaceLastChild(m);m.addChild(k);k=m}else{for(f--;k&&k.parent&&("?"!=k.value||"?"==k.value&&"conditional"!=k.type);)k=k.parent;if(k&&"?"===k.value)k.value="?:";else{console.info("Error10: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}}else{console.info("Error11: en la expresi\u00f3n \u300a "+
h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}else if("separator"===u)if(null!=k)for(;k.parent&&"("!=k.value&&"["!=k.value;)k=k.parent;else{console.info("Error12: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}else{console.info("Error13: en la expresi\u00f3n \u300a "+h+" \u300b, en el token {valor: "+r+", tipo: "+u+"}");break}}0<c&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_CLOSING,h);0>c&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_OPENING,h);0<l&&a.DEBUG.setError(a.DEBUG.BRACKET_CLOSING,
h);0>l&&a.DEBUG.setError(a.DEBUG.BRACKET_OPENING,h);0!=f&&a.DEBUG.setError(a.DEBUG.INCOMPLETE_IF,h);(y=k?k.getRoot():null)&&y.setAllEvalFun();return y};n.prototype.registerDefaultValues=function(){var c=this;c.variables._NUM_MAX_ITE_ALG_=1E5;c.variables.rnd=Math.random;c.variables.pi=c.variables["\u03c0"]=a.returnValue(Math.PI);c.variables.e=a.returnValue(Math.E);c.variables.Infinity=Infinity;c.variables["-Infinity"]=-Infinity;c.variables.isTouch=c.variables["esT\u00e1ctil"]=a.hasTouchSupport?1:0;
c.variables.device=c.variables.dispositivo=function(){var a=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(a)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(a)?"mobile":"desktop"}();Object.defineProperties(c.variables,{screenOrientation:{get:function(){return window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}},screenWidth:{get:function(){return window.innerWidth}},screenHeight:{get:function(){return window.innerHeight}}});
c.functions.sqr=function(a){return a*a};c.functions.sqrt=c.functions["ra\u00edz"]=Math.sqrt;c.functions.exp=Math.exp;c.functions.log=Math.log;c.functions.log10=function(a){return Math.log(a)/Math.log(10)};c.functions.abs=Math.abs;c.functions.ent=Math.floor;c.functions.sgn=function(a){return 0<a?1:0>a?-1:0};c.functions.ind=function(a){return a?1:0};c.functions.sin=c.functions.sen=Math.sin;c.functions.cos=Math.cos;c.functions.tan=Math.tan;c.functions.cot=function(a){return 1/Math.tan(a)};c.functions.sec=
function(a){return 1/Math.cos(a)};c.functions.csc=function(a){return 1/Math.sin(a)};c.functions.sinh=c.functions.senh=function(a){return(Math.exp(a)-Math.exp(-a))/2};c.functions.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};c.functions.tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};c.functions.coth=function(a){return 1/c.functions.tanh(a)};c.functions.sech=function(a){return 1/c.functions.cosh(a)};c.functions.csch=function(a){return 1/c.functions.sinh(a)};c.functions.asin=
c.functions.asen=Math.asin;c.functions.acos=Math.acos;c.functions.atan=Math.atan;c.functions.atan2=Math.atan2;c.functions.floor=Math.floor;c.functions.ceil=Math.ceil;c.functions.round=Math.round;c.functions.min=Math.min;c.functions.max=Math.max;c.functions._Trace_=c.functions._Print_=function(){console.info.apply(console,arguments);return 0};c.functions._Num_=function(a){if("number"==typeof a)return"NaN";a=a.replace(",",".");return parseFloat(a)==a?parseFloat(a):"NaN"};c.functions._Stop_Audios_=function(){c.evaluator.parent.stopAudios()};
c.functions.esCorrecto=function(b,f,d){return a.esCorrecto(b,f,c.evaluator,d)};c.functions.escorrecto=function(b,f,d){return a.escorrecto(b,f,c.evaluator,d)};window.parent!==window&&(c.functions["parent.set"]=function(a,c){window.parent.postMessage({type:"set",name:a,value:c},"*");return 0},c.functions["parent.update"]=function(){window.parent.postMessage({type:"update"},"*");return 0},c.functions["parent.exec"]=function(a,c){window.parent.postMessage({type:"exec",name:a,value:c},"*");return 0});
c.functions.toFixed=c.functions._NumToStr_=c.functions._NumACadena_=function(a,c){a=isNaN(parseFloat(a))?0:parseFloat(a);return a.toFixed(parseInt(c||0))};c.functions.charAt=c.functions._charAt_=c.functions._letraEn_=function(a,c){a=(a||"").toString();c=isNaN(parseInt(c))?0:parseInt(c);return a.charAt(c)};c.functions.substring=c.functions._substring_=c.functions._subcadena_=function(a,c,b){a=(a||"").toString();c=isNaN(parseInt(c))?0:parseInt(c);b=isNaN(parseInt(b))?0:parseInt(b);return 0<=c&&0<=b?
a.substring(c,b):0>c&&0<=b?a.substring(b):0>b&&0<=c?a.substring(c):""};c.functions.strLength=c.functions._length_=c.functions._longitud_=function(a){return(a||"").toString().length};c.functions.indexOf=c.functions._indexOf_=c.functions["_\u00edndiceDe_"]=function(a,c){return(a||"").toString().indexOf((c||"").toString())};c.functions.lastIndexOf=function(a,c){return(a||"").toString().lastIndexOf((c||"").toString())};c.functions.replace=c.functions._replace_=c.functions._reemplazar_=function(a,c,b){a=
(a||"").toString();c=(c||"").toString();b=(b||"").toString();for(var f=a.indexOf(c);0<=f;)a=a.substring(0,f)+b+a.substring(f+c.length),f=a.indexOf(c,f+b.length);return a};c.functions.toLowerCase=function(a){return(a||"").toString().toLowerCase()};c.functions.toUpperCase=function(a){return(a||"").toString().toUpperCase()};c.functions.trim=function(a){return(a||"").toString().trim()};c.functions._Load_=function(c){var b="";c&&(b=(b=document.getElementById(c))&&"descartes/archivo"==b.type?b.text:a.openExternalFile(c));
return b||""};c.functions._GetValues_=function(a,b){return c.functions._ExecBlock_(c.functions._Load_(a).replace(/&brvbar;/g,String.fromCharCode("166")),b)};c.functions._GetMatrix_=function(a,b){return c.functions._StrToMatrix_(c.functions._Load_(a).replace(/&brvbar;/g,String.fromCharCode("166")),b)};c.functions._MatrixToStr_=function(b){var f=c.matrices[b];if(f){for(var d="<"+b+">\\n",l=c.getVariable(b+".columnas_usadas")||f.cols||0,h=c.getVariable(b+".filas_usadas")||f.rows||0,e,g=0;g<l;g++){for(var m=
0;m<h;m++)e=f[g][m],void 0!==e&&("string"==typeof e?e="'"+e+"'":"number"==typeof e&&(e=a.removeNeedlessDecimals(e.toFixed(6))),d+=e+(m<h-1?" \u00a6 ":""));d=d.replace(/(\u00A6 )$/g,"")+"\\n"}return d+"</"+b+">"}return""};c.functions._StrToMatrix_=function(a,b){var f=[],d=!1,l=!1;f.type="matrix";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var h=0,g=a.length;h<g;h++)a[h].match("<"+b+">")?(l=!0,d=a[h].trim().split("<"+b+">"),2==d.length&&""!=d[1]&&f.push(d[1].split(String.fromCharCode("166")).map(e)),
d=!0):(a[h].match("</"+b+">")&&(d=a[h].trim().split("</"+b+">"),2==d.length&&""!=d[0]&&f.push(d[0].split(String.fromCharCode("166")).map(e)),d=!1,h=a.length),d&&f.push(a[h].split(String.fromCharCode("166")).map(e)));c.matrices[b]=f;c.matrices[b].rows=f&&f[0]&&f[0].length?f[0].length:0;c.matrices[b].cols=f&&f.length?f.length:0;c.setVariable(b+".filas",c.matrices[b].rows);c.setVariable(b+".columnas",c.matrices[b].cols)}return l?"OK":"ERROR"};c.functions._GetVector_=function(a,b){return c.functions._StrToVector_(c.functions._Load_(a),
b)};c.functions._VectorToStr_=function(a){var b=c.vectors[a];if(b){for(var f="<"+a+">\\n",d=c.getVariable(a+".long_usada")||b._size_||0,l,h=0;h<d;h++)l=b[h],void 0!==l?("number"==typeof l&&(l=parseFloat(l)),f+=l+"\\n"):f+="0\\n";return f+"</"+a+">"}return""};c.functions._StrToVector_=function(a,b){var f=[],d=!1,l=!1;f.type="vector";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var h=0,g=a.length;h<g;h++)a[h].match("<"+b+">")?d=l=!0:(a[h].match("</"+b+">")&&(d=!1,h=a.length),d&&f.push(e(a[h])));
f._size_=f.length;c.vectors[b]=f;c.setVariable(b+".long",f.length);c.setVariable(b+".long_usada",f.length)}return l?"OK":"ERROR"};c.functions._ExecStr_=function(a){return c.functions._ExecBlock_(a,"")};c.functions._ExecBlock_=function(a,b){var f=[],d=""==b;if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var l=0,h=a.length;l<h;l++)a[l].match("<"+b+">")?(d=a[l].trim().split("<"+b+">"),2==d.length&&""!=d[1]&&(f=f.concat(d[1].split(String.fromCharCode("166")))),d=!0):a[l].match("</"+b+">")?(d=a[l].trim().split("</"+
b+">"),2==d.length&&""!=d[0]&&(f=f.concat(d[0].split(String.fromCharCode("166")))),d=!1):d&&(f=f.concat(a[l].split(String.fromCharCode("166"))));l=0;for(h=f.length;l<h;l++)d=f[l].split("="),d[0]=d[0].trim(),2==d.length&&""!=d[0]&&(isNaN(parseFloat(d[1]))?c.setVariable(d[0],d[1].replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")):c.setVariable(d[0],parseFloat(d[1])))}return 0};var b=a.newHTML("a",{target:"_blank"}),f,l=null;a.newBlobContent=null;c.functions._Save_=function(h,e){c.evaluator.parent.removeButtonClick();
1500<Date.now()-d&&(d=Date.now(),document.body.appendChild(b),l=e.replace(/\\r/g,"").replace(/\\n/g,"\r\n").replace(/\\q/g,"'").replace(/\\_/g,"\\"),f=new Blob(["\ufeff",l],{type:"text/plain;charset=utf-8"}),b.setAttribute("href",window.URL.createObjectURL(f)),b.setAttribute("download",h),l!=a.newBlobContent&&(b.click(),a.newBlobContent=l),document.body.removeChild(b));return 0};var g=a.newHTML("a",{target:"_blank"});c.functions._SaveSpace_=function(b,f){c.evaluator.parent.removeButtonClick();1500<
Date.now()-d&&(d=Date.now(),document.body.appendChild(g),l=f,g.setAttribute("href",l),g.setAttribute("download",b),l!=a.newBlobContent&&(g.click(),a.newBlobContent=l),document.body.removeChild(g));return 0};var m,k,r=a.newHTML("input",{type:"file"});r.addEventListener("change",function(b){m=b.target.files;k=new FileReader;k.onload=function(b){a.addExternalFileContent(m[0].name,b.target.result);c.setVariable("DJS.fileName",m[0].name);c.setVariable("DJS.fileContent",b.target.result);c.getFunction(c._callback)&&
(c.getFunction(c._callback).apply(c.evaluator,[]),c.evaluator.parent.update());r.value=""};0<m.length&&k.readAsText(m[0])});c.functions._Open_=function(a){c.evaluator.parent.removeButtonClick();1500<Date.now()-d&&(c._callback=a,r.click(),d=Date.now());return 0};c.functions._AnchoDeCadena_=c.functions._strWidth_=function(c,b,f,d){return a.getTextWidth(c,a.convertFont(b+","+f+","+d))};c.functions.R=c.functions._Rojo_=c.functions._Red_=function(c){return(new a.Color(c)).r/255};c.functions.G=c.functions._Verde_=
c.functions._Green_=function(c){return(new a.Color(c)).g/255};c.functions.B=c.functions._Azul_=c.functions._Blue_=function(c){return(new a.Color(c)).b/255};c.functions["DJS.typeof"]=function(a){return a.rows?"matrix":a._size_?"vector":typeof a}};a.Parser=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.floor,e=function(d){this.parent=d;this.parser=new a.Parser(this);this.variables=this.parser.variables;this.functions=this.parser.functions;this.vectors=this.parser.vectors;this.matrices=this.parser.matrices;this.definitions=this.parser.definitions};e.prototype.setDefinition=function(a,e){this.definitions[a]=e};e.prototype.getDefinition=function(a){return this.definitions[a]};e.prototype.setVariable=function(a,e){this.variables[a]=e};e.prototype.getVariable=
function(a){return this.variables[a]};e.prototype.setVector=function(a,e,p){e=0>e?0:g(e);this.vectors[a][e]=p};e.prototype.getVector=function(a,e){e=0>e?0:g(e);return this.vectors[a][e]};e.prototype.setMatrix=function(a,e,p,b){e=0>e?0:g(e);p=0>p?0:g(p);void 0==this.matrices[a][e]&&(this.matrices[a][e]=[]);this.matrices[a][e][p]=b};e.prototype.getMatrix=function(a,e,p){e=0>e?0:g(e);p=0>p?0:g(p);return this.matrices[a][e][p]};e.prototype.setFunction=function(a,e){this.functions[a]=e};e.prototype.getFunction=
function(a){return this.functions[a]};e.prototype.eval=function(a){return a?a.evaluate(this):0};a.externalEvaluator=new e;a.Evaluator=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l,f,v,r,u,y,n=function(c,b){this.parent=c;this.evaluator=c.evaluator;this.decimals=c.decimals;this.fixed=c.fixed;this.align=c.align||"left";this.anchor=c.anchor||"a_top_left";this.decimal_symbol=c.parent.decimal_symbol;this.w=this.h=100;this.hasContent=""!==b;this.textStr=(b||"").replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");
this.oldTextStr=this.oldWidth=this.oldSize=this.oldColor=this.oldPosX=this.oldPoxY=null;b.match(/^\{\\rtf1/)?(this.type="rtfNode",this.text=b,this.textNodes=(new a.RTFParser(c.evaluator)).parse(b.substring(10)),this.draw=this.drawRTF):(this.descarTeXParser=new a.DescarTeXParser,this.text=this.parseSimpleText(this.textStr),this.textNodes=new a.TextNode("","textLineBlock",null,null),this.draw=this.drawText)};n.prototype.drawText=function(c,f,l,m,k){g=this.evaluator.eval(this.decimals);e=this.evaluator.eval(this.parent.width);
d=this.evaluator.eval(this.parent.font_size);q=f.getColor?f.getColor():f;p=this.textToString(this.text,g,this.fixed).replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");0<=p.indexOf("[")&&(p=this.textToString(this.parseSimpleText(p),g,this.fixed));if(this.oldTextStr!==p||this.oldWidth!==e||this.oldSize!==d||this.oldColor!==q||this.oldPosX!==l||this.oldPoxY!==m)b=new a.TextStyle({size:d,family:this.parent.font_family||
"arial",italic:this.parent.italics||!1,bold:this.parent.bold||!1,color:q,align:this.align,border:this.parent.border,border_size:this.parent.border_size,shadowBlur:this.parent.shadowBlur,shadowOffsetX:this.parent.shadowOffsetX,shadowOffsetY:this.parent.shadowOffsetY,shadowColor:this.parent.shadowColor||"transparent"}),this.textNodes=this.descarTeXParser.parse(p,this.evaluator,b),this.textNodes.update(l,m,g,this.fixed,this.align,this.anchor,q,e);k||this.textNodes.draw(c);this.oldTextStr=p;this.oldWidth=
e;this.oldSize=d;this.oldColor=q;this.oldPosX=l;this.oldPoxY=m};n.prototype.drawRTF=function(a,c,b,f,d){c=c.getColor?c.getColor():c;a.fillStyle=a.strokeStyle=c;a.textBaseline="alphabetic";this.textNodes.style.align!==this.align&&this.textNodes.propagateStyle("align",this.align);this.textNodes.update(b,f,this.evaluator.eval(this.decimals),this.fixed,this.align,this.anchor,c,this.evaluator.eval(this.parent.width));d||this.textNodes.draw(a)};n.prototype.parseSimpleText=function(a){a=a.replace("&#x2013",
"\u2013").replace(/&squot;/g,"'");k=[];m="'";l=c=0;f=-1;for(u=a.length;c<u;)v=a.charAt(c),r=a.charAt(c-1),"["===v&&"\\"===r?(k.push(a.substring(l,c-1)+"["),l=c+1):"]"===v&&"\\"===r?(k.push(a.substring(l,c-1)+"]"),l=c+1):"["===v&&-1===f?(k.push(a.substring(l,c)),l=c,f++):"["===v?f++:"]"===v&&0===f?(k.push(this.evaluator.parser.parse(a.substring(l,c+1))),l=c+1,f--):("]"==a.charAt(c)&&(f=0>f?f:f-1),m+=a.charAt(c)),c++;k.push(a.substring(l,c));return k};n.prototype.textToString=function(c,b,f){m="";if("rtfNode"!==
c.type)for(var d=0,l=c.length;d<l;d++)"string"===typeof c[d]?m+=c[d]:(y=this.evaluator.eval(c[d])[0][0],""!==y&&("string"===typeof y?m+=y:Infinity===y?m+="Infinity":-Infinity===y?m+="-Infinity":isNaN(y)||"NaN"===y?m+="NaN":(y=parseFloat(y),y=f?y.toFixed(b):a.removeNeedlessDecimals(y.toFixed(b)),m+=y.toString().replace(".",this.decimal_symbol))));return m};a.TextObject=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e=function(){};e.prototype.tokenize=function(a){a=a.replace(/\\n/g,"\\newline ");var d=[],e=null,b=0,k=a.length;a.charAt(0);var m=!1,c=!1,l=0;g="";for(var f=0;f<k;f++){var v=a.charAt(f);var r=a.charAt(f+1);"\\"===v&&"$"===r&&(c=!0);"{"===v?l++:"}"===v&&(l--,c&&0===l&&(c=!1));c?"_"===v?"{"===r?g+="\\subindex":(g+="\\subindex{"+r+"}",f++):"^"===v?"{"===r?g+="\\superindex":(g+="\\superindex{"+r+"}",f++):g+=v:g+=v}a=g;r=a.charAt(0);for(k=a.length;b<
k;)v=r,r=a.charAt(b+1),m&&("{"===v||"["===v||"\\"===v||" "===v?(m=!1," "===v&&(e={type:"ignore"},d.push(e))):e.value+=v),m||"\\"!==v?m||"{"!==v&&"["!==v?m||"}"!==v&&"]"!==v?m||(e&&"text"===e.type?e.value+=v:e&&"ignore"===e.type?(d.pop(),e=d[d.length-1]):(e={type:"text",value:v},d.push(e))):(e={type:"close",value:v},d.push(e)):(e={type:"open",value:v},d.push(e)):(m=!0,e={type:"command",value:""},d.push(e)),b++;return d};a.DescarTeXTokenizer=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=function(){this.tokenizer=new a.DescarTeXTokenizer};g.prototype.parse=function(e,d,g){e=this.tokenizer.tokenize(e);var p=new a.TextNode("","textBlock",g,null),b=new a.TextNode("","textLineBlock",g.clone(),null);p.addChild(b);for(var k=[],m=void 0,c=g,l=[g],f,v,r,u,q=!1,n=0,h=e.length;n<h;n++)if("text"===e[n].type)if("color_parameter"===m)v=new a.Color(e[n].value,d);else if("text_size_parameter"===m)r=parseFloat(e[n].value);else if("textLineBlock"===
b.nodeType){f=e[n].value.split(" ");for(var x=0,w=f.length;x<w;x++)""!==f[x]&&b.addChild(new a.TextNode(f[x],"text",c.clone(),null)),x+1<w&&b.addChild(new a.TextNode(" ","space",c.clone(),null))}else b.addChild(new a.TextNode(e[n].value,"text",c.clone(),null));else"command"===e[n].type&&"curlyBracketOpen"===e[n].value?b.addChild(new a.TextNode("{","text",c.clone(),null)):"command"===e[n].type&&"curlyBracketClose"===e[n].value?b.addChild(new a.TextNode("}","text",c.clone(),null)):"command"===e[n].type&&
"squareBracketOpen"===e[n].value?b.addChild(new a.TextNode("[","text",c.clone(),null)):"command"===e[n].type&&"squareBracketClose"===e[n].value?b.addChild(new a.TextNode("]","text",c.clone(),null)):"command"===e[n].type&&"newline"===e[n].value?(0===b.children.length&&b.addChild(new a.TextNode("","text",c.clone(),null)),b=new a.TextNode("","textLineBlock",g.clone(),null),p.addChild(b)):"command"===e[n].type&&"b"===e[n].value?(m="bold",k.push(m)):"command"===e[n].type&&"i"===e[n].value?(m="italic",
k.push(m)):"command"===e[n].type&&"o"===e[n].value?(m="overline",k.push(m)):"command"===e[n].type&&"u"===e[n].value?(m="underline",k.push(m)):"command"===e[n].type&&"color"===e[n].value?(m="color",k.push(m)):"command"===e[n].type&&"ts"===e[n].value?(m="text_size",k.push(m)):"command"===e[n].type&&"sansserif"===e[n].value.toLowerCase()?(m="sansserif",k.push(m)):"command"===e[n].type&&"serif"===e[n].value.toLowerCase()?(m="serif",k.push(m)):"command"===e[n].type&&"monospace"===e[n].value.toLowerCase()?
(m="monospace",k.push(m)):"command"===e[n].type&&"c"===e[n].value?(m="center",k.push(m)):"command"===e[n].type&&"l"===e[n].value?(m="left",k.push(m)):"command"===e[n].type&&"r"===e[n].value?(m="right",k.push(m)):"command"===e[n].type&&"j"===e[n].value?(m="justify",k.push(m)):"command"===e[n].type&&"$"===e[n].value?(m="formula",k.push(m),q=!0):"command"===e[n].type&&"sum"===e[n].value?(m="sum",k.push(m)):"command"===e[n].type&&"prod"===e[n].value?(m="prod",k.push(m)):"command"===e[n].type&&"int"===
e[n].value?(m="integral",k.push(m)):"command"===e[n].type&&"lim"===e[n].value?(m="limit",k.push(m)):"command"===e[n].type&&"sqrt"===e[n].value?(m="radical",k.push(m)):"command"===e[n].type&&"subindex"===e[n].value?(m="subIndex",k.push(m)):"command"===e[n].type&&"superindex"===e[n].value?(m="superIndex",k.push(m)):"command"===e[n].type&&"frac"===e[n].value?(m="numerator",k.push(m)):"open"===e[n].type&&"{"===e[n].value&&void 0!==m?"bold"===m||"italic"===m||"overline"===m||"underline"===m?(c=c.clone(),
c[m]=!0,l.push(c)):"sansserif"===m?(c=c.clone(),c.family="sansserif",l.push(c)):"serif"===m?(c=c.clone(),c.family="serif",l.push(c)):"monospace"===m?(c=c.clone(),c.family="monospaced",l.push(c)):"text_size"===m?m="text_size_parameter":"text_size_text"===m?(c=c.clone(),c.size=r,l.push(c)):"color"===m?m="color_parameter":"color_text"===m?(c=c.clone(),c.color=v,l.push(c)):"center"===m||"left"===m||"right"===m||"justify"===m?(c=c.clone(),c.align=m,l.push(c),b=new a.TextNode("","textLineBlock",c.clone(),
null),p.addChild(b)):"formula"===m?(c=c.clone(),l.push(c),u=new a.TextNode("","formula",c.clone(),null),b.addChild(u),b=u):"subIndex"===m||"superIndex"===m?q?(c=c.clone(),l.push(c),u=new a.TextNode("",m,c.clone(),null),b.addChild(u),b=u):b.addChild(new a.TextNode("subIndex"===m?"_":"^","text",c.clone(),null)):"radical"===m?q&&(u=new a.TextNode("","radical",c.clone(),null),b.addChild(u),b=u,c=c.clone(),l.push(c),u=new a.TextNode("","index",c.clone(),null),b.addChild(u),b=u,m="index"):"index"===m?q&&
(l.pop(),c=l[l.length-1],u=new a.TextNode("","radicand",c.clone(),null),b.addChild(u),b=u,m="radicand"):"sum"===m||"integral"===m||"limit"===m||"prod"===m?q&&(u=new a.TextNode("",m,c.clone(),null),b.addChild(u),b=u,c=c.clone(),l.push(c),u=new a.TextNode("","from",c.clone(),null),b.addChild(u),b=u,m="from",k[k.length-1]=m):"from"===m?q&&(u=new a.TextNode("","to",c.clone(),null),b.addChild(u),b=u,m="to",k[k.length-1]=m):"to"===m?q&&(l.pop(),c=l[l.length-1],u=new a.TextNode("","what",c.clone(),null),
b.addChild(u),b=u,m="what",k[k.length-1]=m):"numerator"===m?q&&(u=new a.TextNode("","fraction",c.clone(),null),b.addChild(u),b=u,c=c.clone(),l.push(c),u=new a.TextNode("","numerator",c.clone(),null),b.addChild(u),b=u,m="numerator"):"denominator"===m&&(u=new a.TextNode("",m,c.clone(),null),b.addChild(u),b=u):"close"===e[n].type&&"}"===e[n].value&&void 0!==m&&("bold"===m||"italic"===m||"overline"===m||"underline"===m||"color_text"===m||"color"===m||"text_size_text"===m||"text_size"===m||"sansserif"===
m||"serif"===m||"monospace"===m?(l.pop(),c=l[l.length-1],k.pop(),m=k[k.length-1]):"color_parameter"===m?m="color_text":"text_size_parameter"===m?m="text_size_text":"center"===m||"left"===m||"right"===m||"justify"===m?(l.pop(),c=l[l.length-1],k.pop(),m=k[k.length-1],e[n+1]&&"command"===e[n+1].type&&"newline"===e[n+1].value?b=p:(b=new a.TextNode("","textLineBlock",c.clone(),null),p.addChild(b))):"formula"===b.nodeType?(q=!1,l.pop(),c=l[l.length-1],k.pop(),m=k[k.length-1],b=b.parent):"subIndex"===b.nodeType||
"superIndex"===b.nodeType?q&&(l.pop(),c=l[l.length-1],k.pop(),m=k[k.length-1],b=b.parent):"index"===b.nodeType?b=b.parent:"radicand"===b.nodeType?(k.pop(),m=k[k.length-1],b=b.parent.parent):"from"===b.nodeType?b=b.parent:"to"===b.nodeType?b=b.parent:"what"===b.nodeType?(k.pop(),m=k[k.length-1],b=b.parent.parent):"numerator"===b.nodeType?(m="denominator",b=b.parent):"denominator"===b.nodeType&&(l.pop(),c=l[l.length-1],k.pop(),m=k[k.length-1],b=b.parent.parent));var z,A,E=null,J=[];p.children.forEach(function(a){for(var c=
0,b=a.children.length;c<b-1;c++)z=a.children[c],A=a.children[c+1],"text"===z.nodeType&&"text"===A.nodeType&&z.style.equals(A.style)?(null===E&&(E=z,u=z.clone(),E.changeNodeType("word"),E.value="___"+u.value,E.addChild(u)),u=A.clone(),E.addChild(u),J.push(A),E.value+=u.value):E=null});J.forEach(function(a){a.parent.removeChild(a)});p.normalize();p.adjustFontSize();return p};a.DescarTeXParser=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e=function(a){this.size=20;this.family="Arimo";this.overline=this.underline=this.bold=this.italic=!1;this.border=this.color=null;this.align="left";a=a||{};this.set(a)};e.prototype.clone=function(){return new e(Object.assign({},this))};e.prototype.set=function(a){Object.assign(this,a)};e.prototype.equals=function(a){var d=!0,e;for(e in this)this.hasOwnProperty(e)&&(d=d&&this[e]===a[e]);return d};e.prototype.toString=function(d){/arial|sansserif/i.test(this.family)?
g=a.sansserif_font:/times|serif/i.test(this.family)?g=d?a.math_font:a.serif_font:/courier|monospaced/i.test(this.family)&&(g=a.monospace_font);return((this.bold?"bold":"")+" "+(this.italic?"italic":"")+" "+this.size+"px "+g).trim()};a.TextStyle=e;return a}(descartesJS||{});
descartesJS=function(a){function g(a,b){for(var c=0,d=0;d<b;d++)c+=a[d];return c}function e(a){var c={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};if(""==a.trim())return c;var b=parseInt(a.match(/(\d+\.*)+px/)[0]);a=a.match("sansserif")?"sansserif":a.match("serif")?"serif":"monospace";c.ascent=Math.ceil((m[a].ascent+25)*b/m[a].unitsPerEm);c.descent=Math.ceil(Math.abs((m[a].descent-25)*b/m[a].unitsPerEm));c.h=c.ascent+c.descent;return c}if(a.loadLib)return a;
var d=!1,q="#000000",p=2,b=!1;(new Path2D("m 759,1 c -8,0 -15,4 -20,14 L 325,878 153,500 c -5,-11 -11,-14 -17,-9 L 2,596 c -5,4 17,30 22,26 l 65,-47 193,422 c 3,6 27,6 32,-4 L 773,40 V 1 Z")).svgData="m 759,1 c -8,0 -15,4 -20,14 L 325,878 153,500 c -5,-11 -11,-14 -17,-9 L 2,596 c -5,4 17,30 22,26 l 65,-47 193,422 c 3,6 27,6 32,-4 L 773,40 V 1 Z";(new Path2D("M 780,707 H 750 C 728,805 695,872 585,872 H 180 L 509,447 225,65 h 313 c 130,0 167,49 188,181 h 30 V 0 H 25 L 384,500 0,1000 h 729 z")).svgData=
"M 780,707 H 750 C 728,805 695,872 585,872 H 180 L 509,447 225,65 h 313 c 130,0 167,49 188,181 h 30 V 0 H 25 L 384,500 0,1000 h 729 z";(new Path2D("m 150,828 c -21,88 -42,144 -83,144 -6,0 -9,-2 -9,-6 0,-9 15,-8 15,-34 0,-14 -13,-22 -27,-22 -24,0 -45,22 -45,51 0,20 21,39 56,39 97,0 141,-105 159,-176 L 375,181 c 23,-91 45,-154 89,-153 6,0 9,2 9,6 0,7 -15,13 -15,35 0,14 13,20 27,20 24,0 45,-22 45,-51 C 530,18 508,0 473,0 368,0 326,120 309,190 Z")).svgData="m 150,828 c -21,88 -42,144 -83,144 -6,0 -9,-2 -9,-6 0,-9 15,-8 15,-34 0,-14 -13,-22 -27,-22 -24,0 -45,22 -45,51 0,20 21,39 56,39 97,0 141,-105 159,-176 L 375,181 c 23,-91 45,-154 89,-153 6,0 9,2 9,6 0,7 -15,13 -15,35 0,14 13,20 27,20 24,0 45,-22 45,-51 C 530,18 508,0 473,0 368,0 326,120 309,190 Z";
(new Path2D("m 876.3561,999.59384 v -27.38613 h -17.60537 c -64.55302,0 -96.82952,-41.07919 -96.82952,-124.21565 V 144.75542 c 0,-83.136456 27.38612,-117.369116 114.43489,-117.369116 V 1.7633057e-4 H 1.184082e-5 V 27.386304 H 16.627304 c 60.640711,0 98.785676,24.4519 98.785676,121.281426 v 716.9297 c 0,71.39954 -31.298433,106.61028 -96.829524,106.61028 H 1.184082e-5 v 27.38613 H 359.93198 v -27.38613 h -30.32036 c -64.55302,0 -86.07069,-40.10112 -86.07069,-131.06218 V 64.553192 H 633.79325 V 841.14553 c 0,75.31185 -17.60537,131.06218 -86.07068,131.06218 h -31.29844 v 27.38613 z")).svgData=
"m 876.3561,999.59384 v -27.38613 h -17.60537 c -64.55302,0 -96.82952,-41.07919 -96.82952,-124.21565 V 144.75542 c 0,-83.136456 27.38612,-117.369116 114.43489,-117.369116 V 1.7633057e-4 H 1.184082e-5 V 27.386304 H 16.627304 c 60.640711,0 98.785676,24.4519 98.785676,121.281426 v 716.9297 c 0,71.39954 -31.298433,106.61028 -96.829524,106.61028 H 1.184082e-5 v 27.38613 H 359.93198 v -27.38613 h -30.32036 c -64.55302,0 -86.07069,-40.10112 -86.07069,-131.06218 V 64.553192 H 633.79325 V 841.14553 c 0,75.31185 -17.60537,131.06218 -86.07068,131.06218 h -31.29844 v 27.38613 z";
var k=function(c,b,f,d){this.type="rtfNode";this.evaluator=d;this.parent=null;this.children=[];this.metrics={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};this.value=c;this.style=f;this.changeNodeType(b);this.drawBorder=a.in_editor?this.drawBorderSpecial:function(){}};k.prototype.changeNodeType=function(a){this.nodeType=a;this.draw=null;switch(this.nodeType){case "textBlock":this.draw=this.drawTextBlock;break;case "textLineBlock":this.draw=this.drawTextLineBlock;
break;case "formula":this.draw=this.drawFormula;break;case "superIndex":this.draw=this.drawSuperIndex;break;case "subIndex":this.draw=this.drawSubIndex;break;case "dynamicText":this.draw=this.drawDynamicText;this.decimal_symbol=this.evaluator.parent.decimal_symbol;break;case "fraction":this.draw=this.drawFraction;break;case "numerator":case "denominator":this.draw=this.drawNumDen;break;case "radical":this.draw=this.drawRadical;break;case "limit":this.draw=this.drawLimit;break;case "integral":this.draw=
this.drawIntegral;break;case "prod":this.draw=this.drawProd;break;case "sum":this.draw=this.drawSum;break;case "matrix":this.draw=this.drawMatrix;break;case "defparts":this.draw=this.drawDefparts;break;case "text":case "newLine":case "mathSymbol":this.draw=this.drawText;break;case "space":this.draw=this.drawSpace;break;case "word":this.draw=this.drawWord;break;case "hyperlink":this.draw=this.drawHyperlink;break;case "index":case "radicand":case "from":case "to":case "what":case "element":this.draw=
this.drawGenericBlock;break;case "componentNumCtrl":this.draw=this.drawComponentNumCtrl;break;case "componentSpace":this.draw=this.drawComponentSpace}};k.prototype.clone=function(){for(var a=new k(this.value,this.nodeType,this.style.clone()),b=0,f=this.children.length;b<f;b++)a.addChild(this.children[b].clone());return a};k.prototype.toStr=function(){for(var a=this.value,b=0,f=this.children.length;b<f;b++)a+=" "+this.children[b].toStr();return a};k.prototype.stringify=function(){var a="{"+('"NT":"'+
this.nodeType+'",');a+='"V":"'+(this.value||"")+'",';a+='"C":[';for(var b=0,f=this.children.length;b<f;b++)a+=this.children[b].stringify()+(b==f-1?"":",");a=a+"],"+('"S":'+JSON.stringify(this.style));return a+"}"};k.prototype.addChild=function(a,b){b&&null!==a.parent&&a.parent.removeChild(a);a.parent=this;this.children.push(a)};k.prototype.removeChild=function(a){var c=this.children.indexOf(a);-1!==c&&(a.parent=null,this.children.splice(c,1))};k.prototype.getFirstTextNode=function(){for(var a=this;0<
a.children.length;)a=a.children[0];return a};k.prototype.getLastTextNode=function(){for(var a=this;0<a.children.length;)a=a.children[a.children.length-1];return a};k.prototype.nextSibling=function(){if(this.parent)for(var a=null,b=0,f=this.parent.children.length;b<f;b++){if(a)return this.parent.children[b];this.parent.children[b]===this&&(a=!0)}return null};k.prototype.prevSibling=function(){if(this.parent)for(var a=0,b=this.parent.children.length-1;a<b;a++)if(this.parent.children[a+1]===this)return this.parent.children[a];
return null};k.prototype.queryAll=function(a){var c=[];"string"===typeof a&&(a=new RegExp(a));for(var b=0,d=this.children.length;b<d;b++)c=c.concat(this.children[b].queryAll(a));this.nodeType.match(a)&&c.push(this);return c};k.prototype.insertBefore=function(a,b){a=this.children.indexOf(a);-1!==a&&(b.parent=this,this.children.splice(a,0,b))};k.prototype.insertAfter=function(a,b){a=this.children.indexOf(a);-1!==a&&(b.parent=this,this.children.splice(a+1,0,b))};k.prototype.normalize=function(){for(var a=
this.queryAll(/textLineBlock|formula|numerator|denominator|superIndex|subIndex|index|subIndex|radicand|from|to|what|element/),b=0,f=a.length;b<f;b++)0===a[b].children.length&&a[b].addChild(new k("","text",a[b].style));a=this.queryAll(/formula|fraction|superIndex|subIndex|radical|sum|integral|prod|limit|matrix|defparts|dynamicText|componentNumCtrl|componentSpace/);b=0;for(f=a.length;b<f;b++){var d=a[b];(null===d.prevSibling()||null!==d.prevSibling()&&"text"!==d.prevSibling().nodeType)&&d.parent.insertBefore(d,
new k("","text",d.parent.style));(null===d.nextSibling()||null!==d.nextSibling()&&"text"!==d.nextSibling().nodeType)&&d.parent.insertAfter(d,new k("","text",d.parent.style))}return this};k.prototype.removeEmptyText=function(){for(var a=this.queryAll(/text/),b=0,f=a.length;b<f;b++)""===a[b].value&&a[b].parent&&a[b].parent.removeChild(a[b])};k.prototype.adjustFontSize=function(a){var c=this.style.size;"formula"===this.nodeType&&(a=!0);for(var b=0,d=this.children.length;b<d;b++)"text"===this.children[b].nodeType&&
a?(this.children[b].style.size=c,this.children[b].styleString=this.children[b].style.toString()):"index"===this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.5*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):"to"===this.children[b].nodeType||"from"===this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.2*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):
"numerator"===this.children[b].nodeType||"denominator"===this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.1*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):"subIndex"===this.children[b].nodeType||"superIndex"===this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.33*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):(a&&(this.children[b].style.size=
c,this.children[b].styleString=this.children[b].style.toString()),this.children[b].adjustFontSize(a))};k.prototype.propagateStyle=function(a,b){this.style[a]=b;this.styleString=this.style.toString();for(var c=0,d=this.children.length;c<d;c++)this.children[c].propagateStyle(a,b)};k.prototype.update=function(a,d,f,e,g,m,k,n){p=f;b=e;q=k;this.metrics.w=this.metrics.h=0;k=d;if(20<=n)for(f=0;f<this.children.length;f++)this.children[f].breakLines(n);f=0;for(e=this.children.length;f<e;f++){var c=this.children[f];
c.updateLine();c.metrics.offsetX=a;c.metrics.y=d;d+=parseInt(c.metrics.ascent+.5);c.metrics.offsetY=d;g=parseInt(c.metrics.descent+.5)+parseInt(1.5+.05*c.style.size);d+=g;this.metrics.h+=c.metrics.h;this.metrics.w=Math.max(this.metrics.w,c.metrics.w)}d=k;m=m||"";m.match("right")?a-=this.metrics.w:m.match("_center")&&(a-=this.metrics.w/2);m.match("bottom")?d-=this.metrics.h:m.match("center_")&&(d-=this.metrics.h/2);m=this.children;f=0;for(e=m.length;f<e;f++)"left"===m[f].style.align?m[f].metrics.offsetX=
a:"right"===m[f].style.align?m[f].metrics.offsetX=a+this.metrics.w-m[f].metrics.w:"center"===m[f].style.align?m[f].metrics.offsetX=a+(this.metrics.w-m[f].metrics.w)/2:"justify"===m[f].style.align&&20<=n&&(g=f<e-1?m[f+1].value:null,m[f].metrics.offsetX=a,"wrap"===g&&m[f].justifyAux(n)),m[f].metrics.y=d,d+=parseInt(m[f].metrics.ascent+.5),m[f].metrics.offsetY=d,g=parseInt(m[f].metrics.descent+.5)+parseInt(1.5+.05*m[f].style.size),d+=g};k.prototype.breakLines=function(c){for(var b,f=0,d=!1,e=[],g=0,
m=this.children.length;g<m;g++)b=this.children[g],d?e.push(b):("text"===b.nodeType||"space"===b.nodeType?(a.ctx.font=b.style.toString(),b.metrics.w=a.ctx.measureText(b.value).width):"word"===b.nodeType?b.updateLine():"formula"===b.nodeType&&b.updateFormula(),f+=b.metrics.w,f>c&&"space"!==b.nodeType&&0<g&&(d=!0,e.push(b)));if(0<e.length)for(c=new k("wrap","textLineBlock",this.style.clone(),null),this.parent.insertAfter(this,c),g=0,m=e.length;g<m;g++)e[g].parent&&e[g].parent.removeChild(e[g]),c.addChild(e[g])};
k.prototype.updateLine=function(c){var b=this;if("textLineBlock"===this.nodeType||"word"===this.nodeType){this.metrics.w=0;this.metrics.ascent=0;for(var f=this.metrics.descent=0,d=this.children,g,m=0,k=d.length;m<k;m++){g=d[m];if("text"===g.nodeType){a.ctx.font=g.style.toString();var n=""!==g.value?g.value:a.in_editor?"\u200a":"";g.metrics=e(a.ctx.font);g.metrics.w=a.ctx.measureText(n).width;g.metrics.offsetX=f;Object.defineProperties(g.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},
y:{get:function(){return b.metrics.offsetY+this.offsetY}}})}"space"===g.nodeType?(a.ctx.font=g.style.toString(),g.metrics=e(a.ctx.font),g.metrics.w=m===k-1?0:c?c:a.ctx.measureText(" ").width,g.metrics.offsetX=f,Object.defineProperties(g.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY+this.offsetY}}})):"word"===g.nodeType&&(g.updateLine(),g.metrics.offsetX_aux=f,Object.defineProperties(g.metrics,{offsetX:{get:function(){return b.metrics.offsetX+
this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}}));"hyperlink"===g.nodeType&&(a.ctx.font=g.styleString,n=""!==g.value?g.value:a.in_editor?"\u200a":"",g.metrics=e(a.ctx.font),g.metrics.w=a.ctx.measureText(n).width,g.metrics.offsetX=f,Object.defineProperties(g.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}}),g.clickCatcher||(g.clickCatcher=a.newHTML("div",{style:"position:absolute;width:"+g.metrics.w+"px;height:"+
g.metrics.h+"px;cursor:pointer;"}),g.clickCatcher.rtfNode=g,g.clickCatcher.action=new a.OpenURL(this.evaluator.parent,g.URL),g.clickCatcher.addEventListener("click",function(a){this.rtfNode.click=!0;this.action.execute();this.rtfNode.draw(this.rtfNode.ctx)})));"componentNumCtrl"===g.nodeType&&(g.componentNumCtrl=this.evaluator.parent.getControlByCId(g.value),a.ctx.font=g.styleString,g.metrics=e(a.ctx.font),g.metrics.w=g.componentNumCtrl.w,g.metrics.h=g.componentNumCtrl.h,g.metrics.offsetX=f,Object.defineProperties(g.metrics,
{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}}));"componentSpace"===g.nodeType?(g.componentSpace=this.evaluator.parent.getSpaceByCId(g.value),a.ctx.font=g.styleString,g.metrics=e(a.ctx.font),g.metrics.w=g.componentSpace.w,g.metrics.h=g.componentSpace.h,g.metrics.offsetX=f,Object.defineProperties(g.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}})):"formula"===g.nodeType&&(g.updateFormula(),
g.metrics.marginX=g.metrics.marginY=g.metrics.paddingX=g.metrics.paddingY=0,g.metrics.offsetX_aux=f,Object.defineProperties(g.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}}),g.metrics.w+=2*g.metrics.paddingX,g.metrics.ascent+=g.metrics.paddingY,g.metrics.descent+=g.metrics.paddingY,g.metrics.h+=2*g.metrics.paddingY,f+=2*g.metrics.marginX);
this.metrics.w+=g.metrics.w+2*g.metrics.marginX;this.metrics.ascent=Math.max(this.metrics.ascent,g.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,g.metrics.descent);f+=g.metrics.w}this.metrics.h=this.metrics.ascent+this.metrics.descent}};k.prototype.updateFormula=function(){var c=this;this.metrics={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};for(var d=this.children,f,m=0,k={metrics:{ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,
offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0}},u=0,q=d.length;u<q;u++){f=d[u];if("text"===f.nodeType){a.ctx.font=f.style.toString(!0);var n=""!==f.value?f.value:a.in_editor?"\u200a":"";f.metrics=e(a.ctx.font);f.metrics.w=a.ctx.measureText(n).width;f.metrics.offsetX=m;Object.defineProperties(f.metrics,{x:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}});m+=c.metrics.marginX}else if("dynamicText"===f.nodeType){n=void 0===
f.decimals?p:f.evaluator.eval(f.decimals);var h=void 0===f.fixed?b:f.fixed,x=f.evaluator.eval(f.value);parseFloat(x).toString()===x.toString()&&(x=h?parseFloat(x).toFixed(n):a.removeNeedlessDecimals(parseFloat(x).toFixed(n)),x=(""+x).replace(".",f.decimal_symbol));f.evalValue=x;a.ctx.font=f.style.toString(!0);f.metrics=e(a.ctx.font);f.metrics.marginX=0;f.metrics.paddingX=0;f.metrics.w=a.ctx.measureText(x).width+2*f.metrics.paddingX;f.metrics.offsetX_aux=m;Object.defineProperties(f.metrics,{x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return c.metrics.offsetY}}});m+=2*f.metrics.marginX}if("superIndex"===f.nodeType)n=f,n.updateFormula(),n.metrics.marginX=0,n.metrics.paddingX=0,n.metrics.paddingY=0,n.metrics.offsetX_aux=m,n.metrics.prevChild=k,Object.defineProperties(n.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+
c.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return c.metrics.offsetY+this.ascent+(this.prevChild.metrics.descent-this.prevChild.metrics.ascent)/2-this.h}}}),n.metrics.w+=2*n.metrics.paddingX,n.metrics.ascent+=n.metrics.paddingY,n.metrics.descent+=n.metrics.paddingY,n.metrics.h+=2*n.metrics.paddingY,n.metrics.tmp_ascent=n.metrics.h+(n.metrics.prevChild.metrics.ascent-n.metrics.prevChild.metrics.descent)/2,m+=2*n.metrics.marginX;else if("subIndex"===f.nodeType)n=f,n.updateFormula(),
n.metrics.marginX=0,n.metrics.paddingX=0,n.metrics.paddingY=0,n.metrics.offsetX_aux=m,n.metrics.prevChild=k,Object.defineProperties(n.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY+this.ascent+(this.prevChild.metrics.descent-this.prevChild.metrics.ascent)/2}}}),n.metrics.w+=n.metrics.paddingX,n.metrics.ascent+=n.metrics.paddingY,
n.metrics.descent+=n.metrics.paddingY,n.metrics.h+=2*n.metrics.paddingY,this.metrics.descent=n.metrics.ascent+(n.metrics.prevChild.metrics.descent-n.metrics.prevChild.metrics.ascent)/2+n.metrics.descent,m+=n.metrics.marginX;else if("fraction"===f.nodeType){h=f;h.updateFormula();n=h.children;x=n[0];n=n[1];h.metrics.marginX=parseInt(.5+.075*this.style.size);h.metrics.paddingX=0;h.metrics.paddingY=0;var w=Math.max(x.metrics.w,n.metrics.w)+2*h.metrics.paddingX;h.metrics.prevChild=k;h.metrics.offsetX_aux=
m;var z=parseInt(-k.metrics.descent+4*k.metrics.h/9);Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY+z}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY-z}}});Object.defineProperties(x.metrics,{parent:{value:h},maxWidth:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+
parseInt((this.maxWidth-this.w)/2)}},offsetY:{get:function(){return this.parent.metrics.offsetY-this.descent-this.parent.metrics.paddingY}}});Object.defineProperties(n.metrics,{parent:{value:h},maxWidth:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+parseInt((this.maxWidth-this.w)/2)}},offsetY:{get:function(){return this.parent.metrics.offsetY+this.ascent+this.parent.metrics.paddingY}}});h.metrics.w=
w;h.metrics.ascent=x.metrics.h+z+2*h.metrics.paddingY;h.metrics.descent=n.metrics.h-z+2*h.metrics.paddingY;h.metrics.h=x.metrics.h+n.metrics.h+4*h.metrics.paddingY;m+=2*h.metrics.marginX}else if("radical"===f.nodeType){k=f;k.updateFormula();n=k.children;h=n[0];var A=n[1];k.metrics.marginX=parseInt(1.5+.075*this.style.size);k.metrics.paddingX=parseInt(1.5+.075*this.style.size);k.metrics.paddingY=parseInt(1.5+.05*this.style.size);k.metrics.offsetX_aux=m;Object.defineProperties(k.metrics,{x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});n=k.style.size;k.radicalSign={w:n,scaleX:n/722,scaleY:A.metrics.h/1E3};x=parseInt(h.metrics.w-2*k.radicalSign.w/3);Object.defineProperties(k.radicalSign,{parent:{value:k},displaceIndex:{value:x},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)}},
y:{get:function(){return c.metrics.offsetY-A.metrics.ascent}}});Object.defineProperties(h.metrics,{parent:{value:k},displaceIndex:{value:x},fontSize:{value:n},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)-this.displaceIndex}},offsetY:{get:function(){return c.metrics.offsetY-this.descent-2*this.fontSize/5}}});Object.defineProperties(A.metrics,{parent:{value:k},
displaceIndex:{value:x},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.parent.radicalSign.w+Math.max(this.displaceIndex,0)}},offsetY:{get:function(){return c.metrics.offsetY}}});x=h.metrics.w<2*k.radicalSign.w/3?k.radicalSign.w:parseInt(h.metrics.w+k.radicalSign.w/3);k.metrics.w=x+2*k.metrics.paddingX+A.metrics.w;k.metrics.ascent=Math.max(A.metrics.ascent,h.metrics.h+2*n/5)+
k.metrics.paddingY;k.metrics.descent=A.metrics.descent+k.metrics.paddingY;k.metrics.h=k.metrics.ascent+k.metrics.descent;m+=2*k.metrics.marginX}else if("sum"===f.nodeType){h=f;h.updateFormula();n=h.children;x=n[0];w=n[1];var E=n[2];h.metrics.marginX=parseInt(1.5+.075*this.style.size);h.metrics.paddingX=parseInt(1.5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+.05*this.style.size);h.metrics.offsetX_aux=m;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=f.style.toString();var J=e(a.ctx.font);k=parseInt(1.2*J.h);n=parseInt(.5+780*k/1E3);h.sigmaSign={w:n,h:k,scale:k/1E3};var F=Math.max(w.metrics.w,x.metrics.w,h.sigmaSign.w);h.sigmaSign.parent=h;Object.defineProperties(h.sigmaSign,{sumWidth:{value:F},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-
this.w)/2)}},y:{get:function(){return c.metrics.offsetY+J.descent-(this.h+J.h)/2}}});n=J.descent-w.metrics.descent-(k+J.h)/2-h.metrics.paddingY;Object.defineProperties(w.metrics,{parent:{value:h},sumWidth:{value:F},newBaselineTo:{value:n},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaselineTo}}});
k=x.metrics.ascent+J.descent+(k-J.h)/2+h.metrics.paddingY;Object.defineProperties(x.metrics,{parent:{value:h},sumWidth:{value:F},newBaselineFrom:{value:k},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaselineFrom}}});Object.defineProperties(E.metrics,{parent:{value:h},sumWidth:{value:F},
x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.sumWidth}},offsetY:{get:function(){return c.metrics.offsetY}}});h.metrics.w=F+E.metrics.w+3*h.metrics.paddingX;h.metrics.ascent=Math.max(E.metrics.ascent,-n+w.metrics.ascent)+h.metrics.paddingY;h.metrics.descent=Math.max(E.metrics.descent,k+x.metrics.descent)+h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;
m+=2*h.metrics.marginX}else if("integral"===f.nodeType){h=f;h.updateFormula();n=h.children;x=n[0];w=n[1];E=n[2];h.metrics.marginX=parseInt(1.5+.075*this.style.size);h.metrics.paddingX=parseInt(1.5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+.05*this.style.size);h.metrics.offsetX_aux=m;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},
offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=f.style.toString();J=e(a.ctx.font);F=parseInt(1.2*J.h);var G=parseInt(10.5+529*F/1E3);h.sign={w:G,h:F,scale:F/1E3};h.sign.parent=h;Object.defineProperties(h.sign,{x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},y:{get:function(){return c.metrics.offsetY+J.descent-(this.h+J.h)/2}}});n=J.descent-(F+J.h)/2-w.metrics.descent+F/3;Object.defineProperties(w.metrics,{parent:{value:h},integralWidth:{value:G},
newBaselineTo:{value:n},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt(4*this.integralWidth/5)}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaselineTo}}});k=J.descent+x.metrics.ascent/2;Object.defineProperties(x.metrics,{parent:{value:h},integralWidth:{value:G},newBaselineFrom:{value:k},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt(2*this.integralWidth/5)}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaselineFrom}}});G=Math.max(parseInt(3*G/5)+w.metrics.w,parseInt(2*G/5+x.metrics.w))+h.metrics.paddingX;Object.defineProperties(E.metrics,{parent:{value:h},whatDisplace:{value:G},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+
this.whatDisplace}},offsetY:{get:function(){return c.metrics.offsetY}}});h.metrics.w=G+E.metrics.w+2*h.metrics.paddingX;h.metrics.ascent=Math.max(E.metrics.ascent,-n+w.metrics.ascent)+h.metrics.paddingY;h.metrics.descent=Math.max(E.metrics.descent,k+x.metrics.descent,F-h.metrics.ascent)+h.metrics.paddingY;h.metrics.h=Math.max(h.metrics.ascent+h.metrics.descent,F);m+=2*h.metrics.marginX}else if("prod"===f.nodeType)h=f,h.updateFormula(),n=h.children,x=n[0],w=n[1],E=n[2],h.metrics.marginX=parseInt(1.5+
.075*this.style.size),h.metrics.paddingX=parseInt(1.5+.075*this.style.size),h.metrics.paddingY=parseInt(1.5+.05*this.style.size),h.metrics.offsetX_aux=m,Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}}),a.ctx.font=f.style.toString(),J=e(a.ctx.font),k=parseInt(1.2*J.h),n=parseInt(.5+
876*k/1E3),h.piSign={w:n,h:k,scale:k/1E3},F=Math.max(w.metrics.w,x.metrics.w,h.piSign.w),h.piSign.parent=h,Object.defineProperties(h.piSign,{prodWidth:{value:F},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},y:{get:function(){return c.metrics.offsetY+J.descent-(this.h+J.h)/2}}}),n=J.descent-w.metrics.descent-(k+J.h)/2-h.metrics.paddingY,Object.defineProperties(w.metrics,{parent:{value:h},prodWidth:{value:F},newBaselineTo:{value:n},
x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaselineTo}}}),k=x.metrics.ascent+J.descent+(k-J.h)/2+h.metrics.paddingY,Object.defineProperties(x.metrics,{parent:{value:h},prodWidth:{value:F},newBaselineFrom:{value:k},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaselineFrom}}}),Object.defineProperties(E.metrics,{parent:{value:h},prodWidth:{value:F},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.prodWidth}},offsetY:{get:function(){return c.metrics.offsetY}}}),
h.metrics.w=F+E.metrics.w+3*h.metrics.paddingX,h.metrics.ascent=Math.max(E.metrics.ascent,-n+w.metrics.ascent)+h.metrics.paddingY,h.metrics.descent=Math.max(E.metrics.descent,k+x.metrics.descent)+h.metrics.paddingY,h.metrics.h=h.metrics.ascent+h.metrics.descent,m+=2*h.metrics.marginX;else if("limit"===f.nodeType){k=f;k.updateFormula();n=k.children;var D=n[0];h=n[1];n=n[2];k.metrics.marginX=parseInt(1.5+.075*this.style.size);k.metrics.paddingX=parseInt(1.5+.075*this.style.size);k.metrics.paddingY=
parseInt(1.5+.05*this.style.size);k.metrics.offsetX_aux=m;Object.defineProperties(k.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=f.style.toString();J=e(a.ctx.font);x=parseInt(.5+a.ctx.measureText("l\u00edm").width);w=parseInt(.5+a.ctx.measureText("\u2192").width);E=Math.max(x,D.metrics.w+w+h.metrics.w);
k.limitText={parent:k};Object.defineProperties(k.limitText,{limitWidth:{value:E},limitTextWidth:{value:x},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+(this.limitWidth-this.limitTextWidth)/2}}});x=J.descent+Math.max(D.metrics.ascent,h.metrics.ascent,2*J.ascent/3)+k.metrics.paddingY;k.limitArrow={parent:k};Object.defineProperties(k.limitArrow,{newBaseline:{value:x},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+D.metrics.w}},y:{get:function(){return c.metrics.offsetY+
this.newBaseline}}});Object.defineProperties(D.metrics,{parent:{value:k},newBaseline:{value:x},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaseline}}});Object.defineProperties(h.metrics,{parent:{value:k},arrowWidth:{value:w},newBaseline:{value:x},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+D.metrics.w+this.arrowWidth}},offsetY:{get:function(){return c.metrics.offsetY+this.newBaseline}}});Object.defineProperties(n.metrics,{parent:{value:k},limitWidth:{value:E},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.limitWidth}},offsetY:{get:function(){return c.metrics.offsetY}}});
k.metrics.w=E+n.metrics.w+3*k.metrics.paddingX;k.metrics.ascent=Math.max(n.metrics.ascent,J.ascent)+k.metrics.paddingY;w=0;n=Math.max(D.metrics.descent,h.metrics.descent,n.metrics.descent);if(0!=D.metrics.h||0!=h.metrics.h)w=x,n=Math.max(D.metrics.descent,h.metrics.descent,n-w);k.metrics.descent=w+n+k.metrics.paddingY;k.metrics.h=k.metrics.ascent+k.metrics.descent;m+=2*k.metrics.marginX}else if("matrix"===f.nodeType){x=f;x.updateFormula();n=x.children;w=x.rows;E=x.columns;x.metrics.marginX=parseInt(1.5+
.075*this.style.size);x.metrics.paddingX=parseInt(5+.075*this.style.size);x.metrics.paddingY=parseInt(1.5+.05*this.style.size);x.metrics.offsetX_aux=m;Object.defineProperties(x.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=f.style.toString();J=e(a.ctx.font);F=[];G=[];k=0;for(var B=w*E;k<B;k++){var L=
parseInt(k/E);var H=k%E;F[L]=Math.max(F[L]||0,n[k].metrics.h);G[H]=Math.max(G[H]||0,n[k].metrics.w)}var M=(1+E)*x.metrics.paddingX;for(k=0;k<E;k++)M+=G[k];var P=(1+w)*x.metrics.paddingY;for(k=0;k<w;k++)P+=F[k];h=J.descent-J.h/2;k=0;for(B=w*E;k<B;k++)L=parseInt(k/E),H=k%E,n[k].metrics.offsetX_aux=g(G,H)+(G[H]-n[k].metrics.w)/2+H*x.metrics.paddingX,n[k].metrics.offsetY_aux=g(F,L)+(F[L]-n[k].metrics.h)/2+(1+L)*x.metrics.paddingY,Object.defineProperties(n[k].metrics,{parent:{value:x},matrixH:{value:P},
dispY:{value:h},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY-this.matrixH/2+this.ascent+this.offsetY_aux+this.dispY}}});x.metrics.w=M;x.metrics.ascent=P/2-h;x.metrics.descent=P/2+h;x.metrics.h=x.metrics.ascent+x.metrics.descent;m+=2*x.metrics.marginX}else if("defparts"===f.nodeType){x=f;x.updateFormula();n=f.children;
w=f.parts;x.metrics.marginX=parseInt(1.5+.075*this.style.size);x.metrics.paddingX=parseInt(1.5+.075*this.style.size);x.metrics.paddingY=parseInt(1.5+.05*this.style.size);x.metrics.offsetX_aux=m;Object.defineProperties(x.metrics,{parent:{value:c},x:{get:function(){return this.offsetX-2*this.marginX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+3*this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=
f.style.toString();J=e(a.ctx.font);E=0;F=x.metrics.paddingY;h=J.descent-J.h/2;for(k=0;k<w;k++)n[k].metrics.offsetY_aux=F,E=Math.max(E,n[k].metrics.w),F+=n[k].metrics.h+x.metrics.paddingY,Object.defineProperties(n[k].metrics,{parent:{value:x},dispY:{value:h},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},offsetY:{get:function(){return c.metrics.offsetY-this.parent.metrics.defpartsH/
2+this.ascent+this.offsetY_aux+this.dispY}}});x.metrics.defpartsH=F;x.metrics.w=E+4*x.metrics.paddingX;x.metrics.ascent=F/2-h;x.metrics.descent=F/2+h;x.metrics.h=x.metrics.ascent+x.metrics.descent;m+=2*x.metrics.marginX}else if("numerator"===f.nodeType||"denominator"===f.nodeType||"index"===f.nodeType||"radicand"===f.nodeType||"from"===f.nodeType||"to"===f.nodeType||"what"===f.nodeType||"element"===f.nodeType)f.updateFormula(),f.metrics.paddingX=parseInt(1.5+.075*this.style.size),f.metrics.paddingY=
parseInt(1.5+.05*this.style.size),f.metrics.ascent+=f.metrics.paddingY,f.metrics.descent+=f.metrics.paddingY,f.metrics.h=f.metrics.ascent+f.metrics.descent,1==f.children.length&&"text"==f.children[0].nodeType&&""==f.children[0].value?(f.metrics.w=0,a.in_editor||(f.metrics.ascent=f.metrics.descent=f.metrics.h=0)):f.metrics.w+=2*f.metrics.paddingX;k=f;this.metrics.ascent=Math.max(this.metrics.ascent,f.metrics.tmp_ascent||f.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,f.metrics.descent);
this.metrics.w+=f.metrics.w+2*f.metrics.marginX;this.metrics.h=this.metrics.ascent+this.metrics.descent;m+=f.metrics.w}};k.prototype.justifyAux=function(a){for(var c=0,b=0,d=0,e=this.children.length;d<e-1;d++)"space"===this.children[d].nodeType?c++:b+=this.children[d].metrics.w;this.updateLine((a-b)/c)};k.prototype.drawTextBlock=function(a){a.fillStyle=q;a.shadowBlur=this.style.shadowBlur;a.shadowOffsetX=this.style.shadowOffsetX;a.shadowOffsetY=this.style.shadowOffsetY;a.shadowColor=this.style.shadowColor;
for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);a.shadowColor="transparent"};k.prototype.drawTextLineBlock=function(a){for(var c=0,b=this.children.length;c<b;c++)d=!1,this.children[c].draw(a)};k.prototype.drawText=function(a){if(""!==this.value){var c=this.metrics.x,b=this.metrics.y;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.font=this.style.toString(d);a.beginPath();this.style.overline&&(a.rect(c,b-this.metrics.ascent+
parseInt(1+this.style.size/25),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());this.style.underline&&(a.rect(c,b+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());if(this.style.border){var e=a.strokeStyle;a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8);a.lineJoin="round";a.miterLimit=2;a.strokeStyle=this.style.border.getColor();a.strokeText(this.value,c,b);a.strokeStyle=
e}a.fillText(this.value,c,b)}};k.prototype.drawWord=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a)};k.prototype.drawSpace=function(a){};k.prototype.drawDynamicText=function(a){var c=this.metrics.x+this.metrics.paddingX,b=this.metrics.y;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.font=this.style.toString(d);a.beginPath();this.style.overline&&(a.rect(c,b-this.metrics.ascent+parseInt(1+this.style.size/
25),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());this.style.underline&&(a.rect(c,b+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());a.fillText(this.evalValue,c,b);this.drawBorder(a,"blue")};k.prototype.drawHyperlink=function(a){var c=this.metrics.x,b=this.metrics.y;this.ctx=a;this.clickCatcher.parentNode||(a.canvas.nextSibling.className?a.canvas.parentNode.insertBefore(this.clickCatcher,a.canvas.nextSibling.nextSibling):a.canvas.parentNode.insertBefore(this.clickCatcher,
a.canvas.nextSibling));this.clickCatcher.style.left=c+"px";this.clickCatcher.style.top=b-this.metrics.ascent+"px";a.fillStyle="blue";this.click&&(a.fillStyle="white",a.fillRect(c,b-this.metrics.ascent,this.metrics.w,this.metrics.h),a.fillStyle="red");a.font=this.style.toString(d);a.beginPath();a.rect(c,b+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25));a.fill();a.fillText(this.value,c,b)};k.prototype.drawFormula=function(a){for(var c=0,b=this.children.length;c<b;c++)d=
!0,this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawFraction=function(a){a.lineWidth=5;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.beginPath();var c=parseInt(1+this.style.size/24);a.rect(this.metrics.x,this.metrics.offsetY-parseInt(c/2),this.metrics.w,c);a.fill();this.children[0].draw(a);this.children[1].draw(a);this.drawBorder(a,"blue")};k.prototype.drawNumDen=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);
this.drawBorder(a,"blue")};k.prototype.drawSuperIndex=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawSubIndex=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawRadical=function(a){a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.save();a.translate(this.radicalSign.x,this.radicalSign.y);a.scale(this.radicalSign.scaleX,
this.radicalSign.scaleY);this.drawRadicalSign(a);a.restore();a.beginPath();a.fillRect(this.children[1].metrics.x+2.5,this.radicalSign.y-.5,this.children[1].metrics.w-1.5,parseInt(1+this.style.size/18));for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawSum=function(a){a.save();a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.translate(this.sigmaSign.x,this.sigmaSign.y);a.scale(this.sigmaSign.scale,
this.sigmaSign.scale);if(this.style.border){var c=a.strokeStyle;a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8);a.lineWidth=parseInt(a.lineWidth/this.sigmaSign.scale);a.lineJoin="round";a.miterLimit=2;a.strokeStyle=this.style.border.getColor();a.strokeStyle=c}this.drawSigmaSign(a);a.restore();c=0;for(var b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawIntegral=function(a){a.save();
a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.translate(this.sign.x,this.sign.y);a.scale(this.sign.scale,this.sign.scale);this.drawIntegralSign(a);a.restore();for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawProd=function(a){a.save();a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.translate(this.piSign.x,this.piSign.y);
a.scale(this.piSign.scale,this.piSign.scale);this.drawProdSign(a);a.restore();for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawLimit=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.font=this.style.toString();a.fillText("l\u00edm",this.limitText.x,this.metrics.y);0!=this.children[1].metrics.h&&a.fillText("\u2192",
this.limitArrow.x,this.limitArrow.y);this.drawBorder(a,"blue")};k.prototype.drawMatrix=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);b=parseInt(1.5+this.style.size/25);c=b/2;a.lineWidth=b;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.beginPath();if(0==this.matrix_type)a.moveTo(this.metrics.x+c+1.5*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+c,this.metrics.y+c-
this.metrics.ascent),a.lineTo(this.metrics.x+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.lineTo(this.metrics.x+c+1.5*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-c-1.5*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.lineTo(this.metrics.x+
this.metrics.w-c-1.5*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent+this.metrics.h);else if(1==this.matrix_type)a.moveTo(this.metrics.x+c+2*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent),a.bezierCurveTo(this.metrics.x-c,this.metrics.y+c-this.metrics.ascent,this.metrics.x-c,this.metrics.y+c-this.metrics.ascent+this.metrics.h,this.metrics.x+c+2*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-c-2*this.metrics.marginX,
this.metrics.y+c-this.metrics.ascent),a.bezierCurveTo(this.metrics.x+this.metrics.w+c,this.metrics.y+c-this.metrics.ascent,this.metrics.x+this.metrics.w+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w-c-2*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent+this.metrics.h);else if(2==this.matrix_type){b=3*this.metrics.marginX;var d=b/2;a.moveTo(this.metrics.x+c+b,this.metrics.y+c-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent,
this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+
c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+c+d,this.metrics.y-c-this.metrics.ascent+this.metrics.h,this.metrics.x+c+d,this.metrics.y-c-this.metrics.ascent+this.metrics.h,this.metrics.x+
c+b,this.metrics.y-c-this.metrics.ascent+this.metrics.h);a.moveTo(this.metrics.x+this.metrics.w+c-b,this.metrics.y+c-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent,this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent,this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);
a.bezierCurveTo(this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+
c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+this.metrics.w+c-d,this.metrics.y+c-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+this.metrics.w+c-d,this.metrics.y-c-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w+c-d,this.metrics.y-c-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w+c-b,this.metrics.y-c-this.metrics.ascent+this.metrics.h)}else 3==this.matrix_type?
(a.moveTo(this.metrics.x+c,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent+this.metrics.h)):4==this.matrix_type&&(a.moveTo(this.metrics.x+c,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+
c+1.25*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+c+1.25*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-c-1.25*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-c-1.25*this.metrics.marginX,
this.metrics.y+c-this.metrics.ascent+this.metrics.h));a.stroke();this.drawBorder(a,"blue")};k.prototype.drawDefparts=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);b=parseInt(1.5+this.style.size/25);c=b/2;a.lineWidth=b;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:q;a.beginPath();b=3*this.metrics.marginX;var d=b/2;a.moveTo(this.metrics.x+c+b,this.metrics.y+c-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+
c+d,this.metrics.y+c-this.metrics.ascent,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h/
2);a.bezierCurveTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+c+d,this.metrics.y+c-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+c+d,this.metrics.y-c-this.metrics.ascent+this.metrics.h,this.metrics.x+c+d,this.metrics.y-c-this.metrics.ascent+
this.metrics.h,this.metrics.x+c+b,this.metrics.y-c-this.metrics.ascent+this.metrics.h);a.stroke();this.drawBorder(a,"blue")};k.prototype.drawGenericBlock=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};k.prototype.drawComponentNumCtrl=function(a){this.componentNumCtrl.expresion=this.evaluator.parser.parse("("+this.metrics.x+","+(this.metrics.y-this.metrics.ascent)+","+this.componentNumCtrl.w+","+this.componentNumCtrl.h+")");this.componentNumCtrl&&
this.componentNumCtrl.parent&&this.componentNumCtrl.parent.readyApp&&this.componentNumCtrl.update(!0)};k.prototype.drawComponentSpace=function(a){this.componentSpace.xExpr=this.evaluator.parser.parse(this.metrics.x.toString());this.componentSpace.yExpr=this.evaluator.parser.parse((this.metrics.y-this.metrics.ascent).toString());this.componentSpace&&this.componentSpace.parent&&this.componentSpace.parent.readyApp&&this.componentSpace.update(!0)};k.prototype.drawRadicalSign=function(a){a.beginPath();
a.moveTo(759,1);a.bezierCurveTo(751,1,744,5,739,15);a.lineTo(325,878);a.lineTo(153,500);a.bezierCurveTo(148,489,142,486,136,491);a.lineTo(2,596);a.bezierCurveTo(-3,600,19,626,24,622);a.lineTo(89,575);a.lineTo(282,997);a.bezierCurveTo(285,1003,309,1003,314,993);a.lineTo(773,40);a.lineTo(773,1);a.closePath();a.stroke();a.fill()};k.prototype.drawSigmaSign=function(a){a.beginPath();a.moveTo(780,707);a.lineTo(750,707);a.bezierCurveTo(728,805,695,872,585,872);a.lineTo(180,872);a.lineTo(509,447);a.lineTo(225,
65);a.lineTo(538,65);a.bezierCurveTo(668,65,705,114,726,246);a.lineTo(756,246);a.lineTo(756,0);a.lineTo(25,0);a.lineTo(384,500);a.lineTo(0,1E3);a.lineTo(729,1E3);a.closePath();a.stroke();a.fill()};k.prototype.drawIntegralSign=function(a){a.beginPath();a.moveTo(150,828);a.bezierCurveTo(129,916,108,972,67,972);a.bezierCurveTo(61,972,58,970,58,966);a.bezierCurveTo(58,957,73,958,73,932);a.bezierCurveTo(73,918,60,910,46,910);a.bezierCurveTo(22,910,1,932,1,961);a.bezierCurveTo(1,981,22,1E3,57,1E3);a.bezierCurveTo(154,
1E3,198,895,216,824);a.lineTo(375,181);a.bezierCurveTo(398,90,420,27,464,28);a.bezierCurveTo(470,28,473,30,473,34);a.bezierCurveTo(473,41,458,47,458,69);a.bezierCurveTo(458,83,471,89,485,89);a.bezierCurveTo(509,89,530,67,530,38);a.bezierCurveTo(530,18,508,0,473,0);a.bezierCurveTo(368,0,326,120,309,190);a.closePath();a.stroke();a.fill()};k.prototype.drawProdSign=function(a){a.beginPath();a.moveTo(876.3561,999.59384);a.lineTo(876.3561,972.20771);a.lineTo(858.75073,972.20771);a.bezierCurveTo(794.19771,
972.20771,761.92121,931.12852,761.92121,847.99206);a.lineTo(761.92121,144.75542);a.bezierCurveTo(761.92121,61.618964,789.30733,27.386304,876.3561,27.386304);a.lineTo(876.3561,1.7633057E-4);a.lineTo(1.184082E-5,1.7633057E-4);a.lineTo(1.184082E-5,27.386304);a.lineTo(16.627304,27.386304);a.bezierCurveTo(77.268015,27.386304,115.41298,51.838204,115.41298,148.66773);a.lineTo(115.41298,865.59743);a.bezierCurveTo(115.41298,936.99697,84.114547,972.20771,18.583456,972.20771);a.lineTo(1.184082E-5,972.20771);
a.lineTo(1.184082E-5,999.59384);a.lineTo(359.93198,999.59384);a.lineTo(359.93198,972.20771);a.lineTo(329.61162,972.20771);a.bezierCurveTo(265.0586,972.20771,243.54093,932.10659,243.54093,841.14553);a.lineTo(243.54093,64.553192);a.lineTo(633.79325,64.553192);a.lineTo(633.79325,841.14553);a.bezierCurveTo(633.79325,916.45738,616.18788,972.20771,547.72257,972.20771);a.lineTo(516.42413,972.20771);a.lineTo(516.42413,999.59384);a.closePath();a.stroke();a.fill()};k.prototype.drawBorderSpecial=function(a,
b){a.beginPath();a.setLineDash([1,2]);a.strokeStyle=b;a.lineWidth=1;a.rect(parseInt(this.metrics.x)+.5,parseInt(this.metrics.y-this.metrics.ascent)+.5,this.metrics.w,this.metrics.h);a.stroke();a.setLineDash([])};k.prototype.toRTF=function(){var a=[],b=[],d="";this.mergeTextNodes();for(var e=0,g=this.children.length;e<g;e++){var k=this.children[e];"textLineBlock"===k.nodeType&&(d+=k.toRTFAux(a,b)+(1<g&&e<g-1?"\\par":""))}k="{\\fonttbl";e=0;for(g=a.length;e<g;e++)k+="\\f"+e+"\\fcharset0 "+a[e]+";";
a="";if(0<b.length){a="{\\colortbl";e=0;for(g=b.length;e<g;e++)a+=b[e];a+="}"}return"{\\rtf1\\uc0"+(k+"}")+a+d+"}"};k.prototype.toRTFAux=function(a,b){for(var c,d,e,g=null,l="",k,h,m,p,z,A=0,E=this.children.length;A<E;A++)k=h="",c=this.children[A],m=this.addToFontTable(c.style.family,a),p=c.style.size,z=this.addToColorTable(c.style.color,b),null===z&&0<b.length&&(z=this.addToColorTable(q,b)),z!==g&&(k+="\\cf"+z,g=z),m!==d&&(k+="\\f"+m,d=m),p!==e&&(k+="\\fs"+2*p,e=p),c.style.italic&&(k+="\\i",h="\\i0"+
h),c.style.bold&&(k+="\\b",h="\\b0"+h),c.style.underline&&(k+="\\ul",h="\\ulnone"+h),c.style.overline&&(k+="\\ol",h="\\olnone"+h),"text"===c.nodeType?(c.value=c.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),c=""!==k?k+" "+c.value+h:""!==l&&"}"!==l.charAt(l.length-1)?" "+c.value:c.value,l+=c):"formula"===c.nodeType?l+="{\\*\\mjaformula"+c.formulaToRTF(d,e,g,a,b)+"}":"componentSpace"===c.nodeType?l+="{\\*\\component\\Space "+c.value+"}":"componentNumCtrl"===c.nodeType&&
(l+="{\\*\\component\\NumCtrl "+c.value+"}");return l};k.prototype.formulaToRTF=function(a,b,d,e,g){for(var c,f="",l,h,k,m,p=0,r=this.children.length;p<r;p++)l=h="",c=this.children[p],k=this.addToFontTable(c.style.family,e),m=this.addToColorTable(c.style.color,g),null===m&&0<g.length&&(m=this.addToColorTable(q,g)),k!==a&&(l+="\\f"+k,a=k),m!==d&&(l+="\\cf"+m,"text"!==c.nodeType||"text"===c.nodeType&&""!==c.value)&&(d=m),c.style.italic&&(l+="\\i",h="\\i0"+h),c.style.bold&&(l+="\\b",h="\\b0"+h),c.style.underline&&
(l+="\\ul",h="\\ulnone"+h),c.style.overline&&(l+="\\ol",h="\\olnone"+h),"text"===c.nodeType&&""!==c.value?(c.value=c.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),tmpRTF=""!==l?l+" "+c.value+h:"}"!==f.charAt(f.length-1)?" "+c.value:c.value,f+=tmpRTF):"dynamicText"===c.nodeType?(c.value=""===c.value?" ":c.value,f+=l+"{\\expr "+c.value+"\\decimals "+(c.decimals||2)+"\\fixed"+(c.fixed?1:0)+"}"+h):"fraction"===c.nodeType||"radical"===c.nodeType||"index"===c.nodeType||
"radicand"===c.nodeType||"sum"===c.nodeType||"integral"===c.nodeType||"prod"===c.nodeType||"limit"===c.nodeType||"from"===c.nodeType||"to"===c.nodeType||"what"===c.nodeType||"element"===c.nodeType?f+="{\\"+c.nodeType+c.formulaToRTF(a,b,d,e,g)+"}":"numerator"===c.nodeType?f+="{\\num"+c.formulaToRTF(a,b,d,e,g)+"}":"denominator"===c.nodeType?f+="{\\den"+c.formulaToRTF(a,b,d,e,g)+"}":"superIndex"===c.nodeType?f+="{\\supix"+c.formulaToRTF(a,b,d,e,g)+"}":"subIndex"===c.nodeType?f+="{\\subix"+c.formulaToRTF(a,
b,d,e,g)+"}":"matrix"===c.nodeType?f+="{\\matrix\\rows "+(c.rows||2)+"\\columns "+(c.columns||2)+c.formulaToRTF(a,b,d,e,g)+"}":"defparts"===c.nodeType&&(f+="{\\defparts\\parts "+(c.parts||2)+c.formulaToRTF(a,b,d,e,g)+"}");return f};k.prototype.addToFontTable=function(a,b){var c;a.match(/times/i)?c="Times New Roman":a.match(/courier/i)?c="Courier New":a.match(/arial/i)&&(c="Arial");a=b.indexOf(c);-1===a&&(a=b.length,b.push(c));return a};k.prototype.addToColorTable=function(a,b){if(a){a="\\red"+parseInt(a.substring(1,
3),16)+"\\green"+parseInt(a.substring(3,5),16)+"\\blue"+parseInt(a.substring(5,7),16)+";";var c=b.indexOf(a);-1===c&&(c=b.length,b.push(a));return c}return null};k.prototype.mergeTextNodes=function(){for(var a=[],b=null,d=0,e=this.children.length;d<e;d++)"text"===this.children[d].nodeType?null!==b&&"text"===b.nodeType&&b.style.equals(this.children[d].style)&&(this.children[d].value=b.value+this.children[d].value,a.push(b)):this.children[d].mergeTextNodes(),b=this.children[d];d=0;for(e=a.length;d<
e;d++)this.removeChild(a[d])};var m={sansserif:{ascent:1854,descent:-434,lineGap:67,capHeight:1409,xHeight:1082,unitsPerEm:2048},serif:{ascent:1825,descent:-443,lineGap:87,capHeight:1341,xHeight:940,unitsPerEm:2048},monospace:{ascent:1705,descent:-615,lineGap:0,capHeight:1349,xHeight:1082,unitsPerEm:2048}};a.TextNode=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=String.fromCharCode,e,d,q,p,b,k,m,c,l,f,v,r=function(){};r.prototype.tokenize=function(a){if(a)a=a.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quote;/g,"''").replace(/&squot;/g,"'").replace(/\\rquote /g,"'").replace(/\\endash /g,"-").replace(/\n/g," ").replace(/\r/g,"").replace(/\\uc(\d+) /g,"").replace(/\\uc(\d+)/g,"");else return[];e=[];d="";p=q=0;k=a.charAt(0);m=!1;for(c="text";q<a.length;)b=k,k=a.charAt(q+1),m?"\\"===k||"{"===k||"}"===
k||" "===k||";"===k?(m=!1,d+=b," "===k?(q++,k=a.charAt(q+1),v=!0):v=!1,(l=d.match(/^'([0-9a-f]{2})/))?(f="","text"===c&&(f=e.pop().value),d=f+=g(parseInt(l[1],16))+d.substring(3)):(l=d.match(/^u[0-9]+/))?(f="","text"===c&&(f=e.pop().value),d=f+=g(l[0].substring(1))):("{"===d||"}"===d||"\\"==b?(e.push({type:"text",value:d+(v?" ":"")}),c="text"):(e.push({type:"controlWord",value:d}),c="controlWord"),d="")):"{"==b||"}"==b||"\\"==b?(m=!1,e.push({type:"text",value:b}),c="text"):d+=b:"\\"===b?(m=!0,""!==
d&&(e.push({type:"text",value:d}),c="text",d="")):"{"===b?(p++,""!==d&&(e.push({type:"text",value:d}),d=""),e.push({type:"openBlock",value:p}),c="openBlock"):"}"===b?(""!==d&&(e.push({type:"text",value:d}),d=""),e.push({type:"closeBlock",value:p}),c="closeBlock",p--):d+=b,q++;""!==d&&e.push({type:"text",value:d});return e};a.RTFTokenizer=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.max,e,d,q,p,b,k,m,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G,D,B,L,H,M,P,I,O=function(c){this.evaluator=c;this.tokenizer=new a.RTFTokenizer};O.prototype.parse=function(C){e=this.tokenizer.tokenize(C);d={};p=2;if("openBlock"===e[0].type&&"fonttbl"===e[1].value){for(q=e[0].value;"closeBlock"!==e[p].type&&e[p].value!==q;)d[e[p].value]=e[p+2].value.substring(0,e[p+2].value.length-1),p+=3;p++}b={};k=0;if("openBlock"===e[p].type&&"colortbl"===e[p+1].value){q=
e[p++].value;for(p++;"closeBlock"!==e[p].type&&e[p].value!==q;)m=parseInt(e[p++].value.substring(3)).toString(16),c=parseInt(e[p++].value.substring(5)).toString(16),l=parseInt(e[p++].value.substring(4)).toString(16),";"===e[p].value&&p++,b[k++]="#"+(2>m.length?"0"+m:m)+(2>c.length?"0"+c:c)+(2>l.length?"0"+l:l);p++}y=u=r=null;M=H=L=E=A=z=w=x=h=n=!1;J=[new a.TextStyle];F=J[0];D=G=-1;B=[];f=P=new a.TextNode("","textBlock",F,this.evaluator);v=new a.TextNode("","textLineBlock",F,this.evaluator);f.addChild(v);
P.stableWidth=!0;P.hasFormula=!1;C=p;for(var O=e.length;C<O;C++){if("controlWord"==e[C].type)if(d[e[C].value])F.set({family:d[e[C].value]});else if(e[C].value.match(/^fs(\d+)/))F.set({size:parseInt(e[C].value.match(/^fs(\d+)/)[1]/2)});else if("b"==e[C].value)F.set({bold:!0}),0<B.length&&B[B.length-1].style.set({bold:!0});else if("b0"==e[C].value)F.set({bold:!1}),0<B.length&&B[B.length-1].style.set({bold:!1});else if("i"==e[C].value)F.set({italic:!0}),0<B.length&&B[B.length-1].style.set({italic:!0});
else if("i0"==e[C].value)F.set({italic:!1}),0<B.length&&B[B.length-1].style.set({italic:!1});else if("ul"==e[C].value)F.set({underline:!0}),0<B.length&&B[B.length-1].style.set({underline:!0});else if("ulnone"==e[C].value)F.set({underline:!1}),0<B.length&&B[B.length-1].style.set({underline:!1});else if("ol"==e[C].value)F.set({overline:!0}),0<B.length&&B[B.length-1].style.set({overline:!0});else if("olnone"==e[C].value)F.set({overline:!1}),0<B.length&&B[B.length-1].style.set({overline:!1});else if(e[C].value.match(/^cf(\d+)/))F.set({color:b[parseInt(e[C].value.substring(2))]}),
0<B.length&&(B[B.length-1].style.color=F.color);else if("par"==e[C].value){f=new a.TextNode("","textLineBlock",F.clone(),this.evaluator);if("textBlock"!=v.nodeType)for(v=v.parent;"textBlock"!=v.nodeType;)v=v.parent;v.addChild(f);v=f}else if("mjaformula"==e[C].value)P.hasFormula=!0,D=G,n=!0,f=new a.TextNode("","formula",F.clone(),this.evaluator),v.addChild(f),v=f,B[B.length-1]=f;else if("fraction"==e[C].value||"radicand"==e[C].value||"radical"==e[C].value||"what"==e[C].value||"sum"==e[C].value||"integral"==
e[C].value||"limit"==e[C].value){var K=B[B.length-2].style.clone();f=new a.TextNode("",e[C].value,K,this.evaluator);B[B.length-2].addChild(f);B[B.length-1]=f}else"index"==e[C].value?(K=B[B.length-2].style.clone(),K.size=g(parseInt(K.size-.5*K.size),8),f=new a.TextNode("",e[C].value,K,this.evaluator),B[B.length-2].addChild(f),B[B.length-1]=f):"to"==e[C].value||"from"==e[C].value?(K=B[B.length-2].style.clone(),K.size=g(parseInt(K.size-.2*K.size),8),f=new a.TextNode("",e[C].value,K,this.evaluator),B[B.length-
2].addChild(f),B[B.length-1]=f):"num"==e[C].value||"den"==e[C].value?(K=B[B.length-2].style.clone(),K.size=g(Math.round(K.size-.1*K.size),8),"num"==e[C].value?f=new a.TextNode("","numerator",K,this.evaluator):"den"==e[C].value&&(f=new a.TextNode("","denominator",K,this.evaluator)),B[B.length-2].addChild(f),B[B.length-1]=f):"subix"==e[C].value||"supix"==e[C].value?(K=B[B.length-2].style.clone(),K.size=g(Math.floor(K.size-.33*K.size),8),"subix"==e[C].value?f=new a.TextNode("","subIndex",K,this.evaluator):
"supix"==e[C].value&&(f=new a.TextNode("","superIndex",K,this.evaluator)),f.originalStyle=B[B.length-2].style.clone(),B[B.length-2].addChild(f),B[B.length-1]=f):"defparts"==e[C].value||"matrix"==e[C].value||"element"==e[C].value?(K=B[B.length-2].style.clone(),f=new a.TextNode("",e[C].value,K,this.evaluator),B[B.length-2].addChild(f),B[B.length-1]=f,"defparts"==e[C].value?y=f:"matrix"==e[C].value&&(u=f,u.matrix_type=0)):"parts"==e[C].value?E=!0:"type"==e[C].value?w=!0:"rows"==e[C].value?z=!0:"columns"==
e[C].value?A=!0:"expr"==e[C].value?(P.stableWidth=!1,h=!0):"decimals"==e[C].value?x=!0:"fixed1"==e[C].value?r.fixed=!0:"fixed0"==e[C].value?r.fixed=!1:"component"!=e[C].value&&("NumCtrl"==e[C].value?L=!0:"Space"==e[C].value?H=!0:"hyperlink"==e[C].value&&(M=!0));if("text"==e[C].type)if(E)y.parts=parseInt(e[C].value),E=!1;else if(w)u.matrix_type=parseInt(e[C].value),w=!1;else if(z)u.rows=parseInt(e[C].value),z=!1;else if(A)u.columns=parseInt(e[C].value),A=!1;else if(x)r.decimals=this.evaluator.parser.parse(e[C].value+
""),x=!1;else if(M){I=e[C].value.split("|")[0];K=F.clone();f=new a.TextNode(I,"hyperlink",K,this.evaluator);f.URL=e[C].value.split("|")[1];if("textLineBlock"!=v.nodeType)for(v=v.parent;"textLineBlock"!=v.nodeType;)v=v.parent;v.addChild(f);M=!1}else if(L)f=new a.TextNode(e[C].value,"componentNumCtrl",F.clone(),this.evaluator),v.addChild(f),L=!1;else if(H)f=new a.TextNode(e[C].value,"componentSpace",F.clone(),this.evaluator),v.addChild(f),H=!1;else if(h)K=B[B.length-2].style.clone(),I=this.evaluator.parser.parse(e[C].value),
f=new a.TextNode(I,"dynamicText",K,this.evaluator),B[B.length-2].addChild(f),r=B[B.length-1]=f,h=!1;else if(h||n)!h&&n&&(I=e[C].value,f=new a.TextNode(I,"text",B[B.length-1].style.clone(),this.evaluator),B[B.length-1].addChild(f));else{I=e[C].value;f=new a.TextNode(I,"text",F.clone(),this.evaluator);if("textLineBlock"!=v.nodeType)for(v=v.parent;"textLineBlock"!=v.nodeType;)v=v.parent;v.addChild(f)}else if("openBlock"==e[C].type)G=e[C].value,F=F.clone(),J.push(F),B.push(null);else if("closeBlock"==
e[C].type)e[C].value==D&&(D=-1,n=!1,v=v.parent),J.pop(),F=J[J.length-1],B.pop();else if("("==e[C].type||")"==e[C].type)K=B[B.length-1].style.clone(),K.italic="",f=new a.TextNode(e[C].type,"mathSymbol",K,this.evaluator),B[B.length-1].addChild(f);else if("+"==e[C].type||"-"==e[C].type||"*"==e[C].type||"="==e[C].type)f=new a.TextNode(e[C].type,"mathSymbol",B[B.length-1].style.clone(),this.evaluator),B[B.length-1].addChild(f)}return P.normalize()};a.RTFParser=O;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k,m,c,l,f,v=function(c,b){this.parent=c;e=this.evaluator=this.parent.evaluator;d=e.parser;this.id="";this.type="2D";this.xExpr=d.parse("0");this.yExpr=d.parse("0");this.w=parseInt(c.container.width);this.h=parseInt(c.container.height);this.drawif=d.parse("1");this.fixed=!1;this.scale=48;this.Oy=this.Ox=0;this.image=new Image;this.image.onload=function(){this.ready=1};this.imageSrc="";this.bg_display="topleft";this.background=new a.Color("ffffff");
this.net=new a.Color("b8c4c8");this.net10=new a.Color("889498");this.axes=new a.Color("405860");this.numbers=this.text=!1;this.y_axis=this.x_axis="";this.sensitive_to_mouse_movements=!1;this.cID="";this.mouse_y=this.mouse_x=0;this.ctrs=[];this.graphicsCtr=[];this.graphics=[];this.backGraphics=[];this.zIndex=c.zIndex;this.border_width=0;this.border_color=new a.Color("000000");this.border_radius=0;this.plecaHeight=c.plecaHeight||0;this.displaceRegionNorth=c.displaceRegionNorth||0;this.displaceRegionWest=
c.displaceRegionWest||0;Object.assign(this,b);this.initSpace()};v.prototype.initSpace=function(){var a=this;g=a.parent;e=a.evaluator;q=a.id;a.resizable||(a.displaceRegionNorth=g.displaceRegionNorth||0,a.displaceRegionSouth=g.displaceRegionSouth||0,a.displaceRegionEast=g.displaceRegionEast||0,a.displaceRegionWest=g.displaceRegionWest||0,m=parseInt(g.container.width),k=parseInt(g.container.height),void 0!=a.wExpr&&(a.w=parseInt(m-a.displaceRegionWest-a.displaceRegionEast)*parseFloat(a.wExpr)/100),void 0!=
a.hExpr&&(a.h=parseInt(k-a.displaceRegionNorth-a.displaceRegionSouth)*parseFloat(a.hExpr)/100),void 0!=a.xPercentExpr&&(a.xExpr=e.parser.parse((parseInt(m-a.displaceRegionWest-this.displaceRegionEast)*parseFloat(a.xPercentExpr)/100).toString())),void 0!=a.yPercentExpr&&(a.yExpr=e.parser.parse((parseInt(k-a.displaceRegionNorth-a.displaceRegionSouth)*parseFloat(a.yPercentExpr)/100).toString())),a.x=e.eval(a.xExpr)+a.displaceRegionWest,a.y=e.eval(a.yExpr)+a.plecaHeight+a.displaceRegionNorth,a.container&&
(a.container.style.left=a.x+"px",a.container.style.top=a.y+"px"),0<=a.y?(p=k-a.y,a.h>p&&(a.h=p)):(p=a.h+a.y,a.h=p>=k?k:p),0<=a.x?(b=m-a.x,a.w>b&&(a.w=b)):(b=a.w+a.x,a.w=b>=m?m:b));""==a.imageSrc&&/vacio.gif$/i.test(a.imageSrc.trim())||(a.image=g.getImage(a.imageSrc));a.OxExpr&&(l=a.OxExpr,"%"===l[l.length-1]?a.Ox=a.w*parseFloat(l)/100:(c=parseFloat(l),c!=l&&(c=0),a.Ox=c));a.OyExpr&&(f=a.OyExpr,"%"===f[f.length-1]?a.Oy=a.h*parseFloat(f)/100:(c=parseFloat(f),c!=f&&(c=0),a.Oy=c));""!==a.id&&2!==g.version?
(e.setVariable(q+"._w",a.w),e.setVariable(q+"._h",a.h),e.setVariable(q+".escala",a.scale),e.setVariable(q+".Ox",e.getVariable(q+".Ox")||a.Ox),e.setVariable(q+".Oy",e.getVariable(q+".Oy")||a.Oy),e.setVariable(q+".mouse_x",0),e.setVariable(q+".mouse_y",0),e.setVariable(q+".mouse_pressed",0),e.setVariable(q+".mouse_clicked",0),e.setVariable(q+".clic_izquierdo",0)):(c=e.getVariable("_w"),void 0===c&&(c=a.w),e.setVariable("_w",c),c=e.getVariable("_h"),void 0===c&&(c=a.h),e.setVariable("_h",c),c=e.getVariable("escala"),
void 0===c&&(c=a.scale),e.setVariable("escala",c),c=e.getVariable("Ox"),void 0===c&&(c=a.Ox),e.setVariable("Ox",c),c=e.getVariable("Oy"),void 0===c&&(c=a.Oy),e.setVariable("Oy",c),e.setVariable("mouse_x",0),e.setVariable("mouse_y",0),e.setVariable("mouse_pressed",0),e.setVariable("mouse_clicked",0),e.setVariable("clic_izquierdo",0),2==g.version&&""===a.x_axis&&""===a.y_axis&&(a.axes=""));a.w_2=a.w/2;a.h_2=a.h/2;e.setFunction(q+".download_image",function(c){a.evaluator.functions._SaveSpace_(c,a.canvas.toDataURL("image/png"))})};
v.prototype.addCtr=function(a){"GraphicControl"===a.type?this.graphicsCtr.push(a):this.ctrs.push(a)};v.prototype.addGraph=function(a,c){"2D"===this.type&&c||"3D"===this.type&&!c||(a.background&&"3D"!==this.type?this.backGraphics.push(a):this.graphics.push(a))};v.prototype.clearClick=function(){this.evaluator.setVariable(this.mclickedString,0);this.evaluator.setVariable(this.mclicizquierdoString,0)};v.prototype.getRelativeX=function(a){return(parseInt(a)-this.w_2-this.Ox)/this.scale};v.prototype.getRelativeY=
function(a){return(-parseInt(a)+this.h_2+this.Oy)/this.scale};v.prototype.getAbsoluteX=function(a){return a*this.scale+this.w_2+this.Ox};v.prototype.getAbsoluteY=function(a){return-a*this.scale+this.h_2+this.Oy};a.Space=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e=function(d){g=this;g.parent=d;g.width=228;g.vSpace=25;g.container=a.newHTML("div",{style:"box-sizing:border-box;border-style:ridge;border-width:5px;border-color:gray;box-shadow:#000 0 0 25px 5px;overflow-y:scroll;overflow-x:hidden;position:fixed;left:0;top:0;z-index:10000;background-color:#63b4fb;width:"+(g.width+27)+"px;height:460px;"});g.movable=a.newHTML("div",{style:"position:absolute;left:0;top:0;width:"+(g.width+27)+"px;height:"+g.vSpace+
"px;line-height:"+g.vSpace+"px;background-color:#ddd;cursor:move;padding-left:75px;font-family:"+a.sansserif_font+";font-size:18px;"});g.movable.innerHTML="Descartes";g.container.appendChild(g.movable);g.ctrs=[]};e.prototype.init=function(){function d(b){g.newPos=a.getCursorPosition(b,document.body);g.container.style.left=g.initialPosition.x+(g.newPos.x-g.oldPos.x)*a.cssScale+"px";g.container.style.top=g.initialPosition.y+(g.newPos.y-g.oldPos.y)*a.cssScale+"px"}function e(a){a.preventDefault();document.body.removeEventListener("mousemove",
d);document.body.removeEventListener("mouseup",e)}g=this;document.body.appendChild(this.container);for(var p=g.parent.evaluator.parser,b=0,k=g.ctrs.length;b<k;b++)g.ctrs[b].expresion=p.parse("(0,"+(g.vSpace+23+35*b)+","+g.width+",35)"),g.ctrs[b].update();g.numCtr=k;b=new a.Button(g.parent,{region:"external",name:"english"==g.language?"about":"cr\u00e9ditos",font_size:p.parse("15"),expresion:p.parse("(0,"+g.vSpace+","+g.width/2+",25)")});b.actionExec={execute:a.showAbout};b.update();(new a.Button(g.parent,
{region:"external",name:"config",font_size:p.parse("15"),action:"config",expresion:p.parse("("+g.width/2+","+g.vSpace+","+g.width/2+",25)")})).update();(new a.Button(g.parent,{region:"external",name:"english"==g.language?"init":"inicio",font_size:p.parse("15"),action:"init",expresion:p.parse("(0,"+(g.vSpace+23+35*k)+","+g.width/2+",25)")})).update();(new a.Button(g.parent,{region:"external",name:"english"==g.language?"clear":"limpiar",font_size:p.parse("15"),action:"clear",expresion:p.parse("("+g.width/
2+","+(g.vSpace+23+35*k)+","+g.width/2+",25)")})).update();p=new a.Button(g.parent,{region:"external",name:"english"==g.language?"close":"cerrar",font_size:p.parse("15"),expresion:p.parse("("+g.width/4+","+(g.vSpace+46+35*k)+","+g.width/2+",25)")});p.update();p.btn.addEventListener("click",function(a){g.hide()});g.setPositionAndSize();g.movable.addEventListener("mousedown",function(b){b.preventDefault();g.oldPos=a.getCursorPosition(b,document.body);g.initialPosition={x:g.container.offsetLeft,y:g.container.offsetTop};
document.body.addEventListener("mousemove",d);document.body.addEventListener("mouseup",e)});g.hide()};e.prototype.addCtr=function(a){this.ctrs.push(a)};e.prototype.show=function(){this.setPositionAndSize();this.container.style.display="block"};e.prototype.hide=function(){this.container.style.display="none"};e.prototype.setPositionAndSize=function(){g=this;var a=g.vSpace+46+35*g.numCtr+25+10;g.container.style.left=Math.max(parseInt(window.innerWidth-g.width)/2,0)+"px";g.container.style.top="5px";g.container.style.height=
window.innerHeight<g.vSpace+75?g.vSpace+75+"px":a>window.innerHeight-10?window.innerHeight-10:a+"px"};a.SpaceExternal=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=Math.floor,e=Math.round,d=2*Math.PI,q=a.convertFont("Serif,BOLD+ITALIC,16"),p=a.convertFont("Monospaced,PLAIN,12"),b,k,m,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G,D,B,L,H,M,P,I,O,C,Q,K,R,N=function(c,d){b=d=a.Space.call(this,c,d)||this;b.ratio=c.ratio;b.canvas=a.newHTML("canvas",{id:b.id+"_canvas",class:"DescartesSpace2DCanvas",width:b.w*b.ratio});b.backCanvas=a.newHTML("canvas",{id:b.id+"_background",width:b.w*b.ratio});b.canvas.style=b.backCanvas.style=
(0<b.border_width?"border:"+b.border_width+"px solid "+b.border_color.getColor()+";":"")+(b.border_radius?"border-radius:"+b.border_radius+"px;":"");b.canvas.style.zIndex=b.zIndex;b.canvas.style.width=b.backCanvas.style.width=b.w+"px";b.canvas.style.height=b.backCanvas.style.height=b.h+"px";b.ctx=b.canvas.getContext("2d");b.backCtx=b.backCanvas.getContext("2d");b.ctx.imageSmoothingEnabled=b.backCtx.imageSmoothingEnabled=!1;b.graphicControlContainer=a.newHTML("div",{id:b.id+"_graphicControls",style:"position:absolute;left:0;top:0;z-index:"+
b.zIndex+";"});b.numericalControlContainer=a.newHTML("div",{id:b.id+"_numericalControls",style:"position:absolute;left:0;top:0;z-index:"+b.zIndex+";"});b.container=a.newHTML("div",{id:b.id,class:"DescartesSpace2DContainer",style:"z-index:"+b.zIndex+";"});b.parent.arquimedes&&"#f0f8fa"===b.background.getColor()&&(b.container.style.boxShadow="0 0 5px 0 #b8c4c8");b.container.appendChild(b.backCanvas);b.container.appendChild(b.canvas);b.container.appendChild(b.graphicControlContainer);b.container.appendChild(b.numericalControlContainer);
c.container.insertBefore(b.container,c.loader);var f=b.id+".image";b.parent.images[f]=b.canvas;b.parent.images[f].ready=1;b.parent.images[f].complete=b.parent.images[f].canvas=!0;b.evaluator.setVariable(f,f);f=b.id+".back";b.parent.images[f]=b.backCanvas;b.parent.images[f].ready=1;b.parent.images[f].complete=b.parent.images[f].canvas=!0;b.evaluator.setVariable(f,f);f=""!==b.id&&2!==c.version?b.id+".":"";b.OxStr=f+"Ox";b.OyStr=f+"Oy";b.scaleStr=f+"escala";b.wStr=f+"_w";b.hStr=f+"_h";b.mxStr=f+"mouse_x";
b.myStr=f+"mouse_y";b.mpressedStr=f+"mouse_pressed";b.mclickedStr=f+"mouse_clicked";b.mclickIzqStr=f+"clic_izquierdo";b.click=0;b.resizable&&(b.wModExpr=c.evaluator.parser.parse(b.wModExpr),b.hModExpr=c.evaluator.parser.parse(b.hModExpr));"descartesJS_stage"!==b.id?b.addEvents():b.canvas.oncontextmenu=function(a){return!1};c.evaluator.setVariable(b.id+"._refresh_back_",1);return d};$jscomp.inherits(N,a.Space);N.prototype.init=function(){b=this;this.initSpace();b.canvas&&(b.old_w=b.w,b.old_h=b.h,b.canvas.width=
b.backCanvas.width=b.w*b.ratio,b.canvas.height=b.backCanvas.height=b.h*b.ratio,b.canvas.style.width=b.backCanvas.style.width=b.w+"px",b.canvas.style.height=b.backCanvas.style.height=b.h+"px")};N.prototype.update=function(a){b=this;k=b.evaluator;m=b.parent;if(b.resizable){if(C=b.evaluator.eval(b.wModExpr),Q=b.evaluator.eval(b.hModExpr),b.old_w!=C||b.old_h!=Q)b.w=C,b.h=Q,b.w_2=b.w/2,b.h_2=b.h/2,k.setVariable(b.wStr,b.w),k.setVariable(b.hStr,b.h),b.old_w=b.w,b.old_h=b.h,b.canvas.width=b.backCanvas.width=
b.w*b.ratio,b.canvas.height=b.backCanvas.height=b.h*b.ratio,b.canvas.style.width=b.backCanvas.style.width=b.w+"px",b.canvas.style.height=b.backCanvas.style.height=b.h+"px",a=!0}else k.setVariable(b.wStr,b.w),k.setVariable(b.hStr,b.h);b.drawIfValue=0<k.eval(b.drawif);if(b.drawIfValue){l=b.x!==k.eval(b.xExpr)+b.displaceRegionWest;f=b.y!==k.eval(b.yExpr)+m.plecaHeight+b.displaceRegionNorth;b.spaceChange=a||l||f||b.drawBefore!==b.drawIfValue||b.Ox!==k.getVariable(b.OxStr)||b.Oy!==k.getVariable(b.OyStr)||
b.scale!==k.getVariable(b.scaleStr)||b.backColor!==b.background.getColor();b.x=l?k.eval(b.xExpr)+b.displaceRegionWest:b.x;b.y=f?k.eval(b.yExpr)+m.plecaHeight+b.displaceRegionNorth:b.y;b.Ox=k.getVariable(b.OxStr);b.Oy=k.getVariable(b.OyStr);b.scale=k.getVariable(b.scaleStr);b.drawBefore=b.drawIfValue;b.scale=Math.max(1E-6,Math.min(1E6,b.scale));k.setVariable(b.scaleStr,b.scale);if(l||f)b.container.style.left=b.x+"px",b.container.style.top=b.y+"px";b.container.style.display="block";b.drawTrace=!b.spaceChange&&
(!b.fixed&&!b.click||b.fixed);b.spaceChange&&(b.backCtx.setTransform(b.ratio,0,0,b.ratio,0,0),b.drawBackground());b.ctx.setTransform(b.ratio,0,0,b.ratio,0,0);b.draw()}else b.container.style.display="none"};N.prototype.drawBackground=function(){b=this;k=b.evaluator;c=b.backCtx;c.clearRect(0,0,b.backCanvas.width,b.backCanvas.height);c.fillStyle=b.backColor=b.background.getColor();c.fillRect(0,0,b.backCanvas.width,b.backCanvas.height);b.image&&""!=b.image.src&&b.image.ready&&b.image.complete&&("topleft"===
b.bg_display?c.drawImage(b.image,0,0):"stretch"===b.bg_display?c.drawImage(b.image,0,0,b.w,b.h):"patch"===b.bg_display?(c.fillStyle=c.createPattern(b.image,"repeat"),c.fillRect(0,0,b.w,b.h)):"imgcenter"===b.bg_display&&c.drawImage(b.image,(b.w-b.image.width)/2,(b.h-b.image.height)/2));r=b.scale;u=0;for(y=0>b.w+b.h?0:b.w+b.h;r>y;)r/=10,u++;for(;r<y/10;)r*=10;c.lineWidth=1;""!==b.net&&(c.strokeStyle=b.net.getColor(),b.drawMarks(c,r/10,-1));if(2!==b.parent.version&&""!==b.net10||2===b.parent.version&&
""!==b.net&&""!==b.net10)c.strokeStyle=b.net10.getColor(),b.drawMarks(c,r,-1);if(""!==b.axes){var a="";"no"==b.x_axis&&(a+="x");"no"==b.y_axis&&(a+="y");c.strokeStyle=b.axes.getColor();c.beginPath();"no"==b.x_axis||""===b.x_axis&&2===b.parent.version||(c.moveTo(0,g(b.h/2+b.Oy)+.5),c.lineTo(b.w,g(b.h/2+b.Oy)+.5));"no"==b.y_axis||""===b.y_axis&&2===b.parent.version||(c.moveTo(g(b.w/2+b.Ox)+.5,0),c.lineTo(g(b.w/2+b.Ox)+.5,b.h));c.lineWidth=1.2;c.stroke();c.lineWidth=1;b.drawMarks(c,r,4,a);b.drawMarks(c,
r/2,2,a);b.drawMarks(c,r/10,1,a)}if(""!==b.x_axis||""!==b.y_axis)c.fillStyle=""!==b.axes?b.axes.getColor():"#000",c.font=q,c.textAlign="right",c.textBaseline="alphabetic","no"!=b.x_axis&&c.fillText(b.x_axis,g(b.w)-2,g(b.h/2+b.Oy)+12),"no"!=b.y_axis&&c.fillText(b.y_axis,g(b.w/2+b.Ox)-2,12);b.numbers&&""!=b.axes&&(c.fillStyle=b.axes.getColor(),c.font=q,c.textAlign="start",c.textBaseline="bottom",r>(b.w+b.h)/2?b.drawNumbers(c,r/5,r<=b.scale?u+1:u):r>(b.w+b.h)/4?b.drawNumbers(c,r/2,r<=b.scale?u+1:u):
b.drawNumbers(c,r,u));a=0;for(var d=this.backGraphics.length;a<d;a++)this.backGraphics[a].draw()};N.prototype.draw=function(){b=this;c=b.ctx;k.getVariable(b.id+"._refresh_back_")&&c.clearRect(0,0,b.canvas.width,b.canvas.height);for(var a=0,f=b.graphics.length;a<f;a++)v=b.graphics[a],""!==v.trace&&b.drawTrace&&v.drawTrace(),v.draw();a=0;for(f=b.graphicsCtr.length;a<f;a++)b.graphicsCtr[a].draw();""!=b.text&&b.click&&"L"===b.whichBtn&&(c.save(),c.strokeStyle=c.fillStyle=b.text.getColor(),c.lineWidth=
1,c.font=p,c.textAlign="center",c.textBaseline="alphabetic",D=1>=b.scale?b.mouse_x.toFixed(0):b.mouse_x.toFixed(parseInt(b.scale).toString().length+1),B=1>=b.scale?b.mouse_y.toFixed(0):b.mouse_y.toFixed(parseInt(b.scale).toString().length+1),L="("+D+","+B+")",H=g(c.measureText(L).width/2),M=b.getAbsoluteX(b.mouse_x),P=b.getAbsoluteY(b.mouse_y),I=g(M),O=g(P-10),I+H>b.w?I=b.w-H:0>I-H&&(I=H),O+1>b.h?O=b.h:0>O-14&&(O=15),c.fillText(L,I,O),c.beginPath(),c.arc(M,P,2.5,0,d,!0),c.stroke(),c.restore())};N.prototype.drawMarks=
function(a,c,b,d){n=this.w;h=this.h;F=E=0;J=n;G=h;z=g(n/2+this.Ox);A=g(h/2+this.Oy);0<=b&&(E=z-b,J=z+b,F=A-b,G=A+b);a.beginPath();if(!d||d&&!d.match("x"))for(b=-e(z/c);(x=z+e(b*c))<n;b++)a.moveTo(x+.5,F+.5),a.lineTo(x+.5,G+.5);if(!d||d&&!d.match("y"))for(b=-e(A/c);(w=A+e(b*c))<h;b++)a.moveTo(E+.5,w+.5),a.lineTo(J+.5,w+.5);a.stroke()};N.prototype.drawNumbers=function(a,c,b){n=this.w;h=this.h;z=g(n/2+this.Ox);A=g(h/2+this.Oy);for(b=-e(z/c);(x=z+e(b*c))<n;b++)a.fillText(parseFloat((b*c/this.scale).toFixed(4)),
x+1,A-2);for(b=-e(A/c);(w=A+e(b*c))<h;b++)0!==parseFloat(-b*c/this.scale)&&a.fillText(parseFloat((-b*c/this.scale).toFixed(4)),z+5,w+5)};N.prototype.addEvents=function(){function c(a){window.focus();document.activeElement.blur();if(e.evaluator.variables[e.id+".DESCARTESJS_no_fixed"]||!e.fixed||e.sensitive_to_mouse_movements)e.click=0,e.evaluator.setVariable(e.mpressedStr,0),e.evaluator.setVariable(e.mclickedStr,1),e.evaluator.setVariable(e.mclickIzqStr,1),window.removeEventListener("touchmove",h),
window.removeEventListener("touchend",c),a.stopPropagation(),a.preventDefault(),e.parent.update()}function b(c){document.activeElement.blur();window.focus();c.stopPropagation();c.preventDefault();e.click=0;e.evaluator.setVariable(e.mpressedStr,0);e.evaluator.setVariable(e.mclickedStr,1);e.evaluator.setVariable(e.mclickIzqStr,1);"R"===e.whichBtn&&(window.removeEventListener("mousemove",f),e.posZoom==e.posZoomNew&&a.showConfig&&(e.parent.externalSpace.show(),e.posZoom=!1,e.posZoomNew=!0));window.removeEventListener("mousemove",
h);window.removeEventListener("mouseup",b);e.parent.deactivateGraphicControls();e.parent.update()}function d(c){e.posAnte=a.getCursorPosition(c,e.container);e.mouse_x=e.getRelativeX(e.posAnte.x);e.mouse_y=e.getRelativeY(e.posAnte.y);e.evaluator.setVariable(e.mxStr,e.mouse_x);e.evaluator.setVariable(e.myStr,e.mouse_y);e.evaluator.setVariable(e.mclickedStr,0);e.evaluator.setVariable(e.mclickIzqStr,0);e.parent.update()}function f(c){c.preventDefault();e.posZoomNew=a.getCursorPosition(c,e.container).y;
e.evaluator.setVariable(e.scaleStr,e.tempScale+e.tempScale/45*((e.posZoom-e.posZoomNew)/10));e.parent.update()}function h(c){c.preventDefault();c.stopPropagation();e.fixed||(e.posNext=a.getCursorPosition(c,e.container),K=e.posAnte.x-e.posNext.x,R=e.posAnte.y-e.posNext.y,e.evaluator.setVariable(e.OxStr,e.Ox-K),e.evaluator.setVariable(e.OyStr,e.Oy-R));d(c)}var e=this;e.posZoom=e.posZoomNew=null;e.canvas.oncontextmenu=function(a){return!1};this.sensitive_to_mouse_movements&&this.canvas.addEventListener("touchmove",
d);this.canvas.addEventListener("touchstart",function(a){window.focus();document.activeElement.blur();if(e.evaluator.variables[e.id+".DESCARTESJS_no_fixed"]||!e.fixed||e.sensitive_to_mouse_movements)e.parent.clearClick(),e.click=1,e.evaluator.setVariable(e.mpressedStr,1),e.evaluator.setVariable(e.mclickedStr,0),e.evaluator.setVariable(e.mclickIzqStr,0),e.parent.deactivateGraphicControls(),d(a),window.addEventListener("touchmove",h),window.addEventListener("touchend",c),a.stopPropagation(),a.preventDefault()});
this.sensitive_to_mouse_movements&&this.canvas.addEventListener("mousemove",d);this.canvas.addEventListener("mousedown",function(c){window.focus();document.activeElement.blur();c.stopPropagation();c.preventDefault();e.parent.clearClick();e.click=1;e.parent.deactivateGraphicControls();e.whichBtn=a.whichBtn(c);"R"===e.whichBtn?(window.addEventListener("mouseup",b),e.posZoom=a.getCursorPosition(c,e.container).y,e.posZoomNew=e.posZoom,e.fixed||(e.tempScale=e.scale,window.addEventListener("mousemove",
f))):"L"===e.whichBtn&&(e.evaluator.setVariable(e.mpressedStr,1),e.evaluator.setVariable(e.mclickedStr,0),e.evaluator.setVariable(e.mclickIzqStr,0),d(c),window.addEventListener("mousemove",h),window.addEventListener("mouseup",b))});document.addEventListener("visibilitychange",function(a){b(a)});document.addEventListener("mouseleave",function(a){e.click=0;e.evaluator.setVariable(e.mpressedStr,0);e.evaluator.setVariable(e.mclickedStr,1);e.evaluator.setVariable(e.mclickIzqStr,1);window.removeEventListener("mousemove",
h);window.removeEventListener("mouseup",b)})};a.Space2D=N;return a}(descartesJS||{});
descartesJS=function(a){var g,e,d;function q(c,b){I=a.subtract3D(c,a.scalarProduct3D(b,a.dotProduct3D(c,b)));O=a.add3D(c,a.scalarProduct3D(I,-2));C=a.norm3D(O);return 0!==C?a.scalarProduct3D(O,1/C):a.scalarProduct3D(c,-1)}if(a.loadLib)return a;var p=Math.floor,b=Math.max,k=Math.cos,m=Math.sin,c,l,f,v,r,u,y,n,h,x,w,z,A,E,J,F,G=[],D,B,L,H,M,P,I,O,C,Q,K,R=function(c,b){f=b=a.Space.call(this,c,b)||this;f.backCanvas=a.newHTML("canvas",{id:f.id+"_background",width:f.w+"px",height:f.h+"px"});f.canvas=a.newHTML("canvas",
{id:f.id+"_canvas",width:f.w+"px",height:f.h+"px",class:"DescartesSpace3DCanvas",style:"z-index: "+f.zIndex+";"});f.ctx=f.canvas.getContext("2d");f.ctx.imageSmoothingEnabled=!1;f.canvas.style=f.backCanvas.style=(0<f.border_width?"border:"+f.border_width+"px solid "+f.border_color.getColor()+";":"")+(f.border_radius?"border-radius:"+f.border_radius+"px;":"");var d=f.id+".image";f.parent.images[d]=f.canvas;f.parent.images[d].ready=1;f.parent.images[d].complete=!0;f.parent.images[d].canvas=!0;f.evaluator.setVariable(d,
d);f.graphicControlContainer=a.newHTML("div",{id:f.id+"_graphicControls",style:"position:absolute;left:0px;top:0px;z-index:"+f.zIndex+";"});f.numericalControlContainer=a.newHTML("div",{id:f.id+"_numericalControls",style:"position:absolute;left:0px;top:0px;z-index:"+f.zIndex+";"});f.container=a.newHTML("div",{id:f.id,class:"DescartesSpace3DContainer",style:"z-index:"+f.zIndex+";"});f.container.appendChild(f.backCanvas);f.container.appendChild(f.canvas);f.container.appendChild(f.graphicControlContainer);
f.container.appendChild(f.numericalControlContainer);c.container.insertBefore(f.container,c.loader);f.eye={x:0,y:0,z:0};f.lights=[{x:50,y:50,z:70},{x:50,y:-50,z:30},{x:20,y:0,z:-80},{x:0,y:0,z:0}];d=0;for(var e=f.lights.length;d<e;d++)f.lights[d]=a.normalize3D(f.lights[d]);f.light3={x:0,y:0,z:0};f.intensity=[.4,.5,.3,0];f.userIntensity=0;f.dim=1;f.tmpIntensity=[];f.OxStr=f.id+".Ox";f.OyStr=f.id+".Oy";f.scaleStr=f.id+".escala";f.wStr=f.id+"._w";f.hStr=f.id+"._h";f.obsStr=f.id+".observador";f.ojoXStr=
f.id+".Ojo.x";f.ojoYStr=f.id+".Ojo.y";f.ojoZStr=f.id+".Ojo.z";f.rotZStr=f.id+".rot.z";f.rotYStr=f.id+".rot.y";f.userIDimStr=f.id+".userIlum.dim";f.userIIStr=f.id+".userIlum.I";f.userIxStr=f.id+".userIlum.x";f.userIyStr=f.id+".userIlum.y";f.userIzStr=f.id+".userIlum.z";f.evaluator.setVariable(f.rotZStr,0);f.evaluator.setVariable(f.rotYStr,0);f.evaluator.setVariable(f.userIDimStr,f.dim);f.evaluator.setVariable(f.userIIStr,f.userIntensity);f.evaluator.setVariable(f.userIxStr,0);f.evaluator.setVariable(f.userIyStr,
0);f.evaluator.setVariable(f.userIzStr,0);K=new a.Primitive3D({vertices:[new a.Vector4D(0,0,0,1)],type:"vertex"},f);f.evaluator.setFunction(f.id+"._X3D2D_",function(a,c,b){K.vertices[0].x=a;K.vertices[0].y=c;K.vertices[0].z=b;K.computeDepth(f);return K.projVert[0].x});f.evaluator.setFunction(f.id+"._Y3D2D_",function(a,c,b){K.vertices[0].x=a;K.vertices[0].y=c;K.vertices[0].z=b;K.computeDepth(f);return K.projVert[0].y});f.resizable&&(f.wModExpr=c.evaluator.parser.parse(f.wModExpr),f.hModExpr=c.evaluator.parser.parse(f.hModExpr));
f.ratio=1;f.addEvents();return b};$jscomp.inherits(R,a.Space);R.prototype.init=function(a){f=this;f.initSpace();f.canvas&&(f.canvas.width=f.backCanvas.width=f.w,f.canvas.height=f.backCanvas.height=f.h,f.canvas.style.width=f.backCanvas.style.width=f.w+"px",f.canvas.style.height=f.backCanvas.style.height=f.h+"px");f.w_2=f.w/2;f.h_2=f.h/2;f.w_plus_h=f.w+f.h;f.oldMouse={x:0,y:0};f.S={x:f.h/1080*-20.6*(40/f.scale),y:0,z:0};f.Ojo={x:3*f.w_2,y:0,z:0};f.evaluator.setVariable(f.ojoXStr,f.Ojo.x);f.evaluator.setVariable(f.ojoYStr,
f.Ojo.y);f.evaluator.setVariable(f.ojoZStr,f.Ojo.z)};R.prototype.update=function(a){f=this;c=f.evaluator;l=f.parent;c.setVariable(f.wStr,f.w);c.setVariable(f.hStr,f.h);f.drawIfValue=0<c.eval(f.drawif);if(f.drawIfValue){f.resizable&&(wModExpr=f.evaluator.eval(f.wModExpr),hModExpr=f.evaluator.eval(f.hModExpr),f.old_w!=wModExpr||f.old_h!=hModExpr)&&(f.w=wModExpr,f.h=hModExpr,f.w_2=f.w/2,f.h_2=f.h/2,c.setVariable(f.wStr,f.w),c.setVariable(f.hStr,f.h),f.old_w=f.w,f.old_h=f.h,f.canvas.width=f.backCanvas.width=
f.w*f.ratio,f.canvas.height=f.backCanvas.height=f.h*f.ratio,f.canvas.style.width=f.backCanvas.style.width=f.w+"px",f.canvas.style.height=f.backCanvas.style.height=f.h+"px",a=!0,f.S={x:f.h/1080*-20.6*(40/f.scale),y:0,z:0},f.Ojo={x:3*f.w_2,y:0,z:0},f.evaluator.setVariable(f.ojoXStr,f.Ojo.x),f.evaluator.setVariable(f.ojoYStr,f.Ojo.y),f.evaluator.setVariable(f.ojoZStr,f.Ojo.z));u=f.x!==c.eval(f.xExpr)+f.displaceRegionWest;y=f.y!==c.eval(f.yExpr)+l.plecaHeight+f.displaceRegionNorth;f.spaceChange=a||u||
y||f.drawBefore!==f.drawIfValue||f.Ox!==c.getVariable(f.OxStr)||f.Oy!==c.getVariable(f.OyStr)||f.Ojo.x!==c.getVariable(f.ojoXStr)||f.Ojo.y!==c.getVariable(f.ojoYStr)||f.Ojo.z!==c.getVariable(f.ojoZStr)||f.scale!==c.getVariable(f.scaleStr);f.x=u?c.eval(f.xExpr)+f.displaceRegionWest:f.x;f.y=y?c.eval(f.yExpr)+l.plecaHeight+f.displaceRegionNorth:f.y;f.Ojo.x=c.getVariable(f.ojoXStr);f.Ojo.y=c.getVariable(f.ojoYStr);f.Ojo.z=c.getVariable(f.ojoZStr);f.Ox=c.getVariable(f.OxStr);f.Oy=c.getVariable(f.OyStr);
f.scale=c.getVariable(f.scaleStr);f.drawBefore=f.drawIfValue;if(a||void 0==f.observer){a=0;for(var d=f.parent.controls.length;a<d;a++)f.parent.controls[a].id===f.obsStr&&(Q=!0);f.observer=Q?c.getVariable(f.obsStr)||2.5*f.w_plus_h:2.5*f.w_plus_h;f.observer=b(f.observer,.25*f.w_plus_h);c.setVariable(f.obsStr,f.observer)}1E-6>f.scale?(f.scale=1E-6,c.setVariable(f.scaleStr,1E-6)):1E6<f.scale&&(f.scale=1E6,c.setVariable(f.scaleStr,1E6));if(u||y)f.container.style.left=f.x+"px",f.container.style.top=f.y+
"px";f.container.style.display="block";f.dim=c.getVariable(f.userIDimStr);f.userIntensity=c.getVariable(f.userIIStr);f.light3={x:parseInt(c.getVariable(f.userIxStr)),y:parseInt(c.getVariable(f.userIyStr)),z:parseInt(c.getVariable(f.userIzStr))};f.updateCamera();f.draw()}else f.container.style.display="none"};R.prototype.updateCamera=function(){this.eye=a.scalarProduct3D(this.Ojo,1/this.scale)};R.prototype.rotateVertex=function(c){x=a.degToRad(f.evaluator.getVariable(f.rotZStr));w=k(x);z=m(x);g=c.x*
w-c.y*z;e=c.x*z+c.y*w;d=c.z;x=a.degToRad(f.evaluator.getVariable(f.rotYStr));w=k(x);z=m(x);return{x:d*z+g*w,y:e,z:d*w-g*z}};R.prototype.project=function(a){f=this;this.evaluator.getVariable("URL.oldProj");var c=f.eye.x/(a.x-f.eye.x);return{x:f.getAbsoluteX(c*(f.eye.y-a.y)),y:f.getAbsoluteY(c*(f.eye.z-a.z)),z:f.eye.x-a.x}};R.prototype.computeColor=function(c,b,d){"object"!=typeof c&&(c.match("rgba")?c=a.RGBAToHexColor(c):c.match("#")&&(c=new a.Color(c.substring(1))));H=a.subtract3D(this.eye,b.average);
M=a.norm3D(H);P=a.scalarProduct3D(H,1/M);this.lights[3]=a.subtract3D(this.light3,b.average);F=a.norm3D(this.lights[3]);for(var f=0,e=this.intensity.length-1;f<e;f++)G[f]=this.intensity[f]*this.dim;G[3]=this.userIntensity*this.userIntensity/F||0;D=d?this.dim/2:this.dim/4;B=0;L=0>b.direction?b.normal:a.scalarProduct3D(b.normal,-1);f=0;for(e=this.lights.length;f<e;f++)d?(B=Math.max(0,a.dotProduct3D(q(this.lights[f],L),P)),B*=B*B):B=Math.max(0,a.dotProduct3D(this.lights[f],L)),D+=G[f]*B;D=Math.min(D,
1);A=p(c.r*D);E=p(c.g*D);J=p(c.b*D);return"rgba("+A+","+E+","+J+","+c.a+")"};R.prototype.draw=function(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.ctx.fillStyle=this.background.getColor();this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);this.image&&""!=this.image.src&&this.image.ready&&this.image.complete&&("topleft"===this.bg_display?this.ctx.drawImage(this.image,0,0):"stretch"===this.bg_display?this.ctx.drawImage(this.image,0,0,this.w,this.h):"patch"===this.bg_display?
(this.ctx.fillStyle=ctx.createPattern(this.image,"repeat"),this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)):"center"===this.bg_display&&this.ctx.drawImage(this.image,(this.w-this.image.width)/2,(this.h-this.image.height)/2));if(!this.click){for(var a=0,c=this.graphics.length;a<c;a++)this.graphics[a].update();this.primitives=[];if(this.split)for(a=0,c=this.graphics.length;a<c;a++){v=this.graphics[a];for(var b=a+1;b<c;b++)r=this.graphics[b],v.splitFace(r),r.splitFace(v);this.primitives=
this.primitives.concat(v.primitives||[])}else for(a=0,c=this.graphics.length;a<c;a++){v=this.graphics[a];if(v.split)for(b=a+1;b<c;b++)r=this.graphics[b],r.split&&v.splitFace(r);this.primitives=this.primitives.concat(v.primitives||[])}}a=0;for(c=this.primitives.length;a<c;a++)this.primitives[a].computeDepth(this);this.primitives=this.primitives.sort(function(a,c){return c.depth-a.depth});if("painter"===this.render)this.drawPainter(this.primitives);else for(a=0,c=this.primitives.length;a<c;a++)this.primitives[a].draw(this.ctx,
this);a=0;for(c=this.graphicsCtr.length;a<c;a++)this.graphicsCtr[a].draw()};R.prototype.drawPainter=function(a){for(var c=a.length,b=0;b<c;b++)a[b].drawn=!1,a[b].draw(this.ctx,this);for(var d=[],f=[],e=0,h=a.length,g=.001,l,k;;){l=h;for(b=0;b<c;b++)if(!a[b].drawn){k=!0;for(var m=0;m<c;m++)if(m!=b&&!a[m].drawn&&a[b].inFrontOf(d,a[m],g)){k=!1;break}k&&(h--,f[e++]=a[b],a[b].drawn=!0)}if(0==h)break;else if(h==l){if(g*=10,.1<g){for(b=0;b<c;b++)a[b].drawn||(f[e++]=a[b],a[b].drawn=!0);break}}else g=.001}for(b=
0;b<c;b++)f[b].draw(this.ctx,this)};R.prototype.rayFromEye=function(a,c){return{x:-this.eye.x,y:(a-(this.w_2+this.Ox))/this.scale-this.eye.y,z:(this.h_2+this.Oy-c)/this.scale-this.eye.z}};R.prototype.addEvents=function(){function c(a){window.focus();document.activeElement.blur();g.click=0;g.evaluator.setVariable(g.id+".mouse_pressed",0);window.removeEventListener("touchmove",e,!1);window.removeEventListener("touchend",c,!1);a.preventDefault();g.parent.update()}function b(c){document.body.focus();
g.click=0;g.evaluator.setVariable(g.id+".mouse_pressed",0);c.preventDefault();"R"===g.whichBtn&&(window.removeEventListener("mousemove",f,!1),g.posZoom==g.posZoomNew&&a.showConfig&&g.parent.externalSpace.show());window.removeEventListener("mousemove",e,!1);window.removeEventListener("mouseup",b,!1);g.parent.update()}function d(c){g.posAnte=a.getCursorPosition(c,g.container);g.mouse_x=g.getRelativeX(g.posAnte.x);g.mouse_y=g.getRelativeY(g.posAnte.y);g.evaluator.setVariable(g.id+".mouse_x",g.mouse_x);
g.evaluator.setVariable(g.id+".mouse_y",g.mouse_y);g.parent.update()}function f(c){c.preventDefault();g.posZoomNew=a.getCursorPosition(c,g.container).y;g.evaluator.setVariable(g.scaleStr,g.tempScale+g.tempScale/45*((g.posZoom-g.posZoomNew)/10));g.posObserverNew=a.getCursorPosition(c,g.container).x;g.evaluator.setVariable(g.obsStr,g.tempObserver-2.5*(g.posObserver-g.posObserverNew));g.parent.update()}function e(c){if(!g.fixed&&g.click){n=(g.getAbsoluteX(g.oldMouse.x)-g.getAbsoluteX(g.mouse_x))/4;h=
(-g.getAbsoluteY(g.oldMouse.y)+g.getAbsoluteY(g.mouse_y))/4;if(n!==g.disp.x||h!==g.disp.y)g.alpha=a.degToRad(g.evaluator.getVariable(g.rotZStr)),g.beta=a.degToRad(-g.evaluator.getVariable(g.rotYStr)),g.alpha=a.radToDeg(g.alpha)-n,g.beta=a.radToDeg(g.beta)-h,g.evaluator.setVariable(g.rotZStr,g.alpha),g.evaluator.setVariable(g.rotYStr,-g.beta),g.disp.x=n,g.disp.y=h,g.oldMouse.x=g.getRelativeX(g.posAnte.x),g.oldMouse.y=g.getRelativeY(g.posAnte.y);d(c);c.preventDefault()}}var g=this;this.canvas.oncontextmenu=
function(){return!1};this.canvas.addEventListener("touchstart",function(b){window.focus();document.activeElement.blur();g.click=1;g.evaluator.setVariable(g.id+".mouse_pressed",1);g.parent.deactivateGraphicControls();g.posAnte=a.getCursorPosition(b,g.container);g.oldMouse.x=g.getRelativeX(g.posAnte.x);g.oldMouse.y=g.getRelativeY(g.posAnte.y);d(b);window.addEventListener("touchmove",e);window.addEventListener("touchend",c);b.preventDefault()});this.canvas.addEventListener("mousedown",function(c){document.body.focus();
g.click=1;g.parent.deactivateGraphicControls();g.whichBtn=a.whichBtn(c);"R"===g.whichBtn?(window.addEventListener("mouseup",b),g.posObserver=a.getCursorPosition(c,g.container).x,g.posObserverNew=g.posObserver,g.posZoom=a.getCursorPosition(c,g.container).y,g.posZoomNew=g.posZoom,g.fixed||(g.tempScale=g.scale,g.tempObserver=g.observer,window.addEventListener("mousemove",f))):"L"==g.whichBtn&&(g.evaluator.setVariable(g.id+".mouse_pressed",1),g.posAnte=a.getCursorPosition(c,g.container),g.oldMouse.x=
g.getRelativeX(g.posAnte.x),g.oldMouse.y=g.getRelativeY(g.posAnte.y),d(c),window.addEventListener("mousemove",e),window.addEventListener("mouseup",b));c.preventDefault()});this.disp={x:0,y:0};document.addEventListener("visibilitychange",function(a){b(a)});document.addEventListener("mouseleave",function(a){b(a)})};a.Space3D=R;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g,e,d,q,p,b,k=function(b,c){var d=a.Space.call(this,b,c)||this;g=d.parent.evaluator;void 0!=d._w_&&(b=g.parser.parse(d._w_),d._w_="number"!=b.type?b:void 0);void 0!=d._h_&&(b=g.parser.parse(d._h_),d._h_="number"!=b.type?b:void 0);d.isFirefox=/firefox/i.test(window.navigator.userAgent);d.file=d.file?d.file.trim():"";d.file.match(/^\[/)&&d.file.match(/\]$/)?d.file=g.parser.parse(d.file.substring(1,d.file.length-1)):d.file.match(/^'/)&&d.file.match(/'$/)?
d.file=g.parser.parse(d.file):d.file=g.parser.parse("'"+d.file+"'");d.oldFile=g.eval(d.file);d.MyIFrame=a.newHTML("iframe",{marginheight:0,marginwidth:0,frameborder:0,scrolling:"auto",style:"position:absolute;left:0;top:0;"});0!=d.oldFile&&d.MyIFrame.setAttribute("src",d.oldFile);d.container=a.newHTML("div",{id:d.id,style:(a.isIOS?"overflow:scroll;-webkit-overflow-scrolling:touch;overflow-scrolling:touch;":"")+"position:absolute;width:"+d.w+"px;height:"+d.h+"px;left:"+d.x+"px;top:"+d.y+"px;z-index:"+
d.zIndex+";background-repeat:no-repeat;background-position:center;"});d.container.appendChild(d.MyIFrame);d.imageSrc&&(d.container.style.backgroundImage="url("+d.imageSrc+")");d.parent.container.insertBefore(d.container,d.parent.loader);d.MyIFrame.onload=function(c){var b=this;d.evaluator.setFunction(d.id+".set",function(a,c){b.contentWindow.postMessage({type:"set",name:a,value:c},"*");return 0});d.evaluator.setFunction(d.id+".update",function(){b.contentWindow.postMessage({type:"update"},"*");return 0});
d.evaluator.setFunction(d.id+".exec",function(a,c){b.contentWindow.postMessage({type:"exec",name:a,value:c},"*");return 0});d.evaluator.setFunction(d.id+".changeConf",function(c){if(c){if(a.cacheFiles[c])var d=a.cacheFiles[c];else d=(d=document.getElementById(c))&&"descartes/embed"===d.type?d.textContent:a.openExternalFile(c),d=(d=(new DOMParser).parseFromString(d,"text/html").querySelector("ajs"))?d.innerHTML:"",a.cacheFiles[c]=d;b.contentWindow.postMessage({type:"change_config",filename:c,content:d},
"*")}return 0});d.evaluator.setFunction(d.id+".changeContent",function(a){a&&(a=(a=(new DOMParser).parseFromString(a.replace(/&sq;/g,"'"),"text/html").querySelector("ajs"))?a.innerHTML:"",b.contentWindow.postMessage({type:"change_content",content:a},"*"))});d.ImReady=!d.isFirefox;d.isFirefox||(d.container.style.visibility="visible",d.container.style.opacity="1",d.container.style.zIndex=d.zIndex,d.container.style.display=d.drawIfValue?"block":"none");d.MyIFrame.style.visibility="visible";d.container.style.backgroundImage=
""};d.update=d.iframeUpdate;d.evaluator.setVariable(d.id+"._scroll",0);return d};$jscomp.inherits(k,a.Space);k.prototype.init=function(){p=this;p.initSpace();p.MyIFrame&&Object.assign(p.MyIFrame.style,{width:p.w+"px",height:p.h+"px"})};k.prototype.iframeUpdate=function(a){g=this.evaluator;this.drawIfValue=0<g.eval(this.drawif);this.ImReady?this.container.style.display=this.drawIfValue?"block":"none":(this.container.style.visibility=this.drawIfValue?"visible":"hidden",this.container.style.opacity=
this.drawIfValue?"1":"0",this.container.style.zIndex=this.drawIfValue?this.zIndex:-1E3);if(this.drawIfValue){a&&(this.x=this.y=Infinity);e=this.x!==g.eval(this.xExpr)+this.displaceRegionWest;d=this.y!==g.eval(this.yExpr)+this.parent.plecaHeight+this.displaceRegionNorth;this.x=e?g.eval(this.xExpr)+this.displaceRegionWest:this.x;this.y=d?g.eval(this.yExpr)+this.parent.plecaHeight+this.displaceRegionNorth:this.y;void 0!=this._w_&&(a=g.eval(this._w_),this.w!==a&&(this.container.style.width=this.MyIFrame.style.width=
a+"px",this.w=a));void 0!=this._h_&&(a=g.eval(this._h_),this.h!==a&&(this.container.style.height=this.MyIFrame.style.height=a+"px",this.h=a));if(e||d)this.container.style.left=this.x+"px",this.container.style.top=this.y+"px";q=g.eval(this.file);q!==this.oldFile&&(this.ImReady=!1,this.isFirefox||(this.container.style.display="block",this.container.style.visibility=this.drawIfValue?"visible":"hidden",this.container.style.opacity=this.drawIfValue?"1":"0",this.container.style.zIndex=this.drawIfValue?
this.zIndex:-1E3),this.imageSrc&&(this.container.style.backgroundImage="url("+this.imageSrc+")"),this.MyIFrame.style.visibility="hidden",this.oldFile=q,this.MyIFrame.contentWindow.location.replace(q));b=g.getVariable(this.id+"._scroll");1==b?(this.MyIFrame.setAttribute("scrolling","yes"),this.MyIFrame.style.overflow=""):-1==b?(this.MyIFrame.setAttribute("scrolling","no"),this.MyIFrame.style.overflow="hidden"):(this.MyIFrame.setAttribute("scrolling","auto"),this.MyIFrame.style.overflow="")}else this.MyIFrame.contentWindow.blur()};
a.SpaceHTMLIFrame=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var g=1,e=function(d){this.children=d.children;this.lessonParser=d.lessonParser;this.images=d.images;this.images.length=d.images.length;this.audios=d.audios;this.audios.length=d.audios.length;this.descartesApp=d;this.imgLoader=a.newHTML("div",{class:"DescartesLoaderImage"});this.progress=a.newHTML("progress",{class:"PBL",value:0,max:100});d.imgLoader?(d.loader.style.backgroundColor="rgba(0,0,0,0)",this.imgLoader.setAttribute("style","background-image:url("+
d.imgLoader+");background-size:contain;")):(g=d.width<d.height?d.width/1144:d.height/1092,g=2.5<g?2.5:g,this.imgLoader.setAttribute("style","background-image:url("+a.loaderImg.src+");background-position:50% 33.5%;background-size:"+880*g+"px;"),this.progress.setAttribute("style","visibility:visible; left:"+(d.width-726*g)/2+"px; top:"+(33.5*d.height/100+940*g/2)+"px; width:"+726*g+"px; height:"+14*g+"px;"));d.loader.appendChild(this.imgLoader);d.loader.appendChild(this.progress);d.firstRun=!1;this.initPreloader()};
e.prototype.initPreloader=function(){var d=this,e=d.children,g=d.images,b=d.audios,k=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,m=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi;g["lib/DescartesCCLicense.png"]=a.getCCLImg();g["lib/DescartesCCLicense.png"].ready=1;var c,l;var f=0;for(c=e.length;f<c;f++)if("rtf"!==e[f].name){if(e[f].value.match(/'macro'|'makro'/g)){var v="";var r=d.lessonParser.split(e[f].value);var u=0;for(l=r.length;u<l;u++)"expresion"===babel[r[u][0]]&&(v=r[u][1]);if(v)var y=(y=document.getElementById(v))&&
"descartes/macro"==y.type?y.text:a.openExternalFile(v);if(y&&(r=y.match(k)))for(v=0,l=r.length;v<l;v++)u=r[v],u.toLowerCase().match(/vacio.gif$/)||""==u.substring(0,u.length-4)||(g[u]=new Image,g[u].addEventListener("load",function(){this.ready=1}),g[u].addEventListener("error",function(){this.errorload=1}),g[u].src=u)}if(r=e[f].value.match(k))for(v=0,l=r.length;v<l;v++)u=r[v],u.toLowerCase().match(/vacio.gif$/)||""==u.substring(0,u.length-4)||(g[u]=new Image,g[u].addEventListener("load",function(){this.ready=
1}),g[u].addEventListener("error",function(){this.errorload=1}),g[u].src=u);if(r=e[f].value.match(m))for(v=0,u=r.length;v<u;v++)d.initAudio(r[v])}for(var n in g)g.hasOwnProperty(n)&&d.images.length++;for(n in b)b.hasOwnProperty(n)&&d.audios.length++;var h=d.images.length+d.audios.length;0<h&&d.progress.setAttribute("max",h);var x,w=function(){x=0;for(var c in g)g.hasOwnProperty(c)&&(g[c].ready||g[c].errorload)&&x++;for(c in b)b.hasOwnProperty(c)&&(b[c].ready||b[c].errorload)&&x++;d.progress.setAttribute("value",
x);x!=h?d.timer=a.setTimeout(w,1):d.descartesApp.initBuildApp()};w()};e.prototype.initAudio=function(d){var e=this.audios;e[d]=new Audio(d);e[d].filename=d;var g=function(){this.ready=1},b=function(){this.canPlayType("audio/"+this.filename.substring(this.filename.length-3))||"mp3"!=this.filename.substring(this.filename.length-3)?(console.warn("El archivo '"+d+"' no puede ser reproducido"),this.errorload=1):(e[d]=new Audio(this.filename.replace("mp3","ogg")),e[d].filename=this.filename.replace("mp3",
"ogg"),e[d].addEventListener("canplaythrough",g),e[d].addEventListener("load",g),e[d].addEventListener("error",b),e[d].load())};e[d].addEventListener("canplaythrough",g);e[d].addEventListener("load",g);e[d].addEventListener("error",b);a.hasTouchSupport?(e[d].load(),e[d].play(),a.setTimeout(function(){e[d].pause()},20),e[d].ready=1):e[d].load()};a.DescartesLoader=e;return a}(descartesJS||{});
descartesJS=function(a){function g(a){for(var c="[",b=0,f=a.length;b<f;b++)Array.isArray(a[b])?c+=g(a[b]):(d=a[b]||0,"string"==typeof d&&(d="'"+d+"'"),c+=d),b<f-1&&(c+=",");return c+"]"}function e(){q=window.innerWidth/this.width;p=window.innerHeight/this.height;a.cssScale=b=Math.min(q,p);this.container.style.transformOrigin="0 0";this.container.parentNode.style.width=window.innerWidth+"px";this.container.parentNode.style.height=window.innerHeight+"px";q<p?(this.container.style.left="0",this.container.style.top=
"50%",this.container.style.transform="translate3d(0px, 0px, 0px) scale("+b+") translate(0, -50%)"):(this.container.style.left="50%",this.container.style.top="0",this.container.style.transform="translate3d(0px, 0px, 0px) scale("+b+") translate(-50%, 0)")}if(a.loadLib)return a;var d,q,p,b,k=function(b){this.animation={playing:!1,play:function(){},stop:function(){},reinit:function(){}};this.ratio=a._ratio;this.applet=b;this.parentC=b.parentNode;this.width=parseFloat(b.getAttribute("width"));this.height=
parseFloat(b.getAttribute("height"));this.decimal_symbol=".";this.decimal_symbol_regexp=/\./g;this.language="espa\u00f1ol";this.children=b.getElementsByTagName("param");a.ccLicense=!0;for(var c=0,d=this.children.length;c<d;c++)"CreativeCommonsLicense"===this.children[c].name&&(a.ccLicense="no"!==this.children[c].value);this.code=b.getAttribute("code");this.saveState=[];this.images={length:-1};this.audios={length:-1};this.firstRun=!0;this.keyboard=new a.Keyboard(this);this.scaleToFit=function(){};
this.init()};k.prototype.init=function(){this.stop();this.evaluator=new a.Evaluator(this);this.evaluator.setVariable("DJS.w",this.width);this.evaluator.setVariable("DJS.h",this.height);this.getURLParameters();this.lessonParser=new a.LessonParser(this);this.arquimedes=/DescartesWeb2_0|Arquimedes|Discurso/i.test(this.code);this.licenseA=a.ccLicense?"{\\rtf1\\uc0{\\fonttbl\\f0\\fcharset0 Arial;}{\\f0\\fs34 __________________________________________________________________________________\\par \\fs22                                        Los contenidos de esta unidad did\u00e1ctica interactiva est\u00e1n bajo una licencia {\\*\\hyperlink Creative Commons|https://creativecommons.org/licenses/by-nc-sa/4.0/deed.es}, si no se indica lo contrario.\\par                                        La unidad did\u00e1ctica fue creada con Descartes, que es un producto de c\u00f3digo abierto, {\\*\\hyperlink Creditos|https://arquimedes.matem.unam.mx/Descartes5/creditos/conCCL.html}\\par }":
"";for(var b=this.children,c,d=0,f=0,g=a.ccLicense?90:0,k=0,p=b.length;k<p;k++)c=b[k],"rtf_height"==c.name&&(d=parseInt(c.value)+120||this.height),"Buttons"==babel[c.name]&&(this.buttonsConfig=this.lessonParser.parseButtonsConfig(c.value),f=this.buttonsConfig.height),"image_loader"==c.name&&(this.imgLoader=c.value),"expand"==c.name&&(this.expand=c.value),"docBase"==c.name&&(this.docBase=c.value,c=a.newHTML("base",{id:"descartesJS_base",href:this.docBase}),document.head.appendChild(c));this.arquimedes&&
(this.ratio=1,d&&(this.height=d+f+g));this.externalSpace&&document.body.removeChild(this.externalSpace.container);this.externalSpace=new a.SpaceExternal(this);this.northSpace={container:a.newHTML("div"),controls:[]};this.southSpace={container:a.newHTML("div"),controls:[]};this.eastSpace={container:a.newHTML("div"),controls:[]};this.westSpace={container:a.newHTML("div"),controls:[]};this.editableRegion={container:a.newHTML("div"),textFields:[]};this.controls=[];this.auxiliaries=[];this.events=[];this.nIframes=
this.plecaHeight=this.tabindex=this.zIndex=0;void 0!=this.container&&(this.cleanCanvasImages(),this.parentC.removeChild(this.container),delete this.container,delete this.loader);this.container=a.newHTML("div");this.loader=a.newHTML("div",{class:"DescartesLoader"});this.parentC.insertBefore(this.container,this.parentC.firstChild);this.container.width=this.loader.width=this.width;this.container.height=this.loader.height=this.height;this.container.className="DescartesAppContainer";this.container.setAttribute("style",
"width:"+this.width+"px;height:"+this.height+"px;");this.container.appendChild(this.loader);"fit"==this.expand&&(this.container.parentNode.removeAttribute("align"),this.container.parentNode.style.overflow="hidden",this.scaleToFit=e,this.scaleToFit());"cover"==this.expand&&(this.scaleToFit=function(){this.width=window.innerWidth;this.height=window.innerHeight;this.container.width=this.width;this.container.height=this.height;this.container.setAttribute("style","width:"+this.width+"px;height:"+this.height+
"px;");if(this.spaces)for(var a=0,c=this.spaces.length;a<c;a++)this.spaces[a].initSpace(),this.spaces[a].init(),this.spaces[a].update(!0)},this.scaleToFit());this.spaces=[];this.firstRun?(this.loader.style.display="block",new a.DescartesLoader(this)):this.initBuildApp()};k.prototype.initBuildApp=function(){a.showConfig=!0;for(var b=this.children,c,d=this.lessonParser,f=[],e=[],g=[],k=[],p=[],n=[],h=0,q=b.length;h<q;h++)if(c=b[h],"editable"==babel[c.name])a.showConfig="false"==babel[c.value]?!1:!0;
else if("language"==babel[c.name])this.language=c.value;else if("pleca"==c.name)c=d.parsePleca(c.value,this.width),this.container.insertBefore(c,this.loader),this.plecaHeight=c.imageHeight?c.imageHeight:c.offsetHeight;else if("Buttons"==babel[c.name])this.buttonsConfig=d.parseButtonsConfig(c.value);else if("decimal_symbol"==babel[c.name])this.decimal_symbol=c.value,this.decimal_symbol_regexp=new RegExp("\\"+this.decimal_symbol,"g");else if("version"==babel[c.name])this.version=parseInt(c.value);else if("language"==
babel[c.name])this.language=c.value;else if("rtf"==c.name){var w=(this.width-780)/2,z=parseInt(this.height)-this.plecaHeight-this.buttonsConfig.height-45;k.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='[10,20]' background='yes' text='"+c.value.replace(/'/g,"&squot;")+"'");k.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='["+w+","+(z-25)+"]' background='yes' text='"+this.licenseA+"'");a.ccLicense&&k.push("space='descartesJS_stage' type='image' expresion='["+
(w+15)+","+z+"]' background='yes' abs_coord='yes' file='lib/DescartesCCLicense.png'")}else"E"==c.name.charAt(0)?(c.value.match(/'HTMLIFrame'/)&&this.nIframes++,f.push(c.value)):/^C_/.test(c.name)?e.push(c.value):/^A_/.test(c.name)?g.push(c.value):/^G_/.test(c.name)?(c.value.match(/type='fill'|tipo='relleno'|tipus='ple'|mota='betea'|type='plein'|tipo='recheo'|tipo='curva_piena'|tipo='preencher'|tipus='ple'/)&&(this.ratio=1),k.push(c.value)):/^S_/.test(c.name)?p.push(c.value):"Animation"==babel[c.name]&&
n.push(c.value);this.arquimedes&&(this.stage={container:a.newHTML("div",{id:"descartesJS_Stage"}),scroll:0},this.stage.stageSpace=this.lessonParser.parseSpace("tipo='R2' id='descartesJS_stage' fondo='"+(a.TextController?"ffffffff":"blanco")+"' x='0' y='0' fijo='yes' red='no' red10='no' ejes='no' text='no' ancho='"+this.width+"' alto='"+this.height+"'"),this.stage.container.appendChild(this.stage.stageSpace.container),this.container.appendChild(this.stage.container),this.spaces.push(this.stage.stageSpace));
h=0;for(q=f.length;h<q;h++)b=d.parseSpace(f[h]),this.arquimedes&&this.stage.container.appendChild(b.container),this.spaces.push(b),this.zIndex++;h=0;for(q=k.length;h<q;h++)if(a.DEBUG.elemIndex=h,f=d.parseGraphic(k[h]))this.editableRegionVisible=this.editableRegionVisible||f.visible,f.space.addGraph(f);h=0;for(q=p.length;h<q;h++)(f=d.parse3DGraphic(p[h]))&&f.space.addGraph(f,!0);h=0;for(q=e.length;h<q;h++)this.controls.push(d.parseControl(e[h]));h=0;for(q=g.length;h<q;h++)d.parseAuxiliar(g[h]);h=0;
for(q=n.length;h<q;h++)this.animation=d.parseAnimation(n[h]);this.configRegions();this.updateAuxiliaries();this.updateAuxiliaries();h=0;for(q=this.controls.length;h<q;h++)this.controls[h].init();this.updateControls();this.updateSpaces(!0);var A=this;this.nIframes?a.setTimeout(function(){A.finishInit()},200*this.nIframes):this.finishInit()};k.prototype.finishInit=function(){this.evaluator.setVariable("decimalSymbol",this.decimal_symbol);this.update();this.loader.style.display="none";window.parent!==
window&&(this.parentC.style.margin=this.parentC.style.padding="0px","fit"==this.expand&&window.addEventListener("touchmove",function(a){a.preventDefault();a.stopPropagation()}),window.parent.postMessage({type:"reportSize",href:window.location.href,width:this.width,height:this.height},"*"),window.parent.postMessage({type:"ready",value:window.location.href},"*"),a.onResize());window.opener&&window.opener.postMessage({type:"isResizeNeeded",href:window.location.href},"*");this.externalSpace.init();try{var b=
new CustomEvent("descartesReady",{detail:this});window.dispatchEvent(b)}catch(l){console.warn("CustomEvents not supported in this browser")}var c=this;this.evaluator.setFunction("openKB",function(a,b,d,e,g,k,m,h,p,q,z){c.keyboard.show(null,a,b,d,e,{x:g,y:k,w:m,h:h,fs:p+"px",value:q+"",type:"custom",tagName:"textfield"},z)});this.readyApp=!0};k.prototype.adjustSize=function(){document.body.style.margin=document.body.style.padding=this.parentC.style.margin=this.parentC.style.padding="0px";var b=parseInt(this.width)+
30,c=parseInt(this.height)+90;window.moveTo((parseInt(screen.width)-b)/2,(parseInt(screen.height)-c)/2);window.resizeTo(b,c);a.onResize()};k.prototype.configRegions=function(){var b=this.evaluator.parser,c=this.buttonsConfig||{},d=this.container,f="15",e=100,g=100,k=100,p=100;2==this.version&&(f="14",e=63,g=50,k=44,p=53);var n=0,h=0,q=0,w=0,z=0,A=this.northSpace.controls,E=this.southSpace.controls,J=this.eastSpace.controls,F=this.westSpace.controls;if(0<c.rowsNorth||0<A.length||c.about||c.config){0>=
c.rowsNorth?(n=c.height,c.rowsNorth=1):n=c.height*c.rowsNorth;var G=this.northSpace.container;G.id="descartesJS_north";G.setAttribute("style","width:"+d.width+"px;height:"+n+"px;left:0;top:"+this.plecaHeight+"px;");d.insertBefore(G,this.loader);G=d.width;var D=0;c.about?(D=e,G-=D):e=0;c.config&&(G-=g);var B=Math.ceil(A.length/c.rowsNorth),L=G/B;var H=0;for(var M=A.length;H<M;H++)A[H].expresion=b.parse("("+(D+H%B*L)+","+c.height*Math.floor(H/B)+","+L+","+c.height+")"),A[H].init();c.about&&(H=new a.Button(this,
{region:"north",name:"english"==this.language?"about":"cr\u00e9ditos",font_size:b.parse(f),expresion:b.parse("(0, 0, "+e+", "+n+")")}),H.actionExec={execute:a.showAbout},H.update());c.config&&(new a.Button(this,{region:"north",name:"config",font_size:b.parse(f),action:"config",expresion:b.parse("("+(G+e)+", 0, "+g+", "+n+")")})).update()}if(0<c.rowsSouth||0<E.length||c.init||c.clear){0>=c.rowsSouth?(h=c.height,c.rowsSouth=1):h=c.height*c.rowsSouth;e=d.width;D=0;c.init?(D=k,e-=D):k=0;c.clear&&(e-=
p);G=this.southSpace.container;G.id="descartesJS_south";G.setAttribute("style","width:"+d.width+"px;height:"+h+"px;left:0;bottom:0;");d.insertBefore(G,this.loader);B=Math.ceil(E.length/c.rowsSouth);L=e/B;H=0;for(M=E.length;H<M;H++)E[H].expresion=b.parse("("+(D+H%B*L)+","+c.height*Math.floor(H/B)+","+L+","+c.height+")"),E[H].init();c.init&&(new a.Button(this,{region:"south",name:"english"==this.language?"init":"inicio",font_size:b.parse(f),action:"init",expresion:b.parse("(0, 0, "+k+", "+h+")")})).update();
c.clear&&(new a.Button(this,{region:"south",name:"english"==this.language?"clear":"limpiar",font_size:b.parse(f),action:"clear",expresion:b.parse("("+(e+k)+", 0, "+p+", "+h+")")})).update()}if(0<J.length)for(H=d.height-n-h,w=c.widthEast,G=this.eastSpace.container,G.id="descartesJS_east",G.setAttribute("style","width:"+w+"px;height:"+H+"px;right:0;top:"+n+"px;"),d.insertBefore(G,this.loader),H=0,M=J.length;H<M;H++)J[H].expresion=b.parse("(0,"+c.height*H+","+w+","+c.height+")"),J[H].init();if(0<F.length)for(H=
d.height-n-h,z=c.widthWest,G=this.westSpace.container,G.id="descartesJS_west",G.setAttribute("style","width: "+z+"px;height:"+H+"px;left:0;top:"+n+"px;"),d.insertBefore(G,this.loader),H=0,M=F.length;H<M;H++)F[H].expresion=b.parse("(0,"+c.height*H+","+z+","+c.height+")"),F[H].init();if(this.editableRegionVisible)for(q=c.height,G=this.editableRegion.container,G.id="descartesJS_editableRegion",G.setAttribute("style","position:absolute;width:"+d.width+"px;height:"+q+"px;left:0;top:"+(d.height-h-c.height)+
"px;"),d.insertBefore(G,this.loader),b=this.editableRegion.textFields,d=d.width/b.length,c=a.getFieldFontSize(q),H=0,M=b.length;H<M;H++)"div"==b[H].type?(G.appendChild(b[H].container),b[H].container.setAttribute("style","font-family:"+a.sansserif_font+";width:"+(d-4)+"px;height:"+q+"px;position:absolute;left:"+H*d+"px;top:0;"),F=b[H].container.firstChild,F.setAttribute("style","font-family:"+a.sansserif_font+";font-size:"+c+"px;padding-top:0;background-color:#e0e4e8;position:absolute;left:0;top:0;height:"+
q+"px;text-align:center;line-height:"+q+"px;"),J=F.offsetWidth,F.style.width=J+"px",F.firstChild.textContent=F.firstChild.textContent.substring(3,F.firstChild.textContent.length-3),b[H].container.lastChild.setAttribute("style","font-family:"+a.monospace_font+";font-size:"+c+"px;width:"+(d-J)+"px;height:"+q+"px;position:absolute;left:"+J+"px;top:0;border:2px groove white;")):(G.appendChild(b[H]),b[H].setAttribute("style","font-family:"+a.monospace_font+";font-size:"+c+"px;width:"+d+"px;height:"+q+
"px;position:absolute;left:"+H*d+"px;top:0;border:2px groove white;"));this.displaceRegionNorth=n;this.displaceRegionSouth=h+(q||0);this.displaceRegionEast=w;this.displaceRegionWest=z;H=0;for(M=this.spaces.length;H<M;H++)this.spaces[H].init()};k.prototype.update=function(){this.updateAuxiliaries();this.updateControls();this.updateEvents();this.updateControls();this.updateSpaces()};k.prototype.clearClick=function(){for(var a=0,c=this.spaces.length;a<c;a++)this.spaces[a].clearClick()};k.prototype.removeButtonClick=
function(){a.newBlobContent=null;for(var b=0,c=this.controls.length;b<c;b++)this.controls[b].buttonClick=!1};k.prototype.deactivateGraphicControls=function(){for(var a,c=0,b=this.controls.length;c<b;c++)a=this.controls[c],"GraphicControl"==a.type&&a.deactivate()};k.prototype.updateAuxiliaries=function(){for(var a=0,c=this.auxiliaries.length;a<c;a++)this.auxiliaries[a].update()};k.prototype.updateEvents=function(){for(var a=0,c=this.events.length;a<c;a++)this.events[a].update()};k.prototype.updateControls=
function(){for(var a=0,c=this.controls.length;a<c;a++)this.controls[a].update()};k.prototype.updateSpaces=function(a){for(var c=0,b=this.spaces.length;c<b;c++)this.spaces[c].update(a)};k.prototype.clear=function(){for(var a=0,c=this.spaces.length;a<c;a++)this.spaces[a].spaceChange=!0,this.spaces[a].drawBackground&&this.spaces[a].drawBackground()};k.prototype.play=function(){this.animation.play()};k.prototype.stop=function(){this.animation.stop()};k.prototype.reinitAnimation=function(){this.animation.reinit()};
k.prototype.stopAudios=function(){this.stop();for(var a in this.audios)this.audios.hasOwnProperty(a)&&this.audios[a].pause&&(this.audios[a].pause(),this.audios[a].currentTime=0)};k.prototype.getImage=function(a){var c=this.images;return a?(c[a]||(c[a]=new Image,c[a].addEventListener("load",function(){this.ready=1}),c[a].addEventListener("error",function(){this.ready=0;this.errorload=1}),c[a].src=a),c[a]):new Image};k.prototype.getAudio=function(b){var c=this.audios;if(b){if(!c[b]){b.lastIndexOf(".");
c[b]=new Audio(b);var d=function(a){this.ready=1};c[b].addEventListener("canplaythrough",d);var f=function(a){this.canPlayType("audio/"+b.substring(b.length-3))||"mp3"!=b.substring(b.length-3)?(console.warn("El archivo '"+b+"' no puede ser reproducido"),this.errorload=1):(c[b]=new Audio(b.replace("mp3","ogg")),c[b].addEventListener("canplaythrough",d),c[b].addEventListener("load",d),c[b].addEventListener("error",f),c[b].load())};c[b].addEventListener("error",f);c[b].play();a.setTimeout(function(){c[b].pause()},
15)}return c[b]}return new Audio};k.prototype.getControlByCId=function(a){return this.getControlById(a,!0)};k.prototype.getControlById=function(a,c){c=c?"cID":"id";for(var b,d=0,e=this.controls.length;d<e;d++)if(b=this.controls[d],b[c]==a)return b;return{update:function(){},w:0,h:0}};k.prototype.getSpaceByCId=function(a){return this.getSpaceById(a,!0)};k.prototype.getSpaceById=function(a,c){c=c?"cID":"id";for(var b,d=0,e=this.spaces.length;d<e;d++)if(b=this.spaces[d],b[c]==a)return b;return{update:function(){},
w:0,h:0}};k.prototype.getURLParameters=function(){var a=window.location.href,c=a.indexOf("?");if(-1!=c){a=decodeURIComponent(a.substring(c+1)).split("&");for(var b=0,d=a.length;b<d;b++)c=a[b].split("="),2==c.length&&(+c[1]==+c[1]&&(c[1]=parseFloat(c[1])),this.evaluator.setVariable("URL."+c[0],c[1]))}};k.prototype.getState=function(){var a="",c=this.evaluator.variables,b;for(b in c)if(c.hasOwnProperty(b)){var d=c[b];"string"==typeof d&&(d="'"+d+"'");void 0!=d&&"rnd"!=b&&"\u03c0"!=b&&"pi"!=b&&"e"!=
b&&"Infinity"!=b&&"-Infinity"!=b&&"object"!=typeof d&&(a=""!=a?a+"\n"+b+"="+d:b+"="+d)}d=this.evaluator.vectors;for(var e in d)d.hasOwnProperty(e)&&(a+="\n"+e+"="+g(d[e]));e=this.evaluator.matrices;for(var k in e)e.hasOwnProperty(k)&&(a+="\n"+k+"="+g(e[k]));return a};k.prototype.setState=function(a,b){a=a.split("\n");for(var c,d,e=0,g=a.length;e<g;e++)c=a[e].split("="),2<=c.length&&(d=eval(c[1]),-1!=c[1].indexOf("[[")?(this.evaluator.matrices[c[0]]=d,this.evaluator.matrices[c[0]].rows=d.length,this.evaluator.matrices[c[0]].cols=
d[0].length):-1!=c[1].indexOf("[")?(this.evaluator.vectors[c[0]]=d,this.evaluator.variables[c[0]+".long"]=d.length):this.evaluator.variables[c[0]]=d);b||this.update()};k.prototype.getEvaluation=function(){for(var a=correct=0,b="",d=0,e=this.controls.length;d<e;d++)"textfield"==this.controls[d].gui&&this.controls[d].evaluate&&(a++,correct+=this.controls[d].ok,this.controls[d].value=""==this.controls[d].value?"''":this.controls[d].value,b+=" \\n "+this.controls[d].id+"="+this.controls[d].value+"|"+
this.controls[d].ok);return"questions="+a+" \\n correct="+correct+" \\n wrong="+(a-correct)+b};k.prototype.showSolution=function(){for(var a=this.controls,b=0,d=a.length;b<d;b++)"textfield"==a[b].gui&&a[b].evaluate&&a[b].changeValue(a[b].getFirstAnswer());this.update()};k.prototype.showAnswer=function(){for(var a=0,b=this.saveState.length;a<b;a++)this.evaluator.eval(this.saveState[a]);this.update()};k.prototype.cleanCanvasImages=function(){this.container.querySelectorAll("canvas").forEach(function(a){a.width=
a.height=1;a.style.width=a.style.height="1px"});this.spaces.forEach(function(a){a.canvas&&(a.canvas=a.ctx=null);a.backCanvas&&(a.backCanvas=a.backCtx=null)});for(var a in this.images)this.images[a].nodeName&&"canvas"===this.images[a].nodeName.toLowerCase()&&delete this.images[a]};a.DescartesApp=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.DEBUG={PARENTHESIS_CLOSING:"Faltan par\u00e9ntesis por cerrar",PARENTHESIS_OPENING:"Faltan par\u00e9ntesis por abrir",BRACKET_CLOSING:"Faltan corchetes por cerrar",BRACKET_OPENING:"Faltan corchetes por abrir",INCOMPLETE_IF:"Condicional incompleta",EXPRESSION:"En la expresi\u00f3n",setError:function(g,e){g="Error: "+g+" en\u300a "+e+" \u300b";var d="";switch(a.DEBUG.objectName){case "Auxiliar":e="event"===a.DEBUG.typeName||"algorithm"===a.DEBUG.typeName||
"constant"===a.DEBUG.typeName?"En el programa ":"En la definici\u00f3n ";if("doExpr"==babel[a.DEBUG.paramName]||"init"==babel[a.DEBUG.paramName])d=" en la l\u00ednea "+(a.DEBUG.lineCount+1);g+=e+"\u300c"+a.DEBUG.idName+"\u300d, en el param\u00e9tro \u300c"+a.DEBUG.paramName+"\u300d"+d+".";break;case "Graphic":g+="En el gr\u00e1fico #"+(a.DEBUG.elemIndex+1)+" de tipo \u300c"+a.DEBUG.idName+"\u300d, en el param\u00e9tro \u300c"+a.DEBUG.paramName+"\u300d."}console.info(g)}};return a}(descartesJS||{});
descartesJS=function(a){function g(){e().forEach(function(b){a.apps.push(new a.DescartesApp(b));b.className="DescartesJS"})}function e(){return[].concat($jscomp.arrayFromIterable(document.querySelectorAll("applet,ajs"))).filter(function(a){return/Descartes|DescartesJS|descinst.DescartesWeb2_0.class|Arquimedes|Discurso/i.test(a.getAttribute("code"))})}function d(){document.querySelectorAll(".DescartesAppContainer").forEach(function(a){a.remove()})}function q(b){b=a.newHTML("div");var e='<div style="font-size:12px;visibility:hidden;">';
"descartesJS_serif descartesJS_sansserif descartesJS_monospace DJS_symbol DJS_sansserif DJS_serif DJS_monospace DJS_math".split(" ").forEach(function(a){e+='<div style="font-family:'+a+';"><span>_</span><span style="font-weight:bold;">_</span><span style="font-style:italic;">_</span><span style="font-weight:bold;font-style:italic;">_</span></div>'});b.innerHTML=e+"</div>";document.body.appendChild(b);a.getFeatures();a.hasCanvas?(window.scrollTo(0,10),d(),g(),window.addEventListener("resize",a.onResize),
window.scrollTo(0,0)):document.getElementById("StyleDescartesApps").innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:block;}";b.remove()}if(a.loadLib)return a;a.apps=[];a.getDescartesApps=function(){return a.apps};(function(){var b=document.getElementById("StyleDescartesApps");b&&b.remove();b=a.newHTML("style",{id:"StyleDescartesApps",type:"text/css",rel:"stylesheet"});b.innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:none;}";document.head.appendChild(b)})();a.onResize=
function(b){0<a.apps.length&&a.apps[0].scaleToFit()};var p=Object.create(null);a.onMessage=function(b){if(0<a.apps.length){var d=b.data;if(d)if("set"===d.type)"string"==typeof d.value||"number"==typeof d.value?a.apps[0].evaluator.setVariable(d.name,d.value):d.value&&void 0!=d.value.rows?a.apps[0].evaluator.matrices[d.name]=d.value:a.apps[0].evaluator.vectors[d.name]=d.value;else if("update"===d.type)a.apps[0].update();else if("exec"===d.type)(b=a.apps[0].evaluator.getFunction(d.name))&&b.apply(a.apps[0].evaluator,
d.value.toString().split(","));else if("isResizeNeeded"===d.type)b.source.postMessage({type:"doResize"},"*");else if("doResize"===d.type)0<a.apps.length&&a.apps[0].adjustSize();else if("change_config"===d.type){p[d.filename]?b=p[d.filename]:(b=a.newHTML("div"),b.innerHTML=d.content,b=b.getElementsByTagName("param"),p[d.filename]=b);var e=document.querySelector("base");e||(e=a.newHTML("base"),document.body.appendChild(e));e.setAttribute("href",d.filename);a.apps[0].children=b;a.apps[0].init()}else"change_content"===
d.type&&(new_applets=a.newHTML("div"),new_applets.innerHTML=d.content,new_applets=new_applets.getElementsByTagName("param"),a.apps[0].children=new_applets,a.apps[0].init())}};void 0==a.loadLib&&(a.loadLib=!0,window.addEventListener("load",q),window.addEventListener("message",a.onMessage),["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd"].forEach(function(b){window.addEventListener(b,function(b){a.onResize(b)})}),document.fonts.ready.then(function(){setTimeout(function(){a.apps.forEach(function(a){a.updateControls();
a.updateSpaces(!0)})},500)}));return a}(descartesJS||{});
