From 6790355232ceefdaed51d3fedf3a1a267a8cff8f Mon Sep 17 00:00:00 2001 From: DadaMonad Date: Fri, 26 Dec 2014 13:36:45 +0000 Subject: [PATCH] Polymer elements support bind, creation of new elements, overwrite with simple object, events --- bower.json | 3 +- bower_components/connector/.bower.json | 11 +- bower_components/connector/bower.json | 4 +- .../connector/lib/connector.coffee | 5 +- .../peerjs-connector-polymer.coffee | 5 +- .../peerjs-connector/peerjs-connector.html | 2 - bower_components/polymer/.bower.json | 10 +- bower_components/polymer/README.md | 4 +- bower_components/polymer/bower.json | 2 +- bower_components/polymer/build.log | 13 +- bower_components/polymer/polymer.js | 44 +- bower_components/polymer/polymer.min.js | 8 +- build/browser/yatta.js | 69 +- build/test/JsonYatta_test.js | 77 +- build/test/TextYatta_test.js | 77 +- examples/EasyConn/README.md | 7 - .../core-component-page/.bower.json | 19 - .../core-component-page/README.md | 6 - .../core-component-page/bowager-logo.png | Bin 5165 -> 0 bytes .../core-component-page/bower.json | 9 - .../core-component-page.html | 37 - .../core-component-page/demo.html | 23 - .../core-component-page/index.html | 22 - .../peerjs-connector/.bower.json | 41 - .../peerjs-connector/README.md | 180 - .../peerjs-connector/bower.json | 30 - .../peerjs-connector/gulpfile.coffee | 35 - .../lib/peerjs-connector-polymer.coffee | 29 - .../lib/peerjs-connector.coffee | 138 - .../peerjs-connector/package.json | 25 - .../peerjs-connector-polymer.js | 40 - .../peerjs-connector/peerjs-connector.html | 10 - .../peerjs-connector/peerjs-connector.js | 177 - .../peerjs-connector-polymer.js.map | 1 - .../sourcemaps/peerjs-connector.js.map | 1 - .../bower_components/peerjs/.bower.json | 34 - .../bower_components/peerjs/README.md | 5 - .../bower_components/peerjs/bower.json | 24 - .../EasyConn/bower_components/peerjs/peer.js | 2939 ---- .../bower_components/peerjs/peer.min.js | 2 - .../bower_components/polymer/.bower.json | 32 - .../bower_components/polymer/README.md | 16 - .../bower_components/polymer/bower.json | 23 - .../bower_components/polymer/build.log | 26 - .../bower_components/polymer/layout.html | 286 - .../bower_components/polymer/polymer.html | 12 - .../bower_components/polymer/polymer.js | 11829 ---------------- .../bower_components/polymer/polymer.min.js | 14 - .../webcomponentsjs/.bower.json | 23 - .../webcomponentsjs/CustomElements.js | 931 -- .../webcomponentsjs/CustomElements.min.js | 11 - .../webcomponentsjs/HTMLImports.js | 1055 -- .../webcomponentsjs/HTMLImports.min.js | 11 - .../webcomponentsjs/README.md | 16 - .../webcomponentsjs/ShadowDOM.js | 4248 ------ .../webcomponentsjs/ShadowDOM.min.js | 13 - .../webcomponentsjs/bower.json | 14 - .../webcomponentsjs/webcomponents-lite.js | 1692 --- .../webcomponentsjs/webcomponents-lite.min.js | 11 - .../webcomponentsjs/webcomponents.js | 6374 --------- .../webcomponentsjs/webcomponents.min.js | 14 - examples/EasyConn/index.html | 21 - examples/EasyConn/index.js | 6 - examples/Iwc/IwcYatta.xml | 17 - examples/Iwc/README.md | 74 - examples/Iwc/index.js | 57 - examples/IwcDemo/README.md | 40 - examples/IwcDemo/index1.js | 32 - examples/IwcDemo/index2.js | 26 - examples/IwcDemo/test1.xml | 17 - examples/IwcDemo/test2.xml | 17 - examples/PeerJs-Json/index.html | 5 +- examples/TextEditing/index.html | 6 +- examples/TextEditing/index.js | 33 +- examples/temp_ex/README.md | 92 - examples/temp_ex/index.html | 21 - examples/temp_ex/index.js | 83 - gulpfile.coffee | 3 +- lib/Types/StructuredTypes.coffee | 2 +- lib/Types/TextTypes.coffee | 52 +- lib/Yatta.coffee | 41 - test/JsonYatta_test.coffee | 2 +- test/TextYatta_test.coffee | 2 +- yatta.js | 2 +- 84 files changed, 249 insertions(+), 31221 deletions(-) delete mode 100644 examples/EasyConn/README.md delete mode 100644 examples/EasyConn/bower_components/core-component-page/.bower.json delete mode 100644 examples/EasyConn/bower_components/core-component-page/README.md delete mode 100644 examples/EasyConn/bower_components/core-component-page/bowager-logo.png delete mode 100644 examples/EasyConn/bower_components/core-component-page/bower.json delete mode 100644 examples/EasyConn/bower_components/core-component-page/core-component-page.html delete mode 100644 examples/EasyConn/bower_components/core-component-page/demo.html delete mode 100644 examples/EasyConn/bower_components/core-component-page/index.html delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/.bower.json delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/README.md delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/bower.json delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/gulpfile.coffee delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/lib/peerjs-connector-polymer.coffee delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/lib/peerjs-connector.coffee delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/package.json delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/peerjs-connector-polymer.js delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/peerjs-connector.html delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/peerjs-connector.js delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/sourcemaps/peerjs-connector-polymer.js.map delete mode 100644 examples/EasyConn/bower_components/peerjs-connector/sourcemaps/peerjs-connector.js.map delete mode 100644 examples/EasyConn/bower_components/peerjs/.bower.json delete mode 100644 examples/EasyConn/bower_components/peerjs/README.md delete mode 100644 examples/EasyConn/bower_components/peerjs/bower.json delete mode 100644 examples/EasyConn/bower_components/peerjs/peer.js delete mode 100644 examples/EasyConn/bower_components/peerjs/peer.min.js delete mode 100644 examples/EasyConn/bower_components/polymer/.bower.json delete mode 100644 examples/EasyConn/bower_components/polymer/README.md delete mode 100644 examples/EasyConn/bower_components/polymer/bower.json delete mode 100644 examples/EasyConn/bower_components/polymer/build.log delete mode 100644 examples/EasyConn/bower_components/polymer/layout.html delete mode 100644 examples/EasyConn/bower_components/polymer/polymer.html delete mode 100644 examples/EasyConn/bower_components/polymer/polymer.js delete mode 100644 examples/EasyConn/bower_components/polymer/polymer.min.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/.bower.json delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/CustomElements.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/CustomElements.min.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/HTMLImports.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/HTMLImports.min.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/README.md delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/ShadowDOM.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/ShadowDOM.min.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/bower.json delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/webcomponents-lite.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/webcomponents-lite.min.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/webcomponents.js delete mode 100644 examples/EasyConn/bower_components/webcomponentsjs/webcomponents.min.js delete mode 100644 examples/EasyConn/index.html delete mode 100644 examples/EasyConn/index.js delete mode 100644 examples/Iwc/IwcYatta.xml delete mode 100644 examples/Iwc/README.md delete mode 100644 examples/Iwc/index.js delete mode 100644 examples/IwcDemo/README.md delete mode 100644 examples/IwcDemo/index1.js delete mode 100644 examples/IwcDemo/index2.js delete mode 100644 examples/IwcDemo/test1.xml delete mode 100644 examples/IwcDemo/test2.xml delete mode 100644 examples/temp_ex/README.md delete mode 100644 examples/temp_ex/index.html delete mode 100644 examples/temp_ex/index.js delete mode 100644 lib/Yatta.coffee diff --git a/bower.json b/bower.json index b7dca552..660b549d 100644 --- a/bower.json +++ b/bower.json @@ -25,6 +25,7 @@ "tests" ], "dependencies": { - "peerjs": "~0.3.14" + "peerjs": "~0.3.14", + "polymer": "Polymer/polymer#~0.5.2" } } diff --git a/bower_components/connector/.bower.json b/bower_components/connector/.bower.json index c68b5ffc..619f5f69 100644 --- a/bower_components/connector/.bower.json +++ b/bower_components/connector/.bower.json @@ -19,22 +19,21 @@ "ignore": [ "**/.*", "node_modules", - "bower_components", "test", "tests" ], "dependencies": { - "polymer": "Polymer/polymer#~0.5.1" + "polymer": "Polymer/polymer#~0.5.1", + "peerjs": "~0.3.14" }, "homepage": "https://github.com/DadaMonad/Connector", - "_release": "35f8d81ce7", + "_release": "27a5fbf2af", "_resolution": { "type": "branch", "branch": "master", - "commit": "35f8d81ce73ecac317b3dd7fabf32a871a4926a6" + "commit": "27a5fbf2af5c336df0dc4b27adbe43a0959bbdb1" }, "_source": "git://github.com/DadaMonad/Connector.git", "_target": "*", - "_originalSource": "DadaMonad/Connector", - "_direct": true + "_originalSource": "DadaMonad/Connector" } \ No newline at end of file diff --git a/bower_components/connector/bower.json b/bower_components/connector/bower.json index a2b7cd06..0f2e3e89 100644 --- a/bower_components/connector/bower.json +++ b/bower_components/connector/bower.json @@ -20,11 +20,11 @@ "ignore": [ "**/.*", "node_modules", - "bower_components", "test", "tests" ], "dependencies": { - "polymer": "Polymer/polymer#~0.5.1" + "polymer": "Polymer/polymer#~0.5.1", + "peerjs": "~0.3.14" } } diff --git a/bower_components/connector/lib/connector.coffee b/bower_components/connector/lib/connector.coffee index d76385c5..23f89332 100644 --- a/bower_components/connector/lib/connector.coffee +++ b/bower_components/connector/lib/connector.coffee @@ -14,7 +14,10 @@ class Connector @receive_handlers = [] # A list of functions that are executed (left to right) when syncing with a peer. @sync_process_order = [] - + + getUniqueConnectionId: -> + @id # make sure, that every connector implementation does it like this + # # Execute a function _when_ we are connected. If not connected, wait until connected. # @param f {Function} Will be executed on the PeerJs-Connector context. diff --git a/bower_components/connector/lib/peerjs-connector/peerjs-connector-polymer.coffee b/bower_components/connector/lib/peerjs-connector/peerjs-connector-polymer.coffee index c49115ba..67ed626a 100644 --- a/bower_components/connector/lib/peerjs-connector/peerjs-connector-polymer.coffee +++ b/bower_components/connector/lib/peerjs-connector/peerjs-connector-polymer.coffee @@ -5,7 +5,7 @@ new Polymer 'peerjs-connector', if this.is_initialized throw new Error "You must not set the user_id twice!" else - this.initializeConnection() + this.initializeConnection() initializeConnection: ()-> if this.conn_id? @@ -22,8 +22,7 @@ new Polymer 'peerjs-connector', writeIfAvailable 'debug', this.debug this.is_initialized = true; this.connector = new PeerJsConnector this.conn_id, options - + ready: ()-> if this.conn_id != null this.initializeConnection() - diff --git a/bower_components/connector/peerjs-connector/peerjs-connector.html b/bower_components/connector/peerjs-connector/peerjs-connector.html index 1248b189..730161b8 100644 --- a/bower_components/connector/peerjs-connector/peerjs-connector.html +++ b/bower_components/connector/peerjs-connector/peerjs-connector.html @@ -1,4 +1,3 @@ - \ No newline at end of file diff --git a/bower_components/polymer/.bower.json b/bower_components/polymer/.bower.json index 1361f340..9a68ec7a 100644 --- a/bower_components/polymer/.bower.json +++ b/bower_components/polymer/.bower.json @@ -19,14 +19,14 @@ "tools": "Polymer/tools#master", "web-component-tester": "Polymer/web-component-tester#^1.4.2" }, - "version": "0.5.1", - "_release": "0.5.1", + "version": "0.5.2", + "_release": "0.5.2", "_resolution": { "type": "version", - "tag": "0.5.1", - "commit": "c654b2b4996a643e79234ac624d7bc38179dfc2c" + "tag": "0.5.2", + "commit": "2a9ca53fa79ca09907e818f1adf806765409ec9c" }, "_source": "git://github.com/Polymer/polymer.git", - "_target": "~0.5.1", + "_target": "^0.5.0", "_originalSource": "Polymer/polymer" } \ No newline at end of file diff --git a/bower_components/polymer/README.md b/bower_components/polymer/README.md index 68755353..2c03674f 100644 --- a/bower_components/polymer/README.md +++ b/bower_components/polymer/README.md @@ -8,11 +8,11 @@ For more detailed info goto [http://polymer-project.org/](http://polymer-project Polymer is a new type of library for the web, designed to leverage the existing browser infrastructure to provide the encapsulation and extendability currently only available in JS libraries. -Polymer is based on a set of future technologies, including [Shadow DOM](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html), [Custom Elements](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html) and Model Driven Views. Currently these technologies are implemented as polyfills or shims, but as browsers adopt these features natively, the platform code that drives Polymer evacipates, leaving only the value-adds. +Polymer is based on a set of future technologies, including [Shadow DOM](http://w3c.github.io/webcomponents/spec/shadow/), [Custom Elements](http://w3c.github.io/webcomponents/spec/custom/) and Model Driven Views. Currently these technologies are implemented as polyfills or shims, but as browsers adopt these features natively, the platform code that drives Polymer evacipates, leaving only the value-adds. ## Tools & Testing -For running tests or building minified files, consult the [tooling information](http://polymer-project.org/resources/tooling-strategy.html). +For running tests or building minified files, consult the [tooling information](https://www.polymer-project.org/resources/tooling-strategy.html). ## Releases diff --git a/bower_components/polymer/bower.json b/bower_components/polymer/bower.json index 2dfde95f..a08bd2b7 100644 --- a/bower_components/polymer/bower.json +++ b/bower_components/polymer/bower.json @@ -19,5 +19,5 @@ "tools": "Polymer/tools#master", "web-component-tester": "Polymer/web-component-tester#^1.4.2" }, - "version": "0.5.1" + "version": "0.5.2" } \ No newline at end of file diff --git a/bower_components/polymer/build.log b/bower_components/polymer/build.log index dee50c20..e72f5bea 100644 --- a/bower_components/polymer/build.log +++ b/bower_components/polymer/build.log @@ -1,6 +1,6 @@ BUILD LOG --------- -Build Time: 2014-11-12T14:32:18 +Build Time: 2014-12-11T12:46:30 NODEJS INFORMATION ================== @@ -11,16 +11,15 @@ grunt-contrib-concat: 0.5.0 grunt-contrib-copy: 0.7.0 grunt-contrib-uglify: 0.6.0 grunt-string-replace: 1.0.0 -web-component-tester: 1.6.0 REPO REVISIONS ============== -polymer-expressions: 1288fe573dc57cde304f66f0833d0644c766158c -polymer-gestures: 94660a514772e182d27f79c3d8d1bb88796a2327 -polymer: da75e633f39b7761494cc3139a60733c488b2215 +polymer-expressions: 197c3a0150e7a13374cfcc72e7066113723a623d +polymer-gestures: 17a6304916521be39409af292e8adf899bae0ce7 +polymer: a74e9f36526361dccb6df91be439ff9c3e043f41 BUILD HASHES ============ -dist/polymer.js: 59e0d3e669a3a1d163d8337766aa63bf809bfe79 -dist/polymer.min.js: a9145f911c5b9fecc0d4aa422ac658d1d462d15a +dist/polymer.js: b9ad4c86af79c748cf4ea722f6d56671079fadf7 +dist/polymer.min.js: 2f2021ba9682b0bb702ee7fb68fb6fbfd288eac2 dist/layout.html: 348d358a91712ecc2f8811efa430fcd954b4590c \ No newline at end of file diff --git a/bower_components/polymer/polymer.js b/bower_components/polymer/polymer.js index b8b62b0a..2d3b692c 100644 --- a/bower_components/polymer/polymer.js +++ b/bower_components/polymer/polymer.js @@ -939,7 +939,7 @@ window.PolymerGestures = {}; }; })(window.PolymerGestures); -(function (scope) { +(function(scope) { var dispatcher = scope.dispatcher; var pointermap = dispatcher.pointermap; // radius around touchend that swallows mouse events @@ -948,10 +948,22 @@ window.PolymerGestures = {}; var WHICH_TO_BUTTONS = [0, 1, 4, 2]; var CURRENT_BUTTONS = 0; - var HAS_BUTTONS = false; - try { - HAS_BUTTONS = new MouseEvent('test', {buttons: 1}).buttons === 1; - } catch (e) {} + + var FIREFOX_LINUX = /Linux.*Firefox\//i; + + var HAS_BUTTONS = (function() { + // firefox on linux returns spec-incorrect values for mouseup.buttons + // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.buttons#See_also + // https://codereview.chromium.org/727593003/#msg16 + if (FIREFOX_LINUX.test(navigator.userAgent)) { + return false; + } + try { + return new MouseEvent('test', {buttons: 1}).buttons === 1; + } catch (e) { + return false; + } + })(); // handler block for native mouse events var mouseEvents = { @@ -1273,7 +1285,7 @@ window.PolymerGestures = {}; d.forEach(function(p) { this.cancel(p); pointermap.delete(p.pointerId); - }); + }, this); } }, touchstart: function(inEvent) { @@ -2047,7 +2059,9 @@ window.PolymerGestures = {}; 'cancel' ], exposes: [ + 'pinchstart', 'pinch', + 'pinchend', 'rotate' ], defaultActions: { @@ -2065,11 +2079,19 @@ window.PolymerGestures = {}; diameter: points.diameter, target: scope.targetFinding.LCA(points.a.target, points.b.target) }; + + this.firePinch('pinchstart', points.diameter, points); } }, up: function(inEvent) { var p = pointermap.get(inEvent.pointerId); + var num = pointermap.pointers(); if (p) { + if (num === 2) { + // fire 'pinchend' before deleting pointer + var points = this.calcChord(); + this.firePinch('pinchend', points.diameter, points); + } pointermap.delete(inEvent.pointerId); } }, @@ -2084,9 +2106,9 @@ window.PolymerGestures = {}; cancel: function(inEvent) { this.up(inEvent); }, - firePinch: function(diameter, points) { + firePinch: function(type, diameter, points) { var zoom = diameter / this.reference.diameter; - var e = eventFactory.makeGestureEvent('pinch', { + var e = eventFactory.makeGestureEvent(type, { bubbles: true, cancelable: true, scale: zoom, @@ -2113,7 +2135,7 @@ window.PolymerGestures = {}; var diameter = points.diameter; var angle = this.calcAngle(points); if (diameter != this.reference.diameter) { - this.firePinch(diameter, points); + this.firePinch('pinch', diameter, points); } if (angle != this.reference.angle) { this.fireRotate(angle, points); @@ -3258,7 +3280,7 @@ window.PolymerGestures = {}; }, setValue: function(model, newValue) { - if (this.path.length == 1); + if (this.path.length == 1) model = findScope(model, this.path[0]); return this.path.setValueFrom(model, newValue); @@ -8132,7 +8154,7 @@ head.insertBefore(style, head.firstChild); /** * Force any pending data changes to be observed before * the next task. Data changes are processed asynchronously but are guaranteed - * to be processed, for example, before paintin. This method should rarely be + * to be processed, for example, before painting. This method should rarely be * needed. It does nothing when Object.observe is available; * when Object.observe is not available, Polymer automatically flushes data * changes approximately every 1/10 second. diff --git a/bower_components/polymer/polymer.min.js b/bower_components/polymer/polymer.min.js index d8460374..50c334bc 100644 --- a/bower_components/polymer/polymer.min.js +++ b/bower_components/polymer/polymer.min.js @@ -8,7 +8,7 @@ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ // @version 0.5.1 -window.PolymerGestures={},function(a){var b=!1,c=document.createElement("meta");if(c.createShadowRoot){var d=c.createShadowRoot(),e=document.createElement("span");d.appendChild(e),c.addEventListener("testpath",function(a){a.path&&(b=a.path[0]===e),a.stopPropagation()});var f=new CustomEvent("testpath",{bubbles:!0});document.head.appendChild(c),e.dispatchEvent(f),c.parentNode.removeChild(c),d=e=null}c=null;var g={shadow:function(a){return a?a.shadowRoot||a.webkitShadowRoot:void 0},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);return this.canTarget(b)?b:void 0},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){var d,e;return a?(d=a.elementFromPoint(b,c),d?e=this.targetingShadow(d):a!==document&&(e=this.olderShadow(a)),this.searchRoot(e,b,c)||d):void 0},owner:function(a){if(!a)return document;for(var b=a;b.parentNode;)b=b.parentNode;return b.nodeType!=Node.DOCUMENT_NODE&&b.nodeType!=Node.DOCUMENT_FRAGMENT_NODE&&(b=document),b},findTarget:function(a){if(b&&a.path&&a.path.length)return a.path[0];var c=a.clientX,d=a.clientY,e=this.owner(a.target);return e.elementFromPoint(c,d)||(e=document),this.searchRoot(e,c,d)},findTouchAction:function(a){var c;if(b&&a.path&&a.path.length){for(var d=a.path,e=0;e=0?a=this.walk(a,e):b=this.walk(b,-e);a&&b&&a!==b;)a=a.parentNode||a.host,b=b.parentNode||b.host;return a},walk:function(a,b){for(var c=0;a&&b>c;c++)a=a.parentNode||a.host;return a},depth:function(a){for(var b=0;a;)b++,a=a.parentNode||a.host;return b},deepContains:function(a,b){var c=this.LCA(a,b);return c===a},insideNode:function(a,b,c){var d=a.getBoundingClientRect();return d.left<=b&&b<=d.right&&d.top<=c&&c<=d.bottom},path:function(a){var c;if(b&&a.path&&a.path.length)c=a.path;else{c=[];for(var d=this.findTarget(a);d;)c.push(d),d=d.parentNode||d.host}return c}};a.targetFinding=g,a.findTarget=g.findTarget.bind(g),a.deepContains=g.deepContains.bind(g),a.insideNode=g.insideNode}(window.PolymerGestures),function(){function a(a){return"html /deep/ "+b(a)}function b(a){return'[touch-action="'+a+'"]'}function c(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+";}"}var d=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]},"manipulation"],e="",f="string"==typeof document.head.style.touchAction,g=!window.ShadowDOMPolyfill&&document.head.createShadowRoot;if(f){d.forEach(function(d){String(d)===d?(e+=b(d)+c(d)+"\n",g&&(e+=a(d)+c(d)+"\n")):(e+=d.selectors.map(b)+c(d.rule)+"\n",g&&(e+=d.selectors.map(a)+c(d.rule)+"\n"))});var h=document.createElement("style");h.textContent=e,document.head.appendChild(h)}}(),function(a){var b=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],c=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],d=function(){return function(){}},e={preventTap:d,makeBaseEvent:function(a,b){var c=document.createEvent("Event");return c.initEvent(a,b.bubbles||!1,b.cancelable||!1),c.preventTap=e.preventTap(c),c},makeGestureEvent:function(a,b){b=b||Object.create(null);for(var c,d=this.makeBaseEvent(a,b),e=0,f=Object.keys(b);e-1?this.values[c]=b:(this.keys.push(a),this.values.push(b))},has:function(a){return this.keys.indexOf(a)>-1},"delete":function(a){var b=this.keys.indexOf(a);b>-1&&(this.keys.splice(b,1),this.values.splice(b,1))},get:function(a){var b=this.keys.indexOf(a);return this.values[b]},clear:function(){this.keys.length=0,this.values.length=0},forEach:function(a,b){this.values.forEach(function(c,d){a.call(b,c,this.keys[d],this)},this)},pointers:function(){return this.keys.length}},a.PointerMap=b}(window.PolymerGestures),function(a){var b,c=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp","preventTap","tapPrevented","_source"],d=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0,function(){},!1],e="undefined"!=typeof SVGElementInstance,f=a.eventFactory,g={IS_IOS:!1,pointermap:new a.PointerMap,requiredGestures:new a.PointerMap,eventMap:Object.create(null),eventSources:Object.create(null),eventSourceList:[],gestures:[],dependencyMap:{down:{listeners:0,index:-1},up:{listeners:0,index:-1}},gestureQueue:[],registerSource:function(a,b){var c=b,d=c.events;d&&(d.forEach(function(a){c[a]&&(this.eventMap[a]=c[a].bind(c))},this),this.eventSources[a]=c,this.eventSourceList.push(c))},registerGesture:function(a,b){var c=Object.create(null);c.listeners=0,c.index=this.gestures.length;for(var d,e=0;ee&&(c=this.eventSourceList[e]);e++)c.register.call(c,a,b)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.unregister.call(b,a)},down:function(a){this.requiredGestures.set(a.pointerId,b),this.fireEvent("down",a)},move:function(a){a.type="move",this.fillGestureQueue(a)},up:function(a){this.fireEvent("up",a),this.requiredGestures.delete(a.pointerId)},cancel:function(a){a.tapPrevented=!0,this.fireEvent("up",a),this.requiredGestures.delete(a.pointerId)},addGestureDependency:function(a,b){var c=a._pgEvents;if(c&&b)for(var d,e,f,g=Object.keys(c),h=0;h0&&(d=this.dependencyMap[f],e=d?d.index:-1,b[e]=!0)},eventHandler:function(c){var d=c.type;if("touchstart"===d||"mousedown"===d||"pointerdown"===d||"MSPointerDown"===d)if(c._handledByPG||(b={}),this.IS_IOS){var e=c;if("touchstart"===d){var f=c.changedTouches[0];e={target:c.target,clientX:f.clientX,clientY:f.clientY,path:c.path}}for(var g,h=c.path||a.targetFinding.path(e),i=0;id&&(c=b[d]);d++)this.addEvent(a,c)},unlisten:function(a,b){for(var c,d=0,e=b.length;e>d&&(c=b[d]);d++)this.removeEvent(a,c)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=f.makePointerEvent(a,b);return c.preventDefault=b.preventDefault,c.tapPrevented=b.tapPrevented,c._target=c._target||b.target,c},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){for(var b,f=Object.create(null),g=0;g0&&a._pgListeners--,0===a._pgListeners&&g.unregister(a),a._pgEvents&&(a._pgEvents[c]>0?a._pgEvents[c]--:a._pgEvents[c]=0)),Boolean(d)},a.removeEventListener=function(b,c,d,e){d&&(a.deactivateGesture(b,c),b.removeEventListener(c,d,e))}}(window.PolymerGestures),function(a){var b=a.dispatcher,c=b.pointermap,d=25,e=[0,1,4,2],f=0,g=!1;try{g=1===new MouseEvent("test",{buttons:1}).buttons}catch(h){}var i={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup"],exposes:["down","up","move"],register:function(a){b.listen(a,this.events)},unregister:function(a){a!==document&&b.unlisten(a,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,e=a.clientX,f=a.clientY,g=0,h=c.length;h>g&&(b=c[g]);g++){var i=Math.abs(e-b.x),j=Math.abs(f-b.y);if(d>=i&&d>=j)return!0}},prepareEvent:function(a){var c=b.cloneEvent(a);if(c.pointerId=this.POINTER_ID,c.isPrimary=!0,c.pointerType=this.POINTER_TYPE,c._source="mouse",!g){var d=a.type,h=e[a.which]||0;"mousedown"===d?f|=h:"mouseup"===d&&(f&=~h),c.buttons=f}return c},mousedown:function(d){if(!this.isEventSimulatedFromTouch(d)){var e=(c.has(this.POINTER_ID),this.prepareEvent(d));e.target=a.findTarget(d),c.set(this.POINTER_ID,e.target),b.down(e)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.get(this.POINTER_ID);if(d){var e=this.prepareEvent(a);e.target=d,0===(g?e.buttons:e.which)?(g||(f=e.buttons=0),b.cancel(e),this.cleanupMouse(e.buttons)):b.move(e)}}},mouseup:function(d){if(!this.isEventSimulatedFromTouch(d)){var e=this.prepareEvent(d);e.relatedTarget=a.findTarget(d),e.target=c.get(this.POINTER_ID),b.up(e),this.cleanupMouse(e.buttons)}},cleanupMouse:function(a){0===a&&c.delete(this.POINTER_ID)}};a.mouseEvents=i}(window.PolymerGestures),function(a){var b=a.dispatcher,c=(a.targetFinding.allShadows.bind(a.targetFinding),b.pointermap),d=(Array.prototype.map.call.bind(Array.prototype.map),2500),e=25,f=200,g=20,h=!1,i={IS_IOS:!1,events:["touchstart","touchmove","touchend","touchcancel"],exposes:["down","up","move"],register:function(a,c){(this.IS_IOS?c:!c)&&b.listen(a,this.events)},unregister:function(a){this.IS_IOS||b.unlisten(a,this.events)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y"},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return b===c.EMITTER?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":"XY"},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){(0===c.pointers()||1===c.pointers()&&c.has(1))&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.firstTarget=a.target,this.scrolling=null,this.cancelResetClickCount())},removePrimaryPointer:function(a){a.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,f)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;return("touchstart"===a||"touchmove"===a)&&(b=1),b},findTarget:function(b,d){if("touchstart"===this.currentTouchEvent.type){if(this.isPrimaryTouch(b)){var e={clientX:b.clientX,clientY:b.clientY,path:this.currentTouchEvent.path,target:this.currentTouchEvent.target};return a.findTarget(e)}return a.findTarget(b)}return c.get(d)},touchToPointer:function(a){var c=this.currentTouchEvent,d=b.cloneEvent(a),e=d.pointerId=a.identifier+2;d.target=this.findTarget(a,e),d.bubbles=!0,d.cancelable=!0,d.detail=this.clickCount,d.buttons=this.typeToButtons(c.type),d.width=a.webkitRadiusX||a.radiusX||0,d.height=a.webkitRadiusY||a.radiusY||0,d.pressure=a.webkitForce||a.force||.5,d.isPrimary=this.isPrimaryTouch(a),d.pointerType=this.POINTER_TYPE,d._source="touch";var f=this;return d.preventDefault=function(){f.scrolling=!1,f.firstXY=null,c.preventDefault()},d},processTouches:function(a,b){var d=a.changedTouches;this.currentTouchEvent=a;for(var e,f,g=0;g=j}return c}},findTouch:function(a,b){for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(c.pointers()>=b.length){var d=[];c.forEach(function(a,c){if(1!==c&&!this.findTouch(b,c-2)){var e=a;d.push(e)}},this),d.forEach(function(a){this.cancel(a),c.delete(a.pointerId)})}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.down))},down:function(a){b.down(a)},touchmove:function(a){if(h)a.cancelable&&this.processTouches(a,this.move);else if(this.scrolling){if(this.firstXY){var b=a.changedTouches[0],c=b.clientX-this.firstXY.X,d=b.clientY-this.firstXY.Y,e=Math.sqrt(c*c+d*d);e>=g&&(this.touchcancel(a),this.scrolling=!0,this.firstXY=null)}}else null===this.scrolling&&this.shouldScroll(a)?this.scrolling=!0:(this.scrolling=!1,a.preventDefault(),this.processTouches(a,this.move))},move:function(a){b.move(a)},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.up)},up:function(c){c.relatedTarget=a.findTarget(c),b.up(c)},cancel:function(a){b.cancel(a)},touchcancel:function(a){a._cancel=!0,this.processTouches(a,this.cancel)},cleanUpPointer:function(a){c["delete"](a.pointerId),this.removePrimaryPointer(a)},dedupSynthMouse:function(b){var c=a.mouseEvents.lastTouches,e=b.changedTouches[0];if(this.isPrimaryTouch(e)){var f={x:e.clientX,y:e.clientY};c.push(f);var g=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,c,f);setTimeout(g,d)}}},j=Event.prototype.stopImmediatePropagation||Event.prototype.stopPropagation;document.addEventListener("click",function(b){var c=b.clientX,d=b.clientY,f=function(a){var b=Math.abs(c-a.x),f=Math.abs(d-a.y);return e>=b&&e>=f},g=a.mouseEvents.lastTouches.some(f),h=a.targetFinding.path(b);if(g){for(var k=0;k0?1:-1},calcPositionDelta:function(a,b){var c=0,d=0;return a&&b&&(c=b.pageX-a.pageX,d=b.pageY-a.pageY),{x:c,y:d}},fireTrack:function(a,b,d){var e=d,f=this.calcPositionDelta(e.downEvent,b),g=this.calcPositionDelta(e.lastMoveEvent,b);if(g.x)e.xDirection=this.clampDir(g.x);else if("trackx"===a)return;if(g.y)e.yDirection=this.clampDir(g.y);else if("tracky"===a)return;var h={bubbles:!0,cancelable:!0,trackInfo:e.trackInfo,relatedTarget:b.relatedTarget,pointerType:b.pointerType,pointerId:b.pointerId,_source:"track"};"tracky"!==a&&(h.x=b.x,h.dx=f.x,h.ddx=g.x,h.clientX=b.clientX,h.pageX=b.pageX,h.screenX=b.screenX,h.xDirection=e.xDirection),"trackx"!==a&&(h.dy=f.y,h.ddy=g.y,h.y=b.y,h.clientY=b.clientY,h.pageY=b.pageY,h.screenY=b.screenY,h.yDirection=e.yDirection);var i=c.makeGestureEvent(a,h);e.downTarget.dispatchEvent(i)},down:function(a){if(a.isPrimary&&("mouse"===a.pointerType?1===a.buttons:!0)){var b={downEvent:a,downTarget:a.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:!1};d.set(a.pointerId,b)}},move:function(a){var b=d.get(a.pointerId);if(b){if(!b.tracking){var c=this.calcPositionDelta(b.downEvent,a),e=c.x*c.x+c.y*c.y;e>this.WIGGLE_THRESHOLD&&(b.tracking=!0,b.lastMoveEvent=b.downEvent,this.fireTrack("trackstart",a,b))}b.tracking&&(this.fireTrack("track",a,b),this.fireTrack("trackx",a,b),this.fireTrack("tracky",a,b)),b.lastMoveEvent=a}},up:function(a){var b=d.get(a.pointerId);b&&(b.tracking&&this.fireTrack("trackend",a,b),d.delete(a.pointerId))}};b.registerGesture("track",e)}(window.PolymerGestures),function(a){var b=a.dispatcher,c=a.eventFactory,d={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["down","move","up"],exposes:["hold","holdpulse","release"],heldPointer:null,holdJob:null,pulse:function(){var a=Date.now()-this.heldPointer.timeStamp,b=this.held?"holdpulse":"hold";this.fireHold(b,a),this.held=!0},cancel:function(){clearInterval(this.holdJob),this.held&&this.fireHold("release"),this.held=!1,this.heldPointer=null,this.target=null,this.holdJob=null},down:function(a){a.isPrimary&&!this.heldPointer&&(this.heldPointer=a,this.target=a.target,this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY))},up:function(a){this.heldPointer&&this.heldPointer.pointerId===a.pointerId&&this.cancel()},move:function(a){if(this.heldPointer&&this.heldPointer.pointerId===a.pointerId){var b=a.clientX-this.heldPointer.clientX,c=a.clientY-this.heldPointer.clientY;b*b+c*c>this.WIGGLE_THRESHOLD&&this.cancel()}},fireHold:function(a,b){var d={bubbles:!0,cancelable:!0,pointerType:this.heldPointer.pointerType,pointerId:this.heldPointer.pointerId,x:this.heldPointer.clientX,y:this.heldPointer.clientY,_source:"hold"};b&&(d.holdTime=b);var e=c.makeGestureEvent(a,d);this.target.dispatchEvent(e)}};b.registerGesture("hold",d)}(window.PolymerGestures),function(a){var b=a.dispatcher,c=a.eventFactory,d=new a.PointerMap,e={events:["down","up"],exposes:["tap"],down:function(a){a.isPrimary&&!a.tapPrevented&&d.set(a.pointerId,{target:a.target,buttons:a.buttons,x:a.clientX,y:a.clientY})},shouldTap:function(a,b){var c=!0;return"mouse"===a.pointerType&&(c=1^a.buttons&&1&b.buttons),c&&!a.tapPrevented},up:function(b){var e=d.get(b.pointerId);if(e&&this.shouldTap(b,e)){var f=a.targetFinding.LCA(e.target,b.relatedTarget);if(f){var g=c.makeGestureEvent("tap",{bubbles:!0,cancelable:!0,x:b.clientX,y:b.clientY,detail:b.detail,pointerType:b.pointerType,pointerId:b.pointerId,altKey:b.altKey,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey,_source:"tap"});f.dispatchEvent(g)}}d.delete(b.pointerId)}};c.preventTap=function(a){return function(){a.tapPrevented=!0,d.delete(a.pointerId)}},b.registerGesture("tap",e)}(window.PolymerGestures),function(a){var b=a.dispatcher,c=a.eventFactory,d=new a.PointerMap,e=180/Math.PI,f={events:["down","up","move","cancel"],exposes:["pinch","rotate"],defaultActions:{pinch:"none",rotate:"none"},reference:{},down:function(b){if(d.set(b.pointerId,b),2==d.pointers()){var c=this.calcChord(),e=this.calcAngle(c);this.reference={angle:e,diameter:c.diameter,target:a.targetFinding.LCA(c.a.target,c.b.target)}}},up:function(a){var b=d.get(a.pointerId);b&&d.delete(a.pointerId)},move:function(a){d.has(a.pointerId)&&(d.set(a.pointerId,a),d.pointers()>1&&this.calcPinchRotate())},cancel:function(a){this.up(a)},firePinch:function(a,b){var d=a/this.reference.diameter,e=c.makeGestureEvent("pinch",{bubbles:!0,cancelable:!0,scale:d,centerX:b.center.x,centerY:b.center.y,_source:"pinch"});this.reference.target.dispatchEvent(e)},fireRotate:function(a,b){var d=Math.round((a-this.reference.angle)%360),e=c.makeGestureEvent("rotate",{bubbles:!0,cancelable:!0,angle:d,centerX:b.center.x,centerY:b.center.y,_source:"pinch"});this.reference.target.dispatchEvent(e)},calcPinchRotate:function(){var a=this.calcChord(),b=a.diameter,c=this.calcAngle(a);b!=this.reference.diameter&&this.firePinch(b,a),c!=this.reference.angle&&this.fireRotate(c,a)},calcChord:function(){var a=[];d.forEach(function(b){a.push(b)});for(var b,c,e,f=0,g={a:a[0],b:a[1]},h=0;hf&&(f=e,g={a:i,b:k})}return b=Math.abs(g.a.clientX+g.b.clientX)/2,c=Math.abs(g.a.clientY+g.b.clientY)/2,g.center={x:b,y:c},g.diameter=f,g},calcAngle:function(a){var b=a.a.clientX-a.b.clientX,c=a.a.clientY-a.b.clientY;return(360+Math.atan2(c,b)*e)%360}};b.registerGesture("pinch",f)}(window.PolymerGestures),function(a){"use strict";function b(a,b){if(!a)throw new Error("ASSERT: "+b)}function c(a){return a>=48&&57>=a}function d(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&" ᠎              ".indexOf(String.fromCharCode(a))>0}function e(a){return 10===a||13===a||8232===a||8233===a}function f(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a}function g(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a||a>=48&&57>=a}function h(a){return"this"===a}function i(){for(;Y>X&&d(W.charCodeAt(X));)++X}function j(){var a,b;for(a=X++;Y>X&&(b=W.charCodeAt(X),g(b));)++X;return W.slice(a,X)}function k(){var a,b,c;return a=X,b=j(),c=1===b.length?S.Identifier:h(b)?S.Keyword:"null"===b?S.NullLiteral:"true"===b||"false"===b?S.BooleanLiteral:S.Identifier,{type:c,value:b,range:[a,X]}}function l(){var a,b,c=X,d=W.charCodeAt(X),e=W[X];switch(d){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:return++X,{type:S.Punctuator,value:String.fromCharCode(d),range:[c,X]};default:if(a=W.charCodeAt(X+1),61===a)switch(d){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 124:return X+=2,{type:S.Punctuator,value:String.fromCharCode(d)+String.fromCharCode(a),range:[c,X]};case 33:case 61:return X+=2,61===W.charCodeAt(X)&&++X,{type:S.Punctuator,value:W.slice(c,X),range:[c,X]}}}return b=W[X+1],e===b&&"&|".indexOf(e)>=0?(X+=2,{type:S.Punctuator,value:e+b,range:[c,X]}):"<>=!+-*%&|^/".indexOf(e)>=0?(++X,{type:S.Punctuator,value:e,range:[c,X]}):void s({},V.UnexpectedToken,"ILLEGAL")}function m(){var a,d,e;if(e=W[X],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=X,a="","."!==e){for(a=W[X++],e=W[X],"0"===a&&e&&c(e.charCodeAt(0))&&s({},V.UnexpectedToken,"ILLEGAL");c(W.charCodeAt(X));)a+=W[X++];e=W[X]}if("."===e){for(a+=W[X++];c(W.charCodeAt(X));)a+=W[X++];e=W[X]}if("e"===e||"E"===e)if(a+=W[X++],e=W[X],("+"===e||"-"===e)&&(a+=W[X++]),c(W.charCodeAt(X)))for(;c(W.charCodeAt(X));)a+=W[X++];else s({},V.UnexpectedToken,"ILLEGAL");return f(W.charCodeAt(X))&&s({},V.UnexpectedToken,"ILLEGAL"),{type:S.NumericLiteral,value:parseFloat(a),range:[d,X]}}function n(){var a,c,d,f="",g=!1;for(a=W[X],b("'"===a||'"'===a,"String literal must starts with a quote"),c=X,++X;Y>X;){if(d=W[X++],d===a){a="";break}if("\\"===d)if(d=W[X++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===W[X]&&++X;else switch(d){case"n":f+="\n";break;case"r":f+="\r";break;case"t":f+=" ";break;case"b":f+="\b";break;case"f":f+="\f";break;case"v":f+=" ";break;default:f+=d}else{if(e(d.charCodeAt(0)))break;f+=d}}return""!==a&&s({},V.UnexpectedToken,"ILLEGAL"),{type:S.StringLiteral,value:f,octal:g,range:[c,X]}}function o(a){return a.type===S.Identifier||a.type===S.Keyword||a.type===S.BooleanLiteral||a.type===S.NullLiteral}function p(){var a;return i(),X>=Y?{type:S.EOF,range:[X,X]}:(a=W.charCodeAt(X),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(W.charCodeAt(X+1))?m():l():c(a)?m():l())}function q(){var a;return a=$,X=a.range[1],$=p(),X=a.range[1],a}function r(){var a;a=X,$=p(),X=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cX&&(a.push(bb()),!v(")"));)u(",");return u(")"),a}function E(){var a;return a=q(),o(a)||t(a),Z.createIdentifier(a.value)}function F(){return u("."),E()}function G(){var a;return u("["),a=bb(),u("]"),a}function H(){var a,b,c;for(a=C();;)if(v("["))c=G(),a=Z.createMemberExpression("[",a,c);else if(v("."))c=F(),a=Z.createMemberExpression(".",a,c);else{if(!v("("))break;b=D(),a=Z.createCallExpression(a,b)}return a}function I(){var a,b;return $.type!==S.Punctuator&&$.type!==S.Keyword?b=ab():v("+")||v("-")||v("!")?(a=q(),b=I(),b=Z.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},V.UnexpectedToken):b=ab(),b}function J(a){var b=0;if(a.type!==S.Punctuator&&a.type!==S.Keyword)return 0;switch(a.value){case"||":b=1;break;case"&&":b=2;break;case"==":case"!=":case"===":case"!==":b=6;break;case"<":case">":case"<=":case">=":case"instanceof":b=7;break;case"in":b=7;break;case"+":case"-":b=9;break;case"*":case"/":case"%":b=11}return b}function K(){var a,b,c,d,e,f,g,h;if(g=I(),b=$,c=J(b),0===c)return g;for(b.prec=c,q(),e=I(),d=[g,b,e];(c=J($))>0;){for(;d.length>2&&c<=d[d.length-2].prec;)e=d.pop(),f=d.pop().value,g=d.pop(),a=Z.createBinaryExpression(f,g,e),d.push(a);b=q(),b.prec=c,d.push(b),a=I(),d.push(a)}for(h=d.length-1,a=d[h];h>1;)a=Z.createBinaryExpression(d[h-1].value,d[h-2],a),h-=2;return a}function L(){var a,b,c;return a=K(),v("?")&&(q(),b=L(),u(":"),c=L(),a=Z.createConditionalExpression(a,b,c)),a}function M(){var a,b;return a=q(),a.type!==S.Identifier&&t(a),b=v("(")?D():[],Z.createFilter(a.value,b)}function N(){for(;v("|");)q(),M()}function O(){i(),r();var a=bb();a&&(","===$.value||"in"==$.value&&a.type===U.Identifier?Q(a):(N(),"as"===$.value?P(a):Z.createTopLevel(a))),$.type!==S.EOF&&t($)}function P(a){q();var b=q().value;Z.createAsExpression(a,b)}function Q(a){var b;","===$.value&&(q(),$.type!==S.Identifier&&t($),b=q().value),q();var c=bb();N(),Z.createInExpression(a.name,b,c)}function R(a,b){return Z=b,W=a,X=0,Y=W.length,$=null,_={labelSet:{}},O()}var S,T,U,V,W,X,Y,Z,$,_;S={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},T={},T[S.BooleanLiteral]="Boolean",T[S.EOF]="",T[S.Identifier]="Identifier",T[S.Keyword]="Keyword",T[S.NullLiteral]="Null",T[S.NumericLiteral]="Numeric",T[S.Punctuator]="Punctuator",T[S.StringLiteral]="String",U={ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"},V={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"};var ab=H,bb=L; -a.esprima={parse:R}}(this),function(a){"use strict";function b(a,b,d,e){var f;try{if(f=c(a),f.scopeIdent&&(d.nodeType!==Node.ELEMENT_NODE||"TEMPLATE"!==d.tagName||"bind"!==b&&"repeat"!==b))throw Error("as and in can only be used within