Files
poc-provedor/html/blockly-games/bird/generated/pt-br/compressed.js

703 lines
336 KiB
JavaScript

// Automatically generated file. Do not edit!
'use strict';var b,h={yI:{},vt:40,Ht:125,xy:5,Gy:10,bd:28};h.ly=h.bd;h.sy=8;h.Uy="#000000";h.rm=250;h.Go=10;h.jy=30;h.iz=750;h.Hz=100;h.yy=!0;h.Py=.45;h.Qy=.65;h.Ni={width:96,height:124,url:"sprites.png"};h.Sa=1;h.Vd=2;h.Ga=3;h.Xd=4;h.Qd=5;h.Co=-1;h.Js=0;h.Ks=1;h.PE=0;h.QE=1;h.NE=1;h.OE=2;h.Ji=[];h.Ji[h.Sa]=h.Vd;h.Ji[h.Vd]=h.Sa;h.Ji[h.Ga]=h.Xd;h.Ji[h.Xd]=h.Ga;h.fh=0;h.ik=1;h.zd=2;h.fg=3;h.bt=null;h.Ko=1;h.ct=2;h.bu="VARIABLE";h.Uz="VARIABLE_DYNAMIC";h.Jt="PROCEDURE";h.Qt="RENAME_VARIABLE_ID";
h.dt="DELETE_VARIABLE_ID";
h.g={};h.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();
h.h={};h.g.global.Blockly||(h.g.global.Blockly={});h.g.global.Blockly.Msg||(h.g.global.Blockly.Msg=h.h);h.g.I=function(a,c){this.x=a;this.y=c};h.g.I.Ne=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};h.g.I.ng=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};h.g.I.vC=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};h.g.I.Ok=function(a,c){return new h.g.I(a.x-c.x,a.y-c.y)};h.g.I.sum=function(a,c){return new h.g.I(a.x+c.x,a.y+c.y)};h.g.I.prototype.scale=function(a){this.x*=a;this.y*=a;return this};h.g.I.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};h.g.Oa={};h.g.Oa.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};h.g.Oa.qs=function(a){return a.length?a.reduce(function(c,d){return c.length<d.length?c:d}).length:0};h.g.Oa.JA=function(a,c){if(!a.length)return 0;if(1==a.length)return a[0].length;var d=0;c=c||h.g.Oa.qs(a);for(var e=0;e<c;e++){for(var f=a[0][e],g=1;g<a.length;g++)if(f!=a[g][e])return d;" "==f&&(d=e+1)}for(g=1;g<a.length;g++)if((f=a[g][e])&&" "!=f)return d;return c};
h.g.Oa.KA=function(a,c){if(!a.length)return 0;if(1==a.length)return a[0].length;var d=0;c=c||h.g.Oa.qs(a);for(var e=0;e<c;e++){for(var f=a[0].substr(-e-1,1),g=1;g<a.length;g++)if(f!=a[g].substr(-e-1,1))return d;" "==f&&(d=e+1)}for(g=1;g<a.length;g++)if((f=a[g].charAt(a[g].length-e-1))&&" "!=f)return d;return c};h.g.Oa.Gx=function(a,c){a=a.split("\n");for(var d=0;d<a.length;d++)a[d]=h.g.Oa.aE(a[d],c);return a.join("\n")};
h.g.Oa.aE=function(a,c){if(a.length<=c)return a;for(var d=a.trim().split(/\s+/),e=0;e<d.length;e++)d[e].length>c&&(c=d[e].length);e=-Infinity;var f=1;do{var g=e;var k=a;a=[];var l=d.length/f,m=1;for(e=0;e<d.length-1;e++)m<(e+1.5)/l?(m++,a[e]=!0):a[e]=!1;a=h.g.Oa.Hx(d,a,c);e=h.g.Oa.Fs(d,a,c);a=h.g.Oa.bE(d,a);f++}while(e>g);return k};
h.g.Oa.Fs=function(a,c,d){for(var e=[0],f=[],g=0;g<a.length;g++)e[e.length-1]+=a[g].length,!0===c[g]?(e.push(0),f.push(a[g].charAt(a[g].length-1))):!1===c[g]&&e[e.length-1]++;a=Math.max.apply(Math,e);for(g=c=0;g<e.length;g++)c-=2*Math.pow(Math.abs(d-e[g]),1.5),c-=Math.pow(a-e[g],1.5),-1!=".?!".indexOf(f[g])?c+=d/3:-1!=",;)]}".indexOf(f[g])&&(c+=d/4);1<e.length&&e[e.length-1]<=e[e.length-2]&&(c+=.5);return c};
h.g.Oa.Hx=function(a,c,d){for(var e=h.g.Oa.Fs(a,c,d),f,g=0;g<c.length-1;g++)if(c[g]!=c[g+1]){var k=[].concat(c);k[g]=!k[g];k[g+1]=!k[g+1];var l=h.g.Oa.Fs(a,k,d);l>e&&(e=l,f=k)}return f?h.g.Oa.Hx(a,f,d):c};h.g.Oa.bE=function(a,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e]),void 0!==c[e]&&d.push(c[e]?"\n":" ");return d.join("")};h.g.Yd=function(a,c){this.width=a;this.height=c};h.g.Yd.Ne=function(a,c){return a==c?!0:a&&c?a.width==c.width&&a.height==c.height:!1};h.g.style={};h.g.style.Bf=function(a){if("none"!=h.g.style.Gv(a,"display"))return h.g.style.Ev(a);var c=a.style,d=c.display,e=c.visibility,f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";var g=a.offsetWidth;a=a.offsetHeight;c.display=d;c.position=f;c.visibility=e;return new h.g.Yd(g,a)};h.g.style.Ev=function(a){return new h.g.Yd(a.offsetWidth,a.offsetHeight)};h.g.style.Gv=function(a,c){return h.g.style.getComputedStyle(a,c)||h.g.style.CB(a,c)||a.style&&a.style[c]};
h.g.style.getComputedStyle=function(a,c){return document.defaultView&&document.defaultView.getComputedStyle&&(a=document.defaultView.getComputedStyle(a,null))?a[c]||a.getPropertyValue(c)||"":""};h.g.style.CB=function(a,c){return a.currentStyle?a.currentStyle[c]:null};h.g.style.zh=function(a){var c=new h.g.I(0,0);a=a.getBoundingClientRect();var d=document.documentElement;d=new h.g.I(window.pageXOffset||d.scrollLeft,window.pageYOffset||d.scrollTop);c.x=a.left+d.x;c.y=a.top+d.y;return c};
h.g.style.Jv=function(){var a=document.body,c=document.documentElement;return new h.g.I(a.scrollLeft||c.scrollLeft,a.scrollTop||c.scrollTop)};h.g.style.kJ=function(a,c){a.style.display=c?"":"none"};h.g.style.ew=function(){return"rtl"==h.g.style.Gv(void 0,"direction")};
h.g.style.zB=function(a){var c=h.g.style.getComputedStyle(a,"borderLeftWidth"),d=h.g.style.getComputedStyle(a,"borderRightWidth"),e=h.g.style.getComputedStyle(a,"borderTopWidth");a=h.g.style.getComputedStyle(a,"borderBottomWidth");return{top:parseFloat(e),right:parseFloat(d),bottom:parseFloat(a),left:parseFloat(c)}};h.g.style.ax=function(a,c){a=h.g.style.EB(a,c);c.scrollLeft=a.x;c.scrollTop=a.y};
h.g.style.EB=function(a,c){var d=h.g.style.zh(a),e=h.g.style.zh(c),f=h.g.style.zB(c),g=d.x-e.x-f.left;d=d.y-e.y-f.top;a=h.g.style.Ev(a);e=c.clientHeight-a.height;f=c.scrollLeft;var k=c.scrollTop;f+=Math.min(g,Math.max(g-(c.clientWidth-a.width),0));k+=Math.min(d,Math.max(d-e,0));return new h.g.I(f,k)};h.g.userAgent={};
(function(a){function c(e){return-1!=d.indexOf(e.toUpperCase())}h.g.userAgent.raw=a;var d=h.g.userAgent.raw.toUpperCase();h.g.userAgent.Uf=c("Trident")||c("MSIE");h.g.userAgent.Bm=c("Edge");h.g.userAgent.$y=c("JavaFX");h.g.userAgent.Cp=c("WebKit")&&!h.g.userAgent.Bm;h.g.userAgent.Po=c("Gecko")&&!h.g.userAgent.Cp&&!h.g.userAgent.Uf&&!h.g.userAgent.Bm;h.g.userAgent.wi=c("Android");h.g.userAgent.Zg=c("iPad");h.g.userAgent.st=c("iPod");h.g.userAgent.rt=c("iPhone")&&!h.g.userAgent.Zg&&!h.g.userAgent.st;
h.g.userAgent.jz=c("Macintosh");h.g.userAgent.Oz=h.g.userAgent.Zg||h.g.userAgent.wi&&!c("Mobile")||c("Silk");h.g.userAgent.zt=!h.g.userAgent.Oz&&(h.g.userAgent.st||h.g.userAgent.rt||h.g.userAgent.wi||c("IEMobile"))})(h.g.global.navigator&&h.g.global.navigator.userAgent||"");
h.g.LC=function(a){a.preventDefault();a.stopPropagation()};h.g.On=function(a){return"textarea"==a.target.type||"text"==a.target.type||"number"==a.target.type||"email"==a.target.type||"password"==a.target.type||"search"==a.target.type||"tel"==a.target.type||"url"==a.target.type||a.target.isContentEditable};
h.g.Id=function(a){var c=new h.g.I(0,0),d=a.getAttribute("x");d&&(c.x=parseInt(d,10));if(d=a.getAttribute("y"))c.y=parseInt(d,10);if(d=(d=a.getAttribute("transform"))&&d.match(h.g.Id.Yz))c.x+=Number(d[1]),d[3]&&(c.y+=Number(d[3]));(a=a.getAttribute("style"))&&-1<a.indexOf("translate")&&(a=a.match(h.g.Id.Zz))&&(c.x+=Number(a[1]),a[3]&&(c.y+=Number(a[3])));return c};
h.g.Tk=function(a){for(var c=0,d=0;a;){var e=h.g.Id(a);c+=e.x;d+=e.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new h.g.I(c,d)};h.g.Id.Yz=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/;h.g.Id.Zz=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/;h.g.wj=function(a){return a.ctrlKey&&h.g.userAgent.jz?!0:2==a.button};
h.g.zl=function(a,c,d){var e=c.createSVGPoint();e.x=a.clientX;e.y=a.clientY;d||(d=c.getScreenCTM().inverse());return e.matrixTransform(d)};h.g.Dv=function(a){switch(a.deltaMode){case 0:return{x:a.deltaX,y:a.deltaY};case 1:return{x:a.deltaX*h.vt,y:a.deltaY*h.vt};case 2:return{x:a.deltaX*h.Ht,y:a.deltaY*h.Ht}}};h.g.ND=function(a){return h.g.ys(a,!0)};h.g.te=function(a){if("string"!=typeof a)return a;a=h.g.ys(a,!1);return a.length?a[0]:""};
h.g.zu=function(a){for(var c=h.h,d=a.match(/%{BKY_[A-Z]\w*}/ig),e=0;e<d.length;e++)void 0==c[d[e].toUpperCase().slice(6,-1)]&&console.log("WARNING: No message string for "+d[e]+" in "+a)};
h.g.ys=function(a,c){var d=[],e=a.split("");e.push("");var f=0;a=[];for(var g=null,k=0;k<e.length;k++){var l=e[k];0==f?"%"==l?((l=a.join(""))&&d.push(l),a.length=0,f=1):a.push(l):1==f?"%"==l?(a.push(l),f=0):c&&"0"<=l&&"9">=l?(f=2,g=l,(l=a.join(""))&&d.push(l),a.length=0):"{"==l?f=3:(a.push("%",l),f=0):2==f?"0"<=l&&"9">=l?g+=l:(d.push(parseInt(g,10)),k--,f=0):3==f&&(""==l?(a.splice(0,0,"%{"),k--,f=0):"}"!=l?a.push(l):(f=a.join(""),/[A-Z]\w*/i.test(f)?(l=f.toUpperCase(),(l=h.g.Oa.startsWith(l,"BKY_")?
l.substring(4):null)&&l in h.h?(f=h.h[l],"string"==typeof f?Array.prototype.push.apply(d,h.g.ys(f,c)):c?d.push(String(f)):d.push(f)):d.push("%{"+f+"}")):d.push("%{"+f+"}"),f=a.length=0))}(l=a.join(""))&&d.push(l);c=[];for(k=a.length=0;k<d.length;++k)"string"==typeof d[k]?a.push(d[k]):((l=a.join(""))&&c.push(l),a.length=0,c.push(d[k]));(l=a.join(""))&&c.push(l);a.length=0;return c};h.g.Af=function(){for(var a=h.g.Af.ox.length,c=[],d=0;20>d;d++)c[d]=h.g.Af.ox.charAt(Math.random()*a);return c.join("")};
h.g.Af.ox="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
h.g.Gh=function(){if(void 0!==h.g.Gh.Rp)return h.g.Gh.Rp;if(!h.g.global.getComputedStyle)return!1;var a=document.createElement("p"),c="none",d={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(a,null);for(var e in d)if(void 0!==a.style[e]){a.style[e]="translate3d(1px,1px,1px)";c=h.g.global.getComputedStyle(a);if(!c)return document.body.removeChild(a),!1;c=c.getPropertyValue(d[e])}document.body.removeChild(a);
h.g.Gh.Rp="none"!==c;return h.g.Gh.Rp};h.g.$w=function(a){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)a();else var c=setInterval(function(){"complete"==document.readyState&&(clearInterval(c),a())},10)};h.g.PB=function(){var a=h.g.style.Jv();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};
h.g.Xm=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};h.g.IB=function(){var a=document.documentElement,c=window;return h.g.userAgent.Uf&&c.pageYOffset!=a.scrollTop?new h.g.I(a.scrollLeft,a.scrollTop):new h.g.I(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};h.g.Fq=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=u(a))&&(a=e.indexOf(a),e.splice(a,e.length-a));for(a=0;c=e[a];a++)d[c.type]?d[c.type]++:d[c.type]=1;return d};
h.g.tD=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new h.g.I(d-e.left,c-e.top);c=h.g.Tk(a.Xa);return h.g.I.Ok(d,c).scale(1/a.scale)};h.i={};h.i.Nv="";h.i.ic=!0;h.i.gq=0;h.i.xm="create";h.i.Qs=h.i.xm;h.i.Wj="delete";h.i.Zx=h.i.Wj;h.i.yi="change";h.i.oE=h.i.yi;h.i.ck="move";h.i.Rs=h.i.ck;h.i.cu="var_create";h.i.du="var_delete";h.i.fu="var_rename";h.i.Vm="ui";h.i.vm="comment_create";h.i.Xs="comment_delete";h.i.Ws="comment_change";h.i.wm="comment_move";h.i.Fy="finished_loading";h.i.ay=[h.i.Qs,h.i.Rs,h.i.vm,h.i.wm];h.i.Xj=[];h.i.Ha=function(a){h.i.isEnabled()&&(h.i.Xj.length||setTimeout(h.i.rB,0),h.i.Xj.push(a))};
h.i.rB=function(){for(var a=h.i.filter(h.i.Xj,!0),c=h.i.Xj.length=0,d;d=a[c];c++)if(d.ac){var e=h.ob.Gq(d.ac);if(e){var f=d;if(f.ic)for(e.ni.push(f),e.Hl.length=0;e.ni.length>e.xt&&0<=e.xt;)e.ni.shift();for(var g=0;d=e.Kc[g];g++)d(f)}}};
h.i.filter=function(a,c){a=a.slice();c||a.reverse();for(var d=[],e=Object.create(null),f=0,g;g=a[f];f++)if(!g.uj()){var k=[g.type,g.pc,g.ac].join(" "),l=e[k],m=l?l.event:null;if(!l)e[k]={event:g,index:f},d.push(g);else if(g.type==h.i.ck&&l.index==f-1)m.Sh=g.Sh,m.Rh=g.Rh,m.Dg=g.Dg,l.index=f;else if(g.type==h.i.yi&&g.element==m.element&&g.name==m.name)m.newValue=g.newValue;else if(g.type!=h.i.Vm||"click"!=g.element||"commentOpen"!=m.element&&"mutatorOpen"!=m.element&&"warningOpen"!=m.element)e[k]={event:g,
index:1},d.push(g)}a=d.filter(function(n){return!n.uj()});c||a.reverse();for(f=1;g=a[f];f++)g.type==h.i.yi&&"mutation"==g.element&&a.unshift(a.splice(f,1)[0]);return a};h.i.EA=function(){for(var a=0,c;c=h.i.Xj[a];a++)c.ic=!1};h.i.disable=function(){h.i.gq++};h.i.enable=function(){h.i.gq--};h.i.isEnabled=function(){return 0==h.i.gq};h.i.Fb=function(){return h.i.Nv};h.i.X=function(a){h.i.Nv="boolean"==typeof a?a?h.g.Af():"":a};
h.i.wv=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c};
h.i.qa=function(a){switch(a.type){case h.i.xm:var c=new h.i.Pd(null);break;case h.i.Wj:c=new h.i.ze(null);break;case h.i.yi:c=new h.i.Sf(null,"","","","");break;case h.i.ck:c=new h.i.ah(null);break;case h.i.cu:c=new h.i.Ad(null);break;case h.i.du:c=new h.i.Zd(null);break;case h.i.fu:c=new h.i.Fe(null,"");break;case h.i.Vm:c=new h.i.dd(null,"","","");break;case h.i.vm:c=new h.i.hf(null);break;case h.i.Ws:c=new h.i.Ai(null,"","");break;case h.i.wm:c=new h.i.Vg(null);break;case h.i.Xs:c=new h.i.jf(null);
break;default:throw Error("Unknown event type.");}c.qa(a);c.ac=(void 0).id;return c};h.i.Zu=function(a){if((a.type==h.i.ck||a.type==h.i.xm)&&a.ac){var c=h.ob.Gq(a.ac);if(a=v(c,a.pc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.Ze(!0);else if((a.M||a.U)&&!c.gc()){do a.Ze(!1),a=u(a);while(a)}}}};
h.i.Abstract=function(){this.ac=void 0;this.group=h.i.Fb();this.ic=h.i.ic};h.i.Abstract.prototype.Ma=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};h.i.Abstract.prototype.qa=function(a){this.group=a.group};h.i.Abstract.prototype.uj=function(){return!1};h.i.Abstract.prototype.run=function(){};function w(a){if(a.ac)var c=h.ob.Gq(a.ac);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};h.g.object={};h.g.object.S=function(a,c){a.w=c.prototype;a.prototype=Object.create(c.prototype);a.prototype.constructor=a};h.g.object.Ph=function(a,c){for(var d in c)a[d]=c[d]};h.g.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(c){return a[c]})};h.i.dd=function(a,c,d,e){h.i.dd.w.constructor.call(this);this.pc=a?a.id:null;this.ac=a?a.C.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.ic=!1};h.g.object.S(h.i.dd,h.i.Abstract);h.i.dd.prototype.type=h.i.Vm;h.i.dd.prototype.Ma=function(){var a=h.i.dd.w.Ma.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.pc&&(a.blockId=this.pc);return a};
h.i.dd.prototype.qa=function(a){h.i.dd.w.qa.call(this,a);this.element=a.element;this.newValue=a.newValue;this.pc=a.blockId};h.g.m={};h.g.m.nc="http://www.w3.org/2000/svg";h.g.m.Em="http://www.w3.org/1999/xhtml";h.g.m.Ge="http://www.w3.org/1999/xlink";h.g.m.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};h.g.m.kh=null;h.g.m.Qp=0;h.g.m.L=function(a,c,d){a=document.createElementNS(h.g.m.nc,a);for(var e in c)a.setAttribute(e,c[e]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);d&&d.appendChild(a);return a};
h.g.m.Bb=function(a,c){var d=a.getAttribute("class")||"";if(-1!=(" "+d+" ").indexOf(" "+c+" "))return!1;d&&(d+=" ");a.setAttribute("class",d+c);return!0};h.g.m.Lc=function(a,c){var d=a.getAttribute("class");if(-1==(" "+d+" ").indexOf(" "+c+" "))return!1;d=d.split(/\s+/);for(var e=0;e<d.length;e++)d[e]&&d[e]!=c||(d.splice(e,1),e--);d.length?a.setAttribute("class",d.join(" ")):a.removeAttribute("class");return!0};h.g.m.Qv=function(a,c){return-1!=(" "+a.getAttribute("class")+" ").indexOf(" "+c+" ")};
h.g.m.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};h.g.m.qj=function(a,c){var d=c.nextSibling;c=c.parentNode;if(!c)throw Error("Reference node has no parent.");d?c.insertBefore(a,d):c.appendChild(a)};h.g.m.containsNode=function(a,c){return!!(a.compareDocumentPosition(c)&h.g.m.Node.DOCUMENT_POSITION_CONTAINED_BY)};h.g.m.Ll=function(a,c){a.style.transform=c;a.style["-webkit-transform"]=c};h.g.m.Vl=function(){h.g.m.Qp++;h.g.m.kh||(h.g.m.kh={})};
h.g.m.Wl=function(){h.g.m.Qp--;h.g.m.Qp||(h.g.m.kh=null)};h.g.m.Mq=function(a){var c=a.textContent+"\n"+a.className.baseVal,d;if(h.g.m.kh&&(d=h.g.m.kh[c]))return d;try{d=h.g.userAgent.Uf||h.g.userAgent.Bm?a.getBBox().width:a.getComputedTextLength()}catch(e){return 8*a.textContent.length}h.g.m.kh&&(h.g.m.kh[c]=d);return d};h.Vs=function(a){this.Dk=a;this.Ja()};b=h.Vs.prototype;b.eb=null;b.je=null;b.Dk=null;b.Lg=1;b.Xl=null;b.Ja=function(){this.eb||(this.eb=h.g.m.L("svg",{xmlns:h.g.m.nc,"xmlns:html":h.g.m.Em,"xmlns:xlink":h.g.m.Ge,version:"1.1","class":"blocklyBlockDragSurface"},this.Dk),this.je=h.g.m.L("g",{},this.eb))};function ba(a,c){if(a.je.childNodes.length)throw Error("Already dragging a block.");a.je.appendChild(c);a.eb.style.display="block";a.Xl=new h.g.I(0,0)}
b.mi=function(a,c){this.Xl=new h.g.I(a*this.Lg,c*this.Lg);a=this.Xl.x;c=this.Xl.y;a=a.toFixed(0);c=c.toFixed(0);this.eb.style.display="block";h.g.m.Ll(this.eb,"translate3d("+a+"px, "+c+"px, 0px)")};b.Lq=function(){var a=h.g.Id(this.eb);return new h.g.I(a.x/this.Lg,a.y/this.Lg)};b.Fb=function(){return this.je};
b.Zm=function(a){a?a.appendChild(this.je.firstChild):this.je.removeChild(this.je.firstChild);this.eb.style.display="none";if(this.je.childNodes.length)throw Error("Drag group was not cleared.");this.Xl=null};h.g.Gm={};h.g.Gm.KC=0;h.g.Gm.LB=function(){return"blockly:"+(h.g.Gm.KC++).toString(36)};h.Ac=function(){this.Zw=h.Ac.Su;this.oj=null;this.Kd=!1;this.Sc=this.ka=null;this.Qb=[];this.Tp={}};h.Ac.Su=!1;h.Ac.Error={Do:"Component already rendered",It:"Unable to set parent component",gy:"Child component index out of bounds"};b=h.Ac.prototype;b.Pa=function(){return this.oj||(this.oj=h.g.Gm.LB())};b.Hj=function(a){if(this==a)throw Error(h.Ac.Error.It);var c;if(c=a&&this.Sc&&this.oj)c=(c=this.oj)?this.Sc.Tp[c]||null:null;if(c&&this.Sc!=a)throw Error(h.Ac.Error.It);this.Sc=a};b.getParent=function(){return this.Sc};
b.Ja=function(){this.ka=document.createElement("div")};b.ya=function(a){this.Xe(a)};b.Xe=function(a,c){if(this.Kd)throw Error(h.Ac.Error.Do);this.ka||this.Ja();a?a.insertBefore(this.ka,c||null):document.body.appendChild(this.ka);this.Sc&&!this.Sc.Kd||this.qn()};b.qn=function(){this.Kd=!0;ca(this,function(a){!a.Kd&&a.ka&&a.qn()})};b.rn=function(){ca(this,function(a){a.Kd&&a.rn()});this.Kd=!1};b.J=function(){this.gB||(this.gB=!0,this.kq())};
b.kq=function(){this.Kd&&this.rn();ca(this,function(a){a.J()});this.ka&&h.g.m.removeNode(this.ka);this.Sc=this.ka=this.Tp=this.Qb=null};
function da(a,c){var d=a.Qb.length;if(c.Kd)throw Error(h.Ac.Error.Do);if(0>d||d>a.Qb.length)throw Error(h.Ac.Error.gy);a.Tp[c.Pa()]=c;if(c.getParent()==a){var e=a.Qb.indexOf(c);-1<e&&a.Qb.splice(e,1)}c.Hj(a);a.Qb.splice(d,0,c);c.Kd&&a.Kd&&c.getParent()==a?(a=a.ka,d=a.childNodes[d]||null,d!=c.ka&&a.insertBefore(c.ka,d)):(a.ka||a.Ja(),d=a.Qb[d+1]||null,c.Xe(a.ka,d?d.ka:null))}b.ew=function(){return this.Zw};function ea(a,c){if(a.Kd)throw Error(h.Ac.Error.Do);a.Zw=c}
function ca(a,c,d){for(var e=0;e<a.Qb.length;e++)c.call(d,a.Qb[e],e)};h.Zc={};h.Zc.Yq=!1;h.Zc.register=function(a){if(h.Zc.Yq)throw Error("CSS already injected");Array.prototype.push.apply(h.Zc.Io,a);a.length=0};h.Zc.vg=function(a,c){if(!h.Zc.Yq){h.Zc.Yq=!0;var d=h.Zc.Io.join("\n");h.Zc.Io.length=0;a&&(a=c.replace(/[\\/]$/,""),d=d.replace(/<<<PATH>>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};h.Zc.ks=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")};
h.Zc.Io=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;",
"}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);",
"color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: fixed;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-radius: 2px;","padding: 4px;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {","max-height: 300px;","overflow: auto;",
"overflow-x: hidden;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".arrowTop {","border-top: 1px solid;","border-left: 1px solid;","border-top-left-radius: 4px;",
"border-color: inherit;","}",".arrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;",
"stroke-width: 1;","}",".blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<<PATH>>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;",
"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;",
"}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none","}",".blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",".blocklyReplaceable .blocklyPathLight,",".blocklyReplaceable .blocklyPathDark {","display: none;","}",".blocklyText {","cursor: default;","fill: #fff;","font-family: sans-serif;",
"font-size: 11pt;","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {","fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklySvg text, .blocklyBlockDragSurface text {",
"user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;",
"}",".blocklyCommentForeignObject {","position: relative;","z-index: 0;","}",".blocklyCommentRect {","fill: #E7DE8E;","stroke: #bcA903;","stroke-width: 1px","}",".blocklyCommentTarget {","fill: transparent;","stroke: #bcA903;","}",".blocklyCommentTargetFocused {","fill: none;","}",".blocklyCommentHandleTarget {","fill: none;","}",".blocklyCommentHandleTargetFocused {","fill: transparent;","}",".blocklyFocused>.blocklyCommentRect {","fill: #B9B272;","stroke: #B9B272;","}",".blocklySelected>.blocklyCommentTarget {",
"stroke: #fc3;","stroke-width: 3px;","}",".blocklyCommentTextarea {","background-color: #fef49c;","border: 0;","outline: 0;","margin: 0;","padding: 3px;","resize: none;","display: block;","overflow: hidden;","}",".blocklyCommentDeleteIcon {","cursor: pointer;","fill: #000;","display: none","}",".blocklySelected > .blocklyCommentDeleteIcon {","display: block","}",".blocklyDeleteIconShape {","fill: #000;","stroke: #000;","stroke-width: 1px;","}",".blocklyDeleteIconShape.blocklyDeleteIconHighlighted {",
"stroke: #fc3;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {",
"z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",
".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem {","padding-left: 28px;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl {",
"padding-left: 5px;","padding-right: 28px;","}",".blocklyVerticalCursor {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;",
"border-color: transparent;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyWidgetDiv .goog-menu.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .goog-menu {","cursor: default;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;',
"outline: none;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem,",".blocklyDropDownDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","min-width: 7em;","border: none;","padding: 6px 15px;","white-space: nowrap;","cursor: pointer;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem,",".blocklyDropDownDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyDropDownDiv .goog-menu-noicon .goog-menuitem {",
"padding-left: 12px;","}",".blocklyWidgetDiv .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-content {","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","}",".blocklyDropDownDiv .goog-menuitem-content {","color: #000;","}",".blocklyWidgetDiv .goog-menuitem-disabled,",".blocklyDropDownDiv .goog-menuitem-disabled {","cursor: inherit;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-content {",
"color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: .3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight ,",".blocklyDropDownDiv .goog-menuitem-highlight {","background-color: rgba(0,0,0,.1);","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-icon {",
"background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",
".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","float: right;","margin-right: -24px;","}"];h.g.Lb={};h.g.Lb.li=function(a){return a*Math.PI/180};h.g.Lb.wx=function(a){return 180*a/Math.PI};h.g.Lb.wk=function(a,c,d){if(d<a){var e=d;d=a;a=e}return Math.max(a,Math.min(c,d))};
h.D=function(){};h.D.td=null;h.D.Op=null;h.D.wc=null;h.D.bo=null;h.D.pm=16;h.D.Us=1;h.D.Os=12;h.D.Gt=16;h.D.Eo=.25;h.D.$s="#dadce0";h.D.at="#fff";h.D.Fp=null;h.D.Wh=null;
h.D.Ja=function(){if(!h.D.td){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=h.D.at;a.style.borderColor=h.D.$s;document.body.appendChild(a);h.D.td=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);h.D.mg=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);h.D.ce=c;h.D.td.style.opacity=0;h.D.td.style.transition="transform "+h.D.Eo+"s, opacity "+h.D.Eo+"s";a.addEventListener("focusin",
function(){h.g.m.Bb(a,"focused")});a.addEventListener("focusout",function(){h.g.m.Lc(a,"focused")})}};h.D.ex=function(a){h.D.Op=a};h.D.vv=function(){return h.D.mg};h.D.DA=function(){h.D.mg.innerHTML="";h.D.mg.style.width=""};h.D.od=function(a,c){h.D.td.style.backgroundColor=a;h.D.td.style.borderColor=c};h.D.iJ=function(a){h.D.td.setAttribute("data-category",a)};
h.D.lJ=function(a,c,d,e){var f=c.C.scale,g=c.width,k=c.height;g*=f;k*=f;f=c.aa().getBoundingClientRect();g=f.left+g/2;k=f.top+k;f=f.top;e&&(f+=e);h.D.ex(x(c.C).parentNode);return h.D.show(a,c.G,g,k,g,f,d)};h.D.nx=function(a,c){var d=a.aa().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var g=a.A;h.D.bo=!0;h.D.ex(x(g.C).parentNode);h.D.show(a,g.G,e,f,e,d,c)};
h.D.show=function(a,c,d,e,f,g,k){h.D.wc=a;h.D.Wh=k||null;a=h.D.Cv(d,e,f,g);a.Hp?(h.D.ce.style.display="",h.D.ce.style.transform="translate("+a.qk+"px,"+a.qu+"px) rotate(45deg)",h.D.ce.setAttribute("class",a.Gp?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):h.D.ce.style.display="none";h.D.td.style.direction=c?"rtl":"ltr";h.D.Dl(a.Fn,a.Gn,a.tn,a.un);return a.Gp};
h.D.AB=function(){var a=h.D.Op.getBoundingClientRect(),c=h.g.style.Bf(h.D.Op);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};h.D.Cv=function(a,c,d,e){var f=h.D.AB(),g=h.g.style.Bf(h.D.td);return c+g.height<f.bottom?h.D.Bv(a,c,f,g):e-g.height>f.top?h.D.Av(d,e,f,g):c+g.height<document.documentElement.clientHeight?h.D.Bv(a,c,f,g):e-g.height>document.documentElement.clientTop?h.D.Av(d,e,f,g):h.D.MB(a,f,g)};
h.D.Bv=function(a,c,d,e){a=h.D.Jq(a,d.left,d.right,e.width);return{Fn:a.bj,Gn:c,tn:a.bj,un:c+h.D.Gt,qk:a.qk,qu:-(h.D.pm/2+h.D.Us),Gp:!0,Hp:!0}};h.D.Av=function(a,c,d,e){a=h.D.Jq(a,d.left,d.right,e.width);return{Fn:a.bj,Gn:c-e.height,tn:a.bj,un:c-e.height-h.D.Gt,qk:a.qk,qu:e.height-2*h.D.Us-h.D.pm/2,Gp:!1,Hp:!0}};h.D.MB=function(a,c,d){a=h.D.Jq(a,c.left,c.right,d.width);return{Fn:a.bj,Gn:0,tn:a.bj,un:0,Hp:!1}};
h.D.Jq=function(a,c,d,e){var f=a;a=h.g.Lb.wk(c,a-e/2,d-e);f-=h.D.pm/2;c=h.g.Lb.wk(h.D.Os,f-a,e-h.D.Os-h.D.pm);return{qk:c,bj:a}};h.D.isVisible=function(){return!!h.D.wc};h.D.kj=function(a,c){h.D.wc===a&&(c?h.D.lj():h.D.ta())};h.D.ta=function(){var a=h.D.td;a.style.transform="translate(0, 0)";a.style.opacity=0;h.D.Fp=setTimeout(function(){h.D.lj()},1E3*h.D.Eo);h.D.Wh&&(h.D.Wh(),h.D.Wh=null)};
h.D.lj=function(){if(h.D.isVisible()){h.D.Fp&&clearTimeout(h.D.Fp);var a=h.D.td;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=h.D.at;a.style.borderColor=h.D.$s;h.D.Wh&&(h.D.Wh(),h.D.Wh=null);h.D.DA();h.D.wc=null}};
h.D.Dl=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=h.D.td;f.style.left=a+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-a)+"px,"+(e-c)+"px)"};
h.D.cJ=function(){if(h.D.wc){var a=h.D.wc.A,c=a.C.scale,d=h.D.bo?h.D.wc.Gb.width:a.width,e=h.D.bo?h.D.wc.Gb.height:a.height;d*=c;e*=c;a=h.D.bo?h.D.wc.le.getBoundingClientRect():a.aa().getBoundingClientRect();d=a.left+d/2;e=h.D.Cv(d,a.top+e,d,a.top);h.D.Dl(e.Fn,e.Gn,e.tn,e.un)}else h.D.ta()};
h.Yg=function(a,c){this.jj=a;this.ss=c.spacing;this.kw=c.length;this.qC=(this.mr=a.firstChild)&&this.mr.nextSibling;this.BD=c.snap};h.Yg.prototype.Lg=1;h.Yg.prototype.J=function(){this.jj=null};h.Yg.prototype.update=function(a){this.Lg=a;var c=this.ss*a||100;this.jj.setAttribute("width",c);this.jj.setAttribute("height",c);c=Math.floor(this.ss/2)+.5;var d=c-this.kw/2,e=c+this.kw/2;c*=a;d*=a;e*=a;fa(this.mr,a,d,e,c,c);fa(this.qC,a,c,c,d,e)};
function fa(a,c,d,e,f,g){a&&(a.setAttribute("stroke-width",c),a.setAttribute("x1",d),a.setAttribute("y1",f),a.setAttribute("x2",e),a.setAttribute("y2",g))}h.Yg.prototype.moveTo=function(a,c){this.jj.setAttribute("x",a);this.jj.setAttribute("y",c);(h.g.userAgent.Uf||h.g.userAgent.Bm)&&this.update(this.Lg)};
h.Yg.Ja=function(a,c,d){a=h.g.m.L("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},d);0<c.length&&0<c.spacing?(h.g.m.L("line",{stroke:c.colour},a),1<c.length&&h.g.m.L("line",{stroke:c.colour},a)):h.g.m.L("line",{},a);return a};h.g.xml={};h.g.xml.sz="https://developers.google.com/blockly/xml";h.g.xml.document=function(){return document};h.g.xml.createElement=function(a){return h.g.xml.document().createElementNS(h.g.xml.sz,a)};h.g.xml.createTextNode=function(a){return h.g.xml.document().createTextNode(a)};h.g.xml.KD=function(a){return(new DOMParser).parseFromString(a,"text/xml")};h.g.xml.Fc=function(a){return(new XMLSerializer).serializeToString(a)};h.i.ye=function(a){h.i.ye.w.constructor.call(this);this.pc=a.id;this.ac=a.C.id};h.g.object.S(h.i.ye,h.i.Abstract);h.i.ye.prototype.Ma=function(){var a=h.i.ye.w.Ma.call(this);a.blockId=this.pc;return a};h.i.ye.prototype.qa=function(a){h.i.ye.w.qa.call(this,a);this.pc=a.blockId};h.i.Sf=function(a,c,d,e,f){a&&(h.i.Sf.w.constructor.call(this,a),this.element=c,this.name=d,this.oldValue=e,this.newValue=f)};h.g.object.S(h.i.Sf,h.i.ye);h.i.Rf=h.i.Sf;b=h.i.Sf.prototype;b.type=h.i.yi;
b.Ma=function(){var a=h.i.Sf.w.Ma.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};b.qa=function(a){h.i.Sf.w.qa.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};b.uj=function(){return this.oldValue==this.newValue};
b.run=function(a){var c=v(w(this),this.pc);if(c)switch(c.se&&c.se.yb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=ha(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.Gj(a||null);break;case "collapsed":c.Mg(!!a);break;case "disabled":c.Ze(!a);break;case "inline":c.Ng(!!a);break;case "mutation":var d="";c.hc&&(d=(d=c.hc())&&h.N.Fc(d));if(c.Gd){var e=h.N.Qg(a||"<mutation/>");c.Gd(e)}h.i.Ha(new h.i.Sf(c,"mutation",null,d,
a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.pc)};h.i.Pd=function(a){a&&(h.i.Pd.w.constructor.call(this,a),this.xml=a.C.ea?h.N.Mp(a):h.N.gg(a),this.Eh=h.i.wv(a))};h.g.object.S(h.i.Pd,h.i.ye);h.i.tm=h.i.Pd;h.i.Pd.prototype.type=h.i.xm;h.i.Pd.prototype.Ma=function(){var a=h.i.Pd.w.Ma.call(this);a.xml=h.N.Fc(this.xml);a.ids=this.Eh;return a};
h.i.Pd.prototype.qa=function(a){h.i.Pd.w.qa.call(this,a);this.xml=h.N.Qg(a.xml);this.Eh=a.ids};h.i.Pd.prototype.run=function(a){var c=w(this);if(a)a=h.g.xml.createElement("xml"),a.appendChild(this.xml),h.N.wh(a,c);else{a=0;for(var d;d=this.Eh[a];a++){var e=v(c,d);e?e.J(!1):d==this.pc&&console.warn("Can't uncreate non-existent block: "+d)}}};
h.i.ze=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");h.i.ze.w.constructor.call(this,a);this.Ir=a.C.ea?h.N.Mp(a):h.N.gg(a);this.Eh=h.i.wv(a)}};h.g.object.S(h.i.ze,h.i.ye);h.i.by=h.i.ze;h.i.ze.prototype.type=h.i.Wj;h.i.ze.prototype.Ma=function(){var a=h.i.ze.w.Ma.call(this);a.ids=this.Eh;return a};h.i.ze.prototype.qa=function(a){h.i.ze.w.qa.call(this,a);this.Eh=a.ids};
h.i.ze.prototype.run=function(a){var c=w(this);if(a){a=0;for(var d;d=this.Eh[a];a++){var e=v(c,d);e?e.J(!1):d==this.pc&&console.warn("Can't delete non-existent block: "+d)}}else a=h.g.xml.createElement("xml"),a.appendChild(this.Ir),h.N.wh(a,c)};h.i.ah=function(a){a&&(h.i.ah.w.constructor.call(this,a),a=ia(this),this.Bw=a.Jw,this.Aw=a.Zv,this.Fr=a.Ou)};h.g.object.S(h.i.ah,h.i.ye);h.i.Tj=h.i.ah;b=h.i.ah.prototype;b.type=h.i.ck;
b.Ma=function(){var a=h.i.ah.w.Ma.call(this);this.Sh&&(a.newParentId=this.Sh);this.Rh&&(a.newInputName=this.Rh);this.Dg&&(a.newCoordinate=Math.round(this.Dg.x)+","+Math.round(this.Dg.y));return a};b.qa=function(a){h.i.ah.w.qa.call(this,a);this.Sh=a.newParentId;this.Rh=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.Dg=new h.g.I(Number(a[0]),Number(a[1])))};b.Yh=function(){var a=ia(this);this.Sh=a.Jw;this.Rh=a.Zv;this.Dg=a.Ou};
function ia(a){var c=v(w(a),a.pc);a={};var d=c.getParent();if(d){a.Jw=d.id;a:{for(var e=0,f;f=d.P[e];e++)if(f.connection&&z(f.connection)==c){c=f;break a}c=null}c&&(a.Zv=c.name)}else a.Ou=c.Ia();return a}b.uj=function(){return this.Bw==this.Sh&&this.Aw==this.Rh&&h.g.I.Ne(this.Fr,this.Dg)};
b.run=function(a){var c=w(this),d=v(c,this.pc);if(d){var e=a?this.Sh:this.Bw,f=a?this.Rh:this.Aw;a=a?this.Dg:this.Fr;var g=null;if(e&&(g=v(c,e),!g)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&A(d);if(a)f=d.Ia(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.M||d.U;if(f){if(c=B(g,f))var k=c.connection}else d.type==h.Xd&&(k=g.V);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.pc)};h.i.Yj=function(a){this.ac=a.id;this.group=h.i.Fb();this.ic=!1};h.g.object.S(h.i.Yj,h.i.Abstract);h.i.Yj.prototype.type=h.i.Fy;h.i.Yj.prototype.Ma=function(){var a={type:this.type};this.group&&(a.group=this.group);this.ac&&(a.workspaceId=this.ac);return a};h.i.Yj.prototype.qa=function(a){this.ac=a.workspaceId;this.group=a.group};h.i.tf=function(a){h.i.tf.w.constructor.call(this);this.Rg=a.Pa();this.ac=a.C.id};h.g.object.S(h.i.tf,h.i.Abstract);h.i.tf.prototype.Ma=function(){var a=h.i.tf.w.Ma.call(this);a.varId=this.Rg;return a};h.i.tf.prototype.qa=function(a){h.i.tf.w.Ma.call(this);this.Rg=a.varId};h.i.Ad=function(a){a&&(h.i.Ad.w.constructor.call(this,a),this.ri=a.type,this.pi=a.name)};h.g.object.S(h.i.Ad,h.i.tf);h.i.Ad.prototype.type=h.i.cu;
h.i.Ad.prototype.Ma=function(){var a=h.i.Ad.w.Ma.call(this);a.varType=this.ri;a.varName=this.pi;return a};h.i.Ad.prototype.qa=function(a){h.i.Ad.w.qa.call(this,a);this.ri=a.varType;this.pi=a.varName};h.i.Ad.prototype.run=function(a){var c=w(this);a?c.ie(this.pi,this.ri,this.Rg):c.sh(this.Rg)};h.i.Zd=function(a){a&&(h.i.Zd.w.constructor.call(this,a),this.ri=a.type,this.pi=a.name)};h.g.object.S(h.i.Zd,h.i.tf);h.i.Zd.prototype.type=h.i.du;
h.i.Zd.prototype.Ma=function(){var a=h.i.Zd.w.Ma.call(this);a.varType=this.ri;a.varName=this.pi;return a};h.i.Zd.prototype.qa=function(a){h.i.Zd.w.qa.call(this,a);this.ri=a.varType;this.pi=a.varName};h.i.Zd.prototype.run=function(a){var c=w(this);a?c.sh(this.Rg):c.ie(this.pi,this.ri,this.Rg)};h.i.Fe=function(a,c){a&&(h.i.Fe.w.constructor.call(this,a),this.Hr=a.name,this.Cr=c)};h.g.object.S(h.i.Fe,h.i.tf);h.i.Fe.prototype.type=h.i.fu;
h.i.Fe.prototype.Ma=function(){var a=h.i.Fe.w.Ma.call(this);a.oldName=this.Hr;a.newName=this.Cr;return a};h.i.Fe.prototype.qa=function(a){h.i.Fe.w.qa.call(this,a);this.Hr=a.oldName;this.Cr=a.newName};h.i.Fe.prototype.run=function(a){var c=w(this);a?c.$h(this.Rg,this.Cr):c.$h(this.Rg,this.Hr)};h.N={};h.N.Es=function(a){var c=C,d=h.g.xml.createElement("xml"),e=h.N.WD(h.Z.pu(c));e.hasChildNodes()&&d.appendChild(e);var f=ja(c,!0);e=0;for(var g;g=f[e];e++)d.appendChild(g.xs(a));c=D(c,!0);for(e=0;f=c[e];e++)d.appendChild(h.N.Mp(f,a));return d};h.N.WD=function(a){for(var c=h.g.xml.createElement("variables"),d=0,e;e=a[d];d++){var f=h.g.xml.createElement("variable");f.appendChild(h.g.xml.createTextNode(e.name));e.type&&f.setAttribute("type",e.type);f.id=e.Pa();c.appendChild(f)}return c};
h.N.Mp=function(a,c){var d;a.C.G&&(d=a.C.Df());c=h.N.gg(a,c);var e=a.Ia();c.setAttribute("x",Math.round(a.C.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};h.N.pB=function(a){var c=!1;a.name&&(a.Mi?c=!0:a.kf&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),c=!0));return c?(c=h.g.xml.createElement("field"),c.setAttribute("name",a.name),a.xx(c)):null};
h.N.hA=function(a,c){for(var d=0,e;e=a.P[d];d++)for(var f=0,g;g=e.La[f];f++)(g=h.N.pB(g))&&c.appendChild(g)};
h.N.gg=function(a,c){var d=h.g.xml.createElement(a.Qa?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.hc){var e=a.hc();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}h.N.hA(a,d);if(e=a.fe.text){var f=a.fe.size,g=a.fe.Lw,k=h.g.xml.createElement("comment");k.appendChild(h.g.xml.createTextNode(e));k.setAttribute("pinned",g);k.setAttribute("h",f.height);k.setAttribute("w",f.width);d.appendChild(k)}a.data&&(e=h.g.xml.createElement("data"),e.appendChild(h.g.xml.createTextNode(a.data)),
d.appendChild(e));for(f=0;g=a.P[f];f++){var l;k=!0;if(g.type!=h.Qd){var m=z(g.connection);g.type==h.Sa?l=h.g.xml.createElement("value"):g.type==h.Ga&&(l=h.g.xml.createElement("statement"));e=g.connection.af;!e||m&&m.Qa||l.appendChild(h.N.Bu(e,c));m&&(l.appendChild(h.N.gg(m,c)),k=!1);l.setAttribute("name",g.name);k||d.appendChild(l)}}void 0!=a.If&&a.If!=a.hC&&d.setAttribute("inline",a.If);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.md()||a.Qa||d.setAttribute("deletable",
!1);a.Rc()||a.Qa||d.setAttribute("movable",!1);a.Jc()||d.setAttribute("editable",!1);if(f=u(a))l=h.g.xml.createElement("next"),l.appendChild(h.N.gg(f,c)),d.appendChild(l);e=a.V&&a.V.af;!e||f&&f.Qa||l.appendChild(h.N.Bu(e,c));return d};
h.N.Bu=function(a,c){for(var d=a=a.cloneNode(!0),e;d;)if(c&&"shadow"==d.nodeName&&d.removeAttribute("id"),d.firstChild)d=d.firstChild;else{for(;d&&!d.nextSibling;)e=d,d=d.parentNode,e.nodeType==h.g.m.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&h.g.m.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==h.g.m.Node.TEXT_NODE&&""==e.data.trim()&&h.g.m.removeNode(e))}return a};
h.N.Fc=function(a){a=h.g.xml.Fc(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1&#10;$2")}while(a!=d);return a};h.N.zI=function(a){a=h.N.Fc(a).split("<");for(var c="",d=1;d<a.length;d++){var e=a[d];"/"==e[0]&&(c=c.substring(2));a[d]=c+"<"+e;"/"!=e[0]&&"/>"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1</$2>");return a.replace(/^\n/,"")};
h.N.Qg=function(a){var c=h.g.xml.KD(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};h.N.vI=function(a,c){c.Yb(!1);c.clear();a=h.N.wh(a,c);c.Yb(!0);return a};
h.N.wh=function(a,c){if(a instanceof h.ob){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.G&&(e=c.Df());d=[];h.g.m.Vl();var f=a.childNodes.length,g=h.i.Fb();g||h.i.X(!0);c.Yb&&c.Yb(!1);var k=!0;try{for(var l=0;l<f;l++){var m=a.childNodes[l],n=m.nodeName.toLowerCase();if("block"==n||"shadow"==n&&!h.i.ic){var r=h.N.dj(m,c);d.push(r.id);var q=m.hasAttribute("x")?parseInt(m.getAttribute("x"),10):10,t=m.hasAttribute("y")?parseInt(m.getAttribute("y"),
10):10;isNaN(q)||isNaN(t)||r.moveBy(c.G?e-q:q,t);k=!1}else{if("shadow"==n)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==n)c.ea?h.Si?h.Si.Sk(m):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):h.Xz?h.Xz.Sk(m):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==n){if(k)h.N.jB(m,c);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");
k=!1}}}}finally{g||h.i.X(!1),h.g.m.Wl()}c.Yb&&c.Yb(!0);h.i.Ha(new h.i.Yj(c));return d};h.N.pI=function(a,c){if(c.hasOwnProperty("scale")){var d=h.ra.eg;try{h.ra.eg=0;var e=ka(c)}finally{h.ra.eg=d}}a=h.N.wh(a,c);if(e&&e.top!=e.bottom){d=e.bottom;var f=e.left;var g=Infinity,k=Infinity;for(e=0;e<a.length;e++){var l=v(c,a[e]).Ia();l.y<k&&(k=l.y);l.x<g&&(g=l.x)}d=d-k+h.ra.Ez;f-=g;var m;c.G&&(m=c.Df());for(e=0;e<a.length;e++)v(c,a[e]).moveBy(c.G?m-f:f,d)}return a};
h.N.dj=function(a,c){if(a instanceof h.ob){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}h.i.disable();d=c.pg();try{var e=h.N.mq(a,c),f=p(e,!1);if(c.ea){ma(e,!0);for(var g=f.length-1;0<=g;g--)f[g].Re();for(g=f.length-1;0<=g;g--)f[g].ya(!1);setTimeout(function(){e.C&&ma(e,!1)},1);na(e);oa(c)}else for(g=f.length-1;0<=g;g--)f[g].Fh()}finally{h.i.enable()}if(h.i.isEnabled()){a=h.Z.tv(c,d);for(g=0;g<a.length;g++)h.i.Ha(new h.i.Ad(a[g]));h.i.Ha(new h.i.tm(e))}return e};
h.N.jB=function(a,c){for(var d=0,e;e=a.childNodes[d];d++)if(e.nodeType==h.g.m.Node.ELEMENT_NODE){var f=e.getAttribute("type"),g=e.getAttribute("id");c.ie(e.textContent,f,g)}};
h.N.mq=function(a,c){var d=null,e=a.getAttribute("type");if(!e)throw TypeError("Block type unspecified: "+a.outerHTML);var f=a.getAttribute("id");d=c.yj(e,f);var g=null;f=0;for(var k;k=a.childNodes[f];f++)if(k.nodeType!=h.g.m.Node.TEXT_NODE){for(var l=g=null,m=0,n;n=k.childNodes[m];m++)n.nodeType==h.g.m.Node.ELEMENT_NODE&&("block"==n.nodeName.toLowerCase()?g=n:"shadow"==n.nodeName.toLowerCase()&&(l=n));!g&&l&&(g=l);m=k.getAttribute("name");switch(k.nodeName.toLowerCase()){case "mutation":d.Gd&&(d.Gd(k),
d.Re&&d.Re());break;case "comment":if(!h.Comment){console.warn("Missing require for Blockly.Comment, ignoring block comment.");break}g=k.textContent;l="true"==k.getAttribute("pinned");m=parseInt(k.getAttribute("w"),10);k=parseInt(k.getAttribute("h"),10);d.Gj(g);d.fe.Lw=l;isNaN(m)||isNaN(k)||(d.fe.size=new h.g.Yd(m,k));l&&d.DB&&!d.Qc&&setTimeout(function(){d.He.yb(!0)},1);break;case "data":d.data=k.textContent;break;case "title":case "field":h.N.iB(d,m,k);break;case "value":case "statement":k=B(d,
m);if(!k){console.warn("Ignoring non-existent input "+m+" in block "+e);break}l&&(k.connection.af=l);if(g)if(g=h.N.mq(g,c),g.M)k.connection.connect(g.M);else if(g.U)k.connection.connect(g.U);else throw TypeError("Child block does not have output or previous statement.");break;case "next":l&&d.V&&(d.V.af=l);if(g){if(!d.V)throw TypeError("Next statement does not exist.");if(d.V.isConnected())throw TypeError("Next statement is already connected.");g=h.N.mq(g,c);if(!g.U)throw TypeError("Next block does not have previous statement.");
d.V.connect(g.U)}break;default:console.warn("Ignoring unknown tag: "+k.nodeName)}}(f=a.getAttribute("inline"))&&d.Ng("true"==f);(f=a.getAttribute("disabled"))&&d.Ze("true"!=f&&"disabled"!=f);if(f=a.getAttribute("deletable"))d.Mk="true"==f;(f=a.getAttribute("movable"))&&d.io("true"==f);(f=a.getAttribute("editable"))&&d.ls("true"==f);(f=a.getAttribute("collapsed"))&&d.Mg("true"==f);if("shadow"==a.nodeName.toLowerCase()){a=pa(d,!1);for(f=0;c=a[f];f++)if(!c.Qa)throw TypeError("Shadow block not allowed non-shadow child.");
if(qa(d).length)throw TypeError("Shadow blocks cannot have variable references.");d.os(!0)}return d};h.N.iB=function(a,c,d){var e=ha(a,c);e?e.Sk(d):console.warn("Ignoring non-existent field "+c+" in block "+a.type)};h.N.ZA=function(a){for(var c=0,d;d=a.childNodes[c];c++)if("next"==d.nodeName.toLowerCase()){a.removeChild(d);break}};h.yd=function(a){var c=!!a.readOnly;if(c)var d=null,e=!1,f=!1,g=!1,k=!1,l=!1,m=!1;else{d=h.yd.dD(a.toolbox||null);e=!(!d||!d.getElementsByTagName("category").length);f=a.trashcan;void 0===f&&(f=e);var n=a.maxTrashcanContents;f?void 0===n&&(n=32):n=0;g=a.collapse;void 0===g&&(g=e);k=a.comments;void 0===k&&(k=e);l=a.disable;void 0===l&&(l=e);m=a.sounds;void 0===m&&(m=!0)}var r=!!a.rtl,q=a.horizontalLayout;void 0===q&&(q=!1);var t=a.toolboxPosition;t="end"===t?!1:!0;t=q?t?h.fh:h.ik:t==r?h.fg:h.zd;var y=
a.css;void 0===y&&(y=!0);var O="https://blockly-demo.appspot.com/static/media/";a.media?O=a.media:a.path&&(O=a.path+"media/");var V=void 0===a.oneBasedIndex?!0:!!a.oneBasedIndex,la=a.theme,Bd=a.keyMap||h.ab.Wa.QA(),Cd=a.renderer||"geras";this.G=r;this.zj=V;this.collapse=g;this.IA=k;this.disable=l;this.readOnly=c;this.ul=a.maxBlocks||Infinity;this.xr=a.maxInstances;this.Bj=O;this.Pv=e;this.Ub=h.yd.cD(a,e);this.Tv=f;this.Tn=n;this.ZB=m;this.XB=y;this.Hf=q;this.ll=d;this.Lv=h.yd.bD(a);this.mb=h.yd.eD(a);
this.Ya=t;this.MD=la;this.Wa=Bd;this.ai=Cd};h.yd.prototype.Vb=null;h.yd.prototype.Og=null;h.yd.prototype.uc=null;h.yd.cD=function(a,c){var d=a.move||{},e={};e.scrollbars=void 0===d.scrollbars&&void 0===a.scrollbars?c:!!d.scrollbars||!!a.scrollbars;e.si=e.scrollbars&&void 0!==d.wheel?!!d.wheel:!1;e.og=e.scrollbars?void 0===d.drag?!0:!!d.drag:!1;return e};
h.yd.eD=function(a){a=a.zoom||{};var c={};c.controls=void 0===a.controls?!1:!!a.controls;c.si=void 0===a.wheel?!1:!!a.wheel;c.GD=void 0===a.startScale?1:Number(a.startScale);c.vl=void 0===a.maxScale?3:Number(a.maxScale);c.xl=void 0===a.minScale?.3:Number(a.minScale);c.sD=void 0===a.scaleSpeed?1.2:Number(a.scaleSpeed);return c};h.yd.bD=function(a){a=a.grid||{};var c={};c.spacing=Number(a.spacing)||0;c.Db=a.colour||"#888";c.length=Number(a.length)||1;c.mJ=0<c.spacing&&!!a.snap;return c};
h.yd.dD=function(a){if(a){if("string"!=typeof a&&(h.g.userAgent.Uf&&a.outerHTML?a=a.outerHTML:a instanceof Element||(a=null)),"string"==typeof a&&(a=h.N.Qg(a),"xml"!=a.nodeName.toLowerCase()))throw TypeError("Toolbox should be an <xml> document.");}else a=null;return a};h.Touch={};h.Touch.$t="ontouchstart"in h.g.global||!!(h.g.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!h.g.global.navigator||!h.g.global.navigator.maxTouchPoints&&!h.g.global.navigator.msMaxTouchPoints);h.Touch.cm=null;h.Touch.Ee={};
h.g.global.PointerEvent?h.Touch.Ee={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:h.Touch.$t&&(h.Touch.Ee={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});h.Rn=0;
h.uC=function(a,c){h.Cg();a.changedTouches&&1!=a.changedTouches.length||(h.Rn=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&ra(c,a)},h.iz))};h.Cg=function(){h.Rn&&(clearTimeout(h.Rn),h.Rn=0)};h.Touch.$m=function(){h.Touch.cm=null};h.Touch.rs=function(a){return!h.Touch.lC(a)||h.Touch.BA(a)};
h.Touch.An=function(a){return void 0!=a.pointerId?a.pointerId:a.changedTouches&&a.changedTouches[0]&&void 0!==a.changedTouches[0].identifier&&null!==a.changedTouches[0].identifier?a.changedTouches[0].identifier:"mouse"};h.Touch.BA=function(a){var c=h.Touch.An(a);return void 0!==h.Touch.cm&&null!==h.Touch.cm?h.Touch.cm==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(h.Touch.cm=c,!0):!1};
h.Touch.vD=function(a){if(h.g.Oa.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};h.Touch.lC=function(a){return h.g.Oa.startsWith(a.type,"touch")||h.g.Oa.startsWith(a.type,"mouse")||h.g.Oa.startsWith(a.type,"pointer")};h.Touch.Qn=function(a){return h.g.Oa.startsWith(a.type,"touch")||h.g.Oa.startsWith(a.type,"pointer")};
h.Touch.CD=function(a){var c=[];if(a.changedTouches)for(var d=0;d<a.changedTouches.length;d++)c[d]={type:a.type,changedTouches:[a.changedTouches[d]],target:a.target,stopPropagation:function(){a.stopPropagation()},preventDefault:function(){a.preventDefault()}};else c.push(a);return c};
h.Pi=function(a){this.s=a;this.ld=new h.Ca(a,!0,!0,"blocklyMainWorkspaceScrollbar");this.sd=new h.Ca(a,!1,!0,"blocklyMainWorkspaceScrollbar");this.Ek=h.g.m.L("rect",{height:h.Ca.jc,width:h.Ca.jc,"class":"blocklyScrollbarBackground"},null);h.g.m.qj(this.Ek,a.Pf)};h.Pi.prototype.kb=null;h.Pi.prototype.J=function(){h.g.m.removeNode(this.Ek);this.kb=this.s=this.Ek=null;this.ld.J();this.ld=null;this.sd.J();this.sd=null};
h.Pi.prototype.resize=function(){var a=this.s.uc();if(a){var c=!1,d=!1;this.kb&&this.kb.lb==a.lb&&this.kb.vb==a.vb&&this.kb.oc==a.oc&&this.kb.dc==a.dc?(this.kb&&this.kb.Je==a.Je&&this.kb.zb==a.zb&&this.kb.Dc==a.Dc||(c=!0),this.kb&&this.kb.hd==a.hd&&this.kb.Ib==a.Ib&&this.kb.rc==a.rc||(d=!0)):d=c=!0;c&&this.ld.resize(a);d&&this.sd.resize(a);this.kb&&this.kb.lb==a.lb&&this.kb.dc==a.dc||this.Ek.setAttribute("x",this.sd.Ve.x);this.kb&&this.kb.vb==a.vb&&this.kb.oc==a.oc||this.Ek.setAttribute("y",this.ld.Ve.y);
this.kb=a}};h.Pi.prototype.set=function(a,c){var d={};a*=this.ld.Wb;c*=this.sd.Wb;var e=this.sd.Nd,f=a/this.ld.Nd;d.x=isNaN(f)?0:f;e=c/e;d.y=isNaN(e)?0:e;this.s.Og(d);sa(this.ld,a);sa(this.sd,c)};
h.Ca=function(a,c,d,e){this.s=a;this.Aj=d||!1;this.Dh=c;this.kb=null;this.Fk(e);this.Ve=new h.g.I(0,0);a=h.Ca.jc;c?(this.Zb.setAttribute("height",a),this.Te.setAttribute("height",a),this.Tc.setAttribute("height",a-5),this.Tc.setAttribute("y",2.5),this.ml="width",this.Mw="x"):(this.Zb.setAttribute("width",a),this.Te.setAttribute("width",a),this.Tc.setAttribute("width",a-5),this.Tc.setAttribute("x",2.5),this.ml="height",this.Mw="y");this.Gw=h.pa(this.Zb,"mousedown",this,this.UC);this.Hw=h.pa(this.Tc,
"mousedown",this,this.VC)};b=h.Ca.prototype;b.Mr=new h.g.I(0,0);b.sx=0;b.Nd=0;b.sg=0;b.Xk=0;b.Ag=!0;b.mh=!0;h.Ca.jc=15;h.Touch.$t&&(h.Ca.jc=25);h.Ca.wC=function(a,c){return a&&c&&a.lb==c.lb&&a.vb==c.vb&&a.zb==c.zb&&a.Ib==c.Ib&&a.oc==c.oc&&a.dc==c.dc&&a.Je==c.Je&&a.hd==c.hd&&a.Dc==c.Dc&&a.rc==c.rc?!0:!1};
h.Ca.prototype.J=function(){ta();h.Za(this.Gw);this.Gw=null;h.Za(this.Hw);this.Hw=null;h.g.m.removeNode(this.Te);this.Zb=this.K=this.Te=null;this.Tc&&(this.s.$b.unsubscribe(this.Tc),this.Tc=null);this.s=null};function sa(a,c){a.Xk=c;a.Tc.setAttribute(a.Mw,a.Xk)}function ua(a,c){a.Nd=c;a.Te.setAttribute(a.ml,a.Nd);a.Zb.setAttribute(a.ml,a.Nd)}h.Pi.prototype.bi=function(a){this.ld.bi(a);this.sd.bi(a)};
function va(a,c,d){a.Ve.x=c;a.Ve.y=d;h.g.m.Ll(a.Te,"translate("+(a.Ve.x+a.Mr.x)+"px,"+(a.Ve.y+a.Mr.y)+"px)")}b=h.Ca.prototype;b.resize=function(a){if(!a&&(a=this.s.uc(),!a))return;h.Ca.wC(a,this.kb)||(this.kb=a,this.Dh?wa(this,a):xa(this,a),ya(this))};function wa(a,c){var d=c.lb-1;a.Aj&&(d-=h.Ca.jc);ua(a,Math.max(0,d));d=c.dc+.5;a.Aj&&a.s.G&&(d+=h.Ca.jc);va(a,d,c.oc+c.vb-h.Ca.jc-.5);za(a,c)}
function za(a,c){a.Aj||a.yb(a.Nd<c.Je);a.Wb=a.Nd/c.Je;if(-Infinity==a.Wb||Infinity==a.Wb||isNaN(a.Wb))a.Wb=0;a.sg=Math.max(0,c.lb*a.Wb);a.Tc.setAttribute(a.ml,a.sg);sa(a,Aa(a,(c.zb-c.Dc)*a.Wb))}function xa(a,c){var d=c.vb-1;a.Aj&&(d-=h.Ca.jc);ua(a,Math.max(0,d));d=c.dc+.5;a.s.G||(d+=c.lb-h.Ca.jc-1);va(a,d,c.oc+.5);Ba(a,c)}
function Ba(a,c){a.Aj||a.yb(a.Nd<c.hd);a.Wb=a.Nd/c.hd;if(-Infinity==a.Wb||Infinity==a.Wb||isNaN(a.Wb))a.Wb=0;a.sg=Math.max(0,c.vb*a.Wb);a.Tc.setAttribute(a.ml,a.sg);sa(a,Aa(a,(c.Ib-c.rc)*a.Wb))}
b.Fk=function(a){var c="blocklyScrollbar"+(this.Dh?"Horizontal":"Vertical");a&&(c+=" "+a);this.Te=h.g.m.L("svg",{"class":c},null);this.K=h.g.m.L("g",{},this.Te);this.Zb=h.g.m.L("rect",{"class":"blocklyScrollbarBackground"},this.K);a=Math.floor((h.Ca.jc-5)/2);this.Tc=h.g.m.L("rect",{"class":"blocklyScrollbarHandle",rx:a,ry:a},this.K);this.s.$b.subscribe(this.Tc,"scrollbar","fill");this.s.$b.subscribe(this.Tc,"scrollbarOpacity","fill-opacity");h.g.m.qj(this.Te,x(this.s))};b.isVisible=function(){return this.Ag};
b.bi=function(a){var c=a!=this.mh;this.mh=a;c&&this.gm()};b.yb=function(a){var c=a!=this.isVisible();if(this.Aj)throw Error("Unable to toggle visibility of paired scrollbars.");this.Ag=a;c&&this.gm()};b.gm=function(){this.mh&&this.isVisible()?this.Te.setAttribute("display","block"):this.Te.setAttribute("display","none")};
b.UC=function(a){Ca(this.s);h.Touch.$m();ta();if(h.g.wj(a))a.stopPropagation();else{var c=h.g.zl(a,x(this.s),Da(this.s));c=this.Dh?c.x:c.y;var d=h.g.Tk(this.Tc);d=this.Dh?d.x:d.y;var e=this.Xk,f=.95*this.sg;c<=d?e-=f:c>=d+this.sg&&(e+=f);sa(this,Aa(this,e));ya(this);a.stopPropagation();a.preventDefault()}};
b.VC=function(a){Ca(this.s);ta();h.g.wj(a)?a.stopPropagation():(this.ED=this.Xk,Ea(this.s),this.sx=this.Dh?a.clientX:a.clientY,h.Ca.Gg=h.pa(document,"mouseup",this,this.$C),h.Ca.Fg=h.pa(document,"mousemove",this,this.WC),a.stopPropagation(),a.preventDefault())};b.WC=function(a){sa(this,Aa(this,this.ED+((this.Dh?a.clientX:a.clientY)-this.sx)));ya(this)};b.$C=function(){Fa(this.s);h.Touch.$m();ta()};function ta(){h.vc(!0);h.Ca.Gg&&(h.Za(h.Ca.Gg),h.Ca.Gg=null);h.Ca.Fg&&(h.Za(h.Ca.Fg),h.Ca.Fg=null)}
function Aa(a,c){return c=0>=c||isNaN(c)||a.Nd<a.sg?0:Math.min(c,a.Nd-a.sg)}function ya(a){var c=a.Xk/a.Nd;isNaN(c)&&(c=0);var d={};a.Dh?d.x=c:d.y=c;a.s.Og(d)}b.set=function(a){sa(this,Aa(this,a*this.Wb));ya(this)};h.H={};h.H.visible=!1;h.H.Wi=!1;h.H.cz=50;h.H.vw=0;h.H.Tl=0;h.H.jr=0;h.H.kr=0;h.H.ka=null;h.H.ao=null;h.H.Bt=0;h.H.Ct=10;h.H.zz=10;h.H.Oy=750;h.H.Xo=5;h.H.va=null;h.H.Ja=function(){h.H.va||(h.H.va=document.createElement("div"),h.H.va.className="blocklyTooltipDiv",document.body.appendChild(h.H.va))};h.H.Vi=function(a){h.ed(a,"mouseover",null,h.H.ZC);h.ed(a,"mouseout",null,h.H.YC);a.addEventListener("mousemove",h.H.XC,!1)};
h.H.ZC=function(a){if(!h.H.Wi){for(a=a.currentTarget;"string"!=typeof a.ue&&"function"!=typeof a.ue;)a=a.ue;h.H.ka!=a&&(h.H.ta(),h.H.ao=null,h.H.ka=a);clearTimeout(h.H.vw)}};h.H.YC=function(){h.H.Wi||(h.H.vw=setTimeout(function(){h.H.ka=null;h.H.ao=null;h.H.ta()},1),clearTimeout(h.H.Tl))};
h.H.XC=function(a){if(h.H.ka&&h.H.ka.ue&&!h.H.Wi)if(h.H.visible){var c=h.H.jr-a.pageX;a=h.H.kr-a.pageY;Math.sqrt(c*c+a*a)>h.H.zz&&h.H.ta()}else h.H.ao!=h.H.ka&&(clearTimeout(h.H.Tl),h.H.jr=a.pageX,h.H.kr=a.pageY,h.H.Tl=setTimeout(h.H.zD,h.H.Oy))};h.H.ta=function(){h.H.visible&&(h.H.visible=!1,h.H.va&&(h.H.va.style.display="none"));h.H.Tl&&clearTimeout(h.H.Tl)};h.H.block=function(){h.H.ta();h.H.Wi=!0};h.H.SD=function(){h.H.Wi=!1};
h.H.zD=function(){if(!h.H.Wi&&(h.H.ao=h.H.ka,h.H.va)){h.H.va.innerHTML="";for(var a=h.H.ka.ue;"function"==typeof a;)a=a();a=h.g.Oa.Gx(a,h.H.cz);a=a.split("\n");for(var c=0;c<a.length;c++){var d=document.createElement("div");d.appendChild(document.createTextNode(a[c]));h.H.va.appendChild(d)}a=h.H.ka.G;c=document.documentElement.clientWidth;d=document.documentElement.clientHeight;h.H.va.style.direction=a?"rtl":"ltr";h.H.va.style.display="block";h.H.visible=!0;var e=h.H.jr;e=a?e-(h.H.Bt+h.H.va.offsetWidth):
e+h.H.Bt;var f=h.H.kr+h.H.Ct;f+h.H.va.offsetHeight>d+window.scrollY&&(f-=h.H.va.offsetHeight+2*h.H.Ct);a?e=Math.max(h.H.Xo-window.scrollX,e):e+h.H.va.offsetWidth>c+window.scrollX-2*h.H.Xo&&(e=c-h.H.va.offsetWidth-2*h.H.Xo);h.H.va.style.top=f+"px";h.H.va.style.left=e+"px"}};h.ju=function(a){this.Dk=a;this.Ja()};b=h.ju.prototype;b.eb=null;b.je=null;b.Dk=null;b.Ja=function(){this.eb||(this.eb=h.g.m.L("svg",{xmlns:h.g.m.nc,"xmlns:html":h.g.m.Em,"xmlns:xlink":h.g.m.Ge,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.Dk.appendChild(this.eb))};b.mi=function(a,c){a=a.toFixed(0);c=c.toFixed(0);this.eb.style.display="block";h.g.m.Ll(this.eb,"translate3d("+a+"px, "+c+"px, 0px)")};b.Lq=function(){return h.g.Id(this.eb)};
b.Zm=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var c=this.eb.childNodes[0],d=this.eb.childNodes[1];if(!(c&&d&&h.g.m.Qv(c,"blocklyBlockCanvas")&&h.g.m.Qv(d,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.Tr?h.g.m.qj(c,this.Tr):a.insertBefore(c,a.firstChild);h.g.m.qj(d,c);this.eb.style.display="none";if(this.eb.childNodes.length)throw Error("Drag surface was not cleared.");h.g.m.Ll(this.eb,
"");this.Tr=null};h.hb=Object.create(null);h.na=function(a,c){this.A=a;this.type=c};h.na.um=0;h.na.Mt=1;h.na.Pt=2;h.na.Ot=3;h.na.Kt=4;h.na.Lt=5;h.na.Nt=6;b=h.na.prototype;b.ga=null;b.wf=null;b.af=null;b.wb=0;b.Na=0;
b.ge=function(a){var c=this,d=c.A,e=a.A;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=z(c),g=c.af;c.af=null;if(f.Qa)g=h.N.gg(f),f.J(),f=null;else if(c.type==h.Sa){if(!f.M)throw Error("Orphan block does not have an output connection.");var k=h.na.hw(e,f);k&&(f.M.connect(k),f=null)}else if(c.type==h.Ga){if(!f.U)throw Error("Orphan block does not have a previous connection.");for(k=e;k.V;){var l=u(k);if(l&&!l.Qa)k=l;else{Ga(f.U,k.V)&&(k.V.connect(f.U),f=null);break}}}if(f&&(c.disconnect(),
h.i.ic)){var m=h.i.Fb();setTimeout(function(){f.C&&!f.getParent()&&(h.i.X(m),f.M?f.M.Wn(c):f.U&&f.U.Wn(c),h.i.X(!1))},h.rm)}c.af=g}var n;h.i.isEnabled()&&(n=new h.i.Tj(e));h.na.NA(c,a);e.Hj(d);n&&(n.Yh(),h.i.Ha(n))};b.J=function(){if(this.isConnected()){this.af=null;var a=z(this);a.Qa?a.J():A(a)}};function E(a){return a.type==h.Sa||a.type==h.Ga}b.isConnected=function(){return!!this.ga};
function Ha(a,c){if(!c)return h.na.Ot;if(E(a))var d=a.A,e=c.A;else e=a.A,d=c.A;return d&&d==e?h.na.Mt:c.type!=h.Ji[a.type]?h.na.Pt:d&&e&&d.C!==e.C?h.na.Lt:Ga(a,c)?d.Qa&&!e.Qa?h.na.Nt:h.na.um:h.na.Kt}
function Ia(a,c){switch(Ha(a,c)){case h.na.um:break;case h.na.Mt:throw Error("Attempted to connect a block to itself.");case h.na.Lt:throw Error("Blocks not on same workspace.");case h.na.Pt:throw Error("Attempt to connect incompatible types.");case h.na.Ot:throw Error("Target connection is null.");case h.na.Kt:throw Error("Connection checks failed. "+(a+" expected "+a.wf+", found "+c.wf));case h.na.Nt:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!");
}}b.Jn=function(a){if(a.A.xg()||Ha(this,a)!=h.na.um)return!1;switch(a.type){case h.Xd:return this.ga||-1!=h.Pk.indexOf(a)?a=!1:a.ga?(a=z(a),a=a.xg()?!(a.U&&z(a.U)):!1):a=!0,a;case h.Vd:if(a.isConnected()&&!z(a).xg()||this.isConnected())return!1;break;case h.Sa:if(a.isConnected()&&!z(a).Rc()&&!z(a).Qa)return!1;break;case h.Ga:if(a.isConnected()&&!this.A.V&&!z(a).Qa&&z(a).V)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=h.Pk.indexOf(a)?!1:!0};b.Wn=function(){};
b.connect=function(a){if(this.ga!=a){Ia(this,a);var c=h.i.Fb();c||h.i.X(!0);E(this)?this.ge(a):a.ge(this);c||h.i.X(!1)}};h.na.NA=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ga=c;c.ga=a};h.na.AD=function(a,c){for(var d=!1,e=0;e<a.P.length;e++){var f=a.P[e].connection;if(f&&f.type==h.Sa&&Ga(c.M,f)){if(d)return null;d=f}}return d};h.na.hw=function(a,c){for(var d;d=h.na.AD(a,c);)if(a=z(d),!a||a.Qa)return d;return null};b=h.na.prototype;
b.disconnect=function(){var a=this.ga;if(!a)throw Error("Source connection not connected.");if(a.ga!=this)throw Error("Target connection not connected to source connection.");if(E(this)){var c=this.A;var d=a.A;a=this}else c=a.A,d=this.A;var e=h.i.Fb();e||h.i.X(!0);this.hq(c,d);a.ds();e||h.i.X(!1)};b.hq=function(a,c){var d;h.i.isEnabled()&&(d=new h.i.Tj(c));this.ga=this.ga.ga=null;c.Hj(null);d&&(d.Yh(),h.i.Ha(d))};
b.ds=function(){var a=this.A,c=this.af;if(a.C&&c&&h.i.ic)if(a=h.N.dj(c,a.C),a.M)this.connect(a.M);else if(a.U)this.connect(a.U);else throw Error("Child block does not have output or previous statement.");};function z(a){return a.isConnected()?a.ga.A:null}function Ga(a,c){if(!a.wf||!c.wf)return!0;for(var d=0;d<a.wf.length;d++)if(-1!=c.wf.indexOf(a.wf[d]))return!0;return!1}b.Dw=function(){this.isConnected()&&!Ga(this,this.ga)&&A(E(this)?z(this):this.A)};
b.Mc=function(a){a?(Array.isArray(a)||(a=[a]),this.wf=a,this.Dw()):this.wf=null;return this};b.yw=function(){return[]};b.Pe=function(){for(var a=null,c=this.A,d=c.P,e=0;e<c.P.length;e++)if(d[e].connection===this){a=d[e];break}return a};
b.toString=function(){var a=this.A;if(a)if(a.M==this)var c="Output Connection of ";else if(a.U==this)c="Previous Connection of ";else if(a.V==this)c="Next Connection of ";else{c=null;for(var d=0,e;e=a.P[d];d++)if(e.connection==this){c=e;break}if(c)c='Input "'+c.name+'" connection on ';else return console.warn("Connection not actually connected to sourceBlock_"),"Orphan Connection"}else return"Orphan Connection";d=a.type?'"'+a.type+'" block':"Block";a.id&&(d+=' (id="'+a.id+'")');return c+d};h.ba={};h.ba.Sj={};h.ba.register=function(a,c){if("string"!=typeof a||""==a.trim())throw Error('Error: Invalid extension name "'+a+'"');if(h.ba.Sj[a])throw Error('Error: Extension "'+a+'" is already registered.');if("function"!=typeof c)throw Error('Error: Extension "'+a+'" must be a function');h.ba.Sj[a]=c};h.ba.jD=function(){var a=h.cb.$c.hz;if(!a||"object"!=typeof a)throw Error('Error: Mixin "logic_ternary" must be a object');h.ba.register("logic_ternary",function(){this.Ph(a)})};
h.ba.Xr=function(a,c,d,e){var f='Error when registering mutator "'+a+'": ';h.ba.yu(f,c.Gd,"domToMutation");h.ba.yu(f,c.hc,"mutationToDom");var g=h.ba.Au(c,f);if(d&&"function"!=typeof d)throw Error('Extension "'+a+'" is not a function');h.ba.register(a,function(){if(g){if(!h.Sd)throw Error(f+"Missing require for Blockly.Mutator");this.kx(new h.Sd(e))}this.Ph(c);d&&d.apply(this)})};h.ba.unregister=function(a){h.ba.Sj[a]?delete h.ba.Sj[a]:console.warn('No extension mapping for name "'+a+'" found to unregister')};
h.ba.apply=function(a,c,d){var e=h.ba.Sj[a];if("function"!=typeof e)throw Error('Error: Extension "'+a+'" not found.');if(d)h.ba.AA(a,c);else var f=h.ba.Iq(c);e.apply(c);if(d)h.ba.yA('Error after applying mutator "'+a+'": ',c);else if(!h.ba.GC(f,c))throw Error('Error when applying extension "'+a+'": mutation properties changed when applying a non-mutator extension.');};
h.ba.yu=function(a,c,d){if(!c)throw Error(a+'missing required property "'+d+'"');if("function"!=typeof c)throw Error(a+'" required property "'+d+'" must be a function');};h.ba.AA=function(a,c){if(h.ba.Iq(c).length)throw Error('Error: tried to apply mutation "'+a+'" to a block that already has mutator functions. Block id: '+c.id);};
h.ba.Au=function(a,c){var d=void 0!==a.Ak,e=void 0!==a.Lk;if(d&&e){if("function"!=typeof a.Ak)throw Error(c+"compose must be a function.");if("function"!=typeof a.Lk)throw Error(c+"decompose must be a function.");return!0}if(d||e)throw Error(c+'Must have both or neither of "compose" and "decompose"');return!1};
h.ba.yA=function(a,c){if("function"!=typeof c.Gd)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!=typeof c.hc)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');h.ba.Au(c,a)};h.ba.Iq=function(a){var c=[];void 0!==a.Gd&&c.push(a.Gd);void 0!==a.hc&&c.push(a.hc);void 0!==a.Ak&&c.push(a.Ak);void 0!==a.Lk&&c.push(a.Lk);return c};h.ba.GC=function(a,c){c=h.ba.Iq(c);if(c.length!=a.length)return!1;for(var d=0;d<c.length;d++)if(a[d]!=c[d])return!1;return!0};
h.ba.tu=function(a){var c=[];"object"==typeof document&&h.g.$w(function(){for(var d in a)h.g.zu(a[d])});return function(){this.type&&-1==c.indexOf(this.type)&&(h.ba.zA(this,a),c.push(this.type));this.Od(function(){var d=F(this,"OP"),e=a[d];null==e?-1==c.indexOf(this.type)&&(d="No tooltip mapping for value "+d+" of field OP",null!=this.type&&(d+=" of block type "+this.type),console.warn(d+".")):e=h.g.te(e);return e}.bind(this))}};
h.ba.zA=function(a,c){var d=ha(a,"OP");if("function"!=typeof d.Oh){d=d.getOptions();for(var e=0;e<d.length;++e){var f=d[e][1];null==c[f]&&console.warn("No tooltip mapping for value "+f+" of field OP of block type "+a.type)}}};h.ba.tA=function(){"object"==typeof document&&h.g.$w(function(){h.g.zu("%{BKY_MATH_CHANGE_TOOLTIP}")});return function(){this.Od(function(){var a=ha(this,"VAR");return h.g.te("%{BKY_MATH_CHANGE_TOOLTIP}").replace("%1",a?a.kd():"")}.bind(this))}};
h.ba.oB=function(){this.PD=this.ue;this.Od(function(){var a=this.getParent();return a&&Ja(a)&&a.ue||this.PD}.bind(this))};h.ba.register("parent_tooltip_when_inline",h.ba.oB);h.Va={};h.Va.iq=0;h.Va.mn=null;h.Va.fB=function(a){var c=a.C,d=a.aa();c.Bd.play("delete");a=Ka(c,d);d=d.cloneNode(!0);d.QD=a.x;d.RD=a.y;d.setAttribute("transform","translate("+a.x+","+a.y+")");x(c).appendChild(d);d.su=d.getBBox();h.Va.av(d,c.G,new Date,c.scale)};h.Va.av=function(a,c,d,e){var f=(new Date-d)/150;1<f?h.g.m.removeNode(a):(a.setAttribute("transform","translate("+(a.QD+(c?-1:1)*a.su.width*e/2*f)+","+(a.RD+a.su.height*e*f)+") scale("+(1-f)*e+")"),setTimeout(h.Va.av,10,a,c,d,e))};
h.Va.OA=function(a){var c=a.C,d=c.scale;c.Bd.play("click");if(!(1>d)){var e=Ka(c,a.aa());a.M?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.U&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=h.g.m.L("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},x(c));h.Va.Ku(a,new Date,d)}};h.Va.Ku=function(a,c,d){var e=(new Date-c)/150;1<e?h.g.m.removeNode(a):(a.setAttribute("r",25*e*d),a.style.opacity=1-e,h.Va.iq=setTimeout(h.Va.Ku,10,a,c,d))};
h.Va.eB=function(a){a.C.Bd.play("disconnect");if(!(1>a.C.scale)){var c=G(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);h.Va.$u(a.aa(),c,new Date)}};h.Va.$u=function(a,c,d){var e=(new Date-d)/200;1<e?a.Ul="":(a.Ul="skewX("+Math.round(Math.sin(e*Math.PI*3)*(1-e)*c)+")",h.Va.mn=a,h.Va.iq=setTimeout(h.Va.$u,10,a,c,d));a.setAttribute("transform",a.dm+a.Ul)};h.Va.jq=function(){if(h.Va.mn){clearTimeout(h.Va.iq);var a=h.Va.mn;a.Ul="";a.setAttribute("transform",a.dm);h.Va.mn=null}};h.Hm=function(a){this.ve=h.selected=a;this.s=a.C;this.Lh=this.hr=null;this.fj=La(this,this.ve);this.Tb=this.ib=null;this.ff=!1;this.Nh=null;this.Vq=!1;this.mj=null;a=this.ve.Hd(!1);var c;a:{for(c=this.ve.V;c;){var d=z(c);if(!d)break a;c=d.V}c=null}c&&c!=this.ve.V&&(a.push(c),this.hr=c,this.Lh=La(this,c.A));this.Jp=a};
h.Hm.prototype.J=function(){this.s=this.ve=null;this.Jp.length=0;this.Tb=this.ib=null;h.i.disable();try{this.fj&&(this.fj.J(),this.fj=null),this.Lh&&(this.Lh.J(),this.Lh=null)}finally{h.i.enable()}this.mj=null};
h.Hm.prototype.update=function(a,c){var d=this.ib&&this.Tb?h.ly:h.bd;for(var e=null,f=null,g=0;g<this.Jp.length;g++){var k=this.Jp[g],l=k.closest(d,a);l.connection&&(e=l.connection,f=k,d=l.co)}e=(d={closest:e,local:f,co:d},!!d.closest)&&c!=h.ct;if((this.ff=!!c&&!this.ve.getParent()&&this.ve.md()&&!e)||Ma(this,d,a)){h.i.disable();d.closest?(a=this.ib!=d.closest,c=this.Tb!=d.local,this.ib&&this.Tb&&(a||c||this.ff)&&Na(this)):Na(this);this.Tb=this.ib=this.Nh=null;if(!this.ff&&(a=d.closest,c=d.local,
a))if(a==this.ib||a.A.xg())console.log("Trying to connect to an insertion marker");else{this.ib=a;this.Tb=c;a=this.ib;c=this.Tb;if(c.type==h.Vd)a=a.isConnected()&&!h.na.hw(this.ve,a.ga.A);else{a:{for(d=0;e=c.A.P[d];d++)if(e.connection&&e.connection.type==h.Ga){d=e.connection;break a}d=null}a=c==d?0:!this.ve.V&&c.type==h.Xd&&a.isConnected()}if(a)a=this.ib,c=this.Tb,z(a)?(this.mj=z(a),Oa(z(a),!0)):c.type==h.Vd&&(this.mj=a.A,a.A.aC(a,!0)),this.Vq=!0;else{d=this.Tb;a=this.ib;c=this.hr&&d==this.hr?this.Lh:
this.fj;a:{f=d.A;e=c.Hd(!0);f=f.Hd(!0);if(e.length!=f.length)throw Error("Connection lists did not match in length.");for(g=0;g<f.length;g++)if(f[g]==d){d=e[g];break a}d=null}if(d==this.Nh)throw Error("Made it to connectMarker_ even though the marker isn't changing");c.ya();c.ea=!0;c.aa().setAttribute("visibility","visible");d.type!=h.Ga&&d.type!=h.Sa||c.moveBy(a.wb-d.wb,a.Na-d.Na);d.connect(a);this.Nh=d}this.ib&&this.ib.Dn()}h.i.enable()}};
function La(a,c){var d=c.type;h.i.disable();try{var e=a.s.yj(d);e.hx(!0);e.Mg(c.isCollapsed());if(c.hc){var f=c.hc();f&&e.Gd(f)}for(a=0;a<c.P.length;a++){var g=c.P[a],k=e.P[a];for(d=0;d<g.La.length;d++)k.La[d].setValue(g.La[d].getValue())}e.Re();e.aa().setAttribute("visibility","hidden")}finally{h.i.enable()}return e}
function Ma(a,c,d){var e=c.local,f=c.closest;c=c.co;if(e&&f){if(a.Tb&&a.ib){if(a.ib==f&&a.Tb==e)return!1;e=a.Tb.wb+d.x-a.ib.wb;a=a.Tb.Na+d.y-a.ib.Na;a=Math.sqrt(e*e+a*a);return!(f&&c>a-h.sy)}if(a.Tb||a.ib)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Tb||!a.ib);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0}
function Na(a){a.ib&&(h.g.m.removeNode(h.na.Yv),delete h.na.Yv);if(a.Vq){var c=a.ib;c.type!=h.Sa||c.isConnected()?Oa(a.mj,!1):a.mj.aC(c,!1);a.mj=null;a.Vq=!1}else if(a.Nh)if(a.Nh){c=a.Nh;var d=c.A,e=d.V,f=d.U,g=d.M;g=c.type==h.Sa&&!(g&&g.ga);!(c!=e||f&&f.ga)||g?A(z(c),!1):c.type==h.Ga&&c!=e?(e=c.ga,A(e.A,!1),f=f?f.ga:null,A(d,!0),f&&f.connect(e)):A(d,!0);if(c.ga)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.Nh=null;d.aa().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")}
h.Hm.prototype.gj=function(){var a=[];this.fj&&a.push(this.fj);this.Lh&&a.push(this.Lh);return a};h.Ug=function(a,c){this.jb=a;this.s=c;this.Me=new h.Hm(this.jb);this.rh=null;this.ff=!1;this.df=this.jb.Ia();this.on=h.Ug.fC(a)};h.Ug.prototype.J=function(){this.Mb=this.s=this.jb=null;this.on.length=0;this.Me&&(this.Me.J(),this.Me=null)};h.Ug.fC=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Pa(e);for(var f=0;f<e.length;f++)c.push({location:e[f].Zk,icon:e[f]})}return c};
function Qa(a,c,d){d=a.Cj(d);var e=h.g.I.sum(a.df,d);a.jb.Ar(e);for(e=0;e<a.on.length;e++){var f=a.on[e];Ra(f.icon,h.g.I.sum(f.location,d))}a.rh=Sa(a.s,c);a.Me.update(d,a.rh);a.ff=a.Me.ff;c=a.s.kc;a.ff?(Ta(a.jb,!0),a.rh==h.Ko&&c&&Ua(c,!0)):(Ta(a.jb,!1),c&&Ua(c,!1))}
function Va(a,c,d){Qa(a,c,d);a.on=[];h.g.m.Wl();h.Va.jq();c=a.Cj(d);d=h.g.I.sum(a.df,c);var e=a.jb;e.km&&(e.translate(d.x,d.y),e.C.fd.Zm(e.C.Xa));d=a.s.kc;a.ff?(d&&setTimeout(d.close.bind(d),100),a.Rk(),a.jb.J(!1,!0)):d&&d.close();a.ff||(Wa(a.jb,c.x,c.y),a.jb.ci(!1),a.Rk(),a.Me.ib?(c=a.Me,c.ib&&(h.i.disable(),Na(c),h.i.enable(),c.Tb.connect(c.ib),c.ve.ea&&(h.Va.OA((E(c.Tb)?c.ib:c.Tb).A),Xa(H(c.ve))))):a.jb.ya(),Ya(a.jb));a.s.Yb(!0);(c=a.s.wa)&&c.mD(a.jb.md()?"blocklyToolboxDelete":"blocklyToolboxGrab");
h.i.X(!1)}h.Ug.prototype.Rk=function(){var a=new h.i.Tj(this.jb);a.Fr=this.df;a.Yh();h.i.Ha(a)};h.Ug.prototype.Cj=function(a){a=new h.g.I(a.x/this.s.scale,a.y/this.s.scale);this.s.Kh&&a.scale(1/this.s.options.Vb.scale);return a};h.Ug.prototype.gj=function(){return this.Me&&this.Me.gj?this.Me.gj():[]};h.Am=function(){this.Sb=this.tb=null};function I(a,c){a.tb=c;a.Sb&&a.Sb.draw(a.tb)}b=h.Am.prototype;b.ta=function(){this.Sb&&this.Sb.ta()};b.next=function(){var a=this.tb;if(!a)return null;for(a=a.next();a&&a.next()&&(a.qb()==h.F.types.Td||a.qb()==h.F.types.Xc);)a=a.next();a&&I(this,a);return a};b.$k=function(){var a=this.tb;if(!a)return null;if(a.qb()==h.F.types.Wd||a.qb()==h.F.types.Li)a=a.next();(a=a.$k())&&I(this,a);return a};
b.We=function(){var a=this.tb;if(!a)return null;for(a=a.We();a&&a.We()&&(a.qb()==h.F.types.Td||a.qb()==h.F.types.Xc);)a=a.We();a&&I(this,a);return a};b.Bl=function(){var a=this.tb;if(!a)return null;(a=a.Bl())&&a.qb()==h.F.types.Xc&&(a=a.We()||a);a&&I(this,a);return a};h.Xf=function(){h.Xf.w.constructor.call(this)};h.g.object.S(h.Xf,h.Am);h.Xf.prototype.next=function(){return null};h.Xf.prototype.$k=function(){return null};h.Xf.prototype.We=function(){return null};h.Xf.prototype.Bl=function(){return null};h.Pz=function(){this.qA=h.Qi.Vj.WA;this.LA=Object.create(null)};function Za(a,c){return(c=a.LA[c])&&"string"==typeof propertyValue&&Za(a,c)?Za(a,c):c?String(c):null};h.jk=function(a){this.so=a;this.oo=[];this.kg=Object.create(null)};h.jk.prototype.Oq=function(){return this.so};h.jk.prototype.subscribe=function(a,c,d){this.kg[c]||(this.kg[c]=[]);this.kg[c].push({element:a,propertyName:d});a.style[d]=this.so&&Za(this.so,c)||""};h.jk.prototype.unsubscribe=function(a){if(a)for(var c=Object.keys(this.kg),d=0,e;e=c[d];d++){for(var f=this.kg[e],g=f.length-1;0<=g;g--)f[g].element===a&&f.splice(g,1);this.kg[e].length||delete this.kg[e]}};
h.jk.prototype.J=function(){this.kg=this.oo=this.so=this.wc=null};h.Qi={};h.Qi.Vj={};h.Qi.Vj.WA={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}};
h.Qi.Vj.tI={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}};h.Qi.Vj=new h.Pz;h.Bp=function(a){this.Aa=Object.create(null);this.C=a};b=h.Bp.prototype;b.clear=function(){this.Aa=Object.create(null)};b.Yr=function(a,c){var d=this.me(c,a.type),e=J(this.C,!1);h.i.X(!0);try{if(d&&d.Pa()!=a.Pa()){var f=a.type;c!=d.name&&$a(d,c,e);for(c=0;c<e.length;c++)for(var g=void 0,k=e[c],l=a.Pa(),m=d.Pa(),n=0;g=k.P[n];n++)for(var r=0,q;q=g.La[r];r++)q.eo()&&l==q.getValue()&&q.setValue(m);h.i.Ha(new h.i.Zd(a));this.Aa[f].splice(this.Vk(f).indexOf(a),1)}else $a(a,c,e)}finally{h.i.X(!1)}};
b.$h=function(a,c){var d=this.Cf(a);if(!d)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.Yr(d,c)};function $a(a,c,d){h.i.Ha(new h.i.Fe(a,c));a.name=c;for(c=0;c<d.length;c++)for(var e,f=d[c],g=a,k=0;e=f.P[k];k++)for(var l=0,m;m=e.La[l];l++)m.eo()&&g.Pa()==m.getValue()&&ab(m)}
b.ie=function(a,c,d){var e=this.me(a,c);if(e){if(d&&e.Pa()!=d)throw Error('Variable "'+a+'" is already in use and its id is "'+e.Pa()+'" which conflicts with the passed in id, "'+d+'".');return e}if(d&&this.Cf(d))throw Error('Variable id, "'+d+'", is already in use.');e=d||h.g.Af();c=c||"";e=new h.kk(this.C,a,c,e);a=this.Aa[c]||[];a.push(e);delete this.Aa[c];this.Aa[c]=a;return e};
b.sh=function(a){var c=this.Cf(a);if(c){var d=c.name,e=this.Rq(a);a=0;for(var f;f=e[a];a++)if("procedures_defnoreturn"==f.type||"procedures_defreturn"==f.type){a=F(f,"NAME");d=h.h.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",d).replace("%2",a);h.alert(d);return}var g=this;1<e.length?(d=h.h.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(e.length)).replace("%2",d),h.confirm(d,function(k){k&&g.kn(c,e)})):g.kn(c,e)}else console.warn("Can't delete non-existent variable: "+a)};
b.kn=function(a,c){var d=h.i.Fb();d||h.i.X(!0);try{for(var e=0;e<c.length;e++)c[e].J(!0,!1);var f=this.Aa[a.type];c=0;for(var g;g=f[c];c++)if(g.Pa()==a.Pa()){f.splice(c,1);h.i.Ha(new h.i.Zd(a));break}}finally{d||h.i.X(!1)}};b.me=function(a,c){if(c=this.Aa[c||""])for(var d=0,e;e=c[d];d++)if(h.Ud.Ne(e.name,a))return e;return null};b.Cf=function(a){for(var c=Object.keys(this.Aa),d=0;d<c.length;d++)for(var e=c[d],f=0,g;g=this.Aa[e][f];f++)if(g.Pa()==a)return g;return null};
b.Vk=function(a){return(a=this.Aa[a||""])?a.slice():[]};b.Qq=function(a){var c=[];a&&a.Ig&&(c=Object.keys(a.Ig.Aa));a=Object.keys(this.Aa).concat(c);c=!1;for(var d=0;d<a.length;d++)""==a[d]&&(c=!0);c||a.push("");return a};b.pg=function(){var a=[],c;for(c in this.Aa)a=a.concat(this.Aa[c]);return a};b.Rq=function(a){for(var c=[],d=J(this.C,!1),e=0;e<d.length;e++){var f=qa(d[e]);if(f)for(var g=0;g<f.length;g++)f[g].Pa()==a&&c.push(d[e])}return c};h.ob=function(a){this.id=h.g.Af();h.ob.mk[this.id]=this;this.options=a||{};this.G=!!this.options.G;this.Hf=!!this.options.Hf;this.Ya=this.options.Ya;this.Oj=[];this.to=[];this.fn=Object.create(null);this.Kc=[];this.ni=[];this.Hl=[];this.Lp=Object.create(null);this.Qf=Object.create(null);this.Aa=new h.Bp(this);this.Ig=null;this.Ka=new h.Am;this.xb=new h.Xf;this.$b=this.options.Vb?this.options.Vb.$b:new h.jk(this.options.MD||h.Qi.Vj);this.$b.oo.push(this)};b=h.ob.prototype;b.ea=!1;b.cr=!1;b.xt=1024;
b.hn=null;b.ks=function(a){this.Ka=a};b.ix=function(a){this.xb=a};b.Oq=function(){return this.$b.Oq()};b.J=function(){this.Kc.length=0;this.clear();delete h.ob.mk[this.id];if(this.$b){var a=this.$b,c=a.oo.indexOf(this);if(0>c)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.oo.splice(c,1);this.$b.unsubscribe(this.Zb);this.options.Vb||(this.$b.J(),this.$b=null)}};h.ob.Rt=3;b=h.ob.prototype;
b.bf=function(a,c){a=a.Ia();c=c.Ia();return a.y+h.ob.prototype.bf.offset*a.x-(c.y+h.ob.prototype.bf.offset*c.x)};function bb(a,c){if(!h.g.Xm(a.Oj,c))throw Error("Block not present in workspace's list of top-most blocks.");}function D(a,c){var d=[].concat(a.Oj);c&&1<d.length&&(a.bf.offset=Math.sin(h.g.Lb.li(h.ob.Rt)),a.G&&(a.bf.offset*=-1),d.sort(a.bf));return d}
function ja(a,c){var d=[].concat(a.to);c&&1<d.length&&(a.bf.offset=Math.sin(h.g.Lb.li(h.ob.Rt)),a.G&&(a.bf.offset*=-1),d.sort(a.bf));return d}function J(a,c){if(c){a=D(a,!0);c=[];for(var d=0;d<a.length;d++)c.push.apply(c,p(a[d],!0))}else for(c=D(a,!1),d=0;d<c.length;d++)c.push.apply(c,pa(c[d],!1));return c.filter(function(e){return!e.xg()})}
b.clear=function(){this.cr=!0;try{var a=h.i.Fb();for(a||h.i.X(!0);this.Oj.length;)this.Oj[0].J();for(;this.to.length;)this.to[this.to.length-1].J();a||h.i.X(!1);this.Aa.clear();this.Ig&&this.Ig.clear()}finally{this.cr=!1}};b.$h=function(a,c){this.Aa.$h(a,c)};b.ie=function(a,c,d){return this.Aa.ie(a,c,d)};b.Rq=function(a){return this.Aa.Rq(a)};b.sh=function(a){this.Aa.sh(a)};b.kn=function(a,c){this.Aa.kn(a,c)};b.me=function(a,c){return this.Aa.me(a,c)};b.Cf=function(a){return this.Aa.Cf(a)};b.Vk=function(a){return this.Aa.Vk(a)};
b.Qq=function(){return this.Aa.Qq(this)};b.pg=function(){return this.Aa.pg()};b.Df=function(){return 0};b.yj=function(a,c){return new h.sm(this,a,c)};function cb(a,c){if(!db(a))return!0;var d=0,e;for(e in c){var f=c[e];if(a.options.xr){var g=a.options.xr[e]||Infinity;var k=a.Qf[e]?a.Qf[e].slice(0):[];g-=k.length}else g=Infinity;if(f>g)return!1;d+=c[e]}return d>(isNaN(a.options.ul)?Infinity:a.options.ul-J(a).length)?!1:!0}function db(a){return Infinity!=a.options.ul||!!a.options.xr}
b.Cs=function(a){var c=a?this.Hl:this.ni,d=a?this.ni:this.Hl,e=c.pop();if(e){for(var f=[e];c.length&&e.group&&e.group==c[c.length-1].group;)f.push(c.pop());for(c=0;e=f[c];c++)d.push(e);f=h.i.filter(f,a);h.i.ic=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{h.i.ic=!0}}};function K(a,c){a.Kc.push(c)}function eb(a,c){h.g.Xm(a.Kc,c)}function v(a,c){return a.Lp[c]||null}h.ob.mk=Object.create(null);h.ob.Gq=function(a){return h.ob.mk[a]||null};
h.ob.getAll=function(){var a=[],c;for(c in h.ob.mk)a.push(h.ob.mk[c]);return a};h.oa=function(a,c,d,e,f,g){this.s=a;this.mg=c;this.lx=d;d=h.oa.Vx;this.s.G&&(d=-d);this.kA=h.g.Lb.li(d);a.Pf.appendChild(this.Fk(c,!(!f||!g)));this.Cb=e;this.Zr&&fb(this);f&&g||(c=this.mg.getBBox(),f=c.width+2*h.oa.Yc,g=c.height+2*h.oa.Yc);gb(this,f,g);fb(this);hb(this);this.Zr=!0;a.options.readOnly||(h.pa(this.rk,"mousedown",this,this.rA),this.Ye&&h.pa(this.Ye,"mousedown",this,this.oD))};h.oa.Yc=6;h.oa.Wx=5;h.oa.Vx=20;h.oa.Ms=4;h.oa.Tx=8;h.oa.Gg=null;h.oa.Fg=null;h.oa.prototype.Yw=null;
h.oa.Bs=function(){h.oa.Gg&&(h.Za(h.oa.Gg),h.oa.Gg=null);h.oa.Fg&&(h.Za(h.oa.Fg),h.oa.Fg=null)};h.oa.sA=function(){h.Touch.$m();h.oa.Bs()};b=h.oa.prototype;b.Zr=!1;b.Cb=null;b.Lf=0;b.Kg=0;b.bb=0;b.fc=0;b.Ip=!0;
b.Fk=function(a,c){this.gd=h.g.m.L("g",{},null);var d={filter:"url(#"+this.s.options.gv+")"};h.g.userAgent.$y&&(d={});d=h.g.m.L("g",d,this.gd);this.Pp=h.g.m.L("path",{},d);this.rk=h.g.m.L("rect",{"class":"blocklyDraggable",x:0,y:0,rx:h.oa.Yc,ry:h.oa.Yc},d);c?(this.Ye=h.g.m.L("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.gd),c=2*h.oa.Yc,h.g.m.L("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.Ye),h.g.m.L("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/
3},this.Ye),h.g.m.L("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.Ye)):this.Ye=null;this.gd.appendChild(a);return this.gd};b.aa=function(){return this.gd};function ib(a,c){a.gd.dataset&&(a.gd.dataset.blockId=c)}b.rA=function(a){var c=this.s.rg(a);if(c){if(c.Ch)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.pd||(c.pd=this);c.re=a}};b.Rl=function(){};b.md=function(){return!1};
b.oD=function(a){var c=this.gd.parentNode;c.lastChild!==this.gd&&c.appendChild(this.gd);h.oa.Bs();h.g.wj(a)||(this.s.ts(a,new h.g.I(this.s.G?-this.bb:this.bb,this.fc)),h.oa.Gg=h.pa(document,"mouseup",this,h.oa.sA),h.oa.Fg=h.pa(document,"mousemove",this,this.pD),h.vc());a.stopPropagation()};b.pD=function(a){this.Ip=!1;var c=this.s;a=h.g.zl(a,x(c),Da(c));a.x/=c.scale;a.y/=c.scale;c=h.g.I.sum(c.cv,a);gb(this,this.s.G?-c.x:c.x,c.y);this.s.G&&fb(this)};
function jb(a,c,d){var e=a.s.G?a.Cb.x-c.x-a.bb:c.x+a.Cb.x;c=c.y+a.Cb.y;return Math.max(0,Math.min(1,(Math.min(e+a.bb,d.zb+d.lb)-Math.max(e,d.zb))*(Math.min(c+a.fc,d.Ib+d.vb)-Math.max(c,d.Ib))/(a.bb*a.fc)))}function fb(a){var c=a.Cb.x;c=a.s.G?c-(a.Lf+a.bb):c+a.Lf;a.moveTo(c,a.Kg+a.Cb.y)}b.moveTo=function(a,c){this.gd.setAttribute("transform","translate("+a+","+c+")")};
function gb(a,c,d){var e=2*h.oa.Yc;c=Math.max(c,e+45);d=Math.max(d,e+20);a.bb=c;a.fc=d;a.rk.setAttribute("width",c);a.rk.setAttribute("height",d);a.Ye&&(a.s.G?a.Ye.setAttribute("transform","translate("+2*h.oa.Yc+","+(d-e)+") scale(-1 1)"):a.Ye.setAttribute("transform","translate("+(c-e)+","+(d-e)+")"));if(a.Ip){c=a.s.uc();c.zb/=a.s.scale;c.lb/=a.s.scale;c.Ib/=a.s.scale;c.vb/=a.s.scale;d=-a.bb/4;if(!(a.bb>c.lb)){if(a.s.G){e=a.Cb.x-d;var f=e-a.bb;var g=c.zb+c.lb,k=c.zb+h.Ca.jc/a.s.scale}else f=d+a.Cb.x,
e=f+a.bb,k=c.zb,g=c.zb+c.lb-h.Ca.jc/a.s.scale;a.s.G?f<k?d=-(k-a.Cb.x+a.bb):e>g&&(d=-(g-a.Cb.x)):f<k?d=k-a.Cb.x:e>g&&(d=g-a.Cb.x-a.bb)}f=d;d=-a.fc/4;if(!(a.fc>c.vb)){e=a.Cb.y+d;g=e+a.fc;k=c.Ib;var l=c.Ib+c.vb-h.Ca.jc/a.s.scale,m=a.Cb.y;e<k?d=k-m:g>l&&(d=l-m-a.fc)}k=d;g=a.lx.getBBox();d={x:f,y:-a.fc-h.ra.$o};e={x:-a.bb-30,y:k};k={x:g.width,y:k};l={x:f,y:g.height};f=g.width<g.height?k:l;g=g.width<g.height?l:k;k=jb(a,d,c);l=jb(a,e,c);m=jb(a,f,c);c=Math.max(k,l,m,jb(a,g,c));k==c?(a.Lf=d.x,a.Kg=d.y):l==
c?(a.Lf=e.x,a.Kg=e.y):m==c?(a.Lf=f.x,a.Kg=f.y):(a.Lf=g.x,a.Kg=g.y)}fb(a);hb(a);a.Yw&&a.Yw()}
function hb(a){var c=[],d=a.bb/2,e=a.fc/2,f=-a.Lf,g=-a.Kg;if(d==f&&e==g)c.push("M "+d+","+e);else{g-=e;f-=d;a.s.G&&(f*=-1);var k=Math.sqrt(g*g+f*f),l=Math.acos(f/k);0>g&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),r=Math.cos(m),q=new h.g.Yd(a.bb,a.fc);m=(q.width+q.height)/h.oa.Wx;m=Math.min(m,q.width,q.height)/4;q=1-h.oa.Tx/k;f=d+q*f;g=e+q*g;q=d+m*r;var t=e+m*n;d-=m*r;e-=m*n;n=l+a.kA;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/h.oa.Ms;k=Math.cos(n)*k/h.oa.Ms;c.push("M"+
q+","+t);c.push("C"+(q+k)+","+(t+l)+" "+f+","+g+" "+f+","+g);c.push("C"+f+","+g+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.Pp.setAttribute("d",c.join(" "))}b.od=function(a){this.rk.setAttribute("fill",a);this.Pp.setAttribute("fill",a)};b.J=function(){h.oa.Bs();h.g.m.removeNode(this.gd);this.lx=this.mg=this.s=this.Ye=this.rk=this.Pp=this.gd=null};b.Ar=function(a,c){a?a.mi(c.x,c.y):this.moveTo(c.x,c.y);this.Lf=this.s.G?this.Cb.x-c.x-this.bb:c.x-this.Cb.x;this.Kg=c.y-this.Cb.y;hb(this)};
b.Ia=function(){return new h.g.I(this.Cb.x+this.Lf,this.Cb.y+this.Kg)};h.i.gf=function(a){this.Ie=a.id;this.ac=a.C.id;this.group=h.i.Fb();this.ic=h.i.ic};h.g.object.S(h.i.gf,h.i.Abstract);h.i.gf.prototype.Ma=function(){var a=h.i.gf.w.Ma.call(this);this.Ie&&(a.commentId=this.Ie);return a};h.i.gf.prototype.qa=function(a){h.i.gf.w.qa.call(this,a);this.Ie=a.commentId};h.i.Ai=function(a,c,d){a&&(h.i.Ai.w.constructor.call(this,a),this.zw=c,this.Vn=d)};h.g.object.S(h.i.Ai,h.i.gf);b=h.i.Ai.prototype;b.type=h.i.Ws;
b.Ma=function(){var a=h.i.Ai.w.Ma.call(this);a.newContents=this.Vn;return a};b.qa=function(a){h.i.Ai.w.qa.call(this,a);this.Vn=a.newValue};b.uj=function(){return this.zw==this.Vn};b.run=function(a){var c;(c=w(this).fn[this.Ie]||null)?c.jJ(a?this.Vn:this.zw):console.warn("Can't change non-existent comment: "+this.Ie)};h.i.hf=function(a){a&&(h.i.hf.w.constructor.call(this,a),this.xml=a.xs())};h.g.object.S(h.i.hf,h.i.gf);h.i.hf.prototype.type=h.i.vm;
h.i.hf.prototype.Ma=function(){var a=h.i.hf.w.Ma.call(this);a.xml=h.N.Fc(this.xml);return a};h.i.hf.prototype.qa=function(a){h.i.hf.w.qa.call(this,a);this.xml=h.N.Qg(a.xml)};h.i.hf.prototype.run=function(a){h.i.Zs(this,a)};h.i.Zs=function(a,c){var d=w(a);c?(c=h.g.xml.createElement("xml"),c.appendChild(a.xml),h.N.wh(c,d)):(d=d.fn[a.Ie]||null)?d.J(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.Ie)};h.i.jf=function(a){a&&(h.i.jf.w.constructor.call(this,a),this.xml=a.xs())};
h.g.object.S(h.i.jf,h.i.gf);h.i.jf.prototype.type=h.i.Xs;h.i.jf.prototype.Ma=function(){return h.i.jf.w.Ma.call(this)};h.i.jf.prototype.qa=function(a){h.i.jf.w.qa.call(this,a)};h.i.jf.prototype.run=function(a){h.i.Zs(this,!a)};h.i.Vg=function(a){a&&(h.i.Vg.w.constructor.call(this,a),this.Wp=a,this.Gr=a.Kv(),this.Qh=null)};h.g.object.S(h.i.Vg,h.i.gf);b=h.i.Vg.prototype;
b.Yh=function(){if(!this.Wp)throw Error("Tried to record the new position of a comment on the same event twice.");this.Qh=this.Wp.Kv();this.Wp=null};b.type=h.i.wm;b.Ma=function(){var a=h.i.Vg.w.Ma.call(this);this.Qh&&(a.newCoordinate=Math.round(this.Qh.x)+","+Math.round(this.Qh.y));return a};b.qa=function(a){h.i.Vg.w.qa.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.Qh=new h.g.I(Number(a[0]),Number(a[1])))};b.uj=function(){return h.g.I.Ne(this.Gr,this.Qh)};
b.run=function(a){var c;if(c=w(this).fn[this.Ie]||null){a=a?this.Qh:this.Gr;var d=c.Kv();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.Ie)};h.Uj=function(a,c){this.Kb=a;this.s=c;this.rh=null;this.xo=!1;this.df=this.Kb.Ia();this.xh=h.g.Gh()&&c.fd?c.fd:null};h.Uj.prototype.J=function(){this.xh=this.s=this.Kb=null};function kb(a,c,d){d=a.Cj(d);d=h.g.I.sum(a.df,d);a.Kb.Ar(a.xh,d);a.Kb.md()&&(a.rh=Sa(a.s,c),a.xo=a.rh!=h.bt,c=a.s.kc,a.xo?(Ta(a.Kb,!0),a.rh==h.Ko&&c&&Ua(c,!0)):(Ta(a.Kb,!1),c&&Ua(c,!1)))}
function lb(a,c,d){kb(a,c,d);c=a.Cj(d);c=h.g.I.sum(a.df,c);a.Kb.moveTo(c.x,c.y);c=a.s.kc;a.xo?(c&&setTimeout(c.close.bind(c),100),a.Rk(),a.Kb.J(!1,!0)):c&&c.close();a.xo||(a.xh&&a.xh.Zm(a.s.Pf),a.Kb.ci&&a.Kb.ci(!1),a.Rk());a.s.Yb(!0);a.s.wa&&a.s.wa.mD(a.Kb.md()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.i.X(!1)}h.Uj.prototype.Rk=function(){if(this.Kb.cw){var a=new h.i.Vg(this.Kb);a.Gr=this.df;a.Yh();h.i.Ha(a)}};
h.Uj.prototype.Cj=function(a){a=new h.g.I(a.x/this.s.scale,a.y/this.s.scale);this.s.Kh&&a.scale(1/this.s.options.Vb.scale);return a};h.Uj.prototype.Br=function(){this.Kb.moveTo(0,0);this.xh.mi(this.df.x,this.df.y);ba(this.xh,this.Kb.aa())};h.nk=function(a){this.s=a;this.tx=new h.g.I(a.scrollX,a.scrollY)};h.nk.prototype.J=function(){this.s=null};h.nk.prototype.ts=function(){h.selected&&mb(h.selected);Ea(this.s)};h.nk.prototype.og=function(a){a=h.g.I.sum(this.tx,a);this.s.scroll(a.x,a.y)};h.Dm=function(a){h.Dm.w.constructor.call(this,a.ij());this.Xb=a.Xb;this.nj=a.nj};h.g.object.S(h.Dm,h.nk);h.Dm.prototype.og=function(a){a=h.g.I.sum(this.tx,a);this.nj?this.Xb.set(-a.x):this.Xb.set(-a.y)};h.Di=function(a,c){this.Mb=this.Nb=this.di=this.ei=this.pd=this.Ec=this.uw=null;this.Zp=c;this.cl=this.Ih=this.dl=this.Ah=!1;this.re=a;this.O=this.Tg=this.ee=this.uf=this.Yn=this.Xn=null;this.Ln=this.Ch=this.xu=!1;this.Uv=!h.yy};b=h.Di.prototype;b.J=function(){h.Touch.$m();h.H.SD();this.Zp.Rb=null;this.Xn&&h.Za(this.Xn);this.Yn&&h.Za(this.Yn);this.O=this.Mb=this.Nb=this.di=this.ei=null;this.ee&&(this.ee.J(),this.ee=null);this.Tg&&(this.Tg.J(),this.Tg=null);this.uf&&(this.uf.J(),this.uf=null)};
function nb(a,c){a.Ec=h.g.I.Ok(new h.g.I(c.clientX,c.clientY),a.uw);if(a.Ah)var d=!1;else a.Ah=h.g.I.vC(a.Ec)>(a.O?h.Gy:h.xy),d=a.Ah;if(d){if(a.xu)throw Error("updateIsDragging_ should only be called once per gesture.");a.xu=!0;if(a.pd){a.cl=!0;a.uf=new h.Uj(a.pd,a.Mb);d=a.uf;h.i.Fb()||h.i.X(!0);d.s.Yb(!1);d.Kb.Ip=!1;d.xh&&d.Br();d.Kb.ci&&d.Kb.ci(!0);var e=d.s.wa;e&&e.eA(d.Kb.md()?"blocklyToolboxDelete":"blocklyToolboxGrab");kb(a.uf,a.re,a.Ec);d=!0}else d=!1;if(!d){if(a.Nb)if(a.O?(a.O.bw(a.Nb)?((d=
!ob(a.O))||(d=a.Ec,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.O.kB,d=d<e&&d>-e||d<-180+e||d>180-e?!0:!1),d?(a.Mb=a.O.rb,pb(a.Mb),h.i.Fb()||h.i.X(!0),a.di=null,a.Nb=qb(a.O,a.Nb),a.Nb.select(),d=!0):d=!1):d=!1,a.Ih=d):a.Nb.Rc()&&(a.Ih=!0),a.Ih){a.ee=new h.Ug(a.Nb,a.Mb);d=a.ee;e=a.Ec;var f=a.Uv;h.i.Fb()||h.i.X(!0);d.s.Kh&&Xa(d.jb);h.g.m.Vl();d.s.Yb(!1);h.Va.jq();if(d.jb.getParent()||f&&d.jb.V&&z(d.jb.V))A(d.jb,f),e=d.Cj(e),e=h.g.I.sum(d.df,e),d.jb.translate(e.x,e.y),h.Va.eB(d.jb);d.jb.ci(!0);d.jb.Br();(e=
d.s.wa)&&e.eA(d.jb.md()?"blocklyToolboxDelete":"blocklyToolboxGrab");Qa(a.ee,a.re,a.Ec);d=!0}else d=!1;else d=!1;if(d=!d)if(a.O)d=ob(a.O);else if(d=a.Mb)d=a.Mb,d=d.options.Ub&&d.options.Ub.og;d&&(a.Tg=a.O?new h.Dm(a.O):new h.nk(a.Mb),a.dl=!0,a.Tg.ts())}h.Cg()}a.re=c}
b.lq=function(a){h.g.On(a)?this.cancel():(this.Ch=!0,h.Va.jq(),pb(this.Mb),this.Mb.Kh&&this.Mb.resize(),Ca(this.Mb),this.re=a,h.vc(!!this.O),h.H.block(),this.Nb&&(!this.Nb.Qc&&a.shiftKey?(h.navigation.xq(),I(this.Zp.Ka,h.navigation.Pq(this.Nb))):this.Nb.select()),h.g.wj(a)?ra(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||h.uC(a,this),this.uw=new h.g.I(a.clientX,a.clientY),this.Uv=a.altKey||a.ctrlKey||a.metaKey,this.Vi(a)))};
b.Vi=function(a){this.Xn=h.pa(document,"mousemove",null,this.Wk.bind(this));this.Yn=h.pa(document,"mouseup",null,this.Bn.bind(this));a.preventDefault();a.stopPropagation()};b.Wk=function(a){nb(this,a);this.dl?this.Tg.og(this.Ec):this.Ih?Qa(this.ee,this.re,this.Ec):this.cl&&kb(this.uf,this.re,this.Ec);a.preventDefault();a.stopPropagation()};
b.Bn=function(a){nb(this,a);h.Cg();if(this.Ln)console.log("Trying to end a gesture recursively.");else{this.Ln=!0;if(this.cl)lb(this.uf,a,this.Ec);else if(this.Ih)Va(this.ee,a,this.Ec);else if(this.dl){var c=this.Tg;c.og(this.Ec);Fa(c.s)}else if(this.pd&&!this.Ah)this.pd.wD&&this.pd.wD(),this.pd.select&&this.pd.select();else if(rb(this))this.ei.Pg(),sb(this);else if(this.di&&!this.Ah&&!rb(this))this.O&&this.O.Ui?this.Nb.isEnabled()&&(h.i.Fb()||h.i.X(!0),Ya(qb(this.O,this.Nb))):h.i.Ha(new h.i.dd(this.di,
"click",void 0,void 0)),sb(this),h.i.X(!1);else if(!(this.di||this.pd||this.ei||this.Ah))if(c=this.Zp,a.shiftKey){h.navigation.xq();var d=h.g.tD(c,new h.g.I(a.clientX,a.clientY));d=h.F.Ik(c,d);I(c.Ka,d)}else h.selected&&mb(h.selected);a.preventDefault();a.stopPropagation();this.J()}};b.cancel=function(){if(!this.Ln){h.Cg();if(this.cl)lb(this.uf,this.re,this.Ec);else if(this.Ih)Va(this.ee,this.re,this.Ec);else if(this.dl){var a=this.Tg;a.og(this.Ec);Fa(a.s)}this.J()}};
function ra(a,c){a.Nb?(sb(a),h.vc(a.O),a.Nb.Rl(c)):a.pd?a.pd.Rl(c):a.Mb&&!a.O&&(h.vc(),a.Mb.Rl(c));c.preventDefault();c.stopPropagation();a.J()}function tb(a,c,d){if(a.Ch)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.Mb||(a.Mb=d);a.re=c;a.lq(c);h.Se&&h.navigation.$e(h.navigation.Sm)}function ub(a,c,d){if(a.Ch)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.O||(a.O=d);tb(a,c,d.ij())}
function sb(a){a.Nb&&!a.O&&Xa(a.Nb)}function vb(a,c){a.di||a.pd||(a.di=c,c.Qc&&c!=H(c)?wb(a,H(c)):wb(a,c))}function wb(a,c){c.Qa?wb(a,c.getParent()):a.Nb=c}function rb(a){if(a.ei){var c=a.ei;c=!!c.A&&c.A.Jc()&&!!c.Pg&&"function"===typeof c.Pg}else c=!1;return c&&!a.Ah&&(!a.O||!a.O.Ui)}b.gc=function(){return this.dl||this.Ih||this.cl};b.gj=function(){return this.ee?this.ee.gj():[]};h.Di.Xq=function(){for(var a=h.ob.getAll(),c=0,d;d=a[c];c++)if(d.Rb)return!0;return!1};h.Fa=function(a,c,d){this.zx=this.lm=this.Nc=null;this.Gb=new h.g.Yd(0,0);this.ec=null;d&&this.Ed(d);this.setValue(a);c&&(this.lm=c)};h.Fa.Ts=16;h.Fa.Yt=12.5;h.Fa.pk=10;h.Fa.nI=10;h.Fa.Ci=h.Fa.pk/2;b=h.Fa.prototype;b.name=void 0;b.rw=50;b.A=null;b.Jf=!0;b.Sg=!0;b.an=null;h.Fa.At="\u00a0";b=h.Fa.prototype;b.kf=!0;b.Mi=!1;b.Ed=function(a){var c=a.tooltip;"string"==typeof c&&(c=h.g.te(a.tooltip));c&&this.Od(c)};b.ps=function(a){if(this.A)throw Error("Field already bound to a block.");this.A=a};
b.ua=function(){this.le||(this.le=h.g.m.L("g",{},null),this.isVisible()||(this.le.style.display="none"),this.A.aa().appendChild(this.le),this.pj(),this.oi(),this.Od(this.zx),h.H.Vi(this.an||this.aa()),this.tw=h.pa(this.an||this.aa(),"mousedown",this,this.Eg),this.Fh())};b.pj=function(){this.Gb.height=Math.max(this.Gb.height,h.Fa.Ts);this.Gb.width=Math.max(this.Gb.width,h.Fa.pk);this.jh=h.g.m.L("rect",{rx:4,ry:4,x:0,y:0,height:this.Gb.height,width:this.Gb.width},this.le);xb(this)};b.Fh=function(){};
function xb(a){a.Uc=h.g.m.L("text",{"class":"blocklyText",y:h.Fa.Yt,x:a.jh?h.Fa.Ci:0},a.le);a.Lj=document.createTextNode("");a.Uc.appendChild(a.Lj)}b.Sk=function(a){this.setValue(a.textContent)};b.xx=function(a){a.textContent=this.getValue();return a};b.J=function(){h.D.kj(this);h.T.kj(this);this.tw&&h.Za(this.tw);h.g.m.removeNode(this.le)};
b.oi=function(){var a=this.an||this.aa();this.kf&&a&&(this.A.Jc()?(h.g.m.Bb(a,"blocklyEditableText"),h.g.m.Lc(a,"blocklyNonEditableText"),a.style.cursor=this.Ys):(h.g.m.Bb(a,"blocklyNonEditableText"),h.g.m.Lc(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.Sg};b.yb=function(a){if(this.Sg!=a){this.Sg=a;var c=this.aa();c&&(c.style.display=a?"block":"none")}};function yb(a,c){a.lm=c}b.Iv=function(){return this.lm};b.aa=function(){return this.le};b.we=function(){};
b.Xe=function(){if(this.Lj){this.Lj.nodeValue=zb(this);var a=h.g.m.Mq(this.Uc);this.jh&&(a+=h.Fa.pk,this.jh.setAttribute("width",a));this.Gb.width=a}};b.Bf=function(){if(!this.isVisible())return new h.g.Yd(0,0);this.Jf?(this.Xe(),this.Jf=!1):this.Sg&&0==this.Gb.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.Xe());return this.Gb};
function zb(a){var c=a.kd();if(!c)return h.Fa.At;c.length>a.rw&&(c=c.substring(0,a.rw-2)+"\u2026");c=c.replace(/\s/g,h.Fa.At);a.A&&a.A.G&&(c+="\u200f");return c}b.kd=function(){if(this.Nq){var a=this.Nq.call(this);if(null!==a)return String(a)}return String(this.getValue())};b.lo=function(){throw Error("setText method is deprecated");};b.rl=function(){this.Jf=!0};function ab(a){a.Jf=!0;a.A&&a.A.ea&&(a.A.ya(),a.A.Ob())}
b.setValue=function(a){if(null!==a){var c=this.vh(a);a=Ab(this,a,c);if(!(a instanceof Error)){if(c=this.Iv())if(c=c.call(this,a),a=Ab(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.A&&h.i.isEnabled()&&h.i.Ha(new h.i.Rf(this.A,"field",this.name||null,c,a)),this.cj(a),this.Jf&&ab(this))}}};function Ab(a,c,d){if(null===d)return a.bv(),a.Jf&&ab(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.Nc};b.vh=function(a){return null===a||void 0===a?null:a};
b.cj=function(a){this.Nc=a;this.Jf=!0};b.bv=function(){};b.Eg=function(a){if(this.A&&this.A.C&&(a=this.A.C.rg(a))){if(a.Ch)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.ei||(a.ei=this)}};b.Od=function(a){var c=this.an||this.aa();c?c.ue=a||""===a?a:this.A:this.zx=a};b.eo=function(){return!1};b.Pe=function(){for(var a=null,c=this.A,d=c.P,e=0;e<c.P.length;e++)for(var f=d[e],g=f.La,k=0;k<g.length;k++)if(g[k]===this){a=f;break}return a};b.fw=function(){return!1};
b.Vh=function(){return!1};b.Ml=function(a){a?(this.le.appendChild(a),this.ec=a):this.ec=null};b.Nl=function(a){a&&this.le.appendChild(a)};h.tc={};h.tc.em={};h.tc.register=function(a,c){if("string"!=typeof a||""==a.trim())throw Error('Invalid field type "'+a+'". The type must be a non-empty string.');if(h.tc.em[a])throw Error('Error: Field "'+a+'" is already registered.');if(!c||"function"!=typeof c.qa)throw Error('Field "'+c+'" must have a fromJson function');a=a.toLowerCase();h.tc.em[a]=c};h.tc.unregister=function(a){h.tc.em[a]?delete h.tc.em[a]:console.warn('No field mapping for type "'+a+'" found to unregister')};
h.tc.qa=function(a){var c=h.tc.em[a.type.toLowerCase()];return c?c.qa(a):(console.warn("Blockly could not create a field of type "+a.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)};h.vd=function(a,c,d){this.Ym=null;null==a&&(a="");h.vd.w.constructor.call(this,a,null,d);d||(this.Ym=c||null);this.Gb=new h.g.Yd(0,h.Fa.Yt)};h.g.object.S(h.vd,h.Fa);h.vd.qa=function(a){var c=h.g.te(a.text);return new h.vd(c,void 0,a)};h.vd.prototype.kf=!1;h.vd.prototype.Ed=function(a){h.vd.w.Ed.call(this,a);this.Ym=a["class"]};h.vd.prototype.pj=function(){xb(this);this.Uc.setAttribute("y",this.Gb.height);this.Ym&&h.g.m.Bb(this.Uc,this.Ym)};
h.vd.prototype.vh=function(a){return null===a||void 0===a?null:String(a)};h.tc.register("field_label",h.vd);h.tt=function(a,c,d,e){if(a!=h.Qd&&!c)throw Error("Value inputs and statement inputs must have non-empty name.");this.type=a;this.name=c;this.A=d;this.connection=e;this.La=[]};b=h.tt.prototype;b.align=h.Co;b.Sg=!0;function L(a,c,d){Bb(a,a.La.length,c,d);return a}
function Bb(a,c,d,e){if(0>c||c>a.La.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new h.vd(d));d.ps(a.A);a.A.ea&&d.ua();d.name=e;d.Rr&&(c=Bb(a,c,d.Rr));a.La.splice(c,0,d);++c;d.ws&&(c=Bb(a,c,d.ws));a.A.ea&&(a.A.ya(),a.A.Ob());return c}b.isVisible=function(){return this.Sg};
b.yb=function(a){var c=[];if(this.Sg==a)return c;for(var d=(this.Sg=a)?"block":"none",e=0,f;f=this.La[e];e++)f.yb(a);if(this.connection){if(a)c=Cb(this.connection);else if(e=this.connection,Db(e,!0),e.ga)for(e=p(z(e),!1),f=0;f<e.length;f++){for(var g=e[f],k=g.Hd(!0),l=0;l<k.length;l++)Db(k[l],!0);g=Pa(g);for(l=0;l<g.length;l++)g[l].yb(!1)}if(e=z(this.connection))e.aa().style.display=d,a||(e.ea=!1)}return c};b.rl=function(){for(var a=0,c;c=this.La[a];a++)c.rl()};
b.Mc=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.Mc(a);return this};b.ua=function(){if(this.A.C.ea)for(var a=0;a<this.La.length;a++)this.La[a].ua()};b.J=function(){for(var a=0,c;c=this.La[a];a++)c.J();this.connection&&this.connection.J();this.A=null};h.g.Db={};h.g.Db.parse=function(a){a=String(a).toLowerCase().trim();var c=h.g.Db.names[a];if(c)return c;c="#"==a[0]?a:"#"+a;if(/^#[0-9a-f]{6}$/.test(c))return c;if(/^#[0-9a-f]{3}$/.test(c))return["#",c[1],c[1],c[2],c[2],c[3],c[3]].join("");var d=a.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return d&&(a=Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=a&&256>a&&0<=c&&256>c&&0<=d&&256>d)?h.g.Db.fs(a,c,d):null};
h.g.Db.fs=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};h.g.Db.Vv=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]};
h.g.Db.bC=function(a){var c=h.Py,d=255*h.Qy,e=0,f=0,g=0;if(0==c)g=f=e=d;else{var k=Math.floor(a/60),l=a/60-k;a=d*(1-c);var m=d*(1-c*l);c=d*(1-c*(1-l));switch(k){case 1:e=m;f=d;g=a;break;case 2:e=a;f=d;g=c;break;case 3:e=a;f=m;g=d;break;case 4:e=c;f=a;g=d;break;case 5:e=d;f=a;g=m;break;case 6:case 0:e=d,f=c,g=a}}return h.g.Db.fs(Math.floor(e),Math.floor(f),Math.floor(g))};
h.g.Db.Kp=function(a,c,d){a=h.g.Db.Vv(h.g.Db.parse(a));c=h.g.Db.Vv(h.g.Db.parse(c));return h.g.Db.fs(Math.round(c[0]+d*(a[0]-c[0])),Math.round(c[1]+d*(a[1]-c[1])),Math.round(c[2]+d*(a[2]-c[2])))};h.g.Db.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};h.sm=function(a,c,d){if(h.Generator&&"undefined"!=typeof h.Generator.prototype[c])throw Error('Block prototypeName "'+c+'" conflicts with Blockly.Generator members.');this.id=d&&!v(a,d)?d:h.g.Af();a.Lp[this.id]=this;this.U=this.V=this.M=null;this.P=[];this.If=void 0;this.disabled=!1;this.ue="";this.contextMenu=!0;this.Ue=null;this.xf=[];this.fv=this.ww=this.Mk=!0;this.yf=this.Qa=!1;this.zk=null;this.fe={text:null,Lw:!1,size:new h.g.Yd(160,80)};this.Lx=new h.g.I(0,0);this.C=a;this.Qc=a.oe;this.G=a.G;
this.il=!1;this.Ef=void 0;if(c){this.type=c;d=h.hb[c];if(!d||"object"!=typeof d)throw TypeError("Unknown block type: "+c);h.g.object.Ph(this,d)}a.Oj.push(this);a.Qf[this.type]||(a.Qf[this.type]=[]);a.Qf[this.type].push(this);"function"==typeof this.ua&&this.ua();this.hC=this.If;if(h.i.isEnabled()){(a=h.i.Fb())||h.i.X(!0);try{h.i.Ha(new h.i.tm(this))}finally{a||h.i.X(!1)}}if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=typeof a)throw Error("onchange must be a function.");this.Al&&
eb(this.C,this.Al);if(this.onchange=a)this.Al=a.bind(this),K(this.C,this.Al)}};b=h.sm.prototype;b.data=null;b.jg="#000000";b.Eu=null;b.Fu=null;
b.J=function(a){if(this.C){this.Al&&eb(this.C,this.Al);h.Se&&h.navigation.xw(this);A(this,a);h.i.isEnabled()&&h.i.Ha(new h.i.by(this));h.i.disable();try{if(this.C){bb(this.C,this);var c=this.C;c.Qf[this.type].splice(c.Qf[this.type].indexOf(this),1);c.Qf[this.type].length||delete c.Qf[this.type];delete this.C.Lp[this.id];this.C=null}h.selected==this&&(h.selected=null);for(var d=this.xf.length-1;0<=d;d--)this.xf[d].J(!1);d=0;for(var e;e=this.P[d];d++)e.J();this.P.length=0;var f=this.Hd(!0);d=0;for(var g;g=
f[d];d++)g.J()}finally{h.i.enable()}}};b.Fh=function(){for(var a=0,c;c=this.P[a];a++)for(var d=0,e;e=c.La[d];d++)e.Fh&&e.Fh()};
function A(a,c){if(a.M){var d=null;a.M.isConnected()&&(d=a.M.ga,a.M.disconnect());if(d&&c){a:{c=null;for(var e=0;e<a.P.length;e++){var f=a.P[e].connection;if(f&&f.type==h.Sa&&f.ga){if(c){a=null;break a}c=f}}a=c}a&&a.isConnected()&&!z(a).Qa&&(a=a.ga,a.disconnect(),Ga(a,d)?d.connect(a):a.Wn(d))}}else a.U&&(d=null,a.U.isConnected()&&(d=a.U.ga,a.U.disconnect()),e=u(a),c&&e&&!e.Qa&&(a=a.V.ga,a.disconnect(),d&&Ga(d,a)&&d.connect(a)))}
b.Hd=function(){var a=[];this.M&&a.push(this.M);this.U&&a.push(this.U);this.V&&a.push(this.V);for(var c=0,d;d=this.P[c];c++)d.connection&&a.push(d.connection);return a};b.Ob=function(){console.warn("Not expected to reach Block.bumpNeighbours function. BlockSvg.bumpNeighbours was expected to be called instead.")};b.getParent=function(){return this.Ue};function Eb(a){do{var c=a;a=a.getParent();if(!a)return null}while(u(a)==c);return a}function u(a){return a.V&&z(a.V)}
function H(a){var c=a;do a=c,c=a.Ue;while(c);return a}function pa(a,c){if(!c)return a.xf;c=[];for(var d=0,e;e=a.P[d];d++)e.connection&&(e=z(e.connection))&&c.push(e);(a=u(a))&&c.push(a);return c}b.Hj=function(a){if(a!=this.Ue){if(this.Ue){h.g.Xm(this.Ue.xf,this);if(this.U&&this.U.isConnected())throw Error("Still connected to previous block.");if(this.M&&this.M.isConnected())throw Error("Still connected to parent block.");this.Ue=null}else bb(this.C,this);(this.Ue=a)?a.xf.push(this):this.C.Oj.push(this)}};
function p(a,c){var d=[a];a=pa(a,c);for(var e,f=0;e=a[f];f++)d.push.apply(d,p(e,c));return d}b.md=function(){return this.Mk&&!this.Qa&&!(this.C&&this.C.options.readOnly)};b.Rc=function(){return this.ww&&!this.Qa&&!(this.C&&this.C.options.readOnly)};b.io=function(a){this.ww=a};b.os=function(a){this.Qa=a};b.xg=function(){return this.il};b.hx=function(a){this.il=a};b.Jc=function(){return this.fv&&!(this.C&&this.C.options.readOnly)};
b.ls=function(a){this.fv=a;a=0;for(var c;c=this.P[a];a++)for(var d=0,e;e=c.La[d];d++)e.oi()};b.Od=function(a){this.ue=a};function Fb(a){var c=a.Eu;return c?c:h.g.Db.Kp("#fff",a.jg,.6)}function Gb(a){var c=a.Fu;if(c)return{dn:c,Vp:null,Du:null};a=a.jg;return{dn:null,Vp:h.g.Db.Kp("#fff",a,.3),Du:h.g.Db.Kp("#000",a,.2)}}
b.od=function(a){var c="string"==typeof a?h.g.te(a):a,d=Number(c);if(!isNaN(d)&&0<=d&&360>=d)this.jg=h.cC(d);else if(d=h.g.Db.parse(c))this.jg=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);};function ha(a,c){for(var d=0,e;e=a.P[d];d++)for(var f=0,g;g=e.La[f];f++)if(g.name==c)return g;return null}function qa(a){for(var c=[],d=0,e;e=a.P[d];d++)for(var f=0,g;g=e.La[f];f++)g.eo()&&(g=a.C.Cf(g.getValue()))&&c.push(g);return c}
function F(a,c){return(a=ha(a,c))?a.getValue():null}b.Pl=function(a,c){if(a){void 0===c&&(c=null);if(!this.U){if(this.M)throw Error("Remove output connection prior to adding previous connection.");this.U=this.ql(h.Xd)}this.U.Mc(c)}else if(this.U){if(this.U.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.U.J();this.U=null}};
b.jo=function(a,c){if(a)void 0===c&&(c=null),this.V||(this.V=this.ql(h.Ga)),this.V.Mc(c);else if(this.V){if(this.V.isConnected())throw Error("Must disconnect next statement before removing connection.");this.V.J();this.V=null}};
b.Ol=function(a,c){if(a){void 0===c&&(c=null);if(!this.M){if(this.U)throw Error("Remove previous connection prior to adding output connection.");this.M=this.ql(h.Vd)}this.M.Mc(c)}else if(this.M){if(this.M.isConnected())throw Error("Must disconnect output value before removing connection.");this.M.J();this.M=null}};b.Ng=function(a){this.If!=a&&(h.i.Ha(new h.i.Rf(this,"inline",null,this.If,a)),this.If=a)};
function Ja(a){if(void 0!=a.If)return a.If;for(var c=1;c<a.P.length;c++)if(a.P[c-1].type==h.Qd&&a.P[c].type==h.Qd)return!1;for(c=1;c<a.P.length;c++)if(a.P[c-1].type==h.Sa&&a.P[c].type==h.Qd)return!0;return!1}b.isEnabled=function(){return!this.disabled};b.Ze=function(a){this.isEnabled()!=a&&(h.i.Ha(new h.i.Rf(this,"disabled",null,this.disabled,!a)),this.disabled=!a)};function Hb(a){for(a=Eb(a);a;){if(a.disabled)return!0;a=Eb(a)}return!1}b.isCollapsed=function(){return this.yf};
b.Mg=function(a){this.yf!=a&&(h.i.Ha(new h.i.Rf(this,"collapsed",null,this.yf,a)),this.yf=a)};b.toString=function(a,c){var d=[],e=c||"?";if(this.yf)d.push(B(this,"_TEMP_COLLAPSED_INPUT").La[0].kd());else for(var f=0,g;g=this.P[f];f++){for(var k=0,l;l=g.La[k];k++)d.push(l.kd());g.connection&&((g=z(g.connection))?d.push(g.toString(void 0,c)):d.push(e))}d=d.join(" ").trim()||"???";a&&d.length>a&&(d=d.substring(0,a-3)+"...");return d};function Ib(a,c){return a.ae(h.Sa,c)}
function Jb(a,c){var d=c.type?'Block "'+c.type+'": ':"";if(c.output&&c.previousStatement)throw Error(d+"Must not have both an output and a previousStatement.");c.style&&c.style.Ef&&(a.Ef=c.style.Ef,c.style=null);if(c.style&&c.colour)throw Error(d+"Must not have both a colour and a style.");if(c.style){var e=c.style;try{var f=a.C.Oq().qA[e];if(f)a.Eu=f.colourSecondary,a.Fu=f.colourTertiary,a.Ef=f.Ef,a.od(f.colourPrimary);else throw Error("Invalid style name: "+e);}catch(y){console.warn(d+"Style does not exist: ",
e)}}else if("colour"in c)if(void 0===c.colour)console.warn(d+"Undefined colour value.");else{e=c.colour;try{a.od(e)}catch(y){console.warn(d+"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){f=a;for(var g=c["args"+e]||[],k=c["lastDummyAlign"+e],l=h.g.ND(c["message"+e]),m=[],n=0,r=[],q=0;q<l.length;q++){var t=l[q];if("number"==typeof t){if(0>=t||t>g.length)throw Error('Block "'+f.type+'": Message index %'+t+" out of range.");if(m[t])throw Error('Block "'+f.type+'": Message index %'+t+" duplicated.");
m[t]=!0;n++;r.push(g[t-1])}else(t=t.trim())&&r.push(t)}if(n!=g.length)throw Error('Block "'+f.type+'": Message does not reference all '+g.length+" arg(s).");r.length&&("string"==typeof r[r.length-1]||h.g.Oa.startsWith(r[r.length-1].type,"field_"))&&(q={type:"input_dummy"},k&&(q.align=k),r.push(q));k={LEFT:h.Co,RIGHT:h.Ks,CENTRE:h.Js};g=[];for(q=0;q<r.length;q++)if(m=r[q],"string"==typeof m)g.push([m,void 0]);else{l=n=null;do if(t=!1,"string"==typeof m)n=new h.vd(m);else switch(m.type){case "input_value":l=
Ib(f,m.name);break;case "input_statement":l=f.ae(h.Ga,m.name);break;case "input_dummy":l=f.ae(h.Qd,m.name||"");break;default:n=h.tc.qa(m),!n&&m.alt&&(m=m.alt,t=!0)}while(t);if(n)g.push([n,m.name]);else if(l){m.check&&l.Mc(m.check);m.align&&(n=l,n.align=k[m.align],n.A.ea&&n.A.ya());for(m=0;m<g.length;m++)L(l,g[m][0],g[m][1]);g.length=0}}e++}void 0!==c.inputsInline&&a.Ng(c.inputsInline);void 0!==c.output&&a.Ol(!0,c.output);void 0!==c.previousStatement&&a.Pl(!0,c.previousStatement);void 0!==c.nextStatement&&
a.jo(!0,c.nextStatement);void 0!==c.tooltip&&(e=c.tooltip,e=h.g.te(e),a.Od(e));void 0!==c.enableContextMenu&&(e=c.enableContextMenu,a.contextMenu=!!e);void 0!==c.helpUrl&&(e=c.helpUrl,e=h.g.te(e),a.Ff=e);"string"==typeof c.extensions&&(console.warn(d+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+c.type+"' block."),c.extensions=[c.extensions]);void 0!==c.mutator&&h.ba.apply(c.mutator,a,!0);if(Array.isArray(c.extensions))for(c=c.extensions,d=0;d<c.length;++d)h.ba.apply(c[d],
a,!1)}b.Ph=function(a,c){if(void 0!==c&&"boolean"!=typeof c)throw Error("opt_disableCheck must be a boolean if provided");if(!c){c=[];for(var d in a)void 0!==this[d]&&c.push(d);if(c.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(c));}h.g.object.Ph(this,a)};b.ae=function(a,c){var d=null;if(a==h.Sa||a==h.Ga)d=this.ql(a);a=new h.tt(a,c,this,d);this.P.push(a);return a};
b.Zh=function(a,c){for(var d=0,e;e=this.P[d];d++)if(e.name==a){e.J();this.P.splice(d,1);return}if(!c)throw Error("Input not found: "+a);};function B(a,c){for(var d=0,e;e=a.P[d];d++)if(e.name==c)return e;return null}function Kb(a,c){return(a=B(a,c))&&a.connection&&z(a.connection)}b.Gj=function(a){this.fe.text!=a&&(h.i.Ha(new h.i.Rf(this,"comment",null,this.fe.text,a)),this.zk=this.fe.text=a)};b.Ql=function(){};b.kx=function(){};b.Ia=function(){return this.Lx};
b.moveBy=function(a,c){if(this.Ue)throw Error("Block has parent.");var d=new h.i.Tj(this);this.Lx.translate(a,c);d.Yh();h.i.Ha(d)};b.ql=function(a){return new h.na(this,a)};h.j={};h.j.HF=function(){};h.j.dh=function(a){this.ji=a;this.Jj=h.g.m.L("path",{"class":"blocklyPath"},this.ji);this.am=h.g.m.L("path",{"class":"blocklyPathLight"},this.ji);this.Zl=h.g.m.L("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.ji)};h.j.dh.prototype.ns=function(a){this.Jj.setAttribute("d",a);this.am.style.display="none";this.Zl.style.display="none"};h.j.dh.prototype.Aq=function(){this.Jj.setAttribute("transform","scale(-1 1)")};h.g.Da={};h.g.Da.Ux="aria-";h.g.Da.op="role";
h.g.Da.qp={dE:"alert",eE:"alertdialog",gE:"application",hE:"article",nE:"banner",qE:"button",sE:"checkbox",xE:"columnheader",yE:"combobox",AE:"complementary",BE:"contentinfo",HE:"definition",JE:"dialog",KE:"directory",ME:"document",qF:"form",uF:"grid",vF:"gridcell",wF:"group",AF:"heading",EF:"img",PF:"link",QF:"list",RF:"listbox",SF:"listitem",UF:"log",$F:"main",aG:"marquee",bG:"math",nz:"menu",dG:"menubar",oz:"menuitem",pz:"menuitemcheckbox",eG:"menuitemradio",iG:"navigation",lG:"note",GG:"option",
jH:"presentation",mH:"progressbar",pH:"radio",qH:"radiogroup",sH:"region",pp:"row",xH:"rowgroup",yH:"rowheader",AH:"scrollbar",CH:"search",EH:"separator",KH:"slider",NH:"spinbutton",OH:"status",Wt:"tab",PH:"table",QH:"tablist",RH:"tabpanel",SH:"textbox",TH:"textinfo",WH:"timer",XH:"toolbar",YH:"tooltip",ZH:"tree",$H:"treegrid",aI:"treeitem"};
h.g.Da.State={Rx:"activedescendant",iE:"atomic",kE:"autocomplete",pE:"busy",tE:"checked",wE:"colindex",DE:"controls",IE:"describedby",LE:"disabled",RE:"dropeffect",WE:"expanded",pF:"flowto",tF:"grabbed",yF:"haspopup",BF:"hidden",GF:"invalid",KF:"label",LF:"labelledby",OF:"level",TF:"live",fG:"multiline",gG:"multiselectable",$G:"orientation",aH:"owns",iH:"posinset",kH:"pressed",rH:"readonly",tH:"relevant",vH:"required",zH:"rowindex",sp:"selected",FH:"setsize",LH:"sort",Sz:"valuemax",Tz:"valuemin",
dI:"valuenow",eI:"valuetext"};h.g.Da.Ij=function(a,c){c?a.setAttribute(h.g.Da.op,c):h.g.Da.lD(a)};h.g.Da.JI=function(a){return a.getAttribute(h.g.Da.op)||null};h.g.Da.lD=function(a){a.removeAttribute(h.g.Da.op)};h.g.Da.$e=function(a,c,d){Array.isArray(d)&&(d=d.join(" "));a.setAttribute(h.g.Da.xB(c),d)};h.g.Da.xB=function(a){return h.g.Da.Ux+a};h.$g=function(){h.Ac.call(this);this.Gf=-1};h.g.object.S(h.$g,h.Ac);b=h.$g.prototype;b.Ja=function(){var a=document.createElement("div");a.id=this.Pa();this.ka=a;a.className="goog-menu goog-menu-vertical blocklyNonSelectable";a.tabIndex=0;h.g.Da.Ij(a,this.gs||h.g.Da.qp.nz)};b.focus=function(){var a=this.ka;a&&(a.focus(),h.g.m.Bb(a,"focused"))};b.blur=function(){var a=this.ka;a&&(a.blur(),h.g.m.Lc(a,"focused"))};b.Ij=function(a){this.gs=a};
b.qn=function(){h.$g.w.qn.call(this);ca(this,function(a){if(a.Kd){var c=a.ka;c=c.id||(c.id=a.Pa());this.Xi||(this.Xi={});this.Xi[c]=a}},this);Lb(this)};b.rn=function(){Mb(this,-1);h.$g.w.rn.call(this)};b.kq=function(){h.$g.w.kq.call(this);h.Za(this.BC);h.Za(this.FA);h.Za(this.yC);h.Za(this.zC);h.Za(this.Kr)};
function Lb(a){var c=a.ka;a.BC=h.pa(c,"mouseover",a,a.VB,!0);a.FA=h.pa(c,"click",a,a.QB,!0);a.yC=h.pa(c,"mouseenter",a,a.TB,!0);a.zC=h.pa(c,"mouseleave",a,a.UB,!0);a.Kr=h.pa(c,"keydown",a,a.Sq)}b.Xi=null;function Nb(a,c){if(a.Xi)for(var d=a.ka;c&&c!==d;){var e=c.id;if(e in a.Xi)return a.Xi[e];c=c.parentNode}return null}function Ob(a){(a=a.Qb[a.Gf]||null)&&a.Of(!1)}function Mb(a,c){var d=a.Qb[c]||null;d?(d.Of(!0),a.Gf=c):-1<a.Gf&&((a.Qb[a.Gf]||null).Of(!1),a.Gf=-1);d&&h.g.style.ax(d.ka,a.ka)}
b.Of=function(a){Mb(this,this.Qb.indexOf(a))};function Pb(a){Ob(a);Qb(a,function(c,d){return(c+1)%d},a.Gf)}function Rb(a){Ob(a);Qb(a,function(c,d){c--;return 0>c?d-1:c},a.Gf)}function Qb(a,c,d){var e=a.Qb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var g=a.Qb[d]||null;if(g&&g.isEnabled()){Mb(a,d);break}f++;d=c.call(a,d,e)}}b.VB=function(a){(a=Nb(this,a.target))&&a.isEnabled()&&(this.Qb[this.Gf]||null)!==a&&(Ob(this),this.Of(a))};
b.QB=function(a){var c=Nb(this,a.target),d;if(d=c)c.isEnabled()&&(c.Of(!0),Sb(c)),d=void 0;d&&a.preventDefault()};b.TB=function(){this.focus()};b.UB=function(){this.ka&&(this.blur(),Ob(this),Mb(this,-1))};b.Sq=function(a){return 0!=this.Qb.length&&Tb(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};
function Tb(a,c){var d=a.Qb[a.Gf]||null;if(d&&"function"==typeof d.Sq&&d.Sq(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case h.g.Ta.Mo:d&&Sb(d);break;case h.g.Ta.au:Rb(a);break;case h.g.Ta.ft:Pb(a);break;default:return!1}return!0};h.Jm=function(a,c){h.Ac.call(this);this.mg=a;this.setValue(c);this.pn=!0};h.g.object.S(h.Jm,h.Ac);b=h.Jm.prototype;
b.Ja=function(){var a=document.createElement("div");a.id=this.Pa();this.ka=a;a.className="goog-menuitem goog-option "+(this.pn?"":"goog-menuitem-disabled ")+(this.Sp?"goog-option-selected ":"")+(this.ew()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.vk){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Ub(this));h.g.Da.Ij(a,this.gs||(this.vk?h.g.Da.qp.pz:
h.g.Da.qp.oz));h.g.Da.$e(a,h.g.Da.State.sp,this.vk&&this.Sp||!1)};function Ub(a){a=a.mg;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.Nc=a};b.getValue=function(){return this.Nc};b.Ij=function(a){this.gs=a};function Vb(a,c){if(a.vk){a.Sp=c;var d=a.ka;d&&a.isEnabled()&&(c?(h.g.m.Bb(d,"goog-option-selected"),h.g.Da.$e(d,h.g.Da.State.sp,!0)):(h.g.m.Lc(d,"goog-option-selected"),h.g.Da.$e(d,h.g.Da.State.sp,!1)))}}
b.Of=function(a){var c=this.ka;c&&this.isEnabled()&&(a?h.g.m.Bb(c,"goog-menuitem-highlight"):h.g.m.Lc(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.pn};b.Ze=function(a){this.pn=a;(a=this.ka)&&(this.pn?h.g.m.Lc(a,"goog-menuitem-disabled"):h.g.m.Bb(a,"goog-menuitem-disabled"))};function Sb(a){a.vk&&Vb(a,!a.Sp);a.nu&&a.nu.call(a.dA,a)}function Wb(a,c,d){a.nu=c;a.dA=d};h.g.uo={};h.g.uo.Bf=function(a){a=a.ka;var c=h.g.style.Bf(a);c.height=a.scrollHeight;return c};h.g.uo.fA=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};h.za={};h.za.jn=null;h.za.iv=null;h.za.show=function(a,c,d){h.T.show(h.za,d,null);if(c.length){var e=h.za.fD(c,d);h.za.Ve(e,a,d);setTimeout(function(){e.ka.focus()},1);h.za.jn=null}else h.za.ta()};h.za.fD=function(a,c){var d=new h.$g;ea(d,c);for(var e=0,f;f=a[e];e++){var g=new h.Jm(f.text);ea(g,c);da(d,g);g.Ze(f.enabled);f.enabled&&Wb(g,function(){h.za.ta();this.Pb()},f)}return d};
h.za.Ve=function(a,c,d){var e=h.g.PB();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};h.za.UA(a);var f=h.g.uo.Bf(a);d&&h.g.uo.fA(e,c,f);h.T.gD(e,c,f,d);a.ka.focus()};h.za.UA=function(a){a.ya(h.T.va);var c=a.ka;h.g.m.Bb(c,"blocklyContextMenu");h.pa(c,"contextmenu",null,h.g.LC);a.focus()};h.za.ta=function(){h.T.kj(h.za);h.za.jn=null;h.za.iv&&h.Za(h.za.iv)};
h.za.sI=function(a,c){return function(){h.i.disable();try{var d=h.N.dj(c,a.C),e=a.Ia();e.x=a.G?e.x-h.bd:e.x+h.bd;e.y+=2*h.bd;d.moveBy(e.x,e.y)}finally{h.i.enable()}h.i.isEnabled()&&!d.Qa&&h.i.Ha(new h.i.tm(d));d.select()}};h.za.nA=function(a){var c=p(a,!1).length,d=u(a);d&&(c-=p(d,!1).length);return{text:1==c?h.h.DELETE_BLOCK:h.h.DELETE_X_BLOCKS.replace("%1",String(c)),enabled:!0,Pb:function(){h.i.X(!0);a.J(!0,!0);h.i.X(!1)}}};
h.za.pA=function(a){return{enabled:!("function"==typeof a.Ff?!a.Ff():!a.Ff),text:h.h.HELP,Pb:function(){var c="function"==typeof a.Ff?a.Ff():a.Ff;c&&window.open(c)}}};h.za.oA=function(a){var c=db(a.C)?cb(a.C,h.g.Fq(a,!0)):!0;return{text:h.h.DUPLICATE_BLOCK,enabled:c,Pb:function(){h.ev(a)}}};h.za.mA=function(a){var c={enabled:!h.g.userAgent.Uf};a.zk?(c.text=h.h.REMOVE_COMMENT,c.Pb=function(){a.Gj(null)}):(c.text=h.h.ADD_COMMENT,c.Pb=function(){a.Gj("")});return c};
h.za.wI=function(a){return{text:h.h.uH,enabled:!0,Pb:function(){h.i.X(!0);a.J(!0,!0);h.i.X(!1)}}};h.za.xI=function(a){return{text:h.h.SE,enabled:!0,Pb:function(){h.ev(a)}}};
h.za.tJ=function(a,c){if(!h.Si)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!h.g.userAgent.Uf};d.text=h.h.cE;d.Pb=function(){var e=new h.Si(a,h.h.lI,h.Si.wy,h.Si.wy),f=aa(a).getBoundingClientRect();f=new h.g.I(c.clientX-f.left,c.clientY-f.top);var g=h.g.Tk(a.Xa);f=h.g.I.Ok(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ea&&(e.Re(),e.ya(),e.select())};return d};h.qf=function(a,c){h.qf.w.constructor.call(this,a,c);this.Le=a.C.hn[c];this.Qu=a.C.hn[h.Ji[c]];this.Th=new h.g.I(0,0);this.ug=!1;this.Xv=!this.Le};h.g.object.S(h.qf,h.na);b=h.qf.prototype;b.J=function(){h.qf.w.J.call(this);this.ug&&Xb(this.Le,this)};function Yb(a,c){var d=a.wb-c.wb;a=a.Na-c.Na;return Math.sqrt(d*d+a*a)}
function Zb(a,c){if(!a.A.C.gc()){var d=H(a.A);if(!d.Qc){var e=!1;if(!d.Rc()){d=H(c.A);if(!d.Rc())return;c=a;e=!0}var f=h.selected==d;f||d.Wm();var g=c.wb+h.bd+Math.floor(Math.random()*h.Go)-a.wb,k=c.Na+h.bd+Math.floor(Math.random()*h.Go)-a.Na;e&&(k=-k);d.G&&(g=c.wb-h.bd-Math.floor(Math.random()*h.Go)-a.wb);d.moveBy(g,k);f||d.Il()}}}b.moveTo=function(a,c){this.ug&&Xb(this.Le,this);this.wb=a;this.Na=c;this.Xv||$b(this.Le,this)};b.moveBy=function(a,c){this.moveTo(this.wb+a,this.Na+c)};
function ac(a,c){a.moveTo(c.x+a.Th.x,c.y+a.Th.y)}function M(a,c,d){a.Th.x=c;a.Th.y=d}function bc(a){var c=a.ga.wb-a.wb,d=a.ga.Na-a.Na;if(0!=c||0!=d){a=z(a);var e=a.aa();if(!e)throw Error("block is not rendered.");e=h.g.Id(e);a.aa().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Wa(a,-c,-d)}}
b.closest=function(a,c){var d=this.Qu;if(d.Eb.length){var e=this.Na,f=this.wb;this.wb=f+c.x;this.Na=e+c.y;var g=cc(d,this);c=null;for(var k=a,l,m=g-1;0<=m&&Math.abs(d.Eb[m].Na-this.Na)<=a;)l=d.Eb[m],this.Jn(l,k)&&(c=l,k=Yb(l,this)),m--;for(;g<d.Eb.length&&Math.abs(d.Eb[g].Na-this.Na)<=a;)l=d.Eb[g],this.Jn(l,k)&&(c=l,k=Yb(l,this)),g++;this.wb=f;this.Na=e;a={connection:c,co:k}}else a={connection:null,co:a};return a};
b.Dn=function(){var a=this.A.C.Mf.B;a=this.type==h.Sa||this.type==h.Vd?h.g.v.moveBy(0,-5)+h.g.v.W("v",5)+a.bh.Md+h.g.v.W("v",5):h.g.v.moveBy(-5,0)+h.g.v.W("h",5)+a.Ii.Hg+h.g.v.W("h",5);var c=this.A.Ia();h.na.Yv=h.g.m.L("path",{"class":"blocklyHighlightedConnectionPath",d:a,transform:"translate("+(this.wb-c.x)+","+(this.Na-c.y)+")"+(this.A.G?" scale(-1 1)":"")},this.A.aa())};
function Cb(a){Db(a,!1);var c=[];if(a.type!=h.Sa&&a.type!=h.Ga)return c;if(a=z(a)){if(a.isCollapsed()){var d=[];a.M&&d.push(a.M);a.V&&d.push(a.V);a.U&&d.push(a.U)}else d=a.Hd(!0);for(var e=0;e<d.length;e++)c.push.apply(c,Cb(d[e]));c.length||(c[0]=a)}return c}function Db(a,c){(a.Xv=c)&&a.ug?Xb(a.Le,a):c||a.ug||$b(a.Le,a)}b.Jn=function(a,c){return Yb(this,a)>c?!1:h.qf.w.Jn.call(this,a)};b.Wn=function(a){Zb(this,a)};b.hq=function(a,c){h.qf.w.hq.call(this,a,c);a.ea&&a.ya();c.ea&&(na(c),c.ya())};
b.ds=function(){var a=this.A,c=this.af;if(a.C&&c&&h.i.ic){h.qf.w.ds.call(this);c=z(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Re();c.ya(!1);a.ea&&a.ya()}};b.yw=function(a){return dc(this.Qu,this,a)};b.ge=function(a){h.qf.w.ge.call(this,a);var c=this.A;a=a.A;c.ea&&na(c);a.ea&&na(a);c.ea&&a.ea&&(this.type==h.Ga||this.type==h.Xd?a.ya():c.ya())};b.Dw=function(){this.isConnected()&&!Ga(this,this.ga)&&(A(E(this)?z(this):this.A),this.A.Ob())};h.g.Rect=function(a,c,d,e){this.top=a;this.bottom=c;this.left=d;this.right=e};h.g.Rect.prototype.contains=function(a,c){return a>=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};h.xd=function(a){this.R=a};b=h.xd.prototype;b.Cu=!0;b.Qm=17;b.Cd=null;b.Zk=null;function ec(a){a.Pc||(a.Pc=h.g.m.L("g",{"class":"blocklyIconGroup"},null),a.R.Qc&&h.g.m.Bb(a.Pc,"blocklyIconGroupReadonly"),a.dv(a.Pc),a.R.aa().appendChild(a.Pc),h.pa(a.Pc,"mouseup",a,a.Wq),a.oi())}b.J=function(){h.g.m.removeNode(this.Pc);this.Pc=null;this.yb(!1);this.R=null};b.oi=function(){};b.isVisible=function(){return!!this.Cd};b.Wq=function(a){this.R.C.gc()||this.R.Qc||h.g.wj(a)||this.yb(!this.isVisible())};
b.we=function(){this.isVisible()&&this.Cd.od(this.R.jg)};function Ra(a,c){a.Zk=c;a.isVisible()&&(a=a.Cd,a.Cb=c,a.Zr&&fb(a))}function fc(a){var c=a.R.Ia(),d=h.g.Id(a.Pc);c=new h.g.I(c.x+d.x+a.Qm/2,c.y+d.y+a.Qm/2);h.g.I.Ne(a.Zk,c)||Ra(a,c)};h.$d=function(a){h.$d.w.constructor.call(this,a);ec(this);this.Mj={}};h.g.object.S(h.$d,h.xd);h.$d.prototype.Cu=!1;h.$d.prototype.dv=function(a){h.g.m.L("path",{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},a);h.g.m.L("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);h.g.m.L("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)};
h.$d.LD=function(a){var c=h.g.m.L("text",{"class":"blocklyText blocklyBubbleText",y:h.oa.Yc},null);a=a.split("\n");for(var d=0;d<a.length;d++){var e=h.g.m.L("tspan",{dy:"1em",x:h.oa.Yc},c),f=document.createTextNode(a[d]);e.appendChild(f)}return c};
h.$d.prototype.yb=function(a){if(a!=this.isVisible())if(h.i.Ha(new h.i.dd(this.R,"warningOpen",!a,a)),a){this.Zn=h.$d.LD(this.kd());this.Cd=new h.oa(this.R.C,this.Zn,this.R.rd,this.Zk,null,null);ib(this.Cd,this.R.id);if(this.R.G){a=this.Zn.getBBox().width;for(var c=0,d;d=this.Zn.childNodes[c];c++)d.setAttribute("text-anchor","end"),d.setAttribute("x",a+h.oa.Yc)}this.we()}else this.Cd.J(),this.Zn=this.Cd=null};
h.$d.prototype.lo=function(a,c){this.Mj[c]!=a&&(a?this.Mj[c]=a:delete this.Mj[c],this.isVisible()&&(this.yb(!1),this.yb(!0)))};h.$d.prototype.kd=function(){var a=[],c;for(c in this.Mj)a.push(this.Mj[c]);return a.join("\n")};h.$d.prototype.J=function(){this.R.lc=null;h.xd.prototype.J.call(this)};h.ra=function(a,c,d){this.K=h.g.m.L("g",{},null);this.K.dm="";this.Xh=a.Mf.pw(this.K);this.$l=this.Xh.Zl||null;this.rd=this.Xh.Jj||null;this.ii=this.Xh.am||null;this.rd.ue=this;this.ea=!1;this.km=h.g.Gh()&&!!a.fd;h.H.Vi(this.rd);h.ra.w.constructor.call(this,a,c,d);this.K.dataset&&(this.K.dataset.id=this.id);this.ec=null};h.g.object.S(h.ra,h.sm);h.ra.prototype.height=0;h.ra.prototype.width=0;h.ra.prototype.Wc=null;h.ra.FF=-1;h.ra.Ho="TEMP_COLLAPSED_WARNING_";h.ra.Ez=10;h.ra.$o=25;h.ra.eg=8;
h.ra.rf=!1;b=h.ra.prototype;b.Re=function(){if(!this.C.ea)throw TypeError("Workspace is headless.");for(var a=0,c;c=this.P[a];a++)c.ua();c=Pa(this);for(a=0;a<c.length;a++)ec(c[a]);this.we();gc(this);this.C.options.readOnly||this.nB||h.pa(this.aa(),"mousedown",this,this.Eg);this.nB=!0;this.aa().parentNode||this.C.Xa.appendChild(this.aa())};
b.select=function(){if(this.Qa&&this.getParent())this.getParent().select();else if(h.selected!=this){var a=null;if(h.selected){a=h.selected.id;h.i.disable();try{mb(h.selected)}finally{h.i.enable()}}a=new h.i.dd(null,"selected",a,this.id);a.ac=this.C.id;h.i.Ha(a);h.selected=this;this.Wm()}};function mb(a){if(h.selected==a){var c=new h.i.dd(null,"selected",a.id,null);c.ac=a.C.id;h.i.Ha(c);h.selected=null;a.Il()}}b.se=null;b.zk=null;b.He=null;b.lc=null;
function Pa(a){var c=[];a.se&&c.push(a.se);a.He&&c.push(a.He);a.lc&&c.push(a.lc);return c}b.Hj=function(a){var c=this.Ue;if(a!=c){h.g.m.Vl();h.ra.w.Hj.call(this,a);h.g.m.Wl();var d=this.aa();if(!this.C.cr&&d){var e=this.Ia();a?(a.aa().appendChild(d),a=this.Ia(),Wa(this,a.x-e.x,a.y-e.y)):c&&(this.C.Xa.appendChild(d),this.translate(e.x,e.y))}}};
b.Ia=function(){var a=0,c=0,d=this.km?this.C.fd.Fb():null,e=this.aa();if(e){do{var f=h.g.Id(e);a+=f.x;c+=f.y;this.km&&this.C.fd.je.firstChild==e&&(f=this.C.fd.Lq(),a+=f.x,c+=f.y);e=e.parentNode}while(e&&e!=this.C.Xa&&e!=d)}return new h.g.I(a,c)};b.moveBy=function(a,c){if(this.Ue)throw Error("Block has parent.");var d=h.i.isEnabled();if(d)var e=new h.i.Tj(this);var f=this.Ia();this.translate(f.x+a,f.y+c);Wa(this,a,c);d&&(e.Yh(),h.i.Ha(e));oa(this.C)};
b.translate=function(a,c){this.aa().setAttribute("transform","translate("+a+","+c+")")};b.Br=function(){if(this.km){var a=this.Ia();this.aa().removeAttribute("transform");this.C.fd.mi(a.x,a.y);ba(this.C.fd,this.aa())}};b.moveTo=function(a){var c=this.Ia();this.moveBy(a.x-c.x,a.y-c.y)};b.Ar=function(a){this.km?this.C.fd.mi(a.x,a.y):(this.K.dm="translate("+a.x+","+a.y+")",this.K.setAttribute("transform",this.K.dm+this.K.Ul))};
function hc(a){if(a.C&&!a.C.gc()&&!a.getParent()&&!a.Qc){var c=a.C.Jd;if(c&&c.BD){var d=c.ss,e=d/2,f=a.Ia();c=Math.round((f.x-e)/d)*d+e-f.x;d=Math.round((f.y-e)/d)*d+e-f.y;c=Math.round(c);d=Math.round(d);0==c&&0==d||a.moveBy(c,d)}}}function ic(a){var c=a.Ia(),d=a.M?h.ra.eg:0,e=G(a),f=c.y,g=c.y+e.height;a.G?(a=c.x-(e.width-d),c=c.x+d):(a=c.x-d,c=c.x+e.width-d);return new h.g.Rect(f,g,a,c)}b.rl=function(){for(var a=0,c;c=this.P[a];a++)c.rl()};
b.Mg=function(a){if(this.yf!=a){for(var c=[],d=0,e;e=this.P[d];d++)c.push.apply(c,e.yb(!a));if(a){e=Pa(this);for(d=0;d<e.length;d++)e[d].yb(!1);d=this.toString(h.jy);L(this.ae(h.Qd,"_TEMP_COLLAPSED_INPUT"),d).ua();e=p(this,!0);if(d=u(this))d=e.indexOf(d),e.splice(d,e.length-d);d=1;for(var f;f=e[d];d++)if(f.lc){this.Ql(h.h.COLLAPSED_WARNINGS_WARNING,h.ra.Ho);break}}else this.Zh("_TEMP_COLLAPSED_INPUT"),this.lc&&(this.lc.lo("",h.ra.Ho),Object.keys(this.lc.Mj).length||this.Ql(null));h.ra.w.Mg.call(this,
a);c.length||(c[0]=this);if(this.ea)for(d=0;f=c[d];d++)f.ya()}};function jc(a,c,d){for(var e=[],f=0,g;g=a.P[f];f++){for(var k=0,l;l=g.La[k];k++)l.fw()&&l.isVisible()&&e.push(l);g.connection&&(g=z(g.connection))&&e.push(g)}c=e.indexOf(c);-1==c&&(c=d?-1:e.length);(e=e[d?c+1:c-1])?e instanceof h.Fa?e.Pg():jc(e,null,d):(e=a.getParent())&&jc(e,a,d)}
b.Eg=function(a){var c=this.C&&this.C.rg(a);if(c){if(c.Ch)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");vb(c,this);c.re=a}};
function kc(a){if(a.C.options.readOnly||!a.contextMenu)return null;var c=[];if(!a.Qc){a.md()&&a.Rc()&&c.push(h.za.oA(a));a.C.options.IA&&!a.yf&&a.Jc()&&c.push(h.za.mA(a));if(a.Rc())if(a.yf)a.C.options.collapse&&(d={enabled:!0},d.text=h.h.EXPAND_BLOCK,d.Pb=function(){a.Mg(!1)},c.push(d));else{for(var d=1;d<a.P.length;d++)if(a.P[d-1].type!=h.Ga&&a.P[d].type!=h.Ga){d={enabled:!0};var e=Ja(a);d.text=e?h.h.EXTERNAL_INPUTS:h.h.INLINE_INPUTS;d.Pb=function(){a.Ng(!e)};c.push(d);break}a.C.options.collapse&&
(d={enabled:!0},d.text=h.h.COLLAPSE_BLOCK,d.Pb=function(){a.Mg(!0)},c.push(d))}a.C.options.disable&&a.Jc()&&(d={text:a.isEnabled()?h.h.DISABLE_BLOCK:h.h.ENABLE_BLOCK,enabled:!Hb(a),Pb:function(){var f=h.i.Fb();f||h.i.X(!0);a.Ze(!a.isEnabled());f||h.i.X(!1)}},c.push(d));a.md()&&c.push(h.za.nA(a))}c.push(h.za.pA(a));a.VA&&a.VA(c);return c}b.Rl=function(a){var c=kc(this);c&&c.length&&(h.za.show(a,c,this.G),h.za.jn=this)};
function Wa(a,c,d){if(a.ea){for(var e=a.Hd(!1),f=0;f<e.length;f++)e[f].moveBy(c,d);e=Pa(a);for(f=0;f<e.length;f++)fc(e[f]);for(f=0;f<a.xf.length;f++)Wa(a.xf[f],c,d)}}b.ci=function(a){if(a){var c=this.aa();c.dm="";c.Ul="";h.Pk=h.Pk.concat(this.Hd(!0));h.g.m.Bb(this.K,"blocklyDragging")}else h.Pk=[],h.g.m.Lc(this.K,"blocklyDragging");for(c=0;c<this.xf.length;c++)this.xf[c].ci(a)};function gc(a){a.Rc()?h.g.m.Bb(a.K,"blocklyDraggable"):h.g.m.Lc(a.K,"blocklyDraggable")}
b.io=function(a){h.ra.w.io.call(this,a);gc(this)};b.ls=function(a){h.ra.w.ls.call(this,a);a=Pa(this);for(var c=0;c<a.length;c++)a[c].oi()};b.os=function(a){h.ra.w.os.call(this,a);this.we()};b.hx=function(a){this.il!=a&&(this.il=a)&&(this.od(h.Uy),h.g.m.Bb(this.K,"blocklyInsertionMarker"))};b.aa=function(){return this.K};
b.J=function(a,c){if(this.C){h.H.ta();h.g.m.Vl();var d=this.C;if(h.selected==this){mb(this);var e=this.C;e.Rb&&e.Rb.cancel()}h.za.jn==this&&h.za.ta();h.Se&&h.navigation.xw(this);c&&this.ea&&(A(this,a),h.Va.fB(this));this.ea=!1;if(this.Wc){for(var f in this.Wc)clearTimeout(this.Wc[f]);this.Wc=null}c=Pa(this);for(e=0;e<c.length;e++)c[e].J();h.ra.w.J.call(this,a);h.g.m.removeNode(this.K);oa(d);this.$l=this.ii=this.rd=this.K=null;h.g.m.Wl()}};
b.we=function(){if(this.isEnabled()){if(this.Qa){var a=Fb(this);this.ii.style.display="none";this.$l.setAttribute("fill",a);this.rd.setAttribute("stroke","none");this.rd.setAttribute("fill",a)}else a=Gb(this),a.dn?(this.ii.style.display="none",this.$l.style.display="none",this.rd.setAttribute("stroke",a.dn)):(this.ii.style.display="",this.$l.style.display="",this.rd.setAttribute("stroke","none"),this.ii.setAttribute("stroke",a.Vp),this.$l.setAttribute("fill",a.Du)),this.rd.setAttribute("fill",this.jg);
a=Pa(this);for(var c=0;c<a.length;c++)a[c].we();for(a=0;c=this.P[a];a++)for(var d=0,e;e=c.La[d];d++)e.we()}};function na(a){!a.isEnabled()||Hb(a)?h.g.m.Bb(a.K,"blocklyDisabled")&&a.rd.setAttribute("fill","url(#"+a.C.options.uh+")"):h.g.m.Lc(a.K,"blocklyDisabled")&&a.we();a=pa(a,!1);for(var c=0,d;d=a[c];c++)na(d)}b.DB=function(){return this.He};
b.Gj=function(a){if(!h.Comment)throw Error("Missing require for Blockly.Comment");this.fe.text!=a&&(h.ra.w.Gj.call(this,a),a=null!=a,!!this.He==a?this.He.sJ():(a?this.zk=this.He=new h.Comment(this):(this.He.J(),this.zk=this.He=null),this.ea&&(this.ya(),this.Ob())))};
b.Ql=function(a,c){this.Wc||(this.Wc=Object.create(null));var d=c||"";if(d)this.Wc[d]&&(clearTimeout(this.Wc[d]),delete this.Wc[d]);else for(var e in this.Wc)clearTimeout(this.Wc[e]),delete this.Wc[e];if(this.C.gc()){var f=this;this.Wc[d]=setTimeout(function(){f.C&&(delete f.Wc[d],f.Ql(a,d))},100)}else{this.Qc&&(a=null);c=Eb(this);for(e=null;c;)c.isCollapsed()&&(e=c),c=Eb(c);e&&e.Ql(h.h.COLLAPSED_WARNINGS_WARNING,h.ra.Ho);c=!1;"string"==typeof a?(this.lc||(this.lc=new h.$d(this),c=!0),this.lc.lo(a,
d)):this.lc&&!d?(this.lc.J(),c=!0):this.lc&&(c=this.lc.kd(),this.lc.lo("",d),(e=this.lc.kd())||this.lc.J(),c=c!=e);c&&this.ea&&(this.ya(),this.Ob())}};b.kx=function(a){this.se&&this.se!==a&&this.se.J();a&&(a.R=this,this.se=a,ec(a))};b.Ze=function(a){this.isEnabled()!=a&&(h.ra.w.Ze.call(this,a),this.ea&&na(this))};b.Of=function(a){this.ea&&(a?(this.rd.setAttribute("filter","url(#"+this.C.options.gv+")"),this.ii.style.display="none"):(this.rd.setAttribute("filter","none"),this.ii.style.display="inline"))};
b.Wm=function(){h.g.m.Bb(this.K,"blocklySelected")};b.Il=function(){h.g.m.Lc(this.K,"blocklySelected")};function Ta(a,c){c?h.g.m.Bb(a.K,"blocklyDraggingDelete"):h.g.m.Lc(a.K,"blocklyDraggingDelete")}b.od=function(a){h.ra.w.od.call(this,a);this.ea&&this.we()};function Xa(a){do{var c=a.aa();c.parentNode.appendChild(c);a=a.getParent()}while(a)}b.Pl=function(a,c){h.ra.w.Pl.call(this,a,c);this.ea&&(this.ya(),this.Ob())};b.jo=function(a,c){h.ra.w.jo.call(this,a,c);this.ea&&(this.ya(),this.Ob())};
b.Ol=function(a,c){h.ra.w.Ol.call(this,a,c);this.ea&&(this.ya(),this.Ob())};b.Ng=function(a){h.ra.w.Ng.call(this,a);this.ea&&(this.ya(),this.Ob())};b.Zh=function(a,c){h.ra.w.Zh.call(this,a,c);this.ea&&(this.ya(),this.Ob())};b.ae=function(a,c){a=h.ra.w.ae.call(this,a,c);this.ea&&(this.ya(),this.Ob());return a};function ma(a,c){if(!c&&a.isCollapsed()){if(a.M&&Db(a.M,c),a.U&&Db(a.U,c),a.V){Db(a.V,c);var d=z(a.V);d&&ma(d,c)}}else{a=a.Hd(!0);for(var e=0;d=a[e];e++)Db(d,c),E(d)&&(d=z(d))&&ma(d,c)}}
b.Hd=function(a){var c=[];if(a||this.ea)if(this.M&&c.push(this.M),this.U&&c.push(this.U),this.V&&c.push(this.V),a||!this.yf){a=0;for(var d;d=this.P[a];a++)d.connection&&c.push(d.connection)}return c};b.ql=function(a){return new h.qf(this,a)};b.Ob=function(){if(this.C&&!this.C.gc()){var a=H(this);if(!a.Qc)for(var c=this.Hd(!1),d=0,e;e=c[d];d++){e.isConnected()&&E(e)&&z(e).Ob();for(var f=e.yw(h.bd),g=0,k;k=f[g];g++)e.isConnected()&&k.isConnected()||H(k.A)!=a&&(E(e)?Zb(k,e):Zb(e,k))}}};
function Ya(a){var c=h.i.Fb();setTimeout(function(){h.i.X(c);hc(a);h.i.X(!1)},h.rm/2);setTimeout(function(){h.i.X(c);a.Ob();h.i.X(!1)},h.rm)}b.ya=function(a){h.g.m.Vl();this.ea=!0;this.C.Mf.ya(this);var c=this.Ia();this.U&&ac(this.U,c);this.M&&ac(this.M,c);for(var d=0;d<this.P.length;d++){var e=this.P[d].connection;e&&(ac(e,c),e.isConnected()&&bc(e))}this.V&&(ac(this.V,c),this.V.isConnected()&&bc(this.V));!1!==a&&((a=this.getParent())?a.ya(!0):oa(this.C));h.g.m.Wl()};
b.Ml=function(a){a?(this.K.appendChild(a),this.ec=a):this.ec=null};b.Nl=function(a){a&&(this.ec?this.K.insertBefore(a,this.ec):this.K.appendChild(a))};function G(a){var c=a.height,d=a.width;if(a=u(a))a=G(a),c+=a.height-4,d=Math.max(d,a.width);return{height:c,width:d}}function Oa(a,c){c?h.g.m.Bb(a.K,"blocklyReplaceable"):h.g.m.Lc(a.K,"blocklyReplaceable")};h.j.Ej={};h.j.jm=!1;h.j.register=function(a,c){if(h.j.Ej[a])throw Error("Renderer has already been registered.");h.j.Ej[a]=c};h.j.unregister=function(a){h.j.Ej[a]?delete h.j.Ej[a]:console.warn('No renderer mapping for name "'+a+'" found to unregister')};h.j.nJ=function(){h.j.jm=!0};h.j.oJ=function(){h.j.jm=!1};h.j.ua=function(a){function c(){c.w.constructor.call(this)}if(!h.j.Ej[a])throw Error("Renderer not registered: ",a);h.g.object.S(c,h.j.Ej[a]);a=new c;a.ua();return a};h.Bi=function(){this.Eb=[]};function $b(a,c){if(c.ug)throw Error("Connection already in database.");c.A.Qc||(a.Eb.splice(cc(a,c),0,c),c.ug=!0)}function lc(a,c){if(!a.Eb.length)return-1;var d=cc(a,c);if(d>=a.Eb.length)return-1;for(var e=c.Na,f=d;0<=f&&a.Eb[f].Na==e;){if(a.Eb[f]==c)return f;f--}for(;d<a.Eb.length&&a.Eb[d].Na==e;){if(a.Eb[d]==c)return d;d++}return-1}
function cc(a,c){if(!a.Eb.length)return 0;for(var d=0,e=a.Eb.length;d<e;){var f=Math.floor((d+e)/2);if(a.Eb[f].Na<c.Na)d=f+1;else if(a.Eb[f].Na>c.Na)e=f;else{d=f;break}}return d}function Xb(a,c){if(!c.ug)throw Error("Connection not in database.");var d=lc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.ug=!1;a.Eb.splice(d,1)}
function dc(a,c,d){function e(n){var r=g-f[n].wb,q=k-f[n].Na;Math.sqrt(r*r+q*q)<=d&&m.push(f[n]);return q<d}var f=a.Eb,g=c.wb,k=c.Na;a=0;for(var l=c=f.length-2;a<l;)f[l].Na<k?a=l:c=l,l=Math.floor((a+c)/2);var m=[];c=a=l;if(f.length){for(;0<=a&&e(a);)a--;do c++;while(c<f.length&&e(c))}return m}h.Bi.ua=function(){var a=[];a[h.Sa]=new h.Bi;a[h.Vd]=new h.Bi;a[h.Ga]=new h.Bi;a[h.Xd]=new h.Bi;return a};h.cd=function(a,c){h.cd.w.constructor.call(this,a,c);this.Nn=!1;this.Dd={};this.qx=this.Fl=0;this.Lr=null};h.g.object.S(h.cd,h.Di);h.cd.aA=5;h.cd.bA=6;b=h.cd.prototype;b.lq=function(a){h.cd.w.lq.call(this,a);!this.Ln&&h.Touch.Qn(a)&&mc(this,a)};b.Vi=function(a){this.Lr=h.pa(document,"mousedown",null,this.WB.bind(this),!0);this.Xn=h.pa(document,"mousemove",null,this.Wk.bind(this),!0);this.Yn=h.pa(document,"mouseup",null,this.Bn.bind(this),!0);a.preventDefault();a.stopPropagation()};
b.WB=function(a){!this.gc()&&h.Touch.Qn(a)&&(mc(this,a),this.Nn&&h.Cg())};b.Wk=function(a){if(this.gc())h.Touch.rs(a)&&h.cd.w.Wk.call(this,a);else if(this.Nn){if(h.Touch.Qn(a)){this.Dd[h.Touch.An(a)]=nc(this,a);var c=Object.keys(this.Dd);if(2==c.length){c=h.g.I.ng(this.Dd[c[0]],this.Dd[c[1]])/this.qx;if(0<this.Fl&&Infinity>this.Fl){var d=c-this.Fl;d=0<d?d*h.cd.aA:d*h.cd.bA;var e=this.Mb,f=h.g.zl(a,x(e),Da(e));e.zoom(f.x,f.y,d)}this.Fl=c;a.preventDefault()}}h.Cg()}else h.cd.w.Wk.call(this,a)};
b.Bn=function(a){if(h.Touch.Qn(a)&&!this.gc()){var c=h.Touch.An(a);this.Dd[c]&&delete this.Dd[c];2>Object.keys(this.Dd).length&&(this.Dd={},this.Fl=0)}!this.Nn||this.gc()?h.Touch.rs(a)&&h.cd.w.Bn.call(this,a):(a.preventDefault(),a.stopPropagation(),this.J())};b.J=function(){h.cd.w.J.call(this);this.Lr&&h.Za(this.Lr)};function mc(a,c){a.Dd[h.Touch.An(c)]=nc(a,c);var d=Object.keys(a.Dd);2==d.length&&(a.qx=h.g.I.ng(a.Dd[d[0]],a.Dd[d[1]]),a.Nn=!0,c.preventDefault())}
function nc(a,c){return a.Mb?new h.g.I(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};h.iu=function(a){this.Or=a;this.gk=Object.create(null)};b=h.iu.prototype;b.ir=null;b.J=function(){this.gk=this.Or=null};b.load=function(a,c){if(a.length){try{var d=new h.g.global.Audio}catch(l){return}for(var e,f=0;f<a.length;f++){var g=a[f],k=g.match(/\.(\w+)$/);if(k&&d.canPlayType("audio/"+k[1])){e=new h.g.global.Audio(g);break}}e&&e.play&&(this.gk[c]=e)}};
b.preload=function(){for(var a in this.gk){var c=this.gk[a];c.volume=.01;var d=c.play();void 0!==d?d.then(c.pause).catch(function(){}):c.pause();if(h.g.userAgent.Zg||h.g.userAgent.rt)break}};b.play=function(a,c){var d=this.gk[a];d?(a=new Date,null!=this.ir&&a-this.ir<h.Hz||(this.ir=a,d=h.g.userAgent.Zg||h.g.userAgent.wi?d:d.cloneNode(),d.volume=void 0===c?1:c,d.play())):this.Or&&this.Or.Bd.play(a,c)};
h.Ua=function(a,c,d){h.Ua.w.constructor.call(this,a);this.uc=a.uc||h.Ua.OB;this.Og=a.Og||h.Ua.yD;this.hn=h.Bi.ua();c&&(this.fd=c);d&&(this.ti=d);this.vo=this.ti&&h.g.Gh();this.Yk=[];this.Bd=new h.iu(a.Vb);this.Jd=this.options.Mv?new h.Yg(a.Mv,a.Lv):null;this.ec=null;h.Z&&h.Z.yh&&oc(this,h.bu,h.Z.yh);h.gu&&h.gu.yh&&oc(this,h.Uz,h.gu.yh);h.sb&&h.sb.yh&&oc(this,h.Jt,h.sb.yh);this.Mf=h.j.ua(this.options.ai||"geras")};h.g.object.S(h.Ua,h.ob);b=h.Ua.prototype;b.ho=null;b.ea=!0;b.Ag=!0;b.oe=!1;b.Kh=!1;
b.bs=!0;b.scrollX=0;b.scrollY=0;b.cv=null;b.scale=1;b.kc=null;b.ub=null;b.O=null;b.wa=null;b.Rb=null;b.fd=null;b.ti=null;b.vo=!1;b.Kn=!1;b.Zq=null;b.iw=null;b.mv={};b.zs={};b.Hu=null;b.ki=null;b.aw=null;b.$q=!0;b.ks=function(a){this.Ka&&this.Ka.Sb&&this.Ka.Sb.J();if(this.Ka=a)this.Ka.Sb=new h.sa(this,!1),this.Ml(this.Ka.Sb.Ja())};b.ix=function(a){this.xb&&this.xb.Sb&&this.xb.Sb.J();if(this.xb=a)this.xb.Sb=new h.sa(this,!0),this.Nl(this.xb.Sb.Ja())};
b.Ml=function(a){a?this.Xa&&(this.Xa.appendChild(a),this.ec=a):this.ec=null};b.Nl=function(a){a&&this.Xa&&(this.ec?this.Xa.insertBefore(a,this.ec):this.Xa.appendChild(a))};function Da(a){if(a.$q){var c=x(a).getScreenCTM();c&&(a.aw=c.inverse(),a.$q=!1)}return a.aw}b.hm=function(){this.$q=!0};b.isVisible=function(){return this.Ag};
function Ka(a,c){var d=0,e=0,f=1;if(h.g.m.containsNode(a.Xa,c)||h.g.m.containsNode(a.Pf,c))f=a.scale;do{var g=h.g.Id(c);if(c==a.Xa||c==a.Pf)f=1;d+=g.x*f;e+=g.y*f;c=c.parentNode}while(c&&c!=x(a));return new h.g.I(d,e)}function aa(a){if(!a.Zq)for(var c=a.K;c;){if(-1!=(" "+(c.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")){a.Zq=c;break}c=c.parentNode}return a.Zq}
b.Ja=function(a){this.K=h.g.m.L("g",{"class":"blocklyWorkspace"},null);a&&(this.Zb=h.g.m.L("rect",{height:"100%",width:"100%","class":a},this.K),"blocklyMainBackground"==a&&this.Jd?this.Zb.style.fill="url(#"+this.Jd.jj.id+")":this.$b.subscribe(this.Zb,"workspace","fill"));this.Xa=h.g.m.L("g",{"class":"blocklyBlockCanvas"},this.K);this.Pf=h.g.m.L("g",{"class":"blocklyBubbleCanvas"},this.K);this.oe||(h.pa(this.K,"mousedown",this,this.Eg,!1,!0),h.pa(this.K,"wheel",this,this.aD));if(this.options.Pv){if(!h.Qz)throw Error("Missing require for Blockly.Toolbox");
this.wa=new h.Qz(this)}this.Jd&&this.Jd.update(this.scale);pc(this);this.Ka.Sb=new h.sa(this,!1);a=this.Ka.Sb.Ja();this.K.appendChild(a);this.xb.Sb=new h.sa(this,!0);a=this.xb.Sb.Ja();this.K.appendChild(a);return this.K};
b.J=function(){this.ea=!1;this.Rb&&this.Rb.cancel();this.K&&(h.g.m.removeNode(this.K),this.K=null);this.Pf=this.Xa=null;this.wa&&(this.wa.J(),this.wa=null);this.O&&(this.O.J(),this.O=null);this.kc&&(this.kc.J(),this.kc=null);this.ub&&(this.ub.J(),this.ub=null);this.ui&&(this.ui.J(),this.ui=null);this.xb&&this.xb.Sb.J();this.Ka&&this.Ka.Sb.J();this.Bd&&(this.Bd.J(),this.Bd=null);this.Jd&&(this.Jd.J(),this.Jd=null);this.$b&&this.$b.unsubscribe(this.Zb);h.Ua.w.J.call(this);this.mv=this.zs=this.hn=null;
if(!this.options.Vb){var a=x(this).parentNode;a&&h.g.m.removeNode(a)}this.ho&&(h.Za(this.ho),this.ho=null)};b.yj=function(a,c){return new h.ra(this,a,c)};function qc(a){if(!h.Ap)throw Error("Missing require for Blockly.Trashcan");a.kc=new h.Ap(a);var c=a.kc.Ja();a.K.insertBefore(c,a.Xa)}function rc(a){if(!h.cA)throw Error("Missing require for Blockly.ZoomControls");a.ui=new h.cA(a);var c=a.ui.Ja();a.K.appendChild(c)}
function sc(a,c){var d={uh:a.options.uh,Vb:a,G:a.G,zj:a.options.zj,Hf:a.Hf,Ya:a.options.Ya,ai:a.options.ai};if(a.Hf){if(!h.Ro)throw Error("Missing require for Blockly.HorizontalFlyout");a.O=new h.Ro(d)}else{if(!h.gh)throw Error("Missing require for Blockly.VerticalFlyout");a.O=new h.gh(d)}a.O.Ui=!1;return a.O.Ja(c)}function tc(a){return a.O?a.O:a.wa?a.wa.O:null}function oa(a){if(a.bs&&a.ea){if(a.ub){var c=a.uc();za(a.ub.ld,c);Ba(a.ub.sd,c)}a.hm()}}
b.resize=function(){this.wa&&this.wa.position();this.O&&this.O.position();this.kc&&this.kc.position();this.ui&&this.ui.position();this.ub&&this.ub.resize();this.hm();pc(this)};function pb(a){var c=h.g.IB();h.g.I.Ne(a.iw,c)||(a.iw=c,a.hm(),pc(a))}function x(a){if(a.vu)return a.vu;for(var c=a.K;c;){if("svg"==c.tagName)return a.vu=c;c=c.parentNode}return null}
b.translate=function(a,c){if(this.vo&&this.Kn)this.ti.mi(a,c);else{var d="translate("+a+","+c+") scale("+this.scale+")";this.Xa.setAttribute("transform",d);this.Pf.setAttribute("transform",d)}if(this.fd){d=this.fd;var e=this.scale;d.Lg=e;d.je.setAttribute("transform","translate("+a.toFixed(0)+","+c.toFixed(0)+") scale("+e+")")}this.Jd&&this.Jd.moveTo(a,c)};
function Fa(a){if(a.vo){a.Kn=!1;var c=a.ti.Lq();a.ti.Zm(a.K);c="translate("+c.x+","+c.y+") scale("+a.scale+")";a.Xa.setAttribute("transform",c);a.Pf.setAttribute("transform",c)}}
function Ea(a){if(a.vo&&!a.Kn){a.Kn=!0;var c=a.Xa.previousSibling,d=parseInt(x(a).getAttribute("width"),10),e=parseInt(x(a).getAttribute("height"),10),f=h.g.Id(a.Xa),g=a.ti,k=a.Xa,l=a.Pf,m=a.scale;if(g.eb.childNodes.length)throw Error("Already dragging a block.");g.Tr=c;k.setAttribute("transform","translate(0, 0) scale("+m+")");l.setAttribute("transform","translate(0, 0) scale("+m+")");g.eb.setAttribute("width",d);g.eb.setAttribute("height",e);g.eb.appendChild(k);g.eb.appendChild(l);g.eb.style.display=
"block";a.ti.mi(f.x,f.y)}}b.Df=function(){var a=this.uc();return a?a.lb/this.scale:0};b.yb=function(a){this.ub&&this.ub.bi(a);tc(this)&&tc(this).bi(a);x(this).style.display=a?"block":"none";this.wa&&(this.wa.DF.style.display=a?"block":"none");if(a){for(var c=J(this,!1),d=c.length-1;0<=d;d--)c[d].rl();this.ya();this.wa&&this.wa.position()}else h.vc(!0);this.Ag=a};b.ya=function(){for(var a=J(this,!1),c=a.length-1;0<=c;c--)a[c].ya(!1);if(this.Rb)for(a=this.Rb.gj(),c=0;c<a.length;c++)a[c].ya(!1)};
function uc(a,c){var d=C;if(void 0===c){for(var e=0,f;f=d.Yk[e];e++)f.Of(!1);d.Yk.length=0}if(f=a?v(d,a):null)(a=void 0===c||c)?-1==d.Yk.indexOf(f)&&d.Yk.push(f):h.g.Xm(d.Yk,f),f.Of(a)}
function vc(a){var c=h.xk;if(a.ea&&!(c.getElementsByTagName("block").length>=(isNaN(a.options.ul)?Infinity:a.options.ul-J(a).length)))if(a.Rb&&a.Rb.cancel(),"comment"==c.tagName.toLowerCase()){h.i.disable();try{var d=h.Si.Sk(c),e=parseInt(c.getAttribute("x"),10),f=parseInt(c.getAttribute("y"),10);isNaN(e)||isNaN(f)||(a.G&&(e=-e),d.moveBy(e+50,f+50))}finally{h.i.enable()}d.select()}else a:{h.i.disable();try{var g=h.N.dj(c,a),k=a.xb.tb;if(h.Se&&k){h.navigation.$v(g,k.ma);break a}var l=parseInt(c.getAttribute("x"),
10),m=parseInt(c.getAttribute("y"),10);if(!isNaN(l)&&!isNaN(m)){a.G&&(l=-l);do{c=!1;var n=J(a,!1);d=0;for(var r;r=n[d];d++){var q=r.Ia();if(1>=Math.abs(l-q.x)&&1>=Math.abs(m-q.y)){c=!0;break}}if(!c){var t=g.Hd(!1);d=0;for(var y;y=t[d];d++)if(y.closest(h.bd,new h.g.I(l,m)).connection){c=!0;break}}c&&(l=a.G?l-h.bd:l+h.bd,m+=2*h.bd)}while(c);g.moveBy(l,m)}}finally{h.i.enable()}h.i.isEnabled()&&!g.Qa&&h.i.Ha(new h.i.tm(g));g.select()}}function wc(a){(a=a.oe?a.ki:a)&&!a.Rb&&a.wa&&a.wa.O&&a.wa.aJ()}
b.$h=function(a,c){h.Ua.w.$h.call(this,a,c);wc(this)};b.sh=function(a){h.Ua.w.sh.call(this,a);wc(this)};b.ie=function(a,c,d){a=h.Ua.w.ie.call(this,a,c,d);wc(this);return a};function pc(a){a.Uu=a.kc&&a.K.parentNode?a.kc.xn():null;a.Tu=a.O?a.O.xn():a.wa?a.wa.xn():null}function Sa(a,c){return a.Uu&&a.Uu.contains(c.clientX,c.clientY)?h.Ko:a.Tu&&a.Tu.contains(c.clientX,c.clientY)?h.ct:h.bt}b.Eg=function(a){var c=this.rg(a);c&&tb(c,a,this)};
b.ts=function(a,c){a=h.g.zl(a,x(this),Da(this));a.x/=this.scale;a.y/=this.scale;this.cv=h.g.I.Ok(c,a)};b.gc=function(){return null!=this.Rb&&this.Rb.gc()};function xc(a){return a.options.Ub&&a.options.Ub.scrollbars||a.options.Ub&&a.options.Ub.si||a.options.Ub&&a.options.Ub.og||a.options.mb&&a.options.mb.controls||a.options.mb&&a.options.mb.si}
b.Rc=function(){return this.options.Ub&&this.options.Ub.scrollbars||this.options.Ub&&this.options.Ub.si||this.options.Ub&&this.options.Ub.og||this.options.mb&&this.options.mb.si};
b.aD=function(a){if(h.Di.Xq())a.preventDefault(),a.stopPropagation();else{var c=this.options.mb&&this.options.mb.si,d=this.options.Ub&&this.options.Ub.si;if(c||d){var e=h.g.Dv(a);!c||!a.ctrlKey&&d?(c=this.scrollX-e.x,d=this.scrollY-e.y,a.shiftKey&&!e.x&&(c=this.scrollX-e.y,d=this.scrollY),this.scroll(c,d)):(e=-e.y/50,c=h.g.zl(a,x(this),Da(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}};
function ka(a){var c=D(a,!1);a=ja(a,!1);c=c.concat(a);if(!c.length)return new h.g.Rect(0,0,0,0);a=ic(c[0]);for(var d=1;d<c.length;d++){var e=ic(c[d]);e.top<a.top&&(a.top=e.top);e.bottom>a.bottom&&(a.bottom=e.bottom);e.left<a.left&&(a.left=e.left);e.right>a.right&&(a.right=e.right)}return a}b.CA=function(){this.Yb(!1);h.i.X(!0);for(var a=D(this,!0),c=0,d=0,e;e=a[d];d++)if(e.Rc()){var f=e.Ia();e.moveBy(-f.x,c-f.y);hc(e);c=e.Ia().y+G(e).height+h.ra.$o}h.i.X(!1);this.Yb(!0)};
b.Rl=function(a){function c(y){if(y.md())t=t.concat(p(y,!1));else{y=pa(y,!1);for(var O=0;O<y.length;O++)c(y[O])}}function d(){h.i.X(g);var y=t.shift();y&&(y.C?(y.J(!1,!0),setTimeout(d,10)):d());h.i.X(!1)}if(!this.options.readOnly&&!this.oe){var e=[],f=D(this,!0),g=h.g.Af(),k=this,l={};l.text=h.h.UNDO;l.enabled=0<this.ni.length;l.Pb=this.Cs.bind(this,!1);e.push(l);l={};l.text=h.h.REDO;l.enabled=0<this.Hl.length;l.Pb=this.Cs.bind(this,!0);e.push(l);this.Rc()&&(l={},l.text=h.h.CLEAN_UP,l.enabled=1<f.length,
l.Pb=this.CA.bind(this),e.push(l));if(this.options.collapse){for(var m=l=!1,n=0;n<f.length;n++)for(var r=f[n];r;)r.isCollapsed()?l=!0:m=!0,r=u(r);var q=function(y){for(var O=0,V=0;V<f.length;V++)for(var la=f[V];la;)setTimeout(la.Mg.bind(la,y),O),la=u(la),O+=10};m={enabled:m};m.text=h.h.COLLAPSE_ALL;m.Pb=function(){q(!0)};e.push(m);l={enabled:l};l.text=h.h.EXPAND_ALL;l.Pb=function(){q(!1)};e.push(l)}var t=[];for(n=0;n<f.length;n++)c(f[n]);l={text:1==t.length?h.h.DELETE_BLOCK:h.h.DELETE_X_BLOCKS.replace("%1",
String(t.length)),enabled:0<t.length,Pb:function(){k.Rb&&k.Rb.cancel();2>t.length?d():h.confirm(h.h.DELETE_ALL_BLOCKS.replace("%1",t.length),function(y){y&&d()})}};e.push(l);this.Hu&&this.Hu(e);h.za.show(a,e,this.G)}};function Ca(a){if(a.options.Vb)Ca(a.options.Vb);else{h.ol=a;document.activeElement&&document.activeElement.blur();try{x(a).focus()}catch(c){try{x(a).parentNode.setActive()}catch(d){x(a).parentNode.focus()}}}}
b.zoom=function(a,c,d){if(!this.oe&&!this.Kh){d=Math.pow(this.options.mb.sD,d);var e=this.scale*d;if(this.scale!=e){e>this.options.mb.vl?d=this.options.mb.vl/this.scale:e<this.options.mb.xl&&(d=this.options.mb.xl/this.scale);var f=this.Xa.getCTM(),g=x(this).createSVGPoint();g.x=a;g.y=c;g=g.matrixTransform(f.inverse());a=g.x;c=g.y;f=f.translate(a*(1-d),c*(1-d)).scale(d);this.scrollX=f.e;this.scrollY=f.f;this.setScale(e)}}};
b.setScale=function(a){this.options.mb.vl&&a>this.options.mb.vl?a=this.options.mb.vl:this.options.mb.xl&&a<this.options.mb.xl&&(a=this.options.mb.xl);this.scale=a;h.vc(!1);this.O&&(this.O.Wr(),pc(this));this.Jd&&this.Jd.update(this.scale);a=this.uc();this.scrollX-=a.dc;this.scrollY-=a.oc;a.zb+=a.dc;a.Ib+=a.oc;this.scroll(this.scrollX,this.scrollY);this.ub&&(this.O?(wa(this.ub.ld,a),xa(this.ub.sd,a)):(za(this.ub.ld,a),Ba(this.ub.sd,a)))};
b.scroll=function(a,c){h.vc(!0);var d=this.uc(),e=d.Je+d.Dc-d.lb,f=d.hd+d.rc-d.vb;a=Math.min(a,-d.Dc);c=Math.min(c,-d.rc);a=Math.max(a,-e);c=Math.max(c,-f);this.scrollX=a;this.scrollY=c;this.ub&&(sa(this.ub.ld,-(a+d.Dc)*this.ub.ld.Wb),sa(this.ub.sd,-(c+d.rc)*this.ub.sd.Wb));a+=d.dc;c+=d.oc;this.translate(a,c)};h.Ua.xv=function(a){var c=0,d=0;a&&(c=a.Df(),d=a.fc);return{width:c,height:d}};h.Ua.GB=function(a,c){return xc(a)?h.Ua.FB(a,c):h.Ua.uv(a)};
h.Ua.uv=function(a){var c=ka(a),d=a.scale;a=c.top*d;var e=c.bottom*d,f=c.left*d;c=c.right*d;return{top:a,bottom:e,left:f,right:c,width:c-f,height:e-a}};h.Ua.FB=function(a,c){a=h.Ua.uv(a);var d=c.width;c=c.height;var e=d/2,f=c/2,g=Math.min(a.left-e,a.right-d),k=Math.min(a.top-f,a.bottom-c);return{left:g,top:k,height:Math.max(a.bottom+f,a.top+c)-k,width:Math.max(a.right+e,a.left+d)-g}};
h.Ua.OB=function(){var a=h.Ua.xv(this.wa),c=h.Ua.xv(this.O),d=h.JD(x(this)),e={height:d.height,width:d.width};if(this.wa)if(this.Ya==h.fh||this.Ya==h.ik)e.height-=a.height;else{if(this.Ya==h.zd||this.Ya==h.fg)e.width-=a.width}else if(this.O)if(this.Ya==h.fh||this.Ya==h.ik)e.height-=c.height;else if(this.Ya==h.zd||this.Ya==h.fg)e.width-=c.width;var f=h.Ua.GB(this,e),g=0;this.wa&&this.Ya==h.zd?g=a.width:this.O&&this.Ya==h.zd&&(g=c.width);var k=0;this.wa&&this.Ya==h.fh?k=a.height:this.O&&this.Ya==h.fh&&
(k=c.height);return{hd:f.height,Je:f.width,rc:f.top,Dc:f.left,vb:e.height,lb:e.width,Ib:-this.scrollY,zb:-this.scrollX,oc:k,dc:g,pJ:d.height,qJ:d.width,yx:a.width,rJ:a.height,DI:c.width,CI:c.height,Ya:this.Ya}};h.Ua.yD=function(a){var c=this.uc();"number"==typeof a.x&&(this.scrollX=-c.Je*a.x-c.Dc);"number"==typeof a.y&&(this.scrollY=-c.hd*a.y-c.rc);this.translate(this.scrollX+c.dc,this.scrollY+c.oc)};h.Ua.prototype.Yb=function(a){var c=!this.bs&&a;this.bs=a;c&&oa(this)};
h.Ua.prototype.clear=function(){this.Yb(!1);h.Ua.w.clear.call(this);this.Yb(!0)};function yc(a,c){if("function"!=typeof c)throw TypeError("Button callbacks must be functions.");a.mv.CREATE_VARIABLE=c}function oc(a,c,d){if("function"!=typeof d)throw TypeError("Toolbox category callbacks must be functions.");a.zs[c]=d}
h.Ua.prototype.rg=function(a){var c="mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type,d=this.Rb;return d?c&&d.Ch?(console.warn("Tried to start the same gesture twice."),d.cancel(),null):d:c?this.Rb=new h.cd(a,this):null};h.vg=function(a,c){h.xA();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!h.g.m.containsNode(document,a))throw Error("Error: container is not in current document.");c=new h.yd(c||{});var d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);a=h.Fk(d,c);var e=new h.Vs(d);d=new h.ju(d);d=h.RA(a,c,e,d);h.ab.Wa.xD(c.Wa);h.gC(d);h.ol=d;h.bm(d);return d};
h.Fk=function(a,c){a.setAttribute("dir","LTR");h.Ac.Su=c.G;h.Zc.vg(c.XB,c.Bj);a=h.g.m.L("svg",{xmlns:h.g.m.nc,"xmlns:html":h.g.m.Em,"xmlns:xlink":h.g.m.Ge,version:"1.1","class":"blocklySvg"},a);var d=h.g.m.L("defs",{},a),e=String(Math.random()).substring(2),f=h.g.m.L("filter",{id:"blocklyEmbossFilter"+e},d);h.g.m.L("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var g=h.g.m.L("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",
result:"specOut"},f);h.g.m.L("fePointLight",{x:-5E3,y:-1E4,z:2E4},g);h.g.m.L("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);h.g.m.L("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);c.gv=f.id;f=h.g.m.L("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);h.g.m.L("rect",{width:10,height:10,fill:"#aaa"},f);h.g.m.L("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);c.uh=f.id;
c.Mv=h.Yg.Ja(e,c.Lv,d);return a};
h.RA=function(a,c,d,e){c.Vb=null;var f=new h.Ua(c,d,e);f.scale=c.mb.GD;a.appendChild(f.Ja("blocklyMainBackground"));!c.Pv&&c.ll&&(d=sc(f,"svg"),h.g.m.qj(d,a));c.Tv&&qc(f);c.mb&&c.mb.controls&&rc(f);f.$b.subscribe(a,"workspace","background-color");f.translate(0,0);h.ol=f;c.readOnly||f.Rc()||K(f,function(g){if(!f.gc()&&!f.Rc()&&-1!=h.i.ay.indexOf(g.type)){var k=Object.create(null),l=f.uc(),m=f.scale;k.G=f.G;k.zb=l.zb/m;k.Ib=l.Ib/m;k.Fx=(l.zb+l.lb)/m;k.Ex=(l.Ib+l.vb)/m;xc(f)?(l=ka(f),k.Dc=l.left,k.rc=
l.top,k.Nu=l.right,k.Lu=l.bottom):(k.Dc=l.Dc/m,k.rc=l.rc/m,k.Nu=(l.Dc+l.Je)/m,k.Lu=(l.rc+l.hd)/m);if(k.rc<k.Ib||k.Lu>k.Ex||k.Dc<k.zb||k.Nu>k.Fx){l=null;g&&(l=h.i.Fb(),h.i.X(g.group));switch(g.type){case h.i.Qs:case h.i.Rs:var n=v(f,g.pc);n=H(n);break;case h.i.vm:case h.i.wm:n=f.fn[g.Ie]||null}if(n){m=ic(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var r=k.Ib,q=k.Ex-m.height;q=Math.max(r,q);r=h.g.Lb.wk(r,m.top,q)-m.top;q=k.zb;var t=k.Fx-m.width;k.G?q=Math.min(t,q):t=Math.max(q,t);n.moveBy(h.g.Lb.wk(q,
m.left,t)-m.left,r)}g&&(g.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&h.i.X(l))}}});h.bm(f);h.T.Ja();h.D.Ja();h.H.Ja();return f};
h.gC=function(a){var c=a.options,d=x(a);h.pa(d.parentNode,"contextmenu",null,function(e){h.g.On(e)||e.preventDefault()});d=h.pa(window,"resize",null,function(){h.vc(!0);h.bm(a)});a.ho=d;h.vg.lA();c.ll&&(a.wa?a.wa.ua(a):a.O&&(a.O.ua(a),a.O.show(c.ll.childNodes),a.O.Xb.set(0)));d=h.Ca.jc;c.Tv&&(d=a.kc.ua(d));c.mb&&c.mb.controls&&a.ui.ua(d);c.Ub&&c.Ub.scrollbars?(a.ub=new h.Pi(a),a.ub.resize()):a.Og({x:.5,y:.5});c.ZB&&h.vg.sC(c.Bj,a)};
h.vg.lA=function(){h.hB||(h.pa(document,"scroll",null,function(){for(var a=h.ob.getAll(),c=0,d;d=a[c];c++)d.hm&&d.hm()}),h.pa(document,"keydown",null,h.SC),h.ed(document,"touchend",null,h.Cg),h.ed(document,"touchcancel",null,h.Cg),h.g.userAgent.Zg&&h.pa(window,"orientationchange",document,function(){h.bm(h.gb())}));h.hB=!0};
h.vg.sC=function(a,c){function d(){for(;f.length;)h.Za(f.pop());e.preload()}var e=c.Bd;e.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");e.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");e.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var f=[];f.push(h.pa(document,"mousemove",null,d,!0));f.push(h.pa(document,"touchstart",null,d,!0))};h.xe=function(a){this.name=a};h.F=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.fm=a;this.bl=h.F.jC(a);this.ma=c;(a=d||null)&&a.Jx&&(this.Kx=a.Jx)};h.F.types={ud:"field",Xc:"block",lf:"input",Li:"output",Td:"next",Wd:"previous",De:"stack",hh:"workspace"};h.F.vy=-20;h.F.jC=function(a){switch(a){case h.F.types.Wd:case h.F.types.Td:case h.F.types.lf:case h.F.types.Li:return!0}return!1};h.F.Gk=function(a){return new h.F(h.F.types.ud,a)};
h.F.Ke=function(a){return a?a.type==h.Sa||a.type==h.Ga&&a.Pe()?h.F.oh(a.Pe()):a.type==h.Ga?new h.F(h.F.types.Td,a):a.type==h.Vd?new h.F(h.F.types.Li,a):a.type==h.Xd?new h.F(h.F.types.Wd,a):null:null};h.F.oh=function(a){return a?new h.F(h.F.types.lf,a.connection):null};h.F.zf=function(a){return new h.F(h.F.types.Xc,a)};h.F.Hk=function(a){return new h.F(h.F.types.De,a)};h.F.Ik=function(a,c){return new h.F(h.F.types.hh,a,{Jx:c})};b=h.F.prototype;b.qb=function(){return this.fm};
function zc(a,c){a=a.ma;a instanceof h.sm||(a=a.A);if(!a||!a.C)return null;var d=H(a);a=D(d.C,!0);for(var e=0,f;f=a[e];e++)if(d.id==f.id)return c=e+(c?1:-1),-1==c||c==a.length?null:h.F.Hk(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function Ac(a){if(!a)return null;do var c=a.U&&z(a.U);while(c&&u(c)==a&&(a=c));return(c=a.U||a.M)&&c.ga&&c.ga.Pe()?h.F.oh(c.ga.Pe()):h.F.Hk(a)}
b.next=function(){switch(this.fm){case h.F.types.De:return zc(this,!0);case h.F.types.Li:return h.F.zf(this.ma.A);case h.F.types.ud:a:{var a=this.ma,c=a.Pe();var d=a.A;a=c.La.indexOf(a)+1;c=d.P.indexOf(c);for(var e;e=d.P[c];c++){for(var f=e.La;a<f.length;){if(f[a].kf){d=h.F.Gk(f[a]);break a}a++}a=0;if(e.connection){d=h.F.oh(e);break a}}d=null}return d;case h.F.types.lf:a:{a=this.ma.Pe();d=a.A;for(a=d.P.indexOf(a)+1;c=d.P[a];a++){e=c.La;f=0;for(var g;g=e[f];f++)if(g.kf){d=h.F.Gk(g);break a}if(c.connection){d=
h.F.oh(c);break a}}d=null}return d;case h.F.types.Xc:if(d=this.ma.V)return h.F.Ke(d);break;case h.F.types.Wd:return h.F.zf(this.ma.A);case h.F.types.Td:if(d=this.ma.ga)return h.F.Ke(d)}return null};
b.$k=function(){switch(this.fm){case h.F.types.hh:var a=D(this.ma,!0);if(0<a.length)return h.F.Hk(a[0]);break;case h.F.types.De:a=this.ma;var c=a.U||a.M;return c?h.F.Ke(c):h.F.zf(a);case h.F.types.Xc:a:{a=this.ma.P;c=0;for(var d;d=a[c];c++){for(var e=d.La,f=0,g;g=e[f];f++)if(g.kf){a=h.F.Gk(g);break a}if(d.connection){a=h.F.oh(d);break a}}a=null}return a;case h.F.types.lf:if(a=this.ma.ga)return h.F.Ke(a)}return null};
b.We=function(){switch(this.fm){case h.F.types.De:return zc(this,!1);case h.F.types.ud:a:{var a=this.ma;var c=a.Pe();var d=a.A;a=c.La.indexOf(a)-1;for(var e=d.P.indexOf(c),f;f=d.P[e];e--){if(f.connection&&f!==c){c=h.F.oh(f);break a}for(f=f.La;-1<a;){if(f[a].kf){c=h.F.Gk(f[a]);break a}a--}0<=e-1&&(a=d.P[e-1].La.length-1)}c=null}return c;case h.F.types.lf:a:{c=this.ma.Pe();d=c.A;for(a=d.P.indexOf(c);e=d.P[a];a--){if(e.connection&&e!==c){c=h.F.oh(e);break a}e=e.La;f=e.length-1;for(var g;g=e[f];f--)if(g.kf){c=
h.F.Gk(g);break a}}c=null}return c;case h.F.types.Xc:c=this.ma.M;if(c=this.ma.U||c)return h.F.Ke(c);break;case h.F.types.Wd:if((c=this.ma.ga)&&!c.Pe())return h.F.Ke(c);break;case h.F.types.Td:return h.F.zf(this.ma.A)}return null};
b.Bl=function(){switch(this.fm){case h.F.types.De:var a=this.ma.Ia();return h.F.Ik(this.ma.C,new h.g.I(a.x,a.y+h.F.vy));case h.F.types.Li:return(a=this.ma.ga)?h.F.Ke(a):h.F.Hk(this.ma.A);case h.F.types.ud:return h.F.zf(this.ma.A);case h.F.types.lf:return h.F.zf(this.ma.A);case h.F.types.Xc:return Ac(this.ma);case h.F.types.Wd:return Ac(this.ma.A);case h.F.types.Td:return Ac(this.ma.A)}return null};h.g.Ta={jI:0,WF:3,Xx:8,Wt:9,nG:12,Mo:13,Fz:16,EE:17,Sx:18,eH:19,rE:20,No:27,MH:32,dH:33,cH:34,UE:35,CF:36,bz:37,au:38,Bz:39,ft:40,hH:43,lH:44,To:45,Wj:46,ZERO:48,ONE:49,bI:50,UH:51,rF:52,oF:53,IH:54,GH:55,TE:56,jG:57,mF:59,kF:61,jF:173,lF:163,nH:63,jE:64,Mx:65,lE:66,ey:67,uy:68,E:69,XE:70,sF:71,xF:72,Sy:73,IF:74,az:75,JF:76,VF:77,hG:78,DG:79,bH:80,Q:81,oH:82,Dz:83,Nz:84,cI:85,Rz:86,Vz:87,ku:88,mI:89,$z:90,qz:91,kI:92,CE:93,CG:96,vG:97,BG:98,AG:99,rG:100,qG:101,zG:102,yG:103,pG:104,uG:105,tG:106,xG:107,
sG:109,wG:110,oG:111,YE:112,bF:113,cF:114,dF:115,eF:116,fF:117,gF:118,hF:119,iF:120,ZE:121,$E:122,aF:123,mG:144,BH:145,nF:166,MF:183,DH:186,FE:189,VE:187,zE:188,fH:190,JH:191,fE:192,VH:192,HH:222,EG:219,mE:220,vE:221,iI:224,XF:224,YF:91,ZF:93,hI:229,gI:252,gH:255};h.ab={};h.ab.Wa={};h.ab.Wa.Mh={};h.ab.Wa.yr={Fz:"Shift",oy:"Control",Sx:"Alt",qz:"Meta"};h.ab.Wa.hJ=function(a,c){var d=h.ab.Wa.KB(c);d&&delete h.ab.Wa.Mh[d];h.ab.Wa.Mh[a]=c};h.ab.Wa.xD=function(a){h.ab.Wa.Mh=a};h.ab.Wa.HI=function(){var a={};h.g.object.Ph(a,h.ab.Wa.Mh);return a};h.ab.Wa.wB=function(a){return h.ab.Wa.Mh[a]};h.ab.Wa.KB=function(a){for(var c=Object.keys(h.ab.Wa.Mh),d=0,e;e=c[d];d++)if(h.ab.Wa.Mh[e].name===a.name)return e;return null};
h.ab.Wa.uD=function(a){for(var c=h.g.object.values(h.ab.Wa.yr),d="",e=0,f;f=c[e];e++)a.getModifierState(f)&&(d+=f);return d+=a.keyCode};h.ab.Wa.SA=function(){for(var a=h.g.Ta.az,c=[h.ab.Wa.yr.oy],d="",e=h.g.object.values(h.ab.Wa.yr),f=0,g;g=c[f];f++)if(-1<e.indexOf(g))d+=g;else throw Error(g+" is not a valid modifier key.");return d+a};
h.ab.Wa.QA=function(){var a={},c=h.ab.Wa.SA();a[h.g.Ta.Vz]=h.navigation.Bo;a[h.g.Ta.Mx]=h.navigation.Hs;a[h.g.Ta.Dz]=h.navigation.Ao;a[h.g.Ta.uy]=h.navigation.Gs;a[h.g.Ta.Sy]=h.navigation.Ox;a[h.g.Ta.Mo]=h.navigation.Px;a[h.g.Ta.ku]=h.navigation.Nx;a[h.g.Ta.Nz]=h.navigation.Qx;a[h.g.Ta.E]=h.navigation.zo;a[h.g.Ta.No]=h.navigation.zo;a[c]=h.navigation.Is;return a};h.navigation={};h.navigation.xj=null;h.navigation.Ut=1;h.navigation.Sm=2;h.navigation.Vt=3;h.navigation.ph=h.navigation.Sm;h.navigation.$a={Wd:"previous",Td:"next",So:"in",hp:"out",To:"insert",Yo:"mark",et:"disconnect",Zt:"toolbox",Oo:"exit",xp:"toggle_keyboard_nav"};h.navigation.pv=function(){var a=h.gb(),c=a.wa;c&&(h.navigation.ph=h.navigation.Vt,h.navigation.Xw(!1),a.xb.tb||h.navigation.wr(),c.gJ())};
h.navigation.ov=function(){h.navigation.ph=h.navigation.Ut;var a=h.gb();var c=a.wa;c=c?c.O:tc(a);a.xb.tb||h.navigation.wr();c&&c.ij()&&(a=D(c.ij(),!0),0<a.length&&(a=a[0],a=h.F.Hk(a),I(h.navigation.qg(),a)))};h.navigation.vn=function(){h.vc();var a=h.gb(),c=a.Ka,d=!!a.wa,e=D(a,!0);h.navigation.Xw(d);h.navigation.ph=h.navigation.Sm;0<e.length?I(c,h.navigation.Pq(e[0])):(a=h.F.Ik(a,new h.g.I(100,100)),I(c,a))};
h.navigation.qg=function(){var a=h.gb(),c=null;a.ea&&(c=(a=(c=a.wa)?c.O:tc(a))?a.s.Ka:null);return c};h.navigation.iC=function(){var a=h.gb(),c=tc(a);if(c&&c.isVisible()){var d=h.navigation.qg().tb.ma;d.isEnabled()?(c=qb(c,d),c.ya(),ma(c,!1),I(a.Ka,h.F.zf(c)),h.navigation.sw()||h.navigation.yc("Something went wrong while inserting a block from the flyout."),h.navigation.vn(),I(a.Ka,h.navigation.Pq(c)),h.navigation.kD()):h.navigation.yc("Can't insert a disabled block.")}else h.navigation.yc("Trying to insert from the flyout when the flyout does not exist or is not visible")};
h.navigation.Xw=function(a){h.navigation.qg()&&(h.navigation.qg().ta(),a&&tc(h.gb()).ta())};
h.navigation.xC=function(){var a=h.gb().xb.tb,c=h.gb().Ka.tb;if(!a)return h.navigation.yc("Cannot insert with no marked node."),!1;if(!c)return h.navigation.yc("Cannot insert with no cursor node."),!1;a=a.qb();c=c.qb();return a==h.F.types.ud?(h.navigation.yc("Should not have been able to mark a field."),!1):a==h.F.types.Xc?(h.navigation.yc("Should not have been able to mark a block."),!1):a==h.F.types.De?(h.navigation.yc("Should not have been able to mark a stack."),!1):c==h.F.types.ud?(h.navigation.yc("Cannot attach a field to anything else."),
!1):c==h.F.types.hh?(h.navigation.yc("Cannot attach a workspace to anything else."),!1):!0};h.navigation.DC=function(a,c){if(a.Qa)return h.navigation.yc("Cannot move a shadow block to the workspace."),!1;a.getParent()&&A(a,!1);a.moveTo(c.Kx);return!0};
h.navigation.sw=function(){var a=h.gb().xb.tb,c=h.gb().Ka.tb;if(!h.navigation.xC())return!1;var d=a.qb(),e=c.qb(),f=c.ma,g=a.ma;if(a.bl&&c.bl)return h.navigation.ge(f,g);if(a.bl&&(e==h.F.types.Xc||e==h.F.types.De))return h.navigation.$v(f,g);if(d==h.F.types.hh)return c=h.navigation.Kq(c),h.navigation.DC(c,a);h.navigation.yc("Unexpected state in Blockly.navigation.modify_.");return!1};h.navigation.dB=function(a,c){var d=a.A,e=c.A;H(d)==H(e)&&(-1<p(d,!1).indexOf(e)?h.navigation.zn(c).disconnect():h.navigation.zn(a).disconnect())};
h.navigation.zr=function(a,c){if(!a||!c)return!1;var d=a.A;return Ha(c,a)==h.na.um?(h.navigation.dB(a,c),E(c)||a.type!=h.Ga&&a.type!=h.Sa||H(d).moveBy(c.wb-a.wb,c.Na-a.Na),c.connect(a),!0):!1};h.navigation.zn=function(a){var c=a.A;return E(a)?c.U?c.U:c.M?c.M:null:a};h.navigation.Hv=function(a){return E(a)?a:a.ga?a.ga:null};
h.navigation.ge=function(a,c){if(!a||!c)return!1;var d=h.navigation.zn(a),e=h.navigation.Hv(c),f=h.navigation.Hv(a),g=h.navigation.zn(c);if(d&&e&&h.navigation.zr(d,e)||f&&g&&h.navigation.zr(f,g)||h.navigation.zr(a,c))return!0;try{Ia(c,a)}catch(k){h.navigation.yc("Connection failed with error: "+k)}return!1};
h.navigation.$v=function(a,c){switch(c.type){case h.Xd:if(h.navigation.ge(a.V,c))return!0;break;case h.Ga:if(h.navigation.ge(a.U,c))return!0;break;case h.Sa:if(h.navigation.ge(a.M,c))return!0;break;case h.Vd:for(var d=0;d<a.P.length;d++){var e=a.P[d].connection;if(e&&e.type===h.Sa&&h.navigation.ge(e,c))return!0}if(a.M&&h.navigation.ge(a.M,c))return!0}h.navigation.yc("This block can not be inserted at the marked location.");return!1};
h.navigation.cB=function(){var a=h.gb(),c=a.Ka.tb;if(c.bl){var d=c.ma;d.isConnected()?(c=E(d)?d:d.ga,d=E(d)?d.ga:d,d.A.Qa?h.navigation.nr("Cannot disconnect a shadow block"):(c.disconnect(),Zb(d,c),Xa(H(c.A)),c=h.F.Ke(c),I(a.Ka,c))):h.navigation.nr("Cannot disconnect unconnected connection")}else h.navigation.nr("Cannot disconnect blocks when the cursor is not on a connection")};h.navigation.wr=function(){var a=h.gb();I(a.xb,a.Ka.tb)};h.navigation.kD=function(){var a=h.gb();I(a.xb,null);a.xb.ta()};
h.navigation.$e=function(a){h.navigation.ph=a};h.navigation.Kq=function(a){return a?a.qb()===h.F.types.Xc?a.ma:a.qb()===h.F.types.De?a.ma:a.qb()===h.F.types.hh?null:a.ma.A:null};h.navigation.Pq=function(a){var c=a.U||a.M;return c?h.F.Ke(c):h.F.zf(a)};h.navigation.xw=function(a){var c=h.gb();if(c&&(c=c.Ka)){var d=h.navigation.Kq(c.tb);d===a?d.getParent()?(a=d.U||d.M)&&I(c,h.F.Ke(a.ga)):I(c,h.F.Ik(d.C,d.Ia())):-1<pa(a,!1).indexOf(d)&&I(c,h.F.Ik(d.C,d.Ia()))}};
h.navigation.EC=function(a){var c=h.gb().Ka;if(c){var d=h.navigation.Kq(c.tb);d===a&&I(c,h.F.zf(d))}};h.navigation.xq=function(){h.Se||(h.Se=!0,h.navigation.vn())};h.navigation.bB=function(){if(h.Se){var a=h.gb();h.Se=!1;a.Ka.ta();a.xb.ta();h.navigation.qg()&&h.navigation.qg().ta()}};h.navigation.nr=function(a){h.navigation.xj?h.navigation.xj("log",a):console.log(a)};h.navigation.yc=function(a){h.navigation.xj?h.navigation.xj("warn",a):console.warn(a)};
h.navigation.AI=function(a){h.navigation.xj?h.navigation.xj("error",a):console.error(a)};h.navigation.Fw=function(a){a=h.ab.Wa.uD(a);return(a=h.ab.Wa.wB(a))?h.navigation.Vh(a):!1};h.navigation.Vh=function(a){var c=h.gb().options.readOnly,d=!1;h.Se?c?-1<h.navigation.Az.indexOf(a)&&(d=h.navigation.Ov(a)):d=h.navigation.Ov(a):a.name===h.navigation.$a.xp&&(h.navigation.xq(),d=!0);return d};
h.navigation.Ov=function(a){var c=h.gb();if(a.name===h.navigation.$a.xp)return h.navigation.bB(),!0;if(a.name===h.navigation.$a.Zt)return c.wa?h.navigation.pv():h.navigation.ov(),!0;if(h.navigation.ph===h.navigation.Sm){c=c.Ka.tb;var d=!1;c&&c.qb()===h.F.types.ud&&(d=c.ma.Vh(a));d||(d=h.navigation.$D(a));return d}return h.navigation.ph===h.navigation.Ut?h.navigation.uB(a):h.navigation.ph===h.navigation.Vt?h.navigation.OD(a):!1};
h.navigation.$D=function(a){var c=h.gb();switch(a.name){case h.navigation.$a.Wd:return c.Ka.We(),!0;case h.navigation.$a.hp:return c.Ka.Bl(),!0;case h.navigation.$a.Td:return c.Ka.next(),!0;case h.navigation.$a.So:return c.Ka.$k(),!0;case h.navigation.$a.To:return h.navigation.sw(),!0;case h.navigation.$a.Yo:return h.navigation.RB(),!0;case h.navigation.$a.et:return h.navigation.cB(),!0;default:return!1}};
h.navigation.uB=function(a){switch(a.name){case h.navigation.$a.Wd:return h.navigation.qg().We(),!0;case h.navigation.$a.hp:return h.navigation.pv(),!0;case h.navigation.$a.Td:return h.navigation.qg().next(),!0;case h.navigation.$a.Yo:return h.navigation.iC(),!0;case h.navigation.$a.Oo:return h.navigation.vn(),!0;default:return!1}};
h.navigation.OD=function(a){if(a.name===h.navigation.$a.Oo)return h.navigation.vn(),!0;var c=h.gb().wa.Vh(a);return c||a.name!==h.navigation.$a.So?c:(h.navigation.ov(),!0)};h.navigation.RB=function(){var a=h.gb().Ka.tb,c=a.qb();c==h.F.types.ud?a.ma.Pg():a.bl||c==h.F.types.hh?h.navigation.wr():c==h.F.types.Xc?h.navigation.yc("Cannot mark a block."):c==h.F.types.De&&h.navigation.yc("Cannot mark a stack.")};h.navigation.Bo=new h.xe(h.navigation.$a.Wd);h.navigation.Hs=new h.xe(h.navigation.$a.hp);
h.navigation.Ao=new h.xe(h.navigation.$a.Td);h.navigation.Gs=new h.xe(h.navigation.$a.So);h.navigation.Ox=new h.xe(h.navigation.$a.To);h.navigation.Px=new h.xe(h.navigation.$a.Yo);h.navigation.Nx=new h.xe(h.navigation.$a.et);h.navigation.Qx=new h.xe(h.navigation.$a.Zt);h.navigation.zo=new h.xe(h.navigation.$a.Oo);h.navigation.Is=new h.xe(h.navigation.$a.xp);h.navigation.Az=[h.navigation.Bo,h.navigation.Hs,h.navigation.Gs,h.navigation.Ao,h.navigation.Is];h.Ud=function(a,c){this.Dx=c||"";this.Ww=Object.create(null);if(a)for(a=a.split(","),c=0;c<a.length;c++)this.Ww[a[c]]=!0;this.reset()};h.Ud.Lo="DEVELOPER_VARIABLE";h.Ud.prototype.reset=function(){this.Le=Object.create(null);this.Ru=Object.create(null);this.Aa=null};
function Bc(a,c){var d=h.o.Pj;if(c==h.Z.Zf){var e=a;d.Aa?e=(e=d.Aa.Cf(e))?e.name:null:(console.log("Deprecated call to Blockly.Names.prototype.getName without defining a variable map. To fix, add the folowing code in your generator's init() function:\nBlockly.YourGeneratorName.variableDB_.setVariableMap(workspace.getVariableMap());"),e=null);e&&(a=e)}e=a.toLowerCase()+"_"+c;var f=c==h.Z.Zf||c==h.Ud.Lo?d.Dx:"";if(e in d.Le)return f+d.Le[e];a=Cc(d,a,c);d.Le[e]=a.substr(f.length);return a}
function Cc(a,c,d){c?(c=encodeURI(c.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!="0123456789".indexOf(c[0])&&(c="my_"+c)):c=h.h.UNNAMED_KEY||"unnamed";for(var e="";a.Ru[c+e]||c+e in a.Ww;)e=e?e+1:2;c+=e;a.Ru[c]=!0;return(d==h.Z.Zf||d==h.Ud.Lo?a.Dx:"")+c}h.Ud.Ne=function(a,c){return a.toLowerCase()==c.toLowerCase()};h.sb={};h.sb.Zf=h.Jt;h.sb.iA=function(a){a=J(a,!1);for(var c=[],d=[],e=0;e<a.length;e++)if(a[e].hj){var f=a[e].hj();f&&(f[2]?c.push(f):d.push(f))}d.sort(h.sb.Sw);c.sort(h.sb.Sw);return[d,c]};h.sb.Sw=function(a,c){return a[0].toLowerCase().localeCompare(c[0].toLowerCase())};h.sb.qB=function(a,c){if(c.Qc)return a;for(a=a||h.h.UNNAMED_KEY||"unnamed";!h.sb.kC(a,c.C,c);){var d=a.match(/^(.*?)(\d+)$/);a=d?d[1]+(parseInt(d[2],10)+1):a+"2"}return a};h.sb.kC=function(a,c,d){return!h.sb.mC(a,c,d)};
h.sb.mC=function(a,c,d){c=J(c,!1);for(var e=0;e<c.length;e++)if(c[e]!=d&&c[e].hj){var f=c[e].hj();if(h.Ud.Ne(f[0],a))return!0}return!1};h.sb.bJ=function(a){a=a.trim();var c=h.sb.qB(a,this.A),d=this.getValue();if(d!=a&&d!=c){a=J(this.A.C,!1);for(var e=0;e<a.length;e++)a[e].nD&&a[e].nD(d,c)}return c};
h.sb.yh=function(a){function c(g,k){for(var l=0;l<g.length;l++){var m=g[l][0],n=g[l][1],r=h.g.xml.createElement("block");r.setAttribute("type",k);r.setAttribute("gap",16);var q=h.g.xml.createElement("mutation");q.setAttribute("name",m);r.appendChild(q);for(m=0;m<n.length;m++){var t=h.g.xml.createElement("arg");t.setAttribute("name",n[m]);q.appendChild(t)}d.push(r)}}var d=[];if(h.hb.procedures_defnoreturn){var e=h.g.xml.createElement("block");e.setAttribute("type","procedures_defnoreturn");e.setAttribute("gap",
16);var f=h.g.xml.createElement("field");f.setAttribute("name","NAME");f.appendChild(h.g.xml.createTextNode(h.h.PROCEDURES_DEFNORETURN_PROCEDURE));e.appendChild(f);d.push(e)}h.hb.procedures_defreturn&&(e=h.g.xml.createElement("block"),e.setAttribute("type","procedures_defreturn"),e.setAttribute("gap",16),f=h.g.xml.createElement("field"),f.setAttribute("name","NAME"),f.appendChild(h.g.xml.createTextNode(h.h.PROCEDURES_DEFRETURN_PROCEDURE)),e.appendChild(f),d.push(e));h.hb.procedures_ifreturn&&(e=h.g.xml.createElement("block"),
e.setAttribute("type","procedures_ifreturn"),e.setAttribute("gap",16),d.push(e));d.length&&d[d.length-1].setAttribute("gap",24);a=h.sb.iA(a);c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};h.sb.BB=function(a,c){var d=[];c=J(c,!1);for(var e=0;e<c.length;e++)if(c[e].NB){var f=c[e].NB();f&&h.Ud.Ne(f,a)&&d.push(c[e])}return d};
h.sb.YI=function(a){var c=h.i.ic,d=a.hj()[0],e=a.hc(!0);a=h.sb.BB(d,a.C);d=0;for(var f;f=a[d];d++){var g=f.hc();g=g&&h.N.Fc(g);f.Gd(e);var k=f.hc();k=k&&h.N.Fc(k);g!=k&&(h.i.ic=!1,h.i.Ha(new h.i.Rf(f,"mutation",null,g,k)),h.i.ic=c)}};h.sb.FI=function(a,c){c=D(c,!1);for(var d=0;d<c.length;d++)if(c[d].hj){var e=c[d].hj();if(e&&h.Ud.Ne(e[0],a))return c[d]}return null};h.kk=function(a,c,d,e){this.C=a;this.name=c;this.type=d||"";this.oj=e||h.g.Af();h.i.Ha(new h.i.Ad(this))};h.kk.prototype.Pa=function(){return this.oj};h.kk.Gu=function(a,c){a=a.name.toLowerCase();c=c.name.toLowerCase();return a<c?-1:a==c?0:1};h.Z={};h.Z.Zf=h.bu;h.Z.pu=function(a){var c=J(a,!1);a=Object.create(null);for(var d=0;d<c.length;d++){var e=qa(c[d]);if(e)for(var f=0;f<e.length;f++){var g=e[f],k=g.Pa();k&&(a[k]=g)}}c=[];for(k in a)c.push(a[k]);return c};h.Z.oI=function(){console.warn("Deprecated call to Blockly.Variables.allUsedVariables. Use Blockly.Variables.allUsedVarModels instead.\nIf this is a major issue please file a bug on GitHub.")};h.Z.Ls={};
h.Z.gA=function(a){a=J(a,!1);for(var c=Object.create(null),d=0,e;e=a[d];d++){var f=e.GI;!f&&e.HB&&(f=e.HB,h.Z.Ls[e.type]||(console.warn("Function getDeveloperVars() deprecated. Use getDeveloperVariables() (block type '"+e.type+"')"),h.Z.Ls[e.type]=!0));if(f)for(e=f(),f=0;f<e.length;f++)c[e[f]]=!0}return Object.keys(c)};
h.Z.yh=function(a){var c=[],d=document.createElement("button");d.setAttribute("text","%{BKY_NEW_VARIABLE}");d.setAttribute("callbackKey","CREATE_VARIABLE");yc(a,function(e){h.Z.Pu(e.KI())});c.push(d);a=h.Z.tB(a);return c=c.concat(a)};
h.Z.tB=function(a){a=a.Vk("");var c=[];if(0<a.length){var d=a[a.length-1];if(h.hb.variables_set){var e=h.g.xml.createElement("block");e.setAttribute("type","variables_set");e.setAttribute("gap",h.hb.math_change?8:24);e.appendChild(h.Z.Eq(d));c.push(e)}h.hb.math_change&&(e=h.g.xml.createElement("block"),e.setAttribute("type","math_change"),e.setAttribute("gap",h.hb.variables_get?20:8),e.appendChild(h.Z.Eq(d)),d=h.N.Qg('<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>'),
e.appendChild(d),c.push(e));if(h.hb.variables_get){a.sort(h.kk.Gu);d=0;for(var f;f=a[d];d++)e=h.g.xml.createElement("block"),e.setAttribute("type","variables_get"),e.setAttribute("gap",8),e.appendChild(h.Z.Eq(f)),c.push(e)}}return c};
h.Z.vB=function(a){a=a.pg();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var g=!1,k=0;k<a.length;k++)if(a[k].name.toLowerCase()==f){g=!0;break}g?(e++,25==e&&(e=0,d++),f="ijkmnopqrstuvwxyzabcdefgh".charAt(e),1<d&&(f+=d)):c=f}else c="i";return c};
h.Z.Pu=function(a,c,d){function e(g){h.Z.Tw(h.h.NEW_VARIABLE_TITLE,g,function(k){if(k){var l=h.Z.HC(k,a);if(l){var m=k.toLowerCase();if(l.type==f)var n=h.h.VARIABLE_ALREADY_EXISTS.replace("%1",m);else n=h.h.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE,n=n.replace("%1",m).replace("%2",l.type);h.alert(n,function(){e(k)})}else a.ie(k,f),c&&c(k)}else c&&c(null)})}var f=d||"";e("")};h.Z.ie=h.Z.Pu;
h.Z.Yr=function(a,c){function d(e){var f=h.h.RENAME_VARIABLE_TITLE.replace("%1",c.name);h.Z.Tw(f,e,function(g){if(g){var k=h.Z.IC(g,c.type,a);k?(k=h.h.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",g.toLowerCase()).replace("%2",k.type),h.alert(k,function(){d(g)})):a.$h(c.Pa(),g)}})}d("")};h.Z.Tw=function(a,c,d){h.prompt(a,c,function(e){e&&(e=e.replace(/[\s\xa0]+/g," ").trim(),e==h.h.RENAME_VARIABLE||e==h.h.NEW_VARIABLE)&&(e=null);d(e)})};
h.Z.IC=function(a,c,d){d=d.Aa.pg();a=a.toLowerCase();for(var e=0,f;f=d[e];e++)if(f.name.toLowerCase()==a&&f.type!=c)return f;return null};h.Z.HC=function(a,c){c=c.Aa.pg();a=a.toLowerCase();for(var d=0,e;e=c[d];d++)if(e.name.toLowerCase()==a)return e;return null};h.Z.Eq=function(a){var c=h.g.xml.createElement("field");c.setAttribute("name","VAR");c.setAttribute("id",a.Pa());c.setAttribute("variabletype",a.type);a=h.g.xml.createTextNode(a.name);c.appendChild(a);return c};
h.Z.zv=function(a,c,d,e){var f=h.Z.me(a,c,d,e);f||(f=h.Z.TA(a,c,d,e));return f};h.Z.me=function(a,c,d,e){var f=a.Ig;if(c){var g=a.Cf(c);!g&&f&&(g=f.Cf(c));if(g)return g}if(d){if(void 0==e)throw Error("Tried to look up a variable by name without a type");g=a.me(d,e);!g&&f&&(g=f.me(d,e))}return g};h.Z.TA=function(a,c,d,e){var f=a.Ig;d||(d=h.Z.vB(a.oe?a.ki:a));return f?f.ie(d,e,c):a.ie(d,e,c)};
h.Z.tv=function(a,c){a=a.pg();var d=[];if(c.length!=a.length)for(var e=0;e<a.length;e++){var f=a[e];-1==c.indexOf(f)&&d.push(f)}return d};h.T={};h.T.va=null;h.T.wc=null;h.T.nn=null;h.T.Ja=function(){h.T.va||(h.T.va=document.createElement("div"),h.T.va.className="blocklyWidgetDiv",document.body.appendChild(h.T.va))};h.T.show=function(a,c,d){h.T.ta();h.T.wc=a;h.T.nn=d;h.T.va.style.top=h.g.style.Jv().y+"px";h.T.va.style.direction=c?"rtl":"ltr";h.T.va.style.display="block"};h.T.ta=function(){h.T.wc&&(h.T.wc=null,h.T.va.style.display="none",h.T.va.style.left="",h.T.va.style.top="",h.T.nn&&h.T.nn(),h.T.nn=null,h.T.va.innerHTML="")};
h.T.isVisible=function(){return!!h.T.wc};h.T.kj=function(a){h.T.wc==a&&h.T.ta()};h.T.Dl=function(a,c,d){h.T.va.style.left=a+"px";h.T.va.style.top=c+"px";h.T.va.style.height=d+"px"};h.T.gD=function(a,c,d,e){var f=h.T.vA(a,c,d);a=h.T.uA(a,c,d,e);0>f?h.T.Dl(a,0,d.height+f):h.T.Dl(a,f,d.height)};h.T.uA=function(a,c,d,e){if(e)return c=Math.max(c.right-d.width,a.left),Math.min(c,a.right-d.width);c=Math.min(c.left,a.right-d.width);return Math.max(c,a.left)};
h.T.vA=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};h.VERSION="uncompiled";h.ol=null;h.selected=null;h.cursor=null;h.Se=!1;h.Pk=[];h.xk=null;h.cn=null;h.Up=null;h.rI=null;h.JD=function(a){return{width:a.wu,height:a.uu}};h.dJ=function(a){oa(a)};h.bm=function(a){for(;a.options.Vb;)a=a.options.Vb;var c=x(a),d=c.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.wu!=e&&(c.setAttribute("width",e+"px"),c.wu=e);c.uu!=d&&(c.setAttribute("height",d+"px"),c.uu=d);a.resize()}};
h.SC=function(a){var c=h.ol;if(!(h.g.On(a)||c.ea&&!c.isVisible()))if(c.options.readOnly)h.navigation.Fw(a);else{var d=!1;if(a.keyCode==h.g.Ta.No)h.vc(),h.navigation.Vh(h.navigation.zo);else{if(h.navigation.Fw(a))return;if(a.keyCode==h.g.Ta.Xx||a.keyCode==h.g.Ta.Wj){a.preventDefault();if(h.Di.Xq())return;h.selected&&h.selected.md()&&(d=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(h.Di.Xq())return;h.selected&&h.selected.md()&&h.selected.Rc()&&(a.keyCode==h.g.Ta.ey?(h.vc(),h.Yp(h.selected)):a.keyCode!=
h.g.Ta.ku||h.selected.C.oe||(h.Yp(h.selected),d=!0));a.keyCode==h.g.Ta.Rz?h.xk&&(a=h.cn,a.oe&&(a=a.ki),h.Up&&cb(a,h.Up)&&(h.i.X(!0),vc(a),h.i.X(!1))):a.keyCode==h.g.Ta.$z&&(h.vc(),c.Cs(a.shiftKey))}}d&&!h.selected.C.oe&&(h.i.X(!0),h.vc(),h.selected.J(!0,!0),h.i.X(!1))}};h.Yp=function(a){if(a.cw)var c=a.xs();else{c=h.N.gg(a,!0);h.N.ZA(c);var d=a.Ia();c.setAttribute("x",a.G?-d.x:d.x);c.setAttribute("y",d.y)}h.xk=c;h.cn=a.C;h.Up=a.cw?null:h.g.Fq(a,!0)};
h.ev=function(a){var c=h.xk,d=h.cn;h.Yp(a);vc(a.C);h.xk=c;h.cn=d};h.$I=function(a){h.g.On(a)||a.preventDefault()};h.vc=function(a){h.H.ta();h.T.ta();h.D.lj();a||(a=h.gb(),a.kc&&a.kc.O&&a.kc.O.ta(),a.wa&&a.wa.O&&a.wa.O.Ui&&a.wa.uI())};h.gb=function(){return h.ol};h.alert=function(a,c){alert(a);c&&c()};h.confirm=function(a,c){c(confirm(a))};h.prompt=function(a,c,d){d(prompt(a,c))};h.pC=function(a){return function(){Jb(this,a)}};
h.aq=function(a){for(var c=0;c<a.length;c++){var d=a[c];if(d){var e=d.type;null==e||""===e?console.warn("Block definition #"+c+" in JSON array is missing a type attribute. Skipping."):(h.hb[e]&&console.warn("Block definition #"+c+' in JSON array overwrites prior definition of "'+e+'".'),h.hb[e]={ua:h.pC(d)})}else console.warn("Block definition #"+c+" in JSON array is "+d+". Skipping.")}};
h.pa=function(a,c,d,e,f,g){function k(t){var y=!f;t=h.Touch.CD(t);for(var O=0,V;V=t[O];O++)if(!y||h.Touch.rs(V))h.Touch.vD(V),d?e.call(d,V):e(V),l=!0}var l=!1,m=[];if(h.g.global.PointerEvent&&c in h.Touch.Ee)for(var n=0,r;r=h.Touch.Ee[c][n];n++)a.addEventListener(r,k,!1),m.push([a,r,k]);else if(a.addEventListener(c,k,!1),m.push([a,c,k]),c in h.Touch.Ee){var q=function(t){k(t);var y=!g;l&&y&&t.preventDefault()};for(n=0;r=h.Touch.Ee[c][n];n++)a.addEventListener(r,q,!1),m.push([a,r,q])}return m};
h.ed=function(a,c,d,e){function f(n){d?e.call(d,n):e(n)}var g=[];if(h.g.global.PointerEvent&&c in h.Touch.Ee)for(var k=0,l;l=h.Touch.Ee[c][k];k++)a.addEventListener(l,f,!1),g.push([a,l,f]);else if(a.addEventListener(c,f,!1),g.push([a,c,f]),c in h.Touch.Ee){var m=function(n){if(n.changedTouches&&1==n.changedTouches.length){var r=n.changedTouches[0];n.clientX=r.clientX;n.clientY=r.clientY}f(n);n.preventDefault()};for(k=0;l=h.Touch.Ee[c][k];k++)a.addEventListener(l,m,!1),g.push([a,l,m])}return g};
h.Za=function(a){for(;a.length;){var c=a.pop();c[0].removeEventListener(c[1],c[2],!1)}};h.nC=function(a){return/^\s*-?\d+(\.\d+)?\s*$/.test(a)};h.cC=function(a){return h.g.Db.bC(a)};
h.xA=function(){h.qc("LOGIC_HUE",["Blocks","logic","HUE"],void 0);h.qc("LOGIC_HUE",["Constants","Logic","HUE"],210);h.qc("LOOPS_HUE",["Blocks","loops","HUE"],void 0);h.qc("LOOPS_HUE",["Constants","Loops","HUE"],120);h.qc("MATH_HUE",["Blocks","math","HUE"],void 0);h.qc("MATH_HUE",["Constants","Math","HUE"],230);h.qc("TEXTS_HUE",["Blocks","texts","HUE"],void 0);h.qc("TEXTS_HUE",["Constants","Text","HUE"],160);h.qc("LISTS_HUE",["Blocks","lists","HUE"],void 0);h.qc("LISTS_HUE",["Constants","Lists","HUE"],
260);h.qc("COLOUR_HUE",["Blocks","colour","HUE"],void 0);h.qc("COLOUR_HUE",["Constants","Colour","HUE"],20);h.qc("VARIABLES_HUE",["Blocks","variables","HUE"],void 0);h.qc("VARIABLES_HUE",["Constants","Variables","HUE"],330);h.qc("VARIABLES_DYNAMIC_HUE",["Constants","VariablesDynamic","HUE"],310);h.qc("PROCEDURES_HUE",["Blocks","procedures","HUE"],void 0)};
h.qc=function(a,c,d){for(var e="Blockly",f=h,g=0;g<c.length;++g)e+="."+c[g],f&&(f=f[c[g]]);f&&f!==d&&(a=(void 0===d?'%1 has been removed. Use Blockly.Msg["%2"].':'%1 is deprecated and unused. Override Blockly.Msg["%2"].').replace("%1",e).replace("%2",a),console.warn(a))};h.Ra=function(a,c,d){"function"!=typeof a&&h.Ra.Cx(a);this.Oh=a;this.wn=null;this.Kl=0;this.ws=this.Rr=null;a=this.Oh;if(Array.isArray(a)){for(var e=!1,f=0;f<a.length;f++){var g=a[f][0];"string"==typeof g?a[f][0]=h.g.te(g):(null!=g.alt&&(a[f][0].alt=h.g.te(g.alt)),e=!0)}if(!(e||2>a.length)){e=[];for(f=0;f<a.length;f++)e.push(a[f][0]);f=h.g.Oa.qs(e);g=h.g.Oa.JA(e,f);var k=h.g.Oa.KA(e,f);!g&&!k||f<=g+k||(g&&(this.Rr=e[0].substring(0,g-1)),k&&(this.ws=e[0].substr(1-k)),this.Oh=h.Ra.jA(a,g,k))}}a=this.getOptions(!1)[0];
h.Ra.w.constructor.call(this,a[1],c,d);this.Fj=this.tg=null};h.g.object.S(h.Ra,h.Fa);h.Ra.qa=function(a){return new h.Ra(a.options,void 0,a)};h.Ra.prototype.Mi=!0;h.Ra.uE=25;h.Ra.cG=.45;h.Ra.mt=5;h.Ra.Ty=2*h.Ra.mt;h.Ra.Ns=h.g.userAgent.wi?"\u25bc":"\u25be";b=h.Ra.prototype;b.Ys="default";
b.pj=function(){h.Ra.w.pj.call(this);this.tg=h.g.m.L("image",{y:h.Ra.mt},this.le);this.ce=h.g.m.L("tspan",{},this.Uc);this.ce.appendChild(document.createTextNode(this.A.G?h.Ra.Ns+" ":" "+h.Ra.Ns));this.A.G?this.Uc.insertBefore(this.ce,this.Lj):this.Uc.appendChild(this.ce)};b.Pg=function(){this.Kf=this.vq();this.Kf.ya(h.D.vv());h.g.m.Bb(this.Kf.ka,"blocklyDropdownMenu");h.D.nx(this,this.wq.bind(this));this.Kf.focus();this.Fj&&h.g.style.ax(this.Fj.ka,this.Kf.ka)};
b.vq=function(){var a=new h.$g;ea(a,this.A.G);a.Ij("listbox");var c=this.getOptions(!1);this.Fj=null;for(var d=0;d<c.length;d++){var e=c[d][0],f=c[d][1];if("object"==typeof e){var g=new Image(e.width,e.height);g.src=e.src;g.alt=e.alt||"";e=g}e=new h.Jm(e);e.Ij("option");ea(e,this.A.G);e.setValue(f);e.vk=!0;da(a,e);Vb(e,f==this.Nc);f==this.Nc&&(this.Fj=e);Wb(e,this.SB,this)}h.g.Da.$e(a.ka,h.g.Da.State.Rx,this.Fj?this.Fj.Pa():"");return a};b.wq=function(){this.Kf.J();this.Kf=null};
b.SB=function(a){h.D.kj(this,!0);this.Ew(a)};b.Ew=function(a){this.setValue(a.getValue())};h.Ra.jA=function(a,c,d){for(var e=[],f=0;f<a.length;f++){var g=a[f][0],k=a[f][1];g=g.substring(c,g.length-d);e[f]=[g,k]}return e};b=h.Ra.prototype;b.getOptions=function(a){return"function"==typeof this.Oh?(this.wn&&a||(this.wn=this.Oh.call(this),h.Ra.Cx(this.wn)),this.wn):this.Oh};
b.vh=function(a){for(var c=!1,d=this.getOptions(!0),e=0,f;f=d[e];e++)if(f[1]==a){c=!0;break}return c?a:(this.A&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.A.type+", Field name: "+this.name+", Value: "+a),null)};b.cj=function(a){h.Ra.w.cj.call(this,a);a=this.getOptions(!0);for(var c=0,d;d=a[c];c++)d[1]==this.Nc&&(this.Kl=c)};b.we=function(){this.A&&this.ce&&(this.ce.style.fill=this.A.Qa?Fb(this.A):this.A.jg)};
b.Xe=function(){this.Lj.nodeValue="";this.tg.style.display="none";var a=this.getOptions(!0),c=0<=this.Kl&&a[this.Kl][0];if(c&&"object"==typeof c){this.tg.style.display="";this.tg.setAttributeNS(h.g.m.Ge,"xlink:href",c.src);this.tg.setAttribute("height",c.height);this.tg.setAttribute("width",c.width);a=h.g.m.Mq(this.ce);var d=Number(c.width);this.Gb.height=Number(c.height)+h.Ra.Ty;this.Gb.width=d+a+h.Fa.pk;this.A.G?(c=h.Fa.Ci-1,this.tg.setAttribute("x",h.Fa.Ci+a),this.Uc.setAttribute("x",c)):(c=d+
a+h.Fa.Ci+1,this.Uc.setAttribute("text-anchor","end"),this.Uc.setAttribute("x",c),this.tg.setAttribute("x",h.Fa.Ci))}else this.Lj.nodeValue=zb(this),this.Uc.setAttribute("text-anchor","start"),this.Uc.setAttribute("x",h.Fa.Ci),this.Gb.height=h.Fa.Ts,this.Gb.width=h.g.m.Mq(this.Uc)+h.Fa.pk;this.jh.setAttribute("height",this.Gb.height);this.jh.setAttribute("width",this.Gb.width)};b.Nq=function(){if(0>this.Kl)return null;var a=this.getOptions(!0)[this.Kl][0];return"object"==typeof a?a.alt:a};
h.Ra.Cx=function(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");for(var c=!1,d=0;d<a.length;++d){var e=a[d];Array.isArray(e)?"string"!=typeof e[1]?(c=!0,console.error("Invalid option["+d+"]: Each FieldDropdown option id must be a string. Found "+e[1]+" in: ",e)):e[0]&&"string"!=typeof e[0]&&"string"!=typeof e[0].src&&(c=!0,console.error("Invalid option["+d+"]: Each FieldDropdown option must have a string label or image description. Found"+
e[0]+" in: ",e)):(c=!0,console.error("Invalid option["+d+"]: Each FieldDropdown option must be an array. Found: ",e))}if(c)throw TypeError("Found invalid FieldDropdown options.");};h.Ra.prototype.Vh=function(a){if(this.Kf){if(a===h.navigation.Bo)return Rb(this.Kf),!0;if(a===h.navigation.Ao)return Pb(this.Kf),!0}return h.Ra.w.Vh.call(this,a)};h.tc.register("field_dropdown",h.Ra);h.Sd=function(a){h.Sd.w.constructor.call(this,null);this.Uw=a};h.g.object.S(h.Sd,h.xd);b=h.Sd.prototype;b.Rj=0;b.mm=0;
b.dv=function(a){h.g.m.L("rect",{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);h.g.m.L("path",{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},a);
h.g.m.L("circle",{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};b.Wq=function(a){this.R.Jc()&&h.xd.prototype.Wq.call(this,a)};
function Dc(a){a.Yl=h.g.m.L("svg",{x:h.oa.Yc,y:h.oa.Yc},null);if(a.Uw.length)for(var c=h.g.xml.createElement("xml"),d=0,e;e=a.Uw[d];d++){var f=h.g.xml.createElement("block");f.setAttribute("type",e);c.appendChild(f)}else c=null;c={disable:!1,uh:a.R.C.options.uh,ll:c,Vb:a.R.C,Bj:a.R.C.options.Bj,G:a.R.G,Ya:a.R.G?h.fg:h.zd,Hf:!1,uc:a.JB.bind(a),Og:null,ai:a.R.C.options.ai};a.s=new h.Ua(c);a.s.Kh=!0;K(a.s,h.i.Zu);c=sc(a.s,"g");d=a.s.Ja("blocklyMutatorBackground");d.insertBefore(c,a.s.Xa);a.Yl.appendChild(d);
return a.Yl}b.oi=function(){h.Sd.w.oi.call(this);this.R.Qc||(this.R.Jc()?this.Pc&&h.g.m.Lc(this.Pc,"blocklyIconGroupReadonly"):(this.yb(!1),this.Pc&&h.g.m.Bb(this.Pc,"blocklyIconGroupReadonly")))};
function Ec(a){var c=2*h.oa.Yc,d=a.s.Xa.getBBox();var e=a.R.G?-d.x:d.width+d.x;d=d.height+3*c;if(a.s.O){var f=a.s.O.Uk();d=Math.max(d,f.hd+20)}e+=3*c;if(Math.abs(a.Rj-e)>c||Math.abs(a.mm-d)>c)a.Rj=e,a.mm=d,gb(a.Cd,e+c,d+c),a.Yl.setAttribute("width",a.Rj),a.Yl.setAttribute("height",a.mm);a.R.G&&a.s.Xa.setAttribute("transform","translate("+a.Rj+",0)");a.s.resize()}
b.yb=function(a){if(a!=this.isVisible())if(h.i.Ha(new h.i.dd(this.R,"mutatorOpen",!a,a)),a){this.Cd=new h.oa(this.R.C,Dc(this),this.R.rd,this.Zk,null,null);ib(this.Cd,this.R.id);if(a=this.s.options.ll)this.s.O.ua(this.s),this.s.O.show(a.childNodes);this.Nf=this.R.Lk(this.s);a=p(this.Nf,!1);for(var c=0,d;d=a[c];c++)d.ya();this.Nf.io(!1);this.Nf.Mk=!1;this.s.O?(a=2*this.s.O.fb,c=tc(this.s).Df()+a):c=a=16;this.R.G&&(c=-c);this.Nf.moveBy(c,a);if(this.R.hs){var e=this;this.R.hs(this.Nf);this.mo=function(){e.R.hs(e.Nf)};
K(this.R.C,this.mo)}Ec(this);K(this.s,this.ZD.bind(this));this.we()}else this.Yl=null,this.s.J(),this.Nf=this.s=null,this.Cd.J(),this.Cd=null,this.mm=this.Rj=0,this.mo&&(eb(this.R.C,this.mo),this.mo=null)};
b.ZD=function(a){if(a.type!=h.i.Vm&&(a.type!=h.i.yi||"disabled"!=a.element)){if(!this.s.gc()){a=D(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Ia(),f=G(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.Nf.C==this.s){h.i.X(!0);d=this.R;a=(a=d.hc())&&h.N.Fc(a);c=d.ea;d.ea=!1;d.Ak(this.Nf);d.ea=c;d.Re();c=(c=d.hc())&&h.N.Fc(c);if(a!=c){h.i.Ha(new h.i.Rf(d,"mutation",null,a,c));var g=h.i.Fb();setTimeout(function(){h.i.X(g);d.Ob();h.i.X(!1)},h.rm)}d.ea&&d.ya();a!=c&&h.Se&&h.navigation.EC(d);this.s.gc()||
Ec(this);h.i.X(!1)}}};b.JB=function(){return{vb:this.mm,lb:this.Rj-tc(this.s).Df(),oc:0,dc:this.s.G?0:tc(this.s).Df()}};b.J=function(){this.R.se=null;h.xd.prototype.J.call(this)};h.Sd.Vr=function(a,c,d){if(a&&a.A.C){d=B(c,d).connection;var e=z(a);e&&e!=c||d.ga==a||(d.isConnected()&&d.disconnect(),d.connect(a))}};h.Sd.BI=function(a){var c=null;if(a&&a.options){var d=a.options.Vb;a.oe?d&&d.options&&(c=d.options.Vb):d&&(c=d)}return c};h.hb.tC={};h.cb={};h.cb.$c={};h.cb.$c.Ry=210;
h.aq([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,
nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",
helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["\u2260","NEQ"],["\u200f<","LT"],["\u200f\u2264","LTE"],["\u200f>","GT"],["\u200f\u2265","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",
message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",
tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",
name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]}]);
h.aq([{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",
tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]);h.cb.$c.yp={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};h.ba.register("logic_op_tooltip",h.ba.tu(h.cb.$c.yp));
h.cb.$c.py={jd:0,ke:0,po:!0,hc:function(){if(!this.jd&&!this.ke)return null;var a=h.g.xml.createElement("mutation");this.jd&&a.setAttribute("elseif",this.jd);this.ke&&a.setAttribute("else",1);return a},Gd:function(a){this.jd=parseInt(a.getAttribute("elseif"),10)||0;this.ke=parseInt(a.getAttribute("else"),10)||0;this.iD()},Lk:function(a){var c=a.yj("controls_if_if");c.Re();for(var d=c.V,e=1;e<=this.jd;e++){var f=a.yj("controls_if_elseif");f.Re();d.connect(f.U);d=f.V}this.ke&&(a=a.yj("controls_if_else"),
a.Re(),d.connect(a.U));return c},Ak:function(a){a=z(a.V);this.ke=this.jd=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.jd++;c.push(a.UD);d.push(a.vs);break;case "controls_if_else":this.ke++;e=a.vs;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.V&&z(a.V)}this.im();this.Vw(c,d,e)},hs:function(a){a=z(a.V);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=B(this,"IF"+c),e=B(this,"DO"+c);a.UD=d&&d.connection.ga;a.vs=e&&e.connection.ga;
c++;break;case "controls_if_else":e=B(this,"ELSE");a.vs=e&&e.connection.ga;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.V&&z(a.V)}},iD:function(){var a=[null],c=[null],d=null;B(this,"ELSE")&&(d=B(this,"ELSE").connection.ga);for(var e=1;B(this,"IF"+e);){var f=B(this,"DO"+e);a.push(B(this,"IF"+e).connection.ga);c.push(f.connection.ga);e++}this.im();this.Vw(a,c,d)},im:function(){B(this,"ELSE")&&this.Zh("ELSE");for(var a=1;B(this,"IF"+a);)this.Zh("IF"+a),this.Zh("DO"+a),a++;for(a=
1;a<=this.jd;a++)L(Ib(this,"IF"+a).Mc("Boolean"),h.h.CONTROLS_IF_MSG_ELSEIF),L(this.ae(h.Ga,"DO"+a),h.h.CONTROLS_IF_MSG_THEN);this.ke&&L(this.ae(h.Ga,"ELSE"),h.h.CONTROLS_IF_MSG_ELSE)},Vw:function(a,c,d){for(var e=1;e<=this.jd;e++)h.Sd.Vr(a[e],this,"IF"+e),h.Sd.Vr(c[e],this,"DO"+e);h.Sd.Vr(d,this,"ELSE")}};h.ba.Xr("controls_if_mutator",h.cb.$c.py,null,["controls_if_elseif","controls_if_else"]);
h.cb.$c.qy=function(){this.Od(function(){if(this.jd||this.ke){if(!this.jd&&this.ke)return h.h.CONTROLS_IF_TOOLTIP_2;if(this.jd&&!this.ke)return h.h.CONTROLS_IF_TOOLTIP_3;if(this.jd&&this.ke)return h.h.CONTROLS_IF_TOOLTIP_4}else return h.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};h.ba.register("controls_if_tooltip",h.cb.$c.qy);
h.cb.$c.gz={onchange:function(a){this.El||(this.El=[null,null]);var c=Kb(this,"A"),d=Kb(this,"B");c&&d&&!Ga(c.M,d.M)&&(h.i.X(a.group),a=this.El[0],a!==c&&(A(c),a&&!a.Qa&&B(this,"A").connection.connect(a.M)),c=this.El[1],c!==d&&(A(d),c&&!c.Qa&&B(this,"B").connection.connect(c.M)),this.Ob(),h.i.X(!1));this.El[0]=Kb(this,"A");this.El[1]=Kb(this,"B")}};h.cb.$c.fz=function(){this.Ph(h.cb.$c.gz)};h.ba.register("logic_compare",h.cb.$c.fz);
h.cb.$c.hz={Rw:null,onchange:function(a){var c=Kb(this,"THEN"),d=Kb(this,"ELSE"),e=this.M.ga;if((c||d)&&e)for(var f=0;2>f;f++){var g=1==f?c:d;g&&!Ga(g.M,e)&&(h.i.X(a.group),e===this.Rw?(A(this),e.A.Ob()):(A(g),g.Ob()),h.i.X(!1))}this.Rw=e}};h.ba.jD();h.Ab=function(a,c,d){this.px=!0;null==a&&(a="");h.Ab.w.constructor.call(this,a,c,d)};h.g.object.S(h.Ab,h.Fa);h.Ab.qa=function(a){var c=h.g.te(a.text);return new h.Ab(c,void 0,a)};h.Ab.prototype.Mi=!0;h.Ab.Hy=11;h.Ab.$x=4;b=h.Ab.prototype;b.Ys="text";b.Ed=function(a){h.Ab.w.Ed.call(this,a);"boolean"==typeof a.spellcheck&&(this.px=a.spellcheck)};b.vh=function(a){return null===a||void 0===a?null:String(a)};
b.bv=function(){if(this.sj){this.gr=!1;var a=this.Nc;this.Nc=this.Ic.TD;this.A&&h.i.isEnabled()&&h.i.Ha(new h.i.Rf(this.A,"field",this.name||null,a,this.Nc))}};b.cj=function(a){this.gr=!0;this.Nc=a;this.sj||(this.Jf=!0)};b.Xe=function(){h.Ab.w.Xe.call(this);this.sj&&(this.A.G?setTimeout(this.fo.bind(this),0):this.fo(),this.gr?(h.g.m.Lc(this.Ic,"blocklyInvalidInput"),h.g.Da.$e(this.Ic,"invalid",!1)):(h.g.m.Bb(this.Ic,"blocklyInvalidInput"),h.g.Da.$e(this.Ic,"invalid",!0)))};
b.Pg=function(a){this.s=this.A.C;a=a||!1;!a&&(h.g.userAgent.zt||h.g.userAgent.wi||h.g.userAgent.Zg)?Fc(this):(h.T.show(this,this.A.G,this.YD.bind(this)),this.Ic=this.Ds(),this.sj=!0,a||(this.Ic.focus(),this.Ic.select()))};function Fc(a){h.prompt(h.h.CHANGE_VALUE_TITLE,a.kd(),function(c){a.setValue(c)})}
b.Ds=function(){var a=h.T.va,c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.px);var d=h.Ab.Hy*this.s.scale+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=h.Ab.$x*this.s.scale+"px";a.appendChild(c);c.value=c.defaultValue=String(this.Nc);c.TD=this.Nc;c.Cw=null;h.g.userAgent.Po?setTimeout(this.fo.bind(this),0):this.fo();this.Kr=h.pa(c,"keydown",this,this.Jr);this.TC=h.pa(c,"input",this,this.RC);return c};
b.YD=function(){this.sj=!1;this.gr=!0;ab(this);this.QC&&this.QC(this.Nc);h.Za(this.Kr);h.Za(this.TC);var a=h.T.va.style;a.width="auto";a.height="auto";a.fontSize=""};b.Jr=function(a){a.keyCode==h.g.Ta.Mo?(h.T.ta(),h.D.lj()):a.keyCode==h.g.Ta.No?(this.Ic.value=this.Ic.defaultValue,h.T.ta(),h.D.lj()):a.keyCode==h.g.Ta.Wt&&(h.T.ta(),h.D.lj(),jc(this.A,this,!a.shiftKey),a.preventDefault())};b.RC=function(){var a=this.Ic.value;a!==this.Ic.Cw&&(this.Ic.Cw=a,h.i.X(!0),this.setValue(a),ab(this),h.i.X(!1))};
b.fo=function(){var a=h.T.va;var c=this.jh.getBBox();var d=c.height*this.A.C.scale;var e=c.width*this.A.C.scale;var f=h.g.style.zh(this.jh);c=f.y;d=f.y+d;var g=f.x;e=f.x+e;a.style.width=e-g+"px";a.style.height=d-c+"px";c=new h.g.I(this.A.G?e-a.offsetWidth:g,c);c.y+=1;h.g.userAgent.Po&&h.T.va.style.top&&(--c.x,--c.y);h.g.userAgent.Cp&&(c.y-=3);a.style.left=c.x+"px";a.style.top=c.y+"px"};
h.Ab.NC=function(a){console.warn("Blockly.FieldTextInput.numberValidator is deprecated. Use Blockly.FieldNumber instead.");if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=Number(a||0);return isNaN(a)?null:String(a)};h.Ab.ZI=function(a){(a=h.Ab.NC(a))&&(a=String(Math.max(0,Math.floor(a))));return a};h.Ab.prototype.fw=function(){return!0};h.Ab.prototype.Nq=function(){return this.sj&&this.Ic?this.Ic.value:null};h.tc.register("field_input",h.Ab);h.Rd=function(a,c,d,e,f,g){this.yl=-Infinity;this.wl=Infinity;this.Dj=0;this.$p=null;h.Rd.w.constructor.call(this,a||0,f,g);g||(Gc(this,c),Hc(this,d),Ic(this,e),this.setValue(this.getValue()))};h.g.object.S(h.Rd,h.Ab);h.Rd.qa=function(a){return new h.Rd(a.value,void 0,void 0,void 0,void 0,a)};h.Rd.prototype.Mi=!0;h.Rd.prototype.Ed=function(a){h.Rd.w.Ed.call(this,a);Gc(this,a.min);Hc(this,a.max);Ic(this,a.precision)};function Gc(a,c){null==c?a.yl=-Infinity:(c=Number(c),isNaN(c)||(a.yl=c))}
function Hc(a,c){null==c?a.wl=Infinity:(c=Number(c),isNaN(c)||(a.wl=c))}function Ic(a,c){null==c?a.Dj=0:(c=Number(c),isNaN(c)||(a.Dj=c));var d=a.Dj.toString(),e=d.indexOf(".");a.$p=-1==e?c?0:null:d.length-e-1}h.Rd.prototype.vh=function(a){if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=Number(a||0);if(isNaN(a))return null;a=Math.min(Math.max(a,this.yl),this.wl);this.Dj&&isFinite(a)&&(a=Math.round(a/this.Dj)*this.Dj);null!=this.$p&&(a=Number(a.toFixed(this.$p)));return a};
h.Rd.prototype.Ds=function(){var a=h.Rd.w.Ds.call(this);-Infinity<this.yl&&h.g.Da.$e(a,h.g.Da.State.Tz,this.yl);Infinity>this.wl&&h.g.Da.$e(a,h.g.Da.State.Sz,this.wl);return a};h.tc.register("field_number",h.Rd);h.wd=function(a,c,d,e,f){this.Oh=h.wd.mB;this.YA=a||"";this.Gb=new h.g.Yd(0,h.ra.$o);f&&this.Ed(f);c&&(this.lm=c);f||Jc(this,d,e)};h.g.object.S(h.wd,h.Ra);h.wd.qa=function(a){var c=h.g.te(a.variable);return new h.wd(c,void 0,void 0,void 0,a)};b=h.wd.prototype;b.s=null;b.Mi=!0;b.Ed=function(a){h.wd.w.Ed.call(this,a);Jc(this,a.variableTypes,a.defaultType)};b.Fh=function(){if(!this.Vc){var a=h.Z.zv(this.A.C,null,this.YA,this.XA);h.i.disable();this.setValue(a.Pa());h.i.enable()}};
b.Sk=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=h.Z.zv(this.A.C,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.Pa()+"' had type "+c.type+", and does not match variable field that references it: "+h.N.Fc(a)+".");this.setValue(c.Pa())};b.xx=function(a){this.Fh();a.id=this.Vc.Pa();a.textContent=this.Vc.name;this.Vc.type&&a.setAttribute("variabletype",this.Vc.type);return a};
b.ps=function(a){if(a.Qa)throw Error("Variable fields are not allowed to exist on shadow blocks.");h.wd.w.ps.call(this,a)};b.getValue=function(){return this.Vc?this.Vc.Pa():null};b.kd=function(){return this.Vc?this.Vc.name:""};b.me=function(){return this.Vc};b.Iv=function(){return this.Vc?this.lm:null};
b.vh=function(a){if(null===a)return null;var c=h.Z.me(this.A.C,a);if(!c)return console.warn("Variable id doesn't point to a real variable! ID was "+a),null;c=c.type;var d;a:if(d=Kc(this)){for(var e=0;e<d.length;e++)if(c==d[e]){d=!0;break a}d=!1}else d=!0;return d?a:(console.warn("Variable type doesn't match this field! Type was "+c),null)};b.cj=function(a){this.Vc=h.Z.me(this.A.C,a);h.wd.w.cj.call(this,a)};
function Kc(a){var c=a.VD;if(null===c&&a.A&&a.A.C)return a.A.C.Qq();c=c||[""];if(0==c.length)throw a=a.kd(),Error("'variableTypes' of field variable "+a+" was an empty list");return c}
function Jc(a,c,d){d=d||"";if(null==c||void 0==c)c=null;else if(Array.isArray(c)){for(var e=!1,f=0;f<c.length;f++)c[f]==d&&(e=!0);if(!e)throw Error("Invalid default type '"+d+"' in the definition of a FieldVariable");}else throw Error("'variableTypes' was not an array in the definition of a FieldVariable");a.XA=d;a.VD=c}
h.wd.mB=function(){if(!this.Vc)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");var a=this.kd(),c=[];if(this.A&&this.A.C)for(var d=Kc(this),e=0;e<d.length;e++)c=c.concat(this.A.C.Vk(d[e]));c.sort(h.kk.Gu);d=[];for(e=0;e<c.length;e++)d[e]=[c[e].name,c[e].Pa()];d.push([h.h.RENAME_VARIABLE,h.Qt]);h.h.DELETE_VARIABLE&&d.push([h.h.DELETE_VARIABLE.replace("%1",a),h.dt]);return d};
h.wd.prototype.Ew=function(a){a=a.getValue();if(this.A&&this.A.C){if(a==h.Qt){h.Z.Yr(this.A.C,this.Vc);return}if(a==h.dt){this.A.C.sh(this.Vc.Pa());return}}this.setValue(a)};h.wd.prototype.eo=function(){return!0};h.tc.register("field_variable",h.wd);h.hb.Lb={};h.cb.Math={};h.cb.Math.Ry=230;
h.aq([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],
["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",
name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",
extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["\u03c0","PI"],["e","E"],["\u03c6","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(\u00bd)","SQRT1_2"],["\u221e","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",
options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},
{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",
helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}",
"RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",
message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,
output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",
style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]);
h.cb.Math.yp={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",
SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};
h.ba.register("math_op_tooltip",h.ba.tu(h.cb.Math.yp));h.cb.Math.Wy={hc:function(){var a=h.g.xml.createElement("mutation"),c="DIVISIBLE_BY"==F(this,"PROPERTY");a.setAttribute("divisor_input",c);return a},Gd:function(a){a="true"==a.getAttribute("divisor_input");this.im(a)},im:function(a){var c=B(this,"DIVISOR");a?c||Ib(this,"DIVISOR").Mc("Number"):c&&this.Zh("DIVISOR")}};h.cb.Math.Xy=function(){yb(ha(this,"PROPERTY"),function(a){this.A.im("DIVISIBLE_BY"==a)})};
h.ba.Xr("math_is_divisibleby_mutator",h.cb.Math.Wy,h.cb.Math.Xy);h.ba.register("math_change_tooltip",h.ba.tA());h.cb.Math.ez={Bx:function(a){"MODE"==a?this.M.Mc("Array"):this.M.Mc("Number")},hc:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("op",F(this,"OP"));return a},Gd:function(a){this.Bx(a.getAttribute("op"))}};h.cb.Math.dz=function(){yb(ha(this,"OP"),function(a){this.Bx(a)}.bind(this))};h.ba.Xr("math_modes_of_list_mutator",h.cb.Math.ez,h.cb.Math.dz);h.$=function(a,c,d){this.yk=h.$.iy;this.Uh=h.$.$f;this.Ix=h.$.Wz;this.Jl=h.$.Cz;h.$.w.constructor.call(this,a||0,c,d)};h.g.object.S(h.$,h.Ab);h.$.qa=function(a){return new h.$(a.angle,void 0,a)};h.$.prototype.Mi=!0;h.$.Cz=15;h.$.Jb=50;h.$.iy=!1;h.$.$f=0;h.$.Wz=360;h.$.pf=h.$.Jb-1;b=h.$.prototype;
b.Ed=function(a){h.$.w.Ed.call(this,a);switch(a.mode){case "compass":this.yk=!0;this.Uh=90;break;case "protractor":this.yk=!1,this.Uh=0}var c=a.clockwise;"boolean"==typeof c&&(this.yk=c);c=a.offset;null!=c&&(c=Number(c),isNaN(c)||(this.Uh=c));c=a.wrap;null!=c&&(c=Number(c),isNaN(c)||(this.Ix=c));a=a.round;null!=a&&(a=Number(a),isNaN(a)||(this.Jl=a))};b.pj=function(){h.$.w.pj.call(this);this.vx=h.g.m.L("tspan",{},null);this.vx.appendChild(document.createTextNode("\u00b0"));this.Uc.appendChild(this.vx)};
b.Xe=function(){h.$.w.Xe.call(this);Lc(this)};b.Pg=function(){h.$.w.Pg.call(this,h.g.userAgent.zt||h.g.userAgent.wi||h.g.userAgent.Zg);var a=this.vq();h.D.vv().appendChild(a);a=Gb(this.A);a=a.dn||a.Vp;h.D.od(this.A.jg,a);h.D.nx(this,this.wq.bind(this));Lc(this)};
b.vq=function(){var a=h.g.m.L("svg",{xmlns:h.g.m.nc,"xmlns:html":h.g.m.Em,"xmlns:xlink":h.g.m.Ge,version:"1.1",height:2*h.$.Jb+"px",width:2*h.$.Jb+"px",style:"touch-action: none"},null),c=h.g.m.L("circle",{cx:h.$.Jb,cy:h.$.Jb,r:h.$.pf,"class":"blocklyAngleCircle"},a);this.Dq=h.g.m.L("path",{"class":"blocklyAngleGauge"},a);this.lw=h.g.m.L("line",{x1:h.$.Jb,y1:h.$.Jb,"class":"blocklyAngleLine"},a);for(var d=0;360>d;d+=15)h.g.m.L("line",{x1:h.$.Jb+h.$.pf,y1:h.$.Jb,x2:h.$.Jb+h.$.pf-(0==d%45?10:5),y2:h.$.Jb,
"class":"blocklyAngleMarks",transform:"rotate("+d+","+h.$.Jb+","+h.$.Jb+")"},a);this.HA=h.pa(a,"click",this,this.$B);this.GA=h.pa(c,"click",this,this.Iw,!0,!0);this.FC=h.pa(c,"mousemove",this,this.Iw,!0,!0);return a};b.wq=function(){h.Za(this.HA);h.Za(this.GA);h.Za(this.FC)};b.$B=function(){h.D.kj(this);h.T.ta()};
b.Iw=function(a){var c=this.Dq.ownerSVGElement.getBoundingClientRect(),d=a.clientX-c.left-h.$.Jb;a=a.clientY-c.top-h.$.Jb;c=Math.atan(-a/d);isNaN(c)||(c=h.g.Lb.wx(c),0>d?c+=180:0<a&&(c+=360),c=this.yk?this.Uh+360-c:360-(this.Uh-c),Mc(this,c))};function Mc(a,c){a.Jl&&(c=Math.round(c/a.Jl)*a.Jl);c=Nc(a,c);c!=a.Nc&&(a.Jf=!0,a.sj&&(a.Ic.value=String(c)),a.setValue(c))}
function Lc(a){if(a.Dq){var c=Number(a.kd())+a.Uh,d=h.g.Lb.li(c%360);c=["M ",h.$.Jb,",",h.$.Jb];var e=h.$.Jb,f=h.$.Jb;if(!isNaN(d)){var g=Number(a.yk),k=h.g.Lb.li(a.Uh),l=Math.cos(k)*h.$.pf,m=Math.sin(k)*-h.$.pf;g&&(d=2*k-d);e+=Math.cos(d)*h.$.pf;f-=Math.sin(d)*h.$.pf;d=Math.abs(Math.floor((d-k)/Math.PI)%2);g&&(d=1-d);c.push(" l ",l,",",m," A ",h.$.pf,",",h.$.pf," 0 ",d," ",g," ",e,",",f," z")}a.Dq.setAttribute("d",c.join(""));a.lw.setAttribute("x2",e);a.lw.setAttribute("y2",f)}}
b.Jr=function(a){h.$.w.Jr.call(this,a);var c;a.keyCode===h.g.Ta.bz?c=this.A.G?1:-1:a.keyCode===h.g.Ta.Bz?c=this.A.G?-1:1:a.keyCode===h.g.Ta.ft?c=-1:a.keyCode===h.g.Ta.au&&(c=1);if(c){var d=this.getValue();Mc(this,d+c*this.Jl);a.preventDefault();a.stopPropagation()}};b.vh=function(a){a=Number(a);return isNaN(a)||!isFinite(a)?null:Nc(this,a)};function Nc(a,c){c%=360;0>c&&(c+=360);c>a.Ix&&(c-=360);return c}h.Zc.register(".blocklyAngleCircle {,stroke: #444;,stroke-width: 1;,fill: #ddd;,fill-opacity: .8;,},.blocklyAngleMarks {,stroke: #444;,stroke-width: 1;,},.blocklyAngleGauge {,fill: #f88;,fill-opacity: .8;,pointer-events: none;,},.blocklyAngleLine {,stroke: #f00;,stroke-width: 2;,stroke-linecap: round;,pointer-events: none;,}".split(","));
h.tc.register("field_angle",h.$);h.Generator=function(a){this.JC=a;this.Iy=new RegExp(this.Tf,"g")};h.Generator.Zf="generated_function";b=h.Generator.prototype;b.Oi=null;b.sf=null;b.Fm=" ";b.ky=60;b.Om=[];
function Oc(){var a=h.o,c=C;c||(console.warn("No workspace specified in workspaceToCode call. Guessing."),c=h.gb());var d=[];a.ua(c);c=D(c,!0);for(var e=0,f;f=c[e];e++){var g=Pc(a,f);Array.isArray(g)&&(g=g[0]);g&&(f.M&&(g=a.bx(g),a.Oi&&!f.po&&(g=Qc(a.Oi,f)+g),a.sf&&!f.po&&(g+=Qc(a.sf,f))),d.push(g))}d=d.join("\n");d=a.finish(d);d=d.replace(/^\s+\n/,"");d=d.replace(/\n\s+$/,"\n");return d=d.replace(/[ \t]+\n/g,"\n")}function Rc(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)}
function Pc(a,c){if(!c)return"";if(!c.isEnabled())return Pc(a,u(c));var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.JC+'" does not know how to generate code for block type "'+c.type+'".');d=d.call(c,c);if(Array.isArray(d)){if(!c.M)throw TypeError("Expecting string from statement block: "+c.type);return[a.js(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.Oi&&!c.po&&(d=Qc(a.Oi,c)+d),a.sf&&!c.po&&(d+=Qc(a.sf,c)),a.js(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+
d);}
function N(a,c,d){var e=h.o;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=Kb(a,c);if(!f)return"";c=Pc(e,f);if(""===c)return"";if(!Array.isArray(c))throw TypeError("Expecting tuple from value block: "+f.type);a=c[0];c=c[1];if(isNaN(c))throw TypeError("Expecting valid order from value block: "+f.type);if(!a)return"";f=!1;var g=Math.floor(d),k=Math.floor(c);if(g<=k&&(g!=k||0!=g&&99!=g))for(f=!0,g=0;g<e.Om.length;g++)if(e.Om[g][0]==d&&e.Om[g][1]==c){f=!1;break}f&&(a="("+
a+")");return a}function Sc(a,c){var d=h.o;a=Kb(a,c);c=Pc(d,a);if("string"!=typeof c)throw TypeError("Expecting code from statement block: "+(a&&a.type));c&&(c=Rc(c,d.Fm));return c}function Qc(a,c){c=c.id.replace(/\$/g,"$$$$");return a.replace(/%1/g,"'"+c+"'")}b.lp="";function Tc(a){var c=h.o;c.lp+=a+","}b.Tf="{leCUI8hutHZI4480Dc}";
function Uc(a,c){var d=h.o;if(!d.aj[a]){var e=Cc(d.Pj,a,h.sb.Zf);d.Bq[a]=e;c=c.join("\n").replace(d.Iy,e);for(var f;f!=c;)f=c,c=c.replace(/^(( {2})*) {2}/gm,"$1\x00");c=c.replace(/\0/g,d.Fm);d.aj[a]=c}return d.Bq[a]}b.ua=function(){};b.js=function(a,c){return c};b.finish=function(a){return a};b.bx=function(a){return a};h.o=new h.Generator("JavaScript");Tc("Blockly,break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with,class,enum,export,extends,import,super,implements,interface,let,package,private,protected,public,static,yield,const,null,true,false,Array,ArrayBuffer,Boolean,Date,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Error,eval,EvalError,Float32Array,Float64Array,Function,Infinity,Int16Array,Int32Array,Int8Array,isFinite,isNaN,Iterator,JSON,Math,NaN,Number,Object,parseFloat,parseInt,RangeError,ReferenceError,RegExp,StopIteration,String,SyntaxError,TypeError,Uint16Array,Uint32Array,Uint8Array,Uint8ClampedArray,undefined,uneval,URIError,applicationCache,closed,Components,content,_content,controllers,crypto,defaultStatus,dialogArguments,directories,document,frameElement,frames,fullScreen,globalStorage,history,innerHeight,innerWidth,length,location,locationbar,localStorage,menubar,messageManager,mozAnimationStartTime,mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,pkcs11,returnValue,screen,screenX,screenY,scrollbars,scrollMaxX,scrollMaxY,scrollX,scrollY,self,sessionStorage,sidebar,status,statusbar,toolbar,top,URL,window,addEventListener,alert,atob,back,blur,btoa,captureEvents,clearImmediate,clearInterval,clearTimeout,close,confirm,disableExternalCapture,dispatchEvent,dump,enableExternalCapture,escape,find,focus,forward,GeckoActiveXObject,getAttention,getAttentionWithCycleCount,getComputedStyle,getSelection,home,matchMedia,maximize,minimize,moveBy,moveTo,mozRequestAnimationFrame,open,openDialog,postMessage,print,prompt,QueryInterface,releaseEvents,removeEventListener,resizeBy,resizeTo,restore,routeEvent,scroll,scrollBy,scrollByLines,scrollByPages,scrollTo,setCursor,setImmediate,setInterval,setResizable,setTimeout,showModalDialog,sizeToContent,stop,unescape,updateCommands,XPCNativeWrapper,XPCSafeJSObjectWrapper,onabort,onbeforeunload,onblur,onchange,onclick,onclose,oncontextmenu,ondevicemotion,ondeviceorientation,ondragdrop,onerror,onfocus,onhashchange,onkeydown,onkeypress,onkeyup,onload,onmousedown,onmousemove,onmouseout,onmouseover,onmouseup,onmozbeforepaint,onpaint,onpopstate,onreset,onresize,onscroll,onselect,onsubmit,onunload,onpageshow,onpagehide,Image,Option,Worker,Event,Range,File,FileReader,Blob,BlobBuilder,Attr,CDATASection,CharacterData,Comment,console,DocumentFragment,DocumentType,DomConfiguration,DOMError,DOMErrorHandler,DOMException,DOMImplementation,DOMImplementationList,DOMImplementationRegistry,DOMImplementationSource,DOMLocator,DOMObject,DOMString,DOMStringList,DOMTimeStamp,DOMUserData,Entity,EntityReference,MediaQueryList,MediaQueryListListener,NameList,NamedNodeMap,Node,NodeFilter,NodeIterator,NodeList,Notation,Plugin,PluginArray,ProcessingInstruction,SharedWorker,Text,TimeRanges,Treewalker,TypeInfo,UserDataHandler,Worker,WorkerGlobalScope,HTMLDocument,HTMLElement,HTMLAnchorElement,HTMLAppletElement,HTMLAudioElement,HTMLAreaElement,HTMLBaseElement,HTMLBaseFontElement,HTMLBodyElement,HTMLBRElement,HTMLButtonElement,HTMLCanvasElement,HTMLDirectoryElement,HTMLDivElement,HTMLDListElement,HTMLEmbedElement,HTMLFieldSetElement,HTMLFontElement,HTMLFormElement,HTMLFrameElement,HTMLFrameSetElement,HTMLHeadElement,HTMLHeadingElement,HTMLHtmlElement,HTMLHRElement,HTMLIFrameElement,HTMLImageElement,HTMLInputElement,HTMLKeygenElement,HTMLLabelElement,HTMLLIElement,HTMLLinkElement,HTMLMapElement,HTMLMenuElement,HTMLMetaElement,HTMLModElement,HTMLObjectElement,HTMLOListElement,HTMLOptGroupElement,HTMLOptionElement,HTMLOutputElement,HTMLParagraphElement,HTMLParamElement,HTMLPreElement,HTMLQuoteElement,HTMLScriptElement,HTMLSelectElement,HTMLSourceElement,HTMLSpanElement,HTMLStyleElement,HTMLTableElement,HTMLTableCaptionElement,HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement,HTMLTableColElement,HTMLTableRowElement,HTMLTableSectionElement,HTMLTextAreaElement,HTMLTimeElement,HTMLTitleElement,HTMLTrackElement,HTMLUListElement,HTMLUnknownElement,HTMLVideoElement,HTMLCanvasElement,CanvasRenderingContext2D,CanvasGradient,CanvasPattern,TextMetrics,ImageData,CanvasPixelArray,HTMLAudioElement,HTMLVideoElement,NotifyAudioAvailableEvent,HTMLCollection,HTMLAllCollection,HTMLFormControlsCollection,HTMLOptionsCollection,HTMLPropertiesCollection,DOMTokenList,DOMSettableTokenList,DOMStringMap,RadioNodeList,SVGDocument,SVGElement,SVGAElement,SVGAltGlyphElement,SVGAltGlyphDefElement,SVGAltGlyphItemElement,SVGAnimationElement,SVGAnimateElement,SVGAnimateColorElement,SVGAnimateMotionElement,SVGAnimateTransformElement,SVGSetElement,SVGCircleElement,SVGClipPathElement,SVGColorProfileElement,SVGCursorElement,SVGDefsElement,SVGDescElement,SVGEllipseElement,SVGFilterElement,SVGFilterPrimitiveStandardAttributes,SVGFEBlendElement,SVGFEColorMatrixElement,SVGFEComponentTransferElement,SVGFECompositeElement,SVGFEConvolveMatrixElement,SVGFEDiffuseLightingElement,SVGFEDisplacementMapElement,SVGFEDistantLightElement,SVGFEFloodElement,SVGFEGaussianBlurElement,SVGFEImageElement,SVGFEMergeElement,SVGFEMergeNodeElement,SVGFEMorphologyElement,SVGFEOffsetElement,SVGFEPointLightElement,SVGFESpecularLightingElement,SVGFESpotLightElement,SVGFETileElement,SVGFETurbulenceElement,SVGComponentTransferFunctionElement,SVGFEFuncRElement,SVGFEFuncGElement,SVGFEFuncBElement,SVGFEFuncAElement,SVGFontElement,SVGFontFaceElement,SVGFontFaceFormatElement,SVGFontFaceNameElement,SVGFontFaceSrcElement,SVGFontFaceUriElement,SVGForeignObjectElement,SVGGElement,SVGGlyphElement,SVGGlyphRefElement,SVGGradientElement,SVGLinearGradientElement,SVGRadialGradientElement,SVGHKernElement,SVGImageElement,SVGLineElement,SVGMarkerElement,SVGMaskElement,SVGMetadataElement,SVGMissingGlyphElement,SVGMPathElement,SVGPathElement,SVGPatternElement,SVGPolylineElement,SVGPolygonElement,SVGRectElement,SVGScriptElement,SVGStopElement,SVGStyleElement,SVGSVGElement,SVGSwitchElement,SVGSymbolElement,SVGTextElement,SVGTextPathElement,SVGTitleElement,SVGTRefElement,SVGTSpanElement,SVGUseElement,SVGViewElement,SVGVKernElement,SVGAngle,SVGColor,SVGICCColor,SVGElementInstance,SVGElementInstanceList,SVGLength,SVGLengthList,SVGMatrix,SVGNumber,SVGNumberList,SVGPaint,SVGPoint,SVGPointList,SVGPreserveAspectRatio,SVGRect,SVGStringList,SVGTransform,SVGTransformList,SVGAnimatedAngle,SVGAnimatedBoolean,SVGAnimatedEnumeration,SVGAnimatedInteger,SVGAnimatedLength,SVGAnimatedLengthList,SVGAnimatedNumber,SVGAnimatedNumberList,SVGAnimatedPreserveAspectRatio,SVGAnimatedRect,SVGAnimatedString,SVGAnimatedTransformList,SVGPathSegList,SVGPathSeg,SVGPathSegArcAbs,SVGPathSegArcRel,SVGPathSegClosePath,SVGPathSegCurvetoCubicAbs,SVGPathSegCurvetoCubicRel,SVGPathSegCurvetoCubicSmoothAbs,SVGPathSegCurvetoCubicSmoothRel,SVGPathSegCurvetoQuadraticAbs,SVGPathSegCurvetoQuadraticRel,SVGPathSegCurvetoQuadraticSmoothAbs,SVGPathSegCurvetoQuadraticSmoothRel,SVGPathSegLinetoAbs,SVGPathSegLinetoHorizontalAbs,SVGPathSegLinetoHorizontalRel,SVGPathSegLinetoRel,SVGPathSegLinetoVerticalAbs,SVGPathSegLinetoVerticalRel,SVGPathSegMovetoAbs,SVGPathSegMovetoRel,ElementTimeControl,TimeEvent,SVGAnimatedPathData,SVGAnimatedPoints,SVGColorProfileRule,SVGCSSRule,SVGExternalResourcesRequired,SVGFitToViewBox,SVGLangSpace,SVGLocatable,SVGRenderingIntent,SVGStylable,SVGTests,SVGTextContentElement,SVGTextPositioningElement,SVGTransformable,SVGUnitTypes,SVGURIReference,SVGViewSpec,SVGZoomAndPan");
h.o.Lm=0;h.o.VG=1.1;h.o.mf=1.2;h.o.ad=2;h.o.TG=3;h.o.OG=3;h.o.KG=4.1;h.o.XG=4.2;h.o.fk=4.3;h.o.cp=4.4;h.o.WG=4.5;h.o.YG=4.6;h.o.PG=4.7;h.o.IG=4.8;h.o.QG=5;h.o.fp=5.1;h.o.dk=5.2;h.o.ek=5.3;h.o.gp=6.1;h.o.Ki=6.2;h.o.MG=7;h.o.Et=8;h.o.SG=8;h.o.UG=8;h.o.Dt=9;h.o.JG=10;h.o.NG=11;h.o.LG=12;h.o.Nm=13;h.o.ep=14;h.o.Mm=15;h.o.HG=16;h.o.ZG=17;h.o.Ce=18;h.o.nf=99;h.o.Om=[[h.o.ad,h.o.mf],[h.o.ad,h.o.ad],[h.o.mf,h.o.mf],[h.o.mf,h.o.ad],[h.o.cp,h.o.cp],[h.o.fp,h.o.fp],[h.o.Ki,h.o.Ki],[h.o.Nm,h.o.Nm],[h.o.ep,h.o.ep]];
h.o.ua=function(a){h.o.aj=Object.create(null);h.o.Bq=Object.create(null);h.o.Pj?h.o.Pj.reset():h.o.Pj=new h.Ud(h.o.lp);h.o.Pj.Aa=a.Aa;for(var c=[],d=h.Z.gA(a),e=0;e<d.length;e++)c.push(Bc(d[e],h.Ud.Lo));a=h.Z.pu(a);for(e=0;e<a.length;e++)c.push(Bc(a[e].Pa(),h.Z.Zf));c.length&&(h.o.aj.variables="var "+c.join(", ")+";")};h.o.finish=function(a){var c=[],d;for(d in h.o.aj)c.push(h.o.aj[d]);delete h.o.aj;delete h.o.Bq;h.o.Pj.reset();return c.join("\n\n")+"\n\n\n"+a};h.o.bx=function(a){return a+";\n"};
h.o.hD=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};h.o.XI=function(a){return a.split(/\n/g).map(h.o.hD).join(" + '\\n' +\n")};
h.o.js=function(a,c,d){var e="";if(!a.M||!a.M.ga){var f=a.fe.text;f&&(f=h.g.Oa.Gx(f,h.o.ky-3),e+=Rc(f+"\n","// "));for(var g=0;g<a.P.length;g++)if(a.P[g].type==h.Sa){var k=z(a.P[g].connection);if(k){f=[];k=p(k,!0);for(var l=0;l<k.length;l++){var m=k[l].fe.text;m&&f.push(m)}f.length&&f.push("");(f=f.join("\n"))&&(e+=Rc(f,"// "))}}}a=a.V&&z(a.V);d=d?"":Pc(h.o,a);return e+c+d};
h.o.EI=function(a,c,d,e,f){d=d||0;f=f||h.o.nf;a.C.options.zj&&d--;var g=a.C.options.zj?"1":"0";a=0<d?N(a,c,h.o.Ki)||g:0>d?N(a,c,h.o.gp)||g:e?N(a,c,h.o.fk)||g:N(a,c,f)||g;if(h.nC(a))a=Number(a)+d,e&&(a=-a);else{if(0<d){a=a+" + "+d;var k=h.o.Ki}else 0>d&&(a=a+" - "+-d,k=h.o.gp);e&&(a=d?"-("+a+")":"-"+a,k=h.o.fk);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};h.o.tC={};h.o.controls_if=function(a){var c=0,d="";h.o.Oi&&(d+=Qc(h.o.Oi,a));do{var e=N(a,"IF"+c,h.o.nf)||"false";var f=Sc(a,"DO"+c);h.o.sf&&(f=Rc(Qc(h.o.sf,a),h.o.Fm)+f);d+=(0<c?" else ":"")+"if ("+e+") {\n"+f+"}";++c}while(B(a,"IF"+c));if(B(a,"ELSE")||h.o.sf)f=Sc(a,"ELSE"),h.o.sf&&(f=Rc(Qc(h.o.sf,a),h.o.Fm)+f),d+=" else {\n"+f+"}";return d+"\n"};h.o.controls_ifelse=h.o.controls_if;
h.o.logic_compare=function(a){var c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[F(a,"OP")],d="=="==c||"!="==c?h.o.Dt:h.o.Et,e=N(a,"A",d)||"0";a=N(a,"B",d)||"0";return[e+" "+c+" "+a,d]};h.o.logic_operation=function(a){var c="AND"==F(a,"OP")?"&&":"||",d="&&"==c?h.o.Nm:h.o.ep,e=N(a,"A",d);a=N(a,"B",d);if(e||a){var f="&&"==c?"true":"false";e||(e=f);a||(a=f)}else a=e="false";return[e+" "+c+" "+a,d]};h.o.logic_negate=function(a){var c=h.o.cp;return["!"+(N(a,"BOOL",c)||"true"),c]};
h.o.logic_boolean=function(a){return["TRUE"==F(a,"BOOL")?"true":"false",h.o.Lm]};h.o.logic_null=function(){return["null",h.o.Lm]};h.o.logic_ternary=function(a){var c=N(a,"IF",h.o.Mm)||"false",d=N(a,"THEN",h.o.Mm)||"null";a=N(a,"ELSE",h.o.Mm)||"null";return[c+" ? "+d+" : "+a,h.o.Mm]};h.o.Lb={};h.o.math_number=function(a){a=Number(F(a,"NUM"));return[a,0<=a?h.o.Lm:h.o.fk]};h.o.math_arithmetic=function(a){var c={ADD:[" + ",h.o.Ki],MINUS:[" - ",h.o.gp],MULTIPLY:[" * ",h.o.fp],DIVIDE:[" / ",h.o.dk],POWER:[null,h.o.Ce]}[F(a,"OP")],d=c[0];c=c[1];var e=N(a,"A",c)||"0";a=N(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",h.o.ad]};
h.o.math_single=function(a){var c=F(a,"OP");if("NEG"==c)return a=N(a,"NUM",h.o.fk)||"0","-"==a[0]&&(a=" "+a),["-"+a,h.o.fk];a="SIN"==c||"COS"==c||"TAN"==c?N(a,"NUM",h.o.dk)||"0":N(a,"NUM",h.o.nf)||"0";switch(c){case "ABS":var d="Math.abs("+a+")";break;case "ROOT":d="Math.sqrt("+a+")";break;case "LN":d="Math.log("+a+")";break;case "EXP":d="Math.exp("+a+")";break;case "POW10":d="Math.pow(10,"+a+")";break;case "ROUND":d="Math.round("+a+")";break;case "ROUNDUP":d="Math.ceil("+a+")";break;case "ROUNDDOWN":d=
"Math.floor("+a+")";break;case "SIN":d="Math.sin("+a+" / 180 * Math.PI)";break;case "COS":d="Math.cos("+a+" / 180 * Math.PI)";break;case "TAN":d="Math.tan("+a+" / 180 * Math.PI)"}if(d)return[d,h.o.ad];switch(c){case "LOG10":d="Math.log("+a+") / Math.log(10)";break;case "ASIN":d="Math.asin("+a+") / Math.PI * 180";break;case "ACOS":d="Math.acos("+a+") / Math.PI * 180";break;case "ATAN":d="Math.atan("+a+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+c);}return[d,h.o.dk]};
h.o.math_constant=function(a){return{PI:["Math.PI",h.o.mf],E:["Math.E",h.o.mf],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",h.o.dk],SQRT2:["Math.SQRT2",h.o.mf],SQRT1_2:["Math.SQRT1_2",h.o.mf],INFINITY:["Infinity",h.o.Lm]}[F(a,"CONSTANT")]};
h.o.math_number_property=function(a){var c=N(a,"NUMBER_TO_CHECK",h.o.ek)||"0",d=F(a,"PROPERTY");if("PRIME"==d){var e=Uc("mathIsPrime",["function "+h.o.Tf+"(n) {"," // https://en.wikipedia.org/wiki/Primality_test#Naive_methods"," if (n == 2 || n == 3) {"," return true;"," }"," // False if n is NaN, negative, is 1, or not whole."," // And false if n is divisible by 2 or 3."," if (isNaN(n) || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {"," return false;"," }"," // Check all the numbers of form 6k +/- 1, up to sqrt(n).",
" for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {"," if (n % (x - 1) == 0 || n % (x + 1) == 0) {"," return false;"," }"," }"," return true;","}"])+"("+c+")";return[e,h.o.ad]}switch(d){case "EVEN":e=c+" % 2 == 0";break;case "ODD":e=c+" % 2 == 1";break;case "WHOLE":e=c+" % 1 == 0";break;case "POSITIVE":e=c+" > 0";break;case "NEGATIVE":e=c+" < 0";break;case "DIVISIBLE_BY":a=N(a,"DIVISOR",h.o.ek)||"0",e=c+" % "+a+" == 0"}return[e,h.o.Dt]};
h.o.math_change=function(a){var c=N(a,"DELTA",h.o.Ki)||"0";a=Bc(F(a,"VAR"),h.Z.Zf);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};h.o.math_round=h.o.math_single;h.o.math_trig=h.o.math_single;
h.o.math_on_list=function(a){var c=F(a,"OP");switch(c){case "SUM":a=N(a,"LIST",h.o.mf)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=N(a,"LIST",h.o.Ce)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=N(a,"LIST",h.o.Ce)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=Uc("mathMean",["function "+h.o.Tf+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=N(a,"LIST",h.o.nf)||"[]";a=c+"("+a+")";break;case "MEDIAN":c=
Uc("mathMedian",["function "+h.o.Tf+"(myList) {"," var localList = myList.filter(function (x) {return typeof x == 'number';});"," if (!localList.length) return null;"," localList.sort(function(a, b) {return b - a;});"," if (localList.length % 2 == 0) {"," return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;"," } else {"," return localList[(localList.length - 1) / 2];"," }","}"]);a=N(a,"LIST",h.o.nf)||"[]";a=c+"("+a+")";break;case "MODE":c=Uc("mathModes",
["function "+h.o.Tf+"(values) {"," var modes = [];"," var counts = [];"," var maxCount = 0;"," for (var i = 0; i < values.length; i++) {"," var value = values[i];"," var found = false;"," var thisCount;"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][0] === value) {"," thisCount = ++counts[j][1];"," found = true;"," break;"," }"," }"," if (!found) {"," counts.push([value, 1]);"," thisCount = 1;"," }"," maxCount = Math.max(thisCount, maxCount);",
" }"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][1] == maxCount) {"," modes.push(counts[j][0]);"," }"," }"," return modes;","}"]);a=N(a,"LIST",h.o.nf)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=Uc("mathStandardDeviation",["function "+h.o.Tf+"(numbers) {"," var n = numbers.length;"," if (!n) return null;"," var mean = numbers.reduce(function(x, y) {return x + y;}) / n;"," var variance = 0;"," for (var j = 0; j < n; j++) {"," variance += Math.pow(numbers[j] - mean, 2);",
" }"," variance = variance / n;"," return Math.sqrt(variance);","}"]);a=N(a,"LIST",h.o.nf)||"[]";a=c+"("+a+")";break;case "RANDOM":c=Uc("mathRandomList",["function "+h.o.Tf+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=N(a,"LIST",h.o.nf)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,h.o.ad]};h.o.math_modulo=function(a){var c=N(a,"DIVIDEND",h.o.ek)||"0";a=N(a,"DIVISOR",h.o.ek)||"0";return[c+" % "+a,h.o.ek]};
h.o.math_constrain=function(a){var c=N(a,"VALUE",h.o.Ce)||"0",d=N(a,"LOW",h.o.Ce)||"0";a=N(a,"HIGH",h.o.Ce)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",h.o.ad]};
h.o.math_random_int=function(a){var c=N(a,"FROM",h.o.Ce)||"0";a=N(a,"TO",h.o.Ce)||"0";return[Uc("mathRandomInt",["function "+h.o.Tf+"(a, b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," var c = a;"," a = b;"," b = c;"," }"," return Math.floor(Math.random() * (b - a + 1) + a);","}"])+"("+c+", "+a+")",h.o.ad]};h.o.math_random_float=function(){return["Math.random()",h.o.ad]};
h.o.math_atan2=function(a){var c=N(a,"X",h.o.Ce)||"0";return["Math.atan2("+(N(a,"Y",h.o.Ce)||"0")+", "+c+") / Math.PI * 180",h.o.dk]};var Vc={ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",be:"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0456","be-tarask":"Tara\u0161kievica",bg:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a",bn:"\u09ac\u09be\u0982\u09b2\u09be",br:"Brezhoneg",cs:"\u010cesky",da:"Dansk",de:"Deutsch",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English",es:"Espa\u00f1ol",eu:"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc",fi:"Suomi",fr:"Fran\u00e7ais",gl:"Galego",ha:"Hausa",
he:"\u05e2\u05d1\u05e8\u05d9\u05ea",hi:"\u0939\u093f\u0928\u094d\u0926\u0940",hu:"Magyar",hy:"\u0570\u0561\u0575\u0565\u0580\u0567\u0576",ia:"Interlingua",id:"Bahasa Indonesia",ig:"As\u1ee5s\u1ee5 Igbo",is:"\u00cdslenska",it:"Italiano",ja:"\u65e5\u672c\u8a9e",kab:"Taqbaylit",ko:"\ud55c\uad6d\uc5b4",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",my:"\u1019\u103c\u1014\u103a\u1019\u102c\u1005\u102c",nb:"Norsk Bokm\u00e5l",nl:"Nederlands, Vlaams",pl:"Polski",pms:"Piemont\u00e8is",pt:"Portugu\u00eas",
"pt-br":"Portugu\u00eas Brasileiro",ro:"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",sc:"Sardu",sk:"Sloven\u010dina",sl:"Sloven\u0161\u010dina",sq:"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438",sv:"Svenska",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22",tr:"T\u00fcrk\u00e7e",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u064f\u0631\u062f\u064f\u0648\u202c",vi:"Ti\u1ebfng Vi\u1ec7t",yo:"\u00c8d\u00e8 Yor\u00f9b\u00e1","zh-hans":"\u7b80\u4f53\u4e2d\u6587",
"zh-hant":"\u6b63\u9ad4\u4e2d\u6587"},Wc="ace ar fa he mzn ps ur".split(" "),P=window.BlocklyGamesLang,Xc=window.BlocklyGamesLanguages,Yc=".html"==window.location.pathname.substr(-5),C=null,Q,Zc=Number,$c,ad=window.location.search.match(/[?&]level=([^&]+)/);$c=ad?decodeURIComponent(ad[1].replace(/\+/g,"%20")):"NaN";var bd=Zc($c);Q=isNaN(bd)?1:h.g.Lb.wk(1,bd,10);
function cd(){document.title=document.getElementById("title").textContent;document.dir=-1!=Wc.indexOf(P)?"rtl":"ltr";document.head.parentElement.setAttribute("lang",P);var a=document.getElementById("languageMenu");if(a){for(var c=[],d=0;d<Xc.length;d++){var e=Xc[d];c.push([Vc[e],e])}c.sort(function(g,k){return g[0]>k[0]?1:g[0]<k[0]?-1:0});for(d=a.options.length=0;d<c.length;d++){var f=c[d];e=f[1];f=new Option(f[0],e);e==P&&(f.selected=!0);a.options.add(f)}1>=a.options.length&&(a.style.display="none")}for(d=
1;10>=d;d++)a=document.getElementById("level"+d),c=!!dd(d),a&&c&&(a.className+=" level_done");(d=document.querySelector('meta[name="viewport"]'))&&725>screen.availWidth&&d.setAttribute("content","width=725, initial-scale=.35, user-scalable=no");setTimeout(ed,1)}function dd(a){var c=fd;try{var d=window.localStorage[c+a]}catch(e){}return d}function R(a){var c;(c=document.getElementById(a))?(c=c.textContent,c=c.replace(/\\n/g,"\n")):c=null;return null===c?"[Unknown message: "+a+"]":c}
function gd(a,c){if(!a)throw TypeError("Element not found: "+a);"string"==typeof a&&(a=document.getElementById(a));a.addEventListener("click",c,!0);a.addEventListener("touchend",c,!0)}function hd(a){a%=360;0>a&&(a+=360);return a}
function ed(){if(!Yc){window.GoogleAnalyticsObject="GoogleAnalyticsFunction";var a=function(d){(a.q=a.q||[]).push(arguments)};window.GoogleAnalyticsFunction=a;a.l=1*new Date;var c=document.createElement("script");c.async=1;c.src="//www.google-analytics.com/analytics.js";document.head.appendChild(c);a("create","UA-50448074-1","auto");a("send","pageview")}};var id,S,jd,kd,ld,md;h.hb.bird_noWorm={ua:function(){Jb(this,{message0:R("Bird_noWorm"),output:"Boolean",colour:330,tooltip:R("Bird_noWormTooltip")})}};h.o.bird_noWorm=function(){return["noWorm()",h.o.ad]};h.hb.bird_heading={ua:function(){this.od(290);L(L(this.ae(h.Qd,""),R("Bird_heading")),new h.$("90"),"ANGLE");this.Pl(!0);this.Od(R("Bird_headingTooltip"))}};h.o.bird_heading=function(a){return"heading("+Number(F(a,"ANGLE"))+", 'block_id_"+a.id+"');\n"};
h.hb.bird_position={ua:function(){Jb(this,{message0:"%1",args0:[{type:"field_dropdown",name:"XY",options:[["x","X"],["y","Y"]]}],output:"Number",colour:330,tooltip:R("Bird_positionTooltip")})}};h.o.bird_position=function(a){return["get"+F(a,"XY").charAt(0)+"()",h.o.ad]};
h.hb.bird_compare={ua:function(){this.Ff=h.h.LOGIC_COMPARE_HELPURL;this.od(h.h.LOGIC_HUE);this.Ol(!0,"Boolean");Ib(this,"A").Mc("Number");L(Ib(this,"B").Mc("Number"),new h.Ra([["\u200f<","LT"],["\u200f>","GT"]]),"OP");this.Ng(!0);var a=this;this.Od(function(){var c=F(a,"OP");return{LT:h.h.LOGIC_COMPARE_TOOLTIP_LT,GT:h.h.LOGIC_COMPARE_TOOLTIP_GT}[c]})}};h.o.bird_compare=function(a){var c="LT"==F(a,"OP")?"<":">",d=h.o.Et,e=N(a,"A",d)||"0";a=N(a,"B",d)||"0";return[e+" "+c+" "+a,d]};
h.hb.bird_and={ua:function(){this.Ff=h.h.LOGIC_OPERATION_HELPURL;this.od(h.h.LOGIC_HUE);this.Ol(!0,"Boolean");Ib(this,"A").Mc("Boolean");L(Ib(this,"B").Mc("Boolean"),h.h.LOGIC_OPERATION_AND);this.Ng(!0);this.Od(h.h.LOGIC_OPERATION_TOOLTIP_AND)}};h.o.bird_and=function(a){var c=h.o.Nm,d=N(a,"A",c);a=N(a,"B",c);d||a?(d||(d="true"),a||(a="true")):a=d="false";return[d+" && "+a,c]};
h.hb.bird_ifElse={ua:function(){this.Ff=h.h.CONTROLS_IF_HELPURL;this.od(h.h.LOGIC_HUE);L(Ib(this,"CONDITION"),h.h.CONTROLS_IF_MSG_IF).Mc("Boolean");L(this.ae(h.Ga,"DO"),h.h.CONTROLS_IF_MSG_THEN);L(this.ae(h.Ga,"ELSE"),h.h.CONTROLS_IF_MSG_ELSE);this.Mk=!1;this.Od(h.h.CONTROLS_IF_TOOLTIP_2)}};h.o.bird_ifElse=function(a){var c=N(a,"CONDITION",h.o.nf)||"false",d=Sc(a,"DO");a=Sc(a,"ELSE");return"if ("+c+") {\n"+d+"} else {\n"+a+"}\n"};h.hb.controls_if.OC=h.hb.controls_if.ua;
h.hb.controls_if.ua=function(){this.OC();this.Pl(!1);this.jo(!1);this.Mk=!1};var nd=nd||{};function od(a,c){function d(){}d.prototype=c.prototype;a.w=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.qI=function(e,f,g){return c.prototype[f].apply(e,Array.prototype.slice.call(arguments,2))}}if(!pd){var pd,qd="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(qd=navigator.userAgent);var rd=0==qd.indexOf("Opera");pd={VI:{zF:"ScriptEngine"in window},FG:rd,Uf:!rd&&-1!=qd.indexOf("MSIE"),Cp:!rd&&-1!=qd.indexOf("WebKit")}}if(!sd)var sd={};
if(!td)var td={};if(!ud)var ud={};if(!vd)var vd={};if(!wd)var wd={};if(!xd)var xd={};var yd=nd.GE?{fJ:!0}:{};function zd(){throw Error("Do not instantiate directly");}zd.prototype.Mu=null;zd.prototype.toString=function(){return this.content};function Ad(a){if(null!=a)switch(a.Mu){case 1:return 1;case -1:return-1;case 0:return 0}return null}function Dd(){zd.call(this)}od(Dd,zd);Dd.prototype.PA=yd;function T(a){return null!=a&&a.PA===yd?a:Ed(String(String(a)).replace(Fd,Gd),Ad(a))}
var Ed=function(a){function c(){}c.prototype=a.prototype;return function(d,e){var f=new c;f.content=String(d);void 0!==e&&(f.Mu=e);return f}}(Dd),Hd={"\x00":"&#0;",'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\f":"&#12;","\r":"&#13;"," ":"&#32;","-":"&#45;","/":"&#47;","=":"&#61;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function Gd(a){return Hd[a]}var Fd=/[\x00\x22\x26\x27\x3c\x3e]/g;function Id(){for(var a='<div style="display: none"><span id="Games_name">Jogos do Blockly</span><span id="Games_puzzle">Quebra-Cabe\u00e7a</span><span id="Games_maze">Labirinto</span><span id="Games_bird">P\u00e1ssaro</span><span id="Games_turtle">Tartaruga</span><span id="Games_movie">Filme</span><span id="Games_music">M\u00fasica</span><span id="Games_pondTutor">Tutor de Lagoa</span><span id="Games_pond">Lagoa</span><span id="Games_genetics">Gen\u00e9ticas</span><span id="Games_linesOfCode1">Voc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:</span><span id="Games_linesOfCode2">Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:</span><span id="Games_nextLevel">Voc\u00ea esta preparado para o n\u00edvel %1?</span><span id="Games_finalLevel">Voc\u00ea esta preparado para o pr\u00f3ximo desafio?</span><span id="Games_submitTitle">T\u00edtulo:</span><span id="Games_linkTooltip">Salvar e ligar aos blocos.</span><span id="Games_runTooltip">Rodar o programa que voc\u00ea escreveu.</span><span id="Games_runProgram">Executar o programa</span><span id="Games_resetTooltip">Parar a execu\u00e7\u00e3o do programa e resetar o nivel.</span><span id="Games_resetProgram">Reiniciar</span><span id="Games_help">Ajuda</span><span id="Games_dialogOk">OK</span><span id="Games_dialogCancel">Cancelar</span><span id="Games_catLogic">L\u00f3gica</span><span id="Games_catLoops">La\u00e7os</span><span id="Games_catMath">Matem\u00e1tica</span><span id="Games_catText">Texto</span><span id="Games_catLists">Listas</span><span id="Games_catColour">Cor</span><span id="Games_catVariables">Vari\u00e1veis</span><span id="Games_catProcedures">Fun\u00e7\u00f5es</span><span id="Games_httpRequestError">Houve um problema com a requisi\u00e7\u00e3o.</span><span id="Games_linkAlert">Compartilhe seus blocos com este link:\n\n%1</span><span id="Games_hashError">Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.</span><span id="Games_xmlError">N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?</span><span id="Games_submitted">Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.</span><span id="Games_listVariable">lista</span><span id="Games_textVariable">texto</span><span id="Games_breakLink">Quando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?</span><span id="Games_blocks">Blocos</div></div><div style="display: none"><span id="Bird_noWorm">n\u00e3o tem minhocas</span><span id="Bird_heading">dire\u00e7\u00e3o</span><span id="Bird_noWormTooltip">Esse bloco indica quando o p\u00e1ssaro n\u00e3o possui a \\nminhoca. </span><span id="Bird_headingTooltip">Mover na dire\u00e7\u00e3o do \u00e2ngulo indicado: 0 \u00e9 para a \\ndireita, 90 \u00e9 para frente, etc. </span><span id="Bird_positionTooltip">x e y marcam a posi\u00e7\u00e3o do p\u00e1ssaro. \\nQuando x = 0 o p\u00e1ssaro esta pr\u00f3ximo \\nda margem esquerda, quando x = 100 \\nesta perto da margem direita. Quando \\ny = 0 o p\u00e1ssaro esta em baixo, quando \\ny = 100 ele est\u00e1 no topo. </span></div><table width="100%"><tr><td><h1><span id="title">'+
((Yc?'<a href="index.html?lang='+T(P)+'">':'<a href="./?lang='+T(P)+'">')+"Jogos do Blockly</a> : "+T({appName:"P\u00e1ssaro"}.appName)+"</span>"),c=" &nbsp; ",d=1;11>d;d++)c+=" "+(d==Q?'<span class="level_number level_done" id="level'+T(d)+'">'+T(d)+"</span>":10==d?'<a class="level_number" id="level'+T(d)+'" href="?lang='+T(P)+"&level="+T(d)+T("")+'">'+T(d)+"</a>":'<a class="level_dot" id="level'+T(d)+'" href="?lang='+T(P)+"&level="+T(d)+T("")+'"></a>');return a+c+'</h1></td><td class="farSide"><select id="languageMenu"></select>&nbsp;<button id="linkButton" title="Salvar e ligar aos blocos."><img src="common/1x1.gif" class="link icon21"></button></td></tr></table><div id="visualization"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svgBird" width="400px" height="400px"></svg></div><table width="400"><tr><td style="width: 190px;"></td><td><button id="runButton" class="primary" title="Rodar o programa que voc\u00ea escreveu."><img src="common/1x1.gif" class="run icon21"> Executar o programa</button><button id="resetButton" class="primary" style="display: none" title="Parar a execu\u00e7\u00e3o do programa e resetar o nivel."><img src="common/1x1.gif" class="stop icon21"> Reiniciar</button></td></tr></table><xml id="toolbox" style="display: none;" xmlns="https://developers.google.com/blockly/xml"><block type="bird_heading"></block>'+
((2<=Q?(4==Q||5==Q?'<block type="bird_noWorm" disabled="true"></block>':'<block type="bird_noWorm"></block>')+(4<=Q?'<block type="bird_compare"><field name="OP">LT</field><value name="A"><block type="bird_position" movable="false"><field name="XY">X</field></block></value><value name="B"><block type="math_number" movable="false"><field name="NUM">50</field></block></value></block>'+(5<=Q?'<block type="bird_compare"><field name="OP">LT</field><value name="A"><block type="bird_position" movable="false"><field name="XY">Y</field></block></value><value name="B"><block type="math_number" movable="false"><field name="NUM">50</field></block></value></block>'+
(8<=Q?'<block type="bird_and"></block>':""):""):""):"")+'</xml><div id="blockly"></div><div id="dialogShadow" class="dialogAnimate"></div><div id="dialogBorder"></div><div id="dialog"></div><div id="dialogDone" class="dialogHiddenContent"><div style="font-size: large; margin: 1em;">Parab\u00e9ns!</div><div id="dialogLinesText" style="font-size: large; margin: 1em;"></div><pre id="containerCode"></pre><div id="dialogDoneText" style="font-size: large; margin: 1em;"></div><div id="dialogDoneButtons" class="farSide" style="padding: 1ex 3ex 0"><button id="doneCancel">Cancelar</button><button id="doneOk" class="secondary">OK</button></div></div><div id="dialogAbort" class="dialogHiddenContent">Este n\u00edvel \u00e9 extremamente dif\u00edcil. Voc\u00ea deseja pul\u00e1-lo e ir ao pr\u00f3ximo jogo? Voc\u00ea sempre pode voltar mais tarde.<div class="farSide" style="padding: 1ex 3ex 0"><button id="abortCancel">Cancelar</button><button id="abortOk" class="secondary">OK</button></div></div><div id="dialogStorage" class="dialogHiddenContent"><div id="containerStorage"></div><div class="farSide" style="padding: 1ex 3ex 0"><button class="secondary" onclick="BlocklyDialogs.hideDialog(true)">OK</button></div></div><div id="dialogHelp" class="dialogHiddenContent">')+
(1==Q?'<table><tr><td rowspan=2><img src="common/help.png"></td><td><div class="farSide"><img src="bird/help_heading.png" class="mirrorImg" height=27 width=141></div></td></tr><tr><td>Trocar o \u00e2ngulo da dire\u00e7\u00e3o para que o p\u00e1ssaro pegue a minhoca e aterrisse em seu ninho.</td></tr></table>':2==Q?'<table><tr><td><img src="common/help.png"></td><td>Usar este bloco para ir em uma posi\u00e7\u00e3o se voc\u00ea tiver a minhoca, ou uma posi\u00e7\u00e3o diferente se voc\u00ea n\u00e3o tiver a minhoca.</td><td><img src="bird/help_up.png"></td></tr></table>':
4==Q?"<table><tr><td><img src=\"common/help.png\"></td><td>'x' e sua posi\u00e7\u00e3o horizontal atual. Use este bloco para ir em uma dire\u00e7\u00e3o se 'x' for menor que um numero, ou uma dire\u00e7\u00e3o diferente caso contr\u00e1rio.</td><td><img src=\"bird/help_up.png\"></td></tr></table>":5==Q?'<table><tr><td><img src="bird/help_up.png"></td><td>Clique no \u00edcone para modificar o bloco \'se\'.</td><td><img src="common/help.png"></td></tr></table>':6==Q?"<table><tr><td><img src=\"bird/help_up.png\"></td><td>Este n\u00edvel precisa de um bloco 'sen\u00e3o se' e de um bloco 'sen\u00e3o'.</td><td><img src=\"common/help.png\"></td></tr></table>":
8==Q?'<table><tr><td><img src="bird/help_up.png"></td><td>O bloco "e" somente \u00e9 verdadeiro se as duas entradas forem verdadeiras.</td><td><img src="common/help.png"></td></tr></table>':"")+"</div>"+(5==Q?'<div id="dialogMutatorHelp" class="dialogHiddenContent"><table><tr><td><img src="bird/help_mutator.png" class="mirrorImg" height=58 width=107></td><td>Puxe um bloco "sen\u00e3o" em cima do bloco "se".</td></tr></table></div>':"")};h.Ap=function(a){this.s=a;this.nh=[];if(!(0>=this.s.options.Tn)){a={scrollbars:!0,uh:this.s.options.uh,Vb:this.s,G:this.s.G,zj:this.s.options.zj,ai:this.s.options.ai};if(this.s.Hf){a.Ya=this.s.Ya==h.fh?h.ik:h.fh;if(!h.Ro)throw Error("Missing require for Blockly.HorizontalFlyout");this.O=new h.Ro(a)}else{a.Ya=this.s.Ya==h.fg?h.zd:h.fg;if(!h.gh)throw Error("Missing require for Blockly.VerticalFlyout");this.O=new h.gh(a)}K(this.s,this.PC.bind(this))}};b=h.Ap.prototype;b.lk=47;b.qm=44;b.Hi=16;b.kz=20;
b.wt=20;b.Im=10;b.up=0;b.vp=32;b.My=.1;b.er=!1;b.Un=0;b.K=null;b.qo=null;b.lr=0;b.Bg=0;b.jw=0;b.Ax=0;
b.Ja=function(){this.K=h.g.m.L("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=h.g.m.L("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.K);h.g.m.L("rect",{width:this.lk,height:this.qm,y:this.Hi},c);var d=h.g.m.L("image",{width:h.Ni.width,x:-this.up,height:h.Ni.height,y:-this.vp,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.K);d.setAttributeNS(h.g.m.Ge,"xlink:href",this.s.options.Bj+h.Ni.url);c=h.g.m.L("clipPath",{id:"blocklyTrashLidClipPath"+a},this.K);
h.g.m.L("rect",{width:this.lk,height:this.Hi},c);this.qo=h.g.m.L("image",{width:h.Ni.width,x:-this.up,height:h.Ni.height,y:-this.vp,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.K);this.qo.setAttributeNS(h.g.m.Ge,"xlink:href",this.s.options.Bj+h.Ni.url);h.pa(this.K,"mouseup",this,this.click);h.ed(d,"mouseover",this,this.CC);h.ed(d,"mouseout",this,this.AC);this.Ep();return this.K};
b.ua=function(a){0<this.s.options.Tn&&(h.g.m.qj(this.O.Ja("svg"),x(this.s)),this.O.ua(this.s),this.O.bw=function(){return!0});this.wo=this.kz+a;Ua(this,!1);return this.wo+this.qm+this.Hi};b.J=function(){this.K&&(h.g.m.removeNode(this.K),this.K=null);this.s=this.qo=null;clearTimeout(this.lr)};
b.position=function(){if(this.wo){var a=this.s.uc();a&&(this.jw=a.Ya==h.zd||this.s.Hf&&!this.s.G?a.lb+a.dc-this.lk-this.wt-h.Ca.jc:this.wt+h.Ca.jc,this.Ax=a.Ya==h.ik?this.wo:a.vb+a.oc-(this.qm+this.Hi)-this.wo,this.K.setAttribute("transform","translate("+this.jw+","+this.Ax+")"))}};b.xn=function(){if(!this.K)return null;var a=this.K.getBoundingClientRect(),c=a.top+this.vp-this.Im;a=a.left+this.up-this.Im;return new h.g.Rect(c,c+this.Hi+this.qm+2*this.Im,a,a+this.lk+2*this.Im)};
function Ua(a,c){a.er!=c&&(clearTimeout(a.lr),a.er=c,a.Ep())}b.Ep=function(){this.Bg+=this.er?.2:-.2;this.Bg=Math.min(Math.max(this.Bg,this.Un),1);Jd(this,45*this.Bg);this.K.style.opacity=.4+.4*this.Bg;this.Bg>this.Un&&1>this.Bg&&(this.lr=setTimeout(this.Ep.bind(this),20))};function Jd(a,c){var d=a.s.Ya==h.fg||a.s.Hf&&a.s.G;a.qo.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.lk-4)+","+(a.Hi-2)+")")}b.close=function(){Ua(this,!1)};
b.click=function(){if(this.nh.length){for(var a=[],c=0,d;d=this.nh[c];c++)a[c]=h.N.Qg(d);this.O.show(a)}};b.CC=function(){this.nh.length&&Ua(this,!0)};b.AC=function(){Ua(this,!1)};
b.PC=function(a){if(!(0>=this.s.options.Tn)&&a.type==h.i.Zx&&"shadow"!=a.Ir.tagName.toLowerCase()){for(var c=a=a.Ir.cloneNode(!0);c;){c.removeAttribute&&(c.removeAttribute("x"),c.removeAttribute("y"),c.removeAttribute("id"));var d=c.firstChild||c.nextSibling;if(!d)for(d=c.parentNode;d;){if(d.nextSibling){d=d.nextSibling;break}d=d.parentNode}c=d}a=h.N.Fc(a);if(-1==this.nh.indexOf(a)){for(this.nh.unshift(a);this.nh.length>this.s.options.Tn;)this.nh.pop();this.Un=this.My;Jd(this,45*this.Un)}}};h.Xg=function(){h.Xg.w.constructor.call(this)};h.g.object.S(h.Xg,h.Am);h.Xg.prototype.next=function(){var a=this.tb;if(!a)return null;(a=a.next())&&I(this,a);return a};h.Xg.prototype.$k=function(){return null};h.Xg.prototype.We=function(){var a=this.tb;if(!a)return null;(a=a.We())&&I(this,a);return a};h.Xg.prototype.Bl=function(){return null};h.Zj=function(a){a.uc=this.Uk.bind(this);a.Og=this.jx.bind(this);this.s=new h.Ua(a);this.s.oe=!0;this.s.ks(new h.Xg);this.s.ix(new h.Xf);this.G=!!a.G;this.Nj=a.Ya;this.yq=[];this.tl=[];this.tk=[];this.Kc=[];this.Qr=[];this.Kj=this.s.Mf.B.eg};b=h.Zj.prototype;b.Ui=!0;b.Ag=!1;b.mh=!0;b.fb=8;b.Wf=h.Zj.prototype.fb;b.Ky=3*h.Zj.prototype.Wf;b.Ly=3*h.Zj.prototype.Wf;b.rp=2;b.bb=0;b.fc=0;b.kB=70;
b.Ja=function(a){this.K=h.g.m.L(a,{"class":"blocklyFlyout",style:"display: none"},null);this.Zb=h.g.m.L("path",{"class":"blocklyFlyoutBackground"},this.K);this.K.appendChild(this.s.Ja());this.s.$b.subscribe(this.Zb,"flyout","fill");this.s.$b.subscribe(this.Zb,"flyoutOpacity","fill-opacity");return this.K};
b.ua=function(a){this.rb=a;this.s.ki=a;this.Xb=new h.Ca(this.s,this.nj,!1,"blocklyFlyoutScrollbar");this.ta();Array.prototype.push.apply(this.yq,h.pa(this.K,"wheel",this,this.XD));this.Ui||(this.sn=this.zq.bind(this),K(this.rb,this.sn));Array.prototype.push.apply(this.yq,h.pa(this.Zb,"mousedown",this,this.Eg));this.s.rg=this.rb.rg.bind(this.rb);this.s.Aa=this.rb.Aa;a=this.s;a.Ig=new h.Bp(a)};
b.J=function(){this.ta();h.Za(this.yq);this.sn&&(eb(this.rb,this.sn),this.sn=null);this.Xb&&(this.Xb.J(),this.Xb=null);this.s&&(this.s.$b.unsubscribe(this.Zb),this.s.ki=null,this.s.J(),this.s=null);this.K&&(h.g.m.removeNode(this.K),this.K=null);this.rb=this.Zb=null};b.Df=function(){return this.bb};b.ij=function(){return this.s};b.isVisible=function(){return this.Ag};b.yb=function(a){var c=a!=this.isVisible();this.Ag=a;c&&this.gm()};b.bi=function(a){var c=a!=this.mh;this.mh=a;c&&this.gm()};
b.gm=function(){var a=this.mh?this.isVisible():!1;this.K.style.display=a?"block":"none";this.Xb.bi(a)};b.ta=function(){if(this.isVisible()){this.yb(!1);for(var a=0,c;c=this.Kc[a];a++)h.Za(c);this.Kc.length=0;this.Jg&&(eb(this.s,this.Jg),this.Jg=null)}};
b.show=function(a){this.s.Yb(!1);this.ta();Kd(this);if("string"==typeof a){a=this.s.ki.zs[a]||null;if("function"!=typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=a(this.s.ki);if(!Array.isArray(a))throw TypeError("Result of toolbox category callback must be an array.");}this.yb(!0);var c=[],d=[];this.Qr.length=0;for(var e=this.nj?this.Ky:this.Ly,f=0,g;g=a[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "BLOCK":var k=h.N.dj(g,this.s);k.isEnabled()||
this.Qr.push(k);c.push({type:"block",block:k});g=parseInt(g.getAttribute("gap"),10);d.push(isNaN(g)?e:g);break;case "SEP":g=parseInt(g.getAttribute("gap"),10);!isNaN(g)&&0<d.length?d[d.length-1]=g:d.push(e);break;case "LABEL":case "BUTTON":k="LABEL"==g.tagName.toUpperCase();if(!h.Jy)throw Error("Missing require for Blockly.FlyoutButton");g=new h.Jy(this.s,this.rb,g,k);c.push({type:"button",button:g});d.push(e)}Ld(this,c,d);this.Kc.push(h.pa(this.Zb,"mouseover",this,function(){for(var l=D(this.s,!1),
m=0,n;n=l[m];m++)n.Il()}));this.nj?this.fc=0:this.bb=0;this.s.Yb(!0);this.Wr();this.zq();this.position();this.Jg=this.Wr.bind(this);K(this.s,this.Jg)};function Kd(a){for(var c=D(a.s,!1),d=0,e;e=c[d];d++)e.C==a.s&&e.J(!1,!1);for(d=0;d<a.tl.length;d++)(c=a.tl[d])&&h.g.m.removeNode(c);for(d=a.tl.length=0;c=a.tk[d];d++)c.J();a.tk.length=0;a.s.Ig.clear()}function Md(a,c){return function(d){var e=a.rb.rg(d);e&&(vb(e,c),ub(e,d,a))}}b.Eg=function(a){var c=this.rb.rg(a);c&&ub(c,a,this)};b.bw=function(a){return a.isEnabled()};
function qb(a,c){var d=null;h.i.disable();var e=a.rb.pg();a.rb.Yb(!1);try{var f=a.rb;if(!c.aa())throw Error("oldBlock is not rendered.");var g=h.N.gg(c,!0);f.Yb(!1);var k=h.N.dj(g,f);if(!k.aa())throw Error("block is not rendered.");var l=h.g.Tk(f.Xa),m=h.g.Tk(a.s.Xa),n=c.Ia();n.scale(a.s.scale);var r=h.g.I.sum(m,n),q=h.g.I.Ok(r,l);q.scale(1/f.scale);k.moveBy(q.x,q.y);d=k;h.vc()}finally{h.i.enable()}c=h.Z.tv(a.rb,e);if(h.i.isEnabled())for(h.i.X(!0),h.i.Ha(new h.i.Pd(d)),e=0;e<c.length;e++)h.i.Ha(new h.i.Ad(c[e]));
a.Ui?a.ta():a.zq();return d}b.zq=function(){for(var a=D(this.s,!1),c=0,d;d=a[c];c++)if(-1==this.Qr.indexOf(d))for(var e=cb(this.rb,h.g.Fq(d));d;)d.Ze(e),d=u(d)};
b.Wr=function(){this.Jg&&eb(this.s,this.Jg);this.s.scale=this.rb.scale;for(var a=0,c=D(this.s,!1),d=0,e;e=c[d];d++){var f=G(e).width;e.M&&(f-=this.Kj);a=Math.max(a,f)}for(d=0;e=this.tk[d];d++)a=Math.max(a,e.width);a+=1.5*this.Wf+this.Kj;a*=this.s.scale;a+=h.Ca.jc;if(this.bb!=a){for(d=0;e=c[d];d++){if(this.G){f=e.Ia().x;var g=a/this.s.scale-this.Wf;e.M||(g-=this.Kj);e.moveBy(g-f,0)}e.nv&&(f=e.nv,g=e,e=G(g),f.setAttribute("width",e.width),f.setAttribute("height",e.height),g=g.Ia(),f.setAttribute("y",
g.y),f.setAttribute("x",this.G?g.x-e.width:g.x))}if(this.G)for(d=0;e=this.tk[d];d++)c=e.II().y,e.moveTo(a/this.s.scale-e.width-this.Wf-this.Kj,c);this.bb=a;this.position()}this.Jg&&K(this.s,this.Jg)};function ob(a){return a.Xb?a.Xb.isVisible():!1};h.gh=function(a){a.uc=this.Uk.bind(this);a.Og=this.jx.bind(this);h.gh.w.constructor.call(this,a);this.nj=!1};h.g.object.S(h.gh,h.Zj);b=h.gh.prototype;b.Uk=function(){if(!this.isVisible())return null;try{var a=this.s.Xa.getBBox()}catch(f){a={height:0,y:0,width:0,x:0}}var c=this.rp,d=this.fc-2*this.rp,e=this.bb;this.G||(e-=this.rp);return{vb:d,lb:e,hd:a.height*this.s.scale+2*this.Wf,Je:a.width*this.s.scale+2*this.Wf,Ib:-this.s.scrollY+a.y,zb:-this.s.scrollX,rc:a.y,Dc:a.x,oc:c,dc:0}};
b.jx=function(a){var c=this.Uk();c&&("number"==typeof a.y&&(this.s.scrollY=-c.hd*a.y),this.s.translate(this.s.scrollX+c.dc,this.s.scrollY+c.oc))};
b.position=function(){if(this.isVisible()){var a=this.rb.uc();if(a){this.fc=a.vb;var c=this.bb-this.fb,d=a.vb-2*this.fb,e=this.Nj==h.fg,f=c+this.fb;f=["M "+(e?f:0)+",0"];f.push("h",e?-c:c);f.push("a",this.fb,this.fb,0,0,e?0:1,e?-this.fb:this.fb,this.fb);f.push("v",Math.max(0,d));f.push("a",this.fb,this.fb,0,0,e?0:1,e?this.fb:-this.fb,this.fb);f.push("h",e?c:-c);f.push("z");this.Zb.setAttribute("d",f.join(" "));c=this.fc;a=this.rb.Ya==this.Nj?a.yx?this.Nj==h.zd?a.yx:a.lb-this.bb:this.Nj==h.zd?0:a.lb:
this.Nj==h.zd?0:a.lb+a.dc-this.bb;this.K.setAttribute("width",this.bb);this.K.setAttribute("height",c);"svg"==this.K.tagName?h.g.m.Ll(this.K,"translate("+a+"px,0px)"):this.K.setAttribute("transform","translate("+a+",0)");this.Xb&&(this.Xb.Mr=new h.g.I(a,0),this.Xb.resize(),va(this.Xb,this.Xb.Ve.x,this.Xb.Ve.y))}}};b.XD=function(a){var c=h.g.Dv(a);if(c.y){var d=this.Uk();c=d.Ib-d.rc+c.y;c=Math.min(c,d.hd-d.vb);c=Math.max(c,0);this.Xb.set(c);h.T.ta()}a.preventDefault();a.stopPropagation()};
function Ld(a,c,d){a.s.scale=a.rb.scale;for(var e=a.Wf,f=a.G?e:e+a.Kj,g=0,k;k=c[g];g++)if("block"==k.type){k=k.block;for(var l=p(k,!1),m=0,n;n=l[m];m++)n.Qc=!0;k.ya();n=k.aa();l=G(k);m=k.M?f-a.Kj:f;k.moveBy(m,e);var r=a,q=k,t=g;m=h.g.m.L("rect",{"fill-opacity":0,x:a.G?m-l.width:m,y:e,height:l.height,width:l.width},null);m.ue=q;h.H.Vi(m);r.s.Xa.insertBefore(m,q.aa());q.nv=m;r.tl[t]=m;r=a;r.Kc.push(h.pa(n,"mousedown",null,Md(r,k)));r.Kc.push(h.pa(m,"mousedown",null,Md(r,k)));r.Kc.push(h.ed(n,"mouseover",
k,k.Wm));r.Kc.push(h.ed(n,"mouseout",k,k.Il));r.Kc.push(h.ed(m,"mouseover",k,k.Wm));r.Kc.push(h.ed(m,"mouseout",k,k.Il));e+=l.height+d[g]}else"button"==k.type&&(l=a,m=k.button,n=f,r=e,q=m.Ja(),m.moveTo(n,r),m.show(),l.Kc.push(h.pa(q,"mousedown",l,l.Eg)),l.tk.push(m),e+=k.button.height+d[g])}
b.xn=function(){if(!this.K)return null;var a=this.K.getBoundingClientRect(),c=a.left;if(this.Nj==h.zd)return new h.g.Rect(-1E9,1E9,-1E9,c+a.width);h.g.userAgent.Po&&this.rb&&this.rb.Kh&&(a=this.rb.K.getBoundingClientRect().x,10>Math.abs(a-c)&&(c+=this.WI*this.rb.options.Vb.scale));return new h.g.Rect(-1E9,1E9,c,1E9)};h.g.v={};h.g.v.Ea=function(a,c){return" "+a+","+c+" "};h.g.v.curve=function(a,c){return" "+a+c.join("")};h.g.v.moveTo=function(a,c){return" M "+a+","+c+" "};h.g.v.moveBy=function(a,c){return" m "+a+","+c+" "};h.g.v.lineTo=function(a,c){return" l "+a+","+c+" "};h.g.v.line=function(a){return" l"+a.join("")};h.g.v.W=function(a,c){return" "+a+" "+c+" "};h.g.v.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};h.j.Wg=function(){this.Be=0;this.Gz=3;this.Ae=5;this.yt=8;this.Cc=10;this.Xt=this.Ae;this.wp=15;this.hk=5;this.eg=8;this.vz=15;this.uz=4;this.rz=12;this.Ay=16;this.fb=8;this.Km=15;this.Lz=0;this.Mz=20;this.Yx=4;this.Jz=15;this.Kz=100;this.Iz=15;this.Zo=24;this.Cy=14.5;this.By=this.wp+11;this.Ey=2;this.Dy=this.Zo;this.St=h.g.v.moveBy(0,0);this.Yy=12;this.Zy=6};b=h.j.Wg.prototype;
b.ua=function(){this.Gi=this.pr();this.Ii=this.qr();this.rf=this.vr();this.bh=this.rr();var a=this.fb,c=h.g.v.arc("a","0 0,0",a,h.g.v.Ea(-a,a)),d=h.g.v.arc("a","0 0,0",a,h.g.v.Ea(a,a));this.ak={width:a,height:a,Pr:c,$n:d};c=this.fb;a=h.g.v.moveBy(0,c)+h.g.v.arc("a","0 0,1",c,h.g.v.Ea(c,-c));c=h.g.v.arc("a","0 0,1",c,h.g.v.Ea(-c,-c));this.Ft={As:a,Np:c}};b.pr=function(){var a=this.Yy,c=this.Zy,d=h.g.v.line([h.g.v.Ea(6,3),h.g.v.Ea(-12,6),h.g.v.Ea(6,3)]);return{height:a,width:c,path:d}};
b.vr=function(){var a=this.Jz,c=this.Kz,d=h.g.v.curve("c",[h.g.v.Ea(30,-a),h.g.v.Ea(70,-a),h.g.v.Ea(c,0)]);return{height:a,width:c,path:d}};b.rr=function(){function a(g){g=g?-1:1;var k=-g,l=d/2,m=h.g.v.Ea(c,g*l);return h.g.v.curve("c",[h.g.v.Ea(0,g*(l+2.5)),h.g.v.Ea(-c,k*(l+.5)),h.g.v.Ea(-c,g*l)])+h.g.v.curve("s",[h.g.v.Ea(c,2.5*k),m])}var c=this.eg,d=this.wp,e=a(!0),f=a(!1);return{width:c,height:d,Md:f,Cl:e}};
b.qr=function(){function a(k){return h.g.v.line([h.g.v.Ea(k*e,d),h.g.v.Ea(3*k,0),h.g.v.Ea(k*e,-d)])}var c=this.vz,d=this.uz,e=(c-3)/2,f=a(1),g=a(-1);return{width:c,height:d,Hg:f,Kw:g}};h.j.u={NONE:0,ud:1,ht:2,kt:4,tp:8,Ps:16,qt:32,gt:64,lf:128,nt:256,Tt:512,ny:1024,jp:2048,ap:4096,xz:8192,Jo:16384,Wo:32768,Vo:65536,np:131072,mp:262144,ut:524288,pp:1048576,zp:2097152,Fo:4194304,ot:8388608};h.j.u.NF=h.j.u.Wo|h.j.u.Vo;h.j.u.wH=h.j.u.np|h.j.u.mp;h.j.u.Er=16777216;h.j.u.qb=function(){h.j.u.hasOwnProperty(void 0)||(h.j.u[void 0]=h.j.u.Er,h.j.u.Er<<=1);return h.j.u[void 0]};h.j.u.hl=function(a){return a.type&h.j.u.ud};h.j.u.Jh=function(a){return a.type&h.j.u.ht};
h.j.u.tj=function(a){return a.type&h.j.u.kt};h.j.u.qe=function(a){return a.type&h.j.u.tp};h.j.u.OI=function(a){return a.type&h.j.u.qt};h.j.u.pe=function(a){return a.type&h.j.u.lf};h.j.u.fl=function(a){return a.type&h.j.u.gt};h.j.u.wg=function(a){return a.type&h.j.u.nt};h.j.u.kl=function(a){return a.type&h.j.u.Tt};h.j.u.vj=function(a){return a.type&h.j.u.jp};h.j.u.zg=function(a){return a.type&h.j.u.ap};h.j.u.oC=function(a){return a.type&(h.j.u.jp|h.j.u.ap)};h.j.u.yg=function(a){return a.type&h.j.u.Vo};
h.j.u.RI=function(a){return a.type&h.j.u.mp};h.j.u.jl=function(a){return a.type&h.j.u.Wo};h.j.u.SI=function(a){return a.type&h.j.u.np};h.j.u.NI=function(a){return a.type&h.j.u.Jo};h.j.u.dw=function(a){return a.type&h.j.u.ut};h.j.u.TI=function(a){return a.type&h.j.u.pp};h.j.u.MI=function(a){return a.type&h.j.u.Ps};h.j.u.Pn=function(a){return a.type&h.j.u.zp};h.j.u.In=function(a){return a.type&h.j.u.Fo};h.j.u.UI=function(a){return a.type&(h.j.u.zp|h.j.u.Fo)};h.j.u.QI=function(a){return a.type&h.j.u.ot};h.j.Yf=function(a){this.height=this.width=0;this.type=h.j.u.NONE;this.hg=this.Ba=0;this.B=a;this.Ld=this.B.Km};h.j.na=function(a,c){h.j.na.w.constructor.call(this,a);this.Xp=c;a:switch(a=this.B,c.type){case h.Sa:case h.Vd:c=a.bh;break a;case h.Xd:case h.Ga:c=a.Ii;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=h.j.u.ny};h.g.object.S(h.j.na,h.j.Yf);h.j.ip=function(a,c){h.j.ip.w.constructor.call(this,a,c);this.type|=h.j.u.xz;this.height=this.shape.height;this.width=this.shape.width;this.Fd=this.B.hk;this.qd=this.width};h.g.object.S(h.j.ip,h.j.na);
h.j.kp=function(a,c){h.j.kp.w.constructor.call(this,a,c);this.type|=h.j.u.jp;this.height=this.shape.height;this.width=this.shape.width};h.g.object.S(h.j.kp,h.j.na);h.j.bp=function(a,c){h.j.bp.w.constructor.call(this,a,c);this.type|=h.j.u.ap;this.height=this.shape.height;this.width=this.shape.width};h.g.object.S(h.j.bp,h.j.na);h.j.bk=function(a,c){h.j.bk.w.constructor.call(this,a,c.connection);this.type|=h.j.u.lf;this.input=c;this.align=c.align;(this.lh=c.connection&&z(c.connection)?z(c.connection):null)?(a=G(this.lh),this.Bk=a.width,this.gn=a.height):this.gn=this.Bk=0;this.connection=c.connection;this.Fd=0};h.g.object.S(h.j.bk,h.j.na);
h.j.Vf=function(a,c){h.j.Vf.w.constructor.call(this,a,c);this.type|=h.j.u.nt;this.lh?(this.width=this.Bk,this.height=this.gn):(this.height=this.B.By,this.width=this.shape.width+this.B.Cy);this.Fd=this.B.hk;this.Ck=this.shape.height;this.lg=this.shape.width};h.g.object.S(h.j.Vf,h.j.bk);h.j.dg=function(a,c){h.j.dg.w.constructor.call(this,a,c);this.type|=h.j.u.Tt;this.height=this.lh?this.gn+this.B.Lz:this.B.Dy;this.width=this.B.Km+this.shape.width};h.g.object.S(h.j.dg,h.j.bk);
h.j.Cm=function(a,c){h.j.Cm.w.constructor.call(this,a,c);this.type|=h.j.u.gt;this.height=this.lh?this.gn-2*this.B.hk:this.shape.height;this.width=this.shape.width+this.B.Ey;this.Fd=this.B.hk;this.Ck=this.shape.height;this.lg=this.shape.width};h.g.object.S(h.j.Cm,h.j.bk);h.j.xd=function(a,c){h.j.xd.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=h.j.u.kt;a=new h.g.Yd(h.xd.prototype.Qm,h.xd.prototype.Qm-2);this.height=a.height;this.width=a.width};h.g.object.S(h.j.xd,h.j.Yf);h.j.Uo=function(a){h.j.Uo.w.constructor.call(this,a);this.type|=h.j.u.ut;this.height=this.B.Gi.height;this.width=this.B.Gi.width};h.g.object.S(h.j.Uo,h.j.Yf);
h.j.Fa=function(a,c){h.j.Fa.w.constructor.call(this,a);this.jv=c;this.Jc=c.kf&&!!c.A&&c.A.Jc();this.sB=!1;this.type|=h.j.u.ud;a=this.jv.Bf();this.height=a.height;this.width=a.width};h.g.object.S(h.j.Fa,h.j.Yf);h.j.Qo=function(a){h.j.Qo.w.constructor.call(this,a);this.type|=h.j.u.ht;this.height=this.B.rf.height;this.width=this.B.rf.width;this.Ti=this.height};h.g.object.S(h.j.Qo,h.j.Yf);
h.j.Um=function(a,c){h.j.Um.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.j.u.np:h.j.u.Wo)|h.j.u.Jo;this.width=this.height=this.B.Be};h.g.object.S(h.j.Um,h.j.Yf);h.j.Pm=function(a,c){h.j.Pm.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.j.u.mp:h.j.u.Vo)|h.j.u.Jo;this.width=this.B.fb;this.height=this.B.fb/2};h.g.object.S(h.j.Pm,h.j.Yf);h.j.Ei=function(a,c){h.j.Ei.w.constructor.call(this,a);this.type=this.type|h.j.u.tp|h.j.u.qt;this.width=c;this.height=this.B.Iz};h.g.object.S(h.j.Ei,h.j.Yf);h.j.eh=function(a){this.type=h.j.u.pp;this.elements=[];this.Ba=this.bc=this.ef=this.minWidth=this.minHeight=this.width=this.height=0;this.Rv=this.Cn=this.Tq=this.Gc=this.Bh=!1;this.B=a;this.Ld=this.B.Km};h.j.eh.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function U(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.j.u.pe(d))return d;return null}h.j.eh.prototype.us=function(){return!0};h.j.eh.prototype.hv=function(){return!0};
function Nd(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.j.u.qe(d))return d;return null}h.j.Ri=function(a){h.j.Ri.w.constructor.call(this,a);this.type|=h.j.u.zp;this.Ti=this.vf=0;this.YB=!1;this.connection=null};h.g.object.S(h.j.Ri,h.j.eh);h.j.Ri.prototype.Uq=function(a){var c=a.Ef?"cap"===a.Ef:h.ra.rf,d=a.U&&z(a.U);return!!a.M||c||(d?u(d)==a:!1)};
h.j.Ri.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.j.u.qe(f)||(h.j.u.Jh(f)?d=Math.max(d,f.Ti):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.vf=this.Ti=d;this.ef=this.width};h.j.Ri.prototype.us=function(){return!1};h.j.xi=function(a){h.j.xi.w.constructor.call(this,a);this.type|=h.j.u.Fo;this.Sv=!1;this.connection=null;this.ih=this.Nk=0};h.g.object.S(h.j.xi,h.j.eh);
h.j.xi.prototype.Uq=function(a){return!!a.M||!!u(a)};h.j.xi.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.j.u.qe(f)||(h.j.u.zg(f)?d=Math.max(d,f.height):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Nk=d;this.ef=this.width};h.j.xi.prototype.us=function(){return!1};
h.j.Tm=function(a,c,d){h.j.Tm.w.constructor.call(this,a);this.type=this.type|h.j.u.tp|h.j.u.Ps;this.width=d;this.height=c;this.qv=!1;this.ef=0;this.elements=[new h.j.Ei(this.B,d)]};h.g.object.S(h.j.Tm,h.j.eh);h.j.Tm.prototype.measure=function(){};h.j.Fi=function(a){h.j.Fi.w.constructor.call(this,a);this.type|=h.j.u.ot;this.Ju=0};h.g.object.S(h.j.Fi,h.j.eh);
h.j.Fi.prototype.measure=function(){this.width=this.minWidth;this.height=this.minHeight;for(var a=0,c=0,d;d=this.elements[c];c++)this.width+=d.width,h.j.u.pe(d)&&(h.j.u.kl(d)?a+=d.Bk:h.j.u.fl(d)&&0!=d.Bk&&(a+=d.Bk-d.lg)),h.j.u.qe(d)||(this.height=Math.max(this.height,d.height));this.Ju=a;this.ef=this.width+a};h.j.Fi.prototype.hv=function(){return!this.Bh&&!this.Gc};h.j.ag=function(a,c){this.R=c;this.Mf=a;this.B=this.Mf.B;this.M=c.M?new h.j.ip(this.B,c.M):null;this.dr=Ja(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.xg=c.xg();this.G=c.G;this.gi=this.width=this.Qj=this.height=0;this.rows=[];this.Wv=[];this.Hb=new h.j.Ri(this.B);this.pb=new h.j.xi(this.B);this.no=this.qd=0};b=h.j.ag.prototype;
b.measure=function(){var a=this.R.Ef?"cap"===this.R.Ef:h.ra.rf,c=!!this.R.U;this.Hb.Uq(this.R)?this.Hb.elements.push(new h.j.Um(this.B)):this.Hb.elements.push(new h.j.Pm(this.B));a?(a=new h.j.Qo(this.B),this.Hb.elements.push(a),this.Hb.vf=a.Ti):c&&(this.Hb.YB=!0,this.Hb.connection=new h.j.kp(this.B,this.R.U),this.Hb.elements.push(this.Hb.connection));this.R.P.length&&this.R.P[0].type==h.Ga&&!this.R.isCollapsed()?this.Hb.minHeight=this.B.Cc:this.Hb.minHeight=this.B.Ae;this.rows.push(this.Hb);a=new h.j.Fi(this.B);
var d=Pa(this.R);if(d.length){c=0;for(var e;e=d[c];c++){var f=new h.j.xd(this.B,e);this.isCollapsed&&e.Cu?this.Wv.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.R.P[c];c++)if(d.isVisible()){!e||d.type!=h.Ga&&e.type!=h.Ga&&(d.type!=h.Sa&&d.type!=h.Qd||this.dr)||(this.rows.push(a),a=new h.j.Fi(this.B));for(e=0;f=d.La[e];e++)a.elements.push(new h.j.Fa(this.B,f,d));this.ou(d,a);e=d}this.isCollapsed&&(a.Rv=!0,a.elements.push(new h.j.Uo(this.B)));(a.elements.length||a.Cn)&&this.rows.push(a);this.pb.Sv=
!!this.R.V;this.pb.minHeight=this.R.P.length&&this.R.P[this.R.P.length-1].type==h.Ga?this.B.Cc:this.B.Ae-1;this.pb.Uq(this.R)?this.pb.elements.push(new h.j.Um(this.B)):this.pb.elements.push(new h.j.Pm(this.B));this.pb.Sv&&(this.pb.connection=new h.j.bp(this.B,this.R.V),this.pb.elements.push(this.pb.connection));this.rows.push(this.pb);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.us()&&c.elements.push(new h.j.Ei(this.B,this.yn(null,d[0])));for(e=0;e<d.length-1;e++)c.elements.push(d[e]),
c.elements.push(new h.j.Ei(this.B,this.yn(d[e],d[e+1])));c.elements.push(d[d.length-1]);c.hv()&&c.elements.push(new h.j.Ei(this.B,this.yn(d[d.length-1],null)))}for(e=d=c=a=0;f=this.rows[e];e++)f.measure(),c=Math.max(c,f.width),f.Gc&&(a=Math.max(a,f.width-U(f).width)),d=Math.max(d,f.ef);this.gi=a;this.width=c;for(e=0;f=this.rows[e];e++)f.Gc&&(f.gi=this.gi);this.Qj=Math.max(c,d);this.M&&(this.qd=this.M.width,this.width+=this.M.width,this.Qj+=this.M.width);for(a=0;c=this.rows[a];a++)c.Gc?(d=U(c),e=c.width-
d.width,f=this.gi-this.qd,(e=f-e)&&this.Dp(c,e),e=c.width,f=this.width-this.qd-(this.B.ak.eJ||0),d.width+=f-e,c.width+=f-e,c.ef=Math.max(c.width,this.gi+c.Ju)):(d=this.width-this.qd-c.width)&&this.Dp(c,d);a=this.rows;this.rows=[];for(c=0;c<a.length;c++)this.rows.push(a[c]),c!=a.length-1&&this.rows.push(Od(this,a[c],a[c+1]));this.kv()};
b.ou=function(a,c){this.dr&&a.type==h.Sa?(c.elements.push(new h.j.Vf(this.B,a)),c.Tq=!0):a.type==h.Ga?(c.elements.push(new h.j.dg(this.B,a)),c.Gc=!0):a.type==h.Sa?(c.elements.push(new h.j.Cm(this.B,a)),c.Bh=!0):a.type==h.Qd&&(c.Cn=!0)};b.yn=function(a,c){if(a&&h.j.u.pe(a)&&!c){if(h.j.u.fl(a))return this.B.Be;if(h.j.u.wg(a))return this.B.Cc;if(h.j.u.kl(a))return this.B.Be}return a&&h.j.u.jl(a)&&c&&(h.j.u.vj(c)||h.j.u.zg(c))?c.Ld:a&&h.j.u.yg(a)&&c&&(h.j.u.vj(c)||h.j.u.zg(c))?c.Ld-this.B.fb:this.B.Ae};
b.Dp=function(a,c){var d=Nd(a);d&&(d.width+=c,a.width+=c)};function Od(a,c,d){a=new h.j.Tm(a.B,a.Fv(c,d),a.width-a.qd);c.Gc&&(a.qv=!0);return a}b.Fv=function(){return this.B.Ae};b.yv=function(a,c){return h.j.u.qe(c)?a.bc+c.height/2:h.j.u.In(a)?(a=a.bc+a.height-a.Nk,h.j.u.zg(c)?a+c.height/2:a-c.height/2):h.j.u.Pn(a)?h.j.u.Jh(c)?a.vf-c.height/2:a.vf+c.height/2:a.bc+a.height/2};
function Pd(a,c){for(var d=c.Ba,e=0,f;f=c.elements[e];e++)h.j.u.qe(f)&&(f.height=c.height),f.Ba=d,f.hg=a.yv(c,f),d+=f.width}b.kv=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++)e.bc=c,e.Ba=this.qd,c+=e.height,a=Math.max(a,e.ef),Pd(this,e);this.Qj=a+this.qd;this.height=c;this.no=this.Hb.vf;this.pb.ih=c-this.pb.Nk};h.j.mc=function(a,c){this.R=a;this.la=c;a.Ia();this.Hn=this.xa="";this.B=c.Mf.B};b=h.j.mc.prototype;b.draw=function(){Qd(this);Rd(this);Sd(this);this.R.Xh.ns(this.xa+"\n"+this.Hn);this.la.G&&this.R.Xh.Aq();h.j.jm&&this.R.$r.lB(this.R,this.la);Td(this)};function Td(a){a.R.height=a.la.height;a.R.width=a.la.Qj}function Qd(a){for(var c=0,d;d=a.la.Wv[c];c++)d.icon.Pc.setAttribute("display","none")}
function Rd(a){a.tq();for(var c=1;c<a.la.rows.length-1;c++){var d=a.la.rows[c];d.Rv?a.Qk(d):d.Gc?a.rq(d):d.Bh?a.uq(d):a.qq(d)}a.nq();a.pq()}b.tq=function(){var a=this.la.Hb,c=a.elements,d=this.la.Hb;if(d.connection){var e=d.Ba+d.Ld;M(d.connection.Xp,this.la.G?-e:e,0)}this.xa+=h.g.v.moveBy(a.Ba,this.la.no);for(d=0;e=c[d];d++)h.j.u.yg(e)?this.xa+=this.B.Ft.As:h.j.u.vj(e)?this.xa+=e.shape.Hg:h.j.u.Jh(e)?this.xa+=this.B.rf.path:h.j.u.qe(e)&&(this.xa+=h.g.v.W("h",e.width));this.xa+=h.g.v.W("v",a.height)};
b.Qk=function(a){this.xa+=this.B.Gi.path+h.g.v.W("v",a.height-this.B.Gi.height)};b.uq=function(a){var c=U(a);this.Nw(a);var d="function"==typeof c.shape.Md?c.shape.Md(c.height):c.shape.Md;this.xa+=h.g.v.W("H",c.Ba+c.width)+d+h.g.v.W("v",a.height-c.Ck)};b.rq=function(a){var c=U(a);this.xa+=h.g.v.W("H",c.Ba+c.Ld+c.shape.width)+(c.shape.Kw+h.g.v.W("h",-(c.Ld-this.B.ak.width))+this.B.ak.Pr)+h.g.v.W("v",a.height-2*this.B.ak.height)+this.B.ak.$n+h.g.v.W("H",a.Ba+a.width);this.Qw(a)};
b.qq=function(a){this.xa+=h.g.v.W("V",a.bc+a.height)};b.nq=function(){var a=this.la.pb,c=a.elements;this.Pw();this.xa+=h.g.v.W("V",a.ih);for(var d=c.length-1,e;e=c[d];d--)h.j.u.zg(e)?this.xa+=e.shape.Kw:h.j.u.jl(e)?this.xa+=h.g.v.W("H",a.Ba):h.j.u.yg(e)?this.xa+=this.B.Ft.Np:h.j.u.qe(e)&&(this.xa+=h.g.v.W("h",-1*e.width))};
b.pq=function(){var a=this.la.M;if(this.la.M){var c=this.la.qd;M(this.R.M,this.la.G?-c:c,this.la.M.Fd)}a&&(c=a.Fd+a.height,a="function"==typeof a.shape.Cl?a.shape.Cl(a.height):a.shape.Cl,this.xa+=h.g.v.W("V",c)+a);this.xa+="z"};
function Sd(a){for(var c=0,d;d=a.la.rows[c];c++)for(var e=0,f;f=d.elements[e];e++)if(h.j.u.wg(f))a.oq(f);else if(h.j.u.tj(f)||h.j.u.hl(f)){var g=a;if(h.j.u.hl(f))var k=f.jv.aa();else h.j.u.tj(f)&&(k=f.icon.Pc);var l=f.hg-f.height/2,m=f.Ba,n="";g.la.G&&(m=-(m+f.width),f.sB&&(m+=f.width,n="scale(-1 1)"));h.j.u.tj(f)?(k.setAttribute("display","block"),k.setAttribute("transform","translate("+m+","+l+")"),fc(f.icon)):k.setAttribute("transform","translate("+m+","+l+")"+n);g.la.xg&&k.setAttribute("display",
"none")}}b.oq=function(a){var c=a.width,d=a.height,e=a.Fd,f=a.Ck+e;this.Hn+=h.g.v.moveTo(a.Ba+a.lg,a.hg-d/2)+h.g.v.W("v",e)+a.shape.Md+h.g.v.W("v",d-f)+h.g.v.W("h",c-a.lg)+h.g.v.W("v",-d)+"z";this.Ow(a)};b.Ow=function(a){var c=a.hg-a.height/2;if(a.connection){var d=a.Ba+a.lg;this.la.G&&(d*=-1);M(a.connection,d,c+a.Fd)}};b.Qw=function(a){var c=U(a);if(c.connection){var d=a.Ba+a.gi+c.Ld;this.la.G&&(d*=-1);M(c.connection,d,a.bc)}};
b.Nw=function(a){var c=U(a);if(c.connection){var d=a.Ba+a.width;this.la.G&&(d*=-1);M(c.connection,d,a.bc)}};b.Pw=function(){var a=this.la.pb;if(a.connection){a=a.connection;var c=a.Ba;M(a.Xp,this.la.G?-c:c,a.hg-a.height/2)}};h.sa=function(a,c){this.s=a;this.Mn=c;this.Sc=null;this.B=a.Mf.B};h.sa.zm=5;h.sa.zi=100;h.sa.kG=24;h.sa.fI=5;h.sa.Rm=10;h.sa.Ss=2;h.sa.Ny=.75;h.sa.ym="#cc0a0a";h.sa.mz="#4286f4";h.sa.ty="blocklyCursor";h.sa.lz="blocklyMarker";b=h.sa.prototype;b.Jk=null;b.aa=function(){return this.K};
b.Ja=function(){this.K=h.g.m.L("g",{"class":this.Mn?h.sa.lz:h.sa.ty},null);var a=this.Mn?h.sa.mz:h.sa.ym;this.ec=h.g.m.L("g",{width:h.sa.zi,height:h.sa.zm},this.K);this.Zi=h.g.m.L("rect",{x:"0",y:"0",fill:a,width:h.sa.zi,height:h.sa.zm,style:"display: none;"},this.ec);this.$i=h.g.m.L("rect",{"class":"blocklyVerticalCursor",x:"0",y:"0",rx:"10",ry:"10",style:"display: none;",stroke:a},this.ec);this.Kk=h.g.m.L("path",{width:h.sa.zi,height:h.sa.zm,transform:"",style:"display: none;",fill:a},this.ec);
this.qh=h.g.m.L("path",{width:h.sa.zi,height:h.sa.zm,transform:"",style:"display: none;",fill:"none",stroke:a,"stroke-width":"4"},this.ec);this.Mn||(h.g.m.L("animate",{attributeType:"XML",attributeName:"fill",dur:"1s",values:h.sa.ym+";transparent;transparent;",repeatCount:"indefinite"},this.Zi),h.g.m.L("animate",{attributeType:"XML",attributeName:"fill",dur:"1s",values:h.sa.ym+";transparent;transparent;",repeatCount:"indefinite"},this.Kk),h.g.m.L("animate",{attributeType:"XML",attributeName:"stroke",
dur:"1s",values:h.sa.ym+";transparent;transparent;",repeatCount:"indefinite"},this.qh));return this.K};function Ud(a,c){a.Mn?(a.Sc&&a.Sc.Nl(null),c.Nl(a.aa())):(a.Sc&&a.Sc.Ml(null),c.Ml(a.aa()));a.Sc=c}
function Vd(a,c){if(c){var d=c.width,e=c.height,f=e*h.sa.Ny;c.U?(e=h.sa.Ss,d=h.g.v.moveBy(-1*e,f)+h.g.v.W("V",-1*e)+h.g.v.W("H",a.B.Km)+a.B.Ii.Hg+h.g.v.W("H",d+2*e)+h.g.v.W("V",f),a.qh.setAttribute("d",d)):c.M?(d=h.g.v.moveBy(d,0)+h.g.v.W("h",-1*(d-a.B.bh.width))+h.g.v.W("v",a.B.hk)+a.B.bh.Md+h.g.v.W("V",e)+h.g.v.W("H",d),a.qh.setAttribute("d",d)):(e=h.sa.Ss,d=h.g.v.moveBy(-1*e,f)+h.g.v.W("V",-1*e)+h.g.v.W("H",d+2*e)+h.g.v.W("V",f),a.qh.setAttribute("d",d));a.s.G&&a.qh.setAttribute("transform","scale(-1 1)");
a.Jk=a.qh;Ud(a,c);Wd(a)}}function Wd(a){a.ta();a.Jk.style.display=""}function Xd(a,c,d,e){a.Zi.setAttribute("x",c);a.Zi.setAttribute("y",d);a.Zi.setAttribute("width",e);a.Jk=a.Zi}function Yd(a,c,d,e,f){a.$i.setAttribute("x",c);a.$i.setAttribute("y",d);a.$i.setAttribute("width",e);a.$i.setAttribute("height",f);a.Jk=a.$i}b.ta=function(){this.Zi.style.display="none";this.$i.style.display="none";this.Kk.style.display="none";this.qh.style.display="none"};
b.draw=function(a){if(a)if(a.qb()===h.F.types.Xc)Vd(this,a.ma);else if(a.qb()===h.F.types.Li)Vd(this,a.ma.A);else if(a.ma.type===h.Sa){var c=a.ma;a=c.A;var d=c.Th.x;c=c.Th.y;var e=h.g.v.moveTo(0,0)+this.B.bh.Md;this.Kk.setAttribute("d",e);this.Kk.setAttribute("transform","translate("+d+","+c+")"+(this.s.G?" scale(-1 1)":""));this.Jk=this.Kk;Ud(this,a);Wd(this)}else if(a.ma.type===h.Ga)c=a.ma,a=c.A,d=0,c=c.Th.y,e=G(a).width,this.s.G&&(d=-e),Xd(this,d,c,e),Ud(this,a),Wd(this);else if(a.qb()===h.F.types.Wd)Vd(this,
a.ma.A);else if(a.qb()===h.F.types.ud)a=a.ma,d=a.Bf().width,c=a.Bf().height,Yd(this,0,0,d,c),Ud(this,a),Wd(this);else if(a.qb()===h.F.types.hh)d=a.Kx,a=d.x,d=d.y,this.s.G&&(a-=h.sa.zi),Xd(this,a,d,h.sa.zi),Ud(this,this.s),Wd(this);else{if(a.qb()===h.F.types.De){a=a.ma;c=G(a);d=c.width+h.sa.Rm;c=c.height+h.sa.Rm;var f=e=-1*h.sa.Rm/2,g=-1*h.sa.Rm/2;this.s.G&&(f=-(d+e));Yd(this,f,g,d,c);Ud(this,a);Wd(this)}}else this.ta()};b.J=function(){this.K&&h.g.m.removeNode(this.K)};h.j.cg=function(){this.B=null};b=h.j.cg.prototype;b.ua=function(){this.B=this.nw();this.B.ua()};b.nw=function(){return new h.j.Wg};b.qw=function(a){return new h.j.ag(this,a)};b.ow=function(a,c){return new h.j.mc(a,c)};b.pw=function(a){return new h.j.dh(a)};b.ya=function(a){if(h.j.jm&&!a.$r){if(!h.j.zy)throw Error("Missing require for Blockly.blockRendering.Debug");var c=new h.j.zy;a.$r=c}c=this.qw(a);c.measure();this.ow(a,c).draw()};h.ca={};h.ca.Wg=function(){h.ca.Wg.w.constructor.call(this);this.Bc=1};h.g.object.S(h.ca.Wg,h.j.Wg);h.ca.jt=function(a){this.la=a;this.al=this.Y="";this.cc=this.la.G;a=a.Mf;this.B=a.B;this.ne=a.ne;this.Hc=this.ne.$f;this.Nr=this.ne.yz;this.rj=this.ne.Vy;this.Gl=this.ne.bh;this.MC=this.ne.Ii;this.FD=this.ne.rf;this.gw=this.ne.Gi};h.ca.jt.prototype.Qk=function(a){this.la.G&&(this.Y+=h.g.v.W("H",a.width-this.Hc),this.Y+=this.gw.Hg,this.Y+=h.g.v.W("v",a.height-this.gw.height-this.Hc))};
function Zd(a,c){var d=c.Ba+c.width-a.Hc;c.qv&&(a.Y+=h.g.v.W("H",d));a.cc&&(a.Y+=h.g.v.W("H",d),c.height>a.Hc&&(a.Y+=h.g.v.W("V",c.bc+c.height-a.Hc)))};h.ca.dh=function(a){this.ji=a;this.Zl=h.g.m.L("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.ji);this.Jj=h.g.m.L("path",{"class":"blocklyPath"},this.ji);this.am=h.g.m.L("path",{"class":"blocklyPathLight"},this.ji)};h.ca.dh.prototype.ns=function(a,c){this.Jj.setAttribute("d",a);this.Zl.setAttribute("d",a);this.am.setAttribute("d",c)};
h.ca.dh.prototype.Aq=function(){this.Jj.setAttribute("transform","scale(-1 1)");this.am.setAttribute("transform","scale(-1 1)");this.Zl.setAttribute("transform","translate(1,1) scale(-1 1)")};h.ca.Vf=function(a,c){h.ca.Vf.w.constructor.call(this,a,c);this.lh&&(this.width+=this.B.Bc,this.height+=this.B.Bc)};h.g.object.S(h.ca.Vf,h.j.Vf);h.ca.dg=function(a,c){h.ca.dg.w.constructor.call(this,a,c);this.lh&&(this.height+=this.B.Bc)};h.g.object.S(h.ca.dg,h.j.dg);h.ca.ag=function(a,c){h.ca.ag.w.constructor.call(this,a,c)};h.g.object.S(h.ca.ag,h.j.ag);b=h.ca.ag.prototype;b.ou=function(a,c){this.dr&&a.type==h.Sa?(c.elements.push(new h.ca.Vf(this.B,a)),c.Tq=!0):a.type==h.Ga?(c.elements.push(new h.ca.dg(this.B,a)),c.Gc=!0):a.type==h.Sa?(c.elements.push(new h.j.Cm(this.B,a)),c.Bh=!0):a.type==h.Qd&&(c.Cn=!0)};
b.yn=function(a,c){if(!a)return c&&h.j.u.hl(c)&&c.Jc?this.B.Ae:c&&h.j.u.wg(c)?this.B.yt:c&&h.j.u.kl(c)?this.B.Mz:this.B.Cc;if(!h.j.u.pe(a)&&!c)return h.j.u.hl(a)&&a.Jc?this.B.Ae:h.j.u.tj(a)?2*this.B.Cc+1:h.j.u.Jh(a)?this.B.Be:h.j.u.oC(a)?this.B.Cc:h.j.u.yg(a)?this.B.rz:h.j.u.dw(a)?this.B.Be:this.B.Cc;if(h.j.u.pe(a)&&!c){if(h.j.u.fl(a))return this.B.Be;if(h.j.u.wg(a))return this.B.Cc;if(h.j.u.kl(a))return this.B.Be}if(!h.j.u.pe(a)&&c&&h.j.u.pe(c)){if(a.Jc){if(h.j.u.wg(c)||h.j.u.fl(c))return this.B.Gz}else{if(h.j.u.wg(c)||
h.j.u.fl(c))return this.B.yt;if(h.j.u.kl(c))return this.B.Cc}return this.B.Cc-1}if(h.j.u.tj(a)&&c&&!h.j.u.pe(c))return this.B.Cc;if(h.j.u.wg(a)&&c&&!h.j.u.pe(c))return c.Jc?this.B.Ae:this.B.Cc;if(h.j.u.jl(a)&&c){if(h.j.u.Jh(c))return this.B.Be;if(h.j.u.vj(c))return c.Ld;if(h.j.u.zg(c))return a=(this.G?1:-1)*this.B.Bc/2,c.Ld+a}if(h.j.u.yg(a)&&c){if(h.j.u.vj(c))return c.Ld-this.B.fb;if(h.j.u.zg(c))return a=(this.G?1:-1)*this.B.Bc/2,c.Ld-this.B.fb+a}return!h.j.u.pe(a)&&c&&!h.j.u.pe(c)&&a.Jc==c.Jc||c&&
h.j.u.dw(c)?this.B.Cc:this.B.Ae};b.Dp=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(h.j.u.qe(e)){d=e;break a}d=null}e=Nd(a);if(a.Bh||a.Gc)a.ef+=c;var f=U(a);f?f.align==h.Co?e.width+=c:f.align==h.Js?(d.width+=c/2,e.width+=c/2):f.align==h.Ks&&(d.width+=c):e.width+=c;a.width+=c};b.Fv=function(a,c){return h.j.u.Pn(a)&&h.j.u.In(c)?this.B.Ay:h.j.u.Pn(a)||h.j.u.In(c)?this.B.Be:a.Bh&&c.Bh?this.B.Cc:!a.Gc&&c.Gc?this.B.Yx:a.Gc&&c.Gc||!a.Gc&&c.Cn?this.B.Cc:this.B.Ae};
b.yv=function(a,c){if(h.j.u.qe(c))return a.bc+c.height/2;if(h.j.u.In(a))return a=a.bc+a.height-a.Nk,h.j.u.zg(c)?a+c.height/2:a-c.height/2;if(h.j.u.Pn(a))return h.j.u.Jh(c)?a.vf-c.height/2:a.vf+c.height/2;var d=a.bc;h.j.u.hl(c)||h.j.u.tj(c)?(d+=c.height/2,(a.Tq||a.Gc)&&c.height+this.B.Xt<=a.height&&(d+=this.B.Xt)):d=h.j.u.wg(c)?d+c.height/2:d+a.height/2;return d};
b.kv=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.bc=c;e.Ba=this.qd;c+=e.height;a=Math.max(a,e.ef);var f=c-this.Hb.Ti;e==this.pb&&f<this.B.Zo&&(f=this.B.Zo-f,this.pb.height+=f,c+=f);Pd(this,e)}this.pb.ih=c-this.pb.Nk;this.Qj=a+this.qd+this.B.Bc;this.width+=this.B.Bc;this.height=c+this.B.Bc;this.no=this.Hb.vf};h.ca.mc=function(a,c){h.ca.mc.w.constructor.call(this,a,c);this.Qe=new h.ca.jt(c)};h.g.object.S(h.ca.mc,h.j.mc);b=h.ca.mc.prototype;b.draw=function(){Qd(this);Rd(this);Sd(this);var a=this.Qe;this.R.Xh.ns(this.xa+"\n"+this.Hn,a.Y+"\n"+a.al);this.la.G&&this.R.Xh.Aq();h.j.jm&&this.R.$r.lB(this.R,this.la);Td(this)};
b.tq=function(){var a=this.Qe,c=this.la.Hb;a.Y+=h.g.v.moveBy(c.Ba,a.la.no);for(var d=0,e;e=c.elements[d];d++)h.j.u.jl(e)?a.Y+=a.ne.St:h.j.u.yg(e)?a.Y+=a.Nr.As(a.cc):h.j.u.vj(e)?a.Y+=a.MC.Hg:h.j.u.Jh(e)?a.Y+=a.FD.path(a.cc):h.j.u.qe(e)&&0!=e.width&&(a.Y+=h.g.v.W("H",e.Ba+e.width-a.Hc));a.Y+=h.g.v.W("H",c.Ba+c.width-a.Hc);Zd(this.Qe,this.la.Hb);h.ca.mc.w.tq.call(this)};b.Qk=function(a){this.Qe.Qk(a);h.ca.mc.w.Qk.call(this,a)};
b.uq=function(a){var c=this.Qe,d=U(a);if(c.cc){var e=a.height-d.Ck;c.Y+=h.g.v.moveTo(d.Ba+d.width-c.Hc,a.bc)+c.Gl.Md(c.cc)+h.g.v.W("v",e)}else c.Y+=h.g.v.moveTo(d.Ba+d.width,a.bc)+c.Gl.Md(c.cc);h.ca.mc.w.uq.call(this,a)};
b.rq=function(a){var c=this.Qe,d=U(a);if(c.cc){var e=a.height-2*c.rj.height;c.Y+=h.g.v.moveTo(d.Ba,a.bc)+c.rj.Pr(c.cc)+h.g.v.W("v",e)+c.rj.$n(c.cc)+h.g.v.lineTo(a.width-d.Ba-c.rj.width,0)}else c.Y+=h.g.v.moveTo(d.Ba,a.bc+a.height)+c.rj.$n(c.cc)+h.g.v.lineTo(a.width-d.Ba-c.rj.width,0);h.ca.mc.w.rq.call(this,a)};b.qq=function(a){Zd(this.Qe,a);h.ca.mc.w.qq.call(this,a)};
b.nq=function(){var a=this.Qe,c=this.la.pb;if(a.cc)a.Y+=h.g.v.W("V",c.ih-a.Hc);else{var d=a.la.pb.elements[0];h.j.u.jl(d)?a.Y+=h.g.v.moveTo(c.Ba+a.Hc,c.ih-a.Hc):h.j.u.yg(d)&&(a.Y+=h.g.v.moveTo(c.Ba,c.ih),a.Y+=a.Nr.Np())}h.ca.mc.w.nq.call(this)};
b.pq=function(){var a=this.Qe,c=a.la.M;c&&(c=c.Fd+c.height,a.cc?a.Y+=h.g.v.moveTo(a.la.qd,c):(a.Y+=h.g.v.moveTo(a.la.qd+a.Hc,a.la.pb.ih-a.Hc),a.Y+=h.g.v.W("V",c)),a.Y+=a.Gl.Cl(a.cc));a.cc||(c=a.la.Hb,a.Y=h.j.u.yg(c.elements[0])?a.Y+h.g.v.W("V",a.Nr.height):a.Y+h.g.v.W("V",c.vf+a.Hc));h.ca.mc.w.pq.call(this)};
b.oq=function(a){var c=this.Qe,d=c.Hc,e=a.Ba+a.lg,f=a.hg-a.height/2,g=a.width-a.lg,k=f+d;if(c.cc){f=a.Fd-d;var l=a.height-(a.Fd+a.Ck)+d;c.al+=h.g.v.moveTo(e-d,k)+h.g.v.W("v",f)+c.Gl.Md(c.cc)+h.g.v.W("v",l)+h.g.v.W("h",g)}else c.al+=h.g.v.moveTo(a.Ba+a.width+d,k)+h.g.v.W("v",a.height)+h.g.v.W("h",-g)+h.g.v.moveTo(e,f+a.Fd)+c.Gl.Md(c.cc);h.ca.mc.w.oq.call(this,a)};b.Ow=function(a){var c=a.hg-a.height/2;if(a.connection){var d=a.Ba+a.lg+this.B.Bc;this.la.G&&(d*=-1);M(a.connection,d,c+a.Fd+this.B.Bc)}};
b.Qw=function(a){var c=U(a);if(c.connection){var d=a.Ba+a.gi+c.Ld;d=this.la.G?-1*d:d+this.B.Bc;M(c.connection,d,a.bc+this.B.Bc)}};b.Nw=function(a){var c=U(a);if(c.connection){var d=a.Ba+a.width+this.B.Bc;this.la.G&&(d*=-1);M(c.connection,d,a.bc)}};b.Pw=function(){var a=this.la.pb;if(a.connection){a=a.connection;var c=a.Ba;M(a.Xp,(this.la.G?-c:c)+this.B.Bc/2,a.hg-a.height/2+this.B.Bc)}};h.ca.$j=function(a){this.Yi=a;this.$f=.5;this.St=h.g.v.moveBy(this.$f,this.$f);this.Vy=$d(this);this.yz=ae(this);this.bh=this.rr();this.Ii=this.qr();this.Gi=this.pr();this.rf=this.vr()};
function $d(a){var c=a.Yi.fb;a=a.$f;var d=(1-Math.SQRT1_2)*(c+a)-a,e=h.g.v.moveBy(d,d)+h.g.v.arc("a","0 0,0",c,h.g.v.Ea(-d-a,c-d)),f=h.g.v.arc("a","0 0,0",c+a,h.g.v.Ea(c+a,c+a)),g=h.g.v.moveBy(d,-d)+h.g.v.arc("a","0 0,0",c+a,h.g.v.Ea(c-d,d+a));return{width:c+a,height:c,Pr:function(k){return k?e:""},$n:function(k){return k?f:g}}}
function ae(a){var c=a.Yi.fb;a=a.$f;var d=(1-Math.SQRT1_2)*(c-a)+a,e=h.g.v.moveBy(d,d)+h.g.v.arc("a","0 0,1",c-a,h.g.v.Ea(c-d,-d+a)),f=h.g.v.moveBy(a,c)+h.g.v.arc("a","0 0,1",c-a,h.g.v.Ea(c,-c+a)),g=-d,k=h.g.v.moveBy(d,g)+h.g.v.arc("a","0 0,1",c-a,h.g.v.Ea(-d+a,-g-c));return{height:c,As:function(l){return l?e:f},Np:function(){return k}}}
h.ca.$j.prototype.rr=function(){var a=this.Yi.eg,c=this.Yi.wp,d=h.g.v.moveBy(-2,-c+3.4)+h.g.v.lineTo(-.45*a,-2.1),e=h.g.v.W("v",2.5)+h.g.v.moveBy(.97*-a,2.5)+h.g.v.curve("q",[h.g.v.Ea(.05*-a,10),h.g.v.Ea(.3*a,9.5)])+h.g.v.moveBy(.67*a,-1.9)+h.g.v.W("v",2.5),f=h.g.v.W("v",-1.5)+h.g.v.moveBy(-.92*a,-.5)+h.g.v.curve("q",[h.g.v.Ea(-.19*a,-5.5),h.g.v.Ea(0,-11)])+h.g.v.moveBy(.92*a,1),g=h.g.v.moveBy(-5,c-.7)+h.g.v.lineTo(.46*a,-2.1);return{width:a,height:c,Cl:function(k){return k?d:f},Md:function(k){return k?
e:g}}};h.ca.$j.prototype.qr=function(){return{Hg:h.g.v.W("h",this.$f)+this.Yi.Ii.Hg}};h.ca.$j.prototype.pr=function(){return{Hg:h.g.v.lineTo(5.1,2.6)+h.g.v.moveBy(-10.2,6.8)+h.g.v.lineTo(5.1,2.6)}};h.ca.$j.prototype.vr=function(){var a=this.Yi.rf.height,c=h.g.v.moveBy(25,-8.7)+h.g.v.curve("c",[h.g.v.Ea(29.7,-6.2),h.g.v.Ea(57.2,-.5),h.g.v.Ea(75,8.7)]),d=h.g.v.curve("c",[h.g.v.Ea(17.8,-9.2),h.g.v.Ea(45.3,-14.9),h.g.v.Ea(75,-8.7)])+h.g.v.moveTo(100.5,a+.5);return{path:function(e){return e?c:d}}};h.ca.cg=function(){h.ca.cg.w.constructor.call(this);this.ne=null};h.g.object.S(h.ca.cg,h.j.cg);b=h.ca.cg.prototype;b.ua=function(){h.ca.cg.w.ua.call(this);this.ne=new h.ca.$j(this.B)};b.nw=function(){return new h.ca.Wg};b.qw=function(a){return new h.ca.ag(this,a)};b.ow=function(a,c){return new h.ca.mc(a,c)};b.pw=function(a){return new h.ca.dh(a)};h.j.register("geras",h.ca.cg);h.h.ADD_COMMENT="Adicionar coment\u00e1rio";h.h.CANNOT_DELETE_VARIABLE_PROCEDURE="N\u00e3o se pode deletar a vari\u00e1vel '%1' porque \u00e9 parte da defini\u00e7\u00e3o da fun\u00e7\u00e3o '%2'";h.h.CHANGE_VALUE_TITLE="Mudar valor:";h.h.CLEAN_UP="Limpar blocos";h.h.COLLAPSED_WARNINGS_WARNING="Bloqueios recolhidos cont\u00eam avisos.";h.h.COLLAPSE_ALL="Colapsar Blocos";h.h.COLLAPSE_BLOCK="Colapsar Bloco";h.h.COLOUR_BLEND_COLOUR1="cor 1";h.h.COLOUR_BLEND_COLOUR2="cor 2";h.h.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp";
h.h.COLOUR_BLEND_RATIO="propor\u00e7\u00e3o";h.h.COLOUR_BLEND_TITLE="misturar";h.h.COLOUR_BLEND_TOOLTIP="Mistura duas cores em uma dada propor\u00e7\u00e3o (0,0 - 1,0).";h.h.COLOUR_PICKER_HELPURL="https://pt.wikipedia.org/wiki/Cor";h.h.COLOUR_PICKER_TOOLTIP="Escolher uma cor da palheta de cores.";h.h.COLOUR_RANDOM_HELPURL="http://randomcolour.com";h.h.COLOUR_RANDOM_TITLE="cor aleat\u00f3ria";h.h.COLOUR_RANDOM_TOOLTIP="Escolher cor de forma aleat\u00f3ria.";h.h.COLOUR_RGB_BLUE="azul";
h.h.COLOUR_RGB_GREEN="verde";h.h.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html";h.h.COLOUR_RGB_RED="vermelho";h.h.COLOUR_RGB_TITLE="colorir com";h.h.COLOUR_RGB_TOOLTIP="Criar uma cor com a quantidade especificada de vermelho, verde e azul. Todos os valores devem estar entre 0 e 100.";h.h.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="encerra o la\u00e7o";
h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continua com a pr\u00f3xima itera\u00e7\u00e3o do la\u00e7o";h.h.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="Encerra o la\u00e7o.";h.h.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="Ignora o resto deste la\u00e7o, e continua com a pr\u00f3xima itera\u00e7\u00e3o.";h.h.CONTROLS_FLOW_STATEMENTS_WARNING="Aten\u00e7\u00e3o: Este bloco s\u00f3 pode ser usado dentro de um la\u00e7o.";h.h.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";
h.h.CONTROLS_FOREACH_TITLE="para cada item %1 na lista %2";h.h.CONTROLS_FOREACH_TOOLTIP="Para cada item em uma lista, atribua o item \u00e0 vari\u00e1vel '%1' e ent\u00e3o realize algumas instru\u00e7\u00f5es.";h.h.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";h.h.CONTROLS_FOR_TITLE="contar com %1 de %2 at\u00e9 %3 por %4";h.h.CONTROLS_FOR_TOOLTIP="Fa\u00e7a com que a vari\u00e1vel '%1' assuma os valores do n\u00famero inicial ao n\u00famero final, contando de acordo com o intervalo especificado e execute os blocos especificados.";
h.h.CONTROLS_IF_ELSEIF_TOOLTIP="Acrescente uma condi\u00e7\u00e3o para o bloco se.";h.h.CONTROLS_IF_ELSE_TOOLTIP="Acrescente uma condi\u00e7\u00e3o final para o bloco se.";h.h.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";h.h.CONTROLS_IF_IF_TOOLTIP="Acrescente, remova ou reordene se\u00e7\u00f5es para reconfigurar este bloco.";h.h.CONTROLS_IF_MSG_ELSE="sen\u00e3o";h.h.CONTROLS_IF_MSG_ELSEIF="sen\u00e3o se";h.h.CONTROLS_IF_MSG_IF="se";h.h.CONTROLS_IF_TOOLTIP_1="Se um valor for verdadeiro, ent\u00e3o realize algumas instru\u00e7\u00f5es.";
h.h.CONTROLS_IF_TOOLTIP_2="Se um valor for verdadeiro, ent\u00e3o realize o primeiro bloco de instru\u00e7\u00f5es. Sen\u00e3o, realize o segundo bloco de instru\u00e7\u00f5es.";h.h.CONTROLS_IF_TOOLTIP_3="Se o primeiro valor \u00e9 verdadeiro, ent\u00e3o realize o primeiro bloco de instru\u00e7\u00f5es. Sen\u00e3o, se o segundo valor \u00e9 verdadeiro, realize o segundo bloco de instru\u00e7\u00f5es.";h.h.CONTROLS_IF_TOOLTIP_4="Se o primeiro valor for verdadeiro, ent\u00e3o realize o primeiro bloco de instru\u00e7\u00f5es. Sen\u00e3o, se o segundo valor \u00e9 verdadeiro, realize o segundo bloco de instru\u00e7\u00f5es. Se nenhum dos blocos for verdadeiro, realize o \u00faltimo bloco de instru\u00e7\u00f5es.";
h.h.CONTROLS_REPEAT_HELPURL="https://pt.wikipedia.org/wiki/Estrutura_de_repeti%C3%A7%C3%A3o#Repeti.C3.A7.C3.A3o_com_vari.C3.A1vel_de_controle";h.h.CONTROLS_REPEAT_INPUT_DO="fa\u00e7a";h.h.CONTROLS_REPEAT_TITLE="repita %1 vezes";h.h.CONTROLS_REPEAT_TOOLTIP="Fa\u00e7a algumas instru\u00e7\u00f5es v\u00e1rias vezes.";h.h.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";h.h.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="repita at\u00e9";h.h.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="repita enquanto";
h.h.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="Enquanto um valor for falso, ent\u00e3o fa\u00e7a algumas instru\u00e7\u00f5es.";h.h.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="Enquanto um valor for verdadeiro, ent\u00e3o fa\u00e7a algumas instru\u00e7\u00f5es.";h.h.DELETE_ALL_BLOCKS="Deletar todos os blocos %1?";h.h.DELETE_BLOCK="Deletar bloco";h.h.DELETE_VARIABLE="Deletar a vari\u00e1vel '%1'";h.h.DELETE_VARIABLE_CONFIRMATION="Deletar %1 usos da vari\u00e1vel '%2'?";h.h.DELETE_X_BLOCKS="Deletar %1 blocos";
h.h.DISABLE_BLOCK="Desabilitar bloco";h.h.DUPLICATE_BLOCK="Duplicar";h.h.DUPLICATE_COMMENT="Duplicar coment\u00e1rio";h.h.ENABLE_BLOCK="Habilitar bloco";h.h.EXPAND_ALL="Expandir blocos";h.h.EXPAND_BLOCK="Expandir bloco";h.h.EXTERNAL_INPUTS="Entradas externas";h.h.HELP="Ajuda";h.h.INLINE_INPUTS="Entradas incorporadas";h.h.IOS_CANCEL="blockly:IOS Cancelar/pt-br";h.h.IOS_ERROR="Erro";h.h.IOS_OK="Ok";h.h.IOS_PROCEDURES_ADD_INPUT="+ Adicionar Entrada";h.h.IOS_PROCEDURES_ALLOW_STATEMENTS="Permitir declara\u00e7\u00f5es";
h.h.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR="Essa fun\u00e7\u00e3o tem entradas duplicadas.";h.h.IOS_PROCEDURES_INPUTS="ENTRADAS";h.h.IOS_VARIABLES_ADD_BUTTON="Adicionar";h.h.IOS_VARIABLES_ADD_VARIABLE="+ Adicionar Vari\u00e1vel";h.h.IOS_VARIABLES_DELETE_BUTTON="Deletar";h.h.IOS_VARIABLES_EMPTY_NAME_ERROR="Voc\u00ea n\u00e3o pode usar um nome de vari\u00e1vel vazio.";h.h.IOS_VARIABLES_RENAME_BUTTON="Blockly:Renomear varioas botoens/pt-br";h.h.IOS_VARIABLES_VARIABLE_NAME="Nome variavel";
h.h.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list";h.h.LISTS_CREATE_EMPTY_TITLE="criar lista vazia";h.h.LISTS_CREATE_EMPTY_TOOLTIP="Retorna uma lista, de tamanho 0, contendo nenhum registro";h.h.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="lista";h.h.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="Acrescenta, remove ou reordena se\u00e7\u00f5es para reconfigurar este bloco de lista.";h.h.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";
h.h.LISTS_CREATE_WITH_INPUT_WITH="criar lista com";h.h.LISTS_CREATE_WITH_ITEM_TOOLTIP="Acrescenta um item \u00e0 lista.";h.h.LISTS_CREATE_WITH_TOOLTIP="Cria uma lista com a quantidade de itens informada.";h.h.LISTS_GET_INDEX_FIRST="primeiro";h.h.LISTS_GET_INDEX_FROM_END="n\u00ba a partir do final";h.h.LISTS_GET_INDEX_FROM_START="n\u00ba";h.h.LISTS_GET_INDEX_GET="obter";h.h.LISTS_GET_INDEX_GET_REMOVE="obter e remover";h.h.LISTS_GET_INDEX_LAST="\u00faltimo";h.h.LISTS_GET_INDEX_RANDOM="aleat\u00f3rio";
h.h.LISTS_GET_INDEX_REMOVE="remover";h.h.LISTS_GET_INDEX_TAIL="";h.h.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="Retorna o primeiro item em uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_FROM="Retorna o item da lista na posi\u00e7\u00e3o especificada.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_LAST="Retorna o \u00faltimo item em uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="Retorna um item aleat\u00f3rio de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="Remove e retorna o primeiro item de uma lista.";
h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="Remove e retorna o item na posi\u00e7\u00e3o especificada em uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="Remove e retorna o \u00faltimo item de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="Remove e retorna um item aleat\u00f3rio de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="Remove o primeiro item de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="Remove o item na posi\u00e7\u00e3o especificada em uma lista.";
h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="Remove o \u00faltimo item de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="Remove um item aleat\u00f3rio de uma lista.";h.h.LISTS_GET_SUBLIST_END_FROM_END="at\u00e9 n\u00ba a partir do final";h.h.LISTS_GET_SUBLIST_END_FROM_START="at\u00e9 n\u00ba";h.h.LISTS_GET_SUBLIST_END_LAST="at\u00e9 \u00faltimo";h.h.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist";h.h.LISTS_GET_SUBLIST_START_FIRST="obt\u00e9m sublista a partir do primeiro";
h.h.LISTS_GET_SUBLIST_START_FROM_END="obt\u00e9m sublista de n\u00ba a partir do final";h.h.LISTS_GET_SUBLIST_START_FROM_START="obt\u00e9m sublista de n\u00ba";h.h.LISTS_GET_SUBLIST_TAIL="";h.h.LISTS_GET_SUBLIST_TOOLTIP="Cria uma c\u00f3pia da por\u00e7\u00e3o especificada de uma lista.";h.h.LISTS_INDEX_FROM_END_TOOLTIP="%1 \u00e9 o \u00faltimo item.";h.h.LISTS_INDEX_FROM_START_TOOLTIP="%1 \u00e9 o primeiro item.";h.h.LISTS_INDEX_OF_FIRST="encontre a primeira ocorr\u00eancia do item";
h.h.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";h.h.LISTS_INDEX_OF_LAST="encontre a \u00faltima ocorr\u00eancia do item";h.h.LISTS_INDEX_OF_TOOLTIP="Retorna o \u00edndice da primeira/\u00faltima ocorr\u00eancia do item na lista. Retorna %1 se o item n\u00e3o for encontrado.";h.h.LISTS_INLIST="na lista";h.h.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty";h.h.LISTS_ISEMPTY_TITLE="%1 \u00e9 vazia";
h.h.LISTS_ISEMPTY_TOOLTIP="Retorna ao verdadeiro se a lista estiver vazia.";h.h.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of";h.h.LISTS_LENGTH_TITLE="tamanho de %1";h.h.LISTS_LENGTH_TOOLTIP="Retorna o tamanho de uma lista.";h.h.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";h.h.LISTS_REPEAT_TITLE="criar lista com item %1 repetido %2 vezes";h.h.LISTS_REPEAT_TOOLTIP="Cria uma lista consistindo no valor informado repetido o n\u00famero de vezes especificado.";
h.h.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Listas#invertendo-uma-lista";h.h.LISTS_REVERSE_MESSAGE0="inverter %1";h.h.LISTS_REVERSE_TOOLTIP="Inverter uma c\u00f3pia da lista.";h.h.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set";h.h.LISTS_SET_INDEX_INPUT_TO="como";h.h.LISTS_SET_INDEX_INSERT="inserir em";h.h.LISTS_SET_INDEX_SET="definir";h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="Insere o item no in\u00edcio de uma lista.";
h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="Insere o item na posi\u00e7\u00e3o especificada em uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="Insere o item no final de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="Insere o item em uma posi\u00e7\u00e3o qualquer de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="Define o primeiro item de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_SET_FROM="Define o item da posi\u00e7\u00e3o especificada de uma lista.";
h.h.LISTS_SET_INDEX_TOOLTIP_SET_LAST="Define o \u00faltimo item de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="Define um item aleat\u00f3rio de uma lista.";h.h.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";h.h.LISTS_SORT_ORDER_ASCENDING="ascendente";h.h.LISTS_SORT_ORDER_DESCENDING="descendente";h.h.LISTS_SORT_TITLE="ordenar %1 %2 %3";h.h.LISTS_SORT_TOOLTIP="Ordenar uma c\u00f3pia de uma lista.";h.h.LISTS_SORT_TYPE_IGNORECASE="alfab\u00e9tico, ignorar mai\u00fascula/min\u00fascula";
h.h.LISTS_SORT_TYPE_NUMERIC="num\u00e9rico";h.h.LISTS_SORT_TYPE_TEXT="alfab\u00e9tico";h.h.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";h.h.LISTS_SPLIT_LIST_FROM_TEXT="Fazer uma lista a partir do texto";h.h.LISTS_SPLIT_TEXT_FROM_LIST="fazer um texto a partir da lista";h.h.LISTS_SPLIT_TOOLTIP_JOIN="Juntar uma lista de textos em um \u00fanico texto, separado por um delimitador.";h.h.LISTS_SPLIT_TOOLTIP_SPLIT="Dividir o texto em uma lista de textos, separando-o em cada delimitador.";
h.h.LISTS_SPLIT_WITH_DELIMITER="com delimitador";h.h.LOGIC_BOOLEAN_FALSE="falso";h.h.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";h.h.LOGIC_BOOLEAN_TOOLTIP="Retorna verdadeiro ou falso.";h.h.LOGIC_BOOLEAN_TRUE="verdadeiro";h.h.LOGIC_COMPARE_HELPURL="https://pt.wikipedia.org/wiki/Inequa%C3%A7%C3%A3o";h.h.LOGIC_COMPARE_TOOLTIP_EQ="Retorna verdadeiro se ambas as entradas forem iguais.";h.h.LOGIC_COMPARE_TOOLTIP_GT="Retorna verdadeiro se a primeira entrada for maior que a segunda entrada.";
h.h.LOGIC_COMPARE_TOOLTIP_GTE="Retorna verdadeiro se a primeira entrada for maior ou igual \u00e0 segunda entrada.";h.h.LOGIC_COMPARE_TOOLTIP_LT="Retorna verdadeiro se a primeira entrada for menor que a segunda entrada.";h.h.LOGIC_COMPARE_TOOLTIP_LTE="Retorna verdadeiro se a primeira entrada for menor ou igual \u00e0 segunda entrada.";h.h.LOGIC_COMPARE_TOOLTIP_NEQ="Retorna verdadeiro se ambas as entradas forem diferentes.";h.h.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";
h.h.LOGIC_NEGATE_TITLE="n\u00e3o %1";h.h.LOGIC_NEGATE_TOOLTIP="Retorna verdadeiro se a entrada for falsa. Retorna falsa se a entrada for verdadeira.";h.h.LOGIC_NULL="nulo";h.h.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";h.h.LOGIC_NULL_TOOLTIP="Retorna nulo.";h.h.LOGIC_OPERATION_AND="e";h.h.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";h.h.LOGIC_OPERATION_OR="ou";h.h.LOGIC_OPERATION_TOOLTIP_AND="Retorna verdadeiro se ambas as entradas forem verdadeiras.";
h.h.LOGIC_OPERATION_TOOLTIP_OR="Retorna verdadeiro se uma das estradas for verdadeira.";h.h.LOGIC_TERNARY_CONDITION="teste";h.h.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:";h.h.LOGIC_TERNARY_IF_FALSE="se falso";h.h.LOGIC_TERNARY_IF_TRUE="se verdadeiro";h.h.LOGIC_TERNARY_TOOLTIP='Avalia a condi\u00e7\u00e3o em "teste". Se a condi\u00e7\u00e3o for verdadeira retorna o valor "se verdadeiro", sen\u00e3o retorna o valor "se falso".';h.h.MATH_ADDITION_SYMBOL="+";
h.h.MATH_ARITHMETIC_HELPURL="https://pt.wikipedia.org/wiki/Aritm%C3%A9tica";h.h.MATH_ARITHMETIC_TOOLTIP_ADD="Retorna a soma dos dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_DIVIDE="Retorna o quociente da divis\u00e3o dos dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_MINUS="Retorna a diferen\u00e7a entre os dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="Retorna o produto dos dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_POWER="Retorna o primeiro n\u00famero elevado \u00e0 pot\u00eancia do segundo n\u00famero.";
h.h.MATH_ATAN2_HELPURL="https://en.wikipedia.org/wiki/Atan2";h.h.MATH_ATAN2_TITLE="atan2 de X:%1 Y:%2";h.h.MATH_ATAN2_TOOLTIP="Retorne o arco tangente do ponto (X, Y) em graus de -180 a 180.";h.h.MATH_CHANGE_HELPURL="https://pt.wikipedia.org/wiki/Adi%C3%A7%C3%A3o";h.h.MATH_CHANGE_TITLE="alterar %1 por %2";h.h.MATH_CHANGE_TOOLTIP='Soma um n\u00famero \u00e0 vari\u00e1vel "%1".';h.h.MATH_CONSTANT_HELPURL="https://pt.wikipedia.org/wiki/Anexo:Lista_de_constantes_matem%C3%A1ticas";
h.h.MATH_CONSTANT_TOOLTIP="Retorna uma das constantes comuns: \u03c0 (3.141\u2026), e (2.718\u2026), \u03c6 (1.618\u2026), sqrt(2) (1.414\u2026), sqrt(\u00bd) (0.707\u2026), ou \u221e (infinito).";h.h.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)";h.h.MATH_CONSTRAIN_TITLE="restringe %1 inferior %2 superior %3";h.h.MATH_CONSTRAIN_TOOLTIP="Restringe um n\u00famero entre os limites especificados (inclusivo).";h.h.MATH_DIVISION_SYMBOL="\u00f7";h.h.MATH_IS_DIVISIBLE_BY="\u00e9 divis\u00edvel por";
h.h.MATH_IS_EVEN="\u00e9 par";h.h.MATH_IS_NEGATIVE="\u00e9 negativo";h.h.MATH_IS_ODD="\u00e9 \u00edmpar";h.h.MATH_IS_POSITIVE="\u00e9 positivo";h.h.MATH_IS_PRIME="\u00e9 primo";h.h.MATH_IS_TOOLTIP="Verifica se um n\u00famero \u00e9 par, \u00edmpar, inteiro, positivo, negativo, ou se \u00e9 divis\u00edvel por outro n\u00famero. Retorna verdadeiro ou falso.";h.h.MATH_IS_WHOLE="\u00e9 inteiro";h.h.MATH_MODULO_HELPURL="https://pt.wikipedia.org/wiki/Opera%C3%A7%C3%A3o_m%C3%B3dulo";
h.h.MATH_MODULO_TITLE="resto da divis\u00e3o de %1 \u00f7 %2";h.h.MATH_MODULO_TOOLTIP="Retorna o resto da divis\u00e3o de dois n\u00fameros.";h.h.MATH_MULTIPLICATION_SYMBOL="\u00d7";h.h.MATH_NUMBER_HELPURL="https://pt.wikipedia.org/wiki/N%C3%BAmero";h.h.MATH_NUMBER_TOOLTIP="Um n\u00famero.";h.h.MATH_ONLIST_HELPURL="";h.h.MATH_ONLIST_OPERATOR_AVERAGE="m\u00e9dia da lista";h.h.MATH_ONLIST_OPERATOR_MAX="maior da lista";h.h.MATH_ONLIST_OPERATOR_MEDIAN="mediana da lista";h.h.MATH_ONLIST_OPERATOR_MIN="menor da lista";
h.h.MATH_ONLIST_OPERATOR_MODE="moda da lista";h.h.MATH_ONLIST_OPERATOR_RANDOM="item aleat\u00f3rio da lista";h.h.MATH_ONLIST_OPERATOR_STD_DEV="desvio padr\u00e3o da lista";h.h.MATH_ONLIST_OPERATOR_SUM="soma de uma lista";h.h.MATH_ONLIST_TOOLTIP_AVERAGE="Retorna a m\u00e9dia aritm\u00e9tica dos n\u00fameros da lista.";h.h.MATH_ONLIST_TOOLTIP_MAX="Retorna o maior n\u00famero da lista.";h.h.MATH_ONLIST_TOOLTIP_MEDIAN="Retorna a mediana dos n\u00fameros da lista.";h.h.MATH_ONLIST_TOOLTIP_MIN="Retorna o menor n\u00famero da lista.";
h.h.MATH_ONLIST_TOOLTIP_MODE="Retorna uma lista do(s) item(ns) mais comum(ns) da lista.";h.h.MATH_ONLIST_TOOLTIP_RANDOM="Retorna um elemento aleat\u00f3rio da lista.";h.h.MATH_ONLIST_TOOLTIP_STD_DEV="Retorna o desvio padr\u00e3o dos n\u00fameros da lista.";h.h.MATH_ONLIST_TOOLTIP_SUM="Retorna a soma de todos os n\u00fameros na lista.";h.h.MATH_POWER_SYMBOL="^";h.h.MATH_RANDOM_FLOAT_HELPURL="https://pt.wikipedia.org/wiki/Gerador_de_n%C3%BAmeros_pseudoaleat%C3%B3rios";
h.h.MATH_RANDOM_FLOAT_TITLE_RANDOM="fra\u00e7\u00e3o aleat\u00f3ria";h.h.MATH_RANDOM_FLOAT_TOOLTIP="Retorna uma fra\u00e7\u00e3o aleat\u00f3ria entre 0.0 (inclusivo) e 1.0 (exclusivo).";h.h.MATH_RANDOM_INT_HELPURL="https://pt.wikipedia.org/wiki/Gerador_de_n%C3%BAmeros_pseudoaleat%C3%B3rios";h.h.MATH_RANDOM_INT_TITLE="inteiro aleat\u00f3rio entre %1 e %2";h.h.MATH_RANDOM_INT_TOOLTIP="Retorna um n\u00famero inteiro entre os dois limites informados, inclusivo.";h.h.MATH_ROUND_HELPURL="https://pt.wikipedia.org/wiki/Arredondamento";
h.h.MATH_ROUND_OPERATOR_ROUND="arredonda";h.h.MATH_ROUND_OPERATOR_ROUNDDOWN="arredonda para baixo";h.h.MATH_ROUND_OPERATOR_ROUNDUP="arredonda para cima";h.h.MATH_ROUND_TOOLTIP="Arredonda um n\u00famero para cima ou para baixo.";h.h.MATH_SINGLE_HELPURL="https://pt.wikipedia.org/wiki/Raiz_quadrada";h.h.MATH_SINGLE_OP_ABSOLUTE="absoluto";h.h.MATH_SINGLE_OP_ROOT="raiz quadrada";h.h.MATH_SINGLE_TOOLTIP_ABS="Retorna o valor absoluto de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_EXP="Retorna o n\u00famero e elevado \u00e0 pot\u00eancia de um n\u00famero.";
h.h.MATH_SINGLE_TOOLTIP_LN="Retorna o logaritmo natural de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_LOG10="Retorna o logaritmo em base 10 de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_NEG="Retorna o oposto de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_POW10="Retorna 10 elevado \u00e0 pot\u00eancia de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_ROOT="Retorna a raiz quadrada de um n\u00famero.";h.h.MATH_SUBTRACTION_SYMBOL="-";h.h.MATH_TRIG_ACOS="acos";h.h.MATH_TRIG_ASIN="asin";h.h.MATH_TRIG_ATAN="atan";
h.h.MATH_TRIG_COS="cos";h.h.MATH_TRIG_HELPURL="https://pt.wikipedia.org/wiki/Fun%C3%A7%C3%A3o_trigonom%C3%A9trica";h.h.MATH_TRIG_SIN="sin";h.h.MATH_TRIG_TAN="tan";h.h.MATH_TRIG_TOOLTIP_ACOS="Retorna o arco cosseno de um n\u00famero.";h.h.MATH_TRIG_TOOLTIP_ASIN="Retorna o arco seno de um n\u00famero.";h.h.MATH_TRIG_TOOLTIP_ATAN="Retorna o arco tangente de um n\u00famero.";h.h.MATH_TRIG_TOOLTIP_COS="Retorna o cosseno de um grau (n\u00e3o radiano).";h.h.MATH_TRIG_TOOLTIP_SIN="Retorna o seno de um grau (n\u00e3o radiano).";
h.h.MATH_TRIG_TOOLTIP_TAN="Retorna a tangente de um grau (n\u00e3o radiano).";h.h.NEW_COLOUR_VARIABLE="Criar vari\u00e1vel colorida...";h.h.NEW_NUMBER_VARIABLE="Criar vari\u00e1vel num\u00e9rica...";h.h.NEW_STRING_VARIABLE="Criar vari\u00e1vel de segmentos de texto...";h.h.NEW_VARIABLE="Criar vari\u00e1vel...";h.h.NEW_VARIABLE_TITLE="Nome da nova vari\u00e1vel:";h.h.NEW_VARIABLE_TYPE_TITLE="Tipo da nova vari\u00e1vel:";h.h.ORDINAL_NUMBER_SUFFIX="";h.h.PROCEDURES_ALLOW_STATEMENTS="permitir declara\u00e7\u00f5es";
h.h.PROCEDURES_BEFORE_PARAMS="com:";h.h.PROCEDURES_CALLNORETURN_HELPURL="https://pt.wikipedia.org/wiki/Sub-rotina";h.h.PROCEDURES_CALLNORETURN_TOOLTIP='Executa a fun\u00e7\u00e3o definida pelo usu\u00e1rio "%1".';h.h.PROCEDURES_CALLRETURN_HELPURL="https://pt.wikipedia.org/wiki/Sub-rotina";h.h.PROCEDURES_CALLRETURN_TOOLTIP='Executa a fun\u00e7\u00e3o definida pelo usu\u00e1rio "%1" e usa seu retorno.';h.h.PROCEDURES_CALL_BEFORE_PARAMS="com:";h.h.PROCEDURES_CREATE_DO='Criar "%1"';
h.h.PROCEDURES_DEFNORETURN_COMMENT="Descreva esta fun\u00e7\u00e3o...";h.h.PROCEDURES_DEFNORETURN_DO="";h.h.PROCEDURES_DEFNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine";h.h.PROCEDURES_DEFNORETURN_PROCEDURE="fa\u00e7a algo";h.h.PROCEDURES_DEFNORETURN_TITLE="para";h.h.PROCEDURES_DEFNORETURN_TOOLTIP="Cria uma fun\u00e7\u00e3o que n\u00e3o tem retorno.";h.h.PROCEDURES_DEFRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine";h.h.PROCEDURES_DEFRETURN_RETURN="retorna";
h.h.PROCEDURES_DEFRETURN_TOOLTIP="Cria uma fun\u00e7\u00e3o que possui um valor de retorno.";h.h.PROCEDURES_DEF_DUPLICATE_WARNING="Aten\u00e7\u00e3o: Esta fun\u00e7\u00e3o tem par\u00e2metros duplicados.";h.h.PROCEDURES_HIGHLIGHT_DEF="Destacar defini\u00e7\u00e3o da fun\u00e7\u00e3o";h.h.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause";h.h.PROCEDURES_IFRETURN_TOOLTIP="Se um valor \u00e9 verdadeiro, ent\u00e3o retorna um valor.";h.h.PROCEDURES_IFRETURN_WARNING="Aten\u00e7\u00e3o: Este bloco s\u00f3 pode ser utilizado dentro da defini\u00e7\u00e3o de uma fun\u00e7\u00e3o.";
h.h.PROCEDURES_MUTATORARG_TITLE="nome da entrada:";h.h.PROCEDURES_MUTATORARG_TOOLTIP="Adiciona uma entrada para esta fun\u00e7\u00e3o";h.h.PROCEDURES_MUTATORCONTAINER_TITLE="entradas";h.h.PROCEDURES_MUTATORCONTAINER_TOOLTIP="Adiciona, remove, ou reordena as entradas para esta fun\u00e7\u00e3o.";h.h.REDO="Refazer";h.h.REMOVE_COMMENT="Remover coment\u00e1rio";h.h.RENAME_VARIABLE="Renomear vari\u00e1vel...";h.h.RENAME_VARIABLE_TITLE="Renomear todas as vari\u00e1veis '%1' para:";
h.h.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";h.h.TEXT_APPEND_TITLE="para %1 anexar texto %2";h.h.TEXT_APPEND_TOOLTIP='Acrescentar um peda\u00e7o de texto \u00e0 vari\u00e1vel "%1".';h.h.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";h.h.TEXT_CHANGECASE_OPERATOR_LOWERCASE="para min\u00fasculas";h.h.TEXT_CHANGECASE_OPERATOR_TITLECASE="para Nomes Pr\u00f3prios";h.h.TEXT_CHANGECASE_OPERATOR_UPPERCASE="para MAI\u00daSCULAS";
h.h.TEXT_CHANGECASE_TOOLTIP="Retorna uma c\u00f3pia do texto em um formato diferente.";h.h.TEXT_CHARAT_FIRST="obter primeira letra";h.h.TEXT_CHARAT_FROM_END="obter letra # a partir do final";h.h.TEXT_CHARAT_FROM_START="obter letra n\u00ba";h.h.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";h.h.TEXT_CHARAT_LAST="obter \u00faltima letra";h.h.TEXT_CHARAT_RANDOM="obter letra aleat\u00f3ria";h.h.TEXT_CHARAT_TAIL="";h.h.TEXT_CHARAT_TITLE="no texto %1 %2";
h.h.TEXT_CHARAT_TOOLTIP="Retorna a letra na posi\u00e7\u00e3o especificada.";h.h.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings";h.h.TEXT_COUNT_MESSAGE0="Contar %1 em %2";h.h.TEXT_COUNT_TOOLTIP="Calcule quantas vezes algum texto aparece centro de algum outro texto.";h.h.TEXT_CREATE_JOIN_ITEM_TOOLTIP="Acrescentar um item ao texto.";h.h.TEXT_CREATE_JOIN_TITLE_JOIN="unir";h.h.TEXT_CREATE_JOIN_TOOLTIP="Acrescenta, remove ou reordena se\u00e7\u00f5es para reconfigurar este bloco de texto.";
h.h.TEXT_GET_SUBSTRING_END_FROM_END="at\u00e9 letra n\u00ba a partir do final";h.h.TEXT_GET_SUBSTRING_END_FROM_START="at\u00e9 letra n\u00ba";h.h.TEXT_GET_SUBSTRING_END_LAST="at\u00e9 \u00faltima letra";h.h.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";h.h.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="no texto";h.h.TEXT_GET_SUBSTRING_START_FIRST="obter trecho de primeira letra";h.h.TEXT_GET_SUBSTRING_START_FROM_END="obter trecho de letra n\u00ba a partir do final";
h.h.TEXT_GET_SUBSTRING_START_FROM_START="obter trecho de letra n\u00ba";h.h.TEXT_GET_SUBSTRING_TAIL="";h.h.TEXT_GET_SUBSTRING_TOOLTIP="Retorna o trecho de texto especificado.";h.h.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";h.h.TEXT_INDEXOF_OPERATOR_FIRST="encontre a primeira ocorr\u00eancia do item";h.h.TEXT_INDEXOF_OPERATOR_LAST="encontre a \u00faltima ocorr\u00eancia do texto";h.h.TEXT_INDEXOF_TITLE="no texto %1 %2 %3";h.h.TEXT_INDEXOF_TOOLTIP="Retorna a posi\u00e7\u00e3o da primeira/\u00faltima ocorr\u00eancia do primeiro texto no segundo texto. Retorna %1 se o texto n\u00e3o for encontrado.";
h.h.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";h.h.TEXT_ISEMPTY_TITLE="%1 \u00e9 vazio";h.h.TEXT_ISEMPTY_TOOLTIP="Retorna verdadeiro se o texto fornecido for vazio.";h.h.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";h.h.TEXT_JOIN_TITLE_CREATEWITH="criar texto com";h.h.TEXT_JOIN_TOOLTIP="Criar um peda\u00e7o de texto juntando qualquer n\u00famero de itens.";h.h.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";
h.h.TEXT_LENGTH_TITLE="tamanho de %1";h.h.TEXT_LENGTH_TOOLTIP="Retorna o n\u00famero de letras (incluindo espa\u00e7os) no texto fornecido.";h.h.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";h.h.TEXT_PRINT_TITLE="imprime %1";h.h.TEXT_PRINT_TOOLTIP="Imprime o texto, n\u00famero ou valor especificado.";h.h.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";h.h.TEXT_PROMPT_TOOLTIP_NUMBER="Pede ao usu\u00e1rio um n\u00famero.";
h.h.TEXT_PROMPT_TOOLTIP_TEXT="Pede ao usu\u00e1rio um texto.";h.h.TEXT_PROMPT_TYPE_NUMBER="Pede um n\u00famero com uma mensagem";h.h.TEXT_PROMPT_TYPE_TEXT="Pede um texto com uma mensagem";h.h.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Texto#substituindo-substrings";h.h.TEXT_REPLACE_MESSAGE0="substituir %1 por %2 em %3";h.h.TEXT_REPLACE_TOOLTIP="Substitua todas as ocorr\u00eancias de algum texto dentro de algum outro texto.";h.h.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Texto#invertendo-texto";
h.h.TEXT_REVERSE_MESSAGE0="inverter %1";h.h.TEXT_REVERSE_TOOLTIP="Inverter a ordem dos caracteres no texto.";h.h.TEXT_TEXT_HELPURL="https://pt.wikipedia.org/wiki/Cadeia_de_caracteres";h.h.TEXT_TEXT_TOOLTIP="Uma letra, palavra ou linha de texto.";h.h.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";h.h.TEXT_TRIM_OPERATOR_BOTH="remover espa\u00e7os de ambos os lados de";h.h.TEXT_TRIM_OPERATOR_LEFT="remover espa\u00e7os \u00e0 esquerda de";
h.h.TEXT_TRIM_OPERATOR_RIGHT="remover espa\u00e7os \u00e0 direita de";h.h.TEXT_TRIM_TOOLTIP="Retorna uma c\u00f3pia do texto com os espa\u00e7os removidos de uma ou ambas extremidades.";h.h.TODAY="Hoje";h.h.UNDO="Desfazer";h.h.UNNAMED_KEY="Sem t\u00edtulo";h.h.VARIABLES_DEFAULT_NAME="item";h.h.VARIABLES_GET_CREATE_SET='Criar "definir %1"';h.h.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";h.h.VARIABLES_GET_TOOLTIP="Retorna o valor desta vari\u00e1vel.";
h.h.VARIABLES_SET="definir %1 para %2";h.h.VARIABLES_SET_CREATE_GET='Criar "obter %1"';h.h.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";h.h.VARIABLES_SET_TOOLTIP="Define esta vari\u00e1vel para o valor da entrada.";h.h.VARIABLE_ALREADY_EXISTS="A vari\u00e1vel chamada '%1' j\u00e1 existe.";h.h.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="J\u00e1 existe uma vari\u00e1vel chamada '%1' para outra do tipo: '%2'.";h.h.WORKSPACE_COMMENT_DEFAULT_TEXT="Diz algo...";
h.h.CONTROLS_FOREACH_INPUT_DO=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.CONTROLS_FOR_INPUT_DO=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=h.h.CONTROLS_IF_MSG_ELSEIF;h.h.CONTROLS_IF_ELSE_TITLE_ELSE=h.h.CONTROLS_IF_MSG_ELSE;h.h.CONTROLS_IF_IF_TITLE_IF=h.h.CONTROLS_IF_MSG_IF;h.h.CONTROLS_IF_MSG_THEN=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.CONTROLS_WHILEUNTIL_INPUT_DO=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.LISTS_CREATE_WITH_ITEM_TITLE=h.h.VARIABLES_DEFAULT_NAME;h.h.LISTS_GET_INDEX_HELPURL=h.h.LISTS_INDEX_OF_HELPURL;
h.h.LISTS_GET_INDEX_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.LISTS_GET_SUBLIST_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.LISTS_INDEX_OF_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.LISTS_SET_INDEX_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.MATH_CHANGE_TITLE_ITEM=h.h.VARIABLES_DEFAULT_NAME;h.h.PROCEDURES_DEFRETURN_COMMENT=h.h.PROCEDURES_DEFNORETURN_COMMENT;h.h.PROCEDURES_DEFRETURN_DO=h.h.PROCEDURES_DEFNORETURN_DO;h.h.PROCEDURES_DEFRETURN_PROCEDURE=h.h.PROCEDURES_DEFNORETURN_PROCEDURE;h.h.PROCEDURES_DEFRETURN_TITLE=h.h.PROCEDURES_DEFNORETURN_TITLE;
h.h.TEXT_APPEND_VARIABLE=h.h.VARIABLES_DEFAULT_NAME;h.h.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=h.h.VARIABLES_DEFAULT_NAME;h.h.MATH_HUE="230";h.h.LOOPS_HUE="120";h.h.LISTS_HUE="260";h.h.LOGIC_HUE="210";h.h.VARIABLES_HUE="330";h.h.TEXTS_HUE="160";h.h.PROCEDURES_HUE="290";h.h.COLOUR_HUE="20";h.h.VARIABLES_DYNAMIC_HUE="310";var X={ej:null,ua:function(){cd();var a=document.getElementById("linkButton");"BlocklyStorage"in window?(BlocklyStorage.HTTPREQUEST_ERROR=R("Games_httpRequestError"),BlocklyStorage.LINK_ALERT=R("Games_linkAlert"),BlocklyStorage.HASH_ERROR=R("Games_hashError"),BlocklyStorage.XML_ERROR=R("Games_xmlError"),BlocklyStorage.alert=W.ux.bind(W,a),a&&gd(a,BlocklyStorage.link)):a&&(a.style.display="none");(a=document.getElementById("languageMenu"))&&a.addEventListener("change",X.wA,!0);h.hb&&(h.hb.wz=!1);h.o&&
(h.o.wz=!1)},rC:function(a,c){if("BlocklyStorage"in window&&1<window.location.hash.length)BlocklyStorage.retrieveXml(window.location.hash.substring(1));else{var d=null;try{d=window.sessionStorage.mw}catch(g){}d&&delete window.sessionStorage.mw;var e=dd(Q),f=c&&dd(Q-1);f&&"function"==typeof c&&(f=c(f));(a=d||e||f||a)&&X.gx(a)}},gx:function(a){X.ej?X.ej.setValue(a,-1):(a=h.N.Qg(a),C.clear(),h.N.wh(a,C),a=C,a.ni.length=0,a.Hl.length=0,h.i.EA())},Hq:function(){if(X.ej)var a=X.ej.getValue();else{a=h.N.Es(!0);
if(1==D(C,!1).length&&a.querySelector){var c=a.querySelector("block");c&&(c.removeAttribute("x"),c.removeAttribute("y"))}a=h.N.Fc(a)}return a},ij:function(){return C},rD:function(){window.localStorage&&(window.localStorage[fd+Q]=X.Hq())},En:function(){window.location=(Yc?"index.html":"./")+"?lang="+P},wA:function(){if(window.sessionStorage){if(X.ej)var a=X.ej.getValue();else a=h.N.Es(),a=h.N.Fc(a);window.sessionStorage.mw=a}a=document.getElementById("languageMenu");a=encodeURIComponent(a.options[a.selectedIndex].value);
var c=window.location.search;c=1>=c.length?"?lang="+a:c.match(/[?&]lang=[^&]*/)?c.replace(/([?&]lang=)[^&]*/,"$1"+a):c.replace(/\?/,"?lang="+a+"&");window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+c},Dr:function(){10>Q?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+P+"&level="+(Q+1):X.En()},Dn:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}uc(a,c)},LI:function(a,c){a=document.getElementById(a);
a.firstChild||(a=h.vg(a,{rtl:-1!=Wc.indexOf(P),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),h.N.wh(h.N.Qg(c),a))},ID:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Oe:function(a){if("click"==a.type&&"touchend"==X.Oe.Ur&&X.Oe.Sr+2E3>Date.now()||X.Oe.Ur==a.type&&X.Oe.Sr+400>Date.now())return a.preventDefault(),a.stopPropagation(),!0;X.Oe.Ur=a.type;X.Oe.Sr=Date.now();return!1}};X.Oe.Ur=null;X.Oe.Sr=0;
X.dC=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};X.eC=function(){var a=document.createElement("link");a.rel="stylesheet";a.type="text/css";a.href="common/prettify.css";document.head.appendChild(a);a=document.createElement("script");a.type="text/javascript";a.src="common/prettify.js";document.head.appendChild(a)};window.BlocklyInterface=X;X.setCode=X.gx;X.getCode=X.Hq;X.getWorkspace=X.ij;var W={Hh:!1,Wu:null,ln:null,Sl:function(a,c,d,e,f,g){function k(){W.Hh&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);W.Hh&&W.Oc(!1);h.gb()&&h.vc(!0);W.Hh=!0;W.Wu=c;W.ln=g;var l=document.getElementById("dialog");g=document.getElementById("dialogShadow");var m=document.getElementById("dialogBorder"),n;for(n in f)l.style[n]=f[n];e&&(g.style.visibility="visible",g.style.opacity=.3,g.style.zIndex=9,e=document.createElement("div"),
e.id="dialogHeader",l.appendChild(e),W.bq=h.ed(e,"mousedown",null,W.$A));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(W.Sn(c,!1,.2),W.Sn(l,!0,.8),setTimeout(k,175)):k()},Xu:0,Yu:0,$A:function(a){W.fq();if(!h.g.wj(a)){var c=document.getElementById("dialog");W.Xu=c.offsetLeft-a.clientX;W.Yu=c.offsetTop-a.clientY;W.eq=h.ed(document,"mouseup",null,W.fq);W.cq=h.ed(document,"mousemove",null,W.aB);a.stopPropagation()}},aB:function(a){var c=document.getElementById("dialog"),
d=W.Xu+a.clientX;a=W.Yu+a.clientY;a=Math.max(a,0);a=Math.min(a,window.innerHeight-c.offsetHeight);d=Math.max(d,0);d=Math.min(d,window.innerWidth-c.offsetWidth);c.style.left=d+"px";c.style.top=a+"px"},fq:function(){W.eq&&(h.Za(W.eq),W.eq=null);W.cq&&(h.Za(W.cq),W.cq=null)},Oc:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(W.Hh){W.fq();W.bq&&(h.Za(W.bq),W.bq=null);W.Hh=!1;W.ln&&W.ln();W.ln=null;var d=!1===a?
null:W.Wu;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(W.Sn(a,!1,.8),W.Sn(d,!0,.2),setTimeout(c,175)):c();a.style.visibility="hidden";a.style.zIndex=-1;for((d=document.getElementById("dialogHeader"))&&d.parentNode.removeChild(d);a.firstChild;)d=a.firstChild,d.className+=" dialogHiddenContent",document.body.appendChild(d)}},Sn:function(a,c,d){function e(){f.style.width=g.width+"px";f.style.height=g.height+"px";f.style.left=g.x+"px";f.style.top=
g.y+"px";f.style.opacity=d}if(a){var f=document.getElementById("dialogBorder"),g=W.yB(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},yB:function(a){var c=h.g.style.zh(a);c={x:c.x,y:c.y};a.getBBox?(a=a.getBBox(),c.height=a.height,c.width=a.width):(c.height=a.offsetHeight,c.width=a.offsetWidth);return c},ux:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;e<c.length;e++){var f=document.createElement("p");
f.appendChild(document.createTextNode(c[e]));d.appendChild(f)}d=document.getElementById("dialogStorage");W.Sl(d,a,!0,!0,{width:"50%",left:"25%",top:"5em"},W.HD);W.DD()},mu:function(){if(!dd(Q))if(W.Hh||C.gc())setTimeout(W.mu,15E3);else{var a=document.getElementById("dialogAbort"),c=document.getElementById("abortCancel");c.addEventListener("click",W.Oc,!0);c.addEventListener("touchend",W.Oc,!0);c=document.getElementById("abortOk");c.addEventListener("click",X.En,!0);c.addEventListener("touchend",X.En,
!0);W.Sl(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",W.lu,!0)});document.body.addEventListener("keydown",W.lu,!0)}},mx:function(){document.getElementById("galleryXml").value=X.Hq();var a=document.getElementById("galleryDialog");if(!W.mx.qD){var c=document.getElementById("galleryCancel");c.addEventListener("click",W.Oc,!0);c.addEventListener("touchend",W.Oc,!0);c=document.getElementById("galleryOk");c.addEventListener("click",W.Cq,!0);c.addEventListener("touchend",
W.Cq,!0);W.mx.qD=!0}c=document.getElementById("submitButton");W.Sl(a,c,!0,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",W.rv,!0)});document.body.addEventListener("keydown",W.rv,!0);setTimeout(function(){document.getElementById("galleryTitle").focus()},250)},MA:function(){var a=document.getElementById("dialogDone");if(C){var c=document.getElementById("dialogLinesText");c.textContent="";var d=Oc();d=X.ID(d);var e=d.replace(/\/\/[^\n]*/g,"");e=e.replace(/\/\*.*\*\//g,
"");e=e.replace(/[ \t]+\n/g,"\n");e=e.replace(/\n+/g,"\n");e=e.trim();e=e.split("\n").length;var f=document.getElementById("containerCode");f.textContent=d;"function"==typeof prettyPrintOne&&(d=f.innerHTML,d=prettyPrintOne(d,"js"),f.innerHTML=d);d=1==e?R("Games_linesOfCode1"):R("Games_linesOfCode2").replace("%1",String(e));c.appendChild(document.createTextNode(d))}d=10>Q?R("Games_nextLevel").replace("%1",String(Q+1)):R("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click",
W.Oc,!0);c.addEventListener("touchend",W.Oc,!0);c=document.getElementById("doneOk");c.addEventListener("click",X.Dr,!0);c.addEventListener("touchend",X.Dr,!0);W.Sl(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",W.Iu,!0)});document.body.addEventListener("keydown",W.Iu,!0);document.getElementById("dialogDoneText").textContent=d},Vu:function(a){!W.Hh||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(W.Oc(!0),a.stopPropagation(),a.preventDefault())},
DD:function(){document.body.addEventListener("keydown",W.Vu,!0)},HD:function(){document.body.removeEventListener("keydown",W.Vu,!0)},Iu:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)W.Oc(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&X.Dr()},lu:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)W.Oc(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&X.En()},rv:function(a){27==a.keyCode?W.Oc(!0):13==a.keyCode&&W.Cq()},Cq:function(){var a=document.getElementById("galleryTitle");
if(a.value.trim()){a=document.getElementById("galleryForm");for(var c=[],d=0,e;e=a.elements[d];d++)e.name&&(c[d]=encodeURIComponent(e.name)+"="+encodeURIComponent(e.value));var f=new XMLHttpRequest;f.open("POST",a.action);f.setRequestHeader("Content-type","application/x-www-form-urlencoded");f.onload=function(){if(4==f.readyState){var g=200==f.status?R("Games_submitted"):R("Games_httpRequestError")+"\nStatus: "+f.status;W.ux(null,g)}};f.send(c.join("&"));W.Oc(!0)}else a.value="",a.focus()}};
window.BlocklyDialogs=W;W.hideDialog=W.Oc;var fd="bird";function Y(a,c,d,e){this.nm=a;this.om=c;this.x1=d;this.y1=e}Y.prototype.ng=function(a){var c=this.x1-this.nm,d=this.y1-this.om,e=(a.x-this.nm)*c+(a.y-this.om)*d,f=c*c+d*d;e=f?e/f:-1;return h.g.I.ng(a,0>e?new h.g.I(this.nm,this.om):1<e?new h.g.I(this.x1,this.y1):new h.g.I(this.nm+e*c,this.om+e*d))};
var Z=[void 0,{start:new h.g.I(20,20),cf:90,zc:new h.g.I(50,50),nd:new h.g.I(80,80),xc:[]},{start:new h.g.I(20,20),cf:0,zc:new h.g.I(80,20),nd:new h.g.I(80,80),xc:[new Y(0,50,60,50)]},{start:new h.g.I(20,70),cf:270,zc:new h.g.I(50,20),nd:new h.g.I(80,70),xc:[new Y(50,50,50,100)]},{start:new h.g.I(20,80),cf:0,zc:null,nd:new h.g.I(80,20),xc:[new Y(0,0,65,65)]},{start:new h.g.I(80,80),cf:270,zc:null,nd:new h.g.I(20,20),xc:[new Y(0,100,65,35)]},{start:new h.g.I(20,40),cf:0,zc:new h.g.I(80,20),nd:new h.g.I(20,
80),xc:[new Y(0,59,50,59)]},{start:new h.g.I(80,80),cf:180,zc:new h.g.I(80,20),nd:new h.g.I(20,20),xc:[new Y(0,70,40,70),new Y(70,50,100,50)]},{start:new h.g.I(20,25),cf:90,zc:new h.g.I(80,25),nd:new h.g.I(80,75),xc:[new Y(50,0,50,25),new Y(75,50,100,50),new Y(50,100,50,75),new Y(0,50,25,50)]},{start:new h.g.I(80,70),cf:180,zc:new h.g.I(20,20),nd:new h.g.I(80,20),xc:[new Y(0,69,31,100),new Y(40,50,71,0),new Y(80,50,100,50)]},{start:new h.g.I(20,20),cf:90,zc:new h.g.I(80,50),nd:new h.g.I(20,20),xc:[new Y(40,
60,60,60),new Y(40,60,60,30),new Y(60,30,100,30)]}][Q],be=[],ce=1;
function de(){var a=document.getElementById("svgBird");Z.xc.push(new Y(-5,-5,-5,105));Z.xc.push(new Y(-5,105,105,105));Z.xc.push(new Y(105,105,105,-5));Z.xc.push(new Y(105,-5,-5,-5));for(var c=0;c<Z.xc.length;c++){var d=Z.xc[c],e=document.createElementNS(h.g.m.nc,"line");e.setAttribute("x1",d.nm/100*400);e.setAttribute("y1",400*(1-d.om/100));e.setAttribute("x2",d.x1/100*400);e.setAttribute("y2",400*(1-d.y1/100));e.setAttribute("stroke","#CCB");e.setAttribute("stroke-width",10);e.setAttribute("stroke-linecap",
"round");a.appendChild(e)}c=document.createElementNS(h.g.m.nc,"image");c.id="nest";c.setAttributeNS(h.g.m.Ge,"xlink:href","bird/nest.png");c.setAttribute("height",100);c.setAttribute("width",100);a.appendChild(c);Z.zc&&(c=document.createElementNS(h.g.m.nc,"image"),c.id="worm",c.setAttributeNS(h.g.m.Ge,"xlink:href","bird/worm.png"),c.setAttribute("height",100),c.setAttribute("width",100),a.appendChild(c));c=document.createElementNS(h.g.m.nc,"clipPath");c.id="birdClipPath";d=document.createElementNS(h.g.m.nc,
"rect");d.id="clipRect";d.setAttribute("width",120);d.setAttribute("height",120);c.appendChild(d);a.appendChild(c);c=document.createElementNS(h.g.m.nc,"image");c.id="bird";c.setAttributeNS(h.g.m.Ge,"xlink:href","bird/birds-120.png");c.setAttribute("height",480);c.setAttribute("width",1440);c.setAttribute("clip-path","url(#birdClipPath)");a.appendChild(c);c=document.createElementNS(h.g.m.nc,"rect");c.setAttribute("class","edges");c.setAttribute("width",400);c.setAttribute("height",400);a.appendChild(c);
c=3<Q;d=4<Q;e=1;for(var f=.1;.9>f;f+=.1){if(c){var g=document.createElementNS(h.g.m.nc,"line");g.setAttribute("class","edges");g.setAttribute("x1",400*f);g.setAttribute("y1",400);g.setAttribute("x2",400*f);g.setAttribute("y2",400-9*e);a.appendChild(g)}d&&(g=document.createElementNS(h.g.m.nc,"line"),g.setAttribute("class","edges"),g.setAttribute("x1",0),g.setAttribute("y1",400*f),g.setAttribute("x2",9*e),g.setAttribute("y2",400*f),a.appendChild(g));2==e&&(c&&(g=document.createElementNS(h.g.m.nc,"text"),
g.setAttribute("class","edgeX"),g.setAttribute("x",400*f+2),g.setAttribute("y",396),g.appendChild(document.createTextNode(Math.round(100*f))),a.appendChild(g)),d&&(g=document.createElementNS(h.g.m.nc,"text"),g.setAttribute("class","edgeY"),g.setAttribute("x",3),g.setAttribute("y",400*f-2),g.appendChild(document.createTextNode(Math.round(100-100*f))),a.appendChild(g)));e=1==e?2:1}}
window.addEventListener("load",function(){function a(){d.style.top=Math.max(10,e.offsetTop-window.pageYOffset)+"px";d.style.left=c?"10px":"420px";d.style.width=window.innerWidth-440+"px"}document.body.innerHTML=Id();X.ua();var c=-1!=Wc.indexOf(P),d=document.getElementById("blockly"),e=document.getElementById("visualization");window.addEventListener("scroll",function(){a(null);h.bm(C)});window.addEventListener("resize",a);a(null);var f=document.getElementById("toolbox");C=h.vg("blockly",{media:"third-party/blockly/media/",
rtl:c,toolbox:f,trashcan:!0});C.Bd.load(["bird/quack.ogg","bird/quack.mp3"],"quack");C.Bd.load(["bird/whack.mp3","bird/whack.ogg"],"whack");C.Bd.load(["bird/worm.mp3","bird/worm.ogg"],"worm");1<Q&&K(C,h.i.Zu);Tc("noWorm,heading,getX,getY");de();f="";f=1==Q?'<xml><block type="bird_heading" x="70" y="70"></block></xml>':5>Q?'<xml><block type="bird_ifElse" x="70" y="70"></block></xml>':'<xml><block type="controls_if" x="70" y="70"></block></xml>';X.rC(f,!1);ee();gd("runButton",fe);gd("resetButton",ge);
setTimeout(function(){K(C,function(){he()});he()},5E3);8<Q&&setTimeout(W.mu,3E5);setTimeout(X.dC,1);setTimeout(X.eC,1)});var ie=0;
function he(){if(!C.gc()&&!dd(Q)){var a=-1!=Wc.indexOf(P),c=h.N.Fc(h.N.Es()),d=D(C.O.s,!0),e=document.getElementById("dialogHelp"),f=null,g=null;if(1==Q)-1==c.indexOf(">90<")&&-1!=c.indexOf("bird_heading")||h.T.isVisible()||(g={width:"370px",top:"140px"},g[a?"right":"left"]="215px",f=D(C,!0),f=f.length?f[0].aa():d[0].aa());else if(2==Q)-1==c.indexOf("bird_noWorm")&&(g={width:"350px",top:"170px"},g[a?"right":"left"]="180px",f=d[1].aa());else if(4==Q)-1==c.indexOf("bird_compare")&&(g={width:"350px",
top:"230px"},g[a?"right":"left"]="180px",f=d[2].aa());else if(5==Q){if(ie||(ie=setInterval(he,100)),-1==c.indexOf("mutation else")){f=D(C,!1);for(g=0;(d=f[g])&&"controls_if"!=d.type;g++);d.se.isVisible()?(e=document.getElementById("dialogMutatorHelp"),f=d.se.s.O.tl[1],c=h.g.style.zh(f),g={width:"340px",top:c.y+60+"px"},g.left=c.x-(a?310:0)+"px"):(c=h.g.style.zh(d.aa()),g={width:"340px",top:c.y+100+"px"},g.left=c.x-(a?280:0)+"px",f=d.aa())}}else if(6==Q){if(-1==c.indexOf("mutation")){f=D(C,!1);for(g=
0;(d=f[g])&&"controls_if"!=d.type;g++);c=h.g.style.zh(d.aa());g={width:"350px",top:c.y+220+"px"};g.left=c.x-(a?350:0)+"px";f=d.aa()}}else 8==Q&&-1==c.indexOf("bird_and")&&(g={width:"350px",top:"360px"},g[a?"right":"left"]="450px",f=d[4].aa());g?e.parentNode!=document.getElementById("dialog")&&W.Sl(e,f,!0,!1,g,null):W.Oc(!1)}}
function ee(){for(var a=0;a<be.length;a++)window.clearTimeout(be[a]);be=[];S=new h.g.I(Z.start.x,Z.start.y);kd=jd=Z.cf;ld=!Z.zc;ce=1;je();if(a=document.getElementById("worm"))a.setAttribute("x",Z.zc.x/100*400-50),a.setAttribute("y",400*(1-Z.zc.y/100)-50),a.style.visibility="visible";a=document.getElementById("nest");a.setAttribute("x",Z.nd.x/100*400-50);a.setAttribute("y",400*(1-Z.nd.y/100)-50)}
function fe(a){if(!X.Oe(a)){a=document.getElementById("runButton");var c=document.getElementById("resetButton");c.style.minWidth||(c.style.minWidth=a.offsetWidth+"px");a.style.display="none";c.style.display="inline";ee();ke()}}function ge(a){X.Oe(a)||(document.getElementById("runButton").style.display="inline",document.getElementById("resetButton").style.display="none",uc(null),ee())}
function le(a,c){a.setProperty(c,"heading",a.createNativeFunction(function(d,e){var f=h.g.Lb.li(d);S.x+=Math.cos(f);S.y+=Math.sin(f);jd=d;md.push(["move",S.x,S.y,jd,e]);if(ld&&15>h.g.I.ng(S,Z.nd))throw md.push(["play","quack",null]),me(Z.nd),md.push(["finish",null]),!0;!ld&&Z.zc&&15>h.g.I.ng(S,Z.zc)&&(me(Z.zc),md.push(["worm",null]),md.push(["play","worm",null]),ld=!0);a:{for(d=0;e=Z.xc[d];d++)if(6>e.ng(S)){d=!0;break a}d=!1}if(d)throw md.push(["play","whack",null]),!1;}));a.setProperty(c,"noWorm",
a.createNativeFunction(function(){return!ld}));a.setProperty(c,"getX",a.createNativeFunction(function(){return S.x}));a.setProperty(c,"getY",a.createNativeFunction(function(){return S.y}))}
function ke(){if("Interpreter"in window){md=[];h.selected&&mb(h.selected);var a=Oc(),c=a.indexOf("if ("),d=a.indexOf("}\n");-1!=c&&-1!=d&&(a=a.substring(c,d+2));c=0;a=new Interpreter("while(true) {\n"+a+"}",le);try{for(d=1E5;a.step();)if(0>=d--)throw Infinity;c=-1}catch(e){Infinity===e?c=2:!0===e?c=1:!1===e?c=-2:(c=-2,window.alert(e))}id=1==c?10:15;ee();be.push(setTimeout(ne,1))}else setTimeout(ke,250)}
function ne(){be=[];var a=md.shift();a?(X.Dn(a.pop()),"move"==a[0]||"goto"==a[0]?(S.x=a[1],S.y=a[2],jd=a[3],ce="move"==a[0]?2:1,je()):"worm"==a[0]?document.getElementById("worm").style.visibility="hidden":"finish"==a[0]?(ce=3,je(),X.rD(),W.MA()):"play"==a[0]&&C.Bd.play(a[1],.5),be.push(setTimeout(ne,5*id))):X.Dn(null)}
function je(){var a=hd(kd-jd);10>=Math.abs(a)?kd=jd:(kd+=0>a?10:-10,kd=hd(kd));var c=(14-Math.round(kd/360*12))%12,d=kd%30;15<=d&&(d-=30);d*=-1;if(1==ce)var e=0;else if(3==ce)e=3;else if(2==ce)e=Math.round(Date.now()/100)%3;else throw Error("Unknown pose.");a=S.x/100*400-60;var f=400*(1-S.y/100)-60,g=document.getElementById("bird");g.setAttribute("x",a-120*c);g.setAttribute("y",f-120*e);g.setAttribute("transform","rotate("+d+", "+(a+60)+", "+(f+60)+")");c=document.getElementById("clipRect");c.setAttribute("x",
a);c.setAttribute("y",f)}function me(a){var c=Math.round(h.g.I.ng(S,a));a=hd(h.g.Lb.wx(Math.atan2(a.y-S.y,a.x-S.x)));for(var d=h.g.Lb.li(a),e=0;e<c;e++)S.x+=Math.cos(d),S.y+=Math.sin(d),md.push(["goto",S.x,S.y,a,null])};