diff --git a/caddy/etc/Caddyfile b/caddy/etc/Caddyfile new file mode 100644 index 0000000..21c38b0 --- /dev/null +++ b/caddy/etc/Caddyfile @@ -0,0 +1,8 @@ +http://blockly.localhost { + root /var/www/html/blockly-games/ + file_server +} + +http://moodle.localhost { + reverse_proxy moodle:8000 +} diff --git a/docker-compose.yml b/docker-compose.yml index 975794d..2c52503 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,16 @@ services: + static_sites: + image: caddy:alpine + container_name: static_sites_caddy + restart: always + volumes: + - ./html:/var/www/html + - ./caddy/etc/Caddyfile:/etc/caddy/Caddyfile + ports: + - "80:80" + expose: + - 80 + moodle_db: image: mariadb:10 container_name: moodle_db @@ -12,7 +24,7 @@ services: moodle: image: moodlehq/moodleapp:latest ports: - - "80:443" + - "8000:80" expose: - 443 environment: diff --git a/html/blockly-games/about.html b/html/blockly-games/about.html new file mode 100644 index 0000000..81bd55f --- /dev/null +++ b/html/blockly-games/about.html @@ -0,0 +1,134 @@ + + + + + About Blockly Games + + + + +

Blockly Games : About

+ +

Blockly Games is a series of educational games that teach programming. It is +designed for children who have not had prior experience with computer programming. +By the end of these games, players are ready to use conventional text-based languages.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

Puzzle is a quick introduction to Blockly's shapes and how the pieces snap together.

+
+ + +

Maze is an introduction to loops and conditionals. It starts simply, but +every level is more challenging than the last.

+
+ + +

Bird is a deep-dive into conditionals. Control-flow is explored with +increasingly complex conditions.

+
+ + +

Turtle is a deep-dive into loops. Use nested loops to paint a picture. +Then publish your art for the world to see.

+
+ + +

Movie is an introduction to mathematical equations. Use math to animate a movie. +Then publish your movie for the world to watch.

+
+ + +

Music is an introduction to functions. Use functions to compose music. +Then publish your music for the world to listen to.

+
+ + +

Pond Tutor introduces text-based programming. Levels switch back and forth +between blocks and actual JavaScript in a text editor.

+
+ + +

Pond is an open-ended contest to program the smartest duck. +Use either blocks or JavaScript.

+
+ +

Blockly Games is a Google project to encourage tomorrow's programmers. The +games are designed to be self-paced and self-teaching. Feel free to use Blockly +Games both inside and outside the classroom. All code is open source, see +the developer's website +for more info or to download zip files for offline use.

+ +

Developers, teachers and parents are welcome to +give feedback +as we continue to grow.

+ +

+ Google Privacy Policy — + Google Terms of Service +

+ + + + + + + diff --git a/html/blockly-games/bird.html b/html/blockly-games/bird.html new file mode 100644 index 0000000..df0bd96 --- /dev/null +++ b/html/blockly-games/bird.html @@ -0,0 +1,15 @@ + + + + + + + Blockly Games : Bird + + + + + + + + diff --git a/html/blockly-games/bird/birds-120.png b/html/blockly-games/bird/birds-120.png new file mode 100644 index 0000000..8fdbdfb Binary files /dev/null and b/html/blockly-games/bird/birds-120.png differ diff --git a/html/blockly-games/bird/generated/pt-br/compressed.js b/html/blockly-games/bird/generated/pt-br/compressed.js new file mode 100644 index 0000000..e06a50a --- /dev/null +++ b/html/blockly-games/bird/generated/pt-br/compressed.js @@ -0,0 +1,702 @@ +// 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.lengthc&&(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;eg);return k}; +h.g.Oa.Fs=function(a,c,d){for(var e=[0],f=[],g=0;ge&&(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=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;kd;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;ed||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>>/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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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(df.top?h.D.Av(d,e,f,g):c+g.heightdocument.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.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 $2")}while(a!=d);return a};h.N.zI=function(a){a=h.N.Fc(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");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 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=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.Ndh.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;cd+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;ed)){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;1a.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;1a-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;fc)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&&1g)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?fg&&(d=-(g-a.Cb.x)):fg&&(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;el&&(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.widthg&&(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<-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;ec||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;fa&&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=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;ca&&(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=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;qc?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(;gc?!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.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(;dc.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 qthis.Fl){var d=c-this.Fl;d=0Object.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=(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;da.bottom&&(a.bottom=e.bottom);e.lefta.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;Ot.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:ethis.options.mb.vl?a=this.options.mb.vl:this.options.mb.xl&&ak.Ex||k.Dck.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;a1'), +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;kf?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;ca.length)){e=[];for(f=0;fthis.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;dc||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);-Infinitythis.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;ed;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:0c&&(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;gd?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(0d&&(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",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;dk[0]?1:g[0]=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":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function Gd(a){return Hd[a]}var Fd=/[\x00\x22\x26\x27\x3c\x3e]/g;function Id(){for(var a='
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
n\u00e3o tem minhocasdire\u00e7\u00e3oEsse bloco indica quando o p\u00e1ssaro n\u00e3o possui a \\nminhoca. Mover na dire\u00e7\u00e3o do \u00e2ngulo indicado: 0 \u00e9 para a \\ndireita, 90 \u00e9 para frente, etc. 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.

'+ +((Yc?'':'')+"Jogos do Blockly : "+T({appName:"P\u00e1ssaro"}.appName)+""),c="   ",d=1;11>d;d++)c+=" "+(d==Q?''+T(d)+"":10==d?''+T(d)+"":'');return a+c+'

 
Parab\u00e9ns!
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.
')+ +(1==Q?'
Trocar o \u00e2ngulo da dire\u00e7\u00e3o para que o p\u00e1ssaro pegue a minhoca e aterrisse em seu ninho.
':2==Q?'
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.
': +4==Q?"
'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.
":5==Q?'
Clique no \u00edcone para modificar o bloco \'se\'.
':6==Q?"
Este n\u00edvel precisa de um bloco 'sen\u00e3o se' e de um bloco 'sen\u00e3o'.
": +8==Q?'
O bloco "e" somente \u00e9 verdadeiro se as duas entradas forem verdadeiras.
':"")+"
"+(5==Q?'
Puxe um bloco "sen\u00e3o" em cima do bloco "se".
':"")};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){0this.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)&&0Math.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;ea.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=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;eQ?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):1f;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':5>Q?'':'';X.rC(f,!1);ee();gd("runButton",fe);gd("resetButton",ge); +setTimeout(function(){K(C,function(){he()});he()},5E3);890<")&&-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;ah.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;eimg, +button.secondary>img { + opacity: 1; +} +button>img { + opacity: 0.6; + vertical-align: text-bottom; +} +button:hover:not(:disabled)>img { + opacity: 1; +} +button:active:not(:disabled) { + border: 1px solid #888 !important; +} +button:hover:not(:disabled) { + box-shadow: 2px 2px 5px #888; +} + +/* Dialogs */ +#dialog { + visibility: hidden; + background-color: #fff; + color: #000; + border: 1px solid #ccc; + position: absolute; + border-radius: 8px; + box-shadow: 5px 5px 5px #888; + padding: 10px; +} +#dialogBorder { + visibility: hidden; + position: absolute; + background-color: #fff; + color: #000; + border: 1px solid #000; + border-radius: 6px; + box-shadow: 5px 5px 5px #888; +} +#dialogShadow { + visibility: hidden; + position: fixed; + top: 0; + left: 0; + height: 100%; + width: 100%; + background-color: #000; + opacity: 0.3 +} +.dialogAnimate { + transition-property: width height left top opacity; + transition-duration: 0.2s; + transition-timing-function: linear; +} +.dialogHiddenContent { + visibility: hidden; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} +#dialogHeader { + height: 25px; + margin: -10px -10px 15px; + border-top-left-radius: 8px; + border-top-right-radius: 8px; + background-color: #ddd; + cursor: move; +} +#dialog button { + min-width: 4em; +} +.readonly .blocklyMainBackground { + stroke: none; +} +#galleryForm>header { + font-size: larger; +} +#galleryForm>footer { + font-size: smaller; +} +#galleryForm>* { + margin-top: 1em; + margin-left: 1em; + margin-right: 1em; +} diff --git a/html/blockly-games/common/help.png b/html/blockly-games/common/help.png new file mode 100644 index 0000000..2dae19b Binary files /dev/null and b/html/blockly-games/common/help.png differ diff --git a/html/blockly-games/common/loading.gif b/html/blockly-games/common/loading.gif new file mode 100644 index 0000000..31d7ee0 Binary files /dev/null and b/html/blockly-games/common/loading.gif differ diff --git a/html/blockly-games/common/prettify.css b/html/blockly-games/common/prettify.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/html/blockly-games/common/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/html/blockly-games/common/prettify.js b/html/blockly-games/common/prettify.js new file mode 100644 index 0000000..7b99049 --- /dev/null +++ b/html/blockly-games/common/prettify.js @@ -0,0 +1,30 @@ +!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= +b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", +/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ +s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, +q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= +c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), +["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); +return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i + + + + + + + Blockly Games + + + + + + + diff --git a/html/blockly-games/index/bird.png b/html/blockly-games/index/bird.png new file mode 100644 index 0000000..5899865 Binary files /dev/null and b/html/blockly-games/index/bird.png differ diff --git a/html/blockly-games/index/generated/pt-br/compressed.js b/html/blockly-games/index/generated/pt-br/compressed.js new file mode 100644 index 0000000..a111cad --- /dev/null +++ b/html/blockly-games/index/generated/pt-br/compressed.js @@ -0,0 +1,21 @@ +// Automatically generated file. Do not edit! + +'use strict'; +var f={},g={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"},k="ace ar fa he mzn ps ur".split(" "),l=window.BlocklyGamesLang,n=window.BlocklyGamesLanguages,p=".html"==window.location.pathname.substr(-5),q=Number,r,t=window.location.search.match(/[?&]level=([^&]+)/);r=t?decodeURIComponent(t[1].replace(/\+/g,"%20")):"NaN";q(r); +function u(){document.title=document.getElementById("title").textContent;document.dir=-1!=k.indexOf(l)?"rtl":"ltr";document.head.parentElement.setAttribute("lang",l);var a=document.getElementById("languageMenu");if(a){for(var b=[],c=0;cm[0]?1:h[0]=a.options.length&&(a.style.display="none")}for(c= +1;10>=c;c++)a=document.getElementById("level"+c),b=!!v(f.w,c),a&&b&&(a.className+=" level_done");(c=document.querySelector('meta[name="viewport"]'))&&725>screen.availWidth&&c.setAttribute("content","width=725, initial-scale=.35, user-scalable=no");setTimeout(w,1)} +function x(){var a=document.getElementById("languageMenu");a=encodeURIComponent(a.options[a.selectedIndex].value);var b=window.location.search;b=1>=b.length?"?lang="+a:b.match(/[?&]lang=[^&]*/)?b.replace(/([?&]lang=)[^&]*/,"$1"+a):b.replace(/\?/,"?lang="+a+"&");window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+b}function v(a,b){try{var c=window.localStorage[a+b]}catch(d){}return c} +function y(){var a="clearData",b=z;if(!a)throw TypeError("Element not found: "+a);"string"==typeof a&&(a=document.getElementById(a));a.addEventListener("click",b,!0);a.addEventListener("touchend",b,!0)} +function w(){if(!p){window.GoogleAnalyticsObject="GoogleAnalyticsFunction";var a=function(c){(a.q=a.q||[]).push(arguments)};window.GoogleAnalyticsFunction=a;a.l=1*new Date;var b=document.createElement("script");b.async=1;b.src="//www.google-analytics.com/analytics.js";document.head.appendChild(b);a("create","UA-50448074-1","auto");a("send","pageview")}};var A=A||{};function B(a,b){function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.C=function(d,e,h){return b.prototype[e].apply(d,Array.prototype.slice.call(arguments,2))}}if(!C){var C,D="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(D=navigator.userAgent);var E=0==D.indexOf("Opera");C={D:{u:"ScriptEngine"in window},A:E,v:!E&&-1!=D.indexOf("MSIE"),B:!E&&-1!=D.indexOf("WebKit")}}if(!F)var F={};if(!G)var G={}; +if(!H)var H={};if(!I)var I={};if(!J)var J={};if(!K)var K={};var L=A.s?{F:!0}:{};function M(){throw Error("Do not instantiate directly");}M.prototype.i=null;M.prototype.toString=function(){return this.content};function N(a){if(null!=a)switch(a.i){case 1:return 1;case -1:return-1;case 0:return 0}return null}function O(){M.call(this)}B(O,M);O.prototype.o=L;function P(a){return null!=a&&a.o===L?a:Q(String(String(a)).replace(R,S),N(a))} +var Q=function(a){function b(){}b.prototype=a.prototype;return function(c,d){var e=new b;e.content=String(c);void 0!==d&&(e.i=d);return e}}(O),T={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function S(a){return T[a]}var R=/[\x00\x22\x26\x27\x3c\x3e]/g;function U(){var a={lang:l,j:p,m:-1!=k.indexOf(l)};return'
Jogos do BlocklyDeletar todas as suas solu\u00e7\u00f5es?
"+V({g:"puzzle",x:10,y:15,h:"Quebra-Cabe\u00e7a"},a)+V({g:"maze",x:16,y:45,h:"Labirinto"},a)+V({g:"bird",x:26,y:69,h:"P\u00e1ssaro"},a)+V({g:"turtle",x:41,y:80,h:"Tartaruga"},a)+V({g:"movie",x:55,y:61,h:"Filme"},a)+V({g:"music",x:69,y:43,h:"M\u00fasica"},a)+V({g:"pond-tutor",x:83,y:55,h:"Tutor de Lagoa"},a)+V({g:"pond-duck",x:90,y:85,h:"Lagoa"},a)+''} +function V(a,b){return''+(b.j?'':'')+''+P(a.h)+""}; +var W="puzzle maze bird turtle movie music pond-tutor pond-duck".split(" "); +window.addEventListener("load",function(){function a(h,m){return function(){X(h,0,m)}}document.body.innerHTML=U();u();document.getElementById("languageMenu").addEventListener("change",x,!0);for(var b=!1,c=[],d=0;d=e;e++)v(W[d],e)&&(b=!0,c[d]++)}b&&(document.getElementById("clearDataPara").style.visibility="visible",y());for(d=0;d=b;b++)delete window.localStorage[W[a]+b];location.reload()}}; diff --git a/html/blockly-games/index/maze.png b/html/blockly-games/index/maze.png new file mode 100644 index 0000000..e674f2a Binary files /dev/null and b/html/blockly-games/index/maze.png differ diff --git a/html/blockly-games/index/movie.png b/html/blockly-games/index/movie.png new file mode 100644 index 0000000..a3b1335 Binary files /dev/null and b/html/blockly-games/index/movie.png differ diff --git a/html/blockly-games/index/music.png b/html/blockly-games/index/music.png new file mode 100644 index 0000000..b1d151e Binary files /dev/null and b/html/blockly-games/index/music.png differ diff --git a/html/blockly-games/index/pond-duck.png b/html/blockly-games/index/pond-duck.png new file mode 100644 index 0000000..0e16d59 Binary files /dev/null and b/html/blockly-games/index/pond-duck.png differ diff --git a/html/blockly-games/index/pond-tutor.png b/html/blockly-games/index/pond-tutor.png new file mode 100644 index 0000000..532fd13 Binary files /dev/null and b/html/blockly-games/index/pond-tutor.png differ diff --git a/html/blockly-games/index/puzzle.png b/html/blockly-games/index/puzzle.png new file mode 100644 index 0000000..c758432 Binary files /dev/null and b/html/blockly-games/index/puzzle.png differ diff --git a/html/blockly-games/index/style.css b/html/blockly-games/index/style.css new file mode 100644 index 0000000..2b82183 --- /dev/null +++ b/html/blockly-games/index/style.css @@ -0,0 +1,186 @@ +html, body { + height: 100%; + width: 100%; + padding: 0; + margin: 0; + overflow: hidden; +} + +#languageMenu { + position: absolute; + top: 0; +} + +html[dir="LTR"] #languageMenu { + right: 1em; +} + +html[dir="RTL"] #languageMenu { + left: 1em; +} + +#header { + position: absolute; + top: 1em; + left: 20%; + right: 20%; + width: 60%; + text-align: center; +} + +#banner { + padding: 1em; +} + +#subtitle { + font-style: italic; +} + +a { + text-decoration: none; +} + +#clearDataPara { + position: absolute; + bottom: 0; + margin: 1em; +} + +#clearData { + padding: 0 4px; + margin: 5px 10px; + font-size: medium; +} + +#path { + stroke: #ccc; + stroke-width: 1; + stroke-linecap: round; + fill: none; + stroke-dasharray: 180; + stroke-dashoffset: 180; + animation: dash .7s linear forwards; +} + +@keyframes dash { + to { + stroke-dashoffset: 0; + } +} + +.iconBack { + fill: #fff; +} + +.iconBorder { + stroke: #aaa; + stroke-width: 5; + fill: rgba(0, 0, 0, 0.1); +} + +a:hover > .iconBorder { + fill: rgba(255, 255, 255, 0.1); +} + +a:hover > text { + fill: #666; +} + +.icon { + animation: pop .5s cubic-bezier(.5,.5,.5,1.5) forwards; + visibility: hidden; +} + +.icon text { + text-anchor: middle; + font-size: 18pt; +} + +#icon-puzzle { + animation-delay: 0.0s; +} + +#icon-maze { + animation-delay: 0.1s; +} + +#icon-bird { + animation-delay: 0.2s; +} + +#icon-turtle { + animation-delay: 0.3s; +} + +#icon-movie { + animation-delay: 0.4s; +} + +#icon-music { + animation-delay: 0.5s; +} + +#icon-pond-tutor { + animation-delay: 0.6s; +} + +#icon-pond-duck { + animation-delay: 0.7s; +} + +#back-puzzle { + animation-delay: 0.3s; +} + +#back-maze { + animation-delay: 0.4s; +} + +#back-bird { + animation-delay: 0.5s; +} + +#back-turtle { + animation-delay: 0.6s; +} + +#back-movie { + animation-delay: 0.7s; +} + +#back-music { + animation-delay: 0.8s; +} + +#back-pond-tutor { + animation-delay: 0.9s; +} + +#back-pond-duck { + animation-delay: 1.0s; +} + +@keyframes pop { + from { + transform: translate(150px, 50px) scale(0); + visibility: visible; + } + to { + transform: translate(0, 0) scale(1); + visibility: visible; + } +} + +.gaugeBack { + stroke: #aaa; + stroke-width: 6; + fill: none; + animation: pop 0.1s linear forwards; + visibility: hidden; +} + +.gaugeFront { + stroke: #0b0; + stroke-width: 8; + fill: none; +} diff --git a/html/blockly-games/index/title-beta.png b/html/blockly-games/index/title-beta.png new file mode 100644 index 0000000..de65baa Binary files /dev/null and b/html/blockly-games/index/title-beta.png differ diff --git a/html/blockly-games/index/turtle.png b/html/blockly-games/index/turtle.png new file mode 100644 index 0000000..ef06813 Binary files /dev/null and b/html/blockly-games/index/turtle.png differ diff --git a/html/blockly-games/maze.html b/html/blockly-games/maze.html new file mode 100644 index 0000000..b13b2d8 --- /dev/null +++ b/html/blockly-games/maze.html @@ -0,0 +1,15 @@ + + + + + + + Blockly Games : Maze + + + + + + + + diff --git a/html/blockly-games/maze/astro.png b/html/blockly-games/maze/astro.png new file mode 100644 index 0000000..6ed8b1a Binary files /dev/null and b/html/blockly-games/maze/astro.png differ diff --git a/html/blockly-games/maze/bg_astro.jpg b/html/blockly-games/maze/bg_astro.jpg new file mode 100644 index 0000000..8c71174 Binary files /dev/null and b/html/blockly-games/maze/bg_astro.jpg differ diff --git a/html/blockly-games/maze/bg_panda.jpg b/html/blockly-games/maze/bg_panda.jpg new file mode 100644 index 0000000..e812a93 Binary files /dev/null and b/html/blockly-games/maze/bg_panda.jpg differ diff --git a/html/blockly-games/maze/fail_astro.mp3 b/html/blockly-games/maze/fail_astro.mp3 new file mode 100644 index 0000000..86b73eb Binary files /dev/null and b/html/blockly-games/maze/fail_astro.mp3 differ diff --git a/html/blockly-games/maze/fail_astro.ogg b/html/blockly-games/maze/fail_astro.ogg new file mode 100644 index 0000000..dd9050c Binary files /dev/null and b/html/blockly-games/maze/fail_astro.ogg differ diff --git a/html/blockly-games/maze/fail_panda.mp3 b/html/blockly-games/maze/fail_panda.mp3 new file mode 100644 index 0000000..0e6cbfb Binary files /dev/null and b/html/blockly-games/maze/fail_panda.mp3 differ diff --git a/html/blockly-games/maze/fail_panda.ogg b/html/blockly-games/maze/fail_panda.ogg new file mode 100644 index 0000000..0a7ff49 Binary files /dev/null and b/html/blockly-games/maze/fail_panda.ogg differ diff --git a/html/blockly-games/maze/fail_pegman.mp3 b/html/blockly-games/maze/fail_pegman.mp3 new file mode 100644 index 0000000..cd8cc21 Binary files /dev/null and b/html/blockly-games/maze/fail_pegman.mp3 differ diff --git a/html/blockly-games/maze/fail_pegman.ogg b/html/blockly-games/maze/fail_pegman.ogg new file mode 100644 index 0000000..b4d58be Binary files /dev/null and b/html/blockly-games/maze/fail_pegman.ogg differ diff --git a/html/blockly-games/maze/generated/pt-br/compressed.js b/html/blockly-games/maze/generated/pt-br/compressed.js new file mode 100644 index 0000000..b6a4f8c --- /dev/null +++ b/html/blockly-games/maze/generated/pt-br/compressed.js @@ -0,0 +1,637 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,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.O=function(a,c){this.x=a;this.y=c};h.g.O.me=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};h.g.O.Pt=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};h.g.O.HA=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};h.g.O.Mj=function(a,c){return new h.g.O(a.x-c.x,a.y-c.y)};h.g.O.sum=function(a,c){return new h.g.O(a.x+c.x,a.y+c.y)};h.g.O.prototype.scale=function(a){this.x*=a;this.y*=a;return this};h.g.O.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};h.g.Da={};h.g.Da.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};h.g.Da.Rq=function(a){return a.length?a.reduce(function(c,d){return c.lengthc&&(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;eg);return k}; +h.g.Da.jr=function(a,c,d){for(var e=[0],f=[],g=0;ge&&(e=l,f=k)}return f?h.g.Da.gw(a,f,d):c};h.g.Da.aC=function(a,c){for(var d=[],e=0;e=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.Da.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.cr(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;kd;d++)c[d]=h.g.Ve.Rv.charAt(Math.random()*a);return c.join("")}; +h.g.Ve.Rv="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +h.g.Mg=function(){if(void 0!==h.g.Mg.Go)return h.g.Mg.Go;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.Mg.Go="none"!==c;return h.g.Mg.Go};h.g.Gv=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.Zz=function(){var a=h.g.style.vu();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +h.g.Rl=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};h.g.Tz=function(){var a=document.documentElement,c=window;return h.g.userAgent.hf&&c.pageYOffset!=a.scrollTop?new h.g.O(a.scrollLeft,a.scrollTop):new h.g.O(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};h.g.pp=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.xB=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new h.g.O(d-e.left,c-e.top);c=h.g.Sj(a.$a);return h.g.O.Mj(d,c).scale(1/a.scale)}; +h.i={};h.i.zu="";h.i.$b=!0;h.i.Vo=0;h.i.ml="create";h.i.xr=h.i.ml;h.i.aj="delete";h.i.xw=h.i.aj;h.i.Zi="change";h.i.nC=h.i.Zi;h.i.ij="move";h.i.yr=h.i.ij;h.i.Ps="var_create";h.i.Qs="var_delete";h.i.Rs="var_rename";h.i.Nl="ui";h.i.kl="comment_create";h.i.Er="comment_delete";h.i.Dr="comment_change";h.i.ll="comment_move";h.i.Vw="finished_loading";h.i.yw=[h.i.xr,h.i.yr,h.i.kl,h.i.ll];h.i.bj=[];h.i.Na=function(a){h.i.isEnabled()&&(h.i.bj.length||setTimeout(h.i.Bz,0),h.i.bj.push(a))}; +h.i.Bz=function(){for(var a=h.i.filter(h.i.bj,!0),c=h.i.bj.length=0,d;d=a[c];c++)if(d.Ub){var e=h.hb.qp(d.Ub);if(e){var f=d;if(f.$b)for(e.nh.push(f),e.zk.length=0;e.nh.length>e.fs&&0<=e.fs;)e.nh.shift();for(var g=0;d=e.zc[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.si()){var k=[g.type,g.gc,g.Ub].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.ij&&l.index==f-1)m.Vg=g.Vg,m.Ug=g.Ug,m.Rf=g.Rf,l.index=f;else if(g.type==h.i.Zi&&g.element==m.element&&g.name==m.name)m.newValue=g.newValue;else if(g.type!=h.i.Nl||"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.si()});c||a.reverse();for(f=1;g=a[f];f++)g.type==h.i.Zi&&"mutation"==g.element&&a.unshift(a.splice(f,1)[0]);return a};h.i.Ty=function(){for(var a=0,c;c=h.i.bj[a];a++)c.$b=!1};h.i.disable=function(){h.i.Vo++};h.i.enable=function(){h.i.Vo--};h.i.isEnabled=function(){return 0==h.i.Vo};h.i.Db=function(){return h.i.zu};h.i.ga=function(a){h.i.zu="boolean"==typeof a?a?h.g.Ve():"":a}; +h.i.iu=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.pa=function(a){switch(a.type){case h.i.ml:var c=new h.i.wd(null);break;case h.i.aj:c=new h.i.Vd(null);break;case h.i.Zi:c=new h.i.gf(null,"","","","");break;case h.i.ij:c=new h.i.lg(null);break;case h.i.Ps:c=new h.i.cd(null);break;case h.i.Qs:c=new h.i.Ed(null);break;case h.i.Rs:c=new h.i.ce(null,"");break;case h.i.Nl:c=new h.i.bd(null,"","","");break;case h.i.kl:c=new h.i.Fe(null);break;case h.i.Dr:c=new h.i.xh(null,"","");break;case h.i.ll:c=new h.i.fg(null);break;case h.i.Er:c=new h.i.Ge(null); +break;default:throw Error("Unknown event type.");}c.pa(a);c.Ub=(void 0).id;return c};h.i.NG=function(a){if((a.type==h.i.ij||a.type==h.i.ml)&&a.Ub){var c=h.hb.qp(a.Ub);if(a=v(c,a.gc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.we(!0);else if((a.M||a.R)&&!c.yc()){do a.we(!1),a=u(a);while(a)}}}}; +h.i.Abstract=function(){this.Ub=void 0;this.group=h.i.Db();this.$b=h.i.$b};h.i.Abstract.prototype.Ia=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};h.i.Abstract.prototype.pa=function(a){this.group=a.group};h.i.Abstract.prototype.si=function(){return!1};h.i.Abstract.prototype.run=function(){};function w(a){if(a.Ub)var c=h.hb.qp(a.Ub);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.yi=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.g.xml={};h.g.xml.Ex="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.Ex,a)};h.g.xml.createTextNode=function(a){return h.g.xml.document().createTextNode(a)};h.g.xml.NB=function(a){return(new DOMParser).parseFromString(a,"text/xml")};h.g.xml.Mc=function(a){return(new XMLSerializer).serializeToString(a)};h.i.Ud=function(a){h.i.Ud.w.constructor.call(this);this.gc=a.id;this.Ub=a.C.id};h.g.object.S(h.i.Ud,h.i.Abstract);h.i.Ud.prototype.Ia=function(){var a=h.i.Ud.w.Ia.call(this);a.blockId=this.gc;return a};h.i.Ud.prototype.pa=function(a){h.i.Ud.w.pa.call(this,a);this.gc=a.blockId};h.i.gf=function(a,c,d,e,f){a&&(h.i.gf.w.constructor.call(this,a),this.element=c,this.name=d,this.oldValue=e,this.newValue=f)};h.g.object.S(h.i.gf,h.i.Ud);h.i.uh=h.i.gf;b=h.i.gf.prototype;b.type=h.i.Zi; +b.Ia=function(){var a=h.i.gf.w.Ia.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};b.pa=function(a){h.i.gf.w.pa.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};b.si=function(){return this.oldValue==this.newValue}; +b.run=function(a){var c=v(w(this),this.gc);if(c)switch(c.Qf&&c.Qf.Eb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=ba(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.Hi(a||null);break;case "collapsed":c.Zf(!!a);break;case "disabled":c.we(!a);break;case "inline":c.Ii(!!a);break;case "mutation":var d="";c.qd&&(d=(d=c.qd())&&h.K.Mc(d));if(c.Ue){var e=h.K.$f(a||"");c.Ue(e)}h.i.Na(new h.i.gf(c,"mutation",null,d, +a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.gc)};h.i.wd=function(a){a&&(h.i.wd.w.constructor.call(this,a),this.xml=a.C.ca?h.K.Bo(a):h.K.sf(a),this.Lg=h.i.iu(a))};h.g.object.S(h.i.wd,h.i.Ud);h.i.il=h.i.wd;h.i.wd.prototype.type=h.i.ml;h.i.wd.prototype.Ia=function(){var a=h.i.wd.w.Ia.call(this);a.xml=h.K.Mc(this.xml);a.ids=this.Lg;return a}; +h.i.wd.prototype.pa=function(a){h.i.wd.w.pa.call(this,a);this.xml=h.K.$f(a.xml);this.Lg=a.ids};h.i.wd.prototype.run=function(a){var c=w(this);if(a)a=h.g.xml.createElement("xml"),a.appendChild(this.xml),h.K.Eg(a,c);else{a=0;for(var d;d=this.Lg[a];a++){var e=v(c,d);e?e.I(!1):d==this.gc&&console.warn("Can't uncreate non-existent block: "+d)}}}; +h.i.Vd=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");h.i.Vd.w.constructor.call(this,a);this.pq=a.C.ca?h.K.Bo(a):h.K.sf(a);this.Lg=h.i.iu(a)}};h.g.object.S(h.i.Vd,h.i.Ud);h.i.zw=h.i.Vd;h.i.Vd.prototype.type=h.i.aj;h.i.Vd.prototype.Ia=function(){var a=h.i.Vd.w.Ia.call(this);a.ids=this.Lg;return a};h.i.Vd.prototype.pa=function(a){h.i.Vd.w.pa.call(this,a);this.Lg=a.ids}; +h.i.Vd.prototype.run=function(a){var c=w(this);if(a){a=0;for(var d;d=this.Lg[a];a++){var e=v(c,d);e?e.I(!1):d==this.gc&&console.warn("Can't delete non-existent block: "+d)}}else a=h.g.xml.createElement("xml"),a.appendChild(this.pq),h.K.Eg(a,c)};h.i.lg=function(a){a&&(h.i.lg.w.constructor.call(this,a),a=ca(this),this.kv=a.qv,this.jv=a.Lu,this.mq=a.Bt)};h.g.object.S(h.i.lg,h.i.Ud);h.i.Xi=h.i.lg;b=h.i.lg.prototype;b.type=h.i.ij; +b.Ia=function(){var a=h.i.lg.w.Ia.call(this);this.Vg&&(a.newParentId=this.Vg);this.Ug&&(a.newInputName=this.Ug);this.Rf&&(a.newCoordinate=Math.round(this.Rf.x)+","+Math.round(this.Rf.y));return a};b.pa=function(a){h.i.lg.w.pa.call(this,a);this.Vg=a.newParentId;this.Ug=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.Rf=new h.g.O(Number(a[0]),Number(a[1])))};b.$g=function(){var a=ca(this);this.Vg=a.qv;this.Ug=a.Lu;this.Rf=a.Bt}; +function ca(a){var c=v(w(a),a.gc);a={};var d=c.getParent();if(d){a.qv=d.id;a:{for(var e=0,f;f=d.N[e];e++)if(f.connection&&x(f.connection)==c){c=f;break a}c=null}c&&(a.Lu=c.name)}else a.Bt=c.Ha();return a}b.si=function(){return this.kv==this.Vg&&this.jv==this.Ug&&h.g.O.me(this.mq,this.Rf)}; +b.run=function(a){var c=w(this),d=v(c,this.gc);if(d){var e=a?this.Vg:this.kv,f=a?this.Ug:this.jv;a=a?this.Rf:this.mq;var g=null;if(e&&(g=v(c,e),!g)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&y(d);if(a)f=d.Ha(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.M||d.R;if(f){if(c=da(g,f))var k=c.connection}else d.type==h.Bd&&(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.gc)};h.g.m={};h.g.m.qc="http://www.w3.org/2000/svg";h.g.m.Hn="http://www.w3.org/1999/xhtml";h.g.m.dd="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.vg=null;h.g.m.Fo=0;h.g.m.L=function(a,c,d){a=document.createElementNS(h.g.m.qc,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.Ib=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.Sc=function(a,c){var d=a.getAttribute("class");if(-1==(" "+d+" ").indexOf(" "+c+" "))return!1;d=d.split(/\s+/);for(var e=0;ed)){var e=ea(c,a.Y());a.M?(e.x+=(a.H?3:-3)*d,e.y+=13*d):a.R&&(e.x+=(a.H?-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},z(c));h.Qa.xt(a,new Date,d)}};h.Qa.xt=function(a,c,d){var e=(new Date-c)/150;1a.C.scale)){var c=A(a).height;c=Math.atan(10/c)/Math.PI*180;a.H||(c*=-1);h.Qa.Nt(a.Y(),c,new Date)}};h.Qa.Nt=function(a,c,d){var e=(new Date-d)/200;1a-h.Gw)}if(a.Nb||a.bb)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Nb||!a.bb);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function ia(a){a.bb&&(h.g.m.removeNode(h.ea.Ku),delete h.ea.Ku);if(a.Gp){var c=a.bb;c.type!=h.Oa||c.isConnected()?ja(a.ji,!1):a.ji.jA(c,!1);a.ji=null;a.Gp=!1}else if(a.Sg)if(a.Sg){c=a.Sg;var d=c.D,e=d.V,f=d.R,g=d.M;g=c.type==h.Oa&&!(g&&g.la);!(c!=e||f&&f.la)||g?y(x(c),!1):c.type==h.Ca&&c!=e?(e=c.la,y(e.D,!1),f=f?f.la:null,y(d,!0),f&&f.connect(e)):y(d,!0);if(c.la)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.Sg=null;d.Y().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +h.xl.prototype.bi=function(){var a=[];this.ai&&a.push(this.ai);this.Qg&&a.push(this.Qg);return a};h.eg=function(a,c){this.cb=a;this.s=c;this.le=new h.xl(this.cb);this.Dg=null;this.De=!1;this.ze=this.cb.Ha();this.im=h.eg.qA(a)};h.eg.prototype.I=function(){this.Fb=this.s=this.cb=null;this.im.length=0;this.le&&(this.le.I(),this.le=null)};h.eg.qA=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=ka(e);for(var f=0;f=d+this.Ef&&(e+=f);wa(this,Ea(this,e));Ca(this);a.stopPropagation();a.preventDefault()}}; +b.aB=function(a){Ga(this.s);xa();h.g.ui(a)?a.stopPropagation():(this.IB=this.Vj,Ia(this.s),this.Uv=this.Kg?a.clientX:a.clientY,h.za.Uf=h.ra(document,"mouseup",this,this.fB),h.za.Tf=h.ra(document,"mousemove",this,this.bB),a.stopPropagation(),a.preventDefault())};b.bB=function(a){wa(this,Ea(this,this.IB+((this.Kg?a.clientX:a.clientY)-this.Uv)));Ca(this)};b.fB=function(){Ja(this.s);h.Touch.Ul();xa()};function xa(){h.jc(!0);h.za.Uf&&(h.fb(h.za.Uf),h.za.Uf=null);h.za.Tf&&(h.fb(h.za.Tf),h.za.Tf=null)} +function Ea(a,c){return c=0>=c||isNaN(c)||a.tdc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.jn.splice(c,1);this.Tb.unsubscribe(this.Sb);this.options.Ac||(this.Tb.I(),this.Tb=null)}};h.hb.Es=3;b=h.hb.prototype; +b.ye=function(a,c){a=a.Ha();c=c.Ha();return a.y+h.hb.prototype.ye.offset*a.x-(c.y+h.hb.prototype.ye.offset*c.x)};function Oa(a,c){if(!h.g.Rl(a.Ui,c))throw Error("Block not present in workspace's list of top-most blocks.");}function G(a,c){var d=[].concat(a.Ui);c&&1g)return!1;d+=c[e]}return d>Ra(a)?!1:!0} +function Ta(a){return Infinity!=a.options.cq||!!a.options.eq}b.hr=function(a){var c=a?this.zk:this.nh,d=a?this.nh:this.zk,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.$b=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{h.i.$b=!0}}};function Ua(a,c){a.zc.push(c)}function Va(a,c){h.g.Rl(a.zc,c)}function v(a,c){return a.Ao[c]||null}h.hb.oj=Object.create(null);h.hb.qp=function(a){return h.hb.oj[a]||null}; +h.hb.getAll=function(){var a=[],c;for(c in h.hb.oj)a.push(h.hb.oj[c]);return a};h.oa=function(a,c,d,e,f,g){this.s=a;this.wf=c;this.Pv=d;d=h.oa.tw;this.s.H&&(d=-d);this.Ay=h.g.pd.Zq(d);a.ef.appendChild(this.Fj(c,!(!f||!g)));this.xb=e;this.Eq&&Wa(this);f&&g||(c=this.wf.getBBox(),f=c.width+2*h.oa.Td,g=c.height+2*h.oa.Td);Xa(this,f,g);Wa(this);Ya(this);this.Eq=!0;a.options.readOnly||(h.ra(this.tj,"mousedown",this,this.Hy),this.ve&&h.ra(this.ve,"mousedown",this,this.sB))};h.oa.Td=6;h.oa.uw=5;h.oa.tw=20;h.oa.rr=4;h.oa.rw=8;h.oa.Uf=null;h.oa.Tf=null;h.oa.prototype.Ev=null; +h.oa.gr=function(){h.oa.Uf&&(h.fb(h.oa.Uf),h.oa.Uf=null);h.oa.Tf&&(h.fb(h.oa.Tf),h.oa.Tf=null)};h.oa.Iy=function(){h.Touch.Ul();h.oa.gr()};b=h.oa.prototype;b.Eq=!1;b.xb=null;b.bf=0;b.Xf=0;b.Xa=0;b.Zb=0;b.wo=!0; +b.Fj=function(a,c){this.Lc=h.g.m.L("g",{},null);var d={filter:"url(#"+this.s.options.Tt+")"};h.g.userAgent.px&&(d={});d=h.g.m.L("g",d,this.Lc);this.Eo=h.g.m.L("path",{},d);this.tj=h.g.m.L("rect",{"class":"blocklyDraggable",x:0,y:0,rx:h.oa.Td,ry:h.oa.Td},d);c?(this.ve=h.g.m.L("g",{"class":this.s.H?"blocklyResizeSW":"blocklyResizeSE"},this.Lc),c=2*h.oa.Td,h.g.m.L("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.ve),h.g.m.L("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.ve),h.g.m.L("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.ve)):this.ve=null;this.Lc.appendChild(a);return this.Lc};b.Y=function(){return this.Lc};b.Hy=function(a){var c=this.s.Af(a);if(c){if(c.Jg)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.Tc||(c.Tc=this);c.Od=a}};b.Hk=function(){};b.Pc=function(){return!1}; +b.sB=function(a){var c=this.Lc.parentNode;c.lastChild!==this.Lc&&c.appendChild(this.Lc);h.oa.gr();h.g.ui(a)||(this.s.Uq(a,new h.g.O(this.s.H?-this.Xa:this.Xa,this.Zb)),h.oa.Uf=h.ra(document,"mouseup",this,h.oa.Iy),h.oa.Tf=h.ra(document,"mousemove",this,this.tB),h.jc());a.stopPropagation()};b.tB=function(a){this.wo=!1;var c=this.s;a=h.g.qk(a,z(c),Ha(c));a.x/=c.scale;a.y/=c.scale;c=h.g.O.sum(c.Qt,a);Xa(this,this.s.H?-c.x:c.x,c.y);this.s.H&&Wa(this)}; +function Za(a,c,d){var e=a.s.H?a.xb.x-c.x-a.Xa:c.x+a.xb.x;c=c.y+a.xb.y;return Math.max(0,Math.min(1,(Math.min(e+a.Xa,d.wb+d.lb)-Math.max(e,d.wb))*(Math.min(c+a.Zb,d.Bb+d.vb)-Math.max(c,d.Bb))/(a.Xa*a.Zb)))}function Wa(a){var c=a.xb.x;c=a.s.H?c-(a.bf+a.Xa):c+a.bf;a.moveTo(c,a.Xf+a.xb.y)}b.moveTo=function(a,c){this.Lc.setAttribute("transform","translate("+a+","+c+")")}; +function Xa(a,c,d){var e=2*h.oa.Td;c=Math.max(c,e+45);d=Math.max(d,e+20);a.Xa=c;a.Zb=d;a.tj.setAttribute("width",c);a.tj.setAttribute("height",d);a.ve&&(a.s.H?a.ve.setAttribute("transform","translate("+2*h.oa.Td+","+(d-e)+") scale(-1 1)"):a.ve.setAttribute("transform","translate("+(c-e)+","+(d-e)+")"));if(a.wo){c=a.s.vc();c.wb/=a.s.scale;c.lb/=a.s.scale;c.Bb/=a.s.scale;c.vb/=a.s.scale;d=-a.Xa/4;if(!(a.Xa>c.lb)){if(a.s.H){e=a.xb.x-d;var f=e-a.Xa;var g=c.wb+c.lb,k=c.wb+h.za.ac/a.s.scale}else f=d+a.xb.x, +e=f+a.Xa,k=c.wb,g=c.wb+c.lb-h.za.ac/a.s.scale;a.s.H?fg&&(d=-(g-a.xb.x)):fg&&(d=g-a.xb.x-a.Xa)}f=d;d=-a.Zb/4;if(!(a.Zb>c.vb)){e=a.xb.y+d;g=e+a.Zb;k=c.Bb;var l=c.Bb+c.vb-h.za.ac/a.s.scale,m=a.xb.y;el&&(d=l-m-a.Zb)}k=d;g=a.Pv.getBBox();d={x:f,y:-a.Zb-h.ma.hs};e={x:-a.Xa-30,y:k};k={x:g.width,y:k};l={x:f,y:g.height};f=g.widthg&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),q=Math.cos(m),r=new h.g.Cd(a.Xa,a.Zb);m=(r.width+r.height)/h.oa.uw;m=Math.min(m,r.width,r.height)/4;r=1-h.oa.rw/k;f=d+r*f;g=e+r*g;r=d+m*q;var t=e+m*n;d-=m*q;e-=m*n;n=l+a.Ay;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/h.oa.rr;k=Math.cos(n)*k/h.oa.rr;c.push("M"+ +r+","+t);c.push("C"+(r+k)+","+(t+l)+" "+f+","+g+" "+f+","+g);c.push("C"+f+","+g+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.Eo.setAttribute("d",c.join(" "))}b.ud=function(a){this.tj.setAttribute("fill",a);this.Eo.setAttribute("fill",a)};b.I=function(){h.oa.gr();h.g.m.removeNode(this.Lc);this.Pv=this.wf=this.s=this.ve=this.tj=this.Eo=this.Lc=null};b.hq=function(a,c){a?a.mh(c.x,c.y):this.moveTo(c.x,c.y);this.bf=this.s.H?this.xb.x-c.x-this.Xa:c.x-this.xb.x;this.Xf=c.y-this.xb.y;Ya(this)}; +b.Ha=function(){return new h.g.O(this.xb.x+this.bf,this.xb.y+this.Xf)};h.i.Ee=function(a){this.ge=a.id;this.Ub=a.C.id;this.group=h.i.Db();this.$b=h.i.$b};h.g.object.S(h.i.Ee,h.i.Abstract);h.i.Ee.prototype.Ia=function(){var a=h.i.Ee.w.Ia.call(this);this.ge&&(a.commentId=this.ge);return a};h.i.Ee.prototype.pa=function(a){h.i.Ee.w.pa.call(this,a);this.ge=a.commentId};h.i.xh=function(a,c,d){a&&(h.i.xh.w.constructor.call(this,a),this.iv=c,this.Tm=d)};h.g.object.S(h.i.xh,h.i.Ee);b=h.i.xh.prototype;b.type=h.i.Dr; +b.Ia=function(){var a=h.i.xh.w.Ia.call(this);a.newContents=this.Tm;return a};b.pa=function(a){h.i.xh.w.pa.call(this,a);this.Tm=a.newValue};b.si=function(){return this.iv==this.Tm};b.run=function(a){var c;(c=w(this).Xl[this.ge]||null)?c.zH(a?this.Tm:this.iv):console.warn("Can't change non-existent comment: "+this.ge)};h.i.Fe=function(a){a&&(h.i.Fe.w.constructor.call(this,a),this.xml=a.$q())};h.g.object.S(h.i.Fe,h.i.Ee);h.i.Fe.prototype.type=h.i.kl; +h.i.Fe.prototype.Ia=function(){var a=h.i.Fe.w.Ia.call(this);a.xml=h.K.Mc(this.xml);return a};h.i.Fe.prototype.pa=function(a){h.i.Fe.w.pa.call(this,a);this.xml=h.K.$f(a.xml)};h.i.Fe.prototype.run=function(a){h.i.Gr(this,a)};h.i.Gr=function(a,c){var d=w(a);c?(c=h.g.xml.createElement("xml"),c.appendChild(a.xml),h.K.Eg(c,d)):(d=d.Xl[a.ge]||null)?d.I(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.ge)};h.i.Ge=function(a){a&&(h.i.Ge.w.constructor.call(this,a),this.xml=a.$q())}; +h.g.object.S(h.i.Ge,h.i.Ee);h.i.Ge.prototype.type=h.i.Er;h.i.Ge.prototype.Ia=function(){return h.i.Ge.w.Ia.call(this)};h.i.Ge.prototype.pa=function(a){h.i.Ge.w.pa.call(this,a)};h.i.Ge.prototype.run=function(a){h.i.Gr(this,!a)};h.i.fg=function(a){a&&(h.i.fg.w.constructor.call(this,a),this.Ko=a,this.nq=a.wu(),this.Tg=null)};h.g.object.S(h.i.fg,h.i.Ee);b=h.i.fg.prototype; +b.$g=function(){if(!this.Ko)throw Error("Tried to record the new position of a comment on the same event twice.");this.Tg=this.Ko.wu();this.Ko=null};b.type=h.i.ll;b.Ia=function(){var a=h.i.fg.w.Ia.call(this);this.Tg&&(a.newCoordinate=Math.round(this.Tg.x)+","+Math.round(this.Tg.y));return a};b.pa=function(a){h.i.fg.w.pa.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.Tg=new h.g.O(Number(a[0]),Number(a[1])))};b.si=function(){return h.g.O.me(this.nq,this.Tg)}; +b.run=function(a){var c;if(c=w(this).Xl[this.ge]||null){a=a?this.Tg:this.nq;var d=c.wu();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.ge)};h.Yi=function(a,c){this.Cb=a;this.s=c;this.Dg=null;this.rn=!1;this.ze=this.Cb.Ha();this.Fg=h.g.Mg()&&c.Kc?c.Kc:null};h.Yi.prototype.I=function(){this.Fg=this.s=this.Cb=null};function $a(a,c,d){d=a.Bi(d);d=h.g.O.sum(a.ze,d);a.Cb.hq(a.Fg,d);a.Cb.Pc()&&(a.Dg=oa(a.s,c),a.rn=a.Dg!=h.Jr,c=a.s.bc,a.rn?(pa(a.Cb,!0),a.Dg==h.En&&c&&qa(c,!0)):(pa(a.Cb,!1),c&&qa(c,!1)))} +function ab(a,c,d){$a(a,c,d);c=a.Bi(d);c=h.g.O.sum(a.ze,c);a.Cb.moveTo(c.x,c.y);c=a.s.bc;a.rn?(c&&setTimeout(c.close.bind(c),100),a.Qj(),a.Cb.I(!1,!0)):c&&c.close();a.rn||(a.Fg&&a.Fg.Tl(a.s.ef),a.Cb.dh&&a.Cb.dh(!1),a.Qj());a.s.Rb(!0);a.s.sa&&a.s.sa.qB(a.Cb.Pc()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.i.ga(!1)}h.Yi.prototype.Qj=function(){if(this.Cb.Pu){var a=new h.i.fg(this.Cb);a.nq=this.ze;a.$g();h.i.Na(a)}}; +h.Yi.prototype.Bi=function(a){a=new h.g.O(a.x/this.s.scale,a.y/this.s.scale);this.s.ri&&a.scale(1/this.s.options.Ac.scale);return a};h.Yi.prototype.iq=function(){this.Cb.moveTo(0,0);this.Fg.mh(this.ze.x,this.ze.y);bb(this.Fg,this.Cb.Y())};h.LG={};h.bs=40;h.vs=125;h.Nw=5;h.Ww=10;h.ec=28;h.Fr=h.ec;h.Gw=8;h.lx="#000000";h.zn=250;h.An=10;h.Cw=30;h.tx=750;h.Rx=100;h.Ow=!0;h.gx=.45;h.hx=.65;h.Kh={width:96,height:124,url:"sprites.png"};h.Oa=1;h.zd=2;h.Ca=3;h.Bd=4;h.He=5;h.vn=-1;h.nr=0;h.pr=1;h.PC=0;h.QC=1;h.NC=1;h.OC=2;h.Ih=[];h.Ih[h.Oa]=h.zd;h.Ih[h.zd]=h.Oa;h.Ih[h.Ca]=h.Bd;h.Ih[h.Bd]=h.Ca;h.qg=0;h.lj=1;h.Dd=2;h.pg=3;h.Jr=null;h.En=1;h.Kr=2;h.Os="VARIABLE";h.gy="VARIABLE_DYNAMIC";h.xs="PROCEDURE";h.DF="RENAME_VARIABLE_ID";h.HC="DELETE_VARIABLE_ID";h.i.bd=function(a,c,d,e){h.i.bd.w.constructor.call(this);this.gc=a?a.id:null;this.Ub=a?a.C.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.$b=!1};h.g.object.S(h.i.bd,h.i.Abstract);h.i.bd.prototype.type=h.i.Nl;h.i.bd.prototype.Ia=function(){var a=h.i.bd.w.Ia.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.gc&&(a.blockId=this.gc);return a}; +h.i.bd.prototype.pa=function(a){h.i.bd.w.pa.call(this,a);this.element=a.element;this.newValue=a.newValue;this.gc=a.blockId};h.pj=function(a){this.s=a;this.Vv=new h.g.O(a.scrollX,a.scrollY)};h.pj.prototype.I=function(){this.s=null};h.pj.prototype.Uq=function(){h.selected&&cb(h.selected);Ia(this.s)};h.pj.prototype.xf=function(a){a=h.g.O.sum(this.Vv,a);this.s.scroll(a.x,a.y)};h.vl=function(a){h.vl.w.constructor.call(this,a.ei());this.Qb=a.Qb;this.ki=a.ki};h.g.object.S(h.vl,h.pj);h.vl.prototype.xf=function(a){a=h.g.O.sum(this.Vv,a);this.ki?this.Qb.set(-a.x):this.Qb.set(-a.y)};h.F={};h.F.visible=!1;h.F.Sh=!1;h.F.sx=50;h.F.ev=0;h.F.Jk=0;h.F.Rp=0;h.F.Sp=0;h.F.$=null;h.F.an=null;h.F.ks=0;h.F.ls=10;h.F.Lx=10;h.F.ex=750;h.F.Pn=5;h.F.ya=null;h.F.La=function(){h.F.ya||(h.F.ya=document.createElement("div"),h.F.ya.className="blocklyTooltipDiv",document.body.appendChild(h.F.ya))};h.F.Rh=function(a){h.Xb(a,"mouseover",null,h.F.eB);h.Xb(a,"mouseout",null,h.F.dB);a.addEventListener("mousemove",h.F.cB,!1)}; +h.F.eB=function(a){if(!h.F.Sh){for(a=a.currentTarget;"string"!=typeof a.Qd&&"function"!=typeof a.Qd;)a=a.Qd;h.F.$!=a&&(h.F.va(),h.F.an=null,h.F.$=a);clearTimeout(h.F.ev)}};h.F.dB=function(){h.F.Sh||(h.F.ev=setTimeout(function(){h.F.$=null;h.F.an=null;h.F.va()},1),clearTimeout(h.F.Jk))}; +h.F.cB=function(a){if(h.F.$&&h.F.$.Qd&&!h.F.Sh)if(h.F.visible){var c=h.F.Rp-a.pageX;a=h.F.Sp-a.pageY;Math.sqrt(c*c+a*a)>h.F.Lx&&h.F.va()}else h.F.an!=h.F.$&&(clearTimeout(h.F.Jk),h.F.Rp=a.pageX,h.F.Sp=a.pageY,h.F.Jk=setTimeout(h.F.EB,h.F.ex))};h.F.va=function(){h.F.visible&&(h.F.visible=!1,h.F.ya&&(h.F.ya.style.display="none"));h.F.Jk&&clearTimeout(h.F.Jk)};h.F.block=function(){h.F.va();h.F.Sh=!0};h.F.WB=function(){h.F.Sh=!1}; +h.F.EB=function(){if(!h.F.Sh&&(h.F.an=h.F.$,h.F.ya)){h.F.ya.innerHTML="";for(var a=h.F.$.Qd;"function"==typeof a;)a=a();a=h.g.Da.fw(a,h.F.sx);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=h.F.ya.offsetHeight+2*h.F.ls);a?e=Math.max(h.F.Pn-window.scrollX,e):e+h.F.ya.offsetWidth>c+window.scrollX-2*h.F.Pn&&(e=c-h.F.ya.offsetWidth-2*h.F.Pn);h.F.ya.style.top=f+"px";h.F.ya.style.left=e+"px"}};h.Ah=function(a,c){this.Fb=this.Gb=this.gh=this.hh=this.Tc=this.uc=this.dv=null;this.Po=c;this.ck=this.Og=this.dk=this.Hg=!1;this.Od=a;this.P=this.dg=this.Gd=this.Oe=this.Xm=this.Wm=null;this.Hm=this.Jg=this.ht=!1;this.Gu=!h.Ow};b=h.Ah.prototype;b.I=function(){h.Touch.Ul();h.F.WB();this.Po.Lb=null;this.Wm&&h.fb(this.Wm);this.Xm&&h.fb(this.Xm);this.P=this.Fb=this.Gb=this.gh=this.hh=null;this.Gd&&(this.Gd.I(),this.Gd=null);this.dg&&(this.dg.I(),this.dg=null);this.Oe&&(this.Oe.I(),this.Oe=null)}; +function db(a,c){a.uc=h.g.O.Mj(new h.g.O(c.clientX,c.clientY),a.dv);if(a.Hg)var d=!1;else a.Hg=h.g.O.HA(a.uc)>(a.P?h.Ww:h.Nw),d=a.Hg;if(d){if(a.ht)throw Error("updateIsDragging_ should only be called once per gesture.");a.ht=!0;if(a.Tc){a.ck=!0;a.Oe=new h.Yi(a.Tc,a.Fb);d=a.Oe;h.i.Db()||h.i.ga(!0);d.s.Rb(!1);d.Cb.wo=!1;d.Fg&&d.iq();d.Cb.dh&&d.Cb.dh(!0);var e=d.s.sa;e&&e.uy(d.Cb.Pc()?"blocklyToolboxDelete":"blocklyToolboxGrab");$a(a.Oe,a.Od,a.uc);d=!0}else d=!1;if(!d){if(a.Gb)if(a.P?(a.P.Ou(a.Gb)?((d= +!eb(a.P))||(d=a.uc,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.P.uz,d=d-e||d<-180+e||d>180-e?!0:!1),d?(a.Fb=a.P.kb,fb(a.Fb),h.i.Db()||h.i.ga(!0),a.gh=null,a.Gb=gb(a.P,a.Gb),a.Gb.select(),d=!0):d=!1):d=!1,a.Og=d):a.Gb.Dc()&&(a.Og=!0),a.Og){a.Gd=new h.eg(a.Gb,a.Fb);d=a.Gd;e=a.uc;var f=a.Gu;h.i.Db()||h.i.ga(!0);d.s.ri&&ta(d.cb);h.g.m.Lk();d.s.Rb(!1);h.Qa.Yo();if(d.cb.getParent()||f&&d.cb.V&&x(d.cb.V))y(d.cb,f),e=d.Bi(e),e=h.g.O.sum(d.ze,e),d.cb.translate(e.x,e.y),h.Qa.nz(d.cb);d.cb.dh(!0);d.cb.iq(); +(e=d.s.sa)&&e.uy(d.cb.Pc()?"blocklyToolboxDelete":"blocklyToolboxGrab");ma(a.Gd,a.Od,a.uc);d=!0}else d=!1;else d=!1;if(d=!d)if(a.P)d=eb(a.P);else if(d=a.Fb)d=a.Fb,d=d.options.Ob&&d.options.Ob.xf;d&&(a.dg=a.P?new h.vl(a.P):new h.pj(a.Fb),a.dk=!0,a.dg.Uq())}h.Pf()}a.Od=c} +b.$o=function(a){h.g.Km(a)?this.cancel():(this.Jg=!0,h.Qa.Yo(),fb(this.Fb),this.Fb.ri&&this.Fb.resize(),Ga(this.Fb),this.Od=a,h.jc(!!this.P),h.F.block(),this.Gb&&(!this.Gb.Rc&&a.shiftKey?(h.navigation.jp(),E(this.Po.Ga,h.navigation.Ap(this.Gb))):this.Gb.select()),h.g.ui(a)?va(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||h.GA(a,this),this.dv=new h.g.O(a.clientX,a.clientY),this.Gu=a.altKey||a.ctrlKey||a.metaKey,this.Rh(a)))}; +b.Rh=function(a){this.Wm=h.ra(document,"mousemove",null,this.Uj.bind(this));this.Xm=h.ra(document,"mouseup",null,this.xm.bind(this));a.preventDefault();a.stopPropagation()};b.Uj=function(a){db(this,a);this.dk?this.dg.xf(this.uc):this.Og?ma(this.Gd,this.Od,this.uc):this.ck&&$a(this.Oe,this.Od,this.uc);a.preventDefault();a.stopPropagation()}; +b.xm=function(a){db(this,a);h.Pf();if(this.Hm)console.log("Trying to end a gesture recursively.");else{this.Hm=!0;if(this.ck)ab(this.Oe,a,this.uc);else if(this.Og)ra(this.Gd,a,this.uc);else if(this.dk){var c=this.dg;c.xf(this.uc);Ja(c.s)}else if(this.Tc&&!this.Hg)this.Tc.AB&&this.Tc.AB(),this.Tc.select&&this.Tc.select();else if(hb(this))this.hh.Ik(),ib(this);else if(this.gh&&!this.Hg&&!hb(this))this.P&&this.P.Qh?this.Gb.isEnabled()&&(h.i.Db()||h.i.ga(!0),ua(gb(this.P,this.Gb))):h.i.Na(new h.i.bd(this.gh, +"click",void 0,void 0)),ib(this),h.i.ga(!1);else if(!(this.gh||this.Tc||this.hh||this.Hg))if(c=this.Po,a.shiftKey){h.navigation.jp();var d=h.g.xB(c,new h.g.O(a.clientX,a.clientY));d=h.B.Ij(c,d);E(c.Ga,d)}else h.selected&&cb(h.selected);a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.Hm){h.Pf();if(this.ck)ab(this.Oe,this.Od,this.uc);else if(this.Og)ra(this.Gd,this.Od,this.uc);else if(this.dk){var a=this.dg;a.xf(this.uc);Ja(a.s)}this.I()}}; +function va(a,c){a.Gb?(ib(a),h.jc(a.P),a.Gb.Hk(c)):a.Tc?a.Tc.Hk(c):a.Fb&&!a.P&&(h.jc(),a.Fb.Hk(c));c.preventDefault();c.stopPropagation();a.I()}function jb(a,c,d){if(a.Jg)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.Fb||(a.Fb=d);a.Od=c;a.$o(c);h.$e&&h.navigation.Mi(h.navigation.Kl)}function kb(a,c,d){if(a.Jg)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.P||(a.P=d);jb(a,c,d.ei())} +function ib(a){a.Gb&&!a.P&&ta(a.Gb)}function lb(a,c){a.gh||a.Tc||(a.gh=c,c.Rc&&c!=D(c)?mb(a,D(c)):mb(a,c))}function mb(a,c){c.Ua?mb(a,c.getParent()):a.Gb=c}function hb(a){if(a.hh){var c=a.hh;c=!!c.D&&c.D.Qc()&&!!c.Ik&&"function"===typeof c.Ik}else c=!1;return c&&!a.Hg&&(!a.P||!a.P.Qh)}b.yc=function(){return this.dk||this.Og||this.ck};b.bi=function(){return this.Gd?this.Gd.bi():[]};h.Ah.Hp=function(){for(var a=h.hb.getAll(),c=0,d;d=a[c];c++)if(d.Lb)return!0;return!1};h.Ea=function(a,c,d){this.Zv=this.bw=this.Be=null;this.ub=new h.g.Cd(0,0);this.Yb=null;d&&this.Aj(d);this.setValue(a);c&&(this.bw=c)};h.Ea.Ar=16;h.Ea.Ls=12.5;h.Ea.qj=10;h.Ea.Xs=10;h.Ea.zh=h.Ea.qj/2;b=h.Ea.prototype;b.name=void 0;b.av=50;b.D=null;b.If=!0;b.cg=!0;b.Vl=null;h.Ea.js="\u00a0";b=h.Ea.prototype;b.Wd=!0;b.Fs=!1;b.Aj=function(a){var c=a.tooltip;"string"==typeof c&&(c=h.g.Fc(a.tooltip));c&&this.Pd(c)}; +b.wa=function(){this.jd||(this.jd=h.g.m.L("g",{},null),this.isVisible()||(this.jd.style.display="none"),this.D.Y().appendChild(this.jd),this.$j(),this.Xk(),this.Pd(this.Zv),h.F.Rh(this.Vl||this.Y()),this.cv=h.ra(this.Vl||this.Y(),"mousedown",this,this.Sf))};b.$j=function(){this.ub.height=Math.max(this.ub.height,h.Ea.Ar);this.ub.width=Math.max(this.ub.width,h.Ea.qj);this.sj=h.g.m.L("rect",{rx:4,ry:4,x:0,y:0,height:this.ub.height,width:this.ub.width},this.jd);nb(this)}; +function nb(a){a.Vc=h.g.m.L("text",{"class":"blocklyText",y:h.Ea.Ls,x:a.sj?h.Ea.zh:0},a.jd);a.Ri=document.createTextNode("");a.Vc.appendChild(a.Ri)}b.I=function(){h.A.Wj(this);h.W.Wj(this);this.cv&&h.fb(this.cv);h.g.m.removeNode(this.jd)};b.Xk=function(){var a=this.Vl||this.Y();this.Wd&&a&&(this.D.Qc()?(h.g.m.Ib(a,"blocklyEditableText"),h.g.m.Sc(a,"blocklyNonEditableText"),a.style.cursor=this.Hw):(h.g.m.Ib(a,"blocklyNonEditableText"),h.g.m.Sc(a,"blocklyEditableText"),a.style.cursor=""))}; +b.isVisible=function(){return this.cg};b.Eb=function(a){if(this.cg!=a){this.cg=a;var c=this.Y();c&&(c.style.display=a?"block":"none")}};b.Y=function(){return this.jd};b.Ae=function(){};b.Di=function(){if(this.Ri){this.Ri.nodeValue=ob(this);var a=h.g.m.xp(this.Vc);this.sj&&(a+=h.Ea.qj,this.sj.setAttribute("width",a));this.ub.width=a}}; +b.We=function(){if(!this.isVisible())return new h.g.Cd(0,0);this.If?(this.Di(),this.If=!1):this.cg&&0==this.ub.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.Di());return this.ub};function ob(a){var c=a.Bf();if(!c)return h.Ea.js;c.length>a.av&&(c=c.substring(0,a.av-2)+"\u2026");c=c.replace(/\s/g,h.Ea.js);a.D&&a.D.H&&(c+="\u200f");return c}b.Bf=function(){if(this.yp){var a=this.yp.call(this);if(null!==a)return String(a)}return String(this.getValue())}; +b.gn=function(){throw Error("setText method is deprecated");};b.mk=function(){this.If=!0};function pb(a){a.If=!0;a.D&&a.D.ca&&(a.D.Ba(),a.D.Cc())}b.setValue=function(a){if(null!==a){var c=this.gm(a);a=qb(this,a,c);if(!(a instanceof Error)){if(c=this.bw)if(c=c.call(this,a),a=qb(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.D&&h.i.isEnabled()&&h.i.Na(new h.i.uh(this.D,"field",this.name||null,c,a)),this.hm(a),this.If&&pb(this))}}}; +function qb(a,c,d){if(null===d)return a.If&&pb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.Be};b.gm=function(a){return null===a||void 0===a?null:a};b.hm=function(a){this.Be=a;this.If=!0};b.Sf=function(a){if(this.D&&this.D.C&&(a=this.D.C.Af(a))){if(a.Jg)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.hh||(a.hh=this)}};b.Pd=function(a){var c=this.Vl||this.Y();c?c.Qd=a||""===a?a:this.D:this.Zv=a}; +b.ne=function(){for(var a=null,c=this.D,d=c.N,e=0;ed||d>a.Kb.length)throw Error(h.nc.Error.Bw);a.Io[c.ob()]=c;if(c.getParent()==a){var e=a.Kb.indexOf(c);-1c?d-1:c},a.Ye)}function zb(a,c,d){var e=a.Kb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var g=a.Kb[d]||null;if(g&&g.isEnabled()){vb(a,d);break}f++;d=c.call(a,d,e)}}b.eA=function(a){(a=wb(this,a.target))&&a.isEnabled()&&(this.Kb[this.Ye]||null)!==a&&(xb(this),this.df(a))}; +b.$z=function(a){var c=wb(this,a.target),d;if(d=c)c.isEnabled()&&(c.df(!0),Bb(c)),d=void 0;d&&a.preventDefault()};b.cA=function(){this.focus()};b.dA=function(){this.$&&(this.blur(),xb(this),vb(this,-1))};b.Cp=function(a){return 0!=this.Kb.length&&Cb(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1}; +function Cb(a,c){var d=a.Kb[a.Ye]||null;if(d&&"function"==typeof d.Cp&&d.Cp(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case h.g.rb.Mr:d&&Bb(d);break;case h.g.rb.by:Ab(a);break;case h.g.rb.Mw:yb(a);break;default:return!1}return!0};h.zl=function(a,c){h.nc.call(this);this.wf=a;this.setValue(c);this.jm=!0};h.g.object.S(h.zl,h.nc);b=h.zl.prototype; +b.La=function(){var a=document.createElement("div");a.id=this.ob();this.$=a;a.className="goog-menuitem goog-option "+(this.jm?"":"goog-menuitem-disabled ")+(this.Ho?"goog-option-selected ":"")+(this.Ru()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.vj){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Db(this));h.g.Pa.Li(a,this.Jq||(this.vj?h.g.Pa.co.Ax: +h.g.Pa.co.zx));h.g.Pa.Mi(a,h.g.Pa.State.fo,this.vj&&this.Ho||!1)};function Db(a){a=a.wf;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.Be=a};b.getValue=function(){return this.Be};b.Li=function(a){this.Jq=a};function Eb(a,c){if(a.vj){a.Ho=c;var d=a.$;d&&a.isEnabled()&&(c?(h.g.m.Ib(d,"goog-option-selected"),h.g.Pa.Mi(d,h.g.Pa.State.fo,!0)):(h.g.m.Sc(d,"goog-option-selected"),h.g.Pa.Mi(d,h.g.Pa.State.fo,!1)))}} +b.df=function(a){var c=this.$;c&&this.isEnabled()&&(a?h.g.m.Ib(c,"goog-menuitem-highlight"):h.g.m.Sc(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.jm};b.we=function(a){this.jm=a;(a=this.$)&&(this.jm?h.g.m.Sc(a,"goog-menuitem-disabled"):h.g.m.Ib(a,"goog-menuitem-disabled"))};function Bb(a){a.vj&&Eb(a,!a.Ho);a.$s&&a.$s.call(a.sy,a)}function Fb(a,c,d){a.$s=c;a.sy=d};h.Sd=function(a){this.name=a};h.B=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.Vk=a;this.bk=h.B.wA(a);this.ba=c;(a=d||null)&&a.hw&&(this.iw=a.hw)};h.B.types={Zc:"field",Ic:"block",Ie:"input",Jh:"output",xd:"next",Ad:"previous",$d:"stack",sg:"workspace"};h.B.Kw=-20;h.B.wA=function(a){switch(a){case h.B.types.Ad:case h.B.types.xd:case h.B.types.Ie:case h.B.types.Jh:return!0}return!1};h.B.Gj=function(a){return new h.B(h.B.types.Zc,a)}; +h.B.je=function(a){return a?a.type==h.Oa||a.type==h.Ca&&a.ne()?h.B.Ag(a.ne()):a.type==h.Ca?new h.B(h.B.types.xd,a):a.type==h.zd?new h.B(h.B.types.Jh,a):a.type==h.Bd?new h.B(h.B.types.Ad,a):null:null};h.B.Ag=function(a){return a?new h.B(h.B.types.Ie,a.connection):null};h.B.Te=function(a){return new h.B(h.B.types.Ic,a)};h.B.Hj=function(a){return new h.B(h.B.types.$d,a)};h.B.Ij=function(a,c){return new h.B(h.B.types.sg,a,{hw:c})};b=h.B.prototype;b.jb=function(){return this.Vk}; +function Gb(a,c){a=a.ba;a instanceof h.hl||(a=a.D);if(!a||!a.C)return null;var d=D(a);a=G(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.B.Hj(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function Hb(a){if(!a)return null;do var c=a.R&&x(a.R);while(c&&u(c)==a&&(a=c));return(c=a.R||a.M)&&c.la&&c.la.ne()?h.B.Ag(c.la.ne()):h.B.Hj(a)} +b.next=function(){switch(this.Vk){case h.B.types.$d:return Gb(this,!0);case h.B.types.Jh:return h.B.Te(this.ba.D);case h.B.types.Zc:a:{var a=this.ba,c=a.ne();var d=a.D;a=c.Ma.indexOf(a)+1;c=d.N.indexOf(c);for(var e;e=d.N[c];c++){for(var f=e.Ma;aa.length)){e=[];for(f=0;fthis.Ck)return null;var a=this.getOptions(!0)[this.Ck][0];return"object"==typeof a?a.alt:a}; +h.Fa.aw=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=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};h.i.cj=function(a){this.Ub=a.id;this.group=h.i.Db();this.$b=!1};h.g.object.S(h.i.cj,h.i.Abstract);h.i.cj.prototype.type=h.i.Vw;h.i.cj.prototype.Ia=function(){var a={type:this.type};this.group&&(a.group=this.group);this.Ub&&(a.workspaceId=this.Ub);return a};h.i.cj.prototype.pa=function(a){this.Ub=a.workspaceId;this.group=a.group};h.K={};h.K.qn=function(a){var c=H,d=h.g.xml.createElement("xml"),e=h.K.XB(h.Z.bt(c));e.hasChildNodes()&&d.appendChild(e);var f=Pa(c,!0);e=0;for(var g;g=f[e];e++)d.appendChild(g.$q(a));c=G(c,!0);for(e=0;f=c[e];e++)d.appendChild(h.K.Bo(f,a));return d};h.K.XB=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.ob();c.appendChild(f)}return c}; +h.K.Bo=function(a,c){var d;a.C.H&&(d=a.C.di());c=h.K.sf(a,c);var e=a.Ha();c.setAttribute("x",Math.round(a.C.H?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c}; +h.K.zz=function(a){var c=!1;a.name&&(a.Fs?c=!0:a.Wd&&(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),c.textContent=a.getValue(),c):null};h.K.xy=function(a,c){for(var d=0,e;e=a.N[d];d++)for(var f=0,g;g=e.Ma[f];f++)(g=h.K.zz(g))&&c.appendChild(g)}; +h.K.sf=function(a,c){var d=h.g.xml.createElement(a.Ua?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.qd){var e=a.qd();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}h.K.xy(a,d);if(e=a.Hd.text){var f=a.Hd.size,g=a.Hd.tv,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.N[f];f++){var l;k=!0;if(g.type!=h.He){var m=x(g.connection);g.type==h.Oa?l=h.g.xml.createElement("value"):g.type==h.Ca&&(l=h.g.xml.createElement("statement"));e=g.connection.xe;!e||m&&m.Ua||l.appendChild(h.K.nt(e,c));m&&(l.appendChild(h.K.sf(m,c)),k=!1);l.setAttribute("name",g.name);k||d.appendChild(l)}}void 0!=a.Ze&&a.Ze!=a.uA&&d.setAttribute("inline",a.Ze);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.Pc()||a.Ua||d.setAttribute("deletable", +!1);a.Dc()||a.Ua||d.setAttribute("movable",!1);a.Qc()||d.setAttribute("editable",!1);if(f=u(a))l=h.g.xml.createElement("next"),l.appendChild(h.K.sf(f,c)),d.appendChild(l);e=a.V&&a.V.xe;!e||f&&f.Ua||l.appendChild(h.K.nt(e,c));return d}; +h.K.nt=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.K.Mc=function(a){a=h.g.xml.Mc(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};h.K.OG=function(a){a=h.K.Mc(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +h.K.$f=function(a){var c=h.g.xml.NB(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};h.K.IG=function(a,c){c.Rb(!1);c.clear();a=h.K.Eg(a,c);c.Rb(!0);return a}; +h.K.Eg=function(a,c){if(a instanceof h.hb){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.H&&(e=c.di());d=[];h.g.m.Lk();var f=a.childNodes.length,g=h.i.Db();g||h.i.ga(!0);c.Rb&&c.Rb(!1);var k=!0;try{for(var l=0;l=this.s.options.Rm)){a={scrollbars:!0,Nj:this.s.options.Nj,Ac:this.s,H:this.s.H,zi:this.s.options.zi,Bk:this.s.options.Bk};if(this.s.Ff){a.Va=this.s.Va==h.qg?h.lj:h.qg;if(!h.Jn)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new h.Jn(a)}else{a.Va=this.s.Va==h.pg?h.Dd:h.pg;if(!h.rg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new h.rg(a)}Ua(this.s,this.XA.bind(this))}};b=h.oo.prototype;b.nj=47;b.fl=44;b.Eh=16;b.vx=20; +b.ds=20;b.yl=10;b.io=0;b.jo=32;b.ax=.1;b.Np=!1;b.Sm=0;b.J=null;b.kn=null;b.Tp=0;b.Of=0;b.Vu=0;b.$v=0; +b.La=function(){this.J=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.J);h.g.m.L("rect",{width:this.nj,height:this.fl,y:this.Eh},c);var d=h.g.m.L("image",{width:h.Kh.width,x:-this.io,height:h.Kh.height,y:-this.jo,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.J);d.setAttributeNS(h.g.m.dd,"xlink:href",this.s.options.$m+h.Kh.url);c=h.g.m.L("clipPath",{id:"blocklyTrashLidClipPath"+a},this.J); +h.g.m.L("rect",{width:this.nj,height:this.Eh},c);this.kn=h.g.m.L("image",{width:h.Kh.width,x:-this.io,height:h.Kh.height,y:-this.jo,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.J);this.kn.setAttributeNS(h.g.m.dd,"xlink:href",this.s.options.$m+h.Kh.url);h.ra(this.J,"mouseup",this,this.click);h.Xb(d,"mouseover",this,this.OA);h.Xb(d,"mouseout",this,this.MA);this.so();return this.J}; +b.wa=function(a){0this.Sm&&1>this.Of&&(this.Tp=setTimeout(this.so.bind(this),20))};function Rb(a,c){var d=a.s.Va==h.pg||a.s.Ff&&a.s.H;a.kn.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.nj-4)+","+(a.Eh-2)+")")}b.close=function(){qa(this,!1)}; +b.click=function(){if(this.zg.length){for(var a=[],c=0,d;d=this.zg[c];c++)a[c]=h.K.$f(d);this.P.show(a)}};b.OA=function(){this.zg.length&&qa(this,!0)};b.MA=function(){qa(this,!1)}; +b.XA=function(a){if(!(0>=this.s.options.Rm)&&a.type==h.i.xw&&"shadow"!=a.pq.tagName.toLowerCase()){for(var c=a=a.pq.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.K.Mc(a);if(-1==this.zg.indexOf(a)){for(this.zg.unshift(a);this.zg.length>this.s.options.Rm;)this.zg.pop();this.Sm=this.ax;Rb(this,45*this.Sm)}}};h.Hb=Object.create(null);h.ea=function(a,c){this.D=a;this.type=c};h.ea.jl=0;h.ea.As=1;h.ea.Ds=2;h.ea.Cs=3;h.ea.ys=4;h.ea.zs=5;h.ea.Bs=6;b=h.ea.prototype;b.la=null;b.Qe=null;b.xe=null;b.qb=0;b.Ka=0; +b.Id=function(a){var c=this,d=c.D,e=a.D;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=x(c),g=c.xe;c.xe=null;if(f.Ua)g=h.K.sf(f),f.I(),f=null;else if(c.type==h.Oa){if(!f.M)throw Error("Orphan block does not have an output connection.");var k=h.ea.Tu(e,f);k&&(f.M.connect(k),f=null)}else if(c.type==h.Ca){if(!f.R)throw Error("Orphan block does not have a previous connection.");for(k=e;k.V;){var l=u(k);if(l&&!l.Ua)k=l;else{Sb(f.R,k.V)&&(k.V.connect(f.R),f=null);break}}}if(f&&(c.disconnect(), +h.i.$b)){var m=h.i.Db();setTimeout(function(){f.C&&!f.getParent()&&(h.i.ga(m),f.M?f.M.Vm(c):f.R&&f.R.Vm(c),h.i.ga(!1))},h.zn)}c.xe=g}var n;h.i.isEnabled()&&(n=new h.i.Xi(e));h.ea.Yy(c,a);e.Ki(d);n&&(n.$g(),h.i.Na(n))};b.I=function(){if(this.isConnected()){this.xe=null;var a=x(this);a.Ua?a.I():y(a)}};function C(a){return a.type==h.Oa||a.type==h.Ca}b.isConnected=function(){return!!this.la}; +function Kb(a,c){if(!c)return h.ea.Cs;if(C(a))var d=a.D,e=c.D;else e=a.D,d=c.D;return d&&d==e?h.ea.As:c.type!=h.Ih[a.type]?h.ea.Ds:d&&e&&d.C!==e.C?h.ea.zs:Sb(a,c)?d.Ua&&!e.Ua?h.ea.Bs:h.ea.jl:h.ea.ys} +function Lb(a,c){switch(Kb(a,c)){case h.ea.jl:break;case h.ea.As:throw Error("Attempted to connect a block to itself.");case h.ea.zs:throw Error("Blocks not on same workspace.");case h.ea.Ds:throw Error("Attempt to connect incompatible types.");case h.ea.Cs:throw Error("Target connection is null.");case h.ea.ys:throw Error("Connection checks failed. "+(a+" expected "+a.Qe+", found "+c.Qe));case h.ea.Bs:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.Fm=function(a){if(a.D.Kf()||Kb(this,a)!=h.ea.jl)return!1;switch(a.type){case h.Bd:return this.la||-1!=h.Oj.indexOf(a)?a=!1:a.la?(a=x(a),a=a.Kf()?!(a.R&&x(a.R)):!1):a=!0,a;case h.zd:if(a.isConnected()&&!x(a).Kf()||this.isConnected())return!1;break;case h.Oa:if(a.isConnected()&&!x(a).Dc()&&!x(a).Ua)return!1;break;case h.Ca:if(a.isConnected()&&!this.D.V&&!x(a).Ua&&x(a).V)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=h.Oj.indexOf(a)?!1:!0};b.Vm=function(){}; +b.connect=function(a){if(this.la!=a){Lb(this,a);var c=h.i.Db();c||h.i.ga(!0);C(this)?this.Id(a):a.Id(this);c||h.i.ga(!1)}};h.ea.Yy=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.la=c;c.la=a};h.ea.FB=function(a,c){for(var d=!1,e=0;ec||c>a.Ma.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new h.$c(d));if(d.D)throw Error("Field already bound to a block.");d.D=a.D;a.D.ca&&d.wa();d.name=e;d.yq&&(c=Ub(a,c,d.yq));a.Ma.splice(c,0,d);++c;d.Wq&&(c=Ub(a,c,d.Wq));a.D.ca&&(a.D.Ba(),a.D.Cc());return c}b.isVisible=function(){return this.cg}; +b.Eb=function(a){var c=[];if(this.cg==a)return c;for(var d=(this.cg=a)?"block":"none",e=0,f;f=this.Ma[e];e++)f.Eb(a);if(this.connection){if(a)c=Vb(this.connection);else if(e=this.connection,Wb(e,!0),e.la)for(e=p(x(e),!1),f=0;fa&&0<=c&&256>c&&0<=d&&256>d)?h.g.yb.Iq(a,c,d):null}; +h.g.yb.Iq=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};h.g.yb.Hu=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +h.g.yb.kA=function(a){var c=h.gx,d=255*h.hx,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.yb.Iq(Math.floor(e),Math.floor(f),Math.floor(g))}; +h.g.yb.zo=function(a,c,d){a=h.g.yb.Hu(h.g.yb.parse(a));c=h.g.yb.Hu(h.g.yb.parse(c));return h.g.yb.Iq(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.yb.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.hl=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.Ve();a.Ao[this.id]=this;this.R=this.V=this.M=null;this.N=[];this.Ze=void 0;this.disabled=!1;this.Qd="";this.contextMenu=!0;this.se=null;this.Re=[];this.St=this.fv=this.Gt=!0;this.Se=this.Ua=!1;this.zj=null;this.Hd={text:null,tv:!1,size:new h.g.Cd(160,80)};this.jw=new h.g.O(0,0);this.C=a;this.Rc=a.qe;this.H=a.H; +this.gk=!1;this.Xe=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.yi(this,d)}a.Ui.push(this);a.ff[this.type]||(a.ff[this.type]=[]);a.ff[this.type].push(this);"function"==typeof this.wa&&this.wa();this.uA=this.Ze;if(h.i.isEnabled()){(a=h.i.Db())||h.i.ga(!0);try{h.i.Na(new h.i.il(this))}finally{a||h.i.ga(!1)}}if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=typeof a)throw Error("onchange must be a function.");this.rk&& +Va(this.C,this.rk);if(this.onchange=a)this.rk=a.bind(this),Ua(this.C,this.rk)}};b=h.hl.prototype;b.data=null;b.wg="#000000";b.qt=null;b.rt=null; +b.I=function(a){if(this.C){this.rk&&Va(this.C,this.rk);h.$e&&h.navigation.gv(this);y(this,a);h.i.isEnabled()&&h.i.Na(new h.i.zw(this));h.i.disable();try{if(this.C){Oa(this.C,this);var c=this.C;c.ff[this.type].splice(c.ff[this.type].indexOf(this),1);c.ff[this.type].length||delete c.ff[this.type];delete this.C.Ao[this.id];this.C=null}h.selected==this&&(h.selected=null);for(var d=this.Re.length-1;0<=d;d--)this.Re[d].I(!1);d=0;for(var e;e=this.N[d];d++)e.I();this.N.length=0;var f=this.kd(!0);d=0;for(var g;g= +f[d];d++)g.I()}finally{h.i.enable()}}};function y(a,c){if(a.M){var d=null;a.M.isConnected()&&(d=a.M.la,a.M.disconnect());if(d&&c){a:{c=null;for(var e=0;e=d)this.wg=h.lA(d);else if(d=h.g.yb.parse(c))this.wg=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);}; +function ba(a,c){for(var d=0,e;e=a.N[d];d++)for(var f=0,g;g=e.Ma[f];f++)if(g.name==c)return g;return null}function Na(a){for(var c=0,d;d=a.N[c];c++)for(var e=0;d.Ma[e];e++);return[]}function Ma(a,c){return(a=ba(a,c))?a.getValue():null} +b.fh=function(a,c){if(a){void 0===c&&(c=null);if(!this.R){if(this.M)throw Error("Remove output connection prior to adding previous connection.");this.R=this.lk(h.Bd)}this.R.Gi(c)}else if(this.R){if(this.R.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.R.I();this.R=null}}; +b.Ji=function(a,c){if(a)void 0===c&&(c=null),this.V||(this.V=this.lk(h.Ca)),this.V.Gi(c);else if(this.V){if(this.V.isConnected())throw Error("Must disconnect next statement before removing connection.");this.V.I();this.V=null}}; +b.Oq=function(a,c){if(a){void 0===c&&(c=null);if(!this.M){if(this.R)throw Error("Remove previous connection prior to adding output connection.");this.M=this.lk(h.zd)}this.M.Gi(c)}else if(this.M){if(this.M.isConnected())throw Error("Must disconnect output value before removing connection.");this.M.I();this.M=null}};b.Ii=function(a){this.Ze!=a&&(h.i.Na(new h.i.uh(this,"inline",null,this.Ze,a)),this.Ze=a)}; +function Tb(a){if(void 0!=a.Ze)return a.Ze;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function Zb(a,c){return a.Ne(h.He,c||"")} +function $b(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.Xe&&(a.Xe=c.style.Xe,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.zp().Gy[e];if(f)a.qt=f.colourSecondary,a.rt=f.colourTertiary,a.Xe=f.Xe,a.ud(f.colourPrimary);else throw Error("Invalid style name: "+e);}catch(B){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.ud(e)}catch(B){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.RB(c["message"+e]),m=[],n=0,q=[],r=0;r=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++;q.push(g[t-1])}else(t=t.trim())&&q.push(t)}if(n!=g.length)throw Error('Block "'+f.type+'": Message does not reference all '+g.length+" arg(s).");q.length&&("string"==typeof q[q.length-1]||h.g.Da.startsWith(q[q.length-1].type,"field_"))&&(r={type:"input_dummy"},k&&(r.align=k),q.push(r));k={LEFT:h.vn,RIGHT:h.pr,CENTRE:h.nr};g=[];for(r=0;rc?!1:h.Ke.w.Fm.call(this,a)};b.Vm=function(a){Mb(this,a)};b.Wo=function(a,c){h.Ke.w.Wo.call(this,a,c);a.ca&&a.Ba();c.ca&&(Pb(c),c.Ba())}; +b.Hq=function(){var a=this.D,c=this.xe;if(a.C&&c&&h.i.$b){h.Ke.w.Hq.call(this);c=x(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.mi();c.Ba(!1);a.ca&&a.Ba()}};b.hv=function(a){return ic(this.Dt,this,a)};b.Id=function(a){h.Ke.w.Id.call(this,a);var c=this.D;a=a.D;c.ca&&Pb(c);a.ca&&Pb(a);c.ca&&a.ca&&(this.type==h.Ca||this.type==h.Bd?a.Ba():c.Ba())};b.mv=function(){this.isConnected()&&!Sb(this,this.la)&&(y(C(this)?x(this):this.D),this.D.Cc())};h.Je=function(a){this.ka=a};b=h.Je.prototype;b.ot=!0;b.Gl=17;b.ug=null;b.Am=null; +function jc(a){if(!a.pe){a.pe=h.g.m.L("g",{"class":"blocklyIconGroup"},null);a.ka.Rc&&h.g.m.Ib(a.pe,"blocklyIconGroupReadonly");var c=a.pe;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"},c);h.g.m.L("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},c);h.g.m.L("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},c);a.ka.Y().appendChild(a.pe);h.ra(a.pe,"mouseup",a,a.mA);a.Xk()}} +b.I=function(){h.g.m.removeNode(this.pe);this.pe=null;this.Eb(!1);this.ka=null};b.Xk=function(){};b.isVisible=function(){return!!this.ug};b.mA=function(a){this.ka.C.yc()||this.ka.Rc||h.g.ui(a)||this.Eb(!this.isVisible())};b.Ae=function(){this.isVisible()&&this.ug.ud(this.ka.wg)};function na(a,c){a.Am=c;a.isVisible()&&(a=a.ug,a.xb=c,a.Eq&&Wa(a))}function kc(a){var c=a.ka.Ha(),d=h.g.ld(a.pe);c=new h.g.O(c.x+d.x+a.Gl/2,c.y+d.y+a.Gl/2);h.g.O.me(a.Am,c)||na(a,c)};h.ee=function(a){h.ee.w.constructor.call(this,a);jc(this);this.Si={}};h.g.object.S(h.ee,h.Je);h.ee.prototype.ot=!1;h.ee.OB=function(a){var c=h.g.m.L("text",{"class":"blocklyText blocklyBubbleText",y:h.oa.Td},null);a=a.split("\n");for(var d=0;d=a.zb.length)return-1;for(var e=c.Ka,f=d;0<=f&&a.zb[f].Ka==e;){if(a.zb[f]==c)return f;f--}for(;dc.Ka)e=f;else{d=f;break}}return d}function bc(a,c){if(!c.Gf)throw Error("Connection not in database.");var d=pc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Gf=!1;a.zb.splice(d,1)} +function ic(a,c,d){function e(n){var q=g-f[n].qb,r=k-f[n].Ka;Math.sqrt(q*q+r*r)<=d&&m.push(f[n]);return r document.");}else a=null;return a};h.Jc=function(a,c){h.Jc.w.constructor.call(this,a,c);this.Jm=!1;this.ed={};this.Tv=this.xk=0;this.qq=null};h.g.object.S(h.Jc,h.Ah);h.Jc.oy=5;h.Jc.py=6;b=h.Jc.prototype;b.$o=function(a){h.Jc.w.$o.call(this,a);!this.Hm&&h.Touch.Mm(a)&&rc(this,a)};b.Rh=function(a){this.qq=h.ra(document,"mousedown",null,this.fA.bind(this),!0);this.Wm=h.ra(document,"mousemove",null,this.Uj.bind(this),!0);this.Xm=h.ra(document,"mouseup",null,this.xm.bind(this),!0);a.preventDefault();a.stopPropagation()}; +b.fA=function(a){!this.yc()&&h.Touch.Mm(a)&&(rc(this,a),this.Jm&&h.Pf())};b.Uj=function(a){if(this.yc())h.Touch.Sq(a)&&h.Jc.w.Uj.call(this,a);else if(this.Jm){if(h.Touch.Mm(a)){this.ed[h.Touch.vm(a)]=sc(this,a);var c=Object.keys(this.ed);if(2==c.length){c=h.g.O.Pt(this.ed[c[0]],this.ed[c[1]])/this.Tv;if(0this.xk){var d=c-this.xk;d=0Object.keys(this.ed).length&&(this.ed={},this.xk=0)}!this.Jm||this.yc()?h.Touch.Sq(a)&&h.Jc.w.xm.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){h.Jc.w.I.call(this);this.qq&&h.fb(this.qq)};function rc(a,c){a.ed[h.Touch.vm(c)]=sc(a,c);var d=Object.keys(a.ed);2==d.length&&(a.Tv=h.g.O.Pt(a.ed[d[0]],a.ed[d[1]]),a.Jm=!0,c.preventDefault())} +function sc(a,c){return a.Fb?new h.g.O(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};h.Us=function(a){this.uq=a;this.jj=Object.create(null)};b=h.Us.prototype;b.Qp=null;b.I=function(){this.jj=this.uq=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=Ra(a)))if(a.Lb&&a.Lb.cancel(),"comment"==c.tagName.toLowerCase()){h.i.disable();try{h.Oh.setValue(c.textContent);var d=void 0;var e=parseInt(c.getAttribute("x"),10),f=parseInt(c.getAttribute("y"),10);isNaN(e)||isNaN(f)||(a.H&&(e=-e),d.moveBy(e+50,f+50))}finally{h.i.enable()}d.select()}else a:{h.i.disable();try{var g=h.K.Zh(c,a),k=a.tb.mb;if(h.$e&&k){h.navigation.Mu(g,k.ba);break a}var l=parseInt(c.getAttribute("x"),10),m= +parseInt(c.getAttribute("y"),10);if(!isNaN(l)&&!isNaN(m)){a.H&&(l=-l);do{c=!1;var n=F(a,!1);d=0;for(var q;q=n[d];d++){var r=q.Ha();if(1>=Math.abs(l-r.x)&&1>=Math.abs(m-r.y)){c=!0;break}}if(!c){var t=g.kd(!1);d=0;for(var B;B=t[d];d++)if(B.closest(h.ec,new h.g.O(l,m)).connection){c=!0;break}}c&&(l=a.H?l-h.ec:l+h.ec,m+=2*h.ec)}while(c);g.moveBy(l,m)}}finally{h.i.enable()}h.i.isEnabled()&&!g.Ua&&h.i.Na(new h.i.il(g));g.select()}}function Ac(a){(a=a.qe?a.lh:a)&&!a.Lb&&a.sa&&a.sa.P&&a.sa.oH()} +b.ah=function(a,c){h.Sa.w.ah.call(this,a,c);Ac(this)};b.Xh=function(a){h.Sa.w.Xh.call(this,a);Ac(this)};b.Jd=function(a,c,d){a=h.Sa.w.Jd.call(this,a,c,d);Ac(this);return a};function uc(a){a.It=a.bc&&a.J.parentNode?a.bc.rm():null;a.Ht=a.P?a.P.rm():a.sa?a.sa.rm():null}function oa(a,c){return a.It&&a.It.contains(c.clientX,c.clientY)?h.En:a.Ht&&a.Ht.contains(c.clientX,c.clientY)?h.Kr:h.Jr}b.Sf=function(a){var c=this.Af(a);c&&jb(c,a,this)}; +b.Uq=function(a,c){a=h.g.qk(a,z(this),Ha(this));a.x/=this.scale;a.y/=this.scale;this.Qt=h.g.O.Mj(c,a)};b.yc=function(){return null!=this.Lb&&this.Lb.yc()};function Bc(a){return a.options.Ob&&a.options.Ob.scrollbars||a.options.Ob&&a.options.Ob.qh||a.options.Ob&&a.options.Ob.xf||a.options.gb&&a.options.gb.controls||a.options.gb&&a.options.gb.qh} +b.Dc=function(){return this.options.Ob&&this.options.Ob.scrollbars||this.options.Ob&&this.options.Ob.qh||this.options.Ob&&this.options.Ob.xf||this.options.gb&&this.options.gb.qh}; +b.gB=function(a){if(h.Ah.Hp())a.preventDefault(),a.stopPropagation();else{var c=this.options.gb&&this.options.gb.qh,d=this.options.Ob&&this.options.Ob.qh;if(c||d){var e=h.g.pu(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.qk(a,z(this),Ha(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}}; +function Ob(a){var c=G(a,!1);a=Pa(a,!1);c=c.concat(a);if(!c.length)return new h.g.Rect(0,0,0,0);a=nc(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.Ry=function(){this.Rb(!1);h.i.ga(!0);for(var a=G(this,!0),c=0,d=0,e;e=a[d];d++)if(e.Dc()){var f=e.Ha();e.moveBy(-f.x,c-f.y);mc(e);c=e.Ha().y+A(e).height+h.ma.hs}h.i.ga(!1);this.Rb(!0)}; +b.Hk=function(a){function c(B){if(B.Pc())t=t.concat(p(B,!1));else{B=Qa(B,!1);for(var R=0;Rt.length?d():h.confirm(h.h.DELETE_ALL_BLOCKS.replace("%1",t.length),function(B){B&&d()})}};e.push(l);this.ut&&this.ut(e);h.ua.show(a,e,this.H)}};function Ga(a){if(a.options.Ac)Ga(a.options.Ac);else{h.kk=a;document.activeElement&&document.activeElement.blur();try{z(a).focus()}catch(c){try{z(a).parentNode.setActive()}catch(d){z(a).parentNode.focus()}}}} +b.zoom=function(a,c,d){if(!this.qe&&!this.ri){d=Math.pow(this.options.gb.wB,d);var e=this.scale*d;if(this.scale!=e){e>this.options.gb.nk?d=this.options.gb.nk/this.scale:ethis.options.gb.nk?a=this.options.gb.nk:this.options.gb.pk&&af?h.W.wk(a,0,d.height+f):h.W.wk(a,f,d.height)};h.W.Jy=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.W.Ky=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};h.rg=function(a){a.vc=this.um.bind(this);a.eh=this.Nv.bind(this);h.rg.w.constructor.call(this,a);this.ki=!1};h.g.object.S(h.rg,h.dj);b=h.rg.prototype;b.um=function(){if(!this.isVisible())return null;try{var a=this.s.$a.getBBox()}catch(f){a={height:0,y:0,width:0,x:0}}var c=this.eo,d=this.Zb-2*this.eo,e=this.Xa;this.H||(e-=this.eo);return{vb:d,lb:e,gd:a.height*this.s.scale+2*this.kf,ie:a.width*this.s.scale+2*this.kf,Bb:-this.s.scrollY+a.y,wb:-this.s.scrollX,ic:a.y,tc:a.x,rc:c,fc:0}}; +b.Nv=function(a){var c=this.um();c&&("number"==typeof a.y&&(this.s.scrollY=-c.gd*a.y),this.s.translate(this.s.scrollX+c.fc,this.s.scrollY+c.rc))}; +b.position=function(){if(this.isVisible()){var a=this.kb.vc();if(a){this.Zb=a.vb;var c=this.Xa-this.ab,d=a.vb-2*this.ab,e=this.Ti==h.pg,f=c+this.ab;f=["M "+(e?f:0)+",0"];f.push("h",e?-c:c);f.push("a",this.ab,this.ab,0,0,e?0:1,e?-this.ab:this.ab,this.ab);f.push("v",Math.max(0,d));f.push("a",this.ab,this.ab,0,0,e?0:1,e?this.ab:-this.ab,this.ab);f.push("h",e?c:-c);f.push("z");this.Sb.setAttribute("d",f.join(" "));c=this.Zb;a=this.kb.Va==this.Ti?a.Yv?this.Ti==h.Dd?a.Yv:a.lb-this.Xa:this.Ti==h.Dd?0:a.lb: +this.Ti==h.Dd?0:a.lb+a.fc-this.Xa;this.J.setAttribute("width",this.Xa);this.J.setAttribute("height",c);"svg"==this.J.tagName?h.g.m.Dk(this.J,"translate("+a+"px,0px)"):this.J.setAttribute("transform","translate("+a+",0)");this.Qb&&(this.Qb.rq=new h.g.O(a,0),this.Qb.resize(),za(this.Qb,this.Qb.te.x,this.Qb.te.y))}}};b.YB=function(a){var c=h.g.pu(a);if(c.y){var d=this.um();c=d.Bb-d.ic+c.y;c=Math.min(c,d.gd-d.vb);c=Math.max(c,0);this.Qb.set(c);h.W.va()}a.preventDefault();a.stopPropagation()}; +function Ec(a,c,d){a.s.scale=a.kb.scale;for(var e=a.kf,f=a.H?e:e+a.Qi,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.Rc=!0;k.Ba();n=k.Y();l=A(k);m=k.M?f-a.Qi:f;k.moveBy(m,e);var q=a,r=k,t=g;m=h.g.m.L("rect",{"fill-opacity":0,x:a.H?m-l.width:m,y:e,height:l.height,width:l.width},null);m.Qd=r;h.F.Rh(m);q.s.$a.insertBefore(m,r.Y());r.Zt=m;q.Qm[t]=m;q=a;q.zc.push(h.ra(n,"mousedown",null,Fc(q,k)));q.zc.push(h.ra(m,"mousedown",null,Fc(q,k)));q.zc.push(h.Xb(n,"mouseover", +k,k.Pl));q.zc.push(h.Xb(n,"mouseout",k,k.Ak));q.zc.push(h.Xb(m,"mouseover",k,k.Pl));q.zc.push(h.Xb(m,"mouseout",k,k.Ak));e+=l.height+d[g]}else"button"==k.type&&(l=a,m=k.button,n=f,q=e,r=m.La(),m.moveTo(n,q),m.show(),l.zc.push(h.ra(r,"mousedown",l,l.Sf)),l.uj.push(m),e+=k.button.height+d[g])} +b.rm=function(){if(!this.J)return null;var a=this.J.getBoundingClientRect(),c=a.left;if(this.Ti==h.Dd)return new h.g.Rect(-1E9,1E9,-1E9,c+a.width);h.g.userAgent.$w&&this.kb&&this.kb.ri&&(a=this.kb.J.getBoundingClientRect().x,10>Math.abs(a-c)&&(c+=this.jH*this.kb.options.Ac.scale));return new h.g.Rect(-1E9,1E9,c,1E9)};h.Cr=function(a){this.Dj=a;this.La()};b=h.Cr.prototype;b.Ya=null;b.Kd=null;b.Dj=null;b.Yf=1;b.Nk=null;b.La=function(){this.Ya||(this.Ya=h.g.m.L("svg",{xmlns:h.g.m.qc,"xmlns:html":h.g.m.Hn,"xmlns:xlink":h.g.m.dd,version:"1.1","class":"blocklyBlockDragSurface"},this.Dj),this.Kd=h.g.m.L("g",{},this.Ya))};function bb(a,c){if(a.Kd.childNodes.length)throw Error("Already dragging a block.");a.Kd.appendChild(c);a.Ya.style.display="block";a.Nk=new h.g.O(0,0)} +b.mh=function(a,c){this.Nk=new h.g.O(a*this.Yf,c*this.Yf);a=this.Nk.x;c=this.Nk.y;a=a.toFixed(0);c=c.toFixed(0);this.Ya.style.display="block";h.g.m.Dk(this.Ya,"translate3d("+a+"px, "+c+"px, 0px)")};b.wp=function(){var a=h.g.ld(this.Ya);return new h.g.O(a.x/this.Yf,a.y/this.Yf)};b.Db=function(){return this.Kd}; +b.Tl=function(a){a?a.appendChild(this.Kd.firstChild):this.Kd.removeChild(this.Kd.firstChild);this.Ya.style.display="none";if(this.Kd.childNodes.length)throw Error("Drag group was not cleared.");this.Nk=null};h.Xc={};h.Xc.Ip=!1;h.Xc.register=function(a){if(h.Xc.Ip)throw Error("CSS already injected");Array.prototype.push.apply(h.Xc.Cn,a);a.length=0};h.Xc.Hf=function(a,c){if(!h.Xc.Ip){h.Xc.Ip=!0;var d=h.Xc.Cn.join("\n");h.Xc.Cn.length=0;a&&(a=c.replace(/[\\/]$/,""),d=d.replace(/<<>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};h.Xc.Lq=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +h.Xc.Cn=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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.A=function(){};h.A.Yc=null;h.A.Do=null;h.A.lc=null;h.A.cn=null;h.A.dl=16;h.A.Br=1;h.A.vr=12;h.A.us=16;h.A.xn=.25;h.A.Hr="#dadce0";h.A.Ir="#fff";h.A.to=null;h.A.Yg=null; +h.A.La=function(){if(!h.A.Yc){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=h.A.Ir;a.style.borderColor=h.A.Hr;document.body.appendChild(a);h.A.Yc=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);h.A.wf=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);h.A.Fd=c;h.A.Yc.style.opacity=0;h.A.Yc.style.transition="transform "+h.A.xn+"s, opacity "+h.A.xn+"s";a.addEventListener("focusin", +function(){h.g.m.Ib(a,"focused")});a.addEventListener("focusout",function(){h.g.m.Sc(a,"focused")})}};h.A.Jv=function(a){h.A.Do=a};h.A.Rz=function(){return h.A.wf};h.A.Sy=function(){h.A.wf.innerHTML="";h.A.wf.style.width=""};h.A.ud=function(a){h.A.Yc.style.backgroundColor=a;h.A.Yc.style.borderColor=void 0};h.A.yH=function(a){h.A.Yc.setAttribute("data-category",a)}; +h.A.BH=function(a,c,d,e){var f=c.C.scale,g=c.width,k=c.height;g*=f;k*=f;f=c.Y().getBoundingClientRect();g=f.left+g/2;k=f.top+k;f=f.top;e&&(f+=e);h.A.Jv(z(c.C).parentNode);return h.A.show(a,c.H,g,k,g,f,d)};h.A.DB=function(a,c){var d=a.Y().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var g=a.D;h.A.cn=!0;h.A.Jv(z(g.C).parentNode);h.A.show(a,g.H,e,f,e,d,c)}; +h.A.show=function(a,c,d,e,f,g,k){h.A.lc=a;h.A.Yg=k||null;a=h.A.ou(d,e,f,g);a.vo?(h.A.Fd.style.display="",h.A.Fd.style.transform="translate("+a.rj+"px,"+a.ct+"px) rotate(45deg)",h.A.Fd.setAttribute("class",a.uo?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):h.A.Fd.style.display="none";h.A.Yc.style.direction=c?"rtl":"ltr";h.A.wk(a.Bm,a.Cm,a.nm,a.om);return a.uo}; +h.A.Kz=function(){var a=h.A.Do.getBoundingClientRect(),c=h.g.style.We(h.A.Do);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};h.A.ou=function(a,c,d,e){var f=h.A.Kz(),g=h.g.style.We(h.A.Yc);return c+g.heightf.top?h.A.mu(d,e,f,g):c+g.heightdocument.documentElement.clientTop?h.A.mu(d,e,f,g):h.A.Wz(a,f,g)}; +h.A.nu=function(a,c,d,e){a=h.A.up(a,d.left,d.right,e.width);return{Bm:a.Yh,Cm:c,nm:a.Yh,om:c+h.A.us,rj:a.rj,ct:-(h.A.dl/2+h.A.Br),uo:!0,vo:!0}};h.A.mu=function(a,c,d,e){a=h.A.up(a,d.left,d.right,e.width);return{Bm:a.Yh,Cm:c-e.height,nm:a.Yh,om:c-e.height-h.A.us,rj:a.rj,ct:e.height-2*h.A.Br-h.A.dl/2,uo:!1,vo:!0}};h.A.Wz=function(a,c,d){a=h.A.up(a,c.left,c.right,d.width);return{Bm:a.Yh,Cm:0,nm:a.Yh,om:0,vo:!1}}; +h.A.up=function(a,c,d,e){var f=a;a=h.g.pd.wj(c,a-e/2,d-e);f-=h.A.dl/2;c=h.g.pd.wj(h.A.vr,f-a,e-h.A.vr-h.A.dl);return{rj:c,Yh:a}};h.A.isVisible=function(){return!!h.A.lc};h.A.Wj=function(a,c){h.A.lc===a&&(c?h.A.Fp():h.A.va())};h.A.va=function(){var a=h.A.Yc;a.style.transform="translate(0, 0)";a.style.opacity=0;h.A.to=setTimeout(function(){h.A.Fp()},1E3*h.A.xn);h.A.Yg&&(h.A.Yg(),h.A.Yg=null)}; +h.A.Fp=function(){if(h.A.isVisible()){h.A.to&&clearTimeout(h.A.to);var a=h.A.Yc;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=h.A.Ir;a.style.borderColor=h.A.Hr;h.A.Yg&&(h.A.Yg(),h.A.Yg=null);h.A.Sy();h.A.lc=null}}; +h.A.wk=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=h.A.Yc;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.A.sH=function(){if(h.A.lc){var a=h.A.lc.D,c=a.C.scale,d=h.A.cn?h.A.lc.ub.width:a.width,e=h.A.cn?h.A.lc.ub.height:a.height;d*=c;e*=c;a=h.A.cn?h.A.lc.jd.getBoundingClientRect():a.Y().getBoundingClientRect();d=a.left+d/2;e=h.A.ou(d,a.top+e,d,a.top);h.A.wk(e.Bm,e.Cm,e.nm,e.om)}else h.A.va()};h.Hf=function(a,c){h.My();"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.ad(c||{});var d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);a=h.Fj(d,c);var e=new h.Cr(d);d=new h.Vs(d);d=h.bz(a,c,e,d);h.Wa.Ra.BB(c.Ra);h.rA(d);h.kk=d;h.Rk(d);return d}; +h.Fj=function(a,c){a.setAttribute("dir","LTR");h.nc.Ft=c.H;h.Xc.Hf(c.gA,c.$m);a=h.g.m.L("svg",{xmlns:h.g.m.qc,"xmlns:html":h.g.m.Hn,"xmlns:xlink":h.g.m.dd,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.Tt=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.Nj=f.id; +c.yu=h.jg.La(e,c.xu,d);return a}; +h.bz=function(a,c,d,e){c.Ac=null;var f=new h.Sa(c,d,e);f.scale=c.gb.KB;a.appendChild(f.La("blocklyMainBackground"));!c.Bu&&c.Op&&(d=xc(f),h.g.m.ni(d,a));c.Fu&&vc(f);c.gb&&c.gb.controls&&wc(f);f.Tb.subscribe(a,"workspace","background-color");f.translate(0,0);h.kk=f;c.readOnly||f.Dc()||Ua(f,function(g){if(!f.yc()&&!f.Dc()&&-1!=h.i.yw.indexOf(g.type)){var k=Object.create(null),l=f.vc(),m=f.scale;k.H=f.H;k.wb=l.wb/m;k.Bb=l.Bb/m;k.ew=(l.wb+l.lb)/m;k.dw=(l.Bb+l.vb)/m;Bc(f)?(l=Ob(f),k.tc=l.left,k.ic=l.top, +k.At=l.right,k.yt=l.bottom):(k.tc=l.tc/m,k.ic=l.ic/m,k.At=(l.tc+l.ie)/m,k.yt=(l.ic+l.gd)/m);if(k.ick.dw||k.tck.ew){l=null;g&&(l=h.i.Db(),h.i.ga(g.group));switch(g.type){case h.i.xr:case h.i.yr:var n=v(f,g.gc);n=D(n);break;case h.i.kl:case h.i.ll:n=f.Xl[g.ge]||null}if(n){m=nc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var q=k.Bb,r=k.dw-m.height;r=Math.max(q,r);q=h.g.pd.wj(q,m.top,r)-m.top;r=k.wb;var t=k.ew-m.width;k.H?r=Math.min(t,r):t=Math.max(r,t);n.moveBy(h.g.pd.wj(r, +m.left,t)-m.left,q)}g&&(g.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&h.i.ga(l))}}});h.Rk(f);h.W.La();h.A.La();h.F.La();return f}; +h.rA=function(a){var c=a.options,d=z(a);h.ra(d.parentNode,"contextmenu",null,function(e){h.g.Km(e)||e.preventDefault()});d=h.ra(window,"resize",null,function(){h.jc(!0);h.Rk(a)});a.fn=d;h.Hf.By();c.Op&&(a.sa?a.sa.wa(a):a.P&&(a.P.wa(a),a.P.show(c.Op.childNodes),a.P.Qb.set(0)));d=h.za.ac;c.Fu&&(d=a.bc.wa(d));c.gb&&c.gb.controls&&a.sh.wa(d);c.Ob&&c.Ob.scrollbars?(a.pb=new h.Lh(a),a.pb.resize()):a.eh({x:.5,y:.5});c.iA&&h.Hf.FA(c.$m,a)}; +h.Hf.By=function(){h.qz||(h.ra(document,"scroll",null,function(){for(var a=h.hb.getAll(),c=0,d;d=a[c];c++)d.Yk&&d.Yk()}),h.ra(document,"keydown",null,h.ZA),h.Xb(document,"touchend",null,h.Pf),h.Xb(document,"touchcancel",null,h.Pf),h.g.userAgent.gj&&h.ra(window,"orientationchange",document,function(){h.Rk(h.Za())}));h.qz=!0}; +h.Hf.FA=function(a,c){function d(){for(;f.length;)h.fb(f.pop());e.preload()}var e=c.Bc;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.ra(document,"mousemove",null,d,!0));f.push(h.ra(document,"touchstart",null,d,!0))};h.yd=function(a,c){this.cw=c||"";this.Cv=Object.create(null);if(a)for(a=a.split(","),c=0;c1'), +e.appendChild(d),c.push(e));if(h.Hb.variables_get){a.sort(h.Ol.Vy);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.op(f)),c.push(e)}}return c}; +h.Z.Gz=function(a){a=a.yf();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var g=!1,k=0;kk[0]?1:g[0]=a.options.length&&(a.style.display="none")}for(d= +1;10>=d;d++)a=document.getElementById("level"+d),c=!!Nc(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(Oc,1)}function Nc(a){var c=Pc;try{var d=window.localStorage[c+a]}catch(e){}return d}function L(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 Qc(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 Oc(){if(!Kc){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")}};h.g.u={};h.g.u.Aa=function(a,c){return" "+a+","+c+" "};h.g.u.curve=function(a,c){return" "+a+c.join("")};h.g.u.moveTo=function(a,c){return" M "+a+","+c+" "};h.g.u.moveBy=function(a,c){return" m "+a+","+c+" "};h.g.u.lineTo=function(a,c){return" l "+a+","+c+" "};h.g.u.line=function(a){return" l"+a.join("")};h.g.u.T=function(a,c){return" "+a+" "+c+" "};h.g.u.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};h.j.gg=function(){this.Zd=0;this.Qx=3;this.Yd=5;this.gs=8;this.pc=10;this.Ks=this.Yd;this.lo=15;this.kj=5;this.rf=8;this.Gx=15;this.Fx=4;this.Cx=12;this.Qw=16;this.ab=8;this.Al=15;this.Vx=0;this.Wx=20;this.ww=4;this.Tx=15;this.Ux=100;this.Sx=15;this.Rn=24;this.Sw=14.5;this.Rw=this.lo+11;this.Uw=2;this.Tw=this.Rn;this.Gs=h.g.u.moveBy(0,0);this.nx=12;this.ox=6};b=h.j.gg.prototype; +b.wa=function(){this.Dh=this.Yp();this.Gh=this.Zp();this.Le=this.aq();this.mg=this.$p();var a=this.ab,c=h.g.u.arc("a","0 0,0",a,h.g.u.Aa(-a,a)),d=h.g.u.arc("a","0 0,0",a,h.g.u.Aa(a,a));this.fj={width:a,height:a,vq:c,Zm:d};c=this.ab;a=h.g.u.moveBy(0,c)+h.g.u.arc("a","0 0,1",c,h.g.u.Aa(c,-c));c=h.g.u.arc("a","0 0,1",c,h.g.u.Aa(-c,-c));this.ts={er:a,Co:c}};b.Yp=function(){var a=this.nx,c=this.ox,d=h.g.u.line([h.g.u.Aa(6,3),h.g.u.Aa(-12,6),h.g.u.Aa(6,3)]);return{height:a,width:c,path:d}}; +b.aq=function(){var a=this.Tx,c=this.Ux,d=h.g.u.curve("c",[h.g.u.Aa(30,-a),h.g.u.Aa(70,-a),h.g.u.Aa(c,0)]);return{height:a,width:c,path:d}};b.$p=function(){function a(g){g=g?-1:1;var k=-g,l=d/2,m=h.g.u.Aa(c,g*l);return h.g.u.curve("c",[h.g.u.Aa(0,g*(l+2.5)),h.g.u.Aa(-c,k*(l+.5)),h.g.u.Aa(-c,g*l)])+h.g.u.curve("s",[h.g.u.Aa(c,2.5*k),m])}var c=this.rf,d=this.lo,e=a(!0),f=a(!1);return{width:c,height:d,sd:f,vk:e}}; +b.Zp=function(){function a(k){return h.g.u.line([h.g.u.Aa(k*e,d),h.g.u.Aa(3*k,0),h.g.u.Aa(k*e,-d)])}var c=this.Gx,d=this.Fx,e=(c-3)/2,f=a(1),g=a(-1);return{width:c,height:d,Vf:f,rv:g}};h.j.o={NONE:0,Zc:1,Pr:2,Rr:4,ho:8,wr:16,Wr:32,Or:64,Ie:128,Ur:256,Hs:512,Ew:1024,Wn:2048,Sn:4096,Jx:8192,Dn:16384,On:32768,Nn:65536,$n:131072,Zn:262144,$r:524288,bo:1048576,no:2097152,yn:4194304,Vr:8388608};h.j.o.OD=h.j.o.On|h.j.o.Nn;h.j.o.GF=h.j.o.$n|h.j.o.Zn;h.j.o.lq=16777216;h.j.o.jb=function(){h.j.o.hasOwnProperty(void 0)||(h.j.o[void 0]=h.j.o.lq,h.j.o.lq<<=1);return h.j.o[void 0]};h.j.o.fk=function(a){return a.type&h.j.o.Zc};h.j.o.Pg=function(a){return a.type&h.j.o.Pr}; +h.j.o.pi=function(a){return a.type&h.j.o.Rr};h.j.o.Nd=function(a){return a.type&h.j.o.ho};h.j.o.cH=function(a){return a.type&h.j.o.Wr};h.j.o.Md=function(a){return a.type&h.j.o.Ie};h.j.o.ek=function(a){return a.type&h.j.o.Or};h.j.o.Jf=function(a){return a.type&h.j.o.Ur};h.j.o.ik=function(a){return a.type&h.j.o.Hs};h.j.o.ti=function(a){return a.type&h.j.o.Wn};h.j.o.Mf=function(a){return a.type&h.j.o.Sn};h.j.o.BA=function(a){return a.type&(h.j.o.Wn|h.j.o.Sn)};h.j.o.Lf=function(a){return a.type&h.j.o.Nn}; +h.j.o.eH=function(a){return a.type&h.j.o.Zn};h.j.o.hk=function(a){return a.type&h.j.o.On};h.j.o.fH=function(a){return a.type&h.j.o.$n};h.j.o.bH=function(a){return a.type&h.j.o.Dn};h.j.o.Qu=function(a){return a.type&h.j.o.$r};h.j.o.gH=function(a){return a.type&h.j.o.bo};h.j.o.aH=function(a){return a.type&h.j.o.wr};h.j.o.Lm=function(a){return a.type&h.j.o.no};h.j.o.Em=function(a){return a.type&h.j.o.yn};h.j.o.hH=function(a){return a.type&(h.j.o.no|h.j.o.yn)};h.j.o.dH=function(a){return a.type&h.j.o.Vr};h.j.mf=function(a){this.height=this.width=0;this.type=h.j.o.NONE;this.tf=this.xa=0;this.v=a;this.rd=this.v.Al};h.j.ea=function(a,c){h.j.ea.w.constructor.call(this,a);this.Mo=c;a:switch(a=this.v,c.type){case h.Oa:case h.zd:c=a.mg;break a;case h.Bd:case h.Ca:c=a.Gh;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=h.j.o.Ew};h.g.object.S(h.j.ea,h.j.mf);h.j.Vn=function(a,c){h.j.Vn.w.constructor.call(this,a,c);this.type|=h.j.o.Jx;this.height=this.shape.height;this.width=this.shape.width;this.fd=this.v.kj;this.Uc=this.width};h.g.object.S(h.j.Vn,h.j.ea); +h.j.Xn=function(a,c){h.j.Xn.w.constructor.call(this,a,c);this.type|=h.j.o.Wn;this.height=this.shape.height;this.width=this.shape.width};h.g.object.S(h.j.Xn,h.j.ea);h.j.Tn=function(a,c){h.j.Tn.w.constructor.call(this,a,c);this.type|=h.j.o.Sn;this.height=this.shape.height;this.width=this.shape.width};h.g.object.S(h.j.Tn,h.j.ea);h.j.hj=function(a,c){h.j.hj.w.constructor.call(this,a,c.connection);this.type|=h.j.o.Ie;this.input=c;this.align=c.align;(this.xg=c.connection&&x(c.connection)?x(c.connection):null)?(a=A(this.xg),this.Bj=a.width,this.Yl=a.height):this.Yl=this.Bj=0;this.connection=c.connection;this.fd=0};h.g.object.S(h.j.hj,h.j.ea); +h.j.jf=function(a,c){h.j.jf.w.constructor.call(this,a,c);this.type|=h.j.o.Ur;this.xg?(this.width=this.Bj,this.height=this.Yl):(this.height=this.v.Rw,this.width=this.shape.width+this.v.Sw);this.fd=this.v.kj;this.Cj=this.shape.height;this.vf=this.shape.width};h.g.object.S(h.j.jf,h.j.hj);h.j.qf=function(a,c){h.j.qf.w.constructor.call(this,a,c);this.type|=h.j.o.Hs;this.height=this.xg?this.Yl+this.v.Vx:this.v.Tw;this.width=this.v.Al+this.shape.width};h.g.object.S(h.j.qf,h.j.hj); +h.j.ul=function(a,c){h.j.ul.w.constructor.call(this,a,c);this.type|=h.j.o.Or;this.height=this.xg?this.Yl-2*this.v.kj:this.shape.height;this.width=this.shape.width+this.v.Uw;this.fd=this.v.kj;this.Cj=this.shape.height;this.vf=this.shape.width};h.g.object.S(h.j.ul,h.j.hj);h.j.Je=function(a,c){h.j.Je.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=h.j.o.Rr;a=new h.g.Cd(h.Je.prototype.Gl,h.Je.prototype.Gl-2);this.height=a.height;this.width=a.width};h.g.object.S(h.j.Je,h.j.mf);h.j.Mn=function(a){h.j.Mn.w.constructor.call(this,a);this.type|=h.j.o.$r;this.height=this.v.Dh.height;this.width=this.v.Dh.width};h.g.object.S(h.j.Mn,h.j.mf); +h.j.Ea=function(a,c){h.j.Ea.w.constructor.call(this,a);this.Wt=c;this.Qc=c.Wd&&!!c.D&&c.D.Qc();this.Cz=c.lu();this.type|=h.j.o.Zc;a=this.Wt.We();this.height=a.height;this.width=a.width};h.g.object.S(h.j.Ea,h.j.mf);h.j.In=function(a){h.j.In.w.constructor.call(this,a);this.type|=h.j.o.Pr;this.height=this.v.Le.height;this.width=this.v.Le.width;this.Ph=this.height};h.g.object.S(h.j.In,h.j.mf); +h.j.Ml=function(a,c){h.j.Ml.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.j.o.$n:h.j.o.On)|h.j.o.Dn;this.width=this.height=this.v.Zd};h.g.object.S(h.j.Ml,h.j.mf);h.j.Fl=function(a,c){h.j.Fl.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.j.o.Zn:h.j.o.Nn)|h.j.o.Dn;this.width=this.v.ab;this.height=this.v.ab/2};h.g.object.S(h.j.Fl,h.j.mf);h.j.Bh=function(a,c){h.j.Bh.w.constructor.call(this,a);this.type=this.type|h.j.o.ho|h.j.o.Wr;this.width=c;this.height=this.v.Sx};h.g.object.S(h.j.Bh,h.j.mf);h.j.og=function(a){this.type=h.j.o.bo;this.elements=[];this.xa=this.Vb=this.Ce=this.minWidth=this.minHeight=this.width=this.height=0;this.Du=this.ym=this.Dp=this.wc=this.Ig=!1;this.v=a;this.rd=this.v.Al};h.j.og.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function M(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.j.o.Md(d))return d;return null}h.j.og.prototype.Vq=function(){return!0};h.j.og.prototype.Ut=function(){return!0}; +function Rc(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.j.o.Nd(d))return d;return null}h.j.Nh=function(a){h.j.Nh.w.constructor.call(this,a);this.type|=h.j.o.no;this.Ph=this.Pe=0;this.hA=!1;this.connection=null};h.g.object.S(h.j.Nh,h.j.og);h.j.Nh.prototype.Ep=function(a){var c=a.Xe?"cap"===a.Xe:h.ma.Le,d=a.R&&x(a.R);return!!a.M||c||(d?u(d)==a:!1)}; +h.j.Nh.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.j.o.Nd(f)||(h.j.o.Pg(f)?d=Math.max(d,f.Ph):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Pe=this.Ph=d;this.Ce=this.width};h.j.Nh.prototype.Vq=function(){return!1};h.j.vh=function(a){h.j.vh.w.constructor.call(this,a);this.type|=h.j.o.yn;this.Eu=!1;this.connection=null;this.tg=this.Lj=0};h.g.object.S(h.j.vh,h.j.og); +h.j.vh.prototype.Ep=function(a){return!!a.M||!!u(a)};h.j.vh.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.j.o.Nd(f)||(h.j.o.Mf(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.Lj=d;this.Ce=this.width};h.j.vh.prototype.Vq=function(){return!1}; +h.j.Ll=function(a,c,d){h.j.Ll.w.constructor.call(this,a);this.type=this.type|h.j.o.ho|h.j.o.wr;this.width=d;this.height=c;this.bu=!1;this.Ce=0;this.elements=[new h.j.Bh(this.v,d)]};h.g.object.S(h.j.Ll,h.j.og);h.j.Ll.prototype.measure=function(){};h.j.Ch=function(a){h.j.Ch.w.constructor.call(this,a);this.type|=h.j.o.Vr;this.wt=0};h.g.object.S(h.j.Ch,h.j.og); +h.j.Ch.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.o.Md(d)&&(h.j.o.ik(d)?a+=d.Bj:h.j.o.ek(d)&&0!=d.Bj&&(a+=d.Bj-d.vf)),h.j.o.Nd(d)||(this.height=Math.max(this.height,d.height));this.wt=a;this.Ce=this.width+a};h.j.Ch.prototype.Ut=function(){return!this.Ig&&!this.wc};h.j.nf=function(a,c){this.ka=c;this.cf=a;this.v=this.cf.v;this.M=c.M?new h.j.Vn(this.v,c.M):null;this.Mp=Tb(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Kf=c.Kf();this.H=c.H;this.ih=this.width=this.Vi=this.height=0;this.rows=[];this.Iu=[];this.Ab=new h.j.Nh(this.v);this.ib=new h.j.vh(this.v);this.hn=this.Uc=0};b=h.j.nf.prototype; +b.measure=function(){var a=this.ka.Xe?"cap"===this.ka.Xe:h.ma.Le,c=!!this.ka.R;this.Ab.Ep(this.ka)?this.Ab.elements.push(new h.j.Ml(this.v)):this.Ab.elements.push(new h.j.Fl(this.v));a?(a=new h.j.In(this.v),this.Ab.elements.push(a),this.Ab.Pe=a.Ph):c&&(this.Ab.hA=!0,this.Ab.connection=new h.j.Xn(this.v,this.ka.R),this.Ab.elements.push(this.Ab.connection));this.ka.N.length&&this.ka.N[0].type==h.Ca&&!this.ka.isCollapsed()?this.Ab.minHeight=this.v.pc:this.Ab.minHeight=this.v.Yd;this.rows.push(this.Ab); +a=new h.j.Ch(this.v);var d=ka(this.ka);if(d.length){c=0;for(var e;e=d[c];c++){var f=new h.j.Je(this.v,e);this.isCollapsed&&e.ot?this.Iu.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.ka.N[c];c++)if(d.isVisible()){!e||d.type!=h.Ca&&e.type!=h.Ca&&(d.type!=h.Oa&&d.type!=h.He||this.Mp)||(this.rows.push(a),a=new h.j.Ch(this.v));for(e=0;f=d.Ma[e];e++)a.elements.push(new h.j.Ea(this.v,f,d));this.at(d,a);e=d}this.isCollapsed&&(a.Du=!0,a.elements.push(new h.j.Mn(this.v)));(a.elements.length||a.ym)&&this.rows.push(a); +this.ib.Eu=!!this.ka.V;this.ib.minHeight=this.ka.N.length&&this.ka.N[this.ka.N.length-1].type==h.Ca?this.v.pc:this.v.Yd-1;this.ib.Ep(this.ka)?this.ib.elements.push(new h.j.Ml(this.v)):this.ib.elements.push(new h.j.Fl(this.v));this.ib.Eu&&(this.ib.connection=new h.j.Tn(this.v,this.ka.V),this.ib.elements.push(this.ib.connection));this.rows.push(this.ib);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.Vq()&&c.elements.push(new h.j.Bh(this.v,this.sm(null,d[0])));for(e=0;ea.xc&&(a.U+=h.g.u.T("V",c.Vb+c.height-a.xc)))};h.X.ng=function(a){this.kh=a;this.Ok=h.g.m.L("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.kh);this.Pi=h.g.m.L("path",{"class":"blocklyPath"},this.kh);this.Qk=h.g.m.L("path",{"class":"blocklyPathLight"},this.kh)};h.X.ng.prototype.Pq=function(a,c){this.Pi.setAttribute("d",a);this.Ok.setAttribute("d",a);this.Qk.setAttribute("d",c)}; +h.X.ng.prototype.mp=function(){this.Pi.setAttribute("transform","scale(-1 1)");this.Qk.setAttribute("transform","scale(-1 1)");this.Ok.setAttribute("transform","translate(1,1) scale(-1 1)")};h.X.jf=function(a,c){h.X.jf.w.constructor.call(this,a,c);this.xg&&(this.width+=this.v.oc,this.height+=this.v.oc)};h.g.object.S(h.X.jf,h.j.jf);h.X.qf=function(a,c){h.X.qf.w.constructor.call(this,a,c);this.xg&&(this.height+=this.v.oc)};h.g.object.S(h.X.qf,h.j.qf);h.X.nf=function(a,c){h.X.nf.w.constructor.call(this,a,c)};h.g.object.S(h.X.nf,h.j.nf);b=h.X.nf.prototype;b.at=function(a,c){this.Mp&&a.type==h.Oa?(c.elements.push(new h.X.jf(this.v,a)),c.Dp=!0):a.type==h.Ca?(c.elements.push(new h.X.qf(this.v,a)),c.wc=!0):a.type==h.Oa?(c.elements.push(new h.j.ul(this.v,a)),c.Ig=!0):a.type==h.He&&(c.ym=!0)}; +b.sm=function(a,c){if(!a)return c&&h.j.o.fk(c)&&c.Qc?this.v.Yd:c&&h.j.o.Jf(c)?this.v.gs:c&&h.j.o.ik(c)?this.v.Wx:this.v.pc;if(!h.j.o.Md(a)&&!c)return h.j.o.fk(a)&&a.Qc?this.v.Yd:h.j.o.pi(a)?2*this.v.pc+1:h.j.o.Pg(a)?this.v.Zd:h.j.o.BA(a)?this.v.pc:h.j.o.Lf(a)?this.v.Cx:h.j.o.Qu(a)?this.v.Zd:this.v.pc;if(h.j.o.Md(a)&&!c){if(h.j.o.ek(a))return this.v.Zd;if(h.j.o.Jf(a))return this.v.pc;if(h.j.o.ik(a))return this.v.Zd}if(!h.j.o.Md(a)&&c&&h.j.o.Md(c)){if(a.Qc){if(h.j.o.Jf(c)||h.j.o.ek(c))return this.v.Qx}else{if(h.j.o.Jf(c)|| +h.j.o.ek(c))return this.v.gs;if(h.j.o.ik(c))return this.v.pc}return this.v.pc-1}if(h.j.o.pi(a)&&c&&!h.j.o.Md(c))return this.v.pc;if(h.j.o.Jf(a)&&c&&!h.j.o.Md(c))return c.Qc?this.v.Yd:this.v.pc;if(h.j.o.hk(a)&&c){if(h.j.o.Pg(c))return this.v.Zd;if(h.j.o.ti(c))return c.rd;if(h.j.o.Mf(c))return a=(this.H?1:-1)*this.v.oc/2,c.rd+a}if(h.j.o.Lf(a)&&c){if(h.j.o.ti(c))return c.rd-this.v.ab;if(h.j.o.Mf(c))return a=(this.H?1:-1)*this.v.oc/2,c.rd-this.v.ab+a}return!h.j.o.Md(a)&&c&&!h.j.o.Md(c)&&a.Qc==c.Qc||c&& +h.j.o.Qu(c)?this.v.pc:this.v.Yd};b.qo=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(h.j.o.Nd(e)){d=e;break a}d=null}e=Rc(a);if(a.Ig||a.wc)a.Ce+=c;var f=M(a);f?f.align==h.vn?e.width+=c:f.align==h.nr?(d.width+=c/2,e.width+=c/2):f.align==h.pr&&(d.width+=c):e.width+=c;a.width+=c};b.su=function(a,c){return h.j.o.Lm(a)&&h.j.o.Em(c)?this.v.Qw:h.j.o.Lm(a)||h.j.o.Em(c)?this.v.Zd:a.Ig&&c.Ig?this.v.pc:!a.wc&&c.wc?this.v.ww:a.wc&&c.wc||!a.wc&&c.ym?this.v.pc:this.v.Yd}; +b.ku=function(a,c){if(h.j.o.Nd(c))return a.Vb+c.height/2;if(h.j.o.Em(a))return a=a.Vb+a.height-a.Lj,h.j.o.Mf(c)?a+c.height/2:a-c.height/2;if(h.j.o.Lm(a))return h.j.o.Pg(c)?a.Pe-c.height/2:a.Pe+c.height/2;var d=a.Vb;h.j.o.fk(c)||h.j.o.pi(c)?(d+=c.height/2,(a.Dp||a.wc)&&c.height+this.v.Ks<=a.height&&(d+=this.v.Ks)):d=h.j.o.Jf(c)?d+c.height/2:d+a.height/2;return d}; +b.Xt=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Vb=c;e.xa=this.Uc;c+=e.height;a=Math.max(a,e.Ce);var f=c-this.Ab.Ph;e==this.ib&&f=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},Um:function(){10>K?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+J+"&level="+(K+1):O.Zj()},zm:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}yc(a,c)},tA:function(a,c){a=document.getElementById(a); +a.firstChild||(a=h.Hf(a,{rtl:-1!=Ic.indexOf(J),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),h.K.Eg(h.K.$f(c),a))},LB:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},hd:function(a){if("click"==a.type&&"touchend"==O.hd.Bq&&O.hd.zq+2E3>Date.now()||O.hd.Bq==a.type&&O.hd.zq+400>Date.now())return a.preventDefault(),a.stopPropagation(),!0;O.hd.Bq=a.type;O.hd.zq=Date.now();return!1}};O.hd.Bq=null;O.hd.zq=0; +O.oA=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};O.pA=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=O;O.setCode=O.Kv;O.getCode=O.rp;O.getWorkspace=O.ei;var N={Ng:!1,Kt:null,dm:null,Ni:function(a,c,d,e,f,g){function k(){N.Ng&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);N.Ng&&N.kc(!1);h.Za()&&h.jc(!0);N.Ng=!0;N.Kt=c;N.dm=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),N.Ro=h.Xb(e,"mousedown",null,N.iz));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(N.Pm(c,!1,.2),N.Pm(l,!0,.8),setTimeout(k,175)):k()},Lt:0,Mt:0,iz:function(a){N.Uo();if(!h.g.ui(a)){var c=document.getElementById("dialog");N.Lt=c.offsetLeft-a.clientX;N.Mt=c.offsetTop-a.clientY;N.To=h.Xb(document,"mouseup",null,N.Uo);N.So=h.Xb(document,"mousemove",null,N.jz);a.stopPropagation()}},jz:function(a){var c=document.getElementById("dialog"), +d=N.Lt+a.clientX;a=N.Mt+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"},Uo:function(){N.To&&(h.fb(N.To),N.To=null);N.So&&(h.fb(N.So),N.So=null)},kc:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(N.Ng){N.Uo();N.Ro&&(h.fb(N.Ro),N.Ro=null);N.Ng=!1;N.dm&&N.dm();N.dm=null;var d=!1===a? +null:N.Kt;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(N.Pm(a,!1,.8),N.Pm(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)}},Pm: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=N.fu(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},fu:function(a){var c=h.g.style.tp(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},Xv:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eK?L("Games_nextLevel").replace("%1",String(K+1)):L("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +N.kc,!0);c.addEventListener("touchend",N.kc,!0);c=document.getElementById("doneOk");c.addEventListener("click",O.Um,!0);c.addEventListener("touchend",O.Um,!0);N.Ni(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",N.vt,!0)});document.body.addEventListener("keydown",N.vt,!0);document.getElementById("dialogDoneText").textContent=d},Jt:function(a){!N.Ng||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(N.kc(!0),a.stopPropagation(),a.preventDefault())}, +Sv:function(){document.body.addEventListener("keydown",N.Jt,!0)},Wv:function(){document.body.removeEventListener("keydown",N.Jt,!0)},vt:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)N.kc(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&O.Um()},Ys:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)N.kc(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&O.Zj()},cu:function(a){27==a.keyCode?N.kc(!0):13==a.keyCode&&N.np()},np: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?L("Games_submitted"):L("Games_httpRequestError")+"\nStatus: "+f.status;N.Xv(null,g)}};f.send(c.join("&"));N.kc(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=N;N.hideDialog=N.kc;h.Generator=function(a){this.TA=a};h.Generator.Fh="generated_function";b=h.Generator.prototype;b.Tr=null;b.Il=null;b.Jl=null;b.kx=" ";b.Dw=60;b.El=[]; +function fd(){var a=h.G,c=H;c||(console.warn("No workspace specified in workspaceToCode call. Guessing."),c=h.Za());var d=[];a.wa(c);c=G(c,!0);for(var e=0,f;f=c[e];e++){var g=gd(a,f);Array.isArray(g)&&(g=g[0]);g&&(f.M&&(g=a.Iv(g),a.Il&&!f.Xq&&(g=hd(a.Il,f)+g),a.Jl&&!f.Xq&&(g+=hd(a.Jl,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 id(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)} +function gd(a,c){if(!c)return"";if(!c.isEnabled())return gd(a,u(c));var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.TA+'" 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.Kq(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.Il&&!c.Xq&&(d=hd(a.Il,c)+d),a.Jl&&!c.Xq&&(d+=hd(a.Jl,c)),a.Kq(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+ +d);} +function jd(a,c,d){var e=h.G;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=ac(a,c);if(!f)return"";c=gd(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;gd?jd(a,c,h.G.rs)||g:e?jd(a,c,h.G.ss)||g:jd(a,c,f)||g;if(h.AA(a))a=Number(a)+d,e&&(a=-a);else{if(0d&&(a=a+" - "+-d,k=h.G.rs);e&&(a=d?"-("+a+")":"-"+a,k=h.G.ss);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};h.Xd=function(a,c,d,e,f,g,k){if(!a)throw Error("Src value of an image field is required");a=h.g.Fc(a);d=Number(h.g.Fc(d));c=Number(h.g.Fc(c));if(isNaN(d)||isNaN(c))throw Error("Height and width values of an image field must cast to numbers.");if(0>=d||0>=c)throw Error("Height and width values of an image field must be greater than 0.");this.Rj=!1;this.Ql="";h.Xd.w.constructor.call(this,a||"",null,k);k||(this.Rj=!!g,this.Ql=h.g.Fc(e)||"");this.ub=new h.g.Cd(c,d+h.Xd.Xs);this.nA=d;this.xj=null;"function"== +typeof f&&(this.xj=f)};h.g.object.S(h.Xd,h.Ea);h.Xd.pa=function(a){return new h.Xd(a.src,a.width,a.height,void 0,void 0,void 0,a)};h.Xd.Xs=1;b=h.Xd.prototype;b.Wd=!1;b.If=!1;b.Aj=function(a){h.Xd.w.Aj.call(this,a);this.Rj=!!a.flipRtl;this.Ql=h.g.Fc(a.alt)||""};b.$j=function(){this.nd=h.g.m.L("image",{height:this.nA+"px",width:this.ub.width+"px",alt:this.Ql},this.jd);this.nd.setAttributeNS(h.g.m.dd,"xlink:href",this.Be)};b.gm=function(a){return"string"!=typeof a?null:a}; +b.hm=function(a){this.Be=a;this.nd&&this.nd.setAttributeNS(h.g.m.dd,"xlink:href",this.Be||"")};b.lu=function(){return this.Rj};b.Ik=function(){this.xj&&this.xj(this)};b.yp=function(){return this.Ql};h.Nc.register("field_image",h.Xd);var md={},P,nd,od,Q,S,T,pd;h.Hb.maze_moveForward={wa:function(){$b(this,{message0:L("Maze_moveForward"),previousStatement:null,nextStatement:null,colour:290,tooltip:L("Maze_moveForwardTooltip")})}};h.G.maze_moveForward=function(a){return"moveForward('block_id_"+a.id+"');\n"};h.Hb.maze_turn={wa:function(){var a=[[L("Maze_turnLeft"),"turnLeft"],[L("Maze_turnRight"),"turnRight"]];a[0][0]+=" \u21ba";a[1][0]+=" \u21bb";this.ud(290);I(Zb(this),new h.Fa(a),"DIR");this.fh(!0);this.Ji(!0);this.Pd(L("Maze_turnTooltip"))}}; +h.G.maze_turn=function(a){return Ma(a,"DIR")+"('block_id_"+a.id+"');\n"};h.Hb.maze_if={wa:function(){var a=[[L("Maze_pathAhead"),"isPathForward"],[L("Maze_pathLeft"),"isPathLeft"],[L("Maze_pathRight"),"isPathRight"]];a[1][0]+=" \u21ba";a[2][0]+=" \u21bb";this.ud(210);I(Zb(this),new h.Fa(a),"DIR");I(this.Ne(h.Ca,"DO"),L("Maze_doCode"));this.Pd(L("Maze_ifTooltip"));this.fh(!0);this.Ji(!0)}};h.G.maze_if=function(a){var c=Ma(a,"DIR")+"('block_id_"+a.id+"')";a=kd(a,"DO");return"if ("+c+") {\n"+a+"}\n"}; +h.Hb.maze_ifElse={wa:function(){var a=[[L("Maze_pathAhead"),"isPathForward"],[L("Maze_pathLeft"),"isPathLeft"],[L("Maze_pathRight"),"isPathRight"]];a[1][0]+=" \u21ba";a[2][0]+=" \u21bb";this.ud(210);I(Zb(this),new h.Fa(a),"DIR");I(this.Ne(h.Ca,"DO"),L("Maze_doCode"));I(this.Ne(h.Ca,"ELSE"),L("Maze_elseCode"));this.Pd(L("Maze_ifelseTooltip"));this.fh(!0);this.Ji(!0)}}; +h.G.maze_ifElse=function(a){var c=Ma(a,"DIR")+"('block_id_"+a.id+"')",d=kd(a,"DO");a=kd(a,"ELSE");return"if ("+c+") {\n"+d+"} else {\n"+a+"}\n"};h.Hb.maze_forever={wa:function(){this.ud(120);I(I(Zb(this),L("Maze_repeatUntil")),new h.Xd(U.Om,12,16));I(this.Ne(h.Ca,"DO"),L("Maze_doCode"));this.fh(!0);this.Pd(L("Maze_whileTooltip"))}};h.G.maze_forever=function(a){var c=kd(a,"DO");h.G.Tr&&(c=h.G.Tr.replace(/%1/g,"'block_id_"+a.id+"'")+c);return"while (notDone()) {\n"+c+"}\n"};var qd=qd||{};function rd(a,c){function d(){}d.prototype=c.prototype;a.w=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.BG=function(e,f,g){return c.prototype[f].apply(e,Array.prototype.slice.call(arguments,2))}}if(!sd){var sd,td="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(td=navigator.userAgent);var ud=0==td.indexOf("Opera");sd={iH:{zD:"ScriptEngine"in window},HE:ud,hf:!ud&&-1!=td.indexOf("MSIE"),Ts:!ud&&-1!=td.indexOf("WebKit")}}if(!vd)var vd={}; +if(!wd)var wd={};if(!xd)var xd={};if(!yd)var yd={};if(!zd)var zd={};if(!Ad)var Ad={};var Bd=qd.FC?{vH:!0}:{};function Cd(){throw Error("Do not instantiate directly");}Cd.prototype.zt=null;Cd.prototype.toString=function(){return this.content};function Dd(a){if(null!=a)switch(a.zt){case 1:return 1;case -1:return-1;case 0:return 0}return null}function Ed(){Cd.call(this)}rd(Ed,Cd);Ed.prototype.$y=Bd;function V(a){return null!=a&&a.$y===Bd?a:Fd(String(String(a)).replace(Gd,Hd),Dd(a))} +var Fd=function(a){function c(){}c.prototype=a.prototype;return function(d,e){var f=new c;f.content=String(d);void 0!==e&&(f.zt=e);return f}}(Ed),Id={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function Hd(a){return Id[a]}var Gd=/[\x00\x22\x26\x27\x3c\x3e]/g;function Ld(){return'
'};function Md(){var a=Nd,c='
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
avan\u00e7arvire \u00e0 esquerdavire \u00e0 direitafa\u00e7asen\u00e3oBlocos se-sen\u00e3o far\u00e3o uma coisa ou outra.se caminho \u00e0 frentese caminho \u00e0 esquerdase caminho \u00e0 direitarepetir at\u00e9Move o jogador um espa\u00e7o para frente.Vira o jogador 90 graus para esquerda ou direita.Se h\u00e1 um caminho na dire\u00e7\u00e3o especificada, \\nent\u00e3o fa\u00e7a algumas a\u00e7\u00f5es. Se h\u00e1 um caminho na dire\u00e7\u00e3o especificada, \\nent\u00e3o fa\u00e7a o primeiro bloco de a\u00e7\u00f5es. \\nCaso contr\u00e1rio, fa\u00e7a o segundo bloco de \\na\u00e7\u00f5es. Repetir as a\u00e7\u00f5es inclusas at\u00e9 que o ponto final \\nseja alcan\u00e7ado. Restam %0 blocos.Resta %1 bloco.Restam %2 blocos.

'+ +((Kc?'':'')+"Jogos do Blockly : "+V({appName:"Labirinto"}.appName)+"");a="&skin="+V(a);for(var d="   ",e=1;11>e;e++)d+=" "+(e==K?''+V(e)+"":10==e?''+V(e)+"":'');return c+d+'

  
Parab\u00e9ns!
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.
')+ +(Ld()+"
")+(1==K?'
 Empilhe alguns blocos \'avan\u00e7ar\' juntos para me ajudar a alcan\u00e7ar o objetivo.
 Neste n\u00edvel, voc\u00ea deve empilhar todos os blocos na \u00e1rea de trabalho branca.
Execute seu programa para ver o que acontece.
': +2==K?'
Seu programa n\u00e3o resolveu o labirinto. Aperte \'Reiniciar\' e tente novamente.
':3==K||4==K?(3==K?'
Alcance o fim deste caminho usando apenas dois blocos. Use \'repetir\' para executar um bloco mais de uma vez.
': +"")+'
 Voc\u00ea usou todos os blocos para este n\u00edvel. Para criar um novo bloco, voc\u00ea primeiro deve deletar um bloco existente.
Voc\u00ea pode encaixar mais de um bloco dentro de um bloco \'repetir\'.
': +5==K?'
Escolha o seu jogador favorito neste menu.
':6==K?'
Um bloco \'se\' far\u00e1 alguma coisa apenas se a condi\u00e7\u00e3o for verdadeira. Tente virar \u00e0 esquerda se houver um caminho para a esquerda.
': +7==K?'
Clique em %1 no bloco \'se\' para mudar sua condi\u00e7\u00e3o.
':9==K?'
Blocos se-sen\u00e3o far\u00e3o uma coisa ou outra.
':10==K?'
 Voc\u00ea consegue resolver este labirinto complicado? Tente seguir a parede da m\u00e3o esquerda. Apenas para programadores avan\u00e7ados!'+ +Ld()+"
":"")};var Pc="maze";O.Um=function(){10>K?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+J+"&level="+(K+1)+"&skin="+Nd:O.Zj()}; +var Od=[void 0,Infinity,Infinity,2,5,5,5,5,10,7,10][K],Pd=[{Oi:"maze/pegman.png",Yq:"maze/tiles_pegman.png",Om:"maze/marker.png",background:!1,Tj:!1,Xp:"#000",ir:["maze/win.mp3","maze/win.ogg"],Oo:["maze/fail_pegman.mp3","maze/fail_pegman.ogg"],$l:1},{Oi:"maze/astro.png",Yq:"maze/tiles_astro.png",Om:"maze/marker.png",background:"maze/bg_astro.jpg",Tj:!1,Xp:"#fff",ir:["maze/win.mp3","maze/win.ogg"],Oo:["maze/fail_astro.mp3","maze/fail_astro.ogg"],$l:2},{Oi:"maze/panda.png",Yq:"maze/tiles_panda.png", +Om:"maze/marker.png",background:"maze/bg_panda.jpg",Tj:!1,Xp:"#000",ir:["maze/win.mp3","maze/win.ogg"],Oo:["maze/fail_panda.mp3","maze/fail_panda.ogg"],$l:3}],Nd=Lc("skin",0,Pd.length),U=Pd[Nd],X=[void 0,[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,2,1,3,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,1,3,0,0,0],[0,0,2,1,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0], +[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,2,1,1,1,1,3,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,1,1],[0,0,0,0,0,3,1,0],[0,0,0,0,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,1,1,0,0,0,0],[0,2,1,0,0,0,0,0],[1,1,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,3,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,2,1,1,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,1,0,0,0,1,0,0],[0,1,1,3,0,1,0,0],[0,0,0,0, +0,1,0,0],[0,2,1,1,1,1,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,1,1,0],[0,2,1,1,1,1,0,0],[0,0,0,0,0,1,1,0],[0,1,1,3,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,1,1,1,1,1,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,1,1,1,1,0,0,0],[0,1,0,0,1,1,0,0],[0,1,1,1,0,1,0,0],[0,0,0,1,0,1,0,0],[0,2,1,1,0,3,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,0,1,0,0,0,0,0],[3,1,1,1,1,1,1,0],[0,1,0,1,0,1,1,0],[1,1,1,1,1,0,1,0],[0,1,0,1,0,2,1,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0], +[0,1,1,0,3,0,1,0],[0,1,1,0,1,1,1,0],[0,1,0,1,0,1,0,0],[0,1,1,1,1,1,1,0],[0,0,0,1,0,0,1,0],[0,2,1,1,1,0,1,0],[0,0,0,0,0,0,0,0]]][K],Qd=X.length,Rd=X[0].length,Sd=50*Rd,Td=50*Qd,Ud=0,Y=[],Vd={10010:[4,0],10001:[3,3],11E3:[0,1],10100:[0,2],11010:[4,1],10101:[3,2],10110:[0,0],10011:[2,0],11001:[4,2],11100:[2,3],11110:[1,1],10111:[1,0],11011:[2,1],11101:[1,2],11111:[2,2],null0:[4,3],null1:[3,0],null2:[3,1],null3:[0,3],null4:[1,3]}; +function Wd(){function a(n,q){return 0>n||n>=Rd||0>q||q>=Qd?"0":0==X[q][n]?"0":"1"}var c=document.getElementById("svgMaze"),d=50*Math.max(Qd,Rd);c.setAttribute("viewBox","0 0 "+d+" "+d);d=document.createElementNS(h.g.m.qc,"rect");d.setAttribute("width",Sd);d.setAttribute("height",Td);d.setAttribute("fill","#F1EEE7");d.setAttribute("stroke-width",1);d.setAttribute("stroke","#CCB");c.appendChild(d);if(U.background){var e=document.createElementNS(h.g.m.qc,"image");e.setAttributeNS(h.g.m.dd,"xlink:href", +U.background);e.setAttribute("height",Td);e.setAttribute("width",Sd);e.setAttribute("x",0);e.setAttribute("y",0);c.appendChild(e)}if(U.Tj){for(d=0;dF(H).length?(e=document.getElementById("dialogHelpStack"),g={width:"370px",top:"130px"},g[a?"right":"left"]="215px",f=d[0].Y()):(d=G(H,!0),1;;;;;;'.split(";")),e=document.getElementById("dialogHelpOneTopBlock"), +g={width:"360px",top:"120px"},g[a?"right":"left"]="225px",f=d[0].Y()):0==Ud&&(e=document.getElementById("dialogHelpRun"),g={width:"360px",top:"410px"},g[a?"right":"left"]="400px",f=document.getElementById("runButton")));else if(2==K)0!=Ud&&"none"==document.getElementById("runButton").style.display&&(e=document.getElementById("dialogHelpReset"),g={width:"360px",top:"410px"},g[a?"right":"left"]="400px",f=document.getElementById("resetButton"));else if(3==K)-1==c.indexOf("maze_forever")&&(0==Ra(H)?(e= +document.getElementById("dialogHelpCapacity"),g={width:"430px",top:"310px"},g[a?"right":"left"]="50px",f=document.getElementById("capacityBubble")):(e=document.getElementById("dialogHelpRepeat"),g={width:"360px",top:"360px"},g[a?"right":"left"]="425px",f=d[3].Y()));else if(4==K)if(0==Ra(H)&&(-1==c.indexOf("maze_forever")||1l;l++)Y.push(setTimeout(a(l),P*l/2))}}function ae(a){var c=oe(4*T);Z(Q,S,16);a&&H.Bc.play("win",.5);P=150;Y.push(setTimeout(function(){Z(Q,S,18)},P));Y.push(setTimeout(function(){Z(Q,S,16)},2*P));Y.push(setTimeout(function(){Z(Q,S,c)},3*P))} +function Z(a,c,d,e){var f=document.getElementById("pegman");f.setAttribute("x",50*a-49*d+1);f.setAttribute("y",50*(c+.5)-26-8);e?f.setAttribute("transform","rotate("+e+", "+(50*a+25)+", "+(50*c+25)+")"):f.setAttribute("transform","rotate(0, 0, 0)");c=document.getElementById("clipRect");c.setAttribute("x",50*a+1);c.setAttribute("y",f.getAttribute("y"))} +function ke(a){var c=Q,d=S;switch(a){case 0:c+=.5;break;case 1:c+=1;d+=.5;break;case 2:c+=.5;d+=1;break;case 3:d+=.5}c*=50;d*=50;var e=90*a-45;a=document.getElementById("look");a.setAttribute("transform","translate("+c+", "+d+") rotate("+e+" 0 0) scale(.4)");c=a.getElementsByTagName("path");a.style.display="inline";for(d=0;a=c[d];d++)pe(a,P*d)}function pe(a,c){Y.push(setTimeout(function(){a.style.display="inline";setTimeout(function(){a.style.display="none"},2*P)},c))} +function me(a){a=Math.round(a)%4;0>a&&(a+=4);return a}function oe(a){a=Math.round(a)%16;0>a&&(a+=16);return a}function ge(a,c){if(!ie(a,null))throw pd.push(["fail_"+(a?"backward":"forward"),c]),!1;switch(me(T+a)){case 0:S--;var d="north";break;case 1:Q++;d="east";break;case 2:S++;d="south";break;case 3:Q--,d="west"}pd.push([d,c])}function he(a,c){a?(T++,pd.push(["right",c])):(T--,pd.push(["left",c]));T=me(T)} +function ie(a,c){switch(me(T+a)){case 0:var d=X[S-1]&&X[S-1][Q];var e="look_north";break;case 1:d=X[S][Q+1];e="look_east";break;case 2:d=X[S+1]&&X[S+1][Q];e="look_south";break;case 3:d=X[S][Q-1],e="look_west"}c&&pd.push([e,c]);return 0!==d&&void 0!==d} +window.addEventListener("load",function(){function a(){l.style.top=Math.max(10,m.offsetTop-window.pageYOffset)+"px";l.style.left=k?"10px":"420px";l.style.width=window.innerWidth-440+"px"}function c(n){return function(){if(window.sessionStorage){var q=h.K.qn();q=h.K.Mc(q);window.sessionStorage.Vp=q}window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+J+"&level="+K+"&skin="+n}}document.body.innerHTML=Md();O.wa();document.querySelector("#pegmanButton>img").style.backgroundImage= +"url("+U.Oi+")";for(var d=document.getElementById("pegmanMenu"),e=0;e',!1);for(d=0;dpath { + display: none; + fill: none; + stroke-width: 10; + stroke-linecap: round; + stroke-opacity: 0.7; +} + +/* Buttons */ +button.primary { + /* Can't use "text-align: start" due to IE. */ + text-align: left; +} +html[dir="RTL"] button.primary { + text-align: right; +} + +/* Sprited icons. */ +.icon21 { + height: 21px; + width: 21px; + background-image: url(icons.png); +} +.link { + background-position: 0px 0px; +} +.run { + background-position: 0px -21px; +} +.stop { + background-position: -21px -21px; +} + +#pegmanButton { + padding: 0; + position: relative; +} +#pegmanButton:active { + border: 1px solid #ddd !important; +} +#pegmanButton>img { + margin-left: -0.5ex; + margin-right: 0.5ex; + height: 38px; + width: 49px; + background-position: -980px 0px; + opacity: 0.8; +} +html[dir="RTL"] #pegmanButton>img { + margin-left: 0.5ex; + margin-right: -0.5ex; +} +#pegmanButton>span { + position: absolute; + top: 0.8ex; + margin-left: -15px; +} +html[dir="RTL"] #pegmanButton>span { + margin-right: -15px; +} +#pegmanMenu { + border: 1px solid #ddd; + border-radius: 5px; + box-shadow: 2px 2px 5px #888; + display: none; + position: absolute; +} +#pegmanMenu>div { + background-color: #fff; +} +#pegmanMenu>div:hover { + background-color: #57e; +} +#pegmanMenu>div>img { + height: 38px; + width: 49px; + background-position: -980px 0px; +} diff --git a/html/blockly-games/maze/tiles_astro.png b/html/blockly-games/maze/tiles_astro.png new file mode 100644 index 0000000..e21a193 Binary files /dev/null and b/html/blockly-games/maze/tiles_astro.png differ diff --git a/html/blockly-games/maze/tiles_panda.png b/html/blockly-games/maze/tiles_panda.png new file mode 100644 index 0000000..1e096b7 Binary files /dev/null and b/html/blockly-games/maze/tiles_panda.png differ diff --git a/html/blockly-games/maze/tiles_pegman.png b/html/blockly-games/maze/tiles_pegman.png new file mode 100644 index 0000000..8ac9275 Binary files /dev/null and b/html/blockly-games/maze/tiles_pegman.png differ diff --git a/html/blockly-games/maze/win.mp3 b/html/blockly-games/maze/win.mp3 new file mode 100644 index 0000000..2a0ff1b Binary files /dev/null and b/html/blockly-games/maze/win.mp3 differ diff --git a/html/blockly-games/maze/win.ogg b/html/blockly-games/maze/win.ogg new file mode 100644 index 0000000..5eca709 Binary files /dev/null and b/html/blockly-games/maze/win.ogg differ diff --git a/html/blockly-games/movie.html b/html/blockly-games/movie.html new file mode 100644 index 0000000..77a4a39 --- /dev/null +++ b/html/blockly-games/movie.html @@ -0,0 +1,15 @@ + + + + + + + Blockly Games : Movie + + + + + + + + diff --git a/html/blockly-games/movie/generated/pt-br/compressed.js b/html/blockly-games/movie/generated/pt-br/compressed.js new file mode 100644 index 0000000..7c06a46 --- /dev/null +++ b/html/blockly-games/movie/generated/pt-br/compressed.js @@ -0,0 +1,903 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,g={g:{}};g.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}(); +g.h={};g.g.global.Blockly||(g.g.global.Blockly={});g.g.global.Blockly.Msg||(g.g.global.Blockly.Msg=g.h);g.g.V=function(a,c){this.x=a;this.y=c};g.g.V.Le=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};g.g.V.Qx=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};g.g.V.aG=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};g.g.V.Ek=function(a,c){return new g.g.V(a.x-c.x,a.y-c.y)};g.g.V.sum=function(a,c){return new g.g.V(a.x+c.x,a.y+c.y)};g.g.V.prototype.scale=function(a){this.x*=a;this.y*=a;return this};g.g.V.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};g.g.jb={};g.g.jb.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};g.g.jb.gv=function(a){return a.length?a.reduce(function(c,d){return c.lengthc&&(c=d[e].length);e=-Infinity;var f=1;do{var h=e;var k=a;a=[];var l=d.length/f,m=1;for(e=0;eh);return k}; +g.g.jb.Av=function(a,c,d){for(var e=[0],f=[],h=0;he&&(e=l,f=k)}return f?g.g.jb.JA(a,f,d):c};g.g.jb.NH=function(a,c){for(var d=[],e=0;e=l?(f=2,h=l,(l=a.join(""))&&d.push(l),a.length=0):"{"==l?f=3:(a.push("%",l),f=0):2==f?"0"<=l&&"9">=l?h+=l:(d.push(parseInt(h,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=g.g.jb.startsWith(l,"BKY_")? +l.substring(4):null)&&l in g.h?(f=g.h[l],"string"==typeof f?Array.prototype.push.apply(d,g.g.uv(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;kd;d++)c[d]=g.g.Tg.pA.charAt(Math.random()*a);return c.join("")}; +g.g.Tg.pA="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +g.g.gj=function(){if(void 0!==g.g.gj.zs)return g.g.gj.zs;if(!g.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=g.g.global.getComputedStyle(a);if(!c)return document.body.removeChild(a),!1;c=c.getPropertyValue(d[e])}document.body.removeChild(a); +g.g.gj.zs="none"!==c;return g.g.gj.zs};g.g.gA=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)};g.g.lF=function(){var a=g.g.style.Ft();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +g.g.cp=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};g.g.gF=function(){var a=document.documentElement,c=window;return g.g.userAgent.yg&&c.pageYOffset!=a.scrollTop?new g.g.V(a.scrollLeft,a.scrollTop):new g.g.V(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};g.g.rt=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=q(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}; +g.g.eH=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new g.g.V(d-e.left,c-e.top);c=g.g.Km(a.kb);return g.g.V.Ek(d,c).scale(1/a.scale)}; +g.Touch={};g.Touch.Jw="ontouchstart"in g.g.global||!!(g.g.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!g.g.global.navigator||!g.g.global.navigator.maxTouchPoints&&!g.g.global.navigator.msMaxTouchPoints);g.Touch.Tn=null;g.Touch.Nf={}; +g.g.global.PointerEvent?g.Touch.Nf={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:g.Touch.Jw&&(g.Touch.Nf={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});g.eq=0; +g.ZF=function(a,c){g.Zh();a.changedTouches&&1!=a.changedTouches.length||(g.eq=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&ba(c,a)},g.lC))};g.Zh=function(){g.eq&&(clearTimeout(g.eq),g.eq=0)};g.Touch.Dh=function(){g.Touch.Tn=null};g.Touch.hv=function(a){return!g.Touch.QF(a)||g.Touch.WD(a)}; +g.Touch.Lp=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"};g.Touch.WD=function(a){var c=g.Touch.Lp(a);return void 0!==g.Touch.Tn&&null!==g.Touch.Tn?g.Touch.Tn==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(g.Touch.Tn=c,!0):!1}; +g.Touch.gH=function(a){if(g.g.jb.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};g.Touch.QF=function(a){return g.g.jb.startsWith(a.type,"touch")||g.g.jb.startsWith(a.type,"mouse")||g.g.jb.startsWith(a.type,"pointer")};g.Touch.cq=function(a){return g.g.jb.startsWith(a.type,"touch")||g.g.jb.startsWith(a.type,"pointer")}; +g.Touch.nH=function(a){var c=[];if(a.changedTouches)for(var d=0;d=d+this.Nh&&(e+=f);da(this,na(this,e));la(this);a.stopPropagation();a.preventDefault()}}; +b.CG=function(a){pa(this.s);ea();g.g.lj(a)?a.stopPropagation():(this.oH=this.Qm,ra(this.s),this.rA=this.cj?a.clientX:a.clientY,g.La.Ue=g.ca(document,"mouseup",this,this.KG),g.La.hg=g.ca(document,"mousemove",this,this.HG),a.stopPropagation(),a.preventDefault())};b.HG=function(a){da(this,na(this,this.oH+((this.cj?a.clientX:a.clientY)-this.rA)));la(this)};b.KG=function(){sa(this.s);g.Touch.Dh();ea()};function ea(){g.wc(!0);g.La.Ue&&(g.Ua(g.La.Ue),g.La.Ue=null);g.La.hg&&(g.Ua(g.La.hg),g.La.hg=null)} +function na(a,c){return c=0>=c||isNaN(c)||a.Wee.lw&&0<=e.lw;)e.Nj.shift();for(var h=0;d=e.Cd[h];h++)d(f)}}}; +g.i.filter=function(a,c){a=a.slice();c||a.reverse();for(var d=[],e=Object.create(null),f=0,h;h=a[f];f++)if(!h.Uk()){var k=[h.type,h.Gc,h.Cc].join(" "),l=e[k],m=l?l.event:null;if(!l)e[k]={event:h,index:f},d.push(h);else if(h.type==g.i.Sl&&l.index==f-1)m.sj=h.sj,m.rj=h.rj,m.$h=h.$h,l.index=f;else if(h.type==g.i.si&&h.element==m.element&&h.name==m.name)m.newValue=h.newValue;else if(h.type!=g.i.$o||"click"!=h.element||"commentOpen"!=m.element&&"mutatorOpen"!=m.element&&"warningOpen"!=m.element)e[k]={event:h, +index:1},d.push(h)}a=d.filter(function(n){return!n.Uk()});c||a.reverse();for(f=1;h=a[f];f++)h.type==g.i.si&&"mutation"==h.element&&a.unshift(a.splice(f,1)[0]);return a};g.i.ZD=function(){for(var a=0,c;c=g.i.Hl[a];a++)c.Pc=!1};g.i.disable=function(){g.i.Ss++};g.i.enable=function(){g.i.Ss--};g.i.isEnabled=function(){return 0==g.i.Ss};g.i.cc=function(){return g.i.My};g.i.aa=function(a){g.i.My="boolean"==typeof a?a?g.g.Tg():"":a}; +g.i.ty=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c}; +g.i.pa=function(a){switch(a.type){case g.i.wo:var c=new g.i.Ye(null);break;case g.i.El:c=new g.i.Ff(null);break;case g.i.si:c=new g.i.rh(null,"","","","");break;case g.i.Sl:c=new g.i.zi(null);break;case g.i.Lw:c=new g.i.He(null);break;case g.i.Mw:c=new g.i.df(null);break;case g.i.Nw:c=new g.i.Of(null,"");break;case g.i.$o:c=new g.i.yd(null,"","","");break;case g.i.to:c=new g.i.ug(null);break;case g.i.Ov:c=new g.i.Xj(null,"","");break;case g.i.uo:c=new g.i.ti(null);break;case g.i.Pv:c=new g.i.vg(null); +break;default:throw Error("Unknown event type.");}c.pa(a);c.Cc=(void 0).id;return c};g.i.zE=function(a){if((a.type==g.i.Sl||a.type==g.i.wo)&&a.Cc){var c=g.Nb.tt(a.Cc);if(a=x(c,a.Gc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.qd(!0);else if((a.L||a.$)&&!c.lc()){do a.qd(!1),a=q(a);while(a)}}}}; +g.jD=function(){var a=g.Gi.Wj.PD;this.KD=g.Gi.Wj.rE;this.QD=a;this.bE=Object.create(null)};function ta(a,c){return(c=a.bE[c])&&"string"==typeof propertyValue&&ta(a,c)?ta(a,c):c?String(c):null};g.$l=function(a){this.Jq=a;this.Gq=[];this.Eh=Object.create(null)};g.$l.prototype.Kp=function(){return this.Jq};g.$l.prototype.subscribe=function(a,c,d){this.Eh[c]||(this.Eh[c]=[]);this.Eh[c].push({element:a,propertyName:d});a.style[d]=this.Jq&&ta(this.Jq,c)||""};g.$l.prototype.unsubscribe=function(a){if(a)for(var c=Object.keys(this.Eh),d=0,e;e=c[d];d++){for(var f=this.Eh[e],h=f.length-1;0<=h;h--)f[h].element===a&&f.splice(h,1);this.Eh[e].length||delete this.Eh[e]}}; +g.$l.prototype.I=function(){this.Eh=this.Gq=this.Jq=this.od=null};g.Gi={};g.Gi.Wj={};g.Gi.Wj.rE={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"}}; +g.Gi.Wj.PD={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"}};g.Gi.Wj=new g.jD;g.i.Abstract=function(){this.Cc=void 0;this.group=g.i.cc();this.Pc=g.i.Pc};g.i.Abstract.prototype.fb=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};g.i.Abstract.prototype.pa=function(a){this.group=a.group};g.i.Abstract.prototype.Uk=function(){return!1};g.i.Abstract.prototype.run=function(){};function ua(a){if(a.Cc)var c=g.Nb.tt(a.Cc);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};g.i.Gg=function(a){g.i.Gg.w.constructor.call(this);this.ni=a.va();this.Cc=a.v.id};g.g.object.X(g.i.Gg,g.i.Abstract);g.i.Gg.prototype.fb=function(){var a=g.i.Gg.w.fb.call(this);a.varId=this.ni;return a};g.i.Gg.prototype.pa=function(a){g.i.Gg.w.fb.call(this);this.ni=a.varId};g.i.He=function(a){a&&(g.i.He.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};g.g.object.X(g.i.He,g.i.Gg);g.i.He.prototype.type=g.i.Lw; +g.i.He.prototype.fb=function(){var a=g.i.He.w.fb.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};g.i.He.prototype.pa=function(a){g.i.He.w.pa.call(this,a);this.Qj=a.varType;this.Pj=a.varName};g.i.He.prototype.run=function(a){var c=ua(this);a?c.Md(this.Pj,this.Qj,this.ni):c.Zf(this.ni)};g.i.df=function(a){a&&(g.i.df.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};g.g.object.X(g.i.df,g.i.Gg);g.i.df.prototype.type=g.i.Mw; +g.i.df.prototype.fb=function(){var a=g.i.df.w.fb.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};g.i.df.prototype.pa=function(a){g.i.df.w.pa.call(this,a);this.Qj=a.varType;this.Pj=a.varName};g.i.df.prototype.run=function(a){var c=ua(this);a?c.Zf(this.ni):c.Md(this.Pj,this.Qj,this.ni)};g.i.Of=function(a,c){a&&(g.i.Of.w.constructor.call(this,a),this.xu=a.name,this.qu=c)};g.g.object.X(g.i.Of,g.i.Gg);g.i.Of.prototype.type=g.i.Nw; +g.i.Of.prototype.fb=function(){var a=g.i.Of.w.fb.call(this);a.oldName=this.xu;a.newName=this.qu;return a};g.i.Of.prototype.pa=function(a){g.i.Of.w.pa.call(this,a);this.xu=a.oldName;this.qu=a.newName};g.i.Of.prototype.run=function(a){var c=ua(this);a?c.gi(this.ni,this.qu):c.gi(this.ni,this.xu)}; +g.Yr=function(a){this.Va=Object.create(null);this.v=a};b=g.Yr.prototype;b.clear=function(){this.Va=Object.create(null)};b.yq=function(a,c){var d=this.Zc(c,a.type),e=y(this.v,!1);g.i.aa(!0);try{if(d&&d.va()!=a.va()){var f=a.type;c!=d.name&&va(d,c,e);for(c=0;cc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.Gq.splice(c,1);this.Zb.unsubscribe(this.Rc);this.options.Rb||(this.Zb.I(),this.Zb=null)}};g.Nb.Bw=3;b=g.Nb.prototype; +b.og=function(a,c){a=a.Sa();c=c.Sa();return a.y+g.Nb.prototype.og.offset*a.x-(c.y+g.Nb.prototype.og.offset*c.x)};function wa(a,c){if(!g.g.cp(a.vl,c))throw Error("Block not present in workspace's list of top-most blocks.");}function A(a,c){var d=[].concat(a.vl);c&&1h)return!1;d+=c[e]}return d>ya(a)?!1:!0} +function Aa(a){return Infinity!=a.options.ju||!!a.options.ku}b.yv=function(a){var c=a?this.yn:this.Nj,d=a?this.Nj:this.yn,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=g.i.filter(f,a);g.i.Pc=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{g.i.Pc=!0}}};function Ba(a,c){a.Cd.push(c)}function Ca(a,c){g.g.cp(a.Cd,c)}function x(a,c){return a.ss[c]||null}g.Nb.cm=Object.create(null);g.Nb.tt=function(a){return g.Nb.cm[a]||null}; +g.Nb.getAll=function(){var a=[],c;for(c in g.Nb.cm)a.push(g.Nb.cm[c]);return a};g.na=function(a,c,d,e,f,h){this.s=a;this.kf=c;this.nA=d;d=g.na.VA;this.s.G&&(d=-d);this.ED=g.g.Rd.rv(d);a.zf.appendChild(this.rm(c,!(!f||!h)));this.bc=e;this.zq&&Da(this);f&&h||(c=this.kf.getBBox(),f=c.width+2*g.na.gd,h=c.height+2*g.na.gd);this.Fn(f,h);Da(this);Ea(this);this.zq=!0;a.options.readOnly||(g.ca(this.gm,"mousedown",this,this.LD),this.ng&&g.ca(this.ng,"mousedown",this,this.$G))};g.na.gd=6;g.na.WA=5;g.na.VA=20;g.na.Fv=4;g.na.TA=8;g.na.Ue=null;g.na.hg=null;g.na.prototype.Uu=null; +g.na.xv=function(){g.na.Ue&&(g.Ua(g.na.Ue),g.na.Ue=null);g.na.hg&&(g.Ua(g.na.hg),g.na.hg=null)};g.na.MD=function(){g.Touch.Dh();g.na.xv()};b=g.na.prototype;b.zq=!1;b.bc=null;b.eh=0;b.ei=0;b.yb=0;b.$c=0;b.ps=!0; +b.rm=function(a,c){this.ke=g.g.o.K("g",{},null);var d={filter:"url(#"+this.s.options.Xx+")"};g.g.userAgent.bC&&(d={});d=g.g.o.K("g",d,this.ke);this.ws=g.g.o.K("path",{},d);this.gm=g.g.o.K("rect",{"class":"blocklyDraggable",x:0,y:0,rx:g.na.gd,ry:g.na.gd},d);c?(this.ng=g.g.o.K("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.ke),c=2*g.na.gd,g.g.o.K("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.ng),g.g.o.K("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.ng),g.g.o.K("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.ng)):this.ng=null;this.ke.appendChild(a);return this.ke};b.za=function(){return this.ke};function Ga(a,c){a.ke.dataset&&(a.ke.dataset.blockId=c)}b.LD=function(a){var c=this.s.Vg(a);if(c){if(c.aj)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.ve||(c.ve=this);c.vf=a}};b.Jn=function(){};b.qe=function(){return!1}; +b.$G=function(a){Ha(this);g.na.xv();g.g.lj(a)||(this.s.mv(a,new g.g.V(this.s.G?-this.yb:this.yb,this.$c)),g.na.Ue=g.ca(document,"mouseup",this,g.na.MD),g.na.hg=g.ca(document,"mousemove",this,this.aH),g.wc());a.stopPropagation()};b.aH=function(a){this.ps=!1;var c=this.s;a=g.g.nn(a,r(c),qa(c));a.x/=c.scale;a.y/=c.scale;c=g.g.V.sum(c.Ux,a);this.Fn(this.s.G?-c.x:c.x,c.y);this.s.G&&Da(this)};function Ha(a){var c=a.ke.parentNode;return c.lastChild!==a.ke?(c.appendChild(a.ke),!0):!1} +function Ia(a,c,d){var e=a.s.G?a.bc.x-c.x-a.yb:c.x+a.bc.x;c=c.y+a.bc.y;return Math.max(0,Math.min(1,(Math.min(e+a.yb,d.gc+d.vb)-Math.max(e,d.gc))*(Math.min(c+a.$c,d.pc+d.Cb)-Math.max(c,d.pc))/(a.yb*a.$c)))}function Da(a){var c=a.bc.x;c=a.s.G?c-(a.eh+a.yb):c+a.eh;a.moveTo(c,a.ei+a.bc.y)}b.moveTo=function(a,c){this.ke.setAttribute("transform","translate("+a+","+c+")")};b.st=function(){return new g.g.ge(this.yb,this.$c)}; +b.Fn=function(a,c){var d=2*g.na.gd;a=Math.max(a,d+45);c=Math.max(c,d+20);this.yb=a;this.$c=c;this.gm.setAttribute("width",a);this.gm.setAttribute("height",c);this.ng&&(this.s.G?this.ng.setAttribute("transform","translate("+2*g.na.gd+","+(c-d)+") scale(-1 1)"):this.ng.setAttribute("transform","translate("+(a-d)+","+(c-d)+")"));if(this.ps){a=this.s.jc();a.gc/=this.s.scale;a.vb/=this.s.scale;a.pc/=this.s.scale;a.Cb/=this.s.scale;c=-this.yb/4;if(!(this.yb>a.vb)){if(this.s.G){d=this.bc.x-c;var e=d-this.yb; +var f=a.gc+a.vb,h=a.gc+g.La.xc/this.s.scale}else e=c+this.bc.x,d=e+this.yb,h=a.gc,f=a.gc+a.vb-g.La.xc/this.s.scale;this.s.G?ef&&(c=-(f-this.bc.x)):ef&&(c=f-this.bc.x-this.yb)}e=c;c=-this.$c/4;if(!(this.$c>a.Cb)){d=this.bc.y+c;f=d+this.$c;h=a.pc;var k=a.pc+a.Cb-g.La.xc/this.s.scale,l=this.bc.y;dk&&(c=k-l-this.$c)}h=c;f=this.nA.getBBox();c={x:e,y:-this.$c-g.xa.yr};d={x:-this.yb-30,y:h};h={x:f.width,y:h};k={x:e,y:f.height};e=f.widthh&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),t=Math.cos(m),v=a.st();m=(v.width+v.height)/g.na.WA;m=Math.min(m,v.width,v.height)/4;v=1-g.na.TA/k;f=d+v*f;h=e+v*h;v=d+m*t;var w=e+m*n;d-=m*t;e-=m*n;n=l+a.ED;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/g.na.Fv;k=Math.cos(n)*k/g.na.Fv;c.push("M"+v+","+ +w);c.push("C"+(v+k)+","+(w+l)+" "+f+","+h+" "+f+","+h);c.push("C"+f+","+h+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.ws.setAttribute("d",c.join(" "))}b.se=function(a){this.gm.setAttribute("fill",a);this.ws.setAttribute("fill",a)};b.I=function(){g.na.xv();g.g.o.removeNode(this.ke);this.nA=this.kf=this.s=this.ng=this.gm=this.ws=this.ke=null};b.nu=function(a,c){a?a.Mj(c.x,c.y):this.moveTo(c.x,c.y);this.eh=this.s.G?this.bc.x-c.x-this.yb:c.x-this.bc.x;this.ei=c.y-this.bc.y;Ea(this)}; +b.Sa=function(){return new g.g.V(this.bc.x+this.eh,this.bc.y+this.ei)};g.g.xml={};g.g.xml.xC="https://developers.google.com/blockly/xml";g.g.xml.document=function(){return document};g.g.xml.createElement=function(a){return g.g.xml.document().createElementNS(g.g.xml.xC,a)};g.g.xml.createTextNode=function(a){return g.g.xml.document().createTextNode(a)};g.g.xml.vH=function(a){return(new DOMParser).parseFromString(a,"text/xml")};g.g.xml.Nd=function(a){return(new XMLSerializer).serializeToString(a)};g.i.Ef=function(a){g.i.Ef.w.constructor.call(this);this.Gc=a.id;this.Cc=a.v.id};g.g.object.X(g.i.Ef,g.i.Abstract);g.i.Ef.prototype.fb=function(){var a=g.i.Ef.w.fb.call(this);a.blockId=this.Gc;return a};g.i.Ef.prototype.pa=function(a){g.i.Ef.w.pa.call(this,a);this.Gc=a.blockId};g.i.rh=function(a,c,d,e,f){a&&(g.i.rh.w.constructor.call(this,a),this.element=c,this.name=d,this.oldValue=e,this.newValue=f)};g.g.object.X(g.i.rh,g.i.Ef);g.i.sg=g.i.rh;b=g.i.rh.prototype;b.type=g.i.si; +b.fb=function(){var a=g.i.rh.w.fb.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};b.pa=function(a){g.i.rh.w.pa.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};b.Uk=function(){return this.oldValue==this.newValue}; +b.run=function(a){var c=x(ua(this),this.Gc);if(c)switch(c.Sd&&c.Sd.Yb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=B(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.ji(a||null);break;case "collapsed":c.kh(!!a);break;case "disabled":c.qd(!a);break;case "inline":c.te(!!a);break;case "mutation":var d="";c.Pa&&(d=(d=c.Pa())&&g.R.Nd(d));if(c.lb){var e=g.R.mi(a||"");c.lb(e)}g.i.Oa(new g.i.rh(c,"mutation",null,d, +a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.Gc)};g.i.Ye=function(a){a&&(g.i.Ye.w.constructor.call(this,a),this.xml=a.v.ga?g.R.ts(a):g.R.Bh(a),this.Ph=g.i.ty(a))};g.g.object.X(g.i.Ye,g.i.Ef);g.i.oo=g.i.Ye;g.i.Ye.prototype.type=g.i.wo;g.i.Ye.prototype.fb=function(){var a=g.i.Ye.w.fb.call(this);a.xml=g.R.Nd(this.xml);a.ids=this.Ph;return a}; +g.i.Ye.prototype.pa=function(a){g.i.Ye.w.pa.call(this,a);this.xml=g.R.mi(a.xml);this.Ph=a.ids};g.i.Ye.prototype.run=function(a){var c=ua(this);if(a)a=g.g.xml.createElement("xml"),a.appendChild(this.xml),g.R.Hh(a,c);else{a=0;for(var d;d=this.Ph[a];a++){var e=x(c,d);e?e.I(!1):d==this.Gc&&console.warn("Can't uncreate non-existent block: "+d)}}}; +g.i.Ff=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");g.i.Ff.w.constructor.call(this,a);this.zu=a.v.ga?g.R.ts(a):g.R.Bh(a);this.Ph=g.i.ty(a)}};g.g.object.X(g.i.Ff,g.i.Ef);g.i.aB=g.i.Ff;g.i.Ff.prototype.type=g.i.El;g.i.Ff.prototype.fb=function(){var a=g.i.Ff.w.fb.call(this);a.ids=this.Ph;return a};g.i.Ff.prototype.pa=function(a){g.i.Ff.w.pa.call(this,a);this.Ph=a.ids}; +g.i.Ff.prototype.run=function(a){var c=ua(this);if(a){a=0;for(var d;d=this.Ph[a];a++){var e=x(c,d);e?e.I(!1):d==this.Gc&&console.warn("Can't delete non-existent block: "+d)}}else a=g.g.xml.createElement("xml"),a.appendChild(this.zu),g.R.Hh(a,c)};g.i.zi=function(a){a&&(g.i.zi.w.constructor.call(this,a),a=Ja(this),this.Fz=a.Pz,this.Ez=a.az,this.vu=a.xx)};g.g.object.X(g.i.zi,g.i.Ef);g.i.Cl=g.i.zi;b=g.i.zi.prototype;b.type=g.i.Sl; +b.fb=function(){var a=g.i.zi.w.fb.call(this);this.sj&&(a.newParentId=this.sj);this.rj&&(a.newInputName=this.rj);this.$h&&(a.newCoordinate=Math.round(this.$h.x)+","+Math.round(this.$h.y));return a};b.pa=function(a){g.i.zi.w.pa.call(this,a);this.sj=a.newParentId;this.rj=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.$h=new g.g.V(Number(a[0]),Number(a[1])))};b.zj=function(){var a=Ja(this);this.sj=a.Pz;this.rj=a.az;this.$h=a.xx}; +function Ja(a){var c=x(ua(a),a.Gc);a={};var d=c.getParent();if(d){a.Pz=d.id;a:{for(var e=0,f;f=d.P[e];e++)if(f.connection&&C(f.connection)==c){c=f;break a}c=null}c&&(a.az=c.name)}else a.xx=c.Sa();return a}b.Uk=function(){return this.Fz==this.sj&&this.Ez==this.rj&&g.g.V.Le(this.vu,this.$h)}; +b.run=function(a){var c=ua(this),d=x(c,this.Gc);if(d){var e=a?this.sj:this.Fz,f=a?this.rj:this.Ez;a=a?this.$h:this.vu;var h=null;if(e&&(h=x(c,e),!h)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&D(d);if(a)f=d.Sa(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.L||d.$;if(f){if(c=E(h,f))var k=c.connection}else d.type==g.cf&&(k=h.U);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.Gc)};g.i.yd=function(a,c,d,e){g.i.yd.w.constructor.call(this);this.Gc=a?a.id:null;this.Cc=a?a.v.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Pc=!1};g.g.object.X(g.i.yd,g.i.Abstract);g.i.yd.prototype.type=g.i.$o;g.i.yd.prototype.fb=function(){var a=g.i.yd.w.fb.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.Gc&&(a.blockId=this.Gc);return a}; +g.i.yd.prototype.pa=function(a){g.i.yd.w.pa.call(this,a);this.element=a.element;this.newValue=a.newValue;this.Gc=a.blockId};g.Hd=function(a){this.T=a};b=g.Hd.prototype;b.lx=!0;b.Wo=17;b.Ub=null;b.dj=null;function Ka(a){a.Pd||(a.Pd=g.g.o.K("g",{"class":"blocklyIconGroup"},null),a.T.ec&&g.g.o.rb(a.Pd,"blocklyIconGroupReadonly"),a.Zs(a.Pd),a.T.za().appendChild(a.Pd),g.ca(a.Pd,"mouseup",a,a.Lt),a.ph())}b.I=function(){g.g.o.removeNode(this.Pd);this.Pd=null;this.Yb(!1);this.T=null};b.ph=function(){};b.isVisible=function(){return!!this.Ub};b.Lt=function(a){this.T.v.lc()||this.T.ec||g.g.lj(a)||this.Yb(!this.isVisible())}; +b.Xe=function(){this.isVisible()&&this.Ub.se(this.T.Ni)};function La(a){var c=a.T.Sa(),d=g.g.Oe(a.Pd);c=new g.g.V(c.x+d.x+a.Wo/2,c.y+d.y+a.Wo/2);g.g.V.Le(a.dj,c)||(a.dj=c,a.isVisible()&&(a=a.Ub,a.bc=c,a.zq&&Da(a)))};g.Pf=function(a){g.Pf.w.constructor.call(this,a);Ka(this);this.Ed={}};g.g.object.X(g.Pf,g.Hd);g.Pf.prototype.lx=!1;g.Pf.prototype.Zs=function(a){g.g.o.K("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);g.g.o.K("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);g.g.o.K("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)}; +g.Pf.wH=function(a){var c=g.g.o.K("text",{"class":"blocklyText blocklyBubbleText",y:g.na.gd},null);a=a.split("\n");for(var d=0;d>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};g.Tc.$u=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +g.Tc.er=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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;","}"]; +g.D=function(){};g.D.ye=null;g.D.vs=null;g.D.od=null;g.D.tq=null;g.D.ho=16;g.D.Mv=1;g.D.Hv=12;g.D.rw=16;g.D.Zq=.25;g.D.Rv="#dadce0";g.D.Sv="#fff";g.D.js=null;g.D.uj=null; +g.D.Ja=function(){if(!g.D.ye){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=g.D.Sv;a.style.borderColor=g.D.Rv;document.body.appendChild(a);g.D.ye=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);g.D.kf=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);g.D.ff=c;g.D.ye.style.opacity=0;g.D.ye.style.transition="transform "+g.D.Zq+"s, opacity "+g.D.Zq+"s";a.addEventListener("focusin", +function(){g.g.o.rb(a,"focused")});a.addEventListener("focusout",function(){g.g.o.Sb(a,"focused")})}};g.D.iA=function(a){g.D.vs=a};g.D.sy=function(){return g.D.kf};g.D.YD=function(){g.D.kf.innerHTML="";g.D.kf.style.width=""};g.D.se=function(a){g.D.ye.style.backgroundColor=a;g.D.ye.style.borderColor=void 0};g.D.sM=function(a){g.D.ye.setAttribute("data-category",a)}; +g.D.uM=function(a,c,d,e){var f=c.v.scale,h=c.width,k=c.height;h*=f;k*=f;f=c.za().getBoundingClientRect();h=f.left+h/2;k=f.top+k;f=f.top;e&&(f+=e);g.D.iA(r(c.v).parentNode);return g.D.show(a,c.G,h,k,h,f,d)};g.D.oA=function(a,c){var d=a.za().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var h=a.B;g.D.tq=!0;g.D.iA(r(h.v).parentNode);g.D.show(a,h.G,e,f,e,d,c)}; +g.D.show=function(a,c,d,e,f,h,k){g.D.od=a;g.D.uj=k||null;a=g.D.By(d,e,f,h);a.ns?(g.D.ff.style.display="",g.D.ff.style.transform="translate("+a.fm+"px,"+a.Ww+"px) rotate(45deg)",g.D.ff.setAttribute("class",a.ls?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):g.D.ff.style.display="none";g.D.ye.style.direction=c?"rtl":"ltr";g.D.un(a.Rp,a.Sp,a.zp,a.Ap);return a.ls}; +g.D.ZE=function(){var a=g.D.vs.getBoundingClientRect(),c=g.g.style.Wg(g.D.vs);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};g.D.By=function(a,c,d,e){var f=g.D.ZE(),h=g.g.style.Wg(g.D.ye);return c+h.heightf.top?g.D.zy(d,e,f,h):c+h.heightdocument.documentElement.clientTop?g.D.zy(d,e,f,h):g.D.jF(a,f,h)}; +g.D.Ay=function(a,c,d,e){a=g.D.yt(a,d.left,d.right,e.width);return{Rp:a.Fk,Sp:c,zp:a.Fk,Ap:c+g.D.rw,fm:a.fm,Ww:-(g.D.ho/2+g.D.Mv),ls:!0,ns:!0}};g.D.zy=function(a,c,d,e){a=g.D.yt(a,d.left,d.right,e.width);return{Rp:a.Fk,Sp:c-e.height,zp:a.Fk,Ap:c-e.height-g.D.rw,fm:a.fm,Ww:e.height-2*g.D.Mv-g.D.ho/2,ls:!1,ns:!0}};g.D.jF=function(a,c,d){a=g.D.yt(a,c.left,c.right,d.width);return{Rp:a.Fk,Sp:0,zp:a.Fk,Ap:0,ns:!1}}; +g.D.yt=function(a,c,d,e){var f=a;a=g.g.Rd.zk(c,a-e/2,d-e);f-=g.D.ho/2;c=g.g.Rd.zk(g.D.Hv,f-a,e-g.D.Hv-g.D.ho);return{fm:c,Fk:a}};g.D.isVisible=function(){return!!g.D.od};g.D.Ok=function(a,c){g.D.od===a&&(c?g.D.bj():g.D.Ha())};g.D.Ha=function(){var a=g.D.ye;a.style.transform="translate(0, 0)";a.style.opacity=0;g.D.js=setTimeout(function(){g.D.bj()},1E3*g.D.Zq);g.D.uj&&(g.D.uj(),g.D.uj=null)}; +g.D.bj=function(){if(g.D.isVisible()){g.D.js&&clearTimeout(g.D.js);var a=g.D.ye;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=g.D.Sv;a.style.borderColor=g.D.Rv;g.D.uj&&(g.D.uj(),g.D.uj=null);g.D.YD();g.D.od=null}}; +g.D.un=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=g.D.ye;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)"}; +g.D.nM=function(){if(g.D.od){var a=g.D.od.B,c=a.v.scale,d=g.D.tq?g.D.od.Bb.width:a.width,e=g.D.tq?g.D.od.Bb.height:a.height;d*=c;e*=c;a=g.D.tq?g.D.od.me.getBoundingClientRect():a.za().getBoundingClientRect();d=a.left+d/2;e=g.D.By(d,a.top+e,d,a.top);g.D.un(e.Rp,e.Sp,e.zp,e.Ap)}else g.D.Ha()};g.sb={};g.sb.Us=0;g.sb.tp=null;g.sb.DE=function(a){var c=a.v,d=a.za();c.Rf.play("delete");a=Qa(c,d);d=d.cloneNode(!0);d.CH=a.x;d.DH=a.y;d.setAttribute("transform","translate("+a.x+","+a.y+")");r(c).appendChild(d);d.Xw=d.getBBox();g.sb.Px(d,c.G,new Date,c.scale)};g.sb.Px=function(a,c,d,e){var f=(new Date-d)/150;1d)){var e=Qa(c,a.za());a.L?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.$&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=g.g.o.K("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},r(c));g.sb.tx(a,new Date,d)}};g.sb.tx=function(a,c,d){var e=(new Date-c)/150;1a.v.scale)){var c=Ra(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);g.sb.Nx(a.za(),c,new Date)}};g.sb.Nx=function(a,c,d){var e=(new Date-d)/200;1a-g.nB)}if(a.Mc||a.Jb)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Mc||!a.Jb);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function Ua(a){a.Jb&&(g.g.o.removeNode(g.ta.Yy),delete g.ta.Yy);if(a.Kt){var c=a.Jb;c.type!=g.Ra||c.isConnected()?Va(a.Pk,!1):a.Pk.DF(c,!1);a.Pk=null;a.Kt=!1}else if(a.oj)if(a.oj){c=a.oj;var d=c.B,e=d.U,f=d.$,h=d.L;h=c.type==g.Ra&&!(h&&h.ka);!(c!=e||f&&f.ka)||h?D(C(c),!1):c.type==g.Xa&&c!=e?(e=c.ka,D(e.B,!1),f=f?f.ka:null,D(d,!0),f&&f.connect(e)):D(d,!0);if(c.ka)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.oj=null;d.za().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +g.Jo.prototype.Kk=function(){var a=[];this.Hk&&a.push(this.Hk);this.mj&&a.push(this.mj);return a};g.ri=function(a,c){this.Kb=a;this.s=c;this.$f=new g.Jo(this.Kb);this.Vi=null;this.rg=!1;this.pg=this.Kb.Sa();this.wp=g.ri.JF(a)};g.ri.prototype.I=function(){this.zc=this.s=this.Kb=null;this.wp.length=0;this.$f&&(this.$f.I(),this.$f=null)};g.ri.JF=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Wa(e);for(var f=0;fg.J.LC&&g.J.Ha()}else g.J.rq!=g.J.mb&&(clearTimeout(g.J.Kn),g.J.Xt=a.pageX,g.J.Yt=a.pageY,g.J.Kn=setTimeout(g.J.kH,g.J.RB))};g.J.Ha=function(){g.J.visible&&(g.J.visible=!1,g.J.Ca&&(g.J.Ca.style.display="none"));g.J.Kn&&clearTimeout(g.J.Kn)};g.J.block=function(){g.J.Ha();g.J.xk=!0};g.J.EH=function(){g.J.xk=!1}; +g.J.kH=function(){if(!g.J.xk&&(g.J.rq=g.J.mb,g.J.Ca)){g.J.Ca.innerHTML="";for(var a=g.J.mb.Af;"function"==typeof a;)a=a();a=g.g.jb.IA(a,g.J.fC);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=g.J.Ca.offsetHeight+2*g.J.ow);a?e=Math.max(g.J.rr-window.scrollX,e):e+g.J.Ca.offsetWidth>c+window.scrollX-2*g.J.rr&&(e=c-g.J.Ca.offsetWidth-2*g.J.rr);g.J.Ca.style.top=f+"px";g.J.Ca.style.left=e+"px"}};g.$j=function(a,c){this.zc=this.Ac=this.Ej=this.Fj=this.ve=this.zd=this.yz=null;this.Is=c;this.Vm=this.ij=this.Wm=this.Zi=!1;this.vf=a;this.O=this.pi=this.gf=this.Ig=this.oq=this.nq=null;this.Xp=this.aj=this.bx=!1;this.Ty=!g.yB};b=g.$j.prototype;b.I=function(){g.Touch.Dh();g.J.EH();this.Is.Ic=null;this.nq&&g.Ua(this.nq);this.oq&&g.Ua(this.oq);this.O=this.zc=this.Ac=this.Ej=this.Fj=null;this.gf&&(this.gf.I(),this.gf=null);this.pi&&(this.pi.I(),this.pi=null);this.Ig&&(this.Ig.I(),this.Ig=null)}; +function jb(a,c){a.zd=g.g.V.Ek(new g.g.V(c.clientX,c.clientY),a.yz);if(a.Zi)var d=!1;else a.Zi=g.g.V.aG(a.zd)>(a.O?g.GB:g.xB),d=a.Zi;if(d){if(a.bx)throw Error("updateIsDragging_ should only be called once per gesture.");a.bx=!0;if(a.ve){a.Vm=!0;a.Ig=new g.Dl(a.ve,a.zc);d=a.Ig;g.i.cc()||g.i.aa(!0);d.s.Qc(!1);d.uc.ps=!1;d.Xi&&d.pu();d.uc.Bj&&d.uc.Bj(!0);var e=d.s.sa;e&&g.g.o.rb(e.Ec,d.uc.qe()?"blocklyToolboxDelete":"blocklyToolboxGrab");fb(a.Ig,a.vf,a.zd);d=!0}else d=!1;if(!d){if(a.Ac)if(a.O?(a.O.ez(a.Ac)? +((d=!kb(a.O))||(d=a.zd,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.O.IE,d=d-e||d<-180+e||d>180-e?!0:!1),d?(a.zc=a.O.ub,lb(a.zc),g.i.cc()||g.i.aa(!0),a.Ej=null,a.Ac=mb(a.O,a.Ac),a.Ac.select(),d=!0):d=!1):d=!1,a.ij=d):a.Ac.Lc()&&(a.ij=!0),a.ij){a.gf=new g.ri(a.Ac,a.zc);d=a.gf;e=a.zd;var f=a.Ty;g.i.cc()||g.i.aa(!0);d.s.kj&&cb(d.Kb);g.g.o.Mn();d.s.Qc(!1);g.sb.Vs();if(d.Kb.getParent()||f&&d.Kb.U&&C(d.Kb.U))D(d.Kb,f),e=d.bl(e),e=g.g.V.sum(d.pg,e),d.Kb.translate(e.x,e.y),g.sb.CE(d.Kb);d.Kb.Bj(!0);d.Kb.pu(); +(e=d.s.sa)&&g.g.o.rb(e.Ec,d.Kb.qe()?"blocklyToolboxDelete":"blocklyToolboxGrab");Xa(a.gf,a.vf,a.zd);d=!0}else d=!1;else d=!1;if(d=!d)if(a.O)d=kb(a.O);else if(d=a.zc)d=a.zc,d=d.options.Nc&&d.options.Nc.Ih;d&&(a.pi=a.O?new g.Fo(a.O):new g.dm(a.zc),a.Wm=!0,a.pi.mv())}g.Zh()}a.vf=c} +b.Ws=function(a){g.g.$p(a)?this.cancel():(this.aj=!0,g.sb.Vs(),lb(this.zc),this.zc.kj&&this.zc.resize(),pa(this.zc),this.vf=a,g.wc(!!this.O),g.J.block(),this.Ac&&(!this.Ac.ec&&a.shiftKey?(g.navigation.ht(),u(this.Is.cb,g.navigation.Bt(this.Ac))):this.Ac.select()),g.g.lj(a)?ba(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||g.ZF(a,this),this.yz=new g.g.V(a.clientX,a.clientY),this.Ty=a.altKey||a.ctrlKey||a.metaKey,this.wk(a)))}; +b.wk=function(a){this.nq=g.ca(document,"mousemove",null,this.Pm.bind(this));this.oq=g.ca(document,"mouseup",null,this.Mp.bind(this));a.preventDefault();a.stopPropagation()};b.Pm=function(a){jb(this,a);this.Wm?this.pi.Ih(this.zd):this.ij?Xa(this.gf,this.vf,this.zd):this.Vm&&fb(this.Ig,this.vf,this.zd);a.preventDefault();a.stopPropagation()}; +b.Mp=function(a){jb(this,a);g.Zh();if(this.Xp)console.log("Trying to end a gesture recursively.");else{this.Xp=!0;if(this.Vm)gb(this.Ig,a,this.zd);else if(this.ij)ab(this.gf,a,this.zd);else if(this.Wm){var c=this.pi;c.Ih(this.zd);sa(c.s)}else if(this.ve&&!this.Zi)this.ve.hH&&this.ve.hH(),this.ve.select&&this.ve.select();else if(nb(this))this.Fj.yf(),ob(this);else if(this.Ej&&!this.Zi&&!nb(this))this.O&&this.O.vk?this.Ac.isEnabled()&&(g.i.cc()||g.i.aa(!0),eb(mb(this.O,this.Ac))):g.i.Oa(new g.i.yd(this.Ej, +"click",void 0,void 0)),ob(this),g.i.aa(!1);else if(!(this.Ej||this.ve||this.Fj||this.Zi))if(c=this.Is,a.shiftKey){g.navigation.ht();var d=g.g.eH(c,new g.g.V(a.clientX,a.clientY));d=g.F.um(c,d);u(c.cb,d)}else g.selected&&ib(g.selected);a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.Xp){g.Zh();if(this.Vm)gb(this.Ig,this.vf,this.zd);else if(this.ij)ab(this.gf,this.vf,this.zd);else if(this.Wm){var a=this.pi;a.Ih(this.zd);sa(a.s)}this.I()}}; +function ba(a,c){a.Ac?(ob(a),g.wc(a.O),a.Ac.Jn(c)):a.ve?a.ve.Jn(c):a.zc&&!a.O&&(g.wc(),a.zc.Jn(c));c.preventDefault();c.stopPropagation();a.I()}function pb(a,c,d){if(a.aj)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.zc||(a.zc=d);a.vf=c;a.Ws(c);g.Se&&g.navigation.eb(g.navigation.Xl)}function qb(a,c,d){if(a.aj)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.O||(a.O=d);pb(a,c,d.Lk())} +function ob(a){a.Ac&&!a.O&&cb(a.Ac)}function rb(a,c){a.Ej||a.ve||(a.Ej=c,c.ec&&c!=db(c)?sb(a,db(c)):sb(a,c))}function sb(a,c){c.ib?sb(a,c.getParent()):a.Ac=c}function nb(a){if(a.Fj){var c=a.Fj;c=!!c.B&&c.B.nd()&&!!c.yf&&"function"===typeof c.yf}else c=!1;return c&&!a.Zi&&(!a.O||!a.O.vk)}b.lc=function(){return this.Wm||this.ij||this.Vm};b.Kk=function(){return this.gf?this.gf.Kk():[]};g.$j.Mt=function(){for(var a=g.Nb.getAll(),c=0,d;d=a[c];c++)if(d.Ic)return!0;return!1};g.oa=function(a,c,d){this.zA=this.Oj=this.$a=null;this.Bb=new g.g.ge(0,0);this.Yc=null;d&&this.ld(d);this.setValue(a);c&&(this.Oj=c)};g.oa.lo=16;g.oa.Hw=12.5;g.oa.rk=10;g.oa.bs=10;g.oa.wg=g.oa.rk/2;b=g.oa.prototype;b.name=void 0;b.hq=50;b.B=null;b.sf=!0;b.oi=!0;b.kp=null;g.oa.Oo="\u00a0";b=g.oa.prototype;b.Gf=!0;b.Ei=!1;b.ld=function(a){var c=a.tooltip;"string"==typeof c&&(c=g.g.nc(a.tooltip));c&&this.Ta(c)};b.fv=function(a){if(this.B)throw Error("Field already bound to a block.");this.B=a}; +b.Z=function(){this.me||(this.me=g.g.o.K("g",{},null),this.isVisible()||(this.me.style.display="none"),this.B.za().appendChild(this.me),this.Zg(),this.ph(),this.Ta(this.zA),g.J.wk(this.kp||this.za()),this.xz=g.ca(this.kp||this.za(),"mousedown",this,this.ai),this.ej())};b.Zg=function(){tb(this);ub(this)};b.ej=function(){}; +function tb(a){a.Bb.height=Math.max(a.Bb.height,g.oa.lo);a.Bb.width=Math.max(a.Bb.width,g.oa.rk);a.Kd=g.g.o.K("rect",{rx:4,ry:4,x:0,y:0,height:a.Bb.height,width:a.Bb.width},a.me)}function ub(a){a.Bc=g.g.o.K("text",{"class":"blocklyText",y:g.oa.Hw,x:a.Kd?g.oa.wg:0},a.me);a.Kj=document.createTextNode("");a.Bc.appendChild(a.Kj)}b.Gm=function(a){this.setValue(a.textContent)};b.xA=function(a){a.textContent=this.getValue();return a};b.I=function(){g.D.Ok(this);g.ba.Ok(this);this.xz&&g.Ua(this.xz);g.g.o.removeNode(this.me)}; +b.ph=function(){var a=this.kp||this.za();this.Gf&&a&&(this.B.nd()?(g.g.o.rb(a,"blocklyEditableText"),g.g.o.Sb(a,"blocklyNonEditableText"),a.style.cursor=this.xo):(g.g.o.rb(a,"blocklyNonEditableText"),g.g.o.Sb(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.oi};b.Yb=function(a){if(this.oi!=a){this.oi=a;var c=this.za();c&&(c.style.display=a?"block":"none")}};function vb(a,c){a.Oj=c}b.Iy=function(){return this.Oj};b.za=function(){return this.me};b.Xe=function(){}; +b.fh=function(){this.Kj&&(this.Kj.nodeValue=this.Ep(),this.zv())};b.zv=function(){var a=g.g.o.Nm(this.Bc);this.Kd&&(a+=g.oa.rk,this.Kd.setAttribute("width",a));this.Bb.width=a};b.Wg=function(){if(!this.isVisible())return new g.g.ge(0,0);this.sf?(this.fh(),this.sf=!1):this.oi&&0==this.Bb.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.fh());return this.Bb}; +function wb(a){var c=a.Kd.getBBox(),d=c.height*a.B.v.scale;c=c.width*a.B.v.scale;a=g.g.style.Mm(a.Kd);return{top:a.y,bottom:a.y+d,left:a.x,right:a.x+c}}b.Ep=function(){var a=this.dc();if(!a)return g.oa.Oo;a.length>this.hq&&(a=a.substring(0,this.hq-2)+"\u2026");a=a.replace(/\s/g,g.oa.Oo);this.B&&this.B.G&&(a+="\u200f");return a};b.dc=function(){if(this.Jp){var a=this.Jp.call(this);if(null!==a)return String(a)}return String(this.getValue())}; +b.ll=function(){throw Error("setText method is deprecated");};b.hn=function(){this.sf=!0};function xb(a){a.sf=!0;a.B&&a.B.ga&&(a.B.Ea(),a.B.Pb())}b.setValue=function(a){if(null!==a){var c=this.Qg(a);a=yb(this,a,c);if(!(a instanceof Error)){if(c=this.Iy())if(c=c.call(this,a),a=yb(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&g.i.isEnabled()&&g.i.Oa(new g.i.sg(this.B,"field",this.name||null,c,a)),this.Rg(a),this.sf&&xb(this))}}}; +function yb(a,c,d){if(null===d)return a.Tx(),a.sf&&xb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.$a};b.Qg=function(a){return null===a||void 0===a?null:a};b.Rg=function(a){this.$a=a;this.sf=!0};b.Tx=function(){};b.ai=function(a){if(this.B&&this.B.v&&(a=this.B.v.Vg(a))){if(a.aj)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.Fj||(a.Fj=this)}};b.Ta=function(a){var c=this.kp||this.za();c?c.Af=a||""===a?a:this.B:this.zA=a}; +b.zn=function(){return!1};b.ag=function(){for(var a=null,c=this.B,d=c.P,e=0;ea&&0<=c&&256>c&&0<=d&&256>d)?g.g.Ab.Xu(a,c,d):null}; +g.g.Ab.Xu=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};g.g.Ab.Uy=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +g.g.Ab.EF=function(a){var c=g.SB,d=255*g.TB,e=0,f=0,h=0;if(0==c)h=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;h=a;break;case 2:e=a;f=d;h=c;break;case 3:e=a;f=m;h=d;break;case 4:e=c;f=a;h=d;break;case 5:e=d;f=a;h=m;break;case 6:case 0:e=d,f=c,h=a}}return g.g.Ab.Xu(Math.floor(e),Math.floor(f),Math.floor(h))}; +g.g.Ab.rs=function(a,c,d){a=g.g.Ab.Uy(g.g.Ab.parse(a));c=g.g.Ab.Uy(g.g.Ab.parse(c));return g.g.Ab.Xu(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])))};g.g.Ab.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"};g.g.Ol={};g.g.Ol.pG=0;g.g.Ol.yy=function(){return"blockly:"+(g.g.Ol.pG++).toString(36)};g.Ib=function(a,c,d){g.Ib.w.constructor.call(this,a||g.Ib.qo[0],c,d);this.Bb=new g.g.ge(g.Ib.vB,g.oa.lo)};g.g.object.X(g.Ib,g.oa);g.Ib.pa=function(a){return new g.Ib(a.colour,void 0,a)};g.Ib.vB=26;g.Ib.sI=g.oa.lo;b=g.Ib.prototype;b.Ei=!0;b.xo="default";b.sf=!1;b.Ds=null;b.wA=null;b.lm=0;b.ld=function(a){g.Ib.w.ld.call(this,a);a.colourOptions&&(this.Ds=a.colourOptions,this.wA=a.colourTitles);a.columns&&(this.lm=a.columns)};b.Zg=function(){tb(this);this.Kd.style.fillOpacity=1;this.Kd.style.fill=this.$a}; +b.Qg=function(a){return"string"!=typeof a?null:g.g.Ab.parse(a)};b.Rg=function(a){this.$a=a;this.Kd&&(this.Kd.style.fill=a)};b.dc=function(){var a=this.$a;/^#(.)\1(.)\2(.)\3$/.test(a)&&(a="#"+a[1]+a[3]+a[5]);return a};g.Ib.qo="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" "); +g.Ib.gD=[];g.Ib.so=7;b=g.Ib.prototype;b.setColumns=function(a){this.lm=a;return this};b.yf=function(){this.dh=this.ft();g.D.sy().appendChild(this.dh);g.D.oA(this,this.gt.bind(this));this.dh.focus()};b.lq=function(a){a=(a=a.target)&&a.label;null!==a&&(this.setValue(a),g.D.Ok(this))}; +b.Eu=function(a){var c=!1;if(a.keyCode===g.g.ya.am)Hb(this,0,-1),c=!0;else if(a.keyCode===g.g.ya.Fl)Hb(this,0,1),c=!0;else if(a.keyCode===g.g.ya.Ko)Hb(this,-1,0),c=!0;else if(a.keyCode===g.g.ya.To)Hb(this,1,0),c=!0;else if(a.keyCode===g.g.ya.Gl){if(c=Ib(this))c=c&&c.label,null!==c&&this.setValue(c);g.D.bj();c=!0}c&&a.stopPropagation()}; +b.gg=function(a){if(this.dh){if(a===g.navigation.fo)return Hb(this,0,-1),!0;if(a===g.navigation.eo)return Hb(this,0,1),!0;if(a===g.navigation.Vq)return Hb(this,-1,0),!0;if(a===g.navigation.Uq)return Hb(this,1,0),!0}return g.Ib.w.gg.call(this,a)}; +function Hb(a,c,d){var e=a.Ds||g.Ib.qo,f=a.lm||g.Ib.so,h=a.md%f,k=Math.floor(a.md/f);h+=c;k+=d;0>c?0>h&&0h&&(h=0):0f-1&&kf-1&&h--:0>d?0>k&&(k=0):0Math.floor(e.length/f)-1&&(k=Math.floor(e.length/f)-1);Jb(a,a.dh.childNodes[k].childNodes[h],k*f+h)}b.Fu=function(a){var c=(a=a.target)&&a.getAttribute("data-index");null!==c&&c!==this.md&&Jb(this,a,Number(c))};b.EG=function(){this.dh.focus()}; +b.GG=function(){this.dh.blur();var a=Ib(this);a&&g.g.o.Sb(a,"blocklyColourHighlighted")};function Ib(a){var c=a.lm||g.Ib.so,d=a.dh.childNodes[Math.floor(a.md/c)];return d?d.childNodes[a.md%c]:null}function Jb(a,c,d){var e=Ib(a);e&&g.g.o.Sb(e,"blocklyColourHighlighted");g.g.o.rb(c,"blocklyColourHighlighted");a.md=d;g.g.M.eb(a.dh,g.g.M.State.Wq,c.getAttribute("id"))} +b.ft=function(){var a=this.lm||g.Ib.so,c=this.Ds||g.Ib.qo,d=this.wA||g.Ib.gD,e=this.getValue(),f=document.createElement("table");f.className="blocklyColourTable";f.tabIndex=0;f.dir="ltr";g.g.M.ue(f,g.g.M.Kf.MB);g.g.M.eb(f,g.g.M.State.Do,!0);g.g.M.eb(f,"rowcount",Math.floor(c.length/a));g.g.M.eb(f,"colcount",a);for(var h,k=0;ktr>td {","border: .5px solid #888;","box-sizing: border-box;","cursor: pointer;","display: inline-block;","height: 20px;","padding: 0;","width: 20px;","}",".blocklyColourTable>tr>td.blocklyColourHighlighted {","border-color: #eee;","box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);","position: relative;","}",".blocklyColourSelected, .blocklyColourSelected:hover {", +"border-color: #eee !important;","outline: 1px solid #333;","position: relative;","}"]);g.vc.register("field_colour",g.Ib);g.Zj=function(a,c,d,e){this.s=a;this.ub=c;this.Ed=d.getAttribute("text");this.pd=new g.g.V(0,0);this.ah=e;this.hp=d.getAttribute("callbackKey")||d.getAttribute("callbackkey");this.Ax=d.getAttribute("web-class")||null};g.Zj.af=5;b=g.Zj.prototype;b.width=0;b.height=0;b.Ue=null; +b.Ja=function(){var a=this.ah?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.Ax&&(a+=" "+this.Ax);this.H=g.g.o.K("g",{"class":a},this.s.kb);if(!this.ah)var c=g.g.o.K("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.H);a=g.g.o.K("rect",{"class":this.ah?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.H);var d=g.g.o.K("text",{"class":this.ah?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.H);d.textContent=g.g.nc(this.Ed); +this.ah&&(this.qv=d,this.s.Zb.subscribe(this.qv,"flyoutText","fill"));this.width=g.g.o.Nm(d);this.height=20;this.ah||(this.width+=2*g.Zj.af,c.setAttribute("width",this.width),c.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);d.setAttribute("x",this.width/2);d.setAttribute("y",this.height-g.Zj.af);Kb(this);this.Ue=g.ca(this.H,"mouseup",this,this.LG);return this.H};b.show=function(){Kb(this);this.H.setAttribute("display","block")}; +function Kb(a){a.H.setAttribute("transform","translate("+a.pd.x+","+a.pd.y+")")}b.moveTo=function(a,c){this.pd.x=a;this.pd.y=c;Kb(this)};b.I=function(){this.Ue&&g.Ua(this.Ue);this.H&&g.g.o.removeNode(this.H);this.qv&&this.s.Zb.unsubscribe(this.qv)}; +b.LG=function(a){(a=this.ub.Vg(a))&&a.cancel();this.ah&&this.hp?console.warn("Labels should not have callbacks. Label text: "+this.Ed):this.ah||this.hp&&Lb(this.ub,this.hp)?this.ah||Lb(this.ub,this.hp)(this):console.warn("Buttons should have callbacks. Button text: "+this.Ed)};g.Tc.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,},.blocklyFlyoutLabelText {,fill: #000;,}".split(","));g.Dc=function(){this.fA=g.Dc.Gx;this.Qk=null;this.ad=!1;this.Td=this.mb=null;this.ob=[];this.Bs={}};g.Dc.Gx=!1;g.Dc.Error={Yq:"Component already rendered",Fr:"Unable to set parent component",fB:"Child component index out of bounds"};b=g.Dc.prototype;b.va=function(){return this.Qk||(this.Qk=g.g.Ol.yy())};b.ua=function(){return this.mb}; +b.kl=function(a){if(this==a)throw Error(g.Dc.Error.Fr);var c;if(c=a&&this.Td&&this.Qk)c=(c=this.Qk)?this.Td.Bs[c]||null:null;if(c&&this.Td!=a)throw Error(g.Dc.Error.Fr);this.Td=a};b.getParent=function(){return this.Td};b.Ja=function(){this.mb=document.createElement("div")};b.Ea=function(a){this.fh(a)};b.fh=function(a,c){if(this.ad)throw Error(g.Dc.Error.Yq);this.mb||this.Ja();a?a.insertBefore(this.mb,c||null):document.body.appendChild(this.mb);this.Td&&!this.Td.ad||this.nf()}; +b.nf=function(){this.ad=!0;Mb(this,function(a){!a.ad&&a.ua()&&a.nf()})};b.Jh=function(){Mb(this,function(a){a.ad&&a.Jh()});this.ad=!1};b.I=function(){this.EE||(this.EE=!0,this.zm())};b.zm=function(){this.ad&&this.Jh();Mb(this,function(a){a.I()});this.mb&&g.g.o.removeNode(this.mb);this.Td=this.mb=this.Bs=this.ob=null}; +b.em=function(a,c,d){if(a.ad&&(d||!this.ad))throw Error(g.Dc.Error.Yq);if(0>c||c>this.ob.length)throw Error(g.Dc.Error.fB);this.Bs[a.va()]=a;if(a.getParent()==this){var e=this.ob.indexOf(a);-1a&&(a=(a=this.getParent())?a.Jk()+1:0,Tb(this,a));return a};function Tb(a,c){if(c!=a.Ms){a.Ms=c;var d=Ub(a);if(d){var e=Vb(a)+"px";a.Wk()?d.style.paddingRight=e:d.style.paddingLeft=e}Mb(a,function(f){Tb(f,c+1)})}}b.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};b.Kh=function(){var a=[];Mb(this,function(c){a.push(c)});return a};b.select=function(){var a=this.Pe();a&&Bb(a,this)}; +function Wb(a,c){if(a.Cq!=c){a.Cq=c;Xb(a);var d=a.ua();d&&(g.g.M.eb(d,g.g.M.State.mk,c),c&&(c=a.Pe().ua(),g.g.M.eb(c,g.g.M.State.Wq,a.va())))}}b.Ne=function(){return this.Cm}; +b.Cj=function(a){var c=a!=this.Cm,d;this.Cm=a;var e=this.Pe(),f=this.ua();if(Ob(this)){if(!a&&e&&this.contains(e.Ud)&&this.select(),f){if(d=Qb(this))g.g.style.bv(d,a),g.g.M.eb(f,g.g.M.State.Do,a),a&&this.ad&&!d.hasChildNodes()&&(Mb(this,function(h){d.appendChild(Rb(h))}),Mb(this,function(h){h.nf()}));this.Mq()}}else(d=Qb(this))&&g.g.style.bv(d,!1);f&&(this.vt().className=this.Dp());c&&(a?this.Sx():this.Rx())};b.Sx=function(){};b.Rx=function(){};b.toggle=function(){this.Cj(!this.Ne())}; +function Rb(a){var c=a.Ne()&&Ob(a),d=document.createElement("div");d.style.backgroundPosition=Yb(a);c||(d.style.display="none");c&&Mb(a,function(e){d.appendChild(Rb(e))});c=document.createElement("div");c.id=a.va();c.appendChild(Zb(a));c.appendChild(d);return c}function Vb(a){return Math.max(0,(a.Jk()-1)*a.Xc.$y)}function Zb(a){var c=document.createElement("div");c.className=a.Ip();c.style["padding-"+(a.Wk()?"right":"left")]=Vb(a)+"px";c.appendChild($b(a));c.appendChild(ac(a));return c} +b.Ip=function(){var a="";this.Cq&&(a=" "+(this.Xc.qE||""));return this.Xc.Dx+a};function ac(a){var c=document.createElement("span");c.className=a.Xc.oE||"";c.textContent=a.dc();return c}function $b(a){var c=document.createElement("span");c.style.display="inline-block";c.className=a.Dp();return c}b.Dp=function(){throw Error("unimplemented abstract method");};function Yb(a){return(a.tu?(a.Jk()-1)*a.Xc.$y:"-100")+"px 0"} +b.ua=function(){var a=g.Fa.sd.w.ua.call(this);a||(this.mb=a=document.getElementById(this.va()));return a};function Ub(a){return(a=a.ua())?a.firstChild:null}b.vt=function(){var a=Ub(this);return a?a.firstChild:null};function Pb(a){return(a=Ub(a))&&a.lastChild?a.lastChild.previousSibling:null}function Qb(a){return(a=a.ua())?a.lastChild:null}b.ll=function(a){this.kf=a};b.dc=function(){return this.kf};function Xb(a){var c=Ub(a);c&&(c.className=a.Ip())} +b.Mq=function(){var a=Qb(this);a&&(a.style.backgroundPosition=Yb(this))};b.Lz=function(a){"expand"==a.target.getAttribute("type")&&Ob(this)?this.Tt&&this.toggle():(this.select(),Xb(this))};b.lq=function(a){a.preventDefault()};b.Du=function(a){var c=!0;switch(a.keyCode){case g.g.ya.To:if(a.altKey)break;c=bc(this);break;case g.g.ya.Ko:if(a.altKey)break;c=cc(this);break;case g.g.ya.Fl:c=dc(this);break;case g.g.ya.am:c=ec(this);break;default:c=!1}c&&a.preventDefault();return c}; +function dc(a){a:if(Ob(a)&&a.Ne())a=a.ob[0]||null;else{for(var c=a,d;c!=a.Pe();){d=c.tu;if(null!=d){a=d;break a}c=c.getParent()}a=null}a&&a.select();return!0}function ec(a){var c=a.fl;if(null!=c)a=fc(c);else{c=a.getParent();var d=a.Pe();a=c==d||a==d?null:c}a&&a.select();return!0}function cc(a){if(Ob(a)&&a.Ne()&&a.Tt)a.Cj(!1);else{var c=a.getParent();a=a.Pe();c&&c!=a&&c.select()}return!0}function bc(a){return Ob(a)?(a.Ne()?(a.ob[0]||null).select():a.Cj(!0),!0):!1} +function fc(a){return a.Ne()&&Ob(a)?fc(a.ob[a.ob.length-1]||null):a}function Sb(a,c){a.Fa!=c&&(a.Fa=c,Mb(a,function(d){Sb(d,c)}))};g.Fa.Ah=function(a,c,d){this.sa=a;g.Fa.sd.call(this,c,d)};g.g.object.X(g.Fa.Ah,g.Fa.sd);b=g.Fa.Ah.prototype;b.Pe=function(){if(this.Fa)return this.Fa;var a=this.getParent();return a&&(a=a.Pe())?(Sb(this,a),a):null};b.Dp=function(){var a=this.Ne(),c=this.NE;if(a&&c)return c;c=this.FF;if(!a&&c)return c;c=this.Xc;if(Ob(this)){if(a&&c.Bx)return c.pp+" "+c.Bx;if(!a&&c.lE)return c.pp+" "+c.lE}else if(c.Cx)return c.pp+" "+c.Cx;return""}; +b.lq=function(){Ob(this)&&this.Tt?(this.toggle(),this.select()):this.Cq?Bb(this.Pe(),null):this.select();Xb(this)};b.Lz=function(){};b.Du=function(a){if(this.Fa.sa.rf){var c={},d=g.g.ya.Fl,e=g.g.ya.am;c[g.g.ya.To]=this.Wk()?e:d;c[g.g.ya.Ko]=this.Wk()?d:e;c[g.g.ya.am]=g.g.ya.Ko;c[g.g.ya.Fl]=g.g.ya.To;Object.defineProperties(a,{keyCode:{value:c[a.keyCode]||a.keyCode}})}return g.Fa.Ah.w.Du.call(this,a)};b.eA=function(){this.Oz&&this.Oz.call(this.sa)};b.Sx=g.Fa.Ah.prototype.eA;b.Rx=g.Fa.Ah.prototype.eA;g.Fa.Ii=function(a,c){this.sa=a;g.Fa.sd.call(this,"",c);this.Cm=!0;Wb(this,!0);this.Ud=this};g.g.object.X(g.Fa.Ii,g.Fa.sd);b=g.Fa.Ii.prototype;b.Pe=function(){return this};b.Jk=function(){return 0};b.rF=function(){this.ky=!0;var a=this.ua();g.g.o.rb(a,"focused");this.Ud&&this.Ud.select()};b.oF=function(){this.ky=!1;var a=this.ua();g.g.o.Sb(a,"focused")};b.hasFocus=function(){return this.ky};b.Ne=function(){return!0};b.Cj=function(a){this.Cm=a}; +b.vt=function(){var a=Ub(this);return a?a.firstChild:null};b.Mq=function(){};b.Ip=function(){return g.Fa.Ii.w.Ip.call(this)+" "+this.Xc.nE};b.Dp=function(){var a=this.Ne(),c=this.NE;if(a&&c)return c;c=this.FF;if(!a&&c)return c;c=this.Xc;return a&&c.mE?c.pp+" "+c.mE:""};function Bb(a,c){if(c!=a.Ud&&(!a.Hz||a.Hz.call(a.sa,c))){var d=a.Ud;a.Ud&&Wb(a.Ud,!1);(a.Ud=c)&&Wb(c,!0);a.Gz&&a.Gz.call(a.sa,d,c)}} +b.Qp=function(){g.Fa.Ii.w.Qp.call(this);var a=this.ua();g.g.M.ue(a,g.g.M.Kf.hD);g.g.M.eb(a,g.g.M.State.jw,Pb(this).id)};b.nf=function(){g.Fa.Ii.w.nf.call(this);var a=this.ua();a.className=this.Xc.pE;a.setAttribute("hideFocus","true");this.os();this.Qp()};b.Jh=function(){g.Fa.Ii.w.Jh.call(this);this.Ns()};b.os=function(){var a=this.ua();a.tabIndex=0;this.xG=g.jd(a,"focus",this,this.rF);this.uG=g.jd(a,"blur",this,this.oF);this.Au=g.ca(a,"click",this,this.vF);this.AG=g.jd(a,"keydown",this,this.sF)}; +b.Ns=function(){g.Ua(this.xG);g.Ua(this.uG);g.Ua(this.Au);g.Ua(this.AG)};b.vF=function(a){var c;a:{for(var d=a.target;null!=d;){if(c=g.Fa.sd.gs[d.id])break a;if(d==this.ua())break;d=d.parentNode}c=null}if(c)switch(a.type){case "mousedown":c.Lz(a);break;case "click":c.lq(a)}};b.sF=function(a){var c=!1;if(c=this.Ud&&this.Ud.Du(a)||c)g.g.style.Zu(this.Ud.ua(),this.ua().parentNode),a.preventDefault();return c};b.createNode=function(a){return new g.Fa.Ah(this.sa,a||"",this.Xc)};g.g.Rect=function(a,c,d,e){this.top=a;this.bottom=c;this.left=d;this.right=e};g.g.Rect.prototype.contains=function(a,c){return a>=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};g.Hi=function(a){this.s=a;this.G=a.options.G;this.rf=a.options.Od;this.Ia=a.options.Ia;this.Xc={$y:19,pE:"blocklyTreeRoot",nE:"blocklyHidden",Dx:"blocklyTreeRow",oE:"blocklyTreeLabel",pp:"blocklyTreeIcon",Bx:"blocklyTreeIconOpen",Cx:"blocklyTreeIconNone",qE:"blocklyTreeSelected"};this.AA={Dx:"blocklyTreeSeparator"};this.rf&&(this.Xc.cssTreeRow+=a.G?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.AA.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.G?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"), +this.Xc.cssTreeIcon="")};b=g.Hi.prototype;b.width=0;b.height=0;b.Yk=null; +b.Z=function(){var a=this.s,c=r(this.s);this.Ec=document.createElement("div");this.Ec.className="blocklyToolboxDiv blocklyNonSelectable";this.Ec.setAttribute("dir",a.G?"RTL":"LTR");c.parentNode.insertBefore(this.Ec,c);c=a.Zb;c.subscribe(this.Ec,"toolbox","background-color");c.subscribe(this.Ec,"toolboxText","color");g.ca(this.Ec,"mousedown",this,function(d){g.g.lj(d)||d.target==this.Ec?g.wc(!1):g.wc(!0);g.Touch.Dh()},!1,!0);c={Pg:a.options.Pg,Rb:a,G:a.G,Dd:a.options.Dd,Od:a.Od,Ia:a.options.Ia,gh:a.options.gh}; +this.O=null;if(a.Od){if(!g.Ml)throw Error("Missing require for Blockly.HorizontalFlyout");this.O=new g.Ml(c)}else{if(!g.Hg)throw Error("Missing require for Blockly.VerticalFlyout");this.O=new g.Hg(c)}g.g.o.fj(this.O.Ja("svg"),r(this.s));this.O.Z(a);this.Xc.cleardotPath=a.options.wf+"1x1.gif";this.Xc.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.G?"Rtl":"Ltr");gc(this,a.options.Xk)}; +function gc(a,c){a.Fd&&(a.Fd.I(),a.Yk=null);var d=new g.Fa.Ii(a,a.Xc);a.Fd=d;Bb(d,null);d.Hz=a.nF;d.Gz=a.mF;var e=null;if(c){a.Fd.Sf=[];a.Ht=!1;e=hc(a,c,a.Fd,a.s.options.wf);if(a.Fd.Sf.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");ic(a.s)}d.Ea(a.Ec);e&&Bb(d,e);jc(a);a.position();a.rf&&g.g.M.eb(a.Fd.ua(),g.g.M.State.CC,"horizontal")} +b.nF=function(a){if(a==this.Fd)return!1;this.Yk&&(Ub(this.Yk).style.backgroundColor="");if(a){var c=a.Nk||"#57e";Ub(a).style.backgroundColor=c;jc(this,a)}return!0};b.mF=function(a,c){c&&c.Sf&&c.Sf.length?(this.O.show(c.Sf),this.Yk!=c&&this.O.yc.set(0),g.Se&&g.navigation.eb(g.navigation.Rr)):(this.O.Ha(),!g.Se||c instanceof g.Hi.Xr||g.navigation.eb(g.navigation.Xl));a!=c&&a!=this&&(a=new g.i.yd(null,"category",a&&a.dc(),c&&c.dc()),a.Cc=this.s.id,g.i.Oa(a));c&&(this.Yk=c)};b.yF=function(){g.rl(this.s)}; +b.gg=function(a){var c=this.Fd.Ud;if(!c)return!1;switch(a.name){case g.navigation.hb.Ge:return ec(c);case g.navigation.hb.So:return cc(c);case g.navigation.hb.De:return dc(c);case g.navigation.hb.Ho:return bc(c);default:return!1}};b.I=function(){this.O.I();this.Fd.I();this.s.Zb.unsubscribe(this.Ec);g.g.o.removeNode(this.Ec);this.Yk=this.s=null};b.cg=function(){return this.width};b.xy=function(){return this.height}; +b.position=function(){var a=this.Ec;if(a){var c=r(this.s);c=g.vA(c);this.rf?(a.style.left="0",a.style.height="auto",a.style.width=c.width+"px",this.height=a.offsetHeight,this.Ia==g.Fg?a.style.top="0":a.style.bottom="0"):(this.Ia==g.Eg?a.style.right="0":a.style.left="0",a.style.height=c.height+"px",this.width=a.offsetWidth);this.O.position()}}; +function hc(a,c,d,e){for(var f=null,h=null,k=0,l;l=c.childNodes[k];k++)if(l.tagName)switch(l.tagName.toUpperCase()){case "CATEGORY":var m=g.g.nc(l.getAttribute("name"));h=a.Fd.createNode(m);h.Oz=a.yF;h.Sf=[];d.add(h);var n=l.getAttribute("custom");n?h.Sf=n:(n=hc(a,l,h,e))&&(f=n);var t=l.getAttribute("categorystyle");if((n=l.getAttribute("colour"))&&t)h.Nk="",console.warn('Toolbox category "'+m+'" can not have both a style and a colour');else if(t){n=a;var v=h;v.yM=t;var w=n.s.Kp();t&&w&&((w=w.QD[t])&& +w.Ab?kc(n,w.Ab,v,m):console.warn('Style "'+t+'" must exist and contain a colour value'))}else kc(a,n,h,m);"true"==l.getAttribute("expanded")?(h.Sf.length&&(f=h),h.Cj(!0)):h.Cj(!1);h=l;break;case "SEP":if(h&&"CATEGORY"==h.tagName.toUpperCase()){d.add(new g.Hi.Xr(a.AA));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":d.Sf.push(l),h=l}return f} +function kc(a,c,d,e){c=g.g.nc(c);if(null===c||""===c)d.Nk="";else{var f=Number(c);isNaN(f)?(f=g.g.Ab.parse(c))?(d.Nk=f,a.Ht=!0):(d.Nk="",console.warn('Toolbox category "'+e+'" has unrecognized colour attribute: '+c)):(d.Nk=g.Zy(f),a.Ht=!0)}}function jc(a,c){c=(c||a.Fd).Kh(!1);for(var d=0,e;e=c[d];d++){var f=Ub(e);if(f){var h=a.Ht?"8px solid "+(e.Nk||"#ddd"):"none";a.s.G?f.style.borderRight=h:f.style.borderLeft=h}jc(a,e)}} +b.Im=function(){if(!this.Ec)return null;var a=this.Ec.getBoundingClientRect(),c=a.top,d=c+a.height,e=a.left;a=e+a.width;return this.Ia==g.Fg?new g.g.Rect(-1E7,d,-1E7,1E7):this.Ia==g.Fi?new g.g.Rect(c,1E7,-1E7,1E7):this.Ia==g.Jd?new g.g.Rect(-1E7,1E7,-1E7,a):new g.g.Rect(-1E7,1E7,e,1E7)};g.Hi.Xr=function(a){g.Fa.Ah.call(this,null,"",a)};g.g.object.X(g.Hi.Xr,g.Fa.Ah); +g.Tc.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", +"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);g.i.Il=function(a){this.Cc=a.id;this.group=g.i.cc();this.Pc=!1};g.g.object.X(g.i.Il,g.i.Abstract);g.i.Il.prototype.type=g.i.FB;g.i.Il.prototype.fb=function(){var a={type:this.type};this.group&&(a.group=this.group);this.Cc&&(a.workspaceId=this.Cc);return a};g.i.Il.prototype.pa=function(a){this.Cc=a.workspaceId;this.group=a.group};g.R={};g.R.HA=function(a){var c=G,d=g.g.xml.createElement("xml"),e=g.R.HH(g.N.Vw(c));e.hasChildNodes()&&d.appendChild(e);var f=xa(c,!0);e=0;for(var h;h=f[e];e++)d.appendChild(h.tv(a));c=A(c,!0);for(e=0;f=c[e];e++)d.appendChild(g.R.ts(f,a));return d};g.R.HH=function(a){for(var c=g.g.xml.createElement("variables"),d=0,e;e=a[d];d++){var f=g.g.xml.createElement("variable");f.appendChild(g.g.xml.createTextNode(e.name));e.type&&f.setAttribute("type",e.type);f.id=e.va();c.appendChild(f)}return c}; +g.R.ts=function(a,c){var d;a.v.G&&(d=a.v.cg());c=g.R.Bh(a,c);var e=a.Sa();c.setAttribute("x",Math.round(a.v.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};g.R.PE=function(a){var c=!1;a.name&&(a.Ei?c=!0:a.Gf&&(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=g.g.xml.createElement("field"),c.setAttribute("name",a.name),a.xA(c)):null}; +g.R.BD=function(a,c){for(var d=0,e;e=a.P[d];d++)for(var f=0,h;h=e.Na[f];f++)(h=g.R.PE(h))&&c.appendChild(h)}; +g.R.Bh=function(a,c){var d=g.g.xml.createElement(a.ib?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.Pa){var e=a.Pa();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}g.R.BD(a,d);if(e=a.Je.text){var f=a.Je.size,h=a.Je.Nu,k=g.g.xml.createElement("comment");k.appendChild(g.g.xml.createTextNode(e));k.setAttribute("pinned",h);k.setAttribute("h",f.height);k.setAttribute("w",f.width);d.appendChild(k)}a.data&&(e=g.g.xml.createElement("data"),e.appendChild(g.g.xml.createTextNode(a.data)), +d.appendChild(e));for(f=0;h=a.P[f];f++){var l;k=!0;if(h.type!=g.xg){var m=C(h.connection);h.type==g.Ra?l=g.g.xml.createElement("value"):h.type==g.Xa&&(l=g.g.xml.createElement("statement"));e=h.connection.xf;!e||m&&m.ib||l.appendChild(g.R.kx(e,c));m&&(l.appendChild(g.R.Bh(m,c)),k=!1);l.setAttribute("name",h.name);k||d.appendChild(l)}}void 0!=a.$g&&a.$g!=a.MF&&d.setAttribute("inline",a.$g);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.qe()||a.ib||d.setAttribute("deletable", +!1);a.Lc()||a.ib||d.setAttribute("movable",!1);a.nd()||d.setAttribute("editable",!1);if(f=q(a))l=g.g.xml.createElement("next"),l.appendChild(g.R.Bh(f,c)),d.appendChild(l);e=a.U&&a.U.xf;!e||f&&f.ib||l.appendChild(g.R.kx(e,c));return d}; +g.R.kx=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==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&g.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&g.g.o.removeNode(e))}return a}; +g.R.Nd=function(a){a=g.g.xml.Nd(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};g.R.VL=function(a){a=g.R.Nd(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +g.R.mi=function(a){var c=g.g.xml.vH(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};g.R.RL=function(a,c){c.Qc(!1);c.clear();a=g.R.Hh(a,c);c.Qc(!0);return a}; +g.R.Hh=function(a,c){if(a instanceof g.Nb){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.G&&(e=c.cg());d=[];g.g.o.Mn();var f=a.childNodes.length,h=g.i.cc();h||g.i.aa(!0);c.Qc&&c.Qc(!1);var k=!0;try{for(var l=0;l=this.s.options.iq)){a={scrollbars:!0,Pg:this.s.options.Pg,Rb:this.s,G:this.s.G,Dd:this.s.options.Dd,gh:this.s.options.gh};if(this.s.Od){a.Ia=this.s.Ia==g.Fg?g.Fi:g.Fg;if(!g.Ml)throw Error("Missing require for Blockly.HorizontalFlyout");this.O=new g.Ml(a)}else{a.Ia=this.s.Ia==g.Eg?g.Jd:g.Eg;if(!g.Hg)throw Error("Missing require for Blockly.VerticalFlyout");this.O=new g.Hg(a)}Ba(this.s,this.wG.bind(this))}};b=g.Wr.prototype;b.Ji=47;b.jo=44;b.gk=16;b.vr=20; +b.Rl=20;b.Mo=10;b.Pr=0;b.Qr=32;b.PB=.1;b.St=!1;b.jq=0;b.H=null;b.Hq=null;b.Zt=0;b.Yh=0;b.cn=0;b.wl=0; +b.Ja=function(){this.H=g.g.o.K("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=g.g.o.K("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.H);g.g.o.K("rect",{width:this.Ji,height:this.jo,y:this.gk},c);var d=g.g.o.K("image",{width:g.xd.width,x:-this.Pr,height:g.xd.height,y:-this.Qr,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.H);d.setAttributeNS(g.g.o.ef,"xlink:href",this.s.options.wf+g.xd.url);c=g.g.o.K("clipPath",{id:"blocklyTrashLidClipPath"+a},this.H); +g.g.o.K("rect",{width:this.Ji,height:this.gk},c);this.Hq=g.g.o.K("image",{width:g.xd.width,x:-this.Pr,height:g.xd.height,y:-this.Qr,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.H);this.Hq.setAttributeNS(g.g.o.ef,"xlink:href",this.s.options.wf+g.xd.url);g.ca(this.H,"mouseup",this,this.click);g.jd(d,"mouseover",this,this.hG);g.jd(d,"mouseout",this,this.fG);this.hs();return this.H}; +b.Z=function(a){0this.jq&&1>this.Yh&&(this.Zt=setTimeout(this.hs.bind(this),20))};function nc(a,c){var d=a.s.Ia==g.Eg||a.s.Od&&a.s.G;a.Hq.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.Ji-4)+","+(a.gk-2)+")")}b.close=function(){$a(this,!1)}; +b.click=function(){if(this.Qi.length){for(var a=[],c=0,d;d=this.Qi[c];c++)a[c]=g.R.mi(d);this.O.show(a)}};b.hG=function(){this.Qi.length&&$a(this,!0)};b.fG=function(){$a(this,!1)}; +b.wG=function(a){if(!(0>=this.s.options.iq)&&a.type==g.i.io&&"shadow"!=a.zu.tagName.toLowerCase()){for(var c=a=a.zu.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=g.R.Nd(a);if(-1==this.Qi.indexOf(a)){for(this.Qi.unshift(a);this.Qi.length>this.s.options.iq;)this.Qi.pop();this.jq=this.PB;nc(this,45*this.jq)}}};g.S=Object.create(null);g.ta=function(a,c){this.B=a;this.type=c};g.ta.po=0;g.ta.ww=1;g.ta.zw=2;g.ta.yw=3;g.ta.uw=4;g.ta.vw=5;g.ta.xw=6;b=g.ta.prototype;b.ka=null;b.Kg=null;b.xf=null;b.$b=0;b.gb=0; +b.hf=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=C(c),h=c.xf;c.xf=null;if(f.ib)h=g.R.Bh(f),f.I(),f=null;else if(c.type==g.Ra){if(!f.L)throw Error("Orphan block does not have an output connection.");var k=g.ta.lz(e,f);k&&(f.L.connect(k),f=null)}else if(c.type==g.Xa){if(!f.$)throw Error("Orphan block does not have a previous connection.");for(k=e;k.U;){var l=q(k);if(l&&!l.ib)k=l;else{oc(f.$,k.U)&&(k.U.connect(f.$),f=null);break}}}if(f&&(c.disconnect(), +g.i.Pc)){var m=g.i.cc();setTimeout(function(){f.v&&!f.getParent()&&(g.i.aa(m),f.L?f.L.mq(c):f.$&&f.$.mq(c),g.i.aa(!1))},g.mo)}c.xf=h}var n;g.i.isEnabled()&&(n=new g.i.Cl(e));g.ta.dE(c,a);e.kl(d);n&&(n.zj(),g.i.Oa(n))};b.I=function(){if(this.isConnected()){this.xf=null;var a=C(this);a.ib?a.I():D(a)}};function F(a){return a.type==g.Ra||a.type==g.Xa}b.isConnected=function(){return!!this.ka}; +function Eb(a,c){if(!c)return g.ta.yw;if(F(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?g.ta.ww:c.type!=g.jk[a.type]?g.ta.zw:d&&e&&d.v!==e.v?g.ta.vw:oc(a,c)?d.ib&&!e.ib?g.ta.xw:g.ta.po:g.ta.uw} +function Fb(a,c){switch(Eb(a,c)){case g.ta.po:break;case g.ta.ww:throw Error("Attempted to connect a block to itself.");case g.ta.vw:throw Error("Blocks not on same workspace.");case g.ta.zw:throw Error("Attempt to connect incompatible types.");case g.ta.yw:throw Error("Target connection is null.");case g.ta.uw:throw Error("Connection checks failed. "+(a+" expected "+a.Kg+", found "+c.Kg));case g.ta.xw:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.Vp=function(a){if(a.B.Th()||Eb(this,a)!=g.ta.po)return!1;switch(a.type){case g.cf:return this.ka||-1!=g.Am.indexOf(a)?a=!1:a.ka?(a=C(a),a=a.Th()?!(a.$&&C(a.$)):!1):a=!0,a;case g.bf:if(a.isConnected()&&!C(a).Th()||this.isConnected())return!1;break;case g.Ra:if(a.isConnected()&&!C(a).Lc()&&!C(a).ib)return!1;break;case g.Xa:if(a.isConnected()&&!this.B.U&&!C(a).ib&&C(a).U)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=g.Am.indexOf(a)?!1:!0};b.mq=function(){}; +b.connect=function(a){if(this.ka!=a){Fb(this,a);var c=g.i.cc();c||g.i.aa(!0);F(this)?this.hf(a):a.hf(this);c||g.i.aa(!1)}};g.ta.dE=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ka=c;c.ka=a};g.ta.lH=function(a,c){for(var d=!1,e=0;ec||c>a.Na.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new g.ce(d));d.fv(a.B);a.B.ga&&d.Z();d.name=e;d.Ou&&(c=rc(a,c,d.Ou));a.Na.splice(c,0,d);++c;d.pv&&(c=rc(a,c,d.pv));a.B.ga&&(a.B.Ea(),a.B.Pb());return c}b.isVisible=function(){return this.oi}; +b.Yb=function(a){var c=[];if(this.oi==a)return c;for(var d=(this.oi=a)?"block":"none",e=0,f;f=this.Na[e];e++)f.Yb(a);if(this.connection){if(a)c=sc(this.connection);else if(e=this.connection,tc(e,!0),e.ka)for(e=p(C(e),!1),f=0;f=d)this.Ni=g.Zy(d);else if(d=g.g.Ab.parse(c))this.Ni=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);}; +function K(a,c){var d=a.v.Kp().KD[c];if(d)a.mx=d.colourSecondary,a.nx=d.colourTertiary,a.Yg=d.Yg,a.se(d.colourPrimary);else throw Error("Invalid style name: "+c);}function B(a,c){for(var d=0,e;e=a.P[d];d++)for(var f=0,h;h=e.Na[f];f++)if(h.name==c)return h;return null}b.Et=function(){for(var a=[],c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)f.zn()&&a.push(f.getValue());return a}; +b.Xg=function(){for(var a=[],c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)f.zn()&&(f=this.v.pf(f.getValue()))&&a.push(f);return a};b.Nq=function(a){for(var c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)f.zn()&&a.va()==f.getValue()&&xb(f)};b.xq=function(a,c){for(var d=0,e;e=this.P[d];d++)for(var f=0,h;h=e.Na[f];f++)h.zn()&&a==h.getValue()&&h.setValue(c)};function z(a,c){return(a=B(a,c))?a.getValue():null} +function wc(a,c,d){a=B(a,d);if(!a)throw Error('Field "'+d+'" not found.');a.setValue(c)}b.Wd=function(a,c){if(a){void 0===c&&(c=null);if(!this.$){if(this.L)throw Error("Remove output connection prior to adding previous connection.");this.$=this.gn(g.cf)}this.$.wa(c)}else if(this.$){if(this.$.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.$.I();this.$=null}}; +b.Vd=function(a,c){if(a)void 0===c&&(c=null),this.U||(this.U=this.gn(g.Xa)),this.U.wa(c);else if(this.U){if(this.U.isConnected())throw Error("Must disconnect next statement before removing connection.");this.U.I();this.U=null}}; +b.bd=function(a,c){if(a){void 0===c&&(c=null);if(!this.L){if(this.$)throw Error("Remove previous connection prior to adding output connection.");this.L=this.gn(g.bf)}this.L.wa(c)}else if(this.L){if(this.L.isConnected())throw Error("Must disconnect output value before removing connection.");this.L.I();this.L=null}};b.te=function(a){this.$g!=a&&(g.i.Oa(new g.i.sg(this,"inline",null,this.$g,a)),this.$g=a)}; +function qc(a){if(void 0!=a.$g)return a.$g;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function L(a,c){return a.Qf(g.Ra,c)} +function M(a,c){return a.Qf(g.xg,c||"")} +function yc(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.Yg&&(a.Yg=c.style.Yg,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{K(a,e)}catch(I){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.se(e)}catch(I){console.warn(d+ +"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){for(var f=a,h=c["args"+e]||[],k=c["lastDummyAlign"+e],l=g.g.zH(c["message"+e]),m=[],n=0,t=[],v=0;v=w||w>h.length)throw Error('Block "'+f.type+'": Message index %'+w+" out of range.");if(m[w])throw Error('Block "'+f.type+'": Message index %'+w+" duplicated.");m[w]=!0;n++;t.push(h[w-1])}else(w=w.trim())&&t.push(w)}if(n!=h.length)throw Error('Block "'+f.type+'": Message does not reference all '+ +h.length+" arg(s).");t.length&&("string"==typeof t[t.length-1]||g.g.jb.startsWith(t[t.length-1].type,"field_"))&&(v={type:"input_dummy"},k&&(v.align=k),t.push(v));k={LEFT:g.Xq,RIGHT:g.fd,CENTRE:g.Dv};h=[];for(v=0;v=this.P.length)throw RangeError("Input index "+a+" out of bounds.");if(c>this.P.length)throw RangeError("Reference input "+c+" out of bounds.");var d=this.P[a];this.P.splice(a,1);ac?d-1:c},a.md)}function Ec(a,c,d){var e=a.ob.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var h=a.ob[d]||null;if(h&&h.isEnabled()){Ac(a,d);break}f++;d=c.call(a,d,e)}}b.xF=function(a){(a=Bc(this,a.target))&&a.isEnabled()&&(this.ob[this.md]||null)!==a&&(Cc(this),this.lh(a))};b.pF=function(a){var c=Bc(this,a.target),d;if(d=c)c.isEnabled()&&(c.lh(!0),Gc(c)),d=void 0;d&&a.preventDefault()}; +b.uF=function(){this.focus()};b.wF=function(){this.ua()&&(this.blur(),Cc(this),Ac(this,-1))};b.Gt=function(a){return 0!=this.ob.length&&Hc(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};function Hc(a,c){var d=a.ob[a.md]||null;if(d&&"function"==typeof d.Gt&&d.Gt(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case g.g.ya.Gl:d&&Gc(d);break;case g.g.ya.am:Fc(a);break;case g.g.ya.Fl:Dc(a);break;default:return!1}return!0};g.No=function(a,c){g.Dc.call(this);this.kf=a;this.setValue(c);this.xp=!0};g.g.object.X(g.No,g.Dc);b=g.No.prototype; +b.Ja=function(){var a=document.createElement("div");a.id=this.va();this.mb=a;a.className="goog-menuitem goog-option "+(this.xp?"":"goog-menuitem-disabled ")+(this.As?"goog-option-selected ":"")+(this.Wk()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.im){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Ic(this));g.g.M.ue(a,this.Yu||(this.im?g.g.M.Kf.tC: +g.g.M.Kf.sC));g.g.M.eb(a,g.g.M.State.mk,this.im&&this.As||!1)};function Ic(a){a=a.kf;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.$a=a};b.getValue=function(){return this.$a};b.ue=function(a){this.Yu=a};function Jc(a,c){if(a.im){a.As=c;var d=a.ua();d&&a.isEnabled()&&(c?(g.g.o.rb(d,"goog-option-selected"),g.g.M.eb(d,g.g.M.State.mk,!0)):(g.g.o.Sb(d,"goog-option-selected"),g.g.M.eb(d,g.g.M.State.mk,!1)))}} +b.lh=function(a){var c=this.ua();c&&this.isEnabled()&&(a?g.g.o.rb(c,"goog-menuitem-highlight"):g.g.o.Sb(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.xp};b.qd=function(a){this.xp=a;(a=this.ua())&&(this.xp?g.g.o.Sb(a,"goog-menuitem-disabled"):g.g.o.rb(a,"goog-menuitem-disabled"))};function Gc(a){a.im&&Jc(a,!a.As);a.Tw&&a.Tw.call(a.yD,a)}function Kc(a,c,d){a.Tw=c;a.yD=d};g.g.Lq={};g.g.Lq.Wg=function(a){a=a.ua();var c=g.g.style.Wg(a);c.height=a.scrollHeight;return c};g.g.Lq.zD=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};g.Ga={};g.Ga.qp=null;g.Ga.Zx=null;g.Ga.show=function(a,c,d){g.ba.show(g.Ga,d,null);if(c.length){var e=g.Ga.SG(c,d);g.Ga.pd(e,a,d);setTimeout(function(){e.ua().focus()},1);g.Ga.qp=null}else g.Ga.Ha()};g.Ga.SG=function(a,c){var d=new g.yi;Nb(d,c);for(var e=0,f;f=a[e];e++){var h=new g.No(f.text);Nb(h,c);d.em(h,d.ob.length,!0);h.qd(f.enabled);f.enabled&&Kc(h,function(){g.Ga.Ha();this.Fb()},f)}return d}; +g.Ga.pd=function(a,c,d){var e=g.g.lF();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};g.Ga.kE(a);var f=g.g.Lq.Wg(a);d&&g.g.Lq.zD(e,c,f);g.ba.TG(e,c,f,d);a.ua().focus()};g.Ga.kE=function(a){a.Ea(g.ba.Ca);var c=a.ua();g.g.o.rb(c,"blocklyContextMenu");g.ca(c,"contextmenu",null,g.g.qG);a.focus()};g.Ga.Ha=function(){g.ba.Ok(g.Ga);g.Ga.qp=null;g.Ga.Zx&&g.Ua(g.Ga.Zx)}; +g.Ga.gp=function(a,c){return function(){g.i.disable();try{var d=g.R.Wi(c,a.v),e=a.Sa();e.x=a.G?e.x-g.wd:e.x+g.wd;e.y+=2*g.wd;d.moveBy(e.x,e.y)}finally{g.i.enable()}g.i.isEnabled()&&!d.ib&&g.i.Oa(new g.i.oo(d));d.select()}};g.Ga.HD=function(a){var c=p(a,!1).length,d=q(a);d&&(c-=p(d,!1).length);return{text:1==c?g.h.DELETE_BLOCK:g.h.DELETE_X_BLOCKS.replace("%1",String(c)),enabled:!0,Fb:function(){g.i.aa(!0);a.I(!0,!0);g.i.aa(!1)}}}; +g.Ga.JD=function(a){return{enabled:!("function"==typeof a.Wb?!a.Wb():!a.Wb),text:g.h.HELP,Fb:function(){var c="function"==typeof a.Wb?a.Wb():a.Wb;c&&window.open(c)}}};g.Ga.ID=function(a){var c=Aa(a.v)?za(a.v,g.g.rt(a,!0)):!0;return{text:g.h.DUPLICATE_BLOCK,enabled:c,Fb:function(){g.Vx(a)}}};g.Ga.GD=function(a){var c={enabled:!g.g.userAgent.yg};a.Ak?(c.text=g.h.REMOVE_COMMENT,c.Fb=function(){a.ji(null)}):(c.text=g.h.ADD_COMMENT,c.Fb=function(){a.ji("")});return c}; +g.Ga.SL=function(a){return{text:g.h.WK,enabled:!0,Fb:function(){g.i.aa(!0);a.I(!0,!0);g.i.aa(!1)}}};g.Ga.TL=function(a){return{text:g.h.FI,enabled:!0,Fb:function(){g.Vx(a)}}}; +g.Ga.BM=function(a,c){if(!g.qk)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!g.g.userAgent.yg};d.text=g.h.OH;d.Fb=function(){var e=new g.qk(a,g.h.LL,g.qk.uB,g.qk.uB),f=aa(a).getBoundingClientRect();f=new g.g.V(c.clientX-f.left,c.clientY-f.top);var h=g.g.Km(a.kb);f=g.g.V.Ek(f,h);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ga&&(e.Qd(),e.Ea(),e.select())};return d};g.Cg=function(a,c){g.Cg.w.constructor.call(this,a,c);this.Xf=a.v.op[c];this.Ex=a.v.op[g.jk[c]];this.tj=new g.g.V(0,0);this.Qh=!1;this.Wy=!this.Xf};g.g.object.X(g.Cg,g.ta);b=g.Cg.prototype;b.I=function(){g.Cg.w.I.call(this);this.Qh&&Lc(this.Xf,this)};function Mc(a,c){var d=a.$b-c.$b;a=a.gb-c.gb;return Math.sqrt(d*d+a*a)} +function Gb(a,c){if(!a.B.v.lc()){var d=db(a.B);if(!d.ec){var e=!1;if(!d.Lc()){d=db(c.B);if(!d.Lc())return;c=a;e=!0}var f=g.selected==d;f||d.ap();var h=c.$b+g.wd+Math.floor(Math.random()*g.cr)-a.$b,k=c.gb+g.wd+Math.floor(Math.random()*g.cr)-a.gb;e&&(k=-k);d.G&&(h=c.$b-g.wd-Math.floor(Math.random()*g.cr)-a.$b);d.moveBy(h,k);f||d.Bn()}}}b.moveTo=function(a,c){this.Qh&&Lc(this.Xf,this);this.$b=a;this.gb=c;this.Wy||Nc(this.Xf,this)};b.moveBy=function(a,c){this.moveTo(this.$b+a,this.gb+c)}; +function Oc(a,c){a.moveTo(c.x+a.tj.x,c.y+a.tj.y)}function Pc(a,c,d){a.tj.x=c;a.tj.y=d}function Qc(a){var c=a.ka.$b-a.$b,d=a.ka.gb-a.gb;if(0!=c||0!=d){a=C(a);var e=a.za();if(!e)throw Error("block is not rendered.");e=g.g.Oe(e);a.za().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");bb(a,-c,-d)}} +b.closest=function(a,c){var d=this.Ex;if(d.ic.length){var e=this.gb,f=this.$b;this.$b=f+c.x;this.gb=e+c.y;var h=Rc(d,this);c=null;for(var k=a,l,m=h-1;0<=m&&Math.abs(d.ic[m].gb-this.gb)<=a;)l=d.ic[m],this.Vp(l,k)&&(c=l,k=Mc(l,this)),m--;for(;hc?!1:g.Cg.w.Vp.call(this,a)};b.mq=function(a){Gb(this,a)};b.Ts=function(a,c){g.Cg.w.Ts.call(this,a,c);a.ga&&a.Ea();c.ga&&(mc(c),c.Ea())}; +b.Wu=function(){var a=this.B,c=this.xf;if(a.v&&c&&g.i.Pc){g.Cg.w.Wu.call(this);c=C(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Qd();c.Ea(!1);a.ga&&a.Ea()}};b.Cz=function(a){return Sc(this.Ex,this,a)};b.hf=function(a){g.Cg.w.hf.call(this,a);var c=this.B;a=a.B;c.ga&&mc(c);a.ga&&mc(a);c.ga&&a.ga&&(this.type==g.Xa||this.type==g.cf?a.Ea():c.Ea())};b.Iz=function(){this.isConnected()&&!oc(this,this.ka)&&(D(F(this)?C(this):this.B),this.B.Pb())};g.xa=function(a,c,d){this.H=g.g.o.K("g",{},null);this.H.Un="";this.wj=a.hh.uz(this.H);this.Rn=this.wj.Qn||null;this.Yd=this.wj.ql||null;this.Hj=this.wj.Sn||null;this.Yd.Af=this;this.ga=!1;this.ao=g.g.gj()&&!!a.je;g.J.wk(this.Yd);g.xa.w.constructor.call(this,a,c,d);this.H.dataset&&(this.H.dataset.id=this.id);this.Yc=null};g.g.object.X(g.xa,g.no);g.xa.prototype.height=0;g.xa.prototype.width=0;g.xa.prototype.$d=null;g.xa.oJ=-1;g.xa.dr="TEMP_COLLAPSED_WARNING_";g.xa.PC=10;g.xa.yr=25;g.xa.zh=8; +g.xa.Dg=!1;b=g.xa.prototype;b.Qd=function(){if(!this.v.ga)throw TypeError("Workspace is headless.");for(var a=0,c;c=this.P[a];a++)c.Z();c=Wa(this);for(a=0;a=a.ic.length)return-1;for(var e=c.gb,f=d;0<=f&&a.ic[f].gb==e;){if(a.ic[f]==c)return f;f--}for(;dc.gb)e=f;else{d=f;break}}return d}function Lc(a,c){if(!c.Qh)throw Error("Connection not in database.");var d=Yc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Qh=!1;a.ic.splice(d,1)} +function Sc(a,c,d){function e(n){var t=h-f[n].$b,v=k-f[n].gb;Math.sqrt(t*t+v*v)<=d&&m.push(f[n]);return v document.");}else a=null;return a};g.ie=function(a,c){g.ie.w.constructor.call(this,a,c);this.Zp=!1;this.Ie={};this.qA=this.wn=0;this.Gu=null};g.g.object.X(g.ie,g.$j);g.ie.vD=5;g.ie.wD=6;b=g.ie.prototype;b.Ws=function(a){g.ie.w.Ws.call(this,a);!this.Xp&&g.Touch.cq(a)&&$c(this,a)};b.wk=function(a){this.Gu=g.ca(document,"mousedown",null,this.zF.bind(this),!0);this.nq=g.ca(document,"mousemove",null,this.Pm.bind(this),!0);this.oq=g.ca(document,"mouseup",null,this.Mp.bind(this),!0);a.preventDefault();a.stopPropagation()}; +b.zF=function(a){!this.lc()&&g.Touch.cq(a)&&($c(this,a),this.Zp&&g.Zh())};b.Pm=function(a){if(this.lc())g.Touch.hv(a)&&g.ie.w.Pm.call(this,a);else if(this.Zp){if(g.Touch.cq(a)){this.Ie[g.Touch.Lp(a)]=ad(this,a);var c=Object.keys(this.Ie);if(2==c.length){c=g.g.V.Qx(this.Ie[c[0]],this.Ie[c[1]])/this.qA;if(0this.wn){var d=c-this.wn;d=0Object.keys(this.Ie).length&&(this.Ie={},this.wn=0)}!this.Zp||this.lc()?g.Touch.hv(a)&&g.ie.w.Mp.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){g.ie.w.I.call(this);this.Gu&&g.Ua(this.Gu)};function $c(a,c){a.Ie[g.Touch.Lp(c)]=ad(a,c);var d=Object.keys(a.Ie);2==d.length&&(a.qA=g.g.V.Qx(a.Ie[d[0]],a.Ie[d[1]]),a.Zp=!0,c.preventDefault())} +function ad(a,c){return a.zc?new g.g.V(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};g.Pw=function(a){this.Ku=a;this.Wl=Object.create(null)};b=g.Pw.prototype;b.Wt=null;b.I=function(){this.Wl=this.Ku=null};b.load=function(a,c){if(a.length){try{var d=new g.g.global.Audio}catch(l){return}for(var e,f=0;f=ya(a)))if(a.Ic&&a.Ic.cancel(),"comment"==c.tagName.toLowerCase()){g.i.disable();try{var d=g.qk.Gm(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{g.i.enable()}d.select()}else a:{g.i.disable();try{var h=g.R.Wi(c,a),k=a.fc.Vb;if(g.Se&&k){g.navigation.bz(h,k.ra);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=y(a,!1);d=0;for(var t;t=n[d];d++){var v=t.Sa();if(1>=Math.abs(l-v.x)&&1>=Math.abs(m-v.y)){c=!0;break}}if(!c){var w=h.Me(!1);d=0;for(var I;I=w[d];d++)if(I.closest(g.wd,new g.g.V(l,m)).connection){c=!0;break}}c&&(l=a.G?l-g.wd:l+g.wd,m+=2*g.wd)}while(c);h.moveBy(l,m)}}finally{g.i.enable()}g.i.isEnabled()&&!h.ib&&g.i.Oa(new g.i.oo(h));h.select()}} +function hd(a){if((a=a.re?a.Jj:a)&&!a.Ic&&a.sa&&a.sa.O){a=a.sa;var c=a.Fd.Ud;c&&c.Sf&&a.O.show(c.Sf)}}b.gi=function(a,c){g.qb.w.gi.call(this,a,c);hd(this)};b.Zf=function(a){g.qb.w.Zf.call(this,a);hd(this)};b.Md=function(a,c,d){a=g.qb.w.Md.call(this,a,c,d);hd(this);return a};function cd(a){a.Ix=a.cd&&a.H.parentNode?a.cd.Im():null;a.Hx=a.O?a.O.Im():a.sa?a.sa.Im():null}function Ya(a,c){return a.Ix&&a.Ix.contains(c.clientX,c.clientY)?g.hr:a.Hx&&a.Hx.contains(c.clientX,c.clientY)?g.Uv:g.Tv} +b.ai=function(a){var c=this.Vg(a);c&&pb(c,a,this)};b.mv=function(a,c){a=g.g.nn(a,r(this),qa(this));a.x/=this.scale;a.y/=this.scale;this.Ux=g.g.V.Ek(c,a)};b.lc=function(){return null!=this.Ic&&this.Ic.lc()};function id(a){return a.options.Nc&&a.options.Nc.scrollbars||a.options.Nc&&a.options.Nc.Rj||a.options.Nc&&a.options.Nc.Ih||a.options.Hb&&a.options.Hb.controls||a.options.Hb&&a.options.Hb.Rj} +b.Lc=function(){return this.options.Nc&&this.options.Nc.scrollbars||this.options.Nc&&this.options.Nc.Rj||this.options.Nc&&this.options.Nc.Ih||this.options.Hb&&this.options.Hb.Rj}; +b.MG=function(a){if(g.$j.Mt())a.preventDefault(),a.stopPropagation();else{var c=this.options.Hb&&this.options.Hb.Rj,d=this.options.Nc&&this.options.Nc.Rj;if(c||d){var e=g.g.Cy(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=g.g.nn(a,r(this),qa(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}}; +function lc(a){var c=A(a,!1);a=xa(a,!1);c=c.concat(a);if(!c.length)return new g.g.Rect(0,0,0,0);a=Vc(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.XD=function(){this.Qc(!1);g.i.aa(!0);for(var a=A(this,!0),c=0,d=0,e;e=a[d];d++)if(e.Lc()){var f=e.Sa();e.moveBy(-f.x,c-f.y);Uc(e);c=e.Sa().y+Ra(e).height+g.xa.yr}g.i.aa(!1);this.Qc(!0)}; +b.Jn=function(a){function c(I){if(I.qe())w=w.concat(p(I,!1));else{I=I.Kh(!1);for(var ca=0;caw.length?d():g.confirm(g.h.DELETE_ALL_BLOCKS.replace("%1",w.length),function(I){I&&d()})}};e.push(l);this.px&&this.px(e);g.Ga.show(a,e,this.G)}};function pa(a){if(a.options.Rb)pa(a.options.Rb);else{g.fn=a;document.activeElement&&document.activeElement.blur();try{r(a).focus()}catch(c){try{r(a).parentNode.setActive()}catch(d){r(a).parentNode.focus()}}}} +b.zoom=function(a,c,d){if(!this.re&&!this.kj){d=Math.pow(this.options.Hb.dH,d);var e=this.scale*d;if(this.scale!=e){e>this.options.Hb.jn?d=this.options.Hb.jn/this.scale:ethis.options.Hb.jn?a=this.options.Hb.jn:this.options.Hb.ln&&af?g.ba.un(a,0,d.height+f):g.ba.un(a,f,d.height)}; +g.ba.ND=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)};g.ba.OD=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};g.Hg=function(a){a.jc=this.Lm.bind(this);a.ki=this.mA.bind(this);g.Hg.w.constructor.call(this,a);this.rf=!1};g.g.object.X(g.Hg,g.Jl);b=g.Hg.prototype;b.Lm=function(){if(!this.isVisible())return null;try{var a=this.s.kb.getBBox()}catch(f){a={height:0,y:0,width:0,x:0}}var c=this.Nr,d=this.$c-2*this.Nr,e=this.yb;this.G||(e-=this.Nr);return{Cb:d,vb:e,Ld:a.height*this.s.scale+2*this.af,jf:a.width*this.s.scale+2*this.af,pc:-this.s.scrollY+a.y,gc:-this.s.scrollX,tc:a.y,Hc:a.x,Fc:c,qc:0}}; +b.mA=function(a){var c=this.Lm();c&&("number"==typeof a.y&&(this.s.scrollY=-c.Ld*a.y),this.s.translate(this.s.scrollX+c.qc,this.s.scrollY+c.Fc))}; +b.position=function(){if(this.isVisible()){var a=this.ub.jc();if(a){this.$c=a.Cb;var c=this.yb-this.Db,d=a.Cb-2*this.Db,e=this.ul==g.Eg,f=c+this.Db;f=["M "+(e?f:0)+",0"];f.push("h",e?-c:c);f.push("a",this.Db,this.Db,0,0,e?0:1,e?-this.Db:this.Db,this.Db);f.push("v",Math.max(0,d));f.push("a",this.Db,this.Db,0,0,e?0:1,e?this.Db:-this.Db,this.Db);f.push("h",e?c:-c);f.push("z");this.Rc.setAttribute("d",f.join(" "));c=this.$c;a=this.ub.Ia==this.ul?a.yA?this.ul==g.Jd?a.yA:a.vb-this.yb:this.ul==g.Jd?0:a.vb: +this.ul==g.Jd?0:a.vb+a.qc-this.yb;this.H.setAttribute("width",this.yb);this.H.setAttribute("height",c);"svg"==this.H.tagName?g.g.o.Gn(this.H,"translate("+a+"px,0px)"):this.H.setAttribute("transform","translate("+a+",0)");this.yc&&(this.yc.Hu=new g.g.V(a,0),this.yc.resize(),ia(this.yc,this.yc.pd.x,this.yc.pd.y))}}};b.IH=function(a){var c=g.g.Cy(a);if(c.y){var d=this.Lm();c=d.pc-d.tc+c.y;c=Math.min(c,d.Ld-d.Cb);c=Math.max(c,0);this.yc.set(c);g.ba.Ha()}a.preventDefault();a.stopPropagation()}; +function md(a,c,d){a.s.scale=a.ub.scale;for(var e=a.af,f=a.G?e:e+a.tl,h=0,k;k=c[h];h++)if("block"==k.type){k=k.block;for(var l=p(k,!1),m=0,n;n=l[m];m++)n.ec=!0;k.Ea();n=k.za();l=Ra(k);m=k.L?f-a.tl:f;k.moveBy(m,e);var t=a,v=k,w=h;m=g.g.o.K("rect",{"fill-opacity":0,x:a.G?m-l.width:m,y:e,height:l.height,width:l.width},null);m.Af=v;g.J.wk(m);t.s.kb.insertBefore(m,v.za());v.gy=m;t.gq[w]=m;t=a;t.Cd.push(g.ca(n,"mousedown",null,nd(t,k)));t.Cd.push(g.ca(m,"mousedown",null,nd(t,k)));t.Cd.push(g.jd(n,"mouseover", +k,k.ap));t.Cd.push(g.jd(n,"mouseout",k,k.Bn));t.Cd.push(g.jd(m,"mouseover",k,k.ap));t.Cd.push(g.jd(m,"mouseout",k,k.Bn));e+=l.height+d[h]}else"button"==k.type&&(l=a,m=k.button,n=f,t=e,v=m.Ja(),m.moveTo(n,t),m.show(),l.Cd.push(g.ca(v,"mousedown",l,l.ai)),l.hm.push(m),e+=k.button.height+d[h])} +b.Im=function(){if(!this.H)return null;var a=this.H.getBoundingClientRect(),c=a.left;if(this.ul==g.Jd)return new g.g.Rect(-1E9,1E9,-1E9,c+a.width);g.g.userAgent.Go&&this.ub&&this.ub.kj&&(a=this.ub.H.getBoundingClientRect().x,10>Math.abs(a-c)&&(c+=this.kM*this.ub.options.Rb.scale));return new g.g.Rect(-1E9,1E9,c,1E9)}; +g.ds=function(a){this.s=a};b=g.ds.prototype;b.Ji=32;b.Kl=110;b.vr=20;b.Rl=20;b.H=null;b.cn=0;b.wl=0;b.Ja=function(){this.H=g.g.o.K("g",{},null);var a=String(Math.random()).substring(2);od(this,a);pd(this,a);this.s.Lc()&&qd(this,a);return this.H};b.Z=function(a){this.qh=this.vr+a;return this.qh+this.Kl};b.I=function(){this.H&&g.g.o.removeNode(this.H)}; +b.position=function(){if(this.qh){var a=this.s.jc();a&&(this.cn=a.Ia==g.Jd||this.s.Od&&!this.s.G?a.vb+a.qc-this.Ji-this.Rl-g.La.xc:this.Rl+g.La.xc,a.Ia==g.Fi?(this.wl=this.qh,this.Rq.setAttribute("transform","translate(0, 34)"),this.Sq&&this.Sq.setAttribute("transform","translate(0, 77)")):(this.wl=a.Cb+a.Fc-this.Kl-this.qh,this.Rq.setAttribute("transform","translate(0, 43)"),this.Bv.setAttribute("transform","translate(0, 77)")),this.H.setAttribute("transform","translate("+this.cn+","+this.wl+")"))}}; +function od(a,c){var d=a.s;a.Bv=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoomoutClipPath"+c},a.Bv);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.xd.width,height:g.xd.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+c+")"},a.Bv);a.setAttributeNS(g.g.o.ef,"xlink:href",d.options.wf+g.xd.url);g.ca(a,"mousedown",null,function(f){pa(d);jd(d,-1);g.Touch.Dh();f.stopPropagation();f.preventDefault()})} +function pd(a,c){var d=a.s;a.Rq=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoominClipPath"+c},a.Rq);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.xd.width,height:g.xd.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+c+")"},a.Rq);a.setAttributeNS(g.g.o.ef,"xlink:href",d.options.wf+g.xd.url);g.ca(a,"mousedown",null,function(f){pa(d);jd(d,1);g.Touch.Dh();f.stopPropagation();f.preventDefault()})} +function qd(a,c){var d=a.s;a.Sq=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoomresetClipPath"+c},a.Sq);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.xd.width,height:g.xd.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+c+")"},a.Sq);a.setAttributeNS(g.g.o.ef,"xlink:href",d.options.wf+g.xd.url);g.ca(a,"mousedown",null,function(f){pa(d);d.setScale(d.options.Hb.sA);g.g.o.rb(d.kb,"blocklyCanvasTransitioning");g.g.o.rb(d.zf,"blocklyCanvasTransitioning"); +if(d.Lc()){var h=d.jc(),k=(h.jf-h.vb)/2,l=(h.Ld-h.Cb)/2;k=-k-h.Hc;l=-l-h.tc;d.scroll(k,l)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.");setTimeout(d.LE.bind(d),500);g.Touch.Dh();f.stopPropagation();f.preventDefault()})} +g.Tc.register([".blocklyZoom>image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);g.Nv=function(a){this.pm=a;this.Ja()};b=g.Nv.prototype;b.bb=null;b.lf=null;b.pm=null;b.ii=1;b.On=null;b.Ja=function(){this.bb||(this.bb=g.g.o.K("svg",{xmlns:g.g.o.Yl,"xmlns:html":g.g.o.ak,"xmlns:xlink":g.g.o.ef,version:"1.1","class":"blocklyBlockDragSurface"},this.pm),this.lf=g.g.o.K("g",{},this.bb))};function hb(a,c){if(a.lf.childNodes.length)throw Error("Already dragging a block.");a.lf.appendChild(c);a.bb.style.display="block";a.On=new g.g.V(0,0)} +b.Mj=function(a,c){this.On=new g.g.V(a*this.ii,c*this.ii);a=this.On.x;c=this.On.y;a=a.toFixed(0);c=c.toFixed(0);this.bb.style.display="block";g.g.o.Gn(this.bb,"translate3d("+a+"px, "+c+"px, 0px)")};b.At=function(){var a=g.g.Oe(this.bb);return new g.g.V(a.x/this.ii,a.y/this.ii)};b.cc=function(){return this.lf}; +b.jp=function(a){a?a.appendChild(this.lf.firstChild):this.lf.removeChild(this.lf.firstChild);this.bb.style.display="none";if(this.lf.childNodes.length)throw Error("Drag group was not cleared.");this.On=null};g.Rh=function(a,c){g.SD();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!g.g.o.containsNode(document,a))throw Error("Error: container is not in current document.");c=new g.Fe(c||{});var d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);a=g.rm(d,c);var e=new g.Nv(d);d=new g.Qw(d);d=g.hE(a,c,e,d);g.xb.tb.iH(c.tb);g.KF(d);g.fn=d;g.rl(d);return d}; +g.rm=function(a,c){a.setAttribute("dir","LTR");g.Dc.Gx=c.G;g.Tc.Rh(c.AF,c.wf);a=g.g.o.K("svg",{xmlns:g.g.o.Yl,"xmlns:html":g.g.o.ak,"xmlns:xlink":g.g.o.ef,version:"1.1","class":"blocklySvg"},a);var d=g.g.o.K("defs",{},a),e=String(Math.random()).substring(2),f=g.g.o.K("filter",{id:"blocklyEmbossFilter"+e},d);g.g.o.K("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var h=g.g.o.K("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white", +result:"specOut"},f);g.g.o.K("fePointLight",{x:-5E3,y:-1E4,z:2E4},h);g.g.o.K("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);g.g.o.K("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);c.Xx=f.id;f=g.g.o.K("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);g.g.o.K("rect",{width:10,height:10,fill:"#aaa"},f);g.g.o.K("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);c.Pg=f.id; +c.Ly=g.xi.Ja(e,c.Ky,d);return a}; +g.hE=function(a,c,d,e){c.Rb=null;var f=new g.qb(c,d,e);f.scale=c.Hb.sA;a.appendChild(f.Ja("blocklyMainBackground"));!c.Oy&&c.Xk&&(d=fd(f,"svg"),g.g.o.fj(d,a));c.Sy&&dd(f);c.Hb&&c.Hb.controls&&ed(f);f.Zb.subscribe(a,"workspace","background-color");f.translate(0,0);g.fn=f;c.readOnly||f.Lc()||Ba(f,function(h){if(!f.lc()&&!f.Lc()&&-1!=g.i.$A.indexOf(h.type)){var k=Object.create(null),l=f.jc(),m=f.scale;k.G=f.G;k.gc=l.gc/m;k.pc=l.pc/m;k.GA=(l.gc+l.vb)/m;k.FA=(l.pc+l.Cb)/m;id(f)?(l=lc(f),k.Hc=l.left,k.tc= +l.top,k.wx=l.right,k.ux=l.bottom):(k.Hc=l.Hc/m,k.tc=l.tc/m,k.wx=(l.Hc+l.jf)/m,k.ux=(l.tc+l.Ld)/m);if(k.tck.FA||k.Hck.GA){l=null;h&&(l=g.i.cc(),g.i.aa(h.group));switch(h.type){case g.i.Bl:case g.i.Jv:var n=x(f,h.Gc);n=db(n);break;case g.i.to:case g.i.uo:n=f.mp[h.Uf]||null}if(n){m=Vc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var t=k.pc,v=k.FA-m.height;v=Math.max(t,v);t=g.g.Rd.zk(t,m.top,v)-m.top;v=k.gc;var w=k.GA-m.width;k.G?v=Math.min(w,v):w=Math.max(v,w);n.moveBy(g.g.Rd.zk(v, +m.left,w)-m.left,t)}h&&(h.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&g.i.aa(l))}}});g.rl(f);g.ba.Ja();g.D.Ja();g.J.Ja();return f}; +g.KF=function(a){var c=a.options,d=r(a);g.ca(d.parentNode,"contextmenu",null,function(e){g.g.$p(e)||e.preventDefault()});d=g.ca(window,"resize",null,function(){g.wc(!0);g.rl(a)});a.Aq=d;g.Rh.FD();c.Xk&&(a.sa?a.sa.Z(a):a.O&&(a.O.Z(a),a.O.show(c.Xk.childNodes),a.O.yc.set(0)));d=g.La.xc;c.Sy&&(d=a.cd.Z(d));c.Hb&&c.Hb.controls&&a.Tj.Z(d);c.Nc&&c.Nc.scrollbars?(a.Xb=new g.nk(a),a.Xb.resize()):a.ki({x:.5,y:.5});c.CF&&g.Rh.XF(c.wf,a)}; +g.Rh.FD=function(){g.FE||(g.ca(document,"scroll",null,function(){for(var a=g.Nb.getAll(),c=0,d;d=a[c];c++)d.Yn&&d.Yn()}),g.ca(document,"keydown",null,g.Eu),g.jd(document,"touchend",null,g.Zh),g.jd(document,"touchcancel",null,g.Zh),g.g.userAgent.ck&&g.ca(window,"orientationchange",document,function(){g.rl(g.Gb())}));g.FE=!0}; +g.Rh.XF=function(a,c){function d(){for(;f.length;)g.Ua(f.pop());e.preload()}var e=c.Rf;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(g.ca(document,"mousemove",null,d,!0));f.push(g.ca(document,"touchstart",null,d,!0))};g.fe=function(a,c){this.EA=c||"";this.cA=Object.create(null);if(a)for(a=a.split(","),c=0;c1'), +e.appendChild(d),c.push(e));if(g.S.variables_get){a.sort(g.bm.ox);d=0;for(var f;f=a[d];d++)e=g.g.xml.createElement("block"),e.setAttribute("type","variables_get"),e.setAttribute("gap",8),e.appendChild(g.N.Hm(f)),c.push(e)}}return c}; +g.N.oy=function(a){a=a.Ug();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var h=!1,k=0;kk[0]?1:h[0]=a.options.length&&(a.style.display="none")}for(d= +1;10>=d;d++)a=document.getElementById("level"+d),c=!!Ed(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(Fd,1)}function Ed(a){var c=Gd;try{var d=window.localStorage[c+a]}catch(e){}return d}function P(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 Hd(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 Fd(){if(!xd){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")}};g.g.A={};g.g.A.Za=function(a,c){return" "+a+","+c+" "};g.g.A.curve=function(a,c){return" "+a+c.join("")};g.g.A.moveTo=function(a,c){return" M "+a+","+c+" "};g.g.A.moveBy=function(a,c){return" m "+a+","+c+" "};g.g.A.lineTo=function(a,c){return" l "+a+","+c+" "};g.g.A.line=function(a){return" l"+a.join("")};g.g.A.ea=function(a,c){return" "+a+" "+c+" "};g.g.A.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};g.m.ui=function(){this.Jf=0;this.SC=3;this.If=5;this.mw=8;this.vd=10;this.Gw=this.If;this.Sr=15;this.Zl=5;this.zh=8;this.zC=15;this.yC=4;this.vC=12;this.AB=16;this.Db=8;this.Po=15;this.XC=0;this.YC=20;this.YA=4;this.VC=15;this.WC=100;this.UC=15;this.xr=24;this.CB=14.5;this.BB=this.Sr+11;this.EB=2;this.DB=this.xr;this.Cw=g.g.A.moveBy(0,0);this.$B=12;this.aC=6};b=g.m.ui.prototype; +b.Z=function(){this.fk=this.cu();this.hk=this.du();this.Dg=this.gu();this.Bi=this.fu();var a=this.Db,c=g.g.A.arc("a","0 0,0",a,g.g.A.Za(-a,a)),d=g.g.A.arc("a","0 0,0",a,g.g.A.Za(a,a));this.Nl={width:a,height:a,Lu:c,pq:d};c=this.Db;a=g.g.A.moveBy(0,c)+g.g.A.arc("a","0 0,1",c,g.g.A.Za(c,-c));c=g.g.A.arc("a","0 0,1",c,g.g.A.Za(-c,-c));this.qw={wv:a,us:c}};b.cu=function(){var a=this.$B,c=this.aC,d=g.g.A.line([g.g.A.Za(6,3),g.g.A.Za(-12,6),g.g.A.Za(6,3)]);return{height:a,width:c,path:d}}; +b.gu=function(){var a=this.VC,c=this.WC,d=g.g.A.curve("c",[g.g.A.Za(30,-a),g.g.A.Za(70,-a),g.g.A.Za(c,0)]);return{height:a,width:c,path:d}};b.fu=function(){function a(h){h=h?-1:1;var k=-h,l=d/2,m=g.g.A.Za(c,h*l);return g.g.A.curve("c",[g.g.A.Za(0,h*(l+2.5)),g.g.A.Za(-c,k*(l+.5)),g.g.A.Za(-c,h*l)])+g.g.A.curve("s",[g.g.A.Za(c,2.5*k),m])}var c=this.zh,d=this.Sr,e=a(!0),f=a(!1);return{width:c,height:d,Ve:f,sn:e}}; +b.du=function(){function a(k){return g.g.A.line([g.g.A.Za(k*e,d),g.g.A.Za(3*k,0),g.g.A.Za(k*e,-d)])}var c=this.zC,d=this.yC,e=(c-3)/2,f=a(1),h=a(-1);return{width:c,height:d,bi:f,Qz:h}};g.m.u={NONE:0,ze:1,Zv:2,aw:4,Or:8,Iv:16,ew:32,Xv:64,zg:128,cw:256,Dw:512,jB:1024,Gr:2048,zr:4096,DC:8192,gr:16384,qr:32768,pr:65536,Lr:131072,Kr:262144,iw:524288,Uo:1048576,Vr:2097152,$q:4194304,dw:8388608};g.m.u.uJ=g.m.u.qr|g.m.u.pr;g.m.u.ZK=g.m.u.Lr|g.m.u.Kr;g.m.u.uu=16777216;g.m.u.Qb=function(){g.m.u.hasOwnProperty(void 0)||(g.m.u[void 0]=g.m.u.uu,g.m.u.uu<<=1);return g.m.u[void 0]};g.m.u.Ym=function(a){return a.type&g.m.u.ze};g.m.u.jj=function(a){return a.type&g.m.u.Zv}; +g.m.u.Tk=function(a){return a.type&g.m.u.aw};g.m.u.uf=function(a){return a.type&g.m.u.Or};g.m.u.dM=function(a){return a.type&g.m.u.ew};g.m.u.tf=function(a){return a.type&g.m.u.zg};g.m.u.Xm=function(a){return a.type&g.m.u.Xv};g.m.u.Sh=function(a){return a.type&g.m.u.cw};g.m.u.an=function(a){return a.type&g.m.u.Dw};g.m.u.Vk=function(a){return a.type&g.m.u.Gr};g.m.u.Vh=function(a){return a.type&g.m.u.zr};g.m.u.SF=function(a){return a.type&(g.m.u.Gr|g.m.u.zr)};g.m.u.Uh=function(a){return a.type&g.m.u.pr}; +g.m.u.fM=function(a){return a.type&g.m.u.Kr};g.m.u.$m=function(a){return a.type&g.m.u.qr};g.m.u.gM=function(a){return a.type&g.m.u.Lr};g.m.u.cM=function(a){return a.type&g.m.u.gr};g.m.u.gz=function(a){return a.type&g.m.u.iw};g.m.u.hM=function(a){return a.type&g.m.u.Uo};g.m.u.bM=function(a){return a.type&g.m.u.Iv};g.m.u.bq=function(a){return a.type&g.m.u.Vr};g.m.u.Up=function(a){return a.type&g.m.u.$q};g.m.u.iM=function(a){return a.type&(g.m.u.Vr|g.m.u.$q)};g.m.u.eM=function(a){return a.type&g.m.u.dw};g.m.vh=function(a){this.height=this.width=0;this.type=g.m.u.NONE;this.Ch=this.Wa=0;this.C=a;this.Te=this.C.Po};g.m.ta=function(a,c){g.m.ta.w.constructor.call(this,a);this.Fs=c;a:switch(a=this.C,c.type){case g.Ra:case g.bf:c=a.Bi;break a;case g.cf:case g.Xa:c=a.hk;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=g.m.u.jB};g.g.object.X(g.m.ta,g.m.vh);g.m.Er=function(a,c){g.m.Er.w.constructor.call(this,a,c);this.type|=g.m.u.DC;this.height=this.shape.height;this.width=this.shape.width;this.Ke=this.C.Zl;this.we=this.width};g.g.object.X(g.m.Er,g.m.ta); +g.m.Hr=function(a,c){g.m.Hr.w.constructor.call(this,a,c);this.type|=g.m.u.Gr;this.height=this.shape.height;this.width=this.shape.width};g.g.object.X(g.m.Hr,g.m.ta);g.m.Ar=function(a,c){g.m.Ar.w.constructor.call(this,a,c);this.type|=g.m.u.zr;this.height=this.shape.height;this.width=this.shape.width};g.g.object.X(g.m.Ar,g.m.ta);g.m.Pl=function(a,c){g.m.Pl.w.constructor.call(this,a,c.connection);this.type|=g.m.u.zg;this.input=c;this.align=c.align;(this.Oi=c.connection&&C(c.connection)?C(c.connection):null)?(a=Ra(this.Oi),this.nm=a.width,this.np=a.height):this.np=this.nm=0;this.connection=c.connection;this.Ke=0};g.g.object.X(g.m.Pl,g.m.ta); +g.m.sh=function(a,c){g.m.sh.w.constructor.call(this,a,c);this.type|=g.m.u.cw;this.Oi?(this.width=this.nm,this.height=this.np):(this.height=this.C.BB,this.width=this.shape.width+this.C.CB);this.Ke=this.C.Zl;this.om=this.shape.height;this.Fh=this.shape.width};g.g.object.X(g.m.sh,g.m.Pl);g.m.yh=function(a,c){g.m.yh.w.constructor.call(this,a,c);this.type|=g.m.u.Dw;this.height=this.Oi?this.np+this.C.XC:this.C.DB;this.width=this.C.Po+this.shape.width};g.g.object.X(g.m.yh,g.m.Pl); +g.m.Eo=function(a,c){g.m.Eo.w.constructor.call(this,a,c);this.type|=g.m.u.Xv;this.height=this.Oi?this.np-2*this.C.Zl:this.shape.height;this.width=this.shape.width+this.C.EB;this.Ke=this.C.Zl;this.om=this.shape.height;this.Fh=this.shape.width};g.g.object.X(g.m.Eo,g.m.Pl);g.m.Hd=function(a,c){g.m.Hd.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=g.m.u.aw;a=new g.g.ge(g.Hd.prototype.Wo,g.Hd.prototype.Wo-2);this.height=a.height;this.width=a.width};g.g.object.X(g.m.Hd,g.m.vh);g.m.nr=function(a){g.m.nr.w.constructor.call(this,a);this.type|=g.m.u.iw;this.height=this.C.fk.height;this.width=this.C.fk.width};g.g.object.X(g.m.nr,g.m.vh); +g.m.oa=function(a,c){g.m.oa.w.constructor.call(this,a);this.$x=c;this.nd=c.Gf&&!!c.B&&c.B.nd();this.SE=c.wy();this.type|=g.m.u.ze;a=this.$x.Wg();this.height=a.height;this.width=a.width};g.g.object.X(g.m.oa,g.m.vh);g.m.lr=function(a){g.m.lr.w.constructor.call(this,a);this.type|=g.m.u.Zv;this.height=this.C.Dg.height;this.width=this.C.Dg.width;this.tk=this.height};g.g.object.X(g.m.lr,g.m.vh); +g.m.Zo=function(a,c){g.m.Zo.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.m.u.Lr:g.m.u.qr)|g.m.u.gr;this.width=this.height=this.C.Jf};g.g.object.X(g.m.Zo,g.m.vh);g.m.Vo=function(a,c){g.m.Vo.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.m.u.Kr:g.m.u.pr)|g.m.u.gr;this.width=this.C.Db;this.height=this.C.Db/2};g.g.object.X(g.m.Vo,g.m.vh);g.m.dk=function(a,c){g.m.dk.w.constructor.call(this,a);this.type=this.type|g.m.u.Or|g.m.u.ew;this.width=c;this.height=this.C.UC};g.g.object.X(g.m.dk,g.m.vh);g.m.Di=function(a){this.type=g.m.u.Uo;this.elements=[];this.Wa=this.Sc=this.qg=this.minWidth=this.minHeight=this.width=this.height=0;this.Qy=this.Np=this.It=this.Ad=this.$i=!1;this.C=a;this.Te=this.C.Po};g.m.Di.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function Id(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.m.u.tf(d))return d;return null}g.m.Di.prototype.nv=function(){return!0};g.m.Di.prototype.Yx=function(){return!0}; +function Jd(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.m.u.uf(d))return d;return null}g.m.pk=function(a){g.m.pk.w.constructor.call(this,a);this.type|=g.m.u.Vr;this.tk=this.Jg=0;this.BF=!1;this.connection=null};g.g.object.X(g.m.pk,g.m.Di);g.m.pk.prototype.Jt=function(a){var c=a.Yg?"cap"===a.Yg:g.xa.Dg,d=a.$&&C(a.$);return!!a.L||c||(d?q(d)==a:!1)}; +g.m.pk.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.m.u.uf(f)||(g.m.u.jj(f)?d=Math.max(d,f.tk):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Jg=this.tk=d;this.qg=this.width};g.m.pk.prototype.nv=function(){return!1};g.m.Uj=function(a){g.m.Uj.w.constructor.call(this,a);this.type|=g.m.u.$q;this.Ry=!1;this.connection=null;this.Li=this.ym=0};g.g.object.X(g.m.Uj,g.m.Di); +g.m.Uj.prototype.Jt=function(a){return!!a.L||!!q(a)};g.m.Uj.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.m.u.uf(f)||(g.m.u.Vh(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.ym=d;this.qg=this.width};g.m.Uj.prototype.nv=function(){return!1}; +g.m.Yo=function(a,c,d){g.m.Yo.w.constructor.call(this,a);this.type=this.type|g.m.u.Or|g.m.u.Iv;this.width=d;this.height=c;this.ly=!1;this.qg=0;this.elements=[new g.m.dk(this.C,d)]};g.g.object.X(g.m.Yo,g.m.Di);g.m.Yo.prototype.measure=function(){};g.m.ek=function(a){g.m.ek.w.constructor.call(this,a);this.type|=g.m.u.dw;this.sx=0};g.g.object.X(g.m.ek,g.m.Di); +g.m.ek.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,g.m.u.tf(d)&&(g.m.u.an(d)?a+=d.nm:g.m.u.Xm(d)&&0!=d.nm&&(a+=d.nm-d.Fh)),g.m.u.uf(d)||(this.height=Math.max(this.height,d.height));this.sx=a;this.qg=this.width+a};g.m.ek.prototype.Yx=function(){return!this.$i&&!this.Ad};g.m.wh=function(a,c){this.T=c;this.hh=a;this.C=this.hh.C;this.L=c.L?new g.m.Er(this.C,c.L):null;this.Rt=qc(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Th=c.Th();this.G=c.G;this.Gj=this.width=this.xl=this.height=0;this.rows=[];this.Vy=[];this.oc=new g.m.pk(this.C);this.Ob=new g.m.Uj(this.C);this.Fq=this.we=0};b=g.m.wh.prototype; +b.measure=function(){var a=this.T.Yg?"cap"===this.T.Yg:g.xa.Dg,c=!!this.T.$;this.oc.Jt(this.T)?this.oc.elements.push(new g.m.Zo(this.C)):this.oc.elements.push(new g.m.Vo(this.C));a?(a=new g.m.lr(this.C),this.oc.elements.push(a),this.oc.Jg=a.tk):c&&(this.oc.BF=!0,this.oc.connection=new g.m.Hr(this.C,this.T.$),this.oc.elements.push(this.oc.connection));this.T.P.length&&this.T.P[0].type==g.Xa&&!this.T.isCollapsed()?this.oc.minHeight=this.C.vd:this.oc.minHeight=this.C.If;this.rows.push(this.oc);a=new g.m.ek(this.C); +var d=Wa(this.T);if(d.length){c=0;for(var e;e=d[c];c++){var f=new g.m.Hd(this.C,e);this.isCollapsed&&e.lx?this.Vy.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.T.P[c];c++)if(d.isVisible()){!e||d.type!=g.Xa&&e.type!=g.Xa&&(d.type!=g.Ra&&d.type!=g.xg||this.Rt)||(this.rows.push(a),a=new g.m.ek(this.C));for(e=0;f=d.Na[e];e++)a.elements.push(new g.m.oa(this.C,f,d));this.Uw(d,a);e=d}this.isCollapsed&&(a.Qy=!0,a.elements.push(new g.m.nr(this.C)));(a.elements.length||a.Np)&&this.rows.push(a);this.Ob.Ry= +!!this.T.U;this.Ob.minHeight=this.T.P.length&&this.T.P[this.T.P.length-1].type==g.Xa?this.C.vd:this.C.If-1;this.Ob.Jt(this.T)?this.Ob.elements.push(new g.m.Zo(this.C)):this.Ob.elements.push(new g.m.Vo(this.C));this.Ob.Ry&&(this.Ob.connection=new g.m.Ar(this.C,this.T.U),this.Ob.elements.push(this.Ob.connection));this.rows.push(this.Ob);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.nv()&&c.elements.push(new g.m.dk(this.C,this.Fp(null,d[0])));for(e=0;ea.Bd&&(a.la+=g.g.A.ea("V",c.Sc+c.height-a.Bd)))};g.ma.Ci=function(a){this.Ij=a;this.Qn=g.g.o.K("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Ij);this.ql=g.g.o.K("path",{"class":"blocklyPath"},this.Ij);this.Sn=g.g.o.K("path",{"class":"blocklyPathLight"},this.Ij)};g.ma.Ci.prototype.cv=function(a,c){this.ql.setAttribute("d",a);this.Qn.setAttribute("d",a);this.Sn.setAttribute("d",c)}; +g.ma.Ci.prototype.mt=function(){this.ql.setAttribute("transform","scale(-1 1)");this.Sn.setAttribute("transform","scale(-1 1)");this.Qn.setAttribute("transform","translate(1,1) scale(-1 1)")};g.ma.sh=function(a,c){g.ma.sh.w.constructor.call(this,a,c);this.Oi&&(this.width+=this.C.td,this.height+=this.C.td)};g.g.object.X(g.ma.sh,g.m.sh);g.ma.yh=function(a,c){g.ma.yh.w.constructor.call(this,a,c);this.Oi&&(this.height+=this.C.td)};g.g.object.X(g.ma.yh,g.m.yh);g.ma.wh=function(a,c){g.ma.wh.w.constructor.call(this,a,c)};g.g.object.X(g.ma.wh,g.m.wh);b=g.ma.wh.prototype;b.Uw=function(a,c){this.Rt&&a.type==g.Ra?(c.elements.push(new g.ma.sh(this.C,a)),c.It=!0):a.type==g.Xa?(c.elements.push(new g.ma.yh(this.C,a)),c.Ad=!0):a.type==g.Ra?(c.elements.push(new g.m.Eo(this.C,a)),c.$i=!0):a.type==g.xg&&(c.Np=!0)}; +b.Fp=function(a,c){if(!a)return c&&g.m.u.Ym(c)&&c.nd?this.C.If:c&&g.m.u.Sh(c)?this.C.mw:c&&g.m.u.an(c)?this.C.YC:this.C.vd;if(!g.m.u.tf(a)&&!c)return g.m.u.Ym(a)&&a.nd?this.C.If:g.m.u.Tk(a)?2*this.C.vd+1:g.m.u.jj(a)?this.C.Jf:g.m.u.SF(a)?this.C.vd:g.m.u.Uh(a)?this.C.vC:g.m.u.gz(a)?this.C.Jf:this.C.vd;if(g.m.u.tf(a)&&!c){if(g.m.u.Xm(a))return this.C.Jf;if(g.m.u.Sh(a))return this.C.vd;if(g.m.u.an(a))return this.C.Jf}if(!g.m.u.tf(a)&&c&&g.m.u.tf(c)){if(a.nd){if(g.m.u.Sh(c)||g.m.u.Xm(c))return this.C.SC}else{if(g.m.u.Sh(c)|| +g.m.u.Xm(c))return this.C.mw;if(g.m.u.an(c))return this.C.vd}return this.C.vd-1}if(g.m.u.Tk(a)&&c&&!g.m.u.tf(c))return this.C.vd;if(g.m.u.Sh(a)&&c&&!g.m.u.tf(c))return c.nd?this.C.If:this.C.vd;if(g.m.u.$m(a)&&c){if(g.m.u.jj(c))return this.C.Jf;if(g.m.u.Vk(c))return c.Te;if(g.m.u.Vh(c))return a=(this.G?1:-1)*this.C.td/2,c.Te+a}if(g.m.u.Uh(a)&&c){if(g.m.u.Vk(c))return c.Te-this.C.Db;if(g.m.u.Vh(c))return a=(this.G?1:-1)*this.C.td/2,c.Te-this.C.Db+a}return!g.m.u.tf(a)&&c&&!g.m.u.tf(c)&&a.nd==c.nd||c&& +g.m.u.gz(c)?this.C.vd:this.C.If};b.fs=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(g.m.u.uf(e)){d=e;break a}d=null}e=Jd(a);if(a.$i||a.Ad)a.qg+=c;var f=Id(a);f?f.align==g.Xq?e.width+=c:f.align==g.Dv?(d.width+=c/2,e.width+=c/2):f.align==g.fd&&(d.width+=c):e.width+=c;a.width+=c};b.Ey=function(a,c){return g.m.u.bq(a)&&g.m.u.Up(c)?this.C.AB:g.m.u.bq(a)||g.m.u.Up(c)?this.C.Jf:a.$i&&c.$i?this.C.vd:!a.Ad&&c.Ad?this.C.YA:a.Ad&&c.Ad||!a.Ad&&c.Np?this.C.vd:this.C.If}; +b.vy=function(a,c){if(g.m.u.uf(c))return a.Sc+c.height/2;if(g.m.u.Up(a))return a=a.Sc+a.height-a.ym,g.m.u.Vh(c)?a+c.height/2:a-c.height/2;if(g.m.u.bq(a))return g.m.u.jj(c)?a.Jg-c.height/2:a.Jg+c.height/2;var d=a.Sc;g.m.u.Ym(c)||g.m.u.Tk(c)?(d+=c.height/2,(a.It||a.Ad)&&c.height+this.C.Gw<=a.height&&(d+=this.C.Gw)):d=g.m.u.Sh(c)?d+c.height/2:d+a.height/2;return d}; +b.ay=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Sc=c;e.Wa=this.we;c+=e.height;a=Math.max(a,e.qg);var f=c-this.oc.tk;e==this.Ob&&f=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},su:function(){10>O?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+vd+"&level="+(O+1):R.Pp()},Xy:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}var e=a;a=G;if(void 0===c){for(var f=0;d= +a.Rm[f];f++)d.lh(!1);a.Rm.length=0}if(d=e?x(a,e):null)(c=void 0===c||c)?-1==a.Rm.indexOf(d)&&a.Rm.push(d):g.g.cp(a.Rm,d),d.lh(c)},LF:function(a,c){a=document.getElementById(a);a.firstChild||(a=g.Rh(a,{rtl:yd(),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),g.R.Hh(g.R.mi(c),a))},sH:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Sg:function(a){if("click"==a.type&&"touchend"==R.Sg.Ru&&R.Sg.Pu+2E3>Date.now()||R.Sg.Ru==a.type&&R.Sg.Pu+400>Date.now())return a.preventDefault(), +a.stopPropagation(),!0;R.Sg.Ru=a.type;R.Sg.Pu=Date.now();return!1}};R.Sg.Ru=null;R.Sg.Pu=0;R.HF=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};R.IF=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=R;R.setCode=R.jA;R.getCode=R.ut;R.getWorkspace=R.Lk;var Q={hj:!1,Kx:null,sp:null,ml:function(a,c,d,e,f,h){function k(){Q.hj&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);Q.hj&&Q.pe(!1);g.Gb()&&g.wc(!0);Q.hj=!0;Q.Kx=c;Q.sp=h;var l=document.getElementById("dialog");h=document.getElementById("dialogShadow");var m=document.getElementById("dialogBorder"),n;for(n in f)l.style[n]=f[n];e&&(h.style.visibility="visible",h.style.opacity=.3,h.style.zIndex=9,e=document.createElement("div"), +e.id="dialogHeader",l.appendChild(e),Q.Os=g.jd(e,"mousedown",null,Q.wE));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(Q.fq(c,!1,.2),Q.fq(l,!0,.8),setTimeout(k,175)):k()},Lx:0,Mx:0,wE:function(a){Q.Rs();if(!g.g.lj(a)){var c=document.getElementById("dialog");Q.Lx=c.offsetLeft-a.clientX;Q.Mx=c.offsetTop-a.clientY;Q.Qs=g.jd(document,"mouseup",null,Q.Rs);Q.Ps=g.jd(document,"mousemove",null,Q.xE);a.stopPropagation()}},xE:function(a){var c=document.getElementById("dialog"), +d=Q.Lx+a.clientX;a=Q.Mx+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"},Rs:function(){Q.Qs&&(g.Ua(Q.Qs),Q.Qs=null);Q.Ps&&(g.Ua(Q.Ps),Q.Ps=null)},pe:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(Q.hj){Q.Rs();Q.Os&&(g.Ua(Q.Os),Q.Os=null);Q.hj=!1;Q.sp&&Q.sp();Q.sp=null;var d=!1===a? +null:Q.Kx;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(Q.fq(a,!1,.8),Q.fq(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)}},fq:function(a,c,d){function e(){f.style.width=h.width+"px";f.style.height=h.height+"px";f.style.left=h.x+"px";f.style.top= +h.y+"px";f.style.opacity=d}if(a){var f=document.getElementById("dialogBorder"),h=Q.XE(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},XE:function(a){var c=g.g.style.Mm(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},uA:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eO?P("Games_nextLevel").replace("%1",String(O+1)):P("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +Q.pe,!0);c.addEventListener("touchend",Q.pe,!0);c=document.getElementById("doneOk");c.addEventListener("click",R.su,!0);c.addEventListener("touchend",R.su,!0);Q.ml(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",Q.qx,!0)});document.body.addEventListener("keydown",Q.qx,!0);document.getElementById("dialogDoneText").textContent=d},Jx:function(a){!Q.hj||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(Q.pe(!0),a.stopPropagation(),a.preventDefault())}, +kv:function(){document.body.addEventListener("keydown",Q.Jx,!0)},ov:function(){document.body.removeEventListener("keydown",Q.Jx,!0)},qx:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)Q.pe(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&R.su()},Sw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)Q.pe(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&R.Pp()},ny:function(a){27==a.keyCode?Q.pe(!0):13==a.keyCode&&Q.qt()},qt: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 h=200==f.status?P("Games_submitted"):P("Games_httpRequestError")+"\nStatus: "+f.status;Q.uA(null,h)}};f.send(c.join("&"));Q.pe(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=Q;Q.hideDialog=Q.pe;var Zd,S;function $d(){if(10==O)return 1a.length)){e=[];for(f=0;fthis.En)return null;var a=this.getOptions(!0)[this.En][0];return"object"==typeof a?a.alt:a}; +g.Da.DA=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;dc||Math.abs(a.co-d)>c)a.yl=e,a.co=d,a.Ub.Fn(e+c,d+c),a.Pn.setAttribute("width",a.yl),a.Pn.setAttribute("height",a.co);a.T.G&&a.s.kb.setAttribute("transform","translate("+a.yl+",0)");a.s.resize()} +b.Yb=function(a){if(a!=this.isVisible())if(g.i.Oa(new g.i.yd(this.T,"mutatorOpen",!a,a)),a){this.Ub=new g.na(this.T.v,this.Hs(),this.T.Yd,this.dj,null,null);Ga(this.Ub,this.T.id);if(a=this.s.options.Xk)this.s.O.Z(this.s),this.s.O.show(a.childNodes);this.jh=this.T.Yf(this.s);a=p(this.jh,!1);for(var c=0,d;d=a[c];c++)d.Ea();this.jh.Dq(!1);this.jh.Ls=!1;this.s.O?(a=2*this.s.O.Db,c=Cb(this.s).cg()+a):c=a=16;this.T.G&&(c=-c);this.jh.moveBy(c,a);if(this.T.Dn){var e=this;this.T.Dn(this.jh);this.Eq=function(){e.T.Dn(e.jh)}; +Ba(this.T.v,this.Eq)}ce(this);Ba(this.s,this.KH.bind(this));this.Xe()}else this.Pn=null,this.s.I(),this.jh=this.s=null,this.Ub.I(),this.Ub=null,this.co=this.yl=0,this.Eq&&(Ca(this.T.v,this.Eq),this.Eq=null)}; +b.KH=function(a){if(a.type!=g.i.$o&&(a.type!=g.i.si||"disabled"!=a.element)){if(!this.s.lc()){a=A(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Sa(),f=Ra(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.jh.v==this.s){g.i.aa(!0);d=this.T;a=(a=d.Pa())&&g.R.Nd(a);c=d.ga;d.ga=!1;d.Vf(this.jh);d.ga=c;d.Qd();c=(c=d.Pa())&&g.R.Nd(c);if(a!=c){g.i.Oa(new g.i.sg(d,"mutation",null,a,c));var h=g.i.cc();setTimeout(function(){g.i.aa(h);d.Pb();g.i.aa(!1)},g.mo)}d.ga&&d.Ea();a!=c&&g.Se&&g.navigation.jG(d); +this.s.lc()||ce(this);g.i.aa(!1)}}};b.hF=function(){return{Cb:this.co,vb:this.yl-Cb(this.s).cg(),Fc:0,qc:this.s.G?0:Cb(this.s).cg()}};b.I=function(){this.T.Sd=null;g.Hd.prototype.I.call(this)};g.ac.yj=function(a,c,d){if(!a||!a.B.v)return!1;d=E(c,d).connection;var e=C(a);return e&&e!=c||d.ka==a?!1:(d.isConnected()&&d.disconnect(),d.connect(a),!0)};g.ac.by=function(a){var c=null;if(a&&a.options){var d=a.options.Rb;a.re?d&&d.options&&(c=d.options.Rb):d&&(c=d)}return c};g.S.au={};g.W.nC={};g.W.nC.bk=260; +g.Gh([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}", +args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value", +name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]); +g.S.lists_create_with={Z:function(){this.Wb=g.h.LISTS_CREATE_WITH_HELPURL;K(this,"list_blocks");this.Lb=3;this.dd();this.bd(!0,"Array");this.jl(new g.ac(["lists_create_with_item"]));this.Ta(g.h.LISTS_CREATE_WITH_TOOLTIP)},Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("items",this.Lb);return a},lb:function(a){this.Lb=parseInt(a.getAttribute("items"),10);this.dd()},Yf:function(a){var c=a.fg("lists_create_with_container");c.Qd();for(var d=E(c,"STACK").connection,e=0;e","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"]}]); +g.Gh([{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}"}]);g.W.ee.Ur={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}"};g.Y.register("logic_op_tooltip",g.Y.ep("OP",g.W.ee.Ur)); +g.W.ee.lB={le:0,mf:0,li:!0,Pa:function(){if(!this.le&&!this.mf)return null;var a=g.g.xml.createElement("mutation");this.le&&a.setAttribute("elseif",this.le);this.mf&&a.setAttribute("else",1);return a},lb:function(a){this.le=parseInt(a.getAttribute("elseif"),10)||0;this.mf=parseInt(a.getAttribute("else"),10)||0;this.WG()},Yf:function(a){var c=a.fg("controls_if_if");c.Qd();for(var d=c.U,e=1;e<=this.le;e++){var f=a.fg("controls_if_elseif");f.Qd();d.connect(f.$);d=f.U}this.mf&&(a=a.fg("controls_if_else"), +a.Qd(),d.connect(a.$));return c},Vf:function(a){a=C(a.U);this.mf=this.le=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.le++;c.push(a.bo);d.push(a.nh);break;case "controls_if_else":this.mf++;e=a.nh;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.U&&C(a.U)}this.dd();this.aA(c,d,e)},Dn:function(a){a=C(a.U);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=E(this,"IF"+c),e=E(this,"DO"+c);a.bo=d&&d.connection.ka;a.nh=e&&e.connection.ka; +c++;break;case "controls_if_else":e=E(this,"ELSE");a.nh=e&&e.connection.ka;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.U&&C(a.U)}},WG:function(){var a=[null],c=[null],d=null;E(this,"ELSE")&&(d=E(this,"ELSE").connection.ka);for(var e=1;E(this,"IF"+e);){var f=E(this,"DO"+e);a.push(E(this,"IF"+e).connection.ka);c.push(f.connection.ka);e++}this.dd();this.aA(a,c,d)},dd:function(){E(this,"ELSE")&&this.pb("ELSE");for(var a=1;E(this,"IF"+a);)this.pb("IF"+a),this.pb("DO"+a),a++;for(a= +1;a<=this.le;a++)H(L(this,"IF"+a).wa("Boolean"),g.h.CONTROLS_IF_MSG_ELSEIF),H(this.Qf(g.Xa,"DO"+a),g.h.CONTROLS_IF_MSG_THEN);this.mf&&H(this.Qf(g.Xa,"ELSE"),g.h.CONTROLS_IF_MSG_ELSE)},aA:function(a,c,d){for(var e=1;e<=this.le;e++)g.ac.yj(a[e],this,"IF"+e),g.ac.yj(c[e],this,"DO"+e);g.ac.yj(d,this,"ELSE")}};g.Y.An("controls_if_mutator",g.W.ee.lB,null,["controls_if_elseif","controls_if_else"]); +g.W.ee.mB=function(){this.Ta(function(){if(this.le||this.mf){if(!this.le&&this.mf)return g.h.CONTROLS_IF_TOOLTIP_2;if(this.le&&!this.mf)return g.h.CONTROLS_IF_TOOLTIP_3;if(this.le&&this.mf)return g.h.CONTROLS_IF_TOOLTIP_4}else return g.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};g.Y.register("controls_if_tooltip",g.W.ee.mB); +g.W.ee.jC={onchange:function(a){this.vn||(this.vn=[null,null]);var c=N(this,"A"),d=N(this,"B");c&&d&&!oc(c.L,d.L)&&(g.i.aa(a.group),a=this.vn[0],a!==c&&(D(c),a&&!a.ib&&E(this,"A").connection.connect(a.L)),c=this.vn[1],c!==d&&(D(d),c&&!c.ib&&E(this,"B").connection.connect(c.L)),this.Pb(),g.i.aa(!1));this.vn[0]=N(this,"A");this.vn[1]=N(this,"B")}};g.W.ee.iC=function(){this.eg(g.W.ee.jC)};g.Y.register("logic_compare",g.W.ee.iC); +g.W.ee.kC={Wz:null,onchange:function(a){var c=N(this,"THEN"),d=N(this,"ELSE"),e=this.L.ka;if((c||d)&&e)for(var f=0;2>f;f++){var h=1==f?c:d;h&&!oc(h.L,e)&&(g.i.aa(a.group),e===this.Wz?(D(this),e.B.Pb()):(D(h),h.Pb()),g.i.aa(!1))}this.Wz=e}};g.Y.wq("logic_ternary",g.W.ee.kC);g.zb=function(a,c,d){this.ol=!0;null==a&&(a="");g.zb.w.constructor.call(this,a,c,d)};g.g.object.X(g.zb,g.oa);g.zb.pa=function(a){var c=g.g.nc(a.text);return new g.zb(c,void 0,a)};g.zb.prototype.Ei=!0;g.zb.Yv=11;g.zb.Lv=4;b=g.zb.prototype;b.xo="text";b.ld=function(a){g.zb.w.ld.call(this,a);"boolean"==typeof a.spellcheck&&(this.ol=a.spellcheck)};b.Qg=function(a){return null===a||void 0===a?null:String(a)}; +b.Tx=function(){if(this.Sk){this.aq=!1;var a=this.$a;this.$a=this.kc.BA;this.B&&g.i.isEnabled()&&g.i.Oa(new g.i.sg(this.B,"field",this.name||null,a,this.$a))}};b.Rg=function(a){this.aq=!0;this.$a=a;this.Sk||(this.sf=!0)};b.fh=function(){g.zb.w.fh.call(this);this.Sk&&(this.B.G?setTimeout(this.ih.bind(this),0):this.ih(),this.aq?(g.g.o.Sb(this.kc,"blocklyInvalidInput"),g.g.M.eb(this.kc,"invalid",!1)):(g.g.o.rb(this.kc,"blocklyInvalidInput"),g.g.M.eb(this.kc,"invalid",!0)))}; +function de(a){0!=a.ol&&(a.ol=!1,a.kc&&a.kc.setAttribute("spellcheck",a.ol))}b.yf=function(a){this.s=this.B.v;a=a||!1;!a&&(g.g.userAgent.wC||g.g.userAgent.Al||g.g.userAgent.ck)?ee(this):(g.ba.show(this,this.B.G,this.JH.bind(this)),this.kc=this.Pq(),this.Sk=!0,a||(this.kc.focus(),this.kc.select()))};function ee(a){g.prompt(g.h.CHANGE_VALUE_TITLE,a.dc(),function(c){a.setValue(c)})} +b.Pq=function(){var a=g.ba.Ca,c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.ol);var d=g.zb.Yv*this.s.scale+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=g.zb.Lv*this.s.scale+"px";a.appendChild(c);c.value=c.defaultValue=String(this.$a);c.BA=this.$a;c.yu=null;g.g.userAgent.Go?setTimeout(this.ih.bind(this),0):this.ih();fe(this,c);return c}; +b.JH=function(){this.Sk=!1;this.aq=!0;xb(this);this.Bu&&this.Bu(this.$a);g.Ua(this.pn);g.Ua(this.zG);var a=g.ba.Ca.style;a.width="auto";a.height="auto";a.fontSize=""};function fe(a,c){a.pn=g.ca(c,"keydown",a,a.Cu);a.zG=g.ca(c,"input",a,a.yG)}b.Cu=function(a){a.keyCode==g.g.ya.Gl?(g.ba.Ha(),g.D.bj()):a.keyCode==g.g.ya.jr?(this.kc.value=this.kc.defaultValue,g.ba.Ha(),g.D.bj()):a.keyCode==g.g.ya.Fw&&(g.ba.Ha(),g.D.bj(),Wc(this.B,this,!a.shiftKey),a.preventDefault())}; +b.yG=function(){var a=this.kc.value;a!==this.kc.yu&&(this.kc.yu=a,g.i.aa(!0),this.setValue(a),xb(this),g.i.aa(!1))};b.ih=function(){var a=g.ba.Ca,c=wb(this);a.style.width=c.right-c.left+"px";a.style.height=c.bottom-c.top+"px";c=new g.g.V(this.B.G?c.right-a.offsetWidth:c.left,c.top);c.y+=1;g.g.userAgent.Go&&g.ba.Ca.style.top&&(--c.x,--c.y);g.g.userAgent.Zr&&(c.y-=3);a.style.left=c.x+"px";a.style.top=c.y+"px"}; +g.zb.sG=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)};g.zb.lM=function(a){(a=g.zb.sG(a))&&(a=String(Math.max(0,Math.floor(a))));return a};g.zb.prototype.hz=function(){return!0};g.zb.prototype.Jp=function(){return this.Sk&&this.kc?this.kc.value:null};g.vc.register("field_input",g.zb);g.Ze=function(a,c,d,e,f,h){this.mn=-Infinity;this.kn=Infinity;this.dl=0;this.Js=null;g.Ze.w.constructor.call(this,a||0,f,h);h||(ge(this,c),he(this,d),ie(this,e),this.setValue(this.getValue()))};g.g.object.X(g.Ze,g.zb);g.Ze.pa=function(a){return new g.Ze(a.value,void 0,void 0,void 0,void 0,a)};g.Ze.prototype.Ei=!0;g.Ze.prototype.ld=function(a){g.Ze.w.ld.call(this,a);ge(this,a.min);he(this,a.max);ie(this,a.precision)};function ge(a,c){null==c?a.mn=-Infinity:(c=Number(c),isNaN(c)||(a.mn=c))} +function he(a,c){null==c?a.kn=Infinity:(c=Number(c),isNaN(c)||(a.kn=c))}function ie(a,c){null==c?a.dl=0:(c=Number(c),isNaN(c)||(a.dl=c));var d=a.dl.toString(),e=d.indexOf(".");a.Js=-1==e?c?0:null:d.length-e-1}g.Ze.prototype.Qg=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.mn),this.kn);this.dl&&isFinite(a)&&(a=Math.round(a/this.dl)*this.dl);null!=this.Js&&(a=Number(a.toFixed(this.Js)));return a}; +g.Ze.prototype.Pq=function(){var a=g.Ze.w.Pq.call(this);-Infinitythis.kn&&g.g.M.eb(a,g.g.M.State.lD,this.kn);return a};g.vc.register("field_number",g.Ze);g.Be=function(a,c,d,e,f){this.pj=g.Be.KE;this.tE=a||"";this.Bb=new g.g.ge(0,g.xa.yr);f&&this.ld(f);c&&(this.Oj=c);f||je(this,d,e)};g.g.object.X(g.Be,g.Da);g.Be.pa=function(a){var c=g.g.nc(a.variable);return new g.Be(c,void 0,void 0,void 0,a)};b=g.Be.prototype;b.s=null;b.Ei=!0;b.ld=function(a){g.Be.w.ld.call(this,a);je(this,a.variableTypes,a.defaultType)};b.ej=function(){if(!this.Zd){var a=g.N.Hp(this.B.v,null,this.tE,this.sE);g.i.disable();this.setValue(a.va());g.i.enable()}}; +b.Gm=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=g.N.Hp(this.B.v,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.va()+"' had type "+c.type+", and does not match variable field that references it: "+g.R.Nd(a)+".");this.setValue(c.va())};b.xA=function(a){this.ej();a.id=this.Zd.va();a.textContent=this.Zd.name;this.Zd.type&&a.setAttribute("variabletype",this.Zd.type);return a}; +b.fv=function(a){if(a.ib)throw Error("Variable fields are not allowed to exist on shadow blocks.");g.Be.w.fv.call(this,a)};b.getValue=function(){return this.Zd?this.Zd.va():null};b.dc=function(){return this.Zd?this.Zd.name:""};b.Zc=function(){return this.Zd};b.Iy=function(){return this.Zd?this.Oj:null}; +b.Qg=function(a){if(null===a)return null;var c=g.N.Zc(this.B.v,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=ke(this)){for(var e=0;e=d||0>=c)throw Error("Height and width values of an image field must be greater than 0.");this.Em=!1;this.bp="";g.Hf.w.constructor.call(this,a||"",null,k);k||(this.Em=!!h,this.bp=g.g.nc(e)||"");this.Bb=new g.g.ge(c,d+g.Hf.bs);this.GF=d;this.jm=null;"function"== +typeof f&&(this.jm=f)};g.g.object.X(g.Hf,g.oa);g.Hf.pa=function(a){return new g.Hf(a.src,a.width,a.height,void 0,void 0,void 0,a)};g.Hf.bs=1;b=g.Hf.prototype;b.Gf=!1;b.sf=!1;b.ld=function(a){g.Hf.w.ld.call(this,a);this.Em=!!a.flipRtl;this.bp=g.g.nc(a.alt)||""};b.Zg=function(){this.Re=g.g.o.K("image",{height:this.GF+"px",width:this.Bb.width+"px",alt:this.bp},this.me);this.Re.setAttributeNS(g.g.o.ef,"xlink:href",this.$a)};b.Qg=function(a){return"string"!=typeof a?null:a}; +b.Rg=function(a){this.$a=a;this.Re&&this.Re.setAttributeNS(g.g.o.ef,"xlink:href",this.$a||"")};b.wy=function(){return this.Em};b.yf=function(){this.jm&&this.jm(this)};b.Jp=function(){return this.bp};g.vc.register("field_image",g.Hf);g.Ae=function(a,c,d){null==a&&(a="");g.Ae.w.constructor.call(this,a,c,d)};g.g.object.X(g.Ae,g.zb);g.Ae.Lo=20;g.Ae.pa=function(a){var c=g.g.nc(a.text);return new g.Ae(c,void 0,a)};b=g.Ae.prototype;b.Zg=function(){tb(this);this.Iq=g.g.o.K("g",{"class":"blocklyEditableText"},this.me)}; +b.Ep=function(){var a=this.$a;if(!a)return g.oa.Oo;var c=a.split("\n");a="";for(var d=0;dthis.hq&&(e=e.substring(0,this.hq-4)+"...");e=e.replace(/\s/g,g.oa.Oo);a+=e;d!==c.length-1&&(a+="\n")}this.B.G&&(a+="\u200f");return a}; +b.fh=function(){for(var a;a=this.Iq.firstChild;)this.Iq.removeChild(a);a=this.Ep().split("\n");for(var c=g.oa.bs/2,d=0,e=0;ec&&(c=f);d+=g.Ae.Lo}this.Kd&&(c+=g.oa.rk,this.Kd.setAttribute("width",c),this.Kd.setAttribute("height",d));this.Bb.width=c;this.Bb.height=d};b.ih=function(){var a=g.ba.Ca,c=wb(this);a.style.width=c.right-c.left+"px";a.style.height=c.bottom-c.top+"px";c=new g.g.V(this.B.G?c.right-a.offsetWidth:c.left,c.top);a.style.left=c.x+"px";a.style.top=c.y+"px"}; +b.Pq=function(){var a=g.ba.Ca,c=this.s.scale,d=document.createElement("textarea");d.className="blocklyHtmlInput blocklyHtmlTextAreaInput";d.setAttribute("spellcheck",this.ol);var e=g.zb.Yv*c+"pt";a.style.fontSize=e;d.style.fontSize=e;d.style.borderRadius=g.zb.Lv*c+"px";e=g.oa.wg*c;d.style.paddingLeft=e+"px";d.style.width="calc(100% - "+e+"px)";d.style.lineHeight=g.Ae.Lo*c+"px";a.appendChild(d);d.value=d.defaultValue=String(this.$a);d.BA=this.$a;d.yu=null;g.g.userAgent.Go?setTimeout(this.ih.bind(this), +0):this.ih();fe(this,d);return d};b.Cu=function(a){a.keyCode!==g.g.ya.Gl&&g.Ae.w.Cu.call(this,a)};g.Tc.register(".blocklyHtmlTextAreaInput {,font-family: monospace;,resize: none;,overflow: hidden;,height: 100%;,text-align: left;,}".split(","));g.vc.register("field_multilinetext",g.Ae);g.S.xH={};g.W.Text={};g.W.Text.bk=160; +g.Gh([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12, +height:17,alt:"\u00b6"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"}, +{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}], +previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}", +helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}", +args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]); +g.S.text_getSubstring={Z:function(){this.WHERE_OPTIONS_1=[[g.h.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[g.h.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[g.h.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[g.h.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[g.h.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[g.h.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.Wb=g.h.TEXT_GET_SUBSTRING_HELPURL;K(this,"text_blocks");H(L(this,"STRING").wa("String"),g.h.TEXT_GET_SUBSTRING_INPUT_IN_TEXT); +M(this,"AT1");M(this,"AT2");g.h.TEXT_GET_SUBSTRING_TAIL&&H(M(this,"TAIL"),g.h.TEXT_GET_SUBSTRING_TAIL);this.te(!0);this.bd(!0,"String");this.Tb(1,!0);this.Tb(2,!0);this.Ta(g.h.TEXT_GET_SUBSTRING_TOOLTIP)},Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("at1",E(this,"AT1").type==g.Ra);a.setAttribute("at2",E(this,"AT2").type==g.Ra);return a},lb:function(a){var c="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.Tb(1,c);this.Tb(2,a)},Tb:function(a,c){this.pb("AT"+ +a);this.pb("ORDINAL"+a,!0);c?(L(this,"AT"+a).wa("Number"),g.h.ORDINAL_NUMBER_SUFFIX&&H(M(this,"ORDINAL"+a),g.h.ORDINAL_NUMBER_SUFFIX)):M(this,"AT"+a);2==a&&g.h.TEXT_GET_SUBSTRING_TAIL&&(this.pb("TAIL",!0),H(M(this,"TAIL"),g.h.TEXT_GET_SUBSTRING_TAIL));var d=new g.Da(this["WHERE_OPTIONS_"+a],function(e){var f="FROM_START"==e||"FROM_END"==e;if(f!=c){var h=this.B;h.Tb(a,f);wc(h,e,"WHERE"+a);return null}});H(E(this,"AT"+a),d,"WHERE"+a);1==a&&(zc(this,"AT1","AT2"),E(this,"ORDINAL1")&&zc(this,"ORDINAL1", +"AT2"))}};g.S.text_changeCase={Z:function(){var a=[[g.h.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[g.h.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[g.h.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.Wb=g.h.TEXT_CHANGECASE_HELPURL;K(this,"text_blocks");H(L(this,"TEXT").wa("String"),new g.Da(a),"CASE");this.bd(!0,"String");this.Ta(g.h.TEXT_CHANGECASE_TOOLTIP)}}; +g.S.text_trim={Z:function(){var a=[[g.h.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[g.h.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[g.h.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.Wb=g.h.TEXT_TRIM_HELPURL;K(this,"text_blocks");H(L(this,"TEXT").wa("String"),new g.Da(a),"MODE");this.bd(!0,"String");this.Ta(g.h.TEXT_TRIM_TOOLTIP)}}; +g.S.text_print={Z:function(){yc(this,{message0:g.h.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:g.h.TEXT_PRINT_TOOLTIP,helpUrl:g.h.TEXT_PRINT_HELPURL})}}; +g.S.text_prompt_ext={Z:function(){var a=[[g.h.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[g.h.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.Wb=g.h.TEXT_PROMPT_HELPURL;K(this,"text_blocks");var c=this;a=new g.Da(a,function(d){c.Cf(d)});H(L(this,"TEXT"),a,"TYPE");this.bd(!0,"String");this.Ta(function(){return"TEXT"==z(c,"TYPE")?g.h.TEXT_PROMPT_TOOLTIP_TEXT:g.h.TEXT_PROMPT_TOOLTIP_NUMBER})},Cf:function(a){this.L.wa("NUMBER"==a?"Number":"String")},Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("type", +z(this,"TYPE"));return a},lb:function(a){this.Cf(a.getAttribute("type"))}}; +g.S.text_prompt={Z:function(){this.eg(g.W.Text.Ir);var a=[[g.h.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[g.h.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],c=this;this.Wb=g.h.TEXT_PROMPT_HELPURL;K(this,"text_blocks");a=new g.Da(a,function(d){c.Cf(d)});H(H(H(H(M(this),a,"TYPE"),this.$k(!0)),new g.zb(""),"TEXT"),this.$k(!1));this.bd(!0,"String");this.Ta(function(){return"TEXT"==z(c,"TYPE")?g.h.TEXT_PROMPT_TOOLTIP_TEXT:g.h.TEXT_PROMPT_TOOLTIP_NUMBER})},Cf:g.S.text_prompt_ext.Cf,Pa:g.S.text_prompt_ext.Pa,lb:g.S.text_prompt_ext.lb}; +g.S.text_count={Z:function(){yc(this,{message0:g.h.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:g.h.TEXT_COUNT_TOOLTIP,helpUrl:g.h.TEXT_COUNT_HELPURL})}}; +g.S.text_replace={Z:function(){yc(this,{message0:g.h.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:g.h.TEXT_REPLACE_TOOLTIP,helpUrl:g.h.TEXT_REPLACE_HELPURL})}}; +g.S.text_reverse={Z:function(){yc(this,{message0:g.h.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:g.h.TEXT_REVERSE_TOOLTIP,helpUrl:g.h.TEXT_REVERSE_HELPURL})}}; +g.W.Text.Ir={IC:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",JC:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==", +KC:12,HC:12,VG:function(a){for(var c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)if(a==f.name){rc(d,e,this.$k(!0));rc(d,e+2,this.$k(!1));return}console.warn('field named "'+a+'" not found in '+pc(this))},$k:function(a){a=this.G?!a:a;return new g.Hf(a?this.IC:this.JC,this.KC,this.HC,a?"\u201c":"\u201d")}};g.W.Text.fD=function(){this.eg(g.W.Text.Ir);this.VG("TEXT")}; +g.W.Text.eD={Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("items",this.Lb);return a},lb:function(a){this.Lb=parseInt(a.getAttribute("items"),10);this.dd()},Yf:function(a){var c=a.fg("text_create_join_container");c.Qd();for(var d=E(c,"STACK").connection,e=0;ed?U(a,c,g.j.Bg)||h:e?U(a,c,g.j.Vl)||h:U(a,c,f)||h;if(g.Wh(a))a=Number(a)+d,e&&(a=-a);else{if(0d&&(a=a+" - "+-d,k=g.j.Bg);e&&(a=d?"-("+a+")":"-"+a,k=g.j.Vl);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};g.j.Ab={};g.j.colour_picker=function(a){return[g.j.uq(z(a,"COLOUR")),g.j.Ee]};g.j.colour_random=function(){return[V("colourRandom",["function "+g.j.hc+"() {"," var num = Math.floor(Math.random() * Math.pow(2, 24));"," return '#' + ('00000' + num.toString(16)).substr(-6);","}"])+"()",g.j.Aa]}; +g.j.colour_rgb=function(a){var c=U(a,"RED",g.j.Ya)||0,d=U(a,"GREEN",g.j.Ya)||0;a=U(a,"BLUE",g.j.Ya)||0;return[V("colourRgb",["function "+g.j.hc+"(r, g, b) {"," r = Math.max(Math.min(Number(r), 100), 0) * 2.55;"," g = Math.max(Math.min(Number(g), 100), 0) * 2.55;"," b = Math.max(Math.min(Number(b), 100), 0) * 2.55;"," r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);"," g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);"," b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);", +" return '#' + r + g + b;","}"])+"("+c+", "+d+", "+a+")",g.j.Aa]}; +g.j.colour_blend=function(a){var c=U(a,"COLOUR1",g.j.Ya)||"'#000000'",d=U(a,"COLOUR2",g.j.Ya)||"'#000000'";a=U(a,"RATIO",g.j.Ya)||.5;return[V("colourBlend",["function "+g.j.hc+"(c1, c2, ratio) {"," ratio = Math.max(Math.min(Number(ratio), 1), 0);"," var r1 = parseInt(c1.substring(1, 3), 16);"," var g1 = parseInt(c1.substring(3, 5), 16);"," var b1 = parseInt(c1.substring(5, 7), 16);"," var r2 = parseInt(c2.substring(1, 3), 16);"," var g2 = parseInt(c2.substring(3, 5), 16);"," var b2 = parseInt(c2.substring(5, 7), 16);", +" var r = Math.round(r1 * (1 - ratio) + r2 * ratio);"," var g = Math.round(g1 * (1 - ratio) + g2 * ratio);"," var b = Math.round(b1 * (1 - ratio) + b2 * ratio);"," r = ('0' + (r || 0).toString(16)).slice(-2);"," g = ('0' + (g || 0).toString(16)).slice(-2);"," b = ('0' + (b || 0).toString(16)).slice(-2);"," return '#' + r + g + b;","}"])+"("+c+", "+d+", "+a+")",g.j.Aa]};g.j.au={};g.j.lists_create_empty=function(){return["[]",g.j.Ee]};g.j.lists_create_with=function(a){for(var c=Array(a.Lb),d=0;d b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];", +" return function(a, b) { return compare(a, b) * direction; }","}"]);return[c+".slice().sort("+e+'("'+a+'", '+d+"))",g.j.Aa]};g.j.lists_split=function(a){var c=U(a,"INPUT",g.j.ab),d=U(a,"DELIM",g.j.wb)||"''";a=z(a,"MODE");if("SPLIT"==a)c||(c="''"),a="split";else if("JOIN"==a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+d+")",g.j.Aa]};g.j.lists_reverse=function(a){return[(U(a,"LIST",g.j.Aa)||"[]")+".slice().reverse()",g.j.Aa]};g.j.YF={};g.j.controls_if=function(a){var c=0,d="";g.j.Id&&(d+=T(g.j.Id,a));do{var e=U(a,"IF"+c,g.j.wb)||"false";var f=oe(a,"DO"+c);g.j.Wc&&(f=ne(T(g.j.Wc,a),g.j.ud)+f);d+=(0",GTE:">="}[z(a,"OP")],d="=="==c||"!="==c?g.j.pw:g.j.BC,e=U(a,"A",d)||"0";a=U(a,"B",d)||"0";return[e+" "+c+" "+a,d]};g.j.logic_operation=function(a){var c="AND"==z(a,"OP")?"&&":"||",d="&&"==c?g.j.Br:g.j.Cr,e=U(a,"A",d);a=U(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]};g.j.logic_negate=function(a){var c=g.j.kk;return["!"+(U(a,"BOOL",c)||"true"),c]}; +g.j.logic_boolean=function(a){return["TRUE"==z(a,"BOOL")?"true":"false",g.j.Ee]};g.j.logic_null=function(){return["null",g.j.Ee]};g.j.logic_ternary=function(a){var c=U(a,"IF",g.j.Qo)||"false",d=U(a,"THEN",g.j.Qo)||"null";a=U(a,"ELSE",g.j.Qo)||"null";return[c+" ? "+d+" : "+a,g.j.Qo]};g.j.$F={};g.j.controls_repeat_ext=function(a){var c=B(a,"TIMES")?String(Number(z(a,"TIMES"))):U(a,"TIMES",g.j.Ai)||"0",d=oe(a,"DO");d=pe(d,a);a="";var e=sd(g.j.Gd,"count",g.N.Eb),f=c;c.match(/^\w+$/)||g.Wh(c)||(f=sd(g.j.Gd,"repeat_end",g.N.Eb),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")};g.j.controls_repeat=g.j.controls_repeat_ext; +g.j.controls_whileUntil=function(a){var c="UNTIL"==z(a,"MODE"),d=U(a,"BOOL",c?g.j.kk:g.j.wb)||"false",e=oe(a,"DO");e=pe(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"}; +g.j.controls_for=function(a){var c=rd(z(a,"VAR"),g.N.Eb),d=U(a,"FROM",g.j.Ai)||"0",e=U(a,"TO",g.j.Ai)||"0",f=U(a,"BY",g.j.Ai)||"1",h=oe(a,"DO");h=pe(h,a);if(g.Wh(d)&&g.Wh(e)&&g.Wh(f)){var k=Number(d)<=Number(e);a="for ("+c+" = "+d+"; "+c+(k?" <= ":" >= ")+e+"; "+c;c=Math.abs(Number(f));a=(1==c?a+(k?"++":"--"):a+((k?" += ":" -= ")+c))+(") {\n"+h+"}\n")}else a="",k=d,d.match(/^\w+$/)||g.Wh(d)||(k=sd(g.j.Gd,c+"_start",g.N.Eb),a+="var "+k+" = "+d+";\n"),d=e,e.match(/^\w+$/)||g.Wh(e)||(d=sd(g.j.Gd,c+"_end", +g.N.Eb),a+="var "+d+" = "+e+";\n"),e=sd(g.j.Gd,c+"_inc",g.N.Eb),a+="var "+e+" = ",a=g.Wh(f)?a+(Math.abs(f)+";\n"):a+("Math.abs("+f+");\n"),a=a+("if ("+k+" > "+d+") {\n")+(g.j.ud+e+" = -"+e+";\n"),a+="}\n",a+="for ("+c+" = "+k+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+h+"}\n";return a}; +g.j.controls_forEach=function(a){var c=rd(z(a,"VAR"),g.N.Eb),d=U(a,"LIST",g.j.Ai)||"[]",e=oe(a,"DO");e=pe(e,a);a="";var f=d;d.match(/^\w+$/)||(f=sd(g.j.Gd,c+"_list",g.N.Eb),a+="var "+f+" = "+d+";\n");d=sd(g.j.Gd,c+"_index",g.N.Eb);e=g.j.ud+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")}; +g.j.controls_flow_statements=function(a){var c="";g.j.Id&&(c+=T(g.j.Id,a));g.j.Wc&&(c+=T(g.j.Wc,a));if(g.j.Id){var d=g.W.Ce.vo.Hy(a);d&&!d.li&&(c+=T(g.j.Id,d))}switch(z(a,"FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");};g.j.Rd={};g.j.math_number=function(a){a=Number(z(a,"NUM"));return[a,0<=a?g.j.Ee:g.j.Vl]};g.j.math_arithmetic=function(a){var c={ADD:[" + ",g.j.Ag],MINUS:[" - ",g.j.Bg],MULTIPLY:[" * ",g.j.Dr],DIVIDE:[" / ",g.j.Tl],POWER:[null,g.j.Ya]}[z(a,"OP")],d=c[0];c=c[1];var e=U(a,"A",c)||"0";a=U(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",g.j.Aa]}; +g.j.math_single=function(a){var c=z(a,"OP");if("NEG"==c)return a=U(a,"NUM",g.j.Vl)||"0","-"==a[0]&&(a=" "+a),["-"+a,g.j.Vl];a="SIN"==c||"COS"==c||"TAN"==c?U(a,"NUM",g.j.Tl)||"0":U(a,"NUM",g.j.wb)||"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,g.j.Aa];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,g.j.Tl]}; +g.j.math_constant=function(a){return{PI:["Math.PI",g.j.ab],E:["Math.E",g.j.ab],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",g.j.Tl],SQRT2:["Math.SQRT2",g.j.ab],SQRT1_2:["Math.SQRT1_2",g.j.ab],INFINITY:["Infinity",g.j.Ee]}[z(a,"CONSTANT")]}; +g.j.math_number_property=function(a){var c=U(a,"NUMBER_TO_CHECK",g.j.Ul)||"0",d=z(a,"PROPERTY");if("PRIME"==d){var e=V("mathIsPrime",["function "+g.j.hc+"(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,g.j.Aa]}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=U(a,"DIVISOR",g.j.Ul)||"0",e=c+" % "+a+" == 0"}return[e,g.j.pw]}; +g.j.math_change=function(a){var c=U(a,"DELTA",g.j.Ag)||"0";a=rd(z(a,"VAR"),g.N.Eb);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};g.j.math_round=g.j.math_single;g.j.math_trig=g.j.math_single; +g.j.math_on_list=function(a){var c=z(a,"OP");switch(c){case "SUM":a=U(a,"LIST",g.j.ab)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=U(a,"LIST",g.j.Ya)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=U(a,"LIST",g.j.Ya)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=V("mathMean",["function "+g.j.hc+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=U(a,"LIST",g.j.wb)||"[]";a=c+"("+a+")";break;case "MEDIAN":c= +V("mathMedian",["function "+g.j.hc+"(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=U(a,"LIST",g.j.wb)||"[]";a=c+"("+a+")";break;case "MODE":c=V("mathModes",["function "+ +g.j.hc+"(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=U(a,"LIST",g.j.wb)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=V("mathStandardDeviation",["function "+g.j.hc+"(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=U(a,"LIST",g.j.wb)||"[]";a=c+"("+a+")";break;case "RANDOM":c=V("mathRandomList",["function "+g.j.hc+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=U(a,"LIST",g.j.wb)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,g.j.Aa]};g.j.math_modulo=function(a){var c=U(a,"DIVIDEND",g.j.Ul)||"0";a=U(a,"DIVISOR",g.j.Ul)||"0";return[c+" % "+a,g.j.Ul]}; +g.j.math_constrain=function(a){var c=U(a,"VALUE",g.j.Ya)||"0",d=U(a,"LOW",g.j.Ya)||"0";a=U(a,"HIGH",g.j.Ya)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",g.j.Aa]}; +g.j.math_random_int=function(a){var c=U(a,"FROM",g.j.Ya)||"0";a=U(a,"TO",g.j.Ya)||"0";return[V("mathRandomInt",["function "+g.j.hc+"(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+")",g.j.Aa]};g.j.math_random_float=function(){return["Math.random()",g.j.Aa]}; +g.j.math_atan2=function(a){var c=U(a,"X",g.j.Ya)||"0";return["Math.atan2("+(U(a,"Y",g.j.Ya)||"0")+", "+c+") / Math.PI * 180",g.j.Tl]};g.j.UG={};g.j.procedures_defreturn=function(a){var c=rd(z(a,"NAME"),g.Ka.Eb),d="";g.j.Id&&(d+=T(g.j.Id,a));g.j.Wc&&(d+=T(g.j.Wc,a));d&&(d=ne(d,g.j.ud));var e="";g.j.Io&&(e=ne(T(g.j.Io,a),g.j.ud));var f=oe(a,"STACK"),h=U(a,"RETURN",g.j.wb)||"",k="";f&&h&&(k=d);h&&(h=g.j.ud+"return "+h+";\n");for(var l=[],m=0;m":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function Ke(a){return Le[a]}var Je=/[\x00\x22\x26\x27\x3c\x3e]/g;function Me(){return'
'};function Ne(){for(var a='
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
XYin\u00edcio xin\u00edcio yfim Xfim YraiolarguraalturaDesenha um circulo numa localidade espec\u00edfica e \\ncom o raio especificado. circuloDesenhar um ret\u00e2ngulo numa localidade espec\u00edfica \\ncom uma largura e uma altura especifica. retanguloDesenha uma linha de um ponto ao outro com um \\ncomprimento especifico. linhaRetornar o tempo atual na anima\u00e7\u00e3o (0-100).Trocar a cor da caneta.mudar a cor paraSeu filme n\u00e3o se move. Use blocos para fazer algo interessante. Depois voc\u00ea pode enviar seu filme para a galeria.

'+ +((xd?'':'')+"Jogos do Blockly : "+W({appName:"Filme"}.appName)+""),c="   ",d=1;11>d;d++)c+=" "+(d==O?''+W(d)+"":10==d?''+W(d)+"":'');return a+c+'

  
'+ +(10!=O||xd?"":'
Enviar o seu filme para a galeria.
T\u00edtulo:
\x3c!--Legal disclaimer goes here if needed.--\x3e
')+ +('
Parab\u00e9ns!
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.
')+ +(Me()+"
")+(9==O?'
Mova o c\u00edrculo de fundo para o topo do seu programa. Ent\u00e3o aparecer\u00e1 atr\u00e1s da pessoa.
'+Me()+"
":"")+'
'+(1==O?"Use formas simples para desenhar essa pessoa.":2==O?"Este n\u00edvel \u00e9 um filme. Voc\u00ea quer que o bra\u00e7o da pessoa se mova pela tela. Pressione o bot\u00e3o play para ver uma pr\u00e9via.
Enquanto o filme passa, o valor do bloco 'time' conta de 0 a 100. Como queira a posi\u00e7\u00e3o 'y' do bra\u00e7o iniciar no 0 e que v\u00e1 at\u00e9 100 isto deve ser f\u00e1cil.": +3==O?"O bloco 'tempo' conta de 0 a 100. Mas agora voc\u00ea quer que a posi\u00e7\u00e3o 'y' do outro bra\u00e7o comece em 100 e v\u00e1 para 0. Voc\u00ea consegue descobrir uma f\u00f3rmula matem\u00e1tica simples que inverta a dire\u00e7\u00e3o?":4==O?"Use o que voc\u00ea aprendeu no n\u00edvel anterior para fazer pernas cruzadas.":5==O?'A f\u00f3rmula matem\u00e1tica para o bra\u00e7o \u00e9 complicada. Aqui est\u00e1 a resposta:

y = ((time - 50) ÷ 5) ^ 2‎2 ^ (5 ÷ (50 - time)) = y‎': +6==O?"D\u00ea a pessoa algumas m\u00e3os.":7==O?"Use o bloco 'se' para desenhar uma pequena cabe\u00e7a na primeira metade do filme. Em seguida, desenhe uma grande cabe\u00e7a para a segunda metade do filme.":8==O?"Fa\u00e7a as pernas inverterem a dire\u00e7\u00e3o a meio do filme.":9==O?"Desenhe um c\u00edrculo em expans\u00e3o atr\u00e1s da pessoa.":10==O?"Desenhe o que voc\u00ea quiser. Voc\u00ea conseguiu um grande numero de blocos novos para explorar. Divirta-se!"+(xd?"":'

Use o bot\u00e3o "Ver Galeria" para ver o que as outras pessoas desenharam. Se voc\u00ea desenhar algo interessante,use o bot\u00e3o "Enviar para a Galeria" para publicar.'): +"")+"
"+Me()+"
"};function Oe(a){var c=Pe;this.$e=42;this.Ql=328;this.Kl=11.5;this.Mf=12;this.$a=0;this.ex=c;this.ks=[];this.Yz=[];c=g.g.o.Yl;var d=document.createElementNS(c,"text");d.setAttribute("style","font-size: 10pt");d.setAttribute("x",this.Ql+9);d.setAttribute("y",16);yd()&&d.setAttribute("text-anchor","end");a.appendChild(d);this.Ed=d;d="#ff3333 #f72f2f #ef2a2a #e72727 #df2222 #d71f1f #cf1a1a".split(" ");for(var e=0;ef;f++)a.ks.push(setTimeout(d(f),200*f/10))} +b.setValue=function(a){this.$a=g.g.Rd.zk(a,0,1);a=this.$e+(this.Ql-this.$e)*this.$a;this.UF.setAttribute("x",a-8);this.kz.setAttribute("x",a-42-8);this.Ut.setAttribute("x",a-this.Mf);for(var c=0,d;d=this.Yz[c];c++)d.setAttribute("width",a-this.$e);for(;this.Ed.firstChild;)this.Ed.removeChild(this.Ed.firstChild);a=Math.round(100*this.$a);c=document.createTextNode("time = "+a);this.Ed.appendChild(c);this.ex&&this.ex(a)}; +function Xe(a,c){var d=a.bb.createSVGPoint();d.x=c.clientX;d.y=c.clientY;a=a.bb.getScreenCTM().inverse();return d.matrixTransform(a)}function Qe(a,c,d,e){a.addEventListener(c,function(f){e.apply(d,arguments)},!1)}function We(a){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY};var Gd="movie",ae=1==O?0:100,be=Array(ae),af=!1,bf=0;function cf(){document.getElementById("coordinates").style.display="block"}function df(){document.getElementById("coordinates").style.display="none"} +function ef(a){var c=yd(),d=a.clientX;a=a.clientY;c&&(d-=window.innerWidth);var e=document.getElementById("visualization");e=g.g.style.Mm(e);e=g.g.V.Ek(e,g.g.style.Ft());d+=c?e.x:-e.x;a-=e.y;d/=4;a=100-a/4;c&&(d+=100);10==O?(d=Math.round(d),a=Math.round(a)):(d=10*Math.round(d/10),a=10*Math.round(a/10));0<=d&&100>=d&&0<=a&&100>=a?(document.getElementById("x").textContent="x = "+d,document.getElementById("y").textContent="y = "+a):df()} +function ff(){var a=document.getElementById("help"),c=document.getElementById("helpButton");2==O&&R.LF("sampleHelp2",'');Q.ml(a,c,!0,!0,{width:"50%",left:"25%",top:"5em"},gf);Q.kv()}function gf(){Q.ov()} +function hf(a){var c=document.getElementById("visualization");S.strokeStyle="#000";S.fillStyle="#000";var d=document.createElement("canvas");d.id="answer"+a;d.width=400;d.height=400;d.style.display="none";c.appendChild(d);S.canvas.width=S.canvas.width;switch(O){case 1:X("#ff0000");Y(50,70,10);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,70,5);Z(60,50,80,70,5);break;case 2:X("#ff0000");Y(50,70,10);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,70,5);Z(60,50,80,a,5);break;case 3:X("#ff0000"); +Y(50,70,10);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,100-a,5);Z(60,50,80,a,5);break;case 4:X("#ff0000");Y(50,70,10);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,100-a,5);Z(60,50,80,a,5);Z(40,20,a,0,5);Z(60,20,100-a,0,5);break;case 5:X("#ff0000");Y(50,70,10);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,100-a,5);Z(60,50,80,Math.pow((a-50)/5,2),5);Z(40,20,a,0,5);Z(60,20,100-a,0,5);break;case 6:X("#ff0000");Y(50,70,10);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,100- +a,5);Z(60,50,80,Math.pow((a-50)/5,2),5);Z(40,20,a,0,5);Z(60,20,100-a,0,5);X("#ff0000");Y(20,100-a,5);Y(80,Math.pow((a-50)/5,2),5);break;case 7:X("#ff0000");50>a?Y(50,70,10):Y(50,80,20);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,100-a,5);Z(60,50,80,Math.pow((a-50)/5,2),5);Z(40,20,a,0,5);Z(60,20,100-a,0,5);X("#ff0000");Y(20,100-a,5);Y(80,Math.pow((a-50)/5,2),5);break;case 8:X("#ff0000");50>a?Y(50,70,10):Y(50,80,20);X("#3333ff");jf(50,40,20,40);X("#000000");Z(40,50,20,100-a,5);Z(60,50,80,Math.pow((a- +50)/5,2),5);50>a?(Z(40,20,a,0,5),Z(60,20,100-a,0,5)):(Z(40,20,100-a,0,5),Z(60,20,a,0,5));X("#ff0000");Y(20,100-a,5);Y(80,Math.pow((a-50)/5,2),5);break;case 9:X("#00ff00"),Y(50,a/2,a/2),X("#ff0000"),50>a?Y(50,70,10):Y(50,80,20),X("#3333ff"),jf(50,40,20,40),X("#000000"),Z(40,50,20,100-a,5),Z(60,50,80,Math.pow((a-50)/5,2),5),50>a?(Z(40,20,a,0,5),Z(60,20,100-a,0,5)):(Z(40,20,100-a,0,5),Z(60,20,a,0,5)),X("#ff0000"),Y(20,100-a,5),Y(80,Math.pow((a-50)/5,2),5)}a=d.getContext("2d");a.globalCompositeOperation= +"copy";a.drawImage(S.canvas,0,0)}function kf(){var a=document.getElementById("hatching").getContext("2d");a.strokeStyle="#fff";a.lineWidth=1;for(var c=-400;400>c;c+=4)a.beginPath(),a.moveTo(c,-c),a.lineTo(c+400,-c+400),a.stroke()} +function lf(){var a=document.getElementById("axies").getContext("2d");a.lineWidth=1;a.strokeStyle="#bba";a.fillStyle="#bba";a.font="normal 14px sans-serif";for(var c=1,d=.1;.9>d;d+=.1)a.beginPath(),a.moveTo(400*d,400),a.lineTo(400*d,400-9*c),a.stroke(),a.beginPath(),a.moveTo(0,400*d),a.lineTo(9*c,400*d),a.stroke(),2==c&&(a.fillText(Math.round(100*d),400*d+2,396),a.fillText(Math.round(100-100*d),3,400*d-2)),c=1==c?2:1} +function mf(a){S.canvas.width=S.canvas.width;S.strokeStyle="#000";S.fillStyle="#000";S.globalAlpha=10==O?1:.9;for(var c=!0,d=0;c&&1E4>d;d++)try{c=a.step()}catch(e){alert(e),c=!1}} +function Pe(a){if("Interpreter"in window){"number"==typeof a&&(bf=a);var c=bf;Zd.beginPath();Zd.rect(0,0,Zd.canvas.width,Zd.canvas.height);Zd.fillStyle="#ffffff";Zd.fill();if(c=document.getElementById("answer"+c))Zd.globalAlpha=.2,Zd.drawImage(c,0,0),Zd.globalAlpha=1;c=document.getElementById("hatching");Zd.drawImage(c,0,0);c=Yd();try{var d=new Interpreter(c,nf)}catch(e){console.error(e)}d?mf(d):S.canvas.width=S.canvas.width;Zd.drawImage(S.canvas,0,0);Zd.drawImage(document.getElementById("axies"), +0,0);of();1==O&&setTimeout(Ze,1E3)}else setTimeout(function(){Pe(a)},250)}function nf(a,c){var d=function(e,f,h){Y(e,f,h)};a.setProperty(c,"circle",a.createNativeFunction(d));d=function(e,f,h,k){jf(e,f,h,k)};a.setProperty(c,"rect",a.createNativeFunction(d));d=function(e,f,h,k,l){Z(e,f,h,k,l)};a.setProperty(c,"line",a.createNativeFunction(d));d=function(e){X(e)};a.setProperty(c,"penColour",a.createNativeFunction(d));a.setProperty(c,"time",a.createNativeFunction(function(){return bf}))} +function Y(a,c,d){a*=4;c=4*(100-c);d=Math.max(4*d,0);S.beginPath();S.arc(a,c,d,0,2*Math.PI,!1);S.fill()}function jf(a,c,d,e){a*=4;c=4*(100-c);d=Math.max(4*d,0);e=Math.max(4*e,0);S.beginPath();S.rect(a-d/2,c-e/2,d,e);S.fill()}function Z(a,c,d,e,f){a*=4;c=4*(100-c);d*=4;e=4*(100-e);f*=4;S.beginPath();S.moveTo(a,c);S.lineTo(d,e);S.lineWidth=Math.max(f,0);S.stroke()}function X(a){S.strokeStyle=a;S.fillStyle=a} +function of(){var a=document.getElementById("answer"+bf);if(a){a=a.getContext("2d").getImageData(0,0,400,400);for(var c=S.getImageData(0,0,400,400),d=Math.min(c.data.length,a.data.length),e=0,f=3;fO&&(G.Rf.play("win",.5),Q.cE()))} +function pf(){var a=y(G).length,c=Yd();if(4>a||-1==c.indexOf("time()"))alert(P("Movie_submitDisabled"));else{a=new Interpreter(c,nf);c=bf;try{bf=Math.round(ae/2),mf(a)}finally{bf=c}a=document.getElementById("thumbnail");c=a.getContext("2d");c.globalCompositeOperation="copy";c.drawImage(S.canvas,0,0,200,200);a=a.toDataURL("image/png");document.getElementById("galleryThumb").value=a;Q.iv()}} +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=Ne();R.Z();var c=yd(),d=document.getElementById("blockly"),e=document.getElementById("visualization");window.addEventListener("scroll",function(){a(null);g.rl(G)});window.addEventListener("resize",a);a(null);10>O&&(g.Ib.so=3,g.Ib.qo="#ff0000 #ffcc33 #ffff00 #009900 #3333ff #cc33cc #ffffff #999999 #000000".split(" ")); +var f=document.getElementById("toolbox");G=g.Rh("blockly",{media:"third-party/blockly/media/",rtl:c,toolbox:f,trashcan:!0,zoom:10==O?{controls:!0,wheel:!0}:null});qe("circle,rect,line,penColour,time");document.getElementById("submitButton")&&Hd("submitButton",pf);R.WF("",!0);Zd=document.getElementById("display").getContext("2d");Zd.globalCompositeOperation="source-over";S=document.getElementById("scratch").getContext("2d");kf();hf(0);setTimeout(function(){for(var h=1;h<=ae;h++)hf(h)},1); +lf();Pe();Ba(G,Pe);f=document.getElementById("scrubber");new Oe(f);1==O&&(f.style.display="none");G.Rf.load(["movie/win.mp3","movie/win.ogg"],"win");setTimeout(R.HF,1);setTimeout(R.IF,1);Hd("helpButton",ff);2>location.hash.length&&!Ed(O)&&setTimeout(ff,1E3);e.addEventListener("mouseover",cf);e.addEventListener("mouseout",df);e.addEventListener("mousemove",ef)}); diff --git a/html/blockly-games/movie/icons.png b/html/blockly-games/movie/icons.png new file mode 100644 index 0000000..2f85fbb Binary files /dev/null and b/html/blockly-games/movie/icons.png differ diff --git a/html/blockly-games/movie/style.css b/html/blockly-games/movie/style.css new file mode 100644 index 0000000..7b02828 --- /dev/null +++ b/html/blockly-games/movie/style.css @@ -0,0 +1,94 @@ +button.primary { + /* Can't use "text-align: start" due to IE. */ + text-align: left; +} +html[dir="RTL"] button.primary { + text-align: right; +} + +#blockly { + position: fixed; + bottom: 10px; +} +#display { + border: 1px solid #ccc; +} +#downloadImageLink { + display: none; +} +#sampleHelp2 { + height: 50px; + width: 250px; +} + +code { + font-size: 150%; margin: 0 1em; +} + +html code.rtl { + display: none; +} +html code.ltr { + display: inline; +} +html[dir="RTL"] code.rtl { + display: inline; +} +html[dir="RTL"] code.ltr { + display: none; +} + +#coordinates { + display: none; + font-size: 10pt; + margin-top: 5px; + position: absolute; + width: 400px; + user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none; +} +#x { + position: absolute; + left: 300px; +} +#y { + position: absolute; + left: 350px; +} + +/* Slider. */ +.sliderTrack { + stroke: #aaa; + stroke-width: 6px; + stroke-linecap: round; +} +.sliderKnob { + fill: #ddd; + stroke: #bbc; + stroke-width: 1px; + stroke-linejoin: round; +} +.sliderKnob:hover { + fill: #eee; +} + +/* Sprited icons. */ +.icon21 { + height: 21px; + width: 21px; + background-image: url(icons.png); +} +.camera { + background-position: -21px 0px; +} +.stop { + background-position: -42px 0px; +} +.run { + background-position: -63px 0px; +} +.gallery { + background-position: -42px -21px; +} diff --git a/html/blockly-games/movie/win.mp3 b/html/blockly-games/movie/win.mp3 new file mode 100644 index 0000000..8773bd6 Binary files /dev/null and b/html/blockly-games/movie/win.mp3 differ diff --git a/html/blockly-games/movie/win.ogg b/html/blockly-games/movie/win.ogg new file mode 100644 index 0000000..1394028 Binary files /dev/null and b/html/blockly-games/movie/win.ogg differ diff --git a/html/blockly-games/movie/youtube-bg.png b/html/blockly-games/movie/youtube-bg.png new file mode 100644 index 0000000..17b08da Binary files /dev/null and b/html/blockly-games/movie/youtube-bg.png differ diff --git a/html/blockly-games/music.html b/html/blockly-games/music.html new file mode 100644 index 0000000..af3544e --- /dev/null +++ b/html/blockly-games/music.html @@ -0,0 +1,15 @@ + + + + + + + Blockly Games : Music + + + + + + + + diff --git a/html/blockly-games/music/black1x1.gif b/html/blockly-games/music/black1x1.gif new file mode 100644 index 0000000..726f4be Binary files /dev/null and b/html/blockly-games/music/black1x1.gif differ diff --git a/html/blockly-games/music/generated/pt-br/compressed.js b/html/blockly-games/music/generated/pt-br/compressed.js new file mode 100644 index 0000000..9eaff6e --- /dev/null +++ b/html/blockly-games/music/generated/pt-br/compressed.js @@ -0,0 +1,854 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,g={g:{}};g.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}(); +g.h={};g.g.global.Blockly||(g.g.global.Blockly={});g.g.global.Blockly.Msg||(g.g.global.Blockly.Msg=g.h);g.g.S=function(a,c){this.x=a;this.y=c};g.g.S.ve=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};g.g.S.Bx=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};g.g.S.yF=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};g.g.S.hm=function(a,c){return new g.g.S(a.x-c.x,a.y-c.y)};g.g.S.sum=function(a,c){return new g.g.S(a.x+c.x,a.y+c.y)};g.g.S.prototype.scale=function(a){this.x*=a;this.y*=a;return this};g.g.S.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};g.g.ab={};g.g.ab.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};g.g.ab.Lu=function(a){return a.length?a.reduce(function(c,d){return c.lengthc&&(c=d[e].length);e=-Infinity;var f=1;do{var h=e;var k=a;a=[];var l=d.length/f,m=1;for(e=0;eh);return k}; +g.g.ab.cv=function(a,c,d){for(var e=[0],f=[],h=0;he&&(e=l,f=k)}return f?g.g.ab.tA(a,f,d):c};g.g.ab.jH=function(a,c){for(var d=[],e=0;e=l?(f=2,h=l,(l=a.join(""))&&d.push(l),a.length=0):"{"==l?f=3:(a.push("%",l),f=0):2==f?"0"<=l&&"9">=l?h+=l:(d.push(parseInt(h,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=g.g.ab.startsWith(l,"BKY_")? +l.substring(4):null)&&l in g.h?(f=g.h[l],"string"==typeof f?Array.prototype.push.apply(d,g.g.Wu(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;kd;d++)c[d]=g.g.Eg.bA.charAt(Math.random()*a);return c.join("")}; +g.g.Eg.bA="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +g.g.$i=function(){if(void 0!==g.g.$i.Zr)return g.g.$i.Zr;if(!g.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=g.g.global.getComputedStyle(a);if(!c)return document.body.removeChild(a),!1;c=c.getPropertyValue(d[e])}document.body.removeChild(a); +g.g.$i.Zr="none"!==c;return g.g.$i.Zr};g.g.Tz=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)};g.g.KE=function(){var a=g.g.style.uy();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +g.g.Co=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};g.g.DE=function(){var a=document.documentElement,c=window;return g.g.userAgent.lg&&c.pageYOffset!=a.scrollTop?new g.g.S(a.scrollLeft,a.scrollTop):new g.g.S(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};g.g.Ss=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=t(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}; +g.g.AG=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new g.g.S(d-e.left,c-e.top);c=g.g.tm(a.bb);return g.g.S.hm(d,c).scale(1/a.scale)}; +g.Touch={};g.Touch.rw="ontouchstart"in g.g.global||!!(g.g.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!g.g.global.navigator||!g.g.global.navigator.maxTouchPoints&&!g.g.global.navigator.msMaxTouchPoints);g.Touch.An=null;g.Touch.yf={}; +g.g.global.PointerEvent?g.Touch.yf={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:g.Touch.rw&&(g.Touch.yf={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});g.Dp=0; +g.wF=function(a,c){g.Kh();a.changedTouches&&1!=a.changedTouches.length||(g.Dp=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&ba(c,a)},g.TB))};g.Kh=function(){g.Dp&&(clearTimeout(g.Dp),g.Dp=0)};g.Touch.nh=function(){g.Touch.An=null};g.Touch.Mu=function(a){return!g.Touch.oF(a)||g.Touch.sD(a)}; +g.Touch.lp=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"};g.Touch.sD=function(a){var c=g.Touch.lp(a);return void 0!==g.Touch.An&&null!==g.Touch.An?g.Touch.An==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(g.Touch.An=c,!0):!1}; +g.Touch.CG=function(a){if(g.g.ab.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};g.Touch.oF=function(a){return g.g.ab.startsWith(a.type,"touch")||g.g.ab.startsWith(a.type,"mouse")||g.g.ab.startsWith(a.type,"pointer")};g.Touch.Cp=function(a){return g.g.ab.startsWith(a.type,"touch")||g.g.ab.startsWith(a.type,"pointer")}; +g.Touch.JG=function(a){var c=[];if(a.changedTouches)for(var d=0;d=d+this.Ah&&(e+=f);ca(this,ma(this,e));ka(this);a.stopPropagation();a.preventDefault()}}; +b.cG=function(a){oa(this.s);da();g.g.fj(a)?a.stopPropagation():(this.KG=this.xm,qa(this.s),this.dA=this.Vi?a.clientX:a.clientY,g.Ja.Fe=g.ka(document,"mouseup",this,this.iG),g.Ja.Ph=g.ka(document,"mousemove",this,this.eG),a.stopPropagation(),a.preventDefault())};b.eG=function(a){ca(this,ma(this,this.KG+((this.Vi?a.clientX:a.clientY)-this.dA)));ka(this)};b.iG=function(){ra(this.s);g.Touch.nh();da()};function da(){g.mc(!0);g.Ja.Fe&&(g.Xa(g.Ja.Fe),g.Ja.Fe=null);g.Ja.Ph&&(g.Xa(g.Ja.Ph),g.Ja.Ph=null)} +function ma(a,c){return c=0>=c||isNaN(c)||a.Iee.Tv&&0<=e.Tv;)e.Hj.shift();for(var h=0;d=e.sd[h];h++)d(f)}}}; +g.i.filter=function(a,c){a=a.slice();c||a.reverse();for(var d=[],e=Object.create(null),f=0,h;h=a[f];f++)if(!h.Lk()){var k=[h.type,h.zc,h.uc].join(" "),l=e[k],m=l?l.event:null;if(!l)e[k]={event:h,index:f},d.push(h);else if(h.type==g.i.zl&&l.index==f-1)m.nj=h.nj,m.mj=h.mj,m.Mh=h.Mh,l.index=f;else if(h.type==g.i.ei&&h.element==m.element&&h.name==m.name)m.newValue=h.newValue;else if(h.type!=g.i.xo||"click"!=h.element||"commentOpen"!=m.element&&"mutatorOpen"!=m.element&&"warningOpen"!=m.element)e[k]={event:h, +index:1},d.push(h)}a=d.filter(function(n){return!n.Lk()});c||a.reverse();for(f=1;h=a[f];f++)h.type==g.i.ei&&"mutation"==h.element&&a.unshift(a.splice(f,1)[0]);return a};g.i.vD=function(){for(var a=0,c;c=g.i.ql[a];a++)c.Jc=!1};g.i.disable=function(){g.i.vs++};g.i.enable=function(){g.i.vs--};g.i.isEnabled=function(){return 0==g.i.vs};g.i.Ub=function(){return g.i.yy};g.i.Z=function(a){g.i.yy="boolean"==typeof a?a?g.g.Eg():"":a}; +g.i.Zx=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c}; +g.i.sa=function(a){switch(a.type){case g.i.Wn:var c=new g.i.ie(null);break;case g.i.ol:c=new g.i.Oe(null);break;case g.i.ei:c=new g.i.$g(null,"","","","");break;case g.i.zl:c=new g.i.ni(null);break;case g.i.tw:c=new g.i.re(null);break;case g.i.uw:c=new g.i.Te(null);break;case g.i.vw:c=new g.i.zf(null,"");break;case g.i.xo:c=new g.i.od(null,"","","");break;case g.i.Tn:c=new g.i.gg(null);break;case g.i.vv:c=new g.i.Rj(null,"","");break;case g.i.Un:c=new g.i.gi(null);break;case g.i.wv:c=new g.i.hg(null); +break;default:throw Error("Unknown event type.");}c.sa(a);c.uc=(void 0).id;return c};g.i.xx=function(a){if((a.type==g.i.zl||a.type==g.i.Wn)&&a.uc){var c=g.Fb.Us(a.uc);if(a=x(c,a.zc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.Kc(!0);else if((a.L||a.Y)&&!c.dc()){do a.Kc(!1),a=t(a);while(a)}}}}; +g.GC=function(){var a=g.yi.Qj.lD;this.gD=g.yi.Qj.PD;this.mD=a;this.zD=Object.create(null)};function sa(a,c){return(c=a.zD[c])&&"string"==typeof propertyValue&&sa(a,c)?sa(a,c):c?String(c):null};g.Jl=function(a){this.hq=a;this.fq=[];this.ph=Object.create(null)};g.Jl.prototype.kp=function(){return this.hq};g.Jl.prototype.subscribe=function(a,c,d){this.ph[c]||(this.ph[c]=[]);this.ph[c].push({element:a,propertyName:d});a.style[d]=this.hq&&sa(this.hq,c)||""};g.Jl.prototype.unsubscribe=function(a){if(a)for(var c=Object.keys(this.ph),d=0,e;e=c[d];d++){for(var f=this.ph[e],h=f.length-1;0<=h;h--)f[h].element===a&&f.splice(h,1);this.ph[e].length||delete this.ph[e]}}; +g.Jl.prototype.I=function(){this.ph=this.fq=this.hq=this.dd=null};g.yi={};g.yi.Qj={};g.yi.Qj.PD={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"}}; +g.yi.Qj.lD={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"}};g.yi.Qj=new g.GC;g.i.Abstract=function(){this.uc=void 0;this.group=g.i.Ub();this.Jc=g.i.Jc};g.i.Abstract.prototype.Wa=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};g.i.Abstract.prototype.sa=function(a){this.group=a.group};g.i.Abstract.prototype.Lk=function(){return!1};g.i.Abstract.prototype.run=function(){};function ta(a){if(a.uc)var c=g.Fb.Us(a.uc);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};g.i.rg=function(a){g.i.rg.w.constructor.call(this);this.ai=a.ua();this.uc=a.v.id};g.g.object.T(g.i.rg,g.i.Abstract);g.i.rg.prototype.Wa=function(){var a=g.i.rg.w.Wa.call(this);a.varId=this.ai;return a};g.i.rg.prototype.sa=function(a){g.i.rg.w.Wa.call(this);this.ai=a.varId};g.i.re=function(a){a&&(g.i.re.w.constructor.call(this,a),this.Kj=a.type,this.Jj=a.name)};g.g.object.T(g.i.re,g.i.rg);g.i.re.prototype.type=g.i.tw; +g.i.re.prototype.Wa=function(){var a=g.i.re.w.Wa.call(this);a.varType=this.Kj;a.varName=this.Jj;return a};g.i.re.prototype.sa=function(a){g.i.re.w.sa.call(this,a);this.Kj=a.varType;this.Jj=a.varName};g.i.re.prototype.run=function(a){var c=ta(this);a?c.Cd(this.Jj,this.Kj,this.ai):c.Hf(this.ai)};g.i.Te=function(a){a&&(g.i.Te.w.constructor.call(this,a),this.Kj=a.type,this.Jj=a.name)};g.g.object.T(g.i.Te,g.i.rg);g.i.Te.prototype.type=g.i.uw; +g.i.Te.prototype.Wa=function(){var a=g.i.Te.w.Wa.call(this);a.varType=this.Kj;a.varName=this.Jj;return a};g.i.Te.prototype.sa=function(a){g.i.Te.w.sa.call(this,a);this.Kj=a.varType;this.Jj=a.varName};g.i.Te.prototype.run=function(a){var c=ta(this);a?c.Hf(this.ai):c.Cd(this.Jj,this.Kj,this.ai)};g.i.zf=function(a,c){a&&(g.i.zf.w.constructor.call(this,a),this.Zt=a.name,this.Tt=c)};g.g.object.T(g.i.zf,g.i.rg);g.i.zf.prototype.type=g.i.vw; +g.i.zf.prototype.Wa=function(){var a=g.i.zf.w.Wa.call(this);a.oldName=this.Zt;a.newName=this.Tt;return a};g.i.zf.prototype.sa=function(a){g.i.zf.w.sa.call(this,a);this.Zt=a.oldName;this.Tt=a.newName};g.i.zf.prototype.run=function(a){var c=ta(this);a?c.Uh(this.ai,this.Tt):c.Uh(this.ai,this.Zt)}; +g.Cr=function(a){this.Pa=Object.create(null);this.v=a};b=g.Cr.prototype;b.clear=function(){this.Pa=Object.create(null)};b.Tp=function(a,c){var d=this.Tc(c,a.type),e=y(this.v,!1);g.i.Z(!0);try{if(d&&d.ua()!=a.ua()){var f=a.type;c!=d.name&&ua(d,c,e);for(c=0;cc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.fq.splice(c,1);this.Rb.unsubscribe(this.Mc);this.options.Kb||(this.Rb.I(),this.Rb=null)}};g.Fb.jw=3;b=g.Fb.prototype; +b.Yf=function(a,c){a=a.Oa();c=c.Oa();return a.y+g.Fb.prototype.Yf.offset*a.x-(c.y+g.Fb.prototype.Yf.offset*c.x)};function va(a,c){if(!g.g.Co(a.cl,c))throw Error("Block not present in workspace's list of top-most blocks.");}function A(a,c){var d=[].concat(a.cl);c&&1h)return!1;d+=c[e]}return d>xa(a)?!1:!0} +function za(a){return Infinity!=a.options.Mt||!!a.options.Nt}b.$u=function(a){var c=a?this.dn:this.Hj,d=a?this.Hj:this.dn,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=g.i.filter(f,a);g.i.Jc=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{g.i.Jc=!0}}};function Aa(a,c){a.sd.push(c)}function Ba(a,c){g.g.Co(a.sd,c)}function x(a,c){return a.Rr[c]||null}g.Fb.Ll=Object.create(null);g.Fb.Us=function(a){return g.Fb.Ll[a]||null}; +g.Fb.getAll=function(){var a=[],c;for(c in g.Fb.Ll)a.push(g.Fb.Ll[c]);return a};g.na=function(a,c,d,e,f,h){this.s=a;this.Ze=c;this.$z=d;d=g.na.FA;this.s.G&&(d=-d);this.aD=g.g.td.Uu(d);a.pf.appendChild(this.$l(c,!(!f||!h)));this.Tb=e;this.Up&&Ca(this);f&&h||(c=this.Ze.getBBox(),f=c.width+2*g.na.Zc,h=c.height+2*g.na.Zc);this.kn(f,h);Ca(this);Da(this);this.Up=!0;a.options.readOnly||(g.ka(this.Ql,"mousedown",this,this.hD),this.Uf&&g.ka(this.Uf,"mousedown",this,this.vG))};g.na.Zc=6;g.na.GA=5;g.na.FA=20;g.na.kv=4;g.na.DA=8;g.na.Fe=null;g.na.Ph=null;g.na.prototype.wu=null; +g.na.Zu=function(){g.na.Fe&&(g.Xa(g.na.Fe),g.na.Fe=null);g.na.Ph&&(g.Xa(g.na.Ph),g.na.Ph=null)};g.na.iD=function(){g.Touch.nh();g.na.Zu()};b=g.na.prototype;b.Up=!1;b.Tb=null;b.Qg=0;b.Th=0;b.ob=0;b.Uc=0;b.Or=!0; +b.$l=function(a,c){this.Ud=g.g.o.K("g",{},null);var d={filter:"url(#"+this.s.options.Ix+")"};g.g.userAgent.JB&&(d={});d=g.g.o.K("g",d,this.Ud);this.Vr=g.g.o.K("path",{},d);this.Ql=g.g.o.K("rect",{"class":"blocklyDraggable",x:0,y:0,rx:g.na.Zc,ry:g.na.Zc},d);c?(this.Uf=g.g.o.K("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.Ud),c=2*g.na.Zc,g.g.o.K("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.Uf),g.g.o.K("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.Uf),g.g.o.K("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.Uf)):this.Uf=null;this.Ud.appendChild(a);return this.Ud};b.wa=function(){return this.Ud};function Fa(a,c){a.Ud.dataset&&(a.Ud.dataset.blockId=c)}b.hD=function(a){var c=this.s.Gg(a);if(c){if(c.Ti)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.ae||(c.ae=this);c.kf=a}};b.pn=function(){};b.Zd=function(){return!1}; +b.vG=function(a){Ga(this);g.na.Zu();g.g.fj(a)||(this.s.Qu(a,new g.g.S(this.s.G?-this.ob:this.ob,this.Uc)),g.na.Fe=g.ka(document,"mouseup",this,g.na.iD),g.na.Ph=g.ka(document,"mousemove",this,this.wG),g.mc());a.stopPropagation()};b.wG=function(a){this.Or=!1;var c=this.s;a=g.g.Um(a,v(c),pa(c));a.x/=c.scale;a.y/=c.scale;c=g.g.S.sum(c.Fx,a);this.kn(this.s.G?-c.x:c.x,c.y);this.s.G&&Ca(this)};function Ga(a){var c=a.Ud.parentNode;return c.lastChild!==a.Ud?(c.appendChild(a.Ud),!0):!1} +function Ha(a,c,d){var e=a.s.G?a.Tb.x-c.x-a.ob:c.x+a.Tb.x;c=c.y+a.Tb.y;return Math.max(0,Math.min(1,(Math.min(e+a.ob,d.Zb+d.lb)-Math.max(e,d.Zb))*(Math.min(c+a.Uc,d.hc+d.rb)-Math.max(c,d.hc))/(a.ob*a.Uc)))}function Ca(a){var c=a.Tb.x;c=a.s.G?c-(a.Qg+a.ob):c+a.Qg;a.moveTo(c,a.Th+a.Tb.y)}b.moveTo=function(a,c){this.Ud.setAttribute("transform","translate("+a+","+c+")")};b.Ts=function(){return new g.g.qe(this.ob,this.Uc)}; +b.kn=function(a,c){var d=2*g.na.Zc;a=Math.max(a,d+45);c=Math.max(c,d+20);this.ob=a;this.Uc=c;this.Ql.setAttribute("width",a);this.Ql.setAttribute("height",c);this.Uf&&(this.s.G?this.Uf.setAttribute("transform","translate("+2*g.na.Zc+","+(c-d)+") scale(-1 1)"):this.Uf.setAttribute("transform","translate("+(a-d)+","+(c-d)+")"));if(this.Or){a=this.s.bc();a.Zb/=this.s.scale;a.lb/=this.s.scale;a.hc/=this.s.scale;a.rb/=this.s.scale;c=-this.ob/4;if(!(this.ob>a.lb)){if(this.s.G){d=this.Tb.x-c;var e=d-this.ob; +var f=a.Zb+a.lb,h=a.Zb+g.Ja.oc/this.s.scale}else e=c+this.Tb.x,d=e+this.ob,h=a.Zb,f=a.Zb+a.lb-g.Ja.oc/this.s.scale;this.s.G?ef&&(c=-(f-this.Tb.x)):ef&&(c=f-this.Tb.x-this.ob)}e=c;c=-this.Uc/4;if(!(this.Uc>a.rb)){d=this.Tb.y+c;f=d+this.Uc;h=a.hc;var k=a.hc+a.rb-g.Ja.oc/this.s.scale,l=this.Tb.y;dk&&(c=k-l-this.Uc)}h=c;f=this.$z.getBBox();c={x:e,y:-this.Uc-g.va.Vq};d={x:-this.ob-30,y:h};h={x:f.width,y:h};k={x:e,y:f.height};e=f.widthh&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),q=Math.cos(m),r=a.Ts();m=(r.width+r.height)/g.na.GA;m=Math.min(m,r.width,r.height)/4;r=1-g.na.DA/k;f=d+r*f;h=e+r*h;r=d+m*q;var u=e+m*n;d-=m*q;e-=m*n;n=l+a.aD;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/g.na.kv;k=Math.cos(n)*k/g.na.kv;c.push("M"+r+","+ +u);c.push("C"+(r+k)+","+(u+l)+" "+f+","+h+" "+f+","+h);c.push("C"+f+","+h+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.Vr.setAttribute("d",c.join(" "))}b.mf=function(a){this.Ql.setAttribute("fill",a);this.Vr.setAttribute("fill",a)};b.I=function(){g.na.Zu();g.g.o.removeNode(this.Ud);this.$z=this.Ze=this.s=this.Uf=this.Ql=this.Vr=this.Ud=null};b.Qt=function(a,c){a?a.Gj(c.x,c.y):this.moveTo(c.x,c.y);this.Qg=this.s.G?this.Tb.x-c.x-this.ob:c.x-this.Tb.x;this.Th=c.y-this.Tb.y;Da(this)}; +b.Oa=function(){return new g.g.S(this.Tb.x+this.Qg,this.Tb.y+this.Th)};g.g.xml={};g.g.xml.eC="https://developers.google.com/blockly/xml";g.g.xml.document=function(){return document};g.g.xml.createElement=function(a){return g.g.xml.document().createElementNS(g.g.xml.eC,a)};g.g.xml.createTextNode=function(a){return g.g.xml.document().createTextNode(a)};g.g.xml.QG=function(a){return(new DOMParser).parseFromString(a,"text/xml")};g.g.xml.Dd=function(a){return(new XMLSerializer).serializeToString(a)};g.i.tf=function(a){g.i.tf.w.constructor.call(this);this.zc=a.id;this.uc=a.v.id};g.g.object.T(g.i.tf,g.i.Abstract);g.i.tf.prototype.Wa=function(){var a=g.i.tf.w.Wa.call(this);a.blockId=this.zc;return a};g.i.tf.prototype.sa=function(a){g.i.tf.w.sa.call(this,a);this.zc=a.blockId};g.i.$g=function(a,c,d,e,f){a&&(g.i.$g.w.constructor.call(this,a),this.element=c,this.name=d,this.oldValue=e,this.newValue=f)};g.g.object.T(g.i.$g,g.i.tf);g.i.eg=g.i.$g;b=g.i.$g.prototype;b.type=g.i.ei; +b.Wa=function(){var a=g.i.$g.w.Wa.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};b.sa=function(a){g.i.$g.w.sa.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};b.Lk=function(){return this.oldValue==this.newValue}; +b.run=function(a){var c=x(ta(this),this.zc);if(c)switch(c.Gd&&c.Gd.Qb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=B(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.Wh(a||null);break;case "collapsed":c.Ug(!!a);break;case "disabled":c.Kc(!a);break;case "inline":c.Je(!!a);break;case "mutation":var d="";c.eb&&(d=(d=c.eb())&&g.O.Dd(d));if(c.Ab){var e=g.O.$h(a||"");c.Ab(e)}g.i.Ka(new g.i.$g(c,"mutation",null,d, +a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.zc)};g.i.ie=function(a){a&&(g.i.ie.w.constructor.call(this,a),this.xml=a.v.ca?g.O.Sr(a):g.O.lh(a),this.Lg=g.i.Zx(a))};g.g.object.T(g.i.ie,g.i.tf);g.i.Rn=g.i.ie;g.i.ie.prototype.type=g.i.Wn;g.i.ie.prototype.Wa=function(){var a=g.i.ie.w.Wa.call(this);a.xml=g.O.Dd(this.xml);a.ids=this.Lg;return a}; +g.i.ie.prototype.sa=function(a){g.i.ie.w.sa.call(this,a);this.xml=g.O.$h(a.xml);this.Lg=a.ids};g.i.ie.prototype.run=function(a){var c=ta(this);if(a)a=g.g.xml.createElement("xml"),a.appendChild(this.xml),g.O.uh(a,c);else{a=0;for(var d;d=this.Lg[a];a++){var e=x(c,d);e?e.I(!1):d==this.zc&&console.warn("Can't uncreate non-existent block: "+d)}}}; +g.i.Oe=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");g.i.Oe.w.constructor.call(this,a);this.$t=a.v.ca?g.O.Sr(a):g.O.lh(a);this.Lg=g.i.Zx(a)}};g.g.object.T(g.i.Oe,g.i.tf);g.i.MA=g.i.Oe;g.i.Oe.prototype.type=g.i.ol;g.i.Oe.prototype.Wa=function(){var a=g.i.Oe.w.Wa.call(this);a.ids=this.Lg;return a};g.i.Oe.prototype.sa=function(a){g.i.Oe.w.sa.call(this,a);this.Lg=a.ids}; +g.i.Oe.prototype.run=function(a){var c=ta(this);if(a){a=0;for(var d;d=this.Lg[a];a++){var e=x(c,d);e?e.I(!1):d==this.zc&&console.warn("Can't delete non-existent block: "+d)}}else a=g.g.xml.createElement("xml"),a.appendChild(this.$t),g.O.uh(a,c)};g.i.ni=function(a){a&&(g.i.ni.w.constructor.call(this,a),a=Ia(this),this.oz=a.Bz,this.nz=a.My,this.Xt=a.gx)};g.g.object.T(g.i.ni,g.i.tf);g.i.ll=g.i.ni;b=g.i.ni.prototype;b.type=g.i.zl; +b.Wa=function(){var a=g.i.ni.w.Wa.call(this);this.nj&&(a.newParentId=this.nj);this.mj&&(a.newInputName=this.mj);this.Mh&&(a.newCoordinate=Math.round(this.Mh.x)+","+Math.round(this.Mh.y));return a};b.sa=function(a){g.i.ni.w.sa.call(this,a);this.nj=a.newParentId;this.mj=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.Mh=new g.g.S(Number(a[0]),Number(a[1])))};b.tj=function(){var a=Ia(this);this.nj=a.Bz;this.mj=a.My;this.Mh=a.gx}; +function Ia(a){var c=x(ta(a),a.zc);a={};var d=c.getParent();if(d){a.Bz=d.id;a:{for(var e=0,f;f=d.P[e];e++)if(f.connection&&C(f.connection)==c){c=f;break a}c=null}c&&(a.My=c.name)}else a.gx=c.Oa();return a}b.Lk=function(){return this.oz==this.nj&&this.nz==this.mj&&g.g.S.ve(this.Xt,this.Mh)}; +b.run=function(a){var c=ta(this),d=x(c,this.zc);if(d){var e=a?this.nj:this.oz,f=a?this.mj:this.nz;a=a?this.Mh:this.Xt;var h=null;if(e&&(h=x(c,e),!h)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&D(d);if(a)f=d.Oa(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.L||d.Y;if(f){if(c=E(h,f))var k=c.connection}else d.type==g.Se&&(k=h.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.zc)};g.i.od=function(a,c,d,e){g.i.od.w.constructor.call(this);this.zc=a?a.id:null;this.uc=a?a.v.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Jc=!1};g.g.object.T(g.i.od,g.i.Abstract);g.i.od.prototype.type=g.i.xo;g.i.od.prototype.Wa=function(){var a=g.i.od.w.Wa.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.zc&&(a.blockId=this.zc);return a}; +g.i.od.prototype.sa=function(a){g.i.od.w.sa.call(this,a);this.element=a.element;this.newValue=a.newValue;this.zc=a.blockId};g.wd=function(a){this.R=a};b=g.wd.prototype;b.Sw=!0;b.to=17;b.Nb=null;b.Wi=null;function Ja(a){a.Fd||(a.Fd=g.g.o.K("g",{"class":"blocklyIconGroup"},null),a.R.Wb&&g.g.o.qb(a.Fd,"blocklyIconGroupReadonly"),a.Cs(a.Fd),a.R.wa().appendChild(a.Fd),g.ka(a.Fd,"mouseup",a,a.mt),a.Yg())}b.I=function(){g.g.o.removeNode(this.Fd);this.Fd=null;this.Qb(!1);this.R=null};b.Yg=function(){};b.isVisible=function(){return!!this.Nb};b.mt=function(a){this.R.v.dc()||this.R.Wb||g.g.fj(a)||this.Qb(!this.isVisible())}; +b.Ne=function(){this.isVisible()&&this.Nb.mf(this.R.oh)};function Ka(a){var c=a.R.Oa(),d=g.g.ze(a.Fd);c=new g.g.S(c.x+d.x+a.to/2,c.y+d.y+a.to/2);g.g.S.ve(a.Wi,c)||(a.Wi=c,a.isVisible()&&(a=a.Nb,a.Tb=c,a.Up&&Ca(a)))};g.Af=function(a){g.Af.w.constructor.call(this,a);Ja(this);this.ag={}};g.g.object.T(g.Af,g.wd);g.Af.prototype.Sw=!1;g.Af.prototype.Cs=function(a){g.g.o.K("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);g.g.o.K("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);g.g.o.K("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)}; +g.Af.SG=function(a){var c=g.g.o.K("text",{"class":"blocklyText blocklyBubbleText",y:g.na.Zc},null);a=a.split("\n");for(var d=0;d>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};g.hd.Du=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +g.hd.Aq=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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;","}"];g.Tj=function(a,c,d,e){this.s=a;this.jb=c;this.ag=d.getAttribute("text");this.ed=new g.g.S(0,0);this.Og=e;this.Fo=d.getAttribute("callbackKey")||d.getAttribute("callbackkey");this.jx=d.getAttribute("web-class")||null};g.Tj.Qe=5;b=g.Tj.prototype;b.width=0;b.height=0;b.Fe=null; +b.Ga=function(){var a=this.Og?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.jx&&(a+=" "+this.jx);this.H=g.g.o.K("g",{"class":a},this.s.bb);if(!this.Og)var c=g.g.o.K("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.H);a=g.g.o.K("rect",{"class":this.Og?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.H);var d=g.g.o.K("text",{"class":this.Og?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.H);d.textContent=g.g.nc(this.ag); +this.Og&&(this.Tu=d,this.s.Rb.subscribe(this.Tu,"flyoutText","fill"));this.width=g.g.o.jp(d);this.height=20;this.Og||(this.width+=2*g.Tj.Qe,c.setAttribute("width",this.width),c.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);d.setAttribute("x",this.width/2);d.setAttribute("y",this.height-g.Tj.Qe);Pa(this);this.Fe=g.ka(this.H,"mouseup",this,this.jG);return this.H};b.show=function(){Pa(this);this.H.setAttribute("display","block")}; +function Pa(a){a.H.setAttribute("transform","translate("+a.ed.x+","+a.ed.y+")")}b.moveTo=function(a,c){this.ed.x=a;this.ed.y=c;Pa(this)};b.I=function(){this.Fe&&g.Xa(this.Fe);this.H&&g.g.o.removeNode(this.H);this.Tu&&this.s.Rb.unsubscribe(this.Tu)}; +b.jG=function(a){(a=this.jb.Gg(a))&&a.cancel();this.Og&&this.Fo?console.warn("Labels should not have callbacks. Label text: "+this.ag):this.Og||this.Fo&&Qa(this.jb,this.Fo)?this.Og||Qa(this.jb,this.Fo)(this):console.warn("Buttons should have callbacks. Button text: "+this.ag)};g.hd.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,},.blocklyFlyoutLabelText {,fill: #000;,}".split(","));g.sf=function(a){this.name=a};g.F=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.Dn=a;this.Dm=g.F.mF(a);this.qa=c;(a=d||null)&&a.uA&&(this.vA=a.uA)};g.F.types={ke:"field",Nd:"block",mg:"input",fk:"output",oe:"next",pe:"previous",xf:"stack",Ci:"workspace"};g.F.dB=-20;g.F.mF=function(a){switch(a){case g.F.types.pe:case g.F.types.oe:case g.F.types.mg:case g.F.types.fk:return!0}return!1};g.F.am=function(a){return new g.F(g.F.types.ke,a)}; +g.F.Ff=function(a){return a?a.type==g.Ua||a.type==g.Ra&&a.Lf()?g.F.Ki(a.Lf()):a.type==g.Ra?new g.F(g.F.types.oe,a):a.type==g.Re?new g.F(g.F.types.fk,a):a.type==g.Se?new g.F(g.F.types.pe,a):null:null};g.F.Ki=function(a){return a?new g.F(g.F.types.mg,a.connection):null};g.F.zg=function(a){return new g.F(g.F.types.Nd,a)};g.F.bm=function(a){return new g.F(g.F.types.xf,a)};g.F.cm=function(a,c){return new g.F(g.F.types.Ci,a,{uA:c})};b=g.F.prototype;b.Jb=function(){return this.Dn}; +function Ra(a,c){a=a.qa;a instanceof g.Qn||(a=a.B);if(!a||!a.v)return null;var d=G(a);a=A(d.v,!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:g.F.bm(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function Sa(a){if(!a)return null;do var c=a.Y&&C(a.Y);while(c&&t(c)==a&&(a=c));return(c=a.Y||a.L)&&c.ga&&c.ga.Lf()?g.F.Ki(c.ga.Lf()):g.F.bm(a)} +b.next=function(){switch(this.Dn){case g.F.types.xf:return Ra(this,!0);case g.F.types.fk:return g.F.zg(this.qa.B);case g.F.types.ke:a:{var a=this.qa,c=a.Lf();var d=a.B;a=c.Na.indexOf(a)+1;c=d.P.indexOf(c);for(var e;e=d.P[c];c++){for(var f=e.Na;ac||c>this.fb.length)throw Error(g.vc.Error.RA);this.bs[a.ua()]=a;if(a.getParent()==this){var e=this.fb.indexOf(a);-1a&&(a=(a=this.getParent())?a.Ak()+1:0,hb(this,a));return a};function hb(a,c){if(c!=a.ps){a.ps=c;var d=ib(a);if(d){var e=jb(a)+"px";a.Nk()?d.style.paddingRight=e:d.style.paddingLeft=e}ab(a,function(f){hb(f,c+1)})}}b.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};b.xh=function(){var a=[];ab(this,function(c){a.push(c)});return a};b.select=function(){var a=this.Ae();a&&Ta(a,this)}; +function kb(a,c){if(a.Zp!=c){a.Zp=c;lb(a);var d=a.ta();d&&(g.g.U.Eb(d,g.g.U.State.El,c),c&&(c=a.Ae().ta(),g.g.U.Eb(c,g.g.U.State.hv,a.ua())))}}b.ye=function(){return this.lm}; +b.wj=function(a){var c=a!=this.lm,d;this.lm=a;var e=this.Ae(),f=this.ta();if(cb(this)){if(!a&&e&&this.contains(e.Id)&&this.select(),f){if(d=eb(this))g.g.style.Gu(d,a),g.g.U.Eb(f,g.g.U.State.Iq,a),a&&this.Wc&&!d.hasChildNodes()&&(ab(this,function(h){d.appendChild(fb(h))}),ab(this,function(h){h.bf()}));this.kq()}}else(d=eb(this))&&g.g.style.Gu(d,!1);f&&(this.Xs().className=this.cp());c&&(a?this.Dx():this.Cx())};b.Dx=function(){};b.Cx=function(){};b.toggle=function(){this.wj(!this.ye())}; +function fb(a){var c=a.ye()&&cb(a),d=document.createElement("div");d.style.backgroundPosition=mb(a);c||(d.style.display="none");c&&ab(a,function(e){d.appendChild(fb(e))});c=document.createElement("div");c.id=a.ua();c.appendChild(nb(a));c.appendChild(d);return c}function jb(a){return Math.max(0,(a.Ak()-1)*a.Rc.Ly)}function nb(a){var c=document.createElement("div");c.className=a.ip();c.style["padding-"+(a.Nk()?"right":"left")]=jb(a)+"px";c.appendChild(ob(a));c.appendChild(pb(a));return c} +b.ip=function(){var a="";this.Zp&&(a=" "+(this.Rc.OD||""));return this.Rc.mx+a};function pb(a){var c=document.createElement("span");c.className=a.Rc.MD||"";c.textContent=a.cc();return c}function ob(a){var c=document.createElement("span");c.style.display="inline-block";c.className=a.cp();return c}b.cp=function(){throw Error("unimplemented abstract method");};function mb(a){return(a.Vt?(a.Ak()-1)*a.Rc.Ly:"-100")+"px 0"} +b.ta=function(){var a=g.Aa.gd.w.ta.call(this);a||(this.cb=a=document.getElementById(this.ua()));return a};function ib(a){return(a=a.ta())?a.firstChild:null}b.Xs=function(){var a=ib(this);return a?a.firstChild:null};function db(a){return(a=ib(a))&&a.lastChild?a.lastChild.previousSibling:null}function eb(a){return(a=a.ta())?a.lastChild:null}b.Yk=function(a){this.Ze=a};b.cc=function(){return this.Ze};function lb(a){var c=ib(a);c&&(c.className=a.ip())} +b.kq=function(){var a=eb(this);a&&(a.style.backgroundPosition=mb(this))};b.xz=function(a){"expand"==a.target.getAttribute("type")&&cb(this)?this.xt&&this.toggle():(this.select(),lb(this))};b.uz=function(a){a.preventDefault()};b.bu=function(a){var c=!0;switch(a.keyCode){case g.g.Ia.ir:if(a.altKey)break;c=qb(this);break;case g.g.Ia.Oq:if(a.altKey)break;c=rb(this);break;case g.g.Ia.$n:c=sb(this);break;case g.g.Ia.zo:c=tb(this);break;default:c=!1}c&&a.preventDefault();return c}; +function sb(a){a:if(cb(a)&&a.ye())a=a.fb[0]||null;else{for(var c=a,d;c!=a.Ae();){d=c.Vt;if(null!=d){a=d;break a}c=c.getParent()}a=null}a&&a.select();return!0}function tb(a){var c=a.Tk;if(null!=c)a=ub(c);else{c=a.getParent();var d=a.Ae();a=c==d||a==d?null:c}a&&a.select();return!0}function rb(a){if(cb(a)&&a.ye()&&a.xt)a.wj(!1);else{var c=a.getParent();a=a.Ae();c&&c!=a&&c.select()}return!0}function qb(a){return cb(a)?(a.ye()?(a.fb[0]||null).select():a.wj(!0),!0):!1} +function ub(a){return a.ye()&&cb(a)?ub(a.fb[a.fb.length-1]||null):a}function gb(a,c){a.Aa!=c&&(a.Aa=c,ab(a,function(d){gb(d,c)}))};g.Aa.jh=function(a,c,d){this.oa=a;g.Aa.gd.call(this,c,d)};g.g.object.T(g.Aa.jh,g.Aa.gd);b=g.Aa.jh.prototype;b.Ae=function(){if(this.Aa)return this.Aa;var a=this.getParent();return a&&(a=a.Ae())?(gb(this,a),a):null};b.cp=function(){var a=this.ye(),c=this.jE;if(a&&c)return c;c=this.eF;if(!a&&c)return c;c=this.Rc;if(cb(this)){if(a&&c.kx)return c.Oo+" "+c.kx;if(!a&&c.JD)return c.Oo+" "+c.JD}else if(c.lx)return c.Oo+" "+c.lx;return""}; +b.uz=function(){cb(this)&&this.xt?(this.toggle(),this.select()):this.Zp?Ta(this.Ae(),null):this.select();lb(this)};b.xz=function(){};b.bu=function(a){if(this.Aa.oa.ef){var c={},d=g.g.Ia.$n,e=g.g.Ia.zo;c[g.g.Ia.ir]=this.Nk()?e:d;c[g.g.Ia.Oq]=this.Nk()?d:e;c[g.g.Ia.zo]=g.g.Ia.Oq;c[g.g.Ia.$n]=g.g.Ia.ir;Object.defineProperties(a,{keyCode:{value:c[a.keyCode]||a.keyCode}})}return g.Aa.jh.w.bu.call(this,a)};b.Rz=function(){this.Az&&this.Az.call(this.oa)};b.Dx=g.Aa.jh.prototype.Rz;b.Cx=g.Aa.jh.prototype.Rz;g.Aa.Ai=function(a,c){this.oa=a;g.Aa.gd.call(this,"",c);this.lm=!0;kb(this,!0);this.Id=this};g.g.object.T(g.Aa.Ai,g.Aa.gd);b=g.Aa.Ai.prototype;b.Ae=function(){return this};b.Ak=function(){return 0};b.QE=function(){this.Sx=!0;var a=this.ta();g.g.o.qb(a,"focused");this.Id&&this.Id.select()};b.NE=function(){this.Sx=!1;var a=this.ta();g.g.o.fc(a,"focused")};b.hasFocus=function(){return this.Sx};b.ye=function(){return!0};b.wj=function(a){this.lm=a}; +b.Xs=function(){var a=ib(this);return a?a.firstChild:null};b.kq=function(){};b.ip=function(){return g.Aa.Ai.w.ip.call(this)+" "+this.Rc.LD};b.cp=function(){var a=this.ye(),c=this.jE;if(a&&c)return c;c=this.eF;if(!a&&c)return c;c=this.Rc;return a&&c.KD?c.Oo+" "+c.KD:""};function Ta(a,c){if(c!=a.Id&&(!a.rz||a.rz.call(a.oa,c))){var d=a.Id;a.Id&&kb(a.Id,!1);(a.Id=c)&&kb(c,!0);a.qz&&a.qz.call(a.oa,d,c)}} +b.qp=function(){g.Aa.Ai.w.qp.call(this);var a=this.ta();g.g.U.Xf(a,g.g.U.ti.EC);g.g.U.Eb(a,g.g.U.State.Rv,db(this).id)};b.bf=function(){g.Aa.Ai.w.bf.call(this);var a=this.ta();a.className=this.Rc.ND;a.setAttribute("hideFocus","true");this.Nr();this.qp()};b.wh=function(){g.Aa.Ai.w.wh.call(this);this.qs()};b.Nr=function(){var a=this.ta();a.tabIndex=0;this.WF=g.yc(a,"focus",this,this.QE);this.SF=g.yc(a,"blur",this,this.NE);this.UF=g.ka(a,"click",this,this.UE);this.aG=g.yc(a,"keydown",this,this.RE)}; +b.qs=function(){g.Xa(this.WF);g.Xa(this.SF);g.Xa(this.UF);g.Xa(this.aG)};b.UE=function(a){var c;a:{for(var d=a.target;null!=d;){if(c=g.Aa.gd.Hr[d.id])break a;if(d==this.ta())break;d=d.parentNode}c=null}if(c)switch(a.type){case "mousedown":c.xz(a);break;case "click":c.uz(a)}};b.RE=function(a){var c=!1;if(c=this.Id&&this.Id.bu(a)||c)g.g.style.Cu(this.Id.ta(),this.ta().parentNode),a.preventDefault();return c};b.createNode=function(a){return new g.Aa.jh(this.oa,a||"",this.Rc)};g.g.Ib={};g.g.Ib.parse=function(a){a=String(a).toLowerCase().trim();var c=g.g.Ib.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)?g.g.Ib.Au(a,c,d):null}; +g.g.Ib.Au=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};g.g.Ib.Gy=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +g.g.Ib.dF=function(a){var c=g.zB,d=255*g.AB,e=0,f=0,h=0;if(0==c)h=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;h=a;break;case 2:e=a;f=d;h=c;break;case 3:e=a;f=m;h=d;break;case 4:e=c;f=a;h=d;break;case 5:e=d;f=a;h=m;break;case 6:case 0:e=d,f=c,h=a}}return g.g.Ib.Au(Math.floor(e),Math.floor(f),Math.floor(h))}; +g.g.Ib.Qr=function(a,c,d){a=g.g.Ib.Gy(g.g.Ib.parse(a));c=g.g.Ib.Gy(g.g.Ib.parse(c));return g.g.Ib.Au(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])))};g.g.Ib.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"};g.g.Rect=function(a,c,d,e){this.top=a;this.bottom=c;this.left=d;this.right=e};g.g.Rect.prototype.contains=function(a,c){return a>=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};g.zi=function(a){this.s=a;this.G=a.options.G;this.ef=a.options.Ed;this.Da=a.options.Da;this.Rc={Ly:19,ND:"blocklyTreeRoot",LD:"blocklyHidden",mx:"blocklyTreeRow",MD:"blocklyTreeLabel",Oo:"blocklyTreeIcon",kx:"blocklyTreeIconOpen",lx:"blocklyTreeIconNone",OD:"blocklyTreeSelected"};this.lA={mx:"blocklyTreeSeparator"};this.ef&&(this.Rc.cssTreeRow+=a.G?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.lA.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.G?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"), +this.Rc.cssTreeIcon="")};b=g.zi.prototype;b.width=0;b.height=0;b.Ok=null; +b.aa=function(){var a=this.s,c=v(this.s);this.wc=document.createElement("div");this.wc.className="blocklyToolboxDiv blocklyNonSelectable";this.wc.setAttribute("dir",a.G?"RTL":"LTR");c.parentNode.insertBefore(this.wc,c);c=a.Rb;c.subscribe(this.wc,"toolbox","background-color");c.subscribe(this.wc,"toolboxText","color");g.ka(this.wc,"mousedown",this,function(d){g.g.fj(d)||d.target==this.wc?g.mc(!1):g.mc(!0);g.Touch.nh()},!1,!0);c={Cg:a.options.Cg,Kb:a,G:a.G,Ge:a.options.Ge,Ed:a.Ed,Da:a.options.Da,Rg:a.options.Rg}; +this.M=null;if(a.Ed){if(!g.vl)throw Error("Missing require for Blockly.HorizontalFlyout");this.M=new g.vl(c)}else{if(!g.sg)throw Error("Missing require for Blockly.VerticalFlyout");this.M=new g.sg(c)}g.g.o.Zi(this.M.Ga("svg"),v(this.s));this.M.aa(a);this.Rc.cleardotPath=a.options.lf+"1x1.gif";this.Rc.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.G?"Rtl":"Ltr");vb(this,a.options.Of)}; +function vb(a,c){a.ud&&(a.ud.I(),a.Ok=null);var d=new g.Aa.Ai(a,a.Rc);a.ud=d;Ta(d,null);d.rz=a.ME;d.qz=a.LE;var e=null;if(c){a.ud.Cf=[];a.gt=!1;e=wb(a,c,a.ud,a.s.options.lf);if(a.ud.Cf.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");xb(a.s)}d.za(a.wc);e&&Ta(d,e);yb(a);a.position();a.ef&&g.g.U.Eb(a.ud.ta(),g.g.U.State.jC,"horizontal")} +b.ME=function(a){if(a==this.ud)return!1;this.Ok&&(ib(this.Ok).style.backgroundColor="");if(a){var c=a.Fk||"#57e";ib(a).style.backgroundColor=c;yb(this,a)}return!0};b.LE=function(a,c){c&&c.Cf&&c.Cf.length?(this.M.show(c.Cf),this.Ok!=c&&this.M.pc.set(0),g.De&&g.navigation.Eb(g.navigation.vr)):(this.M.ya(),!g.De||c instanceof g.zi.Br||g.navigation.Eb(g.navigation.Gl));a!=c&&a!=this&&(a=new g.i.od(null,"category",a&&a.cc(),c&&c.cc()),a.uc=this.s.id,g.i.Ka(a));c&&(this.Ok=c)};b.XE=function(){g.$k(this.s)}; +b.Nh=function(a){var c=this.ud.Id;if(!c)return!1;switch(a.name){case g.navigation.Za.pe:return tb(c);case g.navigation.Za.qo:return rb(c);case g.navigation.Za.oe:return sb(c);case g.navigation.Za.fo:return qb(c);default:return!1}};b.I=function(){this.M.I();this.ud.I();this.s.Rb.unsubscribe(this.wc);g.g.o.removeNode(this.wc);this.Ok=this.s=null};b.Mf=function(){return this.width};b.ey=function(){return this.height}; +b.position=function(){var a=this.wc;if(a){var c=v(this.s);c=g.hA(c);this.ef?(a.style.left="0",a.style.height="auto",a.style.width=c.width+"px",this.height=a.offsetHeight,this.Da==g.qg?a.style.top="0":a.style.bottom="0"):(this.Da==g.pg?a.style.right="0":a.style.left="0",a.style.height=c.height+"px",this.width=a.offsetWidth);this.M.position()}}; +function wb(a,c,d,e){for(var f=null,h=null,k=0,l;l=c.childNodes[k];k++)if(l.tagName)switch(l.tagName.toUpperCase()){case "CATEGORY":var m=g.g.nc(l.getAttribute("name"));h=a.ud.createNode(m);h.Az=a.XE;h.Cf=[];d.add(h);var n=l.getAttribute("custom");n?h.Cf=n:(n=wb(a,l,h,e))&&(f=n);var q=l.getAttribute("categorystyle");if((n=l.getAttribute("colour"))&&q)h.Fk="",console.warn('Toolbox category "'+m+'" can not have both a style and a colour');else if(q){n=a;var r=h;r.YL=q;var u=n.s.kp();q&&u&&((u=u.mD[q])&& +u.Ib?zb(n,u.Ib,r,m):console.warn('Style "'+q+'" must exist and contain a colour value'))}else zb(a,n,h,m);"true"==l.getAttribute("expanded")?(h.Cf.length&&(f=h),h.wj(!0)):h.wj(!1);h=l;break;case "SEP":if(h&&"CATEGORY"==h.tagName.toUpperCase()){d.add(new g.zi.Br(a.lA));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":d.Cf.push(l),h=l}return f} +function zb(a,c,d,e){c=g.g.nc(c);if(null===c||""===c)d.Fk="";else{var f=Number(c);isNaN(f)?(f=g.g.Ib.parse(c))?(d.Fk=f,a.gt=!0):(d.Fk="",console.warn('Toolbox category "'+e+'" has unrecognized colour attribute: '+c)):(d.Fk=g.Ky(f),a.gt=!0)}}function yb(a,c){c=(c||a.ud).xh(!1);for(var d=0,e;e=c[d];d++){var f=ib(e);if(f){var h=a.gt?"8px solid "+(e.Fk||"#ddd"):"none";a.s.G?f.style.borderRight=h:f.style.borderLeft=h}yb(a,e)}} +b.rm=function(){if(!this.wc)return null;var a=this.wc.getBoundingClientRect(),c=a.top,d=c+a.height,e=a.left;a=e+a.width;return this.Da==g.qg?new g.g.Rect(-1E7,d,-1E7,1E7):this.Da==g.xi?new g.g.Rect(c,1E7,-1E7,1E7):this.Da==g.zd?new g.g.Rect(-1E7,1E7,-1E7,a):new g.g.Rect(-1E7,1E7,e,1E7)};g.zi.Br=function(a){g.Aa.jh.call(this,null,"",a)};g.g.object.T(g.zi.Br,g.Aa.jh); +g.hd.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", +"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);g.i.rl=function(a){this.uc=a.id;this.group=g.i.Ub();this.Jc=!1};g.g.object.T(g.i.rl,g.i.Abstract);g.i.rl.prototype.type=g.i.oB;g.i.rl.prototype.Wa=function(){var a={type:this.type};this.group&&(a.group=this.group);this.uc&&(a.workspaceId=this.uc);return a};g.i.rl.prototype.sa=function(a){this.uc=a.workspaceId;this.group=a.group};g.O={};g.O.rA=function(a){var c=I,d=g.g.xml.createElement("xml"),e=g.O.dH(g.N.Ew(c));e.hasChildNodes()&&d.appendChild(e);var f=wa(c,!0);e=0;for(var h;h=f[e];e++)d.appendChild(h.Vu(a));c=A(c,!0);for(e=0;f=c[e];e++)d.appendChild(g.O.Sr(f,a));return d};g.O.dH=function(a){for(var c=g.g.xml.createElement("variables"),d=0,e;e=a[d];d++){var f=g.g.xml.createElement("variable");f.appendChild(g.g.xml.createTextNode(e.name));e.type&&f.setAttribute("type",e.type);f.id=e.ua();c.appendChild(f)}return c}; +g.O.Sr=function(a,c){var d;a.v.G&&(d=a.v.Mf());c=g.O.lh(a,c);var e=a.Oa();c.setAttribute("x",Math.round(a.v.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};g.O.lE=function(a){var c=!1;a.name&&(a.gk?c=!0:a.uf&&(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=g.g.xml.createElement("field"),c.setAttribute("name",a.name),a.iA(c)):null}; +g.O.YC=function(a,c){for(var d=0,e;e=a.P[d];d++)for(var f=0,h;h=e.Na[f];f++)(h=g.O.lE(h))&&c.appendChild(h)}; +g.O.lh=function(a,c){var d=g.g.xml.createElement(a.$a?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.eb){var e=a.eb();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}g.O.YC(a,d);if(e=a.te.text){var f=a.te.size,h=a.te.mu,k=g.g.xml.createElement("comment");k.appendChild(g.g.xml.createTextNode(e));k.setAttribute("pinned",h);k.setAttribute("h",f.height);k.setAttribute("w",f.width);d.appendChild(k)}a.data&&(e=g.g.xml.createElement("data"),e.appendChild(g.g.xml.createTextNode(a.data)), +d.appendChild(e));for(f=0;h=a.P[f];f++){var l;k=!0;if(h.type!=g.jg){var m=C(h.connection);h.type==g.Ua?l=g.g.xml.createElement("value"):h.type==g.Ra&&(l=g.g.xml.createElement("statement"));e=h.connection.nf;!e||m&&m.$a||l.appendChild(g.O.Rw(e,c));m&&(l.appendChild(g.O.lh(m,c)),k=!1);l.setAttribute("name",h.name);k||d.appendChild(l)}}void 0!=a.Mg&&a.Mg!=a.kF&&d.setAttribute("inline",a.Mg);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.Zd()||a.$a||d.setAttribute("deletable", +!1);a.Fc()||a.$a||d.setAttribute("movable",!1);a.cd()||d.setAttribute("editable",!1);if(f=t(a))l=g.g.xml.createElement("next"),l.appendChild(g.O.lh(f,c)),d.appendChild(l);e=a.V&&a.V.nf;!e||f&&f.$a||l.appendChild(g.O.Rw(e,c));return d}; +g.O.Rw=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==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&g.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&g.g.o.removeNode(e))}return a}; +g.O.Dd=function(a){a=g.g.xml.Dd(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};g.O.tL=function(a){a=g.O.Dd(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +g.O.$h=function(a){var c=g.g.xml.QG(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};g.O.pL=function(a,c){c.Lc(!1);c.clear();a=g.O.uh(a,c);c.Lc(!0);return a}; +g.O.uh=function(a,c){if(a instanceof g.Fb){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.G&&(e=c.Mf());d=[];g.g.o.tn();var f=a.childNodes.length,h=g.i.Ub();h||g.i.Z(!0);c.Lc&&c.Lc(!1);var k=!0;try{for(var l=0;l=this.s.options.Gp)){a={scrollbars:!0,Cg:this.s.options.Cg,Kb:this.s,G:this.s.G,Ge:this.s.options.Ge,Rg:this.s.options.Rg};if(this.s.Ed){a.Da=this.s.Da==g.qg?g.xi:g.qg;if(!g.vl)throw Error("Missing require for Blockly.HorizontalFlyout");this.M=new g.vl(a)}else{a.Da=this.s.Da==g.pg?g.zd:g.pg;if(!g.sg)throw Error("Missing require for Blockly.VerticalFlyout");this.M=new g.sg(a)}Aa(this.s,this.VF.bind(this))}};b=g.Ar.prototype;b.Bi=47;b.On=44;b.ak=16;b.Sq=20; +b.yl=20;b.lo=10;b.qr=0;b.rr=32;b.wB=.1;b.vt=!1;b.Hp=0;b.H=null;b.gq=null;b.Dt=0;b.Jh=0;b.Lm=0;b.dl=0; +b.Ga=function(){this.H=g.g.o.K("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=g.g.o.K("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.H);g.g.o.K("rect",{width:this.Bi,height:this.On,y:this.ak},c);var d=g.g.o.K("image",{width:g.nd.width,x:-this.qr,height:g.nd.height,y:-this.rr,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.H);d.setAttributeNS(g.g.o.Ue,"xlink:href",this.s.options.lf+g.nd.url);c=g.g.o.K("clipPath",{id:"blocklyTrashLidClipPath"+a},this.H); +g.g.o.K("rect",{width:this.Bi,height:this.ak},c);this.gq=g.g.o.K("image",{width:g.nd.width,x:-this.qr,height:g.nd.height,y:-this.rr,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.H);this.gq.setAttributeNS(g.g.o.Ue,"xlink:href",this.s.options.lf+g.nd.url);g.ka(this.H,"mouseup",this,this.click);g.yc(d,"mouseover",this,this.FF);g.yc(d,"mouseout",this,this.DF);this.Ir();return this.H}; +b.aa=function(a){0this.Hp&&1>this.Jh&&(this.Dt=setTimeout(this.Ir.bind(this),20))};function Db(a,c){var d=a.s.Da==g.pg||a.s.Ed&&a.s.G;a.gq.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.Bi-4)+","+(a.ak-2)+")")}b.close=function(){Cb(this,!1)}; +b.click=function(){if(this.Ji.length){for(var a=[],c=0,d;d=this.Ji[c];c++)a[c]=g.O.$h(d);this.M.show(a)}};b.FF=function(){this.Ji.length&&Cb(this,!0)};b.DF=function(){Cb(this,!1)}; +b.VF=function(a){if(!(0>=this.s.options.Gp)&&a.type==g.i.Nn&&"shadow"!=a.$t.tagName.toLowerCase()){for(var c=a=a.$t.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=g.O.Dd(a);if(-1==this.Ji.indexOf(a)){for(this.Ji.unshift(a);this.Ji.length>this.s.options.Gp;)this.Ji.pop();this.Hp=this.wB;Db(this,45*this.Hp)}}};g.W=Object.create(null);g.ra=function(a,c){this.B=a;this.type=c};g.ra.Sn=0;g.ra.ew=1;g.ra.hw=2;g.ra.gw=3;g.ra.cw=4;g.ra.dw=5;g.ra.fw=6;b=g.ra.prototype;b.ga=null;b.vg=null;b.nf=null;b.Sb=0;b.Ya=0; +b.Xe=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=C(c),h=c.nf;c.nf=null;if(f.$a)h=g.O.lh(f),f.I(),f=null;else if(c.type==g.Ua){if(!f.L)throw Error("Orphan block does not have an output connection.");var k=g.ra.Xy(e,f);k&&(f.L.connect(k),f=null)}else if(c.type==g.Ra){if(!f.Y)throw Error("Orphan block does not have a previous connection.");for(k=e;k.V;){var l=t(k);if(l&&!l.$a)k=l;else{Eb(f.Y,k.V)&&(k.V.connect(f.Y),f=null);break}}}if(f&&(c.disconnect(), +g.i.Jc)){var m=g.i.Ub();setTimeout(function(){f.v&&!f.getParent()&&(g.i.Z(m),f.L?f.L.Jp(c):f.Y&&f.Y.Jp(c),g.i.Z(!1))},g.Pn)}c.nf=h}var n;g.i.isEnabled()&&(n=new g.i.ll(e));g.ra.BD(c,a);e.Xk(d);n&&(n.tj(),g.i.Ka(n))};b.I=function(){if(this.isConnected()){this.nf=null;var a=C(this);a.$a?a.I():D(a)}};function H(a){return a.type==g.Ua||a.type==g.Ra}b.isConnected=function(){return!!this.ga}; +function Xa(a,c){if(!c)return g.ra.gw;if(H(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?g.ra.ew:c.type!=g.dk[a.type]?g.ra.hw:d&&e&&d.v!==e.v?g.ra.dw:Eb(a,c)?d.$a&&!e.$a?g.ra.fw:g.ra.Sn:g.ra.cw} +function Ya(a,c){switch(Xa(a,c)){case g.ra.Sn:break;case g.ra.ew:throw Error("Attempted to connect a block to itself.");case g.ra.dw:throw Error("Blocks not on same workspace.");case g.ra.hw:throw Error("Attempt to connect incompatible types.");case g.ra.gw:throw Error("Target connection is null.");case g.ra.cw:throw Error("Connection checks failed. "+(a+" expected "+a.vg+", found "+c.vg));case g.ra.fw:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.vp=function(a){if(a.B.Ng()||Xa(this,a)!=g.ra.Sn)return!1;switch(a.type){case g.Se:return this.ga||-1!=g.jm.indexOf(a)?a=!1:a.ga?(a=C(a),a=a.Ng()?!(a.Y&&C(a.Y)):!1):a=!0,a;case g.Re:if(a.isConnected()&&!C(a).Ng()||this.isConnected())return!1;break;case g.Ua:if(a.isConnected()&&!C(a).Fc()&&!C(a).$a)return!1;break;case g.Ra:if(a.isConnected()&&!this.B.V&&!C(a).$a&&C(a).V)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=g.jm.indexOf(a)?!1:!0};b.Jp=function(){}; +b.connect=function(a){if(this.ga!=a){Ya(this,a);var c=g.i.Ub();c||g.i.Z(!0);H(this)?this.Xe(a):a.Xe(this);c||g.i.Z(!1)}};g.ra.BD=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ga=c;c.ga=a};g.ra.HG=function(a,c){for(var d=!1,e=0;ed)){var e=Gb(c,a.wa());a.L?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.Y&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=g.g.o.K("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},v(c));g.hb.$w(a,new Date,d)}};g.hb.$w=function(a,c,d){var e=(new Date-c)/150;1a.v.scale)){var c=J(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);g.hb.yx(a.wa(),c,new Date)}};g.hb.yx=function(a,c,d){var e=(new Date-d)/200;1a-g.ZA)}if(a.Gc||a.zb)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Gc||!a.zb);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function Jb(a){a.zb&&(g.g.o.removeNode(g.ra.Jy),delete g.ra.Jy);if(a.kt){var c=a.zb;c.type!=g.Ua||c.isConnected()?Kb(a.Hk,!1):a.Hk.cF(c,!1);a.Hk=null;a.kt=!1}else if(a.ij)if(a.ij){c=a.ij;var d=c.B,e=d.V,f=d.Y,h=d.L;h=c.type==g.Ua&&!(h&&h.ga);!(c!=e||f&&f.ga)||h?D(C(c),!1):c.type==g.Ra&&c!=e?(e=c.ga,D(e.B,!1),f=f?f.ga:null,D(d,!0),f&&f.connect(e)):D(d,!0);if(c.ga)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.ij=null;d.wa().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +g.jo.prototype.Bk=function(){var a=[];this.zk&&a.push(this.zk);this.gj&&a.push(this.gj);return a};g.di=function(a,c){this.Bb=a;this.s=c;this.If=new g.jo(this.Bb);this.Ni=null;this.dg=!1;this.Zf=this.Bb.Oa();this.Wo=g.di.iF(a)};g.di.prototype.I=function(){this.qc=this.s=this.Bb=null;this.Wo.length=0;this.If&&(this.If.I(),this.If=null)};g.di.iF=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Lb(e);for(var f=0;fg.J.oC&&g.J.ya()}else g.J.Op!=g.J.cb&&(clearTimeout(g.J.qn),g.J.Bt=a.pageX,g.J.Ct=a.pageY,g.J.qn=setTimeout(g.J.GG,g.J.yB))};g.J.ya=function(){g.J.visible&&(g.J.visible=!1,g.J.Ca&&(g.J.Ca.style.display="none"));g.J.qn&&clearTimeout(g.J.qn)};g.J.block=function(){g.J.ya();g.J.nk=!0};g.J.$G=function(){g.J.nk=!1}; +g.J.GG=function(){if(!g.J.nk&&(g.J.Op=g.J.cb,g.J.Ca)){g.J.Ca.innerHTML="";for(var a=g.J.cb.qf;"function"==typeof a;)a=a();a=g.g.ab.sA(a,g.J.NB);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=g.J.Ca.offsetHeight+2*g.J.Xv);a?e=Math.max(g.J.Rq-window.scrollX,e):e+g.J.Ca.offsetWidth>c+window.scrollX-2*g.J.Rq&&(e=c-g.J.Ca.offsetWidth-2*g.J.Rq);g.J.Ca.style.top=f+"px";g.J.Ca.style.left=e+"px"}};g.Uj=function(a,c){this.qc=this.rc=this.yj=this.zj=this.ae=this.pd=this.hz=null;this.ls=c;this.Em=this.cj=this.Fm=this.Ri=!1;this.kf=a;this.M=this.ci=this.We=this.tg=this.Lp=this.Kp=null;this.xp=this.Ti=this.Lw=!1;this.Fy=!g.hB};b=g.Uj.prototype;b.I=function(){g.Touch.nh();g.J.$G();this.ls.Bc=null;this.Kp&&g.Xa(this.Kp);this.Lp&&g.Xa(this.Lp);this.M=this.qc=this.rc=this.yj=this.zj=null;this.We&&(this.We.I(),this.We=null);this.ci&&(this.ci.I(),this.ci=null);this.tg&&(this.tg.I(),this.tg=null)}; +function Wb(a,c){a.pd=g.g.S.hm(new g.g.S(c.clientX,c.clientY),a.hz);if(a.Ri)var d=!1;else a.Ri=g.g.S.yF(a.pd)>(a.M?g.pB:g.gB),d=a.Ri;if(d){if(a.Lw)throw Error("updateIsDragging_ should only be called once per gesture.");a.Lw=!0;if(a.ae){a.Em=!0;a.tg=new g.ml(a.ae,a.qc);d=a.tg;g.i.Ub()||g.i.Z(!0);d.s.Lc(!1);d.lc.Or=!1;d.Pi&&d.St();d.lc.vj&&d.lc.vj(!0);var e=d.s.oa;e&&g.g.o.qb(e.wc,d.lc.Zd()?"blocklyToolboxDelete":"blocklyToolboxGrab");Sb(a.tg,a.kf,a.pd);d=!0}else d=!1;if(!d){if(a.rc)if(a.M?(a.M.Qy(a.rc)? +((d=!Xb(a.M))||(d=a.pd,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.M.eE,d=d-e||d<-180+e||d>180-e?!0:!1),d?(a.qc=a.M.jb,Yb(a.qc),g.i.Ub()||g.i.Z(!0),a.yj=null,a.rc=Va(a.M,a.rc),a.rc.select(),d=!0):d=!1):d=!1,a.cj=d):a.rc.Fc()&&(a.cj=!0),a.cj){a.We=new g.di(a.rc,a.qc);d=a.We;e=a.pd;var f=a.Fy;g.i.Ub()||g.i.Z(!0);d.s.ej&&$a(d.Bb);g.g.o.tn();d.s.Lc(!1);g.hb.ys();if(d.Bb.getParent()||f&&d.Bb.V&&C(d.Bb.V))D(d.Bb,f),e=d.Rk(e),e=g.g.S.sum(d.Zf,e),d.Bb.translate(e.x,e.y),g.hb.ZD(d.Bb);d.Bb.vj(!0);d.Bb.St(); +(e=d.s.oa)&&g.g.o.qb(e.wc,d.Bb.Zd()?"blocklyToolboxDelete":"blocklyToolboxGrab");Mb(a.We,a.kf,a.pd);d=!0}else d=!1;else d=!1;if(d=!d)if(a.M)d=Xb(a.M);else if(d=a.qc)d=a.qc,d=d.options.Hc&&d.options.Hc.vh;d&&(a.ci=a.M?new g.co(a.M):new g.Ml(a.qc),a.Fm=!0,a.ci.Qu())}g.Kh()}a.kf=c} +b.zs=function(a){g.g.Ap(a)?this.cancel():(this.Ti=!0,g.hb.ys(),Yb(this.qc),this.qc.ej&&this.qc.resize(),oa(this.qc),this.kf=a,g.mc(!!this.M),g.J.block(),this.rc&&(!this.rc.Wb&&a.shiftKey?(g.navigation.Ls(),w(this.ls.Va,g.navigation.bt(this.rc))):this.rc.select()),g.g.fj(a)?ba(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||g.wF(a,this),this.hz=new g.g.S(a.clientX,a.clientY),this.Fy=a.altKey||a.ctrlKey||a.metaKey,this.mk(a)))}; +b.mk=function(a){this.Kp=g.ka(document,"mousemove",null,this.wm.bind(this));this.Lp=g.ka(document,"mouseup",null,this.mp.bind(this));a.preventDefault();a.stopPropagation()};b.wm=function(a){Wb(this,a);this.Fm?this.ci.vh(this.pd):this.cj?Mb(this.We,this.kf,this.pd):this.Em&&Sb(this.tg,this.kf,this.pd);a.preventDefault();a.stopPropagation()}; +b.mp=function(a){Wb(this,a);g.Kh();if(this.xp)console.log("Trying to end a gesture recursively.");else{this.xp=!0;if(this.Em)Tb(this.tg,a,this.pd);else if(this.cj)Pb(this.We,a,this.pd);else if(this.Fm){var c=this.ci;c.vh(this.pd);ra(c.s)}else if(this.ae&&!this.Ri)this.ae.DG&&this.ae.DG(),this.ae.select&&this.ae.select();else if(Zb(this))this.zj.Le(),$b(this);else if(this.yj&&!this.Ri&&!Zb(this))this.M&&this.M.lk?this.rc.isEnabled()&&(g.i.Ub()||g.i.Z(!0),Rb(Va(this.M,this.rc))):g.i.Ka(new g.i.od(this.yj, +"click",void 0,void 0)),$b(this),g.i.Z(!1);else if(!(this.yj||this.ae||this.zj||this.Ri))if(c=this.ls,a.shiftKey){g.navigation.Ls();var d=g.g.AG(c,new g.g.S(a.clientX,a.clientY));d=g.F.cm(c,d);w(c.Va,d)}else g.selected&&Vb(g.selected);a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.xp){g.Kh();if(this.Em)Tb(this.tg,this.kf,this.pd);else if(this.cj)Pb(this.We,this.kf,this.pd);else if(this.Fm){var a=this.ci;a.vh(this.pd);ra(a.s)}this.I()}}; +function ba(a,c){a.rc?($b(a),g.mc(a.M),a.rc.pn(c)):a.ae?a.ae.pn(c):a.qc&&!a.M&&(g.mc(),a.qc.pn(c));c.preventDefault();c.stopPropagation();a.I()}function ac(a,c,d){if(a.Ti)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.qc||(a.qc=d);a.kf=c;a.zs(c);g.De&&g.navigation.Eb(g.navigation.Gl)}function bc(a,c,d){if(a.Ti)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.M||(a.M=d);ac(a,c,d.Dk())} +function $b(a){a.rc&&!a.M&&$a(a.rc)}function cc(a,c){a.yj||a.ae||(a.yj=c,c.Wb&&c!=G(c)?dc(a,G(c)):dc(a,c))}function dc(a,c){c.$a?dc(a,c.getParent()):a.rc=c}function Zb(a){if(a.zj){var c=a.zj;c=!!c.B&&c.B.cd()&&!!c.Le&&"function"===typeof c.Le}else c=!1;return c&&!a.Ri&&(!a.M||!a.M.lk)}b.dc=function(){return this.Fm||this.cj||this.Em};b.Bk=function(){return this.We?this.We.Bk():[]};g.Uj.nt=function(){for(var a=g.Fb.getAll(),c=0,d;d=a[c];c++)if(d.Bc)return!0;return!1};g.Ha=function(a,c,d){this.kA=this.Ij=this.kb=null;this.Lb=new g.g.qe(0,0);this.Sc=null;d&&this.Ad(d);this.setValue(a);c&&(this.Ij=c)};g.Ha.rv=16;g.Ha.pw=12.5;g.Ha.Nl=10;g.Ha.Aw=10;g.Ha.ji=g.Ha.Nl/2;b=g.Ha.prototype;b.name=void 0;b.ez=50;b.B=null;b.ff=!0;b.bi=!0;b.Io=null;g.Ha.Vv="\u00a0";b=g.Ha.prototype;b.uf=!0;b.gk=!1;b.Ad=function(a){var c=a.tooltip;"string"==typeof c&&(c=g.g.nc(a.tooltip));c&&this.vb(c)};b.Ku=function(a){if(this.B)throw Error("Field already bound to a block.");this.B=a}; +b.aa=function(){this.we||(this.we=g.g.o.K("g",{},null),this.isVisible()||(this.we.style.display="none"),this.B.wa().appendChild(this.we),this.Yi(),this.Yg(),this.vb(this.kA),g.J.mk(this.Io||this.wa()),this.gz=g.ka(this.Io||this.wa(),"mousedown",this,this.Oh),this.Xi())};b.Yi=function(){this.Lb.height=Math.max(this.Lb.height,g.Ha.rv);this.Lb.width=Math.max(this.Lb.width,g.Ha.Nl);this.Ei=g.g.o.K("rect",{rx:4,ry:4,x:0,y:0,height:this.Lb.height,width:this.Lb.width},this.we);ec(this)};b.Xi=function(){}; +function ec(a){a.tc=g.g.o.K("text",{"class":"blocklyText",y:g.Ha.pw,x:a.Ei?g.Ha.ji:0},a.we);a.Ej=document.createTextNode("");a.tc.appendChild(a.Ej)}b.pm=function(a){this.setValue(a.textContent)};b.iA=function(a){a.textContent=this.getValue();return a};b.I=function(){g.D.ym(this);g.$.ym(this);this.gz&&g.Xa(this.gz);g.g.o.removeNode(this.we)}; +b.Yg=function(){var a=this.Io||this.wa();this.uf&&a&&(this.B.cd()?(g.g.o.qb(a,"blocklyEditableText"),g.g.o.fc(a,"blocklyNonEditableText"),a.style.cursor=this.Cq):(g.g.o.qb(a,"blocklyNonEditableText"),g.g.o.fc(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.bi};b.Qb=function(a){if(this.bi!=a){this.bi=a;var c=this.wa();c&&(c.style.display=a?"block":"none")}};function fc(a,c){a.Ij=c}b.sy=function(){return this.Ij};b.wa=function(){return this.we};b.Ne=function(){}; +b.Tf=function(){if(this.Ej){this.Ej.nodeValue=gc(this);var a=g.g.o.jp(this.tc);this.Ei&&(a+=g.Ha.Nl,this.Ei.setAttribute("width",a));this.Lb.width=a}};b.Hg=function(){if(!this.isVisible())return new g.g.qe(0,0);this.ff?(this.Tf(),this.ff=!1):this.bi&&0==this.Lb.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.Tf());return this.Lb}; +function gc(a){var c=a.cc();if(!c)return g.Ha.Vv;c.length>a.ez&&(c=c.substring(0,a.ez-2)+"\u2026");c=c.replace(/\s/g,g.Ha.Vv);a.B&&a.B.G&&(c+="\u200f");return c}b.cc=function(){if(this.Ck){var a=this.Ck.call(this);if(null!==a)return String(a)}return String(this.getValue())};b.Yk=function(){throw Error("setText method is deprecated");};b.Pm=function(){this.ff=!0};function hc(a){a.ff=!0;a.B&&a.B.ca&&(a.B.za(),a.B.Hb())} +b.setValue=function(a){if(null!==a){var c=this.Dg(a);a=ic(this,a,c);if(!(a instanceof Error)){if(c=this.sy())if(c=c.call(this,a),a=ic(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&g.i.isEnabled()&&g.i.Ka(new g.i.eg(this.B,"field",this.name||null,c,a)),this.sh(a),this.ff&&hc(this))}}};function ic(a,c,d){if(null===d)return a.Ex(),a.ff&&hc(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.kb};b.Dg=function(a){return null===a||void 0===a?null:a}; +b.sh=function(a){this.kb=a;this.ff=!0};b.Ex=function(){};b.Oh=function(a){if(this.B&&this.B.v&&(a=this.B.v.Gg(a))){if(a.Ti)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.zj||(a.zj=this)}};b.vb=function(a){var c=this.Io||this.wa();c?c.qf=a||""===a?a:this.B:this.kA=a};b.fn=function(){return!1};b.Lf=function(){for(var a=null,c=this.B,d=c.P,e=0;ec||c>a.Na.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new g.Od(d));d.Ku(a.B);a.B.ca&&d.aa();d.name=e;d.nu&&(c=jc(a,c,d.nu));a.Na.splice(c,0,d);++c;d.Su&&(c=jc(a,c,d.Su));a.B.ca&&(a.B.za(),a.B.Hb());return c}b.isVisible=function(){return this.bi}; +b.Qb=function(a){var c=[];if(this.bi==a)return c;for(var d=(this.bi=a)?"block":"none",e=0,f;f=this.Na[e];e++)f.Qb(a);if(this.connection){if(a)c=kc(this.connection);else if(e=this.connection,lc(e,!0),e.ga)for(e=p(C(e),!1),f=0;f=d)this.oh=g.Ky(d);else if(d=g.g.Ib.parse(c))this.oh=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);};function L(a,c){var d=a.v.kp().gD[c];if(d)a.Uw=d.colourSecondary,a.Vw=d.colourTertiary,a.Jg=d.Jg,a.mf(d.colourPrimary);else throw Error("Invalid style name: "+c);}function B(a,c){for(var d=0,e;e=a.P[d];d++)for(var f=0,h;h=e.Na[f];f++)if(h.name==c)return h;return null} +b.et=function(){for(var a=[],c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)f.fn()&&a.push(f.getValue());return a};b.Ig=function(){for(var a=[],c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)f.fn()&&(f=this.v.cf(f.getValue()))&&a.push(f);return a};b.lq=function(a){for(var c=0,d;d=this.P[c];c++)for(var e=0,f;f=d.Na[e];e++)f.fn()&&a.ua()==f.getValue()&&hc(f)};b.Sp=function(a,c){for(var d=0,e;e=this.P[d];d++)for(var f=0,h;h=e.Na[f];f++)h.fn()&&a==h.getValue()&&h.setValue(c)}; +function z(a,c){return(a=B(a,c))?a.getValue():null}function qc(a,c,d){a=B(a,d);if(!a)throw Error('Field "'+d+'" not found.');a.setValue(c)}b.Wf=function(a,c){if(a){void 0===c&&(c=null);if(!this.Y){if(this.L)throw Error("Remove output connection prior to adding previous connection.");this.Y=this.Om(g.Se)}this.Y.Db(c)}else if(this.Y){if(this.Y.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.Y.I();this.Y=null}}; +b.Vf=function(a,c){if(a)void 0===c&&(c=null),this.V||(this.V=this.Om(g.Ra)),this.V.Db(c);else if(this.V){if(this.V.isConnected())throw Error("Must disconnect next statement before removing connection.");this.V.I();this.V=null}}; +b.Ke=function(a,c){if(a){void 0===c&&(c=null);if(!this.L){if(this.Y)throw Error("Remove previous connection prior to adding output connection.");this.L=this.Om(g.Re)}this.L.Db(c)}else if(this.L){if(this.L.isConnected())throw Error("Must disconnect output value before removing connection.");this.L.I();this.L=null}};b.Je=function(a){this.Mg!=a&&(g.i.Ka(new g.i.eg(this,"inline",null,this.Mg,a)),this.Mg=a)}; +function Fb(a){if(void 0!=a.Mg)return a.Mg;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function M(a,c){return a.Bf(g.Ua,c)}function N(a,c){return a.Bf(g.jg,c||"")} +function sc(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.Jg&&(a.Jg=c.style.Jg,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{L(a,e)}catch(F){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.mf(e)}catch(F){console.warn(d+ +"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){for(var f=a,h=c["args"+e]||[],k=c["lastDummyAlign"+e],l=g.g.UG(c["message"+e]),m=[],n=0,q=[],r=0;r=u||u>h.length)throw Error('Block "'+f.type+'": Message index %'+u+" out of range.");if(m[u])throw Error('Block "'+f.type+'": Message index %'+u+" duplicated.");m[u]=!0;n++;q.push(h[u-1])}else(u=u.trim())&&q.push(u)}if(n!=h.length)throw Error('Block "'+f.type+'": Message does not reference all '+ +h.length+" arg(s).");q.length&&("string"==typeof q[q.length-1]||g.g.ab.startsWith(q[q.length-1].type,"field_"))&&(r={type:"input_dummy"},k&&(r.align=k),q.push(r));k={LEFT:g.uq,RIGHT:g.Ln,CENTRE:g.iv};h=[];for(r=0;r=this.P.length)throw RangeError("Input index "+a+" out of bounds.");if(c>this.P.length)throw RangeError("Reference input "+c+" out of bounds.");var d=this.P[a];this.P.splice(a,1);ac?d-1:c},a.Kg)}function zc(a,c,d){var e=a.fb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var h=a.fb[d]||null;if(h&&h.isEnabled()){vc(a,d);break}f++;d=c.call(a,d,e)}}b.WE=function(a){(a=wc(this,a.target))&&a.isEnabled()&&(this.fb[this.Kg]||null)!==a&&(xc(this),this.Vg(a))};b.OE=function(a){var c=wc(this,a.target),d;if(d=c)c.isEnabled()&&(c.Vg(!0),Bc(c)),d=void 0;d&&a.preventDefault()}; +b.TE=function(){this.focus()};b.VE=function(){this.ta()&&(this.blur(),xc(this),vc(this,-1))};b.ft=function(a){return 0!=this.fb.length&&Cc(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};function Cc(a,c){var d=a.fb[a.Kg]||null;if(d&&"function"==typeof d.ft&&d.ft(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case g.g.Ia.Fq:d&&Bc(d);break;case g.g.Ia.zo:Ac(a);break;case g.g.Ia.$n:yc(a);break;default:return!1}return!0};g.mo=function(a,c){g.vc.call(this);this.Ze=a;this.setValue(c);this.Xo=!0};g.g.object.T(g.mo,g.vc);b=g.mo.prototype; +b.Ga=function(){var a=document.createElement("div");a.id=this.ua();this.cb=a;a.className="goog-menuitem goog-option "+(this.Xo?"":"goog-menuitem-disabled ")+(this.$r?"goog-option-selected ":"")+(this.Nk()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.Sl){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Dc(this));g.g.U.Xf(a,this.Bu||(this.Sl?g.g.U.ti.aC: +g.g.U.ti.$B));g.g.U.Eb(a,g.g.U.State.El,this.Sl&&this.$r||!1)};function Dc(a){a=a.Ze;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.kb=a};b.getValue=function(){return this.kb};b.Xf=function(a){this.Bu=a};function Ec(a,c){if(a.Sl){a.$r=c;var d=a.ta();d&&a.isEnabled()&&(c?(g.g.o.qb(d,"goog-option-selected"),g.g.U.Eb(d,g.g.U.State.El,!0)):(g.g.o.fc(d,"goog-option-selected"),g.g.U.Eb(d,g.g.U.State.El,!1)))}} +b.Vg=function(a){var c=this.ta();c&&this.isEnabled()&&(a?g.g.o.qb(c,"goog-menuitem-highlight"):g.g.o.fc(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.Xo};b.Kc=function(a){this.Xo=a;(a=this.ta())&&(this.Xo?g.g.o.fc(a,"goog-menuitem-disabled"):g.g.o.qb(a,"goog-menuitem-disabled"))};function Bc(a){a.Sl&&Ec(a,!a.$r);a.Cw&&a.Cw.call(a.VC,a)}function Fc(a,c,d){a.Cw=c;a.VC=d};g.g.jq={};g.g.jq.Hg=function(a){a=a.ta();var c=g.g.style.Hg(a);c.height=a.scrollHeight;return c};g.g.jq.WC=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};g.Ba={};g.Ba.Po=null;g.Ba.Kx=null;g.Ba.show=function(a,c,d){g.$.show(g.Ba,d,null);if(c.length){var e=g.Ba.oG(c,d);g.Ba.ed(e,a,d);setTimeout(function(){e.ta().focus()},1);g.Ba.Po=null}else g.Ba.ya()};g.Ba.oG=function(a,c){var d=new g.mi;bb(d,c);for(var e=0,f;f=a[e];e++){var h=new g.mo(f.text);bb(h,c);d.Ol(h,d.fb.length,!0);h.Kc(f.enabled);f.enabled&&Fc(h,function(){g.Ba.ya();this.tb()},f)}return d}; +g.Ba.ed=function(a,c,d){var e=g.g.KE();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};g.Ba.ID(a);var f=g.g.jq.Hg(a);d&&g.g.jq.WC(e,c,f);g.$.pG(e,c,f,d);a.ta().focus()};g.Ba.ID=function(a){a.za(g.$.Ca);var c=a.ta();g.g.o.qb(c,"blocklyContextMenu");g.ka(c,"contextmenu",null,g.g.OF);a.focus()};g.Ba.ya=function(){g.$.ym(g.Ba);g.Ba.Po=null;g.Ba.Kx&&g.Xa(g.Ba.Kx)}; +g.Ba.Eo=function(a,c){return function(){g.i.disable();try{var d=g.O.Oi(c,a.v),e=a.Oa();e.x=a.G?e.x-g.md:e.x+g.md;e.y+=2*g.md;d.moveBy(e.x,e.y)}finally{g.i.enable()}g.i.isEnabled()&&!d.$a&&g.i.Ka(new g.i.Rn(d));d.select()}};g.Ba.dD=function(a){var c=p(a,!1).length,d=t(a);d&&(c-=p(d,!1).length);return{text:1==c?g.h.DELETE_BLOCK:g.h.DELETE_X_BLOCKS.replace("%1",String(c)),enabled:!0,tb:function(){g.i.Z(!0);a.I(!0,!0);g.i.Z(!1)}}}; +g.Ba.fD=function(a){return{enabled:!("function"==typeof a.Ec?!a.Ec():!a.Ec),text:g.h.HELP,tb:function(){var c="function"==typeof a.Ec?a.Ec():a.Ec;c&&window.open(c)}}};g.Ba.eD=function(a){var c=za(a.v)?ya(a.v,g.g.Ss(a,!0)):!0;return{text:g.h.DUPLICATE_BLOCK,enabled:c,tb:function(){g.Gx(a)}}};g.Ba.cD=function(a){var c={enabled:!g.g.userAgent.lg};a.qk?(c.text=g.h.REMOVE_COMMENT,c.tb=function(){a.Wh(null)}):(c.text=g.h.ADD_COMMENT,c.tb=function(){a.Wh("")});return c}; +g.Ba.qL=function(a){return{text:g.h.uK,enabled:!0,tb:function(){g.i.Z(!0);a.I(!0,!0);g.i.Z(!1)}}};g.Ba.rL=function(a){return{text:g.h.aI,enabled:!0,tb:function(){g.Gx(a)}}}; +g.Ba.aM=function(a,c){if(!g.jk)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!g.g.userAgent.lg};d.text=g.h.kH;d.tb=function(){var e=new g.jk(a,g.h.jL,g.jk.eB,g.jk.eB),f=aa(a).getBoundingClientRect();f=new g.g.S(c.clientX-f.left,c.clientY-f.top);var h=g.g.tm(a.bb);f=g.g.S.hm(f,h);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ca&&(e.Ce(),e.za(),e.select())};return d};g.ng=function(a,c){g.ng.w.constructor.call(this,a,c);this.Gf=a.v.No[c];this.nx=a.v.No[g.dk[c]];this.oj=new g.g.S(0,0);this.Ch=!1;this.Iy=!this.Gf};g.g.object.T(g.ng,g.ra);b=g.ng.prototype;b.I=function(){g.ng.w.I.call(this);this.Ch&&Gc(this.Gf,this)};function Hc(a,c){var d=a.Sb-c.Sb;a=a.Ya-c.Ya;return Math.sqrt(d*d+a*a)} +function Za(a,c){if(!a.B.v.dc()){var d=G(a.B);if(!d.Wb){var e=!1;if(!d.Fc()){d=G(c.B);if(!d.Fc())return;c=a;e=!0}var f=g.selected==d;f||d.Ao();var h=c.Sb+g.md+Math.floor(Math.random()*g.yq)-a.Sb,k=c.Ya+g.md+Math.floor(Math.random()*g.yq)-a.Ya;e&&(k=-k);d.G&&(h=c.Sb-g.md-Math.floor(Math.random()*g.yq)-a.Sb);d.moveBy(h,k);f||d.gn()}}}b.moveTo=function(a,c){this.Ch&&Gc(this.Gf,this);this.Sb=a;this.Ya=c;this.Iy||Ic(this.Gf,this)};b.moveBy=function(a,c){this.moveTo(this.Sb+a,this.Ya+c)}; +function Jc(a,c){a.moveTo(c.x+a.oj.x,c.y+a.oj.y)}function Kc(a,c,d){a.oj.x=c;a.oj.y=d}function Lc(a){var c=a.ga.Sb-a.Sb,d=a.ga.Ya-a.Ya;if(0!=c||0!=d){a=C(a);var e=a.wa();if(!e)throw Error("block is not rendered.");e=g.g.ze(e);a.wa().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Qb(a,-c,-d)}} +b.closest=function(a,c){var d=this.nx;if(d.ac.length){var e=this.Ya,f=this.Sb;this.Sb=f+c.x;this.Ya=e+c.y;var h=Mc(d,this);c=null;for(var k=a,l,m=h-1;0<=m&&Math.abs(d.ac[m].Ya-this.Ya)<=a;)l=d.ac[m],this.vp(l,k)&&(c=l,k=Hc(l,this)),m--;for(;hc?!1:g.ng.w.vp.call(this,a)};b.Jp=function(a){Za(this,a)};b.ws=function(a,c){g.ng.w.ws.call(this,a,c);a.ca&&a.za();c.ca&&(Bb(c),c.za())}; +b.yu=function(){var a=this.B,c=this.nf;if(a.v&&c&&g.i.Jc){g.ng.w.yu.call(this);c=C(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Ce();c.za(!1);a.ca&&a.za()}};b.lz=function(a){return Nc(this.nx,this,a)};b.Xe=function(a){g.ng.w.Xe.call(this,a);var c=this.B;a=a.B;c.ca&&Bb(c);a.ca&&Bb(a);c.ca&&a.ca&&(this.type==g.Ra||this.type==g.Se?a.za():c.za())};b.sz=function(){this.isConnected()&&!Eb(this,this.ga)&&(D(H(this)?C(this):this.B),this.B.Hb())};g.va=function(a,c,d){this.H=g.g.o.K("g",{},null);this.H.Bn="";this.rj=a.Sg.cz(this.H);this.yn=this.rj.xn||null;this.Kd=this.rj.Zk||null;this.Bj=this.rj.zn||null;this.Kd.qf=this;this.ca=!1;this.Jn=g.g.$i()&&!!a.Td;g.J.mk(this.Kd);g.va.w.constructor.call(this,a,c,d);this.H.dataset&&(this.H.dataset.id=this.id);this.Sc=null};g.g.object.T(g.va,g.Qn);g.va.prototype.height=0;g.va.prototype.width=0;g.va.prototype.Md=null;g.va.LI=-1;g.va.zq="TEMP_COLLAPSED_WARNING_";g.va.sC=10;g.va.Vq=25;g.va.ih=8; +g.va.og=!1;b=g.va.prototype;b.Ce=function(){if(!this.v.ca)throw TypeError("Workspace is headless.");for(var a=0,c;c=this.P[a];a++)c.aa();c=Lb(this);for(a=0;a=a.ac.length)return-1;for(var e=c.Ya,f=d;0<=f&&a.ac[f].Ya==e;){if(a.ac[f]==c)return f;f--}for(;dc.Ya)e=f;else{d=f;break}}return d}function Gc(a,c){if(!c.Ch)throw Error("Connection not in database.");var d=Tc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Ch=!1;a.ac.splice(d,1)} +function Nc(a,c,d){function e(n){var q=h-f[n].Sb,r=k-f[n].Ya;Math.sqrt(q*q+r*r)<=d&&m.push(f[n]);return r document.");}else a=null;return a};g.Sd=function(a,c){g.Sd.w.constructor.call(this,a,c);this.zp=!1;this.se={};this.cA=this.an=0;this.du=null};g.g.object.T(g.Sd,g.Uj);g.Sd.SC=5;g.Sd.TC=6;b=g.Sd.prototype;b.zs=function(a){g.Sd.w.zs.call(this,a);!this.xp&&g.Touch.Cp(a)&&Vc(this,a)};b.mk=function(a){this.du=g.ka(document,"mousedown",null,this.YE.bind(this),!0);this.Kp=g.ka(document,"mousemove",null,this.wm.bind(this),!0);this.Lp=g.ka(document,"mouseup",null,this.mp.bind(this),!0);a.preventDefault();a.stopPropagation()}; +b.YE=function(a){!this.dc()&&g.Touch.Cp(a)&&(Vc(this,a),this.zp&&g.Kh())};b.wm=function(a){if(this.dc())g.Touch.Mu(a)&&g.Sd.w.wm.call(this,a);else if(this.zp){if(g.Touch.Cp(a)){this.se[g.Touch.lp(a)]=Wc(this,a);var c=Object.keys(this.se);if(2==c.length){c=g.g.S.Bx(this.se[c[0]],this.se[c[1]])/this.cA;if(0this.an){var d=c-this.an;d=0Object.keys(this.se).length&&(this.se={},this.an=0)}!this.zp||this.dc()?g.Touch.Mu(a)&&g.Sd.w.mp.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){g.Sd.w.I.call(this);this.du&&g.Xa(this.du)};function Vc(a,c){a.se[g.Touch.lp(c)]=Wc(a,c);var d=Object.keys(a.se);2==d.length&&(a.cA=g.g.S.Bx(a.se[d[0]],a.se[d[1]]),a.zp=!0,c.preventDefault())} +function Wc(a,c){return a.qc?new g.g.S(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};g.xw=function(a){this.ju=a;this.Fl=Object.create(null)};b=g.xw.prototype;b.At=null;b.I=function(){this.Fl=this.ju=null};b.load=function(a,c){if(a.length){try{var d=new g.g.global.Audio}catch(l){return}for(var e,f=0;f=xa(a)))if(a.Bc&&a.Bc.cancel(),"comment"==c.tagName.toLowerCase()){g.i.disable();try{var d=g.jk.pm(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{g.i.enable()}d.select()}else a:{g.i.disable();try{var h=g.O.Oi(c,a),k=a.Xb.Ob;if(g.De&&k){g.navigation.Ny(h,k.qa);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=y(a,!1);d=0;for(var q;q=n[d];d++){var r=q.Oa();if(1>=Math.abs(l-r.x)&&1>=Math.abs(m-r.y)){c=!0;break}}if(!c){var u=h.xe(!1);d=0;for(var F;F=u[d];d++)if(F.closest(g.md,new g.g.S(l,m)).connection){c=!0;break}}c&&(l=a.G?l-g.md:l+g.md,m+=2*g.md)}while(c);h.moveBy(l,m)}}finally{g.i.enable()}g.i.isEnabled()&&!h.$a&&g.i.Ka(new g.i.Rn(h));h.select()}} +function dd(a){if((a=a.$d?a.Dj:a)&&!a.Bc&&a.oa&&a.oa.M){a=a.oa;var c=a.ud.Id;c&&c.Cf&&a.M.show(c.Cf)}}b.Uh=function(a,c){g.gb.w.Uh.call(this,a,c);dd(this)};b.Hf=function(a){g.gb.w.Hf.call(this,a);dd(this)};b.Cd=function(a,c,d){a=g.gb.w.Cd.call(this,a,c,d);dd(this);return a};function Yc(a){a.sx=a.Xc&&a.H.parentNode?a.Xc.rm():null;a.qx=a.M?a.M.rm():a.oa?a.oa.rm():null}function Nb(a,c){return a.sx&&a.sx.contains(c.clientX,c.clientY)?g.Dq:a.qx&&a.qx.contains(c.clientX,c.clientY)?g.Bv:g.Av} +b.Oh=function(a){var c=this.Gg(a);c&&ac(c,a,this)};b.Qu=function(a,c){a=g.g.Um(a,v(this),pa(this));a.x/=this.scale;a.y/=this.scale;this.Fx=g.g.S.hm(c,a)};b.dc=function(){return null!=this.Bc&&this.Bc.dc()};function ed(a){return a.options.Hc&&a.options.Hc.scrollbars||a.options.Hc&&a.options.Hc.Lj||a.options.Hc&&a.options.Hc.vh||a.options.wb&&a.options.wb.controls||a.options.wb&&a.options.wb.Lj} +b.Fc=function(){return this.options.Hc&&this.options.Hc.scrollbars||this.options.Hc&&this.options.Hc.Lj||this.options.Hc&&this.options.Hc.vh||this.options.wb&&this.options.wb.Lj}; +b.kG=function(a){if(g.Uj.nt())a.preventDefault(),a.stopPropagation();else{var c=this.options.wb&&this.options.wb.Lj,d=this.options.Hc&&this.options.Hc.Lj;if(c||d){var e=g.g.ky(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=g.g.Um(a,v(this),pa(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}}; +function Ab(a){var c=A(a,!1);a=wa(a,!1);c=c.concat(a);if(!c.length)return new g.g.Rect(0,0,0,0);a=Qc(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.tD=function(){this.Lc(!1);g.i.Z(!0);for(var a=A(this,!0),c=0,d=0,e;e=a[d];d++)if(e.Fc()){var f=e.Oa();e.moveBy(-f.x,c-f.y);Pc(e);c=e.Oa().y+J(e).height+g.va.Vq}g.i.Z(!1);this.Lc(!0)}; +b.pn=function(a){function c(F){if(F.Zd())u=u.concat(p(F,!1));else{F=F.xh(!1);for(var X=0;Xu.length?d():g.confirm(g.h.DELETE_ALL_BLOCKS.replace("%1",u.length),function(F){F&&d()})}};e.push(l);this.Xw&&this.Xw(e);g.Ba.show(a,e,this.G)}}; +function fd(a){var c=I;if(a=g.Rd.Cz(a)){if(!c.options.Of)throw Error("Existing toolbox is null. Can't create new toolbox.");if(a.getElementsByTagName("category").length){if(!c.oa)throw Error("Existing toolbox has no categories. Can't change mode.");c.options.Of=a;vb(c.oa,a)}else{if(!c.M)throw Error("Existing toolbox has categories. Can't change mode.");c.options.Of=a;c.M.show(a.childNodes)}}else if(c.options.Of)throw Error("Can't nullify an existing toolbox.");} +function oa(a){if(a.options.Kb)oa(a.options.Kb);else{g.Nm=a;document.activeElement&&document.activeElement.blur();try{v(a).focus()}catch(c){try{v(a).parentNode.setActive()}catch(d){v(a).parentNode.focus()}}}} +b.zoom=function(a,c,d){if(!this.$d&&!this.ej){d=Math.pow(this.options.wb.zG,d);var e=this.scale*d;if(this.scale!=e){e>this.options.wb.Qm?d=this.options.wb.Qm/this.scale:ethis.options.wb.Qm?a=this.options.wb.Qm:this.options.wb.Sm&&af?g.$.Zm(a,0,d.height+f):g.$.Zm(a,f,d.height)};g.$.jD=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)}; +g.$.kD=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};g.sg=function(a){a.bc=this.um.bind(this);a.Xh=this.Zz.bind(this);g.sg.w.constructor.call(this,a);this.ef=!1};g.g.object.T(g.sg,g.tl);b=g.sg.prototype;b.um=function(){if(!this.isVisible())return null;try{var a=this.s.bb.getBBox()}catch(f){a={height:0,y:0,width:0,x:0}}var c=this.nr,d=this.Uc-2*this.nr,e=this.ob;this.G||(e-=this.nr);return{rb:d,lb:e,Bd:a.height*this.s.scale+2*this.Qe,Ye:a.width*this.s.scale+2*this.Qe,hc:-this.s.scrollY+a.y,Zb:-this.s.scrollX,kc:a.y,Ac:a.x,xc:c,jc:0}}; +b.Zz=function(a){var c=this.um();c&&("number"==typeof a.y&&(this.s.scrollY=-c.Bd*a.y),this.s.translate(this.s.scrollX+c.jc,this.s.scrollY+c.xc))}; +b.position=function(){if(this.isVisible()){var a=this.jb.bc();if(a){this.Uc=a.rb;var c=this.ob-this.sb,d=a.rb-2*this.sb,e=this.bl==g.pg,f=c+this.sb;f=["M "+(e?f:0)+",0"];f.push("h",e?-c:c);f.push("a",this.sb,this.sb,0,0,e?0:1,e?-this.sb:this.sb,this.sb);f.push("v",Math.max(0,d));f.push("a",this.sb,this.sb,0,0,e?0:1,e?this.sb:-this.sb,this.sb);f.push("h",e?c:-c);f.push("z");this.Mc.setAttribute("d",f.join(" "));c=this.Uc;a=this.jb.Da==this.bl?a.jA?this.bl==g.zd?a.jA:a.lb-this.ob:this.bl==g.zd?0:a.lb: +this.bl==g.zd?0:a.lb+a.jc-this.ob;this.H.setAttribute("width",this.ob);this.H.setAttribute("height",c);"svg"==this.H.tagName?g.g.o.ln(this.H,"translate("+a+"px,0px)"):this.H.setAttribute("transform","translate("+a+",0)");this.pc&&(this.pc.fu=new g.g.S(a,0),this.pc.resize(),ha(this.pc,this.pc.ed.x,this.pc.ed.y))}}};b.eH=function(a){var c=g.g.ky(a);if(c.y){var d=this.um();c=d.hc-d.kc+c.y;c=Math.min(c,d.Bd-d.rb);c=Math.max(c,0);this.pc.set(c);g.$.ya()}a.preventDefault();a.stopPropagation()}; +function jd(a,c,d){a.s.scale=a.jb.scale;for(var e=a.Qe,f=a.G?e:e+a.al,h=0,k;k=c[h];h++)if("block"==k.type){k=k.block;for(var l=p(k,!1),m=0,n;n=l[m];m++)n.Wb=!0;k.za();n=k.wa();l=J(k);m=k.L?f-a.al:f;k.moveBy(m,e);var q=a,r=k,u=h;m=g.g.o.K("rect",{"fill-opacity":0,x:a.G?m-l.width:m,y:e,height:l.height,width:l.width},null);m.qf=r;g.J.mk(m);q.s.bb.insertBefore(m,r.wa());r.Px=m;q.Fp[u]=m;q=a;q.sd.push(g.ka(n,"mousedown",null,kd(q,k)));q.sd.push(g.ka(m,"mousedown",null,kd(q,k)));q.sd.push(g.yc(n,"mouseover", +k,k.Ao));q.sd.push(g.yc(n,"mouseout",k,k.gn));q.sd.push(g.yc(m,"mouseover",k,k.Ao));q.sd.push(g.yc(m,"mouseout",k,k.gn));e+=l.height+d[h]}else"button"==k.type&&(l=a,m=k.button,n=f,q=e,r=m.Ga(),m.moveTo(n,q),m.show(),l.sd.push(g.ka(r,"mousedown",l,l.Oh)),l.Rl.push(m),e+=k.button.height+d[h])} +b.rm=function(){if(!this.H)return null;var a=this.H.getBoundingClientRect(),c=a.left;if(this.bl==g.zd)return new g.g.Rect(-1E9,1E9,-1E9,c+a.width);g.g.userAgent.Jq&&this.jb&&this.jb.ej&&(a=this.jb.H.getBoundingClientRect().x,10>Math.abs(a-c)&&(c+=this.JL*this.jb.options.Kb.scale));return new g.g.Rect(-1E9,1E9,c,1E9)}; +g.Fr=function(a){this.s=a};b=g.Fr.prototype;b.Bi=32;b.Gv=110;b.Sq=20;b.yl=20;b.H=null;b.Lm=0;b.dl=0;b.Ga=function(){this.H=g.g.o.K("g",{},null);var a=String(Math.random()).substring(2);ld(this,a);md(this,a);this.s.Fc()&&nd(this,a);return this.H};b.aa=function(a){this.Zg=this.Sq+a;return this.Zg+this.Gv};b.I=function(){this.H&&g.g.o.removeNode(this.H)}; +b.position=function(){if(this.Zg){var a=this.s.bc();a&&(this.Lm=a.Da==g.zd||this.s.Ed&&!this.s.G?a.lb+a.jc-this.Bi-this.yl-g.Ja.oc:this.yl+g.Ja.oc,a.Da==g.xi?(this.dl=this.Zg,this.oq.setAttribute("transform","translate(0, 34)"),this.pq&&this.pq.setAttribute("transform","translate(0, 77)")):(this.dl=a.rb+a.xc-this.Gv-this.Zg,this.oq.setAttribute("transform","translate(0, 43)"),this.dv.setAttribute("transform","translate(0, 77)")),this.H.setAttribute("transform","translate("+this.Lm+","+this.dl+")"))}}; +function ld(a,c){var d=a.s;a.dv=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoomoutClipPath"+c},a.dv);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.nd.width,height:g.nd.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+c+")"},a.dv);a.setAttributeNS(g.g.o.Ue,"xlink:href",d.options.lf+g.nd.url);g.ka(a,"mousedown",null,function(f){oa(d);gd(d,-1);g.Touch.nh();f.stopPropagation();f.preventDefault()})} +function md(a,c){var d=a.s;a.oq=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoominClipPath"+c},a.oq);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.nd.width,height:g.nd.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+c+")"},a.oq);a.setAttributeNS(g.g.o.Ue,"xlink:href",d.options.lf+g.nd.url);g.ka(a,"mousedown",null,function(f){oa(d);gd(d,1);g.Touch.nh();f.stopPropagation();f.preventDefault()})} +function nd(a,c){var d=a.s;a.pq=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoomresetClipPath"+c},a.pq);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.nd.width,height:g.nd.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+c+")"},a.pq);a.setAttributeNS(g.g.o.Ue,"xlink:href",d.options.lf+g.nd.url);g.ka(a,"mousedown",null,function(f){oa(d);d.setScale(d.options.wb.eA);g.g.o.qb(d.bb,"blocklyCanvasTransitioning");g.g.o.qb(d.pf,"blocklyCanvasTransitioning"); +if(d.Fc()){var h=d.bc(),k=(h.Ye-h.lb)/2,l=(h.Bd-h.rb)/2;k=-k-h.Ac;l=-l-h.kc;d.scroll(k,l)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.");setTimeout(d.hE.bind(d),500);g.Touch.nh();f.stopPropagation();f.preventDefault()})} +g.hd.register([".blocklyZoom>image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);g.uv=function(a){this.Yl=a;this.Ga()};b=g.uv.prototype;b.Sa=null;b.$e=null;b.Yl=null;b.Vh=1;b.vn=null;b.Ga=function(){this.Sa||(this.Sa=g.g.o.K("svg",{xmlns:g.g.o.Hl,"xmlns:html":g.g.o.Vj,"xmlns:xlink":g.g.o.Ue,version:"1.1","class":"blocklyBlockDragSurface"},this.Yl),this.$e=g.g.o.K("g",{},this.Sa))};function Ub(a,c){if(a.$e.childNodes.length)throw Error("Already dragging a block.");a.$e.appendChild(c);a.Sa.style.display="block";a.vn=new g.g.S(0,0)} +b.Gj=function(a,c){this.vn=new g.g.S(a*this.Vh,c*this.Vh);a=this.vn.x;c=this.vn.y;a=a.toFixed(0);c=c.toFixed(0);this.Sa.style.display="block";g.g.o.ln(this.Sa,"translate3d("+a+"px, "+c+"px, 0px)")};b.at=function(){var a=g.g.ze(this.Sa);return new g.g.S(a.x/this.Vh,a.y/this.Vh)};b.Ub=function(){return this.$e}; +b.Ho=function(a){a?a.appendChild(this.$e.firstChild):this.$e.removeChild(this.$e.firstChild);this.Sa.style.display="none";if(this.$e.childNodes.length)throw Error("Drag group was not cleared.");this.vn=null}; +g.D=function(){};g.D.je=null;g.D.Ur=null;g.D.dd=null;g.D.Pp=null;g.D.Mn=16;g.D.tv=1;g.D.nv=12;g.D.$v=16;g.D.wq=.25;g.D.yv="#dadce0";g.D.zv="#fff";g.D.Jr=null;g.D.pj=null; +g.D.Ga=function(){if(!g.D.je){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=g.D.zv;a.style.borderColor=g.D.yv;document.body.appendChild(a);g.D.je=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);g.D.Ze=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);g.D.Ve=c;g.D.je.style.opacity=0;g.D.je.style.transition="transform "+g.D.wq+"s, opacity "+g.D.wq+"s";a.addEventListener("focusin", +function(){g.g.o.qb(a,"focused")});a.addEventListener("focusout",function(){g.g.o.fc(a,"focused")})}};g.D.Vz=function(a){g.D.Ur=a};g.D.Yx=function(){return g.D.Ze};g.D.uD=function(){g.D.Ze.innerHTML="";g.D.Ze.style.width=""};g.D.mf=function(a,c){g.D.je.style.backgroundColor=a;g.D.je.style.borderColor=c};g.D.SL=function(a){g.D.je.setAttribute("data-category",a)}; +g.D.UL=function(a,c,d,e){var f=c.v.scale,h=c.width,k=c.height;h*=f;k*=f;f=c.wa().getBoundingClientRect();h=f.left+h/2;k=f.top+k;f=f.top;e&&(f+=e);g.D.Vz(v(c.v).parentNode);return g.D.show(a,c.G,h,k,h,f,d)};g.D.aA=function(a,c){var d=a.wa().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var h=a.B;g.D.Pp=!0;g.D.Vz(v(h.v).parentNode);g.D.show(a,h.G,e,f,e,d,c)}; +g.D.show=function(a,c,d,e,f,h,k){g.D.dd=a;g.D.pj=k||null;a=g.D.jy(d,e,f,h);a.Mr?(g.D.Ve.style.display="",g.D.Ve.style.transform="translate("+a.Pl+"px,"+a.Fw+"px) rotate(45deg)",g.D.Ve.setAttribute("class",a.Lr?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):g.D.Ve.style.display="none";g.D.je.style.direction=c?"rtl":"ltr";g.D.Zm(a.rp,a.sp,a.Zo,a.$o);return a.Lr}; +g.D.vE=function(){var a=g.D.Ur.getBoundingClientRect(),c=g.g.style.Hg(g.D.Ur);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};g.D.jy=function(a,c,d,e){var f=g.D.vE(),h=g.g.style.Hg(g.D.je);return c+h.heightf.top?g.D.gy(d,e,f,h):c+h.heightdocument.documentElement.clientTop?g.D.gy(d,e,f,h):g.D.IE(a,f,h)}; +g.D.iy=function(a,c,d,e){a=g.D.Zs(a,d.left,d.right,e.width);return{rp:a.xk,sp:c,Zo:a.xk,$o:c+g.D.$v,Pl:a.Pl,Fw:-(g.D.Mn/2+g.D.tv),Lr:!0,Mr:!0}};g.D.gy=function(a,c,d,e){a=g.D.Zs(a,d.left,d.right,e.width);return{rp:a.xk,sp:c-e.height,Zo:a.xk,$o:c-e.height-g.D.$v,Pl:a.Pl,Fw:e.height-2*g.D.tv-g.D.Mn/2,Lr:!1,Mr:!0}};g.D.IE=function(a,c,d){a=g.D.Zs(a,c.left,c.right,d.width);return{rp:a.xk,sp:0,Zo:a.xk,$o:0,Mr:!1}}; +g.D.Zs=function(a,c,d,e){var f=a;a=g.g.td.Gi(c,a-e/2,d-e);f-=g.D.Mn/2;c=g.g.td.Gi(g.D.nv,f-a,e-g.D.nv-g.D.Mn);return{Pl:c,xk:a}};g.D.isVisible=function(){return!!g.D.dd};g.D.ym=function(a,c){g.D.dd===a&&(c?g.D.Ui():g.D.ya())};g.D.ya=function(){var a=g.D.je;a.style.transform="translate(0, 0)";a.style.opacity=0;g.D.Jr=setTimeout(function(){g.D.Ui()},1E3*g.D.wq);g.D.pj&&(g.D.pj(),g.D.pj=null)}; +g.D.Ui=function(){if(g.D.isVisible()){g.D.Jr&&clearTimeout(g.D.Jr);var a=g.D.je;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=g.D.zv;a.style.borderColor=g.D.yv;g.D.pj&&(g.D.pj(),g.D.pj=null);g.D.uD();g.D.dd=null}}; +g.D.Zm=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=g.D.je;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)"}; +g.D.NL=function(){if(g.D.dd){var a=g.D.dd.B,c=a.v.scale,d=g.D.Pp?g.D.dd.Lb.width:a.width,e=g.D.Pp?g.D.dd.Lb.height:a.height;d*=c;e*=c;a=g.D.Pp?g.D.dd.we.getBoundingClientRect():a.wa().getBoundingClientRect();d=a.left+d/2;e=g.D.jy(d,a.top+e,d,a.top);g.D.Zm(e.rp,e.sp,e.Zo,e.$o)}else g.D.ya()};g.Dh=function(a,c){g.oD();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!g.g.o.containsNode(document,a))throw Error("Error: container is not in current document.");c=new g.Rd(c||{});var d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);a=g.$l(d,c);var e=new g.uv(d);d=new g.yw(d);d=g.FD(a,c,e,d);g.mb.ib.EG(c.ib);g.jF(d);g.Nm=d;g.$k(d);return d}; +g.$l=function(a,c){a.setAttribute("dir","LTR");g.vc.px=c.G;g.hd.Dh(c.ZE,c.lf);a=g.g.o.K("svg",{xmlns:g.g.o.Hl,"xmlns:html":g.g.o.Vj,"xmlns:xlink":g.g.o.Ue,version:"1.1","class":"blocklySvg"},a);var d=g.g.o.K("defs",{},a),e=String(Math.random()).substring(2),f=g.g.o.K("filter",{id:"blocklyEmbossFilter"+e},d);g.g.o.K("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var h=g.g.o.K("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white", +result:"specOut"},f);g.g.o.K("fePointLight",{x:-5E3,y:-1E4,z:2E4},h);g.g.o.K("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);g.g.o.K("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);c.Ix=f.id;f=g.g.o.K("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);g.g.o.K("rect",{width:10,height:10,fill:"#aaa"},f);g.g.o.K("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);c.Cg=f.id; +c.xy=g.li.Ga(e,c.wy,d);return a}; +g.FD=function(a,c,d,e){c.Kb=null;var f=new g.gb(c,d,e);f.scale=c.wb.eA;a.appendChild(f.Ga("blocklyMainBackground"));!c.Ay&&c.Of&&(d=ad(f,"svg"),g.g.o.Zi(d,a));c.Ey&&Zc(f);c.wb&&c.wb.controls&&$c(f);f.Rb.subscribe(a,"workspace","background-color");f.translate(0,0);g.Nm=f;c.readOnly||f.Fc()||Aa(f,function(h){if(!f.dc()&&!f.Fc()&&-1!=g.i.LA.indexOf(h.type)){var k=Object.create(null),l=f.bc(),m=f.scale;k.G=f.G;k.Zb=l.Zb/m;k.hc=l.hc/m;k.qA=(l.Zb+l.lb)/m;k.pA=(l.hc+l.rb)/m;ed(f)?(l=Ab(f),k.Ac=l.left,k.kc= +l.top,k.ex=l.right,k.ax=l.bottom):(k.Ac=l.Ac/m,k.kc=l.kc/m,k.ex=(l.Ac+l.Ye)/m,k.ax=(l.kc+l.Bd)/m);if(k.kck.pA||k.Ack.qA){l=null;h&&(l=g.i.Ub(),g.i.Z(h.group));switch(h.type){case g.i.kl:case g.i.pv:var n=x(f,h.zc);n=G(n);break;case g.i.Tn:case g.i.Un:n=f.Lo[h.Ef]||null}if(n){m=Qc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var q=k.hc,r=k.pA-m.height;r=Math.max(q,r);q=g.g.td.Gi(q,m.top,r)-m.top;r=k.Zb;var u=k.qA-m.width;k.G?r=Math.min(u,r):u=Math.max(r,u);n.moveBy(g.g.td.Gi(r, +m.left,u)-m.left,q)}h&&(h.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&g.i.Z(l))}}});g.$k(f);g.$.Ga();g.D.Ga();g.J.Ga();return f}; +g.jF=function(a){var c=a.options,d=v(a);g.ka(d.parentNode,"contextmenu",null,function(e){g.g.Ap(e)||e.preventDefault()});d=g.ka(window,"resize",null,function(){g.mc(!0);g.$k(a)});a.Wp=d;g.Dh.bD();c.Of&&(a.oa?a.oa.aa(a):a.M&&(a.M.aa(a),a.M.show(c.Of.childNodes),a.M.pc.set(0)));d=g.Ja.oc;c.Ey&&(d=a.Xc.aa(d));c.wb&&c.wb.controls&&a.Nj.aa(d);c.Hc&&c.Hc.scrollbars?(a.Pb=new g.hk(a),a.Pb.resize()):a.Xh({x:.5,y:.5});c.aF&&g.Dh.uF(c.lf,a)}; +g.Dh.bD=function(){g.bE||(g.ka(document,"scroll",null,function(){for(var a=g.Fb.getAll(),c=0,d;d=a[c];c++)d.Fn&&d.Fn()}),g.ka(document,"keydown",null,g.ZF),g.yc(document,"touchend",null,g.Kh),g.yc(document,"touchcancel",null,g.Kh),g.g.userAgent.Wj&&g.ka(window,"orientationchange",document,function(){g.$k(g.ub())}));g.bE=!0}; +g.Dh.uF=function(a,c){function d(){for(;f.length;)g.Xa(f.pop());e.preload()}var e=c.kh;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(g.ka(document,"mousemove",null,d,!0));f.push(g.ka(document,"touchstart",null,d,!0))};g.Qd=function(a,c){this.oA=c||"";this.Pz=Object.create(null);if(a)for(a=a.split(","),c=0;c1'), +e.appendChild(d),c.push(e));if(g.W.variables_get){a.sort(g.Kl.Ww);d=0;for(var f;f=a[d];d++)e=g.g.xml.createElement("block"),e.setAttribute("type","variables_get"),e.setAttribute("gap",8),e.appendChild(g.N.qm(f)),c.push(e)}}return c}; +g.N.Vx=function(a){a=a.Fg();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var h=!1,k=0;kk[0]?1:h[0]=a.options.length&&(a.style.display= +"none")}for(d=1;10>=d;d++)a=document.getElementById("level"+d),c=!!Ad(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(Bd,1)}function Ad(a){var c=Cd;try{var d=window.localStorage[c+a]}catch(e){}return d}function P(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 Dd(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 Bd(){if(!ud){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")}};g.g.A={};g.g.A.Ta=function(a,c){return" "+a+","+c+" "};g.g.A.curve=function(a,c){return" "+a+c.join("")};g.g.A.moveTo=function(a,c){return" M "+a+","+c+" "};g.g.A.moveBy=function(a,c){return" m "+a+","+c+" "};g.g.A.lineTo=function(a,c){return" l "+a+","+c+" "};g.g.A.line=function(a){return" l"+a.join("")};g.g.A.ba=function(a,c){return" "+a+" "+c+" "};g.g.A.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};g.j.ii=function(){this.wf=0;this.vC=3;this.vf=5;this.Uv=8;this.ld=10;this.ow=this.vf;this.wr=15;this.Il=5;this.ih=8;this.gC=15;this.fC=4;this.cC=12;this.jB=16;this.sb=8;this.no=15;this.AC=0;this.BC=20;this.IA=4;this.yC=15;this.zC=100;this.xC=15;this.Uq=24;this.lB=14.5;this.kB=this.wr+11;this.nB=2;this.mB=this.Uq;this.kw=g.g.A.moveBy(0,0);this.HB=12;this.IB=6};b=g.j.ii.prototype; +b.aa=function(){this.Zj=this.Ht();this.bk=this.It();this.og=this.Kt();this.ri=this.Jt();var a=this.sb,c=g.g.A.arc("a","0 0,0",a,g.g.A.Ta(-a,a)),d=g.g.A.arc("a","0 0,0",a,g.g.A.Ta(a,a));this.wl={width:a,height:a,ku:c,Mp:d};c=this.sb;a=g.g.A.moveBy(0,c)+g.g.A.arc("a","0 0,1",c,g.g.A.Ta(c,-c));c=g.g.A.arc("a","0 0,1",c,g.g.A.Ta(-c,-c));this.Zv={Yu:a,Tr:c}};b.Ht=function(){var a=this.HB,c=this.IB,d=g.g.A.line([g.g.A.Ta(6,3),g.g.A.Ta(-12,6),g.g.A.Ta(6,3)]);return{height:a,width:c,path:d}}; +b.Kt=function(){var a=this.yC,c=this.zC,d=g.g.A.curve("c",[g.g.A.Ta(30,-a),g.g.A.Ta(70,-a),g.g.A.Ta(c,0)]);return{height:a,width:c,path:d}};b.Jt=function(){function a(h){h=h?-1:1;var k=-h,l=d/2,m=g.g.A.Ta(c,h*l);return g.g.A.curve("c",[g.g.A.Ta(0,h*(l+2.5)),g.g.A.Ta(-c,k*(l+.5)),g.g.A.Ta(-c,h*l)])+g.g.A.curve("s",[g.g.A.Ta(c,2.5*k),m])}var c=this.ih,d=this.wr,e=a(!0),f=a(!1);return{width:c,height:d,He:f,Ym:e}}; +b.It=function(){function a(k){return g.g.A.line([g.g.A.Ta(k*e,d),g.g.A.Ta(3*k,0),g.g.A.Ta(k*e,-d)])}var c=this.gC,d=this.fC,e=(c-3)/2,f=a(1),h=a(-1);return{width:c,height:d,Qh:f,Dz:h}};g.j.u={NONE:0,ke:1,Fv:2,Iv:4,pr:8,ov:16,Mv:32,Ev:64,mg:128,Kv:256,lw:512,VA:1024,er:2048,Wq:4096,kC:8192,Bq:16384,Qq:32768,Pq:65536,kr:131072,jr:262144,Qv:524288,mr:1048576,zr:2097152,xq:4194304,Lv:8388608};g.j.u.TI=g.j.u.Qq|g.j.u.Pq;g.j.u.xK=g.j.u.kr|g.j.u.jr;g.j.u.Wt=16777216;g.j.u.Jb=function(){g.j.u.hasOwnProperty(void 0)||(g.j.u[void 0]=g.j.u.Wt,g.j.u.Wt<<=1);return g.j.u[void 0]};g.j.u.Hm=function(a){return a.type&g.j.u.ke};g.j.u.dj=function(a){return a.type&g.j.u.Fv}; +g.j.u.Kk=function(a){return a.type&g.j.u.Iv};g.j.u.hf=function(a){return a.type&g.j.u.pr};g.j.u.CL=function(a){return a.type&g.j.u.Mv};g.j.u.gf=function(a){return a.type&g.j.u.mg};g.j.u.Gm=function(a){return a.type&g.j.u.Ev};g.j.u.Eh=function(a){return a.type&g.j.u.Kv};g.j.u.Km=function(a){return a.type&g.j.u.lw};g.j.u.Mk=function(a){return a.type&g.j.u.er};g.j.u.Gh=function(a){return a.type&g.j.u.Wq};g.j.u.qF=function(a){return a.type&(g.j.u.er|g.j.u.Wq)};g.j.u.Fh=function(a){return a.type&g.j.u.Pq}; +g.j.u.EL=function(a){return a.type&g.j.u.jr};g.j.u.Jm=function(a){return a.type&g.j.u.Qq};g.j.u.FL=function(a){return a.type&g.j.u.kr};g.j.u.BL=function(a){return a.type&g.j.u.Bq};g.j.u.Sy=function(a){return a.type&g.j.u.Qv};g.j.u.GL=function(a){return a.type&g.j.u.mr};g.j.u.AL=function(a){return a.type&g.j.u.ov};g.j.u.Bp=function(a){return a.type&g.j.u.zr};g.j.u.up=function(a){return a.type&g.j.u.xq};g.j.u.HL=function(a){return a.type&(g.j.u.zr|g.j.u.xq)};g.j.u.DL=function(a){return a.type&g.j.u.Lv};g.j.dh=function(a){this.height=this.width=0;this.type=g.j.u.NONE;this.mh=this.Qa=0;this.C=a;this.Ee=this.C.no};g.j.ra=function(a,c){g.j.ra.w.constructor.call(this,a);this.hs=c;a:switch(a=this.C,c.type){case g.Ua:case g.Re:c=a.ri;break a;case g.Se:case g.Ra:c=a.bk;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=g.j.u.VA};g.g.object.T(g.j.ra,g.j.dh);g.j.cr=function(a,c){g.j.cr.w.constructor.call(this,a,c);this.type|=g.j.u.kC;this.height=this.shape.height;this.width=this.shape.width;this.ue=this.C.Il;this.ce=this.width};g.g.object.T(g.j.cr,g.j.ra); +g.j.gr=function(a,c){g.j.gr.w.constructor.call(this,a,c);this.type|=g.j.u.er;this.height=this.shape.height;this.width=this.shape.width};g.g.object.T(g.j.gr,g.j.ra);g.j.Xq=function(a,c){g.j.Xq.w.constructor.call(this,a,c);this.type|=g.j.u.Wq;this.height=this.shape.height;this.width=this.shape.width};g.g.object.T(g.j.Xq,g.j.ra);g.j.xl=function(a,c){g.j.xl.w.constructor.call(this,a,c.connection);this.type|=g.j.u.mg;this.input=c;this.align=c.align;(this.Hi=c.connection&&C(c.connection)?C(c.connection):null)?(a=J(this.Hi),this.Wl=a.width,this.Mo=a.height):this.Mo=this.Wl=0;this.connection=c.connection;this.ue=0};g.g.object.T(g.j.xl,g.j.ra); +g.j.ah=function(a,c){g.j.ah.w.constructor.call(this,a,c);this.type|=g.j.u.Kv;this.Hi?(this.width=this.Wl,this.height=this.Mo):(this.height=this.C.kB,this.width=this.shape.width+this.C.lB);this.ue=this.C.Il;this.Xl=this.shape.height;this.qh=this.shape.width};g.g.object.T(g.j.ah,g.j.xl);g.j.hh=function(a,c){g.j.hh.w.constructor.call(this,a,c);this.type|=g.j.u.lw;this.height=this.Hi?this.Mo+this.C.AC:this.C.mB;this.width=this.C.no+this.shape.width};g.g.object.T(g.j.hh,g.j.xl); +g.j.bo=function(a,c){g.j.bo.w.constructor.call(this,a,c);this.type|=g.j.u.Ev;this.height=this.Hi?this.Mo-2*this.C.Il:this.shape.height;this.width=this.shape.width+this.C.nB;this.ue=this.C.Il;this.Xl=this.shape.height;this.qh=this.shape.width};g.g.object.T(g.j.bo,g.j.xl);g.j.wd=function(a,c){g.j.wd.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=g.j.u.Iv;a=new g.g.qe(g.wd.prototype.to,g.wd.prototype.to-2);this.height=a.height;this.width=a.width};g.g.object.T(g.j.wd,g.j.dh);g.j.Mq=function(a){g.j.Mq.w.constructor.call(this,a);this.type|=g.j.u.Qv;this.height=this.C.Zj.height;this.width=this.C.Zj.width};g.g.object.T(g.j.Mq,g.j.dh); +g.j.Ha=function(a,c){g.j.Ha.w.constructor.call(this,a);this.Lx=c;this.cd=c.uf&&!!c.B&&c.B.cd();this.oE=c.by();this.type|=g.j.u.ke;a=this.Lx.Hg();this.height=a.height;this.width=a.width};g.g.object.T(g.j.Ha,g.j.dh);g.j.Kq=function(a){g.j.Kq.w.constructor.call(this,a);this.type|=g.j.u.Fv;this.height=this.C.og.height;this.width=this.C.og.width;this.kk=this.height};g.g.object.T(g.j.Kq,g.j.dh); +g.j.wo=function(a,c){g.j.wo.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.j.u.kr:g.j.u.Qq)|g.j.u.Bq;this.width=this.height=this.C.wf};g.g.object.T(g.j.wo,g.j.dh);g.j.so=function(a,c){g.j.so.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.j.u.jr:g.j.u.Pq)|g.j.u.Bq;this.width=this.C.sb;this.height=this.C.sb/2};g.g.object.T(g.j.so,g.j.dh);g.j.Xj=function(a,c){g.j.Xj.w.constructor.call(this,a);this.type=this.type|g.j.u.pr|g.j.u.Mv;this.width=c;this.height=this.C.xC};g.g.object.T(g.j.Xj,g.j.dh);g.j.ui=function(a){this.type=g.j.u.mr;this.elements=[];this.Qa=this.Nc=this.cg=this.minWidth=this.minHeight=this.width=this.height=0;this.Cy=this.np=this.ht=this.qd=this.Si=!1;this.C=a;this.Ee=this.C.no};g.j.ui.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function Ed(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.j.u.gf(d))return d;return null}g.j.ui.prototype.Ru=function(){return!0};g.j.ui.prototype.Jx=function(){return!0}; +function Fd(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.j.u.hf(d))return d;return null}g.j.ik=function(a){g.j.ik.w.constructor.call(this,a);this.type|=g.j.u.zr;this.kk=this.ug=0;this.$E=!1;this.connection=null};g.g.object.T(g.j.ik,g.j.ui);g.j.ik.prototype.jt=function(a){var c=a.Jg?"cap"===a.Jg:g.va.og,d=a.Y&&C(a.Y);return!!a.L||c||(d?t(d)==a:!1)}; +g.j.ik.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.j.u.hf(f)||(g.j.u.dj(f)?d=Math.max(d,f.kk):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.ug=this.kk=d;this.cg=this.width};g.j.ik.prototype.Ru=function(){return!1};g.j.Oj=function(a){g.j.Oj.w.constructor.call(this,a);this.type|=g.j.u.xq;this.Dy=!1;this.connection=null;this.Di=this.gm=0};g.g.object.T(g.j.Oj,g.j.ui); +g.j.Oj.prototype.jt=function(a){return!!a.L||!!t(a)};g.j.Oj.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.j.u.hf(f)||(g.j.u.Gh(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.gm=d;this.cg=this.width};g.j.Oj.prototype.Ru=function(){return!1}; +g.j.vo=function(a,c,d){g.j.vo.w.constructor.call(this,a);this.type=this.type|g.j.u.pr|g.j.u.ov;this.width=d;this.height=c;this.Tx=!1;this.cg=0;this.elements=[new g.j.Xj(this.C,d)]};g.g.object.T(g.j.vo,g.j.ui);g.j.vo.prototype.measure=function(){};g.j.Yj=function(a){g.j.Yj.w.constructor.call(this,a);this.type|=g.j.u.Lv;this.Zw=0};g.g.object.T(g.j.Yj,g.j.ui); +g.j.Yj.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,g.j.u.gf(d)&&(g.j.u.Km(d)?a+=d.Wl:g.j.u.Gm(d)&&0!=d.Wl&&(a+=d.Wl-d.qh)),g.j.u.hf(d)||(this.height=Math.max(this.height,d.height));this.Zw=a;this.cg=this.width+a};g.j.Yj.prototype.Jx=function(){return!this.Si&&!this.qd};g.j.fh=function(a,c){this.R=c;this.Sg=a;this.C=this.Sg.C;this.L=c.L?new g.j.cr(this.C,c.L):null;this.ut=Fb(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Ng=c.Ng();this.G=c.G;this.Aj=this.width=this.fl=this.height=0;this.rows=[];this.Hy=[];this.gc=new g.j.ik(this.C);this.Gb=new g.j.Oj(this.C);this.cq=this.ce=0};b=g.j.fh.prototype; +b.measure=function(){var a=this.R.Jg?"cap"===this.R.Jg:g.va.og,c=!!this.R.Y;this.gc.jt(this.R)?this.gc.elements.push(new g.j.wo(this.C)):this.gc.elements.push(new g.j.so(this.C));a?(a=new g.j.Kq(this.C),this.gc.elements.push(a),this.gc.ug=a.kk):c&&(this.gc.$E=!0,this.gc.connection=new g.j.gr(this.C,this.R.Y),this.gc.elements.push(this.gc.connection));this.R.P.length&&this.R.P[0].type==g.Ra&&!this.R.isCollapsed()?this.gc.minHeight=this.C.ld:this.gc.minHeight=this.C.vf;this.rows.push(this.gc);a=new g.j.Yj(this.C); +var d=Lb(this.R);if(d.length){c=0;for(var e;e=d[c];c++){var f=new g.j.wd(this.C,e);this.isCollapsed&&e.Sw?this.Hy.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.R.P[c];c++)if(d.isVisible()){!e||d.type!=g.Ra&&e.type!=g.Ra&&(d.type!=g.Ua&&d.type!=g.jg||this.ut)||(this.rows.push(a),a=new g.j.Yj(this.C));for(e=0;f=d.Na[e];e++)a.elements.push(new g.j.Ha(this.C,f,d));this.Dw(d,a);e=d}this.isCollapsed&&(a.Cy=!0,a.elements.push(new g.j.Mq(this.C)));(a.elements.length||a.np)&&this.rows.push(a);this.Gb.Dy= +!!this.R.V;this.Gb.minHeight=this.R.P.length&&this.R.P[this.R.P.length-1].type==g.Ra?this.C.ld:this.C.vf-1;this.Gb.jt(this.R)?this.Gb.elements.push(new g.j.wo(this.C)):this.Gb.elements.push(new g.j.so(this.C));this.Gb.Dy&&(this.Gb.connection=new g.j.Xq(this.C,this.R.V),this.Gb.elements.push(this.Gb.connection));this.rows.push(this.Gb);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.Ru()&&c.elements.push(new g.j.Xj(this.C,this.ep(null,d[0])));for(e=0;ea.rd&&(a.ea+=g.g.A.ba("V",c.Nc+c.height-a.rd)))};g.ma.si=function(a){this.Cj=a;this.xn=g.g.o.K("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Cj);this.Zk=g.g.o.K("path",{"class":"blocklyPath"},this.Cj);this.zn=g.g.o.K("path",{"class":"blocklyPathLight"},this.Cj)};g.ma.si.prototype.Hu=function(a,c){this.Zk.setAttribute("d",a);this.xn.setAttribute("d",a);this.zn.setAttribute("d",c)}; +g.ma.si.prototype.Os=function(){this.Zk.setAttribute("transform","scale(-1 1)");this.zn.setAttribute("transform","scale(-1 1)");this.xn.setAttribute("transform","translate(1,1) scale(-1 1)")};g.ma.ah=function(a,c){g.ma.ah.w.constructor.call(this,a,c);this.Hi&&(this.width+=this.C.jd,this.height+=this.C.jd)};g.g.object.T(g.ma.ah,g.j.ah);g.ma.hh=function(a,c){g.ma.hh.w.constructor.call(this,a,c);this.Hi&&(this.height+=this.C.jd)};g.g.object.T(g.ma.hh,g.j.hh);g.ma.fh=function(a,c){g.ma.fh.w.constructor.call(this,a,c)};g.g.object.T(g.ma.fh,g.j.fh);b=g.ma.fh.prototype;b.Dw=function(a,c){this.ut&&a.type==g.Ua?(c.elements.push(new g.ma.ah(this.C,a)),c.ht=!0):a.type==g.Ra?(c.elements.push(new g.ma.hh(this.C,a)),c.qd=!0):a.type==g.Ua?(c.elements.push(new g.j.bo(this.C,a)),c.Si=!0):a.type==g.jg&&(c.np=!0)}; +b.ep=function(a,c){if(!a)return c&&g.j.u.Hm(c)&&c.cd?this.C.vf:c&&g.j.u.Eh(c)?this.C.Uv:c&&g.j.u.Km(c)?this.C.BC:this.C.ld;if(!g.j.u.gf(a)&&!c)return g.j.u.Hm(a)&&a.cd?this.C.vf:g.j.u.Kk(a)?2*this.C.ld+1:g.j.u.dj(a)?this.C.wf:g.j.u.qF(a)?this.C.ld:g.j.u.Fh(a)?this.C.cC:g.j.u.Sy(a)?this.C.wf:this.C.ld;if(g.j.u.gf(a)&&!c){if(g.j.u.Gm(a))return this.C.wf;if(g.j.u.Eh(a))return this.C.ld;if(g.j.u.Km(a))return this.C.wf}if(!g.j.u.gf(a)&&c&&g.j.u.gf(c)){if(a.cd){if(g.j.u.Eh(c)||g.j.u.Gm(c))return this.C.vC}else{if(g.j.u.Eh(c)|| +g.j.u.Gm(c))return this.C.Uv;if(g.j.u.Km(c))return this.C.ld}return this.C.ld-1}if(g.j.u.Kk(a)&&c&&!g.j.u.gf(c))return this.C.ld;if(g.j.u.Eh(a)&&c&&!g.j.u.gf(c))return c.cd?this.C.vf:this.C.ld;if(g.j.u.Jm(a)&&c){if(g.j.u.dj(c))return this.C.wf;if(g.j.u.Mk(c))return c.Ee;if(g.j.u.Gh(c))return a=(this.G?1:-1)*this.C.jd/2,c.Ee+a}if(g.j.u.Fh(a)&&c){if(g.j.u.Mk(c))return c.Ee-this.C.sb;if(g.j.u.Gh(c))return a=(this.G?1:-1)*this.C.jd/2,c.Ee-this.C.sb+a}return!g.j.u.gf(a)&&c&&!g.j.u.gf(c)&&a.cd==c.cd||c&& +g.j.u.Sy(c)?this.C.ld:this.C.vf};b.Gr=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(g.j.u.hf(e)){d=e;break a}d=null}e=Fd(a);if(a.Si||a.qd)a.cg+=c;var f=Ed(a);f?f.align==g.uq?e.width+=c:f.align==g.iv?(d.width+=c/2,e.width+=c/2):f.align==g.Ln&&(d.width+=c):e.width+=c;a.width+=c};b.ny=function(a,c){return g.j.u.Bp(a)&&g.j.u.up(c)?this.C.jB:g.j.u.Bp(a)||g.j.u.up(c)?this.C.wf:a.Si&&c.Si?this.C.ld:!a.qd&&c.qd?this.C.IA:a.qd&&c.qd||!a.qd&&c.np?this.C.ld:this.C.vf}; +b.ay=function(a,c){if(g.j.u.hf(c))return a.Nc+c.height/2;if(g.j.u.up(a))return a=a.Nc+a.height-a.gm,g.j.u.Gh(c)?a+c.height/2:a-c.height/2;if(g.j.u.Bp(a))return g.j.u.dj(c)?a.ug-c.height/2:a.ug+c.height/2;var d=a.Nc;g.j.u.Hm(c)||g.j.u.Kk(c)?(d+=c.height/2,(a.ht||a.qd)&&c.height+this.C.ow<=a.height&&(d+=this.C.ow)):d=g.j.u.Eh(c)?d+c.height/2:d+a.height/2;return d}; +b.Mx=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Nc=c;e.Qa=this.ce;c+=e.height;a=Math.max(a,e.cg);var f=c-this.gc.kk;e==this.Gb&&f=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},Ut:function(){10>O?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+sd+"&level="+(O+1):R.pp()},zm:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}bd(a,c)},ot:function(a,c){a=document.getElementById(a); +a.firstChild||(a=g.Dh(a,{rtl:-1!=rd.indexOf(sd),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),g.O.uh(g.O.$h(c),a))},NG:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Jf:function(a){if("click"==a.type&&"touchend"==R.Jf.qu&&R.Jf.ou+2E3>Date.now()||R.Jf.qu==a.type&&R.Jf.ou+400>Date.now())return a.preventDefault(),a.stopPropagation(),!0;R.Jf.qu=a.type;R.Jf.ou=Date.now();return!1}};R.Jf.qu=null;R.Jf.ou=0; +R.gF=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};R.hF=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=R;R.setCode=R.Wz;R.getCode=R.Vs;R.getWorkspace=R.Dk;var Q={bj:!1,ux:null,So:null,xj:function(a,c,d,e,f,h){function k(){Q.bj&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);Q.bj&&Q.Yd(!1);g.ub()&&g.mc(!0);Q.bj=!0;Q.ux=c;Q.So=h;var l=document.getElementById("dialog");h=document.getElementById("dialogShadow");var m=document.getElementById("dialogBorder"),n;for(n in f)l.style[n]=f[n];e&&(h.style.visibility="visible",h.style.opacity=.3,h.style.zIndex=9,e=document.createElement("div"), +e.id="dialogHeader",l.appendChild(e),Q.rs=g.yc(e,"mousedown",null,Q.UD));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(Q.Ep(c,!1,.2),Q.Ep(l,!0,.8),setTimeout(k,175)):k()},vx:0,wx:0,UD:function(a){Q.us();if(!g.g.fj(a)){var c=document.getElementById("dialog");Q.vx=c.offsetLeft-a.clientX;Q.wx=c.offsetTop-a.clientY;Q.ts=g.yc(document,"mouseup",null,Q.us);Q.ss=g.yc(document,"mousemove",null,Q.VD);a.stopPropagation()}},VD:function(a){var c=document.getElementById("dialog"), +d=Q.vx+a.clientX;a=Q.wx+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"},us:function(){Q.ts&&(g.Xa(Q.ts),Q.ts=null);Q.ss&&(g.Xa(Q.ss),Q.ss=null)},Yd:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(Q.bj){Q.us();Q.rs&&(g.Xa(Q.rs),Q.rs=null);Q.bj=!1;Q.So&&Q.So();Q.So=null;var d=!1===a? +null:Q.ux;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(Q.Ep(a,!1,.8),Q.Ep(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)}},Ep:function(a,c,d){function e(){f.style.width=h.width+"px";f.style.height=h.height+"px";f.style.left=h.x+"px";f.style.top= +h.y+"px";f.style.opacity=d}if(a){var f=document.getElementById("dialogBorder"),h=Q.tE(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},tE:function(a){var c=g.g.style.hp(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},gA:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eO?P("Games_nextLevel").replace("%1",String(O+1)):P("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +Q.Yd,!0);c.addEventListener("touchend",Q.Yd,!0);c=document.getElementById("doneOk");c.addEventListener("click",R.Ut,!0);c.addEventListener("touchend",R.Ut,!0);Q.xj(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",Q.Yw,!0)});document.body.addEventListener("keydown",Q.Yw,!0);document.getElementById("dialogDoneText").textContent=d},tx:function(a){!Q.bj||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(Q.Yd(!0),a.stopPropagation(),a.preventDefault())}, +bq:function(){document.body.addEventListener("keydown",Q.tx,!0)},eq:function(){document.body.removeEventListener("keydown",Q.tx,!0)},Yw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)Q.Yd(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&R.Ut()},Bw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)Q.Yd(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&R.pp()},Ux:function(a){27==a.keyCode?Q.Yd(!0):13==a.keyCode&&Q.Rs()},Rs: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 h=200==f.status?P("Games_submitted"):P("Games_httpRequestError")+"\nStatus: "+f.status;Q.gA(null,h)}};f.send(c.join("&"));Q.Yd(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=Q;Q.hideDialog=Q.Yd;g.pb=function(a,c,d){this.sn=!0;null==a&&(a="");g.pb.w.constructor.call(this,a,c,d)};g.g.object.T(g.pb,g.Ha);g.pb.sa=function(a){var c=g.g.nc(a.text);return new g.pb(c,void 0,a)};g.pb.prototype.gk=!0;g.pb.qB=11;g.pb.JA=4;b=g.pb.prototype;b.Cq="text";b.Ad=function(a){g.pb.w.Ad.call(this,a);"boolean"==typeof a.spellcheck&&(this.sn=a.spellcheck)};b.Dg=function(a){return null===a||void 0===a?null:String(a)}; +b.Ex=function(){if(this.aj){this.wt=!1;var a=this.kb;this.kb=this.Vc.aH;this.B&&g.i.isEnabled()&&g.i.Ka(new g.i.eg(this.B,"field",this.name||null,a,this.kb))}};b.sh=function(a){this.wt=!0;this.kb=a;this.aj||(this.ff=!0)};b.Tf=function(){g.pb.w.Tf.call(this);this.aj&&(this.B.G?setTimeout(this.Vp.bind(this),0):this.Vp(),this.wt?(g.g.o.fc(this.Vc,"blocklyInvalidInput"),g.g.U.Eb(this.Vc,"invalid",!1)):(g.g.o.qb(this.Vc,"blocklyInvalidInput"),g.g.U.Eb(this.Vc,"invalid",!0)))}; +function Vd(a){0!=a.sn&&(a.sn=!1,a.Vc&&a.Vc.setAttribute("spellcheck",a.sn))}b.Le=function(a){this.s=this.B.v;a=a||!1;!a&&(g.g.userAgent.dC||g.g.userAgent.jl||g.g.userAgent.Wj)?Wd(this):(g.$.show(this,this.B.G,this.fH.bind(this)),this.Vc=this.bv(),this.aj=!0,a||(this.Vc.focus(),this.Vc.select()))};function Wd(a){g.prompt(g.h.CHANGE_VALUE_TITLE,a.cc(),function(c){a.setValue(c)})} +b.bv=function(){var a=g.$.Ca,c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.sn);var d=g.pb.qB*this.s.scale+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=g.pb.JA*this.s.scale+"px";a.appendChild(c);c.value=c.defaultValue=this.Ws(this.kb);c.aH=this.kb;c.pz=null;g.g.userAgent.Jq?setTimeout(this.Vp.bind(this),0):this.Vp();this.cu=g.ka(c,"keydown",this,this.YF);this.$F=g.ka(c,"input",this,this.XF);return c}; +b.fH=function(){this.aj=!1;this.wt=!0;hc(this);this.au&&this.au(this.kb);g.Xa(this.cu);g.Xa(this.$F);var a=g.$.Ca.style;a.width="auto";a.height="auto";a.fontSize=""};b.YF=function(a){a.keyCode==g.g.Ia.Fq?(g.$.ya(),g.D.Ui()):a.keyCode==g.g.Ia.Gq?(this.Vc.value=this.Vc.defaultValue,g.$.ya(),g.D.Ui()):a.keyCode==g.g.Ia.nw&&(g.$.ya(),g.D.Ui(),Rc(this.B,this,!a.shiftKey),a.preventDefault())}; +b.XF=function(){var a=this.Vc.value;a!==this.Vc.pz&&(this.Vc.pz=a,g.i.Z(!0),this.setValue(this.ty(a)),hc(this),g.i.Z(!1))}; +b.Vp=function(){var a=g.$.Ca;var c=this.Ei.getBBox();var d=c.height*this.B.v.scale;var e=c.width*this.B.v.scale;var f=g.g.style.hp(this.Ei);c=f.y;d=f.y+d;var h=f.x;e=f.x+e;a.style.width=e-h+"px";a.style.height=d-c+"px";c=new g.g.S(this.B.G?e-a.offsetWidth:h,c);c.y+=1;g.g.userAgent.Jq&&g.$.Ca.style.top&&(--c.x,--c.y);g.g.userAgent.Dr&&(c.y-=3);a.style.left=c.x+"px";a.style.top=c.y+"px"}; +g.pb.QF=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)};g.pb.LL=function(a){(a=g.pb.QF(a))&&(a=String(Math.max(0,Math.floor(a))));return a};g.pb.prototype.Ty=function(){return!0};g.pb.prototype.Ck=function(){return this.aj&&this.Vc?this.Vc.value:null};g.pb.prototype.Ws=function(a){return String(a)}; +g.pb.prototype.ty=function(a){return a};g.Dc.register("field_input",g.pb);function Xd(a){Xd.w.constructor.call(this,a)}g.g.object.T(Xd,g.pb);Xd.sa=function(a){return new Xd(a.pitch)};var Yd="C3 D3 E3 F3 G3 A3 B3 C4 D4 E4 F4 G4 A4".split(/ /);b=Xd.prototype;b.Le=function(){Xd.w.Le.call(this);if(g.$.Ca.firstChild){var a=this.Js();g.D.Yx().appendChild(a);a=pc(this.B);a=a.Ko||a.fs;g.D.mf(this.B.oh,a);g.D.aA(this,this.Ks.bind(this));this.wD=g.yc(this.Vb,"click",this,this.bF);this.IF=g.yc(this.Vb,"mousemove",this,this.dG);Zd(this)}}; +b.Js=function(){this.Vb=document.createElement("div");this.Vb.id="notePicker";return this.Vb};b.Ks=function(){g.Xa(this.wD);g.Xa(this.IF)};b.bF=function(){g.$.ya();g.D.Ui()};b.dG=function(a){var c=this.Vb.getBoundingClientRect();a=g.g.td.Gi(Math.round(13.5-(a.clientY-c.top)/7.5),0,12);this.Vb.style.backgroundPosition=37*-a+"px 0";this.ff=!0;this.aj&&(this.Vc.value=this.Ws(a));this.setValue(a)};b.Ck=function(){if(this.aj)var a=Xd.w.Ck.call(this);else a=this.getValue(),a=Yd[Number(a)]||null;return a}; +b.Ws=function(a){return Yd[Number(a)]};b.ty=function(a){a=Yd.indexOf(a.trim().toUpperCase());return-1a.length)){e=[];for(f=0;fthis.jn)return null;var a=this.getOptions(!0)[this.jn][0];return"object"==typeof a?a.alt:a}; +g.Ma.nA=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;dc||Math.abs(a.Kn-d)>c)a.hl=e,a.Kn=d,a.Nb.kn(e+c,d+c),a.wn.setAttribute("width",a.hl),a.wn.setAttribute("height",a.Kn);a.R.G&&a.s.bb.setAttribute("transform","translate("+a.hl+",0)");a.s.resize()} +b.Qb=function(a){if(a!=this.isVisible())if(g.i.Ka(new g.i.od(this.R,"mutatorOpen",!a,a)),a){this.Nb=new g.na(this.R.v,this.ks(),this.R.Kd,this.Wi,null,null);Fa(this.Nb,this.R.id);if(a=this.s.options.Of)this.s.M.aa(this.s),this.s.M.show(a.childNodes);this.Tg=this.R.Bg(this.s);a=p(this.Tg,!1);for(var c=0,d;d=a[c];c++)d.za();this.Tg.$p(!1);this.Tg.Qo=!1;this.s.M?(a=2*this.s.M.sb,c=Ua(this.s).Mf()+a):c=a=16;this.R.G&&(c=-c);this.Tg.moveBy(c,a);if(this.R.Xp){var e=this;this.R.Xp(this.Tg);this.aq=function(){e.R.Xp(e.Tg)}; +Aa(this.R.v,this.aq)}$d(this);Aa(this.s,this.gH.bind(this));this.Ne()}else this.wn=null,this.s.I(),this.Tg=this.s=null,this.Nb.I(),this.Nb=null,this.Kn=this.hl=0,this.aq&&(Ba(this.R.v,this.aq),this.aq=null)}; +b.gH=function(a){if(a.type!=g.i.xo&&(a.type!=g.i.ei||"disabled"!=a.element)){if(!this.s.dc()){a=A(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Oa(),f=J(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.Tg.v==this.s){g.i.Z(!0);d=this.R;a=(a=d.eb())&&g.O.Dd(a);c=d.ca;d.ca=!1;d.yg(this.Tg);d.ca=c;d.Ce();c=(c=d.eb())&&g.O.Dd(c);if(a!=c){g.i.Ka(new g.i.eg(d,"mutation",null,a,c));var h=g.i.Ub();setTimeout(function(){g.i.Z(h);d.Hb();g.i.Z(!1)},g.Pn)}d.ca&&d.za();a!=c&&g.De&&g.navigation.HF(d);this.s.dc()|| +$d(this);g.i.Z(!1)}}};b.EE=function(){return{rb:this.Kn,lb:this.hl-Ua(this.s).Mf(),xc:0,jc:this.s.G?0:Ua(this.s).Mf()}};b.I=function(){this.R.Gd=null;g.wd.prototype.I.call(this)};g.ic.Uk=function(a,c,d){if(!a||!a.B.v)return!1;d=E(c,d).connection;var e=C(a);return e&&e!=c||d.ga==a?!1:(d.isConnected()&&d.disconnect(),d.connect(a),!0)};g.ic.Nx=function(a){var c=null;if(a&&a.options){var d=a.options.Kb;a.$d?d&&d.options&&(c=d.options.Kb):d&&(c=d)}return c};g.W.Ft={};g.la={};g.la.VB={};g.la.VB.eo=260; +g.wk([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}", +args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value", +name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]); +g.W.lists_create_with={aa:function(){this.Ec=g.h.LISTS_CREATE_WITH_HELPURL;L(this,"list_blocks");this.jf=3;this.fe();this.Ke(!0,"Array");this.on(new g.ic(["lists_create_with_item"]));this.vb(g.h.LISTS_CREATE_WITH_TOOLTIP)},eb:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("items",this.jf);return a},Ab:function(a){this.jf=parseInt(a.getAttribute("items"),10);this.fe()},Bg:function(a){var c=a.Lh("lists_create_with_container");c.Ce();for(var d=E(c,"STACK").connection,e=0;e","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"]}]); +g.wk([{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}"}]);g.la.Pd.yr={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}"};g.X.register("logic_op_tooltip",g.X.Do("OP",g.la.Pd.yr)); +g.la.Pd.XA={Vd:0,af:0,Zh:!0,eb:function(){if(!this.Vd&&!this.af)return null;var a=g.g.xml.createElement("mutation");this.Vd&&a.setAttribute("elseif",this.Vd);this.af&&a.setAttribute("else",1);return a},Ab:function(a){this.Vd=parseInt(a.getAttribute("elseif"),10)||0;this.af=parseInt(a.getAttribute("else"),10)||0;this.rG()},Bg:function(a){var c=a.Lh("controls_if_if");c.Ce();for(var d=c.V,e=1;e<=this.Vd;e++){var f=a.Lh("controls_if_elseif");f.Ce();d.connect(f.Y);d=f.V}this.af&&(a=a.Lh("controls_if_else"), +a.Ce(),d.connect(a.Y));return c},yg:function(a){a=C(a.V);this.af=this.Vd=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.Vd++;c.push(a.av);d.push(a.$f);break;case "controls_if_else":this.af++;e=a.$f;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.V&&C(a.V)}this.fe();this.Oz(c,d,e)},Xp:function(a){a=C(a.V);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=E(this,"IF"+c),e=E(this,"DO"+c);a.av=d&&d.connection.ga;a.$f=e&&e.connection.ga; +c++;break;case "controls_if_else":e=E(this,"ELSE");a.$f=e&&e.connection.ga;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.V&&C(a.V)}},rG:function(){var a=[null],c=[null],d=null;E(this,"ELSE")&&(d=E(this,"ELSE").connection.ga);for(var e=1;E(this,"IF"+e);){var f=E(this,"DO"+e);a.push(E(this,"IF"+e).connection.ga);c.push(f.connection.ga);e++}this.fe();this.Oz(a,c,d)},fe:function(){E(this,"ELSE")&&this.Yb("ELSE");for(var a=1;E(this,"IF"+a);)this.Yb("IF"+a),this.Yb("DO"+a),a++;for(a= +1;a<=this.Vd;a++)K(M(this,"IF"+a).Db("Boolean"),g.h.CONTROLS_IF_MSG_ELSEIF),K(this.Bf(g.Ra,"DO"+a),g.h.CONTROLS_IF_MSG_THEN);this.af&&K(this.Bf(g.Ra,"ELSE"),g.h.CONTROLS_IF_MSG_ELSE)},Oz:function(a,c,d){for(var e=1;e<=this.Vd;e++)g.ic.Uk(a[e],this,"IF"+e),g.ic.Uk(c[e],this,"DO"+e);g.ic.Uk(d,this,"ELSE")}};g.X.tu("controls_if_mutator",g.la.Pd.XA,null,["controls_if_elseif","controls_if_else"]); +g.la.Pd.YA=function(){this.vb(function(){if(this.Vd||this.af){if(!this.Vd&&this.af)return g.h.CONTROLS_IF_TOOLTIP_2;if(this.Vd&&!this.af)return g.h.CONTROLS_IF_TOOLTIP_3;if(this.Vd&&this.af)return g.h.CONTROLS_IF_TOOLTIP_4}else return g.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};g.X.register("controls_if_tooltip",g.la.Pd.YA); +g.la.Pd.RB={onchange:function(a){this.$m||(this.$m=[null,null]);var c=uc(this,"A"),d=uc(this,"B");c&&d&&!Eb(c.L,d.L)&&(g.i.Z(a.group),a=this.$m[0],a!==c&&(D(c),a&&!a.$a&&E(this,"A").connection.connect(a.L)),c=this.$m[1],c!==d&&(D(d),c&&!c.$a&&E(this,"B").connection.connect(c.L)),this.Hb(),g.i.Z(!1));this.$m[0]=uc(this,"A");this.$m[1]=uc(this,"B")}};g.la.Pd.QB=function(){this.kj(g.la.Pd.RB)};g.X.register("logic_compare",g.la.Pd.QB); +g.la.Pd.SB={Jz:null,onchange:function(a){var c=uc(this,"THEN"),d=uc(this,"ELSE"),e=this.L.ga;if((c||d)&&e)for(var f=0;2>f;f++){var h=1==f?c:d;h&&!Eb(h.L,e)&&(g.i.Z(a.group),e===this.Jz?(D(this),e.B.Hb()):(D(h),h.Hb()),g.i.Z(!1))}this.Jz=e}};g.X.Rp("logic_ternary",g.la.Pd.SB);g.Pe=function(a,c,d,e,f,h){this.Tm=-Infinity;this.Rm=Infinity;this.Sk=0;this.ns=null;g.Pe.w.constructor.call(this,a||0,f,h);h||(ae(this,c),be(this,d),ce(this,e),this.setValue(this.getValue()))};g.g.object.T(g.Pe,g.pb);g.Pe.sa=function(a){return new g.Pe(a.value,void 0,void 0,void 0,void 0,a)};g.Pe.prototype.gk=!0;g.Pe.prototype.Ad=function(a){g.Pe.w.Ad.call(this,a);ae(this,a.min);be(this,a.max);ce(this,a.precision)};function ae(a,c){null==c?a.Tm=-Infinity:(c=Number(c),isNaN(c)||(a.Tm=c))} +function be(a,c){null==c?a.Rm=Infinity:(c=Number(c),isNaN(c)||(a.Rm=c))}function ce(a,c){null==c?a.Sk=0:(c=Number(c),isNaN(c)||(a.Sk=c));var d=a.Sk.toString(),e=d.indexOf(".");a.ns=-1==e?c?0:null:d.length-e-1}g.Pe.prototype.Dg=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.Tm),this.Rm);this.Sk&&isFinite(a)&&(a=Math.round(a/this.Sk)*this.Sk);null!=this.ns&&(a=Number(a.toFixed(this.ns)));return a}; +g.Pe.prototype.bv=function(){var a=g.Pe.w.bv.call(this);-Infinitythis.Rm&&g.g.U.Eb(a,g.g.U.State.IC,this.Rm);return a};g.Dc.register("field_number",g.Pe);g.me=function(a,c,d,e,f){this.jj=g.me.gE;this.RD=a||"";this.Lb=new g.g.qe(0,g.va.Vq);f&&this.Ad(f);c&&(this.Ij=c);f||de(this,d,e)};g.g.object.T(g.me,g.Ma);g.me.sa=function(a){var c=g.g.nc(a.variable);return new g.me(c,void 0,void 0,void 0,a)};b=g.me.prototype;b.s=null;b.gk=!0;b.Ad=function(a){g.me.w.Ad.call(this,a);de(this,a.variableTypes,a.defaultType)};b.Xi=function(){if(!this.Ld){var a=g.N.gp(this.B.v,null,this.RD,this.QD);g.i.disable();this.setValue(a.ua());g.i.enable()}}; +b.pm=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=g.N.gp(this.B.v,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.ua()+"' had type "+c.type+", and does not match variable field that references it: "+g.O.Dd(a)+".");this.setValue(c.ua())};b.iA=function(a){this.Xi();a.id=this.Ld.ua();a.textContent=this.Ld.name;this.Ld.type&&a.setAttribute("variabletype",this.Ld.type);return a}; +b.Ku=function(a){if(a.$a)throw Error("Variable fields are not allowed to exist on shadow blocks.");g.me.w.Ku.call(this,a)};b.getValue=function(){return this.Ld?this.Ld.ua():null};b.cc=function(){return this.Ld?this.Ld.name:""};b.Tc=function(){return this.Ld};b.sy=function(){return this.Ld?this.Ij:null}; +b.Dg=function(a){if(null===a)return null;var c=g.N.Tc(this.B.v,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=ee(this)){for(var e=0;e=d||0>=c)throw Error("Height and width values of an image field must be greater than 0.");this.nm=!1;this.Bo="";g.kg.w.constructor.call(this,a||"",null,k);k||(this.nm=!!h,this.Bo=g.g.nc(e)||"");this.Lb=new g.g.qe(c,d+g.kg.Aw);this.fF=d;this.Tl=null;"function"== +typeof f&&(this.Tl=f)};g.g.object.T(g.kg,g.Ha);g.kg.sa=function(a){return new g.kg(a.src,a.width,a.height,void 0,void 0,void 0,a)};g.kg.Aw=1;b=g.kg.prototype;b.uf=!1;b.ff=!1;b.Ad=function(a){g.kg.w.Ad.call(this,a);this.nm=!!a.flipRtl;this.Bo=g.g.nc(a.alt)||""};b.Yi=function(){this.Vb=g.g.o.K("image",{height:this.fF+"px",width:this.Lb.width+"px",alt:this.Bo},this.we);this.Vb.setAttributeNS(g.g.o.Ue,"xlink:href",this.kb)};b.Dg=function(a){return"string"!=typeof a?null:a}; +b.sh=function(a){this.kb=a;this.Vb&&this.Vb.setAttributeNS(g.g.o.Ue,"xlink:href",this.kb||"")};b.by=function(){return this.nm};b.Le=function(){this.Tl&&this.Tl(this)};b.Ck=function(){return this.Bo};g.Dc.register("field_image",g.kg);g.Generator=function(a){this.MF=a;this.rB=new RegExp(this.le,"g")};g.Generator.xb="generated_function";b=g.Generator.prototype;b.ho=null;b.yd=null;b.Qc=null;b.kd=" ";b.TA=60;b.po=[]; +function Ud(){var a=g.m,c=I;c||(console.warn("No workspace specified in workspaceToCode call. Guessing."),c=g.ub());var d=[];a.aa(c);c=A(c,!0);for(var e=0,f;f=c[e];e++){var h=ge(a,f);Array.isArray(h)&&(h=h[0]);h&&(f.L&&(h=a.Uz(h),a.yd&&!f.Zh&&(h=S(a.yd,f)+h),a.Qc&&!f.Zh&&(h+=S(a.Qc,f))),d.push(h))}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 he(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)} +function ge(a,c){if(!c)return"";if(!c.isEnabled())return ge(a,t(c));var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.MF+'" does not know how to generate code for block type "'+c.type+'".');d=d.call(c,c);if(Array.isArray(d)){if(!c.L)throw TypeError("Expecting string from statement block: "+c.type);return[a.Yp(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.yd&&!c.Zh&&(d=S(a.yd,c)+d),a.Qc&&!c.Zh&&(d+=S(a.Qc,c)),a.Yp(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+ +d);} +function T(a,c,d){var e=g.m;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=uc(a,c);if(!f)return"";c=ge(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 h=Math.floor(d),k=Math.floor(c);if(h<=k&&(h!=k||0!=h&&99!=h))for(f=!0,h=0;hd?T(a,c,g.m.ek)||h:e?T(a,c,g.m.Dl)||h:T(a,c,f)||h;if(g.Hh(a))a=Number(a)+d,e&&(a=-a);else{if(0d&&(a=a+" - "+-d,k=g.m.ek);e&&(a=d?"-("+a+")":"-"+a,k=g.m.Dl);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};g.m.Ft={};g.m.lists_create_empty=function(){return["[]",g.m.eh]};g.m.lists_create_with=function(a){for(var c=Array(a.jf),d=0;d b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];", +" return function(a, b) { return compare(a, b) * direction; }","}"]);return[c+".slice().sort("+e+'("'+a+'", '+d+"))",g.m.yb]};g.m.lists_split=function(a){var c=T(a,"INPUT",g.m.Mb),d=T(a,"DELIM",g.m.xd)||"''";a=z(a,"MODE");if("SPLIT"==a)c||(c="''"),a="split";else if("JOIN"==a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+d+")",g.m.yb]};g.m.lists_reverse=function(a){return[(T(a,"LIST",g.m.yb)||"[]")+".slice().reverse()",g.m.yb]};g.m.vF={};g.m.controls_if=function(a){var c=0,d="";g.m.yd&&(d+=S(g.m.yd,a));do{var e=T(a,"IF"+c,g.m.xd)||"false";var f=ie(a,"DO"+c);g.m.Qc&&(f=he(S(g.m.Qc,a),g.m.kd)+f);d+=(0",GTE:">="}[z(a,"OP")],d="=="==c||"!="==c?g.m.Yv:g.m.iC,e=T(a,"A",d)||"0";a=T(a,"B",d)||"0";return[e+" "+c+" "+a,d]};g.m.logic_operation=function(a){var c="AND"==z(a,"OP")?"&&":"||",d="&&"==c?g.m.Yq:g.m.Zq,e=T(a,"A",d);a=T(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]};g.m.logic_negate=function(a){var c=g.m.Bl;return["!"+(T(a,"BOOL",c)||"true"),c]}; +g.m.logic_boolean=function(a){return["TRUE"==z(a,"BOOL")?"true":"false",g.m.eh]};g.m.logic_null=function(){return["null",g.m.eh]};g.m.logic_ternary=function(a){var c=T(a,"IF",g.m.oo)||"false",d=T(a,"THEN",g.m.oo)||"null";a=T(a,"ELSE",g.m.oo)||"null";return[c+" ? "+d+" : "+a,g.m.oo]};g.m.xF={};g.m.controls_repeat_ext=function(a){var c=B(a,"TIMES")?String(Number(z(a,"TIMES"))):T(a,"TIMES",g.m.pi)||"0",d=ie(a,"DO");d=je(d,a);a="";var e=pd(g.m.vd,"count",g.N.xb),f=c;c.match(/^\w+$/)||g.Hh(c)||(f=pd(g.m.vd,"repeat_end",g.N.xb),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")};g.m.controls_repeat=g.m.controls_repeat_ext; +g.m.controls_whileUntil=function(a){var c="UNTIL"==z(a,"MODE"),d=T(a,"BOOL",c?g.m.Bl:g.m.xd)||"false",e=ie(a,"DO");e=je(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"}; +g.m.controls_for=function(a){var c=od(z(a,"VAR"),g.N.xb),d=T(a,"FROM",g.m.pi)||"0",e=T(a,"TO",g.m.pi)||"0",f=T(a,"BY",g.m.pi)||"1",h=ie(a,"DO");h=je(h,a);if(g.Hh(d)&&g.Hh(e)&&g.Hh(f)){var k=Number(d)<=Number(e);a="for ("+c+" = "+d+"; "+c+(k?" <= ":" >= ")+e+"; "+c;c=Math.abs(Number(f));a=(1==c?a+(k?"++":"--"):a+((k?" += ":" -= ")+c))+(") {\n"+h+"}\n")}else a="",k=d,d.match(/^\w+$/)||g.Hh(d)||(k=pd(g.m.vd,c+"_start",g.N.xb),a+="var "+k+" = "+d+";\n"),d=e,e.match(/^\w+$/)||g.Hh(e)||(d=pd(g.m.vd,c+"_end", +g.N.xb),a+="var "+d+" = "+e+";\n"),e=pd(g.m.vd,c+"_inc",g.N.xb),a+="var "+e+" = ",a=g.Hh(f)?a+(Math.abs(f)+";\n"):a+("Math.abs("+f+");\n"),a=a+("if ("+k+" > "+d+") {\n")+(g.m.kd+e+" = -"+e+";\n"),a+="}\n",a+="for ("+c+" = "+k+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+h+"}\n";return a}; +g.m.controls_forEach=function(a){var c=od(z(a,"VAR"),g.N.xb),d=T(a,"LIST",g.m.pi)||"[]",e=ie(a,"DO");e=je(e,a);a="";var f=d;d.match(/^\w+$/)||(f=pd(g.m.vd,c+"_list",g.N.xb),a+="var "+f+" = "+d+";\n");d=pd(g.m.vd,c+"_index",g.N.xb);e=g.m.kd+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")}; +g.m.controls_flow_statements=function(a){var c="";g.m.yd&&(c+=S(g.m.yd,a));g.m.Qc&&(c+=S(g.m.Qc,a));if(g.m.yd){var d=g.la.ne.Vn.qy(a);d&&!d.Zh&&(c+=S(g.m.yd,d))}switch(z(a,"FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");};g.m.td={};g.m.math_number=function(a){a=Number(z(a,"NUM"));return[a,0<=a?g.m.eh:g.m.Dl]};g.m.math_arithmetic=function(a){var c={ADD:[" + ",g.m.oi],MINUS:[" - ",g.m.ek],MULTIPLY:[" * ",g.m.$q],DIVIDE:[" / ",g.m.Al],POWER:[null,g.m.ad]}[z(a,"OP")],d=c[0];c=c[1];var e=T(a,"A",c)||"0";a=T(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",g.m.yb]}; +g.m.math_single=function(a){var c=z(a,"OP");if("NEG"==c)return a=T(a,"NUM",g.m.Dl)||"0","-"==a[0]&&(a=" "+a),["-"+a,g.m.Dl];a="SIN"==c||"COS"==c||"TAN"==c?T(a,"NUM",g.m.Al)||"0":T(a,"NUM",g.m.xd)||"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,g.m.yb];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,g.m.Al]}; +g.m.math_constant=function(a){return{PI:["Math.PI",g.m.Mb],E:["Math.E",g.m.Mb],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",g.m.Al],SQRT2:["Math.SQRT2",g.m.Mb],SQRT1_2:["Math.SQRT1_2",g.m.Mb],INFINITY:["Infinity",g.m.eh]}[z(a,"CONSTANT")]}; +g.m.math_number_property=function(a){var c=T(a,"NUMBER_TO_CHECK",g.m.Cl)||"0",d=z(a,"PROPERTY");if("PRIME"==d){var e=le("mathIsPrime",["function "+g.m.le+"(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,g.m.yb]}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=T(a,"DIVISOR",g.m.Cl)||"0",e=c+" % "+a+" == 0"}return[e,g.m.Yv]}; +g.m.math_change=function(a){var c=T(a,"DELTA",g.m.oi)||"0";a=od(z(a,"VAR"),g.N.xb);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};g.m.math_round=g.m.math_single;g.m.math_trig=g.m.math_single; +g.m.math_on_list=function(a){var c=z(a,"OP");switch(c){case "SUM":a=T(a,"LIST",g.m.Mb)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=T(a,"LIST",g.m.ad)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=T(a,"LIST",g.m.ad)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=le("mathMean",["function "+g.m.le+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=T(a,"LIST",g.m.xd)||"[]";a=c+"("+a+")";break;case "MEDIAN":c= +le("mathMedian",["function "+g.m.le+"(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=T(a,"LIST",g.m.xd)||"[]";a=c+"("+a+")";break;case "MODE":c=le("mathModes", +["function "+g.m.le+"(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=T(a,"LIST",g.m.xd)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=le("mathStandardDeviation",["function "+g.m.le+"(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=T(a,"LIST",g.m.xd)||"[]";a=c+"("+a+")";break;case "RANDOM":c=le("mathRandomList",["function "+g.m.le+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=T(a,"LIST",g.m.xd)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,g.m.yb]};g.m.math_modulo=function(a){var c=T(a,"DIVIDEND",g.m.Cl)||"0";a=T(a,"DIVISOR",g.m.Cl)||"0";return[c+" % "+a,g.m.Cl]}; +g.m.math_constrain=function(a){var c=T(a,"VALUE",g.m.ad)||"0",d=T(a,"LOW",g.m.ad)||"0";a=T(a,"HIGH",g.m.ad)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",g.m.yb]}; +g.m.math_random_int=function(a){var c=T(a,"FROM",g.m.ad)||"0";a=T(a,"TO",g.m.ad)||"0";return[le("mathRandomInt",["function "+g.m.le+"(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+")",g.m.yb]};g.m.math_random_float=function(){return["Math.random()",g.m.yb]}; +g.m.math_atan2=function(a){var c=T(a,"X",g.m.ad)||"0";return["Math.atan2("+(T(a,"Y",g.m.ad)||"0")+", "+c+") / Math.PI * 180",g.m.Al]};g.m.qG={};g.m.procedures_defreturn=function(a){var c=od(z(a,"NAME"),g.Ea.xb),d="";g.m.yd&&(d+=S(g.m.yd,a));g.m.Qc&&(d+=S(g.m.Qc,a));d&&(d=he(d,g.m.kd));var e="";g.m.ho&&(e=he(S(g.m.ho,a),g.m.kd));var f=ie(a,"STACK"),h=T(a,"RETURN",g.m.xd)||"",k="";f&&h&&(k=d);h&&(h=g.m.kd+"return "+h+";\n");for(var l=[],m=0;mO&&(a.shift(),a.pop());sc(this,{message0:P("Music_playNote"),args0:[{type:"field_dropdown",name:"DURATION",options:a},{type:"input_value", +name:"PITCH",check:"Number"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:160,tooltip:P("Music_playNoteTooltip")})}};g.m.music_note=function(a){var c=T(a,"PITCH",g.m.ad)||"7";return"play("+Number(z(a,"DURATION"))+", "+c+", 'block_id_"+a.id+"');\n"};g.W.music_rest_whole={aa:function(){sc(this,{message0:P("Music_rest"),args0:[{type:"field_image",src:"music/rest1.png",width:10,height:20,alt:"-"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:160,tooltip:P("Music_restWholeTooltip")})}}; +g.m.music_rest_whole=function(a){return"rest(1, 'block_id_"+a.id+"');\n"}; +g.W.music_rest={aa:function(){sc(this,{message0:P("Music_rest"),args0:[{type:"field_dropdown",name:"DURATION",options:[[{src:"music/rest1.png",width:10,height:20,alt:"whole"},"1"],[{src:"music/rest0.5.png",width:10,height:20,alt:"half"},"0.5"],[{src:"music/rest0.25.png",width:10,height:20,alt:"quarter"},"0.25"],[{src:"music/rest0.125.png",width:10,height:20,alt:"eighth"},"0.125"],[{src:"music/rest0.0625.png",width:10,height:20,alt:"sixteenth"},"0.0625"]]}],inputsInline:!0,previousStatement:null,nextStatement:null, +colour:160,tooltip:P("Music_restTooltip")})}};g.m.music_rest=function(a){return"rest("+Number(z(a,"DURATION"))+", 'block_id_"+a.id+"');\n"}; +g.W.music_instrument={aa:function(){sc(this,{message0:P("Music_setInstrument"),args0:[{type:"field_dropdown",name:"INSTRUMENT",options:[[P("Music_piano"),"piano"],[P("Music_trumpet"),"trumpet"],[P("Music_banjo"),"banjo"],[P("Music_violin"),"violin"],[P("Music_guitar"),"guitar"],[P("Music_flute"),"flute"],[P("Music_drum"),"drum"],[P("Music_choir"),"choir"]]}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:160,tooltip:P("Music_setInstrumentTooltip")})}}; +g.m.music_instrument=function(a){return"setInstrument("+g.m.Nz(z(a,"INSTRUMENT"))+", 'block_id_"+a.id+"');\n"};g.W.music_start={aa:function(){sc(this,{message0:P("Music_start"),args0:[{type:"field_image",src:"music/play.png",width:17,height:17,alt:"\u25b6"}],message1:"%1",args1:[{type:"input_statement",name:"STACK"}],colour:0,tooltip:P("Music_startTooltip")})}};g.m.music_start=function(a){U++;a=ie(a,"STACK");g.m.rh["%start"+U]="function start"+U+"() {\n"+a+"}\n";return null}; +10>O&&(g.W.procedures_defnoreturn.aa=function(){var a=new g.pb("",g.Ea.uu);Vd(a);K(K(K(N(this),g.h.PROCEDURES_DEFNORETURN_TITLE),a,"NAME"),"","PARAMS");this.mf(g.h.PROCEDURES_HUE);this.vb(g.h.PROCEDURES_DEFNORETURN_TOOLTIP);this.Ec=g.h.PROCEDURES_DEFNORETURN_HELPURL;this.Fa=[];this.$b=[];this.Yh(!0);this.$f=null},delete g.W.procedures_defreturn,delete g.W.procedures_ifreturn);var ne=ne||{};function oe(a,c){function d(){}d.prototype=c.prototype;a.w=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.nL=function(e,f,h){return c.prototype[f].apply(e,Array.prototype.slice.call(arguments,2))}}if(!pe){var pe,qe="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(qe=navigator.userAgent);var re=0==qe.indexOf("Opera");pe={IL:{GI:"ScriptEngine"in window},KJ:re,lg:!re&&-1!=qe.indexOf("MSIE"),Dr:!re&&-1!=qe.indexOf("WebKit")}}if(!se)var se={}; +if(!te)var te={};if(!ue)var ue={};if(!ve)var ve={};if(!we)var we={};if(!xe)var xe={};var ye=ne.OH?{QL:!0}:{};function ze(){throw Error("Do not instantiate directly");}ze.prototype.bx=null;ze.prototype.toString=function(){return this.content};function Ae(a){if(null!=a)switch(a.bx){case 1:return 1;case -1:return-1;case 0:return 0}return null}function Be(){ze.call(this)}oe(Be,ze);Be.prototype.DD=ye;function V(a){return null!=a&&a.DD===ye?a:Ce(String(String(a)).replace(De,Ee),Ae(a))} +var Ce=function(a){function c(){}c.prototype=a.prototype;return function(d,e){var f=new c;f.content=String(d);void 0!==e&&(f.bx=e);return f}}(Be),Fe={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function Ee(a){return Fe[a]}var De=/[\x00\x22\x26\x27\x3c\x3e]/g;function Ie(){return'
'};function Je(){for(var a='
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
Toque uma nota musical com a dura\u00e7\u00e3o e altura \\nespec\u00edficas. tocar %1 nota %2Aguarde pela dura\u00e7\u00e3o especificada.Aguarde por uma semibreve.resta %1Alterne para o instrumento espec\u00edfico ao tocar \\nas notas musicais posteriores. ajustar o instrumento para %1Execute os blocos dentro quando o bot\u00e3o de \\n\'Executar programa\' for clicado. quando %1 \u00e9 clicadoUma nota (C4 \u00e9 7).primeira partepianotrompetebanjoviolinoguitarraflautatamborcoroExecute o seu programa at\u00e9 ele parar. Ent\u00e3o poder\u00e1 enviar a sua m\u00fasica para a galeria.

'+ +((ud?'':'')+"Jogos do Blockly : "+V({appName:"M\u00fasica"}.appName)+""),c="   ",d=1;11>d;d++)c+=" "+(d==O?''+V(d)+"":10==d?''+V(d)+"":'');return a+c+'

  
\x3c!-- Slow icon. --\x3e\x3c!-- Fast icon. --\x3e
'+ +(10!=O||ud?"":'
Envie sua m\u00fasica para a galeria.
T\u00edtulo:
\x3c!--Legal disclaimer goes here if needed.--\x3e
')+ +('
Parab\u00e9ns!
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.
')+ +(Ie()+'
A sua solu\u00e7\u00e3o funcionou, mas pode fazer melhor. Utilize as fun\u00e7\u00f5es para reduzir a quantidade de c\u00f3digo repetido.
')+Ie()+'
A m\u00fasica soar\u00e1 melhor se usar um instrumento diferente em cada bloco inicial.
'+Ie()+'
'+ +(1==O?"Componha as primeiras quatro notas de 'Fr\u00e8re Jacques'.

C4 - D4 - E4 - C4

":2==O?"Uma 'fun\u00e7\u00e3o' permite agrupar os blocos, e depois execut\u00e1-los mais de uma vez.
Crie uma fun\u00e7\u00e3o para tocar as quatro primeiras notas de 'Fr\u00e8re Jacques'. Execute essa fun\u00e7\u00e3o duas vezes. N\u00e3o acrescente novos blocos de notas.":3==O?'Crie uma segunda fun\u00e7\u00e3o para a pr\u00f3xima parte de \'Fr\u00e8re Jacques\'. A \u00faltima nota \u00e9 mais longa.
': +4==O?'Crie uma terceira fun\u00e7\u00e3o para a pr\u00f3xima parte de \'Fr\u00e8re Jacques\'. As quatro primeiras notas s\u00e3o mais curtas.
':5==O?"Complete toda a cantiga de 'Fr\u00e8re Jacques'.":6==O?'Este bloco novo permite que mude para outro instrumento.
Tocar a sua \u00e1ria com um violino.':7==O?'Este novo bloco acrescenta um temporizador silencioso.
Crie um segundo bloco inicial que tenha dois blocos silenciosos, e ent\u00e3o toque \'Fr\u00e8re Jacques\'.': +8==O?"Cada bloco inicial deve tocar 'Fr\u00e8re Jacques' duas vezes.":9==O?"Crie quatro blocos iniciais que toquem 'Fr\u00e8re Jacques' duas vezes. Acrescente o n\u00famero correto dos blocos silenciosos.":10==O?"Componha o que o que voc\u00ea quiser. Voc\u00ea tem uma grande quantidade de blocos novos que pode explorar. Divirta-se!"+(ud?"":'

Utilize o bot\u00e3o "Ver Galeria" para ver o que as outras pessoas compuseram. Se compor algo interessante, use o bot\u00e3o "Enviar para a Galeria" para publicar.'): +"")+"
"+Ie()+"
"};function Ke(a){var c=Le;this.LB=23;this.$j=18;this.Nq=132;this.wi=20;this.kb=.5;this.Mw=c;this.Kr=[];c=g.g.o.Hl;var d=document.createElementNS(c,"line");d.setAttribute("class","sliderTrack");d.setAttribute("x1",10);d.setAttribute("y1",35);d.setAttribute("x2",140);d.setAttribute("y2",35);a.appendChild(d);d=document.createElementNS(c,"rect");d.setAttribute("style","opacity: 0");d.setAttribute("x",10-this.wi);d.setAttribute("y",35-this.wi);d.setAttribute("width",130+2*this.wi);d.setAttribute("height", +2*this.wi);d.setAttribute("rx",this.wi);d.setAttribute("ry",this.wi);a.appendChild(d);this.XG=d;d=document.createElementNS(c,"path");d.setAttribute("class","sliderKnob");d.setAttribute("d","m 0,0 l -8,8 v 12 h 16 v -12 z");a.appendChild(d);this.Wy=d;c=document.createElementNS(c,"circle");c.setAttribute("style","opacity: 0");c.setAttribute("r",this.wi);c.setAttribute("cy",35);a.appendChild(c);this.yt=c;for(this.setValue(.5);a&&"svg"!=a.nodeName.toLowerCase();)a=a.parentNode;this.Sa=a;Me(this.yt,"mousedown", +this,this.Vy);Me(this.yt,"touchstart",this,this.Vy);Me(this.XG,"mousedown",this,this.sG);Me(this.Sa,"mouseup",null,Ne);Me(this.Sa,"touchend",null,Ne);Me(this.Sa,"mousemove",null,Oe);Me(this.Sa,"touchmove",null,Oe);Me(document,"mouseover",null,Pe)}var Qe=null,Re=0,Se=0;Ke.prototype.Vy=function(a){if("touchstart"==a.type){if(1!=a.changedTouches.length)return;Te(a)}Qe=this;Re=Ue(this,a).x;Se=0;var c=this.Wy.getAttribute("transform");c&&(c=c.match(/translate\(\s*([-\d.]+)/))&&(Se=Number(c[1]));a.preventDefault()}; +function Ne(){Qe=null}function Pe(a){if(Qe){a=a.target;do if(a==Qe.Sa)return;while(a=a.parentNode);Qe=null}}function Oe(a){var c=Qe;if(c){if("touchmove"==a.type){if(1!=a.changedTouches.length)return;Te(a)}a=Ue(c,a).x-Re+Se;c.setValue((a-c.$j)/(c.Nq-c.$j))}}Ke.prototype.sG=function(a){if("touchstart"==a.type){if(1!=a.changedTouches.length)return;Te(a)}a=Ue(this,a).x;Ve(this,(a-this.$j)/(this.Nq-this.$j))};Ke.prototype.getValue=function(){return this.kb}; +function Ve(a,c){function d(h){return function(){a.setValue(h*(c-e)/9+e)}}for(;a.Kr.length;)clearTimeout(a.Kr.pop());for(var e=a.getValue(),f=0;10>f;f++)a.Kr.push(setTimeout(d(f),200*f/10))}Ke.prototype.setValue=function(a){this.kb=g.g.td.Gi(a,0,1);a=this.$j+(this.Nq-this.$j)*this.kb;this.Wy.setAttribute("transform","translate("+a+","+this.LB+")");this.yt.setAttribute("cx",a);this.Mw&&this.Mw(this.kb)}; +function Ue(a,c){var d=a.Sa.createSVGPoint();d.x=c.clientX;d.y=c.clientY;a=a.Sa.getScreenCTM().inverse();return d.matrixTransform(a)}function Me(a,c,d,e){a.addEventListener(c,function(f){e.apply(d,arguments)},!1)}function Te(a){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY};var Cd="music",We=0,U=0,Xe=0,Ye=0,Ze=null,$e=[],af=0,W=0,Y=null,bf=!1; +window.addEventListener("load",function(){function a(){var n=e.offsetTop;f.style.top=n+"px";h.style.top=n+"px";d.style.top=Math.max(10,n-window.pageYOffset)+"px";d.style.left=c?"10px":"420px";d.style.width=window.innerWidth-440+"px"}document.body.innerHTML=Je();R.aa();var c=-1!=rd.indexOf(sd),d=document.getElementById("blockly"),e=document.getElementById("paddingBox"),f=document.getElementById("staveBox"),h=document.getElementById("musicBox");window.addEventListener("scroll",function(){a(null);g.$k(I)}); +window.addEventListener("resize",a);a(null);var k=1.03333-.0333333*O,l=document.getElementById("toolbox");I=g.Dh("blockly",{disable:!1,media:"third-party/blockly/media/",rtl:c,toolbox:l,zoom:{maxScale:2,controls:!0,wheel:!0,startScale:k}});Aa(I,g.i.xx);Aa(I,cf);ke("play,rest,setInstrument,start0,start1,start2,start3,start4,start5,start6,start7,start8,start9");document.getElementById("submitButton")&&Dd("submitButton",df);k=document.getElementById("slider");me=new Ke(k);R.tF('',10!=O||ef);if(6location.hash.length&&!Ad(O)&&setTimeout(lf,1E3)});function kf(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/SoundJS/soundjs.min.js";a.onload=mf;document.head.appendChild(a)} +function mf(){for(var a="piano trumpet violin drum flute banjo guitar choir".split(" "),c=[],d=0;d/g,">");d=d.replace(/%1/g,e);R.ot("sampleHelp2", +d)}else 6==O?R.ot("sampleHelp6",''):7==O&&R.ot("sampleHelp7",'');Q.xj(a,c,!0,!0,{width:"50%",left:"25%",top:"5em"},qf);Q.bq()}function qf(){Q.eq()} +function cf(a){var c=document.getElementById("toolbox"),d=document.getElementById("music_start");if(d){var e=Z?Z.length:4,f=U;if(a instanceof g.i.ie){for(var h=[],k=A(I,!1),l=0,m;m=k[l];l++)"music_start"!=m.type||m.Ng()||h.push(m);if(e +a.length&&h.length;)m=h.shift(),m.Eu(!1),a.push(m);e>a.length&&(d.setAttribute("disabled","false"),fd(c));U=a.length}U!=f&&jf()}} +function gf(){clearTimeout(We);for(var a=0,c;c=$e[a];a++)rf(c);Y=Ze=null;af=W=$e.length=0;bf=!1;document.getElementById("staveBox").innerHTML="";a=document.getElementById("musicContainer");a.innerHTML="";Ye=0;c=document.createElement("img");c.id="musicContainerWidth";c.src="common/1x1.gif";a.appendChild(c);if(Z){nf(Z.length);for(a=0;aO){m=Z[Y.Me-1];var n=Y.transcript;l=n.length-2;if(m[l]!=n[l]||m[l+1]!=n[l+1])k=!0}pf(Y.Me,W/64,String(f),e,k?"wrong":"");vf(h)};a.setProperty(c,"play",a.createNativeFunction(d));d=function(e,f){rf(Y);Y.Np=64*e+W;1O){var k=Z[Y.Me-1],l=Y.transcript,m=l.length-2;if(k[m]!=l[m]||k[m+1]W)break a}while(f);rf(e);e.Gk&&(R.zm(e.Gk,!1),e.Gk=null);e.done=!0}c?(yf()&&(R.yG(),10>O&&(U=0,Q.AD())),document.getElementById("spinner").style.visibility="hidden",bd(null), +bf=!0):(sf(),W++,We=setTimeout(xf,af+W*a-Date.now()))}function rf(a){var c=a.Ou;c&&(setTimeout(c.stop.bind(c),100),a.Ou=null)} +function sf(){var a=document.getElementById("musicBox"),c=document.getElementById("musicContainer"),d=document.getElementById("musicContainerWidth"),e=10>O?200:100;e=W?Math.round(W/64*256+10+e):a.scrollWidth+e;for(d.width=e;Yea)return!1;if((7==O||8==O)&&1>a||9==O&&3>a)return console.log("Not enough instruments. Found: "+a),a=document.getElementById("helpUseInstruments"), +c={width:"30%",left:"35%",top:"12em"},Q.xj(a,null,!1,!0,c,Q.eq),Q.bq(),!1}c=[void 0,void 0,16,23,38,47,47,53,55,71,void 0][O];d=0;var e=y(I);a=0;for(var f;f=e[a];a++)"music_instrument"!=f.type&&f.isEnabled()&&!rc(f)&&d++;return c&&d>c?(console.log("Too many blocks. Found: "+d+" Max: "+c),a=document.getElementById("helpUseFunctions"),c={width:"30%",left:"35%",top:"12em"},Q.xj(a,null,!1,!0,c,Q.eq),Q.bq(),!1):!0}function ef(a){return a.replace(/"music_rest_whole"/g,'"music_rest"')} +function df(){if(bf&&U){var a="data:image/png;base64,"+[void 0,"iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAAAAABVicqIAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfhDAQXCQ8DSgv8AAACEklEQVRo3mP8z0B7wMQwasmoJaOWjFoyasmoJaOWjFpCR0samV3p4JN/IqNxMjIt+UsPS248oIMll3fRI04WvKeDJcfX0yN1TaaHJRd66JFP+n7SwZLnsfTI8dtW09gSRlYGhq/Vn2lrSdACVgaGR620tYQvqp6N4efcczS15DtDdRgzw5sptI74xS4MDAu20zp1zZVl+D+B1pZIb+Fl2LWF1jWjXgwDQz/Nq99KXYZ9p2ltiWwKA8NMmjck/PUY9tDcEvkAhte7aG0Jg6/gt4M0t8SEi+EC7Rt3dgxvaW/Jf4Zf9Gim/qeHJay0t4SRgY32ljxn4KW9JfcZNGluyeefDLI0t2T3Nx4tmlty+hOTO80t2c9gQPNS+PAD1nCaW3LiJUMArS15sZ3JVorWlvyTlMkkSiELBZZIdb3XobolV7afu8bMZRyCaHpJE1tUEws22/NCCkMuOYaI/yQBYn1yqmY3jPntEanhSqQlTRPfURB5xFlSOPU3A60tKUZvvf+j/gDOHIyRAXHqWzIZPay4jUltbRAE3Rh6FH6QloSJ8MlSdAH2Cnaq+4QHXUvwfxIBI+HGGQfaKIrjTlYGqkc8WlJy2k6qHcRYkoTM4Sncy056biQcok8cECGnsvs/GYCYUvhxoSoDAwMDk1bK0v9kAUai1kjcvPCAQVBOSY3cFvPoQoxRS0YtGbVk1JLhbgkATHAP6cDyYR8AAAAASUVORK5CYII=", +"iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAAAAABVicqIAAAB8klEQVRo3u3aO0/CUBQA4FMjJsaBTg4uxcHEzZLowlLG3on6CwyDM/EXgLMD8AuAXyDbrYvt4uojTg4GBgc10dY4OZg6FHld0tflOJhzN3pP79f7OL20oASAX1aAEEIIIYQQTGTYj6pVlnGrv7TPNl8i6ldlgTdu8/eYGDnknttOgjAJ5ILbD8kiMyLPnNufiaOzINecX6U6IS3yzTkfpL2qdMix8/SVoevpkNfHRUcPGLNdQMyTNcZMDcDGy5MCM1kONU9KzNwHzDzZYCbbAsw82TEZA9Q8MUy2h7yE10su/qa1mwN8hL5IEEIIIYQQQgghhBBCyB8ivWpRUZRi24+JC9KUujH1wWuov42olhF1Wvae9LYb4w74fZyn32oX9cEUAMA/dPEn/sTFX10tYawKSxgu/w5AGzfknwoBliwybLu3AAB6fXSgK+SFZsnlyaA8CVbDdDCEVpzIJmKRxuwLifCk+XIUyCDe3DAsRmKMGMTTYRFSSWfEIMJ0hsjMC+f8eSCFNIXBr4xulJMjNS+QQjxVQDqjKiccMaPpJbl5RyEdwdCmah1nkHSHiEIqKdMh034i5HWtjL/9HrUQ9vi56653s25wkasrPz3nGecjNk9utDHRCSRKzA9nLdf9yOu6VQaZotAfMQghhBBC/jvyA6C+2c6ogwZuAAAAAElFTkSuQmCC", +"iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAAAAABVicqIAAAB4ElEQVRo3u2aPVKDUBCAl4ytA7U6k1hZQio7SUorMuMBoicgOQG5AXKC4AGcxMoyuQFJaQWeAGbsXYvEwPuBBxkZR2e3y9t979tfMnlEQ2hfOkAQghCEIASRyonS4vXjSq54Oz0rU9xyK6iSYXPPHe4IKjxBfnNO4PxOvv58cV2iaA65+Qzkiu1gVqKwqPAEIQhBCEIQghCEIAQhCEEIQpA/DcmeHi41TesH2Y/+jmcQ0+Xu8M3ksS1IMMv9T9qBZNPwuJo0gGTDTfuFP5rRADI5mlGVrmwLYBqHOovXOCN+IXkHsBtAkmCZAAAMvP2C2LE2exn0Eq4zADBGnnia9Jo2GuQGPRsREXvCzqi4I8z1Rs/jjpNCJqzHO0Ne/BKnAKAGJOXuxOSQcZFhQCWkU3ccuuxHtzCXy77qOSYEYgkFRkTEeXFJX1XEUSNdYm/sEzPOEV5a6RUsFJBYjPXb64UDAADOnEGwIe4yiwqIL2wxC9rVKhbSK/a2p4LY1eMgSlzpVc1XG3OrWi98rehh4weke68w4FtLX1vKFna5OJQvipAdoK4su0J36cXsRmoG211uijUgGB0o3RphsJPllDglTnzq2wC67UVYV2LXBDAdPy4z0OiPGAQhCEEI8t8hX5wfXfFkGIkcAAAAAElFTkSuQmCC", +"iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAAAAABVicqIAAACU0lEQVRo3u2aTY7aQBCFnyMWkRLJZjkrs8rWzlwAcwLgBMAJ4AYWJwBOYOYEkBPYXCD2Ohs7J7AjJcomUmXhAf90N+OMbWmkVG2A6nZ/7q56JSijEfq3d2AIQxjy/0AGUu/w93v59B8fBooBXe7/84sATVq7hll32yAOPKdw1R4e5P6vnz4qBh7l/p/fAIBkNnZJbvBVAwq/DyLiwDOEIQxhCEMYwhCGMIQhDGEIQ97iT+ymdgkCwJhNjd4g2eGYAADOxq4vyHZ/a1hlq34g2STqPfDR5xoj6R6STOqL9gCZC/3DUeeQvRAPszUkOUyGmqbNn66OgzBlc3eBl1tR4ew22clbUb6wipnea0W9mMLZdl98CCovJTsabXQSrZrIwXPaiDGayNrQ9SB7yzZiTKQMLCs9c9NftlL8XNFOPxdvdTdy/rHUJ9+BcRFOIR56vqATbi75LjYzlUAuhXjKkC/HIANgONfCvVXKwQ6SIIEzUhCSp3MEAPbSqurkVFxgjFwiori5HCqWlmJko9TPTasH68o1FzZheEZd7YN7qSrIwW4waXVUlJWwLljZcemnJvtYSgAgIoqFopDXrkXZZcVNGGuoIGKi5zedWkXIvSYISRitZ4gnjOjXLHItADAXjU6KiMSUdp8hDuSnle/G91Nqar78dkFEr5SDxFxhqR0pHm3oZ6OrL6iLjaJA6nu7K8Z4f8sws8oI6dVWS6FF6THRqTwwTamFWVLxonoDU59aWaEs001rD7zitQWY011Mrc2b6tDH64qwNP5zDEMYwpBu7S/9DO5PRs/ScgAAAABJRU5ErkJggg=="][U], +c=document.getElementById("thumbnail").getContext("2d");c.globalCompositeOperation="copy";var d=new Image;d.onload=function(){c.drawImage(d,0,0,200,200)};d.src=a;document.getElementById("galleryThumb").value=a;Q.Nu()}else alert(P("Music_submitDisabled"))}function wf(a,c){this.Me=a;this.stateStack=c;this.transcript=[];this.Oy="piano";this.Np=0;this.Ou=this.Gk=null;this.zu=10>O;this.done=!1}; diff --git a/html/blockly-games/music/icons.png b/html/blockly-games/music/icons.png new file mode 100644 index 0000000..7809722 Binary files /dev/null and b/html/blockly-games/music/icons.png differ diff --git a/html/blockly-games/music/note0.03125.png b/html/blockly-games/music/note0.03125.png new file mode 100644 index 0000000..0fc30b4 Binary files /dev/null and b/html/blockly-games/music/note0.03125.png differ diff --git a/html/blockly-games/music/note0.0625.png b/html/blockly-games/music/note0.0625.png new file mode 100644 index 0000000..28d3ae4 Binary files /dev/null and b/html/blockly-games/music/note0.0625.png differ diff --git a/html/blockly-games/music/note0.125.png b/html/blockly-games/music/note0.125.png new file mode 100644 index 0000000..b74d47e Binary files /dev/null and b/html/blockly-games/music/note0.125.png differ diff --git a/html/blockly-games/music/note0.25.png b/html/blockly-games/music/note0.25.png new file mode 100644 index 0000000..8fcf5c5 Binary files /dev/null and b/html/blockly-games/music/note0.25.png differ diff --git a/html/blockly-games/music/note0.5.png b/html/blockly-games/music/note0.5.png new file mode 100644 index 0000000..ca2437e Binary files /dev/null and b/html/blockly-games/music/note0.5.png differ diff --git a/html/blockly-games/music/note1.png b/html/blockly-games/music/note1.png new file mode 100644 index 0000000..7c9e70c Binary files /dev/null and b/html/blockly-games/music/note1.png differ diff --git a/html/blockly-games/music/notes.png b/html/blockly-games/music/notes.png new file mode 100644 index 0000000..b9a57b5 Binary files /dev/null and b/html/blockly-games/music/notes.png differ diff --git a/html/blockly-games/music/play.png b/html/blockly-games/music/play.png new file mode 100644 index 0000000..59cb8b3 Binary files /dev/null and b/html/blockly-games/music/play.png differ diff --git a/html/blockly-games/music/rest0.03125.png b/html/blockly-games/music/rest0.03125.png new file mode 100644 index 0000000..11e4c9d Binary files /dev/null and b/html/blockly-games/music/rest0.03125.png differ diff --git a/html/blockly-games/music/rest0.0625.png b/html/blockly-games/music/rest0.0625.png new file mode 100644 index 0000000..83da5ef Binary files /dev/null and b/html/blockly-games/music/rest0.0625.png differ diff --git a/html/blockly-games/music/rest0.125.png b/html/blockly-games/music/rest0.125.png new file mode 100644 index 0000000..80a62d1 Binary files /dev/null and b/html/blockly-games/music/rest0.125.png differ diff --git a/html/blockly-games/music/rest0.25.png b/html/blockly-games/music/rest0.25.png new file mode 100644 index 0000000..98c2fa3 Binary files /dev/null and b/html/blockly-games/music/rest0.25.png differ diff --git a/html/blockly-games/music/rest0.5.png b/html/blockly-games/music/rest0.5.png new file mode 100644 index 0000000..4738410 Binary files /dev/null and b/html/blockly-games/music/rest0.5.png differ diff --git a/html/blockly-games/music/rest1.png b/html/blockly-games/music/rest1.png new file mode 100644 index 0000000..9b3d7e4 Binary files /dev/null and b/html/blockly-games/music/rest1.png differ diff --git a/html/blockly-games/music/stave.png b/html/blockly-games/music/stave.png new file mode 100644 index 0000000..714243f Binary files /dev/null and b/html/blockly-games/music/stave.png differ diff --git a/html/blockly-games/music/style.css b/html/blockly-games/music/style.css new file mode 100644 index 0000000..f7ccca4 --- /dev/null +++ b/html/blockly-games/music/style.css @@ -0,0 +1,157 @@ +button.primary { + /* Can't use "text-align: start" due to IE. */ + text-align: left; +} + +html[dir="RTL"] button.primary { + text-align: right; +} + +#blockly { + position: fixed; + bottom: 10px; +} + +#paddingBox { + height: 400px; + width: 400px; +} + +#staveBox { + position: absolute; + border: 1px solid #ccc; + height: 400px; + width: 400px; +} + +.stave { + height: 69px; + width: 400px; + position: absolute; +} + +.note { + height: 37px; + position: absolute; +} + +.rest { + height: 31px; + position: absolute; +} + +.splash { + transition-property: height, opacity, width, margin; + transition-duration: .3s; + opacity: 0; +} + +.splash.note { + margin-left: -10px; + margin-top: -30px; + height: 74px; +} + +.splash.rest { + margin-left: -8px; + margin-top: -6px; + height: 62px; +} + +.goal { + opacity: .4; +} + +.wrong { + filter: invert(50%) sepia(100%) saturate(10000%) +} + +.ledgerLine { + height: 1px; + width: 20px; + position: absolute; +} + +.ledgerLineWide { + height: 1px; + width: 27px; + position: absolute; +} + +.barLine { + height:36px; + width: 1px; + position: absolute; +} + +#musicBox { + direction: ltr; + position: absolute; + height: 400px; + width: 365px; + overflow-x: scroll; + overflow-y: hidden; + margin-left: 36px; +} + +#notePicker { + background-image: url(notes.png); + border: 1px solid #ccc; + height: 109px; + width: 46px; +} + +.sampleNote { + float: left; + height: 37px; + margin: 10px; +} + +html[dir="RTL"] .sampleNote { + float: right; +} + +#sampleHelp2 { + height: 150px; + width: 250px; +} + +#sampleHelp6, #sampleHelp7 { + height: 50px; + width: 250px; +} + +/* Slider. */ +.sliderTrack { + stroke: #aaa; + stroke-width: 6px; + stroke-linecap: round; +} +.sliderKnob { + fill: #ddd; + stroke: #bbc; + stroke-width: 1px; + stroke-linejoin: round; +} +.sliderKnob:hover { + fill: #eee; +} + +/* Sprited icons. */ +.icon21 { + height: 21px; + width: 21px; + background-image: url(icons.png); +} +.camera { + background-position: -21px 0px; +} +.stop { + background-position: -42px 0px; +} +.run { + background-position: -63px 0px; +} +.gallery { + background-position: -63px -21px; +} diff --git a/html/blockly-games/pond-duck.html b/html/blockly-games/pond-duck.html new file mode 100644 index 0000000..1486154 --- /dev/null +++ b/html/blockly-games/pond-duck.html @@ -0,0 +1,16 @@ + + + + + + + Blockly Games : Pond + + + + + + + + + diff --git a/html/blockly-games/pond-tutor.html b/html/blockly-games/pond-tutor.html new file mode 100644 index 0000000..17fe38b --- /dev/null +++ b/html/blockly-games/pond-tutor.html @@ -0,0 +1,17 @@ + + + + + + + Blockly Games : Pond Tutor + + + + + + + + + + diff --git a/html/blockly-games/pond/boom.mp3 b/html/blockly-games/pond/boom.mp3 new file mode 100644 index 0000000..2b35182 Binary files /dev/null and b/html/blockly-games/pond/boom.mp3 differ diff --git a/html/blockly-games/pond/boom.ogg b/html/blockly-games/pond/boom.ogg new file mode 100644 index 0000000..825282a Binary files /dev/null and b/html/blockly-games/pond/boom.ogg differ diff --git a/html/blockly-games/pond/crobots.txt b/html/blockly-games/pond/crobots.txt new file mode 100644 index 0000000..ffe414b --- /dev/null +++ b/html/blockly-games/pond/crobots.txt @@ -0,0 +1,69 @@ +Pond is a reimplementation of Tom Poindexter's 1985 game CROBOTS. Google has +(with the author's permission) updated the game to be playable by a new +generation of programmers. + +Differences between Pond and CROBOTS: + +* Theme +CROBOTS features robots fighting in a battlefield. Given today's diversity +priorities, a different theme was needed. The reimplementation features +rubber ducks in a pond. + +* Battlefield size +Height and width of battlefield is 100m x 100m instead of 1000m x 1000m. +Since speed and damage/health go to 100, scaling the pond's size to the same +magnitude makes for a cleaner API. This was not possible in CROBOTS since +integers were the only data type, whereas JavaScript has floats. + +* Scan resolution +CROBOTS scans in a direction with a resolution of +/- n degrees. Pond scans +with a total resolution of n degrees. The only difference is that Pond's +resolution number is double that specified in CROBOTS. + +* Failed scan +CROBOTS returns 0 for a scan that failed to detect another player. +Pond returns Infinity. + +* Impact damage +CROBOTS gives a flat 2% damage to robots colliding with a wall or another robot. +Pond gives up to 3% damage, proportional to the speed at impact. + +* Blast damage +CROBOTS gives 3%/5%/10% damage to robots within 40m/20m/5m of an explosion. +Pond uses a proportional formula ((1 - r / 4) * 10) which is similar (after +accounting for the 10x decrease in battlefield size), but slightly increases +the value of accuracy. + +* Swim +Because of the rubber duck theme, 'swim()' has been added as an alias to +CROBOT's 'drive()'. Pond supports 'drive()' as an undocumented function. + +* Stop +Pond introduces a new function 'stop()' that is the equivalent of +'drive(0, d)', where d is the current driving direction. + +* Health +People are more used to games having 'health' (more is better) rather than +'damage' (less is better). Pond introduces 'health()', with 'damage()' being +an undocumented function. + +* Trigonometry +CROBOTS has top-level sin/cos/tan/atan functions that use degrees. +Pond adds these to the JavaScript Math object as Math.sin_deg/Math.cos_deg/etc. + +* Constants +Various constants such as acceleration rate, robot-missile speed ratio, etc are +tuned differently. These differences are not intentional. + +Google is indebted to Tom Poindexter for inspiring so many young people to +learn about programming through his game. We hope to continue this success +with Pond. As with CROBOTS, all the code for Pond is open source. + +The original DOS-based CROBOTS game may be found here: + http://crobots.deepthought.it/home.php + https://github.com/tpoindex/crobots/ + +-- +Neil Fraser +Google, California +August 2014 diff --git a/html/blockly-games/pond/docs.html b/html/blockly-games/pond/docs.html new file mode 100644 index 0000000..f980724 --- /dev/null +++ b/html/blockly-games/pond/docs.html @@ -0,0 +1,13 @@ + + + + + + Blockly Games : Pond Documentation + + + + + + + diff --git a/html/blockly-games/pond/docs/compass.png b/html/blockly-games/pond/docs/compass.png new file mode 100644 index 0000000..3dfb995 Binary files /dev/null and b/html/blockly-games/pond/docs/compass.png differ diff --git a/html/blockly-games/pond/docs/generated/pt-br/compressed.js b/html/blockly-games/pond/docs/generated/pt-br/compressed.js new file mode 100644 index 0000000..7121f31 --- /dev/null +++ b/html/blockly-games/pond/docs/generated/pt-br/compressed.js @@ -0,0 +1,38 @@ +// Automatically generated file. Do not edit! + +'use strict'; +var e=Number,f,g=window.location.search.match(/[?&]level=([^&]+)/);f=g?decodeURIComponent(g[1].replace(/\+/g,"%20")):"NaN";e(f);if(!h){var h,k="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(k=navigator.userAgent);var l=0==k.indexOf("Opera");h={l:{g:"ScriptEngine"in window},i:l,h:!l&&-1!=k.indexOf("MSIE"),j:!l&&-1!=k.indexOf("WebKit")}}if(!m)var m={};if(!n)var n={};if(!p)var p={};if(!q)var q={};if(!r)var r={};if(!t)var t={}; +function u(b){b=b.currentTarget;var a=document.getElementById(b.id+"-content"),c="zippy-content-expanded"==a.className;b.className="zippy-header-"+(c?"collapsed":"expanded");a.className="zippy-content-"+(c?"collapsed":"expanded");a.style.maxHeight=c?0:a.scrollHeight+"px"} +window.addEventListener("load",function(){var b=window.location.search.match(/[?&]mode=([^&]+)/);b=b?Number(b[1]):Infinity;var a=b%2?"blocks":"js";document.body.innerHTML='

Pond Documentation

Pond

Angles

The compass is oriented so that due east (right) is 0 degrees, 90 is north, 180 is west, 270 is south. Angles wrap as expected: -90 is south, 450 is north.

Cannon

'+("blocks"== +a?'

cannon(,);0\u00b070

': +"js"==a?'
cannon(angle, range)
':"")+"

The cannon() function fires a cannonball towards the specified angle and range. The angle is independent of the direction of the duck. The range can be 0-70 metres, with greater ranges truncated to 70.

The cannon takes about one second to reload after firing. If cannon() is called during this time, nothing happens."+("js"==a?" cannon() returns true if a cannonball was fired, or false if the cannon is reloading.": +"")+"

"+(5<=b?"

Scan

"+("blocks"==a?'

scan()0\u00b0

': +"js"==a?'
scan(angle)\nscan(angle, width)
':"")+"

The scan() function activates the duck's radar. This function returns the range to the nearest opponent in the specified direction. The angle is independent of the direction of the duck. Sunk opponents are not detected. If there is no opponent in that direction, then Infinity is returned.

"+("js"==a?"

The second (optional) parameter of scan() specifies the width of the scanning beam. This can be from 1 degree to 20 degrees. Advanced players may wish to start scanning with a width of 20 for a fast scan, then progressively decrease the width to get more accuracy. If not specified, the width is 5. This parameter is only available with JavaScript, not with blocks.

": +""):"")+(7<=b?"

Swim

"+("blocks"==a?'

swim();0\u00b0

': +"js"==a?'
swim(angle)\nswim(angle, speed)
':"")+"

The swim() function starts the duck moving. The duck will continue moving in the specified direction indefinitely.

"+("js"==a?"

The second (optional) parameter of swim() specifies the speed. This can be from 0 (stopped) to 100 (fast). Direction of movement may only be changed if the speed is 50 or less. If not specified, the speed is 50. This parameter is only available with JavaScript, not with blocks.

": +"")+"

Crashing into the edges of the pond will damage your duck. Crashing into other ducks will damage both ducks. The amount of damage is proportional to your speed.

":"")+(9<=b?"

Stop

"+("blocks"==a?'

stop();

': +"js"==a?'
stop()
':"")+"

The stop() function stops the duck from moving. The duck will take a moment to slow down before stopping completely."+("js"==a?"This is the same as calling swim() with a speed of zero.":"")+"

":"")+(9<=b?"

Location

"+("blocks"==a?'

getX()   getY()

': +"js"==a?'
getX()\ngetY()
':"")+'

The getX() and getY() functions return the duck\'s horizontal and vertical positions. Values are between 0 and 100, starting from the lower-left corner.

':"")+(11<=b?"

Speed

"+("blocks"==a?'

speed()

': +"js"==a?'
speed()
':"")+"

The speed() function returns the duck's current speed. Values are between 0 (stopped) and 100 (fast). This function may be used to detect collisions (which instantly stop the duck).

":"")+(11<=b?"

Health

"+("blocks"==a?'

health()

': +"js"==a?'
health()
':"")+"

The health() function returns the duck's current health level. Values are between 0 (sunk) and 100 (perfect). Advanced players may wish to store the health in a variable, then periodically check to see if the health has decreased, thus indicating that the duck is under attack.

There is no way to repair health.

":"")+"
"+(3<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e

Logic

'+ +(9<=b?"

If

"+("blocks"==a?'

if () {}

': +"js"==a?'
if (condition) {\n  statements\n}\n\n\nif (condition) {\n  statements\n} else if (condition) {\n  statements\n}\n\n\nif (condition) {\n  statements\n} else {\n  statements\n}
':"")+"

If the condition is true, then execute the contained statements. The if may be followed by any number of other else if conditions, and at the end by an optional else condition that executes if none of the previous conditions were true.

": +"")+(9<=b?"

Equality

"+("blocks"==a?'

== \u25be

': +"js"==a?'
==    !=    <    <=    >    >=
':"")+"

These expressions compare two numbers and return true or false. The six available equality operators are:

OperatorExampleReturns
Equals5 == 10false
Not equals5 != 10true
Less than5 < 10true
Less than or equal5 <= 10true
Greater than5 > 10false
Greater than or equal5 >= 10false

Use of != may be dangerous if the numbers being compared are fractions. Consider this code that is designed to swim to 50 then stop:

while (getY() != 50) {\n  swim(90"+
+("js"==a?", 50":"")+");\n}\nstop();

The above code will fail because getY() may be 49.4 on one execution, then 50.6 on the next execution. Since the value was not seen at exactly 50, the loop continues forever. Below is better code:

while (getY() < 50) {\n  swim(90"+("js"==a?", 50":"")+");\n}\nstop();
":"")+(11<=b?"

And/Or

"+("blocks"==a?'

&& \u25be

': +"js"==a?'
&&    ||
':"")+"

'And' is represented by the && operator. It returns true only if both inputs are true. For example this code will only fire the cannon if the range is both greater than 5 and less than 70:

if (range > 5 && range < 70) {\n  cannon(angle, range);\n}

'Or' is represented by the || operator. It returns true if either input is true. For example this code will stop if the duck is close to any wall:

if (getX() < 10 || getX() > 90 ||\n    getY() < 10 || getY() > 90) {\n  stop();\n}
": +"")+"

Booleans

"+("blocks"==a?'

true \u25be

': +"js"==a?'
true    false
':"")+"

The value true is mainly used by the while loop to make a loop that executes forever. The value false is also available.

":"")+(3<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e

Loops

While

'+("blocks"==a?'

while () {}

': +"js"==a?'
while (condition) {\n  statements\n}
':"")+"

Loops will repeat executing the enclosed statements as long as the condition is true. Thus, the following will fire the cannon west forever:

while (true) {\n  cannon(180, 50);\n}

Whereas the following will fire the canon west as long as an opponent is in range:

while (scan(180"+("js"==a?", 5":"")+") <= 70) {\n  cannon(180, scan(180"+("js"==a?", 5":"")+"));\n}
": +"")+'\x3c!-- ---------------------------------------------------------------------- --\x3e

Math

Number

'+("blocks"==a?'

0

': +"js"==a?'
123
':"")+"

Numbers are used for many things, including ranges, angles, and counters. Numbers may be negative (e.g. -360), or fractional (e.g. 3.14159), or very large (e.g. 9007199254740992). There is even a special number called Infinity.

Do not use thousands separators (e.g. 9,000).

"+(11<=b?"

Arithmetic

"+("blocks"==a?'

+ \u25be21

': +"js"==a?'
+    -    *    /
':"")+"

These operators take two numbers and return a single number. The four available arithmetic operators are:

OperatorExampleReturns
Plus3 + 47
Minus3 - 4-1
Multiply3 * 412
Divide3 / 40.75
": +"")+(11<=b?"

Trigonometry

"+("blocks"==a?'

Math.sqrt \u25be()9

': +"js"==a?'
Math.operation(number)
':"")+"

These functions take a number and return a number. The eight available functions are:

FunctionExampleReturns
Square rootMath.sqrt(25)5
AbsoluteMath.abs(-25)25
SineMath.sin_deg(30)0.5
CosineMath.cos_deg(30)0.866
TangentMath.tan_deg(30)0.577
ArcsineMath.asin_deg(0.5)30
ArccosineMath.acos_deg(0.866)30.003
ArctangentMath.atan_deg(0.577)29.985

Note that these trigonmetric functions are custom to the Pond game and all use degrees. The standard JavaScript functions use radians.

": +"")+(11<=b?"

Random

"+("blocks"==a?'

Math.random  (  )

': +"js"==a?'
Math.random()
':"")+"

This function returns a random fraction from 0.0 to 1.0. To get a random number in a larger range, just multiply it by the maximum value. Here's an example of getting a random angle:

var angle = Math.random() * 360;
":"")+"
"+(11<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e

Variables

Assigning

'+("blocks"==a?'

varname \u25be=;0

': +"js"==a?'
var name = value;
':"")+"

Assigns a value (usually a number) to the named variable. The name of the variable should be something that makes sense, such as range or angle.

"+("js"==a?"

Note that variable names are case-sensitive, thus angle and Angle are two completely different variables. Variable names must only use the English letters a-z, and numbers. Variable names may not start with a number.

The var keyword may be omitted on all but the first assignment, but there is no harm in using it.

": +"")+"

Incrementing

"+("blocks"==a?'

name \u25be+=;1

': +"js"==a?'
name += number;
':"")+"

This is a shortcut for adding a number to an existing variable. There is no difference between the following two lines:

angle += 10;\nvar angle = angle + 10;

Do not use += on a variable that has not already been defined. If in doubt, assign the variable to 0 at the beginning of the program.

Retrieving

"+("blocks"==a?'

name \u25be

': +"js"==a?'
name
':"")+"

Retrieves the value (usually a number) that had previously been assigned to the named variable.

":"")+(11<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e

Functions

TODO

':"");b=document.getElementsByTagName("h2");a=0;for(var c;c=b[a];a++){var d=document.createElement("img");d.src="../common/1x1.gif";c.insertBefore(d,c.firstChild); +c.className="zippy-header-collapsed";document.getElementById(c.id+"-content").className="zippy-content-collapsed";d=u;if(!c)throw TypeError("Element not found: "+c);"string"==typeof c&&(c=document.getElementById(c));c.addEventListener("click",d,!0);c.addEventListener("touchend",d,!0)}}); diff --git a/html/blockly-games/pond/docs/map.png b/html/blockly-games/pond/docs/map.png new file mode 100644 index 0000000..14c7042 Binary files /dev/null and b/html/blockly-games/pond/docs/map.png differ diff --git a/html/blockly-games/pond/docs/style.css b/html/blockly-games/pond/docs/style.css new file mode 100644 index 0000000..7a8b857 --- /dev/null +++ b/html/blockly-games/pond/docs/style.css @@ -0,0 +1,133 @@ +body { + overflow-x: hidden; + overflow-y: scroll; +} + +h2 { + font-size: 120%; + font-weight: normal; +} + +h3 { + font-weight: normal; +} + +td, th { + padding: 0 6px; +} + +pre, code { + font-size: large; +} + +.spec { + padding: 1ex; + border-radius: 5px; +} + +.pondSpec { + border: 2px solid rgb(133, 65, 155); + background: rgba(133, 65, 155, 0.2); +} + +.logicSpec { + border: 2px solid rgb(74, 107, 153); + background: rgba(74, 107, 153, 0.2); +} + +.loopsSpec { + border: 2px solid rgb(77, 154, 61); + background: rgba(77, 154, 61, 0.2); +} + +.mathSpec { + border: 2px solid rgb(73, 80, 155); + background: rgba(73, 80, 155, 0.2); +} + +.variablesSpec { + border: 2px solid rgb(147, 68, 111); + background: rgba(147, 68, 111, 0.2); +} + +.functionsSpec { + border: 2px solid rgb(133, 65, 155); + background: rgba(133, 65, 155, 0.2); +} + +.zippy-header-collapsed>img { + background-image: url('zippy-plus.png'); +} + +.zippy-header-expanded>img { + background-image: url('zippy-minus.png'); +} + +.zippy-header-collapsed, +.zippy-header-expanded { + outline: 0; + background-color: #eee; + padding: 10px; + border-radius: 20px; +} + +.zippy-header-collapsed>img, +.zippy-header-expanded>img { + height: 28px; + margin-right: 1ex; + width: 28px; + vertical-align: bottom; +} + +.zippy-content-collapsed, +.zippy-content-expanded { + max-height: 0; + overflow: hidden; + transition: all .5s ease; +} + +.zippy-content-collapsed { + opacity: 0; +} + +.zippy-content-expanded { + opacity: 1; +} + +.blocklyPathLight { + fill: none; + stroke-linecap: round; + stroke-width: 1; +} + +.blocklyText { + cursor: default; + fill: #fff; + font-family: sans-serif; + font-size: 11pt; +} + +.blocklyNonEditableText>rect, +.blocklyEditableText>rect { + fill: #fff; + fill-opacity: .6; +} + +.blocklyNonEditableText>text, +.blocklyEditableText>text { + fill: #000; +} + +.blocklyIconGroup { + opacity: .6; +} + +.blocklyIconShape { + fill: #00f; + stroke: #fff; + stroke-width: 1px; +} + +.blocklyIconSymbol { + fill: #fff; +} diff --git a/html/blockly-games/pond/docs/zippy-minus.png b/html/blockly-games/pond/docs/zippy-minus.png new file mode 100644 index 0000000..c9eebeb Binary files /dev/null and b/html/blockly-games/pond/docs/zippy-minus.png differ diff --git a/html/blockly-games/pond/docs/zippy-plus.png b/html/blockly-games/pond/docs/zippy-plus.png new file mode 100644 index 0000000..3480bf0 Binary files /dev/null and b/html/blockly-games/pond/docs/zippy-plus.png differ diff --git a/html/blockly-games/pond/duck/generated/pt-br/compressed.js b/html/blockly-games/pond/duck/generated/pt-br/compressed.js new file mode 100644 index 0000000..d476232 --- /dev/null +++ b/html/blockly-games/pond/duck/generated/pt-br/compressed.js @@ -0,0 +1,861 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,g={ed:{}};g.ed.Ft=!1;g.ed.register=function(a){if(g.ed.Ft)throw Error("CSS already injected");Array.prototype.push.apply(g.ed.Oq,a);a.length=0};g.ed.Th=function(a,c){if(!g.ed.Ft){g.ed.Ft=!0;var d=g.ed.Oq.join("\n");g.ed.Oq.length=0;a&&(a=c.replace(/[\\/]$/,""),d=d.replace(/<<>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};g.ed.Su=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +g.ed.Oq=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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;","}"]; +g.g={};g.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();g.h={};g.g.global.Blockly||(g.g.global.Blockly={});g.g.global.Blockly.Msg||(g.g.global.Blockly.Msg=g.h);g.g.N=function(a,c){this.x=a;this.y=c};g.g.N.He=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};g.g.N.jp=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};g.g.N.XF=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};g.g.N.xm=function(a,c){return new g.g.N(a.x-c.x,a.y-c.y)};g.g.N.sum=function(a,c){return new g.g.N(a.x+c.x,a.y+c.y)};g.g.N.prototype.scale=function(a){this.x*=a;this.y*=a;return this};g.g.N.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};g.g.eb={};g.g.eb.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};g.g.eb.Zu=function(a){return a.length?a.reduce(function(c,d){return c.lengthc&&(c=d[e].length);e=-Infinity;var f=1;do{var h=e;var k=a;a=[];var l=d.length/f,m=1;for(e=0;eh);return k}; +g.g.eb.pv=function(a,c,d){for(var e=[0],f=[],h=0;he&&(e=l,f=k)}return f?g.g.eb.GA(a,f,d):c};g.g.eb.NH=function(a,c){for(var d=[],e=0;e=l?(f=2,h=l,(l=a.join(""))&&d.push(l),a.length=0):"{"==l?f=3:(a.push("%",l),f=0):2==f?"0"<=l&&"9">=l?h+=l:(d.push(parseInt(h,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=g.g.eb.startsWith(l,"BKY_")? +l.substring(4):null)&&l in g.h?(f=g.h[l],"string"==typeof f?Array.prototype.push.apply(d,g.g.gv(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;kd;d++)c[d]=g.g.Rg.kA.charAt(Math.random()*a);return c.join("")}; +g.g.Rg.kA="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +g.g.oj=function(){if(void 0!==g.g.oj.ps)return g.g.oj.ps;if(!g.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=g.g.global.getComputedStyle(a);if(!c)return document.body.removeChild(a),!1;c=c.getPropertyValue(d[e])}document.body.removeChild(a); +g.g.oj.ps="none"!==c;return g.g.oj.ps};g.g.aA=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)};g.g.iF=function(){var a=g.g.style.Ey();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +g.g.Qo=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};g.g.bF=function(){var a=document.documentElement,c=window;return g.g.userAgent.vg&&c.pageYOffset!=a.scrollTop?new g.g.N(a.scrollLeft,a.scrollTop):new g.g.N(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};g.g.gt=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=q(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}; +g.g.YG=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new g.g.N(d-e.left,c-e.top);c=g.g.Jm(a.fb);return g.g.N.xm(d,c).scale(1/a.scale)};g.g.o={};g.g.o.Vl="http://www.w3.org/2000/svg";g.g.o.Fi="http://www.w3.org/1999/xhtml";g.g.o.Kf="http://www.w3.org/1999/xlink";g.g.o.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};g.g.o.Wi=null;g.g.o.ns=0;g.g.o.I=function(a,c,d){a=document.createElementNS(g.g.o.Vl,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}; +g.g.o.mb=function(a,c){var d=a.getAttribute("class")||"";if(-1!=(" "+d+" ").indexOf(" "+c+" "))return!1;d&&(d+=" ");a.setAttribute("class",d+c);return!0};g.g.o.Tb=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+this.Nh&&(e+=f);ea(this,na(this,e));la(this);a.stopPropagation();a.preventDefault()}}; +b.AG=function(a){pa(this.s);fa();g.g.tj(a)?a.stopPropagation():(this.jH=this.Nm,ra(this.s),this.mA=this.lj?a.clientX:a.clientY,g.La.Qe=g.la(document,"mouseup",this,this.FG),g.La.ii=g.la(document,"mousemove",this,this.BG),a.stopPropagation(),a.preventDefault())};b.BG=function(a){ea(this,na(this,this.jH+((this.lj?a.clientX:a.clientY)-this.mA)));la(this)};b.FG=function(){sa(this.s);g.Touch.Dh();fa()};function fa(){g.rc(!0);g.La.Qe&&(g.Xa(g.La.Qe),g.La.Qe=null);g.La.ii&&(g.Xa(g.La.ii),g.La.ii=null)} +function na(a,c){return c=0>=c||isNaN(c)||a.Teimage, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);g.YL={};g.ew=40;g.pw=125;g.vB=5;g.EB=10;g.vd=28;g.kB=g.vd;g.nB=8;g.TB="#000000";g.co=250;g.Lq=10;g.hB=30;g.hC=750;g.MC=100;g.wB=!0;g.PB=.45;g.QB=.65;g.wd={width:96,height:124,url:"sprites.png"};g.Wa=1;g.Ye=2;g.jb=3;g.Ze=4;g.tg=5;g.Hq=-1;g.xv=0;g.yl=1;g.BI=0;g.CI=1;g.zI=1;g.AI=2;g.nk=[];g.nk[g.Wa]=g.Ye;g.nk[g.Ye]=g.Wa;g.nk[g.jb]=g.Ze;g.nk[g.Ze]=g.jb;g.Dg=0;g.Oi=1;g.Nd=2;g.Cg=3;g.Ov=null;g.Sq=1;g.Pv=2;g.Hw="VARIABLE";g.cD="VARIABLE_DYNAMIC";g.qw="PROCEDURE";g.xw="RENAME_VARIABLE_ID";g.Qv="DELETE_VARIABLE_ID";g.i={};g.i.Iy="";g.i.Jc=!0;g.i.Is=0;g.i.mo="create";g.i.Al=g.i.mo;g.i.Dl="delete";g.i.ao=g.i.Dl;g.i.zi="change";g.i.$H=g.i.zi;g.i.Nl="move";g.i.Dv=g.i.Nl;g.i.Iw="var_create";g.i.Jw="var_delete";g.i.Kw="var_rename";g.i.Oo="ui";g.i.io="comment_create";g.i.Jv="comment_delete";g.i.Iv="comment_change";g.i.jo="comment_move";g.i.DB="finished_loading";g.i.$A=[g.i.Al,g.i.Dv,g.i.io,g.i.jo];g.i.Fl=[];g.i.Ma=function(a){g.i.isEnabled()&&(g.i.Fl.length||setTimeout(g.i.ME,0),g.i.Fl.push(a))}; +g.i.ME=function(){for(var a=g.i.filter(g.i.Fl,!0),c=g.i.Fl.length=0,d;d=a[c];c++)if(d.xc){var e=g.Jb.jt(d.xc);if(e){var f=d;if(f.Jc)for(e.Uj.push(f),e.tn.length=0;e.Uj.length>e.fw&&0<=e.fw;)e.Uj.shift();for(var h=0;d=e.Dd[h];h++)d(f)}}}; +g.i.filter=function(a,c){a=a.slice();c||a.reverse();for(var d=[],e=Object.create(null),f=0,h;h=a[f];f++)if(!h.Vk()){var k=[h.type,h.Bc,h.xc].join(" "),l=e[k],m=l?l.event:null;if(!l)e[k]={event:h,index:f},d.push(h);else if(h.type==g.i.Nl&&l.index==f-1)m.Bj=h.Bj,m.Aj=h.Aj,m.di=h.di,l.index=f;else if(h.type==g.i.zi&&h.element==m.element&&h.name==m.name)m.newValue=h.newValue;else if(h.type!=g.i.Oo||"click"!=h.element||"commentOpen"!=m.element&&"mutatorOpen"!=m.element&&"warningOpen"!=m.element)e[k]={event:h, +index:1},d.push(h)}a=d.filter(function(n){return!n.Vk()});c||a.reverse();for(f=1;h=a[f];f++)h.type==g.i.zi&&"mutation"==h.element&&a.unshift(a.splice(f,1)[0]);return a};g.i.RD=function(){for(var a=0,c;c=g.i.Fl[a];a++)c.Jc=!1};g.i.disable=function(){g.i.Is++};g.i.enable=function(){g.i.Is--};g.i.isEnabled=function(){return 0==g.i.Is};g.i.$b=function(){return g.i.Iy};g.i.$=function(a){g.i.Iy="boolean"==typeof a?a?g.g.Rg():"":a}; +g.i.py=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c}; +g.i.va=function(a){switch(a.type){case g.i.mo:var c=new g.i.Ve(null);break;case g.i.Dl:c=new g.i.Df(null);break;case g.i.zi:c=new g.i.nh(null,"","","","");break;case g.i.Nl:c=new g.i.Hi(null);break;case g.i.Iw:c=new g.i.Ce(null);break;case g.i.Jw:c=new g.i.af(null);break;case g.i.Kw:c=new g.i.If(null,"");break;case g.i.Oo:c=new g.i.xd(null,"","","");break;case g.i.io:c=new g.i.rg(null);break;case g.i.Iv:c=new g.i.dk(null,"","");break;case g.i.jo:c=new g.i.Ai(null);break;case g.i.Jv:c=new g.i.sg(null); +break;default:throw Error("Unknown event type.");}c.va(a);c.xc=(void 0).id;return c};g.i.uE=function(a){if((a.type==g.i.Nl||a.type==g.i.mo)&&a.xc){var c=g.Jb.jt(a.xc);if(a=w(c,a.Bc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.od(!0);else if((a.M||a.Z)&&!c.ic()){do a.od(!1),a=q(a);while(a)}}}}; +g.i.Abstract=function(){this.xc=void 0;this.group=g.i.$b();this.Jc=g.i.Jc};g.i.Abstract.prototype.Za=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};g.i.Abstract.prototype.va=function(a){this.group=a.group};g.i.Abstract.prototype.Vk=function(){return!1};g.i.Abstract.prototype.run=function(){};function xa(a){if(a.xc)var c=g.Jb.jt(a.xc);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};g.g.object={};g.g.object.W=function(a,c){a.w=c.prototype;a.prototype=Object.create(c.prototype);a.prototype.constructor=a};g.g.object.yj=function(a,c){for(var d in c)a[d]=c[d]};g.g.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(c){return a[c]})};g.i.xd=function(a,c,d,e){g.i.xd.w.constructor.call(this);this.Bc=a?a.id:null;this.xc=a?a.v.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Jc=!1};g.g.object.W(g.i.xd,g.i.Abstract);g.i.xd.prototype.type=g.i.Oo;g.i.xd.prototype.Za=function(){var a=g.i.xd.w.Za.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.Bc&&(a.blockId=this.Bc);return a}; +g.i.xd.prototype.va=function(a){g.i.xd.w.va.call(this,a);this.element=a.element;this.newValue=a.newValue;this.Bc=a.blockId};g.Hv=function(a){this.nm=a;this.Ia()};b=g.Hv.prototype;b.vb=null;b.kf=null;b.nm=null;b.oi=1;b.Kn=null;b.Ia=function(){this.vb||(this.vb=g.g.o.I("svg",{xmlns:g.g.o.Vl,"xmlns:html":g.g.o.Fi,"xmlns:xlink":g.g.o.Kf,version:"1.1","class":"blocklyBlockDragSurface"},this.nm),this.kf=g.g.o.I("g",{},this.vb))};function ya(a,c){if(a.kf.childNodes.length)throw Error("Already dragging a block.");a.kf.appendChild(c);a.vb.style.display="block";a.Kn=new g.g.N(0,0)} +b.Tj=function(a,c){this.Kn=new g.g.N(a*this.oi,c*this.oi);a=this.Kn.x;c=this.Kn.y;a=a.toFixed(0);c=c.toFixed(0);this.vb.style.display="block";g.g.o.An(this.vb,"translate3d("+a+"px, "+c+"px, 0px)")};b.rt=function(){var a=g.g.Ke(this.vb);return new g.g.N(a.x/this.oi,a.y/this.oi)};b.$b=function(){return this.kf}; +b.Vo=function(a){a?a.appendChild(this.kf.firstChild):this.kf.removeChild(this.kf.firstChild);this.vb.style.display="none";if(this.kf.childNodes.length)throw Error("Drag group was not cleared.");this.Kn=null};g.g.xo={};g.g.xo.lG=0;g.g.xo.fF=function(){return"blockly:"+(g.g.xo.lG++).toString(36)};g.yc=function(){this.$z=g.yc.Ex;this.Rk=null;this.$c=!1;this.Wd=this.hb=null;this.kb=[];this.rs={}};g.yc.Ex=!1;g.yc.Error={Iq:"Component already rendered",wr:"Unable to set parent component",fB:"Child component index out of bounds"};b=g.yc.prototype;b.ua=function(){return this.Rk||(this.Rk=g.g.xo.fF())};b.ta=function(){return this.hb}; +b.kl=function(a){if(this==a)throw Error(g.yc.Error.wr);var c;if(c=a&&this.Wd&&this.Rk)c=(c=this.Rk)?this.Wd.rs[c]||null:null;if(c&&this.Wd!=a)throw Error(g.yc.Error.wr);this.Wd=a};b.getParent=function(){return this.Wd};b.Ia=function(){this.hb=document.createElement("div")};b.za=function(a){this.eg(a)};b.eg=function(a,c){if(this.$c)throw Error(g.yc.Error.Iq);this.hb||this.Ia();a?a.insertBefore(this.hb,c||null):document.body.appendChild(this.hb);this.Wd&&!this.Wd.$c||this.lf()}; +b.lf=function(){this.$c=!0;za(this,function(a){!a.$c&&a.ta()&&a.lf()})};b.Jh=function(){za(this,function(a){a.$c&&a.Jh()});this.$c=!1};b.J=function(){this.zE||(this.zE=!0,this.ym())};b.ym=function(){this.$c&&this.Jh();za(this,function(a){a.J()});this.hb&&g.g.o.removeNode(this.hb);this.Wd=this.hb=this.rs=this.kb=null}; +b.cm=function(a,c,d){if(a.$c&&(d||!this.$c))throw Error(g.yc.Error.Iq);if(0>c||c>this.kb.length)throw Error(g.yc.Error.fB);this.rs[a.ua()]=a;if(a.getParent()==this){var e=this.kb.indexOf(a);-1f.top?g.D.uy(d,e,f,h):c+h.heightdocument.documentElement.clientTop?g.D.uy(d,e,f,h):g.D.gF(a,f,h)}; +g.D.vy=function(a,c,d,e){a=g.D.ot(a,d.left,d.right,e.width);return{Gp:a.Gk,Hp:c,op:a.Gk,pp:c+g.D.ow,em:a.em,Tw:-(g.D.$n/2+g.D.Gv),Xr:!0,Yr:!0}};g.D.uy=function(a,c,d,e){a=g.D.ot(a,d.left,d.right,e.width);return{Gp:a.Gk,Hp:c-e.height,op:a.Gk,pp:c-e.height-g.D.ow,em:a.em,Tw:e.height-2*g.D.Gv-g.D.$n/2,Xr:!1,Yr:!0}};g.D.gF=function(a,c,d){a=g.D.ot(a,c.left,c.right,d.width);return{Gp:a.Gk,Hp:0,op:a.Gk,pp:0,Yr:!1}}; +g.D.ot=function(a,c,d,e){var f=a;a=g.g.Ja.Mf(c,a-e/2,d-e);f-=g.D.$n/2;c=g.g.Ja.Mf(g.D.Bv,f-a,e-g.D.Bv-g.D.$n);return{em:c,Gk:a}};g.D.isVisible=function(){return!!g.D.md};g.D.Nk=function(a,c){g.D.md===a&&(c?g.D.Ok():g.D.Ca())};g.D.Ca=function(){var a=g.D.ve;a.style.transform="translate(0, 0)";a.style.opacity=0;g.D.Wr=setTimeout(function(){g.D.Ok()},1E3*g.D.Jq);g.D.Ej&&(g.D.Ej(),g.D.Ej=null)}; +g.D.Ok=function(){if(g.D.isVisible()){g.D.Wr&&clearTimeout(g.D.Wr);var a=g.D.ve;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=g.D.Nv;a.style.borderColor=g.D.Mv;g.D.Ej&&(g.D.Ej(),g.D.Ej=null);g.D.QD();g.D.md=null}}; +g.D.qn=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=g.D.ve;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)"}; +g.D.uM=function(){if(g.D.md){var a=g.D.md.B,c=a.v.scale,d=g.D.bq?g.D.md.cc.width:a.width,e=g.D.bq?g.D.md.cc.height:a.height;d*=c;e*=c;a=g.D.bq?g.D.md.mf.getBoundingClientRect():a.ya().getBoundingClientRect();d=a.left+d/2;e=g.D.wy(d,a.top+e,d,a.top);g.D.qn(e.Gp,e.Hp,e.op,e.pp)}else g.D.Ca()}; +g.Ei=function(a,c){this.Lk=a;this.av=c.spacing;this.fz=c.length;this.SF=(this.Tt=a.firstChild)&&this.Tt.nextSibling;this.fH=c.snap};g.Ei.prototype.oi=1;g.Ei.prototype.J=function(){this.Lk=null};g.Ei.prototype.update=function(a){this.oi=a;var c=this.av*a||100;this.Lk.setAttribute("width",c);this.Lk.setAttribute("height",c);c=Math.floor(this.av/2)+.5;var d=c-this.fz/2,e=c+this.fz/2;c*=a;d*=a;e*=a;Ca(this.Tt,a,d,e,c,c);Ca(this.SF,a,c,c,d,e)}; +function Ca(a,c,d,e,f,h){a&&(a.setAttribute("stroke-width",c),a.setAttribute("x1",d),a.setAttribute("y1",f),a.setAttribute("x2",e),a.setAttribute("y2",h))}g.Ei.prototype.moveTo=function(a,c){this.Lk.setAttribute("x",a);this.Lk.setAttribute("y",c);(g.g.userAgent.vg||g.g.userAgent.qo)&&this.update(this.oi)}; +g.Ei.Ia=function(a,c,d){a=g.g.o.I("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},d);0");c.Cb(e)}g.i.Ma(new g.i.nh(c,"mutation",null,d, +a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.Bc)};g.i.Ve=function(a){a&&(g.i.Ve.w.constructor.call(this,a),this.xml=a.v.ba?g.R.gs(a):g.R.Bh(a),this.Ph=g.i.py(a))};g.g.object.W(g.i.Ve,g.i.Cf);g.i.fo=g.i.Ve;g.i.Ve.prototype.type=g.i.mo;g.i.Ve.prototype.Za=function(){var a=g.i.Ve.w.Za.call(this);a.xml=g.R.Rd(this.xml);a.ids=this.Ph;return a}; +g.i.Ve.prototype.va=function(a){g.i.Ve.w.va.call(this,a);this.xml=g.R.jh(a.xml);this.Ph=a.ids};g.i.Ve.prototype.run=function(a){var c=xa(this);if(a)a=g.g.xml.createElement("xml"),a.appendChild(this.xml),g.R.Qg(a,c);else{a=0;for(var d;d=this.Ph[a];a++){var e=w(c,d);e?e.J(!1):d==this.Bc&&console.warn("Can't uncreate non-existent block: "+d)}}}; +g.i.Df=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");g.i.Df.w.constructor.call(this,a);this.qu=a.v.ba?g.R.gs(a):g.R.Bh(a);this.Ph=g.i.py(a)}};g.g.object.W(g.i.Df,g.i.Cf);g.i.aB=g.i.Df;g.i.Df.prototype.type=g.i.Dl;g.i.Df.prototype.Za=function(){var a=g.i.Df.w.Za.call(this);a.ids=this.Ph;return a};g.i.Df.prototype.va=function(a){g.i.Df.w.va.call(this,a);this.Ph=a.ids}; +g.i.Df.prototype.run=function(a){var c=xa(this);if(a){a=0;for(var d;d=this.Ph[a];a++){var e=w(c,d);e?e.J(!1):d==this.Bc&&console.warn("Can't delete non-existent block: "+d)}}else a=g.g.xml.createElement("xml"),a.appendChild(this.qu),g.R.Qg(a,c)};g.i.Hi=function(a){a&&(g.i.Hi.w.constructor.call(this,a),a=Da(this),this.xz=a.Kz,this.wz=a.Wy,this.nu=a.vx)};g.g.object.W(g.i.Hi,g.i.Cf);g.i.Bl=g.i.Hi;b=g.i.Hi.prototype;b.type=g.i.Nl; +b.Za=function(){var a=g.i.Hi.w.Za.call(this);this.Bj&&(a.newParentId=this.Bj);this.Aj&&(a.newInputName=this.Aj);this.di&&(a.newCoordinate=Math.round(this.di.x)+","+Math.round(this.di.y));return a};b.va=function(a){g.i.Hi.w.va.call(this,a);this.Bj=a.newParentId;this.Aj=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.di=new g.g.N(Number(a[0]),Number(a[1])))};b.Hj=function(){var a=Da(this);this.Bj=a.Kz;this.Aj=a.Wy;this.di=a.vx}; +function Da(a){var c=w(xa(a),a.Bc);a={};var d=c.getParent();if(d){a.Kz=d.id;a:{for(var e=0,f;f=d.T[e];e++)if(f.connection&&y(f.connection)==c){c=f;break a}c=null}c&&(a.Wy=c.name)}else a.vx=c.Ra();return a}b.Vk=function(){return this.xz==this.Bj&&this.wz==this.Aj&&g.g.N.He(this.nu,this.di)}; +b.run=function(a){var c=xa(this),d=w(c,this.Bc);if(d){var e=a?this.Bj:this.xz,f=a?this.Aj:this.wz;a=a?this.di:this.nu;var h=null;if(e&&(h=w(c,e),!h)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&z(d);if(a)f=d.Ra(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.M||d.Z;if(f){if(c=A(h,f))var k=c.connection}else d.type==g.Ze&&(k=h.X);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.Bc)};g.i.Gl=function(a){this.xc=a.id;this.group=g.i.$b();this.Jc=!1};g.g.object.W(g.i.Gl,g.i.Abstract);g.i.Gl.prototype.type=g.i.DB;g.i.Gl.prototype.Za=function(){var a={type:this.type};this.group&&(a.group=this.group);this.xc&&(a.workspaceId=this.xc);return a};g.i.Gl.prototype.va=function(a){this.xc=a.workspaceId;this.group=a.group};g.i.Eg=function(a){g.i.Eg.w.constructor.call(this);this.ti=a.ua();this.xc=a.v.id};g.g.object.W(g.i.Eg,g.i.Abstract);g.i.Eg.prototype.Za=function(){var a=g.i.Eg.w.Za.call(this);a.varId=this.ti;return a};g.i.Eg.prototype.va=function(a){g.i.Eg.w.Za.call(this);this.ti=a.varId};g.i.Ce=function(a){a&&(g.i.Ce.w.constructor.call(this,a),this.Xj=a.type,this.Wj=a.name)};g.g.object.W(g.i.Ce,g.i.Eg);g.i.Ce.prototype.type=g.i.Iw; +g.i.Ce.prototype.Za=function(){var a=g.i.Ce.w.Za.call(this);a.varType=this.Xj;a.varName=this.Wj;return a};g.i.Ce.prototype.va=function(a){g.i.Ce.w.va.call(this,a);this.Xj=a.varType;this.Wj=a.varName};g.i.Ce.prototype.run=function(a){var c=xa(this);a?c.Qd(this.Wj,this.Xj,this.ti):c.Rf(this.ti)};g.i.af=function(a){a&&(g.i.af.w.constructor.call(this,a),this.Xj=a.type,this.Wj=a.name)};g.g.object.W(g.i.af,g.i.Eg);g.i.af.prototype.type=g.i.Jw; +g.i.af.prototype.Za=function(){var a=g.i.af.w.Za.call(this);a.varType=this.Xj;a.varName=this.Wj;return a};g.i.af.prototype.va=function(a){g.i.af.w.va.call(this,a);this.Xj=a.varType;this.Wj=a.varName};g.i.af.prototype.run=function(a){var c=xa(this);a?c.Rf(this.ti):c.Qd(this.Wj,this.Xj,this.ti)};g.i.If=function(a,c){a&&(g.i.If.w.constructor.call(this,a),this.pu=a.name,this.ju=c)};g.g.object.W(g.i.If,g.i.Eg);g.i.If.prototype.type=g.i.Kw; +g.i.If.prototype.Za=function(){var a=g.i.If.w.Za.call(this);a.oldName=this.pu;a.newName=this.ju;return a};g.i.If.prototype.va=function(a){g.i.If.w.va.call(this,a);this.pu=a.oldName;this.ju=a.newName};g.i.If.prototype.run=function(a){var c=xa(this);a?c.ni(this.ti,this.ju):c.ni(this.ti,this.pu)};g.R={};g.R.EA=function(a){var c=B,d=g.g.xml.createElement("xml"),e=g.R.GH(g.O.Sw(c));e.hasChildNodes()&&d.appendChild(e);var f=Ea(c,!0);e=0;for(var h;h=f[e];e++)d.appendChild(h.fv(a));c=D(c,!0);for(e=0;f=c[e];e++)d.appendChild(g.R.gs(f,a));return d};g.R.GH=function(a){for(var c=g.g.xml.createElement("variables"),d=0,e;e=a[d];d++){var f=g.g.xml.createElement("variable");f.appendChild(g.g.xml.createTextNode(e.name));e.type&&f.setAttribute("type",e.type);f.id=e.ua();c.appendChild(f)}return c}; +g.R.gs=function(a,c){var d;a.v.G&&(d=a.v.Xf());c=g.R.Bh(a,c);var e=a.Ra();c.setAttribute("x",Math.round(a.v.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};g.R.KE=function(a){var c=!1;a.name&&(a.Ni?c=!0:a.ug&&(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=g.g.xml.createElement("field"),c.setAttribute("name",a.name),a.uA(c)):null}; +g.R.sD=function(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,h;h=e.Qa[f];f++)(h=g.R.KE(h))&&c.appendChild(h)}; +g.R.Bh=function(a,c){var d=g.g.xml.createElement(a.bb?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.cb){var e=a.cb();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}g.R.sD(a,d);if(e=a.Ee.text){var f=a.Ee.size,h=a.Ee.Du,k=g.g.xml.createElement("comment");k.appendChild(g.g.xml.createTextNode(e));k.setAttribute("pinned",h);k.setAttribute("h",f.height);k.setAttribute("w",f.width);d.appendChild(k)}a.data&&(e=g.g.xml.createElement("data"),e.appendChild(g.g.xml.createTextNode(a.data)), +d.appendChild(e));for(f=0;h=a.T[f];f++){var l;k=!0;if(h.type!=g.tg){var m=y(h.connection);h.type==g.Wa?l=g.g.xml.createElement("value"):h.type==g.jb&&(l=g.g.xml.createElement("statement"));e=h.connection.vf;!e||m&&m.bb||l.appendChild(g.R.gx(e,c));m&&(l.appendChild(g.R.Bh(m,c)),k=!1);l.setAttribute("name",h.name);k||d.appendChild(l)}}void 0!=a.Yg&&a.Yg!=a.JF&&d.setAttribute("inline",a.Yg);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.ne()||a.bb||d.setAttribute("deletable", +!1);a.Fc()||a.bb||d.setAttribute("movable",!1);a.ld()||d.setAttribute("editable",!1);if(f=q(a))l=g.g.xml.createElement("next"),l.appendChild(g.R.Bh(f,c)),d.appendChild(l);e=a.X&&a.X.vf;!e||f&&f.bb||l.appendChild(g.R.gx(e,c));return d}; +g.R.gx=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==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&g.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&g.g.o.removeNode(e))}return a}; +g.R.Rd=function(a){a=g.g.xml.Rd(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};g.R.ZL=function(a){a=g.R.Rd(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +g.R.jh=function(a){var c=g.g.xml.rH(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};g.R.UL=function(a,c){c.Lc(!1);c.clear();a=g.R.Qg(a,c);c.Lc(!0);return a}; +g.R.Qg=function(a,c){if(a instanceof g.Jb){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.G&&(e=c.Xf());d=[];g.g.o.In();var f=a.childNodes.length,h=g.i.$b();h||g.i.$(!0);c.Lc&&c.Lc(!1);var k=!0;try{for(var l=0;l document.");}else a=null;return a};g.K={};g.K.visible=!1;g.K.zk=!1;g.K.bC=50;g.K.qz=0;g.K.En=0;g.K.Qt=0;g.K.Rt=0;g.K.hb=null;g.K.aq=null;g.K.kw=0;g.K.lw=10;g.K.CC=10;g.K.OB=750;g.K.hr=5;g.K.Ga=null;g.K.Ia=function(){g.K.Ga||(g.K.Ga=document.createElement("div"),g.K.Ga.className="blocklyTooltipDiv",document.body.appendChild(g.K.Ga))};g.K.yk=function(a){g.hd(a,"mouseover",null,g.K.EG);g.hd(a,"mouseout",null,g.K.DG);a.addEventListener("mousemove",g.K.CG,!1)}; +g.K.EG=function(a){if(!g.K.zk){for(a=a.currentTarget;"string"!=typeof a.zf&&"function"!=typeof a.zf;)a=a.zf;g.K.hb!=a&&(g.K.Ca(),g.K.aq=null,g.K.hb=a);clearTimeout(g.K.qz)}};g.K.DG=function(){g.K.zk||(g.K.qz=setTimeout(function(){g.K.hb=null;g.K.aq=null;g.K.Ca()},1),clearTimeout(g.K.En))}; +g.K.CG=function(a){if(g.K.hb&&g.K.hb.zf&&!g.K.zk)if(g.K.visible){var c=g.K.Qt-a.pageX;a=g.K.Rt-a.pageY;Math.sqrt(c*c+a*a)>g.K.CC&&g.K.Ca()}else g.K.aq!=g.K.hb&&(clearTimeout(g.K.En),g.K.Qt=a.pageX,g.K.Rt=a.pageY,g.K.En=setTimeout(g.K.dH,g.K.OB))};g.K.Ca=function(){g.K.visible&&(g.K.visible=!1,g.K.Ga&&(g.K.Ga.style.display="none"));g.K.En&&clearTimeout(g.K.En)};g.K.block=function(){g.K.Ca();g.K.zk=!0};g.K.zH=function(){g.K.zk=!1}; +g.K.dH=function(){if(!g.K.zk&&(g.K.aq=g.K.hb,g.K.Ga)){g.K.Ga.innerHTML="";for(var a=g.K.hb.zf;"function"==typeof a;)a=a();a=g.g.eb.FA(a,g.K.bC);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=g.K.Ga.offsetHeight+2*g.K.lw);a?e=Math.max(g.K.hr-window.scrollX,e):e+g.K.Ga.offsetWidth>c+window.scrollX-2*g.K.hr&&(e=c-g.K.Ga.offsetWidth-2*g.K.hr);g.K.Ga.style.top=f+"px";g.K.Ga.style.left=e+"px"}};g.Nw=function(a){this.nm=a;this.Ia()};b=g.Nw.prototype;b.vb=null;b.kf=null;b.nm=null;b.Ia=function(){this.vb||(this.vb=g.g.o.I("svg",{xmlns:g.g.o.Vl,"xmlns:html":g.g.o.Fi,"xmlns:xlink":g.g.o.Kf,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.nm.appendChild(this.vb))};b.Tj=function(a,c){a=a.toFixed(0);c=c.toFixed(0);this.vb.style.display="block";g.g.o.An(this.vb,"translate3d("+a+"px, "+c+"px, 0px)")};b.rt=function(){return g.g.Ke(this.vb)}; +b.Vo=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var c=this.vb.childNodes[0],d=this.vb.childNodes[1];if(!(c&&d&&g.g.o.yt(c,"blocklyBlockCanvas")&&g.g.o.yt(d,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.fl?g.g.o.nj(c,this.fl):a.insertBefore(c,a.firstChild);g.g.o.nj(d,c);this.vb.style.display="none";if(this.vb.childNodes.length)throw Error("Drag surface was not cleared.");g.g.o.An(this.vb, +"");this.fl=null};g.L=Object.create(null);g.sa=function(a,c){this.B=a;this.type=c};g.sa.ho=0;g.sa.tw=1;g.sa.ww=2;g.sa.vw=3;g.sa.rw=4;g.sa.sw=5;g.sa.uw=6;b=g.sa.prototype;b.ca=null;b.df=null;b.vf=null;b.Xb=0;b.$a=0; +b.ef=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=y(c),h=c.vf;c.vf=null;if(f.bb)h=g.R.Bh(f),f.J(),f=null;else if(c.type==g.Wa){if(!f.M)throw Error("Orphan block does not have an output connection.");var k=g.sa.dz(e,f);k&&(f.M.connect(k),f=null)}else if(c.type==g.jb){if(!f.Z)throw Error("Orphan block does not have a previous connection.");for(k=e;k.X;){var l=q(k);if(l&&!l.bb)k=l;else{Ja(f.Z,k.X)&&(k.X.connect(f.Z),f=null);break}}}if(f&&(c.disconnect(), +g.i.Jc)){var m=g.i.$b();setTimeout(function(){f.v&&!f.getParent()&&(g.i.$(m),f.M?f.M.Xp(c):f.Z&&f.Z.Xp(c),g.i.$(!1))},g.co)}c.vf=h}var n;g.i.isEnabled()&&(n=new g.i.Bl(e));g.sa.ZD(c,a);e.kl(d);n&&(n.Hj(),g.i.Ma(n))};b.J=function(){if(this.isConnected()){this.vf=null;var a=y(this);a.bb?a.J():z(a)}};function E(a){return a.type==g.Wa||a.type==g.jb}b.isConnected=function(){return!!this.ca}; +function Ka(a,c){if(!c)return g.sa.vw;if(E(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?g.sa.tw:c.type!=g.nk[a.type]?g.sa.ww:d&&e&&d.v!==e.v?g.sa.sw:Ja(a,c)?d.bb&&!e.bb?g.sa.uw:g.sa.ho:g.sa.rw} +function La(a,c){switch(Ka(a,c)){case g.sa.ho:break;case g.sa.tw:throw Error("Attempted to connect a block to itself.");case g.sa.sw:throw Error("Blocks not on same workspace.");case g.sa.ww:throw Error("Attempt to connect incompatible types.");case g.sa.vw:throw Error("Target connection is null.");case g.sa.rw:throw Error("Connection checks failed. "+(a+" expected "+a.df+", found "+c.df));case g.sa.uw:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.Kp=function(a){if(a.B.Vh()||Ka(this,a)!=g.sa.ho)return!1;switch(a.type){case g.Ze:return this.ca||-1!=g.zm.indexOf(a)?a=!1:a.ca?(a=y(a),a=a.Vh()?!(a.Z&&y(a.Z)):!1):a=!0,a;case g.Ye:if(a.isConnected()&&!y(a).Vh()||this.isConnected())return!1;break;case g.Wa:if(a.isConnected()&&!y(a).Fc()&&!y(a).bb)return!1;break;case g.jb:if(a.isConnected()&&!this.B.X&&!y(a).bb&&y(a).X)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=g.zm.indexOf(a)?!1:!0};b.Xp=function(){}; +b.connect=function(a){if(this.ca!=a){La(this,a);var c=g.i.$b();c||g.i.$(!0);E(this)?this.ef(a):a.ef(this);c||g.i.$(!1)}};g.sa.ZD=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ca=c;c.ca=a};g.sa.eH=function(a,c){for(var d=!1,e=0;ed)){var e=Na(c,a.ya());a.M?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.Z&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=g.g.o.I("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},u(c));g.ob.qx(a,new Date,d)}};g.ob.qx=function(a,c,d){var e=(new Date-c)/150;1a.v.scale)){var c=G(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);g.ob.Lx(a.ya(),c,new Date)}};g.ob.Lx=function(a,c,d){var e=(new Date-d)/200;1a-g.nB)}if(a.Gc||a.Fb)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Gc||!a.Fb);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function Qa(a){a.Fb&&(g.g.o.removeNode(g.sa.Ty),delete g.sa.Ty);if(a.Ct){var c=a.Fb;c.type!=g.Wa||c.isConnected()?Ra(a.Pk,!1):a.Pk.BF(c,!1);a.Pk=null;a.Ct=!1}else if(a.wj)if(a.wj){c=a.wj;var d=c.B,e=d.X,f=d.Z,h=d.M;h=c.type==g.Wa&&!(h&&h.ca);!(c!=e||f&&f.ca)||h?z(y(c),!1):c.type==g.jb&&c!=e?(e=c.ca,z(e.B,!1),f=f?f.ca:null,z(d,!0),f&&f.connect(e)):z(d,!0);if(c.ca)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.wj=null;d.ya().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +g.zo.prototype.Jk=function(){var a=[];this.Hk&&a.push(this.Hk);this.uj&&a.push(this.uj);return a};g.yi=function(a,c){this.Gb=a;this.s=c;this.Tf=new g.zo(this.Gb);this.dj=null;this.og=!1;this.lg=this.Gb.Ra();this.kp=g.yi.GF(a)};g.yi.prototype.J=function(){this.vc=this.s=this.Gb=null;this.kp.length=0;this.Tf&&(this.Tf.J(),this.Tf=null)};g.yi.GF=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Sa(e);for(var f=0;fc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.tq.splice(c,1);this.Wb.unsubscribe(this.Mc);this.options.Ob||(this.Wb.J(),this.Wb=null)}};g.Jb.yw=3;b=g.Jb.prototype; +b.kg=function(a,c){a=a.Ra();c=c.Ra();return a.y+g.Jb.prototype.kg.offset*a.x-(c.y+g.Jb.prototype.kg.offset*c.x)};function db(a,c){if(!g.g.Qo(a.ul,c))throw Error("Block not present in workspace's list of top-most blocks.");}function D(a,c){var d=[].concat(a.ul);c&&1h)return!1;d+=c[e]}return d>eb(a)?!1:!0} +function gb(a){return Infinity!=a.options.au||!!a.options.bu}b.kv=function(a){var c=a?this.tn:this.Uj,d=a?this.Uj:this.tn,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=g.i.filter(f,a);g.i.Jc=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{g.i.Jc=!0}}};function hb(){var a=B;a.Uj.length=0;a.tn.length=0;g.i.RD()}function ib(a,c){a.Dd.push(c)}function jb(a,c){g.g.Qo(a.Dd,c)}function w(a,c){return a.fs[c]||null}g.Jb.$l=Object.create(null); +g.Jb.jt=function(a){return g.Jb.$l[a]||null};g.Jb.getAll=function(){var a=[],c;for(c in g.Jb.$l)a.push(g.Jb.$l[c]);return a};g.oa=function(a,c,d,e,f,h){this.s=a;this.gf=c;this.hA=d;d=g.oa.TA;this.s.G&&(d=-d);this.vD=g.g.Ja.pd(d);a.yf.appendChild(this.pm(c,!(!f||!h)));this.fc=e;this.Ku&&kb(this);f&&h||(c=this.gf.getBBox(),f=c.width+2*g.oa.dd,h=c.height+2*g.oa.dd);this.zn(f,h);kb(this);lb(this);this.Ku=!0;a.options.readOnly||(g.la(this.fm,"mousedown",this,this.DD),this.fg&&g.la(this.fg,"mousedown",this,this.UG))};g.oa.dd=6;g.oa.UA=5;g.oa.TA=20;g.oa.zv=4;g.oa.RA=8;g.oa.Qe=null;g.oa.ii=null;g.oa.prototype.Mu=null; +g.oa.jv=function(){g.oa.Qe&&(g.Xa(g.oa.Qe),g.oa.Qe=null);g.oa.ii&&(g.Xa(g.oa.ii),g.oa.ii=null)};g.oa.ED=function(){g.Touch.Dh();g.oa.jv()};b=g.oa.prototype;b.Ku=!1;b.fc=null;b.bh=0;b.mi=0;b.tb=0;b.Yc=0;b.$r=!0; +b.pm=function(a,c){this.je=g.g.o.I("g",{},null);var d={filter:"url(#"+this.s.options.Ux+")"};g.g.userAgent.ZB&&(d={});d=g.g.o.I("g",d,this.je);this.ks=g.g.o.I("path",{},d);this.fm=g.g.o.I("rect",{"class":"blocklyDraggable",x:0,y:0,rx:g.oa.dd,ry:g.oa.dd},d);c?(this.fg=g.g.o.I("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.je),c=2*g.oa.dd,g.g.o.I("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.fg),g.g.o.I("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.fg),g.g.o.I("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.fg)):this.fg=null;this.je.appendChild(a);return this.je};b.ya=function(){return this.je};function mb(a,c){a.je.dataset&&(a.je.dataset.blockId=c)}b.DD=function(a){var c=this.s.Tg(a);if(c){if(c.kj)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.re||(c.re=this);c.tf=a}};b.Dn=function(){};b.ne=function(){return!1}; +b.UG=function(a){nb(this);g.oa.jv();g.g.tj(a)||(this.s.bv(a,new g.g.N(this.s.G?-this.tb:this.tb,this.Yc)),g.oa.Qe=g.la(document,"mouseup",this,g.oa.ED),g.oa.ii=g.la(document,"mousemove",this,this.VG),g.rc());a.stopPropagation()};b.VG=function(a){this.$r=!1;var c=this.s;a=g.g.kn(a,u(c),qa(c));a.x/=c.scale;a.y/=c.scale;c=g.g.N.sum(c.Rx,a);this.zn(this.s.G?-c.x:c.x,c.y);this.s.G&&kb(this)};function nb(a){var c=a.je.parentNode;return c.lastChild!==a.je?(c.appendChild(a.je),!0):!1} +function ob(a,c,d){var e=a.s.G?a.fc.x-c.x-a.tb:c.x+a.fc.x;c=c.y+a.fc.y;return Math.max(0,Math.min(1,(Math.min(e+a.tb,d.ec+d.rb)-Math.max(e,d.ec))*(Math.min(c+a.Yc,d.mc+d.yb)-Math.max(c,d.mc))/(a.tb*a.Yc)))}function kb(a){var c=a.fc.x;c=a.s.G?c-(a.bh+a.tb):c+a.bh;a.moveTo(c,a.mi+a.fc.y)}b.moveTo=function(a,c){this.je.setAttribute("transform","translate("+a+","+c+")")};b.ht=function(){return new g.g.$e(this.tb,this.Yc)}; +b.zn=function(a,c){var d=2*g.oa.dd;a=Math.max(a,d+45);c=Math.max(c,d+20);this.tb=a;this.Yc=c;this.fm.setAttribute("width",a);this.fm.setAttribute("height",c);this.fg&&(this.s.G?this.fg.setAttribute("transform","translate("+2*g.oa.dd+","+(c-d)+") scale(-1 1)"):this.fg.setAttribute("transform","translate("+(a-d)+","+(c-d)+")"));if(this.$r){a=this.s.hc();a.ec/=this.s.scale;a.rb/=this.s.scale;a.mc/=this.s.scale;a.yb/=this.s.scale;c=-this.tb/4;if(!(this.tb>a.rb)){if(this.s.G){d=this.fc.x-c;var e=d-this.tb; +var f=a.ec+a.rb,h=a.ec+g.La.tc/this.s.scale}else e=c+this.fc.x,d=e+this.tb,h=a.ec,f=a.ec+a.rb-g.La.tc/this.s.scale;this.s.G?ef&&(c=-(f-this.fc.x)):ef&&(c=f-this.fc.x-this.tb)}e=c;c=-this.Yc/4;if(!(this.Yc>a.yb)){d=this.fc.y+c;f=d+this.Yc;h=a.mc;var k=a.mc+a.yb-g.La.tc/this.s.scale,l=this.fc.y;dk&&(c=k-l-this.Yc)}h=c;f=this.hA.getBBox();c={x:e,y:-this.Yc-g.wa.lr};d={x:-this.tb-30,y:h};h={x:f.width,y:h};k={x:e,y:f.height};e=f.widthh&&(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),t=a.ht();m=(t.width+t.height)/g.oa.UA;m=Math.min(m,t.width,t.height)/4;t=1-g.oa.RA/k;f=d+t*f;h=e+t*h;t=d+m*r;var v=e+m*n;d-=m*r;e-=m*n;n=l+a.vD;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/g.oa.zv;k=Math.cos(n)*k/g.oa.zv;c.push("M"+t+","+ +v);c.push("C"+(t+k)+","+(v+l)+" "+f+","+h+" "+f+","+h);c.push("C"+f+","+h+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.ks.setAttribute("d",c.join(" "))}b.Kc=function(a){this.fm.setAttribute("fill",a);this.ks.setAttribute("fill",a)};b.J=function(){g.oa.jv();g.g.o.removeNode(this.je);this.hA=this.gf=this.s=this.fg=this.fm=this.ks=this.je=null};b.fu=function(a,c){a?a.Tj(c.x,c.y):this.moveTo(c.x,c.y);this.bh=this.s.G?this.fc.x-c.x-this.tb:c.x-this.fc.x;this.mi=c.y-this.fc.y;lb(this)}; +b.Ra=function(){return new g.g.N(this.fc.x+this.bh,this.fc.y+this.mi)};g.i.qg=function(a){this.Of=a.id;this.xc=a.v.id;this.group=g.i.$b();this.Jc=g.i.Jc};g.g.object.W(g.i.qg,g.i.Abstract);g.i.qg.prototype.Za=function(){var a=g.i.qg.w.Za.call(this);this.Of&&(a.commentId=this.Of);return a};g.i.qg.prototype.va=function(a){g.i.qg.w.va.call(this,a);this.Of=a.commentId};g.i.dk=function(a,c,d){a&&(g.i.dk.w.constructor.call(this,a),this.vz=c,this.Wp=d)};g.g.object.W(g.i.dk,g.i.qg);b=g.i.dk.prototype;b.type=g.i.Iv; +b.Za=function(){var a=g.i.dk.w.Za.call(this);a.newContents=this.Wp;return a};b.va=function(a){g.i.dk.w.va.call(this,a);this.Wp=a.newValue};b.Vk=function(){return this.vz==this.Wp};b.run=function(a){var c;(c=xa(this).Zo[this.Of]||null)?c.BM(a?this.Wp:this.vz):console.warn("Can't change non-existent comment: "+this.Of)};g.i.rg=function(a){a&&(g.i.rg.w.constructor.call(this,a),this.xml=a.fv())};g.g.object.W(g.i.rg,g.i.qg);g.i.rg.prototype.type=g.i.io; +g.i.rg.prototype.Za=function(){var a=g.i.rg.w.Za.call(this);a.xml=g.R.Rd(this.xml);return a};g.i.rg.prototype.va=function(a){g.i.rg.w.va.call(this,a);this.xml=g.R.jh(a.xml)};g.i.rg.prototype.run=function(a){g.i.Lv(this,a)};g.i.Lv=function(a,c){var d=xa(a);c?(c=g.g.xml.createElement("xml"),c.appendChild(a.xml),g.R.Qg(c,d)):(d=d.Zo[a.Of]||null)?d.J(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.Of)};g.i.sg=function(a){a&&(g.i.sg.w.constructor.call(this,a),this.xml=a.fv())}; +g.g.object.W(g.i.sg,g.i.qg);g.i.sg.prototype.type=g.i.Jv;g.i.sg.prototype.Za=function(){return g.i.sg.w.Za.call(this)};g.i.sg.prototype.va=function(a){g.i.sg.w.va.call(this,a)};g.i.sg.prototype.run=function(a){g.i.Lv(this,!a)};g.i.Ai=function(a){a&&(g.i.Ai.w.constructor.call(this,a),this.us=a,this.ou=a.Fy(),this.zj=null)};g.g.object.W(g.i.Ai,g.i.qg);b=g.i.Ai.prototype; +b.Hj=function(){if(!this.us)throw Error("Tried to record the new position of a comment on the same event twice.");this.zj=this.us.Fy();this.us=null};b.type=g.i.jo;b.Za=function(){var a=g.i.Ai.w.Za.call(this);this.zj&&(a.newCoordinate=Math.round(this.zj.x)+","+Math.round(this.zj.y));return a};b.va=function(a){g.i.Ai.w.va.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.zj=new g.g.N(Number(a[0]),Number(a[1])))};b.Vk=function(){return g.g.N.He(this.ou,this.zj)}; +b.run=function(a){var c;if(c=xa(this).Zo[this.Of]||null){a=a?this.zj:this.ou;var d=c.Fy();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.Of)};g.Cl=function(a,c){this.qc=a;this.s=c;this.dj=null;this.Bq=!1;this.lg=this.qc.Ra();this.gj=g.g.oj()&&c.ie?c.ie:null};g.Cl.prototype.J=function(){this.gj=this.s=this.qc=null};function pb(a,c,d){d=a.bl(d);d=g.g.N.sum(a.lg,d);a.qc.fu(a.gj,d);a.qc.ne()&&(a.dj=Va(a.s,c),a.Bq=a.dj!=g.Ov,c=a.s.bd,a.Bq?(Wa(a.qc,!0),a.dj==g.Sq&&c&&Xa(c,!0)):(Wa(a.qc,!1),c&&Xa(c,!1)))} +function qb(a,c,d){pb(a,c,d);c=a.bl(d);c=g.g.N.sum(a.lg,c);a.qc.moveTo(c.x,c.y);c=a.s.bd;a.Bq?(c&&setTimeout(c.close.bind(c),100),a.Dm(),a.qc.J(!1,!0)):c&&c.close();a.Bq||(a.gj&&a.gj.Vo(a.s.yf),a.qc.Jj&&a.qc.Jj(!1),a.Dm());a.s.Lc(!0);a.s.ra&&g.g.o.Tb(a.s.ra.zc,a.qc.ne()?"blocklyToolboxDelete":"blocklyToolboxGrab");g.i.$(!1)}g.Cl.prototype.Dm=function(){if(this.qc.$y){var a=new g.i.Ai(this.qc);a.ou=this.lg;a.Hj();g.i.Ma(a)}}; +g.Cl.prototype.bl=function(a){a=new g.g.N(a.x/this.s.scale,a.y/this.s.scale);this.s.sj&&a.scale(1/this.s.options.Ob.scale);return a};g.Cl.prototype.iu=function(){this.qc.moveTo(0,0);this.gj.Tj(this.lg.x,this.lg.y);ya(this.gj,this.qc.ya())};g.am=function(a){this.s=a;this.pA=new g.g.N(a.scrollX,a.scrollY)};g.am.prototype.J=function(){this.s=null};g.am.prototype.bv=function(){g.selected&&rb(g.selected);ra(this.s)};g.am.prototype.Ih=function(a){a=g.g.N.sum(this.pA,a);this.s.scroll(a.x,a.y)};g.to=function(a){g.to.w.constructor.call(this,a.Kk());this.uc=a.uc;this.qf=a.qf};g.g.object.W(g.to,g.am);g.to.prototype.Ih=function(a){a=g.g.N.sum(this.pA,a);this.qf?this.uc.set(-a.x):this.uc.set(-a.y)};g.gk=function(a,c){this.vc=this.wc=this.Lj=this.Mj=this.re=this.yd=this.pz=null;this.ys=c;this.Sm=this.qj=this.Tm=this.ij=!1;this.tf=a;this.P=this.wi=this.cf=this.Gg=this.Zp=this.Yp=null;this.Mp=this.kj=this.Zw=!1;this.Oy=!g.wB};b=g.gk.prototype;b.J=function(){g.Touch.Dh();g.K.zH();this.ys.Dc=null;this.Yp&&g.Xa(this.Yp);this.Zp&&g.Xa(this.Zp);this.P=this.vc=this.wc=this.Lj=this.Mj=null;this.cf&&(this.cf.J(),this.cf=null);this.wi&&(this.wi.J(),this.wi=null);this.Gg&&(this.Gg.J(),this.Gg=null)}; +function sb(a,c){a.yd=g.g.N.xm(new g.g.N(c.clientX,c.clientY),a.pz);if(a.ij)var d=!1;else a.ij=g.g.N.XF(a.yd)>(a.P?g.EB:g.vB),d=a.ij;if(d){if(a.Zw)throw Error("updateIsDragging_ should only be called once per gesture.");a.Zw=!0;if(a.re){a.Sm=!0;a.Gg=new g.Cl(a.re,a.vc);d=a.Gg;g.i.$b()||g.i.$(!0);d.s.Lc(!1);d.qc.$r=!1;d.gj&&d.iu();d.qc.Jj&&d.qc.Jj(!0);var e=d.s.ra;e&&g.g.o.mb(e.zc,d.qc.ne()?"blocklyToolboxDelete":"blocklyToolboxGrab");pb(a.Gg,a.tf,a.yd);d=!0}else d=!1;if(!d){if(a.wc)if(a.P?(a.P.Zy(a.wc)? +((d=!tb(a.P))||(d=a.yd,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.P.DE,d=d-e||d<-180+e||d>180-e?!0:!1),d?(a.vc=a.P.qb,ub(a.vc),g.i.$b()||g.i.$(!0),a.Lj=null,a.wc=vb(a.P,a.wc),a.wc.select(),d=!0):d=!1):d=!1,a.qj=d):a.wc.Fc()&&(a.qj=!0),a.qj){a.cf=new g.yi(a.wc,a.vc);d=a.cf;e=a.yd;var f=a.Oy;g.i.$b()||g.i.$(!0);d.s.sj&&$a(d.Gb);g.g.o.In();d.s.Lc(!1);g.ob.Ls();if(d.Gb.getParent()||f&&d.Gb.X&&y(d.Gb.X))z(d.Gb,f),e=d.bl(e),e=g.g.N.sum(d.lg,e),d.Gb.translate(e.x,e.y),g.ob.xE(d.Gb);d.Gb.Jj(!0);d.Gb.iu(); +(e=d.s.ra)&&g.g.o.mb(e.zc,d.Gb.ne()?"blocklyToolboxDelete":"blocklyToolboxGrab");Ta(a.cf,a.tf,a.yd);d=!0}else d=!1;else d=!1;if(d=!d)if(a.P)d=tb(a.P);else if(d=a.vc)d=a.vc,d=d.options.Hc&&d.options.Hc.Ih;d&&(a.wi=a.P?new g.to(a.P):new g.am(a.vc),a.Tm=!0,a.wi.bv())}g.ai()}a.tf=c} +b.Ms=function(a){g.g.Pp(a)?this.cancel():(this.kj=!0,g.ob.Ls(),ub(this.vc),this.vc.sj&&this.vc.resize(),pa(this.vc),this.tf=a,g.rc(!!this.P),g.K.block(),this.wc&&(!this.wc.ac&&a.shiftKey?(g.navigation.Zs(),I(this.ys.Ya,g.navigation.tt(this.wc))):this.wc.select()),g.g.tj(a)?da(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||g.VF(a,this),this.pz=new g.g.N(a.clientX,a.clientY),this.Oy=a.altKey||a.ctrlKey||a.metaKey,this.yk(a)))}; +b.yk=function(a){this.Yp=g.la(document,"mousemove",null,this.Mm.bind(this));this.Zp=g.la(document,"mouseup",null,this.Bp.bind(this));a.preventDefault();a.stopPropagation()};b.Mm=function(a){sb(this,a);this.Tm?this.wi.Ih(this.yd):this.qj?Ta(this.cf,this.tf,this.yd):this.Sm&&pb(this.Gg,this.tf,this.yd);a.preventDefault();a.stopPropagation()}; +b.Bp=function(a){sb(this,a);g.ai();if(this.Mp)console.log("Trying to end a gesture recursively.");else{this.Mp=!0;if(this.Sm)qb(this.Gg,a,this.yd);else if(this.qj)Ya(this.cf,a,this.yd);else if(this.Tm){var c=this.wi;c.Ih(this.yd);sa(c.s)}else if(this.re&&!this.ij)this.re.aH&&this.re.aH(),this.re.select&&this.re.select();else if(wb(this))this.Mj.wf(),xb(this);else if(this.Lj&&!this.ij&&!wb(this))this.P&&this.P.xk?this.wc.isEnabled()&&(g.i.$b()||g.i.$(!0),ab(vb(this.P,this.wc))):g.i.Ma(new g.i.xd(this.Lj, +"click",void 0,void 0)),xb(this),g.i.$(!1);else if(!(this.Lj||this.re||this.Mj||this.ij))if(c=this.ys,a.shiftKey){g.navigation.Zs();var d=g.g.YG(c,new g.g.N(a.clientX,a.clientY));d=g.F.sm(c,d);I(c.Ya,d)}else g.selected&&rb(g.selected);a.preventDefault();a.stopPropagation();this.J()}};b.cancel=function(){if(!this.Mp){g.ai();if(this.Sm)qb(this.Gg,this.tf,this.yd);else if(this.qj)Ya(this.cf,this.tf,this.yd);else if(this.Tm){var a=this.wi;a.Ih(this.yd);sa(a.s)}this.J()}}; +function da(a,c){a.wc?(xb(a),g.rc(a.P),a.wc.Dn(c)):a.re?a.re.Dn(c):a.vc&&!a.P&&(g.rc(),a.vc.Dn(c));c.preventDefault();c.stopPropagation();a.J()}function yb(a,c,d){if(a.kj)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.vc||(a.vc=d);a.tf=c;a.Ms(c);g.Oe&&g.navigation.Ib(g.navigation.Ul)}function zb(a,c,d){if(a.kj)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.P||(a.P=d);yb(a,c,d.Kk())} +function xb(a){a.wc&&!a.P&&$a(a.wc)}function Ab(a,c){a.Lj||a.re||(a.Lj=c,c.ac&&c!=H(c)?Bb(a,H(c)):Bb(a,c))}function Bb(a,c){c.bb?Bb(a,c.getParent()):a.wc=c}function wb(a){if(a.Mj){var c=a.Mj;c=!!c.B&&c.B.ld()&&!!c.wf&&"function"===typeof c.wf}else c=!1;return c&&!a.ij&&(!a.P||!a.P.xk)}b.ic=function(){return this.Tm||this.qj||this.Sm};b.Jk=function(){return this.cf?this.cf.Jk():[]};g.gk.Et=function(){for(var a=g.Jb.getAll(),c=0,d;d=a[c];c++)if(d.Dc)return!0;return!1};g.Pa=function(a,c,d){this.wA=this.Vj=this.dc=null;this.cc=new g.g.$e(0,0);this.Vc=null;d&&this.Od(d);this.setValue(a);c&&(this.Vj=c)};g.Pa.Fv=16;g.Pa.Ew=12.5;g.Pa.bm=10;g.Pa.PL=10;g.Pa.Ci=g.Pa.bm/2;b=g.Pa.prototype;b.name=void 0;b.mz=50;b.B=null;b.Zf=!0;b.ui=!0;b.Wo=null;g.Pa.jw="\u00a0";b=g.Pa.prototype;b.ug=!0;b.Ni=!1;b.Od=function(a){var c=a.tooltip;"string"==typeof c&&(c=g.g.Xd(a.tooltip));c&&this.Sa(c)};b.Yu=function(a){if(this.B)throw Error("Field already bound to a block.");this.B=a}; +b.S=function(){this.mf||(this.mf=g.g.o.I("g",{},null),this.isVisible()||(this.mf.style.display="none"),this.B.ya().appendChild(this.mf),this.Sh(),this.lh(),this.Sa(this.wA),g.K.yk(this.Wo||this.ya()),this.oz=g.la(this.Wo||this.ya(),"mousedown",this,this.gi),this.mj())};b.Sh=function(){this.cc.height=Math.max(this.cc.height,g.Pa.Fv);this.cc.width=Math.max(this.cc.width,g.Pa.bm);this.Vi=g.g.o.I("rect",{rx:4,ry:4,x:0,y:0,height:this.cc.height,width:this.cc.width},this.mf);Cb(this)};b.mj=function(){}; +function Cb(a){a.kc=g.g.o.I("text",{"class":"blocklyText",y:g.Pa.Ew,x:a.Vi?g.Pa.Ci:0},a.mf);a.Rj=document.createTextNode("");a.kc.appendChild(a.Rj)}b.Fm=function(a){this.setValue(a.textContent)};b.uA=function(a){a.textContent=this.getValue();return a};b.J=function(){g.D.Nk(this);g.aa.Nk(this);this.oz&&g.Xa(this.oz);g.g.o.removeNode(this.mf)}; +b.lh=function(){var a=this.Wo||this.ya();this.ug&&a&&(this.B.ld()?(g.g.o.mb(a,"blocklyEditableText"),g.g.o.Tb(a,"blocklyNonEditableText"),a.style.cursor=this.Rq):(g.g.o.mb(a,"blocklyNonEditableText"),g.g.o.Tb(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.ui};b.Vb=function(a){if(this.ui!=a){this.ui=a;var c=this.ya();c&&(c.style.display=a?"block":"none")}};function Db(a,c){a.Vj=c}b.Dy=function(){return this.Vj};b.ya=function(){return this.mf};b.Ue=function(){}; +b.eg=function(){if(this.Rj){this.Rj.nodeValue=Eb(this);var a=g.g.o.yp(this.kc);this.Vi&&(a+=g.Pa.bm,this.Vi.setAttribute("width",a));this.cc.width=a}};b.Ug=function(){if(!this.isVisible())return new g.g.$e(0,0);this.Zf?(this.eg(),this.Zf=!1):this.ui&&0==this.cc.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.eg());return this.cc}; +function Eb(a){var c=a.Sb();if(!c)return g.Pa.jw;c.length>a.mz&&(c=c.substring(0,a.mz-2)+"\u2026");c=c.replace(/\s/g,g.Pa.jw);a.B&&a.B.G&&(c+="\u200f");return c}b.Sb=function(){if(this.st){var a=this.st.call(this);if(null!==a)return String(a)}return String(this.getValue())};b.ll=function(){throw Error("setText method is deprecated");};b.dn=function(){this.Zf=!0};function Fb(a){a.Zf=!0;a.B&&a.B.ba&&(a.B.za(),a.B.Lb())} +b.setValue=function(a){if(null!==a){var c=this.Hh(a);a=Gb(this,a,c);if(!(a instanceof Error)){if(c=this.Dy())if(c=c.call(this,a),a=Gb(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&g.i.isEnabled()&&g.i.Ma(new g.i.pg(this.B,"field",this.name||null,c,a)),this.ej(a),this.Zf&&Fb(this))}}};function Gb(a,c,d){if(null===d)return a.Qx(),a.Zf&&Fb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.dc};b.Hh=function(a){return null===a||void 0===a?null:a}; +b.ej=function(a){this.dc=a;this.Zf=!0};b.Qx=function(){};b.gi=function(a){if(this.B&&this.B.v&&(a=this.B.v.Tg(a))){if(a.kj)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.Mj||(a.Mj=this)}};b.Sa=function(a){var c=this.Wo||this.ya();c?c.zf=a||""===a?a:this.B:this.wA=a};b.un=function(){return!1};b.Wf=function(){for(var a=null,c=this.B,d=c.T,e=0;ec||c>a.Qa.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new g.Id(d));d.Yu(a.B);a.B.ba&&d.S();d.name=e;d.Eu&&(c=Hb(a,c,d.Eu));a.Qa.splice(c,0,d);++c;d.dv&&(c=Hb(a,c,d.dv));a.B.ba&&(a.B.za(),a.B.Lb());return c}function Ib(a,c){for(var d=0,e;e=a.Qa[d];d++)if(e.name===c){e.J();a.Qa.splice(d,1);a.B.ba&&(a.B.za(),a.B.Lb());return}throw Error('Field "%s" not found.',c);}b.isVisible=function(){return this.ui}; +b.Vb=function(a){var c=[];if(this.ui==a)return c;for(var d=(this.ui=a)?"block":"none",e=0,f;f=this.Qa[e];e++)f.Vb(a);if(this.connection){if(a)c=Jb(this.connection);else if(e=this.connection,Kb(e,!0),e.ca)for(e=p(y(e),!1),f=0;fa&&0<=c&&256>c&&0<=d&&256>d)?g.g.Mb.Pu(a,c,d):null}; +g.g.Mb.Pu=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};g.g.Mb.Py=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +g.g.Mb.CF=function(a){var c=g.PB,d=255*g.QB,e=0,f=0,h=0;if(0==c)h=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;h=a;break;case 2:e=a;f=d;h=c;break;case 3:e=a;f=m;h=d;break;case 4:e=c;f=a;h=d;break;case 5:e=d;f=a;h=m;break;case 6:case 0:e=d,f=c,h=a}}return g.g.Mb.Pu(Math.floor(e),Math.floor(f),Math.floor(h))}; +g.g.Mb.ds=function(a,c,d){a=g.g.Mb.Py(g.g.Mb.parse(a));c=g.g.Mb.Py(g.g.Mb.parse(c));return g.g.Mb.Pu(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])))};g.g.Mb.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"};g.eo=function(a,c,d){if(g.Generator&&"undefined"!=typeof g.Generator.prototype[c])throw Error('Block prototypeName "'+c+'" conflicts with Blockly.Generator members.');this.id=d&&!w(a,d)?d:g.g.Rg();a.fs[this.id]=this;this.Z=this.X=this.M=null;this.T=[];this.Yg=void 0;this.disabled=!1;this.zf="";this.contextMenu=!0;this.ag=null;this.Ig=[];this.Tx=this.rz=this.Bs=!0;this.Jg=this.bb=!1;this.Bk=null;this.Ee={text:null,Du:!1,size:new g.g.$e(160,80)};this.KA=new g.g.N(0,0);this.v=a;this.ac=a.oe;this.G=a.G; +this.Wm=!1;this.Wg=void 0;if(c){this.type=c;d=g.L[c];if(!d||"object"!=typeof d)throw TypeError("Unknown block type: "+c);g.g.object.yj(this,d)}a.ul.push(this);a.kh[this.type]||(a.kh[this.type]=[]);a.kh[this.type].push(this);"function"==typeof this.S&&this.S();this.JF=this.Yg;if(g.i.isEnabled()){(a=g.i.$b())||g.i.$(!0);try{g.i.Ma(new g.i.fo(this))}finally{a||g.i.$(!1)}}if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=typeof a)throw Error("onchange must be a function.");this.mn&& +jb(this.v,this.mn);if(this.onchange=a)this.mn=a.bind(this),ib(this.v,this.mn)}};b=g.eo.prototype;b.data=null;b.Eh="#000000";b.kx=null;b.lx=null; +b.J=function(a){if(this.v){this.mn&&jb(this.v,this.mn);g.Oe&&g.navigation.sz(this);z(this,a);g.i.isEnabled()&&g.i.Ma(new g.i.aB(this));g.i.disable();try{if(this.v){db(this.v,this);var c=this.v;c.kh[this.type].splice(c.kh[this.type].indexOf(this),1);c.kh[this.type].length||delete c.kh[this.type];delete this.v.fs[this.id];this.v=null}g.selected==this&&(g.selected=null);for(var d=this.Ig.length-1;0<=d;d--)this.Ig[d].J(!1);d=0;for(var e;e=this.T[d];d++)e.J();this.T.length=0;var f=this.Ie(!0);d=0;for(var h;h= +f[d];d++)h.J()}finally{g.i.enable()}}};b.mj=function(){for(var a=0,c;c=this.T[a];a++)for(var d=0,e;e=c.Qa[d];d++)e.mj&&e.mj()}; +function z(a,c){if(a.M){var d=null;a.M.isConnected()&&(d=a.M.ca,a.M.disconnect());if(d&&c){a:{c=null;for(var e=0;e=d)this.Eh=g.Uy(d);else if(d=g.g.Mb.parse(c))this.Eh=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);};function L(a,c){var d=a.v.zp().CD[c];if(d)a.kx=d.colourSecondary,a.lx=d.colourTertiary,a.Wg=d.Wg,a.Kc(d.colourPrimary);else throw Error("Invalid style name: "+c);}function x(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,h;h=e.Qa[f];f++)if(h.name==c)return h;return null} +b.wt=function(){for(var a=[],c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Qa[e];e++)f.un()&&a.push(f.getValue());return a};b.Vg=function(){for(var a=[],c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Qa[e];e++)f.un()&&(f=this.v.nf(f.getValue()))&&a.push(f);return a};b.zq=function(a){for(var c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Qa[e];e++)f.un()&&a.ua()==f.getValue()&&Fb(f)};b.hq=function(a,c){for(var d=0,e;e=this.T[d];d++)for(var f=0,h;h=e.Qa[f];f++)h.un()&&a==h.getValue()&&h.setValue(c)}; +function F(a,c){return(a=x(a,c))?a.getValue():null}function Pb(a,c,d){a=x(a,d);if(!a)throw Error('Field "'+d+'" not found.');a.setValue(c)}b.qe=function(a,c){if(a){void 0===c&&(c=null);if(!this.Z){if(this.M)throw Error("Remove output connection prior to adding previous connection.");this.Z=this.cn(g.Ze)}this.Z.xb(c)}else if(this.Z){if(this.Z.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.Z.J();this.Z=null}}; +b.pe=function(a,c){if(a)void 0===c&&(c=null),this.X||(this.X=this.cn(g.jb)),this.X.xb(c);else if(this.X){if(this.X.isConnected())throw Error("Must disconnect next statement before removing connection.");this.X.J();this.X=null}}; +b.Ed=function(a,c){if(a){void 0===c&&(c=null);if(!this.M){if(this.Z)throw Error("Remove previous connection prior to adding output connection.");this.M=this.cn(g.Ye)}this.M.xb(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.ad=function(a){this.Yg!=a&&(g.i.Ma(new g.i.pg(this,"inline",null,this.Yg,a)),this.Yg=a)}; +function Ma(a){if(void 0!=a.Yg)return a.Yg;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function M(a,c){return a.dm(g.Wa,c)} +function Rb(a,c){return a.dm(g.jb,c)}function N(a,c){return a.dm(g.tg,c||"")} +function O(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.Wg&&(a.Wg=c.style.Wg,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{L(a,e)}catch(C){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.Kc(e)}catch(C){console.warn(d+ +"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){for(var f=a,h=c["args"+e]||[],k=c["lastDummyAlign"+e],l=g.g.uH(c["message"+e]),m=[],n=0,r=[],t=0;t=v||v>h.length)throw Error('Block "'+f.type+'": Message index %'+v+" out of range.");if(m[v])throw Error('Block "'+f.type+'": Message index %'+v+" duplicated.");m[v]=!0;n++;r.push(h[v-1])}else(v=v.trim())&&r.push(v)}if(n!=h.length)throw Error('Block "'+f.type+'": Message does not reference all '+ +h.length+" arg(s).");r.length&&("string"==typeof r[r.length-1]||g.g.eb.startsWith(r[r.length-1].type,"field_"))&&(t={type:"input_dummy"},k&&(t.align=k),r.push(t));k={LEFT:g.Hq,RIGHT:g.yl,CENTRE:g.xv};h=[];for(t=0;t=this.T.length)throw RangeError("Input index "+a+" out of bounds.");if(c>this.T.length)throw RangeError("Reference input "+c+" out of bounds.");var d=this.T[a];this.T.splice(a,1);ac?d-1:c},a.Xg)}function Yb(a,c,d){var e=a.kb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var h=a.kb[d]||null;if(h&&h.isEnabled()){Ub(a,d);break}f++;d=c.call(a,d,e)}}b.uF=function(a){(a=Vb(this,a.target))&&a.isEnabled()&&(this.kb[this.Xg]||null)!==a&&(Wb(this),this.hh(a))};b.mF=function(a){var c=Vb(this,a.target),d;if(d=c)c.isEnabled()&&(c.hh(!0),$b(c)),d=void 0;d&&a.preventDefault()}; +b.rF=function(){this.focus()};b.tF=function(){this.ta()&&(this.blur(),Wb(this),Ub(this,-1))};b.xt=function(a){return 0!=this.kb.length&&ac(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};function ac(a,c){var d=a.kb[a.Xg]||null;if(d&&"function"==typeof d.xt&&d.xt(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case g.g.Ba.Uq:d&&$b(d);break;case g.g.Ba.Yl:Zb(a);break;case g.g.Ba.El:Xb(a);break;default:return!1}return!0};g.Co=function(a,c){g.yc.call(this);this.gf=a;this.setValue(c);this.lp=!0};g.g.object.W(g.Co,g.yc);b=g.Co.prototype; +b.Ia=function(){var a=document.createElement("div");a.id=this.ua();this.hb=a;a.className="goog-menuitem goog-option "+(this.lp?"":"goog-menuitem-disabled ")+(this.qs?"goog-option-selected ":"")+(this.Xk()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.hm){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(bc(this));g.g.V.hg(a,this.Qu||(this.hm?g.g.V.Li.pC: +g.g.V.Li.oC));g.g.V.Ib(a,g.g.V.State.Sl,this.hm&&this.qs||!1)};function bc(a){a=a.gf;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.dc=a};b.getValue=function(){return this.dc};b.hg=function(a){this.Qu=a};function cc(a,c){if(a.hm){a.qs=c;var d=a.ta();d&&a.isEnabled()&&(c?(g.g.o.mb(d,"goog-option-selected"),g.g.V.Ib(d,g.g.V.State.Sl,!0)):(g.g.o.Tb(d,"goog-option-selected"),g.g.V.Ib(d,g.g.V.State.Sl,!1)))}} +b.hh=function(a){var c=this.ta();c&&this.isEnabled()&&(a?g.g.o.mb(c,"goog-menuitem-highlight"):g.g.o.Tb(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.lp};b.od=function(a){this.lp=a;(a=this.ta())&&(this.lp?g.g.o.Tb(a,"goog-menuitem-disabled"):g.g.o.mb(a,"goog-menuitem-disabled"))};function $b(a){a.hm&&cc(a,!a.qs);a.Qw&&a.Qw.call(a.oD,a)}function dc(a,c,d){a.Qw=c;a.oD=d};g.g.xq={};g.g.xq.Ug=function(a){a=a.ta();var c=g.g.style.Ug(a);c.height=a.scrollHeight;return c};g.g.xq.qD=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};g.Ea={};g.Ea.cp=null;g.Ea.Wx=null;g.Ea.show=function(a,c,d){g.aa.show(g.Ea,d,null);if(c.length){var e=g.Ea.MG(c,d);g.Ea.nd(e,a,d);setTimeout(function(){e.ta().focus()},1);g.Ea.cp=null}else g.Ea.Ca()};g.Ea.MG=function(a,c){var d=new g.Gi;Aa(d,c);for(var e=0,f;f=a[e];e++){var h=new g.Co(f.text);Aa(h,c);d.cm(h,d.kb.length,!0);h.od(f.enabled);f.enabled&&dc(h,function(){g.Ea.Ca();this.Bb()},f)}return d}; +g.Ea.nd=function(a,c,d){var e=g.g.iF();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};g.Ea.fE(a);var f=g.g.xq.Ug(a);d&&g.g.xq.qD(e,c,f);g.aa.NG(e,c,f,d);a.ta().focus()};g.Ea.fE=function(a){a.za(g.aa.Ga);var c=a.ta();g.g.o.mb(c,"blocklyContextMenu");g.la(c,"contextmenu",null,g.g.mG);a.focus()};g.Ea.Ca=function(){g.aa.Nk(g.Ea);g.Ea.cp=null;g.Ea.Wx&&g.Xa(g.Ea.Wx)}; +g.Ea.So=function(a,c){return function(){g.i.disable();try{var d=g.R.fj(c,a.v),e=a.Ra();e.x=a.G?e.x-g.vd:e.x+g.vd;e.y+=2*g.vd;d.moveBy(e.x,e.y)}finally{g.i.enable()}g.i.isEnabled()&&!d.bb&&g.i.Ma(new g.i.fo(d));d.select()}};g.Ea.zD=function(a){var c=p(a,!1).length,d=q(a);d&&(c-=p(d,!1).length);return{text:1==c?g.h.DELETE_BLOCK:g.h.DELETE_X_BLOCKS.replace("%1",String(c)),enabled:!0,Bb:function(){g.i.$(!0);a.J(!0,!0);g.i.$(!1)}}}; +g.Ea.BD=function(a){return{enabled:!("function"==typeof a.wb?!a.wb():!a.wb),text:g.h.HELP,Bb:function(){var c="function"==typeof a.wb?a.wb():a.wb;c&&window.open(c)}}};g.Ea.AD=function(a){var c=gb(a.v)?fb(a.v,g.g.gt(a,!0)):!0;return{text:g.h.DUPLICATE_BLOCK,enabled:c,Bb:function(){g.Sx(a)}}};g.Ea.yD=function(a){var c={enabled:!g.g.userAgent.vg};a.Bk?(c.text=g.h.REMOVE_COMMENT,c.Bb=function(){a.gg(null)}):(c.text=g.h.ADD_COMMENT,c.Bb=function(){a.gg("")});return c}; +g.Ea.VL=function(a){return{text:g.h.YK,enabled:!0,Bb:function(){g.i.$(!0);a.J(!0,!0);g.i.$(!1)}}};g.Ea.WL=function(a){return{text:g.h.EI,enabled:!0,Bb:function(){g.Sx(a)}}}; +g.Ea.IM=function(a,c){if(!g.vk)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!g.g.userAgent.vg};d.text=g.h.OH;d.Bb=function(){var e=new g.vk(a,g.h.NL,g.vk.tB,g.vk.tB),f=aa(a).getBoundingClientRect();f=new g.g.N(c.clientX-f.left,c.clientY-f.top);var h=g.g.Jm(a.fb);f=g.g.N.xm(f,h);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ba&&(e.Ne(),e.za(),e.select())};return d};g.Ag=function(a,c){g.Ag.w.constructor.call(this,a,c);this.Qf=a.v.ap[c];this.Cx=a.v.ap[g.nk[c]];this.Cj=new g.g.N(0,0);this.Rh=!1;this.Ry=!this.Qf};g.g.object.W(g.Ag,g.sa);b=g.Ag.prototype;b.J=function(){g.Ag.w.J.call(this);this.Rh&&ec(this.Qf,this)};function fc(a,c){var d=a.Xb-c.Xb;a=a.$a-c.$a;return Math.sqrt(d*d+a*a)} +function gc(a,c){if(!a.B.v.ic()){var d=H(a.B);if(!d.ac){var e=!1;if(!d.Fc()){d=H(c.B);if(!d.Fc())return;c=a;e=!0}var f=g.selected==d;f||d.Po();var h=c.Xb+g.vd+Math.floor(Math.random()*g.Lq)-a.Xb,k=c.$a+g.vd+Math.floor(Math.random()*g.Lq)-a.$a;e&&(k=-k);d.G&&(h=c.Xb-g.vd-Math.floor(Math.random()*g.Lq)-a.Xb);d.moveBy(h,k);f||d.vn()}}}b.moveTo=function(a,c){this.Rh&&ec(this.Qf,this);this.Xb=a;this.$a=c;this.Ry||hc(this.Qf,this)};b.moveBy=function(a,c){this.moveTo(this.Xb+a,this.$a+c)}; +function ic(a,c){a.moveTo(c.x+a.Cj.x,c.y+a.Cj.y)}function jc(a,c,d){a.Cj.x=c;a.Cj.y=d}function kc(a){var c=a.ca.Xb-a.Xb,d=a.ca.$a-a.$a;if(0!=c||0!=d){a=y(a);var e=a.ya();if(!e)throw Error("block is not rendered.");e=g.g.Ke(e);a.ya().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Za(a,-c,-d)}} +b.closest=function(a,c){var d=this.Cx;if(d.gc.length){var e=this.$a,f=this.Xb;this.Xb=f+c.x;this.$a=e+c.y;var h=lc(d,this);c=null;for(var k=a,l,m=h-1;0<=m&&Math.abs(d.gc[m].$a-this.$a)<=a;)l=d.gc[m],this.Kp(l,k)&&(c=l,k=fc(l,this)),m--;for(;hc?!1:g.Ag.w.Kp.call(this,a)};b.Xp=function(a){gc(this,a)};b.Js=function(a,c){g.Ag.w.Js.call(this,a,c);a.ba&&a.za();c.ba&&(Ha(c),c.za())}; +b.Ou=function(){var a=this.B,c=this.vf;if(a.v&&c&&g.i.Jc){g.Ag.w.Ou.call(this);c=y(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Ne();c.za(!1);a.ba&&a.za()}};b.uz=function(a){return mc(this.Cx,this,a)};b.ef=function(a){g.Ag.w.ef.call(this,a);var c=this.B;a=a.B;c.ba&&Ha(c);a.ba&&Ha(a);c.ba&&a.ba&&(this.type==g.jb||this.type==g.Ze?a.za():c.za())};b.Bz=function(){this.isConnected()&&!Ja(this,this.ca)&&(z(E(this)?y(this):this.B),this.B.Lb())};g.g.Rect=function(a,c,d,e){this.top=a;this.bottom=c;this.left=d;this.right=e};g.g.Rect.prototype.contains=function(a,c){return a>=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};g.Ld=function(a){this.U=a};b=g.Ld.prototype;b.ix=!0;b.Ko=17;b.Zb=null;b.Qk=null;function nc(a){a.Ud||(a.Ud=g.g.o.I("g",{"class":"blocklyIconGroup"},null),a.U.ac&&g.g.o.mb(a.Ud,"blocklyIconGroupReadonly"),a.Qs(a.Ud),a.U.ya().appendChild(a.Ud),g.la(a.Ud,"mouseup",a,a.Dt),a.lh())}b.J=function(){g.g.o.removeNode(this.Ud);this.Ud=null;this.Vb(!1);this.U=null};b.lh=function(){};b.isVisible=function(){return!!this.Zb};b.Dt=function(a){this.U.v.ic()||this.U.ac||g.g.tj(a)||this.Vb(!this.isVisible())}; +b.Ue=function(){this.isVisible()&&this.Zb.Kc(this.U.Eh)};function Ua(a,c){a.Qk=c;a.isVisible()&&(a=a.Zb,a.fc=c,a.Ku&&kb(a))}function oc(a){var c=a.U.Ra(),d=g.g.Ke(a.Ud);c=new g.g.N(c.x+d.x+a.Ko/2,c.y+d.y+a.Ko/2);g.g.N.He(a.Qk,c)||Ua(a,c)};g.Jf=function(a){g.Jf.w.constructor.call(this,a);nc(this);this.mg={}};g.g.object.W(g.Jf,g.Ld);g.Jf.prototype.ix=!1;g.Jf.prototype.Qs=function(a){g.g.o.I("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);g.g.o.I("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);g.g.o.I("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)}; +g.Jf.sH=function(a){var c=g.g.o.I("text",{"class":"blocklyText blocklyBubbleText",y:g.oa.dd},null);a=a.split("\n");for(var d=0;d=a.gc.length)return-1;for(var e=c.$a,f=d;0<=f&&a.gc[f].$a==e;){if(a.gc[f]==c)return f;f--}for(;dc.$a)e=f;else{d=f;break}}return d}function ec(a,c){if(!c.Rh)throw Error("Connection not in database.");var d=vc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Rh=!1;a.gc.splice(d,1)} +function mc(a,c,d){function e(n){var r=h-f[n].Xb,t=k-f[n].$a;Math.sqrt(r*r+t*t)<=d&&m.push(f[n]);return tthis.rn){var d=c-this.rn;d=0Object.keys(this.De).length&&(this.De={},this.rn=0)}!this.Op||this.ic()?g.Touch.$u(a)&&g.ge.w.Bp.call(this,a):(a.preventDefault(),a.stopPropagation(),this.J())};b.J=function(){g.ge.w.J.call(this);this.wu&&g.Xa(this.wu)};function wc(a,c){a.De[g.Touch.Ap(c)]=xc(a,c);var d=Object.keys(a.De);2==d.length&&(a.lA=g.g.N.jp(a.De[d[0]],a.De[d[1]]),a.Op=!0,c.preventDefault())} +function xc(a,c){return a.vc?new g.g.N(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};g.Mw=function(a){this.Au=a;this.Tl=Object.create(null)};b=g.Mw.prototype;b.Pt=null;b.J=function(){this.Tl=this.Au=null};b.load=function(a,c){if(a.length){try{var d=new g.g.global.Audio}catch(l){return}for(var e,f=0;f=eb(a)))if(a.Dc&&a.Dc.cancel(),"comment"==c.tagName.toLowerCase()){g.i.disable();try{var d=g.vk.Fm(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{g.i.enable()}d.select()}else a:{g.i.disable();try{var h=g.R.fj(c,a),k=a.bc.Rb;if(g.Oe&&k){g.navigation.Xy(h,k.qa);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 t=r.Ra();if(1>=Math.abs(l-t.x)&&1>=Math.abs(m-t.y)){c=!0;break}}if(!c){var v=h.Ie(!1);d=0;for(var C;C=v[d];d++)if(C.closest(g.vd,new g.g.N(l,m)).connection){c=!0;break}}c&&(l=a.G?l-g.vd:l+g.vd,m+=2*g.vd)}while(c);h.moveBy(l,m)}}finally{g.i.enable()}g.i.isEnabled()&&!h.bb&&g.i.Ma(new g.i.fo(h));h.select()}} +function Fc(a){if((a=a.oe?a.Qj:a)&&!a.Dc&&a.ra&&a.ra.P){a=a.ra;var c=a.Fd.Yd;c&&c.Lf&&a.P.show(c.Lf)}}b.ni=function(a,c){g.lb.w.ni.call(this,a,c);Fc(this)};b.Rf=function(a){g.lb.w.Rf.call(this,a);Fc(this)};b.Qd=function(a,c,d){a=g.lb.w.Qd.call(this,a,c,d);Fc(this);return a};function zc(a){a.Gx=a.bd&&a.H.parentNode?a.bd.Hm():null;a.Fx=a.P?a.P.Hm():a.ra?a.ra.Hm():null}function Va(a,c){return a.Gx&&a.Gx.contains(c.clientX,c.clientY)?g.Sq:a.Fx&&a.Fx.contains(c.clientX,c.clientY)?g.Pv:g.Ov} +b.gi=function(a){var c=this.Tg(a);c&&yb(c,a,this)};b.bv=function(a,c){a=g.g.kn(a,u(this),qa(this));a.x/=this.scale;a.y/=this.scale;this.Rx=g.g.N.xm(c,a)};b.ic=function(){return null!=this.Dc&&this.Dc.ic()};function Gc(a){return a.options.Hc&&a.options.Hc.scrollbars||a.options.Hc&&a.options.Hc.Yj||a.options.Hc&&a.options.Hc.Ih||a.options.Eb&&a.options.Eb.controls||a.options.Eb&&a.options.Eb.Yj} +b.Fc=function(){return this.options.Hc&&this.options.Hc.scrollbars||this.options.Hc&&this.options.Hc.Yj||this.options.Hc&&this.options.Hc.Ih||this.options.Eb&&this.options.Eb.Yj}; +b.HG=function(a){if(g.gk.Et())a.preventDefault(),a.stopPropagation();else{var c=this.options.Eb&&this.options.Eb.Yj,d=this.options.Hc&&this.options.Hc.Yj;if(c||d){var e=g.g.xy(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=g.g.kn(a,u(this),qa(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}}; +function Fa(a){var c=D(a,!1);a=Ea(a,!1);c=c.concat(a);if(!c.length)return new g.g.Rect(0,0,0,0);a=rc(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.PD=function(){this.Lc(!1);g.i.$(!0);for(var a=D(this,!0),c=0,d=0,e;e=a[d];d++)if(e.Fc()){var f=e.Ra();e.moveBy(-f.x,c-f.y);qc(e);c=e.Ra().y+G(e).height+g.wa.lr}g.i.$(!1);this.Lc(!0)}; +b.Dn=function(a){function c(C){if(C.ne())v=v.concat(p(C,!1));else{C=C.Kh(!1);for(var Q=0;Qv.length?d():g.confirm(g.h.DELETE_ALL_BLOCKS.replace("%1",v.length),function(C){C&&d()})}};e.push(l);this.nx&&this.nx(e);g.Ea.show(a,e,this.G)}};function pa(a){if(a.options.Ob)pa(a.options.Ob);else{g.an=a;document.activeElement&&document.activeElement.blur();try{u(a).focus()}catch(c){try{u(a).parentNode.setActive()}catch(d){u(a).parentNode.focus()}}}} +b.zoom=function(a,c,d){if(!this.oe&&!this.sj){d=Math.pow(this.options.Eb.XG,d);var e=this.scale*d;if(this.scale!=e){e>this.options.Eb.fn?d=this.options.Eb.fn/this.scale:ethis.options.Eb.fn?a=this.options.Eb.fn:this.options.Eb.hn&&ak.BA||k.Cck.CA){l=null;h&&(l=g.i.$b(),g.i.$(h.group));switch(h.type){case g.i.Al:case g.i.Dv:var n=w(f,h.Bc);n=H(n);break;case g.i.io:case g.i.jo:n=f.Zo[h.Of]||null}if(n){m=rc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var r=k.mc,t=k.BA-m.height;t=Math.max(r,t);r=g.g.Ja.Mf(r,m.top,t)-m.top;t=k.ec;var v=k.CA-m.width;k.G?t=Math.min(v,t):v=Math.max(t,v);n.moveBy(g.g.Ja.Mf(t, +m.left,v)-m.left,r)}h&&(h.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&g.i.$(l))}}});g.ol(f);g.aa.Ia();g.D.Ia();g.K.Ia();return f}; +g.IF=function(a){var c=a.options,d=u(a);g.la(d.parentNode,"contextmenu",null,function(e){g.g.Pp(e)||e.preventDefault()});d=g.la(window,"resize",null,function(){g.rc(!0);g.ol(a)});a.kq=d;g.Th.xD();c.Yk&&(a.ra?a.ra.S(a):a.P&&(a.P.S(a),a.P.show(c.Yk.childNodes),a.P.uc.set(0)));d=g.La.tc;c.Ny&&(d=a.bd.S(d));c.Eb&&c.Eb.controls&&a.$j.S(d);c.Hc&&c.Hc.scrollbars?(a.Ub=new g.rk(a),a.Ub.resize()):a.pi({x:.5,y:.5});c.zF&&g.Th.TF(c.uf,a)}; +g.Th.xD=function(){g.AE||(g.la(document,"scroll",null,function(){for(var a=g.Jb.getAll(),c=0,d;d=a[c];c++)d.Un&&d.Un()}),g.la(document,"keydown",null,g.wG),g.hd(document,"touchend",null,g.ai),g.hd(document,"touchcancel",null,g.ai),g.g.userAgent.xg&&g.la(window,"orientationchange",document,function(){g.ol(g.Db())}));g.AE=!0}; +g.Th.TF=function(a,c){function d(){for(;f.length;)g.Xa(f.pop());e.preload()}var e=c.zh;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(g.la(document,"mousemove",null,d,!0));f.push(g.la(document,"touchstart",null,d,!0))};g.Bf=function(a){this.name=a};g.F=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.Sn=a;this.Rm=g.F.MF(a);this.qa=c;(a=d||null)&&a.IA&&(this.JA=a.IA)};g.F.types={we:"field",ee:"block",wg:"input",qk:"output",ze:"next",Be:"previous",Gf:"stack",Ti:"workspace"};g.F.sB=-20;g.F.MF=function(a){switch(a){case g.F.types.Be:case g.F.types.ze:case g.F.types.wg:case g.F.types.qk:return!0}return!1};g.F.qm=function(a){return new g.F(g.F.types.we,a)}; +g.F.Pf=function(a){return a?a.type==g.Wa||a.type==g.jb&&a.Wf()?g.F.$i(a.Wf()):a.type==g.jb?new g.F(g.F.types.ze,a):a.type==g.Ye?new g.F(g.F.types.qk,a):a.type==g.Ze?new g.F(g.F.types.Be,a):null:null};g.F.$i=function(a){return a?new g.F(g.F.types.wg,a.connection):null};g.F.Lg=function(a){return new g.F(g.F.types.ee,a)};g.F.rm=function(a){return new g.F(g.F.types.Gf,a)};g.F.sm=function(a,c){return new g.F(g.F.types.Ti,a,{IA:c})};b=g.F.prototype;b.Nb=function(){return this.Sn}; +function Ic(a,c){a=a.qa;a instanceof g.eo||(a=a.B);if(!a||!a.v)return null;var d=H(a);a=D(d.v,!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:g.F.rm(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function Jc(a){if(!a)return null;do var c=a.Z&&y(a.Z);while(c&&q(c)==a&&(a=c));return(c=a.Z||a.M)&&c.ca&&c.ca.Wf()?g.F.$i(c.ca.Wf()):g.F.rm(a)} +b.next=function(){switch(this.Sn){case g.F.types.Gf:return Ic(this,!0);case g.F.types.qk:return g.F.Lg(this.qa.B);case g.F.types.we:a:{var a=this.qa,c=a.Wf();var d=a.B;a=c.Qa.indexOf(a)+1;c=d.T.indexOf(c);for(var e;e=d.T[c];c++){for(var f=e.Qa;a1'), +e.appendChild(d),c.push(e));if(g.L.variables_get){a.sort(g.Zl.mx);d=0;for(var f;f=a[d];d++)e=g.g.xml.createElement("block"),e.setAttribute("type","variables_get"),e.setAttribute("gap",8),e.appendChild(g.O.Gm(f)),c.push(e)}}return c}; +g.O.ky=function(a){a=a.Sg();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var h=!1,k=0;kf?g.aa.qn(a,0,d.height+f):g.aa.qn(a,f,d.height)}; +g.aa.FD=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)};g.aa.GD=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};g.VERSION="uncompiled";g.an=null;g.selected=null;g.cursor=null;g.Oe=!1;g.zm=[];g.im=null;g.Xo=null;g.ss=null;g.TL=null;g.rA=function(a){return{width:a.Xw,height:a.Vw}};g.vM=function(a){Ia(a)};g.ol=function(a){for(;a.options.Ob;)a=a.options.Ob;var c=u(a),d=c.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.Xw!=e&&(c.setAttribute("width",e+"px"),c.Xw=e);c.Vw!=d&&(c.setAttribute("height",d+"px"),c.Vw=d);a.resize()}}; +g.wG=function(a){var c=g.an;if(!(g.g.Pp(a)||c.ba&&!c.isVisible()))if(c.options.readOnly)g.navigation.Ez(a);else{var d=!1;if(a.keyCode==g.g.Ba.Vq)g.rc(),g.navigation.ei(g.navigation.Eq);else{if(g.navigation.Ez(a))return;if(a.keyCode==g.g.Ba.WA||a.keyCode==g.g.Ba.Dl){a.preventDefault();if(g.gk.Et())return;g.selected&&g.selected.ne()&&(d=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(g.gk.Et())return;g.selected&&g.selected.ne()&&g.selected.Fc()&&(a.keyCode==g.g.Ba.bB?(g.rc(),g.ws(g.selected)):a.keyCode!= +g.g.Ba.Ow||g.selected.v.oe||(g.ws(g.selected),d=!0));a.keyCode==g.g.Ba.$C?g.im&&(a=g.Xo,a.oe&&(a=a.Qj),g.ss&&fb(a,g.ss)&&(g.i.$(!0),Ec(a),g.i.$(!1))):a.keyCode==g.g.Ba.kD&&(g.rc(),c.kv(a.shiftKey))}}d&&!g.selected.v.oe&&(g.i.$(!0),g.rc(),g.selected.J(!0,!0),g.i.$(!1))}};g.ws=function(a){if(a.$y)var c=a.fv();else{c=g.R.Bh(a,!0);g.R.qE(c);var d=a.Ra();c.setAttribute("x",a.G?-d.x:d.x);c.setAttribute("y",d.y)}g.im=c;g.Xo=a.v;g.ss=a.$y?null:g.g.gt(a,!0)}; +g.Sx=function(a){var c=g.im,d=g.Xo;g.ws(a);Ec(a.v);g.im=c;g.Xo=d};g.tM=function(a){g.g.Pp(a)||a.preventDefault()};g.rc=function(a){g.K.Ca();g.aa.Ca();g.D.Ok();a||(a=g.Db(),a.bd&&a.bd.P&&a.bd.P.Ca(),a.ra&&a.ra.P&&a.ra.P.xk&&Kc(a.ra.Fd,null))};g.Db=function(){return g.an};g.alert=function(a,c){alert(a);c&&c()};g.confirm=function(a,c){c(confirm(a))};g.prompt=function(a,c,d){d(prompt(a,c))};g.RF=function(a){return function(){O(this,a)}}; +g.Fk=function(a){for(var c=0;ck[0]?1:h[0]=a.options.length&&(a.style.display= +"none")}for(d=1;10>=d;d++)a=document.getElementById("level"+d),c=!!Wc(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(Xc,1)}function Wc(a){var c=Yc;try{var d=window.localStorage[c+a]}catch(e){}return d}function S(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 Zc(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 $c(a){a%=360;0>a&&(a+=360);return a} +function Xc(){if(!Qc){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")}};g.g.A={};g.g.A.Va=function(a,c){return" "+a+","+c+" "};g.g.A.curve=function(a,c){return" "+a+c.join("")};g.g.A.moveTo=function(a,c){return" M "+a+","+c+" "};g.g.A.moveBy=function(a,c){return" m "+a+","+c+" "};g.g.A.lineTo=function(a,c){return" l "+a+","+c+" "};g.g.A.line=function(a){return" l"+a.join("")};g.g.A.ea=function(a,c){return" "+a+" "+c+" "};g.g.A.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};g.m.Bi=function(){this.Ff=0;this.LC=3;this.Ef=5;this.gw=8;this.ud=10;this.Dw=this.Ef;this.Jr=15;this.Wl=5;this.xh=8;this.uC=15;this.tC=4;this.rC=12;this.yB=16;this.zb=8;this.Do=15;this.SC=0;this.TC=20;this.XA=4;this.OC=15;this.PC=100;this.NC=15;this.kr=24;this.AB=14.5;this.zB=this.Jr+11;this.CB=2;this.BB=this.kr;this.zw=g.g.A.moveBy(0,0);this.XB=12;this.YB=6};b=g.m.Bi.prototype; +b.S=function(){this.jk=this.Wt();this.mk=this.Xt();this.Bg=this.Zt();this.Ji=this.Yt();var a=this.zb,c=g.g.A.arc("a","0 0,0",a,g.g.A.Va(-a,a)),d=g.g.A.arc("a","0 0,0",a,g.g.A.Va(a,a));this.Kl={width:a,height:a,Bu:c,$p:d};c=this.zb;a=g.g.A.moveBy(0,c)+g.g.A.arc("a","0 0,1",c,g.g.A.Va(c,-c));c=g.g.A.arc("a","0 0,1",c,g.g.A.Va(-c,-c));this.nw={iv:a,hs:c}};b.Wt=function(){var a=this.XB,c=this.YB,d=g.g.A.line([g.g.A.Va(6,3),g.g.A.Va(-12,6),g.g.A.Va(6,3)]);return{height:a,width:c,path:d}}; +b.Zt=function(){var a=this.OC,c=this.PC,d=g.g.A.curve("c",[g.g.A.Va(30,-a),g.g.A.Va(70,-a),g.g.A.Va(c,0)]);return{height:a,width:c,path:d}};b.Yt=function(){function a(h){h=h?-1:1;var k=-h,l=d/2,m=g.g.A.Va(c,h*l);return g.g.A.curve("c",[g.g.A.Va(0,h*(l+2.5)),g.g.A.Va(-c,k*(l+.5)),g.g.A.Va(-c,h*l)])+g.g.A.curve("s",[g.g.A.Va(c,2.5*k),m])}var c=this.xh,d=this.Jr,e=a(!0),f=a(!1);return{width:c,height:d,Se:f,pn:e}}; +b.Xt=function(){function a(k){return g.g.A.line([g.g.A.Va(k*e,d),g.g.A.Va(3*k,0),g.g.A.Va(k*e,-d)])}var c=this.uC,d=this.tC,e=(c-3)/2,f=a(1),h=a(-1);return{width:c,height:d,ji:f,Lz:h}};g.m.u={NONE:0,we:1,Tv:2,Wv:4,Fr:8,Cv:16,$v:32,Sv:64,wg:128,Yv:256,Aw:512,lB:1024,xr:2048,mr:4096,yC:8192,Qq:16384,gr:32768,er:65536,Br:131072,Ar:262144,cw:524288,Dr:1048576,Mr:2097152,Kq:4194304,Zv:8388608};g.m.u.wJ=g.m.u.gr|g.m.u.er;g.m.u.aL=g.m.u.Br|g.m.u.Ar;g.m.u.mu=16777216;g.m.u.Nb=function(){g.m.u.hasOwnProperty(void 0)||(g.m.u[void 0]=g.m.u.mu,g.m.u.mu<<=1);return g.m.u[void 0]};g.m.u.Vm=function(a){return a.type&g.m.u.we};g.m.u.rj=function(a){return a.type&g.m.u.Tv}; +g.m.u.Uk=function(a){return a.type&g.m.u.Wv};g.m.u.sf=function(a){return a.type&g.m.u.Fr};g.m.u.iM=function(a){return a.type&g.m.u.$v};g.m.u.rf=function(a){return a.type&g.m.u.wg};g.m.u.Um=function(a){return a.type&g.m.u.Sv};g.m.u.Uh=function(a){return a.type&g.m.u.Yv};g.m.u.Ym=function(a){return a.type&g.m.u.Aw};g.m.u.Wk=function(a){return a.type&g.m.u.xr};g.m.u.Xh=function(a){return a.type&g.m.u.mr};g.m.u.QF=function(a){return a.type&(g.m.u.xr|g.m.u.mr)};g.m.u.Wh=function(a){return a.type&g.m.u.er}; +g.m.u.kM=function(a){return a.type&g.m.u.Ar};g.m.u.Xm=function(a){return a.type&g.m.u.gr};g.m.u.lM=function(a){return a.type&g.m.u.Br};g.m.u.hM=function(a){return a.type&g.m.u.Qq};g.m.u.az=function(a){return a.type&g.m.u.cw};g.m.u.mM=function(a){return a.type&g.m.u.Dr};g.m.u.gM=function(a){return a.type&g.m.u.Cv};g.m.u.Qp=function(a){return a.type&g.m.u.Mr};g.m.u.Jp=function(a){return a.type&g.m.u.Kq};g.m.u.nM=function(a){return a.type&(g.m.u.Mr|g.m.u.Kq)};g.m.u.jM=function(a){return a.type&g.m.u.Zv};g.m.qh=function(a){this.height=this.width=0;this.type=g.m.u.NONE;this.Ch=this.Ua=0;this.C=a;this.Pe=this.C.Do};g.m.sa=function(a,c){g.m.sa.w.constructor.call(this,a);this.vs=c;a:switch(a=this.C,c.type){case g.Wa:case g.Ye:c=a.Ji;break a;case g.Ze:case g.jb:c=a.mk;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=g.m.u.lB};g.g.object.W(g.m.sa,g.m.qh);g.m.vr=function(a,c){g.m.vr.w.constructor.call(this,a,c);this.type|=g.m.u.yC;this.height=this.shape.height;this.width=this.shape.width;this.Fe=this.C.Wl;this.se=this.width};g.g.object.W(g.m.vr,g.m.sa); +g.m.yr=function(a,c){g.m.yr.w.constructor.call(this,a,c);this.type|=g.m.u.xr;this.height=this.shape.height;this.width=this.shape.width};g.g.object.W(g.m.yr,g.m.sa);g.m.nr=function(a,c){g.m.nr.w.constructor.call(this,a,c);this.type|=g.m.u.mr;this.height=this.shape.height;this.width=this.shape.width};g.g.object.W(g.m.nr,g.m.sa);g.m.Ll=function(a,c){g.m.Ll.w.constructor.call(this,a,c.connection);this.type|=g.m.u.wg;this.input=c;this.align=c.align;(this.Xi=c.connection&&y(c.connection)?y(c.connection):null)?(a=G(this.Xi),this.lm=a.width,this.$o=a.height):this.$o=this.lm=0;this.connection=c.connection;this.Fe=0};g.g.object.W(g.m.Ll,g.m.sa); +g.m.oh=function(a,c){g.m.oh.w.constructor.call(this,a,c);this.type|=g.m.u.Yv;this.Xi?(this.width=this.lm,this.height=this.$o):(this.height=this.C.zB,this.width=this.shape.width+this.C.AB);this.Fe=this.C.Wl;this.mm=this.shape.height;this.Gh=this.shape.width};g.g.object.W(g.m.oh,g.m.Ll);g.m.wh=function(a,c){g.m.wh.w.constructor.call(this,a,c);this.type|=g.m.u.Aw;this.height=this.Xi?this.$o+this.C.SC:this.C.BB;this.width=this.C.Do+this.shape.width};g.g.object.W(g.m.wh,g.m.Ll); +g.m.so=function(a,c){g.m.so.w.constructor.call(this,a,c);this.type|=g.m.u.Sv;this.height=this.Xi?this.$o-2*this.C.Wl:this.shape.height;this.width=this.shape.width+this.C.CB;this.Fe=this.C.Wl;this.mm=this.shape.height;this.Gh=this.shape.width};g.g.object.W(g.m.so,g.m.Ll);g.m.Ld=function(a,c){g.m.Ld.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=g.m.u.Wv;a=new g.g.$e(g.Ld.prototype.Ko,g.Ld.prototype.Ko-2);this.height=a.height;this.width=a.width};g.g.object.W(g.m.Ld,g.m.qh);g.m.dr=function(a){g.m.dr.w.constructor.call(this,a);this.type|=g.m.u.cw;this.height=this.C.jk.height;this.width=this.C.jk.width};g.g.object.W(g.m.dr,g.m.qh); +g.m.Pa=function(a,c){g.m.Pa.w.constructor.call(this,a);this.Xx=c;this.ld=c.ug&&!!c.B&&c.B.ld();this.NE=!1;this.type|=g.m.u.we;a=this.Xx.Ug();this.height=a.height;this.width=a.width};g.g.object.W(g.m.Pa,g.m.qh);g.m.Zq=function(a){g.m.Zq.w.constructor.call(this,a);this.type|=g.m.u.Tv;this.height=this.C.Bg.height;this.width=this.C.Bg.width;this.wk=this.height};g.g.object.W(g.m.Zq,g.m.qh); +g.m.No=function(a,c){g.m.No.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.m.u.Br:g.m.u.gr)|g.m.u.Qq;this.width=this.height=this.C.Ff};g.g.object.W(g.m.No,g.m.qh);g.m.Jo=function(a,c){g.m.Jo.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.m.u.Ar:g.m.u.er)|g.m.u.Qq;this.width=this.C.zb;this.height=this.C.zb/2};g.g.object.W(g.m.Jo,g.m.qh);g.m.hk=function(a,c){g.m.hk.w.constructor.call(this,a);this.type=this.type|g.m.u.Fr|g.m.u.$v;this.width=c;this.height=this.C.NC};g.g.object.W(g.m.hk,g.m.qh);g.m.Mi=function(a){this.type=g.m.u.Dr;this.elements=[];this.Ua=this.Oc=this.ng=this.minWidth=this.minHeight=this.width=this.height=0;this.Ly=this.Cp=this.At=this.Ad=this.jj=!1;this.C=a;this.Pe=this.C.Do};g.m.Mi.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function ad(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.m.u.rf(d))return d;return null}g.m.Mi.prototype.cv=function(){return!0};g.m.Mi.prototype.Vx=function(){return!0}; +function bd(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.m.u.sf(d))return d;return null}g.m.tk=function(a){g.m.tk.w.constructor.call(this,a);this.type|=g.m.u.Mr;this.wk=this.Hg=0;this.yF=!1;this.connection=null};g.g.object.W(g.m.tk,g.m.Mi);g.m.tk.prototype.Bt=function(a){var c=a.Wg?"cap"===a.Wg:g.wa.Bg,d=a.Z&&y(a.Z);return!!a.M||c||(d?q(d)==a:!1)}; +g.m.tk.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.m.u.sf(f)||(g.m.u.rj(f)?d=Math.max(d,f.wk):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Hg=this.wk=d;this.ng=this.width};g.m.tk.prototype.cv=function(){return!1};g.m.ak=function(a){g.m.ak.w.constructor.call(this,a);this.type|=g.m.u.Kq;this.My=!1;this.connection=null;this.Ui=this.wm=0};g.g.object.W(g.m.ak,g.m.Mi); +g.m.ak.prototype.Bt=function(a){return!!a.M||!!q(a)};g.m.ak.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.m.u.sf(f)||(g.m.u.Xh(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.wm=d;this.ng=this.width};g.m.ak.prototype.cv=function(){return!1}; +g.m.Mo=function(a,c,d){g.m.Mo.w.constructor.call(this,a);this.type=this.type|g.m.u.Fr|g.m.u.Cv;this.width=d;this.height=c;this.iy=!1;this.ng=0;this.elements=[new g.m.hk(this.C,d)]};g.g.object.W(g.m.Mo,g.m.Mi);g.m.Mo.prototype.measure=function(){};g.m.ik=function(a){g.m.ik.w.constructor.call(this,a);this.type|=g.m.u.Zv;this.px=0};g.g.object.W(g.m.ik,g.m.Mi); +g.m.ik.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,g.m.u.rf(d)&&(g.m.u.Ym(d)?a+=d.lm:g.m.u.Um(d)&&0!=d.lm&&(a+=d.lm-d.Gh)),g.m.u.sf(d)||(this.height=Math.max(this.height,d.height));this.px=a;this.ng=this.width+a};g.m.ik.prototype.Vx=function(){return!this.jj&&!this.Ad};g.m.uh=function(a,c){this.U=c;this.eh=a;this.C=this.eh.C;this.M=c.M?new g.m.vr(this.C,c.M):null;this.Jt=Ma(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Vh=c.Vh();this.G=c.G;this.Nj=this.width=this.wl=this.height=0;this.rows=[];this.Qy=[];this.lc=new g.m.tk(this.C);this.Kb=new g.m.ak(this.C);this.rq=this.se=0};b=g.m.uh.prototype; +b.measure=function(){var a=this.U.Wg?"cap"===this.U.Wg:g.wa.Bg,c=!!this.U.Z;this.lc.Bt(this.U)?this.lc.elements.push(new g.m.No(this.C)):this.lc.elements.push(new g.m.Jo(this.C));a?(a=new g.m.Zq(this.C),this.lc.elements.push(a),this.lc.Hg=a.wk):c&&(this.lc.yF=!0,this.lc.connection=new g.m.yr(this.C,this.U.Z),this.lc.elements.push(this.lc.connection));this.U.T.length&&this.U.T[0].type==g.jb&&!this.U.isCollapsed()?this.lc.minHeight=this.C.ud:this.lc.minHeight=this.C.Ef;this.rows.push(this.lc);a=new g.m.ik(this.C); +var d=Sa(this.U);if(d.length){c=0;for(var e;e=d[c];c++){var f=new g.m.Ld(this.C,e);this.isCollapsed&&e.ix?this.Qy.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.U.T[c];c++)if(d.isVisible()){!e||d.type!=g.jb&&e.type!=g.jb&&(d.type!=g.Wa&&d.type!=g.tg||this.Jt)||(this.rows.push(a),a=new g.m.ik(this.C));for(e=0;f=d.Qa[e];e++)a.elements.push(new g.m.Pa(this.C,f,d));this.Rw(d,a);e=d}this.isCollapsed&&(a.Ly=!0,a.elements.push(new g.m.dr(this.C)));(a.elements.length||a.Cp)&&this.rows.push(a);this.Kb.My= +!!this.U.X;this.Kb.minHeight=this.U.T.length&&this.U.T[this.U.T.length-1].type==g.jb?this.C.ud:this.C.Ef-1;this.Kb.Bt(this.U)?this.Kb.elements.push(new g.m.No(this.C)):this.Kb.elements.push(new g.m.Jo(this.C));this.Kb.My&&(this.Kb.connection=new g.m.nr(this.C,this.U.X),this.Kb.elements.push(this.Kb.connection));this.rows.push(this.Kb);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.cv()&&c.elements.push(new g.m.hk(this.C,this.tp(null,d[0])));for(e=0;ea.Bd&&(a.ga+=g.g.A.ea("V",c.Oc+c.height-a.Bd)))};g.na.Ki=function(a){this.Pj=a;this.Mn=g.g.o.I("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Pj);this.ml=g.g.o.I("path",{"class":"blocklyPath"},this.Pj);this.On=g.g.o.I("path",{"class":"blocklyPathLight"},this.Pj)};g.na.Ki.prototype.Vu=function(a,c){this.ml.setAttribute("d",a);this.Mn.setAttribute("d",a);this.On.setAttribute("d",c)}; +g.na.Ki.prototype.bt=function(){this.ml.setAttribute("transform","scale(-1 1)");this.On.setAttribute("transform","scale(-1 1)");this.Mn.setAttribute("transform","translate(1,1) scale(-1 1)")};g.na.oh=function(a,c){g.na.oh.w.constructor.call(this,a,c);this.Xi&&(this.width+=this.C.sd,this.height+=this.C.sd)};g.g.object.W(g.na.oh,g.m.oh);g.na.wh=function(a,c){g.na.wh.w.constructor.call(this,a,c);this.Xi&&(this.height+=this.C.sd)};g.g.object.W(g.na.wh,g.m.wh);g.na.uh=function(a,c){g.na.uh.w.constructor.call(this,a,c)};g.g.object.W(g.na.uh,g.m.uh);b=g.na.uh.prototype;b.Rw=function(a,c){this.Jt&&a.type==g.Wa?(c.elements.push(new g.na.oh(this.C,a)),c.At=!0):a.type==g.jb?(c.elements.push(new g.na.wh(this.C,a)),c.Ad=!0):a.type==g.Wa?(c.elements.push(new g.m.so(this.C,a)),c.jj=!0):a.type==g.tg&&(c.Cp=!0)}; +b.tp=function(a,c){if(!a)return c&&g.m.u.Vm(c)&&c.ld?this.C.Ef:c&&g.m.u.Uh(c)?this.C.gw:c&&g.m.u.Ym(c)?this.C.TC:this.C.ud;if(!g.m.u.rf(a)&&!c)return g.m.u.Vm(a)&&a.ld?this.C.Ef:g.m.u.Uk(a)?2*this.C.ud+1:g.m.u.rj(a)?this.C.Ff:g.m.u.QF(a)?this.C.ud:g.m.u.Wh(a)?this.C.rC:g.m.u.az(a)?this.C.Ff:this.C.ud;if(g.m.u.rf(a)&&!c){if(g.m.u.Um(a))return this.C.Ff;if(g.m.u.Uh(a))return this.C.ud;if(g.m.u.Ym(a))return this.C.Ff}if(!g.m.u.rf(a)&&c&&g.m.u.rf(c)){if(a.ld){if(g.m.u.Uh(c)||g.m.u.Um(c))return this.C.LC}else{if(g.m.u.Uh(c)|| +g.m.u.Um(c))return this.C.gw;if(g.m.u.Ym(c))return this.C.ud}return this.C.ud-1}if(g.m.u.Uk(a)&&c&&!g.m.u.rf(c))return this.C.ud;if(g.m.u.Uh(a)&&c&&!g.m.u.rf(c))return c.ld?this.C.Ef:this.C.ud;if(g.m.u.Xm(a)&&c){if(g.m.u.rj(c))return this.C.Ff;if(g.m.u.Wk(c))return c.Pe;if(g.m.u.Xh(c))return a=(this.G?1:-1)*this.C.sd/2,c.Pe+a}if(g.m.u.Wh(a)&&c){if(g.m.u.Wk(c))return c.Pe-this.C.zb;if(g.m.u.Xh(c))return a=(this.G?1:-1)*this.C.sd/2,c.Pe-this.C.zb+a}return!g.m.u.rf(a)&&c&&!g.m.u.rf(c)&&a.ld==c.ld||c&& +g.m.u.az(c)?this.C.ud:this.C.Ef};b.Tr=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(g.m.u.sf(e)){d=e;break a}d=null}e=bd(a);if(a.jj||a.Ad)a.ng+=c;var f=ad(a);f?f.align==g.Hq?e.width+=c:f.align==g.xv?(d.width+=c/2,e.width+=c/2):f.align==g.yl&&(d.width+=c):e.width+=c;a.width+=c};b.zy=function(a,c){return g.m.u.Qp(a)&&g.m.u.Jp(c)?this.C.yB:g.m.u.Qp(a)||g.m.u.Jp(c)?this.C.Ff:a.jj&&c.jj?this.C.ud:!a.Ad&&c.Ad?this.C.XA:a.Ad&&c.Ad||!a.Ad&&c.Cp?this.C.ud:this.C.Ef}; +b.sy=function(a,c){if(g.m.u.sf(c))return a.Oc+c.height/2;if(g.m.u.Jp(a))return a=a.Oc+a.height-a.wm,g.m.u.Xh(c)?a+c.height/2:a-c.height/2;if(g.m.u.Qp(a))return g.m.u.rj(c)?a.Hg-c.height/2:a.Hg+c.height/2;var d=a.Oc;g.m.u.Vm(c)||g.m.u.Uk(c)?(d+=c.height/2,(a.At||a.Ad)&&c.height+this.C.Dw<=a.height&&(d+=this.C.Dw)):d=g.m.u.Uh(c)?d+c.height/2:d+a.height/2;return d}; +b.Yx=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Oc=c;e.Ua=this.se;c+=e.height;a=Math.max(a,e.ng);var f=c-this.lc.wk;e==this.Kb&&f=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},ku:function(){10>R?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+Oc+"&level="+(R+1):V.Ep()},Sy:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}var e=a;a=B;if(void 0===c){for(var f=0;d=a.Om[f];f++)d.hh(!1);a.Om.length= +0}if(d=e?w(a,e):null)(c=void 0===c||c)?-1==a.Om.indexOf(d)&&a.Om.push(d):g.g.Qo(a.Om,d),d.hh(c)},fM:function(a,c){a=document.getElementById(a);a.firstChild||(a=g.Th(a,{rtl:-1!=Nc.indexOf(Oc),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),g.R.Qg(g.R.jh(c),a))},oH:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Uf:function(a){if("click"==a.type&&"touchend"==V.Uf.Hu&&V.Uf.Fu+2E3>Date.now()||V.Uf.Hu==a.type&&V.Uf.Fu+400>Date.now())return a.preventDefault(),a.stopPropagation(), +!0;V.Uf.Hu=a.type;V.Uf.Fu=Date.now();return!1}};V.Uf.Hu=null;V.Uf.Fu=0;V.EF=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};V.FF=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=V;V.setCode=V.dA;V.getCode=V.kt;V.getWorkspace=V.Kk;var U={pj:!1,Ix:null,fp:null,pq:function(a,c,d,e,f,h){function k(){U.pj&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);U.pj&&U.me(!1);g.Db()&&g.rc(!0);U.pj=!0;U.Ix=c;U.fp=h;var l=document.getElementById("dialog");h=document.getElementById("dialogShadow");var m=document.getElementById("dialogBorder"),n;for(n in f)l.style[n]=f[n];e&&(h.style.visibility="visible",h.style.opacity=.3,h.style.zIndex=9,e=document.createElement("div"), +e.id="dialogHeader",l.appendChild(e),U.Es=g.hd(e,"mousedown",null,U.rE));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(U.bi(c,!1,.2),U.bi(l,!0,.8),setTimeout(k,175)):k()},Jx:0,Kx:0,rE:function(a){U.Hs();if(!g.g.tj(a)){var c=document.getElementById("dialog");U.Jx=c.offsetLeft-a.clientX;U.Kx=c.offsetTop-a.clientY;U.Gs=g.hd(document,"mouseup",null,U.Hs);U.Fs=g.hd(document,"mousemove",null,U.sE);a.stopPropagation()}},sE:function(a){var c=document.getElementById("dialog"), +d=U.Jx+a.clientX;a=U.Kx+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"},Hs:function(){U.Gs&&(g.Xa(U.Gs),U.Gs=null);U.Fs&&(g.Xa(U.Fs),U.Fs=null)},me:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(U.pj){U.Hs();U.Es&&(g.Xa(U.Es),U.Es=null);U.pj=!1;U.fp&&U.fp();U.fp=null;var d=!1===a? +null:U.Ix;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(U.bi(a,!1,.8),U.bi(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)}},bi:function(a,c,d){function e(){f.style.width=h.width+"px";f.style.height=h.height+"px";f.style.left=h.x+"px";f.style.top= +h.y+"px";f.style.opacity=d}if(a){var f=document.getElementById("dialogBorder"),h=U.SE(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},SE:function(a){var c=g.g.style.wp(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},qA:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eR?S("Games_nextLevel").replace("%1",String(R+1)):S("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +U.me,!0);c.addEventListener("touchend",U.me,!0);c=document.getElementById("doneOk");c.addEventListener("click",V.ku,!0);c.addEventListener("touchend",V.ku,!0);U.pq(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",U.ox,!0)});document.body.addEventListener("keydown",U.ox,!0);document.getElementById("dialogDoneText").textContent=d},Hx:function(a){!U.pj||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(U.me(!0),a.stopPropagation(),a.preventDefault())}, +iH:function(){document.body.addEventListener("keydown",U.Hx,!0)},nH:function(){document.body.removeEventListener("keydown",U.Hx,!0)},ox:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)U.me(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&V.ku()},Pw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)U.me(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&V.Ep()},jy:function(a){27==a.keyCode?U.me(!0):13==a.keyCode&&U.et()},et: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 h=200==f.status?S("Games_submitted"):S("Games_httpRequestError")+"\nStatus: "+f.status;U.qA(null,h)}};f.send(c.join("&"));U.me(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=U;U.hideDialog=U.me;g.Comment=function(a){g.Comment.w.constructor.call(this,a);this.jc=a.Ee;this.jc.text=this.jc.text||"";this.os="";nc(this)};g.g.object.W(g.Comment,g.Ld);b=g.Comment.prototype; +b.Qs=function(a){g.g.o.I("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);g.g.o.I("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);g.g.o.I("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)}; +b.xs=function(){this.Em=g.g.o.I("foreignObject",{x:g.oa.dd,y:g.oa.dd},null);var a=document.createElementNS(g.g.o.Fi,"body");a.setAttribute("xmlns",g.g.o.Fi);a.className="blocklyMinimalBody";var c=this.Sj=document.createElementNS(g.g.o.Fi,"textarea");c.className="blocklyCommentTextarea";c.setAttribute("dir",this.U.G?"RTL":"LTR");c.value=this.jc.text;rd(this);a.appendChild(c);this.Em.appendChild(a);g.la(c,"mouseup",this,this.kH,!0,!0);g.la(c,"wheel",this,function(d){d.stopPropagation()});g.la(c,"change", +this,function(){this.os!=this.jc.text&&g.i.Ma(new g.i.pg(this.U,"comment",null,this.os,this.jc.text))});g.la(c,"input",this,function(){this.jc.text=c.value});setTimeout(c.focus.bind(c),0);return this.Em};b.lh=function(){g.Comment.w.lh.call(this);this.isVisible()&&(sd(this),td(this))};b.rG=function(){this.isVisible()&&(this.jc.size=this.Zb.ht(),rd(this))}; +function rd(a){var c=a.jc.size,d=2*g.oa.dd,e=c.width-d;c=c.height-d;a.Em.setAttribute("width",e);a.Em.setAttribute("height",c);a.Sj.style.width=e-4+"px";a.Sj.style.height=c-4+"px"}b.Vb=function(a){a!=this.isVisible()&&(g.i.Ma(new g.i.xd(this.U,"commentOpen",!a,a)),(this.jc.Du=a)?td(this):sd(this))}; +function td(a){if(!a.U.ld()||g.g.userAgent.vg)g.Jf.prototype.wx.call(a);else{a.Zb=new g.oa(a.U.v,a.xs(),a.U.$d,a.Qk,a.jc.size.width,a.jc.size.height);mb(a.Zb,a.U.id);var c=a.rG.bind(a);a.Zb.Mu=c;a.Ue()}}function sd(a){a.Fj?g.Jf.prototype.Mx.call(a):(a.Zb.J(),a.Zb=null,a.Sj=null,a.Em=null)}b.kH=function(){nb(this.Zb)&&this.Sj.focus();this.os=this.jc.text};b.ht=function(){return this.jc.size};b.zn=function(a,c){this.Zb?this.Zb.zn(a,c):(this.jc.size.width=a,this.jc.size.height=c)}; +b.Sb=function(){return this.jc.text||""};b.ll=function(a){this.jc.text!=a&&(this.jc.text=a,uc(this))};function uc(a){a.Sj?a.Sj.value=a.jc.text:a.Fj&&(a.Fj.firstChild.textContent=a.jc.text)}b.J=function(){this.U.Bk=null;g.Ld.prototype.J.call(this)};g.Da={};g.Da.rd=function(a,c){g.yc.call(this);this.Uc=c;this.gf=a;this.Cm=this.nq=!1;this.Mt=!0;this.Cs=-1};g.g.object.W(g.Da.rd,g.yc);g.Da.rd.Ur={};b=g.Da.rd.prototype;b.ym=function(){g.Da.rd.w.ym.call(this);this.Da&&(this.Da=null);this.hb=null}; +b.Fp=function(){var a=this.ta();if(a){var c=ud(this);c&&!c.id&&(c.id=this.ua()+".label");g.g.V.hg(a,g.g.V.Li.YC);g.g.V.Ib(a,g.g.V.State.Sl,!1);g.g.V.Ib(a,g.g.V.State.aC,this.Ik());c&&g.g.V.Ib(a,g.g.V.State.dw,c.id);(c=this.mt())&&g.g.V.hg(c,g.g.V.Li.BC);if(c=vd(this))if(g.g.V.hg(c,g.g.V.Li.LB),c.hasChildNodes())for(g.g.V.Ib(a,g.g.V.State.Xq,!1),a=this.kb.length,c=1;c<=a;c++){var d=(this.kb[c-1]||null).ta();g.g.V.Ib(d,g.g.V.State.JC,a);g.g.V.Ib(d,g.g.V.State.AC,c)}}}; +b.Ia=function(){var a=document.createElement("div");a.appendChild(wd(this));this.hb=a};b.lf=function(){g.Da.rd.w.lf.call(this);g.Da.rd.Ur[this.ua()]=this;this.Fp()};b.Jh=function(){g.Da.rd.w.Jh.call(this);delete g.Da.rd.Ur[this.ua()]}; +b.cm=function(a,c){var d=this.kb[c-1]||null,e=this.kb[c]||null;g.Da.rd.w.cm.call(this,a,c);a.fl=d;a.lu=e;d?d.lu=a:this.$x=a;e&&(e.fl=a);(c=this.Le())&&xd(a,c);yd(a,this.Ik()+1);if(c=this.ta())if(this.yq(),g.g.V.Ib(c,g.g.V.State.Xq,this.Je()),this.Je()){c=vd(this);a.ta()||a.Ia();var f=a.ta(),h=e&&e.ta();c.insertBefore(f,h);this.$c&&a.lf();e||(d?d.yq():(g.g.style.Uu(c,!0),this.Kj(this.Je())))}};b.add=function(a){if(a.getParent())throw Error(g.yc.Error.wr);this.cm(a,this.kb.length)};b.Le=function(){return null}; +b.Ik=function(){var a=this.Cs;0>a&&(a=(a=this.getParent())?a.Ik()+1:0,yd(this,a));return a};function yd(a,c){if(c!=a.Cs){a.Cs=c;var d=zd(a);if(d){var e=Ad(a)+"px";a.Xk()?d.style.paddingRight=e:d.style.paddingLeft=e}za(a,function(f){yd(f,c+1)})}}b.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};b.Kh=function(){var a=[];za(this,function(c){a.push(c)});return a};b.select=function(){var a=this.Le();a&&Kc(a,this)}; +function Bd(a,c){if(a.nq!=c){a.nq=c;Cd(a);var d=a.ta();d&&(g.g.V.Ib(d,g.g.V.State.Sl,c),c&&(c=a.Le().ta(),g.g.V.Ib(c,g.g.V.State.wv,a.ua())))}}b.Je=function(){return this.Cm}; +b.Kj=function(a){var c=a!=this.Cm,d;this.Cm=a;var e=this.Le(),f=this.ta();if(Ba(this)){if(!a&&e&&this.contains(e.Yd)&&this.select(),f){if(d=vd(this))g.g.style.Uu(d,a),g.g.V.Ib(f,g.g.V.State.Xq,a),a&&this.$c&&!d.hasChildNodes()&&(za(this,function(h){d.appendChild(wd(h))}),za(this,function(h){h.lf()}));this.yq()}}else(d=vd(this))&&g.g.style.Uu(d,!1);f&&(this.mt().className=this.sp());c&&(a?this.Px():this.Ox())};b.Px=function(){};b.Ox=function(){};b.toggle=function(){this.Kj(!this.Je())}; +function wd(a){var c=a.Je()&&Ba(a),d=document.createElement("div");d.style.backgroundPosition=Dd(a);c||(d.style.display="none");c&&za(a,function(e){d.appendChild(wd(e))});c=document.createElement("div");c.id=a.ua();c.appendChild(Ed(a));c.appendChild(d);return c}function Ad(a){return Math.max(0,(a.Ik()-1)*a.Uc.Vy)}function Ed(a){var c=document.createElement("div");c.className=a.xp();c.style["padding-"+(a.Xk()?"right":"left")]=Ad(a)+"px";c.appendChild(Fd(a));c.appendChild(Gd(a));return c} +b.xp=function(){var a="";this.nq&&(a=" "+(this.Uc.lE||""));return this.Uc.Bx+a};function Gd(a){var c=document.createElement("span");c.className=a.Uc.jE||"";c.textContent=a.Sb();return c}function Fd(a){var c=document.createElement("span");c.style.display="inline-block";c.className=a.sp();return c}b.sp=function(){throw Error("unimplemented abstract method");};function Dd(a){return(a.lu?(a.Ik()-1)*a.Uc.Vy:"-100")+"px 0"} +b.ta=function(){var a=g.Da.rd.w.ta.call(this);a||(this.hb=a=document.getElementById(this.ua()));return a};function zd(a){return(a=a.ta())?a.firstChild:null}b.mt=function(){var a=zd(this);return a?a.firstChild:null};function ud(a){return(a=zd(a))&&a.lastChild?a.lastChild.previousSibling:null}function vd(a){return(a=a.ta())?a.lastChild:null}b.ll=function(a){this.gf=a};b.Sb=function(){return this.gf};function Cd(a){var c=zd(a);c&&(c.className=a.xp())} +b.yq=function(){var a=vd(this);a&&(a.style.backgroundPosition=Dd(this))};b.Fz=function(a){"expand"==a.target.getAttribute("type")&&Ba(this)?this.Mt&&this.toggle():(this.select(),Cd(this))};b.Cz=function(a){a.preventDefault()};b.uu=function(a){var c=!0;switch(a.keyCode){case g.g.Ba.Io:if(a.altKey)break;c=Hd(this);break;case g.g.Ba.Ao:if(a.altKey)break;c=Id(this);break;case g.g.Ba.El:c=Jd(this);break;case g.g.Ba.Yl:c=Kd(this);break;default:c=!1}c&&a.preventDefault();return c}; +function Jd(a){a:if(Ba(a)&&a.Je())a=a.kb[0]||null;else{for(var c=a,d;c!=a.Le();){d=c.lu;if(null!=d){a=d;break a}c=c.getParent()}a=null}a&&a.select();return!0}function Kd(a){var c=a.fl;if(null!=c)a=Ld(c);else{c=a.getParent();var d=a.Le();a=c==d||a==d?null:c}a&&a.select();return!0}function Id(a){if(Ba(a)&&a.Je()&&a.Mt)a.Kj(!1);else{var c=a.getParent();a=a.Le();c&&c!=a&&c.select()}return!0}function Hd(a){return Ba(a)?(a.Je()?(a.kb[0]||null).select():a.Kj(!0),!0):!1} +function Ld(a){return a.Je()&&Ba(a)?Ld(a.kb[a.kb.length-1]||null):a}function xd(a,c){a.Da!=c&&(a.Da=c,za(a,function(d){xd(d,c)}))};g.Da.yh=function(a,c,d){this.ra=a;g.Da.rd.call(this,c,d)};g.g.object.W(g.Da.yh,g.Da.rd);b=g.Da.yh.prototype;b.Le=function(){if(this.Da)return this.Da;var a=this.getParent();return a&&(a=a.Le())?(xd(this,a),a):null};b.sp=function(){var a=this.Je(),c=this.IE;if(a&&c)return c;c=this.DF;if(!a&&c)return c;c=this.Uc;if(Ba(this)){if(a&&c.zx)return c.bp+" "+c.zx;if(!a&&c.gE)return c.bp+" "+c.gE}else if(c.Ax)return c.bp+" "+c.Ax;return""}; +b.Cz=function(){Ba(this)&&this.Mt?(this.toggle(),this.select()):this.nq?Kc(this.Le(),null):this.select();Cd(this)};b.Fz=function(){};b.uu=function(a){if(this.Da.ra.qf){var c={},d=g.g.Ba.El,e=g.g.Ba.Yl;c[g.g.Ba.Io]=this.Xk()?e:d;c[g.g.Ba.Ao]=this.Xk()?d:e;c[g.g.Ba.Yl]=g.g.Ba.Ao;c[g.g.Ba.El]=g.g.Ba.Io;Object.defineProperties(a,{keyCode:{value:c[a.keyCode]||a.keyCode}})}return g.Da.yh.w.uu.call(this,a)};b.Zz=function(){this.Jz&&this.Jz.call(this.ra)};b.Px=g.Da.yh.prototype.Zz;b.Ox=g.Da.yh.prototype.Zz;g.Da.Ri=function(a,c){this.ra=a;g.Da.rd.call(this,"",c);this.Cm=!0;Bd(this,!0);this.Yd=this};g.g.object.W(g.Da.Ri,g.Da.rd);b=g.Da.Ri.prototype;b.Le=function(){return this};b.Ik=function(){return 0};b.oF=function(){this.gy=!0;var a=this.ta();g.g.o.mb(a,"focused");this.Yd&&this.Yd.select()};b.lF=function(){this.gy=!1;var a=this.ta();g.g.o.Tb(a,"focused")};b.hasFocus=function(){return this.gy};b.Je=function(){return!0};b.Kj=function(a){this.Cm=a}; +b.mt=function(){var a=zd(this);return a?a.firstChild:null};b.yq=function(){};b.xp=function(){return g.Da.Ri.w.xp.call(this)+" "+this.Uc.iE};b.sp=function(){var a=this.Je(),c=this.IE;if(a&&c)return c;c=this.DF;if(!a&&c)return c;c=this.Uc;return a&&c.hE?c.bp+" "+c.hE:""};function Kc(a,c){if(c!=a.Yd&&(!a.Az||a.Az.call(a.ra,c))){var d=a.Yd;a.Yd&&Bd(a.Yd,!1);(a.Yd=c)&&Bd(c,!0);a.zz&&a.zz.call(a.ra,d,c)}} +b.Fp=function(){g.Da.Ri.w.Fp.call(this);var a=this.ta();g.g.V.hg(a,g.g.V.Li.XC);g.g.V.Ib(a,g.g.V.State.dw,ud(this).id)};b.lf=function(){g.Da.Ri.w.lf.call(this);var a=this.ta();a.className=this.Uc.kE;a.setAttribute("hideFocus","true");this.Zr();this.Fp()};b.Jh=function(){g.Da.Ri.w.Jh.call(this);this.Ds()};b.Zr=function(){var a=this.ta();a.tabIndex=0;this.uG=g.hd(a,"focus",this,this.oF);this.qG=g.hd(a,"blur",this,this.lF);this.sG=g.la(a,"click",this,this.sF);this.yG=g.hd(a,"keydown",this,this.pF)}; +b.Ds=function(){g.Xa(this.uG);g.Xa(this.qG);g.Xa(this.sG);g.Xa(this.yG)};b.sF=function(a){var c;a:{for(var d=a.target;null!=d;){if(c=g.Da.rd.Ur[d.id])break a;if(d==this.ta())break;d=d.parentNode}c=null}if(c)switch(a.type){case "mousedown":c.Fz(a);break;case "click":c.Cz(a)}};b.pF=function(a){var c=!1;if(c=this.Yd&&this.Yd.uu(a)||c)g.g.style.Ru(this.Yd.ta(),this.ta().parentNode),a.preventDefault();return c};b.createNode=function(a){return new g.Da.yh(this.ra,a||"",this.Uc)};g.Qi=function(a){this.s=a;this.G=a.options.G;this.qf=a.options.Td;this.Fa=a.options.Fa;this.Uc={Vy:19,kE:"blocklyTreeRoot",iE:"blocklyHidden",Bx:"blocklyTreeRow",jE:"blocklyTreeLabel",bp:"blocklyTreeIcon",zx:"blocklyTreeIconOpen",Ax:"blocklyTreeIconNone",lE:"blocklyTreeSelected"};this.xA={Bx:"blocklyTreeSeparator"};this.qf&&(this.Uc.cssTreeRow+=a.G?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.xA.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.G?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"), +this.Uc.cssTreeIcon="")};b=g.Qi.prototype;b.width=0;b.height=0;b.Zk=null; +b.S=function(){var a=this.s,c=u(this.s);this.zc=document.createElement("div");this.zc.className="blocklyToolboxDiv blocklyNonSelectable";this.zc.setAttribute("dir",a.G?"RTL":"LTR");c.parentNode.insertBefore(this.zc,c);c=a.Wb;c.subscribe(this.zc,"toolbox","background-color");c.subscribe(this.zc,"toolboxText","color");g.la(this.zc,"mousedown",this,function(d){g.g.tj(d)||d.target==this.zc?g.rc(!1):g.rc(!0);g.Touch.Dh()},!1,!0);c={Pg:a.options.Pg,Ob:a,G:a.G,Re:a.options.Re,Td:a.Td,Fa:a.options.Fa,dh:a.options.dh}; +this.P=null;if(a.Td){if(!g.Jl)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new g.Jl(c)}else{if(!g.Fg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new g.Fg(c)}g.g.o.nj(this.P.Ia("svg"),u(this.s));this.P.S(a);this.Uc.cleardotPath=a.options.uf+"1x1.gif";this.Uc.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.G?"Rtl":"Ltr");Md(this,a.options.Yk)}; +function Md(a,c){a.Fd&&(a.Fd.J(),a.Zk=null);var d=new g.Da.Ri(a,a.Uc);a.Fd=d;Kc(d,null);d.Az=a.kF;d.zz=a.jF;var e=null;if(c){a.Fd.Lf=[];a.zt=!1;e=Nd(a,c,a.Fd,a.s.options.uf);if(a.Fd.Lf.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");Ia(a.s)}d.za(a.zc);e&&Kc(d,e);Od(a);a.position();a.qf&&g.g.V.Ib(a.Fd.ta(),g.g.V.State.xC,"horizontal")} +b.kF=function(a){if(a==this.Fd)return!1;this.Zk&&(zd(this.Zk).style.backgroundColor="");if(a){var c=a.Mk||"#57e";zd(a).style.backgroundColor=c;Od(this,a)}return!0};b.jF=function(a,c){c&&c.Lf&&c.Lf.length?(this.P.show(c.Lf),this.Zk!=c&&this.P.uc.set(0),g.Oe&&g.navigation.Ib(g.navigation.Ir)):(this.P.Ca(),!g.Oe||c instanceof g.Qi.Or||g.navigation.Ib(g.navigation.Ul));a!=c&&a!=this&&(a=new g.i.xd(null,"category",a&&a.Sb(),c&&c.Sb()),a.xc=this.s.id,g.i.Ma(a));c&&(this.Zk=c)};b.vF=function(){g.ol(this.s)}; +b.ei=function(a){var c=this.Fd.Yd;if(!c)return!1;switch(a.name){case g.navigation.ab.Be:return Kd(c);case g.navigation.ab.Go:return Id(c);case g.navigation.ab.ze:return Jd(c);case g.navigation.ab.vo:return Hd(c);default:return!1}};b.J=function(){this.P.J();this.Fd.J();this.s.Wb.unsubscribe(this.zc);g.g.o.removeNode(this.zc);this.Zk=this.s=null};b.Xf=function(){return this.width};b.ty=function(){return this.height}; +b.position=function(){var a=this.zc;if(a){var c=u(this.s);c=g.rA(c);this.qf?(a.style.left="0",a.style.height="auto",a.style.width=c.width+"px",this.height=a.offsetHeight,this.Fa==g.Dg?a.style.top="0":a.style.bottom="0"):(this.Fa==g.Cg?a.style.right="0":a.style.left="0",a.style.height=c.height+"px",this.width=a.offsetWidth);this.P.position()}}; +function Nd(a,c,d,e){for(var f=null,h=null,k=0,l;l=c.childNodes[k];k++)if(l.tagName)switch(l.tagName.toUpperCase()){case "CATEGORY":var m=g.g.Xd(l.getAttribute("name"));h=a.Fd.createNode(m);h.Jz=a.vF;h.Lf=[];d.add(h);var n=l.getAttribute("custom");n?h.Lf=n:(n=Nd(a,l,h,e))&&(f=n);var r=l.getAttribute("categorystyle");if((n=l.getAttribute("colour"))&&r)h.Mk="",console.warn('Toolbox category "'+m+'" can not have both a style and a colour');else if(r){n=a;var t=h;t.GM=r;var v=n.s.zp();r&&v&&((v=v.ID[r])&& +v.Mb?Pd(n,v.Mb,t,m):console.warn('Style "'+r+'" must exist and contain a colour value'))}else Pd(a,n,h,m);"true"==l.getAttribute("expanded")?(h.Lf.length&&(f=h),h.Kj(!0)):h.Kj(!1);h=l;break;case "SEP":if(h&&"CATEGORY"==h.tagName.toUpperCase()){d.add(new g.Qi.Or(a.xA));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":d.Lf.push(l),h=l}return f} +function Pd(a,c,d,e){c=g.g.Xd(c);if(null===c||""===c)d.Mk="";else{var f=Number(c);isNaN(f)?(f=g.g.Mb.parse(c))?(d.Mk=f,a.zt=!0):(d.Mk="",console.warn('Toolbox category "'+e+'" has unrecognized colour attribute: '+c)):(d.Mk=g.Uy(f),a.zt=!0)}}function Od(a,c){c=(c||a.Fd).Kh(!1);for(var d=0,e;e=c[d];d++){var f=zd(e);if(f){var h=a.zt?"8px solid "+(e.Mk||"#ddd"):"none";a.s.G?f.style.borderRight=h:f.style.borderLeft=h}Od(a,e)}} +b.Hm=function(){if(!this.zc)return null;var a=this.zc.getBoundingClientRect(),c=a.top,d=c+a.height,e=a.left;a=e+a.width;return this.Fa==g.Dg?new g.g.Rect(-1E7,d,-1E7,1E7):this.Fa==g.Oi?new g.g.Rect(c,1E7,-1E7,1E7):this.Fa==g.Nd?new g.g.Rect(-1E7,1E7,-1E7,a):new g.g.Rect(-1E7,1E7,e,1E7)};g.Qi.Or=function(a){g.Da.yh.call(this,null,"",a)};g.g.object.W(g.Qi.Or,g.Da.yh); +g.ed.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", +"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);g.Nr=function(a){this.s=a;this.Zi=[];if(!(0>=this.s.options.Up)){a={scrollbars:!0,Pg:this.s.options.Pg,Ob:this.s,G:this.s.G,Re:this.s.options.Re,dh:this.s.options.dh};if(this.s.Td){a.Fa=this.s.Fa==g.Dg?g.Oi:g.Dg;if(!g.Jl)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new g.Jl(a)}else{a.Fa=this.s.Fa==g.Cg?g.Nd:g.Cg;if(!g.Fg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new g.Fg(a)}ib(this.s,this.tG.bind(this))}};b=g.Nr.prototype;b.Si=47;b.bo=44;b.kk=16;b.ir=20; +b.Ml=20;b.Bo=10;b.Gr=0;b.Hr=32;b.MB=.1;b.Kt=!1;b.Vp=0;b.H=null;b.uq=null;b.St=0;b.$h=0;b.Zm=0;b.vl=0; +b.Ia=function(){this.H=g.g.o.I("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=g.g.o.I("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.H);g.g.o.I("rect",{width:this.Si,height:this.bo,y:this.kk},c);var d=g.g.o.I("image",{width:g.wd.width,x:-this.Gr,height:g.wd.height,y:-this.Hr,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.H);d.setAttributeNS(g.g.o.Kf,"xlink:href",this.s.options.uf+g.wd.url);c=g.g.o.I("clipPath",{id:"blocklyTrashLidClipPath"+a},this.H); +g.g.o.I("rect",{width:this.Si,height:this.kk},c);this.uq=g.g.o.I("image",{width:g.wd.width,x:-this.Gr,height:g.wd.height,y:-this.Hr,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.H);this.uq.setAttributeNS(g.g.o.Kf,"xlink:href",this.s.options.uf+g.wd.url);g.la(this.H,"mouseup",this,this.click);g.hd(d,"mouseover",this,this.dG);g.hd(d,"mouseout",this,this.bG);this.Vr();return this.H}; +b.S=function(a){0this.Vp&&1>this.$h&&(this.St=setTimeout(this.Vr.bind(this),20))};function Qd(a,c){var d=a.s.Fa==g.Cg||a.s.Td&&a.s.G;a.uq.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.Si-4)+","+(a.kk-2)+")")}b.close=function(){Xa(this,!1)}; +b.click=function(){if(this.Zi.length){for(var a=[],c=0,d;d=this.Zi[c];c++)a[c]=g.R.jh(d);this.P.show(a)}};b.dG=function(){this.Zi.length&&Xa(this,!0)};b.bG=function(){Xa(this,!1)}; +b.tG=function(a){if(!(0>=this.s.options.Up)&&a.type==g.i.ao&&"shadow"!=a.qu.tagName.toLowerCase()){for(var c=a=a.qu.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=g.R.Rd(a);if(-1==this.Zi.indexOf(a)){for(this.Zi.unshift(a);this.Zi.length>this.s.options.Up;)this.Zi.pop();this.Vp=this.MB;Qd(this,45*this.Vp)}}};g.Di=function(){g.Di.w.constructor.call(this)};g.g.object.W(g.Di,g.po);g.Di.prototype.next=function(){var a=this.Rb;if(!a)return null;(a=a.next())&&I(this,a);return a};g.Di.prototype.Pm=function(){return null};g.Di.prototype.cg=function(){var a=this.Rb;if(!a)return null;(a=a.cg())&&I(this,a);return a};g.Di.prototype.nn=function(){return null};g.Hl=function(a){a.hc=this.Km.bind(this);a.pi=this.gA.bind(this);this.s=new g.lb(a);this.s.oe=!0;this.s.Su(new g.Di);this.s.fA(new g.ph);this.G=!!a.G;this.tl=a.Fa;this.$s=[];this.Tp=[];this.gm=[];this.Dd=[];this.Cu=[];this.ql=this.s.eh.C.xh};b=g.Hl.prototype;b.xk=!0;b.Zh=!1;b.Yi=!0;b.zb=8;b.Xe=g.Hl.prototype.zb;b.JB=3*g.Hl.prototype.Xe;b.KB=3*g.Hl.prototype.Xe;b.Er=2;b.tb=0;b.Yc=0;b.DE=70; +b.Ia=function(a){this.H=g.g.o.I(a,{"class":"blocklyFlyout",style:"display: none"},null);this.Mc=g.g.o.I("path",{"class":"blocklyFlyoutBackground"},this.H);this.H.appendChild(this.s.Ia());this.s.Wb.subscribe(this.Mc,"flyout","fill");this.s.Wb.subscribe(this.Mc,"flyoutOpacity","fill-opacity");return this.H}; +b.S=function(a){this.qb=a;this.s.Qj=a;this.uc=new g.La(this.s,this.qf,!1,"blocklyFlyoutScrollbar");this.Ca();Array.prototype.push.apply(this.$s,g.la(this.H,"wheel",this,this.IH));this.xk||(this.np=this.at.bind(this),ib(this.qb,this.np));Array.prototype.push.apply(this.$s,g.la(this.Mc,"mousedown",this,this.gi));this.s.Tg=this.qb.Tg.bind(this.qb);this.s.Ta=this.qb.Ta;a=this.s;a.ki=new g.Pr(a)}; +b.J=function(){this.Ca();g.Xa(this.$s);this.np&&(jb(this.qb,this.np),this.np=null);this.uc&&(this.uc.J(),this.uc=null);this.s&&(this.s.Wb.unsubscribe(this.Mc),this.s.Qj=null,this.s.J(),this.s=null);this.H&&(g.g.o.removeNode(this.H),this.H=null);this.qb=this.Mc=null};b.Xf=function(){return this.tb};b.ty=function(){return this.Yc};b.Kk=function(){return this.s};b.isVisible=function(){return this.Zh};b.Vb=function(a){var c=a!=this.isVisible();this.Zh=a;c&&this.Tn()}; +b.Ij=function(a){var c=a!=this.Yi;this.Yi=a;c&&this.Tn()};b.Tn=function(){var a=this.Yi?this.isVisible():!1;this.H.style.display=a?"block":"none";this.uc.Ij(a)};b.Ca=function(){if(this.isVisible()){this.Vb(!1);for(var a=0,c;c=this.Dd[a];a++)g.Xa(c);this.Dd.length=0;this.li&&(jb(this.s,this.li),this.li=null)}}; +b.show=function(a){this.s.Lc(!1);this.Ca();Rd(this);if("string"==typeof a){a=this.s.Qj.hv[a]||null;if("function"!=typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=a(this.s.Qj);if(!Array.isArray(a))throw TypeError("Result of toolbox category callback must be an array.");}this.Vb(!0);var c=[],d=[];this.Cu.length=0;for(var e=this.qf?this.JB:this.KB,f=0,h;h=a[f];f++)if(h.tagName)switch(h.tagName.toUpperCase()){case "BLOCK":var k=g.R.fj(h,this.s);k.isEnabled()|| +this.Cu.push(k);c.push({type:"block",block:k});h=parseInt(h.getAttribute("gap"),10);d.push(isNaN(h)?e:h);break;case "SEP":h=parseInt(h.getAttribute("gap"),10);!isNaN(h)&&0Math.abs(a-c)&&(c+=this.pM*this.qb.options.Ob.scale));return new g.g.Rect(-1E9,1E9,c,1E9)};function Ud(a,c,d,e){var f=X;this.name=a;this.VD=c;this.nA=d;this.hH=e||0;this.Ah=f;this.Na=new g.g.N;this.reset();console.log(this+" loaded.")}b=Ud.prototype;b.mH=!1;b.jf=!1;b.kd=0;b.Og=0;b.facing=0;b.speed=0;b.Sf=0;b.Na=null;b.Nt=0;b.toString=function(){return"["+this.name+"]"}; +b.reset=function(){delete this.mH;delete this.jf;delete this.speed;delete this.Sf;delete this.Nt;this.kd=this.hH;this.Na.x=this.nA.x;this.Na.y=this.nA.y;this.facing=this.Og=$c(g.g.Ja.rl(Math.atan2(50-this.Na.y,50-this.Na.x)));var a=this.VD;if("function"==typeof a)a=a();else if("string"!=typeof a)throw Error("Avatar "+this.name+" has invalid code: "+a);this.LF="Interpreter"in window?new Interpreter(a,this.Ah.HF):null};function Vd(a,c){a.kd+=c;100<=a.kd&&Wd(a)} +function Wd(a){a.speed=0;a.jf=!0;a.kd=100;a.Ah.Ho.unshift(a);a.Ah.We.push({type:"DIE",avatar:a});console.log(a+" sinks.")}b.stop=function(){this.Sf=0};var X={Hd:[],Ho:[],We:[],lk:[],IB:50,RC:100,EC:.5,hf:null,VA:1,hw:3,rv:5,iB:5,Nq:3,Mz:0,mp:0,tA:0,WC:3E5,Os:null};X.QC=[new g.g.N(10,90),new g.g.N(90,10),new g.g.N(10,10),new g.g.N(90,90),new g.g.N(50,99),new g.g.N(50,1),new g.g.N(1,50),new g.g.N(99,50),new g.g.N(50,49)];X.reset=function(){clearTimeout(X.Mz);X.We.length=0;X.lk.length=0;X.Ho.length=0;for(var a=X.tA=0,c;c=X.Hd[a];a++)c.reset()};X.pD=function(a,c,d,e){d||(d=X.QC[X.Hd.length]);a=new Ud(a,c,d,e);X.Hd.push(a)}; +X.start=function(a){X.Os=a;X.mp=Date.now()+X.WC;console.log("Starting battle with "+X.Hd.length+" avatars.");X.update()};X.update=function(){X.CH();X.DH();X.BH();X.Hd.length<=X.Ho.length+1&&(X.mp=Math.min(X.mp,Date.now()+1E3));Date.now()>X.mp?X.stop():X.Mz=setTimeout(X.update,1E3/X.IB)};X.stop=function(){for(var a=[],c=0,d;d=X.Hd[c];c++)d.jf||a.push(d);c=a.length;for(a.sort(function(e,f){return e.kd-f.kd});a.length;)X.Ho.unshift(a.pop());X.Os&&X.Os(c)}; +X.DH=function(){for(var a=X.lk.length-1;0<=a;a--){var c=X.lk[a];c.progress+=X.hw;var d=0;if(c.eq-c.progressc.Sf&&(c.speed=Math.max(c.speed-X.rv,c.Sf)),0c.Na.x||100c.Na.y||100d&&(c.Na.x-=k,c.Na.y-=h,e=Math.max(c.speed,f.speed)/100*X.Nq,Vd(c,e),c.speed=0,c.Sf=0,Vd(f,e),f.speed=0,f.Sf=0,X.We.push({type:"CRASH",avatar:c,damage:e}),X.We.push({type:"CRASH",avatar:f,damage:e})))}};X.CH=function(){for(var a=0;ah&&(h+=360);k=e.Na.x;for(var l=e.Na.y,m=Infinity,n=0,r;r=e.Ah.Hd[n];n++)if(r!=e&&!r.jf){var t=r.Na.x,v=r.Na.y;r=Math.sqrt((v-l)*(v-l)+(t-k)*(t-k));r>=m||(t=Math.atan2(v-l,t-k),t=$c(g.g.Ja.rl(t)),tk?e=!1:(f.Nt=k,k=new g.g.N(f.Na.x,f.Na.y),e=$c(e),f.facing=e,h=g.g.Ja.Mf(h,0,70),e={wD:f,Hn:k,Og:e,eq:h,Bm:new g.g.N(k.x+h*Math.cos(g.g.Ja.pd(e)),k.y+h*Math.sin(g.g.Ja.pd(e))),progress:0},f.Ah.lk.push(e),f.Ah.We.push({type:"BANG",avatar:f,degree:e.Og}),e=!0);return e};a.setProperty(c,"cannon", +a.createNativeFunction(d));d=function(e,f){var h=X.hf;f=void 0===f||null===f?50:f;if("number"!=typeof e||isNaN(e)||"number"!=typeof f||isNaN(f))throw TypeError;h.Og!=$c(e)&&(50>=h.speed?(h.Og=$c(e),h.facing=h.Og):f=0);0==h.speed&&0a.length)){e=[];for(f=0;fthis.yn)return null;var a=this.getOptions(!0)[this.yn][0];return"object"==typeof a?a.alt:a}; +g.Ka.zA=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;dthis.gn&&g.g.V.Ib(a,g.g.V.State.aD,this.gn);return a};g.Wc.register("field_number",g.Jd);g.Kd=function(a,c,d,e,f){this.xj=g.Kd.FE;this.oE=a||"";this.cc=new g.g.$e(0,g.wa.lr);f&&this.Od(f);c&&(this.Vj=c);f||Be(this,d,e)};g.g.object.W(g.Kd,g.Ka);g.Kd.va=function(a){var c=g.g.Xd(a.variable);return new g.Kd(c,void 0,void 0,void 0,a)};b=g.Kd.prototype;b.s=null;b.Ni=!0;b.Od=function(a){g.Kd.w.Od.call(this,a);Be(this,a.variableTypes,a.defaultType)};b.mj=function(){if(!this.ae){var a=g.O.vp(this.B.v,null,this.oE,this.nE);g.i.disable();this.setValue(a.ua());g.i.enable()}}; +b.Fm=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=g.O.vp(this.B.v,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.ua()+"' had type "+c.type+", and does not match variable field that references it: "+g.R.Rd(a)+".");this.setValue(c.ua())};b.uA=function(a){this.mj();a.id=this.ae.ua();a.textContent=this.ae.name;this.ae.type&&a.setAttribute("variabletype",this.ae.type);return a}; +b.Yu=function(a){if(a.bb)throw Error("Variable fields are not allowed to exist on shadow blocks.");g.Kd.w.Yu.call(this,a)};b.getValue=function(){return this.ae?this.ae.ua():null};b.Sb=function(){return this.ae?this.ae.name:""};b.Xc=function(){return this.ae};b.Dy=function(){return this.ae?this.Vj:null}; +b.Hh=function(a){if(null===a)return null;var c=g.O.Xc(this.B.v,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=Ce(this)){for(var e=0;ed;d+=15)g.g.o.I("line",{x1:g.ka.nc+g.ka.zg,y1:g.ka.nc,x2:g.ka.nc+g.ka.zg-(0==d% +45?10:5),y2:g.ka.nc,"class":"blocklyAngleMarks",transform:"rotate("+d+","+g.ka.nc+","+g.ka.nc+")"},a);this.UD=g.la(a,"click",this,this.AF);this.TD=g.la(c,"click",this,this.Iz,!0,!0);this.gG=g.la(c,"mousemove",this,this.Iz,!0,!0);return a};b.Ys=function(){g.Xa(this.UD);g.Xa(this.TD);g.Xa(this.gG)};b.AF=function(){g.D.Nk(this);g.aa.Ca()}; +b.Iz=function(a){var c=this.ft.ownerSVGElement.getBoundingClientRect(),d=a.clientX-c.left-g.ka.nc;a=a.clientY-c.top-g.ka.nc;c=Math.atan(-a/d);isNaN(c)||(c=g.g.Ja.rl(c),0>d?c+=180:0c&&(c+=360);c>a.HA&&(c-=360);return c}g.ed.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(",")); +g.Wc.register("field_angle",g.ka);g.Generator=function(a){this.kG=a;this.GB=new RegExp(this.xe,"g")};g.Generator.ub="generated_function";b=g.Generator.prototype;b.wo=null;b.Md=null;b.Tc=null;b.td=" ";b.jB=60;b.Fo=[]; +function qd(){var a=g.j,c=B;c||(console.warn("No workspace specified in workspaceToCode call. Guessing."),c=g.Db());var d=[];a.S(c);c=D(c,!0);for(var e=0,f;f=c[e];e++){var h=Ge(a,f);Array.isArray(h)&&(h=h[0]);h&&(f.M&&(h=a.bA(h),a.Md&&!f.si&&(h=Y(a.Md,f)+h),a.Tc&&!f.si&&(h+=Y(a.Tc,f))),d.push(h))}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 He(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)} +function Ge(a,c){if(!c)return"";if(!c.isEnabled())return Ge(a,q(c));var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.kG+'" 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.mq(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.Md&&!c.si&&(d=Y(a.Md,c)+d),a.Tc&&!c.si&&(d+=Y(a.Tc,c)),a.mq(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+ +d);} +function Z(a,c,d){var e=g.j;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=Tb(a,c);if(!f)return"";c=Ge(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 h=Math.floor(d),k=Math.floor(c);if(h<=k&&(h!=k||0!=h&&99!=h))for(f=!0,h=0;hd?Z(a,c,g.j.pk)||h:e?Z(a,c,g.j.Rl)||h:Z(a,c,f)||h;if(g.Yh(a))a=Number(a)+d,e&&(a=-a);else{if(0d&&(a=a+" - "+-d,k=g.j.pk);e&&(a=d?"-("+a+")":"-"+a,k=g.j.Rl);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};g.j.Ja={};g.j.math_number=function(a){a=Number(F(a,"NUM"));return[a,0<=a?g.j.Ii:g.j.Rl]};g.j.math_arithmetic=function(a){var c={ADD:[" + ",g.j.sh],MINUS:[" - ",g.j.pk],MULTIPLY:[" * ",g.j.rr],DIVIDE:[" / ",g.j.Ol],POWER:[null,g.j.Qc]}[F(a,"OP")],d=c[0];c=c[1];var e=Z(a,"A",c)||"0";a=Z(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",g.j.gb]}; +g.j.math_single=function(a){var c=F(a,"OP");if("NEG"==c)return a=Z(a,"NUM",g.j.Rl)||"0","-"==a[0]&&(a=" "+a),["-"+a,g.j.Rl];a="SIN"==c||"COS"==c||"TAN"==c?Z(a,"NUM",g.j.Ol)||"0":Z(a,"NUM",g.j.Rc)||"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,g.j.gb];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,g.j.Ol]}; +g.j.math_constant=function(a){return{PI:["Math.PI",g.j.Qb],E:["Math.E",g.j.Qb],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",g.j.Ol],SQRT2:["Math.SQRT2",g.j.Qb],SQRT1_2:["Math.SQRT1_2",g.j.Qb],INFINITY:["Infinity",g.j.Ii]}[F(a,"CONSTANT")]}; +g.j.math_number_property=function(a){var c=Z(a,"NUMBER_TO_CHECK",g.j.Ql)||"0",d=F(a,"PROPERTY");if("PRIME"==d){var e=Le("mathIsPrime",["function "+g.j.xe+"(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,g.j.gb]}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=Z(a,"DIVISOR",g.j.Ql)||"0",e=c+" % "+a+" == 0"}return[e,g.j.mw]}; +g.j.math_change=function(a){var c=Z(a,"DELTA",g.j.sh)||"0";a=P(F(a,"VAR"),g.O.ub);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};g.j.math_round=g.j.math_single;g.j.math_trig=g.j.math_single; +g.j.math_on_list=function(a){var c=F(a,"OP");switch(c){case "SUM":a=Z(a,"LIST",g.j.Qb)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=Z(a,"LIST",g.j.Qc)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=Z(a,"LIST",g.j.Qc)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=Le("mathMean",["function "+g.j.xe+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=Z(a,"LIST",g.j.Rc)||"[]";a=c+"("+a+")";break;case "MEDIAN":c= +Le("mathMedian",["function "+g.j.xe+"(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=Z(a,"LIST",g.j.Rc)||"[]";a=c+"("+a+")";break;case "MODE":c=Le("mathModes", +["function "+g.j.xe+"(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=Z(a,"LIST",g.j.Rc)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=Le("mathStandardDeviation",["function "+g.j.xe+"(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=Z(a,"LIST",g.j.Rc)||"[]";a=c+"("+a+")";break;case "RANDOM":c=Le("mathRandomList",["function "+g.j.xe+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=Z(a,"LIST",g.j.Rc)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,g.j.gb]};g.j.math_modulo=function(a){var c=Z(a,"DIVIDEND",g.j.Ql)||"0";a=Z(a,"DIVISOR",g.j.Ql)||"0";return[c+" % "+a,g.j.Ql]}; +g.j.math_constrain=function(a){var c=Z(a,"VALUE",g.j.Qc)||"0",d=Z(a,"LOW",g.j.Qc)||"0";a=Z(a,"HIGH",g.j.Qc)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",g.j.gb]}; +g.j.math_random_int=function(a){var c=Z(a,"FROM",g.j.Qc)||"0";a=Z(a,"TO",g.j.Qc)||"0";return[Le("mathRandomInt",["function "+g.j.xe+"(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+")",g.j.gb]};g.j.math_random_float=function(){return["Math.random()",g.j.gb]}; +g.j.math_atan2=function(a){var c=Z(a,"X",g.j.Qc)||"0";return["Math.atan2("+(Z(a,"Y",g.j.Qc)||"0")+", "+c+") / Math.PI * 180",g.j.Ol]};g.Pb=function(a){g.Pb.w.constructor.call(this,null);this.Vz=a};g.g.object.W(g.Pb,g.Ld);b=g.Pb.prototype;b.xl=0;b.Zn=0; +b.Qs=function(a){g.g.o.I("rect",{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);g.g.o.I("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); +g.g.o.I("circle",{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};b.Dt=function(a){this.U.ld()&&g.Ld.prototype.Dt.call(this,a)}; +b.xs=function(){this.Ln=g.g.o.I("svg",{x:g.oa.dd,y:g.oa.dd},null);if(this.Vz.length)for(var a=g.g.xml.createElement("xml"),c=0,d;d=this.Vz[c];c++){var e=g.g.xml.createElement("block");e.setAttribute("type",d);a.appendChild(e)}else a=null;a={disable:!1,Pg:this.U.v.options.Pg,Yk:a,Ob:this.U.v,uf:this.U.v.options.uf,G:this.U.G,Fa:this.U.G?g.Cg:g.Nd,Td:!1,hc:this.cF.bind(this),pi:null,dh:this.U.v.options.dh};this.s=new g.lb(a);this.s.sj=!0;ib(this.s,g.i.uE);a=Cc(this.s,"g");c=this.s.Ia("blocklyMutatorBackground"); +c.insertBefore(a,this.s.fb);this.Ln.appendChild(c);return this.Ln};b.lh=function(){g.Pb.w.lh.call(this);this.U.ac||(this.U.ld()?this.Ud&&g.g.o.Tb(this.Ud,"blocklyIconGroupReadonly"):(this.Vb(!1),this.Ud&&g.g.o.mb(this.Ud,"blocklyIconGroupReadonly")))}; +function Me(a){var c=2*g.oa.dd,d=a.s.fb.getBBox();var e=a.U.G?-d.x:d.width+d.x;d=d.height+3*c;if(a.s.P){var f=a.s.P.Km();d=Math.max(d,f.Pd+20)}e+=3*c;if(Math.abs(a.xl-e)>c||Math.abs(a.Zn-d)>c)a.xl=e,a.Zn=d,a.Zb.zn(e+c,d+c),a.Ln.setAttribute("width",a.xl),a.Ln.setAttribute("height",a.Zn);a.U.G&&a.s.fb.setAttribute("transform","translate("+a.xl+",0)");a.s.resize()} +b.Vb=function(a){if(a!=this.isVisible())if(g.i.Ma(new g.i.xd(this.U,"mutatorOpen",!a,a)),a){this.Zb=new g.oa(this.U.v,this.xs(),this.U.$d,this.Qk,null,null);mb(this.Zb,this.U.id);if(a=this.s.options.Yk)this.s.P.S(this.s),this.s.P.show(a.childNodes);this.fh=this.U.Ng(this.s);a=p(this.fh,!1);for(var c=0,d;d=a[c];c++)d.za();this.fh.oq(!1);this.fh.Bs=!1;this.s.P?(a=2*this.s.P.zb,c=Dc(this.s).Xf()+a):c=a=16;this.U.G&&(c=-c);this.fh.moveBy(c,a);if(this.U.lq){var e=this;this.U.lq(this.fh);this.qq=function(){e.U.lq(e.fh)}; +ib(this.U.v,this.qq)}Me(this);ib(this.s,this.KH.bind(this));this.Ue()}else this.Ln=null,this.s.J(),this.fh=this.s=null,this.Zb.J(),this.Zb=null,this.Zn=this.xl=0,this.qq&&(jb(this.U.v,this.qq),this.qq=null)}; +b.KH=function(a){if(a.type!=g.i.Oo&&(a.type!=g.i.zi||"disabled"!=a.element)){if(!this.s.ic()){a=D(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Ra(),f=G(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.fh.v==this.s){g.i.$(!0);d=this.U;a=(a=d.cb())&&g.R.Rd(a);c=d.ba;d.ba=!1;d.Kg(this.fh);d.ba=c;d.Ne();c=(c=d.cb())&&g.R.Rd(c);if(a!=c){g.i.Ma(new g.i.pg(d,"mutation",null,a,c));var h=g.i.$b();setTimeout(function(){g.i.$(h);d.Lb();g.i.$(!1)},g.co)}d.ba&&d.za();a!=c&&g.Oe&&g.navigation.fG(d);this.s.ic()|| +Me(this);g.i.$(!1)}}};b.cF=function(){return{yb:this.Zn,rb:this.xl-Dc(this.s).Xf(),Ac:0,oc:this.s.G?0:Dc(this.s).Xf()}};b.J=function(){this.U.Vd=null;g.Ld.prototype.J.call(this)};g.Pb.hl=function(a,c,d){if(!a||!a.B.v)return!1;d=A(c,d).connection;var e=y(a);return e&&e!=c||d.ca==a?!1:(d.isConnected()&&d.disconnect(),d.connect(a),!0)};g.Pb.Zx=function(a){var c=null;if(a&&a.options){var d=a.options.Ob;a.oe?d&&d.options&&(c=d.options.Ob):d&&(c=d)}return c};g.L.Ut={};g.ma.jC={};g.ma.jC.uo=260; +g.Fk([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}", +args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value", +name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]); +g.L.lists_create_with={S:function(){this.wb=g.h.LISTS_CREATE_WITH_HELPURL;L(this,"list_blocks");this.Cd=3;this.Nc();this.Ed(!0,"Array");this.ri(new g.Pb(["lists_create_with_item"]));this.Sa(g.h.LISTS_CREATE_WITH_TOOLTIP)},cb:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("items",this.Cd);return a},Cb:function(a){this.Cd=parseInt(a.getAttribute("items"),10);this.Nc()},Ng:function(a){var c=a.ci("lists_create_with_container");c.Ne();for(var d=A(c,"STACK").connection,e=0;e","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"]}]); +g.Fk([{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}"}]);g.ma.gd.Lr={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}"};g.Y.register("logic_op_tooltip",g.Y.Ro("OP",g.ma.gd.Lr)); +g.ma.gd.Pq={Sd:0,Ge:0,si:!0,cb:function(){if(!this.Sd&&!this.Ge)return null;var a=g.g.xml.createElement("mutation");this.Sd&&a.setAttribute("elseif",this.Sd);this.Ge&&a.setAttribute("else",1);return a},Cb:function(a){this.Sd=parseInt(a.getAttribute("elseif"),10)||0;this.Ge=parseInt(a.getAttribute("else"),10)||0;this.QG()},Ng:function(a){var c=a.ci("controls_if_if");c.Ne();for(var d=c.X,e=1;e<=this.Sd;e++){var f=a.ci("controls_if_elseif");f.Ne();d.connect(f.Z);d=f.X}this.Ge&&(a=a.ci("controls_if_else"), +a.Ne(),d.connect(a.Z));return c},Kg:function(a){a=y(a.X);this.Ge=this.Sd=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.Sd++;c.push(a.nv);d.push(a.xf);break;case "controls_if_else":this.Ge++;e=a.xf;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.X&&y(a.X)}this.Nc();this.Wz(c,d,e)},lq:function(a){a=y(a.X);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=A(this,"IF"+c),e=A(this,"DO"+c);a.nv=d&&d.connection.ca;a.xf=e&&e.connection.ca; +c++;break;case "controls_if_else":e=A(this,"ELSE");a.xf=e&&e.connection.ca;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.X&&y(a.X)}},QG:function(){var a=[null],c=[null],d=null;A(this,"ELSE")&&(d=A(this,"ELSE").connection.ca);for(var e=1;A(this,"IF"+e);){var f=A(this,"DO"+e);a.push(A(this,"IF"+e).connection.ca);c.push(f.connection.ca);e++}this.Nc();this.Wz(a,c,d)},Nc:function(){A(this,"ELSE")&&this.ib("ELSE");for(var a=1;A(this,"IF"+a);)this.ib("IF"+a),this.ib("DO"+a),a++;for(a= +1;a<=this.Sd;a++)K(M(this,"IF"+a).xb("Boolean"),g.h.CONTROLS_IF_MSG_ELSEIF),K(Rb(this,"DO"+a),g.h.CONTROLS_IF_MSG_THEN);this.Ge&&K(Rb(this,"ELSE"),g.h.CONTROLS_IF_MSG_ELSE)},Wz:function(a,c,d){for(var e=1;e<=this.Sd;e++)g.Pb.hl(a[e],this,"IF"+e),g.Pb.hl(c[e],this,"DO"+e);g.Pb.hl(d,this,"ELSE")}};g.Y.Ju("controls_if_mutator",g.ma.gd.Pq,null,["controls_if_elseif","controls_if_else"]); +g.ma.gd.Kv=function(){this.Sa(function(){if(this.Sd||this.Ge){if(!this.Sd&&this.Ge)return g.h.CONTROLS_IF_TOOLTIP_2;if(this.Sd&&!this.Ge)return g.h.CONTROLS_IF_TOOLTIP_3;if(this.Sd&&this.Ge)return g.h.CONTROLS_IF_TOOLTIP_4}else return g.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};g.Y.register("controls_if_tooltip",g.ma.gd.Kv); +g.ma.gd.fC={onchange:function(a){this.dl||(this.dl=[null,null]);var c=Tb(this,"A"),d=Tb(this,"B");c&&d&&!Ja(c.M,d.M)&&(g.i.$(a.group),a=this.dl[0],a!==c&&(z(c),a&&!a.bb&&A(this,"A").connection.connect(a.M)),c=this.dl[1],c!==d&&(z(d),c&&!c.bb&&A(this,"B").connection.connect(c.M)),this.Lb(),g.i.$(!1));this.dl[0]=Tb(this,"A");this.dl[1]=Tb(this,"B")}};g.ma.gd.eC=function(){this.yj(g.ma.gd.fC)};g.Y.register("logic_compare",g.ma.gd.eC); +g.ma.gd.gC={Sz:null,onchange:function(a){var c=Tb(this,"THEN"),d=Tb(this,"ELSE"),e=this.M.ca;if((c||d)&&e)for(var f=0;2>f;f++){var h=1==f?c:d;h&&!Ja(h.M,e)&&(g.i.$(a.group),e===this.Sz?(z(this),e.B.Lb()):(z(h),h.Lb()),g.i.$(!1))}this.Sz=e}};g.Y.fq("logic_ternary",g.ma.gd.gC);g.L.WF={};g.ma.ye={};g.ma.ye.uo=120; +g.Fk([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1", +args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement", +name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1", +args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null, +nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip", +"controls_flow_in_loop_check"]}]);g.ma.ye.eD={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};g.Y.register("controls_whileUntil_tooltip",g.Y.Ro("MODE",g.ma.ye.eD));g.ma.ye.ZA={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};g.Y.register("controls_flow_tooltip",g.Y.Ro("FLOW",g.ma.ye.ZA)); +g.ma.ye.pB={Mg:function(a){if(!this.ac){var c=x(this,"VAR").Xc(),d=c.name;if(!this.isCollapsed()&&null!=d){var e={enabled:!0};e.text=g.h.VARIABLES_SET_CREATE_GET.replace("%1",d);c=g.O.Gm(c);d=g.g.xml.createElement("block");d.setAttribute("type","variables_get");d.appendChild(c);e.Bb=g.Ea.So(this,d);a.push(e)}}}};g.Y.fq("contextMenu_newGetVariableBlock",g.ma.ye.pB);g.Y.register("controls_for_tooltip",g.Y.ls("%{BKY_CONTROLS_FOR_TOOLTIP}"));g.Y.register("controls_forEach_tooltip",g.Y.ls("%{BKY_CONTROLS_FOREACH_TOOLTIP}")); +g.ma.ye.lo={iC:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],si:!0,Cy:function(a){do{if(-1!=g.ma.ye.lo.iC.indexOf(a.type))return a;a=Mb(a)}while(a);return null},onchange:function(){this.v.ic&&!this.v.ic()&&(g.ma.ye.lo.Cy(this)?(this.ih(null),this.ac||this.od(!0)):(this.ih(g.h.CONTROLS_FLOW_STATEMENTS_WARNING),this.ac||Qb(this)||this.od(!1)))}};g.Y.fq("controls_flow_in_loop_check",g.ma.ye.lo);g.Pc=function(a,c,d){this.$w=null;null==a&&(a="FALSE");g.Pc.w.constructor.call(this,a,c,d);this.cc.width=g.Pc.fD};g.g.object.W(g.Pc,g.Pa);g.Pc.va=function(a){return new g.Pc(a.checked,void 0,a)};g.Pc.fD=15;g.Pc.cB="\u2713";g.Pc.dB=g.Pa.Ci-3;g.Pc.eB=14;b=g.Pc.prototype;b.Ni=!0;b.Rq="default";b.Zf=!1;b.Od=function(a){g.Pc.w.Od.call(this,a);a.checkCharacter&&(this.$w=a.checkCharacter)}; +b.Sh=function(){g.Pc.w.Sh.call(this);this.kc.setAttribute("x",g.Pc.dB);this.kc.setAttribute("y",g.Pc.eB);g.g.o.mb(this.kc,"blocklyCheckbox");this.Rj.nodeValue=this.$w||g.Pc.cB;this.kc.style.display=this.dc?"block":"none"};b.wf=function(){this.setValue(!this.dc)};b.Hh=function(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null};b.ej=function(a){this.dc=Ne(a);this.kc&&(this.kc.style.display=this.dc?"block":"none")};b.getValue=function(){return this.dc?"TRUE":"FALSE"};b.Sb=function(){return String(Ne(this.dc))}; +function Ne(a){return"string"==typeof a?"TRUE"==a:!!a}g.Wc.register("field_checkbox",g.Pc);g.L.OG={}; +g.L.procedures_defnoreturn={S:function(){var a=new g.Ab("",g.Ha.gq);ue(a);K(K(K(N(this),g.h.PROCEDURES_DEFNORETURN_TITLE),a,"NAME"),"","PARAMS");this.ri(new g.Pb(["procedures_mutatorarg"]));(this.v.options.km||this.v.options.Ob&&this.v.options.Ob.options.km)&&g.h.PROCEDURES_DEFNORETURN_COMMENT&&this.gg(g.h.PROCEDURES_DEFNORETURN_COMMENT);L(this,"procedure_blocks");this.Sa(g.h.PROCEDURES_DEFNORETURN_TOOLTIP);this.wb=g.h.PROCEDURES_DEFNORETURN_HELPURL;this.xa=[];this.Yb=[];this.jg(!0);this.xf=null}, +jg:function(a){this.Dp!==a&&(a?(K(Rb(this,"STACK"),g.h.PROCEDURES_DEFNORETURN_DO),A(this,"RETURN")&&Sb(this,"STACK","RETURN")):this.ib("STACK",!0),this.Dp=a)},Vn:function(){var a="";this.xa.length&&(a=g.h.PROCEDURES_BEFORE_PARAMS+" "+this.xa.join(", "));g.i.disable();try{Pb(this,a,"PARAMS")}finally{g.i.enable()}},cb:function(a){var c=g.g.xml.createElement("mutation");a&&c.setAttribute("name",F(this,"NAME"));for(var d=0;d b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];", +" return function(a, b) { return compare(a, b) * direction; }","}"]);return[c+".slice().sort("+e+'("'+a+'", '+d+"))",g.j.gb]};g.j.lists_split=function(a){var c=Z(a,"INPUT",g.j.Qb),d=Z(a,"DELIM",g.j.Rc)||"''";a=F(a,"MODE");if("SPLIT"==a)c||(c="''"),a="split";else if("JOIN"==a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+d+")",g.j.gb]};g.j.lists_reverse=function(a){return[(Z(a,"LIST",g.j.gb)||"[]")+".slice().reverse()",g.j.gb]};g.j.UF={};g.j.controls_if=function(a){var c=0,d="";g.j.Md&&(d+=Y(g.j.Md,a));do{var e=Z(a,"IF"+c,g.j.Rc)||"false";var f=Ie(a,"DO"+c);g.j.Tc&&(f=He(Y(g.j.Tc,a),g.j.td)+f);d+=(0",GTE:">="}[F(a,"OP")],d="=="==c||"!="==c?g.j.mw:g.j.wC,e=Z(a,"A",d)||"0";a=Z(a,"B",d)||"0";return[e+" "+c+" "+a,d]};g.j.logic_operation=function(a){var c="AND"==F(a,"OP")?"&&":"||",d="&&"==c?g.j.pr:g.j.qr,e=Z(a,"A",d);a=Z(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]};g.j.logic_negate=function(a){var c=g.j.Pl;return["!"+(Z(a,"BOOL",c)||"true"),c]}; +g.j.logic_boolean=function(a){return["TRUE"==F(a,"BOOL")?"true":"false",g.j.Ii]};g.j.logic_null=function(){return["null",g.j.Ii]};g.j.logic_ternary=function(a){var c=Z(a,"IF",g.j.Eo)||"false",d=Z(a,"THEN",g.j.Eo)||"null";a=Z(a,"ELSE",g.j.Eo)||"null";return[c+" ? "+d+" : "+a,g.j.Eo]};g.j.WF={};g.j.controls_repeat_ext=function(a){var c=x(a,"TIMES")?String(Number(F(a,"TIMES"))):Z(a,"TIMES",g.j.yg)||"0",d=Ie(a,"DO");d=Je(d,a);a="";var e=Lc(g.j.Gd,"count",g.O.ub),f=c;c.match(/^\w+$/)||g.Yh(c)||(f=Lc(g.j.Gd,"repeat_end",g.O.ub),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")};g.j.controls_repeat=g.j.controls_repeat_ext; +g.j.controls_whileUntil=function(a){var c="UNTIL"==F(a,"MODE"),d=Z(a,"BOOL",c?g.j.Pl:g.j.Rc)||"false",e=Ie(a,"DO");e=Je(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"}; +g.j.controls_for=function(a){var c=P(F(a,"VAR"),g.O.ub),d=Z(a,"FROM",g.j.yg)||"0",e=Z(a,"TO",g.j.yg)||"0",f=Z(a,"BY",g.j.yg)||"1",h=Ie(a,"DO");h=Je(h,a);if(g.Yh(d)&&g.Yh(e)&&g.Yh(f)){var k=Number(d)<=Number(e);a="for ("+c+" = "+d+"; "+c+(k?" <= ":" >= ")+e+"; "+c;c=Math.abs(Number(f));a=(1==c?a+(k?"++":"--"):a+((k?" += ":" -= ")+c))+(") {\n"+h+"}\n")}else a="",k=d,d.match(/^\w+$/)||g.Yh(d)||(k=Lc(g.j.Gd,c+"_start",g.O.ub),a+="var "+k+" = "+d+";\n"),d=e,e.match(/^\w+$/)||g.Yh(e)||(d=Lc(g.j.Gd,c+"_end", +g.O.ub),a+="var "+d+" = "+e+";\n"),e=Lc(g.j.Gd,c+"_inc",g.O.ub),a+="var "+e+" = ",a=g.Yh(f)?a+(Math.abs(f)+";\n"):a+("Math.abs("+f+");\n"),a=a+("if ("+k+" > "+d+") {\n")+(g.j.td+e+" = -"+e+";\n"),a+="}\n",a+="for ("+c+" = "+k+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+h+"}\n";return a}; +g.j.controls_forEach=function(a){var c=P(F(a,"VAR"),g.O.ub),d=Z(a,"LIST",g.j.yg)||"[]",e=Ie(a,"DO");e=Je(e,a);a="";var f=d;d.match(/^\w+$/)||(f=Lc(g.j.Gd,c+"_list",g.O.ub),a+="var "+f+" = "+d+";\n");d=Lc(g.j.Gd,c+"_index",g.O.ub);e=g.j.td+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")}; +g.j.controls_flow_statements=function(a){var c="";g.j.Md&&(c+=Y(g.j.Md,a));g.j.Tc&&(c+=Y(g.j.Tc,a));if(g.j.Md){var d=g.ma.ye.lo.Cy(a);d&&!d.si&&(c+=Y(g.j.Md,d))}switch(F(a,"FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");};g.j.OG={};g.j.procedures_defreturn=function(a){var c=P(F(a,"NAME"),g.Ha.ub),d="";g.j.Md&&(d+=Y(g.j.Md,a));g.j.Tc&&(d+=Y(g.j.Tc,a));d&&(d=He(d,g.j.td));var e="";g.j.wo&&(e=He(Y(g.j.wo,a),g.j.td));var f=Ie(a,"STACK"),h=Z(a,"RETURN",g.j.Rc)||"",k="";f&&h&&(k=d);h&&(h=g.j.td+"return "+h+";\n");for(var l=[],m=0;m","GT"],[">=","GTE"]]),"OP");this.ad(!0);var a=this;this.Sa(function(){var c=F(a,"OP");return{EQ:g.h.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:g.h.LOGIC_COMPARE_TOOLTIP_NEQ,LT:g.h.LOGIC_COMPARE_TOOLTIP_LT,LTE:g.h.LOGIC_COMPARE_TOOLTIP_LTE,GT:g.h.LOGIC_COMPARE_TOOLTIP_GT,GTE:g.h.LOGIC_COMPARE_TOOLTIP_GTE}[c]});this.dl= +[null,null]};g.h.LOGIC_OPERATION_AND="&&";g.h.LOGIC_OPERATION_OR="||";g.h.LOGIC_NEGATE_TITLE="! %1";g.h.LOGIC_BOOLEAN_TRUE="true";g.h.LOGIC_BOOLEAN_FALSE="false";g.L.controls_whileUntil.S=function(){O(this,{message0:"while ( %1 ) { %2 %3 }",args0:[{type:"input_value",name:"BOOL",check:"Boolean"},{type:"input_dummy"},{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:g.h.LOOPS_HUE,tooltip:g.h.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,helpUrl:g.h.CONTROLS_WHILEUNTIL_HELPURL})}; +g.L.controls_for.S=function(){O(this,{message0:"for (var %1 = %2; %3 < %4; %5 += 1) { %6 %7 }",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"field_label",name:"VAR1",text:"?"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"field_label",name:"VAR2",text:"?"},{type:"input_dummy"},{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:g.h.LOOPS_HUE,helpUrl:g.h.CONTROLS_FOR_HELPURL}); +var a=this;this.Sa(function(){return g.h.CONTROLS_FOR_TOOLTIP.replace("%1",F(a,"VAR"))})};g.L.controls_for.onchange=function(){var a=x(this,"VAR").Sb();Pb(this,a,"VAR1");Pb(this,a,"VAR2")};g.j.controls_for=function(a){var c=P(F(a,"VAR"),g.O.ub),d=Z(a,"FROM",g.j.yg)||"0",e=Z(a,"TO",g.j.yg)||"0",f=Ie(a,"DO");f=Je(f,a.id);return"for (var "+c+" = "+d+"; "+c+" < "+e+"; "+c+" += 1) {\n"+f+"}\n"};g.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break ;";g.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue ;"; +g.L.math_arithmetic.S=function(){O(this,{message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["+","ADD"],["-","MINUS"],["*","MULTIPLY"],["/","DIVIDE"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:g.h.MATH_HUE,helpUrl:g.h.MATH_ARITHMETIC_HELPURL});var a=this;this.Sa(function(){var c=F(a,"OP");return{ADD:g.h.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:g.h.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:g.h.MATH_ARITHMETIC_TOOLTIP_MULTIPLY, +DIVIDE:g.h.MATH_ARITHMETIC_TOOLTIP_DIVIDE}[c]})};g.L.math_change.S=function(){O(this,{message0:"%1 += %2;",args0:[{type:"field_variable",name:"VAR",variable:"name"},{type:"input_value",name:"DELTA",check:"Number"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:g.h.VARIABLES_HUE,helpUrl:g.h.MATH_CHANGE_HELPURL});var a=this;this.Sa(function(){return g.h.MATH_CHANGE_TOOLTIP.replace("%1",F(a,"VAR"))})}; +g.j.math_change=function(a){var c=Z(a,"DELTA",g.j.sh)||"0";return P(F(a,"VAR"),g.O.ub)+" += "+c+";\n"};g.L.math_random_int.S=function(){O(this,{message0:"%1(%2,%3)",args0:["Math.randomInt",{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",colour:g.h.MATH_HUE,tooltip:g.h.MATH_RANDOM_INT_TOOLTIP,helpUrl:g.h.MATH_RANDOM_INT_HELPURL})};g.h.MATH_RANDOM_FLOAT_TITLE_RANDOM="Math.random ( )";g.h.LISTS_CREATE_EMPTY_TITLE="[ ]"; +g.h.LISTS_CREATE_WITH_INPUT_WITH="[";g.L.lists_create_with.Nc=function(){A(this,"TAIL")&&this.ib("TAIL");this.Cd&&A(this,"EMPTY")?this.ib("EMPTY"):this.Cd||A(this,"EMPTY")||K(N(this,"EMPTY"),g.h.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function gf(a){return hf[a]}var ff=/[\x00\x22\x26\x27\x3c\x3e]/g;function jf(){return'
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
Busque inimigos. Especifique uma dire\u00e7\u00e3o(0-360). \\nRetorna a distancia do inimigo mais proximo \\nnaquela dire\u00e7\u00e3o. Retorna infinito se nenhum \\ninimigo for encontrado. Dispare o canh\u00e3o. Especifique uma dire\u00e7\u00e3o \\n(0-360) e o alcance (0-70). Nadar para a frente. Especifique uma dire\u00e7\u00e3o \\n(0-360). Parar de nadar. O jogador fara uma parada lenta. Retorna a saude atual do jogador (0 esta morto, \\n100 esta saud\u00e1vel). Retorna a velocidade atual do jogador (0 esta \\npar\u00e1do, 100 esta na velocidade maxima) Retorna a coordenada X do jogador (0 \u00e9 a margem \\nesquerda, 100 \u00e9 a margem direita). Retorna a coordenada Y do jogador (0 \u00e9 a borda \\ninferior, 100 \u00e9 a borda superior).
CoelhoContadorTorreFrancoatiradorJogador

'+ +((Qc?'':'')+"Jogos do Blockly : "+df({appName:"Lagoa"}.appName)+'

Blocos
JavaScript
\n\n\n\n\n\n\n\n
')} +;var Yc="pond-duck",kf=null,lf=!0,mf=!0; +function nf(a){for(var c=["blockly","editor"],d=0,e;e=c[d];d++)e=document.getElementById(e),e.style.visibility=d==a?"visible":"hidden";c=[".blocklyTooltipDiv",".blocklyToolboxDiv"];for(d=0;e=c[d];d++)e=document.querySelector(e),e.style.visibility=0==a?"visible":"hidden";document.getElementById("docsButton").disabled=!1;R=0==a?11:12;oe&&(document.getElementById("frameDocs").src="pond/docs.html?lang="+Oc+"&mode="+R);1==a&&lf&&(a=qd(),mf=!0,V.zd.setValue(a,-1),mf=!1)} +function of(){if(!mf)if(lf)if(!D(B,!1).length||confirm(S("Games_breakLink")))g.g.o.mb(kf[0],"tab-disabled"),lf=!1;else{var a=qd();mf=!0;V.zd.setValue(a,-1);mf=!1}else a=V.zd.getValue(),a.trim()||(B.clear(),g.g.o.Tb(kf[0],"tab-disabled"),lf=!0)} +window.addEventListener("load",function(){function a(){var v=h.offsetTop;k.style.top=v-window.pageYOffset+"px";k.style.left=f?"10px":"420px";k.style.width=window.innerWidth-440+"px";v=Math.max(0,v+k.offsetHeight-window.pageYOffset)+"px";for(var C=f?"10px":"420px",Q=window.innerWidth-440+"px",T=0,W;W=m[T];T++)W.style.top=v,W.style.left=C,W.style.width=Q}function c(v){return function(){if(!g.g.o.yt(d[v],"tab-disabled")){for(var C=0;C.tab")),e=0;e070');B.clear();g.R.Qg(e,B);hb();l=[{start:new g.g.N(20,80),kd:0,name:"Pond_myName",code:null},{start:new g.g.N(80,80),kd:0,name:"Pond_rookName",code:"playerRook"}, +{start:new g.g.N(20,20),kd:0,name:"Pond_counterName",code:"playerCounter"},{start:new g.g.N(80,20),kd:0,name:"Pond_sniperName",code:"playerSniper"}];var n;for(e=0;n=l[e];e++){var r=n.code?document.getElementById(n.code).textContent:function(){return lf?qd():V.zd.getValue()},t=S(n.name);X.pD(t,r,n.start,n.kd)}X.reset();he();nf(0);mf=!1}); diff --git a/html/blockly-games/pond/duck/style.css b/html/blockly-games/pond/duck/style.css new file mode 100644 index 0000000..093b1b0 --- /dev/null +++ b/html/blockly-games/pond/duck/style.css @@ -0,0 +1,80 @@ +#tabarea { + position: fixed !important; +} + +#about { + border: 1px solid #ddd; + bottom: 10px; + overflow-y: scroll; + position: fixed; +} + +#about>* { + margin: 1em; +} + +#docsButton:disabled { + color: #ccc; +} + +.tab { + background: #fff; + border: 1px solid #ddd; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + color: #333; + cursor: default; + padding: 4px 8px; + position: relative; + user-select: none; +} + +.tab-bar>.tab { + border-bottom: 0; + float: left; + margin: 1px 4px 0 0; +} + +/* State: Hover */ +.tab:hover { + background: #eee; +} + +/* State: Disabled */ +.tab-disabled { + background: #fff; + border-color: #ccc; + color: #ccc; +} + +/* State: Selected */ +.tab-selected { + background: #ddd !important; /* Selected trumps hover. */ +} + +/* + * Shift selected tabs 1px towards the contents (and compensate via margin and + * padding) to visually merge the borders of the tab with the borders of the + * content area. + */ +.tab-bar>.tab-selected { + margin-top: 0; + padding-bottom: 5px; + top: 1px; +} + +.tab-bar { + border: 0; + cursor: default; + list-style: none; + margin: 0; + outline: none; + padding: 0; + position: relative; +} + +.tab-bar-clear { + clear: both; + height: 0; + overflow: hidden; +} diff --git a/html/blockly-games/pond/icons.png b/html/blockly-games/pond/icons.png new file mode 100644 index 0000000..1ed5c82 Binary files /dev/null and b/html/blockly-games/pond/icons.png differ diff --git a/html/blockly-games/pond/splash.mp3 b/html/blockly-games/pond/splash.mp3 new file mode 100644 index 0000000..7d15daf Binary files /dev/null and b/html/blockly-games/pond/splash.mp3 differ diff --git a/html/blockly-games/pond/splash.ogg b/html/blockly-games/pond/splash.ogg new file mode 100644 index 0000000..a30bc0f Binary files /dev/null and b/html/blockly-games/pond/splash.ogg differ diff --git a/html/blockly-games/pond/sprites.png b/html/blockly-games/pond/sprites.png new file mode 100644 index 0000000..b2e8d38 Binary files /dev/null and b/html/blockly-games/pond/sprites.png differ diff --git a/html/blockly-games/pond/style.css b/html/blockly-games/pond/style.css new file mode 100644 index 0000000..b964029 --- /dev/null +++ b/html/blockly-games/pond/style.css @@ -0,0 +1,146 @@ +#blockly { + position: fixed; + bottom: 10px; +} + +#editor { + font-size: 16pt; + position: fixed !important; + height: auto !important; + bottom: 10px; + border: 1px solid #ddd; +} + +#visualization { + position: relative; +} + +#display { + border: 1px solid #ddd; + vertical-align: bottom; +} + +#avatarStatTable { + width: 406px; + max-width: 406px; + margin-left: -2px; + height: 20px; +} + +#avatarStatTable td { + padding: 0; + border: 1px solid; + background: #ccc; + border-radius: 2px; +} + +#avatarStatTable div:not(.avatarStatHealth) { + padding: 1px; +} + +.avatarStatName { + position: absolute; + color: #fff; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.avatarStatHealth { + position: absolute; +} + +/* Documentation frame. */ +#dialogDocs { + visibility: hidden; + background-color: #fff; + border: 1px solid #ccc; + position: absolute; + border-radius: 8px; + box-shadow: 5px 5px 5px #888; + padding: 15px 0 5px; + top: 55px; + left: 5px; + width: 406px; + bottom: 10px; +} + +html[dir="RTL"] #dialogDocs { + left: auto; + right: 5px; +} + +#frameDocs { + width: 100%; + height: 100%; + border: none; +} + +#closeDocs { + position: absolute; + top: -5px; + left: 389px; + cursor: pointer; + opacity: .7; +} + +html[dir="RTL"] #closeDocs { + left: auto; + right: 389px; +} + +#closeDocs:hover { + opacity: 1; +} + +.edit { + vertical-align: bottom; + opacity: .6; + transition: opacity .2s; + transition-timing-function: ease; +} +.grey { + -webkit-filter: grayscale(1); + filter: grayscale(1); +} + +.edit:hover { + opacity: 1; + -webkit-filter: grayscale(0); + filter: grayscale(0); +} + +.quote0, +.quote1 { + height: 10px; + width: 12px; + margin: 0 2px; + opacity: .5; +} + +.quote0 { + margin-bottom: 6px; +} + +.quote1 { + margin-bottom: -4px; +} + +/* Sprited icons. */ +.icon21 { + height: 21px; + width: 21px; + background-image: url(icons.png); +} +.close { + background-position: -21px 0px; +} +.link { + background-position: 0px 0px; +} +.run { + background-position: 0px -21px; +} +.stop { + background-position: -21px -21px; +} diff --git a/html/blockly-games/pond/tutor/generated/pt-br/compressed.js b/html/blockly-games/pond/tutor/generated/pt-br/compressed.js new file mode 100644 index 0000000..37680ee --- /dev/null +++ b/html/blockly-games/pond/tutor/generated/pt-br/compressed.js @@ -0,0 +1,861 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,h={g:{}};h.g.K=function(a,c){this.x=a;this.y=c};h.g.K.Ee=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};h.g.K.bp=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};h.g.K.QF=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};h.g.K.um=function(a,c){return new h.g.K(a.x-c.x,a.y-c.y)};h.g.K.sum=function(a,c){return new h.g.K(a.x+c.x,a.y+c.y)};h.g.K.prototype.scale=function(a){this.x*=a;this.y*=a;return this}; +h.g.K.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this}; +h.NL={};h.Sv=40;h.dw=125;h.mB=5;h.vB=10;h.td=28;h.bB=h.td;h.eB=8;h.LB="#000000";h.Yn=250;h.Bq=10;h.ZA=30;h.$B=750;h.FC=100;h.nB=!0;h.HB=.45;h.IB=.65;h.ik={width:96,height:124,url:"sprites.png"};h.Wa=1;h.Te=2;h.jb=3;h.Ue=4;h.mg=5;h.xq=-1;h.jv=0;h.tl=1;h.rI=0;h.sI=1;h.pI=1;h.qI=2;h.fk=[];h.fk[h.Wa]=h.Te;h.fk[h.Te]=h.Wa;h.fk[h.jb]=h.Ue;h.fk[h.Ue]=h.jb;h.wg=0;h.kk=1;h.Yd=2;h.vg=3;h.Cv=null;h.Iq=1;h.Dv=2;h.vw="VARIABLE";h.WC="VARIABLE_DYNAMIC";h.ew="PROCEDURE";h.lw="RENAME_VARIABLE_ID";h.Ev="DELETE_VARIABLE_ID";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.fb={};h.g.fb.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};h.g.fb.Mu=function(a){return a.length?a.reduce(function(c,d){return c.lengthc&&(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;eg);return k}; +h.g.fb.dv=function(a,c,d){for(var e=[0],f=[],g=0;ge&&(e=l,f=k)}return f?h.g.fb.xA(a,f,d):c};h.g.fb.DH=function(a,c){for(var d=[],e=0;e=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.fb.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.Wu(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;kd;d++)c[d]=h.g.Jg.cA.charAt(Math.random()*a);return c.join("")}; +h.g.Jg.cA="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +h.g.hj=function(){if(void 0!==h.g.hj.Zr)return h.g.hj.Zr;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.hj.Zr="none"!==c;return h.g.hj.Zr};h.g.Tz=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.bF=function(){var a=h.g.style.ty();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +h.g.Ko=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};h.g.VE=function(){var a=document.documentElement,c=window;return h.g.userAgent.og&&c.pageYOffset!=a.scrollTop?new h.g.K(a.scrollLeft,a.scrollTop):new h.g.K(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};h.g.Us=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=q(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.QG=function(a,c){var d=c.x;c=c.y;var e=ba(a).getBoundingClientRect();d=new h.g.K(d-e.left,c-e.top);c=h.g.Gm(a.pb);return h.g.K.um(d,c).scale(1/a.scale)};h.i={};h.i.xy="";h.i.Dc=!0;h.i.ws=0;h.i.fo="create";h.i.vl=h.i.fo;h.i.yl="delete";h.i.Wn=h.i.yl;h.i.si="change";h.i.QH=h.i.si;h.i.Hl="move";h.i.qv=h.i.Hl;h.i.ww="var_create";h.i.xw="var_delete";h.i.yw="var_rename";h.i.Io="ui";h.i.bo="comment_create";h.i.xv="comment_delete";h.i.wv="comment_change";h.i.co="comment_move";h.i.uB="finished_loading";h.i.RA=[h.i.vl,h.i.qv,h.i.bo,h.i.co];h.i.Al=[];h.i.Ka=function(a){h.i.isEnabled()&&(h.i.Al.length||setTimeout(h.i.FE,0),h.i.Al.push(a))}; +h.i.FE=function(){for(var a=h.i.filter(h.i.Al,!0),c=h.i.Al.length=0,d;d=a[c];c++)if(d.tc){var e=h.Ib.Ws(d.tc);if(e){var f=d;if(f.Dc)for(e.Nj.push(f),e.on.length=0;e.Nj.length>e.Uv&&0<=e.Uv;)e.Nj.shift();for(var g=0;d=e.zd[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.Pk()){var k=[g.type,g.wc,g.tc].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.Hl&&l.index==f-1)m.uj=g.uj,m.tj=g.tj,m.Vh=g.Vh,l.index=f;else if(g.type==h.i.si&&g.element==m.element&&g.name==m.name)m.newValue=g.newValue;else if(g.type!=h.i.Io||"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.Pk()});c||a.reverse();for(f=1;g=a[f];f++)g.type==h.i.si&&"mutation"==g.element&&a.unshift(a.splice(f,1)[0]);return a};h.i.LD=function(){for(var a=0,c;c=h.i.Al[a];a++)c.Dc=!1};h.i.disable=function(){h.i.ws++};h.i.enable=function(){h.i.ws--};h.i.isEnabled=function(){return 0==h.i.ws};h.i.Zb=function(){return h.i.xy};h.i.$=function(a){h.i.xy="boolean"==typeof a?a?h.g.Jg():"":a}; +h.i.$x=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.va=function(a){switch(a.type){case h.i.fo:var c=new h.i.Re(null);break;case h.i.yl:c=new h.i.wf(null);break;case h.i.si:c=new h.i.bh(null,"","","","");break;case h.i.Hl:c=new h.i.Bi(null);break;case h.i.ww:c=new h.i.ze(null);break;case h.i.xw:c=new h.i.We(null);break;case h.i.yw:c=new h.i.Bf(null,"");break;case h.i.Io:c=new h.i.ud(null,"","","");break;case h.i.bo:c=new h.i.kg(null);break;case h.i.wv:c=new h.i.Xj(null,"","");break;case h.i.co:c=new h.i.ti(null);break;case h.i.xv:c=new h.i.lg(null); +break;default:throw Error("Unknown event type.");}c.va(a);c.tc=(void 0).id;return c};h.i.oE=function(a){if((a.type==h.i.Hl||a.type==h.i.fo)&&a.tc){var c=h.Ib.Ws(a.tc);if(a=r(c,a.wc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.md(!0);else if((a.M||a.Z)&&!c.gc()){do a.md(!1),a=q(a);while(a)}}}}; +h.i.Abstract=function(){this.tc=void 0;this.group=h.i.Zb();this.Dc=h.i.Dc};h.i.Abstract.prototype.Za=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};h.i.Abstract.prototype.va=function(a){this.group=a.group};h.i.Abstract.prototype.Pk=function(){return!1};h.i.Abstract.prototype.run=function(){};function v(a){if(a.tc)var c=h.Ib.Ws(a.tc);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};h.g.object={};h.g.object.W=function(a,c){a.w=c.prototype;a.prototype=Object.create(c.prototype);a.prototype.constructor=a};h.g.object.rj=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.ud=function(a,c,d,e){h.i.ud.w.constructor.call(this);this.wc=a?a.id:null;this.tc=a?a.v.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Dc=!1};h.g.object.W(h.i.ud,h.i.Abstract);h.i.ud.prototype.type=h.i.Io;h.i.ud.prototype.Za=function(){var a=h.i.ud.w.Za.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.wc&&(a.blockId=this.wc);return a}; +h.i.ud.prototype.va=function(a){h.i.ud.w.va.call(this,a);this.element=a.element;this.newValue=a.newValue;this.wc=a.blockId};h.g.o={};h.g.o.Ql="http://www.w3.org/2000/svg";h.g.o.zi="http://www.w3.org/1999/xhtml";h.g.o.Mi="http://www.w3.org/1999/xlink";h.g.o.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};h.g.o.Pi=null;h.g.o.Xr=0;h.g.o.L=function(a,c,d){a=document.createElementNS(h.g.o.Ql,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.o.Cb=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.o.Ec=function(a,c){var d=a.getAttribute("class");if(-1==(" "+d+" ").indexOf(" "+c+" "))return!1;d=d.split(/\s+/);for(var e=0;ec||c>this.kb.length)throw Error(h.uc.Error.XA);this.bs[a.ua()]=a;if(a.getParent()==this){var e=this.kb.indexOf(a);-1>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};h.Ed.Fu=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +h.Ed.Eq=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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.Ha={};h.g.Ha.nd=function(a){return a*Math.PI/180};h.g.Ha.ll=function(a){return 180*a/Math.PI};h.g.Ha.Ef=function(a,c,d){if(df.top?h.D.gy(d,e,f,g):c+g.heightdocument.documentElement.clientTop?h.D.gy(d,e,f,g):h.D.$E(a,f,g)}; +h.D.iy=function(a,c,d,e){a=h.D.$s(a,d.left,d.right,e.width);return{yp:a.Ak,zp:c,hp:a.Ak,ip:c+h.D.cw,am:a.am,Hw:-(h.D.Vn/2+h.D.uv),Lr:!0,Mr:!0}};h.D.gy=function(a,c,d,e){a=h.D.$s(a,d.left,d.right,e.width);return{yp:a.Ak,zp:c-e.height,hp:a.Ak,ip:c-e.height-h.D.cw,am:a.am,Hw:e.height-2*h.D.uv-h.D.Vn/2,Lr:!1,Mr:!0}};h.D.$E=function(a,c,d){a=h.D.$s(a,c.left,c.right,d.width);return{yp:a.Ak,zp:0,hp:a.Ak,ip:0,Mr:!1}}; +h.D.$s=function(a,c,d,e){var f=a;a=h.g.Ha.Ef(c,a-e/2,d-e);f-=h.D.Vn/2;c=h.g.Ha.Ef(h.D.ov,f-a,e-h.D.ov-h.D.Vn);return{am:c,Ak:a}};h.D.isVisible=function(){return!!h.D.ld};h.D.Hk=function(a,c){h.D.ld===a&&(c?h.D.Ik():h.D.Ca())};h.D.Ca=function(){var a=h.D.se;a.style.transform="translate(0, 0)";a.style.opacity=0;h.D.Kr=setTimeout(function(){h.D.Ik()},1E3*h.D.zq);h.D.xj&&(h.D.xj(),h.D.xj=null)}; +h.D.Ik=function(){if(h.D.isVisible()){h.D.Kr&&clearTimeout(h.D.Kr);var a=h.D.se;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=h.D.Bv;a.style.borderColor=h.D.Av;h.D.xj&&(h.D.xj(),h.D.xj=null);h.D.KD();h.D.ld=null}}; +h.D.ln=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.se;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.kM=function(){if(h.D.ld){var a=h.D.ld.B,c=a.v.scale,d=h.D.Up?h.D.ld.bc.width:a.width,e=h.D.Up?h.D.ld.bc.height:a.height;d*=c;e*=c;a=h.D.Up?h.D.ld.gf.getBoundingClientRect():a.ya().getBoundingClientRect();d=a.left+d/2;e=h.D.jy(d,a.top+e,d,a.top);h.D.ln(e.yp,e.zp,e.hp,e.ip)}else h.D.Ca()}; +h.yi=function(a,c){this.Fk=a;this.Ou=c.spacing;this.Xy=c.length;this.LF=(this.Gt=a.firstChild)&&this.Gt.nextSibling;this.ZG=c.snap};h.yi.prototype.gi=1;h.yi.prototype.I=function(){this.Fk=null};h.yi.prototype.update=function(a){this.gi=a;var c=this.Ou*a||100;this.Fk.setAttribute("width",c);this.Fk.setAttribute("height",c);c=Math.floor(this.Ou/2)+.5;var d=c-this.Xy/2,e=c+this.Xy/2;c*=a;d*=a;e*=a;ha(this.Gt,a,d,e,c,c);ha(this.LF,a,c,c,d,e)}; +function ha(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.yi.prototype.moveTo=function(a,c){this.Fk.setAttribute("x",a);this.Fk.setAttribute("y",c);(h.g.userAgent.og||h.g.userAgent.lo)&&this.update(this.gi)}; +h.yi.Oa=function(a,c,d){a=h.g.o.L("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},d);0");c.zb(e)}h.i.Ka(new h.i.bh(c,"mutation",null,d,a)); +break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.wc)};h.i.Re=function(a){a&&(h.i.Re.w.constructor.call(this,a),this.xml=a.v.ba?h.R.Sr(a):h.R.qh(a),this.Gh=h.i.$x(a))};h.g.object.W(h.i.Re,h.i.vf);h.i.$n=h.i.Re;h.i.Re.prototype.type=h.i.fo;h.i.Re.prototype.Za=function(){var a=h.i.Re.w.Za.call(this);a.xml=h.R.Md(this.xml);a.ids=this.Gh;return a}; +h.i.Re.prototype.va=function(a){h.i.Re.w.va.call(this,a);this.xml=h.R.li(a.xml);this.Gh=a.ids};h.i.Re.prototype.run=function(a){var c=v(this);if(a)a=h.g.xml.createElement("xml"),a.appendChild(this.xml),h.R.xh(a,c);else{a=0;for(var d;d=this.Gh[a];a++){var e=r(c,d);e?e.I(!1):d==this.wc&&console.warn("Can't uncreate non-existent block: "+d)}}}; +h.i.wf=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");h.i.wf.w.constructor.call(this,a);this.bu=a.v.ba?h.R.Sr(a):h.R.qh(a);this.Gh=h.i.$x(a)}};h.g.object.W(h.i.wf,h.i.vf);h.i.SA=h.i.wf;h.i.wf.prototype.type=h.i.yl;h.i.wf.prototype.Za=function(){var a=h.i.wf.w.Za.call(this);a.ids=this.Gh;return a};h.i.wf.prototype.va=function(a){h.i.wf.w.va.call(this,a);this.Gh=a.ids}; +h.i.wf.prototype.run=function(a){var c=v(this);if(a){a=0;for(var d;d=this.Gh[a];a++){var e=r(c,d);e?e.I(!1):d==this.wc&&console.warn("Can't delete non-existent block: "+d)}}else a=h.g.xml.createElement("xml"),a.appendChild(this.bu),h.R.xh(a,c)};h.i.Bi=function(a){a&&(h.i.Bi.w.constructor.call(this,a),a=ia(this),this.oz=a.Cz,this.nz=a.My,this.Zt=a.jx)};h.g.object.W(h.i.Bi,h.i.vf);h.i.wl=h.i.Bi;b=h.i.Bi.prototype;b.type=h.i.Hl; +b.Za=function(){var a=h.i.Bi.w.Za.call(this);this.uj&&(a.newParentId=this.uj);this.tj&&(a.newInputName=this.tj);this.Vh&&(a.newCoordinate=Math.round(this.Vh.x)+","+Math.round(this.Vh.y));return a};b.va=function(a){h.i.Bi.w.va.call(this,a);this.uj=a.newParentId;this.tj=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.Vh=new h.g.K(Number(a[0]),Number(a[1])))};b.Aj=function(){var a=ia(this);this.uj=a.Cz;this.tj=a.My;this.Vh=a.jx}; +function ia(a){var c=r(v(a),a.wc);a={};var d=c.getParent();if(d){a.Cz=d.id;a:{for(var e=0,f;f=d.T[e];e++)if(f.connection&&z(f.connection)==c){c=f;break a}c=null}c&&(a.My=c.name)}else a.jx=c.Qa();return a}b.Pk=function(){return this.oz==this.uj&&this.nz==this.tj&&h.g.K.Ee(this.Zt,this.Vh)}; +b.run=function(a){var c=v(this),d=r(c,this.wc);if(d){var e=a?this.uj:this.oz,f=a?this.tj:this.nz;a=a?this.Vh:this.Zt;var g=null;if(e&&(g=r(c,e),!g)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&A(d);if(a)f=d.Qa(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.M||d.Z;if(f){if(c=B(g,f))var k=c.connection}else d.type==h.Ue&&(k=g.X);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.wc)};h.i.Bl=function(a){this.tc=a.id;this.group=h.i.Zb();this.Dc=!1};h.g.object.W(h.i.Bl,h.i.Abstract);h.i.Bl.prototype.type=h.i.uB;h.i.Bl.prototype.Za=function(){var a={type:this.type};this.group&&(a.group=this.group);this.tc&&(a.workspaceId=this.tc);return a};h.i.Bl.prototype.va=function(a){this.tc=a.workspaceId;this.group=a.group};h.i.xg=function(a){h.i.xg.w.constructor.call(this);this.mi=a.ua();this.tc=a.v.id};h.g.object.W(h.i.xg,h.i.Abstract);h.i.xg.prototype.Za=function(){var a=h.i.xg.w.Za.call(this);a.varId=this.mi;return a};h.i.xg.prototype.va=function(a){h.i.xg.w.Za.call(this);this.mi=a.varId};h.i.ze=function(a){a&&(h.i.ze.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};h.g.object.W(h.i.ze,h.i.xg);h.i.ze.prototype.type=h.i.ww; +h.i.ze.prototype.Za=function(){var a=h.i.ze.w.Za.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};h.i.ze.prototype.va=function(a){h.i.ze.w.va.call(this,a);this.Qj=a.varType;this.Pj=a.varName};h.i.ze.prototype.run=function(a){var c=v(this);a?c.Ld(this.Pj,this.Qj,this.mi):c.Kf(this.mi)};h.i.We=function(a){a&&(h.i.We.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};h.g.object.W(h.i.We,h.i.xg);h.i.We.prototype.type=h.i.xw; +h.i.We.prototype.Za=function(){var a=h.i.We.w.Za.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};h.i.We.prototype.va=function(a){h.i.We.w.va.call(this,a);this.Qj=a.varType;this.Pj=a.varName};h.i.We.prototype.run=function(a){var c=v(this);a?c.Kf(this.mi):c.Ld(this.Pj,this.Qj,this.mi)};h.i.Bf=function(a,c){a&&(h.i.Bf.w.constructor.call(this,a),this.au=a.name,this.Vt=c)};h.g.object.W(h.i.Bf,h.i.xg);h.i.Bf.prototype.type=h.i.yw; +h.i.Bf.prototype.Za=function(){var a=h.i.Bf.w.Za.call(this);a.oldName=this.au;a.newName=this.Vt;return a};h.i.Bf.prototype.va=function(a){h.i.Bf.w.va.call(this,a);this.au=a.oldName;this.Vt=a.newName};h.i.Bf.prototype.run=function(a){var c=v(this);a?c.ei(this.mi,this.Vt):c.ei(this.mi,this.au)};h.R={};h.R.vA=function(a){var c=C,d=h.g.xml.createElement("xml"),e=h.R.wH(h.O.Gw(c));e.hasChildNodes()&&d.appendChild(e);var f=ja(c,!0);e=0;for(var g;g=f[e];e++)d.appendChild(g.Vu(a));c=D(c,!0);for(e=0;f=c[e];e++)d.appendChild(h.R.Sr(f,a));return d};h.R.wH=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.ua();c.appendChild(f)}return c}; +h.R.Sr=function(a,c){var d;a.v.G&&(d=a.v.Qf());c=h.R.qh(a,c);var e=a.Qa();c.setAttribute("x",Math.round(a.v.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};h.R.DE=function(a){var c=!1;a.name&&(a.Hi?c=!0:a.ng&&(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.kA(c)):null}; +h.R.mD=function(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,g;g=e.Pa[f];f++)(g=h.R.DE(g))&&c.appendChild(g)}; +h.R.qh=function(a,c){var d=h.g.xml.createElement(a.cb?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.eb){var e=a.eb();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}h.R.mD(a,d);if(e=a.Be.text){var f=a.Be.size,g=a.Be.pu,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.T[f];f++){var l;k=!0;if(g.type!=h.mg){var m=z(g.connection);g.type==h.Wa?l=h.g.xml.createElement("value"):g.type==h.jb&&(l=h.g.xml.createElement("statement"));e=g.connection.pf;!e||m&&m.cb||l.appendChild(h.R.Sw(e,c));m&&(l.appendChild(h.R.qh(m,c)),k=!1);l.setAttribute("name",g.name);k||d.appendChild(l)}}void 0!=a.Pg&&a.Pg!=a.CF&&d.setAttribute("inline",a.Pg);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.je()||a.cb||d.setAttribute("deletable", +!1);a.kd()||a.cb||d.setAttribute("movable",!1);a.jd()||d.setAttribute("editable",!1);if(f=q(a))l=h.g.xml.createElement("next"),l.appendChild(h.R.qh(f,c)),d.appendChild(l);e=a.X&&a.X.pf;!e||f&&f.cb||l.appendChild(h.R.Sw(e,c));return d}; +h.R.Sw=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.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&h.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==h.g.o.Node.TEXT_NODE&&""==e.data.trim()&&h.g.o.removeNode(e))}return a}; +h.R.Md=function(a){a=h.g.xml.Md(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};h.R.OL=function(a){a=h.R.Md(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +h.R.li=function(a){var c=h.g.xml.hH(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};h.R.KL=function(a,c){c.Gc(!1);c.clear();a=h.R.xh(a,c);c.Gc(!0);return a}; +h.R.xh=function(a,c){if(a instanceof h.Ib){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.G&&(e=c.Qf());d=[];h.g.o.Dn();var f=a.childNodes.length,g=h.i.Zb();g||h.i.$(!0);c.Gc&&c.Gc(!1);var k=!0;try{for(var l=0;l document.");}else a=null;return a};h.Touch={};h.Touch.uw="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.Kn=null;h.Touch.Af={}; +h.g.global.PointerEvent?h.Touch.Af={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:h.Touch.uw&&(h.Touch.Af={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});h.Kp=0; +h.OF=function(a,c){h.Sh();a.changedTouches&&1!=a.changedTouches.length||(h.Kp=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&oa(c,a)},h.$B))};h.Sh=function(){h.Kp&&(clearTimeout(h.Kp),h.Kp=0)};h.Touch.em=function(){h.Touch.Kn=null};h.Touch.Nu=function(a){return!h.Touch.HF(a)||h.Touch.ID(a)}; +h.Touch.sp=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.ID=function(a){var c=h.Touch.sp(a);return void 0!==h.Touch.Kn&&null!==h.Touch.Kn?h.Touch.Kn==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(h.Touch.Kn=c,!0):!1}; +h.Touch.TG=function(a){if(h.g.fb.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};h.Touch.HF=function(a){return h.g.fb.startsWith(a.type,"touch")||h.g.fb.startsWith(a.type,"mouse")||h.g.fb.startsWith(a.type,"pointer")};h.Touch.Jp=function(a){return h.g.fb.startsWith(a.type,"touch")||h.g.fb.startsWith(a.type,"pointer")}; +h.Touch.$G=function(a){var c=[];if(a.changedTouches)for(var d=0;d=d+this.Eh&&(e+=f);pa(this,xa(this,e));va(this);a.stopPropagation();a.preventDefault()}}; +b.tG=function(a){Aa(this.s);qa();h.g.mj(a)?a.stopPropagation():(this.bH=this.Km,Ca(this.s),this.eA=this.ej?a.clientX:a.clientY,h.Ua.Zh=h.ma(document,"mouseup",this,this.yG),h.Ua.Yh=h.ma(document,"mousemove",this,this.uG),a.stopPropagation(),a.preventDefault())};b.uG=function(a){pa(this,xa(this,this.bH+((this.ej?a.clientX:a.clientY)-this.eA)));va(this)};b.yG=function(){Da(this.s);h.Touch.em();qa()};function qa(){h.oc(!0);h.Ua.Zh&&(h.$a(h.Ua.Zh),h.Ua.Zh=null);h.Ua.Yh&&(h.$a(h.Ua.Yh),h.Ua.Yh=null)} +function xa(a,c){return c=0>=c||isNaN(c)||a.Peh.H.vC&&h.H.Ca()}else h.H.Tp!=h.H.hb&&(clearTimeout(h.H.zn),h.H.Dt=a.pageX,h.H.Et=a.pageY,h.H.zn=setTimeout(h.H.XG,h.H.GB))};h.H.Ca=function(){h.H.visible&&(h.H.visible=!1,h.H.Fa&&(h.H.Fa.style.display="none"));h.H.zn&&clearTimeout(h.H.zn)};h.H.block=function(){h.H.Ca();h.H.rk=!0};h.H.pH=function(){h.H.rk=!1}; +h.H.XG=function(){if(!h.H.rk&&(h.H.Tp=h.H.hb,h.H.Fa)){h.H.Fa.innerHTML="";for(var a=h.H.hb.sf;"function"==typeof a;)a=a();a=h.g.fb.wA(a,h.H.UB);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=h.H.Fa.offsetHeight+2*h.H.$v);a?e=Math.max(h.H.Vq-window.scrollX,e):e+h.H.Fa.offsetWidth>c+window.scrollX-2*h.H.Vq&&(e=c-h.H.Fa.offsetWidth-2*h.H.Vq);h.H.Fa.style.top=f+"px";h.H.Fa.style.left=e+"px"}};h.Bw=function(a){this.km=a;this.Oa()};b=h.Bw.prototype;b.tb=null;b.df=null;b.km=null;b.Oa=function(){this.tb||(this.tb=h.g.o.L("svg",{xmlns:h.g.o.Ql,"xmlns:html":h.g.o.zi,"xmlns:xlink":h.g.o.Mi,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.km.appendChild(this.tb))};b.Mj=function(a,c){a=a.toFixed(0);c=c.toFixed(0);this.tb.style.display="block";h.g.o.vn(this.tb,"translate3d("+a+"px, "+c+"px, 0px)")};b.bt=function(){return h.g.He(this.tb)}; +b.Oo=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var c=this.tb.childNodes[0],d=this.tb.childNodes[1];if(!(c&&d&&h.g.o.Ay(c,"blocklyBlockCanvas")&&h.g.o.Ay(d,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.Zk?h.g.o.gj(c,this.Zk):a.insertBefore(c,a.firstChild);h.g.o.gj(d,c);this.tb.style.display="none";if(this.tb.childNodes.length)throw Error("Drag surface was not cleared.");h.g.o.vn(this.tb, +"");this.Zk=null};h.J=Object.create(null);h.sa=function(a,c){this.B=a;this.type=c};h.sa.ao=0;h.sa.hw=1;h.sa.kw=2;h.sa.jw=3;h.sa.fw=4;h.sa.gw=5;h.sa.iw=6;b=h.sa.prototype;b.ca=null;b.Ze=null;b.pf=null;b.Wb=0;b.ab=0; +b.$e=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=z(c),g=c.pf;c.pf=null;if(f.cb)g=h.R.qh(f),f.I(),f=null;else if(c.type==h.Wa){if(!f.M)throw Error("Orphan block does not have an output connection.");var k=h.sa.Uy(e,f);k&&(f.M.connect(k),f=null)}else if(c.type==h.jb){if(!f.Z)throw Error("Orphan block does not have a previous connection.");for(k=e;k.X;){var l=q(k);if(l&&!l.cb)k=l;else{Ea(f.Z,k.X)&&(k.X.connect(f.Z),f=null);break}}}if(f&&(c.disconnect(), +h.i.Dc)){var m=h.i.Zb();setTimeout(function(){f.v&&!f.getParent()&&(h.i.$(m),f.M?f.M.Pp(c):f.Z&&f.Z.Pp(c),h.i.$(!1))},h.Yn)}c.pf=g}var n;h.i.isEnabled()&&(n=new h.i.wl(e));h.sa.TD(c,a);e.cl(d);n&&(n.Aj(),h.i.Ka(n))};b.I=function(){if(this.isConnected()){this.pf=null;var a=z(this);a.cb?a.I():A(a)}};function E(a){return a.type==h.Wa||a.type==h.jb}b.isConnected=function(){return!!this.ca}; +function Fa(a,c){if(!c)return h.sa.jw;if(E(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?h.sa.hw:c.type!=h.fk[a.type]?h.sa.kw:d&&e&&d.v!==e.v?h.sa.gw:Ea(a,c)?d.cb&&!e.cb?h.sa.iw:h.sa.ao:h.sa.fw} +function Ga(a,c){switch(Fa(a,c)){case h.sa.ao:break;case h.sa.hw:throw Error("Attempted to connect a block to itself.");case h.sa.gw:throw Error("Blocks not on same workspace.");case h.sa.kw:throw Error("Attempt to connect incompatible types.");case h.sa.jw:throw Error("Target connection is null.");case h.sa.fw:throw Error("Connection checks failed. "+(a+" expected "+a.Ze+", found "+c.Ze));case h.sa.iw:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.Cp=function(a){if(a.B.Mh()||Fa(this,a)!=h.sa.ao)return!1;switch(a.type){case h.Ue:return this.ca||-1!=h.wm.indexOf(a)?a=!1:a.ca?(a=z(a),a=a.Mh()?!(a.Z&&z(a.Z)):!1):a=!0,a;case h.Te:if(a.isConnected()&&!z(a).Mh()||this.isConnected())return!1;break;case h.Wa:if(a.isConnected()&&!z(a).kd()&&!z(a).cb)return!1;break;case h.jb:if(a.isConnected()&&!this.B.X&&!z(a).cb&&z(a).X)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=h.wm.indexOf(a)?!1:!0};b.Pp=function(){}; +b.connect=function(a){if(this.ca!=a){Ga(this,a);var c=h.i.Zb();c||h.i.$(!0);E(this)?this.$e(a):a.$e(this);c||h.i.$(!1)}};h.sa.TD=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ca=c;c.ca=a};h.sa.YG=function(a,c){for(var d=!1,e=0;ed)){var e=Ia(c,a.ya());a.M?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.Z&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=h.g.o.L("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},x(c));h.mb.ex(a,new Date,d)}};h.mb.ex=function(a,c,d){var e=(new Date-c)/150;1a.v.scale)){var c=H(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);h.mb.zx(a.ya(),c,new Date)}};h.mb.zx=function(a,c,d){var e=(new Date-d)/200;1a-h.eB)}if(a.Ac||a.Db)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Ac||!a.Db);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function La(a){a.Db&&(h.g.o.removeNode(h.sa.Jy),delete h.sa.Jy);if(a.ot){var c=a.Db;c.type!=h.Wa||c.isConnected()?Ma(a.Jk,!1):a.Jk.uF(c,!1);a.Jk=null;a.ot=!1}else if(a.pj)if(a.pj){c=a.pj;var d=c.B,e=d.X,f=d.Z,g=d.M;g=c.type==h.Wa&&!(g&&g.ca);!(c!=e||f&&f.ca)||g?A(z(c),!1):c.type==h.jb&&c!=e?(e=c.ca,A(e.B,!1),f=f?f.ca:null,A(d,!0),f&&f.connect(e)):A(d,!0);if(c.ca)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.pj=null;d.ya().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +h.to.prototype.Dk=function(){var a=[];this.Bk&&a.push(this.Bk);this.nj&&a.push(this.nj);return a};h.ri=function(a,c){this.Eb=a;this.s=c;this.Mf=new h.to(this.Eb);this.Xi=null;this.gg=!1;this.eg=this.Eb.Qa();this.cp=h.ri.zF(a)};h.ri.prototype.I=function(){this.qc=this.s=this.Eb=null;this.cp.length=0;this.Mf&&(this.Mf.I(),this.Mf=null)};h.ri.zF=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Na(e);for(var f=0;fc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.jq.splice(c,1);this.jc.unsubscribe(this.Hc);this.options.Nb||(this.jc.I(),this.jc=null)}};h.Ib.mw=3;b=h.Ib.prototype; +b.dg=function(a,c){a=a.Qa();c=c.Qa();return a.y+h.Ib.prototype.dg.offset*a.x-(c.y+h.Ib.prototype.dg.offset*c.x)};function Za(a,c){if(!h.g.Ko(a.ol,c))throw Error("Block not present in workspace's list of top-most blocks.");}function D(a,c){var d=[].concat(a.ol);c&&1g)return!1;d+=c[e]}return d>$a(a)?!1:!0} +function bb(a){return Infinity!=a.options.Ot||!!a.options.Pt}b.$u=function(a){var c=a?this.on:this.Nj,d=a?this.Nj:this.on,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.Dc=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{h.i.Dc=!0}}};function cb(a,c){a.zd.push(c)}function db(a,c){h.g.Ko(a.zd,c)}function r(a,c){return a.Rr[c]||null}h.Ib.Wl=Object.create(null);h.Ib.Ws=function(a){return h.Ib.Wl[a]||null}; +h.Ib.getAll=function(){var a=[],c;for(c in h.Ib.Wl)a.push(h.Ib.Wl[c]);return a};h.oa=function(a,c,d,e,f,g){this.s=a;this.af=c;this.$z=d;d=h.oa.KA;this.s.G&&(d=-d);this.pD=h.g.Ha.nd(d);a.Zg.appendChild(this.mm(c,!(!f||!g)));this.ec=e;this.xu&&eb(this);f&&g||(c=this.af.getBBox(),f=c.width+2*h.oa.cd,g=c.height+2*h.oa.cd);this.un(f,g);eb(this);fb(this);this.xu=!0;a.options.readOnly||(h.ma(this.bm,"mousedown",this,this.xD),this.Zf&&h.ma(this.Zf,"mousedown",this,this.LG))};h.oa.cd=6;h.oa.LA=5;h.oa.KA=20;h.oa.mv=4;h.oa.IA=8;h.oa.Zh=null;h.oa.Yh=null;h.oa.prototype.zu=null; +h.oa.Zu=function(){h.oa.Zh&&(h.$a(h.oa.Zh),h.oa.Zh=null);h.oa.Yh&&(h.$a(h.oa.Yh),h.oa.Yh=null)};h.oa.yD=function(){h.Touch.em();h.oa.Zu()};b=h.oa.prototype;b.xu=!1;b.ec=null;b.Sg=0;b.di=0;b.rb=0;b.Wc=0;b.Or=!0; +b.mm=function(a,c){this.ae=h.g.o.L("g",{},null);var d={filter:"url(#"+this.s.options.Ix+")"};h.g.userAgent.RB&&(d={});d=h.g.o.L("g",d,this.ae);this.Vr=h.g.o.L("path",{},d);this.bm=h.g.o.L("rect",{"class":"blocklyDraggable",x:0,y:0,rx:h.oa.cd,ry:h.oa.cd},d);c?(this.Zf=h.g.o.L("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.ae),c=2*h.oa.cd,h.g.o.L("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.Zf),h.g.o.L("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.Zf),h.g.o.L("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.Zf)):this.Zf=null;this.ae.appendChild(a);return this.ae};b.ya=function(){return this.ae};function gb(a,c){a.ae.dataset&&(a.ae.dataset.blockId=c)}b.xD=function(a){var c=this.s.Ch(a);if(c){if(c.dj)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.oe||(c.oe=this);c.nf=a}};b.yn=function(){};b.je=function(){return!1}; +b.LG=function(a){hb(this);h.oa.Zu();h.g.mj(a)||(this.s.Qu(a,new h.g.K(this.s.G?-this.rb:this.rb,this.Wc)),h.oa.Zh=h.ma(document,"mouseup",this,h.oa.yD),h.oa.Yh=h.ma(document,"mousemove",this,this.MG),h.oc());a.stopPropagation()};b.MG=function(a){this.Or=!1;var c=this.s;a=h.g.fn(a,x(c),Ba(c));a.x/=c.scale;a.y/=c.scale;c=h.g.K.sum(c.Fx,a);this.un(this.s.G?-c.x:c.x,c.y);this.s.G&&eb(this)};function hb(a){var c=a.ae.parentNode;return c.lastChild!==a.ae?(c.appendChild(a.ae),!0):!1} +function ib(a,c,d){var e=a.s.G?a.ec.x-c.x-a.rb:c.x+a.ec.x;c=c.y+a.ec.y;return Math.max(0,Math.min(1,(Math.min(e+a.rb,d.dc+d.Bb)-Math.max(e,d.dc))*(Math.min(c+a.Wc,d.lc+d.Pb)-Math.max(c,d.lc))/(a.rb*a.Wc)))}function eb(a){var c=a.ec.x;c=a.s.G?c-(a.Sg+a.rb):c+a.Sg;a.moveTo(c,a.di+a.ec.y)}b.moveTo=function(a,c){this.ae.setAttribute("transform","translate("+a+","+c+")")};b.Vs=function(){return new h.g.Ve(this.rb,this.Wc)}; +b.un=function(a,c){var d=2*h.oa.cd;a=Math.max(a,d+45);c=Math.max(c,d+20);this.rb=a;this.Wc=c;this.bm.setAttribute("width",a);this.bm.setAttribute("height",c);this.Zf&&(this.s.G?this.Zf.setAttribute("transform","translate("+2*h.oa.cd+","+(c-d)+") scale(-1 1)"):this.Zf.setAttribute("transform","translate("+(a-d)+","+(c-d)+")"));if(this.Or){a=this.s.Uc();a.dc/=this.s.scale;a.Bb/=this.s.scale;a.lc/=this.s.scale;a.Pb/=this.s.scale;c=-this.rb/4;if(!(this.rb>a.Bb)){if(this.s.G){d=this.ec.x-c;var e=d-this.rb; +var f=a.dc+a.Bb,g=a.dc+h.Ua.Zc/this.s.scale}else e=c+this.ec.x,d=e+this.rb,g=a.dc,f=a.dc+a.Bb-h.Ua.Zc/this.s.scale;this.s.G?ef&&(c=-(f-this.ec.x)):ef&&(c=f-this.ec.x-this.rb)}e=c;c=-this.Wc/4;if(!(this.Wc>a.Pb)){d=this.ec.y+c;f=d+this.Wc;g=a.lc;var k=a.lc+a.Pb-h.Ua.Zc/this.s.scale,l=this.ec.y;dk&&(c=k-l-this.Wc)}g=c;f=this.$z.getBBox();c={x:e,y:-this.Wc-h.wa.Yq};d={x:-this.rb-30,y:g};g={x:f.width,y:g};k={x:e,y:f.height};e=f.widthg&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),t=Math.cos(m),u=a.Vs();m=(u.width+u.height)/h.oa.LA;m=Math.min(m,u.width,u.height)/4;u=1-h.oa.IA/k;f=d+u*f;g=e+u*g;u=d+m*t;var w=e+m*n;d-=m*t;e-=m*n;n=l+a.pD;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/h.oa.mv;k=Math.cos(n)*k/h.oa.mv;c.push("M"+u+","+ +w);c.push("C"+(u+k)+","+(w+l)+" "+f+","+g+" "+f+","+g);c.push("C"+f+","+g+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.Vr.setAttribute("d",c.join(" "))}b.Fc=function(a){this.bm.setAttribute("fill",a);this.Vr.setAttribute("fill",a)};b.I=function(){h.oa.Zu();h.g.o.removeNode(this.ae);this.$z=this.af=this.s=this.Zf=this.bm=this.Vr=this.ae=null};b.St=function(a,c){a?a.Mj(c.x,c.y):this.moveTo(c.x,c.y);this.Sg=this.s.G?this.ec.x-c.x-this.rb:c.x-this.ec.x;this.di=c.y-this.ec.y;fb(this)}; +b.Qa=function(){return new h.g.K(this.ec.x+this.Sg,this.ec.y+this.di)};h.i.jg=function(a){this.Gf=a.id;this.tc=a.v.id;this.group=h.i.Zb();this.Dc=h.i.Dc};h.g.object.W(h.i.jg,h.i.Abstract);h.i.jg.prototype.Za=function(){var a=h.i.jg.w.Za.call(this);this.Gf&&(a.commentId=this.Gf);return a};h.i.jg.prototype.va=function(a){h.i.jg.w.va.call(this,a);this.Gf=a.commentId};h.i.Xj=function(a,c,d){a&&(h.i.Xj.w.constructor.call(this,a),this.mz=c,this.Op=d)};h.g.object.W(h.i.Xj,h.i.jg);b=h.i.Xj.prototype;b.type=h.i.wv; +b.Za=function(){var a=h.i.Xj.w.Za.call(this);a.newContents=this.Op;return a};b.va=function(a){h.i.Xj.w.va.call(this,a);this.Op=a.newValue};b.Pk=function(){return this.mz==this.Op};b.run=function(a){var c;(c=v(this).So[this.Gf]||null)?c.qM(a?this.Op:this.mz):console.warn("Can't change non-existent comment: "+this.Gf)};h.i.kg=function(a){a&&(h.i.kg.w.constructor.call(this,a),this.xml=a.Vu())};h.g.object.W(h.i.kg,h.i.jg);h.i.kg.prototype.type=h.i.bo; +h.i.kg.prototype.Za=function(){var a=h.i.kg.w.Za.call(this);a.xml=h.R.Md(this.xml);return a};h.i.kg.prototype.va=function(a){h.i.kg.w.va.call(this,a);this.xml=h.R.li(a.xml)};h.i.kg.prototype.run=function(a){h.i.zv(this,a)};h.i.zv=function(a,c){var d=v(a);c?(c=h.g.xml.createElement("xml"),c.appendChild(a.xml),h.R.xh(c,d)):(d=d.So[a.Gf]||null)?d.I(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.Gf)};h.i.lg=function(a){a&&(h.i.lg.w.constructor.call(this,a),this.xml=a.Vu())}; +h.g.object.W(h.i.lg,h.i.jg);h.i.lg.prototype.type=h.i.xv;h.i.lg.prototype.Za=function(){return h.i.lg.w.Za.call(this)};h.i.lg.prototype.va=function(a){h.i.lg.w.va.call(this,a)};h.i.lg.prototype.run=function(a){h.i.zv(this,!a)};h.i.ti=function(a){a&&(h.i.ti.w.constructor.call(this,a),this.gs=a,this.$t=a.uy(),this.sj=null)};h.g.object.W(h.i.ti,h.i.jg);b=h.i.ti.prototype; +b.Aj=function(){if(!this.gs)throw Error("Tried to record the new position of a comment on the same event twice.");this.sj=this.gs.uy();this.gs=null};b.type=h.i.co;b.Za=function(){var a=h.i.ti.w.Za.call(this);this.sj&&(a.newCoordinate=Math.round(this.sj.x)+","+Math.round(this.sj.y));return a};b.va=function(a){h.i.ti.w.va.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.sj=new h.g.K(Number(a[0]),Number(a[1])))};b.Pk=function(){return h.g.K.Ee(this.$t,this.sj)}; +b.run=function(a){var c;if(c=v(this).So[this.Gf]||null){a=a?this.sj:this.$t;var d=c.uy();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.Gf)};h.xl=function(a,c){this.nc=a;this.s=c;this.Xi=null;this.tq=!1;this.eg=this.nc.Qa();this.$i=h.g.hj()&&c.$d?c.$d:null};h.xl.prototype.I=function(){this.$i=this.s=this.nc=null};function jb(a,c,d){d=a.Wk(d);d=h.g.K.sum(a.eg,d);a.nc.St(a.$i,d);a.nc.je()&&(a.Xi=Qa(a.s,c),a.tq=a.Xi!=h.Cv,c=a.s.ad,a.tq?(Ra(a.nc,!0),a.Xi==h.Iq&&c&&Sa(c,!0)):(Ra(a.nc,!1),c&&Sa(c,!1)))} +function kb(a,c,d){jb(a,c,d);c=a.Wk(d);c=h.g.K.sum(a.eg,c);a.nc.moveTo(c.x,c.y);c=a.s.ad;a.tq?(c&&setTimeout(c.close.bind(c),100),a.Am(),a.nc.I(!1,!0)):c&&c.close();a.tq||(a.$i&&a.$i.Oo(a.s.Zg),a.nc.Cj&&a.nc.Cj(!1),a.Am());a.s.Gc(!0);a.s.ra&&h.g.o.Ec(a.s.ra.vc,a.nc.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.i.$(!1)}h.xl.prototype.Am=function(){if(this.nc.Qy){var a=new h.i.ti(this.nc);a.$t=this.eg;a.Aj();h.i.Ka(a)}}; +h.xl.prototype.Wk=function(a){a=new h.g.K(a.x/this.s.scale,a.y/this.s.scale);this.s.lj&&a.scale(1/this.s.options.Nb.scale);return a};h.xl.prototype.Ut=function(){this.nc.moveTo(0,0);this.$i.Mj(this.eg.x,this.eg.y);ca(this.$i,this.nc.ya())};h.Xl=function(a){this.s=a;this.gA=new h.g.K(a.scrollX,a.scrollY)};h.Xl.prototype.I=function(){this.s=null};h.Xl.prototype.Qu=function(){h.selected&&lb(h.selected);Ca(this.s)};h.Xl.prototype.yh=function(a){a=h.g.K.sum(this.gA,a);this.s.scroll(a.x,a.y)};h.no=function(a){h.no.w.constructor.call(this,a.Ek());this.pc=a.pc;this.kf=a.kf};h.g.object.W(h.no,h.Xl);h.no.prototype.yh=function(a){a=h.g.K.sum(this.gA,a);this.kf?this.pc.set(-a.x):this.pc.set(-a.y)};h.Zj=function(a,c){this.qc=this.rc=this.Ej=this.Fj=this.oe=this.vd=this.hz=null;this.ls=c;this.Pm=this.jj=this.Qm=this.bj=!1;this.nf=a;this.P=this.oi=this.Ye=this.zg=this.Rp=this.Qp=null;this.Ep=this.dj=this.Nw=!1;this.Ey=!h.nB};b=h.Zj.prototype;b.I=function(){h.Touch.em();h.H.pH();this.ls.yc=null;this.Qp&&h.$a(this.Qp);this.Rp&&h.$a(this.Rp);this.P=this.qc=this.rc=this.Ej=this.Fj=null;this.Ye&&(this.Ye.I(),this.Ye=null);this.oi&&(this.oi.I(),this.oi=null);this.zg&&(this.zg.I(),this.zg=null)}; +function mb(a,c){a.vd=h.g.K.um(new h.g.K(c.clientX,c.clientY),a.hz);if(a.bj)var d=!1;else a.bj=h.g.K.QF(a.vd)>(a.P?h.vB:h.mB),d=a.bj;if(d){if(a.Nw)throw Error("updateIsDragging_ should only be called once per gesture.");a.Nw=!0;if(a.oe){a.Pm=!0;a.zg=new h.xl(a.oe,a.qc);d=a.zg;h.i.Zb()||h.i.$(!0);d.s.Gc(!1);d.nc.Or=!1;d.$i&&d.Ut();d.nc.Cj&&d.nc.Cj(!0);var e=d.s.ra;e&&h.g.o.Cb(e.vc,d.nc.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");jb(a.zg,a.nf,a.vd);d=!0}else d=!1;if(!d){if(a.rc)if(a.P?(a.P.Py(a.rc)? +((d=!nb(a.P))||(d=a.vd,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.P.xE,d=d-e||d<-180+e||d>180-e?!0:!1),d?(a.qc=a.P.Ob,ob(a.qc),h.i.Zb()||h.i.$(!0),a.Ej=null,a.rc=pb(a.P,a.rc),a.rc.select(),d=!0):d=!1):d=!1,a.jj=d):a.rc.kd()&&(a.jj=!0),a.jj){a.Ye=new h.ri(a.rc,a.qc);d=a.Ye;e=a.vd;var f=a.Ey;h.i.Zb()||h.i.$(!0);d.s.lj&&Va(d.Eb);h.g.o.Dn();d.s.Gc(!1);h.mb.zs();if(d.Eb.getParent()||f&&d.Eb.X&&z(d.Eb.X))A(d.Eb,f),e=d.Wk(e),e=h.g.K.sum(d.eg,e),d.Eb.translate(e.x,e.y),h.mb.rE(d.Eb);d.Eb.Cj(!0);d.Eb.Ut(); +(e=d.s.ra)&&h.g.o.Cb(e.vc,d.Eb.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");Oa(a.Ye,a.nf,a.vd);d=!0}else d=!1;else d=!1;if(d=!d)if(a.P)d=nb(a.P);else if(d=a.qc)d=a.qc,d=d.options.Bc&&d.options.Bc.yh;d&&(a.oi=a.P?new h.no(a.P):new h.Xl(a.qc),a.Qm=!0,a.oi.Qu())}h.Sh()}a.nf=c} +b.As=function(a){h.g.Hp(a)?this.cancel():(this.dj=!0,h.mb.zs(),ob(this.qc),this.qc.lj&&this.qc.resize(),Aa(this.qc),this.nf=a,h.oc(!!this.P),h.H.block(),this.rc&&(!this.rc.$b&&a.shiftKey?(h.navigation.Ns(),J(this.ls.Xa,h.navigation.et(this.rc))):this.rc.select()),h.g.mj(a)?oa(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||h.OF(a,this),this.hz=new h.g.K(a.clientX,a.clientY),this.Ey=a.altKey||a.ctrlKey||a.metaKey,this.qk(a)))}; +b.qk=function(a){this.Qp=h.ma(document,"mousemove",null,this.Jm.bind(this));this.Rp=h.ma(document,"mouseup",null,this.tp.bind(this));a.preventDefault();a.stopPropagation()};b.Jm=function(a){mb(this,a);this.Qm?this.oi.yh(this.vd):this.jj?Oa(this.Ye,this.nf,this.vd):this.Pm&&jb(this.zg,this.nf,this.vd);a.preventDefault();a.stopPropagation()}; +b.tp=function(a){mb(this,a);h.Sh();if(this.Ep)console.log("Trying to end a gesture recursively.");else{this.Ep=!0;if(this.Pm)kb(this.zg,a,this.vd);else if(this.jj)Ta(this.Ye,a,this.vd);else if(this.Qm){var c=this.oi;c.yh(this.vd);Da(c.s)}else if(this.oe&&!this.bj)this.oe.UG&&this.oe.UG(),this.oe.select&&this.oe.select();else if(qb(this))this.Fj.qf(),rb(this);else if(this.Ej&&!this.bj&&!qb(this))this.P&&this.P.pk?this.rc.isEnabled()&&(h.i.Zb()||h.i.$(!0),Wa(pb(this.P,this.rc))):h.i.Ka(new h.i.ud(this.Ej, +"click",void 0,void 0)),rb(this),h.i.$(!1);else if(!(this.Ej||this.oe||this.Fj||this.bj))if(c=this.ls,a.shiftKey){h.navigation.Ns();var d=h.g.QG(c,new h.g.K(a.clientX,a.clientY));d=h.F.pm(c,d);J(c.Xa,d)}else h.selected&&lb(h.selected);a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.Ep){h.Sh();if(this.Pm)kb(this.zg,this.nf,this.vd);else if(this.jj)Ta(this.Ye,this.nf,this.vd);else if(this.Qm){var a=this.oi;a.yh(this.vd);Da(a.s)}this.I()}}; +function oa(a,c){a.rc?(rb(a),h.oc(a.P),a.rc.yn(c)):a.oe?a.oe.yn(c):a.qc&&!a.P&&(h.oc(),a.qc.yn(c));c.preventDefault();c.stopPropagation();a.I()}function sb(a,c,d){if(a.dj)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.qc||(a.qc=d);a.nf=c;a.As(c);h.Le&&h.navigation.Gb(h.navigation.Pl)}function tb(a,c,d){if(a.dj)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.P||(a.P=d);sb(a,c,d.Ek())} +function rb(a){a.rc&&!a.P&&Va(a.rc)}function ub(a,c){a.Ej||a.oe||(a.Ej=c,c.$b&&c!=I(c)?vb(a,I(c)):vb(a,c))}function vb(a,c){c.cb?vb(a,c.getParent()):a.rc=c}function qb(a){if(a.Fj){var c=a.Fj;c=!!c.B&&c.B.jd()&&!!c.qf&&"function"===typeof c.qf}else c=!1;return c&&!a.bj&&(!a.P||!a.P.pk)}b.gc=function(){return this.Qm||this.jj||this.Pm};b.Dk=function(){return this.Ye?this.Ye.Dk():[]};h.Zj.rt=function(){for(var a=h.Ib.getAll(),c=0,d;d=a[c];c++)if(d.yc)return!0;return!1};h.Na=function(a,c,d){this.mA=this.Oj=this.cc=null;this.bc=new h.g.Ve(0,0);this.Sc=null;d&&this.Kd(d);this.setValue(a);c&&(this.Oj=c)};h.Na.tv=16;h.Na.sw=12.5;h.Na.Yl=10;h.Na.FL=10;h.Na.wi=h.Na.Yl/2;b=h.Na.prototype;b.name=void 0;b.ez=50;b.B=null;b.Sf=!0;b.ni=!0;b.Po=null;h.Na.Yv="\u00a0";b=h.Na.prototype;b.ng=!0;b.Hi=!1;b.Kd=function(a){var c=a.tooltip;"string"==typeof c&&(c=h.g.le(a.tooltip));c&&this.Ra(c)};b.Lu=function(a){if(this.B)throw Error("Field already bound to a block.");this.B=a}; +b.S=function(){this.gf||(this.gf=h.g.o.L("g",{},null),this.isVisible()||(this.gf.style.display="none"),this.B.ya().appendChild(this.gf),this.Jh(),this.ah(),this.Ra(this.mA),h.H.qk(this.Po||this.ya()),this.gz=h.ma(this.Po||this.ya(),"mousedown",this,this.Xh),this.fj())};b.Jh=function(){this.bc.height=Math.max(this.bc.height,h.Na.tv);this.bc.width=Math.max(this.bc.width,h.Na.Yl);this.Oi=h.g.o.L("rect",{rx:4,ry:4,x:0,y:0,height:this.bc.height,width:this.bc.width},this.gf);wb(this)};b.fj=function(){}; +function wb(a){a.ic=h.g.o.L("text",{"class":"blocklyText",y:h.Na.sw,x:a.Oi?h.Na.wi:0},a.gf);a.Kj=document.createTextNode("");a.ic.appendChild(a.Kj)}b.Cm=function(a){this.setValue(a.textContent)};b.kA=function(a){a.textContent=this.getValue();return a};b.I=function(){h.D.Hk(this);h.aa.Hk(this);this.gz&&h.$a(this.gz);h.g.o.removeNode(this.gf)}; +b.ah=function(){var a=this.Po||this.ya();this.ng&&a&&(this.B.jd()?(h.g.o.Cb(a,"blocklyEditableText"),h.g.o.Ec(a,"blocklyNonEditableText"),a.style.cursor=this.Hq):(h.g.o.Cb(a,"blocklyNonEditableText"),h.g.o.Ec(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.ni};b.Vb=function(a){if(this.ni!=a){this.ni=a;var c=this.ya();c&&(c.style.display=a?"block":"none")}};function xb(a,c){a.Oj=c}b.sy=function(){return this.Oj};b.ya=function(){return this.gf};b.Qe=function(){}; +b.Yf=function(){if(this.Kj){this.Kj.nodeValue=yb(this);var a=h.g.o.ct(this.ic);this.Oi&&(a+=h.Na.Yl,this.Oi.setAttribute("width",a));this.bc.width=a}};b.Lg=function(){if(!this.isVisible())return new h.g.Ve(0,0);this.Sf?(this.Yf(),this.Sf=!1):this.ni&&0==this.bc.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.Yf());return this.bc}; +function yb(a){var c=a.Tb();if(!c)return h.Na.Yv;c.length>a.ez&&(c=c.substring(0,a.ez-2)+"\u2026");c=c.replace(/\s/g,h.Na.Yv);a.B&&a.B.G&&(c+="\u200f");return c}b.Tb=function(){if(this.dt){var a=this.dt.call(this);if(null!==a)return String(a)}return String(this.getValue())};b.dl=function(){throw Error("setText method is deprecated");};b.Zm=function(){this.Sf=!0};function zb(a){a.Sf=!0;a.B&&a.B.ba&&(a.B.za(),a.B.Kb())} +b.setValue=function(a){if(null!==a){var c=this.wh(a);a=Ab(this,a,c);if(!(a instanceof Error)){if(c=this.sy())if(c=c.call(this,a),a=Ab(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&h.i.isEnabled()&&h.i.Ka(new h.i.hg(this.B,"field",this.name||null,c,a)),this.Yi(a),this.Sf&&zb(this))}}};function Ab(a,c,d){if(null===d)return a.Ex(),a.Sf&&zb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.cc};b.wh=function(a){return null===a||void 0===a?null:a}; +b.Yi=function(a){this.cc=a;this.Sf=!0};b.Ex=function(){};b.Xh=function(a){if(this.B&&this.B.v&&(a=this.B.v.Ch(a))){if(a.dj)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.Fj||(a.Fj=this)}};b.Ra=function(a){var c=this.Po||this.ya();c?c.sf=a||""===a?a:this.B:this.mA=a};b.pn=function(){return!1};b.Pf=function(){for(var a=null,c=this.B,d=c.T,e=0;ec||c>a.Pa.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new h.Fd(d));d.Lu(a.B);a.B.ba&&d.S();d.name=e;d.qu&&(c=Bb(a,c,d.qu));a.Pa.splice(c,0,d);++c;d.Tu&&(c=Bb(a,c,d.Tu));a.B.ba&&(a.B.za(),a.B.Kb());return c}function Cb(a,c){for(var d=0,e;e=a.Pa[d];d++)if(e.name===c){e.I();a.Pa.splice(d,1);a.B.ba&&(a.B.za(),a.B.Kb());return}throw Error('Field "%s" not found.',c);}b.isVisible=function(){return this.ni}; +b.Vb=function(a){var c=[];if(this.ni==a)return c;for(var d=(this.ni=a)?"block":"none",e=0,f;f=this.Pa[e];e++)f.Vb(a);if(this.connection){if(a)c=Db(this.connection);else if(e=this.connection,Eb(e,!0),e.ca)for(e=p(z(e),!1),f=0;fa&&0<=c&&256>c&&0<=d&&256>d)?h.g.Lb.Cu(a,c,d):null}; +h.g.Lb.Cu=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};h.g.Lb.Fy=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +h.g.Lb.vF=function(a){var c=h.HB,d=255*h.IB,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.Lb.Cu(Math.floor(e),Math.floor(f),Math.floor(g))}; +h.g.Lb.Qr=function(a,c,d){a=h.g.Lb.Fy(h.g.Lb.parse(a));c=h.g.Lb.Fy(h.g.Lb.parse(c));return h.g.Lb.Cu(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.Lb.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.Zn=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&&!r(a,d)?d:h.g.Jg();a.Rr[this.id]=this;this.Z=this.X=this.M=null;this.T=[];this.Pg=void 0;this.disabled=!1;this.sf="";this.contextMenu=!0;this.Uf=null;this.Bg=[];this.Hx=this.jz=this.ps=!0;this.Cg=this.cb=!1;this.vk=null;this.Be={text:null,pu:!1,size:new h.g.Ve(160,80)};this.BA=new h.g.K(0,0);this.v=a;this.$b=a.ke;this.G=a.G; +this.Tm=!1;this.Ng=void 0;if(c){this.type=c;d=h.J[c];if(!d||"object"!=typeof d)throw TypeError("Unknown block type: "+c);h.g.object.rj(this,d)}a.ol.push(this);a.$g[this.type]||(a.$g[this.type]=[]);a.$g[this.type].push(this);"function"==typeof this.S&&this.S();this.CF=this.Pg;if(h.i.isEnabled()){(a=h.i.Zb())||h.i.$(!0);try{h.i.Ka(new h.i.$n(this))}finally{a||h.i.$(!1)}}if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=typeof a)throw Error("onchange must be a function.");this.hn&& +db(this.v,this.hn);if(this.onchange=a)this.hn=a.bind(this),cb(this.v,this.hn)}};b=h.Zn.prototype;b.data=null;b.sh="#000000";b.Xw=null;b.Yw=null; +b.I=function(a){if(this.v){this.hn&&db(this.v,this.hn);h.Le&&h.navigation.kz(this);A(this,a);h.i.isEnabled()&&h.i.Ka(new h.i.SA(this));h.i.disable();try{if(this.v){Za(this.v,this);var c=this.v;c.$g[this.type].splice(c.$g[this.type].indexOf(this),1);c.$g[this.type].length||delete c.$g[this.type];delete this.v.Rr[this.id];this.v=null}h.selected==this&&(h.selected=null);for(var d=this.Bg.length-1;0<=d;d--)this.Bg[d].I(!1);d=0;for(var e;e=this.T[d];d++)e.I();this.T.length=0;var f=this.Fe(!0);d=0;for(var g;g= +f[d];d++)g.I()}finally{h.i.enable()}}};b.fj=function(){for(var a=0,c;c=this.T[a];a++)for(var d=0,e;e=c.Pa[d];d++)e.fj&&e.fj()}; +function A(a,c){if(a.M){var d=null;a.M.isConnected()&&(d=a.M.ca,a.M.disconnect());if(d&&c){a:{c=null;for(var e=0;e=d)this.sh=h.Ky(d);else if(d=h.g.Lb.parse(c))this.sh=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);};function M(a,c){var d=a.v.rp().wD[c];if(d)a.Xw=d.colourSecondary,a.Yw=d.colourTertiary,a.Ng=d.Ng,a.Fc(d.colourPrimary);else throw Error("Invalid style name: "+c);}function y(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,g;g=e.Pa[f];f++)if(g.name==c)return g;return null} +b.ht=function(){for(var a=[],c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Pa[e];e++)f.pn()&&a.push(f.getValue());return a};b.Mg=function(){for(var a=[],c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Pa[e];e++)f.pn()&&(f=this.v.hf(f.getValue()))&&a.push(f);return a};b.pq=function(a){for(var c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Pa[e];e++)f.pn()&&a.ua()==f.getValue()&&zb(f)};b.Zp=function(a,c){for(var d=0,e;e=this.T[d];d++)for(var f=0,g;g=e.Pa[f];f++)g.pn()&&a==g.getValue()&&g.setValue(c)}; +function G(a,c){return(a=y(a,c))?a.getValue():null}function Jb(a,c,d){a=y(a,d);if(!a)throw Error('Field "'+d+'" not found.');a.setValue(c)}b.ne=function(a,c){if(a){void 0===c&&(c=null);if(!this.Z){if(this.M)throw Error("Remove output connection prior to adding previous connection.");this.Z=this.Ym(h.Ue)}this.Z.vb(c)}else if(this.Z){if(this.Z.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.Z.I();this.Z=null}}; +b.me=function(a,c){if(a)void 0===c&&(c=null),this.X||(this.X=this.Ym(h.jb)),this.X.vb(c);else if(this.X){if(this.X.isConnected())throw Error("Must disconnect next statement before removing connection.");this.X.I();this.X=null}}; +b.Ad=function(a,c){if(a){void 0===c&&(c=null);if(!this.M){if(this.Z)throw Error("Remove previous connection prior to adding output connection.");this.M=this.Ym(h.Te)}this.M.vb(c)}else if(this.M){if(this.M.isConnected())throw Error("Must disconnect output value before removing connection.");this.M.I();this.M=null}};b.$c=function(a){this.Pg!=a&&(h.i.Ka(new h.i.hg(this,"inline",null,this.Pg,a)),this.Pg=a)}; +function Ha(a){if(void 0!=a.Pg)return a.Pg;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function N(a,c){return a.$l(h.Wa,c)} +function Lb(a,c){return a.$l(h.jb,c)}function O(a,c){return a.$l(h.mg,c||"")} +function P(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.Ng&&(a.Ng=c.style.Ng,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{M(a,e)}catch(F){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.Fc(e)}catch(F){console.warn(d+ +"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){for(var f=a,g=c["args"+e]||[],k=c["lastDummyAlign"+e],l=h.g.kH(c["message"+e]),m=[],n=0,t=[],u=0;u=w||w>g.length)throw Error('Block "'+f.type+'": Message index %'+w+" out of range.");if(m[w])throw Error('Block "'+f.type+'": Message index %'+w+" duplicated.");m[w]=!0;n++;t.push(g[w-1])}else(w=w.trim())&&t.push(w)}if(n!=g.length)throw Error('Block "'+f.type+'": Message does not reference all '+ +g.length+" arg(s).");t.length&&("string"==typeof t[t.length-1]||h.g.fb.startsWith(t[t.length-1].type,"field_"))&&(u={type:"input_dummy"},k&&(u.align=k),t.push(u));k={LEFT:h.xq,RIGHT:h.tl,CENTRE:h.jv};g=[];for(u=0;u=this.T.length)throw RangeError("Input index "+a+" out of bounds.");if(c>this.T.length)throw RangeError("Reference input "+c+" out of bounds.");var d=this.T[a];this.T.splice(a,1);ac?d-1:c},a.Og)}function Sb(a,c,d){var e=a.kb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var g=a.kb[d]||null;if(g&&g.isEnabled()){Ob(a,d);break}f++;d=c.call(a,d,e)}}b.nF=function(a){(a=Pb(this,a.target))&&a.isEnabled()&&(this.kb[this.Og]||null)!==a&&(Qb(this),this.Xg(a))};b.fF=function(a){var c=Pb(this,a.target),d;if(d=c)c.isEnabled()&&(c.Xg(!0),Ub(c)),d=void 0;d&&a.preventDefault()}; +b.kF=function(){this.focus()};b.mF=function(){this.ta()&&(this.blur(),Qb(this),Ob(this,-1))};b.jt=function(a){return 0!=this.kb.length&&Vb(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};function Vb(a,c){var d=a.kb[a.Og]||null;if(d&&"function"==typeof d.jt&&d.jt(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case h.g.Ba.Kq:d&&Ub(d);break;case h.g.Ba.Tl:Tb(a);break;case h.g.Ba.zl:Rb(a);break;default:return!1}return!0};h.wo=function(a,c){h.uc.call(this);this.af=a;this.setValue(c);this.ep=!0};h.g.object.W(h.wo,h.uc);b=h.wo.prototype; +b.Oa=function(){var a=document.createElement("div");a.id=this.ua();this.hb=a;a.className="goog-menuitem goog-option "+(this.ep?"":"goog-menuitem-disabled ")+(this.$r?"goog-option-selected ":"")+(this.Rk()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.dm){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Wb(this));h.g.V.ag(a,this.Du||(this.dm?h.g.V.Fi.iC: +h.g.V.Fi.hC));h.g.V.Gb(a,h.g.V.State.Nl,this.dm&&this.$r||!1)};function Wb(a){a=a.af;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.cc=a};b.getValue=function(){return this.cc};b.ag=function(a){this.Du=a};function Xb(a,c){if(a.dm){a.$r=c;var d=a.ta();d&&a.isEnabled()&&(c?(h.g.o.Cb(d,"goog-option-selected"),h.g.V.Gb(d,h.g.V.State.Nl,!0)):(h.g.o.Ec(d,"goog-option-selected"),h.g.V.Gb(d,h.g.V.State.Nl,!1)))}} +b.Xg=function(a){var c=this.ta();c&&this.isEnabled()&&(a?h.g.o.Cb(c,"goog-menuitem-highlight"):h.g.o.Ec(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.ep};b.md=function(a){this.ep=a;(a=this.ta())&&(this.ep?h.g.o.Ec(a,"goog-menuitem-disabled"):h.g.o.Cb(a,"goog-menuitem-disabled"))};function Ub(a){a.dm&&Xb(a,!a.$r);a.Ew&&a.Ew.call(a.iD,a)}function Yb(a,c,d){a.Ew=c;a.iD=d};h.g.nq={};h.g.nq.Lg=function(a){a=a.ta();var c=h.g.style.Lg(a);c.height=a.scrollHeight;return c};h.g.nq.kD=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};h.Ea={};h.Ea.Wo=null;h.Ea.Kx=null;h.Ea.show=function(a,c,d){h.aa.show(h.Ea,d,null);if(c.length){var e=h.Ea.EG(c,d);h.Ea.Vf(e,a,d);setTimeout(function(){e.ta().focus()},1);h.Ea.Wo=null}else h.Ea.Ca()};h.Ea.EG=function(a,c){var d=new h.Ai;ea(d,c);for(var e=0,f;f=a[e];e++){var g=new h.wo(f.text);ea(g,c);d.Zl(g,d.kb.length,!0);g.md(f.enabled);f.enabled&&Yb(g,function(){h.Ea.Ca();this.yb()},f)}return d}; +h.Ea.Vf=function(a,c,d){var e=h.g.bF();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};h.Ea.$D(a);var f=h.g.nq.Lg(a);d&&h.g.nq.kD(e,c,f);h.aa.FG(e,c,f,d);a.ta().focus()};h.Ea.$D=function(a){a.za(h.aa.Fa);var c=a.ta();h.g.o.Cb(c,"blocklyContextMenu");h.ma(c,"contextmenu",null,h.g.fG);a.focus()};h.Ea.Ca=function(){h.aa.Hk(h.Ea);h.Ea.Wo=null;h.Ea.Kx&&h.$a(h.Ea.Kx)}; +h.Ea.Mo=function(a,c){return function(){h.i.disable();try{var d=h.R.Zi(c,a.v),e=a.Qa();e.x=a.G?e.x-h.td:e.x+h.td;e.y+=2*h.td;d.moveBy(e.x,e.y)}finally{h.i.enable()}h.i.isEnabled()&&!d.cb&&h.i.Ka(new h.i.$n(d));d.select()}};h.Ea.tD=function(a){var c=p(a,!1).length,d=q(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,yb:function(){h.i.$(!0);a.I(!0,!0);h.i.$(!1)}}}; +h.Ea.vD=function(a){return{enabled:!("function"==typeof a.ub?!a.ub():!a.ub),text:h.h.HELP,yb:function(){var c="function"==typeof a.ub?a.ub():a.ub;c&&window.open(c)}}};h.Ea.uD=function(a){var c=bb(a.v)?ab(a.v,h.g.Us(a,!0)):!0;return{text:h.h.DUPLICATE_BLOCK,enabled:c,yb:function(){h.Gx(a)}}};h.Ea.sD=function(a){var c={enabled:!h.g.userAgent.og};a.vk?(c.text=h.h.REMOVE_COMMENT,c.yb=function(){a.$f(null)}):(c.text=h.h.ADD_COMMENT,c.yb=function(){a.$f("")});return c}; +h.Ea.LL=function(a){return{text:h.h.OK,enabled:!0,yb:function(){h.i.$(!0);a.I(!0,!0);h.i.$(!1)}}};h.Ea.ML=function(a){return{text:h.h.uI,enabled:!0,yb:function(){h.Gx(a)}}}; +h.Ea.zM=function(a,c){if(!h.mk)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!h.g.userAgent.og};d.text=h.h.EH;d.yb=function(){var e=new h.mk(a,h.h.DL,h.mk.kB,h.mk.kB),f=ba(a).getBoundingClientRect();f=new h.g.K(c.clientX-f.left,c.clientY-f.top);var g=h.g.Gm(a.pb);f=h.g.K.um(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ba&&(e.Ke(),e.za(),e.select())};return d};h.tg=function(a,c){h.tg.w.constructor.call(this,a,c);this.Jf=a.v.Uo[c];this.px=a.v.Uo[h.fk[c]];this.vj=new h.g.K(0,0);this.Ih=!1;this.Hy=!this.Jf};h.g.object.W(h.tg,h.sa);b=h.tg.prototype;b.I=function(){h.tg.w.I.call(this);this.Ih&&Zb(this.Jf,this)};function $b(a,c){var d=a.Wb-c.Wb;a=a.ab-c.ab;return Math.sqrt(d*d+a*a)} +function ac(a,c){if(!a.B.v.gc()){var d=I(a.B);if(!d.$b){var e=!1;if(!d.kd()){d=I(c.B);if(!d.kd())return;c=a;e=!0}var f=h.selected==d;f||d.Jo();var g=c.Wb+h.td+Math.floor(Math.random()*h.Bq)-a.Wb,k=c.ab+h.td+Math.floor(Math.random()*h.Bq)-a.ab;e&&(k=-k);d.G&&(g=c.Wb-h.td-Math.floor(Math.random()*h.Bq)-a.Wb);d.moveBy(g,k);f||d.qn()}}}b.moveTo=function(a,c){this.Ih&&Zb(this.Jf,this);this.Wb=a;this.ab=c;this.Hy||bc(this.Jf,this)};b.moveBy=function(a,c){this.moveTo(this.Wb+a,this.ab+c)}; +function cc(a,c){a.moveTo(c.x+a.vj.x,c.y+a.vj.y)}function dc(a,c,d){a.vj.x=c;a.vj.y=d}function ec(a){var c=a.ca.Wb-a.Wb,d=a.ca.ab-a.ab;if(0!=c||0!=d){a=z(a);var e=a.ya();if(!e)throw Error("block is not rendered.");e=h.g.He(e);a.ya().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Ua(a,-c,-d)}} +b.closest=function(a,c){var d=this.px;if(d.fc.length){var e=this.ab,f=this.Wb;this.Wb=f+c.x;this.ab=e+c.y;var g=fc(d,this);c=null;for(var k=a,l,m=g-1;0<=m&&Math.abs(d.fc[m].ab-this.ab)<=a;)l=d.fc[m],this.Cp(l,k)&&(c=l,k=$b(l,this)),m--;for(;gc?!1:h.tg.w.Cp.call(this,a)};b.Pp=function(a){ac(this,a)};b.xs=function(a,c){h.tg.w.xs.call(this,a,c);a.ba&&a.za();c.ba&&(ma(c),c.za())}; +b.Bu=function(){var a=this.B,c=this.pf;if(a.v&&c&&h.i.Dc){h.tg.w.Bu.call(this);c=z(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Ke();c.za(!1);a.ba&&a.za()}};b.lz=function(a){return gc(this.px,this,a)};b.$e=function(a){h.tg.w.$e.call(this,a);var c=this.B;a=a.B;c.ba&&ma(c);a.ba&&ma(a);c.ba&&a.ba&&(this.type==h.jb||this.type==h.Ue?a.za():c.za())};b.sz=function(){this.isConnected()&&!Ea(this,this.ca)&&(A(E(this)?z(this):this.B),this.B.Kb())};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.Id=function(a){this.U=a};b=h.Id.prototype;b.Vw=!0;b.Eo=17;b.Yb=null;b.Kk=null;function hc(a){a.Od||(a.Od=h.g.o.L("g",{"class":"blocklyIconGroup"},null),a.U.$b&&h.g.o.Cb(a.Od,"blocklyIconGroupReadonly"),a.Es(a.Od),a.U.ya().appendChild(a.Od),h.ma(a.Od,"mouseup",a,a.qt),a.ah())}b.I=function(){h.g.o.removeNode(this.Od);this.Od=null;this.Vb(!1);this.U=null};b.ah=function(){};b.isVisible=function(){return!!this.Yb};b.qt=function(a){this.U.v.gc()||this.U.$b||h.g.mj(a)||this.Vb(!this.isVisible())}; +b.Qe=function(){this.isVisible()&&this.Yb.Fc(this.U.sh)};function Pa(a,c){a.Kk=c;a.isVisible()&&(a=a.Yb,a.ec=c,a.xu&&eb(a))}function ic(a){var c=a.U.Qa(),d=h.g.He(a.Od);c=new h.g.K(c.x+d.x+a.Eo/2,c.y+d.y+a.Eo/2);h.g.K.Ee(a.Kk,c)||Pa(a,c)};h.Cf=function(a){h.Cf.w.constructor.call(this,a);hc(this);this.kl={}};h.g.object.W(h.Cf,h.Id);h.Cf.prototype.Vw=!1;h.Cf.prototype.Es=function(a){h.g.o.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.o.L("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);h.g.o.L("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)}; +h.Cf.iH=function(a){var c=h.g.o.L("text",{"class":"blocklyText blocklyBubbleText",y:h.oa.cd},null);a=a.split("\n");for(var d=0;d=a.fc.length)return-1;for(var e=c.ab,f=d;0<=f&&a.fc[f].ab==e;){if(a.fc[f]==c)return f;f--}for(;dc.ab)e=f;else{d=f;break}}return d}function Zb(a,c){if(!c.Ih)throw Error("Connection not in database.");var d=pc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Ih=!1;a.fc.splice(d,1)} +function gc(a,c,d){function e(n){var t=g-f[n].Wb,u=k-f[n].ab;Math.sqrt(t*t+u*u)<=d&&m.push(f[n]);return uthis.mn){var d=c-this.mn;d=0Object.keys(this.Ae).length&&(this.Ae={},this.mn=0)}!this.Gp||this.gc()?h.Touch.Nu(a)&&h.Zd.w.tp.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){h.Zd.w.I.call(this);this.iu&&h.$a(this.iu)};function qc(a,c){a.Ae[h.Touch.sp(c)]=rc(a,c);var d=Object.keys(a.Ae);2==d.length&&(a.dA=h.g.K.bp(a.Ae[d[0]],a.Ae[d[1]]),a.Gp=!0,c.preventDefault())} +function rc(a,c){return a.qc?new h.g.K(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};h.Aw=function(a){this.mu=a;this.Ol=Object.create(null)};b=h.Aw.prototype;b.Ct=null;b.I=function(){this.Ol=this.mu=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(a)))if(a.yc&&a.yc.cancel(),"comment"==c.tagName.toLowerCase()){h.i.disable();try{var d=h.mk.Cm(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.R.Zi(c,a),k=a.ac.Sb;if(h.Le&&k){h.navigation.Ny(g,k.qa);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=K(a,!1);d=0;for(var t;t=n[d];d++){var u=t.Qa();if(1>=Math.abs(l-u.x)&&1>=Math.abs(m-u.y)){c=!0;break}}if(!c){var w=g.Fe(!1);d=0;for(var F;F=w[d];d++)if(F.closest(h.td,new h.g.K(l,m)).connection){c=!0;break}}c&&(l=a.G?l-h.td:l+h.td,m+=2*h.td)}while(c);g.moveBy(l,m)}}finally{h.i.enable()}h.i.isEnabled()&&!g.cb&&h.i.Ka(new h.i.$n(g));g.select()}} +function zc(a){if((a=a.ke?a.Jj:a)&&!a.yc&&a.ra&&a.ra.P){a=a.ra;var c=a.Bd.Rd;c&&c.Df&&a.P.show(c.Df)}}b.ei=function(a,c){h.lb.w.ei.call(this,a,c);zc(this)};b.Kf=function(a){h.lb.w.Kf.call(this,a);zc(this)};b.Ld=function(a,c,d){a=h.lb.w.Ld.call(this,a,c,d);zc(this);return a};function tc(a){a.ux=a.ad&&a.N.parentNode?a.ad.Em():null;a.tx=a.P?a.P.Em():a.ra?a.ra.Em():null}function Qa(a,c){return a.ux&&a.ux.contains(c.clientX,c.clientY)?h.Iq:a.tx&&a.tx.contains(c.clientX,c.clientY)?h.Dv:h.Cv} +b.Xh=function(a){var c=this.Ch(a);c&&sb(c,a,this)};b.Qu=function(a,c){a=h.g.fn(a,x(this),Ba(this));a.x/=this.scale;a.y/=this.scale;this.Fx=h.g.K.um(c,a)};b.gc=function(){return null!=this.yc&&this.yc.gc()};function Ac(a){return a.options.Bc&&a.options.Bc.scrollbars||a.options.Bc&&a.options.Bc.Rj||a.options.Bc&&a.options.Bc.yh||a.options.Hb&&a.options.Hb.controls||a.options.Hb&&a.options.Hb.Rj} +b.kd=function(){return this.options.Bc&&this.options.Bc.scrollbars||this.options.Bc&&this.options.Bc.Rj||this.options.Bc&&this.options.Bc.yh||this.options.Hb&&this.options.Hb.Rj}; +b.zG=function(a){if(h.Zj.rt())a.preventDefault(),a.stopPropagation();else{var c=this.options.Hb&&this.options.Hb.Rj,d=this.options.Bc&&this.options.Bc.Rj;if(c||d){var e=h.g.ky(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.fn(a,x(this),Ba(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=lc(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.JD=function(){this.Gc(!1);h.i.$(!0);for(var a=D(this,!0),c=0,d=0,e;e=a[d];d++)if(e.kd()){var f=e.Qa();e.moveBy(-f.x,c-f.y);kc(e);c=e.Qa().y+H(e).height+h.wa.Yq}h.i.$(!1);this.Gc(!0)}; +b.yn=function(a){function c(F){if(F.je())w=w.concat(p(F,!1));else{F=F.Ah(!1);for(var U=0;Uw.length?d():h.confirm(h.h.DELETE_ALL_BLOCKS.replace("%1",w.length),function(F){F&&d()})}};e.push(l);this.$w&&this.$w(e);h.Ea.show(a,e,this.G)}};function Aa(a){if(a.options.Nb)Aa(a.options.Nb);else{h.Xm=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.ke&&!this.lj){d=Math.pow(this.options.Hb.PG,d);var e=this.scale*d;if(this.scale!=e){e>this.options.Hb.$m?d=this.options.Hb.$m/this.scale:ethis.options.Hb.$m?a=this.options.Hb.$m:this.options.Hb.cn&&ak.sA||k.Rck.tA){l=null;g&&(l=h.i.Zb(),h.i.$(g.group));switch(g.type){case h.i.vl:case h.i.qv:var n=r(f,g.wc);n=I(n);break;case h.i.bo:case h.i.co:n=f.So[g.Gf]||null}if(n){m=lc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var t=k.lc,u=k.sA-m.height;u=Math.max(t,u);t=h.g.Ha.Ef(t,m.top,u)-m.top;u=k.dc;var w=k.tA-m.width;k.G?u=Math.min(w,u):w=Math.max(u,w);n.moveBy(h.g.Ha.Ef(u, +m.left,w)-m.left,t)}g&&(g.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&h.i.$(l))}}});h.il(f);h.aa.Oa();h.D.Oa();h.H.Oa();return f}; +h.BF=function(a){var c=a.options,d=x(a);h.ma(d.parentNode,"contextmenu",null,function(e){h.g.Hp(e)||e.preventDefault()});d=h.ma(window,"resize",null,function(){h.oc(!0);h.il(a)});a.bq=d;h.Kh.rD();c.Sk&&(a.ra?a.ra.S(a):a.P&&(a.P.S(a),a.P.show(c.Sk.childNodes),a.P.pc.set(0)));d=h.Ua.Zc;c.Dy&&(d=a.ad.S(d));c.Hb&&c.Hb.controls&&a.Tj.S(d);c.Bc&&c.Bc.scrollbars?(a.Ub=new h.jk(a),a.Ub.resize()):a.ii({x:.5,y:.5});c.sF&&h.Kh.MF(c.ai,a)}; +h.Kh.rD=function(){h.uE||(h.ma(document,"scroll",null,function(){for(var a=h.Ib.getAll(),c=0,d;d=a[c];c++)d.Pn&&d.Pn()}),h.ma(document,"keydown",null,h.pG),h.gd(document,"touchend",null,h.Sh),h.gd(document,"touchcancel",null,h.Sh),h.g.userAgent.qg&&h.ma(window,"orientationchange",document,function(){h.il(h.Ab())}));h.uE=!0}; +h.Kh.MF=function(a,c){function d(){for(;f.length;)h.$a(f.pop());e.preload()}var e=c.oh;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.ma(document,"mousemove",null,d,!0));f.push(h.ma(document,"touchstart",null,d,!0))};h.uf=function(a){this.name=a};h.F=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.Nn=a;this.Om=h.F.FF(a);this.qa=c;(a=d||null)&&a.zA&&(this.AA=a.zA)};h.F.types={te:"field",Wd:"block",pg:"input",hk:"output",we:"next",ye:"previous",zf:"stack",Li:"workspace"};h.F.jB=-20;h.F.FF=function(a){switch(a){case h.F.types.ye:case h.F.types.we:case h.F.types.pg:case h.F.types.hk:return!0}return!1};h.F.nm=function(a){return new h.F(h.F.types.te,a)}; +h.F.If=function(a){return a?a.type==h.Wa||a.type==h.jb&&a.Pf()?h.F.Ti(a.Pf()):a.type==h.jb?new h.F(h.F.types.we,a):a.type==h.Te?new h.F(h.F.types.hk,a):a.type==h.Ue?new h.F(h.F.types.ye,a):null:null};h.F.Ti=function(a){return a?new h.F(h.F.types.pg,a.connection):null};h.F.Eg=function(a){return new h.F(h.F.types.Wd,a)};h.F.om=function(a){return new h.F(h.F.types.zf,a)};h.F.pm=function(a,c){return new h.F(h.F.types.Li,a,{zA:c})};b=h.F.prototype;b.Mb=function(){return this.Nn}; +function Cc(a,c){a=a.qa;a instanceof h.Zn||(a=a.B);if(!a||!a.v)return null;var d=I(a);a=D(d.v,!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.om(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function Dc(a){if(!a)return null;do var c=a.Z&&z(a.Z);while(c&&q(c)==a&&(a=c));return(c=a.Z||a.M)&&c.ca&&c.ca.Pf()?h.F.Ti(c.ca.Pf()):h.F.om(a)} +b.next=function(){switch(this.Nn){case h.F.types.zf:return Cc(this,!0);case h.F.types.hk:return h.F.Eg(this.qa.B);case h.F.types.te:a:{var a=this.qa,c=a.Pf();var d=a.B;a=c.Pa.indexOf(a)+1;c=d.T.indexOf(c);for(var e;e=d.T[c];c++){for(var f=e.Pa;a1'), +e.appendChild(d),c.push(e));if(h.J.variables_get){a.sort(h.Ul.Zw);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.O.Dm(f)),c.push(e)}}return c}; +h.O.Wx=function(a){a=a.Kg();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var g=!1,k=0;kf?h.aa.ln(a,0,d.height+f):h.aa.ln(a,f,d.height)}; +h.aa.zD=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.aa.AD=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};h.VERSION="uncompiled";h.Xm=null;h.selected=null;h.cursor=null;h.Le=!1;h.wm=[];h.fm=null;h.Qo=null;h.ds=null;h.JL=null;h.iA=function(a){return{width:a.Lw,height:a.Jw}};h.lM=function(a){na(a)};h.il=function(a){for(;a.options.Nb;)a=a.options.Nb;var c=x(a),d=c.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.Lw!=e&&(c.setAttribute("width",e+"px"),c.Lw=e);c.Jw!=d&&(c.setAttribute("height",d+"px"),c.Jw=d);a.resize()}}; +h.pG=function(a){var c=h.Xm;if(!(h.g.Hp(a)||c.ba&&!c.isVisible()))if(c.options.readOnly)h.navigation.wz(a);else{var d=!1;if(a.keyCode==h.g.Ba.Lq)h.oc(),h.navigation.Wh(h.navigation.uq);else{if(h.navigation.wz(a))return;if(a.keyCode==h.g.Ba.NA||a.keyCode==h.g.Ba.yl){a.preventDefault();if(h.Zj.rt())return;h.selected&&h.selected.je()&&(d=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(h.Zj.rt())return;h.selected&&h.selected.je()&&h.selected.kd()&&(a.keyCode==h.g.Ba.TA?(h.oc(),h.js(h.selected)):a.keyCode!= +h.g.Ba.Cw||h.selected.v.ke||(h.js(h.selected),d=!0));a.keyCode==h.g.Ba.TC?h.fm&&(a=h.Qo,a.ke&&(a=a.Jj),h.ds&&ab(a,h.ds)&&(h.i.$(!0),yc(a),h.i.$(!1))):a.keyCode==h.g.Ba.dD&&(h.oc(),c.$u(a.shiftKey))}}d&&!h.selected.v.ke&&(h.i.$(!0),h.oc(),h.selected.I(!0,!0),h.i.$(!1))}};h.js=function(a){if(a.Qy)var c=a.Vu();else{c=h.R.qh(a,!0);h.R.kE(c);var d=a.Qa();c.setAttribute("x",a.G?-d.x:d.x);c.setAttribute("y",d.y)}h.fm=c;h.Qo=a.v;h.ds=a.Qy?null:h.g.Us(a,!0)}; +h.Gx=function(a){var c=h.fm,d=h.Qo;h.js(a);yc(a.v);h.fm=c;h.Qo=d};h.jM=function(a){h.g.Hp(a)||a.preventDefault()};h.oc=function(a){h.H.Ca();h.aa.Ca();h.D.Ik();a||(a=h.Ab(),a.ad&&a.ad.P&&a.ad.P.Ca(),a.ra&&a.ra.P&&a.ra.P.pk&&Ec(a.ra.Bd,null))};h.Ab=function(){return h.Xm};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.KF=function(a){return function(){P(this,a)}}; +h.zk=function(a){for(var c=0;ck[0]?1:g[0]=a.options.length&&(a.style.display= +"none")}for(d=1;10>=d;d++)a=document.getElementById("level"+d),c=!!Qc(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(Rc,1)}function Qc(a){var c=Sc;try{var d=window.localStorage[c+a]}catch(e){}return d}function S(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 Tc(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 Uc(a){a%=360;0>a&&(a+=360);return a} +function Rc(){if(!Kc){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")}};h.g.A={};h.g.A.Va=function(a,c){return" "+a+","+c+" "};h.g.A.curve=function(a,c){return" "+a+c.join("")};h.g.A.moveTo=function(a,c){return" M "+a+","+c+" "};h.g.A.moveBy=function(a,c){return" m "+a+","+c+" "};h.g.A.lineTo=function(a,c){return" l "+a+","+c+" "};h.g.A.line=function(a){return" l"+a.join("")};h.g.A.ea=function(a,c){return" "+a+" "+c+" "};h.g.A.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};h.m.ui=function(){this.yf=0;this.EC=3;this.xf=5;this.Vv=8;this.sd=10;this.rw=this.xf;this.yr=15;this.Rl=5;this.mh=8;this.nC=15;this.mC=4;this.kC=12;this.pB=16;this.wb=8;this.xo=15;this.LC=0;this.MC=20;this.OA=4;this.HC=15;this.IC=100;this.GC=15;this.Xq=24;this.rB=14.5;this.qB=this.yr+11;this.tB=2;this.sB=this.Xq;this.nw=h.g.A.moveBy(0,0);this.PB=12;this.QB=6};b=h.m.ui.prototype; +b.S=function(){this.bk=this.Jt();this.ek=this.Kt();this.ug=this.Mt();this.Di=this.Lt();var a=this.wb,c=h.g.A.arc("a","0 0,0",a,h.g.A.Va(-a,a)),d=h.g.A.arc("a","0 0,0",a,h.g.A.Va(a,a));this.Fl={width:a,height:a,nu:c,Sp:d};c=this.wb;a=h.g.A.moveBy(0,c)+h.g.A.arc("a","0 0,1",c,h.g.A.Va(c,-c));c=h.g.A.arc("a","0 0,1",c,h.g.A.Va(-c,-c));this.bw={Yu:a,Tr:c}};b.Jt=function(){var a=this.PB,c=this.QB,d=h.g.A.line([h.g.A.Va(6,3),h.g.A.Va(-12,6),h.g.A.Va(6,3)]);return{height:a,width:c,path:d}}; +b.Mt=function(){var a=this.HC,c=this.IC,d=h.g.A.curve("c",[h.g.A.Va(30,-a),h.g.A.Va(70,-a),h.g.A.Va(c,0)]);return{height:a,width:c,path:d}};b.Lt=function(){function a(g){g=g?-1:1;var k=-g,l=d/2,m=h.g.A.Va(c,g*l);return h.g.A.curve("c",[h.g.A.Va(0,g*(l+2.5)),h.g.A.Va(-c,k*(l+.5)),h.g.A.Va(-c,g*l)])+h.g.A.curve("s",[h.g.A.Va(c,2.5*k),m])}var c=this.mh,d=this.yr,e=a(!0),f=a(!1);return{width:c,height:d,Oe:f,kn:e}}; +b.Kt=function(){function a(k){return h.g.A.line([h.g.A.Va(k*e,d),h.g.A.Va(3*k,0),h.g.A.Va(k*e,-d)])}var c=this.nC,d=this.mC,e=(c-3)/2,f=a(1),g=a(-1);return{width:c,height:d,$h:f,Dz:g}};h.m.u={NONE:0,te:1,Hv:2,Jv:4,rr:8,pv:16,Nv:32,Gv:64,pg:128,Lv:256,ow:512,cB:1024,ir:2048,Zq:4096,rC:8192,Gq:16384,Uq:32768,Tq:65536,mr:131072,lr:262144,Qv:524288,pr:1048576,Br:2097152,Aq:4194304,Mv:8388608};h.m.u.mJ=h.m.u.Uq|h.m.u.Tq;h.m.u.RK=h.m.u.mr|h.m.u.lr;h.m.u.Yt=16777216;h.m.u.Mb=function(){h.m.u.hasOwnProperty(void 0)||(h.m.u[void 0]=h.m.u.Yt,h.m.u.Yt<<=1);return h.m.u[void 0]};h.m.u.Sm=function(a){return a.type&h.m.u.te};h.m.u.kj=function(a){return a.type&h.m.u.Hv}; +h.m.u.Ok=function(a){return a.type&h.m.u.Jv};h.m.u.mf=function(a){return a.type&h.m.u.rr};h.m.u.$L=function(a){return a.type&h.m.u.Nv};h.m.u.lf=function(a){return a.type&h.m.u.pg};h.m.u.Rm=function(a){return a.type&h.m.u.Gv};h.m.u.Lh=function(a){return a.type&h.m.u.Lv};h.m.u.Vm=function(a){return a.type&h.m.u.ow};h.m.u.Qk=function(a){return a.type&h.m.u.ir};h.m.u.Oh=function(a){return a.type&h.m.u.Zq};h.m.u.JF=function(a){return a.type&(h.m.u.ir|h.m.u.Zq)};h.m.u.Nh=function(a){return a.type&h.m.u.Tq}; +h.m.u.bM=function(a){return a.type&h.m.u.lr};h.m.u.Um=function(a){return a.type&h.m.u.Uq};h.m.u.cM=function(a){return a.type&h.m.u.mr};h.m.u.ZL=function(a){return a.type&h.m.u.Gq};h.m.u.Ry=function(a){return a.type&h.m.u.Qv};h.m.u.dM=function(a){return a.type&h.m.u.pr};h.m.u.YL=function(a){return a.type&h.m.u.pv};h.m.u.Ip=function(a){return a.type&h.m.u.Br};h.m.u.Bp=function(a){return a.type&h.m.u.Aq};h.m.u.eM=function(a){return a.type&(h.m.u.Br|h.m.u.Aq)};h.m.u.aM=function(a){return a.type&h.m.u.Mv};h.m.gh=function(a){this.height=this.width=0;this.type=h.m.u.NONE;this.rh=this.Ta=0;this.C=a;this.Me=this.C.xo};h.m.sa=function(a,c){h.m.sa.w.constructor.call(this,a);this.hs=c;a:switch(a=this.C,c.type){case h.Wa:case h.Te:c=a.Di;break a;case h.Ue:case h.jb:c=a.ek;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=h.m.u.cB};h.g.object.W(h.m.sa,h.m.gh);h.m.gr=function(a,c){h.m.gr.w.constructor.call(this,a,c);this.type|=h.m.u.rC;this.height=this.shape.height;this.width=this.shape.width;this.Ce=this.C.Rl;this.pe=this.width};h.g.object.W(h.m.gr,h.m.sa); +h.m.jr=function(a,c){h.m.jr.w.constructor.call(this,a,c);this.type|=h.m.u.ir;this.height=this.shape.height;this.width=this.shape.width};h.g.object.W(h.m.jr,h.m.sa);h.m.$q=function(a,c){h.m.$q.w.constructor.call(this,a,c);this.type|=h.m.u.Zq;this.height=this.shape.height;this.width=this.shape.width};h.g.object.W(h.m.$q,h.m.sa);h.m.Gl=function(a,c){h.m.Gl.w.constructor.call(this,a,c.connection);this.type|=h.m.u.pg;this.input=c;this.align=c.align;(this.Qi=c.connection&&z(c.connection)?z(c.connection):null)?(a=H(this.Qi),this.im=a.width,this.To=a.height):this.To=this.im=0;this.connection=c.connection;this.Ce=0};h.g.object.W(h.m.Gl,h.m.sa); +h.m.dh=function(a,c){h.m.dh.w.constructor.call(this,a,c);this.type|=h.m.u.Lv;this.Qi?(this.width=this.im,this.height=this.To):(this.height=this.C.qB,this.width=this.shape.width+this.C.rB);this.Ce=this.C.Rl;this.jm=this.shape.height;this.vh=this.shape.width};h.g.object.W(h.m.dh,h.m.Gl);h.m.lh=function(a,c){h.m.lh.w.constructor.call(this,a,c);this.type|=h.m.u.ow;this.height=this.Qi?this.To+this.C.LC:this.C.sB;this.width=this.C.xo+this.shape.width};h.g.object.W(h.m.lh,h.m.Gl); +h.m.mo=function(a,c){h.m.mo.w.constructor.call(this,a,c);this.type|=h.m.u.Gv;this.height=this.Qi?this.To-2*this.C.Rl:this.shape.height;this.width=this.shape.width+this.C.tB;this.Ce=this.C.Rl;this.jm=this.shape.height;this.vh=this.shape.width};h.g.object.W(h.m.mo,h.m.Gl);h.m.Id=function(a,c){h.m.Id.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=h.m.u.Jv;a=new h.g.Ve(h.Id.prototype.Eo,h.Id.prototype.Eo-2);this.height=a.height;this.width=a.width};h.g.object.W(h.m.Id,h.m.gh);h.m.Sq=function(a){h.m.Sq.w.constructor.call(this,a);this.type|=h.m.u.Qv;this.height=this.C.bk.height;this.width=this.C.bk.width};h.g.object.W(h.m.Sq,h.m.gh); +h.m.Na=function(a,c){h.m.Na.w.constructor.call(this,a);this.Lx=c;this.jd=c.ng&&!!c.B&&c.B.jd();this.GE=!1;this.type|=h.m.u.te;a=this.Lx.Lg();this.height=a.height;this.width=a.width};h.g.object.W(h.m.Na,h.m.gh);h.m.Pq=function(a){h.m.Pq.w.constructor.call(this,a);this.type|=h.m.u.Hv;this.height=this.C.ug.height;this.width=this.C.ug.width;this.nk=this.height};h.g.object.W(h.m.Pq,h.m.gh); +h.m.Ho=function(a,c){h.m.Ho.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.m.u.mr:h.m.u.Uq)|h.m.u.Gq;this.width=this.height=this.C.yf};h.g.object.W(h.m.Ho,h.m.gh);h.m.Do=function(a,c){h.m.Do.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.m.u.lr:h.m.u.Tq)|h.m.u.Gq;this.width=this.C.wb;this.height=this.C.wb/2};h.g.object.W(h.m.Do,h.m.gh);h.m.$j=function(a,c){h.m.$j.w.constructor.call(this,a);this.type=this.type|h.m.u.rr|h.m.u.Nv;this.width=c;this.height=this.C.GC};h.g.object.W(h.m.$j,h.m.gh);h.m.Gi=function(a){this.type=h.m.u.pr;this.elements=[];this.Ta=this.Jc=this.fg=this.minWidth=this.minHeight=this.width=this.height=0;this.By=this.up=this.mt=this.wd=this.cj=!1;this.C=a;this.Me=this.C.xo};h.m.Gi.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function Vc(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.m.u.lf(d))return d;return null}h.m.Gi.prototype.Ru=function(){return!0};h.m.Gi.prototype.Jx=function(){return!0}; +function Wc(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.m.u.mf(d))return d;return null}h.m.lk=function(a){h.m.lk.w.constructor.call(this,a);this.type|=h.m.u.Br;this.nk=this.Ag=0;this.rF=!1;this.connection=null};h.g.object.W(h.m.lk,h.m.Gi);h.m.lk.prototype.nt=function(a){var c=a.Ng?"cap"===a.Ng:h.wa.ug,d=a.Z&&z(a.Z);return!!a.M||c||(d?q(d)==a:!1)}; +h.m.lk.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.m.u.mf(f)||(h.m.u.kj(f)?d=Math.max(d,f.nk):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Ag=this.nk=d;this.fg=this.width};h.m.lk.prototype.Ru=function(){return!1};h.m.Uj=function(a){h.m.Uj.w.constructor.call(this,a);this.type|=h.m.u.Aq;this.Cy=!1;this.connection=null;this.Ni=this.tm=0};h.g.object.W(h.m.Uj,h.m.Gi); +h.m.Uj.prototype.nt=function(a){return!!a.M||!!q(a)};h.m.Uj.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.m.u.mf(f)||(h.m.u.Oh(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.tm=d;this.fg=this.width};h.m.Uj.prototype.Ru=function(){return!1}; +h.m.Go=function(a,c,d){h.m.Go.w.constructor.call(this,a);this.type=this.type|h.m.u.rr|h.m.u.pv;this.width=d;this.height=c;this.Ux=!1;this.fg=0;this.elements=[new h.m.$j(this.C,d)]};h.g.object.W(h.m.Go,h.m.Gi);h.m.Go.prototype.measure=function(){};h.m.ak=function(a){h.m.ak.w.constructor.call(this,a);this.type|=h.m.u.Mv;this.bx=0};h.g.object.W(h.m.ak,h.m.Gi); +h.m.ak.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.m.u.lf(d)&&(h.m.u.Vm(d)?a+=d.im:h.m.u.Rm(d)&&0!=d.im&&(a+=d.im-d.vh)),h.m.u.mf(d)||(this.height=Math.max(this.height,d.height));this.bx=a;this.fg=this.width+a};h.m.ak.prototype.Jx=function(){return!this.cj&&!this.wd};h.m.jh=function(a,c){this.U=c;this.Ug=a;this.C=this.Ug.C;this.M=c.M?new h.m.gr(this.C,c.M):null;this.wt=Ha(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Mh=c.Mh();this.G=c.G;this.Gj=this.width=this.ql=this.height=0;this.rows=[];this.Gy=[];this.kc=new h.m.lk(this.C);this.Jb=new h.m.Uj(this.C);this.iq=this.pe=0};b=h.m.jh.prototype; +b.measure=function(){var a=this.U.Ng?"cap"===this.U.Ng:h.wa.ug,c=!!this.U.Z;this.kc.nt(this.U)?this.kc.elements.push(new h.m.Ho(this.C)):this.kc.elements.push(new h.m.Do(this.C));a?(a=new h.m.Pq(this.C),this.kc.elements.push(a),this.kc.Ag=a.nk):c&&(this.kc.rF=!0,this.kc.connection=new h.m.jr(this.C,this.U.Z),this.kc.elements.push(this.kc.connection));this.U.T.length&&this.U.T[0].type==h.jb&&!this.U.isCollapsed()?this.kc.minHeight=this.C.sd:this.kc.minHeight=this.C.xf;this.rows.push(this.kc);a=new h.m.ak(this.C); +var d=Na(this.U);if(d.length){c=0;for(var e;e=d[c];c++){var f=new h.m.Id(this.C,e);this.isCollapsed&&e.Vw?this.Gy.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.U.T[c];c++)if(d.isVisible()){!e||d.type!=h.jb&&e.type!=h.jb&&(d.type!=h.Wa&&d.type!=h.mg||this.wt)||(this.rows.push(a),a=new h.m.ak(this.C));for(e=0;f=d.Pa[e];e++)a.elements.push(new h.m.Na(this.C,f,d));this.Fw(d,a);e=d}this.isCollapsed&&(a.By=!0,a.elements.push(new h.m.Sq(this.C)));(a.elements.length||a.up)&&this.rows.push(a);this.Jb.Cy= +!!this.U.X;this.Jb.minHeight=this.U.T.length&&this.U.T[this.U.T.length-1].type==h.jb?this.C.sd:this.C.xf-1;this.Jb.nt(this.U)?this.Jb.elements.push(new h.m.Ho(this.C)):this.Jb.elements.push(new h.m.Do(this.C));this.Jb.Cy&&(this.Jb.connection=new h.m.$q(this.C,this.U.X),this.Jb.elements.push(this.Jb.connection));this.rows.push(this.Jb);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.Ru()&&c.elements.push(new h.m.$j(this.C,this.mp(null,d[0])));for(e=0;ea.xd&&(a.ga+=h.g.A.ea("V",c.Jc+c.height-a.xd)))};h.na.Ei=function(a){this.Ij=a;this.Hn=h.g.o.L("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Ij);this.hl=h.g.o.L("path",{"class":"blocklyPath"},this.Ij);this.Jn=h.g.o.L("path",{"class":"blocklyPathLight"},this.Ij)};h.na.Ei.prototype.Iu=function(a,c){this.hl.setAttribute("d",a);this.Hn.setAttribute("d",a);this.Jn.setAttribute("d",c)}; +h.na.Ei.prototype.Qs=function(){this.hl.setAttribute("transform","scale(-1 1)");this.Jn.setAttribute("transform","scale(-1 1)");this.Hn.setAttribute("transform","translate(1,1) scale(-1 1)")};h.na.dh=function(a,c){h.na.dh.w.constructor.call(this,a,c);this.Qi&&(this.width+=this.C.qd,this.height+=this.C.qd)};h.g.object.W(h.na.dh,h.m.dh);h.na.lh=function(a,c){h.na.lh.w.constructor.call(this,a,c);this.Qi&&(this.height+=this.C.qd)};h.g.object.W(h.na.lh,h.m.lh);h.na.jh=function(a,c){h.na.jh.w.constructor.call(this,a,c)};h.g.object.W(h.na.jh,h.m.jh);b=h.na.jh.prototype;b.Fw=function(a,c){this.wt&&a.type==h.Wa?(c.elements.push(new h.na.dh(this.C,a)),c.mt=!0):a.type==h.jb?(c.elements.push(new h.na.lh(this.C,a)),c.wd=!0):a.type==h.Wa?(c.elements.push(new h.m.mo(this.C,a)),c.cj=!0):a.type==h.mg&&(c.up=!0)}; +b.mp=function(a,c){if(!a)return c&&h.m.u.Sm(c)&&c.jd?this.C.xf:c&&h.m.u.Lh(c)?this.C.Vv:c&&h.m.u.Vm(c)?this.C.MC:this.C.sd;if(!h.m.u.lf(a)&&!c)return h.m.u.Sm(a)&&a.jd?this.C.xf:h.m.u.Ok(a)?2*this.C.sd+1:h.m.u.kj(a)?this.C.yf:h.m.u.JF(a)?this.C.sd:h.m.u.Nh(a)?this.C.kC:h.m.u.Ry(a)?this.C.yf:this.C.sd;if(h.m.u.lf(a)&&!c){if(h.m.u.Rm(a))return this.C.yf;if(h.m.u.Lh(a))return this.C.sd;if(h.m.u.Vm(a))return this.C.yf}if(!h.m.u.lf(a)&&c&&h.m.u.lf(c)){if(a.jd){if(h.m.u.Lh(c)||h.m.u.Rm(c))return this.C.EC}else{if(h.m.u.Lh(c)|| +h.m.u.Rm(c))return this.C.Vv;if(h.m.u.Vm(c))return this.C.sd}return this.C.sd-1}if(h.m.u.Ok(a)&&c&&!h.m.u.lf(c))return this.C.sd;if(h.m.u.Lh(a)&&c&&!h.m.u.lf(c))return c.jd?this.C.xf:this.C.sd;if(h.m.u.Um(a)&&c){if(h.m.u.kj(c))return this.C.yf;if(h.m.u.Qk(c))return c.Me;if(h.m.u.Oh(c))return a=(this.G?1:-1)*this.C.qd/2,c.Me+a}if(h.m.u.Nh(a)&&c){if(h.m.u.Qk(c))return c.Me-this.C.wb;if(h.m.u.Oh(c))return a=(this.G?1:-1)*this.C.qd/2,c.Me-this.C.wb+a}return!h.m.u.lf(a)&&c&&!h.m.u.lf(c)&&a.jd==c.jd||c&& +h.m.u.Ry(c)?this.C.sd:this.C.xf};b.Hr=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(h.m.u.mf(e)){d=e;break a}d=null}e=Wc(a);if(a.cj||a.wd)a.fg+=c;var f=Vc(a);f?f.align==h.xq?e.width+=c:f.align==h.jv?(d.width+=c/2,e.width+=c/2):f.align==h.tl&&(d.width+=c):e.width+=c;a.width+=c};b.ny=function(a,c){return h.m.u.Ip(a)&&h.m.u.Bp(c)?this.C.pB:h.m.u.Ip(a)||h.m.u.Bp(c)?this.C.yf:a.cj&&c.cj?this.C.sd:!a.wd&&c.wd?this.C.OA:a.wd&&c.wd||!a.wd&&c.up?this.C.sd:this.C.xf}; +b.by=function(a,c){if(h.m.u.mf(c))return a.Jc+c.height/2;if(h.m.u.Bp(a))return a=a.Jc+a.height-a.tm,h.m.u.Oh(c)?a+c.height/2:a-c.height/2;if(h.m.u.Ip(a))return h.m.u.kj(c)?a.Ag-c.height/2:a.Ag+c.height/2;var d=a.Jc;h.m.u.Sm(c)||h.m.u.Ok(c)?(d+=c.height/2,(a.mt||a.wd)&&c.height+this.C.rw<=a.height&&(d+=this.C.rw)):d=h.m.u.Lh(c)?d+c.height/2:d+a.height/2;return d}; +b.Mx=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Jc=c;e.Ta=this.pe;c+=e.height;a=Math.max(a,e.fg);var f=c-this.kc.nk;e==this.Jb&&f=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},Wt:function(){10>R?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+Ic+"&level="+(R+1):V.wp()},Iy:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}var e=a;a=C;if(void 0===c){for(var f=0;d= +a.Lm[f];f++)d.Xg(!1);a.Lm.length=0}if(d=e?r(a,e):null)(c=void 0===c||c)?-1==a.Lm.indexOf(d)&&a.Lm.push(d):h.g.Ko(a.Lm,d),d.Xg(c)},XL:function(a,c){a=document.getElementById(a);a.firstChild||(a=h.Kh(a,{rtl:-1!=Hc.indexOf(Ic),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),h.R.xh(h.R.li(c),a))},gH:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Nf:function(a){if("click"==a.type&&"touchend"==V.Nf.uu&&V.Nf.su+2E3>Date.now()||V.Nf.uu==a.type&&V.Nf.su+400>Date.now())return a.preventDefault(), +a.stopPropagation(),!0;V.Nf.uu=a.type;V.Nf.su=Date.now();return!1}};V.Nf.uu=null;V.Nf.su=0;V.xF=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};V.yF=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=V;V.setCode=V.Wz;V.getCode=V.Xs;V.getWorkspace=V.Ek;var T={ij:!1,wx:null,Yo:null,fl:function(a,c,d,e,f,g){function k(){T.ij&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);T.ij&&T.ge(!1);h.Ab()&&h.oc(!0);T.ij=!0;T.wx=c;T.Yo=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),T.ss=h.gd(e,"mousedown",null,T.lE));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(T.Th(c,!1,.2),T.Th(l,!0,.8),setTimeout(k,175)):k()},xx:0,yx:0,lE:function(a){T.vs();if(!h.g.mj(a)){var c=document.getElementById("dialog");T.xx=c.offsetLeft-a.clientX;T.yx=c.offsetTop-a.clientY;T.us=h.gd(document,"mouseup",null,T.vs);T.ts=h.gd(document,"mousemove",null,T.mE);a.stopPropagation()}},mE:function(a){var c=document.getElementById("dialog"), +d=T.xx+a.clientX;a=T.yx+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"},vs:function(){T.us&&(h.$a(T.us),T.us=null);T.ts&&(h.$a(T.ts),T.ts=null)},ge:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(T.ij){T.vs();T.ss&&(h.$a(T.ss),T.ss=null);T.ij=!1;T.Yo&&T.Yo();T.Yo=null;var d=!1===a? +null:T.wx;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(T.Th(a,!1,.8),T.Th(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)}},Th: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=T.LE(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},LE:function(a){var c=h.g.style.pp(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},hA:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eR?S("Games_nextLevel").replace("%1",String(R+1)):S("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +T.ge,!0);c.addEventListener("touchend",T.ge,!0);c=document.getElementById("doneOk");c.addEventListener("click",V.Wt,!0);c.addEventListener("touchend",V.Wt,!0);T.fl(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",T.ax,!0)});document.body.addEventListener("keydown",T.ax,!0);document.getElementById("dialogDoneText").textContent=d},vx:function(a){!T.ij||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(T.ge(!0),a.stopPropagation(),a.preventDefault())}, +Pu:function(){document.body.addEventListener("keydown",T.vx,!0)},Su:function(){document.body.removeEventListener("keydown",T.vx,!0)},ax:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)T.ge(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&V.Wt()},Dw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)T.ge(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&V.wp()},Vx:function(a){27==a.keyCode?T.ge(!0):13==a.keyCode&&T.Ss()},Ss: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?S("Games_submitted"):S("Games_httpRequestError")+"\nStatus: "+f.status;T.hA(null,g)}};f.send(c.join("&"));T.ge(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=T;T.hideDialog=T.ge;h.Comment=function(a){h.Comment.w.constructor.call(this,a);this.hc=a.Be;this.hc.text=this.hc.text||"";this.Yr="";hc(this)};h.g.object.W(h.Comment,h.Id);b=h.Comment.prototype; +b.Es=function(a){h.g.o.L("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);h.g.o.L("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);h.g.o.L("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)}; +b.ks=function(){this.Bm=h.g.o.L("foreignObject",{x:h.oa.cd,y:h.oa.cd},null);var a=document.createElementNS(h.g.o.zi,"body");a.setAttribute("xmlns",h.g.o.zi);a.className="blocklyMinimalBody";var c=this.Lj=document.createElementNS(h.g.o.zi,"textarea");c.className="blocklyCommentTextarea";c.setAttribute("dir",this.U.G?"RTL":"LTR");c.value=this.hc.text;ld(this);a.appendChild(c);this.Bm.appendChild(a);h.ma(c,"mouseup",this,this.cH,!0,!0);h.ma(c,"wheel",this,function(d){d.stopPropagation()});h.ma(c,"change", +this,function(){this.Yr!=this.hc.text&&h.i.Ka(new h.i.hg(this.U,"comment",null,this.Yr,this.hc.text))});h.ma(c,"input",this,function(){this.hc.text=c.value});setTimeout(c.focus.bind(c),0);return this.Bm};b.ah=function(){h.Comment.w.ah.call(this);this.isVisible()&&(md(this),nd(this))};b.kG=function(){this.isVisible()&&(this.hc.size=this.Yb.Vs(),ld(this))}; +function ld(a){var c=a.hc.size,d=2*h.oa.cd,e=c.width-d;c=c.height-d;a.Bm.setAttribute("width",e);a.Bm.setAttribute("height",c);a.Lj.style.width=e-4+"px";a.Lj.style.height=c-4+"px"}b.Vb=function(a){a!=this.isVisible()&&(h.i.Ka(new h.i.ud(this.U,"commentOpen",!a,a)),(this.hc.pu=a)?nd(this):md(this))}; +function nd(a){if(!a.U.jd()||h.g.userAgent.og)h.Cf.prototype.kx.call(a);else{a.Yb=new h.oa(a.U.v,a.ks(),a.U.Td,a.Kk,a.hc.size.width,a.hc.size.height);gb(a.Yb,a.U.id);var c=a.kG.bind(a);a.Yb.zu=c;a.Qe()}}function md(a){a.yj?h.Cf.prototype.Ax.call(a):(a.Yb.I(),a.Yb=null,a.Lj=null,a.Bm=null)}b.cH=function(){hb(this.Yb)&&this.Lj.focus();this.Yr=this.hc.text};b.Vs=function(){return this.hc.size};b.un=function(a,c){this.Yb?this.Yb.un(a,c):(this.hc.size.width=a,this.hc.size.height=c)}; +b.Tb=function(){return this.hc.text||""};b.dl=function(a){this.hc.text!=a&&(this.hc.text=a,oc(this))};function oc(a){a.Lj?a.Lj.value=a.hc.text:a.yj&&(a.yj.firstChild.textContent=a.hc.text)}b.I=function(){this.U.vk=null;h.Id.prototype.I.call(this)};h.Da={};h.Da.pd=function(a,c){h.uc.call(this);this.Qc=c;this.af=a;this.zm=this.fq=!1;this.zt=!0;this.qs=-1};h.g.object.W(h.Da.pd,h.uc);h.Da.pd.Ir={};b=h.Da.pd.prototype;b.vm=function(){h.Da.pd.w.vm.call(this);this.Da&&(this.Da=null);this.hb=null}; +b.xp=function(){var a=this.ta();if(a){var c=od(this);c&&!c.id&&(c.id=this.ua()+".label");h.g.V.ag(a,h.g.V.Fi.RC);h.g.V.Gb(a,h.g.V.State.Nl,!1);h.g.V.Gb(a,h.g.V.State.TB,this.Ck());c&&h.g.V.Gb(a,h.g.V.State.Rv,c.id);(c=this.Ys())&&h.g.V.ag(c,h.g.V.Fi.uC);if(c=pd(this))if(h.g.V.ag(c,h.g.V.Fi.DB),c.hasChildNodes())for(h.g.V.Gb(a,h.g.V.State.Nq,!1),a=this.kb.length,c=1;c<=a;c++){var d=(this.kb[c-1]||null).ta();h.g.V.Gb(d,h.g.V.State.CC,a);h.g.V.Gb(d,h.g.V.State.tC,c)}}}; +b.Oa=function(){var a=document.createElement("div");a.appendChild(qd(this));this.hb=a};b.ff=function(){h.Da.pd.w.ff.call(this);h.Da.pd.Ir[this.ua()]=this;this.xp()};b.zh=function(){h.Da.pd.w.zh.call(this);delete h.Da.pd.Ir[this.ua()]}; +b.Zl=function(a,c){var d=this.kb[c-1]||null,e=this.kb[c]||null;h.Da.pd.w.Zl.call(this,a,c);a.Zk=d;a.Xt=e;d?d.Xt=a:this.Ox=a;e&&(e.Zk=a);(c=this.Ie())&&rd(a,c);sd(a,this.Ck()+1);if(c=this.ta())if(this.oq(),h.g.V.Gb(c,h.g.V.State.Nq,this.Ge()),this.Ge()){c=pd(this);a.ta()||a.Oa();var f=a.ta(),g=e&&e.ta();c.insertBefore(f,g);this.Yc&&a.ff();e||(d?d.oq():(h.g.style.Hu(c,!0),this.Dj(this.Ge())))}};b.add=function(a){if(a.getParent())throw Error(h.uc.Error.hr);this.Zl(a,this.kb.length)};b.Ie=function(){return null}; +b.Ck=function(){var a=this.qs;0>a&&(a=(a=this.getParent())?a.Ck()+1:0,sd(this,a));return a};function sd(a,c){if(c!=a.qs){a.qs=c;var d=td(a);if(d){var e=ud(a)+"px";a.Rk()?d.style.paddingRight=e:d.style.paddingLeft=e}da(a,function(f){sd(f,c+1)})}}b.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};b.Ah=function(){var a=[];da(this,function(c){a.push(c)});return a};b.select=function(){var a=this.Ie();a&&Ec(a,this)}; +function vd(a,c){if(a.fq!=c){a.fq=c;wd(a);var d=a.ta();d&&(h.g.V.Gb(d,h.g.V.State.Nl,c),c&&(c=a.Ie().ta(),h.g.V.Gb(c,h.g.V.State.iv,a.ua())))}}b.Ge=function(){return this.zm}; +b.Dj=function(a){var c=a!=this.zm,d;this.zm=a;var e=this.Ie(),f=this.ta();if(fa(this)){if(!a&&e&&this.contains(e.Rd)&&this.select(),f){if(d=pd(this))h.g.style.Hu(d,a),h.g.V.Gb(f,h.g.V.State.Nq,a),a&&this.Yc&&!d.hasChildNodes()&&(da(this,function(g){d.appendChild(qd(g))}),da(this,function(g){g.ff()}));this.oq()}}else(d=pd(this))&&h.g.style.Hu(d,!1);f&&(this.Ys().className=this.lp());c&&(a?this.Dx():this.Cx())};b.Dx=function(){};b.Cx=function(){};b.toggle=function(){this.Dj(!this.Ge())}; +function qd(a){var c=a.Ge()&&fa(a),d=document.createElement("div");d.style.backgroundPosition=xd(a);c||(d.style.display="none");c&&da(a,function(e){d.appendChild(qd(e))});c=document.createElement("div");c.id=a.ua();c.appendChild(yd(a));c.appendChild(d);return c}function ud(a){return Math.max(0,(a.Ck()-1)*a.Qc.Ly)}function yd(a){var c=document.createElement("div");c.className=a.qp();c.style["padding-"+(a.Rk()?"right":"left")]=ud(a)+"px";c.appendChild(zd(a));c.appendChild(Ad(a));return c} +b.qp=function(){var a="";this.fq&&(a=" "+(this.Qc.fE||""));return this.Qc.ox+a};function Ad(a){var c=document.createElement("span");c.className=a.Qc.dE||"";c.textContent=a.Tb();return c}function zd(a){var c=document.createElement("span");c.style.display="inline-block";c.className=a.lp();return c}b.lp=function(){throw Error("unimplemented abstract method");};function xd(a){return(a.Xt?(a.Ck()-1)*a.Qc.Ly:"-100")+"px 0"} +b.ta=function(){var a=h.Da.pd.w.ta.call(this);a||(this.hb=a=document.getElementById(this.ua()));return a};function td(a){return(a=a.ta())?a.firstChild:null}b.Ys=function(){var a=td(this);return a?a.firstChild:null};function od(a){return(a=td(a))&&a.lastChild?a.lastChild.previousSibling:null}function pd(a){return(a=a.ta())?a.lastChild:null}b.dl=function(a){this.af=a};b.Tb=function(){return this.af};function wd(a){var c=td(a);c&&(c.className=a.qp())} +b.oq=function(){var a=pd(this);a&&(a.style.backgroundPosition=xd(this))};b.xz=function(a){"expand"==a.target.getAttribute("type")&&fa(this)?this.zt&&this.toggle():(this.select(),wd(this))};b.uz=function(a){a.preventDefault()};b.fu=function(a){var c=!0;switch(a.keyCode){case h.g.Ba.Co:if(a.altKey)break;c=Bd(this);break;case h.g.Ba.uo:if(a.altKey)break;c=Cd(this);break;case h.g.Ba.zl:c=Dd(this);break;case h.g.Ba.Tl:c=Ed(this);break;default:c=!1}c&&a.preventDefault();return c}; +function Dd(a){a:if(fa(a)&&a.Ge())a=a.kb[0]||null;else{for(var c=a,d;c!=a.Ie();){d=c.Xt;if(null!=d){a=d;break a}c=c.getParent()}a=null}a&&a.select();return!0}function Ed(a){var c=a.Zk;if(null!=c)a=Fd(c);else{c=a.getParent();var d=a.Ie();a=c==d||a==d?null:c}a&&a.select();return!0}function Cd(a){if(fa(a)&&a.Ge()&&a.zt)a.Dj(!1);else{var c=a.getParent();a=a.Ie();c&&c!=a&&c.select()}return!0}function Bd(a){return fa(a)?(a.Ge()?(a.kb[0]||null).select():a.Dj(!0),!0):!1} +function Fd(a){return a.Ge()&&fa(a)?Fd(a.kb[a.kb.length-1]||null):a}function rd(a,c){a.Da!=c&&(a.Da=c,da(a,function(d){rd(d,c)}))};h.Da.nh=function(a,c,d){this.ra=a;h.Da.pd.call(this,c,d)};h.g.object.W(h.Da.nh,h.Da.pd);b=h.Da.nh.prototype;b.Ie=function(){if(this.Da)return this.Da;var a=this.getParent();return a&&(a=a.Ie())?(rd(this,a),a):null};b.lp=function(){var a=this.Ge(),c=this.BE;if(a&&c)return c;c=this.wF;if(!a&&c)return c;c=this.Qc;if(fa(this)){if(a&&c.mx)return c.Vo+" "+c.mx;if(!a&&c.aE)return c.Vo+" "+c.aE}else if(c.nx)return c.Vo+" "+c.nx;return""}; +b.uz=function(){fa(this)&&this.zt?(this.toggle(),this.select()):this.fq?Ec(this.Ie(),null):this.select();wd(this)};b.xz=function(){};b.fu=function(a){if(this.Da.ra.kf){var c={},d=h.g.Ba.zl,e=h.g.Ba.Tl;c[h.g.Ba.Co]=this.Rk()?e:d;c[h.g.Ba.uo]=this.Rk()?d:e;c[h.g.Ba.Tl]=h.g.Ba.uo;c[h.g.Ba.zl]=h.g.Ba.Co;Object.defineProperties(a,{keyCode:{value:c[a.keyCode]||a.keyCode}})}return h.Da.nh.w.fu.call(this,a)};b.Rz=function(){this.Bz&&this.Bz.call(this.ra)};b.Dx=h.Da.nh.prototype.Rz;b.Cx=h.Da.nh.prototype.Rz;h.Da.Ki=function(a,c){this.ra=a;h.Da.pd.call(this,"",c);this.zm=!0;vd(this,!0);this.Rd=this};h.g.object.W(h.Da.Ki,h.Da.pd);b=h.Da.Ki.prototype;b.Ie=function(){return this};b.Ck=function(){return 0};b.hF=function(){this.Tx=!0;var a=this.ta();h.g.o.Cb(a,"focused");this.Rd&&this.Rd.select()};b.eF=function(){this.Tx=!1;var a=this.ta();h.g.o.Ec(a,"focused")};b.hasFocus=function(){return this.Tx};b.Ge=function(){return!0};b.Dj=function(a){this.zm=a}; +b.Ys=function(){var a=td(this);return a?a.firstChild:null};b.oq=function(){};b.qp=function(){return h.Da.Ki.w.qp.call(this)+" "+this.Qc.cE};b.lp=function(){var a=this.Ge(),c=this.BE;if(a&&c)return c;c=this.wF;if(!a&&c)return c;c=this.Qc;return a&&c.bE?c.Vo+" "+c.bE:""};function Ec(a,c){if(c!=a.Rd&&(!a.rz||a.rz.call(a.ra,c))){var d=a.Rd;a.Rd&&vd(a.Rd,!1);(a.Rd=c)&&vd(c,!0);a.qz&&a.qz.call(a.ra,d,c)}} +b.xp=function(){h.Da.Ki.w.xp.call(this);var a=this.ta();h.g.V.ag(a,h.g.V.Fi.QC);h.g.V.Gb(a,h.g.V.State.Rv,od(this).id)};b.ff=function(){h.Da.Ki.w.ff.call(this);var a=this.ta();a.className=this.Qc.eE;a.setAttribute("hideFocus","true");this.Nr();this.xp()};b.zh=function(){h.Da.Ki.w.zh.call(this);this.rs()};b.Nr=function(){var a=this.ta();a.tabIndex=0;this.nG=h.gd(a,"focus",this,this.hF);this.jG=h.gd(a,"blur",this,this.eF);this.lG=h.ma(a,"click",this,this.lF);this.rG=h.gd(a,"keydown",this,this.iF)}; +b.rs=function(){h.$a(this.nG);h.$a(this.jG);h.$a(this.lG);h.$a(this.rG)};b.lF=function(a){var c;a:{for(var d=a.target;null!=d;){if(c=h.Da.pd.Ir[d.id])break a;if(d==this.ta())break;d=d.parentNode}c=null}if(c)switch(a.type){case "mousedown":c.xz(a);break;case "click":c.uz(a)}};b.iF=function(a){var c=!1;if(c=this.Rd&&this.Rd.fu(a)||c)h.g.style.Eu(this.Rd.ta(),this.ta().parentNode),a.preventDefault();return c};b.createNode=function(a){return new h.Da.nh(this.ra,a||"",this.Qc)};h.Ji=function(a){this.s=a;this.G=a.options.G;this.kf=a.options.ie;this.Ia=a.options.Ia;this.Qc={Ly:19,eE:"blocklyTreeRoot",cE:"blocklyHidden",ox:"blocklyTreeRow",dE:"blocklyTreeLabel",Vo:"blocklyTreeIcon",mx:"blocklyTreeIconOpen",nx:"blocklyTreeIconNone",fE:"blocklyTreeSelected"};this.oA={ox:"blocklyTreeSeparator"};this.kf&&(this.Qc.cssTreeRow+=a.G?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.oA.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.G?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"), +this.Qc.cssTreeIcon="")};b=h.Ji.prototype;b.width=0;b.height=0;b.Tk=null; +b.S=function(){var a=this.s,c=x(this.s);this.vc=document.createElement("div");this.vc.className="blocklyToolboxDiv blocklyNonSelectable";this.vc.setAttribute("dir",a.G?"RTL":"LTR");c.parentNode.insertBefore(this.vc,c);c=a.jc;c.subscribe(this.vc,"toolbox","background-color");c.subscribe(this.vc,"toolboxText","color");h.ma(this.vc,"mousedown",this,function(d){h.g.mj(d)||d.target==this.vc?h.oc(!1):h.oc(!0);h.Touch.em()},!1,!0);c={Ig:a.options.Ig,Nb:a,G:a.G,Ne:a.options.Ne,ie:a.ie,Ia:a.options.Ia,Tg:a.options.Tg}; +this.P=null;if(a.ie){if(!h.El)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new h.El(c)}else{if(!h.yg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new h.yg(c)}h.g.o.gj(this.P.Oa("svg"),x(this.s));this.P.S(a);this.Qc.cleardotPath=a.options.ai+"1x1.gif";this.Qc.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.G?"Rtl":"Ltr");Gd(this,a.options.Sk)}; +function Gd(a,c){a.Bd&&(a.Bd.I(),a.Tk=null);var d=new h.Da.Ki(a,a.Qc);a.Bd=d;Ec(d,null);d.rz=a.dF;d.qz=a.cF;var e=null;if(c){a.Bd.Df=[];a.kt=!1;e=Hd(a,c,a.Bd,a.s.options.ai);if(a.Bd.Df.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");na(a.s)}d.za(a.vc);e&&Ec(d,e);Id(a);a.position();a.kf&&h.g.V.Gb(a.Bd.ta(),h.g.V.State.qC,"horizontal")} +b.dF=function(a){if(a==this.Bd)return!1;this.Tk&&(td(this.Tk).style.backgroundColor="");if(a){var c=a.Gk||"#57e";td(a).style.backgroundColor=c;Id(this,a)}return!0};b.cF=function(a,c){c&&c.Df&&c.Df.length?(this.P.show(c.Df),this.Tk!=c&&this.P.pc.set(0),h.Le&&h.navigation.Gb(h.navigation.xr)):(this.P.Ca(),!h.Le||c instanceof h.Ji.Dr||h.navigation.Gb(h.navigation.Pl));a!=c&&a!=this&&(a=new h.i.ud(null,"category",a&&a.Tb(),c&&c.Tb()),a.tc=this.s.id,h.i.Ka(a));c&&(this.Tk=c)};b.oF=function(){h.il(this.s)}; +b.Wh=function(a){var c=this.Bd.Rd;if(!c)return!1;switch(a.name){case h.navigation.bb.ye:return Ed(c);case h.navigation.bb.Bo:return Cd(c);case h.navigation.bb.we:return Dd(c);case h.navigation.bb.po:return Bd(c);default:return!1}};b.I=function(){this.P.I();this.Bd.I();this.s.jc.unsubscribe(this.vc);h.g.o.removeNode(this.vc);this.Tk=this.s=null};b.Qf=function(){return this.width};b.ey=function(){return this.height}; +b.position=function(){var a=this.vc;if(a){var c=x(this.s);c=h.iA(c);this.kf?(a.style.left="0",a.style.height="auto",a.style.width=c.width+"px",this.height=a.offsetHeight,this.Ia==h.wg?a.style.top="0":a.style.bottom="0"):(this.Ia==h.vg?a.style.right="0":a.style.left="0",a.style.height=c.height+"px",this.width=a.offsetWidth);this.P.position()}}; +function Hd(a,c,d,e){for(var f=null,g=null,k=0,l;l=c.childNodes[k];k++)if(l.tagName)switch(l.tagName.toUpperCase()){case "CATEGORY":var m=h.g.le(l.getAttribute("name"));g=a.Bd.createNode(m);g.Bz=a.oF;g.Df=[];d.add(g);var n=l.getAttribute("custom");n?g.Df=n:(n=Hd(a,l,g,e))&&(f=n);var t=l.getAttribute("categorystyle");if((n=l.getAttribute("colour"))&&t)g.Gk="",console.warn('Toolbox category "'+m+'" can not have both a style and a colour');else if(t){n=a;var u=g;u.vM=t;var w=n.s.rp();t&&w&&((w=w.CD[t])&& +w.Lb?Jd(n,w.Lb,u,m):console.warn('Style "'+t+'" must exist and contain a colour value'))}else Jd(a,n,g,m);"true"==l.getAttribute("expanded")?(g.Df.length&&(f=g),g.Dj(!0)):g.Dj(!1);g=l;break;case "SEP":if(g&&"CATEGORY"==g.tagName.toUpperCase()){d.add(new h.Ji.Dr(a.oA));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":d.Df.push(l),g=l}return f} +function Jd(a,c,d,e){c=h.g.le(c);if(null===c||""===c)d.Gk="";else{var f=Number(c);isNaN(f)?(f=h.g.Lb.parse(c))?(d.Gk=f,a.kt=!0):(d.Gk="",console.warn('Toolbox category "'+e+'" has unrecognized colour attribute: '+c)):(d.Gk=h.Ky(f),a.kt=!0)}}function Id(a,c){c=(c||a.Bd).Ah(!1);for(var d=0,e;e=c[d];d++){var f=td(e);if(f){var g=a.kt?"8px solid "+(e.Gk||"#ddd"):"none";a.s.G?f.style.borderRight=g:f.style.borderLeft=g}Id(a,e)}} +b.Em=function(){if(!this.vc)return null;var a=this.vc.getBoundingClientRect(),c=a.top,d=c+a.height,e=a.left;a=e+a.width;return this.Ia==h.wg?new h.g.Rect(-1E7,d,-1E7,1E7):this.Ia==h.kk?new h.g.Rect(c,1E7,-1E7,1E7):this.Ia==h.Yd?new h.g.Rect(-1E7,1E7,-1E7,a):new h.g.Rect(-1E7,1E7,e,1E7)};h.Ji.Dr=function(a){h.Da.nh.call(this,null,"",a)};h.g.object.W(h.Ji.Dr,h.Da.nh); +h.Ed.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", +"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);h.Cr=function(a){this.s=a;this.Si=[];if(!(0>=this.s.options.Mp)){a={scrollbars:!0,Ig:this.s.options.Ig,Nb:this.s,G:this.s.G,Ne:this.s.options.Ne,Tg:this.s.options.Tg};if(this.s.ie){a.Ia=this.s.Ia==h.wg?h.kk:h.wg;if(!h.El)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new h.El(a)}else{a.Ia=this.s.Ia==h.vg?h.Yd:h.vg;if(!h.yg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new h.yg(a)}cb(this.s,this.mG.bind(this))}};b=h.Cr.prototype;b.Vl=47;b.Xn=44;b.ck=16;b.dC=20; +b.Tv=20;b.vo=10;b.vr=0;b.wr=32;b.EB=.1;b.xt=!1;b.Np=0;b.N=null;b.kq=null;b.Ft=0;b.Rh=0;b.Wy=0;b.nA=0; +b.Oa=function(){this.N=h.g.o.L("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=h.g.o.L("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.N);h.g.o.L("rect",{width:this.Vl,height:this.Xn,y:this.ck},c);var d=h.g.o.L("image",{width:h.ik.width,x:-this.vr,height:h.ik.height,y:-this.wr,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.N);d.setAttributeNS(h.g.o.Mi,"xlink:href",this.s.options.ai+h.ik.url);c=h.g.o.L("clipPath",{id:"blocklyTrashLidClipPath"+a},this.N); +h.g.o.L("rect",{width:this.Vl,height:this.ck},c);this.kq=h.g.o.L("image",{width:h.ik.width,x:-this.vr,height:h.ik.height,y:-this.wr,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.N);this.kq.setAttributeNS(h.g.o.Mi,"xlink:href",this.s.options.ai+h.ik.url);h.ma(this.N,"mouseup",this,this.click);h.gd(d,"mouseover",this,this.XF);h.gd(d,"mouseout",this,this.VF);this.Jr();return this.N}; +b.S=function(a){0this.Np&&1>this.Rh&&(this.Ft=setTimeout(this.Jr.bind(this),20))};function Kd(a,c){var d=a.s.Ia==h.vg||a.s.ie&&a.s.G;a.kq.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.Vl-4)+","+(a.ck-2)+")")}b.close=function(){Sa(this,!1)}; +b.click=function(){if(this.Si.length){for(var a=[],c=0,d;d=this.Si[c];c++)a[c]=h.R.li(d);this.P.show(a)}};b.XF=function(){this.Si.length&&Sa(this,!0)};b.VF=function(){Sa(this,!1)}; +b.mG=function(a){if(!(0>=this.s.options.Mp)&&a.type==h.i.Wn&&"shadow"!=a.bu.tagName.toLowerCase()){for(var c=a=a.bu.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.R.Md(a);if(-1==this.Si.indexOf(a)){for(this.Si.unshift(a);this.Si.length>this.s.options.Mp;)this.Si.pop();this.Np=this.EB;Kd(this,45*this.Np)}}};h.xi=function(){h.xi.w.constructor.call(this)};h.g.object.W(h.xi,h.jo);h.xi.prototype.next=function(){var a=this.Sb;if(!a)return null;(a=a.next())&&J(this,a);return a};h.xi.prototype.Mm=function(){return null};h.xi.prototype.Wf=function(){var a=this.Sb;if(!a)return null;(a=a.Wf())&&J(this,a);return a};h.xi.prototype.jn=function(){return null};h.Cl=function(a){a.Uc=this.Hm.bind(this);a.ii=this.Zz.bind(this);this.s=new h.lb(a);this.s.ke=!0;this.s.Fu(new h.xi);this.s.Yz(new h.fh);this.G=!!a.G;this.ml=a.Ia;this.Os=[];this.Lp=[];this.cm=[];this.zd=[];this.ou=[];this.jl=this.s.Ug.C.mh};b=h.Cl.prototype;b.pk=!0;b.Qh=!1;b.Ri=!0;b.wb=8;b.eh=h.Cl.prototype.wb;b.BB=3*h.Cl.prototype.eh;b.CB=3*h.Cl.prototype.eh;b.qr=2;b.rb=0;b.Wc=0;b.xE=70; +b.Oa=function(a){this.N=h.g.o.L(a,{"class":"blocklyFlyout",style:"display: none"},null);this.Hc=h.g.o.L("path",{"class":"blocklyFlyoutBackground"},this.N);this.N.appendChild(this.s.Oa());this.s.jc.subscribe(this.Hc,"flyout","fill");this.s.jc.subscribe(this.Hc,"flyoutOpacity","fill-opacity");return this.N}; +b.S=function(a){this.Ob=a;this.s.Jj=a;this.pc=new h.Ua(this.s,this.kf,!1,"blocklyFlyoutScrollbar");this.Ca();Array.prototype.push.apply(this.Os,h.ma(this.N,"wheel",this,this.yH));this.pk||(this.gp=this.Ps.bind(this),cb(this.Ob,this.gp));Array.prototype.push.apply(this.Os,h.ma(this.Hc,"mousedown",this,this.Xh));this.s.Ch=this.Ob.Ch.bind(this.Ob);this.s.Sa=this.Ob.Sa;a=this.s;a.bi=new h.Er(a)}; +b.I=function(){this.Ca();h.$a(this.Os);this.gp&&(db(this.Ob,this.gp),this.gp=null);this.pc&&(this.pc.I(),this.pc=null);this.s&&(this.s.jc.unsubscribe(this.Hc),this.s.Jj=null,this.s.I(),this.s=null);this.N&&(h.g.o.removeNode(this.N),this.N=null);this.Ob=this.Hc=null};b.Qf=function(){return this.rb};b.ey=function(){return this.Wc};b.Ek=function(){return this.s};b.isVisible=function(){return this.Qh};b.Vb=function(a){var c=a!=this.isVisible();this.Qh=a;c&&this.On()}; +b.Bj=function(a){var c=a!=this.Ri;this.Ri=a;c&&this.On()};b.On=function(){var a=this.Ri?this.isVisible():!1;this.N.style.display=a?"block":"none";this.pc.Bj(a)};b.Ca=function(){if(this.isVisible()){this.Vb(!1);for(var a=0,c;c=this.zd[a];a++)h.$a(c);this.zd.length=0;this.ci&&(db(this.s,this.ci),this.ci=null)}}; +b.show=function(a){this.s.Gc(!1);this.Ca();Ld(this);if("string"==typeof a){a=this.s.Jj.Xu[a]||null;if("function"!=typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=a(this.s.Jj);if(!Array.isArray(a))throw TypeError("Result of toolbox category callback must be an array.");}this.Vb(!0);var c=[],d=[];this.ou.length=0;for(var e=this.kf?this.BB:this.CB,f=0,g;g=a[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "BLOCK":var k=h.R.Zi(g,this.s);k.isEnabled()|| +this.ou.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)&&0Math.abs(a-c)&&(c+=this.gM*this.Ob.options.Nb.scale));return new h.g.Rect(-1E9,1E9,c,1E9)};function Od(a,c,d,e){var f=W;this.name=a;this.Uw=c;this.fA=d;this.aH=e||0;this.ph=f;this.La=new h.g.K;this.reset();console.log(this+" loaded.")}b=Od.prototype;b.fH=!1;b.cf=!1;b.Ya=0;b.Hg=0;b.facing=0;b.speed=0;b.Lf=0;b.La=null;b.At=0;b.toString=function(){return"["+this.name+"]"}; +b.reset=function(){delete this.fH;delete this.cf;delete this.speed;delete this.Lf;delete this.At;this.Ya=this.aH;this.La.x=this.fA.x;this.La.y=this.fA.y;this.facing=this.Hg=Uc(h.g.Ha.ll(Math.atan2(50-this.La.y,50-this.La.x)));var a=this.Uw;if("function"==typeof a)a=a();else if("string"!=typeof a)throw Error("Avatar "+this.name+" has invalid code: "+a);this.EF="Interpreter"in window?new Interpreter(a,this.ph.AF):null};function Pd(a,c){a.Ya+=c;100<=a.Ya&&Qd(a)} +function Qd(a){a.speed=0;a.cf=!0;a.Ya=100;a.ph.Ml.unshift(a);a.ph.Se.push({type:"DIE",avatar:a});console.log(a+" sinks.")}b.stop=function(){this.Lf=0};var W={Dd:[],Ml:[],Se:[],dk:[],AB:50,KC:100,xC:.5,bf:null,MA:1,Wv:3,ev:5,$A:5,Dq:3,Ez:0,fp:0,Uu:0,PC:3E5,Cs:null};W.JC=[new h.g.K(10,90),new h.g.K(90,10),new h.g.K(10,10),new h.g.K(90,90),new h.g.K(50,99),new h.g.K(50,1),new h.g.K(1,50),new h.g.K(99,50),new h.g.K(50,49)];W.reset=function(){clearTimeout(W.Ez);W.Se.length=0;W.dk.length=0;W.Ml.length=0;for(var a=W.Uu=0,c;c=W.Dd[a];a++)c.reset()};W.jD=function(a,c,d,e){d||(d=W.JC[W.Dd.length]);a=new Od(a,c,d,e);W.Dd.push(a)}; +W.start=function(a){W.Cs=a;W.fp=Date.now()+W.PC;console.log("Starting battle with "+W.Dd.length+" avatars.");W.update()};W.update=function(){W.sH();W.tH();W.rH();W.Dd.length<=W.Ml.length+1&&(W.fp=Math.min(W.fp,Date.now()+1E3));Date.now()>W.fp?W.stop():W.Ez=setTimeout(W.update,1E3/W.AB)};W.stop=function(){for(var a=[],c=0,d;d=W.Dd[c];c++)d.cf||a.push(d);c=a.length;for(a.sort(function(e,f){return e.Ya-f.Ya});a.length;)W.Ml.unshift(a.pop());W.Cs&&W.Cs(c)}; +W.tH=function(){for(var a=W.dk.length-1;0<=a;a--){var c=W.dk[a];c.progress+=W.Wv;var d=0;if(c.Wp-c.progressc.Lf&&(c.speed=Math.max(c.speed-W.ev,c.Lf)),0c.La.x||100c.La.y||100d&&(c.La.x-=k,c.La.y-=g,e=Math.max(c.speed,f.speed)/100*W.Dq,Pd(c,e),c.speed=0,c.Lf=0,Pd(f,e),f.speed=0,f.Lf=0,W.Se.push({type:"CRASH",avatar:c,damage:e}),W.Se.push({type:"CRASH",avatar:f,damage:e})))}};W.sH=function(){for(var a=0;ag&&(g+=360);k=e.La.x;for(var l=e.La.y,m=Infinity,n=0,t;t=e.ph.Dd[n];n++)if(t!=e&&!t.cf){var u=t.La.x,w=t.La.y;t=Math.sqrt((w-l)*(w-l)+(u-k)*(u-k));t>=m||(u=Math.atan2(w-l,u-k),u=Uc(h.g.Ha.ll(u)),uk?e=!1:(f.At=k,k=new h.g.K(f.La.x,f.La.y),e=Uc(e),f.facing=e,g=h.g.Ha.Ef(g,0,70),e={qD:f,Cn:k,Hg:e,Wp:g,ym:new h.g.K(k.x+g*Math.cos(h.g.Ha.nd(e)),k.y+g*Math.sin(h.g.Ha.nd(e))),progress:0},f.ph.dk.push(e),f.ph.Se.push({type:"BANG",avatar:f,degree:e.Hg}),e=!0);return e};a.setProperty(c,"cannon", +a.createNativeFunction(d));d=function(e,f){var g=W.bf;f=void 0===f||null===f?50:f;if("number"!=typeof e||isNaN(e)||"number"!=typeof f||isNaN(f))throw TypeError;g.Hg!=Uc(e)&&(50>=g.speed?(g.Hg=Uc(e),g.facing=g.Hg):f=0);0==g.speed&&0a.length)){e=[];for(f=0;fthis.tn)return null;var a=this.getOptions(!0)[this.tn][0];return"object"==typeof a?a.alt:a}; +h.Ja.qA=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;dthis.an&&h.g.V.Gb(a,h.g.V.State.UC,this.an);return a};h.Tc.register("field_number",h.Gd);h.Hd=function(a,c,d,e,f){this.qj=h.Hd.zE;this.iE=a||"";this.bc=new h.g.Ve(0,h.wa.Yq);f&&this.Kd(f);c&&(this.Oj=c);f||xe(this,d,e)};h.g.object.W(h.Hd,h.Ja);h.Hd.va=function(a){var c=h.g.le(a.variable);return new h.Hd(c,void 0,void 0,void 0,a)};b=h.Hd.prototype;b.s=null;b.Hi=!0;b.Kd=function(a){h.Hd.w.Kd.call(this,a);xe(this,a.variableTypes,a.defaultType)};b.fj=function(){if(!this.Ud){var a=h.O.op(this.B.v,null,this.iE,this.hE);h.i.disable();this.setValue(a.ua());h.i.enable()}}; +b.Cm=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=h.O.op(this.B.v,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.ua()+"' had type "+c.type+", and does not match variable field that references it: "+h.R.Md(a)+".");this.setValue(c.ua())};b.kA=function(a){this.fj();a.id=this.Ud.ua();a.textContent=this.Ud.name;this.Ud.type&&a.setAttribute("variabletype",this.Ud.type);return a}; +b.Lu=function(a){if(a.cb)throw Error("Variable fields are not allowed to exist on shadow blocks.");h.Hd.w.Lu.call(this,a)};b.getValue=function(){return this.Ud?this.Ud.ua():null};b.Tb=function(){return this.Ud?this.Ud.name:""};b.Vc=function(){return this.Ud};b.sy=function(){return this.Ud?this.Oj:null}; +b.wh=function(a){if(null===a)return null;var c=h.O.Vc(this.B.v,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=ye(this)){for(var e=0;ed;d+=15)h.g.o.L("line",{x1:h.ka.mc+h.ka.sg,y1:h.ka.mc,x2:h.ka.mc+h.ka.sg-(0==d% +45?10:5),y2:h.ka.mc,"class":"blocklyAngleMarks",transform:"rotate("+d+","+h.ka.mc+","+h.ka.mc+")"},a);this.OD=h.ma(a,"click",this,this.tF);this.ND=h.ma(c,"click",this,this.Az,!0,!0);this.$F=h.ma(c,"mousemove",this,this.Az,!0,!0);return a};b.Ms=function(){h.$a(this.OD);h.$a(this.ND);h.$a(this.$F)};b.tF=function(){h.D.Hk(this);h.aa.Ca()}; +b.Az=function(a){var c=this.Ts.ownerSVGElement.getBoundingClientRect(),d=a.clientX-c.left-h.ka.mc;a=a.clientY-c.top-h.ka.mc;c=Math.atan(-a/d);isNaN(c)||(c=h.g.Ha.ll(c),0>d?c+=180:0c&&(c+=360);c>a.yA&&(c-=360);return c}h.Ed.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.ka);h.Generator=function(a){this.dG=a;this.xB=new RegExp(this.ue,"g")};h.Generator.sb="generated_function";b=h.Generator.prototype;b.qo=null;b.Jd=null;b.Oc=null;b.rd=" ";b.aB=60;b.Ao=[]; +function kd(){var a=h.j,c=C;c||(console.warn("No workspace specified in workspaceToCode call. Guessing."),c=h.Ab());var d=[];a.S(c);c=D(c,!0);for(var e=0,f;f=c[e];e++){var g=Ce(a,f);Array.isArray(g)&&(g=g[0]);g&&(f.M&&(g=a.Uz(g),a.Jd&&!f.ki&&(g=X(a.Jd,f)+g),a.Oc&&!f.ki&&(g+=X(a.Oc,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 De(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)} +function Ce(a,c){if(!c)return"";if(!c.isEnabled())return Ce(a,q(c));var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.dG+'" 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.eq(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.Jd&&!c.ki&&(d=X(a.Jd,c)+d),a.Oc&&!c.ki&&(d+=X(a.Oc,c)),a.eq(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+ +d);} +function Y(a,c,d){var e=h.j;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=Nb(a,c);if(!f)return"";c=Ce(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;gd?Y(a,c,h.j.gk)||g:e?Y(a,c,h.j.Ll)||g:Y(a,c,f)||g;if(h.Ph(a))a=Number(a)+d,e&&(a=-a);else{if(0d&&(a=a+" - "+-d,k=h.j.gk);e&&(a=d?"-("+a+")":"-"+a,k=h.j.Ll);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};h.j.Ha={};h.j.math_number=function(a){a=Number(G(a,"NUM"));return[a,0<=a?h.j.Ci:h.j.Ll]};h.j.math_arithmetic=function(a){var c={ADD:[" + ",h.j.ih],MINUS:[" - ",h.j.gk],MULTIPLY:[" * ",h.j.er],DIVIDE:[" / ",h.j.Il],POWER:[null,h.j.Lc]}[G(a,"OP")],d=c[0];c=c[1];var e=Y(a,"A",c)||"0";a=Y(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",h.j.gb]}; +h.j.math_single=function(a){var c=G(a,"OP");if("NEG"==c)return a=Y(a,"NUM",h.j.Ll)||"0","-"==a[0]&&(a=" "+a),["-"+a,h.j.Ll];a="SIN"==c||"COS"==c||"TAN"==c?Y(a,"NUM",h.j.Il)||"0":Y(a,"NUM",h.j.Mc)||"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.j.gb];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.j.Il]}; +h.j.math_constant=function(a){return{PI:["Math.PI",h.j.Rb],E:["Math.E",h.j.Rb],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",h.j.Il],SQRT2:["Math.SQRT2",h.j.Rb],SQRT1_2:["Math.SQRT1_2",h.j.Rb],INFINITY:["Infinity",h.j.Ci]}[G(a,"CONSTANT")]}; +h.j.math_number_property=function(a){var c=Y(a,"NUMBER_TO_CHECK",h.j.Kl)||"0",d=G(a,"PROPERTY");if("PRIME"==d){var e=He("mathIsPrime",["function "+h.j.ue+"(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.j.gb]}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=Y(a,"DIVISOR",h.j.Kl)||"0",e=c+" % "+a+" == 0"}return[e,h.j.aw]}; +h.j.math_change=function(a){var c=Y(a,"DELTA",h.j.ih)||"0";a=Q(G(a,"VAR"),h.O.sb);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};h.j.math_round=h.j.math_single;h.j.math_trig=h.j.math_single; +h.j.math_on_list=function(a){var c=G(a,"OP");switch(c){case "SUM":a=Y(a,"LIST",h.j.Rb)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=Y(a,"LIST",h.j.Lc)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=Y(a,"LIST",h.j.Lc)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=He("mathMean",["function "+h.j.ue+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "MEDIAN":c= +He("mathMedian",["function "+h.j.ue+"(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=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "MODE":c=He("mathModes", +["function "+h.j.ue+"(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=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=He("mathStandardDeviation",["function "+h.j.ue+"(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=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "RANDOM":c=He("mathRandomList",["function "+h.j.ue+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,h.j.gb]};h.j.math_modulo=function(a){var c=Y(a,"DIVIDEND",h.j.Kl)||"0";a=Y(a,"DIVISOR",h.j.Kl)||"0";return[c+" % "+a,h.j.Kl]}; +h.j.math_constrain=function(a){var c=Y(a,"VALUE",h.j.Lc)||"0",d=Y(a,"LOW",h.j.Lc)||"0";a=Y(a,"HIGH",h.j.Lc)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",h.j.gb]}; +h.j.math_random_int=function(a){var c=Y(a,"FROM",h.j.Lc)||"0";a=Y(a,"TO",h.j.Lc)||"0";return[He("mathRandomInt",["function "+h.j.ue+"(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.j.gb]};h.j.math_random_float=function(){return["Math.random()",h.j.gb]}; +h.j.math_atan2=function(a){var c=Y(a,"X",h.j.Lc)||"0";return["Math.atan2("+(Y(a,"Y",h.j.Lc)||"0")+", "+c+") / Math.PI * 180",h.j.Il]};h.Qb=function(a){h.Qb.w.constructor.call(this,null);this.Nz=a};h.g.object.W(h.Qb,h.Id);b=h.Qb.prototype;b.rl=0;b.Un=0; +b.Es=function(a){h.g.o.L("rect",{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);h.g.o.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.o.L("circle",{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};b.qt=function(a){this.U.jd()&&h.Id.prototype.qt.call(this,a)}; +b.ks=function(){this.Gn=h.g.o.L("svg",{x:h.oa.cd,y:h.oa.cd},null);if(this.Nz.length)for(var a=h.g.xml.createElement("xml"),c=0,d;d=this.Nz[c];c++){var e=h.g.xml.createElement("block");e.setAttribute("type",d);a.appendChild(e)}else a=null;a={disable:!1,Ig:this.U.v.options.Ig,Sk:a,Nb:this.U.v,ai:this.U.v.options.ai,G:this.U.G,Ia:this.U.G?h.vg:h.Yd,ie:!1,Uc:this.WE.bind(this),ii:null,Tg:this.U.v.options.Tg};this.s=new h.lb(a);this.s.lj=!0;cb(this.s,h.i.oE);a=wc(this.s,"g");c=this.s.Oa("blocklyMutatorBackground"); +c.insertBefore(a,this.s.pb);this.Gn.appendChild(c);return this.Gn};b.ah=function(){h.Qb.w.ah.call(this);this.U.$b||(this.U.jd()?this.Od&&h.g.o.Ec(this.Od,"blocklyIconGroupReadonly"):(this.Vb(!1),this.Od&&h.g.o.Cb(this.Od,"blocklyIconGroupReadonly")))}; +function Ie(a){var c=2*h.oa.cd,d=a.s.pb.getBBox();var e=a.U.G?-d.x:d.width+d.x;d=d.height+3*c;if(a.s.P){var f=a.s.P.Hm();d=Math.max(d,f.ce+20)}e+=3*c;if(Math.abs(a.rl-e)>c||Math.abs(a.Un-d)>c)a.rl=e,a.Un=d,a.Yb.un(e+c,d+c),a.Gn.setAttribute("width",a.rl),a.Gn.setAttribute("height",a.Un);a.U.G&&a.s.pb.setAttribute("transform","translate("+a.rl+",0)");a.s.resize()} +b.Vb=function(a){if(a!=this.isVisible())if(h.i.Ka(new h.i.ud(this.U,"mutatorOpen",!a,a)),a){this.Yb=new h.oa(this.U.v,this.ks(),this.U.Td,this.Kk,null,null);gb(this.Yb,this.U.id);if(a=this.s.options.Sk)this.s.P.S(this.s),this.s.P.show(a.childNodes);this.Vg=this.U.Gg(this.s);a=p(this.Vg,!1);for(var c=0,d;d=a[c];c++)d.za();this.Vg.gq(!1);this.Vg.ps=!1;this.s.P?(a=2*this.s.P.wb,c=xc(this.s).Qf()+a):c=a=16;this.U.G&&(c=-c);this.Vg.moveBy(c,a);if(this.U.cq){var e=this;this.U.cq(this.Vg);this.hq=function(){e.U.cq(e.Vg)}; +cb(this.U.v,this.hq)}Ie(this);cb(this.s,this.AH.bind(this));this.Qe()}else this.Gn=null,this.s.I(),this.Vg=this.s=null,this.Yb.I(),this.Yb=null,this.Un=this.rl=0,this.hq&&(db(this.U.v,this.hq),this.hq=null)}; +b.AH=function(a){if(a.type!=h.i.Io&&(a.type!=h.i.si||"disabled"!=a.element)){if(!this.s.gc()){a=D(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Qa(),f=H(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.Vg.v==this.s){h.i.$(!0);d=this.U;a=(a=d.eb())&&h.R.Md(a);c=d.ba;d.ba=!1;d.Dg(this.Vg);d.ba=c;d.Ke();c=(c=d.eb())&&h.R.Md(c);if(a!=c){h.i.Ka(new h.i.hg(d,"mutation",null,a,c));var g=h.i.Zb();setTimeout(function(){h.i.$(g);d.Kb();h.i.$(!1)},h.Yn)}d.ba&&d.za();a!=c&&h.Le&&h.navigation.ZF(d);this.s.gc()|| +Ie(this);h.i.$(!1)}}};b.WE=function(){return{Pb:this.Un,Bb:this.rl-xc(this.s).Qf(),fd:0,Pc:this.s.G?0:xc(this.s).Qf()}};b.I=function(){this.U.Pd=null;h.Id.prototype.I.call(this)};h.Qb.$k=function(a,c,d){if(!a||!a.B.v)return!1;d=B(c,d).connection;var e=z(a);return e&&e!=c||d.ca==a?!1:(d.isConnected()&&d.disconnect(),d.connect(a),!0)};h.Qb.Nx=function(a){var c=null;if(a&&a.options){var d=a.options.Nb;a.ke?d&&d.options&&(c=d.options.Nb):d&&(c=d)}return c};h.J.Ht={};h.la.bC={};h.la.bC.oo=260; +h.zk([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}", +args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value", +name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]); +h.J.lists_create_with={S:function(){this.ub=h.h.LISTS_CREATE_WITH_HELPURL;M(this,"list_blocks");this.yd=3;this.Ic();this.Ad(!0,"Array");this.ji(new h.Qb(["lists_create_with_item"]));this.Ra(h.h.LISTS_CREATE_WITH_TOOLTIP)},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("items",this.yd);return a},zb:function(a){this.yd=parseInt(a.getAttribute("items"),10);this.Ic()},Gg:function(a){var c=a.Uh("lists_create_with_container");c.Ke();for(var d=B(c,"STACK").connection,e=0;e","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.zk([{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.la.ed.Ar={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.Y.register("logic_op_tooltip",h.Y.Lo("OP",h.la.ed.Ar)); +h.la.ed.Fq={Nd:0,De:0,ki:!0,eb:function(){if(!this.Nd&&!this.De)return null;var a=h.g.xml.createElement("mutation");this.Nd&&a.setAttribute("elseif",this.Nd);this.De&&a.setAttribute("else",1);return a},zb:function(a){this.Nd=parseInt(a.getAttribute("elseif"),10)||0;this.De=parseInt(a.getAttribute("else"),10)||0;this.IG()},Gg:function(a){var c=a.Uh("controls_if_if");c.Ke();for(var d=c.X,e=1;e<=this.Nd;e++){var f=a.Uh("controls_if_elseif");f.Ke();d.connect(f.Z);d=f.X}this.De&&(a=a.Uh("controls_if_else"), +a.Ke(),d.connect(a.Z));return c},Dg:function(a){a=z(a.X);this.De=this.Nd=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.Nd++;c.push(a.bv);d.push(a.rf);break;case "controls_if_else":this.De++;e=a.rf;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.X&&z(a.X)}this.Ic();this.Oz(c,d,e)},cq:function(a){a=z(a.X);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=B(this,"IF"+c),e=B(this,"DO"+c);a.bv=d&&d.connection.ca;a.rf=e&&e.connection.ca; +c++;break;case "controls_if_else":e=B(this,"ELSE");a.rf=e&&e.connection.ca;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.X&&z(a.X)}},IG:function(){var a=[null],c=[null],d=null;B(this,"ELSE")&&(d=B(this,"ELSE").connection.ca);for(var e=1;B(this,"IF"+e);){var f=B(this,"DO"+e);a.push(B(this,"IF"+e).connection.ca);c.push(f.connection.ca);e++}this.Ic();this.Oz(a,c,d)},Ic:function(){B(this,"ELSE")&&this.ib("ELSE");for(var a=1;B(this,"IF"+a);)this.ib("IF"+a),this.ib("DO"+a),a++;for(a= +1;a<=this.Nd;a++)L(N(this,"IF"+a).vb("Boolean"),h.h.CONTROLS_IF_MSG_ELSEIF),L(Lb(this,"DO"+a),h.h.CONTROLS_IF_MSG_THEN);this.De&&L(Lb(this,"ELSE"),h.h.CONTROLS_IF_MSG_ELSE)},Oz:function(a,c,d){for(var e=1;e<=this.Nd;e++)h.Qb.$k(a[e],this,"IF"+e),h.Qb.$k(c[e],this,"DO"+e);h.Qb.$k(d,this,"ELSE")}};h.Y.wu("controls_if_mutator",h.la.ed.Fq,null,["controls_if_elseif","controls_if_else"]); +h.la.ed.yv=function(){this.Ra(function(){if(this.Nd||this.De){if(!this.Nd&&this.De)return h.h.CONTROLS_IF_TOOLTIP_2;if(this.Nd&&!this.De)return h.h.CONTROLS_IF_TOOLTIP_3;if(this.Nd&&this.De)return h.h.CONTROLS_IF_TOOLTIP_4}else return h.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};h.Y.register("controls_if_tooltip",h.la.ed.yv); +h.la.ed.YB={onchange:function(a){this.Yk||(this.Yk=[null,null]);var c=Nb(this,"A"),d=Nb(this,"B");c&&d&&!Ea(c.M,d.M)&&(h.i.$(a.group),a=this.Yk[0],a!==c&&(A(c),a&&!a.cb&&B(this,"A").connection.connect(a.M)),c=this.Yk[1],c!==d&&(A(d),c&&!c.cb&&B(this,"B").connection.connect(c.M)),this.Kb(),h.i.$(!1));this.Yk[0]=Nb(this,"A");this.Yk[1]=Nb(this,"B")}};h.la.ed.XB=function(){this.rj(h.la.ed.YB)};h.Y.register("logic_compare",h.la.ed.XB); +h.la.ed.ZB={Kz:null,onchange:function(a){var c=Nb(this,"THEN"),d=Nb(this,"ELSE"),e=this.M.ca;if((c||d)&&e)for(var f=0;2>f;f++){var g=1==f?c:d;g&&!Ea(g.M,e)&&(h.i.$(a.group),e===this.Kz?(A(this),e.B.Kb()):(A(g),g.Kb()),h.i.$(!1))}this.Kz=e}};h.Y.Xp("logic_ternary",h.la.ed.ZB);h.J.PF={};h.la.ve={};h.la.ve.oo=120; +h.zk([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1", +args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement", +name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1", +args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null, +nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip", +"controls_flow_in_loop_check"]}]);h.la.ve.YC={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};h.Y.register("controls_whileUntil_tooltip",h.Y.Lo("MODE",h.la.ve.YC));h.la.ve.QA={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};h.Y.register("controls_flow_tooltip",h.Y.Lo("FLOW",h.la.ve.QA)); +h.la.ve.gB={Fg:function(a){if(!this.$b){var c=y(this,"VAR").Vc(),d=c.name;if(!this.isCollapsed()&&null!=d){var e={enabled:!0};e.text=h.h.VARIABLES_SET_CREATE_GET.replace("%1",d);c=h.O.Dm(c);d=h.g.xml.createElement("block");d.setAttribute("type","variables_get");d.appendChild(c);e.yb=h.Ea.Mo(this,d);a.push(e)}}}};h.Y.Xp("contextMenu_newGetVariableBlock",h.la.ve.gB);h.Y.register("controls_for_tooltip",h.Y.Wr("%{BKY_CONTROLS_FOR_TOOLTIP}"));h.Y.register("controls_forEach_tooltip",h.Y.Wr("%{BKY_CONTROLS_FOREACH_TOOLTIP}")); +h.la.ve.eo={aC:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],ki:!0,qy:function(a){do{if(-1!=h.la.ve.eo.aC.indexOf(a.type))return a;a=Gb(a)}while(a);return null},onchange:function(){this.v.gc&&!this.v.gc()&&(h.la.ve.eo.qy(this)?(this.Yg(null),this.$b||this.md(!0)):(this.Yg(h.h.CONTROLS_FLOW_STATEMENTS_WARNING),this.$b||Kb(this)||this.md(!1)))}};h.Y.Xp("controls_flow_in_loop_check",h.la.ve.eo);h.Kc=function(a,c,d){this.Ow=null;null==a&&(a="FALSE");h.Kc.w.constructor.call(this,a,c,d);this.bc.width=h.Kc.ZC};h.g.object.W(h.Kc,h.Na);h.Kc.va=function(a){return new h.Kc(a.checked,void 0,a)};h.Kc.ZC=15;h.Kc.UA="\u2713";h.Kc.VA=h.Na.wi-3;h.Kc.WA=14;b=h.Kc.prototype;b.Hi=!0;b.Hq="default";b.Sf=!1;b.Kd=function(a){h.Kc.w.Kd.call(this,a);a.checkCharacter&&(this.Ow=a.checkCharacter)}; +b.Jh=function(){h.Kc.w.Jh.call(this);this.ic.setAttribute("x",h.Kc.VA);this.ic.setAttribute("y",h.Kc.WA);h.g.o.Cb(this.ic,"blocklyCheckbox");this.Kj.nodeValue=this.Ow||h.Kc.UA;this.ic.style.display=this.cc?"block":"none"};b.qf=function(){this.setValue(!this.cc)};b.wh=function(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null};b.Yi=function(a){this.cc=Je(a);this.ic&&(this.ic.style.display=this.cc?"block":"none")};b.getValue=function(){return this.cc?"TRUE":"FALSE"};b.Tb=function(){return String(Je(this.cc))}; +function Je(a){return"string"==typeof a?"TRUE"==a:!!a}h.Tc.register("field_checkbox",h.Kc);h.J.GG={}; +h.J.procedures_defnoreturn={S:function(){var a=new h.xb("",h.Ga.Yp);se(a);L(L(L(O(this),h.h.PROCEDURES_DEFNORETURN_TITLE),a,"NAME"),"","PARAMS");this.ji(new h.Qb(["procedures_mutatorarg"]));(this.v.options.hm||this.v.options.Nb&&this.v.options.Nb.options.hm)&&h.h.PROCEDURES_DEFNORETURN_COMMENT&&this.$f(h.h.PROCEDURES_DEFNORETURN_COMMENT);M(this,"procedure_blocks");this.Ra(h.h.PROCEDURES_DEFNORETURN_TOOLTIP);this.ub=h.h.PROCEDURES_DEFNORETURN_HELPURL;this.xa=[];this.Xb=[];this.cg(!0);this.rf=null}, +cg:function(a){this.vp!==a&&(a?(L(Lb(this,"STACK"),h.h.PROCEDURES_DEFNORETURN_DO),B(this,"RETURN")&&Mb(this,"STACK","RETURN")):this.ib("STACK",!0),this.vp=a)},Qn:function(){var a="";this.xa.length&&(a=h.h.PROCEDURES_BEFORE_PARAMS+" "+this.xa.join(", "));h.i.disable();try{Jb(this,a,"PARAMS")}finally{h.i.enable()}},eb:function(a){var c=h.g.xml.createElement("mutation");a&&c.setAttribute("name",G(this,"NAME"));for(var d=0;d b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];", +" return function(a, b) { return compare(a, b) * direction; }","}"]);return[c+".slice().sort("+e+'("'+a+'", '+d+"))",h.j.gb]};h.j.lists_split=function(a){var c=Y(a,"INPUT",h.j.Rb),d=Y(a,"DELIM",h.j.Mc)||"''";a=G(a,"MODE");if("SPLIT"==a)c||(c="''"),a="split";else if("JOIN"==a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+d+")",h.j.gb]};h.j.lists_reverse=function(a){return[(Y(a,"LIST",h.j.gb)||"[]")+".slice().reverse()",h.j.gb]};h.j.NF={};h.j.controls_if=function(a){var c=0,d="";h.j.Jd&&(d+=X(h.j.Jd,a));do{var e=Y(a,"IF"+c,h.j.Mc)||"false";var f=Ee(a,"DO"+c);h.j.Oc&&(f=De(X(h.j.Oc,a),h.j.rd)+f);d+=(0",GTE:">="}[G(a,"OP")],d="=="==c||"!="==c?h.j.aw:h.j.pC,e=Y(a,"A",d)||"0";a=Y(a,"B",d)||"0";return[e+" "+c+" "+a,d]};h.j.logic_operation=function(a){var c="AND"==G(a,"OP")?"&&":"||",d="&&"==c?h.j.cr:h.j.dr,e=Y(a,"A",d);a=Y(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.j.logic_negate=function(a){var c=h.j.Jl;return["!"+(Y(a,"BOOL",c)||"true"),c]}; +h.j.logic_boolean=function(a){return["TRUE"==G(a,"BOOL")?"true":"false",h.j.Ci]};h.j.logic_null=function(){return["null",h.j.Ci]};h.j.logic_ternary=function(a){var c=Y(a,"IF",h.j.zo)||"false",d=Y(a,"THEN",h.j.zo)||"null";a=Y(a,"ELSE",h.j.zo)||"null";return[c+" ? "+d+" : "+a,h.j.zo]};h.j.PF={};h.j.controls_repeat_ext=function(a){var c=y(a,"TIMES")?String(Number(G(a,"TIMES"))):Y(a,"TIMES",h.j.rg)||"0",d=Ee(a,"DO");d=Fe(d,a);a="";var e=Fc(h.j.Cd,"count",h.O.sb),f=c;c.match(/^\w+$/)||h.Ph(c)||(f=Fc(h.j.Cd,"repeat_end",h.O.sb),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")};h.j.controls_repeat=h.j.controls_repeat_ext; +h.j.controls_whileUntil=function(a){var c="UNTIL"==G(a,"MODE"),d=Y(a,"BOOL",c?h.j.Jl:h.j.Mc)||"false",e=Ee(a,"DO");e=Fe(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"}; +h.j.controls_for=function(a){var c=Q(G(a,"VAR"),h.O.sb),d=Y(a,"FROM",h.j.rg)||"0",e=Y(a,"TO",h.j.rg)||"0",f=Y(a,"BY",h.j.rg)||"1",g=Ee(a,"DO");g=Fe(g,a);if(h.Ph(d)&&h.Ph(e)&&h.Ph(f)){var k=Number(d)<=Number(e);a="for ("+c+" = "+d+"; "+c+(k?" <= ":" >= ")+e+"; "+c;c=Math.abs(Number(f));a=(1==c?a+(k?"++":"--"):a+((k?" += ":" -= ")+c))+(") {\n"+g+"}\n")}else a="",k=d,d.match(/^\w+$/)||h.Ph(d)||(k=Fc(h.j.Cd,c+"_start",h.O.sb),a+="var "+k+" = "+d+";\n"),d=e,e.match(/^\w+$/)||h.Ph(e)||(d=Fc(h.j.Cd,c+"_end", +h.O.sb),a+="var "+d+" = "+e+";\n"),e=Fc(h.j.Cd,c+"_inc",h.O.sb),a+="var "+e+" = ",a=h.Ph(f)?a+(Math.abs(f)+";\n"):a+("Math.abs("+f+");\n"),a=a+("if ("+k+" > "+d+") {\n")+(h.j.rd+e+" = -"+e+";\n"),a+="}\n",a+="for ("+c+" = "+k+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+g+"}\n";return a}; +h.j.controls_forEach=function(a){var c=Q(G(a,"VAR"),h.O.sb),d=Y(a,"LIST",h.j.rg)||"[]",e=Ee(a,"DO");e=Fe(e,a);a="";var f=d;d.match(/^\w+$/)||(f=Fc(h.j.Cd,c+"_list",h.O.sb),a+="var "+f+" = "+d+";\n");d=Fc(h.j.Cd,c+"_index",h.O.sb);e=h.j.rd+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")}; +h.j.controls_flow_statements=function(a){var c="";h.j.Jd&&(c+=X(h.j.Jd,a));h.j.Oc&&(c+=X(h.j.Oc,a));if(h.j.Jd){var d=h.la.ve.eo.qy(a);d&&!d.ki&&(c+=X(h.j.Jd,d))}switch(G(a,"FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");};h.j.GG={};h.j.procedures_defreturn=function(a){var c=Q(G(a,"NAME"),h.Ga.sb),d="";h.j.Jd&&(d+=X(h.j.Jd,a));h.j.Oc&&(d+=X(h.j.Oc,a));d&&(d=De(d,h.j.rd));var e="";h.j.qo&&(e=De(X(h.j.qo,a),h.j.rd));var f=Ee(a,"STACK"),g=Y(a,"RETURN",h.j.Mc)||"",k="";f&&g&&(k=d);g&&(g=h.j.rd+"return "+g+";\n");for(var l=[],m=0;m","GT"],[">=","GTE"]]),"OP");this.$c(!0);var a=this;this.Ra(function(){var c=G(a,"OP");return{EQ:h.h.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:h.h.LOGIC_COMPARE_TOOLTIP_NEQ,LT:h.h.LOGIC_COMPARE_TOOLTIP_LT,LTE:h.h.LOGIC_COMPARE_TOOLTIP_LTE,GT:h.h.LOGIC_COMPARE_TOOLTIP_GT,GTE:h.h.LOGIC_COMPARE_TOOLTIP_GTE}[c]});this.Yk= +[null,null]};h.h.LOGIC_OPERATION_AND="&&";h.h.LOGIC_OPERATION_OR="||";h.h.LOGIC_NEGATE_TITLE="! %1";h.h.LOGIC_BOOLEAN_TRUE="true";h.h.LOGIC_BOOLEAN_FALSE="false";h.J.controls_whileUntil.S=function(){P(this,{message0:"while ( %1 ) { %2 %3 }",args0:[{type:"input_value",name:"BOOL",check:"Boolean"},{type:"input_dummy"},{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.LOOPS_HUE,tooltip:h.h.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,helpUrl:h.h.CONTROLS_WHILEUNTIL_HELPURL})}; +h.J.controls_for.S=function(){P(this,{message0:"for (var %1 = %2; %3 < %4; %5 += 1) { %6 %7 }",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"field_label",name:"VAR1",text:"?"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"field_label",name:"VAR2",text:"?"},{type:"input_dummy"},{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.LOOPS_HUE,helpUrl:h.h.CONTROLS_FOR_HELPURL}); +var a=this;this.Ra(function(){return h.h.CONTROLS_FOR_TOOLTIP.replace("%1",G(a,"VAR"))})};h.J.controls_for.onchange=function(){var a=y(this,"VAR").Tb();Jb(this,a,"VAR1");Jb(this,a,"VAR2")};h.j.controls_for=function(a){var c=Q(G(a,"VAR"),h.O.sb),d=Y(a,"FROM",h.j.rg)||"0",e=Y(a,"TO",h.j.rg)||"0",f=Ee(a,"DO");f=Fe(f,a.id);return"for (var "+c+" = "+d+"; "+c+" < "+e+"; "+c+" += 1) {\n"+f+"}\n"};h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break ;";h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue ;"; +h.J.math_arithmetic.S=function(){P(this,{message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["+","ADD"],["-","MINUS"],["*","MULTIPLY"],["/","DIVIDE"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:h.h.MATH_HUE,helpUrl:h.h.MATH_ARITHMETIC_HELPURL});var a=this;this.Ra(function(){var c=G(a,"OP");return{ADD:h.h.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:h.h.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:h.h.MATH_ARITHMETIC_TOOLTIP_MULTIPLY, +DIVIDE:h.h.MATH_ARITHMETIC_TOOLTIP_DIVIDE}[c]})};h.J.math_change.S=function(){P(this,{message0:"%1 += %2;",args0:[{type:"field_variable",name:"VAR",variable:"name"},{type:"input_value",name:"DELTA",check:"Number"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.VARIABLES_HUE,helpUrl:h.h.MATH_CHANGE_HELPURL});var a=this;this.Ra(function(){return h.h.MATH_CHANGE_TOOLTIP.replace("%1",G(a,"VAR"))})}; +h.j.math_change=function(a){var c=Y(a,"DELTA",h.j.ih)||"0";return Q(G(a,"VAR"),h.O.sb)+" += "+c+";\n"};h.J.math_random_int.S=function(){P(this,{message0:"%1(%2,%3)",args0:["Math.randomInt",{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",colour:h.h.MATH_HUE,tooltip:h.h.MATH_RANDOM_INT_TOOLTIP,helpUrl:h.h.MATH_RANDOM_INT_HELPURL})};h.h.MATH_RANDOM_FLOAT_TITLE_RANDOM="Math.random ( )";h.h.LISTS_CREATE_EMPTY_TITLE="[ ]"; +h.h.LISTS_CREATE_WITH_INPUT_WITH="[";h.J.lists_create_with.Ic=function(){B(this,"TAIL")&&this.ib("TAIL");this.yd&&B(this,"EMPTY")?this.ib("EMPTY"):this.yd||B(this,"EMPTY")||L(O(this,"EMPTY"),h.h.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function bf(a){return cf[a]}var af=/[\x00\x22\x26\x27\x3c\x3e]/g;function df(){return'
'};function ef(){for(var a=Ic,c='
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
Busque inimigos. Especifique uma dire\u00e7\u00e3o(0-360). \\nRetorna a distancia do inimigo mais proximo \\nnaquela dire\u00e7\u00e3o. Retorna infinito se nenhum \\ninimigo for encontrado. Dispare o canh\u00e3o. Especifique uma dire\u00e7\u00e3o \\n(0-360) e o alcance (0-70). Nadar para a frente. Especifique uma dire\u00e7\u00e3o \\n(0-360). Parar de nadar. O jogador fara uma parada lenta. Retorna a saude atual do jogador (0 esta morto, \\n100 esta saud\u00e1vel). Retorna a velocidade atual do jogador (0 esta \\npar\u00e1do, 100 esta na velocidade maxima) Retorna a coordenada X do jogador (0 \u00e9 a margem \\nesquerda, 100 \u00e9 a margem direita). Retorna a coordenada Y do jogador (0 \u00e9 a borda \\ninferior, 100 \u00e9 a borda superior).
JogadorAlvoPenduloAssustado

'+ +((Kc?'':'')+"Jogos do Blockly : "+Z({appName:"Tutor de Lagoa"}.appName)+""),d="   ",e=1;11>e;e++)d+=" "+(e==R?''+Z(e)+"":10==e?''+Z(e)+"":'');a=c+d+'

  
'; +switch(R){case 1:case 3:case 5:case 7:case 9:a+='
';break;case 2:case 4:case 6:case 8:case 10:a+='
'}return a+='\n\n\n\n\n\n
Parab\u00e9ns!
'+ +(df()+"
")+(5==R||6==R?'
Sua solu\u00e7\u00e3o funciona, mas voc\u00ea pode fazer melhor. Use \'scan\' para mostrar ao canh\u00e3o o qu\u00e3o longe atirar.
'+df()+"
":"")+'
'+(1==R||2==R?"Use o comando 'cannon' para atingir o alvo. O primeiro par\u00e2metro \u00e9 o \u00e2ngulo, o segundo \u00e9 o alcance. Ache a combina\u00e7\u00e3o correta."+ +(1==R?'

0\u00b070cannon(,);': +2==R?"
cannon(0, 70);
":""):3==R||4==R?"Este alvo deve ser acertado v\u00e1rias vezes. Use o ciclo 'while (true)' para fazer algo indefinidamente."+(3==R?'

while () {}true \u25be': +4==R?"
while (true) {\n  ...\n}
":""):5==R||6==R?"Esse oponente move-se para frente e para tr\u00e1s, fazendo ficar dif\u00edcil acert\u00e1-lo. A Express\u00e3o 'scan' retorna o alcance exato do oponente naquela dire\u00e7\u00e3o."+(5==R?'

0\u00b0scan()

': +6==R?"
scan(0)
":"")+"Este alcance \u00e9 exatamente o que o comando 'cannon' precisa para atirar precisamente.":7==R||8==R?"Esse oponente est\u00e1 muito longe para usar o canh\u00e3o (que tem um alcance de 70 metros). Inv\u00e9s disso, use o comando 'swim' para come\u00e7ar a nadar at\u00e9 o oponente e trombar nele."+(7==R?'

0\u00b0swim();': +8==R?"
swim(0);
":""):9==R?"Este oponente tamb\u00e9m est\u00e1 muito longe para usar o canh\u00e3o. Mas voc\u00ea est\u00e1 muito fraco para sobreviver \u00e0 uma colis\u00e3o. Nade at\u00e9 o oponente enquanto sua posi\u00e7\u00e3o horizontal for menor que 50. Ent\u00e3o 'pare' e use o canh\u00e3o."+(9==R?'

< \u25be50getX()

stop();': +10==R?"
getX() < 50
stop();
":""):10==R?"Este oponente ir\u00e1 se mover para longe quando golpeado. Nade at\u00e9 ele se est\u00e1 fora do alcance (70 metros).":"")+"
"+df()+"
"};var Sc="pond-tutor"; +window.addEventListener("load",function(){document.body.innerHTML=ef();V.S();$d();Tc("runButton",me);Tc("resetButton",oe);Tc("docsButton",ke);Tc("closeDocs",le);setTimeout(V.xF,1);setTimeout(V.yF,1);Tc("helpButton",re);2>location.hash.length&&!Qc(R)&&setTimeout(re,1E3);var a=-1!=Hc.indexOf(Ic),c=document.getElementById("blockly"),d=document.getElementById("editor"),e=document.getElementById("visualization");if(c){var f=function(){c.style.top=Math.max(10,e.offsetTop-window.pageYOffset)+"px";c.style.left= +a?"10px":"420px";c.style.width=window.innerWidth-440+"px"};window.addEventListener("scroll",function(){f(null);h.il(C)});f(null);var g=document.getElementById("toolbox");C=h.Kh("blockly",{media:"third-party/blockly/media/",rtl:!1,toolbox:g,trashcan:!0});Ge("scan,cannon,drive,swim,stop,speed,damage,health,loc_x,getX,loc_y,getY,");V.Zy(7==R?'0': +'070')}if(d){g=document.getElementById("containerCode");g.parentNode.removeChild(g);g=8==R?"swim(0);":"cannon(0, 70);";V.ef=window.ace.edit("editor");V.ef.setTheme("ace/theme/chrome"); +V.ef.setShowPrintMargin(!1);var k=V.ef.getSession();k.setMode("ace/mode/javascript");k.setTabSize(2);k.setUseSoftTabs(!0);V.Zy(g+"\n");f=function(){d.style.top=Math.max(10,e.offsetTop-window.pageYOffset)+"px";d.style.left=a?"10px":"420px";d.style.width=window.innerWidth-440+"px"};window.addEventListener("scroll",f)}window.addEventListener("resize",f);f(null);for(k=0;g=ff[k];k++){var l=g.code?document.getElementById(g.code).textContent:c?function(){return kd()}:function(){return V.ef.getValue()},m= +S(g.name);W.jD(m,l,g.start,g.Ya)}W.reset();be()}); +var ff=[void 0,[{start:new h.g.K(50,30),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,70),Ya:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(70,50),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(20,50),Ya:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(20,20),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(62.4264,62.4264),Ya:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(50,80),Ya:0,name:"Pond_playerName",code:null}, +{start:new h.g.K(50,20),Ya:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(90,50),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,50),Ya:0,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new h.g.K(10,50),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,50),Ya:0,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new h.g.K(20,80),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(80,20),Ya:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(50, +90),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,10),Ya:99,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new h.g.K(5,50),Ya:99,name:"Pond_playerName",code:null},{start:new h.g.K(95,50),Ya:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(10,10),Ya:50,name:"Pond_playerName",code:null},{start:new h.g.K(40,40),Ya:0,name:"Pond_scaredName",code:"playerScared"}]][R]; +ie=function(a){clearTimeout(Yd);0!=a&&1==a&&"function"==typeof W.Ml[0].Uw&&((5==R||6==R)&&2E5rect { + stroke: none; +} + +#help svg { + direction: ltr; +} diff --git a/html/blockly-games/pond/whack.mp3 b/html/blockly-games/pond/whack.mp3 new file mode 100644 index 0000000..cd8cc21 Binary files /dev/null and b/html/blockly-games/pond/whack.mp3 differ diff --git a/html/blockly-games/pond/whack.ogg b/html/blockly-games/pond/whack.ogg new file mode 100644 index 0000000..b4d58be Binary files /dev/null and b/html/blockly-games/pond/whack.ogg differ diff --git a/html/blockly-games/puzzle.html b/html/blockly-games/puzzle.html new file mode 100644 index 0000000..177d3f3 --- /dev/null +++ b/html/blockly-games/puzzle.html @@ -0,0 +1,14 @@ + + + + + + + Blockly Games : Puzzle + + + + + + + diff --git a/html/blockly-games/puzzle/bee.jpg b/html/blockly-games/puzzle/bee.jpg new file mode 100644 index 0000000..bec79cd Binary files /dev/null and b/html/blockly-games/puzzle/bee.jpg differ diff --git a/html/blockly-games/puzzle/cat.jpg b/html/blockly-games/puzzle/cat.jpg new file mode 100644 index 0000000..3c81c57 Binary files /dev/null and b/html/blockly-games/puzzle/cat.jpg differ diff --git a/html/blockly-games/puzzle/duck.jpg b/html/blockly-games/puzzle/duck.jpg new file mode 100644 index 0000000..a67e097 Binary files /dev/null and b/html/blockly-games/puzzle/duck.jpg differ diff --git a/html/blockly-games/puzzle/generated/pt-br/compressed.js b/html/blockly-games/puzzle/generated/pt-br/compressed.js new file mode 100644 index 0000000..5a6a57d --- /dev/null +++ b/html/blockly-games/puzzle/generated/pt-br/compressed.js @@ -0,0 +1,564 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,h={g:{}};h.g.Vb={};h.g.Vb.Sg=function(a){return a*Math.PI/180};h.g.Vb.cA=function(a){return 180*a/Math.PI};h.g.Vb.Ni=function(a,c,d){if(dc&&(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;eg);return k}; +h.g.Ga.Rp=function(a,c,d){for(var e=[0],f=[],g=0;ge&&(e=l,f=k)}return f?h.g.Ga.Du(a,f,d):c};h.g.Ga.nA=function(a,c){for(var d=[],e=0;e=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.Ga.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.Np(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;kd;d++)c[d]=h.g.He.ou.charAt(Math.random()*a);return c.join("")}; +h.g.He.ou="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +h.g.vg=function(){if(void 0!==h.g.vg.yn)return h.g.vg.yn;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.vg.yn="none"!==c;return h.g.vg.yn};h.g.du=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.sy=function(){var a=h.g.style.Qs();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +h.g.Hi=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};h.g.jy=function(){var a=document.documentElement,c=window;return h.g.userAgent.Xe&&c.pageYOffset!=a.scrollTop?new h.g.M(a.scrollLeft,a.scrollTop):new h.g.M(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};h.g.Cs=function(a){var c=Object.create(null),d=p(a,!0);if(a=t(a))a=d.indexOf(a),d.splice(a,d.length-a);a=0;for(var e;e=d[a];a++)c[e.type]?c[e.type]++:c[e.type]=1;return c}; +h.g.Lz=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new h.g.M(d-e.left,c-e.top);c=h.g.lo(a.kb);return h.g.M.bl(d,c).scale(1/a.scale)};h.i={};h.i.Us="";h.i.Mb=!0;h.i.Pn=0;h.i.yk="create";h.i.aq=h.i.yk;h.i.pi="delete";h.i.BA=h.i.pi;h.i.ni="change";h.i.AA=h.i.ni;h.i.yi="move";h.i.bq=h.i.yi;h.i.lr="var_create";h.i.mr="var_delete";h.i.nr="var_rename";h.i.jn="ui";h.i.wk="comment_create";h.i.iq="comment_delete";h.i.hq="comment_change";h.i.xk="comment_move";h.i.qv="finished_loading";h.i.Uu=[h.i.aq,h.i.bq,h.i.wk,h.i.xk];h.i.ri=[];h.i.Ma=function(a){h.i.isEnabled()&&(h.i.ri.length||setTimeout(h.i.Nx,0),h.i.ri.push(a))}; +h.i.Nx=function(){for(var a=h.i.filter(h.i.ri,!0),c=h.i.ri.length=0,d;d=a[c];c++)if(d.Ib){var e=h.ab.io(d.Ib);if(e){var f=d;if(f.Mb)for(e.Ug.push(f),e.Pj.length=0;e.Ug.length>e.Hq&&0<=e.Hq;)e.Ug.shift();for(var g=0;d=e.Bj[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.Mh()){var k=[g.type,g.Tb,g.Ib].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.yi&&l.index==f-1)m.Dg=g.Dg,m.Cg=g.Cg,m.wf=g.wf,l.index=f;else if(g.type==h.i.ni&&g.element==m.element&&g.name==m.name)m.newValue=g.newValue;else if(g.type!=h.i.jn||"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.Mh()});c||a.reverse();for(f=1;g=a[f];f++)g.type==h.i.ni&&"mutation"==g.element&&a.unshift(a.splice(f,1)[0]);return a};h.i.bx=function(){for(var a=0,c;c=h.i.ri[a];a++)c.Mb=!1};h.i.disable=function(){h.i.Pn++};h.i.enable=function(){h.i.Pn--};h.i.isEnabled=function(){return 0==h.i.Pn};h.i.ub=function(){return h.i.Us};h.i.ca=function(a){h.i.Us="boolean"==typeof a?a?h.g.He():"":a}; +h.i.Fs=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.oa=function(a){switch(a.type){case h.i.yk:var c=new h.i.Ed(null);break;case h.i.pi:c=new h.i.Fd(null);break;case h.i.ni:c=new h.i.We(null,"","","","");break;case h.i.yi:c=new h.i.Qf(null);break;case h.i.lr:c=new h.i.nd(null);break;case h.i.mr:c=new h.i.od(null);break;case h.i.nr:c=new h.i.Md(null,"");break;case h.i.jn:c=new h.i.Qc(null,"","","");break;case h.i.wk:c=new h.i.oe(null);break;case h.i.hq:c=new h.i.dh(null,"","");break;case h.i.xk:c=new h.i.Lf(null);break;case h.i.iq:c=new h.i.pe(null); +break;default:throw Error("Unknown event type.");}c.oa(a);c.Ib=(void 0).id;return c};h.i.JE=function(a){if((a.type==h.i.yi||a.type==h.i.yk)&&a.Ib){var c=h.ab.io(a.Ib);if(a=u(c,a.Tb)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.Re(!0);else if((a.L||a.N)&&!c.lc()){do a.Re(!1),a=t(a);while(a)}}}}; +h.i.Abstract=function(){this.Ib=void 0;this.group=h.i.ub();this.Mb=h.i.Mb};h.i.Abstract.prototype.za=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};h.i.Abstract.prototype.oa=function(a){this.group=a.group};h.i.Abstract.prototype.Mh=function(){return!1};h.i.Abstract.prototype.run=function(){};function x(a){if(a.Ib)var c=h.ab.io(a.Ib);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.v=c.prototype;a.prototype=Object.create(c.prototype);a.prototype.constructor=a};h.g.object.Rh=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.Qc=function(a,c,d,e){h.i.Qc.v.constructor.call(this);this.Tb=a?a.id:null;this.Ib=a?a.C.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Mb=!1};h.g.object.S(h.i.Qc,h.i.Abstract);h.i.Qc.prototype.type=h.i.jn;h.i.Qc.prototype.za=function(){var a=h.i.Qc.v.za.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.Tb&&(a.blockId=this.Tb);return a}; +h.i.Qc.prototype.oa=function(a){h.i.Qc.v.oa.call(this,a);this.element=a.element;this.newValue=a.newValue;this.Tb=a.blockId};h.g.o={};h.g.o.Mk="http://www.w3.org/2000/svg";h.g.o.Fm="http://www.w3.org/1999/xhtml";h.g.o.sh="http://www.w3.org/1999/xlink";h.g.o.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};h.g.o.cg=null;h.g.o.xn=0;h.g.o.J=function(a,c,d){a=document.createElementNS(h.g.o.Mk,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.o.Ab=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.o.Gc=function(a,c){var d=a.getAttribute("class");if(-1==(" "+d+" ").indexOf(" "+c+" "))return!1;d=d.split(/\s+/);for(var e=0;ed||d>a.Cb.length)throw Error(h.$b.Error.Xu);a.An[c.ib()]=c;if(c.getParent()==a){var e=a.Cb.indexOf(c);-1>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};h.Lc.ju=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +h.Lc.Am=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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.w=function(){};h.w.Mc=null;h.w.vn=null;h.w.Xb=null;h.w.$l=null;h.w.qk=16;h.w.fq=1;h.w.Zp=12;h.w.Oq=16;h.w.vm=.25;h.w.lq="#dadce0";h.w.mq="#fff";h.w.ln=null;h.w.Gg=null; +h.w.Va=function(){if(!h.w.Mc){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=h.w.mq;a.style.borderColor=h.w.lq;document.body.appendChild(a);h.w.Mc=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);h.w.ff=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);h.w.pd=c;h.w.Mc.style.opacity=0;h.w.Mc.style.transition="transform "+h.w.vm+"s, opacity "+h.w.vm+"s";a.addEventListener("focusin", +function(){h.g.o.Ab(a,"focused")});a.addEventListener("focusout",function(){h.g.o.Gc(a,"focused")})}};h.w.gu=function(a){h.w.vn=a};h.w.gy=function(){return h.w.ff};h.w.ax=function(){h.w.ff.innerHTML="";h.w.ff.style.width=""};h.w.zd=function(a){h.w.Mc.style.backgroundColor=a;h.w.Mc.style.borderColor=void 0};h.w.yF=function(a){h.w.Mc.setAttribute("data-category",a)}; +h.w.BF=function(a,c,d,e){var f=c.C.scale,g=c.width,k=c.height;g*=f;k*=f;f=c.ga().getBoundingClientRect();g=f.left+g/2;k=f.top+k;f=f.top;e&&(f+=e);h.w.gu(y(c.C).parentNode);return h.w.show(a,c.H,g,k,g,f,d)};h.w.Rz=function(a,c){var d=a.ga().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var g=a.B;h.w.$l=!0;h.w.gu(y(g.C).parentNode);h.w.show(a,g.H,e,f,e,d,c)}; +h.w.show=function(a,c,d,e,f,g,k){h.w.Xb=a;h.w.Gg=k||null;a=h.w.Ls(d,e,f,g);a.nn?(h.w.pd.style.display="",h.w.pd.style.transform="translate("+a.Ii+"px,"+a.Cr+"px) rotate(45deg)",h.w.pd.setAttribute("class",a.mn?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):h.w.pd.style.display="none";h.w.Mc.style.direction=c?"rtl":"ltr";h.w.Mj(a.Dl,a.El,a.ol,a.ql);return a.mn}; +h.w.Xx=function(){var a=h.w.vn.getBoundingClientRect(),c=h.g.style.Ie(h.w.vn);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};h.w.Ls=function(a,c,d,e){var f=h.w.Xx(),g=h.g.style.Ie(h.w.Mc);return c+g.heightf.top?h.w.Js(d,e,f,g):c+g.heightdocument.documentElement.clientTop?h.w.Js(d,e,f,g):h.w.ny(a,f,g)}; +h.w.Ks=function(a,c,d,e){a=h.w.oo(a,d.left,d.right,e.width);return{Dl:a.Bh,El:c,ol:a.Bh,ql:c+h.w.Oq,Ii:a.Ii,Cr:-(h.w.qk/2+h.w.fq),mn:!0,nn:!0}};h.w.Js=function(a,c,d,e){a=h.w.oo(a,d.left,d.right,e.width);return{Dl:a.Bh,El:c-e.height,ol:a.Bh,ql:c-e.height-h.w.Oq,Ii:a.Ii,Cr:e.height-2*h.w.fq-h.w.qk/2,mn:!1,nn:!0}};h.w.ny=function(a,c,d){a=h.w.oo(a,c.left,c.right,d.width);return{Dl:a.Bh,El:0,ol:a.Bh,ql:0,nn:!1}}; +h.w.oo=function(a,c,d,e){var f=a;a=h.g.Vb.Ni(c,a-e/2,d-e);f-=h.w.qk/2;c=h.g.Vb.Ni(h.w.Zp,f-a,e-h.w.Zp-h.w.qk);return{Ii:c,Bh:a}};h.w.isVisible=function(){return!!h.w.Xb};h.w.jj=function(a,c){h.w.Xb===a&&(c?h.w.Bo():h.w.Ia())};h.w.Ia=function(){var a=h.w.Mc;a.style.transform="translate(0, 0)";a.style.opacity=0;h.w.ln=setTimeout(function(){h.w.Bo()},1E3*h.w.vm);h.w.Gg&&(h.w.Gg(),h.w.Gg=null)}; +h.w.Bo=function(){if(h.w.isVisible()){h.w.ln&&clearTimeout(h.w.ln);var a=h.w.Mc;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=h.w.mq;a.style.borderColor=h.w.lq;h.w.Gg&&(h.w.Gg(),h.w.Gg=null);h.w.ax();h.w.Xb=null}}; +h.w.Mj=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=h.w.Mc;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.w.rF=function(){if(h.w.Xb){var a=h.w.Xb.B,c=a.C.scale,d=h.w.$l?h.w.Xb.jb.width:a.width,e=h.w.$l?h.w.Xb.jb.height:a.height;d*=c;e*=c;a=h.w.$l?h.w.Xb.Wc.getBoundingClientRect():a.ga().getBoundingClientRect();d=a.left+d/2;e=h.w.Ls(d,a.top+e,d,a.top);h.w.Mj(e.Dl,e.El,e.ol,e.ql)}else h.w.Ia()}; +h.Nf=function(a,c){this.Gh=a;this.Fp=c.spacing;this.tt=c.length;this.Uy=(this.Po=a.firstChild)&&this.Po.nextSibling;this.Uz=c.snap};h.Nf.prototype.Ef=1;h.Nf.prototype.G=function(){this.Gh=null};h.Nf.prototype.update=function(a){this.Ef=a;var c=this.Fp*a||100;this.Gh.setAttribute("width",c);this.Gh.setAttribute("height",c);c=Math.floor(this.Fp/2)+.5;var d=c-this.tt/2,e=c+this.tt/2;c*=a;d*=a;e*=a;fa(this.Po,a,d,e,c,c);fa(this.Uy,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.Nf.prototype.moveTo=function(a,c){this.Gh.setAttribute("x",a);this.Gh.setAttribute("y",c);(h.g.userAgent.Xe||h.g.userAgent.Bk)&&this.update(this.Ef)}; +h.Nf.Va=function(a,c,d){a=h.g.o.J("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},d);0");c.yc(e)}h.i.Ma(new h.i.We(c,"mutation",null,d,a)); +break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.Tb)};h.i.Ed=function(a){a&&(h.i.Ed.v.constructor.call(this,a),this.xml=a.C.$?h.I.tn(a):h.I.$f(a),this.tg=h.i.Fs(a))};h.g.object.S(h.i.Ed,h.i.Dd);h.i.tk=h.i.Ed;h.i.Ed.prototype.type=h.i.yk;h.i.Ed.prototype.za=function(){var a=h.i.Ed.v.za.call(this);a.xml=h.I.Sd(this.xml);a.ids=this.tg;return a}; +h.i.Ed.prototype.oa=function(a){h.i.Ed.v.oa.call(this,a);this.xml=h.I.Ue(a.xml);this.tg=a.ids};h.i.Ed.prototype.run=function(a){var c=x(this);if(a)a=h.g.xml.createElement("xml"),a.appendChild(this.xml),h.I.Fe(a,c);else{a=0;for(var d;d=this.tg[a];a++){var e=u(c,d);e?e.G(!1):d==this.Tb&&console.warn("Can't uncreate non-existent block: "+d)}}}; +h.i.Fd=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");h.i.Fd.v.constructor.call(this,a);this.jz=a.C.$?h.I.tn(a):h.I.$f(a);this.tg=h.i.Fs(a)}};h.g.object.S(h.i.Fd,h.i.Dd);h.i.Vu=h.i.Fd;h.i.Fd.prototype.type=h.i.pi;h.i.Fd.prototype.za=function(){var a=h.i.Fd.v.za.call(this);a.ids=this.tg;return a};h.i.Fd.prototype.oa=function(a){h.i.Fd.v.oa.call(this,a);this.tg=a.ids}; +h.i.Fd.prototype.run=function(a){var c=x(this);if(a){a=0;for(var d;d=this.tg[a];a++){var e=u(c,d);e?e.G(!1):d==this.Tb&&console.warn("Can't delete non-existent block: "+d)}}else a=h.g.xml.createElement("xml"),a.appendChild(this.jz),h.I.Fe(a,c)};h.i.Qf=function(a){a&&(h.i.Qf.v.constructor.call(this,a),a=ha(this),this.It=a.Pt,this.Ht=a.ht,this.ep=a.Xr)};h.g.object.S(h.i.Qf,h.i.Dd);h.i.li=h.i.Qf;b=h.i.Qf.prototype;b.type=h.i.yi; +b.za=function(){var a=h.i.Qf.v.za.call(this);this.Dg&&(a.newParentId=this.Dg);this.Cg&&(a.newInputName=this.Cg);this.wf&&(a.newCoordinate=Math.round(this.wf.x)+","+Math.round(this.wf.y));return a};b.oa=function(a){h.i.Qf.v.oa.call(this,a);this.Dg=a.newParentId;this.Cg=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.wf=new h.g.M(Number(a[0]),Number(a[1])))};b.Jg=function(){var a=ha(this);this.Dg=a.Pt;this.Cg=a.ht;this.wf=a.Xr}; +function ha(a){var c=u(x(a),a.Tb);a={};var d=c.getParent();if(d){a.Pt=d.id;a:{for(var e=0,f;f=d.K[e];e++)if(f.connection&&A(f.connection)==c){c=f;break a}c=null}c&&(a.ht=c.name)}else a.Xr=c.Fa();return a}b.Mh=function(){return this.It==this.Dg&&this.Ht==this.Cg&&h.g.M.Ud(this.ep,this.wf)}; +b.run=function(a){var c=x(this),d=u(c,this.Tb);if(d){var e=a?this.Dg:this.It,f=a?this.Cg:this.Ht;a=a?this.wf:this.ep;var g=null;if(e&&(g=u(c,e),!g)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&B(d);if(a)f=d.Fa(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.L||d.N;if(f){if(c=ia(g,f))var k=c.connection}else d.type==h.ld&&(k=g.W);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.Tb)};h.i.si=function(a){this.Ib=a.id;this.group=h.i.ub();this.Mb=!1};h.g.object.S(h.i.si,h.i.Abstract);h.i.si.prototype.type=h.i.qv;h.i.si.prototype.za=function(){var a={type:this.type};this.group&&(a.group=this.group);this.Ib&&(a.workspaceId=this.Ib);return a};h.i.si.prototype.oa=function(a){this.Ib=a.workspaceId;this.group=a.group};h.i.ve=function(a){h.i.ve.v.constructor.call(this);this.Hf=a.ib();this.Ib=a.C.id};h.g.object.S(h.i.ve,h.i.Abstract);h.i.ve.prototype.za=function(){var a=h.i.ve.v.za.call(this);a.varId=this.Hf;return a};h.i.ve.prototype.oa=function(a){h.i.ve.v.za.call(this);this.Hf=a.varId};h.i.nd=function(a){a&&(h.i.nd.v.constructor.call(this,a),this.Wg=a.type,this.Vg=a.name)};h.g.object.S(h.i.nd,h.i.ve);h.i.nd.prototype.type=h.i.lr; +h.i.nd.prototype.za=function(){var a=h.i.nd.v.za.call(this);a.varType=this.Wg;a.varName=this.Vg;return a};h.i.nd.prototype.oa=function(a){h.i.nd.v.oa.call(this,a);this.Wg=a.varType;this.Vg=a.varName};h.i.nd.prototype.run=function(a){var c=x(this);a?c.sd(this.Vg,this.Wg,this.Hf):c.Ah(this.Hf)};h.i.od=function(a){a&&(h.i.od.v.constructor.call(this,a),this.Wg=a.type,this.Vg=a.name)};h.g.object.S(h.i.od,h.i.ve);h.i.od.prototype.type=h.i.mr; +h.i.od.prototype.za=function(){var a=h.i.od.v.za.call(this);a.varType=this.Wg;a.varName=this.Vg;return a};h.i.od.prototype.oa=function(a){h.i.od.v.oa.call(this,a);this.Wg=a.varType;this.Vg=a.varName};h.i.od.prototype.run=function(a){var c=x(this);a?c.Ah(this.Hf):c.sd(this.Vg,this.Wg,this.Hf)};h.i.Md=function(a,c){a&&(h.i.Md.v.constructor.call(this,a),this.gp=a.name,this.ap=c)};h.g.object.S(h.i.Md,h.i.ve);h.i.Md.prototype.type=h.i.nr; +h.i.Md.prototype.za=function(){var a=h.i.Md.v.za.call(this);a.oldName=this.gp;a.newName=this.ap;return a};h.i.Md.prototype.oa=function(a){h.i.Md.v.oa.call(this,a);this.gp=a.oldName;this.ap=a.newName};h.i.Md.prototype.run=function(a){var c=x(this);a?c.Kg(this.Hf,this.ap):c.Kg(this.Hf,this.gp)};h.I={};h.I.Cu=function(a){var c=C,d=h.g.xml.createElement("xml"),e=h.I.jA(h.na.Hw(c));e.hasChildNodes()&&d.appendChild(e);var f=ja(c,!0);e=0;for(var g;g=f[e];e++)d.appendChild(g.Mp(a));c=D(c,!0);for(e=0;f=c[e];e++)d.appendChild(h.I.tn(f,a));return d};h.I.jA=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.ib();c.appendChild(f)}return c}; +h.I.tn=function(a,c){var d;a.C.H&&(d=a.C.gj());c=h.I.$f(a,c);var e=a.Fa();c.setAttribute("x",Math.round(a.C.H?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c}; +h.I.Lx=function(a){var c=!1;a.name&&(a.Zq?c=!0:a.Gd&&(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),c.textContent=a.getValue(),c):null};h.I.Fw=function(a,c){for(var d=0,e;e=a.K[d];d++)for(var f=0,g;g=e.Ea[f];f++)(g=h.I.Lx(g))&&c.appendChild(g)}; +h.I.$f=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.Wb){var e=a.Wb();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}h.I.Fw(a,d);if(e=a.Be.text){var f=a.Be.size,g=a.Be.St,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.K[f];f++){var l;k=!0;if(g.type!=h.qe){var m=A(g.connection);g.type==h.Ha?l=h.g.xml.createElement("value"):g.type==h.Ca&&(l=h.g.xml.createElement("statement"));e=g.connection.ae;!e||m&&m.Qa||l.appendChild(h.I.Mr(e,c));m&&(l.appendChild(h.I.$f(m,c)),k=!1);l.setAttribute("name",g.name);k||d.appendChild(l)}}void 0!=a.Le&&a.Le!=a.Ly&&d.setAttribute("inline",a.Le);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.Cc()||a.Qa||d.setAttribute("deletable", +!1);a.mc()||a.Qa||d.setAttribute("movable",!1);a.Dc()||d.setAttribute("editable",!1);if(f=t(a))l=h.g.xml.createElement("next"),l.appendChild(h.I.$f(f,c)),d.appendChild(l);e=a.W&&a.W.ae;!e||f&&f.Qa||l.appendChild(h.I.Mr(e,c));return d}; +h.I.Mr=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.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&h.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==h.g.o.Node.TEXT_NODE&&""==e.data.trim()&&h.g.o.removeNode(e))}return a}; +h.I.Sd=function(a){a=h.g.xml.Sd(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};h.I.KE=function(a){a=h.I.Sd(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +h.I.Ue=function(a){var c=h.g.xml.$z(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};h.I.DE=function(a,c){c.qc(!1);c.clear();a=h.I.Fe(a,c);c.qc(!0);return a}; +h.I.Fe=function(a,c){if(a instanceof h.ab){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.H&&(e=c.gj());d=[];h.g.o.Zj();var f=a.childNodes.length,g=h.i.ub();g||h.i.ca(!0);c.qc&&c.qc(!1);var k=!0;try{for(var l=0;l document.");}else a=null;return a};h.Touch={};h.Touch.jr="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.fk=null;h.Touch.Ld={}; +h.g.global.PointerEvent?h.Touch.Ld={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:h.Touch.jr&&(h.Touch.Ld={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});h.Ql=0; +h.Wy=function(a,c){h.uf();a.changedTouches&&1!=a.changedTouches.length||(h.Ql=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&oa(c,a)},h.Hv))};h.uf=function(){h.Ql&&(clearTimeout(h.Ql),h.Ql=0)};h.Touch.Tk=function(){h.Touch.fk=null};h.Touch.Ep=function(a){return!h.Touch.Py(a)||h.Touch.Zw(a)}; +h.Touch.wl=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.Zw=function(a){var c=h.Touch.wl(a);return void 0!==h.Touch.fk&&null!==h.Touch.fk?h.Touch.fk==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(h.Touch.fk=c,!0):!1}; +h.Touch.Nz=function(a){if(h.g.Ga.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};h.Touch.Py=function(a){return h.g.Ga.startsWith(a.type,"touch")||h.g.Ga.startsWith(a.type,"mouse")||h.g.Ga.startsWith(a.type,"pointer")};h.Touch.Ol=function(a){return h.g.Ga.startsWith(a.type,"touch")||h.g.Ga.startsWith(a.type,"pointer")}; +h.Touch.Vz=function(a){var c=[];if(a.changedTouches)for(var d=0;d=d+this.lf&&(e+=f);G(this,wa(this,e));ua(this);a.stopPropagation();a.preventDefault()}}; +b.nz=function(a){za(this.F);pa();h.g.Oh(a)?a.stopPropagation():(this.Wz=this.ij,Ba(this.F),this.qu=this.sg?a.clientX:a.clientY,h.Da.yf=h.Ba(document,"mouseup",this,this.sz),h.Da.xf=h.Ba(document,"mousemove",this,this.oz),a.stopPropagation(),a.preventDefault())};b.oz=function(a){G(this,wa(this,this.Wz+((this.sg?a.clientX:a.clientY)-this.qu)));ua(this)};b.sz=function(){Ca(this.F);h.Touch.Tk();pa()};function pa(){h.ec(!0);h.Da.yf&&(h.lb(h.Da.yf),h.Da.yf=null);h.Da.xf&&(h.lb(h.Da.xf),h.Da.xf=null)} +function wa(a,c){return c=0>=c||isNaN(c)||a.fdh.D.Yv&&h.D.Ia()}else h.D.Zl!=h.D.X&&(clearTimeout(h.D.Xj),h.D.No=a.pageX,h.D.Oo=a.pageY,h.D.Xj=setTimeout(h.D.Sz,h.D.uv))};h.D.Ia=function(){h.D.visible&&(h.D.visible=!1,h.D.ua&&(h.D.ua.style.display="none"));h.D.Xj&&clearTimeout(h.D.Xj)};h.D.block=function(){h.D.Ia();h.D.vh=!0};h.D.iA=function(){h.D.vh=!1}; +h.D.Sz=function(){if(!h.D.vh&&(h.D.Zl=h.D.X,h.D.ua)){h.D.ua.innerHTML="";for(var a=h.D.X.ge;"function"==typeof a;)a=a();a=h.g.Ga.lA(a);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=h.D.ua.offsetHeight+2*h.D.Mq);a?e=Math.max(h.D.Mm-window.scrollX,e):e+h.D.ua.offsetWidth>c+window.scrollX-2*h.D.Mm&&(e=c-h.D.ua.offsetWidth-2*h.D.Mm);h.D.ua.style.top=f+"px";h.D.ua.style.left=e+"px"}};h.wr=function(a){this.Ui=a;this.Va()};b=h.wr.prototype;b.Sa=null;b.td=null;b.Ui=null;b.Va=function(){this.Sa||(this.Sa=h.g.o.J("svg",{xmlns:h.g.o.Mk,"xmlns:html":h.g.o.Fm,"xmlns:xlink":h.g.o.sh,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.Ui.appendChild(this.Sa))};b.Tg=function(a,c){a=a.toFixed(0);c=c.toFixed(0);this.Sa.style.display="block";h.g.o.dm(this.Sa,"translate3d("+a+"px, "+c+"px, 0px)")};b.qo=function(){return h.g.Zc(this.Sa)}; +b.Sk=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var c=this.Sa.childNodes[0],d=this.Sa.childNodes[1];if(!(c&&d&&h.g.o.Xs(c,"blocklyBlockCanvas")&&h.g.o.Xs(d,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.np?h.g.o.pj(c,this.np):a.insertBefore(c,a.firstChild);h.g.o.pj(d,c);this.Sa.style.display="none";if(this.Sa.childNodes.length)throw Error("Drag surface was not cleared.");h.g.o.dm(this.Sa, +"");this.np=null};h.zb=Object.create(null);h.aa=function(a,c){this.B=a;this.type=c};h.aa.vk=0;h.aa.Uq=1;h.aa.Xq=2;h.aa.Wq=3;h.aa.Sq=4;h.aa.Tq=5;h.aa.Vq=6;b=h.aa.prototype;b.ka=null;b.ye=null;b.ae=null;b.fb=0;b.Aa=0; +b.rd=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=A(c),g=c.ae;c.ae=null;if(f.Qa)g=h.I.$f(f),f.G(),f=null;else if(c.type==h.Ha){if(!f.L)throw Error("Orphan block does not have an output connection.");var k=h.aa.rt(e,f);k&&(f.L.connect(k),f=null)}else if(c.type==h.Ca){if(!f.N)throw Error("Orphan block does not have a previous connection.");for(k=e;k.W;){var l=t(k);if(l&&!l.Qa)k=l;else{H(f.N,k.W)&&(k.W.connect(f.N),f=null);break}}}if(f&&(c.disconnect(), +h.i.Mb)){var m=h.i.ub();setTimeout(function(){f.C&&!f.getParent()&&(h.i.ca(m),f.L?f.L.Tl(c):f.N&&f.N.Tl(c),h.i.ca(!1))},h.xm)}c.ae=g}var n;h.i.isEnabled()&&(n=new h.i.li(e));h.aa.kx(c,a);e.$h(d);n&&(n.Jg(),h.i.Ma(n))};b.G=function(){if(this.isConnected()){this.ae=null;var a=A(this);a.Qa?a.G():B(a)}};function I(a){return a.type==h.Ha||a.type==h.Ca}b.isConnected=function(){return!!this.ka}; +function Da(a,c){if(!c)return h.aa.Wq;if(I(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?h.aa.Uq:c.type!=h.mh[a.type]?h.aa.Xq:d&&e&&d.C!==e.C?h.aa.Tq:H(a,c)?d.Qa&&!e.Qa?h.aa.Vq:h.aa.vk:h.aa.Sq} +function Ea(a,c){switch(Da(a,c)){case h.aa.vk:break;case h.aa.Uq:throw Error("Attempted to connect a block to itself.");case h.aa.Tq:throw Error("Blocks not on same workspace.");case h.aa.Xq:throw Error("Attempt to connect incompatible types.");case h.aa.Wq:throw Error("Target connection is null.");case h.aa.Sq:throw Error("Connection checks failed. "+(a+" expected "+a.ye+", found "+c.ye));case h.aa.Vq:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.Hl=function(a){if(a.B.rf()||Da(this,a)!=h.aa.vk)return!1;switch(a.type){case h.ld:return this.ka||-1!=h.cj.indexOf(a)?a=!1:a.ka?(a=A(a),a=a.rf()?!(a.N&&A(a.N)):!1):a=!0,a;case h.jd:if(a.isConnected()&&!A(a).rf()||this.isConnected())return!1;break;case h.Ha:if(a.isConnected()&&!A(a).mc()&&!A(a).Qa)return!1;break;case h.Ca:if(a.isConnected()&&!this.B.W&&!A(a).Qa&&A(a).W)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=h.cj.indexOf(a)?!1:!0};b.Tl=function(){}; +b.connect=function(a){if(this.ka!=a){Ea(this,a);var c=h.i.ub();c||h.i.ca(!0);I(this)?this.rd(a):a.rd(this);c||h.i.ca(!1)}};h.aa.kx=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ka=c;c.ka=a};h.aa.Tz=function(a,c){for(var d=!1,e=0;ed)){var e=Ha(c,a.ga());a.L?(e.x+=(a.H?3:-3)*d,e.y+=13*d):a.N&&(e.x+=(a.H?-23:23)*d,e.y+=3*d);a=h.g.o.J("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},y(c));h.La.Tr(a,new Date,d)}};h.La.Tr=function(a,c,d){var e=(new Date-c)/150;1a.C.scale)){var c=J(a).height;c=Math.atan(10/c)/Math.PI*180;a.H||(c*=-1);h.La.ls(a.ga(),c,new Date)}};h.La.ls=function(a,c,d){var e=(new Date-d)/200;1a-h.av)}if(a.Eb||a.Wa)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Eb||!a.Wa);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function Ka(a){a.Wa&&(h.g.o.removeNode(h.aa.ft),delete h.aa.ft);if(a.Co){var c=a.Wa;c.type!=h.Ha||c.isConnected()?La(a.Ih,!1):a.Ih.Dy(c,!1);a.Ih=null;a.Co=!1}else if(a.Ag)if(a.Ag){c=a.Ag;var d=c.B,e=d.W,f=d.N,g=d.L;g=c.type==h.Ha&&!(g&&g.ka);!(c!=e||f&&f.ka)||g?B(A(c),!1):c.type==h.Ca&&c!=e?(e=c.ka,B(e.B,!1),f=f?f.ka:null,B(d,!0),f&&f.connect(e)):B(d,!0);if(c.ka)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.Ag=null;d.ga().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +h.Fk.prototype.Eh=function(){var a=[];this.Dh&&a.push(this.Dh);this.yg&&a.push(this.yg);return a};h.Kf=function(a,c){this.Xa=a;this.F=c;this.Td=new h.Fk(this.Xa);this.kg=null;this.le=!1;this.ee=this.Xa.Fa();this.jl=h.Kf.Iy(a)};h.Kf.prototype.G=function(){this.wb=this.F=this.Xa=null;this.jl.length=0;this.Td&&(this.Td.G(),this.Td=null)};h.Kf.Iy=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=M(e);for(var f=0;fc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.km.splice(c,1);this.gc.unsubscribe(this.fe);this.options.Fc||(this.gc.G(),this.gc=null)}};h.ab.Yq=3;b=h.ab.prototype;b.ce=function(a,c){a=a.Fa();c=c.Fa();return a.y+h.ab.prototype.ce.offset*a.x-(c.y+h.ab.prototype.ce.offset*c.x)}; +function Wa(a,c){if(!h.g.Hi(a.ii,c))throw Error("Block not present in workspace's list of top-most blocks.");}function D(a,c){var d=[].concat(a.ii);c&&1g)return!1;d+=c[e]}return d>(isNaN(a.options.Fj)?Infinity:a.options.Fj-P(a).length)?!1:!0}function Ya(a){return Infinity!=a.options.Fj||!!a.options.Wo} +b.Qp=function(a){var c=a?this.Pj:this.Ug,d=a?this.Ug:this.Pj,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.Mb=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{h.i.Mb=!0}}};function Za(){var a=C;a.Ug.length=0;a.Pj.length=0;h.i.bx()}function $a(a,c){a.Bj.push(c)}function u(a,c){return a.sn[c]||null}h.ab.Ei=Object.create(null);h.ab.io=function(a){return h.ab.Ei[a]||null}; +h.ab.getAll=function(){var a=[],c;for(c in h.ab.Ei)a.push(h.ab.Ei[c]);return a};h.la=function(a,c,d,e,f,g){this.F=a;this.ff=c;this.mu=d;d=h.la.Qu;this.F.H&&(d=-d);this.Jw=h.g.Vb.Sg(d);a.Te.appendChild(this.Wi(c,!(!f||!g)));this.mb=e;this.qp&&ab(this);f&&g||(c=this.ff.getBBox(),f=c.width+2*h.la.Cd,g=c.height+2*h.la.Cd);bb(this,f,g);ab(this);cb(this);this.qp=!0;a.options.readOnly||(h.Ba(this.Li,"mousedown",this,this.Qw),this.$d&&h.Ba(this.$d,"mousedown",this,this.Gz))};h.la.Cd=6;h.la.Ru=5;h.la.Qu=20;h.la.Xp=4;h.la.Ou=8;h.la.yf=null;h.la.xf=null;h.la.prototype.bu=null; +h.la.Pp=function(){h.la.yf&&(h.lb(h.la.yf),h.la.yf=null);h.la.xf&&(h.lb(h.la.xf),h.la.xf=null)};h.la.Rw=function(){h.Touch.Tk();h.la.Pp()};b=h.la.prototype;b.qp=!1;b.mb=null;b.Qe=0;b.Cf=0;b.Qb=0;b.ud=0;b.pn=!0; +b.Wi=function(a,c){this.xc=h.g.o.J("g",{},null);var d={filter:"url(#"+this.F.options.ss+")"};h.g.userAgent.Ev&&(d={});d=h.g.o.J("g",d,this.xc);this.wn=h.g.o.J("path",{},d);this.Li=h.g.o.J("rect",{"class":"blocklyDraggable",x:0,y:0,rx:h.la.Cd,ry:h.la.Cd},d);c?(this.$d=h.g.o.J("g",{"class":this.F.H?"blocklyResizeSW":"blocklyResizeSE"},this.xc),c=2*h.la.Cd,h.g.o.J("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.$d),h.g.o.J("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.$d),h.g.o.J("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.$d)):this.$d=null;this.xc.appendChild(a);return this.xc};b.ga=function(){return this.xc};b.Qw=function(a){var c=db(this.F,a);if(c){if(c.Hh)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.Hc||(c.Hc=this);c.yd=a}};b.Vj=function(){};b.Cc=function(){return!1}; +b.Gz=function(a){var c=this.xc.parentNode;c.lastChild!==this.xc&&c.appendChild(this.xc);h.la.Pp();h.g.Oh(a)||(this.F.Hp(a,new h.g.M(this.F.H?-this.Qb:this.Qb,this.ud)),h.la.yf=h.Ba(document,"mouseup",this,h.la.Rw),h.la.xf=h.Ba(document,"mousemove",this,this.Hz),h.ec());a.stopPropagation()};b.Hz=function(a){this.pn=!1;var c=this.F;a=h.g.Ij(a,y(c),Aa(c));a.x/=c.scale;a.y/=c.scale;c=h.g.M.sum(c.ps,a);bb(this,this.F.H?-c.x:c.x,c.y);this.F.H&&ab(this)}; +function eb(a,c,d){var e=a.F.H?a.mb.x-c.x-a.Qb:c.x+a.mb.x;c=c.y+a.mb.y;return Math.max(0,Math.min(1,(Math.min(e+a.Qb,d.sb+d.yb)-Math.max(e,d.sb))*(Math.min(c+a.ud,d.Hb+d.Ob)-Math.max(c,d.Hb))/(a.Qb*a.ud)))}function ab(a){var c=a.mb.x;c=a.F.H?c-(a.Qe+a.Qb):c+a.Qe;a.moveTo(c,a.Cf+a.mb.y)}b.moveTo=function(a,c){this.xc.setAttribute("transform","translate("+a+","+c+")")}; +function bb(a,c,d){var e=2*h.la.Cd;c=Math.max(c,e+45);d=Math.max(d,e+20);a.Qb=c;a.ud=d;a.Li.setAttribute("width",c);a.Li.setAttribute("height",d);a.$d&&(a.F.H?a.$d.setAttribute("transform","translate("+2*h.la.Cd+","+(d-e)+") scale(-1 1)"):a.$d.setAttribute("transform","translate("+(c-e)+","+(d-e)+")"));if(a.pn){c=a.F.Yc();c.sb/=a.F.scale;c.yb/=a.F.scale;c.Hb/=a.F.scale;c.Ob/=a.F.scale;d=-a.Qb/4;if(!(a.Qb>c.yb)){if(a.F.H){e=a.mb.x-d;var f=e-a.Qb;var g=c.sb+c.yb,k=c.sb+h.Da.pc/a.F.scale}else f=d+a.mb.x, +e=f+a.Qb,k=c.sb,g=c.sb+c.yb-h.Da.pc/a.F.scale;a.F.H?fg&&(d=-(g-a.mb.x)):fg&&(d=g-a.mb.x-a.Qb)}f=d;d=-a.ud/4;if(!(a.ud>c.Ob)){e=a.mb.y+d;g=e+a.ud;k=c.Hb;var l=c.Hb+c.Ob-h.Da.pc/a.F.scale,m=a.mb.y;el&&(d=l-m-a.ud)}k=d;g=a.mu.getBBox();d={x:f,y:-a.ud-h.ea.Jq};e={x:-a.Qb-30,y:k};k={x:g.width,y:k};l={x:f,y:g.height};f=g.widthg&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),q=Math.cos(m),r=new h.g.md(a.Qb,a.ud);m=(r.width+r.height)/h.la.Ru;m=Math.min(m,r.width,r.height)/4;r=1-h.la.Ou/k;f=d+r*f;g=e+r*g;r=d+m*q;var v=e+m*n;d-=m*q;e-=m*n;n=l+a.Jw;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/h.la.Xp;k=Math.cos(n)*k/h.la.Xp;c.push("M"+ +r+","+v);c.push("C"+(r+k)+","+(v+l)+" "+f+","+g+" "+f+","+g);c.push("C"+f+","+g+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.wn.setAttribute("d",c.join(" "))}b.zd=function(a){this.Li.setAttribute("fill",a);this.wn.setAttribute("fill",a)};b.G=function(){h.la.Pp();h.g.o.removeNode(this.xc);this.mu=this.ff=this.F=this.$d=this.Li=this.wn=this.xc=null};b.Zo=function(a,c){a?a.Tg(c.x,c.y):this.moveTo(c.x,c.y);this.Qe=this.F.H?this.mb.x-c.x-this.Qb:c.x-this.mb.x;this.Cf=c.y-this.mb.y;cb(this)}; +b.Fa=function(){return new h.g.M(this.mb.x+this.Qe,this.mb.y+this.Cf)};h.i.ne=function(a){this.Qd=a.id;this.Ib=a.C.id;this.group=h.i.ub();this.Mb=h.i.Mb};h.g.object.S(h.i.ne,h.i.Abstract);h.i.ne.prototype.za=function(){var a=h.i.ne.v.za.call(this);this.Qd&&(a.commentId=this.Qd);return a};h.i.ne.prototype.oa=function(a){h.i.ne.v.oa.call(this,a);this.Qd=a.commentId};h.i.dh=function(a,c,d){a&&(h.i.dh.v.constructor.call(this,a),this.Gt=c,this.Sl=d)};h.g.object.S(h.i.dh,h.i.ne);b=h.i.dh.prototype;b.type=h.i.hq; +b.za=function(){var a=h.i.dh.v.za.call(this);a.newContents=this.Sl;return a};b.oa=function(a){h.i.dh.v.oa.call(this,a);this.Sl=a.newValue};b.Mh=function(){return this.Gt==this.Sl};b.run=function(a){var c;(c=x(this).Wk[this.Qd]||null)?c.zF(a?this.Sl:this.Gt):console.warn("Can't change non-existent comment: "+this.Qd)};h.i.oe=function(a){a&&(h.i.oe.v.constructor.call(this,a),this.xml=a.Mp())};h.g.object.S(h.i.oe,h.i.ne);h.i.oe.prototype.type=h.i.wk; +h.i.oe.prototype.za=function(){var a=h.i.oe.v.za.call(this);a.xml=h.I.Sd(this.xml);return a};h.i.oe.prototype.oa=function(a){h.i.oe.v.oa.call(this,a);this.xml=h.I.Ue(a.xml)};h.i.oe.prototype.run=function(a){h.i.kq(this,a)};h.i.kq=function(a,c){var d=x(a);c?(c=h.g.xml.createElement("xml"),c.appendChild(a.xml),h.I.Fe(c,d)):(d=d.Wk[a.Qd]||null)?d.G(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.Qd)};h.i.pe=function(a){a&&(h.i.pe.v.constructor.call(this,a),this.xml=a.Mp())}; +h.g.object.S(h.i.pe,h.i.ne);h.i.pe.prototype.type=h.i.iq;h.i.pe.prototype.za=function(){return h.i.pe.v.za.call(this)};h.i.pe.prototype.oa=function(a){h.i.pe.v.oa.call(this,a)};h.i.pe.prototype.run=function(a){h.i.kq(this,!a)};h.i.Lf=function(a){a&&(h.i.Lf.v.constructor.call(this,a),this.Cn=a,this.fp=a.Rs(),this.Bg=null)};h.g.object.S(h.i.Lf,h.i.ne);b=h.i.Lf.prototype; +b.Jg=function(){if(!this.Cn)throw Error("Tried to record the new position of a comment on the same event twice.");this.Bg=this.Cn.Rs();this.Cn=null};b.type=h.i.xk;b.za=function(){var a=h.i.Lf.v.za.call(this);this.Bg&&(a.newCoordinate=Math.round(this.Bg.x)+","+Math.round(this.Bg.y));return a};b.oa=function(a){h.i.Lf.v.oa.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.Bg=new h.g.M(Number(a[0]),Number(a[1])))};b.Mh=function(){return h.g.M.Ud(this.fp,this.Bg)}; +b.run=function(a){var c;if(c=x(this).Wk[this.Qd]||null){a=a?this.Bg:this.fp;var d=c.Rs();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.Qd)};h.mi=function(a,c){this.tb=a;this.F=c;this.kg=null;this.pm=!1;this.ee=this.tb.Fa();this.lg=h.g.vg()&&c.wc?c.wc:null};h.mi.prototype.G=function(){this.lg=this.F=this.tb=null};function fb(a,c,d){d=a.Uh(d);d=h.g.M.sum(a.ee,d);a.tb.Zo(a.lg,d);a.tb.Cc()&&(a.kg=Oa(a.F,c),a.pm=a.kg!=h.nq,c=a.F.Nb,a.pm?(Pa(a.tb,!0),a.kg==h.Dm&&c&&c.Ap(!0)):(Pa(a.tb,!1),c&&c.Ap(!1)))} +function gb(a,c,d){fb(a,c,d);c=a.Uh(d);c=h.g.M.sum(a.ee,c);a.tb.moveTo(c.x,c.y);c=a.F.Nb;a.pm?(c&&setTimeout(c.close.bind(c),100),a.ej(),a.tb.G(!1,!0)):c&&c.close();a.pm||(a.lg&&a.lg.Sk(a.F.Te),a.tb.Lg&&a.tb.Lg(!1),a.ej());a.F.qc(!0);a.F.qa&&a.F.qa.Dz(a.tb.Cc()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.i.ca(!1)}h.mi.prototype.ej=function(){if(this.tb.mt){var a=new h.i.Lf(this.tb);a.fp=this.ee;a.Jg();h.i.Ma(a)}}; +h.mi.prototype.Uh=function(a){a=new h.g.M(a.x/this.F.scale,a.y/this.F.scale);this.F.xj&&a.scale(1/this.F.options.Fc.scale);return a};h.mi.prototype.$o=function(){this.tb.moveTo(0,0);this.lg.Tg(this.ee.x,this.ee.y);ba(this.lg,this.tb.ga())};h.Fi=function(a){this.F=a;this.su=new h.g.M(a.scrollX,a.scrollY)};h.Fi.prototype.G=function(){this.F=null};h.Fi.prototype.Hp=function(){h.selected&&hb(h.selected);Ba(this.F)};h.Fi.prototype.Ge=function(a){a=h.g.M.sum(this.su,a);this.F.scroll(a.x,a.y)};h.Dk=function(a){h.Dk.v.constructor.call(this,a.yl());this.xp=a.xp;this.gt=a.gt};h.g.object.S(h.Dk,h.Fi);h.Dk.prototype.Ge=function(a){a=h.g.M.sum(this.su,a);this.gt?this.xp.set(-a.x):this.xp.set(-a.y)};h.gh=function(a,c){this.wb=this.xb=this.Ng=this.Og=this.Hc=this.cc=this.Bt=null;this.Hn=c;this.rj=this.wg=this.sj=this.pg=!1;this.yd=a;this.R=this.Jf=this.qd=this.we=this.Vl=this.Ul=null;this.Jl=this.Hh=this.Ir=!1;this.at=!h.iv};b=h.gh.prototype;b.G=function(){h.Touch.Tk();h.D.iA();this.Hn.Db=null;this.Ul&&h.lb(this.Ul);this.Vl&&h.lb(this.Vl);this.R=this.wb=this.xb=this.Ng=this.Og=null;this.qd&&(this.qd.G(),this.qd=null);this.Jf&&(this.Jf.G(),this.Jf=null);this.we&&(this.we.G(),this.we=null)}; +function ib(a,c){a.cc=h.g.M.bl(new h.g.M(c.clientX,c.clientY),a.Bt);if(a.pg)var d=!1;else a.pg=h.g.M.Xy(a.cc)>(a.R?h.rv:h.hv),d=a.pg;if(d){if(a.Ir)throw Error("updateIsDragging_ should only be called once per gesture.");a.Ir=!0;if(a.Hc){a.rj=!0;a.we=new h.mi(a.Hc,a.wb);d=a.we;h.i.ub()||h.i.ca(!0);d.F.qc(!1);d.tb.pn=!1;d.lg&&d.$o();d.tb.Lg&&d.tb.Lg(!0);var e=d.F.qa;e&&e.Dw(d.tb.Cc()?"blocklyToolboxDelete":"blocklyToolboxGrab");fb(a.we,a.yd,a.cc);d=!0}else d=!1;if(!d){if(a.xb)if(a.R?(a.R.YE(a.xb)?!a.R.Sy()|| +a.R.$E(a.cc)?(a.wb=a.R.HF,jb(a.wb),h.i.ub()||h.i.ca(!0),a.Ng=null,a.xb=a.R.Yr(a.xb),a.xb.select(),d=!0):d=!1:d=!1,a.wg=d):a.xb.mc()&&(a.wg=!0),a.wg){a.qd=new h.Kf(a.xb,a.wb);d=a.qd;e=a.cc;var f=a.at;h.i.ub()||h.i.ca(!0);d.F.xj&&Sa(d.Xa);h.g.o.Zj();d.F.qc(!1);h.La.Sn();if(d.Xa.getParent()||f&&d.Xa.W&&A(d.Xa.W))B(d.Xa,f),e=d.Uh(e),e=h.g.M.sum(d.ee,e),d.Xa.translate(e.x,e.y),h.La.Bx(d.Xa);d.Xa.Lg(!0);d.Xa.$o();(e=d.F.qa)&&e.Dw(d.Xa.Cc()?"blocklyToolboxDelete":"blocklyToolboxGrab");Ma(a.qd,a.yd,a.cc); +d=!0}else d=!1;else d=!1;if(d=!d)if(a.R)d=a.R.Sy();else if(d=a.wb)d=a.wb,d=d.options.vb&&d.options.vb.Ge;d&&(a.Jf=a.R?new h.Dk(a.R):new h.Fi(a.wb),a.sj=!0,a.Jf.Hp())}h.uf()}a.yd=c} +b.Un=function(a){h.g.Ml(a)?this.cancel():(this.Hh=!0,h.La.Sn(),jb(this.wb),this.wb.xj&&this.wb.resize(),za(this.wb),this.yd=a,h.ec(!!this.R),h.D.block(),this.xb&&(!this.xb.cd&&a.shiftKey?(h.navigation.co(),O(this.Hn.ya,h.navigation.vo(this.xb))):this.xb.select()),h.g.Oh(a)?oa(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||h.Wy(a,this),this.Bt=new h.g.M(a.clientX,a.clientY),this.at=a.altKey||a.ctrlKey||a.metaKey,this.Ji(a)))}; +b.Ji=function(a){this.Ul=h.Ba(document,"mousemove",null,this.hj.bind(this));this.Vl=h.Ba(document,"mouseup",null,this.zl.bind(this));a.preventDefault();a.stopPropagation()};b.hj=function(a){ib(this,a);this.sj?this.Jf.Ge(this.cc):this.wg?Ma(this.qd,this.yd,this.cc):this.rj&&fb(this.we,this.yd,this.cc);a.preventDefault();a.stopPropagation()}; +b.zl=function(a){ib(this,a);h.uf();if(this.Jl)console.log("Trying to end a gesture recursively.");else{this.Jl=!0;if(this.rj)gb(this.we,a,this.cc);else if(this.wg)Qa(this.qd,a,this.cc);else if(this.sj){var c=this.Jf;c.Ge(this.cc);Ca(c.F)}else if(this.Hc&&!this.pg)this.Hc.Oz&&this.Hc.Oz(),this.Hc.select&&this.Hc.select();else if(kb(this))this.Og.Wj(),lb(this);else if(this.Ng&&!this.pg&&!kb(this))this.R&&this.R.on?this.xb.isEnabled()&&(h.i.ub()||h.i.ca(!0),Ta(this.R.Yr(this.xb))):h.i.Ma(new h.i.Qc(this.Ng, +"click",void 0,void 0)),lb(this),h.i.ca(!1);else if(!(this.Ng||this.Hc||this.Og||this.pg))if(c=this.Hn,a.shiftKey){h.navigation.co();var d=h.g.Lz(c,new h.g.M(a.clientX,a.clientY));d=h.A.Zi(c,d);O(c.ya,d)}else h.selected&&hb(h.selected);a.preventDefault();a.stopPropagation();this.G()}};b.cancel=function(){if(!this.Jl){h.uf();if(this.rj)gb(this.we,this.yd,this.cc);else if(this.wg)Qa(this.qd,this.yd,this.cc);else if(this.sj){var a=this.Jf;a.Ge(this.cc);Ca(a.F)}this.G()}}; +function oa(a,c){a.xb?(lb(a),h.ec(a.R),a.xb.Vj(c)):a.Hc?a.Hc.Vj(c):a.wb&&!a.R&&(h.ec(),a.wb.Vj(c));c.preventDefault();c.stopPropagation();a.G()}function lb(a){a.xb&&!a.R&&Sa(a.xb)}function mb(a,c){c.Qa?mb(a,c.getParent()):a.xb=c}function kb(a){if(a.Og){var c=a.Og;c=!!c.B&&c.B.Dc()&&!!c.Wj&&"function"===typeof c.Wj}else c=!1;return c&&!a.pg&&(!a.R||!a.R.on)}b.lc=function(){return this.sj||this.wg||this.rj};b.Eh=function(){return this.qd?this.qd.Eh():[]}; +h.gh.Do=function(){for(var a=h.ab.getAll(),c=0,d;d=a[c];c++)if(d.Db)return!0;return!1};h.xa=function(a,c,d){this.wu=this.zu=this.je=null;this.jb=new h.g.md(0,0);this.Lb=null;d&&this.Ri(d);this.setValue(a);c&&(this.zu=c)};h.xa.eq=16;h.xa.hr=12.5;h.xa.Gi=10;h.xa.yr=10;h.xa.fh=h.xa.Gi/2;b=h.xa.prototype;b.name=void 0;b.yt=50;b.B=null;b.pf=!0;b.If=!0;b.Uk=null;h.xa.Kq="\u00a0";b=h.xa.prototype;b.Gd=!0;b.Zq=!1;b.Ri=function(a){var c=a.tooltip;"string"==typeof c&&(c=h.g.oc(a.tooltip));c&&this.Gf(c)}; +b.Pa=function(){this.Wc||(this.Wc=h.g.o.J("g",{},null),this.isVisible()||(this.Wc.style.display="none"),this.B.ga().appendChild(this.Wc),this.nj(),this.jk(),this.Gf(this.wu),h.D.Ji(this.Uk||this.ga()),this.At=h.Ba(this.Uk||this.ga(),"mousedown",this,this.Jj))};b.nj=function(){this.jb.height=Math.max(this.jb.height,h.xa.eq);this.jb.width=Math.max(this.jb.width,h.xa.Gi);this.Ki=h.g.o.J("rect",{rx:4,ry:4,x:0,y:0,height:this.jb.height,width:this.jb.width},this.Wc);nb(this)}; +function nb(a){a.Jc=h.g.o.J("text",{"class":"blocklyText",y:h.xa.hr,x:a.Ki?h.xa.fh:0},a.Wc);a.ei=document.createTextNode("");a.Jc.appendChild(a.ei)}b.G=function(){h.w.jj(this);h.V.jj(this);this.At&&h.lb(this.At);h.g.o.removeNode(this.Wc)};b.jk=function(){var a=this.Uk||this.ga();this.Gd&&a&&(this.B.Dc()?(h.g.o.Ab(a,"blocklyEditableText"),h.g.o.Gc(a,"blocklyNonEditableText"),a.style.cursor=this.bv):(h.g.o.Ab(a,"blocklyNonEditableText"),h.g.o.Gc(a,"blocklyEditableText"),a.style.cursor=""))}; +b.isVisible=function(){return this.If};b.Yb=function(a){if(this.If!=a){this.If=a;var c=this.ga();c&&(c.style.display=a?"block":"none")}};b.ga=function(){return this.Wc};b.ie=function(){};b.Vh=function(){if(this.ei){this.ei.nodeValue=ob(this);var a=h.g.o.so(this.Jc);this.Ki&&(a+=h.xa.Gi,this.Ki.setAttribute("width",a));this.jb.width=a}}; +b.Ie=function(){if(!this.isVisible())return new h.g.md(0,0);this.pf?(this.Vh(),this.pf=!1):this.If&&0==this.jb.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.Vh());return this.jb};function ob(a){var c=a.jf();if(!c)return h.xa.Kq;c.length>a.yt&&(c=c.substring(0,a.yt-2)+"\u2026");c=c.replace(/\s/g,h.xa.Kq);a.B&&a.B.H&&(c+="\u200f");return c}b.jf=function(){if(this.to){var a=this.to.call(this);if(null!==a)return String(a)}return String(this.getValue())}; +b.im=function(){throw Error("setText method is deprecated");};b.Ej=function(){this.pf=!0};function pb(a){a.pf=!0;a.B&&a.B.$&&(a.B.wa(),a.B.hc())}b.setValue=function(a){if(null!==a){var c=this.fl(a);a=qb(this,a,c);if(!(a instanceof Error)){if(c=this.zu)if(c=c.call(this,a),a=qb(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&h.i.isEnabled()&&h.i.Ma(new h.i.$g(this.B,"field",this.name||null,c,a)),this.hl(a),this.pf&&pb(this))}}}; +function qb(a,c,d){if(null===d)return a.pf&&pb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.je};b.fl=function(a){return null===a||void 0===a?null:a};b.hl=function(a){this.je=a;this.pf=!0};b.Jj=function(a){if(this.B&&this.B.C&&(a=db(this.B.C,a))){if(a.Hh)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.Og||(a.Og=this)}};b.Gf=function(a){var c=this.Uk||this.ga();c?c.ge=a||""===a?a:this.B:this.wu=a}; +b.Vd=function(){for(var a=null,c=this.B,d=c.K,e=0;ec||c>a.Ea.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new h.Oc(d));if(d.B)throw Error("Field already bound to a block.");d.B=a.B;a.B.$&&d.Pa();d.name=e;d.lp&&(c=rb(a,c,d.lp));a.Ea.splice(c,0,d);++c;d.Kp&&(c=rb(a,c,d.Kp));a.B.$&&(a.B.wa(),a.B.hc());return c}b.isVisible=function(){return this.If}; +b.Yb=function(a){var c=[];if(this.If==a)return c;for(var d=(this.If=a)?"block":"none",e=0,f;f=this.Ea[e];e++)f.Yb(a);if(this.connection){if(a)c=sb(this.connection);else if(e=this.connection,R(e,!0),e.ka)for(e=p(A(e),!1),f=0;fa&&0<=c&&256>c&&0<=d&&256>d)?h.g.ob.vp(a,c,d):null}; +h.g.ob.vp=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};h.g.ob.bt=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +h.g.ob.Ey=function(a){var c=h.vv,d=255*h.wv,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.ob.vp(Math.floor(e),Math.floor(f),Math.floor(g))}; +h.g.ob.rn=function(a,c,d){a=h.g.ob.bt(h.g.ob.parse(a));c=h.g.ob.bt(h.g.ob.parse(c));return h.g.ob.vp(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.ob.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.rk=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&&!u(a,d)?d:h.g.He();a.sn[this.id]=this;this.N=this.W=this.L=null;this.K=[];this.Le=void 0;this.disabled=!1;this.ge="";this.contextMenu=!0;this.Zd=null;this.ze=[];this.rs=this.Dt=this.Jn=!0;this.Ae=this.Qa=!1;this.Qi=null;this.Be={text:null,St:!1,size:new h.g.md(160,80)};this.Gu=new h.g.M(0,0);this.C=a;this.cd=a.Ne;this.H=a.H; +this.vj=!1;this.Je=void 0;if(c){this.type=c;d=h.zb[c];if(!d||"object"!=typeof d)throw TypeError("Unknown block type: "+c);h.g.object.Rh(this,d)}a.ii.push(this);a.Ve[this.type]||(a.Ve[this.type]=[]);a.Ve[this.type].push(this);"function"==typeof this.Pa&&this.Pa();this.Ly=this.Le;if(h.i.isEnabled()){(a=h.i.ub())||h.i.ca(!0);try{h.i.Ma(new h.i.tk(this))}finally{a||h.i.ca(!1)}}if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=typeof a)throw Error("onchange must be a function.");this.Kj&& +h.g.Hi(this.C.Bj,this.Kj);if(this.onchange=a)this.Kj=a.bind(this),$a(this.C,this.Kj)}};b=h.rk.prototype;b.data=null;b.dg="#000000";b.Or=null;b.Pr=null; +b.G=function(a){if(this.C){this.Kj&&h.g.Hi(this.C.Bj,this.Kj);h.Oe&&h.navigation.Et(this);B(this,a);h.i.isEnabled()&&h.i.Ma(new h.i.Vu(this));h.i.disable();try{if(this.C){Wa(this.C,this);var c=this.C;c.Ve[this.type].splice(c.Ve[this.type].indexOf(this),1);c.Ve[this.type].length||delete c.Ve[this.type];delete this.C.sn[this.id];this.C=null}h.selected==this&&(h.selected=null);for(var d=this.ze.length-1;0<=d;d--)this.ze[d].G(!1);d=0;for(var e;e=this.K[d];d++)e.G();this.K.length=0;var f=this.Xc(!0);d= +0;for(var g;g=f[d];d++)g.G()}finally{h.i.enable()}}};function B(a,c){if(a.L){var d=null;a.L.isConnected()&&(d=a.L.ka,a.L.disconnect());if(d&&c){a:{c=null;for(var e=0;e=d)this.dg=h.Fy(d);else if(d=h.g.ob.parse(c))this.dg=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);}; +function z(a,c){for(var d=0,e;e=a.K[d];d++)for(var f=0,g;g=e.Ea[f];f++)if(g.name==c)return g;return null}function na(a){for(var c=0,d;d=a.K[c];c++)for(var e=0;d.Ea[e];e++);return[]}function Fa(a,c){return(a=z(a,c))?a.getValue():null}function wb(a,c){a=z(a,"NAME");if(!a)throw Error('Field "NAME" not found.');a.setValue(c)} +b.hm=function(a,c){if(a){void 0===c&&(c=null);if(!this.N){if(this.L)throw Error("Remove output connection prior to adding previous connection.");this.N=this.Dj(h.ld)}this.N.Yh(c)}else if(this.N){if(this.N.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.N.G();this.N=null}}; +b.fm=function(a,c){if(a)void 0===c&&(c=null),this.W||(this.W=this.Dj(h.Ca)),this.W.Yh(c);else if(this.W){if(this.W.isConnected())throw Error("Must disconnect next statement before removing connection.");this.W.G();this.W=null}}; +b.gm=function(a,c){if(a){void 0===c&&(c=null);if(!this.L){if(this.N)throw Error("Remove previous connection prior to adding output connection.");this.L=this.Dj(h.jd)}this.L.Yh(c)}else if(this.L){if(this.L.isConnected())throw Error("Must disconnect output value before removing connection.");this.L.G();this.L=null}};b.Mg=function(a){this.Le!=a&&(h.i.Ma(new h.i.$g(this,"inline",null,this.Le,a)),this.Le=a)}; +function Ga(a){if(void 0!=a.Le)return a.Le;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function yb(a,c){return a.Xf(h.qe,c||"")} +b.Rh=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.Rh(this,a)};b.Xf=function(a,c){var d=null;if(a==h.Ha||a==h.Ca)d=this.Dj(a);a=new h.Dq(a,c,this,d);this.K.push(a);return a}; +b.pp=function(a,c){for(var d=0,e;e=this.K[d];d++)if(e.name==a){e.G();this.K.splice(d,1);return}if(!c)throw Error("Input not found: "+a);};function ia(a,c){for(var d=0,e;e=a.K[d];d++)if(e.name==c)return e;return null}b.Zh=function(a){this.Be.text!=a&&(h.i.Ma(new h.i.$g(this,"comment",null,this.Be.text,a)),this.Qi=this.Be.text=a)};b.Uj=function(){};b.lu=function(){};b.Fa=function(){return this.Gu}; +b.moveBy=function(a,c){if(this.Zd)throw Error("Block has parent.");var d=new h.i.li(this);this.Gu.translate(a,c);d.Jg();h.i.Ma(d)};b.Dj=function(a){return new h.aa(this,a)};h.j={};h.j.XB=function(){};h.j.Tf=function(a){this.Rg=a;this.di=h.g.o.J("path",{"class":"blocklyPath"},this.Rg);this.dk=h.g.o.J("path",{"class":"blocklyPathLight"},this.Rg);this.bk=h.g.o.J("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Rg)};h.j.Tf.prototype.Bp=function(a){this.di.setAttribute("d",a);this.dk.style.display="none";this.bk.style.display="none"};h.j.Tf.prototype.eo=function(){this.di.setAttribute("transform","scale(-1 1)")};h.g.Ka={};h.g.Ka.Pu="aria-";h.g.Ka.Xm="role"; +h.g.Ka.Zm={pA:"alert",qA:"alertdialog",sA:"application",tA:"article",zA:"banner",DA:"button",FA:"checkbox",KA:"columnheader",LA:"combobox",NA:"complementary",OA:"contentinfo",UA:"definition",YA:"dialog",ZA:"directory",aB:"document",FB:"form",KB:"grid",LB:"gridcell",MB:"group",QB:"heading",UB:"img",fC:"link",gC:"list",hC:"listbox",iC:"listitem",kC:"log",qC:"main",rC:"marquee",sC:"math",Lv:"menu",uC:"menubar",Mv:"menuitem",Nv:"menuitemcheckbox",vC:"menuitemradio",AC:"navigation",DC:"note",YC:"option", +iD:"presentation",lD:"progressbar",oD:"radio",pD:"radiogroup",rD:"region",Ym:"row",yD:"rowgroup",zD:"rowheader",BD:"scrollbar",DD:"search",FD:"separator",LD:"slider",OD:"spinbutton",QD:"status",kw:"tab",RD:"table",SD:"tablist",TD:"tabpanel",UD:"textbox",VD:"textinfo",YD:"timer",ZD:"toolbar",$D:"tooltip",aE:"tree",bE:"treegrid",cE:"treeitem"}; +h.g.Ka.State={Mu:"activedescendant",uA:"atomic",wA:"autocomplete",CA:"busy",GA:"checked",JA:"colindex",QA:"controls",WA:"describedby",$A:"disabled",fB:"dropeffect",kB:"expanded",EB:"flowto",JB:"grabbed",OB:"haspopup",RB:"hidden",WB:"invalid",$B:"label",aC:"labelledby",eC:"level",jC:"live",xC:"multiline",yC:"multiselectable",ZC:"orientation",$C:"owns",hD:"posinset",jD:"pressed",qD:"readonly",sD:"relevant",vD:"required",AD:"rowindex",$m:"selected",GD:"setsize",MD:"sort",fE:"valuemax",gE:"valuemin", +hE:"valuenow",iE:"valuetext"};h.g.Ka.ai=function(a,c){c?a.setAttribute(h.g.Ka.Xm,c):h.g.Ka.Cz(a)};h.g.Ka.TE=function(a){return a.getAttribute(h.g.Ka.Xm)||null};h.g.Ka.Cz=function(a){a.removeAttribute(h.g.Ka.Xm)};h.g.Ka.bi=function(a,c,d){Array.isArray(d)&&(d=d.join(" "));a.setAttribute(h.g.Ka.Ux(c),d)};h.g.Ka.Ux=function(a){return h.g.Ka.Pu+a};h.Pf=function(){h.$b.call(this);this.Ke=-1};h.g.object.S(h.Pf,h.$b);b=h.Pf.prototype;b.Va=function(){var a=document.createElement("div");a.id=this.ib();this.X=a;a.className="goog-menu goog-menu-vertical blocklyNonSelectable";a.tabIndex=0;h.g.Ka.ai(a,this.wp||h.g.Ka.Zm.Lv)};b.focus=function(){var a=this.X;a&&(a.focus(),h.g.o.Ab(a,"focused"))};b.blur=function(){var a=this.X;a&&(a.blur(),h.g.o.Gc(a,"focused"))};b.ai=function(a){this.wp=a}; +b.ll=function(){h.Pf.v.ll.call(this);ca(this,function(a){if(a.bd){var c=a.X;c=c.id||(c.id=a.ib());this.wh||(this.wh={});this.wh[c]=a}},this);zb(this)};b.ml=function(){Ab(this,-1);h.Pf.v.ml.call(this)};b.Tn=function(){h.Pf.v.Tn.call(this);h.lb(this.bz);h.lb(this.Oi);h.lb(this.$y);h.lb(this.az);h.lb(this.kz)}; +function zb(a){var c=a.X;a.bz=h.Ba(c,"mouseover",a,a.yy,!0);a.Oi=h.Ba(c,"click",a,a.ty,!0);a.$y=h.Ba(c,"mouseenter",a,a.wy,!0);a.az=h.Ba(c,"mouseleave",a,a.xy,!0);a.kz=h.Ba(c,"keydown",a,a.xo)}b.wh=null;function Bb(a,c){if(a.wh)for(var d=a.X;c&&c!==d;){var e=c.id;if(e in a.wh)return a.wh[e];c=c.parentNode}return null}function Cb(a){(a=a.Cb[a.Ke]||null)&&a.Se(!1)}function Ab(a,c){var d=a.Cb[c]||null;d?(d.Se(!0),a.Ke=c):-1c?d-1:c},a.Ke)}function Eb(a,c,d){var e=a.Cb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var g=a.Cb[d]||null;if(g&&g.isEnabled()){Ab(a,d);break}f++;d=c.call(a,d,e)}}b.yy=function(a){(a=Bb(this,a.target))&&a.isEnabled()&&(this.Cb[this.Ke]||null)!==a&&(Cb(this),this.Se(a))}; +b.ty=function(a){var c=Bb(this,a.target),d;if(d=c)c.isEnabled()&&(c.Se(!0),Gb(c)),d=void 0;d&&a.preventDefault()};b.wy=function(){this.focus()};b.xy=function(){this.X&&(this.blur(),Cb(this),Ab(this,-1))};b.xo=function(a){return 0!=this.Cb.length&&Hb(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1}; +function Hb(a,c){var d=a.Cb[a.Ke]||null;if(d&&"function"==typeof d.xo&&d.xo(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case h.g.gb.qq:d&&Gb(d);break;case h.g.gb.pw:Fb(a);break;case h.g.gb.gv:Db(a);break;default:return!1}return!0};h.Gk=function(a,c){h.$b.call(this);this.ff=a;this.setValue(c);this.kl=!0};h.g.object.S(h.Gk,h.$b);b=h.Gk.prototype; +b.Va=function(){var a=document.createElement("div");a.id=this.ib();this.X=a;a.className="goog-menuitem goog-option "+(this.kl?"":"goog-menuitem-disabled ")+(this.zn?"goog-option-selected ":"")+(this.ot()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.Mi){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Ib(this));h.g.Ka.ai(a,this.wp||(this.Mi?h.g.Ka.Zm.Nv: +h.g.Ka.Zm.Mv));h.g.Ka.bi(a,h.g.Ka.State.$m,this.Mi&&this.zn||!1)};function Ib(a){a=a.ff;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.je=a};b.getValue=function(){return this.je};b.ai=function(a){this.wp=a};function Jb(a,c){if(a.Mi){a.zn=c;var d=a.X;d&&a.isEnabled()&&(c?(h.g.o.Ab(d,"goog-option-selected"),h.g.Ka.bi(d,h.g.Ka.State.$m,!0)):(h.g.o.Gc(d,"goog-option-selected"),h.g.Ka.bi(d,h.g.Ka.State.$m,!1)))}} +b.Se=function(a){var c=this.X;c&&this.isEnabled()&&(a?h.g.o.Ab(c,"goog-menuitem-highlight"):h.g.o.Gc(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.kl};b.Re=function(a){this.kl=a;(a=this.X)&&(this.kl?h.g.o.Gc(a,"goog-menuitem-disabled"):h.g.o.Ab(a,"goog-menuitem-disabled"))};function Gb(a){a.Mi&&Jb(a,!a.zn);a.Ar&&a.Ar.call(a.Cw,a)}function Kb(a,c,d){a.Ar=c;a.Cw=d};h.g.nm={};h.g.nm.Ie=function(a){a=a.X;var c=h.g.style.Ie(a);c.height=a.scrollHeight;return c};h.g.nm.Ew=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};h.sa={};h.sa.Zk=null;h.sa.us=null;h.sa.show=function(a,c,d){h.V.show(h.sa,d,null);if(c.length){var e=h.sa.zz(c,d);h.sa.Af(e,a,d);setTimeout(function(){e.X.focus()},1);h.sa.Zk=null}else h.sa.Ia()};h.sa.zz=function(a,c){var d=new h.Pf;ea(d,c);for(var e=0,f;f=a[e];e++){var g=new h.Gk(f.text);ea(g,c);da(d,g);g.Re(f.enabled);f.enabled&&Kb(g,function(){h.sa.Ia();this.Bb()},f)}return d}; +h.sa.Af=function(a,c,d){var e=h.g.sy();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};h.sa.sx(a);var f=h.g.nm.Ie(a);d&&h.g.nm.Ew(e,c,f);h.V.Az(e,c,f,d);a.X.focus()};h.sa.sx=function(a){a.wa(h.V.ua);var c=a.X;h.g.o.Ab(c,"blocklyContextMenu");h.Ba(c,"contextmenu",null,h.g.hz);a.focus()};h.sa.Ia=function(){h.V.jj(h.sa);h.sa.Zk=null;h.sa.us&&h.lb(h.sa.us)}; +h.sa.AE=function(a,c){return function(){h.i.disable();try{var d=h.I.il(c,a.C),e=a.Fa();e.x=a.H?e.x-h.Sb:e.x+h.Sb;e.y+=2*h.Sb;d.moveBy(e.x,e.y)}finally{h.i.enable()}h.i.isEnabled()&&!d.Qa&&h.i.Ma(new h.i.tk(d));d.select()}};h.sa.Mw=function(a){var c=p(a,!1).length,d=t(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,Bb:function(){h.i.ca(!0);a.G(!0,!0);h.i.ca(!1)}}}; +h.sa.Ow=function(a){return{enabled:!("function"==typeof a.rg?!a.rg():!a.rg),text:h.h.HELP,Bb:function(){var c="function"==typeof a.rg?a.rg():a.rg;c&&window.open(c)}}};h.sa.Nw=function(a){var c=Ya(a.C)?Xa(a.C,h.g.Cs(a)):!0;return{text:h.h.DUPLICATE_BLOCK,enabled:c,Bb:function(){h.qs(a)}}};h.sa.Lw=function(a){var c={enabled:!h.g.userAgent.Xe};a.Qi?(c.text=h.h.REMOVE_COMMENT,c.Bb=function(){a.Zh(null)}):(c.text=h.h.ADD_COMMENT,c.Bb=function(){a.Zh("")});return c}; +h.sa.EE=function(a){return{text:h.h.tD,enabled:!0,Bb:function(){h.i.ca(!0);a.G(!0,!0);h.i.ca(!1)}}};h.sa.FE=function(a){return{text:h.h.gB,enabled:!0,Bb:function(){h.qs(a)}}}; +h.sa.LF=function(a,c){if(!h.rh)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!h.g.userAgent.Xe};d.text=h.h.oA;d.Bb=function(){var e=new h.rh(a,h.h.pE,h.rh.fv,h.rh.fv),f=aa(a).getBoundingClientRect();f=new h.g.M(c.clientX-f.left,c.clientY-f.top);var g=h.g.lo(a.kb);f=h.g.M.bl(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.$&&(e.ug(),e.wa(),e.select())};return d};h.te=function(a,c){h.te.v.constructor.call(this,a,c);this.jg=a.C.Yk[c];this.$r=a.C.Yk[h.mh[c]];this.Eg=new h.g.M(0,0);this.mf=!1;this.dt=!this.jg};h.g.object.S(h.te,h.aa);b=h.te.prototype;b.G=function(){h.te.v.G.call(this);this.mf&&Lb(this.jg,this)};function Mb(a,c){var d=a.fb-c.fb;a=a.Aa-c.Aa;return Math.sqrt(d*d+a*a)} +function Nb(a,c){if(!a.B.C.lc()){var d=N(a.B);if(!d.cd){var e=!1;if(!d.mc()){d=N(c.B);if(!d.mc())return;c=a;e=!0}var f=h.selected==d;f||Ob(d);var g=c.fb+h.Sb+Math.floor(Math.random()*h.ym)-a.fb,k=c.Aa+h.Sb+Math.floor(Math.random()*h.ym)-a.Aa;e&&(k=-k);d.H&&(g=c.fb-h.Sb-Math.floor(Math.random()*h.ym)-a.fb);d.moveBy(g,k);f||Pb(d)}}}b.moveTo=function(a,c){this.mf&&Lb(this.jg,this);this.fb=a;this.Aa=c;this.dt||Qb(this.jg,this)};b.moveBy=function(a,c){this.moveTo(this.fb+a,this.Aa+c)}; +function Rb(a,c){a.moveTo(c.x+a.Eg.x,c.y+a.Eg.y)}function S(a,c,d){a.Eg.x=c;a.Eg.y=d}function Sb(a){var c=a.ka.fb-a.fb,d=a.ka.Aa-a.Aa;if(0!=c||0!=d){a=A(a);var e=a.ga();if(!e)throw Error("block is not rendered.");e=h.g.Zc(e);a.ga().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Ra(a,-c,-d)}} +b.closest=function(a,c){var d=this.$r;if(d.pb.length){var e=this.Aa,f=this.fb;this.fb=f+c.x;this.Aa=e+c.y;var g=Tb(d,this);c=null;for(var k=a,l,m=g-1;0<=m&&Math.abs(d.pb[m].Aa-this.Aa)<=a;)l=d.pb[m],this.Hl(l,k)&&(c=l,k=Mb(l,this)),m--;for(;gc?!1:h.te.v.Hl.call(this,a)};b.Tl=function(a){Nb(this,a)};b.Qn=function(a,c){h.te.v.Qn.call(this,a,c);a.$&&a.wa();c.$&&(E(c),c.wa())}; +b.up=function(){var a=this.B,c=this.ae;if(a.C&&c&&h.i.Mb){h.te.v.up.call(this);c=A(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.ug();c.wa(!1);a.$&&a.wa()}};b.Ft=function(a){return Ub(this.$r,this,a)};b.rd=function(a){h.te.v.rd.call(this,a);var c=this.B;a=a.B;c.$&&E(c);a.$&&E(a);c.$&&a.$&&(this.type==h.Ca||this.type==h.ld?a.wa():c.wa())};b.Jt=function(){this.isConnected()&&!H(this,this.ka)&&(B(I(this)?A(this):this.B),this.B.hc())};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.se=function(a){this.ba=a};b=h.se.prototype;b.Nr=!0;b.Jk=17;b.ag=null;b.Bl=null; +function Vb(a){if(!a.Xd){a.Xd=h.g.o.J("g",{"class":"blocklyIconGroup"},null);a.ba.cd&&h.g.o.Ab(a.Xd,"blocklyIconGroupReadonly");var c=a.Xd;h.g.o.J("path",{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},c);h.g.o.J("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},c);h.g.o.J("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},c);a.ba.ga().appendChild(a.Xd);h.Ba(a.Xd,"mouseup",a,a.Gy);a.jk()}} +b.G=function(){h.g.o.removeNode(this.Xd);this.Xd=null;this.Yb(!1);this.ba=null};b.jk=function(){};b.isVisible=function(){return!!this.ag};b.Gy=function(a){this.ba.C.lc()||this.ba.cd||h.g.Oh(a)||this.Yb(!this.isVisible())};b.ie=function(){this.isVisible()&&this.ag.zd(this.ba.dg)};function Na(a,c){a.Bl=c;a.isVisible()&&(a=a.ag,a.mb=c,a.qp&&ab(a))}function Wb(a){var c=a.ba.Fa(),d=h.g.Zc(a.Xd);c=new h.g.M(c.x+d.x+a.Jk/2,c.y+d.y+a.Jk/2);h.g.M.Ud(a.Bl,c)||Na(a,c)};h.Nd=function(a){h.Nd.v.constructor.call(this,a);Vb(this);this.gi={}};h.g.object.S(h.Nd,h.se);h.Nd.prototype.Nr=!1;h.Nd.aA=function(a){var c=h.g.o.J("text",{"class":"blocklyText blocklyBubbleText",y:h.la.Cd},null);a=a.split("\n");for(var d=0;d=a.pb.length)return-1;for(var e=c.Aa,f=d;0<=f&&a.pb[f].Aa==e;){if(a.pb[f]==c)return f;f--}for(;dc.Aa)e=f;else{d=f;break}}return d}function Lb(a,c){if(!c.mf)throw Error("Connection not in database.");var d=ac(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.mf=!1;a.pb.splice(d,1)} +function Ub(a,c,d){function e(n){var q=g-f[n].fb,r=k-f[n].Aa;Math.sqrt(q*q+r*r)<=d&&m.push(f[n]);return rthis.Nj){var d=c-this.Nj;d=0Object.keys(this.Uc).length&&(this.Uc={},this.Nj=0)}!this.Ll||this.lc()?h.Touch.Ep(a)&&h.vc.v.zl.call(this,a):(a.preventDefault(),a.stopPropagation(),this.G())};b.G=function(){h.vc.v.G.call(this);this.hp&&h.lb(this.hp)};function bc(a,c){a.Uc[h.Touch.wl(c)]=cc(a,c);var d=Object.keys(a.Uc);2==d.length&&(a.pu=h.g.M.os(a.Uc[d[0]],a.Uc[d[1]]),a.Ll=!0,c.preventDefault())} +function cc(a,c){return a.wb?new h.g.M(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};h.vr=function(a){this.jp=a;this.zi=Object.create(null)};b=h.vr.prototype;b.Mo=null;b.G=function(){this.zi=this.jp=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=(isNaN(a.options.Fj)?Infinity:a.options.Fj-P(a).length)))if(a.Db&&a.Db.cancel(),"comment"==c.tagName.toLowerCase()){h.i.disable();try{h.rh.setValue(c.textContent);var d=void 0;var e=parseInt(c.getAttribute("x"),10),f=parseInt(c.getAttribute("y"),10);isNaN(e)||isNaN(f)||(a.H&&(e=-e),d.moveBy(e+50,f+50))}finally{h.i.enable()}d.select()}else a:{h.i.disable();try{var g=h.I.il(c,a),k=a.Ec.qb;if(h.Oe&&k){h.navigation.jt(g,k.Z); +break a}var l=parseInt(c.getAttribute("x"),10),m=parseInt(c.getAttribute("y"),10);if(!isNaN(l)&&!isNaN(m)){a.H&&(l=-l);do{c=!1;var n=P(a,!1);d=0;for(var q;q=n[d];d++){var r=q.Fa();if(1>=Math.abs(l-r.x)&&1>=Math.abs(m-r.y)){c=!0;break}}if(!c){var v=g.Xc(!1);d=0;for(var w;w=v[d];d++)if(w.closest(h.Sb,new h.g.M(l,m)).connection){c=!0;break}}c&&(l=a.H?l-h.Sb:l+h.Sb,m+=2*h.Sb)}while(c);g.moveBy(l,m)}}finally{h.i.enable()}h.i.isEnabled()&&!g.Qa&&h.i.Ma(new h.i.tk(g));g.select()}} +function kc(a){(a=a.Ne?a.Lp:a)&&!a.Db&&a.qa&&a.qa.R&&a.qa.nF()}b.Kg=function(a,c){h.Ua.v.Kg.call(this,a,c);kc(this)};b.Ah=function(a){h.Ua.v.Ah.call(this,a);kc(this)};b.sd=function(a,c,d){a=h.Ua.v.sd.call(this,a,c,d);kc(this);return a};function ec(a){a.fs=a.Nb&&a.P.parentNode?a.Nb.Ds():null;a.ds=a.R?a.R.Ds():a.qa?a.qa.Ds():null}function Oa(a,c){return a.fs&&a.fs.contains(c.clientX,c.clientY)?h.Dm:a.ds&&a.ds.contains(c.clientX,c.clientY)?h.oq:h.nq} +b.Jj=function(a){var c=db(this,a);if(c){if(c.Hh)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");c.wb||(c.wb=this);c.yd=a;c.Un(a);h.Oe&&h.navigation.bi(h.navigation.Lk)}};b.Hp=function(a,c){a=h.g.Ij(a,y(this),Aa(this));a.x/=this.scale;a.y/=this.scale;this.ps=h.g.M.bl(c,a)};b.lc=function(){return null!=this.Db&&this.Db.lc()}; +function lc(a){return a.options.vb&&a.options.vb.scrollbars||a.options.vb&&a.options.vb.Xg||a.options.vb&&a.options.vb.Ge||a.options.$a&&a.options.$a.controls||a.options.$a&&a.options.$a.Xg}b.mc=function(){return this.options.vb&&this.options.vb.scrollbars||this.options.vb&&this.options.vb.Xg||this.options.vb&&this.options.vb.Ge||this.options.$a&&this.options.$a.Xg}; +b.uz=function(a){if(h.gh.Do())a.preventDefault(),a.stopPropagation();else{var c=this.options.$a&&this.options.$a.Xg,d=this.options.vb&&this.options.vb.Xg;if(c||d){var e=h.g.py(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.Ij(a,y(this),Aa(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=Zb(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.$w=function(){this.qc(!1);h.i.ca(!0);for(var a=D(this,!0),c=0,d=0,e;e=a[d];d++)if(e.mc()){var f=e.Fa();e.moveBy(-f.x,c-f.y);Yb(e);c=e.Fa().y+J(e).height+h.ea.Jq}h.i.ca(!1);this.qc(!0)}; +b.Vj=function(a){function c(w){if(w.Cc())v=v.concat(p(w,!1));else{w=ma(w,!1);for(var K=0;Kv.length?d():h.confirm(h.h.DELETE_ALL_BLOCKS.replace("%1",v.length),function(w){w&&d()})}};e.push(l);this.Qr&&this.Qr(e);h.sa.show(a,e,this.H)}};function za(a){if(a.options.Fc)za(a.options.Fc);else{h.Cj=a;document.activeElement&&document.activeElement.blur();try{y(a).focus()}catch(c){try{y(a).parentNode.setActive()}catch(d){y(a).parentNode.focus()}}}} +b.zoom=function(a,c,d){if(!this.Ne&&!this.xj){d=Math.pow(this.options.$a.Kz,d);var e=this.scale*d;if(this.scale!=e){e>this.options.$a.Gj?d=this.options.$a.Gj/this.scale:ethis.options.$a.Gj?a=this.options.$a.Gj:this.options.$a.Hj&&ak.Au||k.ick.Bu){l=null;g&&(l=h.i.ub(),h.i.ca(g.group));switch(g.type){case h.i.aq:case h.i.bq:var n=u(f,g.Tb);n=N(n);break;case h.i.wk:case h.i.xk:n=f.Wk[g.Qd]||null}if(n){m=Zb(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var q=k.Hb,r=k.Au-m.height;r=Math.max(q,r);q=h.g.Vb.Ni(q,m.top,r)-m.top;r=k.sb;var v=k.Bu-m.width;k.H?r=Math.min(v,r):v=Math.max(r,v);n.moveBy(h.g.Vb.Ni(r, +m.left,v)-m.left,q)}g&&(g.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&h.i.ca(l))}}});h.ek(f);h.V.Va();h.w.Va();h.D.Va();return f}; +h.Jy=function(a){var c=a.options,d=y(a);h.Ba(d.parentNode,"contextmenu",null,function(e){h.g.Ml(e)||e.preventDefault()});d=h.Ba(window,"resize",null,function(){h.ec(!0);h.ek(a)});a.cm=d;h.nf.Kw();c.Ko&&(a.qa?a.qa.Pa(a):a.R&&(a.R.Pa(a),a.R.show(c.Ko.childNodes),a.R.vF()));d=h.Da.pc;c.$s&&(d=a.Nb.Pa(d));c.$a&&c.$a.controls&&a.Zg.Pa(d);c.vb&&c.vb.scrollbars?(a.eb=new h.oh(a),a.eb.resize()):a.Tj({x:.5,y:.5});c.Cy&&h.nf.Vy(c.Rt,a)}; +h.nf.Kw=function(){h.Ex||(h.Ba(document,"scroll",null,function(){for(var a=h.ab.getAll(),c=0,d;d=a[c];c++)d.kk&&d.kk()}),h.Ba(document,"keydown",null,h.lz),h.Zf(document,"touchend",h.uf),h.Zf(document,"touchcancel",h.uf),h.g.userAgent.wi&&h.Ba(window,"orientationchange",document,function(){h.ek(h.Ya())}));h.Ex=!0}; +h.nf.Vy=function(a,c){function d(){for(;f.length;)h.lb(f.pop());e.preload()}var e=c.Od;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.Ba(document,"mousemove",null,d,!0));f.push(h.Ba(document,"touchstart",null,d,!0))};h.Bd=function(a){this.name=a};h.A=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.ik=a;this.qj=h.A.Ny(a);this.Z=c;(a=d||null)&&a.Eu&&(this.Fu=a.Eu)};h.A.types={Nc:"field",uc:"block",re:"input",nh:"output",hd:"next",kd:"previous",Kd:"stack",Wf:"workspace"};h.A.ev=-20;h.A.Ny=function(a){switch(a){case h.A.types.kd:case h.A.types.hd:case h.A.types.re:case h.A.types.nh:return!0}return!1};h.A.Xi=function(a){return new h.A(h.A.types.Nc,a)}; +h.A.Rd=function(a){return a?a.type==h.Ha||a.type==h.Ca&&a.Vd()?h.A.fg(a.Vd()):a.type==h.Ca?new h.A(h.A.types.hd,a):a.type==h.jd?new h.A(h.A.types.nh,a):a.type==h.ld?new h.A(h.A.types.kd,a):null:null};h.A.fg=function(a){return a?new h.A(h.A.types.re,a.connection):null};h.A.Ee=function(a){return new h.A(h.A.types.uc,a)};h.A.Yi=function(a){return new h.A(h.A.types.Kd,a)};h.A.Zi=function(a,c){return new h.A(h.A.types.Wf,a,{Eu:c})};b=h.A.prototype;b.cb=function(){return this.ik}; +function nc(a,c){a=a.Z;a instanceof h.rk||(a=a.B);if(!a||!a.C)return null;var d=N(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.A.Yi(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function oc(a){if(!a)return null;do var c=a.N&&A(a.N);while(c&&t(c)==a&&(a=c));return(c=a.N||a.L)&&c.ka&&c.ka.Vd()?h.A.fg(c.ka.Vd()):h.A.Yi(a)} +b.next=function(){switch(this.ik){case h.A.types.Kd:return nc(this,!0);case h.A.types.nh:return h.A.Ee(this.Z.B);case h.A.types.Nc:a:{var a=this.Z,c=a.Vd();var d=a.B;a=c.Ea.indexOf(a)+1;c=d.K.indexOf(c);for(var e;e=d.K[c];c++){for(var f=e.Ea;a1'), +e.appendChild(d),c.push(e));if(h.zb.variables_get){a.sort(h.Pk.ix);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.na.ho(f)),c.push(e)}}return c}; +h.na.Rx=function(a){a=a.ng();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var g=!1,k=0;kf?h.V.Mj(a,0,d.height+f):h.V.Mj(a,f,d.height)};h.V.Sw=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.V.Tw=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};h.VERSION="uncompiled";h.Cj=null;h.selected=null;h.cursor=null;h.Oe=!1;h.cj=[];h.Pi=null;h.Vk=null;h.Bn=null;h.xE=null;h.uu=function(a){return{width:a.Gr,height:a.Er}};h.sF=function(a){F(a)};h.ek=function(a){for(;a.options.Fc;)a=a.options.Fc;var c=y(a),d=c.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.Gr!=e&&(c.setAttribute("width",e+"px"),c.Gr=e);c.Er!=d&&(c.setAttribute("height",d+"px"),c.Er=d);a.resize()}}; +h.lz=function(a){var c=h.Cj;if(!(h.g.Ml(a)||c.$&&!c.isVisible()))if(c.options.readOnly)h.navigation.Kt(a);else{var d=!1;if(a.keyCode==h.g.gb.rq)h.ec(),h.navigation.Fg(h.navigation.qm);else{if(h.navigation.Kt(a))return;if(a.keyCode==h.g.gb.Su||a.keyCode==h.g.gb.pi){a.preventDefault();if(h.gh.Do())return;h.selected&&h.selected.Cc()&&(d=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(h.gh.Do())return;h.selected&&h.selected.Cc()&&h.selected.mc()&&(a.keyCode==h.g.gb.Wu?(h.ec(),h.Gn(h.selected)):a.keyCode!= +h.g.gb.xr||h.selected.C.Ne||(h.Gn(h.selected),d=!0));a.keyCode==h.g.gb.qw?h.Pi&&(a=h.Vk,a.Ne&&(a=a.Lp),h.Bn&&Xa(a,h.Bn)&&(h.i.ca(!0),jc(a),h.i.ca(!1))):a.keyCode==h.g.gb.xw&&(h.ec(),c.Qp(a.shiftKey))}}d&&!h.selected.C.Ne&&(h.i.ca(!0),h.ec(),h.selected.G(!0,!0),h.i.ca(!1))}};h.Gn=function(a){if(a.mt)var c=a.Mp();else{c=h.I.$f(a,!0);h.I.vx(c);var d=a.Fa();c.setAttribute("x",a.H?-d.x:d.x);c.setAttribute("y",d.y)}h.Pi=c;h.Vk=a.C;h.Bn=a.mt?null:h.g.Cs(a)}; +h.qs=function(a){var c=h.Pi,d=h.Vk;h.Gn(a);jc(a.C);h.Pi=c;h.Vk=d};h.lF=function(a){h.g.Ml(a)||a.preventDefault()};h.ec=function(a){h.D.Ia();h.V.Ia();h.w.Bo();a||(a=h.Ya(),a.Nb&&a.Nb.R&&a.Nb.R.Ia(),a.qa&&a.qa.R&&a.qa.R.on&&a.qa.CE())};h.Ya=function(){return h.Cj};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.Ty=function(a){return function(){var c=a.type?'Block "'+a.type+'": ':"";if(a.output&&a.previousStatement)throw Error(c+"Must not have both an output and a previousStatement.");a.style&&a.style.Je&&(this.Je=a.style.Je,a.style=null);if(a.style&&a.colour)throw Error(c+"Must not have both a colour and a style.");if(a.style){var d=a.style;try{var e=this.C.uo().Pw[d];if(e)this.Or=e.colourSecondary,this.Pr=e.colourTertiary,this.Je=e.Je,this.zd(e.colourPrimary);else throw Error("Invalid style name: "+d); +}catch(r){console.warn(c+"Style does not exist: ",d)}}else if("colour"in a)if(void 0===a.colour)console.warn(c+"Undefined colour value.");else{d=a.colour;try{this.zd(d)}catch(r){console.warn(c+"Illegal colour value: ",d)}}for(d=0;void 0!==a["message"+d];){var f=a["args"+d]||[],g=a["lastDummyAlign"+d],k=h.g.dA(a["message"+d]),l=[],m=0;e=[];for(var n=0;n=q||q>f.length)throw Error('Block "'+this.type+'": Message index %'+q+" out of range.");if(l[q])throw Error('Block "'+ +this.type+'": Message index %'+q+" duplicated.");l[q]=!0;m++;e.push(f[q-1])}else(q=q.trim())&&e.push(q)}if(m!=f.length)throw Error('Block "'+this.type+'": Message does not reference all '+f.length+" arg(s).");e.length&&("string"==typeof e[e.length-1]||h.g.Ga.startsWith(e[e.length-1].type,"field_"))&&(n={type:"input_dummy"},g&&(n.align=g),e.push(n));g={LEFT:h.tm,RIGHT:h.nk,CENTRE:h.Vp};f=[];for(n=0;nk[0]?1:g[0]=a.options.length&&(a.style.display="none")}for(d=1;10>= +d;d++)a=document.getElementById("level"+d),c=!!zc(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(Ac,1)}function zc(a){var c=Bc;try{var d=window.localStorage[c+a]}catch(e){}return d}function W(a){var c=Cc(a);return null===c?"[Unknown message: "+a+"]":c} +function Cc(a){return(a=document.getElementById(a))?(a=a.textContent,a=a.replace(/\\n/g,"\n")):null}function Dc(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 Ac(){if(!sc){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")}};h.g.s={};h.g.s.va=function(a,c){return" "+a+","+c+" "};h.g.s.curve=function(a,c){return" "+a+c.join("")};h.g.s.moveTo=function(a,c){return" M "+a+","+c+" "};h.g.s.moveBy=function(a,c){return" m "+a+","+c+" "};h.g.s.lineTo=function(a,c){return" l "+a+","+c+" "};h.g.s.line=function(a){return" l"+a.join("")};h.g.s.O=function(a,c){return" "+a+" "+c+" "};h.g.s.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};h.j.Mf=function(){this.Jd=0;this.cw=3;this.Id=5;this.Iq=8;this.bc=10;this.gr=this.Id;this.cn=15;this.Ai=5;this.Vf=8;this.Uv=15;this.Tv=4;this.Pv=12;this.kv=16;this.me=8;this.Hk=15;this.hw=0;this.iw=20;this.Tu=4;this.fw=15;this.gw=100;this.ew=15;this.Om=24;this.nv=14.5;this.mv=this.cn+11;this.pv=2;this.ov=this.Om;this.$q=h.g.s.moveBy(0,0);this.Cv=12;this.Dv=6};b=h.j.Mf.prototype; +b.Pa=function(){this.jh=this.Ro();this.kh=this.So();this.ue=this.Uo();this.Sf=this.To();var a=this.me,c=h.g.s.arc("a","0 0,0",a,h.g.s.va(-a,a)),d=h.g.s.arc("a","0 0,0",a,h.g.s.va(a,a));this.ui={width:a,height:a,kp:c,Yl:d};c=this.me;a=h.g.s.moveBy(0,c)+h.g.s.arc("a","0 0,1",c,h.g.s.va(c,-c));c=h.g.s.arc("a","0 0,1",c,h.g.s.va(-c,-c));this.Nq={Op:a,un:c}};b.Ro=function(){var a=this.Cv,c=this.Dv,d=h.g.s.line([h.g.s.va(6,3),h.g.s.va(-12,6),h.g.s.va(6,3)]);return{height:a,width:c,path:d}}; +b.Uo=function(){var a=this.fw,c=this.gw,d=h.g.s.curve("c",[h.g.s.va(30,-a),h.g.s.va(70,-a),h.g.s.va(c,0)]);return{height:a,width:c,path:d}};b.To=function(){function a(g){g=g?-1:1;var k=-g,l=d/2,m=h.g.s.va(c,g*l);return h.g.s.curve("c",[h.g.s.va(0,g*(l+2.5)),h.g.s.va(-c,k*(l+.5)),h.g.s.va(-c,g*l)])+h.g.s.curve("s",[h.g.s.va(c,2.5*k),m])}var c=this.Vf,d=this.cn,e=a(!0),f=a(!1);return{width:c,height:d,ed:f,Lj:e}}; +b.So=function(){function a(k){return h.g.s.line([h.g.s.va(k*e,d),h.g.s.va(3*k,0),h.g.s.va(k*e,-d)])}var c=this.Uv,d=this.Tv,e=(c-3)/2,f=a(1),g=a(-1);return{width:c,height:d,zf:f,Qt:g}};h.j.m={NONE:0,Nc:1,uq:2,wq:4,an:8,$p:16,Aq:32,tq:64,re:128,yq:256,cr:512,Zu:1024,Tm:2048,Pm:4096,Wv:8192,Bm:16384,Lm:32768,Km:65536,Wm:131072,Vm:262144,Eq:524288,Ym:1048576,hn:2097152,wm:4194304,zq:8388608};h.j.m.dC=h.j.m.Lm|h.j.m.Km;h.j.m.xD=h.j.m.Wm|h.j.m.Vm;h.j.m.cp=16777216;h.j.m.cb=function(){h.j.m.hasOwnProperty(void 0)||(h.j.m[void 0]=h.j.m.cp,h.j.m.cp<<=1);return h.j.m[void 0]};h.j.m.uj=function(a){return a.type&h.j.m.Nc};h.j.m.xg=function(a){return a.type&h.j.m.uq}; +h.j.m.Lh=function(a){return a.type&h.j.m.wq};h.j.m.xd=function(a){return a.type&h.j.m.an};h.j.m.aF=function(a){return a.type&h.j.m.Aq};h.j.m.wd=function(a){return a.type&h.j.m.re};h.j.m.tj=function(a){return a.type&h.j.m.tq};h.j.m.qf=function(a){return a.type&h.j.m.yq};h.j.m.yj=function(a){return a.type&h.j.m.cr};h.j.m.Nh=function(a){return a.type&h.j.m.Tm};h.j.m.tf=function(a){return a.type&h.j.m.Pm};h.j.m.Ry=function(a){return a.type&(h.j.m.Tm|h.j.m.Pm)};h.j.m.sf=function(a){return a.type&h.j.m.Km}; +h.j.m.dF=function(a){return a.type&h.j.m.Vm};h.j.m.wj=function(a){return a.type&h.j.m.Lm};h.j.m.eF=function(a){return a.type&h.j.m.Wm};h.j.m.ZE=function(a){return a.type&h.j.m.Bm};h.j.m.nt=function(a){return a.type&h.j.m.Eq};h.j.m.fF=function(a){return a.type&h.j.m.Ym};h.j.m.XE=function(a){return a.type&h.j.m.$p};h.j.m.Nl=function(a){return a.type&h.j.m.hn};h.j.m.Gl=function(a){return a.type&h.j.m.wm};h.j.m.gF=function(a){return a.type&(h.j.m.hn|h.j.m.wm)};h.j.m.bF=function(a){return a.type&h.j.m.zq};h.j.Ze=function(a){this.height=this.width=0;this.type=h.j.m.NONE;this.cf=this.ta=0;this.u=a;this.dd=this.u.Hk};h.j.aa=function(a,c){h.j.aa.v.constructor.call(this,a);this.En=c;a:switch(a=this.u,c.type){case h.Ha:case h.jd:c=a.Sf;break a;case h.ld:case h.Ca:c=a.kh;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=h.j.m.Zu};h.g.object.S(h.j.aa,h.j.Ze);h.j.Sm=function(a,c){h.j.Sm.v.constructor.call(this,a,c);this.type|=h.j.m.Wv;this.height=this.shape.height;this.width=this.shape.width;this.Vc=this.u.Ai;this.Ic=this.width};h.g.object.S(h.j.Sm,h.j.aa); +h.j.Um=function(a,c){h.j.Um.v.constructor.call(this,a,c);this.type|=h.j.m.Tm;this.height=this.shape.height;this.width=this.shape.width};h.g.object.S(h.j.Um,h.j.aa);h.j.Qm=function(a,c){h.j.Qm.v.constructor.call(this,a,c);this.type|=h.j.m.Pm;this.height=this.shape.height;this.width=this.shape.width};h.g.object.S(h.j.Qm,h.j.aa);h.j.xi=function(a,c){h.j.xi.v.constructor.call(this,a,c.connection);this.type|=h.j.m.re;this.input=c;this.align=c.align;(this.eg=c.connection&&A(c.connection)?A(c.connection):null)?(a=J(this.eg),this.Si=a.width,this.Xk=a.height):this.Xk=this.Si=0;this.connection=c.connection;this.Vc=0};h.g.object.S(h.j.xi,h.j.aa); +h.j.Ye=function(a,c){h.j.Ye.v.constructor.call(this,a,c);this.type|=h.j.m.yq;this.eg?(this.width=this.Si,this.height=this.Xk):(this.height=this.u.mv,this.width=this.shape.width+this.u.nv);this.Vc=this.u.Ai;this.Ti=this.shape.height;this.ef=this.shape.width};h.g.object.S(h.j.Ye,h.j.xi);h.j.bf=function(a,c){h.j.bf.v.constructor.call(this,a,c);this.type|=h.j.m.cr;this.height=this.eg?this.Xk+this.u.hw:this.u.ov;this.width=this.u.Hk+this.shape.width};h.g.object.S(h.j.bf,h.j.xi); +h.j.Ck=function(a,c){h.j.Ck.v.constructor.call(this,a,c);this.type|=h.j.m.tq;this.height=this.eg?this.Xk-2*this.u.Ai:this.shape.height;this.width=this.shape.width+this.u.pv;this.Vc=this.u.Ai;this.Ti=this.shape.height;this.ef=this.shape.width};h.g.object.S(h.j.Ck,h.j.xi);h.j.se=function(a,c){h.j.se.v.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=h.j.m.wq;a=new h.g.md(h.se.prototype.Jk,h.se.prototype.Jk-2);this.height=a.height;this.width=a.width};h.g.object.S(h.j.se,h.j.Ze);h.j.Jm=function(a){h.j.Jm.v.constructor.call(this,a);this.type|=h.j.m.Eq;this.height=this.u.jh.height;this.width=this.u.jh.width};h.g.object.S(h.j.Jm,h.j.Ze); +h.j.xa=function(a,c){h.j.xa.v.constructor.call(this,a);this.vs=c;this.Dc=c.Gd&&!!c.B&&c.B.Dc();this.Ox=c.Is();this.type|=h.j.m.Nc;a=this.vs.Ie();this.height=a.height;this.width=a.width};h.g.object.S(h.j.xa,h.j.Ze);h.j.Gm=function(a){h.j.Gm.v.constructor.call(this,a);this.type|=h.j.m.uq;this.height=this.u.ue.height;this.width=this.u.ue.width;this.uh=this.height};h.g.object.S(h.j.Gm,h.j.Ze); +h.j.Ok=function(a,c){h.j.Ok.v.constructor.call(this,a);this.type=(c&&"left"!=c?h.j.m.Wm:h.j.m.Lm)|h.j.m.Bm;this.width=this.height=this.u.Jd};h.g.object.S(h.j.Ok,h.j.Ze);h.j.Ik=function(a,c){h.j.Ik.v.constructor.call(this,a);this.type=(c&&"left"!=c?h.j.m.Vm:h.j.m.Km)|h.j.m.Bm;this.width=this.u.me;this.height=this.u.me/2};h.g.object.S(h.j.Ik,h.j.Ze);h.j.hh=function(a,c){h.j.hh.v.constructor.call(this,a);this.type=this.type|h.j.m.an|h.j.m.Aq;this.width=c;this.height=this.u.ew};h.g.object.S(h.j.hh,h.j.Ze);h.j.Uf=function(a){this.type=h.j.m.Ym;this.elements=[];this.ta=this.Jb=this.ke=this.minWidth=this.minHeight=this.width=this.height=0;this.Ys=this.Al=this.zo=this.dc=this.qg=!1;this.u=a;this.dd=this.u.Hk};h.j.Uf.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function X(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.j.m.wd(d))return d;return null}h.j.Uf.prototype.Ip=function(){return!0};h.j.Uf.prototype.ts=function(){return!0}; +function Ec(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.j.m.xd(d))return d;return null}h.j.qh=function(a){h.j.qh.v.constructor.call(this,a);this.type|=h.j.m.hn;this.uh=this.xe=0;this.By=!1;this.connection=null};h.g.object.S(h.j.qh,h.j.Uf);h.j.qh.prototype.Ao=function(a){var c=a.Je?"cap"===a.Je:h.ea.ue,d=a.N&&A(a.N);return!!a.L||c||(d?t(d)==a:!1)}; +h.j.qh.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.j.m.xd(f)||(h.j.m.xg(f)?d=Math.max(d,f.uh):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.xe=this.uh=d;this.ke=this.width};h.j.qh.prototype.Ip=function(){return!1};h.j.ah=function(a){h.j.ah.v.constructor.call(this,a);this.type|=h.j.m.wm;this.Zs=!1;this.connection=null;this.Yf=this.bj=0};h.g.object.S(h.j.ah,h.j.Uf); +h.j.ah.prototype.Ao=function(a){return!!a.L||!!t(a)};h.j.ah.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.j.m.xd(f)||(h.j.m.tf(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.bj=d;this.ke=this.width};h.j.ah.prototype.Ip=function(){return!1}; +h.j.Nk=function(a,c,d){h.j.Nk.v.constructor.call(this,a);this.type=this.type|h.j.m.an|h.j.m.$p;this.width=d;this.height=c;this.As=!1;this.ke=0;this.elements=[new h.j.hh(this.u,d)]};h.g.object.S(h.j.Nk,h.j.Uf);h.j.Nk.prototype.measure=function(){};h.j.ih=function(a){h.j.ih.v.constructor.call(this,a);this.type|=h.j.m.zq;this.Sr=0};h.g.object.S(h.j.ih,h.j.Uf); +h.j.ih.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.m.wd(d)&&(h.j.m.yj(d)?a+=d.Si:h.j.m.tj(d)&&0!=d.Si&&(a+=d.Si-d.ef)),h.j.m.xd(d)||(this.height=Math.max(this.height,d.height));this.Sr=a;this.ke=this.width+a};h.j.ih.prototype.ts=function(){return!this.qg&&!this.dc};h.j.$e=function(a,c){this.ba=c;this.Df=a;this.u=this.Df.u;this.L=c.L?new h.j.Sm(this.u,c.L):null;this.Jo=Ga(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.rf=c.rf();this.H=c.H;this.Pg=this.width=this.ji=this.height=0;this.rows=[];this.ct=[];this.rb=new h.j.qh(this.u);this.bb=new h.j.ah(this.u);this.jm=this.Ic=0};b=h.j.$e.prototype; +b.measure=function(){var a=this.ba.Je?"cap"===this.ba.Je:h.ea.ue,c=!!this.ba.N;this.rb.Ao(this.ba)?this.rb.elements.push(new h.j.Ok(this.u)):this.rb.elements.push(new h.j.Ik(this.u));a?(a=new h.j.Gm(this.u),this.rb.elements.push(a),this.rb.xe=a.uh):c&&(this.rb.By=!0,this.rb.connection=new h.j.Um(this.u,this.ba.N),this.rb.elements.push(this.rb.connection));this.ba.K.length&&this.ba.K[0].type==h.Ca&&!this.ba.isCollapsed()?this.rb.minHeight=this.u.bc:this.rb.minHeight=this.u.Id;this.rows.push(this.rb); +a=new h.j.ih(this.u);var d=M(this.ba);if(d.length){c=0;for(var e;e=d[c];c++){var f=new h.j.se(this.u,e);this.isCollapsed&&e.Nr?this.ct.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.ba.K[c];c++)if(d.isVisible()){!e||d.type!=h.Ca&&e.type!=h.Ca&&(d.type!=h.Ha&&d.type!=h.qe||this.Jo)||(this.rows.push(a),a=new h.j.ih(this.u));for(e=0;f=d.Ea[e];e++)a.elements.push(new h.j.xa(this.u,f,d));this.Br(d,a);e=d}this.isCollapsed&&(a.Ys=!0,a.elements.push(new h.j.Jm(this.u)));(a.elements.length||a.Al)&&this.rows.push(a); +this.bb.Zs=!!this.ba.W;this.bb.minHeight=this.ba.K.length&&this.ba.K[this.ba.K.length-1].type==h.Ca?this.u.bc:this.u.Id-1;this.bb.Ao(this.ba)?this.bb.elements.push(new h.j.Ok(this.u)):this.bb.elements.push(new h.j.Ik(this.u));this.bb.Zs&&(this.bb.connection=new h.j.Qm(this.u,this.ba.W),this.bb.elements.push(this.bb.connection));this.rows.push(this.bb);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.Ip()&&c.elements.push(new h.j.hh(this.u,this.ul(null,d[0])));for(e=0;ea.fc&&(a.T+=h.g.s.O("V",c.Jb+c.height-a.fc)))};h.U.Tf=function(a){this.Rg=a;this.bk=h.g.o.J("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Rg);this.di=h.g.o.J("path",{"class":"blocklyPath"},this.Rg);this.dk=h.g.o.J("path",{"class":"blocklyPathLight"},this.Rg)};h.U.Tf.prototype.Bp=function(a,c){this.di.setAttribute("d",a);this.bk.setAttribute("d",a);this.dk.setAttribute("d",c)}; +h.U.Tf.prototype.eo=function(){this.di.setAttribute("transform","scale(-1 1)");this.dk.setAttribute("transform","scale(-1 1)");this.bk.setAttribute("transform","translate(1,1) scale(-1 1)")};h.U.Ye=function(a,c){h.U.Ye.v.constructor.call(this,a,c);this.eg&&(this.width+=this.u.ac,this.height+=this.u.ac)};h.g.object.S(h.U.Ye,h.j.Ye);h.U.bf=function(a,c){h.U.bf.v.constructor.call(this,a,c);this.eg&&(this.height+=this.u.ac)};h.g.object.S(h.U.bf,h.j.bf);h.U.$e=function(a,c){h.U.$e.v.constructor.call(this,a,c)};h.g.object.S(h.U.$e,h.j.$e);b=h.U.$e.prototype;b.Br=function(a,c){this.Jo&&a.type==h.Ha?(c.elements.push(new h.U.Ye(this.u,a)),c.zo=!0):a.type==h.Ca?(c.elements.push(new h.U.bf(this.u,a)),c.dc=!0):a.type==h.Ha?(c.elements.push(new h.j.Ck(this.u,a)),c.qg=!0):a.type==h.qe&&(c.Al=!0)}; +b.ul=function(a,c){if(!a)return c&&h.j.m.uj(c)&&c.Dc?this.u.Id:c&&h.j.m.qf(c)?this.u.Iq:c&&h.j.m.yj(c)?this.u.iw:this.u.bc;if(!h.j.m.wd(a)&&!c)return h.j.m.uj(a)&&a.Dc?this.u.Id:h.j.m.Lh(a)?2*this.u.bc+1:h.j.m.xg(a)?this.u.Jd:h.j.m.Ry(a)?this.u.bc:h.j.m.sf(a)?this.u.Pv:h.j.m.nt(a)?this.u.Jd:this.u.bc;if(h.j.m.wd(a)&&!c){if(h.j.m.tj(a))return this.u.Jd;if(h.j.m.qf(a))return this.u.bc;if(h.j.m.yj(a))return this.u.Jd}if(!h.j.m.wd(a)&&c&&h.j.m.wd(c)){if(a.Dc){if(h.j.m.qf(c)||h.j.m.tj(c))return this.u.cw}else{if(h.j.m.qf(c)|| +h.j.m.tj(c))return this.u.Iq;if(h.j.m.yj(c))return this.u.bc}return this.u.bc-1}if(h.j.m.Lh(a)&&c&&!h.j.m.wd(c))return this.u.bc;if(h.j.m.qf(a)&&c&&!h.j.m.wd(c))return c.Dc?this.u.Id:this.u.bc;if(h.j.m.wj(a)&&c){if(h.j.m.xg(c))return this.u.Jd;if(h.j.m.Nh(c))return c.dd;if(h.j.m.tf(c))return a=(this.H?1:-1)*this.u.ac/2,c.dd+a}if(h.j.m.sf(a)&&c){if(h.j.m.Nh(c))return c.dd-this.u.me;if(h.j.m.tf(c))return a=(this.H?1:-1)*this.u.ac/2,c.dd-this.u.me+a}return!h.j.m.wd(a)&&c&&!h.j.m.wd(c)&&a.Dc==c.Dc||c&& +h.j.m.nt(c)?this.u.bc:this.u.Id};b.kn=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(h.j.m.xd(e)){d=e;break a}d=null}e=Ec(a);if(a.qg||a.dc)a.ke+=c;var f=X(a);f?f.align==h.tm?e.width+=c:f.align==h.Vp?(d.width+=c/2,e.width+=c/2):f.align==h.nk&&(d.width+=c):e.width+=c;a.width+=c};b.Ns=function(a,c){return h.j.m.Nl(a)&&h.j.m.Gl(c)?this.u.kv:h.j.m.Nl(a)||h.j.m.Gl(c)?this.u.Jd:a.qg&&c.qg?this.u.bc:!a.dc&&c.dc?this.u.Tu:a.dc&&c.dc||!a.dc&&c.Al?this.u.bc:this.u.Id}; +b.Hs=function(a,c){if(h.j.m.xd(c))return a.Jb+c.height/2;if(h.j.m.Gl(a))return a=a.Jb+a.height-a.bj,h.j.m.tf(c)?a+c.height/2:a-c.height/2;if(h.j.m.Nl(a))return h.j.m.xg(c)?a.xe-c.height/2:a.xe+c.height/2;var d=a.Jb;h.j.m.uj(c)||h.j.m.Lh(c)?(d+=c.height/2,(a.zo||a.dc)&&c.height+this.u.gr<=a.height&&(d+=this.u.gr)):d=h.j.m.qf(c)?d+c.height/2:d+a.height/2;return d}; +b.ws=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Jb=c;e.ta=this.Ic;c+=e.height;a=Math.max(a,e.ke);var f=c-this.rb.uh;e==this.bb&&f=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},bp:function(){10>V?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+U+"&level="+(V+1):Z.mj()},et:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}var e=a;a=C;if(void 0===c){for(var f=0;d=a.kj[f];f++)d.Se(!1);a.kj.length= +0}if(d=e?u(a,e):null)(c=void 0===c||c)?-1==a.kj.indexOf(d)&&a.kj.push(d):h.g.Hi(a.kj,d),d.Se(c)},Ky:function(a,c){a=document.getElementById(a);a.firstChild||(a=h.nf(a,{rtl:tc(),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),h.I.Fe(h.I.Ue(c),a))},Zz:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},gf:function(a){if("click"==a.type&&"touchend"==Z.gf.op&&Z.gf.mp+2E3>Date.now()||Z.gf.op==a.type&&Z.gf.mp+400>Date.now())return a.preventDefault(),a.stopPropagation(), +!0;Z.gf.op=a.type;Z.gf.mp=Date.now();return!1}};Z.gf.op=null;Z.gf.mp=0;Z.VE=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};Z.WE=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=Z;Z.setCode=Z.iu;Z.getCode=Z.jo;Z.getWorkspace=Z.yl;var Y={Me:!1,hs:null,al:null,ci:function(a,c,d,e,f,g){function k(){Y.Me&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);Y.Me&&Y.Bc(!1);h.Ya()&&h.ec(!0);Y.Me=!0;Y.hs=c;Y.al=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),Y.Kn=h.Zf(e,"mousedown",Y.wx));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(Y.Rl(c,!1,.2),Y.Rl(l,!0,.8),setTimeout(k,175)):k()},js:0,ks:0,wx:function(a){Y.Nn();if(!h.g.Oh(a)){var c=document.getElementById("dialog");Y.js=c.offsetLeft-a.clientX;Y.ks=c.offsetTop-a.clientY;Y.Mn=h.Zf(document,"mouseup",Y.Nn);Y.Ln=h.Zf(document,"mousemove",Y.xx);a.stopPropagation()}},xx:function(a){var c=document.getElementById("dialog"),d=Y.js+a.clientX; +a=Y.ks+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"},Nn:function(){Y.Mn&&(h.lb(Y.Mn),Y.Mn=null);Y.Ln&&(h.lb(Y.Ln),Y.Ln=null)},Bc:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(Y.Me){Y.Nn();Y.Kn&&(h.lb(Y.Kn),Y.Kn=null);Y.Me=!1;Y.al&&Y.al();Y.al=null;var d=!1===a?null:Y.hs;a=document.getElementById("dialog"); +var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(Y.Rl(a,!1,.8),Y.Rl(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)}},Rl: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=Y.Vx(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},Vx:function(a){var c=h.g.style.no(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},tu:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eV?W("Games_nextLevel").replace("%1",String(V+1)):W("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +Y.Bc,!0);c.addEventListener("touchend",Y.Bc,!0);c=document.getElementById("doneOk");c.addEventListener("click",Z.bp,!0);c.addEventListener("touchend",Z.bp,!0);Y.ci(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",Y.Rr,!0)});document.body.addEventListener("keydown",Y.Rr,!0);document.getElementById("dialogDoneText").textContent=d},gs:function(a){!Y.Me||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(Y.Bc(!0),a.stopPropagation(),a.preventDefault())}, +Gp:function(){document.body.addEventListener("keydown",Y.gs,!0)},Jp:function(){document.body.removeEventListener("keydown",Y.gs,!0)},Rr:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)Y.Bc(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&Z.bp()},zr:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)Y.Bc(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&Z.mj()},Bs:function(a){27==a.keyCode?Y.Bc(!0):13==a.keyCode&&Y.fo()},fo: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?W("Games_submitted"):W("Games_httpRequestError")+"\nStatus: "+f.status;Y.tu(null,g)}};f.send(c.join("&"));Y.Bc(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=Y;Y.hideDialog=Y.Bc;var Uc=Uc||{};function Vc(a,c){function d(){}d.prototype=c.prototype;a.v=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.uE=function(e,f,g){return c.prototype[f].apply(e,Array.prototype.slice.call(arguments,2))}}if(!Wc){var Wc,Xc="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(Xc=navigator.userAgent);var Yc=0==Xc.indexOf("Opera");Wc={hF:{PB:"ScriptEngine"in window},XC:Yc,Xe:!Yc&&-1!=Xc.indexOf("MSIE"),rr:!Yc&&-1!=Xc.indexOf("WebKit")}}if(!Zc)var Zc={}; +if(!$c)var $c={};if(!ad)var ad={};if(!bd)var bd={};if(!cd)var cd={};if(!dd)var dd={};var ed=Uc.TA?{uF:!0}:{};function fd(){throw Error("Do not instantiate directly");}fd.prototype.Vr=null;fd.prototype.toString=function(){return this.content};function gd(a){if(null!=a)switch(a.Vr){case 1:return 1;case -1:return-1;case 0:return 0}return null}function hd(){fd.call(this)}Vc(hd,fd);hd.prototype.mx=ed;function id(a){return null!=a&&a.mx===ed?a:jd(String(String(a)).replace(kd,ld),gd(a))} +var jd=function(a){function c(){}c.prototype=a.prototype;return function(d,e){var f=new c;f.content=String(d);void 0!==e&&(f.Vr=e);return f}}(hd),md={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function ld(a){return md[a]}var kd=/[\x00\x22\x26\x27\x3c\x3e]/g;function nd(){return'
'};h.Ja=function(a,c,d){"function"!=typeof a&&h.Ja.yu(a);this.Qh=a;this.tl=null;this.Qj=0;this.Kp=this.lp=null;a=this.Qh;if(Array.isArray(a)){for(var e=!1,f=0;fa.length)){e=[];for(f=0;fthis.Qj)return null;var a=this.getOptions(!0)[this.Qj][0];return"object"==typeof a?a.alt:a}; +h.Ja.yu=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=d||0>=c)throw Error("Height and width values of an image field must be greater than 0.");this.fj=!1;this.Qk="";h.Hd.v.constructor.call(this,a||"",null,k);k||(this.fj=!!g,this.Qk=h.g.oc(e)||"");this.jb=new h.g.md(c,d+h.Hd.yr);this.Hy=d;this.Oi=null;"function"== +typeof f&&(this.Oi=f)};h.g.object.S(h.Hd,h.xa);h.Hd.oa=function(a){return new h.Hd(a.src,a.width,a.height,void 0,void 0,void 0,a)};h.Hd.yr=1;b=h.Hd.prototype;b.Gd=!1;b.pf=!1;b.Ri=function(a){h.Hd.v.Ri.call(this,a);this.fj=!!a.flipRtl;this.Qk=h.g.oc(a.alt)||""};b.nj=function(){this.ad=h.g.o.J("image",{height:this.Hy+"px",width:this.jb.width+"px",alt:this.Qk},this.Wc);this.ad.setAttributeNS(h.g.o.sh,"xlink:href",this.je)};b.fl=function(a){return"string"!=typeof a?null:a}; +b.hl=function(a){this.je=a;this.ad&&this.ad.setAttributeNS(h.g.o.sh,"xlink:href",this.je||"")};b.Is=function(){return this.fj};b.Wj=function(){this.Oi&&this.Oi(this)};b.to=function(){return this.Qk};h.zc.register("field_image",h.Hd);h.zb.animal={Pa:function(){this.zd(120);Q(yb(this),"","NAME");Q(tb(this.Xf(h.Ha,"PIC"),h.nk),W("Puzzle_picture"));Q(Q(tb(yb(this),h.nk),W("Puzzle_legs")),new h.Ja(od),"LEGS");Q(this.Xf(h.Ca,"TRAITS"),W("Puzzle_traits"));this.Mg(!1)},Wb:function(){var a=document.createElement("mutation");a.setAttribute("animal",this.Tc);return a},yc:function(a){this.Ig(parseInt(a.getAttribute("animal"),10))},Tc:0,Ig:function(a){this.Tc=a;wb(this,W("Puzzle_animal"+a));this.rg=W("Puzzle_animal"+a+"HelpUrl")},Io:function(){return Fa(this, +"LEGS")==this.Tc}};h.zb.picture={Pa:function(){this.zd(30);yb(this,"PIC");this.gm(!0);this.Gf("")},Wb:h.zb.animal.Wb,yc:h.zb.animal.yc,Tc:0,Ig:function(a){this.Tc=a;var c="puzzle/"+W("Puzzle_animal"+a+"Pic"),d=W("Puzzle_animal"+a+"PicHeight");a=W("Puzzle_animal"+a+"PicWidth");Q(ia(this,"PIC"),new h.Hd(c,a,d))},Io:function(){var a=this.getParent();return a&&a.Tc==this.Tc}}; +h.zb.trait={Pa:function(){this.zd(290);Q(yb(this),"","NAME");this.hm(!0);this.fm(!0)},Wb:function(){var a=document.createElement("mutation");a.setAttribute("animal",this.Tc);a.setAttribute("trait",this.xu);return a},yc:function(a){this.Ig(parseInt(a.getAttribute("animal"),10),parseInt(a.getAttribute("trait"),10))},Tc:0,xu:0,Ig:function(a,c){this.Tc=a;this.xu=c;wb(this,W("Puzzle_animal"+a+"Trait"+c))},Io:function(){var a=ub(this);return a&&a.Tc==this.Tc}};var Bc="puzzle";function pd(a){for(var c=a.length-1;0Math.sqrt(Math.pow(f-d.x,2)+Math.pow(g-d.y,2))?(e=f-d.x,d=g-d.y):(d=h.g.Vb.cA(Math.atan2(g-d.y,f-d.x)),d%=360,0>d&&(d+=360),e=Math.round(5*Math.cos(h.g.Vb.Sg(d))),d=Math.round(5*Math.sin(h.g.Vb.Sg(d)))); +a.moveBy(e,d);setTimeout(sd.bind(null,a,c),50)}} +function td(a){Z.Ky("sample",';;;1;;;;;;;;;;;;;;;;;'.split(";"));var c=document.getElementById("help"),d=document.getElementById("helpButton"); +Y.ci(c,d,a,!0,{width:"50%",left:"25%",top:"5em"},Y.Jp);Y.Gp()} +window.addEventListener("load",function(){function a(){d.style.width=window.innerWidth-20+"px";d.style.height=window.innerHeight-d.offsetTop-15+"px"}document.body.innerHTML='
Patoduck.jpg70100  2  PenasBicohttp://pt.wikipedia.org/wiki/PatoGatocat.jpg70100  4  BigodesPelohttp://pt.wikipedia.org/wiki/GatoAbelhabee.jpg70100  6  MelFerr\u00e3ohttp://pt.wikipedia.org/wiki/AbelhaCaracolsnail.jpg70100  0  ConchaGosmahttp://pt.wikipedia.org/wiki/Caracolimagem:patas:escolha...tra\u00e7os:Perfeito!\nTodos os %1 blocos est\u00e3o corretos.Quase! Um bloco est\u00e1 incorreto.%1 blocos est\u00e3o incorretos.O bloco destacado est\u00e1 incorreto. Continue tentando.
Para cada animal (verde), anexe sua imagem, escolha seu numero de pernas, e fa\u00e7a uma lista de seus tra\u00e7os.
')+ +nd()+'
'+nd()+"
";Z.Pa();var c=tc(),d=document.getElementById("blockly");a(null);window.addEventListener("resize",a);C=h.nf("blockly",{media:"third-party/blockly/media/",rtl:c,scrollbars:!1,trashcan:!1});var e=zc(V);try{var f=window.sessionStorage.Pl}catch(v){f=null}if(f)delete window.sessionStorage.Pl,c=h.I.Ue(f),h.I.Fe(c,C);else if(e)c=h.I.Ue(e),h.I.Fe(c,C);else{var g= +[],k=[],l=[];f=1;for(var m;Cc("Puzzle_animal"+f);){m=C.Sh("animal");m.Ig(f);g.push(m);m=C.Sh("picture");m.Ig(f);k.push(m);for(var n=1;Cc("Puzzle_animal"+f+"Trait"+n);)m=C.Sh("trait"),m.Ig(f,n),l.push(m),n++;f++}pd(g);pd(k);pd(l);g=[].concat(g,k,l);c&&g.reverse();for(f=0;m=g[f];f++)m.Jn=!1,m.ug(),m.wa();for(f=k=0;m=g[f];f++)l=m.ga().getBBox(),m.zE=l.width,m.yE=l.height,m.Hr=l.width*l.height,k+=m.Hr;h.ek(C);n=h.uu(y(C));n.width-=50;n.height-=50;var q=0;for(f=0;m=g[f];f++){l=m.ga().getBBox();var r=c? +l.width+q/k*n.width:q/k*(n.width-l.width);r=Math.round(r+50*Math.random());m.moveBy(r,Math.round(Math.random()*(n.height-l.height)));q+=m.Hr}}Za();Dc("checkButton",qd);Dc("helpButton",function(){td(!0)});e||td(!1);h.Sb*=2;h.jq=h.Sb;C.Od.load(["puzzle/win.mp3","puzzle/win.ogg"],"win")}); diff --git a/html/blockly-games/puzzle/snail.jpg b/html/blockly-games/puzzle/snail.jpg new file mode 100644 index 0000000..1b589cd Binary files /dev/null and b/html/blockly-games/puzzle/snail.jpg differ diff --git a/html/blockly-games/puzzle/style.css b/html/blockly-games/puzzle/style.css new file mode 100644 index 0000000..6d37102 --- /dev/null +++ b/html/blockly-games/puzzle/style.css @@ -0,0 +1,31 @@ +body { + overflow: hidden; +} + +#graph { + position: absolute; + bottom: 25px; + height: 15px; + width: 100px; + border: 1px solid #ddd; +} +#graphValue { + height: 15px; + width: 0; + background-color: #0d0; + transition-property: width; + transition-duration: 1s; +} + +#blockly { + position: fixed; +} + +#help { + overflow: hidden; +} + +#sample { + height: 205px; + width: 300px; +} diff --git a/html/blockly-games/puzzle/win.mp3 b/html/blockly-games/puzzle/win.mp3 new file mode 100644 index 0000000..cb1594a Binary files /dev/null and b/html/blockly-games/puzzle/win.mp3 differ diff --git a/html/blockly-games/puzzle/win.ogg b/html/blockly-games/puzzle/win.ogg new file mode 100644 index 0000000..4447576 Binary files /dev/null and b/html/blockly-games/puzzle/win.ogg differ diff --git a/html/blockly-games/third-party/JS-Interpreter/compressed.js b/html/blockly-games/third-party/JS-Interpreter/compressed.js new file mode 100644 index 0000000..9a74461 --- /dev/null +++ b/html/blockly-games/third-party/JS-Interpreter/compressed.js @@ -0,0 +1,185 @@ +'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(b){var a=0;return function(){return aa)++g;else if(47===a)if(a=h.charCodeAt(g+1),42===a){a=void 0;var b=l.onComment&&l.locations&&new e,d=g,f=h.indexOf("*/",g+=2);-1===f&&c(g-2,"Unterminated comment");g=f+2;if(l.locations)for(X.lastIndex=d;(a=X.exec(h))&&a.index=a?a=Va(!0):(++g,a=f(xa)),a;case 40:return++g,f(I);case 41:return++g,f(E);case 59:return++g,f(J);case 44:return++g,f(K);case 91:return++g,f(ka);case 93:return++g,f(la);case 123:return++g,f(Y);case 125:return++g,f(R);case 58:return++g,f(Z);case 63:return++g,f(ya);case 48:if(a=h.charCodeAt(g+1),120===a||88===a)return g+=2,a=S(16),null==a&&c(w+2,"Expected hexadecimal number"),ma(h.charCodeAt(g))&&c(g,"Identifier directly after number"),f(aa,a);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Va(!1); +case 34:case 39:a:{g++;for(var b="";;){g>=Q&&c(w,"Unterminated string constant");var d=h.charCodeAt(g);if(d===a){++g;a=f(ca,b);break a}if(92===d){d=h.charCodeAt(++g);var e=/^[0-7]+/.exec(h.slice(g,g+3));for(e&&(e=e[0]);e&&255=Q)return f(qa);var b=h.charCodeAt(g);if(ma(b)||92===b)return Za();a=B(b);if(!1===a){b=String.fromCharCode(b);if("\\"===b||$a.test(b))return Za();c(g,"Unexpected character '"+b+"'")}return a}function r(a, +b){var c=h.slice(g,g+b);g+=b;f(a,c)}function da(){for(var a,b,d=g;;){g>=Q&&c(d,"Unterminated regular expression");var e=h.charAt(g);oa.test(e)&&c(d,"Unterminated regular expression");if(a)a=!1;else{if("["===e)b=!0;else if("]"===e&&b)b=!1;else if("/"===e&&!b)break;a="\\"===e}++g}a=h.slice(d,g);++g;(b=ab())&&!/^[gmsiy]*$/.test(b)&&c(d,"Invalid regexp flag");return f(Ba,new RegExp(a,b))}function S(a,b){for(var c=g,d=0,e=0,z=null==b?Infinity:b;e=f?f-48:Infinity;if(f>=a)break;++g;d=d*a+f}return g===c||null!=b&&g-c!==b?null:d}function Va(a){var b=g,d=!1,e=48===h.charCodeAt(g);a||null!==S(10)||c(b,"Invalid number");46===h.charCodeAt(g)&&(++g,S(10),d=!0);a=h.charCodeAt(g);if(69===a||101===a)a=h.charCodeAt(++g),43!==a&&45!==a||++g,null===S(10)&&c(b,"Invalid number"),d=!0;ma(h.charCodeAt(g))&&c(g,"Identifier directly after number");a=h.slice(b,g);var z;d?z=parseFloat(a):e&&1!==a.length?/[89]/.test(a)||C?c(b,"Invalid number"):z=parseInt(a, +8):z=parseInt(a,10);return f(aa,z)}function na(a){a=S(16,a);null===a&&c(w,"Bad character escape sequence");return a}function ab(){ba=!1;for(var a,b=!0,d=g;;){var e=h.charCodeAt(g);if(bb(e))ba&&(a+=h.charAt(g)),++g;else if(92===e){ba||(a=h.slice(d,g));ba=!0;117!=h.charCodeAt(++g)&&c(g,"Expecting Unicode escape sequence \\uXXXX");++g;e=na(4);var f=String.fromCharCode(e);f||c(g-1,"Invalid Unicode escape");(b?ma(e):bb(e))||c(g-4,"Invalid Unicode escape");a+=f}else break;b=!1}return ba?a:h.slice(d,g)} +function Za(){var a=ab(),b=U;ba||(Mb(a)?b=Ca[a]:(l.forbidReserved&&(3===l.ecmaVersion?Nb:Ob)(a)||C&&cb(a))&&c(w,"The keyword '"+a+"' is reserved"));return f(b,a)}function q(){Da=w;L=W;Ea=ja;x()}function Fa(a){C=a;g=L;if(l.locations)for(;gb){var e=O(a);e.left=a;e.operator=H;a=m;q();e.right=Ra(Sa(),d,c);d=n(e,a===Wa||a===Xa?"LogicalExpression":"BinaryExpression");return Ra(d,b,c)}return a}function Sa(){if(m.prefix){var a=y(),b=m.isUpdate;a.operator=H;P=a.prefix= +!0;q();a.argument=Sa();b?sa(a.argument):C&&"delete"===a.operator&&"Identifier"===a.argument.type&&c(a.start,"Deleting local variable in strict mode");return n(a,b?"UpdateExpression":"UnaryExpression")}for(b=ia(va());m.postfix&&!ra();)a=O(b),a.operator=H,a.prefix=!1,a.argument=b,sa(b),q(),b=n(a,"UpdateExpression");return b}function ia(a,b){if(t(xa)){var c=O(a);c.object=a;c.property=N(!0);c.computed=!1;return ia(n(c,"MemberExpression"),b)}return t(ka)?(c=O(a),c.object=a,c.property=A(),c.computed=!0, +u(la),ia(n(c,"MemberExpression"),b)):!b&&t(I)?(c=O(a),c.callee=a,c.arguments=Ta(E,!1),ia(n(c,"CallExpression"),b)):a}function va(){switch(m){case vb:var a=y();q();return n(a,"ThisExpression");case U:return N();case aa:case ca:case Ba:return a=y(),a.value=H,a.raw=h.slice(w,W),q(),n(a,"Literal");case wb:case xb:case yb:return a=y(),a.value=m.atomValue,a.raw=m.keyword,q(),n(a,"Literal");case I:a=pa;var b=w;q();var d=A();d.start=b;d.end=W;l.locations&&(d.loc.start=a,d.loc.end=ja);l.ranges&&(d.range=[b, +W]);u(E);return d;case ka:return a=y(),q(),a.elements=Ta(la,!0,!0),n(a,"ArrayExpression");case Y:a=y();b=!0;d=!1;a.properties=[];for(q();!t(R);){if(b)b=!1;else if(u(K),l.allowTrailingCommas&&t(R))break;var e={key:m===aa||m===ca?va():N(!0)},f=!1;if(t(Z)){e.value=A(!0);var g=e.kind="init"}else 5<=l.ecmaVersion&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)?(f=d=!0,g=e.kind=e.key.name,e.key=m===aa||m===ca?va():N(!0),m!==I&&M(),e.value=Na(y(),!1)):M();if("Identifier"===e.key.type&& +(C||d))for(var p=0;pd?a.id:a.params[d],(cb(e.name)||ta(e.name))&&c(e.start,"Defining '"+e.name+"' in strict mode"),0<=d)for(var f=0;fa?36===a:91>a?!0:97>a?95===a:123>a?!0:170<=a&&$a.test(String.fromCharCode(a))},bb=b.isIdentifierChar=function(a){return 48>a?36===a:58>a?!0:65>a?!1:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Qb.test(String.fromCharCode(a))},ba,Ia={kind:"loop"},Pb={kind:"switch"}});var Interpreter=function(b,a){"string"===typeof b&&(b=acorn.parse(b,Interpreter.PARSE_OPTIONS));this.ast=b;this.initFunc_=a;this.paused_=!1;this.polyfills_=[];this.functionCounter_=0;this.stepFunctions_=Object.create(null);a=/^step([A-Z]\w*)$/;var c,d;for(d in this)"function"===typeof this[d]&&(c=d.match(a))&&(this.stepFunctions_[c[1]]=this[d].bind(this));this.global=this.createScope(this.ast,null);this.ast=acorn.parse(this.polyfills_.join("\n"),Interpreter.PARSE_OPTIONS);this.polyfills_=void 0;this.stripLocations_(this.ast, +void 0,void 0);c=new Interpreter.State(this.ast,this.global);c.done=!1;this.stateStack=[c];this.run();this.value=void 0;this.ast=b;c=new Interpreter.State(this.ast,this.global);c.done=!1;this.stateStack.length=0;this.stateStack[0]=c;this.nodeConstructor=c.node.constructor;this.stateStack=this.stateStack};Interpreter.PARSE_OPTIONS={ecmaVersion:5};Interpreter.READONLY_DESCRIPTOR={configurable:!0,enumerable:!0,writable:!1};Interpreter.NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!0}; +Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!1};Interpreter.VARIABLE_DESCRIPTOR={configurable:!1,enumerable:!0,writable:!0};Interpreter.STEP_ERROR={STEP_ERROR:!0};Interpreter.SCOPE_REFERENCE={SCOPE_REFERENCE:!0};Interpreter.VALUE_IN_DESCRIPTOR={VALUE_IN_DESCRIPTOR:!0};Interpreter.REGEXP_TIMEOUT={REGEXP_TIMEOUT:!0};Interpreter.toStringCycles_=[];Interpreter.vm=null; +Interpreter.WORKER_CODE=["onmessage = function(e) {","var result;","var data = e.data;","switch (data[0]) {","case 'split':","result = data[1].split(data[2], data[3]);","break;","case 'match':","result = data[1].match(data[2]);","break;","case 'search':","result = data[1].search(data[2]);","break;","case 'replace':","result = data[1].replace(data[2], data[3]);","break;","case 'exec':","var regexp = data[1];","regexp.lastIndex = data[2];","result = [regexp.exec(data[3]), data[1].lastIndex];","break;", +"default:","throw 'Unknown RegExp operation: ' + data[0];","}","postMessage(result);","};"];Interpreter.prototype.REGEXP_MODE=2;Interpreter.prototype.REGEXP_THREAD_TIMEOUT=1E3; +Interpreter.prototype.appendCode=function(b){var a=this.stateStack[0];if(!a||"Program"!==a.node.type)throw Error("Expecting original AST to start with a Program node.");"string"===typeof b&&(b=acorn.parse(b,Interpreter.PARSE_OPTIONS));if(!b||"Program"!==b.type)throw Error("Expecting new AST to start with a Program node.");this.populateScope_(b,a.scope);for(var c=0,d;d=b.body[c];c++)a.node.body.push(d);a.done=!1}; +Interpreter.prototype.step=function(){var b=this.stateStack,a=b[b.length-1];if(!a)return!1;var c=a.node,d=c.type;if("Program"===d&&a.done)return!1;if(this.paused_)return!0;try{var e=this.stepFunctions_[d](b,a,c)}catch(f){if(f!==Interpreter.STEP_ERROR)throw f;}e&&b.push(e);return c.end?!0:this.step()};Interpreter.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_}; +Interpreter.prototype.initGlobalScope=function(b){this.setProperty(b,"NaN",NaN,Interpreter.READONLY_DESCRIPTOR);this.setProperty(b,"Infinity",Infinity,Interpreter.READONLY_DESCRIPTOR);this.setProperty(b,"undefined",void 0,Interpreter.READONLY_DESCRIPTOR);this.setProperty(b,"window",b,Interpreter.READONLY_DESCRIPTOR);this.setProperty(b,"this",b,Interpreter.READONLY_DESCRIPTOR);this.setProperty(b,"self",b);this.OBJECT_PROTO=new Interpreter.Object(null);this.FUNCTION_PROTO=new Interpreter.Object(this.OBJECT_PROTO); +this.initFunction(b);this.initObject(b);b.proto=this.OBJECT_PROTO;this.setProperty(b,"constructor",this.OBJECT,Interpreter.NONENUMERABLE_DESCRIPTOR);this.initArray(b);this.initString(b);this.initBoolean(b);this.initNumber(b);this.initDate(b);this.initRegExp(b);this.initError(b);this.initMath(b);this.initJSON(b);var a=this,c=this.createNativeFunction(function(a){throw EvalError("Can't happen");},!1);c.eval=!0;this.setProperty(b,"eval",c);this.setProperty(b,"parseInt",this.createNativeFunction(parseInt, +!1));this.setProperty(b,"parseFloat",this.createNativeFunction(parseFloat,!1));this.setProperty(b,"isNaN",this.createNativeFunction(isNaN,!1));this.setProperty(b,"isFinite",this.createNativeFunction(isFinite,!1));c=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]];for(var d=0;d>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;","}","});","Object.defineProperty(Array.prototype, 'filter',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {", +"if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {","var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}","});","Object.defineProperty(Array.prototype, 'forEach',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();", +"var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'map',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);", +"k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);","k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();","var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');", +"}","value = t[k++];","}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];", +"} else {","while (k >= 0 && !(k in t)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'some',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;", +"for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","(function() {","var sort_ = Array.prototype.sort;","Array.prototype.sort = function(opt_comp) {","if (typeof opt_comp !== 'function') {","return sort_.call(this);","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp(this[j], this[j + 1]) > 0) {","var swap = this[j];","this[j] = this[j + 1];", +"this[j + 1] = swap;","changes++;","}","}","if (!changes) break;","}","return this;","};","})();","Object.defineProperty(Array.prototype, 'toLocaleString',","{configurable: true, writable: true, value:","function() {","var out = [];","for (var i = 0; i < this.length; i++) {","out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")}; +Interpreter.prototype.initString=function(b){var a=this;var c=function(b){b=String(b);return a.calledWithNew()?(this.data=b,this):b};this.STRING=this.createNativeFunction(c,!0);this.setProperty(b,"String",this.STRING);this.setProperty(this.STRING,"fromCharCode",this.createNativeFunction(String.fromCharCode,!1),Interpreter.NONENUMERABLE_DESCRIPTOR);b="charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" ");for(c= +0;c= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);","}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);", +"str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","")};Interpreter.prototype.initBoolean=function(b){var a=this;this.BOOLEAN=this.createNativeFunction(function(b){b=!!b;return a.calledWithNew()?(this.data=b,this):b},!0);this.setProperty(b,"Boolean",this.BOOLEAN)}; +Interpreter.prototype.initNumber=function(b){var a=this;var c=function(b){b=Number(b);return a.calledWithNew()?(this.data=b,this):b};this.NUMBER=this.createNativeFunction(c,!0);this.setProperty(b,"Number",this.NUMBER);b=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"];for(c=0;c>>0;return a===Number(b)?a:NaN};Interpreter.legalArrayIndex=function(b){var a=b>>>0;return String(a)===String(b)&&4294967295!==a?a:NaN}; +Interpreter.Object=function(b){this.getter=Object.create(null);this.setter=Object.create(null);this.properties=Object.create(null);this.proto=b};Interpreter.Object.prototype.proto=null;Interpreter.Object.prototype.isObject=!0;Interpreter.Object.prototype.class="Object";Interpreter.Object.prototype.data=null; +Interpreter.Object.prototype.toString=function(){if("Array"===this.class){var b=Interpreter.toStringCycles_;b.push(this);try{for(var a=[],c=0;ca.charCodeAt(0)&&this.isa(b,this.STRING)){var c=Interpreter.legalArrayIndex(a);if(!isNaN(c)&&c>=":d>>=e;break;case ">>>=":d>>>=e;break;case "&=":d&=e;break;case "^=":d^=e;break;case "|=":d|=e;break;default:throw SyntaxError("Unknown assignment expression: "+c.operator);}if(c=this.setValue(a.leftReference_,d))return a.doneSetter_= +!0,a.setterValue_=d,this.createSetter_(c,a.leftReference_,d);b.pop();b[b.length-1].value=d}}; +Interpreter.prototype.stepBinaryExpression=function(b,a,c){if(!a.doneLeft_)return a.doneLeft_=!0,new Interpreter.State(c.left,a.scope);if(!a.doneRight_)return a.doneRight_=!0,a.leftValue_=a.value,new Interpreter.State(c.right,a.scope);b.pop();var d=a.leftValue_;a=a.value;switch(c.operator){case "==":c=d==a;break;case "!=":c=d!=a;break;case "===":c=d===a;break;case "!==":c=d!==a;break;case ">":c=d>a;break;case ">=":c=d>=a;break;case "<":c=d>":c=d>>a;break;case ">>>":c=d>>>a;break;case "in":a&&a.isObject||this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+a+"'");c=this.hasProperty(a,d);break;case "instanceof":this.isa(a,this.FUNCTION)||this.throwException(this.TYPE_ERROR,"Right-hand side of instanceof is not an object");c=d.isObject?this.isa(d,a):!1;break; +default:throw SyntaxError("Unknown binary operator: "+c.operator);}b[b.length-1].value=c};Interpreter.prototype.stepBlockStatement=function(b,a,c){var d=a.n_||0;if(c=c.body[d])return a.n_=d+1,new Interpreter.State(c,a.scope);b.pop()};Interpreter.prototype.stepBreakStatement=function(b,a,c){this.unwind(Interpreter.Completion.BREAK,void 0,c.label&&c.label.name)}; +Interpreter.prototype.stepCallExpression=function(b,a,c){if(!a.doneCallee_){a.doneCallee_=1;var d=new Interpreter.State(c.callee,a.scope);d.components=!0;return d}if(1===a.doneCallee_){a.doneCallee_=2;d=a.value;if(Array.isArray(d)){if(a.func_=this.getValue(d),d[0]===Interpreter.SCOPE_REFERENCE?a.directEval_="eval"===d[1]:a.funcThis_=d[0],(d=a.func_)&&"object"===typeof d&&d.isGetter)return d.isGetter=!1,a.doneCallee_=1,this.createGetter_(d,a.value)}else a.func_=d;a.arguments_=[];a.n_=0}d=a.func_;if(!a.doneArgs_){0!== +a.n_&&a.arguments_.push(a.value);if(c.arguments[a.n_])return new Interpreter.State(c.arguments[a.n_++],a.scope);if("NewExpression"===c.type){d.illegalConstructor&&this.throwException(this.TYPE_ERROR,d+" is not a constructor");var e=d.properties.prototype;if("object"!==typeof e||null===e)e=this.OBJECT_PROTO;a.funcThis_=this.createObjectProto(e);a.isConstructor=!0}else void 0===a.funcThis_&&(a.funcThis_=a.scope.strict?void 0:this.global);a.doneArgs_=!0}if(a.doneExec_)b.pop(),b[b.length-1].value=a.isConstructor&& +"object"!==typeof a.value?a.funcThis_:a.value;else{a.doneExec_=!0;d&&d.isObject||this.throwException(this.TYPE_ERROR,d+" is not a function");if(b=d.node){c=this.createScope(b.body,d.parentScope);for(var f=0;ff?a.arguments_[f]:void 0);e=this.createObjectProto(this.ARRAY_PROTO);for(f=0;fc;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function BrowserDetect(){throw"BrowserDetect cannot be instantiated"}var a=BrowserDetect.agent=window.navigator.userAgent;BrowserDetect.isWindowPhone=a.indexOf("IEMobile")>-1||a.indexOf("Windows Phone")>-1,BrowserDetect.isFirefox=a.indexOf("Firefox")>-1,BrowserDetect.isOpera=null!=window.opera,BrowserDetect.isChrome=a.indexOf("Chrome")>-1,BrowserDetect.isIOS=(a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1)&&!BrowserDetect.isWindowPhone,BrowserDetect.isAndroid=a.indexOf("Android")>-1&&!BrowserDetect.isWindowPhone,BrowserDetect.isBlackberry=a.indexOf("Blackberry")>-1,createjs.BrowserDetect=BrowserDetect}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d,e=2>=b?this._captureListeners:this._listeners;if(a&&e&&(d=e[a.type])&&(c=d.length)){try{a.currentTarget=this}catch(f){}try{a.eventPhase=0|b}catch(f){}a.removed=!1,d=d.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=d[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}2===b&&this._dispatchEvent(a,2.1)},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.Methods.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),this.createjs=this.createjs||{},function(){var a={};a.POST="POST",a.GET="GET",createjs.Methods=a}(),this.createjs=this.createjs||{},function(){var a={};a.BINARY="binary",a.CSS="css",a.FONT="font",a.FONTCSS="fontcss",a.IMAGE="image",a.JAVASCRIPT="javascript",a.JSON="json",a.JSONP="jsonp",a.MANIFEST="manifest",a.SOUND="sound",a.VIDEO="video",a.SPRITESHEET="spritesheet",a.SVG="svg",a.TEXT="text",a.XML="xml",createjs.Types=a}(),function(){var a={};a.a=function(){return a.el("a")},a.svg=function(){return a.el("svg")},a.object=function(){return a.el("object")},a.image=function(){return a.el("image")},a.img=function(){return a.el("img")},a.style=function(){return a.el("style")},a.link=function(){return a.el("link")},a.script=function(){return a.el("script")},a.audio=function(){return a.el("audio")},a.video=function(){return a.el("video")},a.text=function(a){return document.createTextNode(a)},a.el=function(a){return document.createElement(a)},createjs.Elements=a}(),function(){var a={container:null};a.appendToHead=function(b){a.getHead().appendChild(b)},a.appendToBody=function(b){if(null==a.container){a.container=document.createElement("div"),a.container.id="preloadjs-container";var c=a.container.style;c.visibility="hidden",c.position="absolute",c.width=a.container.style.height="10px",c.overflow="hidden",c.transform=c.msTransform=c.webkitTransform=c.oTransform="translate(-10px, -10px)",a.getBody().appendChild(a.container)}a.container.appendChild(b)},a.getHead=function(){return document.head||document.getElementsByTagName("head")[0]},a.getBody=function(){return document.body||document.getElementsByTagName("body")[0]},a.removeChild=function(a){a.parent&&a.parent.removeChild(a)},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},createjs.DomUtils=a}(),function(){var a={};a.isBinary=function(a){switch(a){case createjs.Types.IMAGE:case createjs.Types.BINARY:return!0;default:return!1}},a.isText=function(a){switch(a){case createjs.Types.TEXT:case createjs.Types.JSON:case createjs.Types.MANIFEST:case createjs.Types.XML:case createjs.Types.CSS:case createjs.Types.SVG:case createjs.Types.JAVASCRIPT:case createjs.Types.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.Types.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.Types.IMAGE;case"ogg":case"mp3":case"webm":return createjs.Types.SOUND;case"mp4":case"webm":case"ts":return createjs.Types.VIDEO;case"json":return createjs.Types.JSON;case"xml":return createjs.Types.XML;case"css":return createjs.Types.CSS;case"js":return createjs.Types.JAVASCRIPT;case"svg":return createjs.Types.SVG;default:return createjs.Types.TEXT}},createjs.RequestUtils=a}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1,protocol:null,hostname:null,port:null,pathname:null,search:null,hash:null,host:null};if(null==b)return c;var d=createjs.Elements.a();d.href=b;for(var e in c)e in d&&(c[e]=d[e]);var f=b.indexOf("?");f>-1&&(b=b.substr(0,f));var g;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(g=b.match(a.EXTENSION_PATT))&&(c.extension=g[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildURI=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=createjs.Elements.a();b.href=a.src;var c=createjs.Elements.a();c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=createjs.Elements.a();return b.href=a.src,""==b.hostname&&"file:"==b.protocol},createjs.URLUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;try{Object.defineProperties(b,{POST:{get:createjs.deprecate(function(){return createjs.Methods.POST},"AbstractLoader.POST")},GET:{get:createjs.deprecate(function(){return createjs.Methods.GET},"AbstractLoader.GET")},BINARY:{get:createjs.deprecate(function(){return createjs.Types.BINARY},"AbstractLoader.BINARY")},CSS:{get:createjs.deprecate(function(){return createjs.Types.CSS},"AbstractLoader.CSS")},FONT:{get:createjs.deprecate(function(){return createjs.Types.FONT},"AbstractLoader.FONT")},FONTCSS:{get:createjs.deprecate(function(){return createjs.Types.FONTCSS},"AbstractLoader.FONTCSS")},IMAGE:{get:createjs.deprecate(function(){return createjs.Types.IMAGE},"AbstractLoader.IMAGE")},JAVASCRIPT:{get:createjs.deprecate(function(){return createjs.Types.JAVASCRIPT},"AbstractLoader.JAVASCRIPT")},JSON:{get:createjs.deprecate(function(){return createjs.Types.JSON},"AbstractLoader.JSON")},JSONP:{get:createjs.deprecate(function(){return createjs.Types.JSONP},"AbstractLoader.JSONP")},MANIFEST:{get:createjs.deprecate(function(){return createjs.Types.MANIFEST},"AbstractLoader.MANIFEST")},SOUND:{get:createjs.deprecate(function(){return createjs.Types.SOUND},"AbstractLoader.SOUND")},VIDEO:{get:createjs.deprecate(function(){return createjs.Types.VIDEO},"AbstractLoader.VIDEO")},SPRITESHEET:{get:createjs.deprecate(function(){return createjs.Types.SPRITESHEET},"AbstractLoader.SPRITESHEET")},SVG:{get:createjs.deprecate(function(){return createjs.Types.SVG},"AbstractLoader.SVG")},TEXT:{get:createjs.deprecate(function(){return createjs.Types.TEXT},"AbstractLoader.TEXT")},XML:{get:createjs.deprecate(function(){return createjs.Types.XML},"AbstractLoader.XML")}})}catch(c){}a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(createjs.DomUtils.appendToBody(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values?this._request.send(createjs.URLUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);return a>=400&&599>=a?new Error(a):0==a&&/^https?:/.test(location.protocol)?new Error(0):null},a._getResponse=function(){if(null!=this._response)return this._response;if(null!=this._request.response)return this._request.response;try{if(null!=this._request.responseText)return this._request.responseText}catch(a){}try{if(null!=this._request.responseXML)return this._request.responseXML}catch(a){}return null},a._createXHR=function(a){var b=createjs.URLUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.Methods.GET?createjs.URLUtils.buildURI(a.src,a.values):a.src,d.open(a.method||createjs.Methods.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.Methods.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.Types.SOUND),createjs.DomUtils.isAudioTag(a)?this._tag=a:createjs.DomUtils.isAudioTag(a.src)?this._tag=a:createjs.DomUtils.isAudioTag(a.tag)&&(this._tag=createjs.DomUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.Types.SOUND},a._createTag=function(a){var b=createjs.Elements.audio();return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var PlayPropsConfig=function(){this.interrupt=null,this.delay=null,this.offset=null,this.loop=null,this.volume=null,this.pan=null,this.startTime=null,this.duration=null},a=PlayPropsConfig.prototype={},b=PlayPropsConfig;b.create=function(a){if("string"==typeof a)return console&&(console.warn||console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."),(new createjs.PlayPropsConfig).set({interrupt:a});if(null==a||a instanceof b||a instanceof Object)return(new createjs.PlayPropsConfig).set(a);if(null==a)throw new Error("PlayProps configuration not recognized.")},a.set=function(a){if(null!=a)for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[PlayPropsConfig]"},createjs.PlayPropsConfig=b}(),this.createjs=this.createjs||{},function(){"use strict";function Sound(){throw"Sound cannot be instantiated"}function a(a,b){this.init(a,b)}var b=Sound;b.INTERRUPT_ANY="any",b.INTERRUPT_EARLY="early",b.INTERRUPT_LATE="late",b.INTERRUPT_NONE="none",b.PLAY_INITED="playInited",b.PLAY_SUCCEEDED="playSucceeded",b.PLAY_INTERRUPTED="playInterrupted",b.PLAY_FINISHED="playFinished",b.PLAY_FAILED="playFailed",b.SUPPORTED_EXTENSIONS=["mp3","ogg","opus","mpeg","wav","m4a","mp4","aiff","wma","mid"],b.EXTENSION_MAP={m4a:"mp4"},b.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([\/.]*?(?:[^?]+)?\/)?((?:[^\/?]+)\.(\w+))(?:\?(\S+)?)?$/,b.defaultInterruptBehavior=b.INTERRUPT_NONE,b.alternateExtensions=[],b.activePlugin=null,b._masterVolume=1,b._getMasterVolume=function(){return this._masterVolume},b.getVolume=createjs.deprecate(b._getMasterVolume,"Sound.getVolume"),b._setMasterVolume=function(a){if(null!=Number(a)&&(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a)))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)},b.setVolume=createjs.deprecate(b._setMasterVolume,"Sound.setVolume"),b._masterMute=!1,b._getMute=function(){return this._masterMute},b.getMute=createjs.deprecate(b._getMute,"Sound.getMute"),b._setMute=function(a){if(null!=a&&(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a)))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a)},b.setMute=createjs.deprecate(b._setMute,"Sound.setMute"),b._getCapabilities=function(){return null==b.activePlugin?null:b.activePlugin._capabilities},b.getCapabilities=createjs.deprecate(b._getCapabilities,"Sound.getCapabilities"),Object.defineProperties(b,{volume:{get:b._getMasterVolume,set:b._setMasterVolume},muted:{get:b._getMute,set:b._setMute},capabilities:{get:b._getCapabilities}}),b._pluginsRegistered=!1,b._lastID=0,b._instances=[],b._idHash={},b._preloadHash={},b._defaultPlayPropsHash={},b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b.getPreloadHandlers=function(){return{callback:createjs.proxy(b.initLoad,b),types:["sound"],extensions:b.SUPPORTED_EXTENSIONS}},b._handleLoadComplete=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!0,b.hasEventListener("fileload")){var a=new createjs.Event("fileload");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._handleLoadError=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!1,b.hasEventListener("fileerror")){var a=new createjs.Event("fileerror");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._registerPlugin=function(a){return a.isSupported()?(b.activePlugin=new a,!0):!1},b.registerPlugins=function(a){b._pluginsRegistered=!0;for(var c=0,d=a.length;d>c;c++)if(b._registerPlugin(a[c]))return!0;return!1},b.initializeDefaultPlugins=function(){return null!=b.activePlugin?!0:b._pluginsRegistered?!1:b.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1},b.isReady=function(){return null!=b.activePlugin},b.initLoad=function(a){return"video"==a.type?!0:b._registerSound(a)},b._registerSound=function(c){if(!b.initializeDefaultPlugins())return!1;var d;if(c.src instanceof Object?(d=b._parseSrc(c.src),d.src=c.path+d.src):d=b._parsePath(c.src),null==d)return!1; +c.src=d.src,c.type="sound";var e=c.data,f=null;if(null!=e&&(isNaN(e.channels)?isNaN(e)||(f=parseInt(e)):f=parseInt(e.channels),e.audioSprite))for(var g,h=e.audioSprite.length;h--;)g=e.audioSprite[h],b._idHash[g.id]={src:c.src,startTime:parseInt(g.startTime),duration:parseInt(g.duration)},g.defaultPlayProps&&(b._defaultPlayPropsHash[g.id]=createjs.PlayPropsConfig.create(g.defaultPlayProps));null!=c.id&&(b._idHash[c.id]={src:c.src});var i=b.activePlugin.register(c);return a.create(c.src,f),null!=e&&isNaN(e)?c.data.channels=f||a.maxPerChannel():c.data=f||a.maxPerChannel(),i.type&&(c.type=i.type),c.defaultPlayProps&&(b._defaultPlayPropsHash[c.src]=createjs.PlayPropsConfig.create(c.defaultPlayProps)),i},b.registerSound=function(a,c,d,e,f){var g={src:a,id:c,data:d,defaultPlayProps:f};a instanceof Object&&a.src&&(e=c,g=a),g=createjs.LoadItem.create(g),g.path=e,null==e||g.src instanceof Object||(g.src=e+g.src);var h=b._registerSound(g);if(!h)return!1;if(b._preloadHash[g.src]||(b._preloadHash[g.src]=[]),b._preloadHash[g.src].push(g),1==b._preloadHash[g.src].length)h.on("complete",this._handleLoadComplete,this),h.on("error",this._handleLoadError,this),b.activePlugin.preload(h);else if(1==b._preloadHash[g.src][0])return!0;return g},b.registerSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.registerSound(a[d].src,a[d].id,a[d].data,b,a[d].defaultPlayProps);return c},b.removeSound=function(c,d){if(null==b.activePlugin)return!1;c instanceof Object&&c.src&&(c=c.src);var e;if(c instanceof Object?e=b._parseSrc(c):(c=b._getSrcById(c).src,e=b._parsePath(c)),null==e)return!1;c=e.src,null!=d&&(c=d+c);for(var f in b._idHash)b._idHash[f].src==c&&delete b._idHash[f];return a.removeSrc(c),delete b._preloadHash[c],b.activePlugin.removeSound(c),!0},b.removeSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.removeSound(a[d].src,b);return c},b.removeAllSounds=function(){b._idHash={},b._preloadHash={},a.removeAll(),b.activePlugin&&b.activePlugin.removeAllSounds()},b.loadComplete=function(a){if(!b.isReady())return!1;var c=b._parsePath(a);return a=c?b._getSrcById(c.src).src:b._getSrcById(a).src,void 0==b._preloadHash[a]?!1:1==b._preloadHash[a][0]},b._parsePath=function(a){"string"!=typeof a&&(a=a.toString());var c=a.match(b.FILE_PATTERN);if(null==c)return!1;for(var d=c[4],e=c[5],f=b.capabilities,g=0;!f[e];)if(e=b.alternateExtensions[g++],g>b.alternateExtensions.length)return null;a=a.replace("."+c[5],"."+e);var h={name:d,src:a,extension:e};return h},b._parseSrc=function(a){var c={name:void 0,src:void 0,extension:void 0},d=b.capabilities;for(var e in a)if(a.hasOwnProperty(e)&&d[e]){c.src=a[e],c.extension=e;break}if(!c.src)return!1;var f=c.src.lastIndexOf("/");return c.name=-1!=f?c.src.slice(f+1):c.src,c},b.play=function(a,c){var d=createjs.PlayPropsConfig.create(c),e=b.createInstance(a,d.startTime,d.duration),f=b._playInstance(e,d);return f||e._playFailed(),e},b.createInstance=function(c,d,e){if(!b.initializeDefaultPlugins())return new createjs.DefaultSoundInstance(c,d,e);var f=b._defaultPlayPropsHash[c];c=b._getSrcById(c);var g=b._parsePath(c.src),h=null;return null!=g&&null!=g.src?(a.create(g.src),null==d&&(d=c.startTime),h=b.activePlugin.create(g.src,d,e||c.duration),f=f||b._defaultPlayPropsHash[g.src],f&&h.applyPlayProps(f)):h=new createjs.DefaultSoundInstance(c,d,e),h.uniqueId=b._lastID++,h},b.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()},b.setDefaultPlayProps=function(a,c){a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]=createjs.PlayPropsConfig.create(c)},b.getDefaultPlayProps=function(a){return a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]},b._playInstance=function(a,c){var d=b._defaultPlayPropsHash[a.src]||{};if(null==c.interrupt&&(c.interrupt=d.interrupt||b.defaultInterruptBehavior),null==c.delay&&(c.delay=d.delay||0),null==c.offset&&(c.offset=a.position),null==c.loop&&(c.loop=a.loop),null==c.volume&&(c.volume=a.volume),null==c.pan&&(c.pan=a.pan),0==c.delay){var e=b._beginPlaying(a,c);if(!e)return!1}else{var f=setTimeout(function(){b._beginPlaying(a,c)},c.delay);a.delayTimeoutId=f}return this._instances.push(a),!0},b._beginPlaying=function(b,c){if(!a.add(b,c.interrupt))return!1;var d=b._beginPlaying(c);if(!d){var e=createjs.indexOf(this._instances,b);return e>-1&&this._instances.splice(e,1),!1}return!0},b._getSrcById=function(a){return b._idHash[a]||{src:a}},b._playFinished=function(b){a.remove(b);var c=createjs.indexOf(this._instances,b);c>-1&&this._instances.splice(c,1)},createjs.Sound=Sound,a.channels={},a.create=function(b,c){var d=a.get(b);return null==d?(a.channels[b]=new a(b,c),!0):!1},a.removeSrc=function(b){var c=a.get(b);return null==c?!1:(c._removeAll(),delete a.channels[b],!0)},a.removeAll=function(){for(var b in a.channels)a.channels[b]._removeAll();a.channels={}},a.add=function(b,c){var d=a.get(b.src);return null==d?!1:d._add(b,c)},a.remove=function(b){var c=a.get(b.src);return null==c?!1:(c._remove(b),!0)},a.maxPerChannel=function(){return c.maxDefault},a.get=function(b){return a.channels[b]};var c=a.prototype;c.constructor=a,c.src=null,c.max=null,c.maxDefault=100,c.length=0,c.init=function(a,b){this.src=a,this.max=b||this.maxDefault,-1==this.max&&(this.max=this.maxDefault),this._instances=[]},c._get=function(a){return this._instances[a]},c._add=function(a,b){return this._getSlot(b,a)?(this._instances.push(a),this.length++,!0):!1},c._remove=function(a){var b=createjs.indexOf(this._instances,a);return-1==b?!1:(this._instances.splice(b,1),this.length--,!0)},c._removeAll=function(){for(var a=this.length-1;a>=0;a--)this._instances[a].stop()},c._getSlot=function(a){var b,c;if(a!=Sound.INTERRUPT_NONE&&(c=this._get(0),null==c))return!0;for(var d=0,e=this.max;e>d;d++){if(b=this._get(d),null==b)return!0;if(b.playState==Sound.PLAY_FINISHED||b.playState==Sound.PLAY_INTERRUPTED||b.playState==Sound.PLAY_FAILED){c=b;break}a!=Sound.INTERRUPT_NONE&&(a==Sound.INTERRUPT_EARLY&&b.positionc.position)&&(c=b)}return null!=c?(c._interrupt(),this._remove(c),!0):!1},c.toString=function(){return"[Sound SoundChannel]"}}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractSoundInstance=function(a,b,c,d){this.EventDispatcher_constructor(),this.src=a,this.uniqueId=-1,this.playState=null,this.delayTimeoutId=null,this._volume=1,Object.defineProperty(this,"volume",{get:this._getVolume,set:this._setVolume}),this.getVolume=createjs.deprecate(this._getVolume,"AbstractSoundInstance.getVolume"),this.setVolume=createjs.deprecate(this._setVolume,"AbstractSoundInstance.setVolume"),this._pan=0,Object.defineProperty(this,"pan",{get:this._getPan,set:this._setPan}),this.getPan=createjs.deprecate(this._getPan,"AbstractSoundInstance.getPan"),this.setPan=createjs.deprecate(this._setPan,"AbstractSoundInstance.setPan"),this._startTime=Math.max(0,b||0),Object.defineProperty(this,"startTime",{get:this._getStartTime,set:this._setStartTime}),this.getStartTime=createjs.deprecate(this._getStartTime,"AbstractSoundInstance.getStartTime"),this.setStartTime=createjs.deprecate(this._setStartTime,"AbstractSoundInstance.setStartTime"),this._duration=Math.max(0,c||0),Object.defineProperty(this,"duration",{get:this._getDuration,set:this._setDuration}),this.getDuration=createjs.deprecate(this._getDuration,"AbstractSoundInstance.getDuration"),this.setDuration=createjs.deprecate(this._setDuration,"AbstractSoundInstance.setDuration"),this._playbackResource=null,Object.defineProperty(this,"playbackResource",{get:this._getPlaybackResource,set:this._setPlaybackResource}),d!==!1&&d!==!0&&this._setPlaybackResource(d),this.getPlaybackResource=createjs.deprecate(this._getPlaybackResource,"AbstractSoundInstance.getPlaybackResource"),this.setPlaybackResource=createjs.deprecate(this._setPlaybackResource,"AbstractSoundInstance.setPlaybackResource"),this._position=0,Object.defineProperty(this,"position",{get:this._getPosition,set:this._setPosition}),this.getPosition=createjs.deprecate(this._getPosition,"AbstractSoundInstance.getPosition"),this.setPosition=createjs.deprecate(this._setPosition,"AbstractSoundInstance.setPosition"),this._loop=0,Object.defineProperty(this,"loop",{get:this._getLoop,set:this._setLoop}),this.getLoop=createjs.deprecate(this._getLoop,"AbstractSoundInstance.getLoop"),this.setLoop=createjs.deprecate(this._setLoop,"AbstractSoundInstance.setLoop"),this._muted=!1,Object.defineProperty(this,"muted",{get:this._getMuted,set:this._setMuted}),this.getMuted=createjs.deprecate(this._getMuted,"AbstractSoundInstance.getMuted"),this.setMuted=createjs.deprecate(this._setMuted,"AbstractSoundInstance.setMuted"),this._paused=!1,Object.defineProperty(this,"paused",{get:this._getPaused,set:this._setPaused}),this.getPaused=createjs.deprecate(this._getPaused,"AbstractSoundInstance.getPaused"),this.setPaused=createjs.deprecate(this._setPaused,"AbstractSoundInstance.setPaused")},a=createjs.extend(AbstractSoundInstance,createjs.EventDispatcher);a.play=function(a){var b=createjs.PlayPropsConfig.create(a);return this.playState==createjs.Sound.PLAY_SUCCEEDED?(this.applyPlayProps(b),void(this._paused&&this._setPaused(!1))):(this._cleanUp(),createjs.Sound._playInstance(this,b),this)},a.stop=function(){return this._position=0,this._paused=!1,this._handleStop(),this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this},a.destroy=function(){this._cleanUp(),this.src=null,this.playbackResource=null,this.removeAllEventListeners()},a.applyPlayProps=function(a){return null!=a.offset&&this._setPosition(a.offset),null!=a.loop&&this._setLoop(a.loop),null!=a.volume&&this._setVolume(a.volume),null!=a.pan&&this._setPan(a.pan),null!=a.startTime&&(this._setStartTime(a.startTime),this._setDuration(a.duration)),this},a.toString=function(){return"[AbstractSoundInstance]"},a._getPaused=function(){return this._paused},a._setPaused=function(a){return a!==!0&&a!==!1||this._paused==a||1==a&&this.playState!=createjs.Sound.PLAY_SUCCEEDED?void 0:(this._paused=a,a?this._pause():this._resume(),clearTimeout(this.delayTimeoutId),this)},a._setVolume=function(a){return a==this._volume?this:(this._volume=Math.max(0,Math.min(1,a)),this._muted||this._updateVolume(),this)},a._getVolume=function(){return this._volume},a._setMuted=function(a){return a===!0||a===!1?(this._muted=a,this._updateVolume(),this):void 0},a._getMuted=function(){return this._muted},a._setPan=function(a){return a==this._pan?this:(this._pan=Math.max(-1,Math.min(1,a)),this._updatePan(),this)},a._getPan=function(){return this._pan},a._getPosition=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||(this._position=this._calculateCurrentPosition()),this._position},a._setPosition=function(a){return this._position=Math.max(0,a),this.playState==createjs.Sound.PLAY_SUCCEEDED&&this._updatePosition(),this},a._getStartTime=function(){return this._startTime},a._setStartTime=function(a){return a==this._startTime?this:(this._startTime=Math.max(0,a||0),this._updateStartTime(),this)},a._getDuration=function(){return this._duration},a._setDuration=function(a){return a==this._duration?this:(this._duration=Math.max(0,a||0),this._updateDuration(),this)},a._setPlaybackResource=function(a){return this._playbackResource=a,0==this._duration&&this._playbackResource&&this._setDurationFromSource(),this},a._getPlaybackResource=function(){return this._playbackResource},a._getLoop=function(){return this._loop},a._setLoop=function(a){null!=this._playbackResource&&(0!=this._loop&&0==a?this._removeLooping(a):0==this._loop&&0!=a&&this._addLooping(a)),this._loop=a},a._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},a._cleanUp=function(){clearTimeout(this.delayTimeoutId),this._handleCleanUp(),this._paused=!1,createjs.Sound._playFinished(this)},a._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._sendEvent("interrupted")},a._beginPlaying=function(a){return this._setPosition(a.offset),this._setLoop(a.loop),this._setVolume(a.volume),this._setPan(a.pan),null!=a.startTime&&(this._setStartTime(a.startTime),this._setDuration(a.duration)),null!=this._playbackResource&&this._positionc;c++){var e=this._soundInstances[b][c];e.playbackResource=this._audioSources[b],this._soundInstances[b]=null}},a._handlePreloadError=function(){},a._updateVolume=function(){},createjs.AbstractPlugin=AbstractPlugin}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.Types.SOUND)}var b=createjs.extend(a,createjs.AbstractLoader);a.context=null,b.toString=function(){return"[WebAudioLoader]"},b._createRequest=function(){this._request=new createjs.XHRRequest(this._item,!1),this._request.setResponseType("arraybuffer")},b._sendComplete=function(){a.context.decodeAudioData(this._rawResult,createjs.proxy(this._handleAudioDecoded,this),createjs.proxy(this._sendError,this))},b._handleAudioDecoded=function(a){this._result=a,this.AbstractLoader__sendComplete()},createjs.WebAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioSoundInstance(a,c,d,e){this.AbstractSoundInstance_constructor(a,c,d,e),this.gainNode=b.context.createGain(),this.panNode=b.context.createPanner(),this.panNode.panningModel=b._panningModel,this.panNode.connect(this.gainNode),this._updatePan(),this.sourceNode=null,this._soundCompleteTimeout=null,this._sourceNodeNext=null,this._playbackStartTime=0,this._endedHandler=createjs.proxy(this._handleSoundComplete,this)}var a=createjs.extend(WebAudioSoundInstance,createjs.AbstractSoundInstance),b=WebAudioSoundInstance;b.context=null,b._scratchBuffer=null,b.destinationNode=null,b._panningModel="equalpower",a.destroy=function(){this.AbstractSoundInstance_destroy(),this.panNode.disconnect(0),this.panNode=null,this.gainNode.disconnect(0),this.gainNode=null},a.toString=function(){return"[WebAudioSoundInstance]"},a._updatePan=function(){this.panNode.setPosition(this._pan,0,-.5)},a._removeLooping=function(){this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)},a._addLooping=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._setDurationFromSource=function(){this._duration=1e3*this.playbackResource.duration},a._handleCleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout),this._playbackStartTime=0},a._cleanUpAudioNode=function(a){if(a){if(a.stop(0),a.disconnect(0),createjs.BrowserDetect.isIOS)try{a.buffer=b._scratchBuffer}catch(c){}a=null}return a},a._handleSoundReady=function(){this.gainNode.connect(b.destinationNode);var a=.001*this._duration,c=Math.min(.001*Math.max(0,this._position),a);this.sourceNode=this._createAndPlayAudioNode(b.context.currentTime-a,c),this._playbackStartTime=this.sourceNode.startTime-c,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(a-c)),0!=this._loop&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._createAndPlayAudioNode=function(a,c){var d=b.context.createBufferSource();d.buffer=this.playbackResource,d.connect(this.panNode);var e=.001*this._duration;return d.startTime=a+e,d.start(d.startTime,c+.001*this._startTime,e-c),d},a._pause=function(){this._position=1e3*(b.context.currentTime-this._playbackStartTime),this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout)},a._resume=function(){this._handleSoundReady()},a._updateVolume=function(){var a=this._muted?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},a._calculateCurrentPosition=function(){return 1e3*(b.context.currentTime-this._playbackStartTime)},a._updatePosition=function(){this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout),this._paused||this._handleSoundReady()},a._handleLoop=function(){this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._playbackStartTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)},a._updateDuration=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._pause(),this._resume())},createjs.WebAudioSoundInstance=createjs.promote(WebAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioPlugin(){this.AbstractPlugin_constructor(),this._panningModel=b._panningModel,this.context=b.context,this.dynamicsCompressorNode=this.context.createDynamicsCompressor(),this.dynamicsCompressorNode.connect(this.context.destination),this.gainNode=this.context.createGain(),this.gainNode.connect(this.dynamicsCompressorNode),createjs.WebAudioSoundInstance.destinationNode=this.gainNode,this._capabilities=b._capabilities,this._loaderClass=createjs.WebAudioLoader,this._soundInstanceClass=createjs.WebAudioSoundInstance,this._addPropsToClasses()}var a=createjs.extend(WebAudioPlugin,createjs.AbstractPlugin),b=WebAudioPlugin;b._capabilities=null,b._panningModel="equalpower",b.context=null,b._scratchBuffer=null,b._unlocked=!1,b.DEFAULT_SAMPLE_RATE=44100,b.isSupported=function(){var a=createjs.BrowserDetect.isIOS||createjs.BrowserDetect.isAndroid||createjs.BrowserDetect.isBlackberry;return"file:"!=location.protocol||a||this._isFileXHRSupported()?(b._generateCapabilities(),null==b.context?!1:!0):!1},b.playEmptySound=function(){if(null!=b.context){var a=b.context.createBufferSource();a.buffer=b._scratchBuffer,a.connect(b.context.destination),a.start(0,0,0)}},b._isFileXHRSupported=function(){var a=!0,b=new XMLHttpRequest;try{b.open("GET","WebAudioPluginTest.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1},b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(c){a=!1}return a},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;if(null==b.context&&(b.context=b._createAudioContext(),null==b.context))return null;null==b._scratchBuffer&&(b._scratchBuffer=b.context.createBuffer(1,1,22050)),b._compatibilitySetUp(),"ontouchstart"in window&&"running"!=b.context.state&&(b._unlock(),document.addEventListener("mousedown",b._unlock,!0),document.addEventListener("touchstart",b._unlock,!0),document.addEventListener("touchend",b._unlock,!0)),b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}b.context.destination.numberOfChannels<2&&(b._capabilities.panning=!1)}},b._createAudioContext=function(){var a=window.AudioContext||window.webkitAudioContext;if(null==a)return null;var c=new a;if(/(iPhone|iPad)/i.test(navigator.userAgent)&&c.sampleRate!==b.DEFAULT_SAMPLE_RATE){var d=c.createBuffer(1,1,b.DEFAULT_SAMPLE_RATE),e=c.createBufferSource();e.buffer=d,e.connect(c.destination),e.start(0),e.disconnect(),c.close(),c=new a}return c},b._compatibilitySetUp=function(){if(b._panningModel="equalpower",!b.context.createGain){b.context.createGain=b.context.createGainNode;var a=b.context.createBufferSource();a.__proto__.start=a.__proto__.noteGrainOn,a.__proto__.stop=a.__proto__.noteOff,b._panningModel=0}},b._unlock=function(){b._unlocked||(b.playEmptySound(),"running"==b.context.state&&(document.removeEventListener("mousedown",b._unlock,!0),document.removeEventListener("touchend",b._unlock,!0),document.removeEventListener("touchstart",b._unlock,!0),b._unlocked=!0))},a.toString=function(){return"[WebAudioPlugin]"},a._addPropsToClasses=function(){var a=this._soundInstanceClass;a.context=this.context,a._scratchBuffer=b._scratchBuffer,a.destinationNode=this.gainNode,a._panningModel=this._panningModel,this._loaderClass.context=this.context},a._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},createjs.WebAudioPlugin=createjs.promote(WebAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioTagPool(){throw"HTMLAudioTagPool cannot be instantiated"}function a(){this._tags=[]}var b=HTMLAudioTagPool;b._tags={},b._tagPool=new a,b._tagUsed={},b.get=function(a){var c=b._tags[a];return null==c?(c=b._tags[a]=b._tagPool.get(),c.src=a):b._tagUsed[a]?(c=b._tagPool.get(),c.src=a):b._tagUsed[a]=!0,c},b.set=function(a,c){c==b._tags[a]?b._tagUsed[a]=!1:b._tagPool.set(c)},b.remove=function(a){var c=b._tags[a];return null==c?!1:(b._tagPool.set(c),delete b._tags[a],delete b._tagUsed[a],!0)},b.getDuration=function(a){var c=b._tags[a];return null!=c&&c.duration?1e3*c.duration:0},createjs.HTMLAudioTagPool=HTMLAudioTagPool;var c=a.prototype;c.constructor=a,c.get=function(){var a;return a=0==this._tags.length?this._createTag():this._tags.pop(),null==a.parentNode&&document.body.appendChild(a),a},c.set=function(a){var b=createjs.indexOf(this._tags,a);-1==b&&(this._tags.src=null,this._tags.push(a))},c.toString=function(){return"[TagPool]"},c._createTag=function(){var a=document.createElement("audio");return a.autoplay=!1,a.preload="none",a}}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this._audioSpriteStopTime=null,this._delayTimeoutId=null,this._endedHandler=createjs.proxy(this._handleSoundComplete,this),this._readyHandler=createjs.proxy(this._handleTagReady,this),this._stalledHandler=createjs.proxy(this._playFailed,this),this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteLoop,this),this._loopHandler=createjs.proxy(this._handleSoundComplete,this),c?this._audioSpriteStopTime=.001*(b+c):this._duration=createjs.HTMLAudioTagPool.getDuration(this.src)}var a=createjs.extend(HTMLAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.toString=function(){return"[HTMLAudioSoundInstance]"},a._removeLooping=function(){null!=this._playbackResource&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._addLooping=function(){null==this._playbackResource||this._audioSpriteStopTime||(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)},a._handleCleanUp=function(){var a=this._playbackResource;if(null!=a){a.pause(),a.loop=!1,a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1);try{a.currentTime=this._startTime}catch(b){}createjs.HTMLAudioTagPool.set(this.src,a),this._playbackResource=null}},a._beginPlaying=function(a){return this._playbackResource=createjs.HTMLAudioTagPool.get(this.src),this.AbstractSoundInstance__beginPlaying(a)},a._handleSoundReady=function(){if(4!==this._playbackResource.readyState){var a=this._playbackResource;return a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.preload="auto",void a.load()}this._updateVolume(),this._playbackResource.currentTime=.001*(this._startTime+this._position),this._audioSpriteStopTime?this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1):(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),0!=this._loop&&(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)),this._playbackResource.play()},a._handleTagReady=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),this._handleSoundReady()},a._pause=function(){this._playbackResource.pause()},a._resume=function(){this._playbackResource.play()},a._updateVolume=function(){if(null!=this._playbackResource){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;a!=this._playbackResource.volume&&(this._playbackResource.volume=a)}},a._calculateCurrentPosition=function(){return 1e3*this._playbackResource.currentTime-this._startTime},a._updatePosition=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1);try{this._playbackResource.currentTime=.001*(this._position+this._startTime)}catch(a){this._handleSetPositionSeek(null)}},a._handleSetPositionSeek=function(){null!=this._playbackResource&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._handleAudioSpriteLoop=function(){this._playbackResource.currentTime<=this._audioSpriteStopTime||(this._playbackResource.pause(),0==this._loop?this._handleSoundComplete(null):(this._position=0,this._loop--,this._playbackResource.currentTime=.001*this._startTime,this._paused||this._playbackResource.play(),this._sendEvent("loop")))},a._handleLoop=function(){0==this._loop&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._updateStartTime=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._updateDuration=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._setDurationFromSource=function(){this._duration=createjs.HTMLAudioTagPool.getDuration(this.src),this._playbackResource=null},createjs.HTMLAudioSoundInstance=createjs.promote(HTMLAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.SoundLoader,this._soundInstanceClass=createjs.HTMLAudioSoundInstance}var a=createjs.extend(HTMLAudioPlugin,createjs.AbstractPlugin),b=HTMLAudioPlugin;b.MAX_INSTANCES=30,b._AUDIO_READY="canplaythrough",b._AUDIO_ENDED="ended",b._AUDIO_SEEKED="seeked",b._AUDIO_STALLED="stalled",b._TIME_UPDATE="timeupdate",b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.register=function(a){var b=createjs.HTMLAudioTagPool.get(a.src),c=this.AbstractPlugin_register(a);return c.setTag(b),c},a.removeSound=function(a){this.AbstractPlugin_removeSound(a),createjs.HTMLAudioTagPool.remove(a)},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playbackResource=null,d},a.toString=function(){return"[HTMLAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,createjs.HTMLAudioPlugin=createjs.promote(HTMLAudioPlugin,"AbstractPlugin") +}(); \ No newline at end of file diff --git a/html/blockly-games/third-party/ace/ace.js b/html/blockly-games/third-party/ace/ace.js new file mode 100644 index 0000000..47f2936 --- /dev/null +++ b/html/blockly-games/third-party/ace/ace.js @@ -0,0 +1,17 @@ +(function(){function o(n){var i=e;n&&(e[n]||(e[n]={}),i=e[n]);if(!i.define||!i.define.packaged)t.original=i.define,i.define=t,i.define.packaged=!0;if(!i.require||!i.require.packaged)r.original=i.require,i.require=r,i.require.packaged=!0}var ACE_NAMESPACE = "ace",e=function(){return this}();!e&&typeof window!="undefined"&&(e=window);if(!ACE_NAMESPACE&&typeof requirejs!="undefined")return;var t=function(e,n,r){if(typeof e!="string"){t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)};t.modules={},t.payloads={};var n=function(e,t,n){if(typeof t=="string"){var i=s(e,t);if(i!=undefined)return n&&n(),i}else if(Object.prototype.toString.call(t)==="[object Array]"){var o=[];for(var u=0,a=t.length;u1&&u(t,"")>-1&&(a=RegExp(this.source,r.replace.call(o(this),"g","")),r.replace.call(e.slice(t.index),a,function(){for(var e=1;et.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function H(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",t.isWebKit=parseFloat(s.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(s.split(" Chrome/")[1])||undefined,t.isEdge=parseFloat(s.split(" Edge/")[1])||undefined,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent"),i="http://www.w3.org/1999/xhtml";t.buildDom=function o(e,t,n){if(typeof e=="string"&&e){var r=document.createTextNode(e);return t&&t.appendChild(r),r}if(!Array.isArray(e))return e;if(typeof e[0]!="string"||!e[0]){var i=[];for(var s=0;s=1.5:!0;if(typeof document!="undefined"){var s=document.createElement("div");t.HI_DPI&&s.style.transform!==undefined&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&typeof s.style.animationName!="undefined"&&(t.HAS_CSS_ANIMATION=!0),s=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,"super":8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},t,n;for(n in e.FUNCTION_KEYS)t=e.FUNCTION_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);for(n in e.PRINTABLE_KEYS)t=e.PRINTABLE_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);return r.mixin(e,e.MODIFIER_KEYS),r.mixin(e,e.PRINTABLE_KEYS),r.mixin(e,e.FUNCTION_KEYS),e.enter=e["return"],e.escape=e.esc,e.del=e["delete"],e[173]="-",function(){var t=["cmd","ctrl","alt","shift"];for(var n=Math.pow(2,t.length);n--;)e.KEY_MODS[n]=t.filter(function(t){return n&e.KEY_MODS[t]}).join("-")+"-"}(),e.KEY_MODS[0]="",e.KEY_MODS[-1]="input-",e}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return typeof t!="string"&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function a(e,t,n){var a=u(t);if(!i.isMac&&s){t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(a|=8);if(s.altGr){if((3&a)==3)return;s.altGr=0}if(n===18||n===17){var f="location"in t?t.location:t.keyLocation;if(n===17&&f===1)s[n]==1&&(o=t.timeStamp);else if(n===18&&a===3&&f===2){var l=t.timeStamp-o;l<50&&(s.altGr=!0)}}}n in r.MODIFIER_KEYS&&(n=-1);if(!a&&n===13){var f="location"in t?t.location:t.keyLocation;if(f===3){e(t,a,-n);if(t.defaultPrevented)return}}if(i.isChromeOS&&a&8){e(t,a,n);if(t.defaultPrevented)return;a&=-9}return!!a||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS?e(t,a,n):!1}function f(){s=Object.create(null)}var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return e.type=="dblclick"?0:e.type=="contextmenu"||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0,e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=(e.deltaX||0)*5,e.wheelY=(e.deltaY||0)*5}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=(e.detail||0)*5,e.wheelY=0):(e.wheelX=0,e.wheelY=(e.detail||0)*5),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){function c(e){t.getButton(e)!==0?o=0:e.detail>1?(o++,o>4&&(o=1)):o=1;if(i.isIE){var c=Math.abs(e.clientX-u)>5||Math.abs(e.clientY-a)>5;if(!f||c)o=1;f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),o==1&&(u=e.clientX,a=e.clientY)}e._clicks=o,r[s]("mousedown",e);if(o>4)o=0;else if(o>1)return r[s](l[o],e)}function h(e){o=2,f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),r[s]("mousedown",e),r[s](l[o],e)}var o=0,u,a,f,l={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",c),i.isOldIE&&t.addListener(e,"dblclick",h)})};var u=!i.isMac||!i.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};t.getModifierString=function(e){return r.KEY_MODS[u(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return a(n,e,o)})}else{var u=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=a(n,e,e.keyCode);return u=e.defaultPrevented,t}),r(e,"keypress",function(e){u&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),u=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(f(),r(window,"focus",f))}};if(typeof window=="object"&&window.postMessage&&!i.isOldIE){var l=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+l++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function r(){t.$idleBlocked?setTimeout(r,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;nDate.now()-50?!0:r=!1},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),u=e("../clipboard"),a=i.isChrome<18,f=i.isIE,l=i.isChrome>63,c=400,h=e("../lib/keys"),p=h.KEY_MODS,d=i.isIOS,v=d?/\s/:/\n/,m=function(e,t){function z(){S=!0,n.blur(),n.focus(),S=!1}function X(e){e.keyCode==27&&n.value.lengthN&&x[s]=="\n")o=h.end;else if(rN&&x.slice(0,s).split("\n").length>2)o=h.down;else if(s>N&&x[s-1]==" ")o=h.right,u=p.option;else if(s>N||s==N&&N!=T&&r==s)o=h.right;r!==s&&(u|=p.shift);if(o){var a=t.onCommandKey({},u,o);if(!a&&t.commands){o=h.keyCodeToString(o);var f=t.commands.findKeyCommand(u,o);f&&t.execCommand(f)}T=r,N=s,L("")}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var m=!1,g=!1,y=!1,b=!1,w="";i.isMobile||(n.style.fontSize="1px");var E=!1,S=!1,x="",T=0,N=0;try{var C=document.activeElement===n}catch(k){}r.addListener(n,"blur",function(e){if(S)return;t.onBlur(e),C=!1}),r.addListener(n,"focus",function(e){if(S)return;C=!0;if(i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(L):L()}),this.$focusScroll=!1,this.focus=function(){if(w||l||this.$focusScroll=="browser")return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=n.getBoundingClientRect().top!=0}catch(r){return}var i=[];if(t){var s=n.parentElement;while(s&&s.nodeType==1)i.push(s),s.setAttribute("ace_nocontext",!0),!s.parentElement&&s.getRootNode?s=s.getRootNode().host:s=s.parentElement}n.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="",n.style.top=="0px"&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return C},t.on("beforeEndOperation",function(){if(t.curOp&&t.curOp.command.name=="insertstring")return;y&&(x=n.value="",U()),L()});var L=d?function(e){if(!C||m&&!e||b)return;e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=x=r);var i=4,s=4+(e.length||(t.selection.isEmpty()?0:1));(T!=i||N!=s)&&n.setSelectionRange(i,s),T=i,N=s}:function(){if(y||b)return;if(!C&&!_)return;y=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,u=t.session.getLine(i);if(r.start.row!=i){var a=t.session.getLine(i-1);s=r.start.rowi+1?f.length:o,o+=u.length+1,u=u+"\n"+f}u.length>c&&(s=x.length&&e.value===x&&x&&e.selectionEnd!==N},O=function(e){if(y)return;m?m=!1:A(n)&&(t.selectAll(),L())},M=null;this.setInputHandler=function(e){M=e},this.getInputHandler=function(){return M};var _=!1,D=function(e,r){_&&(_=!1);if(g)return L(),e&&t.onPaste(e),g=!1,"";var i=n.selectionStart,s=n.selectionEnd,o=T,u=x.length-N,a=e,f=e.length-i,l=e.length-s,c=0;while(o>0&&x[c]==e[c])c++,o--;a=a.slice(c),c=1;while(u>0&&x.length-c>T-1&&x[x.length-c]==e[e.length-c])c++,u--;f-=c-1,l-=c-1;var h=a.length-c+1;return h<0&&(o=-h,h=0),a=a.slice(0,h),!r&&f==a.length&&!o&&!u&&!l?"":(b=!0,a&&!o&&!u&&!f&&!l||E?t.onTextInput(a):t.onTextInput(a,{extendLeft:o,extendRight:u,restoreStart:f,restoreEnd:l}),b=!1,x=e,T=i,N=s,a)},P=function(e){if(y)return R();if(e&&e.inputType){if(e.inputType=="historyUndo")return t.execCommand("undo");if(e.inputType=="historyRedo")return t.execCommand("redo")}var r=n.value,i=D(r,!0);(r.length>c+100||v.test(i))&&L()},H=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(!r||a)return;var i=f||n?"Text":"text/plain";try{return t?r.setData(i,t)!==!1:r.getData(i)}catch(e){if(!n)return H(e,t,!0)}},B=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);H(e,s)?(d&&(L(s),m=s,setTimeout(function(){m=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(m=!0,n.value=s,n.select(),setTimeout(function(){m=!1,L(),i?t.onCut():t.onCopy()}))},j=function(e){B(e,!0)},F=function(e){B(e,!1)},I=function(e){var s=H(e);if(u.pasteCancelled())return;typeof s=="string"?(s&&t.onPaste(s,e),i.isIE&&setTimeout(L),r.preventDefault(e)):(n.value="",g=!0)};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",O),r.addListener(n,"input",P),r.addListener(n,"cut",j),r.addListener(n,"copy",F),r.addListener(n,"paste",I),(!("oncut"in n)||!("oncopy"in n)||!("onpaste"in n))&&r.addListener(e,"keydown",function(e){if(i.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:F(e);break;case 86:I(e);break;case 88:j(e)}});var q=function(e){if(y||!t.onCompositionStart||t.$readOnly)return;y={};if(E)return;setTimeout(R,0),t.on("mousedown",z);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,y.markerRange=r,y.selectionStart=T,t.onCompositionStart(y),y.useTextareaForIME?(n.value="",x="",T=0,N=0):(n.msGetInputContext&&(y.context=n.msGetInputContext()),n.getInputContext&&(y.context=n.getInputContext()))},R=function(){if(!y||!t.onCompositionUpdate||t.$readOnly)return;if(E)return z();if(y.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;D(e),y.markerRange&&(y.context&&(y.markerRange.start.column=y.selectionStart=y.context.compositionStartOffset),y.markerRange.end.column=y.markerRange.start.column+N-y.selectionStart)}},U=function(e){if(!t.onCompositionEnd||t.$readOnly)return;y=!1,t.onCompositionEnd(),t.off("mousedown",z),e&&P()},W=o.delayedCall(R,50).schedule.bind(null,null);r.addListener(n,"compositionstart",q),r.addListener(n,"compositionupdate",R),r.addListener(n,"keyup",X),r.addListener(n,"keydown",W),r.addListener(n,"compositionend",U),this.getElement=function(){return n},this.setCommandMode=function(e){E=e,n.readOnly=!1},this.setReadOnly=function(e){E||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){_=!0,L(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){w||(w=n.style.cssText),n.style.cssText=(o?"z-index:100000;":"")+(i.isIE?"opacity:0.1;":"")+"text-indent: -"+(T+N)*t.renderer.characterWidth*.5+"px;";var u=t.container.getBoundingClientRect(),a=s.computedStyle(t.container),f=u.top+(parseInt(a.borderTopWidth)||0),l=u.left+(parseInt(u.borderLeftWidth)||0),c=u.bottom-f-n.clientHeight-2,h=function(e){s.translate(n,e.clientX-l-2,Math.min(e.clientY-f-2,c))};h(e);if(e.type!="mousedown")return;t.renderer.$isMousePressed=!0,clearTimeout(V),i.isWin&&r.capture(t.container,h,$)},this.onContextMenuClose=$;var V,J=function(e){t.textInput.onContextMenu(e),$()};r.addListener(n,"mouseup",J),r.addListener(n,"mousedown",function(e){e.preventDefault(),$()}),r.addListener(t.renderer.scroller,"contextmenu",J),r.addListener(n,"contextmenu",J),d&&K(e,t,n)};t.TextInput=m}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function u(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}function a(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=t.column-4;else var n=2*t.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent"),i=0,s=550;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();if(s!==0){var o=i.getSelectionRange(),u=o.isEmpty();(u||s==1)&&i.selection.moveToPosition(n),s==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}this.mousedownEvent.time=Date.now();if(t&&!i.isFocused()){i.focus();if(this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode){this.setState("focusWait"),this.captureMouse(e);return}}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;if(!this.mousedownEvent)return;this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=a(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=a(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>i||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,u=i?e.wheelY/i:n.vy;i=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(f=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(f=!0);if(f)n.allowed=r;else if(r-n.allowedt.session.documentToScreenRow(l.row,l.column))return c()}if(f==s)return;f=s.text.join("
"),i.setHtml(f),i.show(),t._signal("showGutterTooltip",i),t.on("mousewheel",c);if(e.$tooltipFollowsMouse)h(u);else{var p=u.domEvent.target,d=p.getBoundingClientRect(),v=i.getElement().style;v.left=d.right+"px",v.top=d.bottom+"px"}}function c(){o&&(o=clearTimeout(o)),f&&(i.hide(),f=null,t._signal("hideGutterTooltip",i),t.removeEventListener("mousewheel",c))}function h(e){i.setPosition(e.x,e.y)}var t=e.editor,n=t.renderer.$gutterLayer,i=new a(t.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused()||r.getButton()!=0)return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()});var o,u,f;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(r.hasCssClass(n,"ace_fold-widget"))return c();f&&e.$tooltipFollowsMouse&&h(t),u=t;if(o)return;o=setTimeout(function(){o=null,u&&!e.isMousePressed?l():c()},50)}),s.addListener(t.renderer.$gutter,"mouseout",function(e){u=null;if(!f||o)return;o=setTimeout(function(){o=null,c()},50)}),t.on("changeSession",c)}function a(e){o.call(this,e)}var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();e+=15,t+=15,e+i>n&&(e-=e+i-n),t+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=u}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function f(e){function T(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;if(!S||i||s)t.moveCursorToPosition(e),S=r,x={x:p,y:d};else{var o=l(x.x,x.y,p,d);o>a?S=null:r-S>=u&&(t.renderer.scrollCursorIntoView(),S=null)}}function N(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,u=t.renderer.scroller.getBoundingClientRect(),a={x:{left:p-u.left,right:u.right-p},y:{top:d-u.top,bottom:u.bottom-d}},f=Math.min(a.x.left,a.x.right),l=Math.min(a.y.top,a.y.bottom),c={row:e.row,column:e.column};f/s<=2&&(c.column+=a.x.left=o&&t.renderer.scrollCursorIntoView(c):E=r:E=null}function C(){var e=g;g=t.renderer.screenToTextCoordinates(p,d),T(g,e),N(g,e)}function k(){m=t.selection.toOrientedRange(),h=t.session.addMarker(m,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),C(),v=setInterval(C,20),y=0,i.addListener(document,"mousemove",O)}function L(){clearInterval(v),t.session.removeMarker(h),h=null,t.selection.fromOrientedRange(m),t.isFocused()&&!w&&t.$resetCursorStyle(),m=null,g=null,y=0,E=null,S=null,i.removeListener(document,"mousemove",O)}function O(){A==null&&(A=setTimeout(function(){A!=null&&h&&L()},20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function _(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],r=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return r&&t.indexOf(i)>=0?o="copy":n.indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var c=t.container,h,p,d,v,m,g,y=0,b,w,E,S,x;this.onDragStart=function(e){if(this.cancelDrag||!c.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}m=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(e){c.draggable=!1,w=!1,this.setState(null);if(!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!b&&n=="move"&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||k(),y++,e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragOver=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||(k(),y++),A!==null&&(A=null),e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragLeave=function(e){y--;if(y<=0&&h)return L(),b=null,i.preventDefault(e)},this.onDrop=function(e){if(!g)return;var n=e.dataTransfer;if(w)switch(b){case"move":m.contains(g.row,g.column)?m={start:g,end:g}:m=t.moveText(m,g);break;case"copy":m=t.moveText(m,g,!0)}else{var r=n.getData("Text");m={start:g,end:t.session.insert(g,r)},t.focus(),b=null}return L(),i.preventDefault(e)},i.addListener(c,"dragstart",this.onDragStart.bind(e)),i.addListener(c,"dragend",this.onDragEnd.bind(e)),i.addListener(c,"dragenter",this.onDragEnter.bind(e)),i.addListener(c,"dragover",this.onDragOver.bind(e)),i.addListener(c,"dragleave",this.onDragLeave.bind(e)),i.addListener(c,"drop",this.onDrop.bind(e));var A=null}function l(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=200,u=200,a=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var n=s.isWin?"default":"move";e.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(s.isIE&&this.state=="dragReady"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state==="dragWait"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton(),i=e.domEvent.detail||1;if(i===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on");if(t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;var u=t.container;u.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}).call(f.prototype),t.DragdropHandler=f}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){function y(){var e=window.navigator&&window.navigator.clipboard,r=!1,s=function(){var n=t.getCopyText(),s=t.session.getUndoManager().hasUndo();g.replaceChild(i.buildDom(r?["span",!n&&["span",{"class":"ace_mobile-button",action:"selectall"},"Select All"],n&&["span",{"class":"ace_mobile-button",action:"copy"},"Copy"],n&&["span",{"class":"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{"class":"ace_mobile-button",action:"paste"},"Paste"],s&&["span",{"class":"ace_mobile-button",action:"undo"},"Undo"],["span",{"class":"ace_mobile-button",action:"find"},"Find"],["span",{"class":"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),g.firstChild)},o=function(n){var i=n.target.getAttribute("action");if(i=="more"||!r)return r=!r,s();if(i=="paste")e.readText().then(function(e){t.execCommand(i,e)});else if(i){if(i=="cut"||i=="copy")e?e.writeText(t.getCopyText()):document.execCommand("copy");t.execCommand(i)}g.firstChild.style.display="none",r=!1,i!="openCommandPallete"&&t.focus()};g=i.buildDom(["div",{"class":"ace_mobile-menu",ontouchstart:function(e){n="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),o(e)},onclick:o},["span"],["span",{"class":"ace_mobile-button",action:"more"},"..."]],t.container)}function b(){g||y();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.container.getBoundingClientRect();g.style.top=n.pageY-r.top-3+"px",g.style.right="10px",g.style.display="",g.firstChild.style.display="none",t.on("input",w)}function w(e){g&&(g.style.display="none"),t.off("input",w)}function E(){f=null,clearTimeout(f);var e=t.selection.getRange(),r=e.contains(h.row,h.column);if(e.isEmpty()||!r)t.selection.moveToPosition(h),t.selection.selectWord();n="wait",b()}function S(){f=null,clearTimeout(f),t.selection.moveToPosition(h);var e=p>=2?t.selection.getLineRange(h.row):t.session.getBracketRange(h);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n="wait"}function x(){c+=60,l=setInterval(function(){c--<=0&&(clearInterval(l),l=null),Math.abs(d)<.01&&(d=0),Math.abs(v)<.01&&(v=0),c<20&&(d=.9*d),c<20&&(v=.9*v);var e=t.session.getScrollTop();t.renderer.scrollBy(10*d,10*v),e==t.session.getScrollTop()&&(c=0)},10)}var n="scroll",s,o,u,a,f,l,c=0,h,p=0,d=0,v=0,m,g;e.addEventListener("contextmenu",function(e){if(!m)return;var n=t.textInput.getElement();n.focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(f||i.length>1){clearTimeout(f),f=null,u=-1,n="zoom";return}m=t.$mouseHandler.isMousePressed=!0;var l=t.renderer.layerConfig.lineHeight,g=t.renderer.layerConfig.lineHeight,y=e.timeStamp;a=y;var b=i[0],w=b.clientX,x=b.clientY;Math.abs(s-w)+Math.abs(o-x)>l&&(u=-1),s=e.clientX=w,o=e.clientY=x,d=v=0;var T=new r(e,t);h=T.getDocumentPosition();if(y-u<500&&i.length==1&&!c)p++,e.preventDefault(),e.button=0,S();else{p=0;var N=t.selection.cursor,C=t.selection.isEmpty()?N:t.selection.anchor,k=t.renderer.$cursorLayer.getPixelPosition(N,!0),L=t.renderer.$cursorLayer.getPixelPosition(C,!0),A=t.renderer.scroller.getBoundingClientRect(),O=function(e,t){return e/=g,t=t/l-.75,e*e+t*t};if(e.clientX_?"cursor":"anchor"),_<3.5?n="anchor":M<3.5?n="cursor":n="scroll",f=setTimeout(E,450)}u=y}),e.addEventListener("touchend",function(e){m=t.$mouseHandler.isMousePressed=!1,l&&clearInterval(l),n=="zoom"?(n="",c=0):f?(t.selection.moveToPosition(h),c=0,b()):n=="scroll"?(x(),e.preventDefault(),w()):b(),clearTimeout(f),f=null}),e.addEventListener("touchmove",function(e){f&&(clearTimeout(f),f=null);var i=e.touches;if(i.length>1||n=="zoom")return;var u=i[0],l=s-u.clientX,c=o-u.clientY;if(n=="wait"){if(!(l*l+c*c>4))return e.preventDefault();n="cursor"}s=u.clientX,o=u.clientY,e.clientX=u.clientX,e.clientY=u.clientY;var h=e.timeStamp,p=h-a;a=h;if(n=="scroll"){var m=new r(e,t);m.speed=1,m.wheelX=l,m.wheelY=c,10*Math.abs(l)1&&(i=n[n.length-2]);var o=a[t+"Path"];return o==null?o=a.basePath:r=="/"&&(t=r=""),o&&o.slice(-1)!="/"&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(u){}if(i&&!t.$loading[n])return r&&r(i);t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r);if(t.$loading[n].length>1)return;var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),f()};var f=function(){!a.basePath&&!a.workerPath&&!a.modePath&&!a.themePath&&!Object.keys(a.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),f=function(){})};t.init=l,t.version="1.4.6"}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,f=e("./touch_handler").addTouchListeners,l=e("../config"),c=function(e){var t=this;this.editor=e,new s(this),new o(this),new a(this);var n=function(t){var n=!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement());n&&window.focus(),e.focus()},u=e.renderer.getMouseEventTarget();r.addListener(u,"click",this.onMouseEvent.bind(this,"click")),r.addListener(u,"mousemove",this.onMouseMove.bind(this,"mousemove")),r.addMultiMouseDownListener([u,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),f(e.container,e);var l=e.renderer.$gutter;r.addListener(l,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),r.addListener(l,"click",this.onMouseEvent.bind(this,"gutterclick")),r.addListener(l,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),r.addListener(l,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),r.addListener(u,"mousedown",n),r.addListener(l,"mousedown",n),i.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",n),r.addListener(e.renderer.scrollBarH.element,"mousedown",n)),e.on("mousemove",function(n){if(t.state||t.$dragDelay||!t.$dragEnabled)return;var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),s=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?s.setCursorStyle("default"):s.setCursorStyle("")})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!n||!n.length)return;this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var n=new u(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,s=this.editor.renderer;s.$isMousePressed=!0;var o=this,a=function(e){if(!e)return;if(i.isWebKit&&!e.which&&o.releaseMouse)return o.releaseMouse();o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new u(e,o.editor),o.$mouseMoved=!0},f=function(e){n.off("beforeEndOperation",c),clearInterval(h),l(),o[o.state+"End"]&&o[o.state+"End"](e),o.state="",o.isMousePressed=s.$isMousePressed=!1,s.$keepTextAreaAtCursor&&s.$moveTextAreaToCursor(),o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent("mouseup",e),n.endOperation()},l=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1};if(i.isOldIE&&e.domEvent.type=="dblclick")return setTimeout(function(){f(e)});var c=function(e){if(!o.releaseMouse)return;n.curOp.command.name&&n.curOp.selectionChanged&&(o[o.state+"End"]&&o[o.state+"End"](),o.state="",o.releaseMouse())};n.on("beforeEndOperation",c),n.startOperation({command:{name:"mouse"}}),o.$onCaptureMouseMove=a,o.releaseMouse=r.capture(this.editor.container,a,f);var h=setInterval(l,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){if(t&&t.domEvent&&t.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent)}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(c.prototype),l.defineOptions(c.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=c}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";function i(e){e.on("click",function(t){var n=t.getDocumentPosition(),i=e.session,s=i.getFoldAt(n.row,n.column,1);s&&(t.getAccelKey()?i.removeFold(s):i.expandFold(s),t.stop());var o=t.domEvent&&t.domEvent.target;o&&r.hasCssClass(o,"ace_inline_button")&&r.hasCssClass(o,"ace_toggle_wrap")&&(i.setOption("wrap",!i.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),o=s.range||s.firstRange;if(o){r=o.start.row;var u=i.getFoldAt(r,i.getLine(r).length,1);u?i.removeFold(u):(i.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}var r=e("../lib/dom");t.FoldHandler=i}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/event"),s=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)},this.addKeyboardHandler=function(e,t){if(!e)return;typeof e=="function"&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,r){var s,o=!1,u=this.$editor.commands;for(var a=this.$handlers.length;a--;){s=this.$handlers[a].handleKeyboard(this.$data,e,t,n,r);if(!s||!s.command)continue;s.command=="null"?o=!0:o=u.exec(s.command,this.$editor,s.args,r),o&&r&&e!=-1&&s.passEvent!=1&&s.command.passEvent!=1&&i.stopEvent(r);if(o)break}return!o&&e==-1&&(s={command:"insertstring"},o=u.exec("insertstring",this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),o},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);return this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(s.prototype),t.KeyBinding=s}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,t,n){"use strict";function F(e,t,n,r){var i=s?d:p,c=null,h=null,v=null,m=0,g=null,y=null,b=-1,w=null,E=null,T=[];if(!r)for(w=0,r=[];w0)if(g==16){for(w=b;w-1){for(w=b;w=0;C--){if(r[C]!=N)break;t[C]=s}}}function I(e,t,n){if(o=e){u=i+1;while(u=e)u++;for(a=i,l=u-1;a=t.length||(o=n[r-1])!=b&&o!=w||(c=t[r+1])!=b&&c!=w)return E;return u&&(c=w),c==o?c:E;case k:o=r>0?n[r-1]:S;if(o==b&&r+10&&n[r-1]==b)return b;if(u)return E;p=r+1,h=t.length;while(p=1425&&d<=2303||d==64286;o=t[p];if(v&&(o==y||o==T))return y}if(r<1||(o=t[r-1])==S)return E;return n[r-1];case S:return u=!1,f=!0,s;case x:return l=!0,E;case O:case M:case D:case P:case _:u=!1;case H:return E}}function R(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?g:B[t]:n==5?/[\u0591-\u05f4]/.test(e)?y:g:n==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?w:t==1642?L:/[\u06f0-\u06f9]/.test(e)?b:T:n==32&&t<=8287?j[t&255]:n==254?t>=65136?T:E:E}function U(e){return e>="\u064b"&&e<="\u0655"}var r=["\u0621","\u0641"],i=["\u063a","\u064a"],s=0,o=0,u=!1,a=!1,f=!1,l=!1,c=!1,h=!1,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v=0,m=1,g=0,y=1,b=2,w=3,E=4,S=5,x=6,T=7,N=8,C=9,k=10,L=11,A=12,O=13,M=14,_=15,D=16,P=17,H=18,B=[H,H,H,H,H,H,H,H,H,x,S,x,N,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,S,S,S,x,N,E,E,L,L,L,E,E,E,E,E,k,C,k,C,C,b,b,b,b,b,b,b,b,b,b,C,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,H,H,H,H,H,H,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,C,E,L,L,L,L,E,E,E,E,g,E,E,H,E,E,L,L,b,b,E,g,E,E,E,b,g,E,E,E,E,E],j=[N,N,N,N,N,N,N,N,N,N,N,H,H,H,g,y,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N,S,O,M,_,D,P,C,L,L,L,L,L,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,C,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N];t.L=g,t.R=y,t.EN=b,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="\u00b7",t.doBidiReorder=function(e,n,r){if(e.length<2)return{};var i=e.split(""),o=new Array(i.length),u=new Array(i.length),a=[];s=r?m:v,F(i,a,i.length,n);for(var f=0;fT&&n[f]0&&i[f-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(i[f])&&(a[f-1]=a[f]=t.R_H,f++);i[i.length-1]===t.DOT&&(a[i.length-1]=t.B),i[0]==="\u202b"&&(a[0]=t.RLE);for(var f=0;f=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n,r=this.session.$getRowCacheIndex(t,this.currentRow);while(this.currentRow-e>0){n=this.session.$getRowCacheIndex(t,this.currentRow-e-1);if(n!==r)break;r=n,e++}}else e=this.currentRow;return e},this.updateRowLine=function(e,t){e===undefined&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1,s=n?this.EOF:this.EOL;this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE;if(this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(t===undefined&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!==0&&i++;for(var u=0;ut&&s[i]%2===0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,s=[],o=0,u=Math.min(e,t)-this.wrapIndent,a=Math.max(e,t)-this.wrapIndent,f=!1,l=!1,c=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var h,p=0;p=u&&hn+s/2){n+=s;if(r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!==0&&i[r]%2===0?(e0&&i[r-1]%2===0&&i[r]%2!==0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&s===0&&i[r-1]%2===0||!this.isRtlDir&&r===0&&i[r]%2!==0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!==0&&s!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t));if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(s)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},this.$shortWordEndIndex=function(e){var t=0,n,r=/\s/,i=this.session.tokenRe;i.lastIndex=0;if(this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{while((n=e[t])&&r.test(n))t++;if(t<1){i.lastIndex=0;while((n=e[t])&&!i.test(n)){i.lastIndex=0,t++;if(r.test(n)){if(t>2){t--;break}while((n=e[t])&&r.test(n))t++;if(t>2)break}}}}return i.lastIndex=0,t},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var i=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,t===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(r){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(u.prototype),t.Selection=u}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",u=[];for(var a=0;a1?f.onMatch=this.$applyToken:f.onMatch=f.token),c>1&&(/\\\d/.test(f.regex)?l=f.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(c=1,l=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&u.push(f)),s[i]=a,i+=c,r.push(l),f.onMatch||(f.onMatch=null)}r.length||(s[0]=0,r.push("$")),u.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=e|0},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n=="string")return[{type:n,value:e}];var r=[];for(var i=0,s=n.length;il){var g=e.substring(l,m-v.length);h.type==p?h.value+=g:(h.type&&f.push(h),h={type:p,value:g})}for(var y=0;yi){c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});while(l1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:f,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){var r=e[n];for(var i=0;i=this.$rowTokens.length){this.$row+=1,e||(e=this.$session.getLength());if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","rparen","paren","punctuation.operator"],a=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],f,l={},c={'"':'"',"'":"'"},h=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},d=function(e){this.add("braces","insertion",function(t,n,r,i,s){var u=r.getCursorPosition(),a=i.doc.getLine(u.row);if(s=="{"){h(r);var l=r.getSelectionRange(),c=i.doc.getTextRange(l);if(c!==""&&c!=="{"&&r.getWrapBehavioursEnabled())return p(l,c,"{","}");if(d.isSaneInsertion(r,i))return/[\]\}\)]/.test(a[u.column])||r.inMultiSelectMode||e&&e.braces?(d.recordAutoInsert(r,i,"}"),{text:"{}",selection:[1,1]}):(d.recordMaybeInsert(r,i,"{"),{text:"{",selection:[1,1]})}else if(s=="}"){h(r);var v=a.substring(u.column,u.column+1);if(v=="}"){var m=i.$findOpeningBracket("}",{column:u.column+1,row:u.row});if(m!==null&&d.isAutoInsertedClosing(u,a,s))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(s=="\n"||s=="\r\n"){h(r);var g="";d.isMaybeInsertedClosing(u,a)&&(g=o.stringRepeat("}",f.maybeInsertedBrackets),d.clearMaybeInsertedClosing());var v=a.substring(u.column,u.column+1);if(v==="}"){var y=i.findMatchingBracket({row:u.row,column:u.column+1},"}");if(!y)return null;var b=this.$getIndent(i.getLine(y.row))}else{if(!g){d.clearMaybeInsertedClosing();return}var b=this.$getIndent(a)}var w=b+i.getTabString();return{text:"\n"+w+"\n"+b+g,selection:[1,w.length,1,w.length]}}d.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||c;if(i.length==1&&s[i]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(i)!=-1)return;h(n);var o=i,u=n.getSelectionRange(),a=r.doc.getTextRange(u);if(a!==""&&(a.length!=1||!s[a])&&n.getWrapBehavioursEnabled())return p(u,a,o,o);if(!a){var f=n.getCursorPosition(),l=r.doc.getLine(f.row),d=l.substring(f.column-1,f.column),v=l.substring(f.column,f.column+1),m=r.getTokenAt(f.row,f.column),g=r.getTokenAt(f.row,f.column+1);if(d=="\\"&&m&&/escape/.test(m.type))return null;var y=m&&/string|escape/.test(m.type),b=!g||/string|escape/.test(g.type),w;if(v==o)w=y!==b,w&&/string\.end/.test(g.type)&&(w=!1);else{if(y&&!b)return null;if(y&&b)return null;var E=r.$mode.tokenRe;E.lastIndex=0;var S=E.test(d);E.lastIndex=0;var x=E.test(d);if(S||x)return null;if(v&&!/[\s;,.})\]\\]/.test(v))return null;var T=l[f.column-2];if(!(d!=o||T!=o&&!E.test(T)))return null;w=!0}return{text:w?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||c,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)){h(n);var u=r.doc.getLine(i.start.row),a=u.substring(i.start.column+1,i.start.column+2);if(a==o)return i.end.column++,i}})};d.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},d.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},d.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},d.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},d.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},d.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},d.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},d.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(d,i),t.CstyleBehaviour=d}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[];for(var o=0;o2?r%f!=f-1:r%f==0}}var E=Infinity;w(function(e,t){var n=e.search(/\S/);n!==-1?(ne.length&&(E=e.length)}),u==Infinity&&(u=E,s=!1,o=!1),l&&u%f!=0&&(u=Math.floor(u/f)*f),w(o?m:v)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(!i)return;!i.start&&i[0]&&(i=i[0]);var s=new f(t,r.row,r.column),o=s.getCurrentToken(),u=t.selection,a=t.selection.toOrientedRange(),c,h;if(o&&/comment/.test(o.type)){var p,d;while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.start);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;p=new l(m,g,m,g+i.start.length);break}o=s.stepBackward()}var s=new f(t,r.row,r.column),o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.end);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;d=new l(m,g,m,g+i.end.length);break}o=s.stepForward()}d&&t.remove(d),p&&(t.remove(p),c=p.start.row,h=-i.start.length)}else h=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);a.start.row==c&&(a.start.column+=h),a.end.row==c&&(a.end.column+=h),t.selection.fromOrientedRange(a)},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(var t=0;t=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var r=n?e.column<=t.column:e.columnthis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$splitAndapplyLargeDelta=function(e,t){var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column;for(var o=0,u=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.lines[t]=null;else if(e.action=="remove")this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e,this.cache=[]},this.update=function(e,t,n,i){if(!this.regExp)return;var o=i.firstRow,u=i.lastRow;for(var a=o;a<=u;a++){var f=this.cache[a];f==null&&(f=r.getMatchOffsets(n.getLine(a),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(e){return new s(a,e.offset,a,e.offset+e.length)}),this.cache[a]=f.length?f:"");for(var l=f.length;l--;)t.drawSingleLineMarker(e,f[l].toScreenRange(n),this.clazz,i)}}}).call(o.prototype),t.SearchHighlight=o}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var r=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r=0,i=this.folds,s,o,u,a=!0;t==null&&(t=this.end.row,n=this.end.column);for(var f=0;f0)continue;var a=i(e,o.start);return u===0?t&&a!==0?-s-2:s:a>0||a===0&&!t?s:-s-1}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){var t=[];for(var n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return i(e.start,t.start)});var n=t[0],r;for(var s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r)break}if(e.action=="insert"){var f=i-r,l=-t.column+n.column;for(;or)break;a.start.row==r&&a.start.column>=t.column&&(a.start.column==t.column&&this.$bias<=0||(a.start.column+=l,a.start.row+=f));if(a.end.row==r&&a.end.column>=t.column){if(a.end.column==t.column&&this.$bias<0)continue;a.end.column==t.column&&l>0&&oa.start.column&&a.end.column==s[o+1].start.column&&(a.end.column-=l),a.end.column+=l,a.end.row+=f}}}else{var f=r-i,l=t.column-n.column;for(;oi)break;if(a.end.rowt.column)a.end.column=t.column,a.end.row=t.row}else a.end.column+=l,a.end.row+=f;else a.end.row>i&&(a.end.row+=f);if(a.start.rowt.column)a.start.column=t.column,a.start.row=t.row}else a.start.column+=l,a.start.row+=f;else a.start.row>i&&(a.start.row+=f)}}if(f!=0&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r=e)return i}return null},this.getFoldedRowCount=function(e,t){var n=this.$foldData,r=t-e+1;for(var i=0;i=t){u=e?r-=t-u:r=0);break}o>=e&&(u>=e?r-=o-u:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof s?o=e:(o=new s(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var u=o.start.row,a=o.start.column,f=o.end.row,l=o.end.column,c=this.getFoldAt(u,a,1),h=this.getFoldAt(f,l,-1);if(c&&h==c)return c.addSubFold(o);c&&!c.range.isStart(u,a)&&this.removeFold(c),h&&!h.range.isEnd(f,l)&&this.removeFold(h);var p=this.getFoldsInRange(o.range);p.length>0&&(this.removeFolds(p),p.forEach(function(e){o.addSubFold(e)}));for(var d=0;d0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;e==null?(n=new r(0,0,this.getLength(),0),t=!0):typeof e=="number"?n=new r(e,0,e,this.getLine(e).length):"row"in e?n=r.fromPoints(e,e):n=e,i=this.getFoldsInRangeList(n);if(t)this.removeFolds(i);else{var s=i;while(s.length)this.expandFolds(s),s=this.getFoldsInRangeList(n)}if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r==null&&(r=e.start.row),i==null&&(i=0),t==null&&(t=e.end.row),n==null&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,u){if(tl)break}while(s&&a.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return f.end.row=i.getCurrentTokenRow(),f.end.column=i.getCurrentTokenColumn()+s.value.length-2,f}},this.foldAll=function(e,t,n){n==undefined&&(n=1e5);var r=this.foldWidgets;if(!r)return;t=t||this.getLength(),e=e||0;for(var i=e;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(u){}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle==e)return;this.$foldStyle=e,e=="manual"&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)},this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation");if(!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};var r=e-1,i;while(r>=0){var s=n[r];s==null&&(s=n[r]=this.getFoldWidget(r));if(s=="start"){var o=this.getFoldWidgetRange(r);i||(i=o);if(o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},r=this.$toggleFoldWidget(e,n);if(!r){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var n=this.getFoldWidget(e),r=this.getLine(e),i=n==="end"?-1:1,s=this.getFoldAt(e,i===-1?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()){s=this.getFoldAt(o.start.row,o.start.column,1);if(s&&o.isEqual(s.range))return this.removeFold(s),s}if(t.siblings){var u=this.getParentFoldRangeData(e);if(u.range)var a=u.range.start.row+1,f=u.range.end.row;this.foldAll(a,f,t.all?1e4:0)}else t.children?(f=o?o.end.row:this.getLength(),this.foldAll(e+1,f,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(n)return;var r=this.getParentFoldRangeData(t,!0);n=r.range||r.firstRange;if(n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.foldWidgets[t]=null;else if(e.action=="remove")this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var r=e("../range").Range,i=e("./fold_line").FoldLine,s=e("./fold").Fold,o=e("../token_iterator").TokenIterator;t.Folding=u}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";function s(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n=="")return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,s=t.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);o||(s=t.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1);if(!o)return null;if(o[1]){var u=this.$findClosingBracket(o[1],e);if(!u)return null;r=i.fromPoints(e,u),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var u=this.$findOpeningBracket(o[2],e);if(!u)return null;r=i.fromPoints(u,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));var a=t.column-o.getCurrentTokenColumn()-2,f=u.value;for(;;){while(a>=0){var l=f.charAt(a);if(l==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else l==e&&(s+=1);a-=1}do u=o.stepBackward();while(u&&!n.test(u.type));if(u==null)break;f=u.value,a=f.length-1}return null},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));var a=t.column-o.getCurrentTokenColumn();for(;;){var f=u.value,l=f.length;while(a=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}r.implement(this,u),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){var n=0,r=e.length-1;while(n<=r){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t)break}return r=n[s],r?(r.index=s,r.start=i-r.value.length,r):null},this.setUndoManager=function(e){this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel();if(e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe));if(r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var s=t;if(s>0){do s--;while(s>=0&&n.charAt(s).match(i));s++}var o=t;while(oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){this.$modified=!1;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:Infinity,u=t.length;for(var a=0;ao){a=s.end.row+1;if(a>=u)break;s=this.$foldData[i++],o=s?s.start.row:Infinity}n[a]==null&&(n[a]=this.$getStringScreenWidth(t[a])[0]),n[a]>r&&(r=n[a])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=e.length-1;n!=-1;n--){var r=e[n];r.action=="insert"||r.action=="remove"?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1},this.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}s.end=this.insert(s.start,r);if(i.length){var a=e.start,f=s.start,o=f.row-a.row,u=f.column-a.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){var t=e.collapseRows(),n=new l(0,0,0,0),r=this.getTabSize();for(var i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var s=new l(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),u=n==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,u),o.length&&this.addFolds(o),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode")},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,u=o-s,a=null;this.$updating=!0;if(u!=0)if(n==="remove"){this[t?"$wrapData":"$rowLengthCache"].splice(s,u);var f=this.$foldData;a=this.getFoldsInRange(e),this.removeFolds(a);var l=this.getFoldLine(i.row),c=0;if(l){l.addRemoveChars(i.row,i.column,r.column-i.column),l.shiftRow(-u);var h=this.getFoldLine(s);h&&h!==l&&(h.merge(l),l=h),c=f.indexOf(l)+1}for(c;c=i.row&&l.shiftRow(-u)}o=s}else{var p=Array(u);p.unshift(s,0);var d=t?this.$wrapData:this.$rowLengthCache;d.splice.apply(d,p);var f=this.$foldData,l=this.getFoldLine(s),c=0;if(l){var v=l.range.compareInside(r.row,r.column);v==0?(l=l.split(r.row,r.column),l&&(l.shiftRow(u),l.addRemoveChars(o,0,i.column-r.column))):v==-1&&(l.addRemoveChars(s,0,i.column-r.column),l.shiftRow(u)),c=f.indexOf(l)+1}for(c;c=s&&l.shiftRow(u)}}else{u=Math.abs(e.start.column-e.end.column),n==="remove"&&(a=this.getFoldsInRange(e),this.removeFolds(a),u=-u);var l=this.getFoldLine(s);l&&l.addRemoveChars(s,r.column,u)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),a},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var r=this.doc.getAllLines(),i=this.getTabSize(),o=this.$wrapData,u=this.$wrapLimit,a,f,l=e;t=Math.min(t,r.length-1);while(l<=t)f=this.getFoldLine(l,f),f?(a=[],f.walk(function(e,t,i,o){var u;if(e!=null){u=this.$getDisplayTokens(e,a.length),u[0]=n;for(var f=1;fr-b){var w=f+r-b;if(e[w-1]>=c&&e[w]>=c){y(w);continue}if(e[w]==n||e[w]==s){for(w;w!=f-1;w--)if(e[w]==n)break;if(w>f){y(w);continue}w=f+r;for(w;w>2)),f-1);while(w>E&&e[w]E&&e[w]E&&e[w]==a)w--}else while(w>E&&e[w]E){y(++w);continue}w=f+r,e[w]==t&&w--,y(w-b)}return o},this.$getDisplayTokens=function(n,r){var i=[],s;r=r||0;for(var o=0;o39&&u<48||u>57&&u<64?i.push(a):u>=4352&&m(u)?i.push(e,t):i.push(e)}return i},this.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t==null&&(t=Infinity),n=n||0;var r,i;for(i=0;i=4352&&m(r)?n+=2:n+=1;if(n>t)break}return[n,i]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0)var u=f[l],i=this.$docRowCache[l],h=e>f[c-1];else var h=!c;var p=this.getLength()-1,d=this.getNextFoldLine(i),v=d?d.start.row:Infinity;while(u<=e){a=this.getRowLength(i);if(u+a>e||i>=p)break;u+=a,i++,i>v&&(i=d.end.row+1,d=this.getNextFoldLine(i,d),v=d?d.start.row:Infinity),h&&(this.$docRowCache.push(i),this.$screenRowCache.push(u))}if(d&&d.start.row<=i)r=this.getFoldDisplayLine(d),i=d.start.row;else{if(u+a<=e||i>p)return{row:p,column:this.getLine(p).length};r=this.getLine(i),d=null}var m=0,g=Math.floor(e-u);if(this.$useWrapMode){var y=this.$wrapData[i];y&&(o=y[g],g>0&&y.length&&(m=y.indent,s=y[g-1]||y[y.length-1],r=r.substring(s)))}return n!==undefined&&this.$bidiHandler.isBidiRow(u+g,i,g)&&(t=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(r,t-m)[1],this.$useWrapMode&&s>=o&&(s=o-1),d?d.idxToPosition(s):{row:i,column:s}},this.documentToScreenPosition=function(e,t){if(typeof t=="undefined")var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,s=null;s=this.getFoldAt(e,t,1),s&&(e=s.start.row,t=s.start.column);var o,u=0,a=this.$docRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var u=a[f],r=this.$screenRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getNextFoldLine(u),p=h?h.start.row:Infinity;while(u=p){o=h.end.row+1;if(o>e)break;h=this.getNextFoldLine(o,h),p=h?h.start.row:Infinity}else o=u+1;r+=this.getRowLength(u),u=o,c&&(this.$docRowCache.push(u),this.$screenRowCache.push(r))}var d="";h&&u>=p?(d=this.getFoldDisplayLine(h,e,t),i=h.start.row):(d=this.getLine(e).substring(0,t),i=e);var v=0;if(this.$useWrapMode){var m=this.$wrapData[i];if(m){var g=0;while(d.length>=m[g])r++,g++;d=d.substring(m[g-1]||0,d.length),v=g>0?m.indent:0}}return{row:r,column:v+this.$getStringScreenWidth(d)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(!this.$useWrapMode){e=this.getLength();var n=this.$foldData;for(var r=0;ro&&(s=t.end.row+1,t=this.$foldData[r++],o=t?t.start.row:Infinity)}}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){if(!this.$enableVarChar)return;this.$getStringScreenWidth=function(t,n,r){if(n===0)return[0,0];n||(n=Infinity),r=r||0;var i,s;for(s=0;sn)break}return[r,s]}},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=m}.call(d.prototype),e("./edit_session/folding").Folding.call(d.prototype),e("./edit_session/bracket_match").BracketMatch.call(d.prototype),o.defineOptions(d.prototype,"session",{wrap:{set:function(e){!e||e=="off"?e=!1:e=="free"?e=!0:e=="printMargin"?e=-1:typeof e=="string"&&(e=parseInt(e,10)||!1);if(this.$wrap==e)return;this.$wrap=e;if(!e)this.setUseWrapMode(!1);else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text",e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){e=parseInt(e),e>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=d}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";function u(e,t){function n(e){return/\w/.test(e)||t.regExp?"\\b":""}return n(e[0])+e+n(e[e.length-1])}var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),n==o&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start)?(r=null,!1):!0}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],u=t.re;if(t.$isMultiLine){var a=u.length,f=i.length-a,l;e:for(var c=u.offset||0;c<=f;c++){for(var h=0;hv)continue;o.push(l=new s(c,v,c+a-1,m)),a>2&&(c=c+a-2)}}else for(var g=0;gE&&o[h].end.row==n.end.row)h--;o=o.slice(g,h+1);for(g=0,h=o.length;g=u;n--)if(c(n,Number.MAX_VALUE,e))return;if(t.wrap==0)return;for(n=a,u=o.row;n>=u;n--)if(c(n,Number.MAX_VALUE,e))return};else var f=function(e){var n=o.row;if(c(n,o.column,e))return;for(n+=1;n<=a;n++)if(c(n,0,e))return;if(t.wrap==0)return;for(n=u,a=o.row;n<=a;n++)if(c(n,0,e))return};if(t.$isMultiLine)var l=n.length,c=function(t,i,s){var o=r?t-l+1:t;if(o<0)return;var u=e.getLine(o),a=u.search(n[0]);if(!r&&ai)return;if(s(o,a,o+l-1,c))return!0};else if(r)var c=function(t,r,i){var s=e.getLine(t),o=[],u,a=0;n.lastIndex=0;while(u=n.exec(s)){var f=u[0].length;a=u.index;if(!f){if(a>=s.length)break;n.lastIndex=a+=1}if(u.index+f>r)break;o.push(u.index,f)}for(var l=o.length-1;l>=0;l-=2){var c=o[l-1],f=o[l];if(i(t,c,t,c+f))return!0}};else var c=function(t,r,i){var s=e.getLine(t),o,u;n.lastIndex=r;while(u=n.exec(s)){var a=u[0].length;o=u.index;if(i(t,o,t,o+a))return!0;if(!a){n.lastIndex=o+=1;if(o>=s.length)return!1}}};return{forEach:f}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function u(e,t){o.call(this,e,t),this.$singleCommand=!1}var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;u.prototype=o.prototype,function(){function e(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);o!=-1&&(s.splice(o,1),s.length==1&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){typeof e=="object"&&e&&(n==undefined&&(n=e.position),e=e[this.platform]);if(!e)return;if(typeof t=="function")return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split("|").forEach(function(e){var r="";if(e.indexOf(" ")!=-1){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),u=s[o.hashId]+o.key;this._addCommandToBinding(r+u,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i=this.commandKeyBinding,s;if(!n)delete i[t];else if(!i[t]||this.$singleCommand)i[t]=n;else{Array.isArray(i[t])?(s=i[t].indexOf(n))!=-1&&i[t].splice(s,1):i[t]=[i[t]],typeof r!="number"&&(r=e(n));var o=i[t];for(s=0;sr)break}o.splice(s,0,n)}},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(!n)return;if(typeof n=="string")return this.bindKey(n,t);typeof n=="function"&&(n={exec:n});if(typeof n!="object")return;n.name||(n.name=t),this.addCommand(n)},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(t.length==1&&t[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}var s=0;for(var o=t.length;o--;){var u=r.KEY_MODS[t[o]];if(u==null)return typeof console!="undefined"&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=u}return{key:n,hashId:s}},this.findKeyCommand=function(t,n){var r=s[t]+n;return this.commandKeyBinding[r]},this.handleKeyboard=function(e,t,n,r){if(r<0)return;var i=s[t]+n,o=this.commandKeyBinding[i];e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o);if(o)if(o=="chainKeys"||o[o.length-1]=="chainKeys")return e.$keyChain=e.$keyChain||i,{command:"null"};if(e.$keyChain)if(!!t&&t!=4||n.length!=1){if(t==-1||r>0)e.$keyChain=""}else e.$keyChain=e.$keyChain.slice(0,-i.length-1);return{command:o}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=u}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e=="string"&&(e=this.commands[e]);if(!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(this.$checkCommandState!=0&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),i.returnValue===!1?!1:!0},this.toggleRecording=function(e){if(this.$inReplay)return;return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}},this.trimMacro=function(e){return e.map(function(e){return typeof e[0]!="string"&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";function o(e,t){return{win:e,mac:t}}var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){typeof t=="number"&&!isNaN(t)&&e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty(),n=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",n),n.isEmpty()||e.session.remove(n),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,u=e.session.doc.getTextRange(e.selection.getRange()),a=u.replace(/\n\s*/," ").length,f=e.session.doc.getLine(n.row);for(var l=n.row+1;l<=i.row+1;l++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));c.length!==0&&(c=" "+c),f+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:}n=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var i=e.args;this.mergeNextCommand===undefined&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())},this.setKeyboardHandler=function(e,t){if(e&&typeof e=="string"&&e!="ace"){this.$keybindingId=e;var n=this;g.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session==e)return;this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new p(n.row,n.column,n.row,n.column+1);else if(t.$mode.getMatching)var r=t.$mode.getMatching(e.session);r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))},50)},this.$highlightTags=function(){if(this.$highlightTagPending)return;var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=e.getCursorPosition(),r=new y(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type)){t.removeMarker(t.$tagHighlight),t.$tagHighlight=null;return}if(i.type.indexOf("tag-open")!=-1){i=r.stepForward();if(!i)return}var s=i.value,o=0,u=r.stepBackward();if(u.value=="<"){do u=i,i=r.stepForward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="=0)}else{do i=u,u=r.stepBackward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="1)&&(t=!1)}if(e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,Infinity);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null;if(!this.selection.isEmpty()){var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}else this.$updateHighlightActiveLine();var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(s.length>5e3||!/[\w\d]/.test(s))return;var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),u=i.substring(n-1,r+1);if(!o.test(u))return;return o},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;var r=this.selection.getAllRanges();for(var i=0;iu.search(/\S|$/)){var a=u.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var f=i.column,l=n.getState(i.row),u=n.getLine(i.row),c=r.checkOutdent(l,u,e);n.insert(i,e),s&&s.selection&&(s.selection.length==2?this.selection.setSelectionRange(new p(i.row,f+s.selection[0],i.row,f+s.selection[1])):this.selection.setSelectionRange(new p(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3])));if(n.getDocument().isNewLine(e)){var h=r.getNextLineIndent(l,u.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},h)}c&&r.autoOutdent(l,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var n=this.selection.getRange();n.start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove()}(e||!this.selection.isEmpty())&&this.insert(e,!0);if(t.restoreStart||t.restoreEnd){var n=this.selection.getRange();n.start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n)}},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&(e=="left"?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(t.end.column===0){var s=n.getTextRange(t);if(s[s.length-1]=="\n"){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var e=this.getCursorPosition(),t=e.column;if(t===0)return;var n=this.session.getLine(e.row),r,i;tt.toLowerCase()?1:0});var i=new p(0,0,0,0);for(var r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;var r=this.session.getLine(e);while(n.lastIndex=t){var s={value:i[0],start:i.index,end:i.index+i[0].length};return s}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new p(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,u=s.start+s.value.length-o,a=parseFloat(s.value);a*=Math.pow(10,u),o!==s.end&&n=u&&o<=a&&(n=t,f.selection.clearSelection(),f.moveCursorTo(e,u+r),f.selection.selectTo(e,a+r)),u=a});var l=this.$toggleWordPairs,c;for(var h=0;hp+1)break;p=d.last}l--,u=this.session.$moveLines(h,p,t?0:e),t&&e==-1&&(c=l+1);while(c<=l)o[c].moveBy(u,0),c++;t||(u=0),a+=u}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new y(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(!s)return;var o,u=!1,a={},f=n.column-s.start,l,c={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g))for(;f=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t!==null?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),typeof e=="string"||e instanceof RegExp?t.needle=e:typeof e=="object"&&r.mixin(t,e);var i=this.selection.getRange();t.needle==null&&(e=this.session.getTextRange(i)||this.$search.$options.needle,e||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);if(t.preventScroll)return s;if(s)return this.revealRange(s,n),s;t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(!e)return;var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),u=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,u=s.top-o.offset;s.top>=0&&u+t.top<0?r=!0:s.topwindow.innerHeight?r=!1:r=null,r!=null&&(i.style.top=u+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",u),this.renderer.off("beforeRender",o)}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!="wide",i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))},this.prompt=function(e,t,n){var r=this;g.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(w.prototype),g.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?E.attach(this):E.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?E.attach(this):E.detach(this)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var E={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"\u00b7":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=w}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){for(var n=t;n--;){var r=e[n];if(r&&!r[0].ignore){while(n0){a.row+=i,a.column+=a.row==r.row?s:0;continue}!t&&l<=0&&(a.row=n.row,a.column=n.column,l===0&&(a.bias=1))}}function f(e){return{row:e.row,column:e.column}}function l(e){return{start:f(e.start),end:f(e.end),action:e.action,lines:e.lines.slice()}}function c(e){e=e||this;if(Array.isArray(e))return e.map(c).join("\n");var t="";e.action?(t=e.action=="insert"?"+":"-",t+="["+e.lines+"]"):e.value&&(Array.isArray(e.value)?t=e.value.map(h).join("\n"):t=h(e.value)),e.start&&(t+=h(e));if(e.id||e.rev)t+=" ("+(e.id||e.rev)+")";return t}function h(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function p(e,t){var n=e.action=="insert",r=t.action=="insert";if(n&&r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}else if(!n&&r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(!n&&!r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}return[t,e]}function d(e,t){for(var n=e.length;n--;)for(var r=0;r=0?m(e,t,-1):o(e.start,t.start)<=0?m(t,e,1):(m(e,s.fromPoints(t.start,e.start),-1),m(t,e,1));else if(!n&&r)o(t.start,e.end)>=0?m(t,e,-1):o(t.start,e.start)<=0?m(e,t,1):(m(t,s.fromPoints(e.start,t.start),-1),m(e,t,1));else if(!n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0)){var i,u;return o(e.start,t.start)<0&&(i=e,e=y(e,t.start)),o(e.end,t.end)>0&&(u=y(e,t.end)),g(t.end,e.start,e.end,-1),u&&!i&&(e.lines=u.lines,e.start=u.start,e.end=u.end,u=e),[t,i,u].filter(Boolean)}m(e,t,-1)}return[t,e]}function m(e,t,n){g(e.start,t.start,t.end,n),g(e.end,t.start,t.end,n)}function g(e,t,n,r){e.row==(r==1?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function y(e,t){var n=e.lines,r=e.end;e.end=f(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),o=i?t.column:t.column-e.start.column;n.push(s[0].substring(0,o)),s[0]=s[0].substr(o);var u={start:f(t),end:r,lines:s,action:e.action};return u}function b(e,t){t=l(t);for(var n=e.length;n--;){var r=e[n];for(var i=0;i0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){e==undefined&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?c(e):c(this.$undoStack)+"\n---\n"+c(this.$redoStack)}}).call(r.prototype);var s=e("./range").Range,o=s.comparePoints,u=s.comparePoints;t.UndoManager=r}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){r.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,n){var r=t.firstRowScreen*t.lineHeight,i=Math.floor(r/this.canvasHeight),s=n.documentToScreenRow(e,0)*t.lineHeight;return s-i*this.canvasHeight},this.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLength(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);var t=r.createFragment(this.element);for(var n=0;ns&&(a=i.end.row+1,i=t.getNextFoldLine(a,i),s=i?i.start.row:Infinity);if(a>r){while(this.$lines.getLength()>u+1)this.$lines.pop();break}o=this.$lines.get(++u),o?o.row=a:(o=this.$lines.createCell(a,e,this.session,f),this.$lines.push(o)),this.$renderCell(o,e,i,a),a++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";if(this.$fixedWidth||t.$useWrapMode)i=t.getLength()+r-1;var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();s+=o.left+o.right,s!==this.gutterWidth&&!isNaN(s)&&(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.getCursor();if(this.$cursorRow===e.row)return;this.$cursorRow=e.row},this.updateLineHighlight=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.cursor.row;this.$cursorRow=e;if(this.$cursorCell&&this.$cursorCell.row==e)return;this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}},this.scrollLines=function(e){var t=this.config;this.config=e,this.$updateCursorRow();if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;this.oldLastRow=n;if(!t||r0;i--)this.$lines.shift();if(r>n)for(var i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:Infinity;for(;;){i>o&&(i=s.end.row+1,s=this.session.getNextFoldLine(i,s),o=s?s.start.row:Infinity);if(i>n)break;var u=this.$lines.createCell(i,e,this.session,f);this.$renderCell(u,e,s,i),r.push(u),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,u=s.childNodes[0],a=s.childNodes[1],f=o.$firstLineNumber,l=o.$breakpoints,c=o.$decorations,h=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,d=n?n.start.row:Number.MAX_VALUE,v="ace_gutter-cell ";this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=d&&this.$cursorRow<=n.end.row)&&(v+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),l[i]&&(v+=l[i]),c[i]&&(v+=c[i]),this.$annotations[i]&&(v+=this.$annotations[i].className),s.className!=v&&(s.className=v);if(p){var m=p[i];m==null&&(m=p[i]=o.getFoldWidget(i))}if(m){var v="ace_fold-widget ace_"+m;m=="start"&&i==d&&in.right-t.right)return"foldWidgets"}}).call(a.prototype),t.Gutter=a}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(!e)return;this.config=e,this.i=0;var t;for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(i.isEmpty())continue;i=i.toScreenRange(this.session);if(r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else r.type=="fullLine"?this.drawFullLineMarker(t,i,r.clazz,e):r.type=="screenLine"?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type=="text"?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start"+" ace_br15",e)}if(this.i!=-1)while(this.ip,l==f),s,l==f?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,u=this.$getTop(t.start.row,r),a=s+t.start.column*r.characterWidth;i=i||"";if(this.session.$bidiHandler.isBidiRow(t.start.row)){var f=t.clone();f.end.row=f.start.row,f.end.column=this.session.getLine(f.start.row).length,this.drawBidiSingleLineMarker(e,f,n+" ace_br1 ace_start",r,null,i)}else this.elt(n+" ace_br1 ace_start","height:"+o+"px;"+"right:0;"+"top:"+u+"px;left:"+a+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var f=t.clone();f.start.row=f.end.row,f.start.column=0,this.drawBidiSingleLineMarker(e,f,n+" ace_br12",r,null,i)}else{u=this.$getTop(t.end.row,r);var l=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;"+"width:"+l+"px;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))}o=(t.end.row-t.start.row-1)*r.lineHeight;if(o<=0)return;u=this.$getTop(t.start.row+1,r);var c=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(c?" ace_br"+c:""),"height:"+o+"px;"+"right:0;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,u=(t.end.column+(i||0)-t.start.column)*r.characterWidth,a=this.$getTop(t.start.row,r),f=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;"+"width:"+u+"px;"+"top:"+a+"px;"+"left:"+f+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,u=this.$getTop(t.start.row,r),a=this.$padding,f=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);f.forEach(function(e){this.elt(n,"height:"+o+"px;"+"width:"+e.width+(i||0)+"px;"+"top:"+u+"px;"+"left:"+(a+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,u=e("../lib/event_emitter").EventEmitter,a=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,u),this.EOF_CHAR="\u00b6",this.EOL_CHAR_LF="\u00ac",this.EOL_CHAR_CRLF="\u00a4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\u00b7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows",n=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var n=1;nl&&(u=a.end.row+1,a=this.session.getNextFoldLine(u,a),l=a?a.start.row:Infinity);if(u>i)break;var c=s[o++];if(c){this.dom.removeChildren(c),this.$renderLine(c,u,u==l?a:!1),f&&(c.style.top=this.$lines.computeLineTop(u,e,this.session)+"px");var h=e.lineHeight*this.session.getRowLength(u)+"px";c.style.height!=h&&(f=!0,c.style.height=h)}u++}if(f)while(o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){var r=[],s=t,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>n)break;var a=this.$lines.createCell(s,e,this.session),f=a.element;this.dom.removeChildren(f),i.setStyle(f.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(f.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(f,s,s==u?o:!1),this.$useLineGroups()?f.className="ace_line_group":f.className="ace_line",r.push(a),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;var t=e.firstRow,n=e.lastRow,r=this.$lines;while(r.getLength())r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){var i=this,o=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,u=this.dom.createFragment(this.element),a,f=0;while(a=o.exec(r)){var l=a[1],c=a[2],h=a[3],p=a[4],d=a[5];if(!i.showInvisibles&&c)continue;var v=f!=a.index?r.slice(f,a.index):"";f=a.index+a[0].length,v&&u.appendChild(this.dom.createTextNode(v,this.element));if(l){var m=i.session.getScreenTabSize(t+a.index);u.appendChild(i.$tabStrings[m].cloneNode(!0)),t+=m-1}else if(c)if(i.showInvisibles){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_space",g.textContent=s.stringRepeat(i.SPACE_CHAR,c.length),u.appendChild(g)}else u.appendChild(this.com.createTextNode(c,this.element));else if(h){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_space ace_invalid",g.textContent=s.stringRepeat(i.SPACE_CHAR,h.length),u.appendChild(g)}else if(p){t+=1;var g=this.dom.createElement("span");g.style.width=i.config.characterWidth*2+"px",g.className=i.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",g.textContent=i.showInvisibles?i.SPACE_CHAR:p,u.appendChild(g)}else if(d){t+=1;var g=this.dom.createElement("span");g.style.width=i.config.characterWidth*2+"px",g.className="ace_cjk",g.textContent=d,u.appendChild(g)}}u.appendChild(this.dom.createTextNode(f?r.slice(f):r,this.element));if(!this.$textToken[n.type]){var y="ace_"+n.type.replace(/\./g," ace_"),g=this.dom.createElement("span");n.type=="fold"&&(g.style.width=n.value.length*this.config.characterWidth+"px"),g.className=y,g.appendChild(u),e.appendChild(g)}else e.appendChild(u);return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(t[0]==" "){r-=r%this.tabSize;var i=r/this.tabSize;for(var s=0;s=o)u=this.$renderToken(a,u,l,c.substring(0,o-r)),c=c.substring(o-r),r=o,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode(s.stringRepeat("\u00a0",n.indent),this.element)),i++,u=0,o=n[i]||Number.MAX_VALUE;c.length!=0&&(r+=c.length,u=this.$renderToken(a,u,l,c))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(a,u,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){!n&&n!=0&&(n=this.session.getFoldLine(t));if(n)var r=this.$getFoldLineTokens(t,n);else var r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,r,s);var i=e.lastChild}else{var i=e;this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r)}}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){function i(e,t,n){var i=0,s=0;while(s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1}while(sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}var n=this.session,r=[],s=n.getTokens(e);return t.walk(function(e,t,o,u,a){e!=null?r.push({type:"fold",value:e}):(a&&(s=n.getTokens(t)),s.length&&i(s,u,o))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(a.prototype),t.Text=a}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){var t=this.cursors;for(var n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){var e=this.cursors;for(var t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0);if(!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this));if(r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),i=(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:i}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)continue;var u=this.cursors[i++]||this.addCursor(),a=u.style;this.drawCursor?this.drawCursor(u,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(a,"display","block"),r.translate(u,o.left,o.top),r.setStyle(a,"width",Math.round(e.characterWidth)+"px"),r.setStyle(a,"height",e.lineHeight+"px")):r.setStyle(a,"display","none")}while(this.cursors.length>i)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,u=32768,a=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\u00a0",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var f=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(f,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>u?(this.coeff=u/e,e=u):this.coeff!=1&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(f.prototype);var l=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(l,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(l.prototype),t.ScrollBar=f,t.ScrollBarV=f,t.ScrollBarH=l,t.VScrollBar=f,t.HScrollBar=l}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;t&&(r.blockIdle(100),n.changes=0,n.onRender(t));if(n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),u=e("../lib/useragent"),a=e("../lib/event_emitter").EventEmitter,f=256,l=typeof ResizeObserver=="function",c=200,h=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",f),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,a),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",u.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){e===undefined&&(e=this.$measureSizes());if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/f})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/f};return t.width===0||t.height===0?null:t},this.$measureCharWidth=function(e){this.$main.innerHTML=s.stringRepeat(e,f);var t=this.$main.getBoundingClientRect();return t.width/f},this.getCharacterWidth=function(e){var t=this.charSizes[e];return t===undefined&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(c,0),e(0,c),e(c,c)],this.el)},this.transformCoordinates=function(e,t){function r(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function u(e){var t=e.getBoundingClientRect();return[t.left,t.top]}if(e){var n=this.$getZoom(this.el);e=o(1/n,e)}this.els||this.$initTransformMeasureNodes();var a=u(this.els[0]),f=u(this.els[1]),l=u(this.els[2]),h=u(this.els[3]),p=r(i(h,f),i(h,l),i(s(f,l),s(h,a))),d=o(1+p[0],i(f,a)),v=o(1+p[1],i(l,a));if(t){var m=t,g=p[0]*m[0]/c+p[1]*m[1]/c+1,y=s(o(m[0],d),o(m[1],v));return s(o(1/g/c,y),a)}var b=i(e,a),w=r(i(d,o(p[0],b)),i(v,o(p[1],b)),b);return o(c,w)}}).call(h.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,u=e("./layer/marker").Marker,a=e("./layer/text").Text,f=e("./layer/cursor").Cursor,l=e("./scrollbar").HScrollBar,c=e("./scrollbar").VScrollBar,h=e("./renderloop").RenderLoop,p=e("./layer/font_metrics").FontMetrics,d=e("./lib/event_emitter").EventEmitter,v='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}',m=e("./lib/useragent"),g=m.isIE;i.importCssString(v,"ace_editor.css");var y=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new u(this.content);var r=this.$textLayer=new a(this.content);this.canvas=r.element,this.$markerFront=new u(this.content),this.$cursorLayer=new f(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new c(this.container,this),this.scrollBarH=new l(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new h(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,d),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e);if(!e)return;this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode)},this.updateLines=function(e,t,n){t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(this.resizing>2)return;this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,u={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL);if(n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,t==null&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",a),i.setStyle(this.scroller.style,"right",a),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight());if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)s|=this.CHANGE_FULL}return o.$dirty=!n||!r,s&&this._signal("resize",u),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(this.$isMousePressed)return;var e=this.textarea.style,t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){i.translate(this.textarea,-100,0);return}var n=this.$cursorLayer.$pixelPos;if(!n)return;t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var u=t&&t.useTextareaForIME?this.lineHeight:g?0:1;if(s<0||s>r.height-u){i.translate(this.textarea,0,0);return}var a=1,f=this.$size.height-u;if(!t)s+=this.lineHeight;else if(t.useTextareaForIME){var l=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(l)[0],u+=2}else s+=this.lineHeight+2;o-=this.scrollLeft,o>this.$size.scrollerWidth-a&&(o=this.$size.scrollerWidth-a),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",u+"px"),i.setStyle(e,"width",a+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-a),Math.min(s,f))},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow,n=this.session.documentToScreenRow(t,0)*e.lineHeight;return n-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){this.$changes&&(e|=this.$changes,this.$changes=0);if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig()|this.$loop.clear();if(n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left");if(e&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender");return}if(e&this.CHANGE_SCROLL){this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender");return}e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=n<=2*this.lineHeight,i=!r&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var s=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength(),i=r*this.lineHeight,s=this.$getLongestLine(),o=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),u=this.$horizScroll!==o;u&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var f=t.scrollerHeight+this.lineHeight,l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=l;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,i-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+l<0||this.scrollTop>c.top),p=a!==h;p&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var d=this.scrollTop%this.lineHeight,v=Math.ceil(f/this.lineHeight)-1,m=Math.max(0,Math.round((this.scrollTop-d)/this.lineHeight)),g=m+v,y,b,w=this.lineHeight;m=e.screenToDocumentRow(m,0);var E=e.getFoldLine(m);E&&(m=E.start.row),y=e.documentToScreenRow(m,0),b=e.getRowLength(m)*w,g=Math.min(e.screenToDocumentRow(g,0),e.getLength()-1),f=t.scrollerHeight+e.getRowLength(g)*w+b,d=this.scrollTop-y*w;var S=0;if(this.layerConfig.width!=s||u)S=this.CHANGE_H_SCROLL;if(u||p)S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),p&&(s=this.$getLongestLine());return this.layerConfig={width:s,padding:this.$padding,firstRow:m,firstRowScreen:y,lastRow:g,lineHeight:w,characterWidth:this.characterWidth,minHeight:f,maxHeight:i,offset:d,gutterOffset:w?Math.max(0,Math.ceil((d+t.height-t.scrollerHeight)/w)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),S},this.$updateLines=function(){if(!this.$changedLines)return;var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(e>n.lastRow+1)return;if(tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(this.$size.scrollerHeight===0)return;var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,u=n&&n.bottom||0,a=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;a+o>s?(t&&a+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):a+this.$size.scrollerHeight-ui?(i=1-this.scrollMargin.top)return!0;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return!0;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return!0;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),u=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:u,side:s-u>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),u=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(u,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(!this.$composition)return;this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display=""},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(r==null)o.push(s);else{var u=0;for(var a=0;a50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e})}}).call(f.prototype);var l=function(e,t,n){var r=null,i=!1,u=Object.create(s),a=[],l=new f({messageBuffer:a,terminate:function(){},postMessage:function(e){a.push(e);if(!r)return;i?setTimeout(c):c()}});l.setEmitSync=function(e){i=e};var c=function(){var e=a.shift();e.command?r[e.command].apply(r,e.args):e.event&&u._signal(e.event,e.data)};return u.postMessage=function(e){l.onMessage({data:e})},u.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},u.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){r=new e[n](u);while(a.length)c()}),l};t.UIWorkerClient=l,t.WorkerClient=f,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var u=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})},this.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;this.updateAnchors(e),i&&(this.length+=n);if(i&&!this.session.$fromUndo)if(e.action==="insert")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.insertMergedLines(a,e.lines)}else if(e.action==="remove")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(this.$updating)return;var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)},this.onCursorChange=function(e){if(this.$updating||!this.session)return;var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(this.$undoStackDepth===-1)return;var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth;for(var n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new r,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var n=this.getRange(),r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var u=n.end,a=n.start;else var u=n.start,a=n.end;this.addRange(i.fromPoints(a,a)),this.addRange(i.fromPoints(u,u));return}var f=[],l=this.getLineRange(s,!0);l.start.column=n.start.column,f.push(l);for(var c=s+1;c1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor),o=this.rectangularRangeBlock(r,s);o.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0)g--;if(g>0){var y=0;while(r[y].isEmpty())y++}for(var b=g;b>=y;b--)r[b].isEmpty()&&r.splice(b,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var n=e.length;n--;){var r=e[n];if(!r.marker)continue;this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(f.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(f.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection")},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(!n.multiSelect)return;if(!t.multiSelectAction){var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}else t.multiSelectAction=="forEach"?r=n.forEachSelection(t,e.args):t.multiSelectAction=="forEachLine"?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction=="single"?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});return r},this.forEachSelection=function(e,t,n){if(this.inVirtualSelectionMode)return;var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,u=this.selection,a=u.rangeList,f=(r?u:a).ranges,l;if(!f.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=u._eventRegistry;u._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var p=f.length;p--;){if(i)while(p>0&&f[p].start.row==f[p-1].end.row)p--;h.fromOrientedRange(f[p]),h.index=p,this.selection=o.selection=h;var d=e.exec?e.exec(this,t||{}):e(this,t||{});!l&&d!==undefined&&(l=d),h.toOrientedRange(f[p])}h.detach(),this.selection=o.selection=u,this.inVirtualSelectionMode=!1,u._eventRegistry=c,u.mergeOverlappingRanges(),u.ranges[0]&&u.fromOrientedRange(u.ranges[0]);var v=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),v&&v.from==v.to&&this.renderer.animateScrolling(v.from),l},this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges,n=[];for(var r=0;r0);u<0&&(u=0),f>=c&&(f=c-1)}var p=this.session.removeFullLines(u,f);p=this.$reAlignText(p,l),this.session.insert({row:u,column:0},p.join("\n")+"\n"),l||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{s.forEach(function(e){t.substractPoint(e.cursor)});var d=0,v=Infinity,m=n.map(function(t){var n=t.cursor,r=e.getLine(n.row),i=r.substr(n.column).search(/\S/g);return i==-1&&(i=0),n.column>d&&(d=n.column),io?e.insert(r,a.stringRepeat(" ",s-o)):e.remove(new i(r.row,r.column,r.row,r.column-s+o)),t.start.column=t.end.column=d,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){function u(e){return a.stringRepeat(" ",e)}function f(e){return e[2]?u(i)+e[2]+u(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function l(e){return e[2]?u(i+s-e[2].length)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function c(e){return e[2]?u(i)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var n=!0,r=!0,i,s,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?i==null?(i=t[1].length,s=t[2].length,o=t[3].length,t):(i+s+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),st[3].length&&(o=t[3].length),t):[e]}).map(t?f:n?r?l:f:c)}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=m,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){m(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(o==-1)return;var u=n||s.length,a=e.getLength(),f=t,l=t;while(++tf){var p=e.getLine(l).length;return new r(f,u,l,p)}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},u=e.$findClosingBracket(t,o,s);if(!u)return;var a=e.foldWidgets[u.row];return a==null&&(a=e.getFoldWidget(u.row)),a=="start"&&u.row>o.row&&(u.row--,u.column=e.getLine(u.row).length),r.fromPoints(o,u)},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},u=e.$findOpeningBracket(t,o);if(!u)return;return u.column++,o.column--,r.fromPoints(u,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./range").Range;(function(){this.getRowLength=function(e){var t;return this.lineWidgets?t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:t=0,!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach();if(this.editor==e)return;this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},this.detach=function(e){var t=this.editor;if(!t)return;this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(!n||!e.action)return;var r=e.data,i=r.start.row,s=r.end.row,o=e.action=="add";for(var u=i+1;u0&&!r[i])i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var u=r[o];if(!u||!u.el)continue;if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,t.container.appendChild(u.el));var a=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;u.coverLine||(a+=n.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=a-n.offset+"px";var f=u.coverGutter?0:t.gutterWidth;u.fixedWidth||(f-=t.scrollLeft),u.el.style.left=f+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=n.width+2*n.padding+"px"),u.fixedWidth?u.el.style.right=t.scrollBar.getWidth()+"px":u.el.style.right=""}}}).call(o.prototype),t.LineWidgets=o}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e,t,n){var r=0,i=e.length-1;while(r<=i){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}function u(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(!r.length)return;var i=o(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:i===0&&n<0&&(i=r.length-1);var u=r[i];if(!u||!n)return;if(u.row===t){do u=r[i+=n];while(u&&u.row===t);if(!u)return r.slice()}var a=[];t=u.row;do a[n<0?"unshift":"push"](u),u=r[i+=n];while(u&&u.row==t);return a.length&&a}var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),o=s.row,a=n.widgetManager.getWidgetsAtRow(o).filter(function(e){return e.type=="errorMarker"})[0];a?a.destroy():o-=t;var f=u(n,o,t),l;if(f){var c=f[0];s.column=(c.pos&&typeof c.column!="number"?c.pos.sc:c.column)||0,s.row=c.row,l=e.renderer.$gutterLayer.$annotations[s.row]}else{if(a)return;l={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var h={row:s.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},p=h.el.appendChild(i.createElement("div")),d=h.el.appendChild(i.createElement("div"));d.className="error_widget_arrow "+l.className;var v=e.renderer.$cursorLayer.getPixelPosition(s).left;d.style.left=v+e.renderer.gutterWidth-5+"px",h.el.className="error_widget_wrapper",p.className="error_widget "+l.className,p.innerHTML=l.text.join("
"),p.appendChild(i.createElement("div"));var m=function(e,t,n){if(t===0&&(n==="esc"||n==="return"))return h.destroy(),{command:"null"}};h.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(h),e.off("changeSelection",h.destroy),e.off("changeSession",h.destroy),e.off("mouseup",h.destroy),e.off("change",h.destroy)},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",h.destroy),e.on("changeSession",h.destroy),e.on("mouseup",h.destroy),e.on("change",h.destroy),e.session.widgetManager.addLineWidget(h),h.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var r=e("./lib/dom"),i=e("./lib/event"),s=e("./range").Range,o=e("./editor").Editor,u=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,f=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,typeof define=="function"&&(t.define=define),t.edit=function(e,n){if(typeof e=="string"){var s=e;e=document.getElementById(s);if(!e)throw new Error("ace.edit can't find div #"+s)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var u="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;u=a.value,e=r.createElement("pre"),a.parentNode.replaceChild(e,a)}else e&&(u=e.textContent,e.innerHTML="");var l=t.createEditSession(u),c=new o(new f(e),l,n),h={document:l,editor:c,onResize:c.resize.bind(c,null)};return a&&(h.textarea=a),i.addListener(window,"resize",h.onResize),c.on("destroy",function(){i.removeListener(window,"resize",h.onResize),h.editor.container.env=null}),c.container.env=c.env=h,c},t.createEditSession=function(e,t){var n=new u(e,t);return n.setUndoManager(new a),n},t.Range=s,t.Editor=o,t.EditSession=u,t.UndoManager=a,t.VirtualRenderer=f,t.version=t.config.version}); (function() { + ace.require(["ace/ace"], function(a) { + if (a) { + a.config.init(true); + a.define = ace.define; + } + if (!window.ace) + window.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + window.ace[key] = a[key]; + window.ace["default"] = window.ace; + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = window.ace; + } + }); + })(); + \ No newline at end of file diff --git a/html/blockly-games/third-party/ace/mode-javascript.js b/html/blockly-games/third-party/ace/mode-javascript.js new file mode 100644 index 0000000..68ba6a1 --- /dev/null +++ b/html/blockly-games/third-party/ace/mode-javascript.js @@ -0,0 +1,8 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+o+")(\\.)(prototype)(\\.)("+o+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:r},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/cstyle").CstyleBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(l.prototype),t.Mode=l}); (function() { + ace.require(["ace/mode/javascript"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/html/blockly-games/third-party/ace/theme-chrome.js b/html/blockly-games/third-party/ace/theme-chrome.js new file mode 100644 index 0000000..cabebe9 --- /dev/null +++ b/html/blockly-games/third-party/ace/theme-chrome.js @@ -0,0 +1,8 @@ +ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-chrome",t.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome {background-color: #FFFFFF;color: black;}.ace-chrome .ace_cursor {color: black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { + ace.require(["ace/theme/chrome"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/html/blockly-games/third-party/ace/worker-javascript.js b/html/blockly-games/third-party/ace/worker-javascript.js new file mode 100644 index 0000000..3e88229 --- /dev/null +++ b/html/blockly-games/third-party/ace/worker-javascript.js @@ -0,0 +1 @@ +"no use strict";!function(e){function t(e,t){var n=e,r="";while(n){var i=t[n];if(typeof i=="string")return i+r;if(i)return i.location.replace(/\/*$/,"/")+(r||i.main||i.name);if(i===!1)return"";var s=n.lastIndexOf("/");if(s===-1)break;r=n.substr(s)+r,n=n.slice(0,s)}return e}if(typeof e.window!="undefined"&&e.document)return;if(e.require&&e.define)return;e.console||(e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console),e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,data:i.data,file:t,line:n,col:r,stack:i.stack}})},e.normalizeModule=function(t,n){if(n.indexOf("!")!==-1){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if(n.charAt(0)=="."){var i=t.split("/").slice(0,-1).join("/");n=(i?i+"/":"")+n;while(n.indexOf(".")!==-1&&s!=n){var s=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(r,i){i||(i=r,r=null);if(!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=e.normalizeModule(r,i);var s=e.require.modules[i];if(s)return s.initialized||(s.initialized=!0,s.exports=s.factory().exports),s.exports;if(!e.require.tlns)return console.log("unable to load "+i);var o=t(i,e.require.tlns);return o.slice(-3)!=".js"&&(o+=".js"),e.require.id=i,e.require.modules[i]={},importScripts(o),e.require(r,i)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){arguments.length==2?(r=n,typeof t!="string"&&(n=t,t=e.require.id)):arguments.length==1&&(r=t,n=[],t=e.require.id);if(typeof r!="function"){e.require.modules[t]={exports:r,initialized:!0};return}n.length||(n=["require","exports","module"]);var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.slice(0,r.length).map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}},e.define.amd={},require.tlns={},e.initBaseUrls=function(t){for(var n in t)require.tlns[n]=t[n]},e.initSender=function(){var n=e.require("ace/lib/event_emitter").EventEmitter,r=e.require("ace/lib/oop"),i=function(){};return function(){r.implement(this,n),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(i.prototype),new i};var n=e.main=null,r=e.sender=null;e.onmessage=function(t){var i=t.data;if(i.event&&r)r._signal(i.event,i.data);else if(i.command)if(n[i.command])n[i.command].apply(n,i.args);else{if(!e[i.command])throw new Error("Unknown command:"+i.command);e[i.command].apply(e,i.args)}else if(i.init){e.initBaseUrls(i.tlns),require("ace/lib/es5-shim"),r=e.sender=e.initSender();var s=require(i.module)[i.classname];n=e.main=new s(r)}}}(this),ace.define("ace/lib/oop",[],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/range",[],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),ace.define("ace/lib/event_emitter",[],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;othis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$splitAndapplyLargeDelta=function(e,t){var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column;for(var o=0,u=0;o0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,s,u;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;n=this._events[e],s=n.length,r=-1;if(n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(u=s;u-->0;)if(n[u]===t||n[u].listener&&n[u].listener===t){r=u;break}if(r<0)return this;n.length===1?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}return this.removeAllListeners("removeListener"),this._events={},this}n=this._events[e];if(i(n))this.removeListener(e,n);else while(n.length)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return!this._events||!this._events[e]?t=[]:i(this._events[e])?t=[this._events[e]]:t=this._events[e].slice(),t},r.listenerCount=function(e,t){var n;return!e._events||!e._events[t]?n=0:i(e._events[t])?n=1:n=e._events[t].length,n}},{}],"/node_modules/jshint/data/ascii-identifier-data.js":[function(e,t,n){var r=[];for(var i=0;i<128;i++)r[i]=i===36||i>=65&&i<=90||i===95||i>=97&&i<=122;var s=[];for(var i=0;i<128;i++)s[i]=r[i]||i>=48&&i<=57;t.exports={asciiIdentifierStartTable:r,asciiIdentifierPartTable:s}},{}],"/node_modules/jshint/lodash.js":[function(e,t,n){(function(e){(function(){function $(e,t,n){var r=e.length,i=n?r:-1;while(n?i--:++ir&&(r=i)}return r}function Dt(e,t){var n=-1,r=e.length;while(++ns?0:s+t),n=n===r||n>s?s:+n||0,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;var o=Array(s);while(++i>>1,o=e[s];(n?o<=t:o2&&n[i-2],o=i>2&&n[2],u=i>1&&n[i-1];typeof s=="function"?(s=on(s,u,5),i-=2):(s=typeof u=="function"?u:null,i-=s?1:0),o&&Tn(n[0],n[1],o)&&(s=i<3?null:s,i=1);while(++rf))return!1;while(c&&++a-1&&e%1==0&&e-1&&e%1==0&&e<=Nt}function kn(e){return e===e&&(e===0?1/e>0:!Jn(e))}function Ln(e){var t,n=Ct.support;if(!Y(e)||rt.call(e)!=d||!nt.call(e,"constructor")&&(t=e.constructor,typeof t=="function"&&!(t instanceof t)))return!1;var i;return Ut(e,function(e,t){i=t}),i===r||nt.call(e,i)}function An(e){var t=ir(e),n=t.length,r=n&&e.length,i=Ct.support,s=r&&Cn(r)&&(Xn(e)||i.nonEnumArgs&&Wn(e)),o=-1,u=[];while(++o>>0,r=Array(n);while(++t-1:gn(e,t,n)>-1):!1}function qn(e,t,n){var r=Xn(e)?Ot:qt;return t=mn(t,n,3),r(e,function(e,n,r){return!t(e,n,r)})}function Rn(e,t,n){var i=Xn(e)?Dt:tn;n&&Tn(e,t,n)&&(t=null);if(typeof t!="function"||n!==r)t=mn(t,n,3);return i(e,t)}function Un(e,t){if(typeof e!="function")throw new TypeError(s);return t=yt(t===r?e.length-1:+t||0,0),function(){var n=arguments,r=-1,i=yt(n.length-t,0),s=Array(i);while(++r0;while(++r>>1,Tt=dt?dt.BYTES_PER_ELEMENT:0,Nt=Math.pow(2,53)-1,kt=Ct.support={};(function(e){var t=function(){this.x=e},n={0:e,length:e},r=[];t.prototype={valueOf:e,y:e};for(var i in new t)r.push(i);kt.funcDecomp=/\bthis\b/.test(function(){return this}),kt.funcNames=typeof Function.name=="string";try{kt.nonEnumArgs=!ht.call(arguments,1)}catch(s){kt.nonEnumArgs=!0}})(1,0);var Ht=vt||function(e,t){return t==null?e:Bt(t,bn(t),Bt(t,rr(t),e))},It=fn(zt),Rt=ln();ot||(un=!st||!pt?fr(null):function(e){var t=e.byteLength,n=dt?ut(t/Tt):0,r=n*Tt,i=new st(t);if(n){var s=new dt(i,0,n);s.set(new dt(e,0,n))}return t!=r&&(s=new pt(i,r),s.set(new pt(e,r))),i});var yn=Yt("length"),bn=at?function(e){return at(On(e))}:fr([]),_n=cn(!0),jn=Un(Bn),Fn=hn(At,It),Xn=mt||function(e){return Y(e)&&Cn(e.length)&&rt.call(e)==u},$n=K(/x/)||pt&&!K(pt)?function(e){return rt.call(e)==c}:K,Gn=ft?function(e){if(!e||rt.call(e)!=d)return!1;var t=e.valueOf,n=Kn(t)&&(n=ft(t))&&ft(n);return n?e==n||ft(e)==n:Ln(e)}:Ln,tr=an(function(e,t,n){return n?Pt(e,t,n):Ht(e,t)}),rr=gt?function(e){if(e)var t=e.constructor,n=e.length;return typeof t=="function"&&t.prototype===e||typeof e!="function"&&Cn(n)?An(e):Jn(e)?gt(e):[]}:An,sr=an(Qt);Ct.assign=tr,Ct.callback=ar,Ct.constant=fr,Ct.forEach=Fn,Ct.keys=rr,Ct.keysIn=ir,Ct.merge=sr,Ct.property=cr,Ct.reject=qn,Ct.restParam=Un,Ct.slice=Hn,Ct.toPlainObject=er,Ct.unzip=Bn,Ct.values=or,Ct.zip=jn,Ct.each=Fn,Ct.extend=tr,Ct.iteratee=ar,Ct.clone=zn,Ct.escapeRegExp=ur,Ct.findLastIndex=_n,Ct.has=nr,Ct.identity=lr,Ct.includes=In,Ct.indexOf=Dn,Ct.isArguments=Wn,Ct.isArray=Xn,Ct.isEmpty=Vn,Ct.isFunction=$n,Ct.isNative=Kn,Ct.isNumber=Qn,Ct.isObject=Jn,Ct.isPlainObject=Gn,Ct.isString=Yn,Ct.isTypedArray=Zn,Ct.last=Pn,Ct.some=Rn,Ct.any=Rn,Ct.contains=In,Ct.include=In,Ct.VERSION=i,q&&R?X?(R.exports=Ct)._=Ct:q._=Ct:V._=Ct}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],"/node_modules/jshint/src/jshint.js":[function(e,t,n){var r=e("../lodash"),i=e("events"),s=e("./vars.js"),o=e("./messages.js"),u=e("./lex.js").Lexer,a=e("./reg.js"),f=e("./state.js").state,l=e("./style.js"),c=e("./options.js"),h=e("./scope-manager.js"),p=function(){"use strict";function k(e,t){return e=e.trim(),/^[+-]W\d{3}$/g.test(e)?!0:c.validNames.indexOf(e)===-1&&t.type!=="jslint"&&!r.has(c.removed,e)?(q("E001",t,e),!1):!0}function L(e){return Object.prototype.toString.call(e)==="[object String]"}function A(e,t){return e?!e.identifier||e.value!==t?!1:!0:!1}function O(e){if(!e.reserved)return!1;var t=e.meta;if(t&&t.isFutureReservedWord&&f.inES5()){if(!t.es5)return!1;if(t.strictOnly&&!f.option.strict&&!f.isStrict())return!1;if(e.isProperty)return!1}return!0}function M(e,t){return e.replace(/\{([^{}]*)\}/g,function(e,n){var r=t[n];return typeof r=="string"||typeof r=="number"?r:e})}function D(e,t){Object.keys(t).forEach(function(n){if(r.has(p.blacklist,n))return;e[n]=t[n]})}function P(){if(f.option.enforceall){for(var e in c.bool.enforcing)f.option[e]===undefined&&!c.noenforceall[e]&&(f.option[e]=!0);for(var t in c.bool.relaxing)f.option[t]===undefined&&(f.option[t]=!1)}}function H(){P(),!f.option.esversion&&!f.option.moz&&(f.option.es3?f.option.esversion=3:f.option.esnext?f.option.esversion=6:f.option.esversion=5),f.inES5()&&D(S,s.ecmaIdentifiers[5]),f.inES6()&&D(S,s.ecmaIdentifiers[6]),f.option.module&&(f.option.strict===!0&&(f.option.strict="global"),f.inES6()||F("W134",f.tokens.next,"module",6)),f.option.couch&&D(S,s.couch),f.option.qunit&&D(S,s.qunit),f.option.rhino&&D(S,s.rhino),f.option.shelljs&&(D(S,s.shelljs),D(S,s.node)),f.option.typed&&D(S,s.typed),f.option.phantom&&(D(S,s.phantom),f.option.strict===!0&&(f.option.strict="global")),f.option.prototypejs&&D(S,s.prototypejs),f.option.node&&(D(S,s.node),D(S,s.typed),f.option.strict===!0&&(f.option.strict="global")),f.option.devel&&D(S,s.devel),f.option.dojo&&D(S,s.dojo),f.option.browser&&(D(S,s.browser),D(S,s.typed)),f.option.browserify&&(D(S,s.browser),D(S,s.typed),D(S,s.browserify),f.option.strict===!0&&(f.option.strict="global")),f.option.nonstandard&&D(S,s.nonstandard),f.option.jasmine&&D(S,s.jasmine),f.option.jquery&&D(S,s.jquery),f.option.mootools&&D(S,s.mootools),f.option.worker&&D(S,s.worker),f.option.wsh&&D(S,s.wsh),f.option.globalstrict&&f.option.strict!==!1&&(f.option.strict="global"),f.option.yui&&D(S,s.yui),f.option.mocha&&D(S,s.mocha)}function B(e,t,n){var r=Math.floor(t/f.lines.length*100),i=o.errors[e].desc;throw{name:"JSHintError",line:t,character:n,message:i+" ("+r+"% scanned).",raw:i,code:e}}function j(){var e=f.ignoredLines;if(r.isEmpty(e))return;p.errors=r.reject(p.errors,function(t){return e[t.line]})}function F(e,t,n,r,i,s){var u,a,l,c;if(/^W\d{3}$/.test(e)){if(f.ignored[e])return;c=o.warnings[e]}else/E\d{3}/.test(e)?c=o.errors[e]:/I\d{3}/.test(e)&&(c=o.info[e]);return t=t||f.tokens.next||{},t.id==="(end)"&&(t=f.tokens.curr),a=t.line||0,u=t.from||0,l={id:"(error)",raw:c.desc,code:c.code,evidence:f.lines[a-1]||"",line:a,character:u,scope:p.scope,a:n,b:r,c:i,d:s},l.reason=M(c.desc,l),p.errors.push(l),j(),p.errors.length>=f.option.maxerr&&B("E043",a,u),l}function I(e,t,n,r,i,s,o){return F(e,{line:t,from:n},r,i,s,o)}function q(e,t,n,r,i,s){F(e,t,n,r,i,s)}function R(e,t,n,r,i,s,o){return q(e,{line:t,from:n},r,i,s,o)}function U(e,t){var n;return n={id:"(internal)",elem:e,value:t},p.internals.push(n),n}function z(){var e=f.tokens.next,t=e.body.match(/(-\s+)?[^\s,:]+(?:\s*:\s*(-\s+)?[^\s,]+)?/g)||[],i={};if(e.type==="globals"){t.forEach(function(n,r){n=n.split(":");var s=(n[0]||"").trim(),o=(n[1]||"").trim();if(s==="-"||!s.length){if(r>0&&r===t.length-1)return;q("E002",e);return}s.charAt(0)==="-"?(s=s.slice(1),o=!1,p.blacklist[s]=s,delete S[s]):i[s]=o==="true"}),D(S,i);for(var s in i)r.has(i,s)&&(n[s]=e)}e.type==="exported"&&t.forEach(function(n,r){if(!n.length){if(r>0&&r===t.length-1)return;q("E002",e);return}f.funct["(scope)"].addExported(n)}),e.type==="members"&&(E=E||{},t.forEach(function(e){var t=e.charAt(0),n=e.charAt(e.length-1);t===n&&(t==='"'||t==="'")&&(e=e.substr(1,e.length-2).replace('\\"','"')),E[e]=!1}));var o=["maxstatements","maxparams","maxdepth","maxcomplexity","maxerr","maxlen","indent"];if(e.type==="jshint"||e.type==="jslint")t.forEach(function(t){t=t.split(":");var n=(t[0]||"").trim(),i=(t[1]||"").trim();if(!k(n,e))return;if(o.indexOf(n)>=0){if(i!=="false"){i=+i;if(typeof i!="number"||!isFinite(i)||i<=0||Math.floor(i)!==i){q("E032",e,t[1].trim());return}f.option[n]=i}else f.option[n]=n==="indent"?4:!1;return}if(n==="validthis"){if(f.funct["(global)"])return void q("E009");if(i!=="true"&&i!=="false")return void q("E002",e);f.option.validthis=i==="true";return}if(n==="quotmark"){switch(i){case"true":case"false":f.option.quotmark=i==="true";break;case"double":case"single":f.option.quotmark=i;break;default:q("E002",e)}return}if(n==="shadow"){switch(i){case"true":f.option.shadow=!0;break;case"outer":f.option.shadow="outer";break;case"false":case"inner":f.option.shadow="inner";break;default:q("E002",e)}return}if(n==="unused"){switch(i){case"true":f.option.unused=!0;break;case"false":f.option.unused=!1;break;case"vars":case"strict":f.option.unused=i;break;default:q("E002",e)}return}if(n==="latedef"){switch(i){case"true":f.option.latedef=!0;break;case"false":f.option.latedef=!1;break;case"nofunc":f.option.latedef="nofunc";break;default:q("E002",e)}return}if(n==="ignore"){switch(i){case"line":f.ignoredLines[e.line]=!0,j();break;default:q("E002",e)}return}if(n==="strict"){switch(i){case"true":f.option.strict=!0;break;case"false":f.option.strict=!1;break;case"func":case"global":case"implied":f.option.strict=i;break;default:q("E002",e)}return}n==="module"&&(zt(f.funct)||q("E055",f.tokens.next,"module"));var s={es3:3,es5:5,esnext:6};if(r.has(s,n)){switch(i){case"true":f.option.moz=!1,f.option.esversion=s[n];break;case"false":f.option.moz||(f.option.esversion=5);break;default:q("E002",e)}return}if(n==="esversion"){switch(i){case"5":f.inES5(!0)&&F("I003");case"3":case"6":f.option.moz=!1,f.option.esversion=+i;break;case"2015":f.option.moz=!1,f.option.esversion=6;break;default:q("E002",e)}zt(f.funct)||q("E055",f.tokens.next,"esversion");return}var u=/^([+-])(W\d{3})$/g.exec(n);if(u){f.ignored[u[2]]=u[1]==="-";return}var a;if(i==="true"||i==="false"){e.type==="jslint"?(a=c.renamed[n]||n,f.option[a]=i==="true",c.inverted[a]!==undefined&&(f.option[a]=!f.option[a])):f.option[n]=i==="true",n==="newcap"&&(f.option["(explicitNewcap)"]=!0);return}q("E002",e)}),H()}function W(e){var t=e||0,n=y.length,r;if(t="a"&&t<="z"||t>="A"&&t<="Z")e.identifier=e.reserved=!0;return e}function ut(e,t){var n=nt(e,150);return ot(n),n.nud=typeof t=="function"?t:function(){this.arity="unary",this.right=Q(150);if(this.id==="++"||this.id==="--")f.option.plusplus?F("W016",this,this.id):this.right&&(!this.right.identifier||O(this.right))&&this.right.id!=="."&&this.right.id!=="["&&F("W017",this),this.right&&this.right.isMetaProperty?q("E031",this):this.right&&this.right.identifier&&f.funct["(scope)"].block.modify(this.right.value,this);return this},n}function at(e,t){var n=rt(e);return n.type=e,n.nud=t,n}function ft(e,t){var n=at(e,t);return n.identifier=!0,n.reserved=!0,n}function lt(e,t){var n=at(e,t&&t.nud||function(){return this});return t=t||{},t.isFutureReservedWord=!0,n.value=e,n.identifier=!0,n.reserved=!0,n.meta=t,n}function ct(e,t){return ft(e,function(){return typeof t=="function"&&t(this),this})}function ht(e,t,n,r){var i=nt(e,n);return ot(i),i.infix=!0,i.led=function(i){return r||Y(f.tokens.prev,f.tokens.curr),(e==="in"||e==="instanceof")&&i.id==="!"&&F("W018",i,"!"),typeof t=="function"?t(i,this):(this.left=i,this.right=Q(n),this)},i}function pt(e){var t=nt(e,42);return t.led=function(e){return Y(f.tokens.prev,f.tokens.curr),this.left=e,this.right=Xt({type:"arrow",loneArg:e}),this},t}function dt(e,t){var n=nt(e,100);return n.led=function(e){Y(f.tokens.prev,f.tokens.curr),this.left=e;var n=this.right=Q(100);return A(e,"NaN")||A(n,"NaN")?F("W019",this):t&&t.apply(this,[e,n]),(!e||!n)&&B("E041",f.tokens.curr.line),e.id==="!"&&F("W018",e,"!"),n.id==="!"&&F("W018",n,"!"),this},n}function vt(e){return e&&(e.type==="(number)"&&+e.value===0||e.type==="(string)"&&e.value===""||e.type==="null"&&!f.option.eqnull||e.type==="true"||e.type==="false"||e.type==="undefined")}function gt(e,t,n){var i;return n.option.notypeof?!1:!e||!t?!1:(i=n.inES6()?mt.es6:mt.es3,t.type==="(identifier)"&&t.value==="typeof"&&e.type==="(string)"?!r.contains(i,e.value):!1)}function yt(e,t){var n=!1;return e.type==="this"&&t.funct["(context)"]===null?n=!0:e.type==="(identifier)"&&(t.option.node&&e.value==="global"?n=!0:t.option.browser&&(e.value==="window"||e.value==="document")&&(n=!0)),n}function bt(e){function n(e){if(typeof e!="object")return;return e.right==="prototype"?e:n(e.left)}function r(e){while(!e.identifier&&typeof e.left=="object")e=e.left;if(e.identifier&&t.indexOf(e.value)>=0)return e.value}var t=["Array","ArrayBuffer","Boolean","Collator","DataView","Date","DateTimeFormat","Error","EvalError","Float32Array","Float64Array","Function","Infinity","Intl","Int16Array","Int32Array","Int8Array","Iterator","Number","NumberFormat","Object","RangeError","ReferenceError","RegExp","StopIteration","String","SyntaxError","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError"],i=n(e);if(i)return r(i)}function wt(e,t,n){var r=n&&n.allowDestructuring;t=t||e;if(f.option.freeze){var i=bt(e);i&&F("W121",e,i)}return e.identifier&&!e.isMetaProperty&&f.funct["(scope)"].block.reassign(e.value,e),e.id==="."?((!e.left||e.left.value==="arguments"&&!f.isStrict())&&F("E031",t),f.nameStack.set(f.tokens.prev),!0):e.id==="{"||e.id==="["?(r&&f.tokens.curr.left.destructAssign?f.tokens.curr.left.destructAssign.forEach(function(e){e.id&&f.funct["(scope)"].block.modify(e.id,e.token)}):e.id==="{"||!e.left?F("E031",t):e.left.value==="arguments"&&!f.isStrict()&&F("E031",t),e.id==="["&&f.nameStack.set(e.right),!0):e.isMetaProperty?(q("E031",t),!0):e.identifier&&!O(e)?(f.funct["(scope)"].labeltype(e.value)==="exception"&&F("W022",e),f.nameStack.set(e),!0):(e===f.syntax["function"]&&F("W023",f.tokens.curr),!1)}function Et(e,t,n){var r=ht(e,typeof t=="function"?t:function(e,t){t.left=e;if(e&&wt(e,t,{allowDestructuring:!0}))return t.right=Q(10),t;q("E031",t)},n);return r.exps=!0,r.assign=!0,r}function St(e,t,n){var r=nt(e,n);return ot(r),r.led=typeof t=="function"?t:function(e){return f.option.bitwise&&F("W016",this,this.id),this.left=e,this.right=Q(n),this},r}function xt(e){return Et(e,function(e,t){f.option.bitwise&&F("W016",t,t.id);if(e&&wt(e,t))return t.right=Q(10),t;q("E031",t)},20)}function Tt(e){var t=nt(e,150);return t.led=function(e){return f.option.plusplus?F("W016",this,this.id):(!e.identifier||O(e))&&e.id!=="."&&e.id!=="["&&F("W017",this),e.isMetaProperty?q("E031",this):e&&e.identifier&&f.funct["(scope)"].block.modify(e.value,e),this.left=e,this},t}function Nt(e,t,n){if(!f.tokens.next.identifier)return;n||V();var r=f.tokens.curr,i=f.tokens.curr.value;return O(r)?t&&f.inES5()?i:e&&i==="undefined"?i:(F("W024",f.tokens.curr,f.tokens.curr.id),i):i}function Ct(e,t){var n=Nt(e,t,!1);if(n)return n;if(f.tokens.next.value==="..."){f.inES6(!0)||F("W119",f.tokens.next,"spread/rest operator","6"),V();if(pn(f.tokens.next,"...")){F("E024",f.tokens.next,"...");while(pn(f.tokens.next,"..."))V()}if(!f.tokens.next.identifier){F("E024",f.tokens.curr,"...");return}return Ct(e,t)}q("E030",f.tokens.next,f.tokens.next.value),f.tokens.next.id!==";"&&V()}function kt(e){var t=0,n;if(f.tokens.next.id!==";"||e.inBracelessBlock)return;for(;;){do n=W(t),t+=1;while(n.id!=="(end)"&&n.id==="(comment)");if(n.reach)return;if(n.id!=="(endline)"){if(n.id==="function"){f.option.latedef===!0&&F("W026",n);break}F("W027",n,n.value,e.value);break}}}function Lt(){if(f.tokens.next.id!==";"){if(f.tokens.next.isUnclosed)return V();var e=G(f.tokens.next)===f.tokens.curr.line&&f.tokens.next.id!=="(end)",t=pn(f.tokens.next,"}");e&&!t?R("E058",f.tokens.curr.line,f.tokens.curr.character):f.option.asi||(t&&!f.option.lastsemic||!e)&&I("W033",f.tokens.curr.line,f.tokens.curr.character)}else V(";")}function At(){var e=g,t,n=f.tokens.next,r=!1;if(n.id===";"){V(";");return}var i=O(n);i&&n.meta&&n.meta.isFutureReservedWord&&W().id===":"&&(F("W024",n,n.id),i=!1),n.identifier&&!i&&W().id===":"&&(V(),V(":"),r=!0,f.funct["(scope)"].stack(),f.funct["(scope)"].block.addBreakLabel(n.value,{token:f.tokens.curr}),!f.tokens.next.labelled&&f.tokens.next.value!=="{"&&F("W028",f.tokens.next,n.value,f.tokens.next.value),f.tokens.next.label=n.value,n=f.tokens.next);if(n.id==="{"){var s=f.funct["(verb)"]==="case"&&f.tokens.curr.value===":";_t(!0,!0,!1,!1,s);return}return t=Q(0,!0),t&&(!t.identifier||t.value!=="function")&&(t.type!=="(punctuator)"||!t.left||!t.left.identifier||t.left.value!=="function")&&!f.isStrict()&&f.option.strict==="global"&&F("E007"),n.block||(!f.option.expr&&(!t||!t.exps)?F("W030",f.tokens.curr):f.option.nonew&&t&&t.left&&t.id==="("&&t.left.id==="new"&&F("W031",n),Lt()),g=e,r&&f.funct["(scope)"].unstack(),t}function Ot(){var e=[],t;while(!f.tokens.next.reach&&f.tokens.next.id!=="(end)")f.tokens.next.id===";"?(t=W(),(!t||t.id!=="("&&t.id!=="[")&&F("W032"),V(";")):e.push(At());return e}function Mt(){var e,t,n;while(f.tokens.next.id==="(string)"){t=W(0);if(t.id==="(endline)"){e=1;do n=W(e++);while(n.id==="(endline)");if(n.id===";")t=n;else{if(n.value==="["||n.value===".")break;(!f.option.asi||n.value==="(")&&F("W033",f.tokens.next)}}else{if(t.id==="."||t.id==="[")break;t.id!==";"&&F("W033",t)}V();var r=f.tokens.curr.value;(f.directive[r]||r==="use strict"&&f.option.strict==="implied")&&F("W034",f.tokens.curr,r),f.directive[r]=!0,t.id===";"&&V(";")}f.isStrict()&&(f.option["(explicitNewcap)"]||(f.option.newcap=!0),f.option.undef=!0)}function _t(e,t,n,i,s){var o,u=m,a=g,l,c,h,p;m=e,c=f.tokens.next;var d=f.funct["(metrics)"];d.nestedBlockDepth+=1,d.verifyMaxNestedBlockDepthPerFunction();if(f.tokens.next.id==="{"){V("{"),f.funct["(scope)"].stack(),h=f.tokens.curr.line;if(f.tokens.next.id!=="}"){g+=f.option.indent;while(!e&&f.tokens.next.from>g)g+=f.option.indent;if(n){l={};for(p in f.directive)r.has(f.directive,p)&&(l[p]=f.directive[p]);Mt(),f.option.strict&&f.funct["(context)"]["(global)"]&&!l["use strict"]&&!f.isStrict()&&F("E007")}o=Ot(),d.statementCount+=o.length,g-=f.option.indent}V("}",c),n&&(f.funct["(scope)"].validateParams(),l&&(f.directive=l)),f.funct["(scope)"].unstack(),g=a}else if(!e)if(n){f.funct["(scope)"].stack(),l={},t&&!i&&!f.inMoz()&&q("W118",f.tokens.curr,"function closure expressions");if(!t)for(p in f.directive)r.has(f.directive,p)&&(l[p]=f.directive[p]);Q(10),f.option.strict&&f.funct["(context)"]["(global)"]&&!l["use strict"]&&!f.isStrict()&&F("E007"),f.funct["(scope)"].unstack()}else q("E021",f.tokens.next,"{",f.tokens.next.value);else f.funct["(noblockscopedvar)"]=f.tokens.next.id!=="for",f.funct["(scope)"].stack(),(!t||f.option.curly)&&F("W116",f.tokens.next,"{",f.tokens.next.value),f.tokens.next.inBracelessBlock=!0,g+=f.option.indent,o=[At()],g-=f.option.indent,f.funct["(scope)"].unstack(),delete f.funct["(noblockscopedvar)"];switch(f.funct["(verb)"]){case"break":case"continue":case"return":case"throw":if(s)break;default:f.funct["(verb)"]=null}return m=u,e&&f.option.noempty&&(!o||o.length===0)&&F("W035",f.tokens.prev),d.nestedBlockDepth-=1,o}function Dt(e){E&&typeof E[e]!="boolean"&&F("W036",f.tokens.curr,e),typeof w[e]=="number"?w[e]+=1:w[e]=1}function Bt(){var e={};e.exps=!0,f.funct["(comparray)"].stack();var t=!1;return f.tokens.next.value!=="for"&&(t=!0,f.inMoz()||F("W116",f.tokens.next,"for",f.tokens.next.value),f.funct["(comparray)"].setState("use"),e.right=Q(10)),V("for"),f.tokens.next.value==="each"&&(V("each"),f.inMoz()||F("W118",f.tokens.curr,"for each")),V("("),f.funct["(comparray)"].setState("define"),e.left=Q(130),r.contains(["in","of"],f.tokens.next.value)?V():q("E045",f.tokens.curr),f.funct["(comparray)"].setState("generate"),Q(10),V(")"),f.tokens.next.value==="if"&&(V("if"),V("("),f.funct["(comparray)"].setState("filter"),e.filter=Q(10),V(")")),t||(f.funct["(comparray)"].setState("use"),e.right=Q(10)),V("]"),f.funct["(comparray)"].unstack(),e}function jt(){return f.funct["(statement)"]&&f.funct["(statement)"].type==="class"||f.funct["(context)"]&&f.funct["(context)"]["(verb)"]==="class"}function Ft(e){return e.identifier||e.id==="(string)"||e.id==="(number)"}function It(e){var t,n=!0;return typeof e=="object"?t=e:(n=e,t=Nt(!1,!0,n)),t?typeof t=="object"&&(t.id==="(string)"||t.id==="(identifier)"?t=t.value:t.id==="(number)"&&(t=t.value.toString())):f.tokens.next.id==="(string)"?(t=f.tokens.next.value,n||V()):f.tokens.next.id==="(number)"&&(t=f.tokens.next.value.toString(),n||V()),t==="hasOwnProperty"&&F("W001"),t}function qt(e){function h(e){f.funct["(scope)"].addParam.apply(f.funct["(scope)"],e)}var t,n=[],i,s=[],o,u=!1,a=!1,l=0,c=e&&e.loneArg;if(c&&c.identifier===!0)return f.funct["(scope)"].addParam(c.value,c),{arity:1,params:[c.value]};t=f.tokens.next,(!e||!e.parsedOpening)&&V("(");if(f.tokens.next.id===")"){V(")");return}for(;;){l++;var p=[];if(r.contains(["{","["],f.tokens.next.id)){s=Gt();for(o in s)o=s[o],o.id&&(n.push(o.id),p.push([o.id,o.token]))}else{pn(f.tokens.next,"...")&&(a=!0),i=Ct(!0);if(i)n.push(i),p.push([i,f.tokens.curr]);else while(!hn(f.tokens.next,[",",")"]))V()}u&&f.tokens.next.id!=="="&&q("W138",f.tokens.current),f.tokens.next.id==="="&&(f.inES6()||F("W119",f.tokens.next,"default parameters","6"),V("="),u=!0,Q(10)),p.forEach(h);if(f.tokens.next.id!==",")return V(")",t),{arity:l,params:n};a&&F("W131",f.tokens.next),tt()}}function Rt(e,t,n){var i={"(name)":e,"(breakage)":0,"(loopage)":0,"(tokens)":{},"(properties)":{},"(catch)":!1,"(global)":!1,"(line)":null,"(character)":null,"(metrics)":null,"(statement)":null,"(context)":null,"(scope)":null,"(comparray)":null,"(generator)":null,"(arrow)":null,"(params)":null};return t&&r.extend(i,{"(line)":t.line,"(character)":t.character,"(metrics)":Vt(t)}),r.extend(i,n),i["(context)"]&&(i["(scope)"]=i["(context)"]["(scope)"],i["(comparray)"]=i["(context)"]["(comparray)"]),i}function Ut(e){return"(scope)"in e}function zt(e){return e["(global)"]&&!e["(verb)"]}function Wt(e){function i(){if(f.tokens.curr.template&&f.tokens.curr.tail&&f.tokens.curr.context===t)return!0;var e=f.tokens.next.template&&f.tokens.next.tail&&f.tokens.next.context===t;return e&&V(),e||f.tokens.next.isUnclosed}var t=this.context,n=this.noSubst,r=this.depth;if(!n)while(!i())!f.tokens.next.template||f.tokens.next.depth>r?Q(0):V();return{id:"(template)",type:"(template)",tag:e}}function Xt(e){var t,n,r,i,s,o,u,a,l=f.option,c=f.ignored;e&&(r=e.name,i=e.statement,s=e.classExprBinding,o=e.type==="generator",u=e.type==="arrow",a=e.ignoreLoopFunc),f.option=Object.create(f.option),f.ignored=Object.create(f.ignored),f.funct=Rt(r||f.nameStack.infer(),f.tokens.next,{"(statement)":i,"(context)":f.funct,"(arrow)":u,"(generator)":o}),t=f.funct,n=f.tokens.curr,n.funct=f.funct,v.push(f.funct),f.funct["(scope)"].stack("functionouter");var h=r||s;h&&f.funct["(scope)"].block.add(h,s?"class":"function",f.tokens.curr,!1),f.funct["(scope)"].stack("functionparams");var p=qt(e);return p?(f.funct["(params)"]=p.params,f.funct["(metrics)"].arity=p.arity,f.funct["(metrics)"].verifyMaxParametersPerFunction()):f.funct["(metrics)"].arity=0,u&&(f.inES6(!0)||F("W119",f.tokens.curr,"arrow function syntax (=>)","6"),e.loneArg||V("=>")),_t(!1,!0,!0,u),!f.option.noyield&&o&&f.funct["(generator)"]!=="yielded"&&F("W124",f.tokens.curr),f.funct["(metrics)"].verifyMaxStatementsPerFunction(),f.funct["(metrics)"].verifyMaxComplexityPerFunction(),f.funct["(unusedOption)"]=f.option.unused,f.option=l,f.ignored=c,f.funct["(last)"]=f.tokens.curr.line,f.funct["(lastcharacter)"]=f.tokens.curr.character,f.funct["(scope)"].unstack(),f.funct["(scope)"].unstack(),f.funct=f.funct["(context)"],!a&&!f.option.loopfunc&&f.funct["(loopage)"]&&t["(isCapturing)"]&&F("W083",n),t}function Vt(e){return{statementCount:0,nestedBlockDepth:-1,ComplexityCount:1,arity:0,verifyMaxStatementsPerFunction:function(){f.option.maxstatements&&this.statementCount>f.option.maxstatements&&F("W071",e,this.statementCount)},verifyMaxParametersPerFunction:function(){r.isNumber(f.option.maxparams)&&this.arity>f.option.maxparams&&F("W072",e,this.arity)},verifyMaxNestedBlockDepthPerFunction:function(){f.option.maxdepth&&this.nestedBlockDepth>0&&this.nestedBlockDepth===f.option.maxdepth+1&&F("W073",null,this.nestedBlockDepth)},verifyMaxComplexityPerFunction:function(){var t=f.option.maxcomplexity,n=this.ComplexityCount;t&&n>t&&F("W074",e,n)}}}function $t(){f.funct["(metrics)"].ComplexityCount+=1}function Jt(e){var t,n;e&&(t=e.id,n=e.paren,t===","&&(e=e.exprs[e.exprs.length-1])&&(t=e.id,n=n||e.paren));switch(t){case"=":case"+=":case"-=":case"*=":case"%=":case"&=":case"|=":case"^=":case"/=":!n&&!f.option.boss&&F("W084")}}function Kt(e){if(f.inES5())for(var t in e)e[t]&&e[t].setterToken&&!e[t].getterToken&&F("W078",e[t].setterToken)}function Qt(e,t){if(pn(f.tokens.next,".")){var n=f.tokens.curr.id;V(".");var r=Ct();return f.tokens.curr.isMetaProperty=!0,e!==r?q("E057",f.tokens.prev,n,r):t(),f.tokens.curr}}function Gt(e){var t=e&&e.assignment;return f.inES6()||F("W104",f.tokens.curr,t?"destructuring assignment":"destructuring binding","6"),Yt(e)}function Yt(e){var t,n=[],r=e&&e.openingParsed,i=e&&e.assignment,s=i?{assignment:i}:null,o=r?f.tokens.curr:f.tokens.next,u=function(){var e;if(hn(f.tokens.next,["[","{"])){t=Yt(s);for(var r in t)r=t[r],n.push({id:r.id,token:r.token})}else if(pn(f.tokens.next,","))n.push({id:null,token:f.tokens.curr});else{if(!pn(f.tokens.next,"(")){var o=pn(f.tokens.next,"...");if(i){var a=o?W(0):f.tokens.next;a.identifier||F("E030",a,a.value);var l=Q(155);l&&(wt(l),l.identifier&&(e=l.value))}else e=Ct();return e&&n.push({id:e,token:f.tokens.curr}),o}V("("),u(),V(")")}return!1},a=function(){var e;pn(f.tokens.next,"[")?(V("["),Q(10),V("]"),V(":"),u()):f.tokens.next.id==="(string)"||f.tokens.next.id==="(number)"?(V(),V(":"),u()):(e=Ct(),pn(f.tokens.next,":")?(V(":"),u()):e&&(i&&wt(f.tokens.curr),n.push({id:e,token:f.tokens.curr})))};if(pn(o,"[")){r||V("["),pn(f.tokens.next,"]")&&F("W137",f.tokens.curr);var l=!1;while(!pn(f.tokens.next,"]"))u()&&!l&&pn(f.tokens.next,",")&&(F("W130",f.tokens.next),l=!0),pn(f.tokens.next,"=")&&(pn(f.tokens.prev,"...")?V("]"):V("="),f.tokens.next.id==="undefined"&&F("W080",f.tokens.prev,f.tokens.prev.value),Q(10)),pn(f.tokens.next,"]")||V(",");V("]")}else if(pn(o,"{")){r||V("{"),pn(f.tokens.next,"}")&&F("W137",f.tokens.curr);while(!pn(f.tokens.next,"}")){a(),pn(f.tokens.next,"=")&&(V("="),f.tokens.next.id==="undefined"&&F("W080",f.tokens.prev,f.tokens.prev.value),Q(10));if(!pn(f.tokens.next,"}")){V(",");if(pn(f.tokens.next,"}"))break}}V("}")}return n}function Zt(e,t){var n=t.first;if(!n)return;r.zip(e,Array.isArray(n)?n:[n]).forEach(function(e){var t=e[0],n=e[1];t&&n?t.first=n:t&&t.first&&!n&&F("W080",t.first,t.first.value)})}function en(e,t,n){var i=n&&n.prefix,s=n&&n.inexport,o=e==="let",u=e==="const",a,l,c,h;f.inES6()||F("W104",f.tokens.curr,e,"6"),o&&f.tokens.next.value==="("?(f.inMoz()||F("W118",f.tokens.next,"let block"),V("("),f.funct["(scope)"].stack(),h=!0):f.funct["(noblockscopedvar)"]&&q("E048",f.tokens.curr,u?"Const":"Let"),t.first=[];for(;;){var p=[];r.contains(["{","["],f.tokens.next.value)?(a=Gt(),l=!1):(a=[{id:Ct(),token:f.tokens.curr}],l=!0),!i&&u&&f.tokens.next.id!=="="&&F("E012",f.tokens.curr,f.tokens.curr.value);for(var d in a)a.hasOwnProperty(d)&&(d=a[d],f.funct["(scope)"].block.isGlobal()&&S[d.id]===!1&&F("W079",d.token,d.id),d.id&&!f.funct["(noblockscopedvar)"]&&(f.funct["(scope)"].addlabel(d.id,{type:e,token:d.token}),p.push(d.token),l&&s&&f.funct["(scope)"].setExported(d.token.value,d.token)));f.tokens.next.id==="="&&(V("="),!i&&f.tokens.next.id==="undefined"&&F("W080",f.tokens.prev,f.tokens.prev.value),!i&&W(0).id==="="&&f.tokens.next.identifier&&F("W120",f.tokens.next,f.tokens.next.value),c=Q(i?120:10),l?a[0].first=c:Zt(p,c)),t.first=t.first.concat(p);if(f.tokens.next.id!==",")break;tt()}return h&&(V(")"),_t(!0,!0),t.block=!0,f.funct["(scope)"].unstack()),t}function sn(e){return f.inES6()||F("W104",f.tokens.curr,"class","6"),e?(this.name=Ct(),f.funct["(scope)"].addlabel(this.name,{type:"class",token:f.tokens.curr})):f.tokens.next.identifier&&f.tokens.next.value!=="extends"?(this.name=Ct(),this.namedExpr=!0):this.name=f.nameStack.infer(),on(this),this}function on(e){var t=f.inClassBody;f.tokens.next.value==="extends"&&(V("extends"),e.heritage=Q(10)),f.inClassBody=!0,V("{"),e.body=un(e),V("}"),f.inClassBody=t}function un(e){var t,n,r,i,s=Object.create(null),o=Object.create(null),u;for(var a=0;f.tokens.next.id!=="}";++a){t=f.tokens.next,n=!1,r=!1,i=null;if(t.id===";"){F("W032"),V(";");continue}t.id==="*"&&(r=!0,V("*"),t=f.tokens.next);if(t.id==="[")t=cn(),u=!0;else{if(!Ft(t)){F("W052",f.tokens.next,f.tokens.next.value||f.tokens.next.type),V();continue}V(),u=!1;if(t.identifier&&t.value==="static"){pn(f.tokens.next,"*")&&(r=!0,V("*"));if(Ft(f.tokens.next)||f.tokens.next.id==="[")u=f.tokens.next.id==="[",n=!0,t=f.tokens.next,f.tokens.next.id==="["?t=cn():V()}t.identifier&&(t.value==="get"||t.value==="set")&&(Ft(f.tokens.next)||f.tokens.next.id==="[")&&(u=f.tokens.next.id==="[",i=t,t=f.tokens.next,f.tokens.next.id==="["?t=cn():V())}if(!pn(f.tokens.next,"(")){q("E054",f.tokens.next,f.tokens.next.value);while(f.tokens.next.id!=="}"&&!pn(f.tokens.next,"("))V();f.tokens.next.value!=="("&&Xt({statement:e})}u||(i?ln(i.value,n?o:s,t.value,t,!0,n):(t.value==="constructor"?f.nameStack.set(e):f.nameStack.set(t),fn(n?o:s,t.value,t,!0,n)));if(i&&t.value==="constructor"){var l=i.value==="get"?"class getter method":"class setter method";q("E049",t,l,"constructor")}else t.value==="prototype"&&q("E049",t,"class method","prototype");It(t),Xt({statement:e,type:r?"generator":null,classExprBinding:e.namedExpr?e.name:null})}Kt(s)}function fn(e,t,n,r,i){var s=["key","class method","static class method"];s=s[(r||!1)+(i||!1)],n.identifier&&(t=n.value),e[t]&&t!=="__proto__"?F("W075",f.tokens.next,s,t):e[t]=Object.create(null),e[t].basic=!0,e[t].basictkn=n}function ln(e,t,n,r,i,s){var o=e==="get"?"getterToken":"setterToken",u="";i?(s&&(u+="static "),u+=e+"ter method"):u="key",f.tokens.curr.accessorType=e,f.nameStack.set(r),t[n]?(t[n].basic||t[n][o])&&n!=="__proto__"&&F("W075",f.tokens.next,u,n):t[n]=Object.create(null),t[n][o]=r}function cn(){V("["),f.inES6()||F("W119",f.tokens.curr,"computed property names","6");var e=Q(10);return V("]"),e}function hn(e,t){return e.type==="(punctuator)"?r.contains(t,e.value):!1}function pn(e,t){return e.type==="(punctuator)"&&e.value===t}function dn(){var e=an();e.notJson?(!f.inES6()&&e.isDestAssign&&F("W104",f.tokens.curr,"destructuring assignment","6"),Ot()):(f.option.laxbreak=!0,f.jsonMode=!0,mn())}function mn(){function e(){var e={},t=f.tokens.next;V("{");if(f.tokens.next.id!=="}")for(;;){if(f.tokens.next.id==="(end)")q("E026",f.tokens.next,t.line);else{if(f.tokens.next.id==="}"){F("W094",f.tokens.curr);break}f.tokens.next.id===","?q("E028",f.tokens.next):f.tokens.next.id!=="(string)"&&F("W095",f.tokens.next,f.tokens.next.value)}e[f.tokens.next.value]===!0?F("W075",f.tokens.next,"key",f.tokens.next.value):f.tokens.next.value==="__proto__"&&!f.option.proto||f.tokens.next.value==="__iterator__"&&!f.option.iterator?F("W096",f.tokens.next,f.tokens.next.value):e[f.tokens.next.value]=!0,V(),V(":"),mn();if(f.tokens.next.id!==",")break;V(",")}V("}")}function t(){var e=f.tokens.next;V("[");if(f.tokens.next.id!=="]")for(;;){if(f.tokens.next.id==="(end)")q("E027",f.tokens.next,e.line);else{if(f.tokens.next.id==="]"){F("W094",f.tokens.curr);break}f.tokens.next.id===","&&q("E028",f.tokens.next)}mn();if(f.tokens.next.id!==",")break;V(",")}V("]")}switch(f.tokens.next.id){case"{":e();break;case"[":t();break;case"true":case"false":case"null":case"(number)":case"(string)":V();break;case"-":V("-"),V("(number)");break;default:q("E003",f.tokens.next)}}var e,t={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},n,d=["closure","exception","global","label","outer","unused","var"],v,m,g,y,b,w,E,S,x,T,N=[],C=new i.EventEmitter,mt={};mt.legacy=["xml","unknown"],mt.es3=["undefined","boolean","number","string","function","object"],mt.es3=mt.es3.concat(mt.legacy),mt.es6=mt.es3.concat("symbol"),at("(number)",function(){return this}),at("(string)",function(){return this}),f.syntax["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var e=this.value;return f.tokens.next.id==="=>"?this:(f.funct["(comparray)"].check(e)||f.funct["(scope)"].block.use(e,f.tokens.curr),this)},led:function(){q("E033",f.tokens.next,f.tokens.next.value)}};var Pt={lbp:0,identifier:!1,template:!0};f.syntax["(template)"]=r.extend({type:"(template)",nud:Wt,led:Wt,noSubst:!1},Pt),f.syntax["(template middle)"]=r.extend({type:"(template middle)",middle:!0,noSubst:!1},Pt),f.syntax["(template tail)"]=r.extend({type:"(template tail)",tail:!0,noSubst:!1},Pt),f.syntax["(no subst template)"]=r.extend({type:"(template)",nud:Wt,led:Wt,noSubst:!0,tail:!0},Pt),at("(regexp)",function(){return this}),rt("(endline)"),rt("(begin)"),rt("(end)").reach=!0,rt("(error)").reach=!0,rt("}").reach=!0,rt(")"),rt("]"),rt('"').reach=!0,rt("'").reach=!0,rt(";"),rt(":").reach=!0,rt("#"),ft("else"),ft("case").reach=!0,ft("catch"),ft("default").reach=!0,ft("finally"),ct("arguments",function(e){f.isStrict()&&f.funct["(global)"]&&F("E008",e)}),ct("eval"),ct("false"),ct("Infinity"),ct("null"),ct("this",function(e){f.isStrict()&&!jt()&&!f.option.validthis&&(f.funct["(statement)"]&&f.funct["(name)"].charAt(0)>"Z"||f.funct["(global)"])&&F("W040",e)}),ct("true"),ct("undefined"),Et("=","assign",20),Et("+=","assignadd",20),Et("-=","assignsub",20),Et("*=","assignmult",20),Et("/=","assigndiv",20).nud=function(){q("E014")},Et("%=","assignmod",20),xt("&="),xt("|="),xt("^="),xt("<<="),xt(">>="),xt(">>>="),ht(",",function(e,t){var n;t.exprs=[e],f.option.nocomma&&F("W127");if(!tt({peek:!0}))return t;for(;;){if(!(n=Q(10)))break;t.exprs.push(n);if(f.tokens.next.value!==","||!tt())break}return t},10,!0),ht("?",function(e,t){return $t(),t.left=e,t.right=Q(10),V(":"),t["else"]=Q(10),t},30);var Ht=40;ht("||",function(e,t){return $t(),t.left=e,t.right=Q(Ht),t},Ht),ht("&&","and",50),St("|","bitor",70),St("^","bitxor",80),St("&","bitand",90),dt("==",function(e,t){var n=f.option.eqnull&&((e&&e.value)==="null"||(t&&t.value)==="null");switch(!0){case!n&&f.option.eqeqeq:this.from=this.character,F("W116",this,"===","==");break;case vt(e):F("W041",this,"===",e.value);break;case vt(t):F("W041",this,"===",t.value);break;case gt(t,e,f):F("W122",this,t.value);break;case gt(e,t,f):F("W122",this,e.value)}return this}),dt("===",function(e,t){return gt(t,e,f)?F("W122",this,t.value):gt(e,t,f)&&F("W122",this,e.value),this}),dt("!=",function(e,t){var n=f.option.eqnull&&((e&&e.value)==="null"||(t&&t.value)==="null");return!n&&f.option.eqeqeq?(this.from=this.character,F("W116",this,"!==","!=")):vt(e)?F("W041",this,"!==",e.value):vt(t)?F("W041",this,"!==",t.value):gt(t,e,f)?F("W122",this,t.value):gt(e,t,f)&&F("W122",this,e.value),this}),dt("!==",function(e,t){return gt(t,e,f)?F("W122",this,t.value):gt(e,t,f)&&F("W122",this,e.value),this}),dt("<"),dt(">"),dt("<="),dt(">="),St("<<","shiftleft",120),St(">>","shiftright",120),St(">>>","shiftrightunsigned",120),ht("in","in",120),ht("instanceof","instanceof",120),ht("+",function(e,t){var n;return t.left=e,t.right=n=Q(130),e&&n&&e.id==="(string)"&&n.id==="(string)"?(e.value+=n.value,e.character=n.character,!f.option.scripturl&&a.javascriptURL.test(e.value)&&F("W050",e),e):t},130),ut("+","num"),ut("+++",function(){return F("W007"),this.arity="unary",this.right=Q(150),this}),ht("+++",function(e){return F("W007"),this.left=e,this.right=Q(130),this},130),ht("-","sub",130),ut("-","neg"),ut("---",function(){return F("W006"),this.arity="unary",this.right=Q(150),this}),ht("---",function(e){return F("W006"),this.left=e,this.right=Q(130),this},130),ht("*","mult",140),ht("/","div",140),ht("%","mod",140),Tt("++"),ut("++","preinc"),f.syntax["++"].exps=!0,Tt("--"),ut("--","predec"),f.syntax["--"].exps=!0,ut("delete",function(){var e=Q(10);return e?(e.id!=="."&&e.id!=="["&&F("W051"),this.first=e,e.identifier&&!f.isStrict()&&(e.forgiveUndef=!0),this):this}).exps=!0,ut("~",function(){return f.option.bitwise&&F("W016",this,"~"),this.arity="unary",this.right=Q(150),this}),ut("...",function(){return f.inES6(!0)||F("W119",this,"spread/rest operator","6"),!f.tokens.next.identifier&&f.tokens.next.type!=="(string)"&&!hn(f.tokens.next,["[","("])&&q("E030",f.tokens.next,f.tokens.next.value),Q(150),this}),ut("!",function(){return this.arity="unary",this.right=Q(150),this.right||B("E041",this.line||0),t[this.right.id]===!0&&F("W018",this,"!"),this}),ut("typeof",function(){var e=Q(150);return this.first=this.right=e,e||B("E041",this.line||0,this.character||0),e.identifier&&(e.forgiveUndef=!0),this}),ut("new",function(){var e=Qt("target",function(){f.inES6(!0)||F("W119",f.tokens.prev,"new.target","6");var e,t=f.funct;while(t){e=!t["(global)"];if(!t["(arrow)"])break;t=t["(context)"]}e||F("W136",f.tokens.prev,"new.target")});if(e)return e;var t=Q(155),n;if(t&&t.id!=="function")if(t.identifier){t["new"]=!0;switch(t.value){case"Number":case"String":case"Boolean":case"Math":case"JSON":F("W053",f.tokens.prev,t.value);break;case"Symbol":f.inES6()&&F("W053",f.tokens.prev,t.value);break;case"Function":f.option.evil||F("W054");break;case"Date":case"RegExp":case"this":break;default:t.id!=="function"&&(n=t.value.substr(0,1),f.option.newcap&&(n<"A"||n>"Z")&&!f.funct["(scope)"].isPredefined(t.value)&&F("W055",f.tokens.curr))}}else t.id!=="."&&t.id!=="["&&t.id!=="("&&F("W056",f.tokens.curr);else f.option.supernew||F("W057",this);return f.tokens.next.id!=="("&&!f.option.supernew&&F("W058",f.tokens.curr,f.tokens.curr.value),this.first=this.right=t,this}),f.syntax["new"].exps=!0,ut("void").exps=!0,ht(".",function(e,t){var n=Ct(!1,!0);return typeof n=="string"&&Dt(n),t.left=e,t.right=n,n&&n==="hasOwnProperty"&&f.tokens.next.value==="="&&F("W001"),!e||e.value!=="arguments"||n!=="callee"&&n!=="caller"?!f.option.evil&&e&&e.value==="document"&&(n==="write"||n==="writeln")&&F("W060",e):f.option.noarg?F("W059",e,n):f.isStrict()&&q("E008"),!f.option.evil&&(n==="eval"||n==="execScript")&&yt(e,f)&&F("W061"),t},160,!0),ht("(",function(e,t){f.option.immed&&e&&!e.immed&&e.id==="function"&&F("W062");var n=0,r=[];e&&e.type==="(identifier)"&&e.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&"Array Number String Boolean Date Object Error Symbol".indexOf(e.value)===-1&&(e.value==="Math"?F("W063",e):f.option.newcap&&F("W064",e));if(f.tokens.next.id!==")")for(;;){r[r.length]=Q(10),n+=1;if(f.tokens.next.id!==",")break;tt()}return V(")"),typeof e=="object"&&(!f.inES5()&&e.value==="parseInt"&&n===1&&F("W065",f.tokens.curr),f.option.evil||(e.value==="eval"||e.value==="Function"||e.value==="execScript"?(F("W061",e),r[0]&&[0].id==="(string)"&&U(e,r[0].value)):!r[0]||r[0].id!=="(string)"||e.value!=="setTimeout"&&e.value!=="setInterval"?r[0]&&r[0].id==="(string)"&&e.value==="."&&e.left.value==="window"&&(e.right==="setTimeout"||e.right==="setInterval")&&(F("W066",e),U(e,r[0].value)):(F("W066",e),U(e,r[0].value))),!e.identifier&&e.id!=="."&&e.id!=="["&&e.id!=="=>"&&e.id!=="("&&e.id!=="&&"&&e.id!=="||"&&e.id!=="?"&&(!f.inES6()||!e["(name)"])&&F("W067",t)),t.left=e,t},155,!0).exps=!0,ut("(",function(){var e=f.tokens.next,t,n=-1,r,i,s,o,u=1,a=f.tokens.curr,l=f.tokens.prev,c=!f.option.singleGroups;do e.value==="("?u+=1:e.value===")"&&(u-=1),n+=1,t=e,e=W(n);while((u!==0||t.value!==")")&&e.value!==";"&&e.type!=="(end)");f.tokens.next.id==="function"&&(i=f.tokens.next.immed=!0);if(e.value==="=>")return Xt({type:"arrow",parsedOpening:!0});var h=[];if(f.tokens.next.id!==")")for(;;){h.push(Q(10));if(f.tokens.next.id!==",")break;f.option.nocomma&&F("W127"),tt()}V(")",this),f.option.immed&&h[0]&&h[0].id==="function"&&f.tokens.next.id!=="("&&f.tokens.next.id!=="."&&f.tokens.next.id!=="["&&F("W068",this);if(!h.length)return;return h.length>1?(r=Object.create(f.syntax[","]),r.exprs=h,s=h[0],o=h[h.length-1],c||(c=l.assign||l.delim)):(r=s=o=h[0],c||(c=a.beginsStmt&&(r.id==="{"||i||Ut(r))||i&&(!J()||f.tokens.prev.id!=="}")||Ut(r)&&!J()||r.id==="{"&&l.id==="=>"||r.type==="(number)"&&pn(e,".")&&/^\d+$/.test(r.value))),r&&(!c&&(s.left||s.right||r.exprs)&&(c=!K(l)&&s.lbp<=l.lbp||!J()&&o.lbp"),ht("[",function(e,t){var n=Q(10),r;return n&&n.type==="(string)"&&(!f.option.evil&&(n.value==="eval"||n.value==="execScript")&&yt(e,f)&&F("W061"),Dt(n.value),!f.option.sub&&a.identifier.test(n.value)&&(r=f.syntax[n.value],(!r||!O(r))&&F("W069",f.tokens.prev,n.value))),V("]",t),n&&n.value==="hasOwnProperty"&&f.tokens.next.value==="="&&F("W001"),t.left=e,t.right=n,t},160,!0),ut("[",function(){var e=an();if(e.isCompArray)return!f.option.esnext&&!f.inMoz()&&F("W118",f.tokens.curr,"array comprehension"),Bt();if(e.isDestAssign)return this.destructAssign=Gt({openingParsed:!0,assignment:!0}),this;var t=f.tokens.curr.line!==G(f.tokens.next);this.first=[],t&&(g+=f.option.indent,f.tokens.next.from===g+f.option.indent&&(g+=f.option.indent));while(f.tokens.next.id!=="(end)"){while(f.tokens.next.id===","){if(!f.option.elision){if(!!f.inES5()){F("W128");do V(",");while(f.tokens.next.id===",");continue}F("W070")}V(",")}if(f.tokens.next.id==="]")break;this.first.push(Q(10));if(f.tokens.next.id!==",")break;tt({allowTrailing:!0});if(f.tokens.next.id==="]"&&!f.inES5()){F("W070",f.tokens.curr);break}}return t&&(g-=f.option.indent),V("]",this),this}),function(e){e.nud=function(){var e,t,n,r,i,s=!1,o,u=Object.create(null);e=f.tokens.curr.line!==G(f.tokens.next),e&&(g+=f.option.indent,f.tokens.next.from===g+f.option.indent&&(g+=f.option.indent));var a=an();if(a.isDestAssign)return this.destructAssign=Gt({openingParsed:!0,assignment:!0}),this;for(;;){if(f.tokens.next.id==="}")break;o=f.tokens.next.value;if(!f.tokens.next.identifier||X().id!==","&&X().id!=="}")if(W().id===":"||o!=="get"&&o!=="set"){f.tokens.next.value==="*"&&f.tokens.next.type==="(punctuator)"?(f.inES6()||F("W104",f.tokens.next,"generator functions","6"),V("*"),s=!0):s=!1;if(f.tokens.next.id==="[")n=cn(),f.nameStack.set(n);else{f.nameStack.set(f.tokens.next),n=It(),fn(u,n,f.tokens.next);if(typeof n!="string")break}f.tokens.next.value==="("?(f.inES6()||F("W104",f.tokens.curr,"concise methods","6"),Xt({type:s?"generator":null})):(V(":"),Q(10))}else V(o),f.inES5()||q("E034"),n=It(),!n&&!f.inES6()&&q("E035"),n&&ln(o,u,n,f.tokens.curr),i=f.tokens.next,t=Xt(),r=t["(params)"],o==="get"&&n&&r?F("W076",i,r[0],n):o==="set"&&n&&(!r||r.length!==1)&&F("W077",i,n);else f.inES6()||F("W104",f.tokens.next,"object short notation","6"),n=It(!0),fn(u,n,f.tokens.next),Q(10);Dt(n);if(f.tokens.next.id!==",")break;tt({allowTrailing:!0,property:!0}),f.tokens.next.id===","?F("W070",f.tokens.curr):f.tokens.next.id==="}"&&!f.inES5()&&F("W070",f.tokens.curr)}return e&&(g-=f.option.indent),V("}",this),Kt(u),this},e.fud=function(){q("E036",f.tokens.curr)}}(rt("{"));var tn=it("const",function(e){return en("const",this,e)});tn.exps=!0;var nn=it("let",function(e){return en("let",this,e)});nn.exps=!0;var rn=it("var",function(e){var t=e&&e.prefix,n=e&&e.inexport,i,o,u,a=e&&e.implied,l=!e||!e.ignore;this.first=[];for(;;){var c=[];r.contains(["{","["],f.tokens.next.value)?(i=Gt(),o=!1):(i=[{id:Ct(),token:f.tokens.curr}],o=!0),(!t||!a)&&l&&f.option.varstmt&&F("W132",this),this.first=this.first.concat(c);for(var h in i)i.hasOwnProperty(h)&&(h=i[h],!a&&f.funct["(global)"]&&(S[h.id]===!1?F("W079",h.token,h.id):f.option.futurehostile===!1&&(!f.inES5()&&s.ecmaIdentifiers[5][h.id]===!1||!f.inES6()&&s.ecmaIdentifiers[6][h.id]===!1)&&F("W129",h.token,h.id)),h.id&&(a==="for"?(f.funct["(scope)"].has(h.id)||l&&F("W088",h.token,h.id),f.funct["(scope)"].block.use(h.id,h.token)):(f.funct["(scope)"].addlabel(h.id,{type:"var",token:h.token}),o&&n&&f.funct["(scope)"].setExported(h.id,h.token)),c.push(h.token)));f.tokens.next.id==="="&&(f.nameStack.set(f.tokens.curr),V("="),!t&&l&&!f.funct["(loopage)"]&&f.tokens.next.id==="undefined"&&F("W080",f.tokens.prev,f.tokens.prev.value),W(0).id==="="&&f.tokens.next.identifier&&(!t&&l&&!f.funct["(params)"]||f.funct["(params)"].indexOf(f.tokens.next.value)===-1)&&F("W120",f.tokens.next,f.tokens.next.value),u=Q(t?120:10),o?i[0].first=u:Zt(c,u));if(f.tokens.next.id!==",")break;tt()}return this});rn.exps=!0,st("class",function(){return sn.call(this,!0)}),st("function",function(e){var t=e&&e.inexport,n=!1;f.tokens.next.value==="*"&&(V("*"),f.inES6({strict:!0})?n=!0:F("W119",f.tokens.curr,"function*","6")),m&&F("W082",f.tokens.curr);var r=Nt();return f.funct["(scope)"].addlabel(r,{type:"function",token:f.tokens.curr}),r===undefined?F("W025"):t&&f.funct["(scope)"].setExported(r,f.tokens.prev),Xt({name:r,statement:this,type:n?"generator":null,ignoreLoopFunc:m}),f.tokens.next.id==="("&&f.tokens.next.line===f.tokens.curr.line&&q("E039"),this}),ut("function",function(){var e=!1;f.tokens.next.value==="*"&&(f.inES6()||F("W119",f.tokens.curr,"function*","6"),V("*"),e=!0);var t=Nt();return Xt({name:t,type:e?"generator":null}),this}),st("if",function(){var e=f.tokens.next;$t(),f.condition=!0,V("(");var t=Q(0);Jt(t);var n=null;f.option.forin&&f.forinifcheckneeded&&(f.forinifcheckneeded=!1,n=f.forinifchecks[f.forinifchecks.length-1],t.type==="(punctuator)"&&t.value==="!"?n.type="(negative)":n.type="(positive)"),V(")",e),f.condition=!1;var r=_t(!0,!0);return n&&n.type==="(negative)"&&r&&r[0]&&r[0].type==="(identifier)"&&r[0].value==="continue"&&(n.type="(negative-with-continue)"),f.tokens.next.id==="else"&&(V("else"),f.tokens.next.id==="if"||f.tokens.next.id==="switch"?At():_t(!0,!0)),this}),st("try",function(){function t(){V("catch"),V("("),f.funct["(scope)"].stack("catchparams");if(hn(f.tokens.next,["[","{"])){var e=Gt();r.each(e,function(e){e.id&&f.funct["(scope)"].addParam(e.id,e,"exception")})}else f.tokens.next.type!=="(identifier)"?F("E030",f.tokens.next,f.tokens.next.value):f.funct["(scope)"].addParam(Ct(),f.tokens.curr,"exception");f.tokens.next.value==="if"&&(f.inMoz()||F("W118",f.tokens.curr,"catch filter"),V("if"),Q(0)),V(")"),_t(!1),f.funct["(scope)"].unstack()}var e;_t(!0);while(f.tokens.next.id==="catch")$t(),e&&!f.inMoz()&&F("W118",f.tokens.next,"multiple catch blocks"),t(),e=!0;if(f.tokens.next.id==="finally"){V("finally"),_t(!0);return}return e||q("E021",f.tokens.next,"catch",f.tokens.next.value),this}),st("while",function(){var e=f.tokens.next;return f.funct["(breakage)"]+=1,f.funct["(loopage)"]+=1,$t(),V("("),Jt(Q(0)),V(")",e),_t(!0,!0),f.funct["(breakage)"]-=1,f.funct["(loopage)"]-=1,this}).labelled=!0,st("with",function(){var e=f.tokens.next;return f.isStrict()?q("E010",f.tokens.curr):f.option.withstmt||F("W085",f.tokens.curr),V("("),Q(0),V(")",e),_t(!0,!0),this}),st("switch",function(){var e=f.tokens.next,t=!1,n=!1;f.funct["(breakage)"]+=1,V("("),Jt(Q(0)),V(")",e),e=f.tokens.next,V("{"),f.tokens.next.from===g&&(n=!0),n||(g+=f.option.indent),this.cases=[];for(;;)switch(f.tokens.next.id){case"case":switch(f.funct["(verb)"]){case"yield":case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:f.tokens.curr.caseFallsThrough||F("W086",f.tokens.curr,"case")}V("case"),this.cases.push(Q(0)),$t(),t=!0,V(":"),f.funct["(verb)"]="case";break;case"default":switch(f.funct["(verb)"]){case"yield":case"break":case"continue":case"return":case"throw":break;default:this.cases.length&&(f.tokens.curr.caseFallsThrough||F("W086",f.tokens.curr,"default"))}V("default"),t=!0,V(":");break;case"}":n||(g-=f.option.indent),V("}",e),f.funct["(breakage)"]-=1,f.funct["(verb)"]=undefined;return;case"(end)":q("E023",f.tokens.next,"}");return;default:g+=f.option.indent;if(t)switch(f.tokens.curr.id){case",":q("E040");return;case":":t=!1,Ot();break;default:q("E025",f.tokens.curr);return}else{if(f.tokens.curr.id!==":"){q("E021",f.tokens.next,"case",f.tokens.next.value);return}V(":"),q("E024",f.tokens.curr,":"),Ot()}g-=f.option.indent}return this}).labelled=!0,it("debugger",function(){return f.option.debug||F("W087",this),this}).exps=!0,function(){var e=it("do",function(){f.funct["(breakage)"]+=1,f.funct["(loopage)"]+=1,$t(),this.first=_t(!0,!0),V("while");var e=f.tokens.next;return V("("),Jt(Q(0)),V(")",e),f.funct["(breakage)"]-=1,f.funct["(loopage)"]-=1,this});e.labelled=!0,e.exps=!0}(),st("for",function(){var e,t=f.tokens.next,n=!1,i=null;t.value==="each"&&(i=t,V("each"),f.inMoz()||F("W118",f.tokens.curr,"for each")),$t(),V("(");var s,o=0,u=["in","of"],a=0,l,c;hn(f.tokens.next,["{","["])&&++a;do{s=W(o),++o,hn(s,["{","["])?++a:hn(s,["}","]"])&&--a;if(a<0)break;a===0&&(!l&&pn(s,",")?l=s:!c&&pn(s,"=")&&(c=s))}while(a>0||!r.contains(u,s.value)&&s.value!==";"&&s.type!=="(end)");if(r.contains(u,s.value)){!f.inES6()&&s.value==="of"&&F("W104",s,"for of","6");var h=!c&&!l;c&&q("W133",l,s.value,"initializer is forbidden"),l&&q("W133",l,s.value,"more than one ForBinding"),f.tokens.next.id==="var"?(V("var"),f.tokens.curr.fud({prefix:!0})):f.tokens.next.id==="let"||f.tokens.next.id==="const"?(V(f.tokens.next.id),n=!0,f.funct["(scope)"].stack(),f.tokens.curr.fud({prefix:!0})):Object.create(rn).fud({prefix:!0,implied:"for",ignore:!h}),V(s.value),Q(20),V(")",t),s.value==="in"&&f.option.forin&&(f.forinifcheckneeded=!0,f.forinifchecks===undefined&&(f.forinifchecks=[]),f.forinifchecks.push({type:"(none)"})),f.funct["(breakage)"]+=1,f.funct["(loopage)"]+=1,e=_t(!0,!0);if(s.value==="in"&&f.option.forin){if(f.forinifchecks&&f.forinifchecks.length>0){var p=f.forinifchecks.pop();(e&&e.length>0&&(typeof e[0]!="object"||e[0].value!=="if")||p.type==="(positive)"&&e.length>1||p.type==="(negative)")&&F("W089",this)}f.forinifcheckneeded=!1}f.funct["(breakage)"]-=1,f.funct["(loopage)"]-=1}else{i&&q("E045",i);if(f.tokens.next.id!==";")if(f.tokens.next.id==="var")V("var"),f.tokens.curr.fud();else if(f.tokens.next.id==="let")V("let"),n=!0,f.funct["(scope)"].stack(),f.tokens.curr.fud();else for(;;){Q(0,"for");if(f.tokens.next.id!==",")break;l()}Z(f.tokens.curr),V(";"),f.funct["(loopage)"]+=1,f.tokens.next.id!==";"&&Jt(Q(0)),Z(f.tokens.curr),V(";"),f.tokens.next.id===";"&&q("E021",f.tokens.next,")",";");if(f.tokens.next.id!==")")for(;;){Q(0,"for");if(f.tokens.next.id!==",")break;l()}V(")",t),f.funct["(breakage)"]+=1,_t(!0,!0),f.funct["(breakage)"]-=1,f.funct["(loopage)"]-=1}return n&&f.funct["(scope)"].unstack(),this}).labelled=!0,it("break",function(){var e=f.tokens.next.value;return f.option.asi||Z(this),f.tokens.next.id!==";"&&!f.tokens.next.reach&&f.tokens.curr.line===G(f.tokens.next)?(f.funct["(scope)"].funct.hasBreakLabel(e)||F("W090",f.tokens.next,e),this.first=f.tokens.next,V()):f.funct["(breakage)"]===0&&F("W052",f.tokens.next,this.value),kt(this),this}).exps=!0,it("continue",function(){var e=f.tokens.next.value;return f.funct["(breakage)"]===0&&F("W052",f.tokens.next,this.value),f.funct["(loopage)"]||F("W052",f.tokens.next,this.value),f.option.asi||Z(this),f.tokens.next.id!==";"&&!f.tokens.next.reach&&f.tokens.curr.line===G(f.tokens.next)&&(f.funct["(scope)"].funct.hasBreakLabel(e)||F("W090",f.tokens.next,e),this.first=f.tokens.next,V()),kt(this),this}).exps=!0,it("return",function(){return this.line===G(f.tokens.next)?f.tokens.next.id!==";"&&!f.tokens.next.reach&&(this.first=Q(0),this.first&&this.first.type==="(punctuator)"&&this.first.value==="="&&!this.first.paren&&!f.option.boss&&I("W093",this.first.line,this.first.character)):f.tokens.next.type==="(punctuator)"&&["[","{","+","-"].indexOf(f.tokens.next.value)>-1&&Z(this),kt(this),this}).exps=!0,function(e){e.exps=!0,e.lbp=25}(ut("yield",function(){var e=f.tokens.prev;f.inES6(!0)&&!f.funct["(generator)"]?("(catch)"!==f.funct["(name)"]||!f.funct["(context)"]["(generator)"])&&q("E046",f.tokens.curr,"yield"):f.inES6()||F("W104",f.tokens.curr,"yield","6"),f.funct["(generator)"]="yielded";var t=!1;f.tokens.next.value==="*"&&(t=!0,V("*"));if(this.line===G(f.tokens.next)||!f.inMoz()){if(t||f.tokens.next.id!==";"&&!f.option.asi&&!f.tokens.next.reach&&f.tokens.next.nud)Y(f.tokens.curr,f.tokens.next),this.first=Q(10),this.first.type==="(punctuator)"&&this.first.value==="="&&!this.first.paren&&!f.option.boss&&I("W093",this.first.line,this.first.character);f.inMoz()&&f.tokens.next.id!==")"&&(e.lbp>30||!e.assign&&!J()||e.id==="yield")&&q("E050",this)}else f.option.asi||Z(this);return this})),it("throw",function(){return Z(this),this.first=Q(20),kt(this),this}).exps=!0,it("import",function(){f.inES6()||F("W119",f.tokens.curr,"import","6");if(f.tokens.next.type==="(string)")return V("(string)"),this;if(f.tokens.next.identifier){this.name=Ct(),f.funct["(scope)"].addlabel(this.name,{type:"const",token:f.tokens.curr});if(f.tokens.next.value!==",")return V("from"),V("(string)"),this;V(",")}if(f.tokens.next.id==="*")V("*"),V("as"),f.tokens.next.identifier&&(this.name=Ct(),f.funct["(scope)"].addlabel(this.name,{type:"const",token:f.tokens.curr}));else{V("{");for(;;){if(f.tokens.next.value==="}"){V("}");break}var e;f.tokens.next.type==="default"?(e="default",V("default")):e=Ct(),f.tokens.next.value==="as"&&(V("as"),e=Ct()),f.funct["(scope)"].addlabel(e,{type:"const",token:f.tokens.curr});if(f.tokens.next.value!==","){if(f.tokens.next.value==="}"){V("}");break}q("E024",f.tokens.next,f.tokens.next.value);break}V(",")}}return V("from"),V("(string)"),this}).exps=!0,it("export",function(){var e=!0,t,n;f.inES6()||(F("W119",f.tokens.curr,"export","6"),e=!1),f.funct["(scope)"].block.isGlobal()||(q("E053",f.tokens.curr),e=!1);if(f.tokens.next.value==="*")return V("*"),V("from"),V("(string)"),this;if(f.tokens.next.type==="default"){f.nameStack.set(f.tokens.next),V("default");var r=f.tokens.next.id;if(r==="function"||r==="class")this.block=!0;return t=W(),Q(10),n=t.value,this.block&&(f.funct["(scope)"].addlabel(n,{type:r,token:t}),f.funct["(scope)"].setExported(n,t)),this}if(f.tokens.next.value==="{"){V("{");var i=[];for(;;){f.tokens.next.identifier||q("E030",f.tokens.next,f.tokens.next.value),V(),i.push(f.tokens.curr),f.tokens.next.value==="as"&&(V("as"),f.tokens.next.identifier||q("E030",f.tokens.next,f.tokens.next.value),V());if(f.tokens.next.value!==","){if(f.tokens.next.value==="}"){V("}");break}q("E024",f.tokens.next,f.tokens.next.value);break}V(",")}return f.tokens.next.value==="from"?(V("from"),V("(string)")):e&&i.forEach(function(e){f.funct["(scope)"].setExported(e.value,e)}),this}if(f.tokens.next.id==="var")V("var"),f.tokens.curr.fud({inexport:!0});else if(f.tokens.next.id==="let")V("let"),f.tokens.curr.fud({inexport:!0});else if(f.tokens.next.id==="const")V("const"),f.tokens.curr.fud({inexport:!0});else if(f.tokens.next.id==="function")this.block=!0,V("function"),f.syntax["function"].fud({inexport:!0});else if(f.tokens.next.id==="class"){this.block=!0,V("class");var s=f.tokens.next;f.syntax["class"].fud(),f.funct["(scope)"].setExported(s.value,s)}else q("E024",f.tokens.next,f.tokens.next.value);return this}).exps=!0,lt("abstract"),lt("boolean"),lt("byte"),lt("char"),lt("class",{es5:!0,nud:sn}),lt("double"),lt("enum",{es5:!0}),lt("export",{es5:!0}),lt("extends",{es5:!0}),lt("final"),lt("float"),lt("goto"),lt("implements",{es5:!0,strictOnly:!0}),lt("import",{es5:!0}),lt("int"),lt("interface",{es5:!0,strictOnly:!0}),lt("long"),lt("native"),lt("package",{es5:!0,strictOnly:!0}),lt("private",{es5:!0,strictOnly:!0}),lt("protected",{es5:!0,strictOnly:!0}),lt("public",{es5:!0,strictOnly:!0}),lt("short"),lt("static",{es5:!0,strictOnly:!0}),lt("super",{es5:!0}),lt("synchronized"),lt("transient"),lt("volatile");var an=function(){var e,t,n,r=-1,i=0,s={};hn(f.tokens.curr,["[","{"])&&(i+=1);do{n=r===-1?f.tokens.curr:e,e=r===-1?f.tokens.next:W(r),t=W(r+1),r+=1,hn(e,["[","{"])?i+=1:hn(e,["]","}"])&&(i-=1);if(i===1&&e.identifier&&e.value==="for"&&!pn(n,".")){s.isCompArray=!0,s.notJson=!0;break}if(i===0&&hn(e,["}","]"])){if(t.value==="="){s.isDestAssign=!0,s.notJson=!0;break}if(t.value==="."){s.notJson=!0;break}}pn(e,";")&&(s.isBlock=!0,s.notJson=!0)}while(i>0&&e.id!=="(end)");return s},vn=function(){function i(e){var t=n.variables.filter(function(t){if(t.value===e)return t.undef=!1,e}).length;return t!==0}function s(e){var t=n.variables.filter(function(t){if(t.value===e&&!t.undef)return t.unused===!0&&(t.unused=!1),e}).length;return t===0}var e=function(){this.mode="use",this.variables=[]},t=[],n;return{stack:function(){n=new e,t.push(n)},unstack:function(){n.variables.filter(function(e){e.unused&&F("W098",e.token,e.raw_text||e.value),e.undef&&f.funct["(scope)"].block.use(e.value,e.token)}),t.splice(-1,1),n=t[t.length-1]},setState:function(e){r.contains(["use","define","generate","filter"],e)&&(n.mode=e)},check:function(e){if(!n)return;return n&&n.mode==="use"?(s(e)&&n.variables.push({funct:f.funct,token:f.tokens.curr,value:e,undef:!0,unused:!1}),!0):n&&n.mode==="define"?(i(e)||n.variables.push({funct:f.funct,token:f.tokens.curr,value:e,undef:!1,unused:!0}),!0):n&&n.mode==="generate"?(f.funct["(scope)"].block.use(e,f.tokens.curr),!0):n&&n.mode==="filter"?(s(e)&&f.funct["(scope)"].block.use(e,f.tokens.curr),!0):!1}}},gn=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},yn=function(t,i,o){function U(e,t){if(!e)return;!Array.isArray(e)&&typeof e=="object"&&(e=Object.keys(e)),e.forEach(t)}var a,l,c,d,A,O,M={},P={};i=r.clone(i),f.reset(),i&&i.scope?p.scope=i.scope:(p.errors=[],p.undefs=[],p.internals=[],p.blacklist={},p.scope="(main)"),S=Object.create(null),D(S,s.ecmaIdentifiers[3]),D(S,s.reservedVars),D(S,o||{}),n=Object.create(null);var j=Object.create(null);if(i){U(i.predef||null,function(e){var t,n;e[0]==="-"?(t=e.slice(1),p.blacklist[t]=t,delete S[t]):(n=Object.getOwnPropertyDescriptor(i.predef,e),S[e]=n?n.value:!1)}),U(i.exported||null,function(e){j[e]=!0}),delete i.predef,delete i.exported,O=Object.keys(i);for(c=0;c0&&(e.implieds=u),T.length>0&&(e.urls=T),o=f.funct["(scope)"].getUsedOrDefinedGlobals(),o.length>0&&(e.globals=o);for(r=1;r0&&(e.unused=a);for(s in w)if(typeof w[s]=="number"){e.member=w;break}return e},yn.jshint=yn,yn}();typeof n=="object"&&n&&(n.JSHINT=p)},{"../lodash":"/node_modules/jshint/lodash.js","./lex.js":"/node_modules/jshint/src/lex.js","./messages.js":"/node_modules/jshint/src/messages.js","./options.js":"/node_modules/jshint/src/options.js","./reg.js":"/node_modules/jshint/src/reg.js","./scope-manager.js":"/node_modules/jshint/src/scope-manager.js","./state.js":"/node_modules/jshint/src/state.js","./style.js":"/node_modules/jshint/src/style.js","./vars.js":"/node_modules/jshint/src/vars.js",events:"/node_modules/browserify/node_modules/events/events.js"}],"/node_modules/jshint/src/lex.js":[function(e,t,n){"use strict";function h(){var e=[];return{push:function(t){e.push(t)},check:function(){for(var t=0;t0&&this.context[this.context.length-1].type===e},pushContext:function(e){this.context.push({type:e})},popContext:function(){return this.context.pop()},isContext:function(e){return this.context.length>0&&this.context[this.context.length-1]===e},currentContext:function(){return this.context.length>0&&this.context[this.context.length-1]},getLines:function(){return this._lines=o.lines,this._lines},setLines:function(e){this._lines=e,o.lines=this._lines},peek:function(e){return this.input.charAt(e||0)},skip:function(e){e=e||1,this.char+=e,this.input=this.input.slice(e)},on:function(e,t){e.split(" ").forEach(function(e){this.emitter.on(e,t)}.bind(this))},trigger:function(){this.emitter.emit.apply(this.emitter,Array.prototype.slice.call(arguments))},triggerAsync:function(e,t,n,r){n.push(function(){r()&&this.trigger(e,t)}.bind(this))},scanPunctuator:function(){var e=this.peek(),t,n,r;switch(e){case".":if(/^[0-9]$/.test(this.peek(1)))return null;if(this.peek(1)==="."&&this.peek(2)===".")return{type:l.Punctuator,value:"..."};case"(":case")":case";":case",":case"[":case"]":case":":case"~":case"?":return{type:l.Punctuator,value:e};case"{":return this.pushContext(c.Block),{type:l.Punctuator,value:e};case"}":return this.inContext(c.Block)&&this.popContext(),{type:l.Punctuator,value:e};case"#":return{type:l.Punctuator,value:e};case"":return null}return t=this.peek(1),n=this.peek(2),r=this.peek(3),e===">"&&t===">"&&n===">"&&r==="="?{type:l.Punctuator,value:">>>="}:e==="="&&t==="="&&n==="="?{type:l.Punctuator,value:"==="}:e==="!"&&t==="="&&n==="="?{type:l.Punctuator,value:"!=="}:e===">"&&t===">"&&n===">"?{type:l.Punctuator,value:">>>"}:e==="<"&&t==="<"&&n==="="?{type:l.Punctuator,value:"<<="}:e===">"&&t===">"&&n==="="?{type:l.Punctuator,value:">>="}:e==="="&&t===">"?{type:l.Punctuator,value:e+t}:e===t&&"+-<>&|".indexOf(e)>=0?{type:l.Punctuator,value:e+t}:"<>=!+-*%&|^".indexOf(e)>=0?t==="="?{type:l.Punctuator,value:e+t}:{type:l.Punctuator,value:e}:e==="/"?t==="="?{type:l.Punctuator,value:"/="}:{type:l.Punctuator,value:"/"}:null},scanComments:function(){function u(e,t,n){var r=["jshint","jslint","members","member","globals","global","exported"],i=!1,u=e+t,a="plain";return n=n||{},n.isMultiline&&(u+="*/"),t=t.replace(/\n/g," "),e==="/*"&&s.fallsThrough.test(t)&&(i=!0,a="falls through"),r.forEach(function(n){if(i)return;if(e==="//"&&n!=="jshint")return;t.charAt(n.length)===" "&&t.substr(0,n.length)===n&&(i=!0,e+=n,t=t.substr(n.length)),!i&&t.charAt(0)===" "&&t.charAt(n.length+1)===" "&&t.substr(1,n.length)===n&&(i=!0,e=e+" "+n,t=t.substr(n.length+1));if(!i)return;switch(n){case"member":a="members";break;case"global":a="globals";break;default:var r=t.split(":").map(function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")});if(r.length===2)switch(r[0]){case"ignore":switch(r[1]){case"start":o.ignoringLinterErrors=!0,i=!1;break;case"end":o.ignoringLinterErrors=!1,i=!1}}a=n}}),{type:l.Comment,commentType:a,value:u,body:t,isSpecial:i,isMultiline:n.isMultiline||!1,isMalformed:n.isMalformed||!1}}var e=this.peek(),t=this.peek(1),n=this.input.substr(2),r=this.line,i=this.char,o=this;if(e==="*"&&t==="/")return this.trigger("error",{code:"E018",line:r,character:i}),this.skip(2),null;if(e!=="/"||t!=="*"&&t!=="/")return null;if(t==="/")return this.skip(this.input.length),u("//",n);var a="";if(t==="*"){this.inComment=!0,this.skip(2);while(this.peek()!=="*"||this.peek(1)!=="/")if(this.peek()===""){a+="\n";if(!this.nextLine())return this.trigger("error",{code:"E017",line:r,character:i}),this.inComment=!1,u("/*",a,{isMultiline:!0,isMalformed:!0})}else a+=this.peek(),this.skip();return this.skip(2),this.inComment=!1,u("/*",a,{isMultiline:!0})}},scanKeyword:function(){var e=/^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input),t=["if","in","do","var","for","new","try","let","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"];return e&&t.indexOf(e[0])>=0?{type:l.Keyword,value:e[0]}:null},scanIdentifier:function(){function i(e){return e>256}function s(e){return e>256}function o(e){return/^[0-9a-fA-F]$/.test(e)}function p(e){return e.replace(/\\u([0-9a-fA-F]{4})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})}var e="",t=0,n,r,u=function(){t+=1;if(this.peek(t)!=="u")return null;var e=this.peek(t+1),n=this.peek(t+2),r=this.peek(t+3),i=this.peek(t+4),u;return o(e)&&o(n)&&o(r)&&o(i)?(u=parseInt(e+n+r+i,16),f[u]||s(u)?(t+=5,"\\u"+e+n+r+i):null):null}.bind(this),c=function(){var e=this.peek(t),n=e.charCodeAt(0);return n===92?u():n<128?a[n]?(t+=1,e):null:i(n)?(t+=1,e):null}.bind(this),h=function(){var e=this.peek(t),n=e.charCodeAt(0);return n===92?u():n<128?f[n]?(t+=1,e):null:s(n)?(t+=1,e):null}.bind(this);r=c();if(r===null)return null;e=r;for(;;){r=h();if(r===null)break;e+=r}switch(e){case"true":case"false":n=l.BooleanLiteral;break;case"null":n=l.NullLiteral;break;default:n=l.Identifier}return{type:n,value:p(e),text:e,tokenLength:e.length}},scanNumericLiteral:function(){function f(e){return/^[0-9]$/.test(e)}function c(e){return/^[0-7]$/.test(e)}function h(e){return/^[01]$/.test(e)}function p(e){return/^[0-9a-fA-F]$/.test(e)}function d(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"}var e=0,t="",n=this.input.length,r=this.peek(e),i,s=f,u=10,a=!1;if(r!=="."&&!f(r))return null;if(r!=="."){t=this.peek(e),e+=1,r=this.peek(e);if(t==="0"){if(r==="x"||r==="X")s=p,u=16,e+=1,t+=r;if(r==="o"||r==="O")s=c,u=8,o.inES6(!0)||this.trigger("warning",{code:"W119",line:this.line,character:this.char,data:["Octal integer literal","6"]}),e+=1,t+=r;if(r==="b"||r==="B")s=h,u=2,o.inES6(!0)||this.trigger("warning",{code:"W119",line:this.line,character:this.char,data:["Binary integer literal","6"]}),e+=1,t+=r;c(r)&&(s=c,u=8,a=!0,i=!1,e+=1,t+=r),!c(r)&&f(r)&&(e+=1,t+=r)}while(e=0&&i<=7&&o.isStrict()});break;case"u":var s=this.input.substr(1,4),u=parseInt(s,16);isNaN(u)&&this.trigger("warning",{code:"W052",line:this.line,character:this.char,data:["u"+s]}),r=String.fromCharCode(u),n=5;break;case"v":this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\v"]},e,function(){return o.jsonMode}),r="\x0b";break;case"x":var a=parseInt(this.input.substr(1,2),16);this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\x-"]},e,function(){return o.jsonMode}),r=String.fromCharCode(a),n=3;break;case"\\":r="\\\\";break;case'"':r='\\"';break;case"/":break;case"":t=!0,r=""}return{"char":r,jump:n,allowNewLine:t}},scanTemplateLiteral:function(e){var t,n="",r,i=this.line,s=this.char,u=this.templateStarts.length;if(!o.inES6(!0))return null;if(this.peek()==="`")t=l.TemplateHead,this.templateStarts.push({line:this.line,"char":this.char}),u=this.templateStarts.length,this.skip(1),this.pushContext(c.Template);else{if(!this.inContext(c.Template)||this.peek()!=="}")return null;t=l.TemplateMiddle}while(this.peek()!=="`"){while((r=this.peek())===""){n+="\n";if(!this.nextLine()){var a=this.templateStarts.pop();return this.trigger("error",{code:"E052",line:a.line,character:a.char}),{type:t,value:n,startLine:i,startChar:s,isUnclosed:!0,depth:u,context:this.popContext()}}}if(r==="$"&&this.peek(1)==="{")return n+="${",this.skip(2),{type:t,value:n,startLine:i,startChar:s,isUnclosed:!1,depth:u,context:this.currentContext()};if(r==="\\"){var f=this.scanEscapeSequence(e);n+=f.char,this.skip(f.jump)}else r!=="`"&&(n+=r,this.skip(1))}return t=t===l.TemplateHead?l.NoSubstTemplate:l.TemplateTail,this.skip(1),this.templateStarts.pop(),{type:t,value:n,startLine:i,startChar:s,isUnclosed:!1,depth:u,context:this.popContext()}},scanStringLiteral:function(e){var t=this.peek();if(t!=='"'&&t!=="'")return null;this.triggerAsync("warning",{code:"W108",line:this.line,character:this.char},e,function(){return o.jsonMode&&t!=='"'});var n="",r=this.line,i=this.char,s=!1;this.skip();while(this.peek()!==t)if(this.peek()===""){s?(s=!1,this.triggerAsync("warning",{code:"W043",line:this.line,character:this.char},e,function(){return!o.option.multistr}),this.triggerAsync("warning",{code:"W042",line:this.line,character:this.char},e,function(){return o.jsonMode&&o.option.multistr})):this.trigger("warning",{code:"W112",line:this.line,character:this.char});if(!this.nextLine())return this.trigger("error",{code:"E029",line:r,character:i}),{type:l.StringLiteral,value:n,startLine:r,startChar:i,isUnclosed:!0,quote:t}}else{s=!1;var u=this.peek(),a=1;u<" "&&this.trigger("warning",{code:"W113",line:this.line,character:this.char,data:[""]});if(u==="\\"){var f=this.scanEscapeSequence(e);u=f.char,a=f.jump,s=f.allowNewLine}n+=u,this.skip(a)}return this.skip(),{type:l.StringLiteral,value:n,startLine:r,startChar:i,isUnclosed:!1,quote:t}},scanRegExp:function(){var e=0,t=this.input.length,n=this.peek(),r=n,i="",s=[],o=!1,u=!1,a,f=function(){n<" "&&(o=!0,this.trigger("warning",{code:"W048",line:this.line,character:this.char})),n==="<"&&(o=!0,this.trigger("warning",{code:"W049",line:this.line,character:this.char,data:[n]}))}.bind(this);if(!this.prereg||n!=="/")return null;e+=1,a=!1;while(e=this.getLines().length)return!1;this.input=this.getLines()[this.line],this.line+=1,this.char=1,this.from=1;var t=this.input.trim(),n=function(){return r.some(arguments,function(e){return t.indexOf(e)===0})},i=function(){return r.some(arguments,function(e){return t.indexOf(e,t.length-e.length)!==-1})};this.ignoringLinterErrors===!0&&!n("/*","//")&&(!this.inComment||!i("*/"))&&(this.input=""),e=this.scanNonBreakingSpaces(),e>=0&&this.trigger("warning",{code:"W125",line:this.line,character:e+1}),this.input=this.input.replace(/\t/g,o.tab),e=this.scanUnsafeChars(),e>=0&&this.trigger("warning",{code:"W100",line:this.line,character:e});if(!this.ignoringLinterErrors&&o.option.maxlen&&o.option.maxlen=0;--t){var n=a[t]["(labels)"];if(n[e])return n}}function x(e){for(var t=a.length-1;t>=0;t--){var n=a[t];if(n["(usages)"][e])return n["(usages)"][e];if(n===l)break}return!1}function T(t,n){if(e.option.shadow!=="outer")return;var r=l["(type)"]==="global",i=u["(type)"]==="functionparams",s=!r;for(var o=0;o1?a[a.length-2]:null,n=u===l,i=u["(type)"]==="functionparams",f=u["(type)"]==="functionouter",p,d,g=u["(usages)"],y=u["(labels)"],E=Object.keys(g);g.__proto__&&E.indexOf("__proto__")===-1&&E.push("__proto__");for(p=0;p=0;s--){var o=a[s];if(o["(labels)"][e]&&(!n||o["(labels)"][e]["(blockscoped)"]))return o["(labels)"][e]["(type)"];var u=r?a[s-1]:o;if(u&&u["(type)"]==="functionparams")return null}return null},hasBreakLabel:function(e){for(var t=a.length-1;t>=0;t--){var n=a[t];if(n["(breakLabels)"][e])return!0;if(n["(type)"]==="functionparams")return!1}return!1},has:function(e,t){return Boolean(this.labeltype(e,t))},add:function(e,t,n,r){u["(labels)"][e]={"(type)":t,"(token)":n,"(blockscoped)":!1,"(function)":l,"(unused)":r}}},block:{isGlobal:function(){return u["(type)"]==="global"},use:function(t,n){var r=l["(parent)"];r&&r["(labels)"][t]&&r["(labels)"][t]["(type)"]==="param"&&(C.funct.has(t,{excludeParams:!0,onlyBlockscoped:!0})||(r["(labels)"][t]["(unused)"]=!1)),n&&(e.ignored.W117||e.option.undef===!1)&&(n.ignoreUndef=!0),g(t),n&&(n["(function)"]=l,u["(usages)"][t]["(tokens)"].push(n))},reassign:function(e,t){this.modify(e,t),u["(usages)"][e]["(reassigned)"].push(t)},modify:function(e,t){g(e),u["(usages)"][e]["(modified)"].push(t)},add:function(e,t,n,r){u["(labels)"][e]={"(type)":t,"(token)":n,"(blockscoped)":!0,"(unused)":r}},addBreakLabel:function(t,n){var r=n.token;C.funct.hasBreakLabel(t)?v("E011",r,t):e.option.shadow==="outer"&&(C.funct.has(t)?v("W004",r,t):T(t,r)),u["(breakLabels)"][t]=r}}};return C};t.exports=o},{"../lodash":"/node_modules/jshint/lodash.js",events:"/node_modules/browserify/node_modules/events/events.js"}],"/node_modules/jshint/src/state.js":[function(e,t,n){"use strict";var r=e("./name-stack.js"),i={syntax:{},isStrict:function(){return this.directive["use strict"]||this.inClassBody||this.option.module||this.option.strict==="implied"},inMoz:function(){return this.option.moz},inES6:function(){return this.option.moz||this.option.esversion>=6},inES5:function(e){return e?(!this.option.esversion||this.option.esversion===5)&&!this.option.moz:!this.option.esversion||this.option.esversion>=5||this.option.moz},reset:function(){this.tokens={prev:null,next:null,curr:null},this.option={},this.funct=null,this.ignored={},this.directive={},this.jsonMode=!1,this.jsonWarnings=[],this.lines=[],this.tab="",this.cache={},this.ignoredLines={},this.forinifcheckneeded=!1,this.nameStack=new r,this.inClassBody=!1}};n.state=i},{"./name-stack.js":"/node_modules/jshint/src/name-stack.js"}],"/node_modules/jshint/src/style.js":[function(e,t,n){"use strict";n.register=function(e){e.on("Identifier",function(n){if(e.getOption("proto"))return;n.name==="__proto__"&&e.warn("W103",{line:n.line,"char":n.char,data:[n.name,"6"]})}),e.on("Identifier",function(n){if(e.getOption("iterator"))return;n.name==="__iterator__"&&e.warn("W103",{line:n.line,"char":n.char,data:[n.name]})}),e.on("Identifier",function(n){if(!e.getOption("camelcase"))return;n.name.replace(/^_+|_+$/g,"").indexOf("_")>-1&&!n.name.match(/^[A-Z0-9_]*$/)&&e.warn("W106",{line:n.line,"char":n.from,data:[n.name]})}),e.on("String",function(n){var r=e.getOption("quotmark"),i;if(!r)return;r==="single"&&n.quote!=="'"&&(i="W109"),r==="double"&&n.quote!=='"'&&(i="W108"),r===!0&&(e.getCache("quotmark")||e.setCache("quotmark",n.quote),e.getCache("quotmark")!==n.quote&&(i="W110")),i&&e.warn(i,{line:n.line,"char":n.char})}),e.on("Number",function(n){n.value.charAt(0)==="."&&e.warn("W008",{line:n.line,"char":n.char,data:[n.value]}),n.value.substr(n.value.length-1)==="."&&e.warn("W047",{line:n.line,"char":n.char,data:[n.value]}),/^00+/.test(n.value)&&e.warn("W046",{line:n.line,"char":n.char,data:[n.value]})}),e.on("String",function(n){var r=/^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i;if(e.getOption("scripturl"))return;r.test(n.value)&&e.warn("W107",{line:n.line,"char":n.char})})}},{}],"/node_modules/jshint/src/vars.js":[function(e,t,n){"use strict";n.reservedVars={arguments:!1,NaN:!1},n.ecmaIdentifiers={3:{Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},5:{JSON:!1},6:{Map:!1,Promise:!1,Proxy:!1,Reflect:!1,Set:!1,Symbol:!1,WeakMap:!1,WeakSet:!1}},n.browser={Audio:!1,Blob:!1,addEventListener:!1,applicationCache:!1,atob:!1,blur:!1,btoa:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CSS:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,Comment:!1,CustomEvent:!1,DOMParser:!1,defaultStatus:!1,Document:!1,document:!1,DocumentFragment:!1,Element:!1,ElementTimeControl:!1,Event:!1,event:!1,fetch:!1,FileReader:!1,FormData:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,history:!1,Image:!1,Intl:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,Node:!1,NodeFilter:!1,NodeList:!1,Notification:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,performance:!1,print:!1,Range:!1,requestAnimationFrame:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,status:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimationElement:!1,SVGCSSRule:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLineElement:!1,SVGLinearGradientElement:!1,SVGLocatable:!1,SVGMPathElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGSVGElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTransformable:!1,SVGURIReference:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGVKernElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGZoomAndPan:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TimeEvent:!1,top:!1,URL:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},n.devel={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},n.worker={importScripts:!0,postMessage:!0,self:!0,FileReaderSync:!0},n.nonstandard={escape:!1,unescape:!1},n.couch={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1,provides:!1},n.node={__filename:!1,__dirname:!1,GLOBAL:!1,global:!1,module:!1,require:!1,Buffer:!0,console:!0,exports:!0,process:!0,setTimeout:!0,clearTimeout:!0,setInterval:!0,clearInterval:!0,setImmediate:!0,clearImmediate:!0},n.browserify={__filename:!1,__dirname:!1,global:!1,module:!1,require:!1,Buffer:!0,exports:!0,process:!0},n.phantom={phantom:!0,require:!0,WebPage:!0,console:!0,exports:!0},n.qunit={asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,"throws":!1},n.rhino={defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},n.shelljs={target:!1,echo:!1,exit:!1,cd:!1,pwd:!1,ls:!1,find:!1,cp:!1,rm:!1,mv:!1,mkdir:!1,test:!1,cat:!1,sed:!1,grep:!1,which:!1,dirs:!1,pushd:!1,popd:!1,env:!1,exec:!1,chmod:!1,config:!1,error:!1,tempdir:!1},n.typed={ArrayBuffer:!1,ArrayBufferView:!1,DataView:!1,Float32Array:!1,Float64Array:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1},n.wsh={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0,XDomainRequest:!0},n.dojo={dojo:!1,dijit:!1,dojox:!1,define:!1,require:!1},n.jquery={$:!1,jQuery:!1},n.mootools={$:!1,$$:!1,Asset:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMEvent:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,IFrame:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},n.prototypejs={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},n.yui={YUI:!1,Y:!1,YUI_config:!1},n.mocha={mocha:!1,describe:!1,xdescribe:!1,it:!1,xit:!1,context:!1,xcontext:!1,before:!1,after:!1,beforeEach:!1,afterEach:!1,suite:!1,test:!1,setup:!1,teardown:!1,suiteSetup:!1,suiteTeardown:!1},n.jasmine={jasmine:!1,describe:!1,xdescribe:!1,it:!1,xit:!1,beforeEach:!1,afterEach:!1,setFixtures:!1,loadFixtures:!1,spyOn:!1,expect:!1,runs:!1,waitsFor:!1,waits:!1,beforeAll:!1,afterAll:!1,fail:!1,fdescribe:!1,fit:!1,pending:!1}},{}]},{},["/node_modules/jshint/src/jshint.js"])}),ace.define("ace/mode/javascript_worker",[],function(require,exports,module){"use strict";function startRegex(e){return RegExp("^("+e.join("|")+")")}var oop=require("../lib/oop"),Mirror=require("../worker/mirror").Mirror,lint=require("./javascript/jshint").JSHINT,disabledWarningsRe=startRegex(["Bad for in variable '(.+)'.",'Missing "use strict"']),errorsRe=startRegex(["Unexpected","Expected ","Confusing (plus|minus)","\\{a\\} unterminated regular expression","Unclosed ","Unmatched ","Unbegun comment","Bad invocation","Missing space after","Missing operator at"]),infoRe=startRegex(["Expected an assignment","Bad escapement of EOL","Unexpected comma","Unexpected space","Missing radix parameter.","A leading decimal point can","\\['{a}'\\] is better written in dot notation.","'{a}' used out of scope"]),JavaScriptWorker=exports.JavaScriptWorker=function(e){Mirror.call(this,e),this.setTimeout(500),this.setOptions()};oop.inherits(JavaScriptWorker,Mirror),function(){this.setOptions=function(e){this.options=e||{esnext:!0,moz:!0,devel:!0,browser:!0,node:!0,laxcomma:!0,laxbreak:!0,lastsemic:!0,onevar:!1,passfail:!1,maxerr:100,expr:!0,multistr:!0,globalstrict:!0},this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.changeOptions=function(e){oop.mixin(this.options,e),this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.isValidJS=function(str){try{eval("throw 0;"+str)}catch(e){if(e===0)return!0}return!1},this.onUpdate=function(){var e=this.doc.getValue();e=e.replace(/^#!.*\n/,"\n");if(!e)return this.sender.emit("annotate",[]);var t=[],n=this.isValidJS(e)?"warning":"error";lint(e,this.options,this.options.globals);var r=lint.errors,i=!1;for(var s=0;s0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n + + + + + + Blockly Games : Turtle + + + + + + + + diff --git a/html/blockly-games/turtle/generated/pt-br/compressed.js b/html/blockly-games/turtle/generated/pt-br/compressed.js new file mode 100644 index 0000000..adbdbf7 --- /dev/null +++ b/html/blockly-games/turtle/generated/pt-br/compressed.js @@ -0,0 +1,907 @@ +// Automatically generated file. Do not edit! + +'use strict';var b,g={g:{}};g.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}(); +g.h={};g.g.global.Blockly||(g.g.global.Blockly={});g.g.global.Blockly.Msg||(g.g.global.Blockly.Msg=g.h);g.g.X=function(a,c){this.x=a;this.y=c};g.g.X.Je=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};g.g.X.Ox=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};g.g.X.UF=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};g.g.X.xm=function(a,c){return new g.g.X(a.x-c.x,a.y-c.y)};g.g.X.sum=function(a,c){return new g.g.X(a.x+c.x,a.y+c.y)};g.g.X.prototype.scale=function(a){this.x*=a;this.y*=a;return this};g.g.X.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};g.g.ib={};g.g.ib.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};g.g.ib.dv=function(a){return a.length?a.reduce(function(c,d){return c.lengthc&&(c=d[e].length);e=-Infinity;var f=1;do{var h=e;var k=a;a=[];var l=d.length/f,m=1;for(e=0;eh);return k}; +g.g.ib.wv=function(a,c,d){for(var e=[0],f=[],h=0;he&&(e=l,f=k)}return f?g.g.ib.FA(a,f,d):c};g.g.ib.HH=function(a,c){for(var d=[],e=0;e=l?(f=2,h=l,(l=a.join(""))&&d.push(l),a.length=0):"{"==l?f=3:(a.push("%",l),f=0):2==f?"0"<=l&&"9">=l?h+=l:(d.push(parseInt(h,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=g.g.ib.startsWith(l,"BKY_")? +l.substring(4):null)&&l in g.h?(f=g.h[l],"string"==typeof f?Array.prototype.push.apply(d,g.g.pv(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;kd;d++)c[d]=g.g.Qg.lA.charAt(Math.random()*a);return c.join("")}; +g.g.Qg.lA="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +g.g.fj=function(){if(void 0!==g.g.fj.ws)return g.g.fj.ws;if(!g.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=g.g.global.getComputedStyle(a);if(!c)return document.body.removeChild(a),!1;c=c.getPropertyValue(d[e])}document.body.removeChild(a); +g.g.fj.ws="none"!==c;return g.g.fj.ws};g.g.cA=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)};g.g.gF=function(){var a=g.g.style.Hy();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}}; +g.g.$o=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};g.g.bF=function(){var a=document.documentElement,c=window;return g.g.userAgent.wg&&c.pageYOffset!=a.scrollTop?new g.g.X(a.scrollLeft,a.scrollTop):new g.g.X(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};g.g.nt=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=q(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}; +g.g.YG=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new g.g.X(d-e.left,c-e.top);c=g.g.Jm(a.jb);return g.g.X.xm(d,c).scale(1/a.scale)}; +g.Touch={};g.Touch.Gw="ontouchstart"in g.g.global||!!(g.g.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!g.g.global.navigator||!g.g.global.navigator.maxTouchPoints&&!g.g.global.navigator.msMaxTouchPoints);g.Touch.Qn=null;g.Touch.Kf={}; +g.g.global.PointerEvent?g.Touch.Kf={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:g.Touch.Gw&&(g.Touch.Kf={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});g.bq=0; +g.SF=function(a,c){g.Yh();a.changedTouches&&1!=a.changedTouches.length||(g.bq=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&ba(c,a)},g.hC))};g.Yh=function(){g.bq&&(clearTimeout(g.bq),g.bq=0)};g.Touch.Bh=function(){g.Touch.Qn=null};g.Touch.ev=function(a){return!g.Touch.KF(a)||g.Touch.RD(a)}; +g.Touch.Jp=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"};g.Touch.RD=function(a){var c=g.Touch.Jp(a);return void 0!==g.Touch.Qn&&null!==g.Touch.Qn?g.Touch.Qn==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(g.Touch.Qn=c,!0):!1}; +g.Touch.$G=function(a){if(g.g.ib.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};g.Touch.KF=function(a){return g.g.ib.startsWith(a.type,"touch")||g.g.ib.startsWith(a.type,"mouse")||g.g.ib.startsWith(a.type,"pointer")};g.Touch.aq=function(a){return g.g.ib.startsWith(a.type,"touch")||g.g.ib.startsWith(a.type,"pointer")}; +g.Touch.gH=function(a){var c=[];if(a.changedTouches)for(var d=0;d=d+this.Lh&&(e+=f);da(this,na(this,e));la(this);a.stopPropagation();a.preventDefault()}}; +b.vG=function(a){pa(this.s);ea();g.g.jj(a)?a.stopPropagation():(this.hH=this.Om,ra(this.s),this.nA=this.bj?a.clientX:a.clientY,g.La.Se=g.ca(document,"mouseup",this,this.DG),g.La.eg=g.ca(document,"mousemove",this,this.AG),a.stopPropagation(),a.preventDefault())};b.AG=function(a){da(this,na(this,this.hH+((this.bj?a.clientX:a.clientY)-this.nA)));la(this)};b.DG=function(){sa(this.s);g.Touch.Bh();ea()};function ea(){g.wc(!0);g.La.Se&&(g.Ua(g.La.Se),g.La.Se=null);g.La.eg&&(g.Ua(g.La.eg),g.La.eg=null)} +function na(a,c){return c=0>=c||isNaN(c)||a.Uee.iw&&0<=e.iw;)e.Nj.shift();for(var h=0;d=e.Gd[h];h++)d(f)}}}; +g.i.filter=function(a,c){a=a.slice();c||a.reverse();for(var d=[],e=Object.create(null),f=0,h;h=a[f];f++)if(!h.Uk()){var k=[h.type,h.Ic,h.Ec].join(" "),l=e[k],m=l?l.event:null;if(!l)e[k]={event:h,index:f},d.push(h);else if(h.type==g.i.Pl&&l.index==f-1)m.qj=h.qj,m.pj=h.pj,m.Zh=h.Zh,l.index=f;else if(h.type==g.i.pi&&h.element==m.element&&h.name==m.name)m.newValue=h.newValue;else if(h.type!=g.i.Yl||"click"!=h.element||"commentOpen"!=m.element&&"mutatorOpen"!=m.element&&"warningOpen"!=m.element)e[k]={event:h, +index:1},d.push(h)}a=d.filter(function(n){return!n.Uk()});c||a.reverse();for(f=1;h=a[f];f++)h.type==g.i.pi&&"mutation"==h.element&&a.unshift(a.splice(f,1)[0]);return a};g.i.UD=function(){for(var a=0,c;c=g.i.Gl[a];a++)c.Rc=!1};g.i.disable=function(){g.i.Ps++};g.i.enable=function(){g.i.Ps--};g.i.isEnabled=function(){return 0==g.i.Ps};g.i.cc=function(){return g.i.Ly};g.i.aa=function(a){g.i.Ly="boolean"==typeof a?a?g.g.Qg():"":a}; +g.i.qy=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c}; +g.i.qa=function(a){switch(a.type){case g.i.uo:var c=new g.i.We(null);break;case g.i.Dl:c=new g.i.Df(null);break;case g.i.pi:c=new g.i.ph(null,"","","","");break;case g.i.Pl:c=new g.i.xi(null);break;case g.i.Iw:c=new g.i.Fe(null);break;case g.i.Jw:c=new g.i.af(null);break;case g.i.Kw:c=new g.i.Lf(null,"");break;case g.i.Yl:c=new g.i.Bd(null,"","","");break;case g.i.qo:c=new g.i.sg(null);break;case g.i.Kv:c=new g.i.Xj(null,"","");break;case g.i.so:c=new g.i.ri(null);break;case g.i.Lv:c=new g.i.tg(null); +break;default:throw Error("Unknown event type.");}c.qa(a);c.Ec=(void 0).id;return c};g.i.uE=function(a){if((a.type==g.i.Pl||a.type==g.i.uo)&&a.Ec){var c=g.Ob.qt(a.Ec);if(a=x(c,a.Ic)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.sd(!0);else if((a.L||a.$)&&!c.lc()){do a.sd(!1),a=q(a);while(a)}}}}; +g.fD=function(){var a=g.Fi.Wj.KD;this.FD=g.Fi.Wj.mE;this.LD=a;this.XD=Object.create(null)};function ta(a,c){return(c=a.XD[c])&&"string"==typeof propertyValue&&ta(a,c)?ta(a,c):c?String(c):null};g.Xl=function(a){this.Fq=a;this.Cq=[];this.Ch=Object.create(null)};g.Xl.prototype.Ip=function(){return this.Fq};g.Xl.prototype.subscribe=function(a,c,d){this.Ch[c]||(this.Ch[c]=[]);this.Ch[c].push({element:a,propertyName:d});a.style[d]=this.Fq&&ta(this.Fq,c)||""};g.Xl.prototype.unsubscribe=function(a){if(a)for(var c=Object.keys(this.Ch),d=0,e;e=c[d];d++){for(var f=this.Ch[e],h=f.length-1;0<=h;h--)f[h].element===a&&f.splice(h,1);this.Ch[e].length||delete this.Ch[e]}}; +g.Xl.prototype.I=function(){this.Ch=this.Cq=this.Fq=this.qd=null};g.Fi={};g.Fi.Wj={};g.Fi.Wj.mE={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"}}; +g.Fi.Wj.KD={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"}};g.Fi.Wj=new g.fD;g.i.Abstract=function(){this.Ec=void 0;this.group=g.i.cc();this.Rc=g.i.Rc};g.i.Abstract.prototype.eb=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};g.i.Abstract.prototype.qa=function(a){this.group=a.group};g.i.Abstract.prototype.Uk=function(){return!1};g.i.Abstract.prototype.run=function(){};function ua(a){if(a.Ec)var c=g.Ob.qt(a.Ec);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};g.i.Eg=function(a){g.i.Eg.w.constructor.call(this);this.li=a.wa();this.Ec=a.v.id};g.g.object.Y(g.i.Eg,g.i.Abstract);g.i.Eg.prototype.eb=function(){var a=g.i.Eg.w.eb.call(this);a.varId=this.li;return a};g.i.Eg.prototype.qa=function(a){g.i.Eg.w.eb.call(this);this.li=a.varId};g.i.Fe=function(a){a&&(g.i.Fe.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};g.g.object.Y(g.i.Fe,g.i.Eg);g.i.Fe.prototype.type=g.i.Iw; +g.i.Fe.prototype.eb=function(){var a=g.i.Fe.w.eb.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};g.i.Fe.prototype.qa=function(a){g.i.Fe.w.qa.call(this,a);this.Qj=a.varType;this.Pj=a.varName};g.i.Fe.prototype.run=function(a){var c=ua(this);a?c.Pd(this.Pj,this.Qj,this.li):c.Vf(this.li)};g.i.af=function(a){a&&(g.i.af.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};g.g.object.Y(g.i.af,g.i.Eg);g.i.af.prototype.type=g.i.Jw; +g.i.af.prototype.eb=function(){var a=g.i.af.w.eb.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};g.i.af.prototype.qa=function(a){g.i.af.w.qa.call(this,a);this.Qj=a.varType;this.Pj=a.varName};g.i.af.prototype.run=function(a){var c=ua(this);a?c.Vf(this.li):c.Pd(this.Pj,this.Qj,this.li)};g.i.Lf=function(a,c){a&&(g.i.Lf.w.constructor.call(this,a),this.uu=a.name,this.nu=c)};g.g.object.Y(g.i.Lf,g.i.Eg);g.i.Lf.prototype.type=g.i.Kw; +g.i.Lf.prototype.eb=function(){var a=g.i.Lf.w.eb.call(this);a.oldName=this.uu;a.newName=this.nu;return a};g.i.Lf.prototype.qa=function(a){g.i.Lf.w.qa.call(this,a);this.uu=a.oldName;this.nu=a.newName};g.i.Lf.prototype.run=function(a){var c=ua(this);a?c.ei(this.li,this.nu):c.ei(this.li,this.uu)}; +g.Vr=function(a){this.Va=Object.create(null);this.v=a};b=g.Vr.prototype;b.clear=function(){this.Va=Object.create(null)};b.uq=function(a,c){var d=this.ad(c,a.type),e=y(this.v,!1);g.i.aa(!0);try{if(d&&d.wa()!=a.wa()){var f=a.type;c!=d.name&&va(d,c,e);for(c=0;cc)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.Cq.splice(c,1);this.Zb.unsubscribe(this.Tc);this.options.Sb||(this.Zb.I(),this.Zb=null)}};g.Ob.yw=3;b=g.Ob.prototype; +b.lg=function(a,c){a=a.Ta();c=c.Ta();return a.y+g.Ob.prototype.lg.offset*a.x-(c.y+g.Ob.prototype.lg.offset*c.x)};function wa(a,c){if(!g.g.$o(a.ul,c))throw Error("Block not present in workspace's list of top-most blocks.");}function A(a,c){var d=[].concat(a.ul);c&&1h)return!1;d+=c[e]}return d>ya(a)?!1:!0} +function Aa(a){return Infinity!=a.options.fu||!!a.options.gu}b.uv=function(a){var c=a?this.vn:this.Nj,d=a?this.Nj:this.vn,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=g.i.filter(f,a);g.i.Rc=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{g.i.Rc=!0}}};function Ba(a,c){a.Gd.push(c)}function Ca(a,c){g.g.$o(a.Gd,c)}function x(a,c){return a.ps[c]||null}g.Ob.am=Object.create(null);g.Ob.qt=function(a){return g.Ob.am[a]||null}; +g.Ob.getAll=function(){var a=[],c;for(c in g.Ob.am)a.push(g.Ob.am[c]);return a};g.oa=function(a,c,d,e,f,h){this.s=a;this.hf=c;this.jA=d;d=g.oa.RA;this.s.G&&(d=-d);this.zD=g.g.dd.rl(d);a.xf.appendChild(this.pm(c,!(!f||!h)));this.bc=e;this.vq&&Da(this);f&&h||(c=this.hf.getBBox(),f=c.width+2*g.oa.jd,h=c.height+2*g.oa.jd);this.Cn(f,h);Da(this);Ea(this);this.vq=!0;a.options.readOnly||(g.ca(this.em,"mousedown",this,this.GD),this.kg&&g.ca(this.kg,"mousedown",this,this.TG))};g.oa.jd=6;g.oa.SA=5;g.oa.RA=20;g.oa.Bv=4;g.oa.PA=8;g.oa.Se=null;g.oa.eg=null;g.oa.prototype.Ru=null; +g.oa.tv=function(){g.oa.Se&&(g.Ua(g.oa.Se),g.oa.Se=null);g.oa.eg&&(g.Ua(g.oa.eg),g.oa.eg=null)};g.oa.HD=function(){g.Touch.Bh();g.oa.tv()};b=g.oa.prototype;b.vq=!1;b.bc=null;b.ah=0;b.di=0;b.xb=0;b.bd=0;b.ls=!0; +b.pm=function(a,c){this.ke=g.g.o.K("g",{},null);var d={filter:"url(#"+this.s.options.Vx+")"};g.g.userAgent.XB&&(d={});d=g.g.o.K("g",d,this.ke);this.ts=g.g.o.K("path",{},d);this.em=g.g.o.K("rect",{"class":"blocklyDraggable",x:0,y:0,rx:g.oa.jd,ry:g.oa.jd},d);c?(this.kg=g.g.o.K("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.ke),c=2*g.oa.jd,g.g.o.K("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.kg),g.g.o.K("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/ +3},this.kg),g.g.o.K("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.kg)):this.kg=null;this.ke.appendChild(a);return this.ke};b.za=function(){return this.ke};function Fa(a,c){a.ke.dataset&&(a.ke.dataset.blockId=c)}b.GD=function(a){var c=this.s.Sg(a);if(c){if(c.$i)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.te||(c.te=this);c.tf=a}};b.Gn=function(){};b.pe=function(){return!1}; +b.TG=function(a){Ga(this);g.oa.tv();g.g.jj(a)||(this.s.iv(a,new g.g.X(this.s.G?-this.xb:this.xb,this.bd)),g.oa.Se=g.ca(document,"mouseup",this,g.oa.HD),g.oa.eg=g.ca(document,"mousemove",this,this.UG),g.wc());a.stopPropagation()};b.UG=function(a){this.ls=!1;var c=this.s;a=g.g.ln(a,r(c),qa(c));a.x/=c.scale;a.y/=c.scale;c=g.g.X.sum(c.Sx,a);this.Cn(this.s.G?-c.x:c.x,c.y);this.s.G&&Da(this)};function Ga(a){var c=a.ke.parentNode;return c.lastChild!==a.ke?(c.appendChild(a.ke),!0):!1} +function Ha(a,c,d){var e=a.s.G?a.bc.x-c.x-a.xb:c.x+a.bc.x;c=c.y+a.bc.y;return Math.max(0,Math.min(1,(Math.min(e+a.xb,d.gc+d.ub)-Math.max(e,d.gc))*(Math.min(c+a.bd,d.pc+d.Cb)-Math.max(c,d.pc))/(a.xb*a.bd)))}function Da(a){var c=a.bc.x;c=a.s.G?c-(a.ah+a.xb):c+a.ah;a.moveTo(c,a.di+a.bc.y)}b.moveTo=function(a,c){this.ke.setAttribute("transform","translate("+a+","+c+")")};b.ot=function(){return new g.g.ge(this.xb,this.bd)}; +b.Cn=function(a,c){var d=2*g.oa.jd;a=Math.max(a,d+45);c=Math.max(c,d+20);this.xb=a;this.bd=c;this.em.setAttribute("width",a);this.em.setAttribute("height",c);this.kg&&(this.s.G?this.kg.setAttribute("transform","translate("+2*g.oa.jd+","+(c-d)+") scale(-1 1)"):this.kg.setAttribute("transform","translate("+(a-d)+","+(c-d)+")"));if(this.ls){a=this.s.jc();a.gc/=this.s.scale;a.ub/=this.s.scale;a.pc/=this.s.scale;a.Cb/=this.s.scale;c=-this.xb/4;if(!(this.xb>a.ub)){if(this.s.G){d=this.bc.x-c;var e=d-this.xb; +var f=a.gc+a.ub,h=a.gc+g.La.xc/this.s.scale}else e=c+this.bc.x,d=e+this.xb,h=a.gc,f=a.gc+a.ub-g.La.xc/this.s.scale;this.s.G?ef&&(c=-(f-this.bc.x)):ef&&(c=f-this.bc.x-this.xb)}e=c;c=-this.bd/4;if(!(this.bd>a.Cb)){d=this.bc.y+c;f=d+this.bd;h=a.pc;var k=a.pc+a.Cb-g.La.xc/this.s.scale,l=this.bc.y;dk&&(c=k-l-this.bd)}h=c;f=this.jA.getBBox();c={x:e,y:-this.bd-g.xa.vr};d={x:-this.xb-30,y:h};h={x:f.width,y:h};k={x:e,y:f.height};e=f.widthh&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),u=Math.cos(m),v=a.ot();m=(v.width+v.height)/g.oa.SA;m=Math.min(m,v.width,v.height)/4;v=1-g.oa.PA/k;f=d+v*f;h=e+v*h;v=d+m*u;var w=e+m*n;d-=m*u;e-=m*n;n=l+a.zD;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/g.oa.Bv;k=Math.cos(n)*k/g.oa.Bv;c.push("M"+v+","+ +w);c.push("C"+(v+k)+","+(w+l)+" "+f+","+h+" "+f+","+h);c.push("C"+f+","+h+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.ts.setAttribute("d",c.join(" "))}b.ed=function(a){this.em.setAttribute("fill",a);this.ts.setAttribute("fill",a)};b.I=function(){g.oa.tv();g.g.o.removeNode(this.ke);this.jA=this.hf=this.s=this.kg=this.em=this.ts=this.ke=null};b.ku=function(a,c){a?a.Mj(c.x,c.y):this.moveTo(c.x,c.y);this.ah=this.s.G?this.bc.x-c.x-this.xb:c.x-this.bc.x;this.di=c.y-this.bc.y;Ea(this)}; +b.Ta=function(){return new g.g.X(this.bc.x+this.ah,this.bc.y+this.di)};g.g.xml={};g.g.xml.tC="https://developers.google.com/blockly/xml";g.g.xml.document=function(){return document};g.g.xml.createElement=function(a){return g.g.xml.document().createElementNS(g.g.xml.tC,a)};g.g.xml.createTextNode=function(a){return g.g.xml.document().createTextNode(a)};g.g.xml.oH=function(a){return(new DOMParser).parseFromString(a,"text/xml")};g.g.xml.Dd=function(a){return(new XMLSerializer).serializeToString(a)};g.i.Cf=function(a){g.i.Cf.w.constructor.call(this);this.Ic=a.id;this.Ec=a.v.id};g.g.object.Y(g.i.Cf,g.i.Abstract);g.i.Cf.prototype.eb=function(){var a=g.i.Cf.w.eb.call(this);a.blockId=this.Ic;return a};g.i.Cf.prototype.qa=function(a){g.i.Cf.w.qa.call(this,a);this.Ic=a.blockId};g.i.ph=function(a,c,d,e,f){a&&(g.i.ph.w.constructor.call(this,a),this.element=c,this.name=d,this.oldValue=e,this.newValue=f)};g.g.object.Y(g.i.ph,g.i.Cf);g.i.qg=g.i.ph;b=g.i.ph.prototype;b.type=g.i.pi; +b.eb=function(){var a=g.i.ph.w.eb.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};b.qa=function(a){g.i.ph.w.qa.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};b.Uk=function(){return this.oldValue==this.newValue}; +b.run=function(a){var c=x(ua(this),this.Ic);if(c)switch(c.Ud&&c.Ud.Yb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=B(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.ii(a||null);break;case "collapsed":c.hh(!!a);break;case "disabled":c.sd(!a);break;case "inline":c.re(!!a);break;case "mutation":var d="";c.Pa&&(d=(d=c.Pa())&&g.R.Dd(d));if(c.kb){var e=g.R.lh(a||"");c.kb(e)}g.i.Oa(new g.i.ph(c,"mutation",null,d, +a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.Ic)};g.i.We=function(a){a&&(g.i.We.w.constructor.call(this,a),this.xml=a.v.ga?g.R.qs(a):g.R.zh(a),this.Nh=g.i.qy(a))};g.g.object.Y(g.i.We,g.i.Cf);g.i.mo=g.i.We;g.i.We.prototype.type=g.i.uo;g.i.We.prototype.eb=function(){var a=g.i.We.w.eb.call(this);a.xml=g.R.Dd(this.xml);a.ids=this.Nh;return a}; +g.i.We.prototype.qa=function(a){g.i.We.w.qa.call(this,a);this.xml=g.R.lh(a.xml);this.Nh=a.ids};g.i.We.prototype.run=function(a){var c=ua(this);if(a)a=g.g.xml.createElement("xml"),a.appendChild(this.xml),g.R.Fh(a,c);else{a=0;for(var d;d=this.Nh[a];a++){var e=x(c,d);e?e.I(!1):d==this.Ic&&console.warn("Can't uncreate non-existent block: "+d)}}}; +g.i.Df=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");g.i.Df.w.constructor.call(this,a);this.wu=a.v.ga?g.R.qs(a):g.R.zh(a);this.Nh=g.i.qy(a)}};g.g.object.Y(g.i.Df,g.i.Cf);g.i.XA=g.i.Df;g.i.Df.prototype.type=g.i.Dl;g.i.Df.prototype.eb=function(){var a=g.i.Df.w.eb.call(this);a.ids=this.Nh;return a};g.i.Df.prototype.qa=function(a){g.i.Df.w.qa.call(this,a);this.Nh=a.ids}; +g.i.Df.prototype.run=function(a){var c=ua(this);if(a){a=0;for(var d;d=this.Nh[a];a++){var e=x(c,d);e?e.I(!1):d==this.Ic&&console.warn("Can't delete non-existent block: "+d)}}else a=g.g.xml.createElement("xml"),a.appendChild(this.wu),g.R.Fh(a,c)};g.i.xi=function(a){a&&(g.i.xi.w.constructor.call(this,a),a=Ja(this),this.Cz=a.Mz,this.Bz=a.$y,this.su=a.vx)};g.g.object.Y(g.i.xi,g.i.Cf);g.i.Bl=g.i.xi;b=g.i.xi.prototype;b.type=g.i.Pl; +b.eb=function(){var a=g.i.xi.w.eb.call(this);this.qj&&(a.newParentId=this.qj);this.pj&&(a.newInputName=this.pj);this.Zh&&(a.newCoordinate=Math.round(this.Zh.x)+","+Math.round(this.Zh.y));return a};b.qa=function(a){g.i.xi.w.qa.call(this,a);this.qj=a.newParentId;this.pj=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.Zh=new g.g.X(Number(a[0]),Number(a[1])))};b.yj=function(){var a=Ja(this);this.qj=a.Mz;this.pj=a.$y;this.Zh=a.vx}; +function Ja(a){var c=x(ua(a),a.Ic);a={};var d=c.getParent();if(d){a.Mz=d.id;a:{for(var e=0,f;f=d.S[e];e++)if(f.connection&&C(f.connection)==c){c=f;break a}c=null}c&&(a.$y=c.name)}else a.vx=c.Ta();return a}b.Uk=function(){return this.Cz==this.qj&&this.Bz==this.pj&&g.g.X.Je(this.su,this.Zh)}; +b.run=function(a){var c=ua(this),d=x(c,this.Ic);if(d){var e=a?this.qj:this.Cz,f=a?this.pj:this.Bz;a=a?this.Zh:this.su;var h=null;if(e&&(h=x(c,e),!h)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&D(d);if(a)f=d.Ta(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.L||d.$;if(f){if(c=E(h,f))var k=c.connection}else d.type==g.$e&&(k=h.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.Ic)};g.i.Bd=function(a,c,d,e){g.i.Bd.w.constructor.call(this);this.Ic=a?a.id:null;this.Ec=a?a.v.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Rc=!1};g.g.object.Y(g.i.Bd,g.i.Abstract);g.i.Bd.prototype.type=g.i.Yl;g.i.Bd.prototype.eb=function(){var a=g.i.Bd.w.eb.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.Ic&&(a.blockId=this.Ic);return a}; +g.i.Bd.prototype.qa=function(a){g.i.Bd.w.qa.call(this,a);this.element=a.element;this.newValue=a.newValue;this.Ic=a.blockId};g.Kd=function(a){this.T=a};b=g.Kd.prototype;b.jx=!0;b.Uo=17;b.Vb=null;b.cj=null;function Ka(a){a.Sd||(a.Sd=g.g.o.K("g",{"class":"blocklyIconGroup"},null),a.T.ec&&g.g.o.qb(a.Sd,"blocklyIconGroupReadonly"),a.Ws(a.Sd),a.T.za().appendChild(a.Sd),g.ca(a.Sd,"mouseup",a,a.It),a.nh())}b.I=function(){g.g.o.removeNode(this.Sd);this.Sd=null;this.Yb(!1);this.T=null};b.nh=function(){};b.isVisible=function(){return!!this.Vb};b.It=function(a){this.T.v.lc()||this.T.ec||g.g.jj(a)||this.Yb(!this.isVisible())}; +b.Ve=function(){this.isVisible()&&this.Vb.ed(this.T.Mi)};function La(a){var c=a.T.Ta(),d=g.g.Me(a.Sd);c=new g.g.X(c.x+d.x+a.Uo/2,c.y+d.y+a.Uo/2);g.g.X.Je(a.cj,c)||(a.cj=c,a.isVisible()&&(a=a.Vb,a.bc=c,a.vq&&Da(a)))};g.Mf=function(a){g.Mf.w.constructor.call(this,a);Ka(this);this.ng={}};g.g.object.Y(g.Mf,g.Kd);g.Mf.prototype.jx=!1;g.Mf.prototype.Ws=function(a){g.g.o.K("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);g.g.o.K("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);g.g.o.K("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)}; +g.Mf.pH=function(a){var c=g.g.o.K("text",{"class":"blocklyText blocklyBubbleText",y:g.oa.jd},null);a=a.split("\n");for(var d=0;d>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};g.Vc.Xu=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +g.Vc.Zq=[".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("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;", +"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/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(<<>>/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;","}"]; +g.D=function(){};g.D.we=null;g.D.ss=null;g.D.qd=null;g.D.pq=null;g.D.eo=16;g.D.Iv=1;g.D.Dv=12;g.D.ow=16;g.D.Vq=.25;g.D.Nv="#dadce0";g.D.Ov="#fff";g.D.fs=null;g.D.sj=null; +g.D.Ja=function(){if(!g.D.we){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=g.D.Ov;a.style.borderColor=g.D.Nv;document.body.appendChild(a);g.D.we=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);g.D.hf=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);g.D.df=c;g.D.we.style.opacity=0;g.D.we.style.transition="transform "+g.D.Vq+"s, opacity "+g.D.Vq+"s";a.addEventListener("focusin", +function(){g.g.o.qb(a,"focused")});a.addEventListener("focusout",function(){g.g.o.Tb(a,"focused")})}};g.D.eA=function(a){g.D.ss=a};g.D.py=function(){return g.D.hf};g.D.TD=function(){g.D.hf.innerHTML="";g.D.hf.style.width=""};g.D.ed=function(a){g.D.we.style.backgroundColor=a;g.D.we.style.borderColor=void 0};g.D.mM=function(a){g.D.we.setAttribute("data-category",a)}; +g.D.oM=function(a,c,d,e){var f=c.v.scale,h=c.width,k=c.height;h*=f;k*=f;f=c.za().getBoundingClientRect();h=f.left+h/2;k=f.top+k;f=f.top;e&&(f+=e);g.D.eA(r(c.v).parentNode);return g.D.show(a,c.G,h,k,h,f,d)};g.D.kA=function(a,c){var d=a.za().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var h=a.B;g.D.pq=!0;g.D.eA(r(h.v).parentNode);g.D.show(a,h.G,e,f,e,d,c)}; +g.D.show=function(a,c,d,e,f,h,k){g.D.qd=a;g.D.sj=k||null;a=g.D.zy(d,e,f,h);a.js?(g.D.df.style.display="",g.D.df.style.transform="translate("+a.dm+"px,"+a.Uw+"px) rotate(45deg)",g.D.df.setAttribute("class",a.hs?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):g.D.df.style.display="none";g.D.we.style.direction=c?"rtl":"ltr";g.D.rn(a.Pp,a.Qp,a.wp,a.xp);return a.hs}; +g.D.UE=function(){var a=g.D.ss.getBoundingClientRect(),c=g.g.style.Tg(g.D.ss);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};g.D.zy=function(a,c,d,e){var f=g.D.UE(),h=g.g.style.Tg(g.D.we);return c+h.heightf.top?g.D.xy(d,e,f,h):c+h.heightdocument.documentElement.clientTop?g.D.xy(d,e,f,h):g.D.eF(a,f,h)}; +g.D.yy=function(a,c,d,e){a=g.D.vt(a,d.left,d.right,e.width);return{Pp:a.Fk,Qp:c,wp:a.Fk,xp:c+g.D.ow,dm:a.dm,Uw:-(g.D.eo/2+g.D.Iv),hs:!0,js:!0}};g.D.xy=function(a,c,d,e){a=g.D.vt(a,d.left,d.right,e.width);return{Pp:a.Fk,Qp:c-e.height,wp:a.Fk,xp:c-e.height-g.D.ow,dm:a.dm,Uw:e.height-2*g.D.Iv-g.D.eo/2,hs:!1,js:!0}};g.D.eF=function(a,c,d){a=g.D.vt(a,c.left,c.right,d.width);return{Pp:a.Fk,Qp:0,wp:a.Fk,xp:0,js:!1}}; +g.D.vt=function(a,c,d,e){var f=a;a=g.g.dd.Ak(c,a-e/2,d-e);f-=g.D.eo/2;c=g.g.dd.Ak(g.D.Dv,f-a,e-g.D.Dv-g.D.eo);return{dm:c,Fk:a}};g.D.isVisible=function(){return!!g.D.qd};g.D.Ok=function(a,c){g.D.qd===a&&(c?g.D.aj():g.D.Ga())};g.D.Ga=function(){var a=g.D.we;a.style.transform="translate(0, 0)";a.style.opacity=0;g.D.fs=setTimeout(function(){g.D.aj()},1E3*g.D.Vq);g.D.sj&&(g.D.sj(),g.D.sj=null)}; +g.D.aj=function(){if(g.D.isVisible()){g.D.fs&&clearTimeout(g.D.fs);var a=g.D.we;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=g.D.Ov;a.style.borderColor=g.D.Nv;g.D.sj&&(g.D.sj(),g.D.sj=null);g.D.TD();g.D.qd=null}}; +g.D.rn=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=g.D.we;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)"}; +g.D.hM=function(){if(g.D.qd){var a=g.D.qd.B,c=a.v.scale,d=g.D.pq?g.D.qd.Bb.width:a.width,e=g.D.pq?g.D.qd.Bb.height:a.height;d*=c;e*=c;a=g.D.pq?g.D.qd.me.getBoundingClientRect():a.za().getBoundingClientRect();d=a.left+d/2;e=g.D.zy(d,a.top+e,d,a.top);g.D.rn(e.Pp,e.Qp,e.wp,e.xp)}else g.D.Ga()};g.rb={};g.rb.Rs=0;g.rb.qp=null;g.rb.yE=function(a){var c=a.v,d=a.za();c.Nf.play("delete");a=Qa(c,d);d=d.cloneNode(!0);d.wH=a.x;d.xH=a.y;d.setAttribute("transform","translate("+a.x+","+a.y+")");r(c).appendChild(d);d.Vw=d.getBBox();g.rb.Nx(d,c.G,new Date,c.scale)};g.rb.Nx=function(a,c,d,e){var f=(new Date-d)/150;1d)){var e=Qa(c,a.za());a.L?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.$&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=g.g.o.K("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},r(c));g.rb.qx(a,new Date,d)}};g.rb.qx=function(a,c,d){var e=(new Date-c)/150;1a.v.scale)){var c=Ra(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);g.rb.Lx(a.za(),c,new Date)}};g.rb.Lx=function(a,c,d){var e=(new Date-d)/200;1a-g.jB)}if(a.Oc||a.Jb)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Oc||!a.Jb);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0} +function Ua(a){a.Jb&&(g.g.o.removeNode(g.ua.Wy),delete g.ua.Wy);if(a.Ht){var c=a.Jb;c.type!=g.Ra||c.isConnected()?Va(a.Pk,!1):a.Pk.yF(c,!1);a.Pk=null;a.Ht=!1}else if(a.mj)if(a.mj){c=a.mj;var d=c.B,e=d.V,f=d.$,h=d.L;h=c.type==g.Ra&&!(h&&h.ka);!(c!=e||f&&f.ka)||h?D(C(c),!1):c.type==g.Sa&&c!=e?(e=c.ka,D(e.B,!1),f=f?f.ka:null,D(d,!0),f&&f.connect(e)):D(d,!0);if(c.ka)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.mj=null;d.za().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")} +g.Ho.prototype.Kk=function(){var a=[];this.Hk&&a.push(this.Hk);this.kj&&a.push(this.kj);return a};g.oi=function(a,c){this.Kb=a;this.s=c;this.Wf=new g.Ho(this.Kb);this.Ui=null;this.pg=!1;this.mg=this.Kb.Ta();this.tp=g.oi.EF(a)};g.oi.prototype.I=function(){this.Bc=this.s=this.Kb=null;this.tp.length=0;this.Wf&&(this.Wf.I(),this.Wf=null)};g.oi.EF=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Wa(e);for(var f=0;fg.J.HC&&g.J.Ga()}else g.J.oq!=g.J.lb&&(clearTimeout(g.J.Hn),g.J.Ut=a.pageX,g.J.Vt=a.pageY,g.J.Hn=setTimeout(g.J.dH,g.J.MB))};g.J.Ga=function(){g.J.visible&&(g.J.visible=!1,g.J.Ca&&(g.J.Ca.style.display="none"));g.J.Hn&&clearTimeout(g.J.Hn)};g.J.block=function(){g.J.Ga();g.J.yk=!0};g.J.yH=function(){g.J.yk=!1}; +g.J.dH=function(){if(!g.J.yk&&(g.J.oq=g.J.lb,g.J.Ca)){g.J.Ca.innerHTML="";for(var a=g.J.lb.yf;"function"==typeof a;)a=a();a=g.g.ib.EA(a,g.J.bC);a=a.split("\n");for(var c=0;cd+window.scrollY&&(f-=g.J.Ca.offsetHeight+2*g.J.lw);a?e=Math.max(g.J.nr-window.scrollX,e):e+g.J.Ca.offsetWidth>c+window.scrollX-2*g.J.nr&&(e=c-g.J.Ca.offsetWidth-2*g.J.nr);g.J.Ca.style.top=f+"px";g.J.Ca.style.left=e+"px"}};g.$j=function(a,c){this.Bc=this.Cc=this.Ej=this.Fj=this.te=this.Cd=this.vz=null;this.Fs=c;this.Tm=this.gj=this.Um=this.Yi=!1;this.tf=a;this.P=this.ni=this.ef=this.Gg=this.mq=this.lq=null;this.Vp=this.$i=this.$w=!1;this.Sy=!g.uB};b=g.$j.prototype;b.I=function(){g.Touch.Bh();g.J.yH();this.Fs.Kc=null;this.lq&&g.Ua(this.lq);this.mq&&g.Ua(this.mq);this.P=this.Bc=this.Cc=this.Ej=this.Fj=null;this.ef&&(this.ef.I(),this.ef=null);this.ni&&(this.ni.I(),this.ni=null);this.Gg&&(this.Gg.I(),this.Gg=null)}; +function jb(a,c){a.Cd=g.g.X.xm(new g.g.X(c.clientX,c.clientY),a.vz);if(a.Yi)var d=!1;else a.Yi=g.g.X.UF(a.Cd)>(a.P?g.CB:g.tB),d=a.Yi;if(d){if(a.$w)throw Error("updateIsDragging_ should only be called once per gesture.");a.$w=!0;if(a.te){a.Tm=!0;a.Gg=new g.Cl(a.te,a.Bc);d=a.Gg;g.i.cc()||g.i.aa(!0);d.s.Sc(!1);d.uc.ls=!1;d.Wi&&d.mu();d.uc.Aj&&d.uc.Aj(!0);var e=d.s.ta;e&&g.g.o.qb(e.Gc,d.uc.pe()?"blocklyToolboxDelete":"blocklyToolboxGrab");fb(a.Gg,a.tf,a.Cd);d=!0}else d=!1;if(!d){if(a.Cc)if(a.P?(a.P.dz(a.Cc)? +((d=!kb(a.P))||(d=a.Cd,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.P.DE,d=d-e||d<-180+e||d>180-e?!0:!1),d?(a.Bc=a.P.tb,lb(a.Bc),g.i.cc()||g.i.aa(!0),a.Ej=null,a.Cc=mb(a.P,a.Cc),a.Cc.select(),d=!0):d=!1):d=!1,a.gj=d):a.Cc.Nc()&&(a.gj=!0),a.gj){a.ef=new g.oi(a.Cc,a.Bc);d=a.ef;e=a.Cd;var f=a.Sy;g.i.cc()||g.i.aa(!0);d.s.ij&&cb(d.Kb);g.g.o.Jn();d.s.Sc(!1);g.rb.Ss();if(d.Kb.getParent()||f&&d.Kb.V&&C(d.Kb.V))D(d.Kb,f),e=d.bl(e),e=g.g.X.sum(d.mg,e),d.Kb.translate(e.x,e.y),g.rb.xE(d.Kb);d.Kb.Aj(!0);d.Kb.mu(); +(e=d.s.ta)&&g.g.o.qb(e.Gc,d.Kb.pe()?"blocklyToolboxDelete":"blocklyToolboxGrab");Xa(a.ef,a.tf,a.Cd);d=!0}else d=!1;else d=!1;if(d=!d)if(a.P)d=kb(a.P);else if(d=a.Bc)d=a.Bc,d=d.options.Pc&&d.options.Pc.Gh;d&&(a.ni=a.P?new g.Do(a.P):new g.bm(a.Bc),a.Um=!0,a.ni.iv())}g.Yh()}a.tf=c} +b.Ts=function(a){g.g.Yp(a)?this.cancel():(this.$i=!0,g.rb.Ss(),lb(this.Bc),this.Bc.ij&&this.Bc.resize(),pa(this.Bc),this.tf=a,g.wc(!!this.P),g.J.block(),this.Cc&&(!this.Cc.ec&&a.shiftKey?(g.navigation.et(),t(this.Fs.bb,g.navigation.yt(this.Cc))):this.Cc.select()),g.g.jj(a)?ba(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||g.SF(a,this),this.vz=new g.g.X(a.clientX,a.clientY),this.Sy=a.altKey||a.ctrlKey||a.metaKey,this.xk(a)))}; +b.xk=function(a){this.lq=g.ca(document,"mousemove",null,this.Nm.bind(this));this.mq=g.ca(document,"mouseup",null,this.Kp.bind(this));a.preventDefault();a.stopPropagation()};b.Nm=function(a){jb(this,a);this.Um?this.ni.Gh(this.Cd):this.gj?Xa(this.ef,this.tf,this.Cd):this.Tm&&fb(this.Gg,this.tf,this.Cd);a.preventDefault();a.stopPropagation()}; +b.Kp=function(a){jb(this,a);g.Yh();if(this.Vp)console.log("Trying to end a gesture recursively.");else{this.Vp=!0;if(this.Tm)gb(this.Gg,a,this.Cd);else if(this.gj)ab(this.ef,a,this.Cd);else if(this.Um){var c=this.ni;c.Gh(this.Cd);sa(c.s)}else if(this.te&&!this.Yi)this.te.aH&&this.te.aH(),this.te.select&&this.te.select();else if(nb(this))this.Fj.wf(),ob(this);else if(this.Ej&&!this.Yi&&!nb(this))this.P&&this.P.wk?this.Cc.isEnabled()&&(g.i.cc()||g.i.aa(!0),eb(mb(this.P,this.Cc))):g.i.Oa(new g.i.Bd(this.Ej, +"click",void 0,void 0)),ob(this),g.i.aa(!1);else if(!(this.Ej||this.te||this.Fj||this.Yi))if(c=this.Fs,a.shiftKey){g.navigation.et();var d=g.g.YG(c,new g.g.X(a.clientX,a.clientY));d=g.F.sm(c,d);t(c.bb,d)}else g.selected&&ib(g.selected);a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.Vp){g.Yh();if(this.Tm)gb(this.Gg,this.tf,this.Cd);else if(this.gj)ab(this.ef,this.tf,this.Cd);else if(this.Um){var a=this.ni;a.Gh(this.Cd);sa(a.s)}this.I()}}; +function ba(a,c){a.Cc?(ob(a),g.wc(a.P),a.Cc.Gn(c)):a.te?a.te.Gn(c):a.Bc&&!a.P&&(g.wc(),a.Bc.Gn(c));c.preventDefault();c.stopPropagation();a.I()}function pb(a,c,d){if(a.$i)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.Bc||(a.Bc=d);a.tf=c;a.Ts(c);g.Qe&&g.navigation.cb(g.navigation.Ul)}function qb(a,c,d){if(a.$i)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.P||(a.P=d);pb(a,c,d.Lk())} +function ob(a){a.Cc&&!a.P&&cb(a.Cc)}function rb(a,c){a.Ej||a.te||(a.Ej=c,c.ec&&c!=db(c)?sb(a,db(c)):sb(a,c))}function sb(a,c){c.hb?sb(a,c.getParent()):a.Cc=c}function nb(a){if(a.Fj){var c=a.Fj;c=!!c.B&&c.B.pd()&&!!c.wf&&"function"===typeof c.wf}else c=!1;return c&&!a.Yi&&(!a.P||!a.P.wk)}b.lc=function(){return this.Um||this.gj||this.Tm};b.Kk=function(){return this.ef?this.ef.Kk():[]};g.$j.Jt=function(){for(var a=g.Ob.getAll(),c=0,d;d=a[c];c++)if(d.Kc)return!0;return!1};g.pa=function(a,c,d){this.vA=this.Oj=this.$a=null;this.Bb=new g.g.ge(0,0);this.$c=null;d&&this.nd(d);this.setValue(a);c&&(this.Oj=c)};g.pa.io=16;g.pa.Ew=12.5;g.pa.tk=10;g.pa.Yr=10;g.pa.ug=g.pa.tk/2;b=g.pa.prototype;b.name=void 0;b.fq=50;b.B=null;b.qf=!0;b.mi=!0;b.hp=null;g.pa.Mo="\u00a0";b=g.pa.prototype;b.Ef=!0;b.Ci=!1;b.nd=function(a){var c=a.tooltip;"string"==typeof c&&(c=g.g.nc(a.tooltip));c&&this.Ha(c)};b.cv=function(a){if(this.B)throw Error("Field already bound to a block.");this.B=a}; +b.U=function(){this.me||(this.me=g.g.o.K("g",{},null),this.isVisible()||(this.me.style.display="none"),this.B.za().appendChild(this.me),this.Wg(),this.nh(),this.Ha(this.vA),g.J.xk(this.hp||this.za()),this.uz=g.ca(this.hp||this.za(),"mousedown",this,this.$h),this.dj())};b.Wg=function(){tb(this);ub(this)};b.dj=function(){}; +function tb(a){a.Bb.height=Math.max(a.Bb.height,g.pa.io);a.Bb.width=Math.max(a.Bb.width,g.pa.tk);a.Nd=g.g.o.K("rect",{rx:4,ry:4,x:0,y:0,height:a.Bb.height,width:a.Bb.width},a.me)}function ub(a){a.Dc=g.g.o.K("text",{"class":"blocklyText",y:g.pa.Ew,x:a.Nd?g.pa.ug:0},a.me);a.Kj=document.createTextNode("");a.Dc.appendChild(a.Kj)}b.Fm=function(a){this.setValue(a.textContent)};b.tA=function(a){a.textContent=this.getValue();return a};b.I=function(){g.D.Ok(this);g.ba.Ok(this);this.uz&&g.Ua(this.uz);g.g.o.removeNode(this.me)}; +b.nh=function(){var a=this.hp||this.za();this.Ef&&a&&(this.B.pd()?(g.g.o.qb(a,"blocklyEditableText"),g.g.o.Tb(a,"blocklyNonEditableText"),a.style.cursor=this.vo):(g.g.o.qb(a,"blocklyNonEditableText"),g.g.o.Tb(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.mi};b.Yb=function(a){if(this.mi!=a){this.mi=a;var c=this.za();c&&(c.style.display=a?"block":"none")}};function vb(a,c){a.Oj=c}b.Gy=function(){return this.Oj};b.za=function(){return this.me};b.Ve=function(){}; +b.bh=function(){this.Kj&&(this.Kj.nodeValue=this.Bp(),this.vv())};b.vv=function(){var a=g.g.o.Lm(this.Dc);this.Nd&&(a+=g.pa.tk,this.Nd.setAttribute("width",a));this.Bb.width=a};b.Tg=function(){if(!this.isVisible())return new g.g.ge(0,0);this.qf?(this.bh(),this.qf=!1):this.mi&&0==this.Bb.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.bh());return this.Bb}; +function wb(a){var c=a.Nd.getBBox(),d=c.height*a.B.v.scale;c=c.width*a.B.v.scale;a=g.g.style.Fp(a.Nd);return{top:a.y,bottom:a.y+d,left:a.x,right:a.x+c}}b.Bp=function(){var a=this.dc();if(!a)return g.pa.Mo;a.length>this.fq&&(a=a.substring(0,this.fq-2)+"\u2026");a=a.replace(/\s/g,g.pa.Mo);this.B&&this.B.G&&(a+="\u200f");return a};b.dc=function(){if(this.Hp){var a=this.Hp.call(this);if(null!==a)return String(a)}return String(this.getValue())}; +b.kl=function(){throw Error("setText method is deprecated");};b.fn=function(){this.qf=!0};function xb(a){a.qf=!0;a.B&&a.B.ga&&(a.B.Da(),a.B.Qb())}b.setValue=function(a){if(null!==a){var c=this.Og(a);a=yb(this,a,c);if(!(a instanceof Error)){if(c=this.Gy())if(c=c.call(this,a),a=yb(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&g.i.isEnabled()&&g.i.Oa(new g.i.qg(this.B,"field",this.name||null,c,a)),this.Pg(a),this.qf&&xb(this))}}}; +function yb(a,c,d){if(null===d)return a.Rx(),a.qf&&xb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.$a};b.Og=function(a){return null===a||void 0===a?null:a};b.Pg=function(a){this.$a=a;this.qf=!0};b.Rx=function(){};b.$h=function(a){if(this.B&&this.B.v&&(a=this.B.v.Sg(a))){if(a.$i)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.Fj||(a.Fj=this)}};b.Ha=function(a){var c=this.hp||this.za();c?c.yf=a||""===a?a:this.B:this.vA=a}; +b.wn=function(){return!1};b.Yf=function(){for(var a=null,c=this.B,d=c.S,e=0;ea&&0<=c&&256>c&&0<=d&&256>d)?g.g.Ab.Uu(a,c,d):null}; +g.g.Ab.Uu=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};g.g.Ab.Ty=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +g.g.Ab.zF=function(a){var c=g.NB,d=255*g.OB,e=0,f=0,h=0;if(0==c)h=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;h=a;break;case 2:e=a;f=d;h=c;break;case 3:e=a;f=m;h=d;break;case 4:e=c;f=a;h=d;break;case 5:e=d;f=a;h=m;break;case 6:case 0:e=d,f=c,h=a}}return g.g.Ab.Uu(Math.floor(e),Math.floor(f),Math.floor(h))}; +g.g.Ab.os=function(a,c,d){a=g.g.Ab.Ty(g.g.Ab.parse(a));c=g.g.Ab.Ty(g.g.Ab.parse(c));return g.g.Ab.Uu(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])))};g.g.Ab.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"};g.g.Ml={};g.g.Ml.iG=0;g.g.Ml.wy=function(){return"blockly:"+(g.g.Ml.iG++).toString(36)};g.Eb=function(a,c,d){g.Eb.w.constructor.call(this,a||g.Eb.oo[0],c,d);this.Bb=new g.g.ge(g.Eb.rB,g.pa.io)};g.g.object.Y(g.Eb,g.pa);g.Eb.qa=function(a){return new g.Eb(a.colour,void 0,a)};g.Eb.rB=26;g.Eb.mI=g.pa.io;b=g.Eb.prototype;b.Ci=!0;b.vo="default";b.qf=!1;b.As=null;b.sA=null;b.jm=0;b.nd=function(a){g.Eb.w.nd.call(this,a);a.colourOptions&&(this.As=a.colourOptions,this.sA=a.colourTitles);a.columns&&(this.jm=a.columns)};b.Wg=function(){tb(this);this.Nd.style.fillOpacity=1;this.Nd.style.fill=this.$a}; +b.Og=function(a){return"string"!=typeof a?null:g.g.Ab.parse(a)};b.Pg=function(a){this.$a=a;this.Nd&&(this.Nd.style.fill=a)};b.dc=function(){var a=this.$a;/^#(.)\1(.)\2(.)\3$/.test(a)&&(a="#"+a[1]+a[3]+a[5]);return a};g.Eb.oo="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" "); +g.Eb.cD=[];g.Eb.po=7;b=g.Eb.prototype;b.setColumns=function(a){this.jm=a;return this};b.wf=function(){this.$g=this.ct();g.D.py().appendChild(this.$g);g.D.kA(this,this.dt.bind(this));this.$g.focus()};b.jq=function(a){a=(a=a.target)&&a.label;null!==a&&(this.setValue(a),g.D.Ok(this))}; +b.Bu=function(a){var c=!1;if(a.keyCode===g.g.ya.Zl)Hb(this,0,-1),c=!0;else if(a.keyCode===g.g.ya.El)Hb(this,0,1),c=!0;else if(a.keyCode===g.g.ya.Io)Hb(this,-1,0),c=!0;else if(a.keyCode===g.g.ya.Ro)Hb(this,1,0),c=!0;else if(a.keyCode===g.g.ya.Fl){if(c=Ib(this))c=c&&c.label,null!==c&&this.setValue(c);g.D.aj();c=!0}c&&a.stopPropagation()}; +b.dg=function(a){if(this.$g){if(a===g.navigation.bo)return Hb(this,0,-1),!0;if(a===g.navigation.ao)return Hb(this,0,1),!0;if(a===g.navigation.Rq)return Hb(this,-1,0),!0;if(a===g.navigation.Qq)return Hb(this,1,0),!0}return g.Eb.w.dg.call(this,a)}; +function Hb(a,c,d){var e=a.As||g.Eb.oo,f=a.jm||g.Eb.po,h=a.od%f,k=Math.floor(a.od/f);h+=c;k+=d;0>c?0>h&&0h&&(h=0):0f-1&&kf-1&&h--:0>d?0>k&&(k=0):0Math.floor(e.length/f)-1&&(k=Math.floor(e.length/f)-1);Jb(a,a.$g.childNodes[k].childNodes[h],k*f+h)}b.Cu=function(a){var c=(a=a.target)&&a.getAttribute("data-index");null!==c&&c!==this.od&&Jb(this,a,Number(c))};b.xG=function(){this.$g.focus()}; +b.zG=function(){this.$g.blur();var a=Ib(this);a&&g.g.o.Tb(a,"blocklyColourHighlighted")};function Ib(a){var c=a.jm||g.Eb.po,d=a.$g.childNodes[Math.floor(a.od/c)];return d?d.childNodes[a.od%c]:null}function Jb(a,c,d){var e=Ib(a);e&&g.g.o.Tb(e,"blocklyColourHighlighted");g.g.o.qb(c,"blocklyColourHighlighted");a.od=d;g.g.M.cb(a.$g,g.g.M.State.Sq,c.getAttribute("id"))} +b.ct=function(){var a=this.jm||g.Eb.po,c=this.As||g.Eb.oo,d=this.sA||g.Eb.cD,e=this.getValue(),f=document.createElement("table");f.className="blocklyColourTable";f.tabIndex=0;f.dir="ltr";g.g.M.se(f,g.g.M.If.HB);g.g.M.cb(f,g.g.M.State.Bo,!0);g.g.M.cb(f,"rowcount",Math.floor(c.length/a));g.g.M.cb(f,"colcount",a);for(var h,k=0;ktr>td {","border: .5px solid #888;","box-sizing: border-box;","cursor: pointer;","display: inline-block;","height: 20px;","padding: 0;","width: 20px;","}",".blocklyColourTable>tr>td.blocklyColourHighlighted {","border-color: #eee;","box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);","position: relative;","}",".blocklyColourSelected, .blocklyColourSelected:hover {", +"border-color: #eee !important;","outline: 1px solid #333;","position: relative;","}"]);g.vc.register("field_colour",g.Eb);g.Zj=function(a,c,d,e){this.s=a;this.tb=c;this.ng=d.getAttribute("text");this.rd=new g.g.X(0,0);this.Yg=e;this.ep=d.getAttribute("callbackKey")||d.getAttribute("callbackkey");this.yx=d.getAttribute("web-class")||null};g.Zj.Xe=5;b=g.Zj.prototype;b.width=0;b.height=0;b.Se=null; +b.Ja=function(){var a=this.Yg?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.yx&&(a+=" "+this.yx);this.H=g.g.o.K("g",{"class":a},this.s.jb);if(!this.Yg)var c=g.g.o.K("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.H);a=g.g.o.K("rect",{"class":this.Yg?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.H);var d=g.g.o.K("text",{"class":this.Yg?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.H);d.textContent=g.g.nc(this.ng); +this.Yg&&(this.nv=d,this.s.Zb.subscribe(this.nv,"flyoutText","fill"));this.width=g.g.o.Lm(d);this.height=20;this.Yg||(this.width+=2*g.Zj.Xe,c.setAttribute("width",this.width),c.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);d.setAttribute("x",this.width/2);d.setAttribute("y",this.height-g.Zj.Xe);Kb(this);this.Se=g.ca(this.H,"mouseup",this,this.EG);return this.H};b.show=function(){Kb(this);this.H.setAttribute("display","block")}; +function Kb(a){a.H.setAttribute("transform","translate("+a.rd.x+","+a.rd.y+")")}b.moveTo=function(a,c){this.rd.x=a;this.rd.y=c;Kb(this)};b.I=function(){this.Se&&g.Ua(this.Se);this.H&&g.g.o.removeNode(this.H);this.nv&&this.s.Zb.unsubscribe(this.nv)}; +b.EG=function(a){(a=this.tb.Sg(a))&&a.cancel();this.Yg&&this.ep?console.warn("Labels should not have callbacks. Label text: "+this.ng):this.Yg||this.ep&&Lb(this.tb,this.ep)?this.Yg||Lb(this.tb,this.ep)(this):console.warn("Buttons should have callbacks. Button text: "+this.ng)};g.Vc.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,},.blocklyFlyoutLabelText {,fill: #000;,}".split(","));g.Fc=function(){this.bA=g.Fc.Ex;this.Qk=null;this.cd=!1;this.Vd=this.lb=null;this.mb=[];this.ys={}};g.Fc.Ex=!1;g.Fc.Error={Uq:"Component already rendered",Cr:"Unable to set parent component",bB:"Child component index out of bounds"};b=g.Fc.prototype;b.wa=function(){return this.Qk||(this.Qk=g.g.Ml.wy())};b.va=function(){return this.lb}; +b.jl=function(a){if(this==a)throw Error(g.Fc.Error.Cr);var c;if(c=a&&this.Vd&&this.Qk)c=(c=this.Qk)?this.Vd.ys[c]||null:null;if(c&&this.Vd!=a)throw Error(g.Fc.Error.Cr);this.Vd=a};b.getParent=function(){return this.Vd};b.Ja=function(){this.lb=document.createElement("div")};b.Da=function(a){this.bh(a)};b.bh=function(a,c){if(this.cd)throw Error(g.Fc.Error.Uq);this.lb||this.Ja();a?a.insertBefore(this.lb,c||null):document.body.appendChild(this.lb);this.Vd&&!this.Vd.cd||this.lf()}; +b.lf=function(){this.cd=!0;Mb(this,function(a){!a.cd&&a.va()&&a.lf()})};b.Hh=function(){Mb(this,function(a){a.cd&&a.Hh()});this.cd=!1};b.I=function(){this.zE||(this.zE=!0,this.ym())};b.ym=function(){this.cd&&this.Hh();Mb(this,function(a){a.I()});this.lb&&g.g.o.removeNode(this.lb);this.Vd=this.lb=this.ys=this.mb=null}; +b.cm=function(a,c,d){if(a.cd&&(d||!this.cd))throw Error(g.Fc.Error.Uq);if(0>c||c>this.mb.length)throw Error(g.Fc.Error.bB);this.ys[a.wa()]=a;if(a.getParent()==this){var e=this.mb.indexOf(a);-1a&&(a=(a=this.getParent())?a.Jk()+1:0,Tb(this,a));return a};function Tb(a,c){if(c!=a.Js){a.Js=c;var d=Ub(a);if(d){var e=Vb(a)+"px";a.Wk()?d.style.paddingRight=e:d.style.paddingLeft=e}Mb(a,function(f){Tb(f,c+1)})}}b.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};b.Ih=function(){var a=[];Mb(this,function(c){a.push(c)});return a};b.select=function(){var a=this.Ne();a&&Bb(a,this)}; +function Wb(a,c){if(a.yq!=c){a.yq=c;Xb(a);var d=a.va();d&&(g.g.M.cb(d,g.g.M.State.nk,c),c&&(c=a.Ne().va(),g.g.M.cb(c,g.g.M.State.Sq,a.wa())))}}b.Le=function(){return this.Bm}; +b.Bj=function(a){var c=a!=this.Bm,d;this.Bm=a;var e=this.Ne(),f=this.va();if(Ob(this)){if(!a&&e&&this.contains(e.Wd)&&this.select(),f){if(d=Qb(this))g.g.style.Zu(d,a),g.g.M.cb(f,g.g.M.State.Bo,a),a&&this.cd&&!d.hasChildNodes()&&(Mb(this,function(h){d.appendChild(Rb(h))}),Mb(this,function(h){h.lf()}));this.Iq()}}else(d=Qb(this))&&g.g.style.Zu(d,!1);f&&(this.st().className=this.Ap());c&&(a?this.Qx():this.Px())};b.Qx=function(){};b.Px=function(){};b.toggle=function(){this.Bj(!this.Le())}; +function Rb(a){var c=a.Le()&&Ob(a),d=document.createElement("div");d.style.backgroundPosition=Yb(a);c||(d.style.display="none");c&&Mb(a,function(e){d.appendChild(Rb(e))});c=document.createElement("div");c.id=a.wa();c.appendChild(Zb(a));c.appendChild(d);return c}function Vb(a){return Math.max(0,(a.Jk()-1)*a.Zc.Yy)}function Zb(a){var c=document.createElement("div");c.className=a.Gp();c.style["padding-"+(a.Wk()?"right":"left")]=Vb(a)+"px";c.appendChild($b(a));c.appendChild(ac(a));return c} +b.Gp=function(){var a="";this.yq&&(a=" "+(this.Zc.lE||""));return this.Zc.Bx+a};function ac(a){var c=document.createElement("span");c.className=a.Zc.jE||"";c.textContent=a.dc();return c}function $b(a){var c=document.createElement("span");c.style.display="inline-block";c.className=a.Ap();return c}b.Ap=function(){throw Error("unimplemented abstract method");};function Yb(a){return(a.pu?(a.Jk()-1)*a.Zc.Yy:"-100")+"px 0"} +b.va=function(){var a=g.Ea.vd.w.va.call(this);a||(this.lb=a=document.getElementById(this.wa()));return a};function Ub(a){return(a=a.va())?a.firstChild:null}b.st=function(){var a=Ub(this);return a?a.firstChild:null};function Pb(a){return(a=Ub(a))&&a.lastChild?a.lastChild.previousSibling:null}function Qb(a){return(a=a.va())?a.lastChild:null}b.kl=function(a){this.hf=a};b.dc=function(){return this.hf};function Xb(a){var c=Ub(a);c&&(c.className=a.Gp())} +b.Iq=function(){var a=Qb(this);a&&(a.style.backgroundPosition=Yb(this))};b.Iz=function(a){"expand"==a.target.getAttribute("type")&&Ob(this)?this.Qt&&this.toggle():(this.select(),Xb(this))};b.jq=function(a){a.preventDefault()};b.Au=function(a){var c=!0;switch(a.keyCode){case g.g.ya.Ro:if(a.altKey)break;c=bc(this);break;case g.g.ya.Io:if(a.altKey)break;c=cc(this);break;case g.g.ya.El:c=dc(this);break;case g.g.ya.Zl:c=ec(this);break;default:c=!1}c&&a.preventDefault();return c}; +function dc(a){a:if(Ob(a)&&a.Le())a=a.mb[0]||null;else{for(var c=a,d;c!=a.Ne();){d=c.pu;if(null!=d){a=d;break a}c=c.getParent()}a=null}a&&a.select();return!0}function ec(a){var c=a.dl;if(null!=c)a=fc(c);else{c=a.getParent();var d=a.Ne();a=c==d||a==d?null:c}a&&a.select();return!0}function cc(a){if(Ob(a)&&a.Le()&&a.Qt)a.Bj(!1);else{var c=a.getParent();a=a.Ne();c&&c!=a&&c.select()}return!0}function bc(a){return Ob(a)?(a.Le()?(a.mb[0]||null).select():a.Bj(!0),!0):!1} +function fc(a){return a.Le()&&Ob(a)?fc(a.mb[a.mb.length-1]||null):a}function Sb(a,c){a.Ea!=c&&(a.Ea=c,Mb(a,function(d){Sb(d,c)}))};g.Ea.yh=function(a,c,d){this.ta=a;g.Ea.vd.call(this,c,d)};g.g.object.Y(g.Ea.yh,g.Ea.vd);b=g.Ea.yh.prototype;b.Ne=function(){if(this.Ea)return this.Ea;var a=this.getParent();return a&&(a=a.Ne())?(Sb(this,a),a):null};b.Ap=function(){var a=this.Le(),c=this.IE;if(a&&c)return c;c=this.AF;if(!a&&c)return c;c=this.Zc;if(Ob(this)){if(a&&c.zx)return c.mp+" "+c.zx;if(!a&&c.gE)return c.mp+" "+c.gE}else if(c.Ax)return c.mp+" "+c.Ax;return""}; +b.jq=function(){Ob(this)&&this.Qt?(this.toggle(),this.select()):this.yq?Bb(this.Ne(),null):this.select();Xb(this)};b.Iz=function(){};b.Au=function(a){if(this.Ea.ta.pf){var c={},d=g.g.ya.El,e=g.g.ya.Zl;c[g.g.ya.Ro]=this.Wk()?e:d;c[g.g.ya.Io]=this.Wk()?d:e;c[g.g.ya.Zl]=g.g.ya.Io;c[g.g.ya.El]=g.g.ya.Ro;Object.defineProperties(a,{keyCode:{value:c[a.keyCode]||a.keyCode}})}return g.Ea.yh.w.Au.call(this,a)};b.aA=function(){this.Lz&&this.Lz.call(this.ta)};b.Qx=g.Ea.yh.prototype.aA;b.Px=g.Ea.yh.prototype.aA;g.Ea.Hi=function(a,c){this.ta=a;g.Ea.vd.call(this,"",c);this.Bm=!0;Wb(this,!0);this.Wd=this};g.g.object.Y(g.Ea.Hi,g.Ea.vd);b=g.Ea.Hi.prototype;b.Ne=function(){return this};b.Jk=function(){return 0};b.mF=function(){this.iy=!0;var a=this.va();g.g.o.qb(a,"focused");this.Wd&&this.Wd.select()};b.jF=function(){this.iy=!1;var a=this.va();g.g.o.Tb(a,"focused")};b.hasFocus=function(){return this.iy};b.Le=function(){return!0};b.Bj=function(a){this.Bm=a}; +b.st=function(){var a=Ub(this);return a?a.firstChild:null};b.Iq=function(){};b.Gp=function(){return g.Ea.Hi.w.Gp.call(this)+" "+this.Zc.iE};b.Ap=function(){var a=this.Le(),c=this.IE;if(a&&c)return c;c=this.AF;if(!a&&c)return c;c=this.Zc;return a&&c.hE?c.mp+" "+c.hE:""};function Bb(a,c){if(c!=a.Wd&&(!a.Ez||a.Ez.call(a.ta,c))){var d=a.Wd;a.Wd&&Wb(a.Wd,!1);(a.Wd=c)&&Wb(c,!0);a.Dz&&a.Dz.call(a.ta,d,c)}} +b.Op=function(){g.Ea.Hi.w.Op.call(this);var a=this.va();g.g.M.se(a,g.g.M.If.dD);g.g.M.cb(a,g.g.M.State.gw,Pb(this).id)};b.lf=function(){g.Ea.Hi.w.lf.call(this);var a=this.va();a.className=this.Zc.kE;a.setAttribute("hideFocus","true");this.ks();this.Op()};b.Hh=function(){g.Ea.Hi.w.Hh.call(this);this.Ks()};b.ks=function(){var a=this.va();a.tabIndex=0;this.qG=g.ld(a,"focus",this,this.mF);this.nG=g.ld(a,"blur",this,this.jF);this.xu=g.ca(a,"click",this,this.qF);this.tG=g.ld(a,"keydown",this,this.nF)}; +b.Ks=function(){g.Ua(this.qG);g.Ua(this.nG);g.Ua(this.xu);g.Ua(this.tG)};b.qF=function(a){var c;a:{for(var d=a.target;null!=d;){if(c=g.Ea.vd.bs[d.id])break a;if(d==this.va())break;d=d.parentNode}c=null}if(c)switch(a.type){case "mousedown":c.Iz(a);break;case "click":c.jq(a)}};b.nF=function(a){var c=!1;if(c=this.Wd&&this.Wd.Au(a)||c)g.g.style.Wu(this.Wd.va(),this.va().parentNode),a.preventDefault();return c};b.createNode=function(a){return new g.Ea.yh(this.ta,a||"",this.Zc)};g.g.Rect=function(a,c,d,e){this.top=a;this.bottom=c;this.left=d;this.right=e};g.g.Rect.prototype.contains=function(a,c){return a>=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};g.Gi=function(a){this.s=a;this.G=a.options.G;this.pf=a.options.Rd;this.Ia=a.options.Ia;this.Zc={Yy:19,kE:"blocklyTreeRoot",iE:"blocklyHidden",Bx:"blocklyTreeRow",jE:"blocklyTreeLabel",mp:"blocklyTreeIcon",zx:"blocklyTreeIconOpen",Ax:"blocklyTreeIconNone",lE:"blocklyTreeSelected"};this.wA={Bx:"blocklyTreeSeparator"};this.pf&&(this.Zc.cssTreeRow+=a.G?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.wA.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.G?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"), +this.Zc.cssTreeIcon="")};b=g.Gi.prototype;b.width=0;b.height=0;b.Yk=null; +b.U=function(){var a=this.s,c=r(this.s);this.Gc=document.createElement("div");this.Gc.className="blocklyToolboxDiv blocklyNonSelectable";this.Gc.setAttribute("dir",a.G?"RTL":"LTR");c.parentNode.insertBefore(this.Gc,c);c=a.Zb;c.subscribe(this.Gc,"toolbox","background-color");c.subscribe(this.Gc,"toolboxText","color");g.ca(this.Gc,"mousedown",this,function(d){g.g.jj(d)||d.target==this.Gc?g.wc(!1):g.wc(!0);g.Touch.Bh()},!1,!0);c={Ng:a.options.Ng,Sb:a,G:a.G,Hd:a.options.Hd,Rd:a.Rd,Ia:a.options.Ia,dh:a.options.dh}; +this.P=null;if(a.Rd){if(!g.Kl)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new g.Kl(c)}else{if(!g.Fg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new g.Fg(c)}g.g.o.ej(this.P.Ja("svg"),r(this.s));this.P.U(a);this.Zc.cleardotPath=a.options.uf+"1x1.gif";this.Zc.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.G?"Rtl":"Ltr");gc(this,a.options.Xk)}; +function gc(a,c){a.Id&&(a.Id.I(),a.Yk=null);var d=new g.Ea.Hi(a,a.Zc);a.Id=d;Bb(d,null);d.Ez=a.iF;d.Dz=a.hF;var e=null;if(c){a.Id.Of=[];a.Dt=!1;e=hc(a,c,a.Id,a.s.options.uf);if(a.Id.Of.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");ic(a.s)}d.Da(a.Gc);e&&Bb(d,e);jc(a);a.position();a.pf&&g.g.M.cb(a.Id.va(),g.g.M.State.yC,"horizontal")} +b.iF=function(a){if(a==this.Id)return!1;this.Yk&&(Ub(this.Yk).style.backgroundColor="");if(a){var c=a.Nk||"#57e";Ub(a).style.backgroundColor=c;jc(this,a)}return!0};b.hF=function(a,c){c&&c.Of&&c.Of.length?(this.P.show(c.Of),this.Yk!=c&&this.P.yc.set(0),g.Qe&&g.navigation.cb(g.navigation.Or)):(this.P.Ga(),!g.Qe||c instanceof g.Gi.Ur||g.navigation.cb(g.navigation.Ul));a!=c&&a!=this&&(a=new g.i.Bd(null,"category",a&&a.dc(),c&&c.dc()),a.Ec=this.s.id,g.i.Oa(a));c&&(this.Yk=c)};b.tF=function(){g.ol(this.s)}; +b.dg=function(a){var c=this.Id.Wd;if(!c)return!1;switch(a.name){case g.navigation.gb.Ee:return ec(c);case g.navigation.gb.Qo:return cc(c);case g.navigation.gb.Ce:return dc(c);case g.navigation.gb.Fo:return bc(c);default:return!1}};b.I=function(){this.P.I();this.Id.I();this.s.Zb.unsubscribe(this.Gc);g.g.o.removeNode(this.Gc);this.Yk=this.s=null};b.Zf=function(){return this.width};b.vy=function(){return this.height}; +b.position=function(){var a=this.Gc;if(a){var c=r(this.s);c=g.rA(c);this.pf?(a.style.left="0",a.style.height="auto",a.style.width=c.width+"px",this.height=a.offsetHeight,this.Ia==g.Dg?a.style.top="0":a.style.bottom="0"):(this.Ia==g.Cg?a.style.right="0":a.style.left="0",a.style.height=c.height+"px",this.width=a.offsetWidth);this.P.position()}}; +function hc(a,c,d,e){for(var f=null,h=null,k=0,l;l=c.childNodes[k];k++)if(l.tagName)switch(l.tagName.toUpperCase()){case "CATEGORY":var m=g.g.nc(l.getAttribute("name"));h=a.Id.createNode(m);h.Lz=a.tF;h.Of=[];d.add(h);var n=l.getAttribute("custom");n?h.Of=n:(n=hc(a,l,h,e))&&(f=n);var u=l.getAttribute("categorystyle");if((n=l.getAttribute("colour"))&&u)h.Nk="",console.warn('Toolbox category "'+m+'" can not have both a style and a colour');else if(u){n=a;var v=h;v.sM=u;var w=n.s.Ip();u&&w&&((w=w.LD[u])&& +w.Ab?kc(n,w.Ab,v,m):console.warn('Style "'+u+'" must exist and contain a colour value'))}else kc(a,n,h,m);"true"==l.getAttribute("expanded")?(h.Of.length&&(f=h),h.Bj(!0)):h.Bj(!1);h=l;break;case "SEP":if(h&&"CATEGORY"==h.tagName.toUpperCase()){d.add(new g.Gi.Ur(a.wA));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":d.Of.push(l),h=l}return f} +function kc(a,c,d,e){c=g.g.nc(c);if(null===c||""===c)d.Nk="";else{var f=Number(c);isNaN(f)?(f=g.g.Ab.parse(c))?(d.Nk=f,a.Dt=!0):(d.Nk="",console.warn('Toolbox category "'+e+'" has unrecognized colour attribute: '+c)):(d.Nk=g.Xy(f),a.Dt=!0)}}function jc(a,c){c=(c||a.Id).Ih(!1);for(var d=0,e;e=c[d];d++){var f=Ub(e);if(f){var h=a.Dt?"8px solid "+(e.Nk||"#ddd"):"none";a.s.G?f.style.borderRight=h:f.style.borderLeft=h}jc(a,e)}} +b.Hm=function(){if(!this.Gc)return null;var a=this.Gc.getBoundingClientRect(),c=a.top,d=c+a.height,e=a.left;a=e+a.width;return this.Ia==g.Dg?new g.g.Rect(-1E7,d,-1E7,1E7):this.Ia==g.Ei?new g.g.Rect(c,1E7,-1E7,1E7):this.Ia==g.Md?new g.g.Rect(-1E7,1E7,-1E7,a):new g.g.Rect(-1E7,1E7,e,1E7)};g.Gi.Ur=function(a){g.Ea.yh.call(this,null,"",a)};g.g.object.Y(g.Gi.Ur,g.Ea.yh); +g.Vc.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", +"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);g.i.Hl=function(a){this.Ec=a.id;this.group=g.i.cc();this.Rc=!1};g.g.object.Y(g.i.Hl,g.i.Abstract);g.i.Hl.prototype.type=g.i.BB;g.i.Hl.prototype.eb=function(){var a={type:this.type};this.group&&(a.group=this.group);this.Ec&&(a.workspaceId=this.Ec);return a};g.i.Hl.prototype.qa=function(a){this.Ec=a.workspaceId;this.group=a.group};g.R={};g.R.DA=function(a){var c=H,d=g.g.xml.createElement("xml"),e=g.R.BH(g.O.Tw(c));e.hasChildNodes()&&d.appendChild(e);var f=xa(c,!0);e=0;for(var h;h=f[e];e++)d.appendChild(h.ov(a));c=A(c,!0);for(e=0;f=c[e];e++)d.appendChild(g.R.qs(f,a));return d};g.R.BH=function(a){for(var c=g.g.xml.createElement("variables"),d=0,e;e=a[d];d++){var f=g.g.xml.createElement("variable");f.appendChild(g.g.xml.createTextNode(e.name));e.type&&f.setAttribute("type",e.type);f.id=e.wa();c.appendChild(f)}return c}; +g.R.qs=function(a,c){var d;a.v.G&&(d=a.v.Zf());c=g.R.zh(a,c);var e=a.Ta();c.setAttribute("x",Math.round(a.v.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};g.R.KE=function(a){var c=!1;a.name&&(a.Ci?c=!0:a.Ef&&(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=g.g.xml.createElement("field"),c.setAttribute("name",a.name),a.tA(c)):null}; +g.R.wD=function(a,c){for(var d=0,e;e=a.S[d];d++)for(var f=0,h;h=e.Na[f];f++)(h=g.R.KE(h))&&c.appendChild(h)}; +g.R.zh=function(a,c){var d=g.g.xml.createElement(a.hb?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.Pa){var e=a.Pa();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}g.R.wD(a,d);if(e=a.He.text){var f=a.He.size,h=a.He.Ku,k=g.g.xml.createElement("comment");k.appendChild(g.g.xml.createTextNode(e));k.setAttribute("pinned",h);k.setAttribute("h",f.height);k.setAttribute("w",f.width);d.appendChild(k)}a.data&&(e=g.g.xml.createElement("data"),e.appendChild(g.g.xml.createTextNode(a.data)), +d.appendChild(e));for(f=0;h=a.S[f];f++){var l;k=!0;if(h.type!=g.vg){var m=C(h.connection);h.type==g.Ra?l=g.g.xml.createElement("value"):h.type==g.Sa&&(l=g.g.xml.createElement("statement"));e=h.connection.vf;!e||m&&m.hb||l.appendChild(g.R.ix(e,c));m&&(l.appendChild(g.R.zh(m,c)),k=!1);l.setAttribute("name",h.name);k||d.appendChild(l)}}void 0!=a.Xg&&a.Xg!=a.GF&&d.setAttribute("inline",a.Xg);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.pe()||a.hb||d.setAttribute("deletable", +!1);a.Nc()||a.hb||d.setAttribute("movable",!1);a.pd()||d.setAttribute("editable",!1);if(f=q(a))l=g.g.xml.createElement("next"),l.appendChild(g.R.zh(f,c)),d.appendChild(l);e=a.V&&a.V.vf;!e||f&&f.hb||l.appendChild(g.R.ix(e,c));return d}; +g.R.ix=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==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&g.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==g.g.o.Node.TEXT_NODE&&""==e.data.trim()&&g.g.o.removeNode(e))}return a}; +g.R.Dd=function(a){a=g.g.xml.Dd(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1 $2")}while(a!=d);return a};g.R.PL=function(a){a=g.R.Dd(a).split("<");for(var c="",d=1;d"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +g.R.lh=function(a){var c=g.g.xml.oH(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};g.R.LL=function(a,c){c.Sc(!1);c.clear();a=g.R.Fh(a,c);c.Sc(!0);return a}; +g.R.Fh=function(a,c){if(a instanceof g.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.Zf());d=[];g.g.o.Jn();var f=a.childNodes.length,h=g.i.cc();h||g.i.aa(!0);c.Sc&&c.Sc(!1);var k=!0;try{for(var l=0;l=this.s.options.gq)){a={scrollbars:!0,Ng:this.s.options.Ng,Sb:this.s,G:this.s.G,Hd:this.s.options.Hd,dh:this.s.options.dh};if(this.s.Rd){a.Ia=this.s.Ia==g.Dg?g.Ei:g.Dg;if(!g.Kl)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new g.Kl(a)}else{a.Ia=this.s.Ia==g.Cg?g.Md:g.Cg;if(!g.Fg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new g.Fg(a)}Ba(this.s,this.pG.bind(this))}};b=g.Tr.prototype;b.Ii=47;b.ho=44;b.hk=16;b.pr=20; +b.Ol=20;b.Ko=10;b.Mr=0;b.Nr=32;b.KB=.1;b.Pt=!1;b.hq=0;b.H=null;b.Dq=null;b.Wt=0;b.Xh=0;b.$m=0;b.vl=0; +b.Ja=function(){this.H=g.g.o.K("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=g.g.o.K("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.H);g.g.o.K("rect",{width:this.Ii,height:this.ho,y:this.hk},c);var d=g.g.o.K("image",{width:g.Ad.width,x:-this.Mr,height:g.Ad.height,y:-this.Nr,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.H);d.setAttributeNS(g.g.o.bf,"xlink:href",this.s.options.uf+g.Ad.url);c=g.g.o.K("clipPath",{id:"blocklyTrashLidClipPath"+a},this.H); +g.g.o.K("rect",{width:this.Ii,height:this.hk},c);this.Dq=g.g.o.K("image",{width:g.Ad.width,x:-this.Mr,height:g.Ad.height,y:-this.Nr,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.H);this.Dq.setAttributeNS(g.g.o.bf,"xlink:href",this.s.options.uf+g.Ad.url);g.ca(this.H,"mouseup",this,this.click);g.ld(d,"mouseover",this,this.aG);g.ld(d,"mouseout",this,this.ZF);this.ds();return this.H}; +b.U=function(a){0this.hq&&1>this.Xh&&(this.Wt=setTimeout(this.ds.bind(this),20))};function nc(a,c){var d=a.s.Ia==g.Cg||a.s.Rd&&a.s.G;a.Dq.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.Ii-4)+","+(a.hk-2)+")")}b.close=function(){$a(this,!1)}; +b.click=function(){if(this.Pi.length){for(var a=[],c=0,d;d=this.Pi[c];c++)a[c]=g.R.lh(d);this.P.show(a)}};b.aG=function(){this.Pi.length&&$a(this,!0)};b.ZF=function(){$a(this,!1)}; +b.pG=function(a){if(!(0>=this.s.options.gq)&&a.type==g.i.fo&&"shadow"!=a.wu.tagName.toLowerCase()){for(var c=a=a.wu.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=g.R.Dd(a);if(-1==this.Pi.indexOf(a)){for(this.Pi.unshift(a);this.Pi.length>this.s.options.gq;)this.Pi.pop();this.hq=this.KB;nc(this,45*this.hq)}}};g.N=Object.create(null);g.ua=function(a,c){this.B=a;this.type=c};g.ua.no=0;g.ua.tw=1;g.ua.ww=2;g.ua.vw=3;g.ua.rw=4;g.ua.sw=5;g.ua.uw=6;b=g.ua.prototype;b.ka=null;b.Ig=null;b.vf=null;b.$b=0;b.fb=0; +b.ff=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=C(c),h=c.vf;c.vf=null;if(f.hb)h=g.R.zh(f),f.I(),f=null;else if(c.type==g.Ra){if(!f.L)throw Error("Orphan block does not have an output connection.");var k=g.ua.kz(e,f);k&&(f.L.connect(k),f=null)}else if(c.type==g.Sa){if(!f.$)throw Error("Orphan block does not have a previous connection.");for(k=e;k.V;){var l=q(k);if(l&&!l.hb)k=l;else{oc(f.$,k.V)&&(k.V.connect(f.$),f=null);break}}}if(f&&(c.disconnect(), +g.i.Rc)){var m=g.i.cc();setTimeout(function(){f.v&&!f.getParent()&&(g.i.aa(m),f.L?f.L.kq(c):f.$&&f.$.kq(c),g.i.aa(!1))},g.jo)}c.vf=h}var n;g.i.isEnabled()&&(n=new g.i.Bl(e));g.ua.ZD(c,a);e.jl(d);n&&(n.yj(),g.i.Oa(n))};b.I=function(){if(this.isConnected()){this.vf=null;var a=C(this);a.hb?a.I():D(a)}};function G(a){return a.type==g.Ra||a.type==g.Sa}b.isConnected=function(){return!!this.ka}; +function Eb(a,c){if(!c)return g.ua.vw;if(G(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?g.ua.tw:c.type!=g.kk[a.type]?g.ua.ww:d&&e&&d.v!==e.v?g.ua.sw:oc(a,c)?d.hb&&!e.hb?g.ua.uw:g.ua.no:g.ua.rw} +function Fb(a,c){switch(Eb(a,c)){case g.ua.no:break;case g.ua.tw:throw Error("Attempted to connect a block to itself.");case g.ua.sw:throw Error("Blocks not on same workspace.");case g.ua.ww:throw Error("Attempt to connect incompatible types.");case g.ua.vw:throw Error("Target connection is null.");case g.ua.rw:throw Error("Connection checks failed. "+(a+" expected "+a.Ig+", found "+c.Ig));case g.ua.uw:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!"); +}}b.Tp=function(a){if(a.B.Sh()||Eb(this,a)!=g.ua.no)return!1;switch(a.type){case g.$e:return this.ka||-1!=g.zm.indexOf(a)?a=!1:a.ka?(a=C(a),a=a.Sh()?!(a.$&&C(a.$)):!1):a=!0,a;case g.Ze:if(a.isConnected()&&!C(a).Sh()||this.isConnected())return!1;break;case g.Ra:if(a.isConnected()&&!C(a).Nc()&&!C(a).hb)return!1;break;case g.Sa:if(a.isConnected()&&!this.B.V&&!C(a).hb&&C(a).V)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=g.zm.indexOf(a)?!1:!0};b.kq=function(){}; +b.connect=function(a){if(this.ka!=a){Fb(this,a);var c=g.i.cc();c||g.i.aa(!0);G(this)?this.ff(a):a.ff(this);c||g.i.aa(!1)}};g.ua.ZD=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ka=c;c.ka=a};g.ua.eH=function(a,c){for(var d=!1,e=0;ec||c>a.Na.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new g.ce(d));d.cv(a.B);a.B.ga&&d.U();d.name=e;d.Lu&&(c=rc(a,c,d.Lu));a.Na.splice(c,0,d);++c;d.mv&&(c=rc(a,c,d.mv));a.B.ga&&(a.B.Da(),a.B.Qb());return c}b.isVisible=function(){return this.mi}; +b.Yb=function(a){var c=[];if(this.mi==a)return c;for(var d=(this.mi=a)?"block":"none",e=0,f;f=this.Na[e];e++)f.Yb(a);if(this.connection){if(a)c=sc(this.connection);else if(e=this.connection,tc(e,!0),e.ka)for(e=p(C(e),!1),f=0;f=d)this.Mi=g.Xy(d);else if(d=g.g.Ab.parse(c))this.Mi=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);}; +function J(a,c){var d=a.v.Ip().FD[c];if(d)a.kx=d.colourSecondary,a.lx=d.colourTertiary,a.Vg=d.Vg,a.ed(d.colourPrimary);else throw Error("Invalid style name: "+c);}function B(a,c){for(var d=0,e;e=a.S[d];d++)for(var f=0,h;h=e.Na[f];f++)if(h.name==c)return h;return null}b.Bt=function(){for(var a=[],c=0,d;d=this.S[c];c++)for(var e=0,f;f=d.Na[e];e++)f.wn()&&a.push(f.getValue());return a}; +b.Ug=function(){for(var a=[],c=0,d;d=this.S[c];c++)for(var e=0,f;f=d.Na[e];e++)f.wn()&&(f=this.v.mf(f.getValue()))&&a.push(f);return a};b.Jq=function(a){for(var c=0,d;d=this.S[c];c++)for(var e=0,f;f=d.Na[e];e++)f.wn()&&a.wa()==f.getValue()&&xb(f)};b.tq=function(a,c){for(var d=0,e;e=this.S[d];d++)for(var f=0,h;h=e.Na[f];f++)h.wn()&&a==h.getValue()&&h.setValue(c)};function z(a,c){return(a=B(a,c))?a.getValue():null} +function xc(a,c,d){a=B(a,d);if(!a)throw Error('Field "'+d+'" not found.');a.setValue(c)}b.Ac=function(a,c){if(a){void 0===c&&(c=null);if(!this.$){if(this.L)throw Error("Remove output connection prior to adding previous connection.");this.$=this.dn(g.$e)}this.$.Za(c)}else if(this.$){if(this.$.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.$.I();this.$=null}}; +b.zc=function(a,c){if(a)void 0===c&&(c=null),this.V||(this.V=this.dn(g.Sa)),this.V.Za(c);else if(this.V){if(this.V.isConnected())throw Error("Must disconnect next statement before removing connection.");this.V.I();this.V=null}}; +b.td=function(a,c){if(a){void 0===c&&(c=null);if(!this.L){if(this.$)throw Error("Remove previous connection prior to adding output connection.");this.L=this.dn(g.Ze)}this.L.Za(c)}else if(this.L){if(this.L.isConnected())throw Error("Must disconnect output value before removing connection.");this.L.I();this.L=null}};b.re=function(a){this.Xg!=a&&(g.i.Oa(new g.i.qg(this,"inline",null,this.Xg,a)),this.Xg=a)}; +function qc(a){if(void 0!=a.Xg)return a.Xg;for(var c=1;ca&&(d=d.substring(0,a-3)+"...");return d};function K(a,c){return a.cf(g.Ra,c)} +function L(a,c){return a.cf(g.vg,c||"")} +function zc(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.Vg&&(a.Vg=c.style.Vg,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{J(a,e)}catch(F){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.ed(e)}catch(F){console.warn(d+ +"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){for(var f=a,h=c["args"+e]||[],k=c["lastDummyAlign"+e],l=g.g.sH(c["message"+e]),m=[],n=0,u=[],v=0;v=w||w>h.length)throw Error('Block "'+f.type+'": Message index %'+w+" out of range.");if(m[w])throw Error('Block "'+f.type+'": Message index %'+w+" duplicated.");m[w]=!0;n++;u.push(h[w-1])}else(w=w.trim())&&u.push(w)}if(n!=h.length)throw Error('Block "'+f.type+'": Message does not reference all '+ +h.length+" arg(s).");u.length&&("string"==typeof u[u.length-1]||g.g.ib.startsWith(u[u.length-1].type,"field_"))&&(v={type:"input_dummy"},k&&(v.align=k),u.push(v));k={LEFT:g.Tq,RIGHT:g.co,CENTRE:g.zv};h=[];for(v=0;v=this.S.length)throw RangeError("Input index "+a+" out of bounds.");if(c>this.S.length)throw RangeError("Reference input "+c+" out of bounds.");var d=this.S[a];this.S.splice(a,1);ac?d-1:c},a.od)}function Gc(a,c,d){var e=a.mb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var h=a.mb[d]||null;if(h&&h.isEnabled()){Cc(a,d);break}f++;d=c.call(a,d,e)}}b.sF=function(a){(a=Dc(this,a.target))&&a.isEnabled()&&(this.mb[this.od]||null)!==a&&(Ec(this),this.ih(a))};b.kF=function(a){var c=Dc(this,a.target),d;if(d=c)c.isEnabled()&&(c.ih(!0),Ic(c)),d=void 0;d&&a.preventDefault()}; +b.pF=function(){this.focus()};b.rF=function(){this.va()&&(this.blur(),Ec(this),Cc(this,-1))};b.Ct=function(a){return 0!=this.mb.length&&Jc(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};function Jc(a,c){var d=a.mb[a.od]||null;if(d&&"function"==typeof d.Ct&&d.Ct(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case g.g.ya.Fl:d&&Ic(d);break;case g.g.ya.Zl:Hc(a);break;case g.g.ya.El:Fc(a);break;default:return!1}return!0};g.Lo=function(a,c){g.Fc.call(this);this.hf=a;this.setValue(c);this.up=!0};g.g.object.Y(g.Lo,g.Fc);b=g.Lo.prototype; +b.Ja=function(){var a=document.createElement("div");a.id=this.wa();this.lb=a;a.className="goog-menuitem goog-option "+(this.up?"":"goog-menuitem-disabled ")+(this.xs?"goog-option-selected ":"")+(this.Wk()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.gm){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Kc(this));g.g.M.se(a,this.Vu||(this.gm?g.g.M.If.pC: +g.g.M.If.oC));g.g.M.cb(a,g.g.M.State.nk,this.gm&&this.xs||!1)};function Kc(a){a=a.hf;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.$a=a};b.getValue=function(){return this.$a};b.se=function(a){this.Vu=a};function Lc(a,c){if(a.gm){a.xs=c;var d=a.va();d&&a.isEnabled()&&(c?(g.g.o.qb(d,"goog-option-selected"),g.g.M.cb(d,g.g.M.State.nk,!0)):(g.g.o.Tb(d,"goog-option-selected"),g.g.M.cb(d,g.g.M.State.nk,!1)))}} +b.ih=function(a){var c=this.va();c&&this.isEnabled()&&(a?g.g.o.qb(c,"goog-menuitem-highlight"):g.g.o.Tb(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.up};b.sd=function(a){this.up=a;(a=this.va())&&(this.up?g.g.o.Tb(a,"goog-menuitem-disabled"):g.g.o.qb(a,"goog-menuitem-disabled"))};function Ic(a){a.gm&&Lc(a,!a.xs);a.Rw&&a.Rw.call(a.tD,a)}function Mc(a,c,d){a.Rw=c;a.tD=d};g.g.Hq={};g.g.Hq.Tg=function(a){a=a.va();var c=g.g.style.Tg(a);c.height=a.scrollHeight;return c};g.g.Hq.uD=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};g.Fa={};g.Fa.np=null;g.Fa.Xx=null;g.Fa.show=function(a,c,d){g.ba.show(g.Fa,d,null);if(c.length){var e=g.Fa.KG(c,d);g.Fa.rd(e,a,d);setTimeout(function(){e.va().focus()},1);g.Fa.np=null}else g.Fa.Ga()};g.Fa.KG=function(a,c){var d=new g.wi;Nb(d,c);for(var e=0,f;f=a[e];e++){var h=new g.Lo(f.text);Nb(h,c);d.cm(h,d.mb.length,!0);h.sd(f.enabled);f.enabled&&Mc(h,function(){g.Fa.Ga();this.Gb()},f)}return d}; +g.Fa.rd=function(a,c,d){var e=g.g.gF();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};g.Fa.fE(a);var f=g.g.Hq.Tg(a);d&&g.g.Hq.uD(e,c,f);g.ba.LG(e,c,f,d);a.va().focus()};g.Fa.fE=function(a){a.Da(g.ba.Ca);var c=a.va();g.g.o.qb(c,"blocklyContextMenu");g.ca(c,"contextmenu",null,g.g.jG);a.focus()};g.Fa.Ga=function(){g.ba.Ok(g.Fa);g.Fa.np=null;g.Fa.Xx&&g.Ua(g.Fa.Xx)}; +g.Fa.cp=function(a,c){return function(){g.i.disable();try{var d=g.R.Vi(c,a.v),e=a.Ta();e.x=a.G?e.x-g.zd:e.x+g.zd;e.y+=2*g.zd;d.moveBy(e.x,e.y)}finally{g.i.enable()}g.i.isEnabled()&&!d.hb&&g.i.Oa(new g.i.mo(d));d.select()}};g.Fa.CD=function(a){var c=p(a,!1).length,d=q(a);d&&(c-=p(d,!1).length);return{text:1==c?g.h.DELETE_BLOCK:g.h.DELETE_X_BLOCKS.replace("%1",String(c)),enabled:!0,Gb:function(){g.i.aa(!0);a.I(!0,!0);g.i.aa(!1)}}}; +g.Fa.ED=function(a){return{enabled:!("function"==typeof a.Lb?!a.Lb():!a.Lb),text:g.h.HELP,Gb:function(){var c="function"==typeof a.Lb?a.Lb():a.Lb;c&&window.open(c)}}};g.Fa.DD=function(a){var c=Aa(a.v)?za(a.v,g.g.nt(a,!0)):!0;return{text:g.h.DUPLICATE_BLOCK,enabled:c,Gb:function(){g.Tx(a)}}};g.Fa.BD=function(a){var c={enabled:!g.g.userAgent.wg};a.Bk?(c.text=g.h.REMOVE_COMMENT,c.Gb=function(){a.ii(null)}):(c.text=g.h.ADD_COMMENT,c.Gb=function(){a.ii("")});return c}; +g.Fa.ML=function(a){return{text:g.h.QK,enabled:!0,Gb:function(){g.i.aa(!0);a.I(!0,!0);g.i.aa(!1)}}};g.Fa.NL=function(a){return{text:g.h.zI,enabled:!0,Gb:function(){g.Tx(a)}}}; +g.Fa.vM=function(a,c){if(!g.rk)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!g.g.userAgent.wg};d.text=g.h.IH;d.Gb=function(){var e=new g.rk(a,g.h.FL,g.rk.qB,g.rk.qB),f=aa(a).getBoundingClientRect();f=new g.g.X(c.clientX-f.left,c.clientY-f.top);var h=g.g.Jm(a.jb);f=g.g.X.xm(f,h);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ga&&(e.Td(),e.Da(),e.select())};return d};g.Ag=function(a,c){g.Ag.w.constructor.call(this,a,c);this.Tf=a.v.lp[c];this.Cx=a.v.lp[g.kk[c]];this.rj=new g.g.X(0,0);this.Oh=!1;this.Vy=!this.Tf};g.g.object.Y(g.Ag,g.ua);b=g.Ag.prototype;b.I=function(){g.Ag.w.I.call(this);this.Oh&&Nc(this.Tf,this)};function Oc(a,c){var d=a.$b-c.$b;a=a.fb-c.fb;return Math.sqrt(d*d+a*a)} +function Gb(a,c){if(!a.B.v.lc()){var d=db(a.B);if(!d.ec){var e=!1;if(!d.Nc()){d=db(c.B);if(!d.Nc())return;c=a;e=!0}var f=g.selected==d;f||d.Yo();var h=c.$b+g.zd+Math.floor(Math.random()*g.Xq)-a.$b,k=c.fb+g.zd+Math.floor(Math.random()*g.Xq)-a.fb;e&&(k=-k);d.G&&(h=c.$b-g.zd-Math.floor(Math.random()*g.Xq)-a.$b);d.moveBy(h,k);f||d.yn()}}}b.moveTo=function(a,c){this.Oh&&Nc(this.Tf,this);this.$b=a;this.fb=c;this.Vy||Pc(this.Tf,this)};b.moveBy=function(a,c){this.moveTo(this.$b+a,this.fb+c)}; +function Qc(a,c){a.moveTo(c.x+a.rj.x,c.y+a.rj.y)}function Rc(a,c,d){a.rj.x=c;a.rj.y=d}function Sc(a){var c=a.ka.$b-a.$b,d=a.ka.fb-a.fb;if(0!=c||0!=d){a=C(a);var e=a.za();if(!e)throw Error("block is not rendered.");e=g.g.Me(e);a.za().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");bb(a,-c,-d)}} +b.closest=function(a,c){var d=this.Cx;if(d.ic.length){var e=this.fb,f=this.$b;this.$b=f+c.x;this.fb=e+c.y;var h=Tc(d,this);c=null;for(var k=a,l,m=h-1;0<=m&&Math.abs(d.ic[m].fb-this.fb)<=a;)l=d.ic[m],this.Tp(l,k)&&(c=l,k=Oc(l,this)),m--;for(;hc?!1:g.Ag.w.Tp.call(this,a)};b.kq=function(a){Gb(this,a)};b.Qs=function(a,c){g.Ag.w.Qs.call(this,a,c);a.ga&&a.Da();c.ga&&(mc(c),c.Da())}; +b.Tu=function(){var a=this.B,c=this.vf;if(a.v&&c&&g.i.Rc){g.Ag.w.Tu.call(this);c=C(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Td();c.Da(!1);a.ga&&a.Da()}};b.zz=function(a){return Uc(this.Cx,this,a)};b.ff=function(a){g.Ag.w.ff.call(this,a);var c=this.B;a=a.B;c.ga&&mc(c);a.ga&&mc(a);c.ga&&a.ga&&(this.type==g.Sa||this.type==g.$e?a.Da():c.Da())};b.Fz=function(){this.isConnected()&&!oc(this,this.ka)&&(D(G(this)?C(this):this.B),this.B.Qb())};g.xa=function(a,c,d){this.H=g.g.o.K("g",{},null);this.H.Rn="";this.uj=a.eh.qz(this.H);this.On=this.uj.Nn||null;this.Yd=this.uj.ml||null;this.Hj=this.uj.Pn||null;this.Yd.yf=this;this.ga=!1;this.Yn=g.g.fj()&&!!a.je;g.J.xk(this.Yd);g.xa.w.constructor.call(this,a,c,d);this.H.dataset&&(this.H.dataset.id=this.id);this.$c=null};g.g.object.Y(g.xa,g.lo);g.xa.prototype.height=0;g.xa.prototype.width=0;g.xa.prototype.$d=null;g.xa.iJ=-1;g.xa.Yq="TEMP_COLLAPSED_WARNING_";g.xa.LC=10;g.xa.vr=25;g.xa.xh=8; +g.xa.Bg=!1;b=g.xa.prototype;b.Td=function(){if(!this.v.ga)throw TypeError("Workspace is headless.");for(var a=0,c;c=this.S[a];a++)c.U();c=Wa(this);for(a=0;a=a.ic.length)return-1;for(var e=c.fb,f=d;0<=f&&a.ic[f].fb==e;){if(a.ic[f]==c)return f;f--}for(;dc.fb)e=f;else{d=f;break}}return d}function Nc(a,c){if(!c.Oh)throw Error("Connection not in database.");var d=$c(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Oh=!1;a.ic.splice(d,1)} +function Uc(a,c,d){function e(n){var u=h-f[n].$b,v=k-f[n].fb;Math.sqrt(u*u+v*v)<=d&&m.push(f[n]);return v document.");}else a=null;return a};g.ie=function(a,c){g.ie.w.constructor.call(this,a,c);this.Xp=!1;this.Ge={};this.mA=this.tn=0;this.Du=null};g.g.object.Y(g.ie,g.$j);g.ie.rD=5;g.ie.sD=6;b=g.ie.prototype;b.Ts=function(a){g.ie.w.Ts.call(this,a);!this.Vp&&g.Touch.aq(a)&&bd(this,a)};b.xk=function(a){this.Du=g.ca(document,"mousedown",null,this.uF.bind(this),!0);this.lq=g.ca(document,"mousemove",null,this.Nm.bind(this),!0);this.mq=g.ca(document,"mouseup",null,this.Kp.bind(this),!0);a.preventDefault();a.stopPropagation()}; +b.uF=function(a){!this.lc()&&g.Touch.aq(a)&&(bd(this,a),this.Xp&&g.Yh())};b.Nm=function(a){if(this.lc())g.Touch.ev(a)&&g.ie.w.Nm.call(this,a);else if(this.Xp){if(g.Touch.aq(a)){this.Ge[g.Touch.Jp(a)]=cd(this,a);var c=Object.keys(this.Ge);if(2==c.length){c=g.g.X.Ox(this.Ge[c[0]],this.Ge[c[1]])/this.mA;if(0this.tn){var d=c-this.tn;d=0Object.keys(this.Ge).length&&(this.Ge={},this.tn=0)}!this.Xp||this.lc()?g.Touch.ev(a)&&g.ie.w.Kp.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){g.ie.w.I.call(this);this.Du&&g.Ua(this.Du)};function bd(a,c){a.Ge[g.Touch.Jp(c)]=cd(a,c);var d=Object.keys(a.Ge);2==d.length&&(a.mA=g.g.X.Ox(a.Ge[d[0]],a.Ge[d[1]]),a.Xp=!0,c.preventDefault())} +function cd(a,c){return a.Bc?new g.g.X(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};g.Mw=function(a){this.Hu=a;this.Tl=Object.create(null)};b=g.Mw.prototype;b.Tt=null;b.I=function(){this.Tl=this.Hu=null};b.load=function(a,c){if(a.length){try{var d=new g.g.global.Audio}catch(l){return}for(var e,f=0;f=ya(a)))if(a.Kc&&a.Kc.cancel(),"comment"==c.tagName.toLowerCase()){g.i.disable();try{var d=g.rk.Fm(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{g.i.enable()}d.select()}else a:{g.i.disable();try{var h=g.R.Vi(c,a),k=a.fc.Wb;if(g.Qe&&k){g.navigation.az(h,k.sa);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=y(a,!1);d=0;for(var u;u=n[d];d++){var v=u.Ta();if(1>=Math.abs(l-v.x)&&1>=Math.abs(m-v.y)){c=!0;break}}if(!c){var w=h.Ke(!1);d=0;for(var F;F=w[d];d++)if(F.closest(g.zd,new g.g.X(l,m)).connection){c=!0;break}}c&&(l=a.G?l-g.zd:l+g.zd,m+=2*g.zd)}while(c);h.moveBy(l,m)}}finally{g.i.enable()}g.i.isEnabled()&&!h.hb&&g.i.Oa(new g.i.mo(h));h.select()}} +function kd(a){if((a=a.qe?a.Jj:a)&&!a.Kc&&a.ta&&a.ta.P){a=a.ta;var c=a.Id.Wd;c&&c.Of&&a.P.show(c.Of)}}b.ei=function(a,c){g.pb.w.ei.call(this,a,c);kd(this)};b.Vf=function(a){g.pb.w.Vf.call(this,a);kd(this)};b.Pd=function(a,c,d){a=g.pb.w.Pd.call(this,a,c,d);kd(this);return a};function ed(a){a.Gx=a.fd&&a.H.parentNode?a.fd.Hm():null;a.Fx=a.P?a.P.Hm():a.ta?a.ta.Hm():null}function Ya(a,c){return a.Gx&&a.Gx.contains(c.clientX,c.clientY)?g.cr:a.Fx&&a.Fx.contains(c.clientX,c.clientY)?g.Qv:g.Pv} +b.$h=function(a){var c=this.Sg(a);c&&pb(c,a,this)};b.iv=function(a,c){a=g.g.ln(a,r(this),qa(this));a.x/=this.scale;a.y/=this.scale;this.Sx=g.g.X.xm(c,a)};b.lc=function(){return null!=this.Kc&&this.Kc.lc()};function ld(a){return a.options.Pc&&a.options.Pc.scrollbars||a.options.Pc&&a.options.Pc.Rj||a.options.Pc&&a.options.Pc.Gh||a.options.Ib&&a.options.Ib.controls||a.options.Ib&&a.options.Ib.Rj} +b.Nc=function(){return this.options.Pc&&this.options.Pc.scrollbars||this.options.Pc&&this.options.Pc.Rj||this.options.Pc&&this.options.Pc.Gh||this.options.Ib&&this.options.Ib.Rj}; +b.FG=function(a){if(g.$j.Jt())a.preventDefault(),a.stopPropagation();else{var c=this.options.Ib&&this.options.Ib.Rj,d=this.options.Pc&&this.options.Pc.Rj;if(c||d){var e=g.g.Ay(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=g.g.ln(a,r(this),qa(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}}; +function lc(a){var c=A(a,!1);a=xa(a,!1);c=c.concat(a);if(!c.length)return new g.g.Rect(0,0,0,0);a=Xc(c[0]);for(var d=1;da.bottom&&(a.bottom=e.bottom);e.lefta.right&&(a.right=e.right)}return a}b.SD=function(){this.Sc(!1);g.i.aa(!0);for(var a=A(this,!0),c=0,d=0,e;e=a[d];d++)if(e.Nc()){var f=e.Ta();e.moveBy(-f.x,c-f.y);Wc(e);c=e.Ta().y+Ra(e).height+g.xa.vr}g.i.aa(!1);this.Sc(!0)}; +b.Gn=function(a){function c(F){if(F.pe())w=w.concat(p(F,!1));else{F=F.Ih(!1);for(var ca=0;caw.length?d():g.confirm(g.h.DELETE_ALL_BLOCKS.replace("%1",w.length),function(F){F&&d()})}};e.push(l);this.nx&&this.nx(e);g.Fa.show(a,e,this.G)}};function pa(a){if(a.options.Sb)pa(a.options.Sb);else{g.cn=a;document.activeElement&&document.activeElement.blur();try{r(a).focus()}catch(c){try{r(a).parentNode.setActive()}catch(d){r(a).parentNode.focus()}}}} +b.zoom=function(a,c,d){if(!this.qe&&!this.ij){d=Math.pow(this.options.Ib.XG,d);var e=this.scale*d;if(this.scale!=e){e>this.options.Ib.gn?d=this.options.Ib.gn/this.scale:ethis.options.Ib.gn?a=this.options.Ib.gn:this.options.Ib.jn&&af?g.ba.rn(a,0,d.height+f):g.ba.rn(a,f,d.height)}; +g.ba.ID=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)};g.ba.JD=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};g.Fg=function(a){a.jc=this.Km.bind(this);a.ji=this.iA.bind(this);g.Fg.w.constructor.call(this,a);this.pf=!1};g.g.object.Y(g.Fg,g.Il);b=g.Fg.prototype;b.Km=function(){if(!this.isVisible())return null;try{var a=this.s.jb.getBBox()}catch(f){a={height:0,y:0,width:0,x:0}}var c=this.Kr,d=this.bd-2*this.Kr,e=this.xb;this.G||(e-=this.Kr);return{Cb:d,ub:e,Od:a.height*this.s.scale+2*this.Xe,gf:a.width*this.s.scale+2*this.Xe,pc:-this.s.scrollY+a.y,gc:-this.s.scrollX,tc:a.y,Jc:a.x,Hc:c,qc:0}}; +b.iA=function(a){var c=this.Km();c&&("number"==typeof a.y&&(this.s.scrollY=-c.Od*a.y),this.s.translate(this.s.scrollX+c.qc,this.s.scrollY+c.Hc))}; +b.position=function(){if(this.isVisible()){var a=this.tb.jc();if(a){this.bd=a.Cb;var c=this.xb-this.Db,d=a.Cb-2*this.Db,e=this.tl==g.Cg,f=c+this.Db;f=["M "+(e?f:0)+",0"];f.push("h",e?-c:c);f.push("a",this.Db,this.Db,0,0,e?0:1,e?-this.Db:this.Db,this.Db);f.push("v",Math.max(0,d));f.push("a",this.Db,this.Db,0,0,e?0:1,e?this.Db:-this.Db,this.Db);f.push("h",e?c:-c);f.push("z");this.Tc.setAttribute("d",f.join(" "));c=this.bd;a=this.tb.Ia==this.tl?a.uA?this.tl==g.Md?a.uA:a.ub-this.xb:this.tl==g.Md?0:a.ub: +this.tl==g.Md?0:a.ub+a.qc-this.xb;this.H.setAttribute("width",this.xb);this.H.setAttribute("height",c);"svg"==this.H.tagName?g.g.o.Dn(this.H,"translate("+a+"px,0px)"):this.H.setAttribute("transform","translate("+a+",0)");this.yc&&(this.yc.Eu=new g.g.X(a,0),this.yc.resize(),ia(this.yc,this.yc.rd.x,this.yc.rd.y))}}};b.CH=function(a){var c=g.g.Ay(a);if(c.y){var d=this.Km();c=d.pc-d.tc+c.y;c=Math.min(c,d.Od-d.Cb);c=Math.max(c,0);this.yc.set(c);g.ba.Ga()}a.preventDefault();a.stopPropagation()}; +function pd(a,c,d){a.s.scale=a.tb.scale;for(var e=a.Xe,f=a.G?e:e+a.ql,h=0,k;k=c[h];h++)if("block"==k.type){k=k.block;for(var l=p(k,!1),m=0,n;n=l[m];m++)n.ec=!0;k.Da();n=k.za();l=Ra(k);m=k.L?f-a.ql:f;k.moveBy(m,e);var u=a,v=k,w=h;m=g.g.o.K("rect",{"fill-opacity":0,x:a.G?m-l.width:m,y:e,height:l.height,width:l.width},null);m.yf=v;g.J.xk(m);u.s.jb.insertBefore(m,v.za());v.by=m;u.eq[w]=m;u=a;u.Gd.push(g.ca(n,"mousedown",null,qd(u,k)));u.Gd.push(g.ca(m,"mousedown",null,qd(u,k)));u.Gd.push(g.ld(n,"mouseover", +k,k.Yo));u.Gd.push(g.ld(n,"mouseout",k,k.yn));u.Gd.push(g.ld(m,"mouseover",k,k.Yo));u.Gd.push(g.ld(m,"mouseout",k,k.yn));e+=l.height+d[h]}else"button"==k.type&&(l=a,m=k.button,n=f,u=e,v=m.Ja(),m.moveTo(n,u),m.show(),l.Gd.push(g.ca(v,"mousedown",l,l.$h)),l.fm.push(m),e+=k.button.height+d[h])} +b.Hm=function(){if(!this.H)return null;var a=this.H.getBoundingClientRect(),c=a.left;if(this.tl==g.Md)return new g.g.Rect(-1E9,1E9,-1E9,c+a.width);g.g.userAgent.Eo&&this.tb&&this.tb.ij&&(a=this.tb.H.getBoundingClientRect().x,10>Math.abs(a-c)&&(c+=this.eM*this.tb.options.Sb.scale));return new g.g.Rect(-1E9,1E9,c,1E9)}; +g.Zr=function(a){this.s=a};b=g.Zr.prototype;b.Ii=32;b.Wv=110;b.pr=20;b.Ol=20;b.H=null;b.$m=0;b.vl=0;b.Ja=function(){this.H=g.g.o.K("g",{},null);var a=String(Math.random()).substring(2);rd(this,a);sd(this,a);this.s.Nc()&&td(this,a);return this.H};b.U=function(a){this.oh=this.pr+a;return this.oh+this.Wv};b.I=function(){this.H&&g.g.o.removeNode(this.H)}; +b.position=function(){if(this.oh){var a=this.s.jc();a&&(this.$m=a.Ia==g.Md||this.s.Rd&&!this.s.G?a.ub+a.qc-this.Ii-this.Ol-g.La.xc:this.Ol+g.La.xc,a.Ia==g.Ei?(this.vl=this.oh,this.Nq.setAttribute("transform","translate(0, 34)"),this.Oq&&this.Oq.setAttribute("transform","translate(0, 77)")):(this.vl=a.Cb+a.Hc-this.Wv-this.oh,this.Nq.setAttribute("transform","translate(0, 43)"),this.xv.setAttribute("transform","translate(0, 77)")),this.H.setAttribute("transform","translate("+this.$m+","+this.vl+")"))}}; +function rd(a,c){var d=a.s;a.xv=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoomoutClipPath"+c},a.xv);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.Ad.width,height:g.Ad.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+c+")"},a.xv);a.setAttributeNS(g.g.o.bf,"xlink:href",d.options.uf+g.Ad.url);g.ca(a,"mousedown",null,function(f){pa(d);md(d,-1);g.Touch.Bh();f.stopPropagation();f.preventDefault()})} +function sd(a,c){var d=a.s;a.Nq=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoominClipPath"+c},a.Nq);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.Ad.width,height:g.Ad.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+c+")"},a.Nq);a.setAttributeNS(g.g.o.bf,"xlink:href",d.options.uf+g.Ad.url);g.ca(a,"mousedown",null,function(f){pa(d);md(d,1);g.Touch.Bh();f.stopPropagation();f.preventDefault()})} +function td(a,c){var d=a.s;a.Oq=g.g.o.K("g",{"class":"blocklyZoom"},a.H);var e=g.g.o.K("clipPath",{id:"blocklyZoomresetClipPath"+c},a.Oq);g.g.o.K("rect",{width:32,height:32},e);a=g.g.o.K("image",{width:g.Ad.width,height:g.Ad.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+c+")"},a.Oq);a.setAttributeNS(g.g.o.bf,"xlink:href",d.options.uf+g.Ad.url);g.ca(a,"mousedown",null,function(f){pa(d);d.setScale(d.options.Ib.oA);g.g.o.qb(d.jb,"blocklyCanvasTransitioning");g.g.o.qb(d.xf,"blocklyCanvasTransitioning"); +if(d.Nc()){var h=d.jc(),k=(h.gf-h.ub)/2,l=(h.Od-h.Cb)/2;k=-k-h.Jc;l=-l-h.tc;d.scroll(k,l)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.");setTimeout(d.GE.bind(d),500);g.Touch.Bh();f.stopPropagation();f.preventDefault()})} +g.Vc.register([".blocklyZoom>image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);g.Jv=function(a){this.nm=a;this.Ja()};b=g.Jv.prototype;b.Xa=null;b.jf=null;b.nm=null;b.gi=1;b.Ln=null;b.Ja=function(){this.Xa||(this.Xa=g.g.o.K("svg",{xmlns:g.g.o.Vl,"xmlns:html":g.g.o.ak,"xmlns:xlink":g.g.o.bf,version:"1.1","class":"blocklyBlockDragSurface"},this.nm),this.jf=g.g.o.K("g",{},this.Xa))};function hb(a,c){if(a.jf.childNodes.length)throw Error("Already dragging a block.");a.jf.appendChild(c);a.Xa.style.display="block";a.Ln=new g.g.X(0,0)} +b.Mj=function(a,c){this.Ln=new g.g.X(a*this.gi,c*this.gi);a=this.Ln.x;c=this.Ln.y;a=a.toFixed(0);c=c.toFixed(0);this.Xa.style.display="block";g.g.o.Dn(this.Xa,"translate3d("+a+"px, "+c+"px, 0px)")};b.xt=function(){var a=g.g.Me(this.Xa);return new g.g.X(a.x/this.gi,a.y/this.gi)};b.cc=function(){return this.jf}; +b.gp=function(a){a?a.appendChild(this.jf.firstChild):this.jf.removeChild(this.jf.firstChild);this.Xa.style.display="none";if(this.jf.childNodes.length)throw Error("Drag group was not cleared.");this.Ln=null};g.Ph=function(a,c){g.ND();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!g.g.o.containsNode(document,a))throw Error("Error: container is not in current document.");c=new g.De(c||{});var d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);a=g.pm(d,c);var e=new g.Jv(d);d=new g.Nw(d);d=g.cE(a,c,e,d);g.wb.sb.bH(c.sb);g.FF(d);g.cn=d;g.ol(d);return d}; +g.pm=function(a,c){a.setAttribute("dir","LTR");g.Fc.Ex=c.G;g.Vc.Ph(c.vF,c.uf);a=g.g.o.K("svg",{xmlns:g.g.o.Vl,"xmlns:html":g.g.o.ak,"xmlns:xlink":g.g.o.bf,version:"1.1","class":"blocklySvg"},a);var d=g.g.o.K("defs",{},a),e=String(Math.random()).substring(2),f=g.g.o.K("filter",{id:"blocklyEmbossFilter"+e},d);g.g.o.K("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var h=g.g.o.K("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white", +result:"specOut"},f);g.g.o.K("fePointLight",{x:-5E3,y:-1E4,z:2E4},h);g.g.o.K("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);g.g.o.K("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);c.Vx=f.id;f=g.g.o.K("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);g.g.o.K("rect",{width:10,height:10,fill:"#aaa"},f);g.g.o.K("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);c.Ng=f.id; +c.Ky=g.ui.Ja(e,c.Jy,d);return a}; +g.cE=function(a,c,d,e){c.Sb=null;var f=new g.pb(c,d,e);f.scale=c.Ib.oA;a.appendChild(f.Ja("blocklyMainBackground"));!c.Ny&&c.Xk&&(d=hd(f,"svg"),g.g.o.ej(d,a));c.Ry&&fd(f);c.Ib&&c.Ib.controls&&gd(f);f.Zb.subscribe(a,"workspace","background-color");f.translate(0,0);g.cn=f;c.readOnly||f.Nc()||Ba(f,function(h){if(!f.lc()&&!f.Nc()&&-1!=g.i.WA.indexOf(h.type)){var k=Object.create(null),l=f.jc(),m=f.scale;k.G=f.G;k.gc=l.gc/m;k.pc=l.pc/m;k.CA=(l.gc+l.ub)/m;k.BA=(l.pc+l.Cb)/m;ld(f)?(l=lc(f),k.Jc=l.left,k.tc= +l.top,k.ux=l.right,k.sx=l.bottom):(k.Jc=l.Jc/m,k.tc=l.tc/m,k.ux=(l.Jc+l.gf)/m,k.sx=(l.tc+l.Od)/m);if(k.tck.BA||k.Jck.CA){l=null;h&&(l=g.i.cc(),g.i.aa(h.group));switch(h.type){case g.i.Al:case g.i.Fv:var n=x(f,h.Ic);n=db(n);break;case g.i.qo:case g.i.so:n=f.jp[h.Qf]||null}if(n){m=Xc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var u=k.pc,v=k.BA-m.height;v=Math.max(u,v);u=g.g.dd.Ak(u,m.top,v)-m.top;v=k.gc;var w=k.CA-m.width;k.G?v=Math.min(w,v):w=Math.max(v,w);n.moveBy(g.g.dd.Ak(v, +m.left,w)-m.left,u)}h&&(h.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&g.i.aa(l))}}});g.ol(f);g.ba.Ja();g.D.Ja();g.J.Ja();return f}; +g.FF=function(a){var c=a.options,d=r(a);g.ca(d.parentNode,"contextmenu",null,function(e){g.g.Yp(e)||e.preventDefault()});d=g.ca(window,"resize",null,function(){g.wc(!0);g.ol(a)});a.wq=d;g.Ph.AD();c.Xk&&(a.ta?a.ta.U(a):a.P&&(a.P.U(a),a.P.show(c.Xk.childNodes),a.P.yc.set(0)));d=g.La.xc;c.Ry&&(d=a.fd.U(d));c.Ib&&c.Ib.controls&&a.Tj.U(d);c.Pc&&c.Pc.scrollbars?(a.Xb=new g.pk(a),a.Xb.resize()):a.ji({x:.5,y:.5});c.xF&&g.Ph.QF(c.uf,a)}; +g.Ph.AD=function(){g.AE||(g.ca(document,"scroll",null,function(){for(var a=g.Ob.getAll(),c=0,d;d=a[c];c++)d.Vn&&d.Vn()}),g.ca(document,"keydown",null,g.Bu),g.ld(document,"touchend",null,g.Yh),g.ld(document,"touchcancel",null,g.Yh),g.g.userAgent.ck&&g.ca(window,"orientationchange",document,function(){g.ol(g.Hb())}));g.AE=!0}; +g.Ph.QF=function(a,c){function d(){for(;f.length;)g.Ua(f.pop());e.preload()}var e=c.Nf;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(g.ca(document,"mousemove",null,d,!0));f.push(g.ca(document,"touchstart",null,d,!0))};g.fe=function(a,c){this.AA=c||"";this.Zz=Object.create(null);if(a)for(a=a.split(","),c=0;c1'), +e.appendChild(d),c.push(e));if(g.N.variables_get){a.sort(g.$l.mx);d=0;for(var f;f=a[d];d++)e=g.g.xml.createElement("block"),e.setAttribute("type","variables_get"),e.setAttribute("gap",8),e.appendChild(g.O.Gm(f)),c.push(e)}}return c}; +g.O.ly=function(a){a=a.Rg();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var h=!1,k=0;kk[0]?1:h[0]=a.options.length&&(a.style.display= +"none")}for(d=1;10>=d;d++)a=document.getElementById("level"+d),c=!!Gd(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(Hd,1)}function Gd(a){var c=Id;try{var d=window.localStorage[c+a]}catch(e){}return d}function N(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 Jd(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(){if(!Ad){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")}};g.g.A={};g.g.A.Ya=function(a,c){return" "+a+","+c+" "};g.g.A.curve=function(a,c){return" "+a+c.join("")};g.g.A.moveTo=function(a,c){return" M "+a+","+c+" "};g.g.A.moveBy=function(a,c){return" m "+a+","+c+" "};g.g.A.lineTo=function(a,c){return" l "+a+","+c+" "};g.g.A.line=function(a){return" l"+a.join("")};g.g.A.ea=function(a,c){return" "+a+" "+c+" "};g.g.A.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};g.m.si=function(){this.Hf=0;this.OC=3;this.Gf=5;this.jw=8;this.yd=10;this.Dw=this.Gf;this.Pr=15;this.Wl=5;this.xh=8;this.vC=15;this.uC=4;this.rC=12;this.wB=16;this.Db=8;this.No=15;this.TC=0;this.UC=20;this.UA=4;this.RC=15;this.SC=100;this.QC=15;this.rr=24;this.yB=14.5;this.xB=this.Pr+11;this.AB=2;this.zB=this.rr;this.zw=g.g.A.moveBy(0,0);this.VB=12;this.WB=6};b=g.m.si.prototype; +b.U=function(){this.fk=this.$t();this.ik=this.au();this.Bg=this.cu();this.zi=this.bu();var a=this.Db,c=g.g.A.arc("a","0 0,0",a,g.g.A.Ya(-a,a)),d=g.g.A.arc("a","0 0,0",a,g.g.A.Ya(a,a));this.Ll={width:a,height:a,Iu:c,nq:d};c=this.Db;a=g.g.A.moveBy(0,c)+g.g.A.arc("a","0 0,1",c,g.g.A.Ya(c,-c));c=g.g.A.arc("a","0 0,1",c,g.g.A.Ya(-c,-c));this.nw={rv:a,rs:c}};b.$t=function(){var a=this.VB,c=this.WB,d=g.g.A.line([g.g.A.Ya(6,3),g.g.A.Ya(-12,6),g.g.A.Ya(6,3)]);return{height:a,width:c,path:d}}; +b.cu=function(){var a=this.RC,c=this.SC,d=g.g.A.curve("c",[g.g.A.Ya(30,-a),g.g.A.Ya(70,-a),g.g.A.Ya(c,0)]);return{height:a,width:c,path:d}};b.bu=function(){function a(h){h=h?-1:1;var k=-h,l=d/2,m=g.g.A.Ya(c,h*l);return g.g.A.curve("c",[g.g.A.Ya(0,h*(l+2.5)),g.g.A.Ya(-c,k*(l+.5)),g.g.A.Ya(-c,h*l)])+g.g.A.curve("s",[g.g.A.Ya(c,2.5*k),m])}var c=this.xh,d=this.Pr,e=a(!0),f=a(!1);return{width:c,height:d,Te:f,qn:e}}; +b.au=function(){function a(k){return g.g.A.line([g.g.A.Ya(k*e,d),g.g.A.Ya(3*k,0),g.g.A.Ya(k*e,-d)])}var c=this.vC,d=this.uC,e=(c-3)/2,f=a(1),h=a(-1);return{width:c,height:d,ai:f,Nz:h}};g.m.u={NONE:0,xe:1,Vv:2,Yv:4,Lr:8,Ev:16,bw:32,Tv:64,xg:128,$v:256,Aw:512,fB:1024,Dr:2048,wr:4096,zC:8192,$q:16384,mr:32768,lr:65536,Ir:131072,Hr:262144,fw:524288,So:1048576,Sr:2097152,Wq:4194304,aw:8388608};g.m.u.oJ=g.m.u.mr|g.m.u.lr;g.m.u.TK=g.m.u.Ir|g.m.u.Hr;g.m.u.qu=16777216;g.m.u.Rb=function(){g.m.u.hasOwnProperty(void 0)||(g.m.u[void 0]=g.m.u.qu,g.m.u.qu<<=1);return g.m.u[void 0]};g.m.u.Wm=function(a){return a.type&g.m.u.xe};g.m.u.hj=function(a){return a.type&g.m.u.Vv}; +g.m.u.Tk=function(a){return a.type&g.m.u.Yv};g.m.u.sf=function(a){return a.type&g.m.u.Lr};g.m.u.YL=function(a){return a.type&g.m.u.bw};g.m.u.rf=function(a){return a.type&g.m.u.xg};g.m.u.Vm=function(a){return a.type&g.m.u.Tv};g.m.u.Rh=function(a){return a.type&g.m.u.$v};g.m.u.Zm=function(a){return a.type&g.m.u.Aw};g.m.u.Vk=function(a){return a.type&g.m.u.Dr};g.m.u.Uh=function(a){return a.type&g.m.u.wr};g.m.u.MF=function(a){return a.type&(g.m.u.Dr|g.m.u.wr)};g.m.u.Th=function(a){return a.type&g.m.u.lr}; +g.m.u.$L=function(a){return a.type&g.m.u.Hr};g.m.u.Ym=function(a){return a.type&g.m.u.mr};g.m.u.aM=function(a){return a.type&g.m.u.Ir};g.m.u.XL=function(a){return a.type&g.m.u.$q};g.m.u.fz=function(a){return a.type&g.m.u.fw};g.m.u.bM=function(a){return a.type&g.m.u.So};g.m.u.WL=function(a){return a.type&g.m.u.Ev};g.m.u.$p=function(a){return a.type&g.m.u.Sr};g.m.u.Sp=function(a){return a.type&g.m.u.Wq};g.m.u.cM=function(a){return a.type&(g.m.u.Sr|g.m.u.Wq)};g.m.u.ZL=function(a){return a.type&g.m.u.aw};g.m.sh=function(a){this.height=this.width=0;this.type=g.m.u.NONE;this.Ah=this.Wa=0;this.C=a;this.Re=this.C.No};g.m.ua=function(a,c){g.m.ua.w.constructor.call(this,a);this.Cs=c;a:switch(a=this.C,c.type){case g.Ra:case g.Ze:c=a.zi;break a;case g.$e:case g.Sa:c=a.ik;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=g.m.u.fB};g.g.object.Y(g.m.ua,g.m.sh);g.m.Br=function(a,c){g.m.Br.w.constructor.call(this,a,c);this.type|=g.m.u.zC;this.height=this.shape.height;this.width=this.shape.width;this.Ie=this.C.Wl;this.ue=this.width};g.g.object.Y(g.m.Br,g.m.ua); +g.m.Er=function(a,c){g.m.Er.w.constructor.call(this,a,c);this.type|=g.m.u.Dr;this.height=this.shape.height;this.width=this.shape.width};g.g.object.Y(g.m.Er,g.m.ua);g.m.xr=function(a,c){g.m.xr.w.constructor.call(this,a,c);this.type|=g.m.u.wr;this.height=this.shape.height;this.width=this.shape.width};g.g.object.Y(g.m.xr,g.m.ua);g.m.Nl=function(a,c){g.m.Nl.w.constructor.call(this,a,c.connection);this.type|=g.m.u.xg;this.input=c;this.align=c.align;(this.Ni=c.connection&&C(c.connection)?C(c.connection):null)?(a=Ra(this.Ni),this.lm=a.width,this.kp=a.height):this.kp=this.lm=0;this.connection=c.connection;this.Ie=0};g.g.object.Y(g.m.Nl,g.m.ua); +g.m.qh=function(a,c){g.m.qh.w.constructor.call(this,a,c);this.type|=g.m.u.$v;this.Ni?(this.width=this.lm,this.height=this.kp):(this.height=this.C.xB,this.width=this.shape.width+this.C.yB);this.Ie=this.C.Wl;this.mm=this.shape.height;this.Dh=this.shape.width};g.g.object.Y(g.m.qh,g.m.Nl);g.m.wh=function(a,c){g.m.wh.w.constructor.call(this,a,c);this.type|=g.m.u.Aw;this.height=this.Ni?this.kp+this.C.TC:this.C.zB;this.width=this.C.No+this.shape.width};g.g.object.Y(g.m.wh,g.m.Nl); +g.m.Co=function(a,c){g.m.Co.w.constructor.call(this,a,c);this.type|=g.m.u.Tv;this.height=this.Ni?this.kp-2*this.C.Wl:this.shape.height;this.width=this.shape.width+this.C.AB;this.Ie=this.C.Wl;this.mm=this.shape.height;this.Dh=this.shape.width};g.g.object.Y(g.m.Co,g.m.Nl);g.m.Kd=function(a,c){g.m.Kd.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=g.m.u.Yv;a=new g.g.ge(g.Kd.prototype.Uo,g.Kd.prototype.Uo-2);this.height=a.height;this.width=a.width};g.g.object.Y(g.m.Kd,g.m.sh);g.m.jr=function(a){g.m.jr.w.constructor.call(this,a);this.type|=g.m.u.fw;this.height=this.C.fk.height;this.width=this.C.fk.width};g.g.object.Y(g.m.jr,g.m.sh); +g.m.pa=function(a,c){g.m.pa.w.constructor.call(this,a);this.Yx=c;this.pd=c.Ef&&!!c.B&&c.B.pd();this.NE=c.uy();this.type|=g.m.u.xe;a=this.Yx.Tg();this.height=a.height;this.width=a.width};g.g.object.Y(g.m.pa,g.m.sh);g.m.hr=function(a){g.m.hr.w.constructor.call(this,a);this.type|=g.m.u.Vv;this.height=this.C.Bg.height;this.width=this.C.Bg.width;this.vk=this.height};g.g.object.Y(g.m.hr,g.m.sh); +g.m.Xo=function(a,c){g.m.Xo.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.m.u.Ir:g.m.u.mr)|g.m.u.$q;this.width=this.height=this.C.Hf};g.g.object.Y(g.m.Xo,g.m.sh);g.m.To=function(a,c){g.m.To.w.constructor.call(this,a);this.type=(c&&"left"!=c?g.m.u.Hr:g.m.u.lr)|g.m.u.$q;this.width=this.C.Db;this.height=this.C.Db/2};g.g.object.Y(g.m.To,g.m.sh);g.m.dk=function(a,c){g.m.dk.w.constructor.call(this,a);this.type=this.type|g.m.u.Lr|g.m.u.bw;this.width=c;this.height=this.C.QC};g.g.object.Y(g.m.dk,g.m.sh);g.m.Bi=function(a){this.type=g.m.u.So;this.elements=[];this.Wa=this.Uc=this.og=this.minWidth=this.minHeight=this.width=this.height=0;this.Py=this.Lp=this.Et=this.Ed=this.Zi=!1;this.C=a;this.Re=this.C.No};g.m.Bi.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function Kd(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.m.u.rf(d))return d;return null}g.m.Bi.prototype.jv=function(){return!0};g.m.Bi.prototype.Wx=function(){return!0}; +function Ld(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(g.m.u.sf(d))return d;return null}g.m.qk=function(a){g.m.qk.w.constructor.call(this,a);this.type|=g.m.u.Sr;this.vk=this.Hg=0;this.wF=!1;this.connection=null};g.g.object.Y(g.m.qk,g.m.Bi);g.m.qk.prototype.Ft=function(a){var c=a.Vg?"cap"===a.Vg:g.xa.Bg,d=a.$&&C(a.$);return!!a.L||c||(d?q(d)==a:!1)}; +g.m.qk.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.m.u.sf(f)||(g.m.u.hj(f)?d=Math.max(d,f.vk):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Hg=this.vk=d;this.og=this.width};g.m.qk.prototype.jv=function(){return!1};g.m.Uj=function(a){g.m.Uj.w.constructor.call(this,a);this.type|=g.m.u.Wq;this.Qy=!1;this.connection=null;this.Ki=this.wm=0};g.g.object.Y(g.m.Uj,g.m.Bi); +g.m.Uj.prototype.Ft=function(a){return!!a.L||!!q(a)};g.m.Uj.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,g.m.u.sf(f)||(g.m.u.Uh(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.wm=d;this.og=this.width};g.m.Uj.prototype.jv=function(){return!1}; +g.m.Wo=function(a,c,d){g.m.Wo.w.constructor.call(this,a);this.type=this.type|g.m.u.Lr|g.m.u.Ev;this.width=d;this.height=c;this.jy=!1;this.og=0;this.elements=[new g.m.dk(this.C,d)]};g.g.object.Y(g.m.Wo,g.m.Bi);g.m.Wo.prototype.measure=function(){};g.m.ek=function(a){g.m.ek.w.constructor.call(this,a);this.type|=g.m.u.aw;this.px=0};g.g.object.Y(g.m.ek,g.m.Bi); +g.m.ek.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,g.m.u.rf(d)&&(g.m.u.Zm(d)?a+=d.lm:g.m.u.Vm(d)&&0!=d.lm&&(a+=d.lm-d.Dh)),g.m.u.sf(d)||(this.height=Math.max(this.height,d.height));this.px=a;this.og=this.width+a};g.m.ek.prototype.Wx=function(){return!this.Zi&&!this.Ed};g.m.uh=function(a,c){this.T=c;this.eh=a;this.C=this.eh.C;this.L=c.L?new g.m.Br(this.C,c.L):null;this.Ot=qc(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Sh=c.Sh();this.G=c.G;this.Gj=this.width=this.wl=this.height=0;this.rows=[];this.Uy=[];this.oc=new g.m.qk(this.C);this.Pb=new g.m.Uj(this.C);this.Bq=this.ue=0};b=g.m.uh.prototype; +b.measure=function(){var a=this.T.Vg?"cap"===this.T.Vg:g.xa.Bg,c=!!this.T.$;this.oc.Ft(this.T)?this.oc.elements.push(new g.m.Xo(this.C)):this.oc.elements.push(new g.m.To(this.C));a?(a=new g.m.hr(this.C),this.oc.elements.push(a),this.oc.Hg=a.vk):c&&(this.oc.wF=!0,this.oc.connection=new g.m.Er(this.C,this.T.$),this.oc.elements.push(this.oc.connection));this.T.S.length&&this.T.S[0].type==g.Sa&&!this.T.isCollapsed()?this.oc.minHeight=this.C.yd:this.oc.minHeight=this.C.Gf;this.rows.push(this.oc);a=new g.m.ek(this.C); +var d=Wa(this.T);if(d.length){c=0;for(var e;e=d[c];c++){var f=new g.m.Kd(this.C,e);this.isCollapsed&&e.jx?this.Uy.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.T.S[c];c++)if(d.isVisible()){!e||d.type!=g.Sa&&e.type!=g.Sa&&(d.type!=g.Ra&&d.type!=g.vg||this.Ot)||(this.rows.push(a),a=new g.m.ek(this.C));for(e=0;f=d.Na[e];e++)a.elements.push(new g.m.pa(this.C,f,d));this.Sw(d,a);e=d}this.isCollapsed&&(a.Py=!0,a.elements.push(new g.m.jr(this.C)));(a.elements.length||a.Lp)&&this.rows.push(a);this.Pb.Qy= +!!this.T.V;this.Pb.minHeight=this.T.S.length&&this.T.S[this.T.S.length-1].type==g.Sa?this.C.yd:this.C.Gf-1;this.Pb.Ft(this.T)?this.Pb.elements.push(new g.m.Xo(this.C)):this.Pb.elements.push(new g.m.To(this.C));this.Pb.Qy&&(this.Pb.connection=new g.m.xr(this.C,this.T.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.jv()&&c.elements.push(new g.m.dk(this.C,this.Cp(null,d[0])));for(e=0;ea.Fd&&(a.la+=g.g.A.ea("V",c.Uc+c.height-a.Fd)))};g.ma.Ai=function(a){this.Ij=a;this.Nn=g.g.o.K("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Ij);this.ml=g.g.o.K("path",{"class":"blocklyPath"},this.Ij);this.Pn=g.g.o.K("path",{"class":"blocklyPathLight"},this.Ij)};g.ma.Ai.prototype.$u=function(a,c){this.ml.setAttribute("d",a);this.Nn.setAttribute("d",a);this.Pn.setAttribute("d",c)}; +g.ma.Ai.prototype.ht=function(){this.ml.setAttribute("transform","scale(-1 1)");this.Pn.setAttribute("transform","scale(-1 1)");this.Nn.setAttribute("transform","translate(1,1) scale(-1 1)")};g.ma.qh=function(a,c){g.ma.qh.w.constructor.call(this,a,c);this.Ni&&(this.width+=this.C.wd,this.height+=this.C.wd)};g.g.object.Y(g.ma.qh,g.m.qh);g.ma.wh=function(a,c){g.ma.wh.w.constructor.call(this,a,c);this.Ni&&(this.height+=this.C.wd)};g.g.object.Y(g.ma.wh,g.m.wh);g.ma.uh=function(a,c){g.ma.uh.w.constructor.call(this,a,c)};g.g.object.Y(g.ma.uh,g.m.uh);b=g.ma.uh.prototype;b.Sw=function(a,c){this.Ot&&a.type==g.Ra?(c.elements.push(new g.ma.qh(this.C,a)),c.Et=!0):a.type==g.Sa?(c.elements.push(new g.ma.wh(this.C,a)),c.Ed=!0):a.type==g.Ra?(c.elements.push(new g.m.Co(this.C,a)),c.Zi=!0):a.type==g.vg&&(c.Lp=!0)}; +b.Cp=function(a,c){if(!a)return c&&g.m.u.Wm(c)&&c.pd?this.C.Gf:c&&g.m.u.Rh(c)?this.C.jw:c&&g.m.u.Zm(c)?this.C.UC:this.C.yd;if(!g.m.u.rf(a)&&!c)return g.m.u.Wm(a)&&a.pd?this.C.Gf:g.m.u.Tk(a)?2*this.C.yd+1:g.m.u.hj(a)?this.C.Hf:g.m.u.MF(a)?this.C.yd:g.m.u.Th(a)?this.C.rC:g.m.u.fz(a)?this.C.Hf:this.C.yd;if(g.m.u.rf(a)&&!c){if(g.m.u.Vm(a))return this.C.Hf;if(g.m.u.Rh(a))return this.C.yd;if(g.m.u.Zm(a))return this.C.Hf}if(!g.m.u.rf(a)&&c&&g.m.u.rf(c)){if(a.pd){if(g.m.u.Rh(c)||g.m.u.Vm(c))return this.C.OC}else{if(g.m.u.Rh(c)|| +g.m.u.Vm(c))return this.C.jw;if(g.m.u.Zm(c))return this.C.yd}return this.C.yd-1}if(g.m.u.Tk(a)&&c&&!g.m.u.rf(c))return this.C.yd;if(g.m.u.Rh(a)&&c&&!g.m.u.rf(c))return c.pd?this.C.Gf:this.C.yd;if(g.m.u.Ym(a)&&c){if(g.m.u.hj(c))return this.C.Hf;if(g.m.u.Vk(c))return c.Re;if(g.m.u.Uh(c))return a=(this.G?1:-1)*this.C.wd/2,c.Re+a}if(g.m.u.Th(a)&&c){if(g.m.u.Vk(c))return c.Re-this.C.Db;if(g.m.u.Uh(c))return a=(this.G?1:-1)*this.C.wd/2,c.Re-this.C.Db+a}return!g.m.u.rf(a)&&c&&!g.m.u.rf(c)&&a.pd==c.pd||c&& +g.m.u.fz(c)?this.C.yd:this.C.Gf};b.$r=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(g.m.u.sf(e)){d=e;break a}d=null}e=Ld(a);if(a.Zi||a.Ed)a.og+=c;var f=Kd(a);f?f.align==g.Tq?e.width+=c:f.align==g.zv?(d.width+=c/2,e.width+=c/2):f.align==g.co&&(d.width+=c):e.width+=c;a.width+=c};b.Cy=function(a,c){return g.m.u.$p(a)&&g.m.u.Sp(c)?this.C.wB:g.m.u.$p(a)||g.m.u.Sp(c)?this.C.Hf:a.Zi&&c.Zi?this.C.yd:!a.Ed&&c.Ed?this.C.UA:a.Ed&&c.Ed||!a.Ed&&c.Lp?this.C.yd:this.C.Gf}; +b.ty=function(a,c){if(g.m.u.sf(c))return a.Uc+c.height/2;if(g.m.u.Sp(a))return a=a.Uc+a.height-a.wm,g.m.u.Uh(c)?a+c.height/2:a-c.height/2;if(g.m.u.$p(a))return g.m.u.hj(c)?a.Hg-c.height/2:a.Hg+c.height/2;var d=a.Uc;g.m.u.Wm(c)||g.m.u.Tk(c)?(d+=c.height/2,(a.Et||a.Ed)&&c.height+this.C.Dw<=a.height&&(d+=this.C.Dw)):d=g.m.u.Rh(c)?d+c.height/2:d+a.height/2;return d}; +b.Zx=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Uc=c;e.Wa=this.ue;c+=e.height;a=Math.max(a,e.og);var f=c-this.oc.vk;e==this.Pb&&f=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},ou:function(){10>M?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+yd+"&level="+(M+1):P.Np()},Gt:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}id(a,c)},Zy:function(a,c){a=document.getElementById(a); +a.firstChild||(a=g.Ph(a,{rtl:-1!=xd.indexOf(yd),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),g.R.Fh(g.R.lh(c),a))},lH:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Xf:function(a){if("click"==a.type&&"touchend"==P.Xf.Ou&&P.Xf.Mu+2E3>Date.now()||P.Xf.Ou==a.type&&P.Xf.Mu+400>Date.now())return a.preventDefault(),a.stopPropagation(),!0;P.Xf.Ou=a.type;P.Xf.Mu=Date.now();return!1}};P.Xf.Ou=null;P.Xf.Mu=0; +P.CF=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};P.DF=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=P;P.setCode=P.fA;P.getCode=P.rt;P.getWorkspace=P.Lk;var O={Qh:!1,Ix:null,pp:null,Dj:function(a,c,d,e,f,h){function k(){O.Qh&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);O.Qh&&O.Qd(!1);g.Hb()&&g.wc(!0);O.Qh=!0;O.Ix=c;O.pp=h;var l=document.getElementById("dialog");h=document.getElementById("dialogShadow");var m=document.getElementById("dialogBorder"),n;for(n in f)l.style[n]=f[n];e&&(h.style.visibility="visible",h.style.opacity=.3,h.style.zIndex=9,e=document.createElement("div"), +e.id="dialogHeader",l.appendChild(e),O.Ls=g.ld(e,"mousedown",null,O.rE));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(O.cq(c,!1,.2),O.cq(l,!0,.8),setTimeout(k,175)):k()},Jx:0,Kx:0,rE:function(a){O.Os();if(!g.g.jj(a)){var c=document.getElementById("dialog");O.Jx=c.offsetLeft-a.clientX;O.Kx=c.offsetTop-a.clientY;O.Ns=g.ld(document,"mouseup",null,O.Os);O.Ms=g.ld(document,"mousemove",null,O.sE);a.stopPropagation()}},sE:function(a){var c=document.getElementById("dialog"), +d=O.Jx+a.clientX;a=O.Kx+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"},Os:function(){O.Ns&&(g.Ua(O.Ns),O.Ns=null);O.Ms&&(g.Ua(O.Ms),O.Ms=null)},Qd:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(O.Qh){O.Os();O.Ls&&(g.Ua(O.Ls),O.Ls=null);O.Qh=!1;O.pp&&O.pp();O.pp=null;var d=!1===a? +null:O.Ix;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(O.cq(a,!1,.8),O.cq(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)}},cq:function(a,c,d){function e(){f.style.width=h.width+"px";f.style.height=h.height+"px";f.style.left=h.x+"px";f.style.top= +h.y+"px";f.style.opacity=d}if(a){var f=document.getElementById("dialogBorder"),h=O.SE(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},SE:function(a){var c=g.g.style.Fp(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},qA:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;eM?N("Games_nextLevel").replace("%1",String(M+1)):N("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click", +O.Qd,!0);c.addEventListener("touchend",O.Qd,!0);c=document.getElementById("doneOk");c.addEventListener("click",P.ou,!0);c.addEventListener("touchend",P.ou,!0);O.Dj(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",O.ox,!0)});document.body.addEventListener("keydown",O.ox,!0);document.getElementById("dialogDoneText").textContent=d},Hx:function(a){!O.Qh||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(O.Qd(!0),a.stopPropagation(),a.preventDefault())}, +hv:function(){document.body.addEventListener("keydown",O.Hx,!0)},kv:function(){document.body.removeEventListener("keydown",O.Hx,!0)},ox:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)O.Qd(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&P.ou()},Pw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)O.Qd(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&P.Np()},ky:function(a){27==a.keyCode?O.Qd(!0):13==a.keyCode&&O.mt()},mt: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 h=200==f.status?N("Games_submitted"):N("Games_httpRequestError")+"\nStatus: "+f.status;O.qA(null,h)}};f.send(c.join("&"));O.Qd(!0)}else a.value="",a.focus()}}; +window.BlocklyDialogs=O;O.hideDialog=O.Qd;function ae(a){this.ZB=23;this.gk=18;this.kr=132;this.Di=20;this.$a=.5;this.ax=void 0;this.gs=[];var c=g.g.o.Vl,d=document.createElementNS(c,"line");d.setAttribute("class","sliderTrack");d.setAttribute("x1",10);d.setAttribute("y1",35);d.setAttribute("x2",140);d.setAttribute("y2",35);a.appendChild(d);d=document.createElementNS(c,"rect");d.setAttribute("style","opacity: 0");d.setAttribute("x",10-this.Di);d.setAttribute("y",35-this.Di);d.setAttribute("width",130+2*this.Di);d.setAttribute("height",2* +this.Di);d.setAttribute("rx",this.Di);d.setAttribute("ry",this.Di);a.appendChild(d);this.vH=d;d=document.createElementNS(c,"path");d.setAttribute("class","sliderKnob");d.setAttribute("d","m 0,0 l -8,8 v 12 h 16 v -12 z");a.appendChild(d);this.jz=d;c=document.createElementNS(c,"circle");c.setAttribute("style","opacity: 0");c.setAttribute("r",this.Di);c.setAttribute("cy",35);a.appendChild(c);this.Rt=c;for(this.setValue(.5);a&&"svg"!=a.nodeName.toLowerCase();)a=a.parentNode;this.Xa=a;be(this.Rt,"mousedown", +this,this.iz);be(this.Rt,"touchstart",this,this.iz);be(this.vH,"mousedown",this,this.PG);be(this.Xa,"mouseup",null,ce);be(this.Xa,"touchend",null,ce);be(this.Xa,"mousemove",null,de);be(this.Xa,"touchmove",null,de);be(document,"mouseover",null,ee)}var fe=null,ge=0,he=0;ae.prototype.iz=function(a){if("touchstart"==a.type){if(1!=a.changedTouches.length)return;ie(a)}fe=this;ge=je(this,a).x;he=0;var c=this.jz.getAttribute("transform");c&&(c=c.match(/translate\(\s*([-\d.]+)/))&&(he=Number(c[1]));a.preventDefault()}; +function ce(){fe=null}function ee(a){if(fe){a=a.target;do if(a==fe.Xa)return;while(a=a.parentNode);fe=null}}function de(a){var c=fe;if(c){if("touchmove"==a.type){if(1!=a.changedTouches.length)return;ie(a)}a=je(c,a).x-ge+he;c.setValue((a-c.gk)/(c.kr-c.gk))}}ae.prototype.PG=function(a){if("touchstart"==a.type){if(1!=a.changedTouches.length)return;ie(a)}a=je(this,a).x;ke(this,(a-this.gk)/(this.kr-this.gk))};ae.prototype.getValue=function(){return this.$a}; +function ke(a,c){function d(h){return function(){a.setValue(h*(c-e)/9+e)}}for(;a.gs.length;)clearTimeout(a.gs.pop());for(var e=a.getValue(),f=0;10>f;f++)a.gs.push(setTimeout(d(f),200*f/10))}ae.prototype.setValue=function(a){this.$a=g.g.dd.Ak(a,0,1);a=this.gk+(this.kr-this.gk)*this.$a;this.jz.setAttribute("transform","translate("+a+","+this.ZB+")");this.Rt.setAttribute("cx",a);this.ax&&this.ax(this.$a)}; +function je(a,c){var d=a.Xa.createSVGPoint();d.x=c.clientX;d.y=c.clientY;a=a.Xa.getScreenCTM().inverse();return d.matrixTransform(a)}function be(a,c,d,e){a.addEventListener(c,function(f){e.apply(d,arguments)},!1)}function ie(a){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY};var le,Q,me,R,ne,oe,pe,qe; +function re(){function a(d){for(var e=0;5>e;e++)S(d),T(144)}switch(M){case 1:for(var c=0;4>c;c++)S(100),T(90);break;case 2:for(c=0;5>c;c++)S(100),T(72);break;case 3:U("#ffff00");a(100);break;case 4:U("#ffff00");a(50);V(!1);S(150);V(!0);S(20);break;case 5:U("#ffff00");for(c=0;4>c;c++)V(!1),S(150),T(90),V(!0),a(50);break;case 6:U("#ffff00");for(c=0;3>c;c++)V(!1),S(150),T(120),V(!0),a(50);V(!1);T(-90);S(100);V(!0);U("#ffffff");S(50);break;case 7:U("#ffff00");for(c=0;3>c;c++)V(!1),S(150),T(120),V(!0), +a(50);V(!1);T(-90);S(100);V(!0);U("#ffffff");for(c=0;4>c;c++)S(50),S(-50),T(45);break;case 8:U("#ffff00");for(c=0;3>c;c++)V(!1),S(150),T(120),V(!0),a(50);V(!1);T(-90);S(100);V(!0);U("#ffffff");for(c=0;360>c;c++)S(50),S(-50),T(1);break;case 9:U("#ffff00");for(c=0;3>c;c++)V(!1),S(150),T(120),V(!0),a(50);V(!1);T(-90);S(100);V(!0);U("#ffffff");for(c=0;360>c;c++)S(50),S(-50),T(1);T(120);S(20);U("#000000");for(c=0;360>c;c++)S(50),S(-50),T(1)}} +function se(a){if(10==M)return 1=M&&3a.length)){e=[];for(f=0;fthis.Bn)return null;var a=this.getOptions(!0)[this.Bn][0];return"object"==typeof a?a.alt:a}; +g.na.zA=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;dc||Math.abs(a.$n-d)>c)a.xl=e,a.$n=d,a.Vb.Cn(e+c,d+c),a.Mn.setAttribute("width",a.xl),a.Mn.setAttribute("height",a.$n);a.T.G&&a.s.jb.setAttribute("transform","translate("+a.xl+",0)");a.s.resize()} +b.Yb=function(a){if(a!=this.isVisible())if(g.i.Oa(new g.i.Bd(this.T,"mutatorOpen",!a,a)),a){this.Vb=new g.oa(this.T.v,this.Es(),this.T.Yd,this.cj,null,null);Fa(this.Vb,this.T.id);if(a=this.s.options.Xk)this.s.P.U(this.s),this.s.P.show(a.childNodes);this.gh=this.T.Uf(this.s);a=p(this.gh,!1);for(var c=0,d;d=a[c];c++)d.Da();this.gh.zq(!1);this.gh.Is=!1;this.s.P?(a=2*this.s.P.Db,c=Cb(this.s).Zf()+a):c=a=16;this.T.G&&(c=-c);this.gh.moveBy(c,a);if(this.T.An){var e=this;this.T.An(this.gh);this.Aq=function(){e.T.An(e.gh)}; +Ba(this.T.v,this.Aq)}te(this);Ba(this.s,this.EH.bind(this));this.Ve()}else this.Mn=null,this.s.I(),this.gh=this.s=null,this.Vb.I(),this.Vb=null,this.$n=this.xl=0,this.Aq&&(Ca(this.T.v,this.Aq),this.Aq=null)}; +b.EH=function(a){if(a.type!=g.i.Yl&&(a.type!=g.i.pi||"disabled"!=a.element)){if(!this.s.lc()){a=A(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Ta(),f=Ra(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.gh.v==this.s){g.i.aa(!0);d=this.T;a=(a=d.Pa())&&g.R.Dd(a);c=d.ga;d.ga=!1;d.Rf(this.gh);d.ga=c;d.Td();c=(c=d.Pa())&&g.R.Dd(c);if(a!=c){g.i.Oa(new g.i.qg(d,"mutation",null,a,c));var h=g.i.cc();setTimeout(function(){g.i.aa(h);d.Qb();g.i.aa(!1)},g.jo)}d.ga&&d.Da();a!=c&&g.Qe&&g.navigation.cG(d); +this.s.lc()||te(this);g.i.aa(!1)}}};b.cF=function(){return{Cb:this.$n,ub:this.xl-Cb(this.s).Zf(),Hc:0,qc:this.s.G?0:Cb(this.s).Zf()}};b.I=function(){this.T.Ud=null;g.Kd.prototype.I.call(this)};g.ac.xj=function(a,c,d){if(!a||!a.B.v)return!1;d=E(c,d).connection;var e=C(a);return e&&e!=c||d.ka==a?!1:(d.isConnected()&&d.disconnect(),d.connect(a),!0)};g.ac.$x=function(a){var c=null;if(a&&a.options){var d=a.options.Sb;a.qe?d&&d.options&&(c=d.options.Sb):d&&(c=d)}return c};g.N.Yt={};g.W.jC={};g.W.jC.bk=260; +g.Eh([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}", +args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value", +name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]); +g.N.lists_create_with={U:function(){this.Lb=g.h.LISTS_CREATE_WITH_HELPURL;J(this,"list_blocks");this.Mb=3;this.gd();this.td(!0,"Array");this.il(new g.ac(["lists_create_with_item"]));this.Ha(g.h.LISTS_CREATE_WITH_TOOLTIP)},Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("items",this.Mb);return a},kb:function(a){this.Mb=parseInt(a.getAttribute("items"),10);this.gd()},Uf:function(a){var c=a.cg("lists_create_with_container");c.Td();for(var d=E(c,"STACK").connection,e=0;e","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"]}]); +g.Eh([{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}"}]);g.W.ee.Rr={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}"};g.Z.register("logic_op_tooltip",g.Z.ap("OP",g.W.ee.Rr)); +g.W.ee.hB={le:0,kf:0,ki:!0,Pa:function(){if(!this.le&&!this.kf)return null;var a=g.g.xml.createElement("mutation");this.le&&a.setAttribute("elseif",this.le);this.kf&&a.setAttribute("else",1);return a},kb:function(a){this.le=parseInt(a.getAttribute("elseif"),10)||0;this.kf=parseInt(a.getAttribute("else"),10)||0;this.OG()},Uf:function(a){var c=a.cg("controls_if_if");c.Td();for(var d=c.V,e=1;e<=this.le;e++){var f=a.cg("controls_if_elseif");f.Td();d.connect(f.$);d=f.V}this.kf&&(a=a.cg("controls_if_else"), +a.Td(),d.connect(a.$));return c},Rf:function(a){a=C(a.V);this.kf=this.le=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.le++;c.push(a.Zn);d.push(a.kh);break;case "controls_if_else":this.kf++;e=a.kh;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.V&&C(a.V)}this.gd();this.Xz(c,d,e)},An:function(a){a=C(a.V);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=E(this,"IF"+c),e=E(this,"DO"+c);a.Zn=d&&d.connection.ka;a.kh=e&&e.connection.ka; +c++;break;case "controls_if_else":e=E(this,"ELSE");a.kh=e&&e.connection.ka;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.V&&C(a.V)}},OG:function(){var a=[null],c=[null],d=null;E(this,"ELSE")&&(d=E(this,"ELSE").connection.ka);for(var e=1;E(this,"IF"+e);){var f=E(this,"DO"+e);a.push(E(this,"IF"+e).connection.ka);c.push(f.connection.ka);e++}this.gd();this.Xz(a,c,d)},gd:function(){E(this,"ELSE")&&this.ob("ELSE");for(var a=1;E(this,"IF"+a);)this.ob("IF"+a),this.ob("DO"+a),a++;for(a= +1;a<=this.le;a++)I(K(this,"IF"+a).Za("Boolean"),g.h.CONTROLS_IF_MSG_ELSEIF),I(this.cf(g.Sa,"DO"+a),g.h.CONTROLS_IF_MSG_THEN);this.kf&&I(this.cf(g.Sa,"ELSE"),g.h.CONTROLS_IF_MSG_ELSE)},Xz:function(a,c,d){for(var e=1;e<=this.le;e++)g.ac.xj(a[e],this,"IF"+e),g.ac.xj(c[e],this,"DO"+e);g.ac.xj(d,this,"ELSE")}};g.Z.xn("controls_if_mutator",g.W.ee.hB,null,["controls_if_elseif","controls_if_else"]); +g.W.ee.iB=function(){this.Ha(function(){if(this.le||this.kf){if(!this.le&&this.kf)return g.h.CONTROLS_IF_TOOLTIP_2;if(this.le&&!this.kf)return g.h.CONTROLS_IF_TOOLTIP_3;if(this.le&&this.kf)return g.h.CONTROLS_IF_TOOLTIP_4}else return g.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};g.Z.register("controls_if_tooltip",g.W.ee.iB); +g.W.ee.fC={onchange:function(a){this.sn||(this.sn=[null,null]);var c=Bc(this,"A"),d=Bc(this,"B");c&&d&&!oc(c.L,d.L)&&(g.i.aa(a.group),a=this.sn[0],a!==c&&(D(c),a&&!a.hb&&E(this,"A").connection.connect(a.L)),c=this.sn[1],c!==d&&(D(d),c&&!c.hb&&E(this,"B").connection.connect(c.L)),this.Qb(),g.i.aa(!1));this.sn[0]=Bc(this,"A");this.sn[1]=Bc(this,"B")}};g.W.ee.eC=function(){this.ag(g.W.ee.fC)};g.Z.register("logic_compare",g.W.ee.eC); +g.W.ee.gC={Tz:null,onchange:function(a){var c=Bc(this,"THEN"),d=Bc(this,"ELSE"),e=this.L.ka;if((c||d)&&e)for(var f=0;2>f;f++){var h=1==f?c:d;h&&!oc(h.L,e)&&(g.i.aa(a.group),e===this.Tz?(D(this),e.B.Qb()):(D(h),h.Qb()),g.i.aa(!1))}this.Tz=e}};g.Z.rq("logic_ternary",g.W.ee.gC);g.yb=function(a,c,d){this.ll=!0;null==a&&(a="");g.yb.w.constructor.call(this,a,c,d)};g.g.object.Y(g.yb,g.pa);g.yb.qa=function(a){var c=g.g.nc(a.text);return new g.yb(c,void 0,a)};g.yb.prototype.Ci=!0;g.yb.Uv=11;g.yb.Hv=4;b=g.yb.prototype;b.vo="text";b.nd=function(a){g.yb.w.nd.call(this,a);"boolean"==typeof a.spellcheck&&(this.ll=a.spellcheck)};b.Og=function(a){return null===a||void 0===a?null:String(a)}; +b.Rx=function(){if(this.Sk){this.Zp=!1;var a=this.$a;this.$a=this.kc.xA;this.B&&g.i.isEnabled()&&g.i.Oa(new g.i.qg(this.B,"field",this.name||null,a,this.$a))}};b.Pg=function(a){this.Zp=!0;this.$a=a;this.Sk||(this.qf=!0)};b.bh=function(){g.yb.w.bh.call(this);this.Sk&&(this.B.G?setTimeout(this.fh.bind(this),0):this.fh(),this.Zp?(g.g.o.Tb(this.kc,"blocklyInvalidInput"),g.g.M.cb(this.kc,"invalid",!1)):(g.g.o.qb(this.kc,"blocklyInvalidInput"),g.g.M.cb(this.kc,"invalid",!0)))}; +function ue(a){0!=a.ll&&(a.ll=!1,a.kc&&a.kc.setAttribute("spellcheck",a.ll))}b.wf=function(a){this.s=this.B.v;a=a||!1;!a&&(g.g.userAgent.sC||g.g.userAgent.zl||g.g.userAgent.ck)?ve(this):(g.ba.show(this,this.B.G,this.DH.bind(this)),this.kc=this.Lq(),this.Sk=!0,a||(this.kc.focus(),this.kc.select()))};function ve(a){g.prompt(g.h.CHANGE_VALUE_TITLE,a.dc(),function(c){a.setValue(c)})} +b.Lq=function(){var a=g.ba.Ca,c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.ll);var d=g.yb.Uv*this.s.scale+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=g.yb.Hv*this.s.scale+"px";a.appendChild(c);c.value=c.defaultValue=String(this.$a);c.xA=this.$a;c.vu=null;g.g.userAgent.Eo?setTimeout(this.fh.bind(this),0):this.fh();we(this,c);return c}; +b.DH=function(){this.Sk=!1;this.Zp=!0;xb(this);this.yu&&this.yu(this.$a);g.Ua(this.nn);g.Ua(this.sG);var a=g.ba.Ca.style;a.width="auto";a.height="auto";a.fontSize=""};function we(a,c){a.nn=g.ca(c,"keydown",a,a.zu);a.sG=g.ca(c,"input",a,a.rG)}b.zu=function(a){a.keyCode==g.g.ya.Fl?(g.ba.Ga(),g.D.aj()):a.keyCode==g.g.ya.er?(this.kc.value=this.kc.defaultValue,g.ba.Ga(),g.D.aj()):a.keyCode==g.g.ya.Cw&&(g.ba.Ga(),g.D.aj(),Yc(this.B,this,!a.shiftKey),a.preventDefault())}; +b.rG=function(){var a=this.kc.value;a!==this.kc.vu&&(this.kc.vu=a,g.i.aa(!0),this.setValue(a),xb(this),g.i.aa(!1))};b.fh=function(){var a=g.ba.Ca,c=wb(this);a.style.width=c.right-c.left+"px";a.style.height=c.bottom-c.top+"px";c=new g.g.X(this.B.G?c.right-a.offsetWidth:c.left,c.top);c.y+=1;g.g.userAgent.Eo&&g.ba.Ca.style.top&&(--c.x,--c.y);g.g.userAgent.Wr&&(c.y-=3);a.style.left=c.x+"px";a.style.top=c.y+"px"}; +g.yb.lG=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)};g.yb.fM=function(a){(a=g.yb.lG(a))&&(a=String(Math.max(0,Math.floor(a))));return a};g.yb.prototype.gz=function(){return!0};g.yb.prototype.Hp=function(){return this.Sk&&this.kc?this.kc.value:null};g.vc.register("field_input",g.yb);g.ze=function(a,c,d,e,f,h){this.kn=-Infinity;this.hn=Infinity;this.cl=0;this.Gs=null;g.ze.w.constructor.call(this,a||0,f,h);h||(xe(this,c),ye(this,d),ze(this,e),this.setValue(this.getValue()))};g.g.object.Y(g.ze,g.yb);g.ze.qa=function(a){return new g.ze(a.value,void 0,void 0,void 0,void 0,a)};g.ze.prototype.Ci=!0;g.ze.prototype.nd=function(a){g.ze.w.nd.call(this,a);xe(this,a.min);ye(this,a.max);ze(this,a.precision)};function xe(a,c){null==c?a.kn=-Infinity:(c=Number(c),isNaN(c)||(a.kn=c))} +function ye(a,c){null==c?a.hn=Infinity:(c=Number(c),isNaN(c)||(a.hn=c))}function ze(a,c){null==c?a.cl=0:(c=Number(c),isNaN(c)||(a.cl=c));var d=a.cl.toString(),e=d.indexOf(".");a.Gs=-1==e?c?0:null:d.length-e-1}g.ze.prototype.Og=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.kn),this.hn);this.cl&&isFinite(a)&&(a=Math.round(a/this.cl)*this.cl);null!=this.Gs&&(a=Number(a.toFixed(this.Gs)));return a}; +g.ze.prototype.Lq=function(){var a=g.ze.w.Lq.call(this);-Infinitythis.hn&&g.g.M.cb(a,g.g.M.State.hD,this.hn);return a};g.vc.register("field_number",g.ze);g.Ae=function(a,c,d,e,f){this.nj=g.Ae.FE;this.oE=a||"";this.Bb=new g.g.ge(0,g.xa.vr);f&&this.nd(f);c&&(this.Oj=c);f||Ae(this,d,e)};g.g.object.Y(g.Ae,g.na);g.Ae.qa=function(a){var c=g.g.nc(a.variable);return new g.Ae(c,void 0,void 0,void 0,a)};b=g.Ae.prototype;b.s=null;b.Ci=!0;b.nd=function(a){g.Ae.w.nd.call(this,a);Ae(this,a.variableTypes,a.defaultType)};b.dj=function(){if(!this.Zd){var a=g.O.Ep(this.B.v,null,this.oE,this.nE);g.i.disable();this.setValue(a.wa());g.i.enable()}}; +b.Fm=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=g.O.Ep(this.B.v,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.wa()+"' had type "+c.type+", and does not match variable field that references it: "+g.R.Dd(a)+".");this.setValue(c.wa())};b.tA=function(a){this.dj();a.id=this.Zd.wa();a.textContent=this.Zd.name;this.Zd.type&&a.setAttribute("variabletype",this.Zd.type);return a}; +b.cv=function(a){if(a.hb)throw Error("Variable fields are not allowed to exist on shadow blocks.");g.Ae.w.cv.call(this,a)};b.getValue=function(){return this.Zd?this.Zd.wa():null};b.dc=function(){return this.Zd?this.Zd.name:""};b.ad=function(){return this.Zd};b.Gy=function(){return this.Zd?this.Oj:null}; +b.Og=function(a){if(null===a)return null;var c=g.O.ad(this.B.v,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=Be(this)){for(var e=0;e=d||0>=c)throw Error("Height and width values of an image field must be greater than 0.");this.Dm=!1;this.Zo="";g.Ff.w.constructor.call(this,a||"",null,k);k||(this.Dm=!!h,this.Zo=g.g.nc(e)||"");this.Bb=new g.g.ge(c,d+g.Ff.Yr);this.BF=d;this.hm=null;"function"== +typeof f&&(this.hm=f)};g.g.object.Y(g.Ff,g.pa);g.Ff.qa=function(a){return new g.Ff(a.src,a.width,a.height,void 0,void 0,void 0,a)};g.Ff.Yr=1;b=g.Ff.prototype;b.Ef=!1;b.qf=!1;b.nd=function(a){g.Ff.w.nd.call(this,a);this.Dm=!!a.flipRtl;this.Zo=g.g.nc(a.alt)||""};b.Wg=function(){this.Pe=g.g.o.K("image",{height:this.BF+"px",width:this.Bb.width+"px",alt:this.Zo},this.me);this.Pe.setAttributeNS(g.g.o.bf,"xlink:href",this.$a)};b.Og=function(a){return"string"!=typeof a?null:a}; +b.Pg=function(a){this.$a=a;this.Pe&&this.Pe.setAttributeNS(g.g.o.bf,"xlink:href",this.$a||"")};b.uy=function(){return this.Dm};b.wf=function(){this.hm&&this.hm(this)};b.Hp=function(){return this.Zo};g.vc.register("field_image",g.Ff);g.ye=function(a,c,d){null==a&&(a="");g.ye.w.constructor.call(this,a,c,d)};g.g.object.Y(g.ye,g.yb);g.ye.Jo=20;g.ye.qa=function(a){var c=g.g.nc(a.text);return new g.ye(c,void 0,a)};b=g.ye.prototype;b.Wg=function(){tb(this);this.Eq=g.g.o.K("g",{"class":"blocklyEditableText"},this.me)}; +b.Bp=function(){var a=this.$a;if(!a)return g.pa.Mo;var c=a.split("\n");a="";for(var d=0;dthis.fq&&(e=e.substring(0,this.fq-4)+"...");e=e.replace(/\s/g,g.pa.Mo);a+=e;d!==c.length-1&&(a+="\n")}this.B.G&&(a+="\u200f");return a}; +b.bh=function(){for(var a;a=this.Eq.firstChild;)this.Eq.removeChild(a);a=this.Bp().split("\n");for(var c=g.pa.Yr/2,d=0,e=0;ec&&(c=f);d+=g.ye.Jo}this.Nd&&(c+=g.pa.tk,this.Nd.setAttribute("width",c),this.Nd.setAttribute("height",d));this.Bb.width=c;this.Bb.height=d};b.fh=function(){var a=g.ba.Ca,c=wb(this);a.style.width=c.right-c.left+"px";a.style.height=c.bottom-c.top+"px";c=new g.g.X(this.B.G?c.right-a.offsetWidth:c.left,c.top);a.style.left=c.x+"px";a.style.top=c.y+"px"}; +b.Lq=function(){var a=g.ba.Ca,c=this.s.scale,d=document.createElement("textarea");d.className="blocklyHtmlInput blocklyHtmlTextAreaInput";d.setAttribute("spellcheck",this.ll);var e=g.yb.Uv*c+"pt";a.style.fontSize=e;d.style.fontSize=e;d.style.borderRadius=g.yb.Hv*c+"px";e=g.pa.ug*c;d.style.paddingLeft=e+"px";d.style.width="calc(100% - "+e+"px)";d.style.lineHeight=g.ye.Jo*c+"px";a.appendChild(d);d.value=d.defaultValue=String(this.$a);d.xA=this.$a;d.vu=null;g.g.userAgent.Eo?setTimeout(this.fh.bind(this), +0):this.fh();we(this,d);return d};b.zu=function(a){a.keyCode!==g.g.ya.Fl&&g.ye.w.zu.call(this,a)};g.Vc.register(".blocklyHtmlTextAreaInput {,font-family: monospace;,resize: none;,overflow: hidden;,height: 100%;,text-align: left;,}".split(","));g.vc.register("field_multilinetext",g.ye);g.N.qH={};g.W.Text={};g.W.Text.bk=160; +g.Eh([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12, +height:17,alt:"\u00b6"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"}, +{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}], +previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}", +helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}", +args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]); +g.N.text_getSubstring={U:function(){this.WHERE_OPTIONS_1=[[g.h.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[g.h.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[g.h.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[g.h.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[g.h.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[g.h.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.Lb=g.h.TEXT_GET_SUBSTRING_HELPURL;J(this,"text_blocks");I(K(this,"STRING").Za("String"),g.h.TEXT_GET_SUBSTRING_INPUT_IN_TEXT); +L(this,"AT1");L(this,"AT2");g.h.TEXT_GET_SUBSTRING_TAIL&&I(L(this,"TAIL"),g.h.TEXT_GET_SUBSTRING_TAIL);this.re(!0);this.td(!0,"String");this.Ub(1,!0);this.Ub(2,!0);this.Ha(g.h.TEXT_GET_SUBSTRING_TOOLTIP)},Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("at1",E(this,"AT1").type==g.Ra);a.setAttribute("at2",E(this,"AT2").type==g.Ra);return a},kb:function(a){var c="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.Ub(1,c);this.Ub(2,a)},Ub:function(a,c){this.ob("AT"+ +a);this.ob("ORDINAL"+a,!0);c?(K(this,"AT"+a).Za("Number"),g.h.ORDINAL_NUMBER_SUFFIX&&I(L(this,"ORDINAL"+a),g.h.ORDINAL_NUMBER_SUFFIX)):L(this,"AT"+a);2==a&&g.h.TEXT_GET_SUBSTRING_TAIL&&(this.ob("TAIL",!0),I(L(this,"TAIL"),g.h.TEXT_GET_SUBSTRING_TAIL));var d=new g.na(this["WHERE_OPTIONS_"+a],function(e){var f="FROM_START"==e||"FROM_END"==e;if(f!=c){var h=this.B;h.Ub(a,f);xc(h,e,"WHERE"+a);return null}});I(E(this,"AT"+a),d,"WHERE"+a);1==a&&(Ac(this,"AT1","AT2"),E(this,"ORDINAL1")&&Ac(this,"ORDINAL1", +"AT2"))}};g.N.text_changeCase={U:function(){var a=[[g.h.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[g.h.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[g.h.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.Lb=g.h.TEXT_CHANGECASE_HELPURL;J(this,"text_blocks");I(K(this,"TEXT").Za("String"),new g.na(a),"CASE");this.td(!0,"String");this.Ha(g.h.TEXT_CHANGECASE_TOOLTIP)}}; +g.N.text_trim={U:function(){var a=[[g.h.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[g.h.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[g.h.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.Lb=g.h.TEXT_TRIM_HELPURL;J(this,"text_blocks");I(K(this,"TEXT").Za("String"),new g.na(a),"MODE");this.td(!0,"String");this.Ha(g.h.TEXT_TRIM_TOOLTIP)}}; +g.N.text_print={U:function(){zc(this,{message0:g.h.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:g.h.TEXT_PRINT_TOOLTIP,helpUrl:g.h.TEXT_PRINT_HELPURL})}}; +g.N.text_prompt_ext={U:function(){var a=[[g.h.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[g.h.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.Lb=g.h.TEXT_PROMPT_HELPURL;J(this,"text_blocks");var c=this;a=new g.na(a,function(d){c.Af(d)});I(K(this,"TEXT"),a,"TYPE");this.td(!0,"String");this.Ha(function(){return"TEXT"==z(c,"TYPE")?g.h.TEXT_PROMPT_TOOLTIP_TEXT:g.h.TEXT_PROMPT_TOOLTIP_NUMBER})},Af:function(a){this.L.Za("NUMBER"==a?"Number":"String")},Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("type", +z(this,"TYPE"));return a},kb:function(a){this.Af(a.getAttribute("type"))}}; +g.N.text_prompt={U:function(){this.ag(g.W.Text.Fr);var a=[[g.h.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[g.h.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],c=this;this.Lb=g.h.TEXT_PROMPT_HELPURL;J(this,"text_blocks");a=new g.na(a,function(d){c.Af(d)});I(I(I(I(L(this),a,"TYPE"),this.$k(!0)),new g.yb(""),"TEXT"),this.$k(!1));this.td(!0,"String");this.Ha(function(){return"TEXT"==z(c,"TYPE")?g.h.TEXT_PROMPT_TOOLTIP_TEXT:g.h.TEXT_PROMPT_TOOLTIP_NUMBER})},Af:g.N.text_prompt_ext.Af,Pa:g.N.text_prompt_ext.Pa,kb:g.N.text_prompt_ext.kb}; +g.N.text_count={U:function(){zc(this,{message0:g.h.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:g.h.TEXT_COUNT_TOOLTIP,helpUrl:g.h.TEXT_COUNT_HELPURL})}}; +g.N.text_replace={U:function(){zc(this,{message0:g.h.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:g.h.TEXT_REPLACE_TOOLTIP,helpUrl:g.h.TEXT_REPLACE_HELPURL})}}; +g.N.text_reverse={U:function(){zc(this,{message0:g.h.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:g.h.TEXT_REVERSE_TOOLTIP,helpUrl:g.h.TEXT_REVERSE_HELPURL})}}; +g.W.Text.Fr={EC:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",FC:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==", +GC:12,DC:12,NG:function(a){for(var c=0,d;d=this.S[c];c++)for(var e=0,f;f=d.Na[e];e++)if(a==f.name){rc(d,e,this.$k(!0));rc(d,e+2,this.$k(!1));return}console.warn('field named "'+a+'" not found in '+pc(this))},$k:function(a){a=this.G?!a:a;return new g.Ff(a?this.EC:this.FC,this.GC,this.DC,a?"\u201c":"\u201d")}};g.W.Text.bD=function(){this.ag(g.W.Text.Fr);this.NG("TEXT")}; +g.W.Text.aD={Pa:function(){var a=g.g.xml.createElement("mutation");a.setAttribute("items",this.Mb);return a},kb:function(a){this.Mb=parseInt(a.getAttribute("items"),10);this.gd()},Uf:function(a){var c=a.cg("text_create_join_container");c.Td();for(var d=E(c,"STACK").connection,e=0;ed?X(a,c,g.j.zg)||h:e?X(a,c,g.j.Sl)||h:X(a,c,f)||h;if(g.Vh(a))a=Number(a)+d,e&&(a=-a);else{if(0d&&(a=a+" - "+-d,k=g.j.zg);e&&(a=d?"-("+a+")":"-"+a,k=g.j.Sl);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};g.j.Ab={};g.j.colour_picker=function(a){return[g.j.wj(z(a,"COLOUR")),g.j.Ye]};g.j.colour_random=function(){return[Y("colourRandom",["function "+g.j.hc+"() {"," var num = Math.floor(Math.random() * Math.pow(2, 24));"," return '#' + ('00000' + num.toString(16)).substr(-6);","}"])+"()",g.j.Aa]}; +g.j.colour_rgb=function(a){var c=X(a,"RED",g.j.vb)||0,d=X(a,"GREEN",g.j.vb)||0;a=X(a,"BLUE",g.j.vb)||0;return[Y("colourRgb",["function "+g.j.hc+"(r, g, b) {"," r = Math.max(Math.min(Number(r), 100), 0) * 2.55;"," g = Math.max(Math.min(Number(g), 100), 0) * 2.55;"," b = Math.max(Math.min(Number(b), 100), 0) * 2.55;"," r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);"," g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);"," b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);", +" return '#' + r + g + b;","}"])+"("+c+", "+d+", "+a+")",g.j.Aa]}; +g.j.colour_blend=function(a){var c=X(a,"COLOUR1",g.j.vb)||"'#000000'",d=X(a,"COLOUR2",g.j.vb)||"'#000000'";a=X(a,"RATIO",g.j.vb)||.5;return[Y("colourBlend",["function "+g.j.hc+"(c1, c2, ratio) {"," ratio = Math.max(Math.min(Number(ratio), 1), 0);"," var r1 = parseInt(c1.substring(1, 3), 16);"," var g1 = parseInt(c1.substring(3, 5), 16);"," var b1 = parseInt(c1.substring(5, 7), 16);"," var r2 = parseInt(c2.substring(1, 3), 16);"," var g2 = parseInt(c2.substring(3, 5), 16);"," var b2 = parseInt(c2.substring(5, 7), 16);", +" var r = Math.round(r1 * (1 - ratio) + r2 * ratio);"," var g = Math.round(g1 * (1 - ratio) + g2 * ratio);"," var b = Math.round(b1 * (1 - ratio) + b2 * ratio);"," r = ('0' + (r || 0).toString(16)).slice(-2);"," g = ('0' + (g || 0).toString(16)).slice(-2);"," b = ('0' + (b || 0).toString(16)).slice(-2);"," return '#' + r + g + b;","}"])+"("+c+", "+d+", "+a+")",g.j.Aa]};g.j.Yt={};g.j.lists_create_empty=function(){return["[]",g.j.Ye]};g.j.lists_create_with=function(a){for(var c=Array(a.Mb),d=0;d b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];", +" return function(a, b) { return compare(a, b) * direction; }","}"]);return[c+".slice().sort("+e+'("'+a+'", '+d+"))",g.j.Aa]};g.j.lists_split=function(a){var c=X(a,"INPUT",g.j.ab),d=X(a,"DELIM",g.j.zb)||"''";a=z(a,"MODE");if("SPLIT"==a)c||(c="''"),a="split";else if("JOIN"==a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+d+")",g.j.Aa]};g.j.lists_reverse=function(a){return[(X(a,"LIST",g.j.Aa)||"[]")+".slice().reverse()",g.j.Aa]};g.j.RF={};g.j.controls_if=function(a){var c=0,d="";g.j.Ld&&(d+=W(g.j.Ld,a));do{var e=X(a,"IF"+c,g.j.zb)||"false";var f=Fe(a,"DO"+c);g.j.Yc&&(f=Ee(W(g.j.Yc,a),g.j.xd)+f);d+=(0",GTE:">="}[z(a,"OP")],d="=="==c||"!="==c?g.j.mw:g.j.xC,e=X(a,"A",d)||"0";a=X(a,"B",d)||"0";return[e+" "+c+" "+a,d]};g.j.logic_operation=function(a){var c="AND"==z(a,"OP")?"&&":"||",d="&&"==c?g.j.yr:g.j.zr,e=X(a,"A",d);a=X(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]};g.j.logic_negate=function(a){var c=g.j.lk;return["!"+(X(a,"BOOL",c)||"true"),c]}; +g.j.logic_boolean=function(a){return["TRUE"==z(a,"BOOL")?"true":"false",g.j.Ye]};g.j.logic_null=function(){return["null",g.j.Ye]};g.j.logic_ternary=function(a){var c=X(a,"IF",g.j.Oo)||"false",d=X(a,"THEN",g.j.Oo)||"null";a=X(a,"ELSE",g.j.Oo)||"null";return[c+" ? "+d+" : "+a,g.j.Oo]};g.j.TF={};g.j.controls_repeat_ext=function(a){var c=B(a,"TIMES")?String(Number(z(a,"TIMES"))):X(a,"TIMES",g.j.yi)||"0",d=Fe(a,"DO");d=Ge(d,a);a="";var e=vd(g.j.Jd,"count",g.O.Fb),f=c;c.match(/^\w+$/)||g.Vh(c)||(f=vd(g.j.Jd,"repeat_end",g.O.Fb),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")};g.j.controls_repeat=g.j.controls_repeat_ext; +g.j.controls_whileUntil=function(a){var c="UNTIL"==z(a,"MODE"),d=X(a,"BOOL",c?g.j.lk:g.j.zb)||"false",e=Fe(a,"DO");e=Ge(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"}; +g.j.controls_for=function(a){var c=ud(z(a,"VAR"),g.O.Fb),d=X(a,"FROM",g.j.yi)||"0",e=X(a,"TO",g.j.yi)||"0",f=X(a,"BY",g.j.yi)||"1",h=Fe(a,"DO");h=Ge(h,a);if(g.Vh(d)&&g.Vh(e)&&g.Vh(f)){var k=Number(d)<=Number(e);a="for ("+c+" = "+d+"; "+c+(k?" <= ":" >= ")+e+"; "+c;c=Math.abs(Number(f));a=(1==c?a+(k?"++":"--"):a+((k?" += ":" -= ")+c))+(") {\n"+h+"}\n")}else a="",k=d,d.match(/^\w+$/)||g.Vh(d)||(k=vd(g.j.Jd,c+"_start",g.O.Fb),a+="var "+k+" = "+d+";\n"),d=e,e.match(/^\w+$/)||g.Vh(e)||(d=vd(g.j.Jd,c+"_end", +g.O.Fb),a+="var "+d+" = "+e+";\n"),e=vd(g.j.Jd,c+"_inc",g.O.Fb),a+="var "+e+" = ",a=g.Vh(f)?a+(Math.abs(f)+";\n"):a+("Math.abs("+f+");\n"),a=a+("if ("+k+" > "+d+") {\n")+(g.j.xd+e+" = -"+e+";\n"),a+="}\n",a+="for ("+c+" = "+k+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+h+"}\n";return a}; +g.j.controls_forEach=function(a){var c=ud(z(a,"VAR"),g.O.Fb),d=X(a,"LIST",g.j.yi)||"[]",e=Fe(a,"DO");e=Ge(e,a);a="";var f=d;d.match(/^\w+$/)||(f=vd(g.j.Jd,c+"_list",g.O.Fb),a+="var "+f+" = "+d+";\n");d=vd(g.j.Jd,c+"_index",g.O.Fb);e=g.j.xd+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")}; +g.j.controls_flow_statements=function(a){var c="";g.j.Ld&&(c+=W(g.j.Ld,a));g.j.Yc&&(c+=W(g.j.Yc,a));if(g.j.Ld){var d=g.W.Be.to.Fy(a);d&&!d.ki&&(c+=W(g.j.Ld,d))}switch(z(a,"FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");};g.j.dd={};g.j.math_number=function(a){a=Number(z(a,"NUM"));return[a,0<=a?g.j.Ye:g.j.Sl]};g.j.math_arithmetic=function(a){var c={ADD:[" + ",g.j.yg],MINUS:[" - ",g.j.zg],MULTIPLY:[" * ",g.j.Ar],DIVIDE:[" / ",g.j.Ql],POWER:[null,g.j.vb]}[z(a,"OP")],d=c[0];c=c[1];var e=X(a,"A",c)||"0";a=X(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",g.j.Aa]}; +g.j.math_single=function(a){var c=z(a,"OP");if("NEG"==c)return a=X(a,"NUM",g.j.Sl)||"0","-"==a[0]&&(a=" "+a),["-"+a,g.j.Sl];a="SIN"==c||"COS"==c||"TAN"==c?X(a,"NUM",g.j.Ql)||"0":X(a,"NUM",g.j.zb)||"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,g.j.Aa];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,g.j.Ql]}; +g.j.math_constant=function(a){return{PI:["Math.PI",g.j.ab],E:["Math.E",g.j.ab],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",g.j.Ql],SQRT2:["Math.SQRT2",g.j.ab],SQRT1_2:["Math.SQRT1_2",g.j.ab],INFINITY:["Infinity",g.j.Ye]}[z(a,"CONSTANT")]}; +g.j.math_number_property=function(a){var c=X(a,"NUMBER_TO_CHECK",g.j.Rl)||"0",d=z(a,"PROPERTY");if("PRIME"==d){var e=Y("mathIsPrime",["function "+g.j.hc+"(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,g.j.Aa]}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=X(a,"DIVISOR",g.j.Rl)||"0",e=c+" % "+a+" == 0"}return[e,g.j.mw]}; +g.j.math_change=function(a){var c=X(a,"DELTA",g.j.yg)||"0";a=ud(z(a,"VAR"),g.O.Fb);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};g.j.math_round=g.j.math_single;g.j.math_trig=g.j.math_single; +g.j.math_on_list=function(a){var c=z(a,"OP");switch(c){case "SUM":a=X(a,"LIST",g.j.ab)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=X(a,"LIST",g.j.vb)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=X(a,"LIST",g.j.vb)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=Y("mathMean",["function "+g.j.hc+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=X(a,"LIST",g.j.zb)||"[]";a=c+"("+a+")";break;case "MEDIAN":c= +Y("mathMedian",["function "+g.j.hc+"(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=X(a,"LIST",g.j.zb)||"[]";a=c+"("+a+")";break;case "MODE":c=Y("mathModes",["function "+ +g.j.hc+"(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=X(a,"LIST",g.j.zb)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=Y("mathStandardDeviation",["function "+g.j.hc+"(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=X(a,"LIST",g.j.zb)||"[]";a=c+"("+a+")";break;case "RANDOM":c=Y("mathRandomList",["function "+g.j.hc+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=X(a,"LIST",g.j.zb)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,g.j.Aa]};g.j.math_modulo=function(a){var c=X(a,"DIVIDEND",g.j.Rl)||"0";a=X(a,"DIVISOR",g.j.Rl)||"0";return[c+" % "+a,g.j.Rl]}; +g.j.math_constrain=function(a){var c=X(a,"VALUE",g.j.vb)||"0",d=X(a,"LOW",g.j.vb)||"0";a=X(a,"HIGH",g.j.vb)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",g.j.Aa]}; +g.j.math_random_int=function(a){var c=X(a,"FROM",g.j.vb)||"0";a=X(a,"TO",g.j.vb)||"0";return[Y("mathRandomInt",["function "+g.j.hc+"(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+")",g.j.Aa]};g.j.math_random_float=function(){return["Math.random()",g.j.Aa]}; +g.j.math_atan2=function(a){var c=X(a,"X",g.j.vb)||"0";return["Math.atan2("+(X(a,"Y",g.j.vb)||"0")+", "+c+") / Math.PI * 180",g.j.Ql]};g.j.MG={};g.j.procedures_defreturn=function(a){var c=ud(z(a,"NAME"),g.Ka.Fb),d="";g.j.Ld&&(d+=W(g.j.Ld,a));g.j.Yc&&(d+=W(g.j.Yc,a));d&&(d=Ee(d,g.j.xd));var e="";g.j.Go&&(e=Ee(W(g.j.Go,a),g.j.xd));var f=Fe(a,"STACK"),h=X(a,"RETURN",g.j.zb)||"",k="";f&&h&&(k=d);h&&(h=g.j.xd+"return "+h+";\n");for(var l=[],m=0;m":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function af(a){return bf[a]}var $e=/[\x00\x22\x26\x27\x3c\x3e]/g;function cf(){return'
'};function df(){for(var a='
Jogos do BlocklyQuebra-Cabe\u00e7aLabirintoP\u00e1ssaroTartarugaFilmeM\u00fasicaTutor de LagoaLagoaGen\u00e9ticasVoc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:Voc\u00ea esta preparado para o n\u00edvel %1?Voc\u00ea esta preparado para o pr\u00f3ximo desafio?T\u00edtulo:Salvar e ligar aos blocos.Rodar o programa que voc\u00ea escreveu.Executar o programaParar a execu\u00e7\u00e3o do programa e resetar o nivel.ReiniciarAjudaOKCancelarL\u00f3gicaLa\u00e7osMatem\u00e1ticaTextoListasCorVari\u00e1veisFun\u00e7\u00f5esHouve um problema com a requisi\u00e7\u00e3o.Compartilhe seus blocos com este link:\n\n%1Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.listatextoQuando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?Blocos
Move a tartaruga para frente ou para tr\u00e1s a \\nquantidade especificada. avan\u00e7armover para tr\u00e1sGira a tartaruga para esquerda ou direita de \\nacordo com o n\u00famero de graus especificado. vire \u00e0 direitavire \u00e0 esquerdaMuda o tamanho da caneta.configurar largura paraMuda a cor da caneta.Configurar cor paraLevanta ou abaixa a caneta, para parar ou voltar \\na desenhar. levantar canetaabaixar canetaTorna a tartaruga (c\u00edrculo e seta) vis\u00edvel ou \\ninvis\u00edvel. esconder tartarugamostrar tartarugahttps://pt.wikipedia.org/wiki/Impress%C3%A3oDesenha texto na dire\u00e7\u00e3o da tartaruga em sua \\nlocaliza\u00e7\u00e3o. imprimirhttps://pt.wikipedia.org/wiki/Fonte_tipogr%C3%A1ficaConfigurar a fonte usada pelo bloco de impress\u00e3o \\nna tela. fontetamanho da fontenormalnegritoit\u00e1licoRode seu programa at\u00e9 que ele pare. Depois voc\u00ea pode submeter seu desenho a galeria.

'+ +((Ad?'':'')+"Jogos do Blockly : "+Z({appName:"Tartaruga"}.appName)+""),c="   ",d=1;11>d;d++)c+=" "+(d==M?''+Z(d)+"":10==d?''+Z(d)+"":'');return a+c+'

  
\x3c!-- Slow icon. --\x3e\x3c!-- Fast icon. --\x3e
'+ +(10!=M||Ad?"":'
Enviar seu desenho para a galeria.
T\u00edtulo:
\x3c!--Legal disclaimer goes here if needed.--\x3e
')+ +('
Parab\u00e9ns!
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.
')+ +(cf()+"
")+(4>M?'
Sua solu\u00e7\u00e3o funciona, mas voc\u00ea pode fazer melhor. '+(3>M?"Desenhe o contorno somente com esses tr\u00eas blocos.":"Desenhe a estrela somente com 4 blocos.")+"
"+cf()+"
":"")+'
'+(1==M?'Crie um programa que desenha um quadrado.
': +2==M?"Modifique seu programa para que desenhe um pent\u00e1gono em vez de um quadrado.":3==M?'Aqui est\u00e1 um novo bloco que te permite trocar a cor:
Desenhe uma estrela amarela.':4==M?'Aqui esta um novo bloco que te permite suspender a caneta quando voc\u00ea move o cursor:
Desenhe uma pequena estrela amarela, depois, desenhe uma linha em cima dela.':5==M?"Em vez de uma estrela, voc\u00ea pode desenhar quatro estrelas dispostas como um quadrado?": +6==M?"Desenhe tr\u00eas estrelas amarelas e uma linha branca.":7==M?"Desenhe as estrelas, depois desenhe quatro linhas brancas.":8==M?"Desenhar 360 linhas brancas vai parecer uma lua cheia.":9==M?"Voc\u00ea pode adicionar um circulo preto para que a lua fique crescente?":10==M?"Desenhe o que voc\u00ea quiser. Voc\u00ea conseguiu um grande numero de blocos novos para explorar. Divirta-se!"+(Ad?"":'

Use o bot\u00e3o "Ver Galeria" para ver o que as outras pessoas desenharam. Se voc\u00ea desenhar algo interessante,use o bot\u00e3o "Enviar para a Galeria" para publicar.'): +"")+"
"+cf()+"
"+(1==M?'
Escolha uma categoria para ver os blocos.
':"")};var Id="turtle",ef=[],ff=0,gf=null,hf=!0,jf=!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=df();P.U();var c=-1!=xd.indexOf(yd),d=document.getElementById("blockly"),e=document.getElementById("visualization");window.addEventListener("scroll",function(){a(null);g.ol(H)});window.addEventListener("resize",a);a(null);10>M&&(g.Eb.po=3,g.Eb.oo="#ff0000 #ffcc33 #ffff00 #009900 #3333ff #cc33cc #ffffff #999999 #000000".split(" ")); +var f=document.getElementById("toolbox");H=g.Ph("blockly",{media:"third-party/blockly/media/",rtl:c,toolbox:f,trashcan:!0,zoom:10==M?{controls:!0,wheel:!0}:null});He("moveForward,moveBackward,turnRight,turnLeft,penUp,penDown,penWidth,penColour,hideTurtle,showTurtle,print,font");document.getElementById("submitButton")&&Jd("submitButton",kf);f=document.getElementById("slider");le=new ae(f);P.PF(10==M?'10': +'100',10!=M||lf);Q=document.getElementById("display").getContext("2d");me=document.getElementById("answer").getContext("2d");R=document.getElementById("scratch").getContext("2d");mf();re();me.globalCompositeOperation="copy";me.drawImage(R.canvas,0,0);me.globalCompositeOperation="source-over";mf();Jd("runButton",nf);Jd("resetButton",of);H.Nf.load(["turtle/win.mp3","turtle/win.ogg"],"win");setTimeout(P.CF, +1);setTimeout(P.DF,1);Jd("helpButton",pf);2>location.hash.length&&!Gd(M)&&(setTimeout(pf,1E3),9==M&&setTimeout(O.Qw,3E5));1==M&&Ba(H,qf)}); +function lf(a){for(var c=a=g.R.lh(a);c;){if("block"==c.nodeName.toLowerCase()){for(var d=c.getAttribute("type"),e=c.lastChild;e&&"field"!=e.nodeName.toLowerCase();)e=e.previousSibling;var f=e&&e.getAttribute("name");if("turtle_colour_internal"==d&&"COLOUR"==f){c.setAttribute("type","turtle_colour");c.removeChild(e);var h=document.createElement("value");h.setAttribute("name","COLOUR");c.appendChild(h);var k=document.createElement("shadow");k.setAttribute("type","colour_picker");h.appendChild(k);k.appendChild(e)}"turtle_repeat_internal"== +d&&"TIMES"==f&&(c.setAttribute("type","controls_repeat_ext"),c.removeChild(e),h=document.createElement("value"),h.setAttribute("name","TIMES"),c.appendChild(h),k=document.createElement("shadow"),k.setAttribute("type","math_number"),h.appendChild(k),e.setAttribute("name","NUM"),k.appendChild(e));"turtle_move_internal"==d&&"VALUE"==f&&(c.setAttribute("type","turtle_move"),c.removeChild(e),h=document.createElement("value"),h.setAttribute("name","VALUE"),c.appendChild(h),k=document.createElement("shadow"), +k.setAttribute("type","math_number"),h.appendChild(k),e.setAttribute("name","NUM"),k.appendChild(e));"turtle_turn_internal"==d&&"VALUE"==f&&(c.setAttribute("type","turtle_turn"),c.removeChild(e),h=document.createElement("value"),h.setAttribute("name","VALUE"),c.appendChild(h),k=document.createElement("shadow"),k.setAttribute("type","math_number"),h.appendChild(k),e.setAttribute("name","NUM"),k.appendChild(e))}c=rf(c)}return g.R.Dd(a)} +function rf(a){if(a.firstChild)return a.firstChild;do if(a.nextSibling)return a.nextSibling;while(a=a.parentNode);return a}function pf(){var a=document.getElementById("help"),c=document.getElementById("helpButton");3==M?P.Zy("sampleHelp3",'#ffff00'):4==M&&P.Zy("sampleHelp4",'');O.Dj(a,c,!0,!0,{width:"50%",left:"25%",top:"5em"},sf);O.hv()} +function sf(){O.kv();1==M&&setTimeout(tf,5E3)}function tf(){if(!uf&&!O.Qh){var a=document.getElementById("helpToolbox"),c={width:"25%",top:"3.3em"};-1!=xd.indexOf(yd)?c.right="525px":c.left="525px";var d=document.getElementById(":0");O.Dj(a,d,!0,!1,c,null)}}var uf=!1;function qf(a){a.type==g.i.Yl&&"category"==a.element&&(uf=!0,O.Qd(!1),Ca(H,qf))} +function mf(){oe=ne=200;pe=0;hf=qe=!0;R.canvas.width=R.canvas.width;R.strokeStyle="#ffffff";R.fillStyle="#ffffff";R.lineWidth=5;R.lineCap="round";R.font="normal 18pt Arial";vf();for(var a=0;aM&&(H.Nf.play("win",.5),O.YD())):U("#ff0000");jf=!0}} +function yf(a){a&&(vf(),P.Gt(a),a=1E3*Math.pow(1-le.getValue(),2),ff=Math.max(1,a))}function S(a,c){qe&&(R.beginPath(),R.moveTo(ne,oe));if(a){var d=g.g.dd.rl(pe);ne+=a*Math.sin(d);oe-=a*Math.cos(d);a=0}else a=.1;qe&&(R.lineTo(ne,oe+a),R.stroke());yf(c)}function T(a,c){a=pe+a;a%=360;0>a&&(a+=360);pe=a;yf(c)}function V(a,c){qe=a;yf(c)}function U(a,c){R.strokeStyle=a;R.fillStyle=a;yf(c)} +function kf(){if(jf){var a=document.getElementById("thumbnail"),c=a.getContext("2d");c.globalCompositeOperation="copy";c.drawImage(Q.canvas,0,0,200,200);a=a.toDataURL("image/png");document.getElementById("galleryThumb").value=a;O.fv()}else alert(N("Turtle_submitDisabled"))}; diff --git a/html/blockly-games/turtle/help_left.png b/html/blockly-games/turtle/help_left.png new file mode 100644 index 0000000..690886e Binary files /dev/null and b/html/blockly-games/turtle/help_left.png differ diff --git a/html/blockly-games/turtle/icons.png b/html/blockly-games/turtle/icons.png new file mode 100644 index 0000000..7809722 Binary files /dev/null and b/html/blockly-games/turtle/icons.png differ diff --git a/html/blockly-games/turtle/square.gif b/html/blockly-games/turtle/square.gif new file mode 100644 index 0000000..2e5a1ce Binary files /dev/null and b/html/blockly-games/turtle/square.gif differ diff --git a/html/blockly-games/turtle/style.css b/html/blockly-games/turtle/style.css new file mode 100644 index 0000000..8c72d10 --- /dev/null +++ b/html/blockly-games/turtle/style.css @@ -0,0 +1,57 @@ +button.primary { + /* Can't use "text-align: start" due to IE. */ + text-align: left; +} +html[dir="RTL"] button.primary { + text-align: right; +} + +#blockly { + position: fixed; + bottom: 10px; +} +#display { + border: 1px solid #ccc; +} +#downloadImageLink { + display: none; +} +#sampleHelp3, #sampleHelp4 { + height: 50px; + width: 250px; +} + +/* Slider. */ +.sliderTrack { + stroke: #aaa; + stroke-width: 6px; + stroke-linecap: round; +} +.sliderKnob { + fill: #ddd; + stroke: #bbc; + stroke-width: 1px; + stroke-linejoin: round; +} +.sliderKnob:hover { + fill: #eee; +} + +/* Sprited icons. */ +.icon21 { + height: 21px; + width: 21px; + background-image: url(icons.png); +} +.camera { + background-position: -21px 0px; +} +.stop { + background-position: -42px 0px; +} +.run { + background-position: -63px 0px; +} +.gallery { + background-position: -63px -21px; +} diff --git a/html/blockly-games/turtle/win.mp3 b/html/blockly-games/turtle/win.mp3 new file mode 100644 index 0000000..5ae3d1d Binary files /dev/null and b/html/blockly-games/turtle/win.mp3 differ diff --git a/html/blockly-games/turtle/win.ogg b/html/blockly-games/turtle/win.ogg new file mode 100644 index 0000000..2451cf5 Binary files /dev/null and b/html/blockly-games/turtle/win.ogg differ