polymer-paper-rails 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -18
  3. data/app/assets/components/core-a11y-keys/core-a11y-keys.html +4 -4
  4. data/app/assets/components/core-animation/web-animations.html +1 -1
  5. data/app/assets/components/core-collapse/core-collapse.html +1 -1
  6. data/app/assets/components/core-drawer-panel/core-drawer-panel.css +14 -6
  7. data/app/assets/components/core-drawer-panel/core-drawer-panel.html +32 -8
  8. data/app/assets/components/core-dropdown/core-dropdown.html +8 -2
  9. data/app/assets/components/core-icon/core-icon.html +0 -2
  10. data/app/assets/components/core-icons/av-icons.html +2 -9
  11. data/app/assets/components/core-icons/communication-icons.html +39 -42
  12. data/app/assets/components/core-icons/core-icons.html +231 -235
  13. data/app/assets/components/core-icons/device-icons.html +75 -90
  14. data/app/assets/components/core-icons/editor-icons.html +52 -52
  15. data/app/assets/components/core-icons/hardware-icons.html +40 -41
  16. data/app/assets/components/core-icons/image-icons.html +133 -137
  17. data/app/assets/components/core-icons/maps-icons.html +55 -57
  18. data/app/assets/components/core-icons/notification-icons.html +34 -34
  19. data/app/assets/components/core-icons/social-icons.html +23 -37
  20. data/app/assets/components/core-menu/core-menu.html +8 -3
  21. data/app/assets/components/core-menu/core-submenu.html +2 -2
  22. data/app/assets/components/core-overlay/core-key-helper.html +3 -0
  23. data/app/assets/components/core-overlay/core-overlay-layer.html +3 -0
  24. data/app/assets/components/core-overlay/core-overlay.html +20 -4
  25. data/app/assets/components/core-resizable/core-resizable.html +248 -0
  26. data/app/assets/components/core-scroll-header-panel/core-scroll-header-panel.html +14 -3
  27. data/app/assets/components/core-selection/core-selection.html +1 -1
  28. data/app/assets/components/core-selector/core-selector.html +26 -26
  29. data/app/assets/components/core-style/core-style.html +1 -1
  30. data/app/assets/components/core-toolbar/core-toolbar.html +1 -1
  31. data/app/assets/components/paper-button/paper-button-base.html +56 -12
  32. data/app/assets/components/paper-button/paper-button.html +22 -5
  33. data/app/assets/components/paper-checkbox/paper-checkbox.css +65 -184
  34. data/app/assets/components/paper-checkbox/paper-checkbox.html +47 -55
  35. data/app/assets/components/paper-dialog/paper-action-dialog.html +3 -3
  36. data/app/assets/components/paper-dialog/paper-dialog.html +2 -2
  37. data/app/assets/components/paper-dropdown-menu/paper-dropdown-menu.html +4 -1
  38. data/app/assets/components/{core-elements → paper-elements}/metadata.html +0 -0
  39. data/app/assets/components/{core-elements → paper-elements}/paper-elements.html +1 -0
  40. data/app/assets/components/paper-fab/paper-fab.html +2 -2
  41. data/app/assets/components/paper-input/paper-autogrow-textarea.html +8 -3
  42. data/app/assets/components/paper-input/paper-char-counter.html +121 -0
  43. data/app/assets/components/paper-input/paper-input-decorator.css +1 -21
  44. data/app/assets/components/paper-input/paper-input-decorator.html +130 -51
  45. data/app/assets/components/paper-input/paper-input.html +31 -5
  46. data/app/assets/components/paper-item/paper-item.html +1 -2
  47. data/app/assets/components/paper-progress/paper-progress.html +1 -1
  48. data/app/assets/components/paper-radio-button/paper-radio-button.css +16 -12
  49. data/app/assets/components/paper-radio-button/paper-radio-button.html +9 -3
  50. data/app/assets/components/paper-ripple/paper-ripple.html +2 -1
  51. data/app/assets/components/paper-shadow/paper-shadow.css +10 -10
  52. data/app/assets/components/paper-shadow/paper-shadow.html +8 -1
  53. data/app/assets/components/paper-slider/paper-slider.html +28 -4
  54. data/app/assets/components/paper-spinner/paper-spinner.css +35 -23
  55. data/app/assets/components/paper-spinner/paper-spinner.html +46 -5
  56. data/app/assets/components/paper-tabs/paper-tabs.css +5 -0
  57. data/app/assets/components/paper-tabs/paper-tabs.html +32 -7
  58. data/app/assets/components/paper-toggle-button/paper-toggle-button.css +58 -30
  59. data/app/assets/components/paper-toggle-button/paper-toggle-button.html +69 -44
  60. data/app/assets/components/sampler-scaffold/sampler-scaffold.css +1 -1
  61. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
  62. data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
  63. data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
  64. data/app/assets/components/webcomponentsjs/CustomElements.js +634 -0
  65. data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
  66. data/app/assets/components/webcomponentsjs/HTMLImports.js +764 -0
  67. data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
  68. data/app/assets/components/webcomponentsjs/ShadowDOM.js +4277 -0
  69. data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +13 -0
  70. data/app/assets/components/webcomponentsjs/package.json +31 -0
  71. data/app/assets/components/webcomponentsjs/webcomponents-lite.js +1728 -0
  72. data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +11 -0
  73. data/app/assets/components/webcomponentsjs/webcomponents.js +6114 -0
  74. data/app/assets/components/webcomponentsjs/webcomponents.min.js +14 -0
  75. data/lib/polymer-paper-rails/version.rb +1 -1
  76. metadata +20 -71
  77. data/app/assets/components/core-dropdown/metadata.html +0 -62
  78. data/app/assets/components/core-icons/png-icons.html +0 -19
  79. data/app/assets/components/core-label/core-label.html +0 -124
  80. data/app/assets/components/core-overlay/tests/html/core-overlay-basic.html +0 -127
  81. data/app/assets/components/core-overlay/tests/html/core-overlay-positioning-margin.html +0 -153
  82. data/app/assets/components/core-overlay/tests/html/core-overlay-positioning.html +0 -167
  83. data/app/assets/components/core-overlay/tests/html/core-overlay-scroll.html +0 -130
  84. data/app/assets/components/core-overlay/tests/js/htmltests.js +0 -6
  85. data/app/assets/components/core-overlay/tests/runner.html +0 -14
  86. data/app/assets/components/core-overlay/tests/tests.json +0 -6
  87. data/app/assets/components/core-popup-menu/core-popup-menu.css +0 -28
  88. data/app/assets/components/core-popup-menu/core-popup-menu.html +0 -198
  89. data/app/assets/components/core-popup-menu/core-popup-overlay.html +0 -111
  90. data/app/assets/components/core-popup-menu/metadata.html +0 -62
  91. data/app/assets/components/paper-focusable/paper-focusable.html +0 -146
  92. data/app/assets/components/platform/platform.js +0 -16
  93. data/app/assets/components/web-animations-js/web-animations.js +0 -5529
  94. data/app/assets/components/web-animations-next/Gruntfile.js +0 -279
  95. data/app/assets/components/web-animations-next/History.md +0 -76
  96. data/app/assets/components/web-animations-next/package.json +0 -33
  97. data/app/assets/components/web-animations-next/src/animation-constructor.js +0 -139
  98. data/app/assets/components/web-animations-next/src/animation-node.js +0 -31
  99. data/app/assets/components/web-animations-next/src/animation.js +0 -65
  100. data/app/assets/components/web-animations-next/src/apply-preserving-inline-style.js +0 -192
  101. data/app/assets/components/web-animations-next/src/apply.js +0 -25
  102. data/app/assets/components/web-animations-next/src/box-handler.js +0 -57
  103. data/app/assets/components/web-animations-next/src/color-handler.js +0 -62
  104. data/app/assets/components/web-animations-next/src/deprecation.js +0 -42
  105. data/app/assets/components/web-animations-next/src/dev.js +0 -16
  106. data/app/assets/components/web-animations-next/src/dimension-handler.js +0 -167
  107. data/app/assets/components/web-animations-next/src/effect-callback.js +0 -86
  108. data/app/assets/components/web-animations-next/src/effect.js +0 -110
  109. data/app/assets/components/web-animations-next/src/element-animatable.js +0 -19
  110. data/app/assets/components/web-animations-next/src/font-weight-handler.js +0 -42
  111. data/app/assets/components/web-animations-next/src/group-constructors.js +0 -81
  112. data/app/assets/components/web-animations-next/src/handler-utils.js +0 -177
  113. data/app/assets/components/web-animations-next/src/interpolation.js +0 -49
  114. data/app/assets/components/web-animations-next/src/matrix-decomposition.js +0 -452
  115. data/app/assets/components/web-animations-next/src/matrix-interpolation.js +0 -130
  116. data/app/assets/components/web-animations-next/src/maxifill-player.js +0 -162
  117. data/app/assets/components/web-animations-next/src/normalize-keyframes.js +0 -259
  118. data/app/assets/components/web-animations-next/src/number-handler.js +0 -72
  119. data/app/assets/components/web-animations-next/src/player.js +0 -193
  120. data/app/assets/components/web-animations-next/src/position-handler.js +0 -117
  121. data/app/assets/components/web-animations-next/src/property-interpolation.js +0 -62
  122. data/app/assets/components/web-animations-next/src/property-names.js +0 -35
  123. data/app/assets/components/web-animations-next/src/scope.js +0 -20
  124. data/app/assets/components/web-animations-next/src/shadow-handler.js +0 -108
  125. data/app/assets/components/web-animations-next/src/shape-handler.js +0 -85
  126. data/app/assets/components/web-animations-next/src/tick.js +0 -148
  127. data/app/assets/components/web-animations-next/src/timeline.js +0 -77
  128. data/app/assets/components/web-animations-next/src/timing-utilities.js +0 -242
  129. data/app/assets/components/web-animations-next/src/transform-handler.js +0 -262
  130. data/app/assets/components/web-animations-next/src/visibility-handler.js +0 -29
  131. data/app/assets/components/web-animations-next/target-config.js +0 -124
  132. data/app/assets/components/web-animations-next/target-loader.js +0 -13
  133. data/app/assets/components/web-animations-next/templates/boilerplate +0 -13
  134. data/app/assets/components/web-animations-next/templates/runner.html +0 -26
  135. data/app/assets/components/web-animations-next/templates/web-animations.html +0 -18
  136. data/app/assets/components/web-animations-next/templates/web-animations.js +0 -21
  137. data/app/assets/components/web-animations-next/web-animations-next-lite.dev.html +0 -44
  138. data/app/assets/components/web-animations-next/web-animations-next-lite.dev.js +0 -21
  139. data/app/assets/components/web-animations-next/web-animations-next.dev.html +0 -49
  140. data/app/assets/components/web-animations-next/web-animations-next.dev.js +0 -21
  141. data/app/assets/components/web-animations-next/web-animations.dev.html +0 -44
  142. data/app/assets/components/web-animations-next/web-animations.dev.js +0 -21
  143. data/app/assets/components/web-animations-next/web-animations.html +0 -50
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ * Code distributed by Google as part of the polymer project is also
8
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ */
10
+ // @version 0.5.5
11
+ "undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),window.ShadowDOMPolyfill={},function(e){"use strict";function t(){if("undefined"!=typeof chrome&&chrome.app&&chrome.app.runtime)return!1;if(navigator.getDeviceStorage)return!1;try{var e=new Function("return true;");return e()}catch(t){return!1}}function n(e){if(!e)throw new Error("Assertion failed")}function r(e,t){for(var n=k(t),r=0;r<n.length;r++){var o=n[r];I(e,o,F(t,o))}return e}function o(e,t){for(var n=k(t),r=0;r<n.length;r++){var o=n[r];switch(o){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":continue}I(e,o,F(t,o))}return e}function i(e,t){for(var n=0;n<t.length;n++)if(t[n]in e)return t[n]}function a(e,t,n){B.value=n,I(e,t,B)}function s(e){var t=e.__proto__||Object.getPrototypeOf(e);if(U)try{k(t)}catch(n){t=t.__proto__}var r=R.get(t);if(r)return r;var o=s(t),i=E(o);return v(t,i,e),i}function c(e,t){m(e,t,!0)}function u(e,t){m(t,e,!1)}function l(e){return/^on[a-z]+$/.test(e)}function p(e){return/^\w[a-zA-Z_0-9]*$/.test(e)}function d(e){return A&&p(e)?new Function("return this.__impl4cf1e782hg__."+e):function(){return this.__impl4cf1e782hg__[e]}}function f(e){return A&&p(e)?new Function("v","this.__impl4cf1e782hg__."+e+" = v"):function(t){this.__impl4cf1e782hg__[e]=t}}function h(e){return A&&p(e)?new Function("return this.__impl4cf1e782hg__."+e+".apply(this.__impl4cf1e782hg__, arguments)"):function(){return this.__impl4cf1e782hg__[e].apply(this.__impl4cf1e782hg__,arguments)}}function w(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch(n){return q}}function m(t,n,r){for(var o=k(t),i=0;i<o.length;i++){var a=o[i];if("polymerBlackList_"!==a&&!(a in n||t.polymerBlackList_&&t.polymerBlackList_[a])){U&&t.__lookupGetter__(a);var s,c,u=w(t,a);if(r&&"function"==typeof u.value)n[a]=h(a);else{var p=l(a);s=p?e.getEventHandlerGetter(a):d(a),(u.writable||u.set||V)&&(c=p?e.getEventHandlerSetter(a):f(a));var m=V||u.configurable;I(n,a,{get:s,set:c,configurable:m,enumerable:u.enumerable})}}}}function g(e,t,n){var r=e.prototype;v(r,t,n),o(t,e)}function v(e,t,r){var o=t.prototype;n(void 0===R.get(e)),R.set(e,t),P.set(o,e),c(e,o),r&&u(o,r),a(o,"constructor",t),t.prototype=o}function b(e,t){return R.get(t.prototype)===e}function y(e){var t=Object.getPrototypeOf(e),n=s(t),r=E(n);return v(t,r,e),r}function E(e){function t(t){e.call(this,t)}var n=Object.create(e.prototype);return n.constructor=t,t.prototype=n,t}function S(e){return e&&e.__impl4cf1e782hg__}function M(e){return!S(e)}function T(e){return null===e?null:(n(M(e)),e.__wrapper8e3dd93a60__||(e.__wrapper8e3dd93a60__=new(s(e))(e)))}function O(e){return null===e?null:(n(S(e)),e.__impl4cf1e782hg__)}function L(e){return e.__impl4cf1e782hg__}function j(e,t){t.__impl4cf1e782hg__=e,e.__wrapper8e3dd93a60__=t}function N(e){return e&&S(e)?O(e):e}function _(e){return e&&!S(e)?T(e):e}function C(e,t){null!==t&&(n(M(e)),n(void 0===t||S(t)),e.__wrapper8e3dd93a60__=t)}function D(e,t,n){G.get=n,I(e.prototype,t,G)}function H(e,t){D(e,t,function(){return T(this.__impl4cf1e782hg__[t])})}function x(e,t){e.forEach(function(e){t.forEach(function(t){e.prototype[t]=function(){var e=_(this);return e[t].apply(e,arguments)}})})}var R=new WeakMap,P=new WeakMap,W=Object.create(null),A=t(),I=Object.defineProperty,k=Object.getOwnPropertyNames,F=Object.getOwnPropertyDescriptor,B={value:void 0,configurable:!0,enumerable:!1,writable:!0};k(window);var U=/Firefox/.test(navigator.userAgent),q={get:function(){},set:function(){},configurable:!0,enumerable:!0},V=function(){var e=Object.getOwnPropertyDescriptor(Node.prototype,"nodeType");return e&&!e.get&&!e.set}(),G={get:void 0,configurable:!0,enumerable:!0};e.assert=n,e.constructorTable=R,e.defineGetter=D,e.defineWrapGetter=H,e.forwardMethodsToWrapper=x,e.isWrapper=S,e.isWrapperFor=b,e.mixin=r,e.nativePrototypeTable=P,e.oneOf=i,e.registerObject=y,e.registerWrapper=g,e.rewrap=C,e.setWrapper=j,e.unsafeUnwrap=L,e.unwrap=O,e.unwrapIfNeeded=N,e.wrap=T,e.wrapIfNeeded=_,e.wrappers=W}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e,t,n){return{index:e,removed:t,addedCount:n}}function n(){}var r=0,o=1,i=2,a=3;n.prototype={calcEditDistances:function(e,t,n,r,o,i){for(var a=i-o+1,s=n-t+1,c=new Array(a),u=0;a>u;u++)c[u]=new Array(s),c[u][0]=u;for(var l=0;s>l;l++)c[0][l]=l;for(var u=1;a>u;u++)for(var l=1;s>l;l++)if(this.equals(e[t+l-1],r[o+u-1]))c[u][l]=c[u-1][l-1];else{var p=c[u-1][l]+1,d=c[u][l-1]+1;c[u][l]=d>p?p:d}return c},spliceOperationsFromEditDistances:function(e){for(var t=e.length-1,n=e[0].length-1,s=e[t][n],c=[];t>0||n>0;)if(0!=t)if(0!=n){var u,l=e[t-1][n-1],p=e[t-1][n],d=e[t][n-1];u=d>p?l>p?p:l:l>d?d:l,u==l?(l==s?c.push(r):(c.push(o),s=l),t--,n--):u==p?(c.push(a),t--,s=p):(c.push(i),n--,s=d)}else c.push(a),t--;else c.push(i),n--;return c.reverse(),c},calcSplices:function(e,n,s,c,u,l){var p=0,d=0,f=Math.min(s-n,l-u);if(0==n&&0==u&&(p=this.sharedPrefix(e,c,f)),s==e.length&&l==c.length&&(d=this.sharedSuffix(e,c,f-p)),n+=p,u+=p,s-=d,l-=d,s-n==0&&l-u==0)return[];if(n==s){for(var h=t(n,[],0);l>u;)h.removed.push(c[u++]);return[h]}if(u==l)return[t(n,[],s-n)];for(var w=this.spliceOperationsFromEditDistances(this.calcEditDistances(e,n,s,c,u,l)),h=void 0,m=[],g=n,v=u,b=0;b<w.length;b++)switch(w[b]){case r:h&&(m.push(h),h=void 0),g++,v++;break;case o:h||(h=t(g,[],0)),h.addedCount++,g++,h.removed.push(c[v]),v++;break;case i:h||(h=t(g,[],0)),h.addedCount++,g++;break;case a:h||(h=t(g,[],0)),h.removed.push(c[v]),v++}return h&&m.push(h),m},sharedPrefix:function(e,t,n){for(var r=0;n>r;r++)if(!this.equals(e[r],t[r]))return r;return n},sharedSuffix:function(e,t,n){for(var r=e.length,o=t.length,i=0;n>i&&this.equals(e[--r],t[--o]);)i++;return i},calculateSplices:function(e,t){return this.calcSplices(e,0,e.length,t,0,t.length)},equals:function(e,t){return e===t}},e.ArraySplice=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(){a=!1;var e=i.slice(0);i=[];for(var t=0;t<e.length;t++)e[t]()}function n(e){i.push(e),a||(a=!0,r(t,0))}var r,o=window.MutationObserver,i=[],a=!1;if(o){var s=1,c=new o(t),u=document.createTextNode(s);c.observe(u,{characterData:!0}),r=function(){s=(s+1)%2,u.data=s}}else r=window.setTimeout;e.setEndOfMicrotask=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){e.scheduled_||(e.scheduled_=!0,h.push(e),w||(l(n),w=!0))}function n(){for(w=!1;h.length;){var e=h;h=[],e.sort(function(e,t){return e.uid_-t.uid_});for(var t=0;t<e.length;t++){var n=e[t];n.scheduled_=!1;var r=n.takeRecords();i(n),r.length&&n.callback_(r,n)}}}function r(e,t){this.type=e,this.target=t,this.addedNodes=new d.NodeList,this.removedNodes=new d.NodeList,this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function o(e,t){for(;e;e=e.parentNode){var n=f.get(e);if(n)for(var r=0;r<n.length;r++){var o=n[r];o.options.subtree&&o.addTransientObserver(t)}}}function i(e){for(var t=0;t<e.nodes_.length;t++){var n=e.nodes_[t],r=f.get(n);if(!r)return;for(var o=0;o<r.length;o++){var i=r[o];i.observer===e&&i.removeTransientObservers()}}}function a(e,n,o){for(var i=Object.create(null),a=Object.create(null),s=e;s;s=s.parentNode){var c=f.get(s);if(c)for(var u=0;u<c.length;u++){var l=c[u],p=l.options;if((s===e||p.subtree)&&!("attributes"===n&&!p.attributes||"attributes"===n&&p.attributeFilter&&(null!==o.namespace||-1===p.attributeFilter.indexOf(o.name))||"characterData"===n&&!p.characterData||"childList"===n&&!p.childList)){var d=l.observer;i[d.uid_]=d,("attributes"===n&&p.attributeOldValue||"characterData"===n&&p.characterDataOldValue)&&(a[d.uid_]=o.oldValue)}}}for(var h in i){var d=i[h],w=new r(n,e);"name"in o&&"namespace"in o&&(w.attributeName=o.name,w.attributeNamespace=o.namespace),o.addedNodes&&(w.addedNodes=o.addedNodes),o.removedNodes&&(w.removedNodes=o.removedNodes),o.previousSibling&&(w.previousSibling=o.previousSibling),o.nextSibling&&(w.nextSibling=o.nextSibling),void 0!==a[h]&&(w.oldValue=a[h]),t(d),d.records_.push(w)}}function s(e){if(this.childList=!!e.childList,this.subtree=!!e.subtree,this.attributes="attributes"in e||!("attributeOldValue"in e||"attributeFilter"in e)?!!e.attributes:!0,this.characterData="characterDataOldValue"in e&&!("characterData"in e)?!0:!!e.characterData,!this.attributes&&(e.attributeOldValue||"attributeFilter"in e)||!this.characterData&&e.characterDataOldValue)throw new TypeError;if(this.characterData=!!e.characterData,this.attributeOldValue=!!e.attributeOldValue,this.characterDataOldValue=!!e.characterDataOldValue,"attributeFilter"in e){if(null==e.attributeFilter||"object"!=typeof e.attributeFilter)throw new TypeError;this.attributeFilter=m.call(e.attributeFilter)}else this.attributeFilter=null}function c(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++g,this.scheduled_=!1}function u(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}var l=e.setEndOfMicrotask,p=e.wrapIfNeeded,d=e.wrappers,f=new WeakMap,h=[],w=!1,m=Array.prototype.slice,g=0;c.prototype={constructor:c,observe:function(e,t){e=p(e);var n,r=new s(t),o=f.get(e);o||f.set(e,o=[]);for(var i=0;i<o.length;i++)o[i].observer===this&&(n=o[i],n.removeTransientObservers(),n.options=r);n||(n=new u(this,e,r),o.push(n),this.nodes_.push(e))},disconnect:function(){this.nodes_.forEach(function(e){for(var t=f.get(e),n=0;n<t.length;n++){var r=t[n];if(r.observer===this){t.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var e=this.records_;return this.records_=[],e}},u.prototype={addTransientObserver:function(e){if(e!==this.target){t(this.observer),this.transientObservedNodes.push(e);var n=f.get(e);n||f.set(e,n=[]),n.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[];for(var t=0;t<e.length;t++)for(var n=e[t],r=f.get(n),o=0;o<r.length;o++)if(r[o]===this){r.splice(o,1);break}}},e.enqueueMutation=a,e.registerTransientObservers=o,e.wrappers.MutationObserver=c,e.wrappers.MutationRecord=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e,t){this.root=e,this.parent=t}function n(e,t){if(e.treeScope_!==t){e.treeScope_=t;for(var r=e.shadowRoot;r;r=r.olderShadowRoot)r.treeScope_.parent=t;for(var o=e.firstChild;o;o=o.nextSibling)n(o,t)}}function r(n){if(n instanceof e.wrappers.Window,n.treeScope_)return n.treeScope_;var o,i=n.parentNode;return o=i?r(i):new t(n,null),n.treeScope_=o}t.prototype={get renderer(){return this.root instanceof e.wrappers.ShadowRoot?e.getRendererForHost(this.root.host):null},contains:function(e){for(;e;e=e.parent)if(e===this)return!0;return!1}},e.TreeScope=t,e.getTreeScope=r,e.setTreeScope=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e instanceof G.ShadowRoot}function n(e){return I(e).root}function r(e,r){var s=[],c=e;for(s.push(c);c;){var u=a(c);if(u&&u.length>0){for(var l=0;l<u.length;l++){var d=u[l];if(i(d)){var f=n(d),h=f.olderShadowRoot;h&&s.push(h)}s.push(d)}c=u[u.length-1]}else if(t(c)){if(p(e,c)&&o(r))break;c=c.host,s.push(c)}else c=c.parentNode,c&&s.push(c)}return s}function o(e){if(!e)return!1;switch(e.type){case"abort":case"error":case"select":case"change":case"load":case"reset":case"resize":case"scroll":case"selectstart":return!0}return!1}function i(e){return e instanceof HTMLShadowElement}function a(t){return e.getDestinationInsertionPoints(t)}function s(e,t){if(0===e.length)return t;t instanceof G.Window&&(t=t.document);for(var n=I(t),r=e[0],o=I(r),i=u(n,o),a=0;a<e.length;a++){var s=e[a];if(I(s)===i)return s}return e[e.length-1]}function c(e){for(var t=[];e;e=e.parent)t.push(e);return t}function u(e,t){for(var n=c(e),r=c(t),o=null;n.length>0&&r.length>0;){var i=n.pop(),a=r.pop();if(i!==a)break;o=i}return o}function l(e,t,n){t instanceof G.Window&&(t=t.document);var o,i=I(t),a=I(n),s=r(n,e),o=u(i,a);o||(o=a.root);for(var c=o;c;c=c.parent)for(var l=0;l<s.length;l++){var p=s[l];if(I(p)===c)return p}return null}function p(e,t){return I(e)===I(t)}function d(e){if(!z.get(e)&&(z.set(e,!0),h(V(e),V(e.target)),W)){var t=W;throw W=null,t}}function f(e){switch(e.type){case"load":case"beforeunload":case"unload":return!0}return!1}function h(t,n){if(K.get(t))throw new Error("InvalidStateError");K.set(t,!0),e.renderAllPending();var o,i,a;if(f(t)&&!t.bubbles){var s=n;s instanceof G.Document&&(a=s.defaultView)&&(i=s,o=[])}if(!o)if(n instanceof G.Window)a=n,o=[];else if(o=r(n,t),!f(t)){var s=o[o.length-1];s instanceof G.Document&&(a=s.defaultView)}return nt.set(t,o),w(t,o,a,i)&&m(t,o,a,i)&&g(t,o,a,i),J.set(t,rt),$["delete"](t,null),K["delete"](t),t.defaultPrevented}function w(e,t,n,r){var o=ot;if(n&&!v(n,e,o,t,r))return!1;for(var i=t.length-1;i>0;i--)if(!v(t[i],e,o,t,r))return!1;return!0}function m(e,t,n,r){var o=it,i=t[0]||n;return v(i,e,o,t,r)}function g(e,t,n,r){for(var o=at,i=1;i<t.length;i++)if(!v(t[i],e,o,t,r))return;n&&t.length>0&&v(n,e,o,t,r)}function v(e,t,n,r,o){var i=X.get(e);if(!i)return!0;var a=o||s(r,e);if(a===e){if(n===ot)return!0;n===at&&(n=it)}else if(n===at&&!t.bubbles)return!0;if("relatedTarget"in t){var c=q(t),u=c.relatedTarget;if(u){if(u instanceof Object&&u.addEventListener){var p=V(u),d=l(t,e,p);if(d===a)return!0}else d=null;Z.set(t,d)}}J.set(t,n);var f=t.type,h=!1;Y.set(t,a),$.set(t,e),i.depth++;for(var w=0,m=i.length;m>w;w++){var g=i[w];if(g.removed)h=!0;else if(!(g.type!==f||!g.capture&&n===ot||g.capture&&n===at))try{if("function"==typeof g.handler?g.handler.call(e,t):g.handler.handleEvent(t),et.get(t))return!1}catch(v){W||(W=v)}}if(i.depth--,h&&0===i.depth){var b=i.slice();i.length=0;for(var w=0;w<b.length;w++)b[w].removed||i.push(b[w])}return!Q.get(t)}function b(e,t,n){this.type=e,this.handler=t,this.capture=Boolean(n)}function y(e,t){if(!(e instanceof st))return V(T(st,"Event",e,t));var n=e;return vt||"beforeunload"!==n.type||this instanceof O?void B(n,this):new O(n)}function E(e){return e&&e.relatedTarget?Object.create(e,{relatedTarget:{value:q(e.relatedTarget)}}):e}function S(e,t,n){var r=window[e],o=function(t,n){return t instanceof r?void B(t,this):V(T(r,e,t,n))};if(o.prototype=Object.create(t.prototype),n&&k(o.prototype,n),r)try{F(r,o,new r("temp"))}catch(i){F(r,o,document.createEvent(e))}return o}function M(e,t){return function(){arguments[t]=q(arguments[t]);var n=q(this);n[e].apply(n,arguments)}}function T(e,t,n,r){if(mt)return new e(n,E(r));var o=q(document.createEvent(t)),i=wt[t],a=[n];return Object.keys(i).forEach(function(e){var t=null!=r&&e in r?r[e]:i[e];"relatedTarget"===e&&(t=q(t)),a.push(t)}),o["init"+t].apply(o,a),o}function O(e){y.call(this,e)}function L(e){return"function"==typeof e?!0:e&&e.handleEvent}function j(e){switch(e){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function N(e){B(e,this)}function _(e){return e instanceof G.ShadowRoot&&(e=e.host),q(e)}function C(e,t){var n=X.get(e);if(n)for(var r=0;r<n.length;r++)if(!n[r].removed&&n[r].type===t)return!0;return!1}function D(e,t){for(var n=q(e);n;n=n.parentNode)if(C(V(n),t))return!0;return!1}function H(e){A(e,yt)}function x(t,n,o,i){e.renderAllPending();var a=V(Et.call(U(n),o,i));if(!a)return null;var c=r(a,null),u=c.lastIndexOf(t);return-1==u?null:(c=c.slice(0,u),s(c,t))}function R(e){return function(){var t=tt.get(this);return t&&t[e]&&t[e].value||null}}function P(e){var t=e.slice(2);return function(n){var r=tt.get(this);r||(r=Object.create(null),tt.set(this,r));var o=r[e];if(o&&this.removeEventListener(t,o.wrapped,!1),"function"==typeof n){var i=function(t){var r=n.call(this,t);r===!1?t.preventDefault():"onbeforeunload"===e&&"string"==typeof r&&(t.returnValue=r)};this.addEventListener(t,i,!1),r[e]={value:n,wrapped:i}}}}var W,A=e.forwardMethodsToWrapper,I=e.getTreeScope,k=e.mixin,F=e.registerWrapper,B=e.setWrapper,U=e.unsafeUnwrap,q=e.unwrap,V=e.wrap,G=e.wrappers,X=(new WeakMap,new WeakMap),z=new WeakMap,K=new WeakMap,Y=new WeakMap,$=new WeakMap,Z=new WeakMap,J=new WeakMap,Q=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,rt=0,ot=1,it=2,at=3;b.prototype={equals:function(e){return this.handler===e.handler&&this.type===e.type&&this.capture===e.capture},get removed(){return null===this.handler},remove:function(){this.handler=null}};var st=window.Event;st.prototype.polymerBlackList_={returnValue:!0,keyLocation:!0},y.prototype={get target(){return Y.get(this)},get currentTarget(){return $.get(this)},get eventPhase(){return J.get(this)},get path(){var e=nt.get(this);return e?e.slice():[]},stopPropagation:function(){Q.set(this,!0)},stopImmediatePropagation:function(){Q.set(this,!0),et.set(this,!0)}},F(st,y,document.createEvent("Event"));var ct=S("UIEvent",y),ut=S("CustomEvent",y),lt={get relatedTarget(){var e=Z.get(this);return void 0!==e?e:V(q(this).relatedTarget)}},pt=k({initMouseEvent:M("initMouseEvent",14)},lt),dt=k({initFocusEvent:M("initFocusEvent",5)},lt),ft=S("MouseEvent",ct,pt),ht=S("FocusEvent",ct,dt),wt=Object.create(null),mt=function(){try{new window.FocusEvent("focus")}catch(e){return!1}return!0}();if(!mt){var gt=function(e,t,n){if(n){var r=wt[n];t=k(k({},r),t)}wt[e]=t};gt("Event",{bubbles:!1,cancelable:!1}),gt("CustomEvent",{detail:null},"Event"),gt("UIEvent",{view:null,detail:0},"Event"),gt("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),gt("FocusEvent",{relatedTarget:null},"UIEvent")}var vt=window.BeforeUnloadEvent;O.prototype=Object.create(y.prototype),k(O.prototype,{get returnValue(){return U(this).returnValue},set returnValue(e){U(this).returnValue=e}}),vt&&F(vt,O);var bt=window.EventTarget,yt=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forEach(function(e){var t=e.prototype;yt.forEach(function(e){Object.defineProperty(t,e+"_",{value:t[e]})})}),N.prototype={addEventListener:function(e,t,n){if(L(t)&&!j(e)){var r=new b(e,t,n),o=X.get(this);if(o){for(var i=0;i<o.length;i++)if(r.equals(o[i]))return}else o=[],o.depth=0,X.set(this,o);o.push(r);var a=_(this);a.addEventListener_(e,d,!0)}},removeEventListener:function(e,t,n){n=Boolean(n);var r=X.get(this);if(r){for(var o=0,i=!1,a=0;a<r.length;a++)r[a].type===e&&r[a].capture===n&&(o++,r[a].handler===t&&(i=!0,r[a].remove()));if(i&&1===o){var s=_(this);s.removeEventListener_(e,d,!0)}}},dispatchEvent:function(t){var n=q(t),r=n.type;z.set(n,!1),e.renderAllPending();var o;D(this,r)||(o=function(){},this.addEventListener(r,o,!0));try{return q(this).dispatchEvent_(n)}finally{o&&this.removeEventListener(r,o,!0)}}},bt&&F(bt,N);var Et=document.elementFromPoint;e.elementFromPoint=x,e.getEventHandlerGetter=R,e.getEventHandlerSetter=P,e.wrapEventTargetMethods=H,e.wrappers.BeforeUnloadEvent=O,e.wrappers.CustomEvent=ut,e.wrappers.Event=y,e.wrappers.EventTarget=N,e.wrappers.FocusEvent=ht,e.wrappers.MouseEvent=ft,e.wrappers.UIEvent=ct}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e,t){Object.defineProperty(e,t,w)}function n(e){u(e,this)}function r(){this.length=0,t(this,"length")}function o(e){for(var t=new r,o=0;o<e.length;o++)t[o]=new n(e[o]);return t.length=o,t}function i(e){a.call(this,e)}var a=e.wrappers.UIEvent,s=e.mixin,c=e.registerWrapper,u=e.setWrapper,l=e.unsafeUnwrap,p=e.wrap,d=window.TouchEvent;if(d){var f;try{f=document.createEvent("TouchEvent")}catch(h){return}var w={enumerable:!1};n.prototype={get target(){return p(l(this).target)}};var m={configurable:!0,enumerable:!0,get:null};["clientX","clientY","screenX","screenY","pageX","pageY","identifier","webkitRadiusX","webkitRadiusY","webkitRotationAngle","webkitForce"].forEach(function(e){m.get=function(){return l(this)[e]},Object.defineProperty(n.prototype,e,m)}),r.prototype={item:function(e){return this[e]}},i.prototype=Object.create(a.prototype),s(i.prototype,{get touches(){return o(l(this).touches)},get targetTouches(){return o(l(this).targetTouches)},get changedTouches(){return o(l(this).changedTouches)},initTouchEvent:function(){throw new Error("Not implemented")}}),c(d,i,f),e.wrappers.Touch=n,e.wrappers.TouchEvent=i,e.wrappers.TouchList=r}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e,t){Object.defineProperty(e,t,s)}function n(){this.length=0,t(this,"length")}function r(e){if(null==e)return e;for(var t=new n,r=0,o=e.length;o>r;r++)t[r]=a(e[r]);return t.length=o,t}function o(e,t){e.prototype[t]=function(){return r(i(this)[t].apply(i(this),arguments))}}var i=e.unsafeUnwrap,a=e.wrap,s={enumerable:!1};n.prototype={item:function(e){return this[e]}},t(n.prototype,"item"),e.wrappers.NodeList=n,e.addWrapNodeListMethod=o,e.wrapNodeList=r}(window.ShadowDOMPolyfill),function(e){"use strict";e.wrapHTMLCollection=e.wrapNodeList,e.wrappers.HTMLCollection=e.wrappers.NodeList}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){L(e instanceof S)}function n(e){var t=new T;return t[0]=e,t.length=1,t}function r(e,t,n){N(t,"childList",{removedNodes:n,previousSibling:e.previousSibling,nextSibling:e.nextSibling})}function o(e,t){N(e,"childList",{removedNodes:t})}function i(e,t,r,o){if(e instanceof DocumentFragment){var i=s(e);B=!0;for(var a=i.length-1;a>=0;a--)e.removeChild(i[a]),i[a].parentNode_=t;B=!1;for(var a=0;a<i.length;a++)i[a].previousSibling_=i[a-1]||r,i[a].nextSibling_=i[a+1]||o;return r&&(r.nextSibling_=i[0]),o&&(o.previousSibling_=i[i.length-1]),i}var i=n(e),c=e.parentNode;return c&&c.removeChild(e),e.parentNode_=t,e.previousSibling_=r,e.nextSibling_=o,r&&(r.nextSibling_=e),o&&(o.previousSibling_=e),i}function a(e){if(e instanceof DocumentFragment)return s(e);var t=n(e),o=e.parentNode;return o&&r(e,o,t),t}function s(e){for(var t=new T,n=0,r=e.firstChild;r;r=r.nextSibling)t[n++]=r;return t.length=n,o(e,t),t}function c(e){return e}function u(e,t){R(e,t),e.nodeIsInserted_()}function l(e,t){for(var n=_(t),r=0;r<e.length;r++)u(e[r],n)}function p(e){R(e,new O(e,null))}function d(e){for(var t=0;t<e.length;t++)p(e[t])}function f(e,t){var n=e.nodeType===S.DOCUMENT_NODE?e:e.ownerDocument;n!==t.ownerDocument&&n.adoptNode(t)}function h(t,n){if(n.length){var r=t.ownerDocument;if(r!==n[0].ownerDocument)for(var o=0;o<n.length;o++)e.adoptNodeNoRemove(n[o],r)}}function w(e,t){h(e,t);var n=t.length;if(1===n)return W(t[0]);for(var r=W(e.ownerDocument.createDocumentFragment()),o=0;n>o;o++)r.appendChild(W(t[o]));return r}function m(e){if(void 0!==e.firstChild_)for(var t=e.firstChild_;t;){var n=t;t=t.nextSibling_,n.parentNode_=n.previousSibling_=n.nextSibling_=void 0}e.firstChild_=e.lastChild_=void 0}function g(e){if(e.invalidateShadowRenderer()){for(var t=e.firstChild;t;){L(t.parentNode===e);var n=t.nextSibling,r=W(t),o=r.parentNode;o&&K.call(o,r),t.previousSibling_=t.nextSibling_=t.parentNode_=null,t=n}e.firstChild_=e.lastChild_=null}else for(var n,i=W(e),a=i.firstChild;a;)n=a.nextSibling,K.call(i,a),a=n}function v(e){var t=e.parentNode;return t&&t.invalidateShadowRenderer()}function b(e){for(var t,n=0;n<e.length;n++)t=e[n],t.parentNode.removeChild(t)}function y(e,t,n){var r;if(r=I(n?U.call(n,P(e),!1):q.call(P(e),!1)),t){for(var o=e.firstChild;o;o=o.nextSibling)r.appendChild(y(o,!0,n));if(e instanceof F.HTMLTemplateElement)for(var i=r.content,o=e.content.firstChild;o;o=o.nextSibling)i.appendChild(y(o,!0,n))}return r}function E(e,t){if(!t||_(e)!==_(t))return!1;for(var n=t;n;n=n.parentNode)if(n===e)return!0;return!1}function S(e){L(e instanceof V),M.call(this,e),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0,this.treeScope_=void 0}var M=e.wrappers.EventTarget,T=e.wrappers.NodeList,O=e.TreeScope,L=e.assert,j=e.defineWrapGetter,N=e.enqueueMutation,_=e.getTreeScope,C=e.isWrapper,D=e.mixin,H=e.registerTransientObservers,x=e.registerWrapper,R=e.setTreeScope,P=e.unsafeUnwrap,W=e.unwrap,A=e.unwrapIfNeeded,I=e.wrap,k=e.wrapIfNeeded,F=e.wrappers,B=!1,U=document.importNode,q=window.Node.prototype.cloneNode,V=window.Node,G=window.DocumentFragment,X=(V.prototype.appendChild,V.prototype.compareDocumentPosition),z=V.prototype.insertBefore,K=V.prototype.removeChild,Y=V.prototype.replaceChild,$=/Trident|Edge/.test(navigator.userAgent),Z=$?function(e,t){try{K.call(e,t)}catch(n){if(!(e instanceof G))throw n}}:function(e,t){K.call(e,t)};S.prototype=Object.create(M.prototype),D(S.prototype,{appendChild:function(e){return this.insertBefore(e,null)},insertBefore:function(e,n){t(e);var r;n?C(n)?r=W(n):(r=n,n=I(r)):(n=null,r=null),n&&L(n.parentNode===this);var o,s=n?n.previousSibling:this.lastChild,c=!this.invalidateShadowRenderer()&&!v(e);if(o=c?a(e):i(e,this,s,n),c)f(this,e),m(this),z.call(P(this),W(e),r);else{s||(this.firstChild_=o[0]),n||(this.lastChild_=o[o.length-1],void 0===this.firstChild_&&(this.firstChild_=this.firstChild));var u=r?r.parentNode:P(this);u?z.call(u,w(this,o),r):h(this,o)}return N(this,"childList",{addedNodes:o,nextSibling:n,previousSibling:s}),l(o,this),e},removeChild:function(e){if(t(e),e.parentNode!==this){for(var r=!1,o=(this.childNodes,this.firstChild);o;o=o.nextSibling)if(o===e){r=!0;break}if(!r)throw new Error("NotFoundError")}var i=W(e),a=e.nextSibling,s=e.previousSibling;if(this.invalidateShadowRenderer()){var c=this.firstChild,u=this.lastChild,l=i.parentNode;l&&Z(l,i),c===e&&(this.firstChild_=a),u===e&&(this.lastChild_=s),s&&(s.nextSibling_=a),a&&(a.previousSibling_=s),e.previousSibling_=e.nextSibling_=e.parentNode_=void 0}else m(this),Z(P(this),i);return B||N(this,"childList",{removedNodes:n(e),nextSibling:a,previousSibling:s}),H(this,e),e},replaceChild:function(e,r){t(e);var o;if(C(r)?o=W(r):(o=r,r=I(o)),r.parentNode!==this)throw new Error("NotFoundError");var s,c=r.nextSibling,u=r.previousSibling,d=!this.invalidateShadowRenderer()&&!v(e);return d?s=a(e):(c===e&&(c=e.nextSibling),s=i(e,this,u,c)),d?(f(this,e),m(this),Y.call(P(this),W(e),o)):(this.firstChild===r&&(this.firstChild_=s[0]),this.lastChild===r&&(this.lastChild_=s[s.length-1]),r.previousSibling_=r.nextSibling_=r.parentNode_=void 0,o.parentNode&&Y.call(o.parentNode,w(this,s),o)),N(this,"childList",{addedNodes:s,removedNodes:n(r),nextSibling:c,previousSibling:u}),p(r),l(s,this),r},nodeIsInserted_:function(){for(var e=this.firstChild;e;e=e.nextSibling)e.nodeIsInserted_()},hasChildNodes:function(){return null!==this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:I(P(this).parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:I(P(this).firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:I(P(this).lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:I(P(this).nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:I(P(this).previousSibling)},get parentElement(){for(var e=this.parentNode;e&&e.nodeType!==S.ELEMENT_NODE;)e=e.parentNode;return e},get textContent(){for(var e="",t=this.firstChild;t;t=t.nextSibling)t.nodeType!=S.COMMENT_NODE&&(e+=t.textContent);return e},set textContent(e){null==e&&(e="");var t=c(this.childNodes);if(this.invalidateShadowRenderer()){if(g(this),""!==e){var n=P(this).ownerDocument.createTextNode(e);this.appendChild(n)}}else m(this),P(this).textContent=e;var r=c(this.childNodes);N(this,"childList",{addedNodes:r,removedNodes:t}),d(t),l(r,this)},get childNodes(){for(var e=new T,t=0,n=this.firstChild;n;n=n.nextSibling)e[t++]=n;return e.length=t,e},cloneNode:function(e){return y(this,e)},contains:function(e){return E(this,k(e))},compareDocumentPosition:function(e){return X.call(P(this),A(e))},normalize:function(){for(var e,t,n=c(this.childNodes),r=[],o="",i=0;i<n.length;i++)t=n[i],t.nodeType===S.TEXT_NODE?e||t.data.length?e?(o+=t.data,r.push(t)):e=t:this.removeChild(t):(e&&r.length&&(e.data+=o,b(r)),r=[],o="",e=null,t.childNodes.length&&t.normalize());e&&r.length&&(e.data+=o,b(r))}}),j(S,"ownerDocument"),x(V,S,document.createDocumentFragment()),delete S.prototype.querySelector,delete S.prototype.querySelectorAll,S.prototype=D(Object.create(M.prototype),S.prototype),e.cloneNode=y,e.nodeWasAdded=u,e.nodeWasRemoved=p,e.nodesWereAdded=l,e.nodesWereRemoved=d,e.originalInsertBefore=z,e.originalRemoveChild=K,e.snapshotNodeList=c,e.wrappers.Node=S}(window.ShadowDOMPolyfill),function(e){"use strict";function t(t,n,r,o){for(var i=null,a=null,s=0,c=t.length;c>s;s++)i=b(t[s]),!o&&(a=g(i).root)&&a instanceof e.wrappers.ShadowRoot||(r[n++]=i);return n}function n(e){return String(e).replace(/\/deep\/|::shadow/g," ")}function r(e){return String(e).replace(/:host\(([^\s]+)\)/g,"$1").replace(/([^\s]):host/g,"$1").replace(":host","*").replace(/\^|\/shadow\/|\/shadow-deep\/|::shadow|\/deep\/|::content/g," ")}function o(e,t){for(var n,r=e.firstElementChild;r;){if(r.matches(t))return r;if(n=o(r,t))return n;r=r.nextElementSibling}return null}function i(e,t){return e.matches(t)}function a(e,t,n){var r=e.localName;return r===t||r===n&&e.namespaceURI===C}function s(){return!0}function c(e,t,n){return e.localName===n}function u(e,t){return e.namespaceURI===t}function l(e,t,n){return e.namespaceURI===t&&e.localName===n}function p(e,t,n,r,o,i){for(var a=e.firstElementChild;a;)r(a,o,i)&&(n[t++]=a),t=p(a,t,n,r,o,i),a=a.nextElementSibling;return t}function d(n,r,o,i,a){var s,c=v(this),u=g(this).root;if(u instanceof e.wrappers.ShadowRoot)return p(this,r,o,n,i,null);if(c instanceof N)s=M.call(c,i);else{if(!(c instanceof _))return p(this,r,o,n,i,null);s=S.call(c,i)}return t(s,r,o,a)}function f(n,r,o,i,a){var s,c=v(this),u=g(this).root;if(u instanceof e.wrappers.ShadowRoot)return p(this,r,o,n,i,a);if(c instanceof N)s=O.call(c,i,a);else{if(!(c instanceof _))return p(this,r,o,n,i,a);s=T.call(c,i,a)}return t(s,r,o,!1)}function h(n,r,o,i,a){var s,c=v(this),u=g(this).root;if(u instanceof e.wrappers.ShadowRoot)return p(this,r,o,n,i,a);if(c instanceof N)s=j.call(c,i,a);else{if(!(c instanceof _))return p(this,r,o,n,i,a);s=L.call(c,i,a)}return t(s,r,o,!1)}var w=e.wrappers.HTMLCollection,m=e.wrappers.NodeList,g=e.getTreeScope,v=e.unsafeUnwrap,b=e.wrap,y=document.querySelector,E=document.documentElement.querySelector,S=document.querySelectorAll,M=document.documentElement.querySelectorAll,T=document.getElementsByTagName,O=document.documentElement.getElementsByTagName,L=document.getElementsByTagNameNS,j=document.documentElement.getElementsByTagNameNS,N=window.Element,_=window.HTMLDocument||window.Document,C="http://www.w3.org/1999/xhtml",D={querySelector:function(t){var r=n(t),i=r!==t;t=r;var a,s=v(this),c=g(this).root;if(c instanceof e.wrappers.ShadowRoot)return o(this,t);if(s instanceof N)a=b(E.call(s,t));else{if(!(s instanceof _))return o(this,t);a=b(y.call(s,t))}return a&&!i&&(c=g(a).root)&&c instanceof e.wrappers.ShadowRoot?o(this,t):a},querySelectorAll:function(e){var t=n(e),r=t!==e;e=t;var o=new m;return o.length=d.call(this,i,0,o,e,r),o}},H={matches:function(t){return t=r(t),e.originalMatches.call(v(this),t)}},x={getElementsByTagName:function(e){var t=new w,n="*"===e?s:a;return t.length=f.call(this,n,0,t,e,e.toLowerCase()),t},getElementsByClassName:function(e){return this.querySelectorAll("."+e)},getElementsByTagNameNS:function(e,t){var n=new w,r=null;return r="*"===e?"*"===t?s:c:"*"===t?u:l,n.length=h.call(this,r,0,n,e||null,t),n}};e.GetElementsByInterface=x,e.SelectorsInterface=D,e.MatchesInterface=H}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.nextSibling;return e}function n(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.previousSibling;return e}var r=e.wrappers.NodeList,o={get firstElementChild(){return t(this.firstChild)
12
+ },get lastElementChild(){return n(this.lastChild)},get childElementCount(){for(var e=0,t=this.firstElementChild;t;t=t.nextElementSibling)e++;return e},get children(){for(var e=new r,t=0,n=this.firstElementChild;n;n=n.nextElementSibling)e[t++]=n;return e.length=t,e},remove:function(){var e=this.parentNode;e&&e.removeChild(this)}},i={get nextElementSibling(){return t(this.nextSibling)},get previousElementSibling(){return n(this.previousSibling)}};e.ChildNodeInterface=i,e.ParentNodeInterface=o}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}var n=e.ChildNodeInterface,r=e.wrappers.Node,o=e.enqueueMutation,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=window.CharacterData;t.prototype=Object.create(r.prototype),i(t.prototype,{get textContent(){return this.data},set textContent(e){this.data=e},get data(){return s(this).data},set data(e){var t=s(this).data;o(this,"characterData",{oldValue:t}),s(this).data=e}}),i(t.prototype,n),a(c,t,document.createTextNode("")),e.wrappers.CharacterData=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e>>>0}function n(e){r.call(this,e)}var r=e.wrappers.CharacterData,o=(e.enqueueMutation,e.mixin),i=e.registerWrapper,a=window.Text;n.prototype=Object.create(r.prototype),o(n.prototype,{splitText:function(e){e=t(e);var n=this.data;if(e>n.length)throw new Error("IndexSizeError");var r=n.slice(0,e),o=n.slice(e);this.data=r;var i=this.ownerDocument.createTextNode(o);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}}),i(a,n,document.createTextNode("")),e.wrappers.Text=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return i(e).getAttribute("class")}function n(e,t){a(e,"attributes",{name:"class",namespace:null,oldValue:t})}function r(t){e.invalidateRendererBasedOnAttribute(t,"class")}function o(e,o,i){var a=e.ownerElement_;if(null==a)return o.apply(e,i);var s=t(a),c=o.apply(e,i);return t(a)!==s&&(n(a,s),r(a)),c}if(!window.DOMTokenList)return void console.warn("Missing DOMTokenList prototype, please include a compatible classList polyfill such as http://goo.gl/uTcepH.");var i=e.unsafeUnwrap,a=e.enqueueMutation,s=DOMTokenList.prototype.add;DOMTokenList.prototype.add=function(){o(this,s,arguments)};var c=DOMTokenList.prototype.remove;DOMTokenList.prototype.remove=function(){o(this,c,arguments)};var u=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(){return o(this,u,arguments)}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(t,n){var r=t.parentNode;if(r&&r.shadowRoot){var o=e.getRendererForHost(r);o.dependsOnAttribute(n)&&o.invalidate()}}function n(e,t,n){l(e,"attributes",{name:t,namespace:null,oldValue:n})}function r(e){a.call(this,e)}var o=e.ChildNodeInterface,i=e.GetElementsByInterface,a=e.wrappers.Node,s=e.ParentNodeInterface,c=e.SelectorsInterface,u=e.MatchesInterface,l=(e.addWrapNodeListMethod,e.enqueueMutation),p=e.mixin,d=(e.oneOf,e.registerWrapper),f=e.unsafeUnwrap,h=e.wrappers,w=window.Element,m=["matches","mozMatchesSelector","msMatchesSelector","webkitMatchesSelector"].filter(function(e){return w.prototype[e]}),g=m[0],v=w.prototype[g],b=new WeakMap;r.prototype=Object.create(a.prototype),p(r.prototype,{createShadowRoot:function(){var t=new h.ShadowRoot(this);f(this).polymerShadowRoot_=t;var n=e.getRendererForHost(this);return n.invalidate(),t},get shadowRoot(){return f(this).polymerShadowRoot_||null},setAttribute:function(e,r){var o=f(this).getAttribute(e);f(this).setAttribute(e,r),n(this,e,o),t(this,e)},removeAttribute:function(e){var r=f(this).getAttribute(e);f(this).removeAttribute(e),n(this,e,r),t(this,e)},get classList(){var e=b.get(this);if(!e){if(e=f(this).classList,!e)return;e.ownerElement_=this,b.set(this,e)}return e},get className(){return f(this).className},set className(e){this.setAttribute("class",e)},get id(){return f(this).id},set id(e){this.setAttribute("id",e)}}),m.forEach(function(e){"matches"!==e&&(r.prototype[e]=function(e){return this.matches(e)})}),w.prototype.webkitCreateShadowRoot&&(r.prototype.webkitCreateShadowRoot=r.prototype.createShadowRoot),p(r.prototype,o),p(r.prototype,i),p(r.prototype,s),p(r.prototype,c),p(r.prototype,u),d(w,r,document.createElementNS(null,"x")),e.invalidateRendererBasedOnAttribute=t,e.matchesNames=m,e.originalMatches=v,e.wrappers.Element=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function n(e){return e.replace(L,t)}function r(e){return e.replace(j,t)}function o(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}function i(e,t){switch(e.nodeType){case Node.ELEMENT_NODE:for(var o,i=e.tagName.toLowerCase(),s="<"+i,c=e.attributes,u=0;o=c[u];u++)s+=" "+o.name+'="'+n(o.value)+'"';return s+=">",N[i]?s:s+a(e)+"</"+i+">";case Node.TEXT_NODE:var l=e.data;return t&&_[t.localName]?l:r(l);case Node.COMMENT_NODE:return"<!--"+e.data+"-->";default:throw console.error(e),new Error("not implemented")}}function a(e){e instanceof O.HTMLTemplateElement&&(e=e.content);for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=i(n,e);return t}function s(e,t,n){var r=n||"div";e.textContent="";var o=M(e.ownerDocument.createElement(r));o.innerHTML=t;for(var i;i=o.firstChild;)e.appendChild(T(i))}function c(e){h.call(this,e)}function u(e,t){var n=M(e.cloneNode(!1));n.innerHTML=t;for(var r,o=M(document.createDocumentFragment());r=n.firstChild;)o.appendChild(r);return T(o)}function l(t){return function(){return e.renderAllPending(),S(this)[t]}}function p(e){w(c,e,l(e))}function d(t){Object.defineProperty(c.prototype,t,{get:l(t),set:function(n){e.renderAllPending(),S(this)[t]=n},configurable:!0,enumerable:!0})}function f(t){Object.defineProperty(c.prototype,t,{value:function(){return e.renderAllPending(),S(this)[t].apply(S(this),arguments)},configurable:!0,enumerable:!0})}var h=e.wrappers.Element,w=e.defineGetter,m=e.enqueueMutation,g=e.mixin,v=e.nodesWereAdded,b=e.nodesWereRemoved,y=e.registerWrapper,E=e.snapshotNodeList,S=e.unsafeUnwrap,M=e.unwrap,T=e.wrap,O=e.wrappers,L=/[&\u00A0"]/g,j=/[&\u00A0<>]/g,N=o(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),_=o(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),C=/MSIE/.test(navigator.userAgent),D=window.HTMLElement,H=window.HTMLTemplateElement;c.prototype=Object.create(h.prototype),g(c.prototype,{get innerHTML(){return a(this)},set innerHTML(e){if(C&&_[this.localName])return void(this.textContent=e);var t=E(this.childNodes);this.invalidateShadowRenderer()?this instanceof O.HTMLTemplateElement?s(this.content,e):s(this,e,this.tagName):!H&&this instanceof O.HTMLTemplateElement?s(this.content,e):S(this).innerHTML=e;var n=E(this.childNodes);m(this,"childList",{addedNodes:n,removedNodes:t}),b(t),v(n,this)},get outerHTML(){return i(this,this.parentNode)},set outerHTML(e){var t=this.parentNode;if(t){t.invalidateShadowRenderer();var n=u(t,e);t.replaceChild(n,this)}},insertAdjacentHTML:function(e,t){var n,r;switch(String(e).toLowerCase()){case"beforebegin":n=this.parentNode,r=this;break;case"afterend":n=this.parentNode,r=this.nextSibling;break;case"afterbegin":n=this,r=this.firstChild;break;case"beforeend":n=this,r=null;break;default:return}var o=u(n,t);n.insertBefore(o,r)},get hidden(){return this.hasAttribute("hidden")},set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollWidth"].forEach(p),["scrollLeft","scrollTop"].forEach(d),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(f),y(D,c,document.createElement("b")),e.wrappers.HTMLElement=c,e.getInnerHTML=a,e.setInnerHTML=s}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=window.HTMLCanvasElement;t.prototype=Object.create(n.prototype),r(t.prototype,{getContext:function(){var e=i(this).getContext.apply(i(this),arguments);return e&&a(e)}}),o(s,t,document.createElement("canvas")),e.wrappers.HTMLCanvasElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=window.HTMLContentElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor:t,get select(){return this.getAttribute("select")},set select(e){this.setAttribute("select",e)},setAttribute:function(e,t){n.prototype.setAttribute.call(this,e,t),"select"===String(e).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),i&&o(i,t),e.wrappers.HTMLContentElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=window.HTMLFormElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get elements(){return i(a(this).elements)}}),o(s,t,document.createElement("form")),e.wrappers.HTMLFormElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}function n(e,t){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var o=i(document.createElement("img"));r.call(this,o),a(o,this),void 0!==e&&(o.width=e),void 0!==t&&(o.height=t)}var r=e.wrappers.HTMLElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLImageElement;t.prototype=Object.create(r.prototype),o(s,t,document.createElement("img")),n.prototype=t.prototype,e.wrappers.HTMLImageElement=t,e.wrappers.Image=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=(e.mixin,e.wrappers.NodeList,e.registerWrapper),o=window.HTMLShadowElement;t.prototype=Object.create(n.prototype),t.prototype.constructor=t,o&&r(o,t),e.wrappers.HTMLShadowElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){if(!e.defaultView)return e;var t=p.get(e);if(!t){for(t=e.implementation.createHTMLDocument("");t.lastChild;)t.removeChild(t.lastChild);p.set(e,t)}return t}function n(e){for(var n,r=t(e.ownerDocument),o=c(r.createDocumentFragment());n=e.firstChild;)o.appendChild(n);return o}function r(e){if(o.call(this,e),!d){var t=n(e);l.set(this,u(t))}}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=e.unwrap,u=e.wrap,l=new WeakMap,p=new WeakMap,d=window.HTMLTemplateElement;r.prototype=Object.create(o.prototype),i(r.prototype,{constructor:r,get content(){return d?u(s(this).content):l.get(this)}}),d&&a(d,r),e.wrappers.HTMLTemplateElement=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.registerWrapper,o=window.HTMLMediaElement;o&&(t.prototype=Object.create(n.prototype),r(o,t,document.createElement("audio")),e.wrappers.HTMLMediaElement=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}function n(e){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var t=i(document.createElement("audio"));r.call(this,t),a(t,this),t.setAttribute("preload","auto"),void 0!==e&&t.setAttribute("src",e)}var r=e.wrappers.HTMLMediaElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLAudioElement;s&&(t.prototype=Object.create(r.prototype),o(s,t,document.createElement("audio")),n.prototype=t.prototype,e.wrappers.HTMLAudioElement=t,e.wrappers.Audio=n)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e.replace(/\s+/g," ").trim()}function n(e){o.call(this,e)}function r(e,t,n,i){if(!(this instanceof r))throw new TypeError("DOM object constructor cannot be called as a function.");var a=c(document.createElement("option"));o.call(this,a),s(a,this),void 0!==e&&(a.text=e),void 0!==t&&a.setAttribute("value",t),n===!0&&a.setAttribute("selected",""),a.selected=i===!0}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.rewrap,c=e.unwrap,u=e.wrap,l=window.HTMLOptionElement;n.prototype=Object.create(o.prototype),i(n.prototype,{get text(){return t(this.textContent)},set text(e){this.textContent=t(String(e))},get form(){return u(c(this).form)}}),a(l,n,document.createElement("option")),r.prototype=n.prototype,e.wrappers.HTMLOptionElement=n,e.wrappers.Option=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=window.HTMLSelectElement;t.prototype=Object.create(n.prototype),r(t.prototype,{add:function(e,t){"object"==typeof t&&(t=i(t)),i(this).add(i(e),t)},remove:function(e){return void 0===e?void n.prototype.remove.call(this):("object"==typeof e&&(e=i(e)),void i(this).remove(e))},get form(){return a(i(this).form)}}),o(s,t,document.createElement("select")),e.wrappers.HTMLSelectElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=e.wrapHTMLCollection,c=window.HTMLTableElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get caption(){return a(i(this).caption)},createCaption:function(){return a(i(this).createCaption())},get tHead(){return a(i(this).tHead)},createTHead:function(){return a(i(this).createTHead())},createTFoot:function(){return a(i(this).createTFoot())},get tFoot(){return a(i(this).tFoot)},get tBodies(){return s(i(this).tBodies)},createTBody:function(){return a(i(this).createTBody())},get rows(){return s(i(this).rows)},insertRow:function(e){return a(i(this).insertRow(e))}}),o(c,t,document.createElement("table")),e.wrappers.HTMLTableElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLTableSectionElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor:t,get rows(){return i(a(this).rows)},insertRow:function(e){return s(a(this).insertRow(e))}}),o(c,t,document.createElement("thead")),e.wrappers.HTMLTableSectionElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLTableRowElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get cells(){return i(a(this).cells)},insertCell:function(e){return s(a(this).insertCell(e))}}),o(c,t,document.createElement("tr")),e.wrappers.HTMLTableRowElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e.localName){case"content":return new n(e);case"shadow":return new o(e);case"template":return new i(e)}r.call(this,e)}var n=e.wrappers.HTMLContentElement,r=e.wrappers.HTMLElement,o=e.wrappers.HTMLShadowElement,i=e.wrappers.HTMLTemplateElement,a=(e.mixin,e.registerWrapper),s=window.HTMLUnknownElement;t.prototype=Object.create(r.prototype),a(s,t),e.wrappers.HTMLUnknownElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.wrappers.Element,n=e.wrappers.HTMLElement,r=e.registerObject,o=e.defineWrapGetter,i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"title"),s=r(a),c=Object.getPrototypeOf(s.prototype).constructor;if(!("classList"in a)){var u=Object.getOwnPropertyDescriptor(t.prototype,"classList");Object.defineProperty(n.prototype,"classList",u),delete t.prototype.classList}o(c,"ownerSVGElement"),e.wrappers.SVGElement=c}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){d.call(this,e)}var n=e.mixin,r=e.registerWrapper,o=e.unwrap,i=e.wrap,a=window.SVGUseElement,s="http://www.w3.org/2000/svg",c=i(document.createElementNS(s,"g")),u=document.createElementNS(s,"use"),l=c.constructor,p=Object.getPrototypeOf(l.prototype),d=p.constructor;t.prototype=Object.create(p),"instanceRoot"in u&&n(t.prototype,{get instanceRoot(){return i(o(this).instanceRoot)},get animatedInstanceRoot(){return i(o(this).animatedInstanceRoot)}}),r(a,t,u),e.wrappers.SVGUseElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=window.SVGElementInstance;s&&(t.prototype=Object.create(n.prototype),r(t.prototype,{get correspondingElement(){return a(i(this).correspondingElement)},get correspondingUseElement(){return a(i(this).correspondingUseElement)},get parentNode(){return a(i(this).parentNode)},get childNodes(){throw new Error("Not implemented")},get firstChild(){return a(i(this).firstChild)},get lastChild(){return a(i(this).lastChild)},get previousSibling(){return a(i(this).previousSibling)},get nextSibling(){return a(i(this).nextSibling)}}),o(s,t),e.wrappers.SVGElementInstance=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrap,s=e.unwrapIfNeeded,c=e.wrap,u=window.CanvasRenderingContext2D;n(t.prototype,{get canvas(){return c(i(this).canvas)},drawImage:function(){arguments[0]=s(arguments[0]),i(this).drawImage.apply(i(this),arguments)},createPattern:function(){return arguments[0]=a(arguments[0]),i(this).createPattern.apply(i(this),arguments)}}),r(u,t,document.createElement("canvas").getContext("2d")),e.wrappers.CanvasRenderingContext2D=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrapIfNeeded,s=e.wrap,c=window.WebGLRenderingContext;if(c){n(t.prototype,{get canvas(){return s(i(this).canvas)},texImage2D:function(){arguments[5]=a(arguments[5]),i(this).texImage2D.apply(i(this),arguments)},texSubImage2D:function(){arguments[6]=a(arguments[6]),i(this).texSubImage2D.apply(i(this),arguments)}});var u=/WebKit/.test(navigator.userAgent)?{drawingBufferHeight:null,drawingBufferWidth:null}:{};r(c,t,u),e.wrappers.WebGLRenderingContext=t}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r(e,this)}var n=e.registerWrapper,r=e.setWrapper,o=e.unsafeUnwrap,i=e.unwrap,a=e.unwrapIfNeeded,s=e.wrap,c=window.Range;t.prototype={get startContainer(){return s(o(this).startContainer)},get endContainer(){return s(o(this).endContainer)},get commonAncestorContainer(){return s(o(this).commonAncestorContainer)},setStart:function(e,t){o(this).setStart(a(e),t)},setEnd:function(e,t){o(this).setEnd(a(e),t)},setStartBefore:function(e){o(this).setStartBefore(a(e))},setStartAfter:function(e){o(this).setStartAfter(a(e))},setEndBefore:function(e){o(this).setEndBefore(a(e))},setEndAfter:function(e){o(this).setEndAfter(a(e))},selectNode:function(e){o(this).selectNode(a(e))},selectNodeContents:function(e){o(this).selectNodeContents(a(e))},compareBoundaryPoints:function(e,t){return o(this).compareBoundaryPoints(e,i(t))},extractContents:function(){return s(o(this).extractContents())},cloneContents:function(){return s(o(this).cloneContents())},insertNode:function(e){o(this).insertNode(a(e))},surroundContents:function(e){o(this).surroundContents(a(e))},cloneRange:function(){return s(o(this).cloneRange())},isPointInRange:function(e,t){return o(this).isPointInRange(a(e),t)},comparePoint:function(e,t){return o(this).comparePoint(a(e),t)},intersectsNode:function(e){return o(this).intersectsNode(a(e))},toString:function(){return o(this).toString()}},c.prototype.createContextualFragment&&(t.prototype.createContextualFragment=function(e){return s(o(this).createContextualFragment(e))}),n(window.Range,t,document.createRange()),e.wrappers.Range=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.GetElementsByInterface,n=e.ParentNodeInterface,r=e.SelectorsInterface,o=e.mixin,i=e.registerObject,a=i(document.createDocumentFragment());o(a.prototype,n),o(a.prototype,r),o(a.prototype,t);var s=i(document.createComment(""));e.wrappers.Comment=s,e.wrappers.DocumentFragment=a}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=p(l(e).ownerDocument.createDocumentFragment());n.call(this,t),c(t,this);var o=e.shadowRoot;f.set(this,o),this.treeScope_=new r(this,a(o||e)),d.set(this,e)}var n=e.wrappers.DocumentFragment,r=e.TreeScope,o=e.elementFromPoint,i=e.getInnerHTML,a=e.getTreeScope,s=e.mixin,c=e.rewrap,u=e.setInnerHTML,l=e.unsafeUnwrap,p=e.unwrap,d=new WeakMap,f=new WeakMap,h=/[ \t\n\r\f]/;t.prototype=Object.create(n.prototype),s(t.prototype,{constructor:t,get innerHTML(){return i(this)},set innerHTML(e){u(this,e),this.invalidateShadowRenderer()},get olderShadowRoot(){return f.get(this)||null},get host(){return d.get(this)||null},invalidateShadowRenderer:function(){return d.get(this).invalidateShadowRenderer()},elementFromPoint:function(e,t){return o(this,this.ownerDocument,e,t)},getElementById:function(e){return h.test(e)?null:this.querySelector('[id="'+e+'"]')}}),e.wrappers.ShadowRoot=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){e.previousSibling_=e.previousSibling,e.nextSibling_=e.nextSibling,e.parentNode_=e.parentNode}function n(n,o,i){var a=x(n),s=x(o),c=i?x(i):null;if(r(o),t(o),i)n.firstChild===i&&(n.firstChild_=i),i.previousSibling_=i.previousSibling;else{n.lastChild_=n.lastChild,n.lastChild===n.firstChild&&(n.firstChild_=n.firstChild);var u=R(a.lastChild);u&&(u.nextSibling_=u.nextSibling)}e.originalInsertBefore.call(a,s,c)}function r(n){var r=x(n),o=r.parentNode;if(o){var i=R(o);t(n),n.previousSibling&&(n.previousSibling.nextSibling_=n),n.nextSibling&&(n.nextSibling.previousSibling_=n),i.lastChild===n&&(i.lastChild_=n),i.firstChild===n&&(i.firstChild_=n),e.originalRemoveChild.call(o,r)}}function o(e){W.set(e,[])}function i(e){var t=W.get(e);return t||W.set(e,t=[]),t}function a(e){for(var t=[],n=0,r=e.firstChild;r;r=r.nextSibling)t[n++]=r;return t}function s(){for(var e=0;e<F.length;e++){var t=F[e],n=t.parentRenderer;n&&n.dirty||t.render()}F=[]}function c(){T=null,s()}function u(e){var t=I.get(e);return t||(t=new f(e),I.set(e,t)),t}function l(e){var t=C(e).root;return t instanceof _?t:null}function p(e){return u(e.host)}function d(e){this.skip=!1,this.node=e,this.childNodes=[]}function f(e){this.host=e,this.dirty=!1,this.invalidateAttributes(),this.associateNode(e)}function h(e){for(var t=[],n=e.firstChild;n;n=n.nextSibling)E(n)?t.push.apply(t,i(n)):t.push(n);return t}function w(e){if(e instanceof j)return e;if(e instanceof L)return null;for(var t=e.firstChild;t;t=t.nextSibling){var n=w(t);if(n)return n}return null}function m(e,t){i(t).push(e);var n=A.get(e);n?n.push(t):A.set(e,[t])}function g(e){return A.get(e)}function v(e){A.set(e,void 0)}function b(e,t){var n=t.getAttribute("select");if(!n)return!0;if(n=n.trim(),!n)return!0;if(!(e instanceof O))return!1;if(!U.test(n))return!1;try{return e.matches(n)}catch(r){return!1}}function y(e,t){var n=g(t);return n&&n[n.length-1]===e}function E(e){return e instanceof L||e instanceof j}function S(e){return e.shadowRoot}function M(e){for(var t=[],n=e.shadowRoot;n;n=n.olderShadowRoot)t.push(n);return t}var T,O=e.wrappers.Element,L=e.wrappers.HTMLContentElement,j=e.wrappers.HTMLShadowElement,N=e.wrappers.Node,_=e.wrappers.ShadowRoot,C=(e.assert,e.getTreeScope),D=(e.mixin,e.oneOf),H=e.unsafeUnwrap,x=e.unwrap,R=e.wrap,P=e.ArraySplice,W=new WeakMap,A=new WeakMap,I=new WeakMap,k=D(window,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout"]),F=[],B=new P;B.equals=function(e,t){return x(e.node)===t},d.prototype={append:function(e){var t=new d(e);return this.childNodes.push(t),t},sync:function(e){if(!this.skip){for(var t=this.node,o=this.childNodes,i=a(x(t)),s=e||new WeakMap,c=B.calculateSplices(o,i),u=0,l=0,p=0,d=0;d<c.length;d++){for(var f=c[d];p<f.index;p++)l++,o[u++].sync(s);for(var h=f.removed.length,w=0;h>w;w++){var m=R(i[l++]);s.get(m)||r(m)}for(var g=f.addedCount,v=i[l]&&R(i[l]),w=0;g>w;w++){var b=o[u++],y=b.node;n(t,y,v),s.set(y,!0),b.sync(s)}p+=g}for(var d=p;d<o.length;d++)o[d].sync(s)}}},f.prototype={render:function(e){if(this.dirty){this.invalidateAttributes();var t=this.host;this.distribution(t);var n=e||new d(t);this.buildRenderTree(n,t);var r=!e;r&&n.sync(),this.dirty=!1}},get parentRenderer(){return C(this.host).renderer},invalidate:function(){if(!this.dirty){this.dirty=!0;var e=this.parentRenderer;if(e&&e.invalidate(),F.push(this),T)return;T=window[k](c,0)}},distribution:function(e){this.resetAllSubtrees(e),this.distributionResolution(e)},resetAll:function(e){E(e)?o(e):v(e),this.resetAllSubtrees(e)},resetAllSubtrees:function(e){for(var t=e.firstChild;t;t=t.nextSibling)this.resetAll(t);e.shadowRoot&&this.resetAll(e.shadowRoot),e.olderShadowRoot&&this.resetAll(e.olderShadowRoot)},distributionResolution:function(e){if(S(e)){for(var t=e,n=h(t),r=M(t),o=0;o<r.length;o++)this.poolDistribution(r[o],n);for(var o=r.length-1;o>=0;o--){var i=r[o],a=w(i);if(a){var s=i.olderShadowRoot;s&&(n=h(s));for(var c=0;c<n.length;c++)m(n[c],a)}this.distributionResolution(i)}}for(var u=e.firstChild;u;u=u.nextSibling)this.distributionResolution(u)},poolDistribution:function(e,t){if(!(e instanceof j))if(e instanceof L){var n=e;this.updateDependentAttributes(n.getAttribute("select"));for(var r=!1,o=0;o<t.length;o++){var e=t[o];e&&b(e,n)&&(m(e,n),t[o]=void 0,r=!0)}if(!r)for(var i=n.firstChild;i;i=i.nextSibling)m(i,n)}else for(var i=e.firstChild;i;i=i.nextSibling)this.poolDistribution(i,t)},buildRenderTree:function(e,t){for(var n=this.compose(t),r=0;r<n.length;r++){var o=n[r],i=e.append(o);this.buildRenderTree(i,o)}if(S(t)){var a=u(t);a.dirty=!1}},compose:function(e){for(var t=[],n=e.shadowRoot||e,r=n.firstChild;r;r=r.nextSibling)if(E(r)){this.associateNode(n);for(var o=i(r),a=0;a<o.length;a++){var s=o[a];y(r,s)&&t.push(s)}}else t.push(r);return t},invalidateAttributes:function(){this.attributes=Object.create(null)},updateDependentAttributes:function(e){if(e){var t=this.attributes;/\.\w+/.test(e)&&(t["class"]=!0),/#\w+/.test(e)&&(t.id=!0),e.replace(/\[\s*([^\s=\|~\]]+)/g,function(e,n){t[n]=!0})}},dependsOnAttribute:function(e){return this.attributes[e]},associateNode:function(e){H(e).polymerShadowRenderer_=this}};var U=/^(:not\()?[*.#[a-zA-Z_|]/;N.prototype.invalidateShadowRenderer=function(){var e=H(this).polymerShadowRenderer_;return e?(e.invalidate(),!0):!1},L.prototype.getDistributedNodes=j.prototype.getDistributedNodes=function(){return s(),i(this)},O.prototype.getDestinationInsertionPoints=function(){return s(),g(this)||[]},L.prototype.nodeIsInserted_=j.prototype.nodeIsInserted_=function(){this.invalidateShadowRenderer();var e,t=l(this);t&&(e=p(t)),H(this).polymerShadowRenderer_=e,e&&e.invalidate()},e.getRendererForHost=u,e.getShadowTrees=M,e.renderAllPending=s,e.getDestinationInsertionPoints=g,e.visual={insertBefore:n,remove:r}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(t){if(window[t]){r(!e.wrappers[t]);var c=function(e){n.call(this,e)};c.prototype=Object.create(n.prototype),o(c.prototype,{get form(){return s(a(this).form)}}),i(window[t],c,document.createElement(t.slice(4,-7))),e.wrappers[t]=c}}var n=e.wrappers.HTMLElement,r=e.assert,o=e.mixin,i=e.registerWrapper,a=e.unwrap,s=e.wrap,c=["HTMLButtonElement","HTMLFieldSetElement","HTMLInputElement","HTMLKeygenElement","HTMLLabelElement","HTMLLegendElement","HTMLObjectElement","HTMLOutputElement","HTMLTextAreaElement"];c.forEach(t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r(e,this)}{var n=e.registerWrapper,r=e.setWrapper,o=e.unsafeUnwrap,i=e.unwrap,a=e.unwrapIfNeeded,s=e.wrap;window.Selection}t.prototype={get anchorNode(){return s(o(this).anchorNode)},get focusNode(){return s(o(this).focusNode)},addRange:function(e){o(this).addRange(i(e))},collapse:function(e,t){o(this).collapse(a(e),t)},containsNode:function(e,t){return o(this).containsNode(a(e),t)},extend:function(e,t){o(this).extend(a(e),t)},getRangeAt:function(e){return s(o(this).getRangeAt(e))},removeRange:function(e){o(this).removeRange(i(e))},selectAllChildren:function(e){o(this).selectAllChildren(a(e))},toString:function(){return o(this).toString()}},n(window.Selection,t,window.getSelection()),e.wrappers.Selection=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){l.call(this,e),this.treeScope_=new w(this,null)}function n(e){var n=document[e];t.prototype[e]=function(){return N(n.apply(L(this),arguments))}}function r(e,t){D.call(L(t),j(e)),o(e,t)}function o(e,t){e.shadowRoot&&t.adoptNode(e.shadowRoot),e instanceof h&&i(e,t);for(var n=e.firstChild;n;n=n.nextSibling)o(n,t)}function i(e,t){var n=e.olderShadowRoot;n&&t.adoptNode(n)}function a(e){O(e,this)}function s(e,t){var n=document.implementation[t];e.prototype[t]=function(){return N(n.apply(L(this),arguments))}}function c(e,t){var n=document.implementation[t];e.prototype[t]=function(){return n.apply(L(this),arguments)}}var u=e.GetElementsByInterface,l=e.wrappers.Node,p=e.ParentNodeInterface,d=e.wrappers.Selection,f=e.SelectorsInterface,h=e.wrappers.ShadowRoot,w=e.TreeScope,m=e.cloneNode,g=e.defineWrapGetter,v=e.elementFromPoint,b=e.forwardMethodsToWrapper,y=e.matchesNames,E=e.mixin,S=e.registerWrapper,M=e.renderAllPending,T=e.rewrap,O=e.setWrapper,L=e.unsafeUnwrap,j=e.unwrap,N=e.wrap,_=e.wrapEventTargetMethods,C=(e.wrapNodeList,new WeakMap);t.prototype=Object.create(l.prototype),g(t,"documentElement"),g(t,"body"),g(t,"head"),["createComment","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createRange","createTextNode","getElementById"].forEach(n);var D=document.adoptNode,H=document.getSelection;if(E(t.prototype,{adoptNode:function(e){return e.parentNode&&e.parentNode.removeChild(e),r(e,this),e},elementFromPoint:function(e,t){return v(this,this,e,t)},importNode:function(e,t){return m(e,t,L(this))},getSelection:function(){return M(),new d(H.call(j(this)))},getElementsByName:function(e){return f.querySelectorAll.call(this,"[name="+JSON.stringify(String(e))+"]")}}),document.registerElement){var x=document.registerElement;t.prototype.registerElement=function(t,n){function r(e){return e?void O(e,this):i?document.createElement(i,t):document.createElement(t)}var o,i;if(void 0!==n&&(o=n.prototype,i=n["extends"]),o||(o=Object.create(HTMLElement.prototype)),e.nativePrototypeTable.get(o))throw new Error("NotSupportedError");for(var a,s=Object.getPrototypeOf(o),c=[];s&&!(a=e.nativePrototypeTable.get(s));)c.push(s),s=Object.getPrototypeOf(s);if(!a)throw new Error("NotSupportedError");for(var u=Object.create(a),l=c.length-1;l>=0;l--)u=Object.create(u);["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"].forEach(function(e){var t=o[e];t&&(u[e]=function(){N(this)instanceof r||T(this),t.apply(N(this),arguments)})});var p={prototype:u};i&&(p["extends"]=i),r.prototype=o,r.prototype.constructor=r,e.constructorTable.set(u,r),e.nativePrototypeTable.set(o,u);x.call(j(this),t,p);return r},b([window.HTMLDocument||window.Document],["registerElement"])}b([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement,window.HTMLHtmlElement],["appendChild","compareDocumentPosition","contains","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","insertBefore","querySelector","querySelectorAll","removeChild","replaceChild"]),b([window.HTMLBodyElement,window.HTMLHeadElement,window.HTMLHtmlElement],y),b([window.HTMLDocument||window.Document],["adoptNode","importNode","contains","createComment","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createRange","createTextNode","elementFromPoint","getElementById","getElementsByName","getSelection"]),E(t.prototype,u),E(t.prototype,p),E(t.prototype,f),E(t.prototype,{get implementation(){var e=C.get(this);return e?e:(e=new a(j(this).implementation),C.set(this,e),e)},get defaultView(){return N(j(this).defaultView)}}),S(window.Document,t,document.implementation.createHTMLDocument("")),window.HTMLDocument&&S(window.HTMLDocument,t),_([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement]),s(a,"createDocumentType"),s(a,"createDocument"),s(a,"createHTMLDocument"),c(a,"hasFeature"),S(window.DOMImplementation,a),b([window.DOMImplementation],["createDocumentType","createDocument","createHTMLDocument","hasFeature"]),e.adoptNodeNoRemove=r,e.wrappers.DOMImplementation=a,e.wrappers.Document=t
13
+ }(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.wrappers.Selection,o=e.mixin,i=e.registerWrapper,a=e.renderAllPending,s=e.unwrap,c=e.unwrapIfNeeded,u=e.wrap,l=window.Window,p=window.getComputedStyle,d=window.getDefaultComputedStyle,f=window.getSelection;t.prototype=Object.create(n.prototype),l.prototype.getComputedStyle=function(e,t){return u(this||window).getComputedStyle(c(e),t)},d&&(l.prototype.getDefaultComputedStyle=function(e,t){return u(this||window).getDefaultComputedStyle(c(e),t)}),l.prototype.getSelection=function(){return u(this||window).getSelection()},delete window.getComputedStyle,delete window.getDefaultComputedStyle,delete window.getSelection,["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){l.prototype[e]=function(){var t=u(this||window);return t[e].apply(t,arguments)},delete window[e]}),o(t.prototype,{getComputedStyle:function(e,t){return a(),p.call(s(this),c(e),t)},getSelection:function(){return a(),new r(f.call(s(this)))},get document(){return u(s(this).document)}}),d&&(t.prototype.getDefaultComputedStyle=function(e,t){return a(),d.call(s(this),c(e),t)}),i(l,t,window),e.wrappers.Window=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.unwrap,n=window.DataTransfer||window.Clipboard,r=n.prototype.setDragImage;r&&(n.prototype.setDragImage=function(e,n,o){r.call(this,t(e),n,o)})}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t;t=e instanceof i?e:new i(e&&o(e)),r(t,this)}var n=e.registerWrapper,r=e.setWrapper,o=e.unwrap,i=window.FormData;i&&(n(i,t,new i),e.wrappers.FormData=t)}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.unwrapIfNeeded,n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){return n.call(this,t(e))}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=n[e],r=window[t];if(r){var o=document.createElement(e),i=o.constructor;window[t]=i}}var n=(e.isWrapperFor,{a:"HTMLAnchorElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",base:"HTMLBaseElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",col:"HTMLTableColElement",content:"HTMLContentElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",del:"HTMLModElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",head:"HTMLHeadElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuItemElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",shadow:"HTMLShadowElement",source:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",ul:"HTMLUListElement",video:"HTMLVideoElement"});Object.keys(n).forEach(t),Object.getOwnPropertyNames(e.wrappers).forEach(function(t){window[t]=e.wrappers[t]})}(window.ShadowDOMPolyfill);
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "webcomponents.js",
3
+ "version": "0.5.5",
4
+ "description": "webcomponents.js",
5
+ "main": "webcomponents.js",
6
+ "directories": {
7
+ "test": "tests"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/webcomponents/webcomponentsjs.git"
12
+ },
13
+ "author": "The Polymer Authors",
14
+ "license": {
15
+ "type": "BSD-3-Clause",
16
+ "url": "http://polymer.github.io/LICENSE.txt"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/webcomponents/webcomponentsjs/issues"
20
+ },
21
+ "homepage": "http://webcomponents.org",
22
+ "devDependencies": {
23
+ "gulp": "^3.8.8",
24
+ "gulp-audit": "^1.0.0",
25
+ "gulp-concat": "^2.4.1",
26
+ "gulp-header": "^1.1.1",
27
+ "gulp-uglify": "^1.0.1",
28
+ "run-sequence": "^1.0.1",
29
+ "web-component-tester": "*"
30
+ }
31
+ }
@@ -0,0 +1,1728 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ * Code distributed by Google as part of the polymer project is also
8
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ */
10
+ // @version 0.5.5
11
+ window.WebComponents = window.WebComponents || {};
12
+
13
+ (function(scope) {
14
+ var flags = scope.flags || {};
15
+ var file = "webcomponents.js";
16
+ var script = document.querySelector('script[src*="' + file + '"]');
17
+ if (!flags.noOpts) {
18
+ location.search.slice(1).split("&").forEach(function(o) {
19
+ o = o.split("=");
20
+ o[0] && (flags[o[0]] = o[1] || true);
21
+ });
22
+ if (script) {
23
+ for (var i = 0, a; a = script.attributes[i]; i++) {
24
+ if (a.name !== "src") {
25
+ flags[a.name] = a.value || true;
26
+ }
27
+ }
28
+ }
29
+ if (flags.log) {
30
+ var parts = flags.log.split(",");
31
+ flags.log = {};
32
+ parts.forEach(function(f) {
33
+ flags.log[f] = true;
34
+ });
35
+ } else {
36
+ flags.log = {};
37
+ }
38
+ }
39
+ flags.shadow = flags.shadow || flags.shadowdom || flags.polyfill;
40
+ if (flags.shadow === "native") {
41
+ flags.shadow = false;
42
+ } else {
43
+ flags.shadow = flags.shadow || !HTMLElement.prototype.createShadowRoot;
44
+ }
45
+ if (flags.register) {
46
+ window.CustomElements = window.CustomElements || {
47
+ flags: {}
48
+ };
49
+ window.CustomElements.flags.register = flags.register;
50
+ }
51
+ scope.flags = flags;
52
+ })(WebComponents);
53
+
54
+ (function(global) {
55
+ var registrationsTable = new WeakMap();
56
+ var setImmediate;
57
+ if (/Trident|Edge/.test(navigator.userAgent)) {
58
+ setImmediate = setTimeout;
59
+ } else if (window.setImmediate) {
60
+ setImmediate = window.setImmediate;
61
+ } else {
62
+ var setImmediateQueue = [];
63
+ var sentinel = String(Math.random());
64
+ window.addEventListener("message", function(e) {
65
+ if (e.data === sentinel) {
66
+ var queue = setImmediateQueue;
67
+ setImmediateQueue = [];
68
+ queue.forEach(function(func) {
69
+ func();
70
+ });
71
+ }
72
+ });
73
+ setImmediate = function(func) {
74
+ setImmediateQueue.push(func);
75
+ window.postMessage(sentinel, "*");
76
+ };
77
+ }
78
+ var isScheduled = false;
79
+ var scheduledObservers = [];
80
+ function scheduleCallback(observer) {
81
+ scheduledObservers.push(observer);
82
+ if (!isScheduled) {
83
+ isScheduled = true;
84
+ setImmediate(dispatchCallbacks);
85
+ }
86
+ }
87
+ function wrapIfNeeded(node) {
88
+ return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
89
+ }
90
+ function dispatchCallbacks() {
91
+ isScheduled = false;
92
+ var observers = scheduledObservers;
93
+ scheduledObservers = [];
94
+ observers.sort(function(o1, o2) {
95
+ return o1.uid_ - o2.uid_;
96
+ });
97
+ var anyNonEmpty = false;
98
+ observers.forEach(function(observer) {
99
+ var queue = observer.takeRecords();
100
+ removeTransientObserversFor(observer);
101
+ if (queue.length) {
102
+ observer.callback_(queue, observer);
103
+ anyNonEmpty = true;
104
+ }
105
+ });
106
+ if (anyNonEmpty) dispatchCallbacks();
107
+ }
108
+ function removeTransientObserversFor(observer) {
109
+ observer.nodes_.forEach(function(node) {
110
+ var registrations = registrationsTable.get(node);
111
+ if (!registrations) return;
112
+ registrations.forEach(function(registration) {
113
+ if (registration.observer === observer) registration.removeTransientObservers();
114
+ });
115
+ });
116
+ }
117
+ function forEachAncestorAndObserverEnqueueRecord(target, callback) {
118
+ for (var node = target; node; node = node.parentNode) {
119
+ var registrations = registrationsTable.get(node);
120
+ if (registrations) {
121
+ for (var j = 0; j < registrations.length; j++) {
122
+ var registration = registrations[j];
123
+ var options = registration.options;
124
+ if (node !== target && !options.subtree) continue;
125
+ var record = callback(options);
126
+ if (record) registration.enqueue(record);
127
+ }
128
+ }
129
+ }
130
+ }
131
+ var uidCounter = 0;
132
+ function JsMutationObserver(callback) {
133
+ this.callback_ = callback;
134
+ this.nodes_ = [];
135
+ this.records_ = [];
136
+ this.uid_ = ++uidCounter;
137
+ }
138
+ JsMutationObserver.prototype = {
139
+ observe: function(target, options) {
140
+ target = wrapIfNeeded(target);
141
+ if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
142
+ throw new SyntaxError();
143
+ }
144
+ var registrations = registrationsTable.get(target);
145
+ if (!registrations) registrationsTable.set(target, registrations = []);
146
+ var registration;
147
+ for (var i = 0; i < registrations.length; i++) {
148
+ if (registrations[i].observer === this) {
149
+ registration = registrations[i];
150
+ registration.removeListeners();
151
+ registration.options = options;
152
+ break;
153
+ }
154
+ }
155
+ if (!registration) {
156
+ registration = new Registration(this, target, options);
157
+ registrations.push(registration);
158
+ this.nodes_.push(target);
159
+ }
160
+ registration.addListeners();
161
+ },
162
+ disconnect: function() {
163
+ this.nodes_.forEach(function(node) {
164
+ var registrations = registrationsTable.get(node);
165
+ for (var i = 0; i < registrations.length; i++) {
166
+ var registration = registrations[i];
167
+ if (registration.observer === this) {
168
+ registration.removeListeners();
169
+ registrations.splice(i, 1);
170
+ break;
171
+ }
172
+ }
173
+ }, this);
174
+ this.records_ = [];
175
+ },
176
+ takeRecords: function() {
177
+ var copyOfRecords = this.records_;
178
+ this.records_ = [];
179
+ return copyOfRecords;
180
+ }
181
+ };
182
+ function MutationRecord(type, target) {
183
+ this.type = type;
184
+ this.target = target;
185
+ this.addedNodes = [];
186
+ this.removedNodes = [];
187
+ this.previousSibling = null;
188
+ this.nextSibling = null;
189
+ this.attributeName = null;
190
+ this.attributeNamespace = null;
191
+ this.oldValue = null;
192
+ }
193
+ function copyMutationRecord(original) {
194
+ var record = new MutationRecord(original.type, original.target);
195
+ record.addedNodes = original.addedNodes.slice();
196
+ record.removedNodes = original.removedNodes.slice();
197
+ record.previousSibling = original.previousSibling;
198
+ record.nextSibling = original.nextSibling;
199
+ record.attributeName = original.attributeName;
200
+ record.attributeNamespace = original.attributeNamespace;
201
+ record.oldValue = original.oldValue;
202
+ return record;
203
+ }
204
+ var currentRecord, recordWithOldValue;
205
+ function getRecord(type, target) {
206
+ return currentRecord = new MutationRecord(type, target);
207
+ }
208
+ function getRecordWithOldValue(oldValue) {
209
+ if (recordWithOldValue) return recordWithOldValue;
210
+ recordWithOldValue = copyMutationRecord(currentRecord);
211
+ recordWithOldValue.oldValue = oldValue;
212
+ return recordWithOldValue;
213
+ }
214
+ function clearRecords() {
215
+ currentRecord = recordWithOldValue = undefined;
216
+ }
217
+ function recordRepresentsCurrentMutation(record) {
218
+ return record === recordWithOldValue || record === currentRecord;
219
+ }
220
+ function selectRecord(lastRecord, newRecord) {
221
+ if (lastRecord === newRecord) return lastRecord;
222
+ if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
223
+ return null;
224
+ }
225
+ function Registration(observer, target, options) {
226
+ this.observer = observer;
227
+ this.target = target;
228
+ this.options = options;
229
+ this.transientObservedNodes = [];
230
+ }
231
+ Registration.prototype = {
232
+ enqueue: function(record) {
233
+ var records = this.observer.records_;
234
+ var length = records.length;
235
+ if (records.length > 0) {
236
+ var lastRecord = records[length - 1];
237
+ var recordToReplaceLast = selectRecord(lastRecord, record);
238
+ if (recordToReplaceLast) {
239
+ records[length - 1] = recordToReplaceLast;
240
+ return;
241
+ }
242
+ } else {
243
+ scheduleCallback(this.observer);
244
+ }
245
+ records[length] = record;
246
+ },
247
+ addListeners: function() {
248
+ this.addListeners_(this.target);
249
+ },
250
+ addListeners_: function(node) {
251
+ var options = this.options;
252
+ if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
253
+ if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
254
+ if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
255
+ if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
256
+ },
257
+ removeListeners: function() {
258
+ this.removeListeners_(this.target);
259
+ },
260
+ removeListeners_: function(node) {
261
+ var options = this.options;
262
+ if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
263
+ if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
264
+ if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
265
+ if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
266
+ },
267
+ addTransientObserver: function(node) {
268
+ if (node === this.target) return;
269
+ this.addListeners_(node);
270
+ this.transientObservedNodes.push(node);
271
+ var registrations = registrationsTable.get(node);
272
+ if (!registrations) registrationsTable.set(node, registrations = []);
273
+ registrations.push(this);
274
+ },
275
+ removeTransientObservers: function() {
276
+ var transientObservedNodes = this.transientObservedNodes;
277
+ this.transientObservedNodes = [];
278
+ transientObservedNodes.forEach(function(node) {
279
+ this.removeListeners_(node);
280
+ var registrations = registrationsTable.get(node);
281
+ for (var i = 0; i < registrations.length; i++) {
282
+ if (registrations[i] === this) {
283
+ registrations.splice(i, 1);
284
+ break;
285
+ }
286
+ }
287
+ }, this);
288
+ },
289
+ handleEvent: function(e) {
290
+ e.stopImmediatePropagation();
291
+ switch (e.type) {
292
+ case "DOMAttrModified":
293
+ var name = e.attrName;
294
+ var namespace = e.relatedNode.namespaceURI;
295
+ var target = e.target;
296
+ var record = new getRecord("attributes", target);
297
+ record.attributeName = name;
298
+ record.attributeNamespace = namespace;
299
+ var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
300
+ forEachAncestorAndObserverEnqueueRecord(target, function(options) {
301
+ if (!options.attributes) return;
302
+ if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
303
+ return;
304
+ }
305
+ if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
306
+ return record;
307
+ });
308
+ break;
309
+
310
+ case "DOMCharacterDataModified":
311
+ var target = e.target;
312
+ var record = getRecord("characterData", target);
313
+ var oldValue = e.prevValue;
314
+ forEachAncestorAndObserverEnqueueRecord(target, function(options) {
315
+ if (!options.characterData) return;
316
+ if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
317
+ return record;
318
+ });
319
+ break;
320
+
321
+ case "DOMNodeRemoved":
322
+ this.addTransientObserver(e.target);
323
+
324
+ case "DOMNodeInserted":
325
+ var changedNode = e.target;
326
+ var addedNodes, removedNodes;
327
+ if (e.type === "DOMNodeInserted") {
328
+ addedNodes = [ changedNode ];
329
+ removedNodes = [];
330
+ } else {
331
+ addedNodes = [];
332
+ removedNodes = [ changedNode ];
333
+ }
334
+ var previousSibling = changedNode.previousSibling;
335
+ var nextSibling = changedNode.nextSibling;
336
+ var record = getRecord("childList", e.target.parentNode);
337
+ record.addedNodes = addedNodes;
338
+ record.removedNodes = removedNodes;
339
+ record.previousSibling = previousSibling;
340
+ record.nextSibling = nextSibling;
341
+ forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
342
+ if (!options.childList) return;
343
+ return record;
344
+ });
345
+ }
346
+ clearRecords();
347
+ }
348
+ };
349
+ global.JsMutationObserver = JsMutationObserver;
350
+ if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
351
+ })(this);
352
+
353
+ if (typeof WeakMap === "undefined") {
354
+ (function() {
355
+ var defineProperty = Object.defineProperty;
356
+ var counter = Date.now() % 1e9;
357
+ var WeakMap = function() {
358
+ this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
359
+ };
360
+ WeakMap.prototype = {
361
+ set: function(key, value) {
362
+ var entry = key[this.name];
363
+ if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
364
+ value: [ key, value ],
365
+ writable: true
366
+ });
367
+ return this;
368
+ },
369
+ get: function(key) {
370
+ var entry;
371
+ return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
372
+ },
373
+ "delete": function(key) {
374
+ var entry = key[this.name];
375
+ if (!entry || entry[0] !== key) return false;
376
+ entry[0] = entry[1] = undefined;
377
+ return true;
378
+ },
379
+ has: function(key) {
380
+ var entry = key[this.name];
381
+ if (!entry) return false;
382
+ return entry[0] === key;
383
+ }
384
+ };
385
+ window.WeakMap = WeakMap;
386
+ })();
387
+ }
388
+
389
+ window.HTMLImports = window.HTMLImports || {
390
+ flags: {}
391
+ };
392
+
393
+ (function(scope) {
394
+ var IMPORT_LINK_TYPE = "import";
395
+ var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link"));
396
+ var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);
397
+ var wrap = function(node) {
398
+ return hasShadowDOMPolyfill ? ShadowDOMPolyfill.wrapIfNeeded(node) : node;
399
+ };
400
+ var rootDocument = wrap(document);
401
+ var currentScriptDescriptor = {
402
+ get: function() {
403
+ var script = HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null);
404
+ return wrap(script);
405
+ },
406
+ configurable: true
407
+ };
408
+ Object.defineProperty(document, "_currentScript", currentScriptDescriptor);
409
+ Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor);
410
+ var isIE = /Trident|Edge/.test(navigator.userAgent);
411
+ function whenReady(callback, doc) {
412
+ doc = doc || rootDocument;
413
+ whenDocumentReady(function() {
414
+ watchImportsLoad(callback, doc);
415
+ }, doc);
416
+ }
417
+ var requiredReadyState = isIE ? "complete" : "interactive";
418
+ var READY_EVENT = "readystatechange";
419
+ function isDocumentReady(doc) {
420
+ return doc.readyState === "complete" || doc.readyState === requiredReadyState;
421
+ }
422
+ function whenDocumentReady(callback, doc) {
423
+ if (!isDocumentReady(doc)) {
424
+ var checkReady = function() {
425
+ if (doc.readyState === "complete" || doc.readyState === requiredReadyState) {
426
+ doc.removeEventListener(READY_EVENT, checkReady);
427
+ whenDocumentReady(callback, doc);
428
+ }
429
+ };
430
+ doc.addEventListener(READY_EVENT, checkReady);
431
+ } else if (callback) {
432
+ callback();
433
+ }
434
+ }
435
+ function markTargetLoaded(event) {
436
+ event.target.__loaded = true;
437
+ }
438
+ function watchImportsLoad(callback, doc) {
439
+ var imports = doc.querySelectorAll("link[rel=import]");
440
+ var loaded = 0, l = imports.length;
441
+ function checkDone(d) {
442
+ if (loaded == l && callback) {
443
+ callback();
444
+ }
445
+ }
446
+ function loadedImport(e) {
447
+ markTargetLoaded(e);
448
+ loaded++;
449
+ checkDone();
450
+ }
451
+ if (l) {
452
+ for (var i = 0, imp; i < l && (imp = imports[i]); i++) {
453
+ if (isImportLoaded(imp)) {
454
+ loadedImport.call(imp, {
455
+ target: imp
456
+ });
457
+ } else {
458
+ imp.addEventListener("load", loadedImport);
459
+ imp.addEventListener("error", loadedImport);
460
+ }
461
+ }
462
+ } else {
463
+ checkDone();
464
+ }
465
+ }
466
+ function isImportLoaded(link) {
467
+ return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed;
468
+ }
469
+ if (useNative) {
470
+ new MutationObserver(function(mxns) {
471
+ for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) {
472
+ if (m.addedNodes) {
473
+ handleImports(m.addedNodes);
474
+ }
475
+ }
476
+ }).observe(document.head, {
477
+ childList: true
478
+ });
479
+ function handleImports(nodes) {
480
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
481
+ if (isImport(n)) {
482
+ handleImport(n);
483
+ }
484
+ }
485
+ }
486
+ function isImport(element) {
487
+ return element.localName === "link" && element.rel === "import";
488
+ }
489
+ function handleImport(element) {
490
+ var loaded = element.import;
491
+ if (loaded) {
492
+ markTargetLoaded({
493
+ target: element
494
+ });
495
+ } else {
496
+ element.addEventListener("load", markTargetLoaded);
497
+ element.addEventListener("error", markTargetLoaded);
498
+ }
499
+ }
500
+ (function() {
501
+ if (document.readyState === "loading") {
502
+ var imports = document.querySelectorAll("link[rel=import]");
503
+ for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) {
504
+ handleImport(imp);
505
+ }
506
+ }
507
+ })();
508
+ }
509
+ whenReady(function() {
510
+ HTMLImports.ready = true;
511
+ HTMLImports.readyTime = new Date().getTime();
512
+ var evt = rootDocument.createEvent("CustomEvent");
513
+ evt.initCustomEvent("HTMLImportsLoaded", true, true, {});
514
+ rootDocument.dispatchEvent(evt);
515
+ });
516
+ scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;
517
+ scope.useNative = useNative;
518
+ scope.rootDocument = rootDocument;
519
+ scope.whenReady = whenReady;
520
+ scope.isIE = isIE;
521
+ })(HTMLImports);
522
+
523
+ (function(scope) {
524
+ var modules = [];
525
+ var addModule = function(module) {
526
+ modules.push(module);
527
+ };
528
+ var initializeModules = function() {
529
+ modules.forEach(function(module) {
530
+ module(scope);
531
+ });
532
+ };
533
+ scope.addModule = addModule;
534
+ scope.initializeModules = initializeModules;
535
+ })(HTMLImports);
536
+
537
+ HTMLImports.addModule(function(scope) {
538
+ var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g;
539
+ var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g;
540
+ var path = {
541
+ resolveUrlsInStyle: function(style) {
542
+ var doc = style.ownerDocument;
543
+ var resolver = doc.createElement("a");
544
+ style.textContent = this.resolveUrlsInCssText(style.textContent, resolver);
545
+ return style;
546
+ },
547
+ resolveUrlsInCssText: function(cssText, urlObj) {
548
+ var r = this.replaceUrls(cssText, urlObj, CSS_URL_REGEXP);
549
+ r = this.replaceUrls(r, urlObj, CSS_IMPORT_REGEXP);
550
+ return r;
551
+ },
552
+ replaceUrls: function(text, urlObj, regexp) {
553
+ return text.replace(regexp, function(m, pre, url, post) {
554
+ var urlPath = url.replace(/["']/g, "");
555
+ urlObj.href = urlPath;
556
+ urlPath = urlObj.href;
557
+ return pre + "'" + urlPath + "'" + post;
558
+ });
559
+ }
560
+ };
561
+ scope.path = path;
562
+ });
563
+
564
+ HTMLImports.addModule(function(scope) {
565
+ var xhr = {
566
+ async: true,
567
+ ok: function(request) {
568
+ return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0;
569
+ },
570
+ load: function(url, next, nextContext) {
571
+ var request = new XMLHttpRequest();
572
+ if (scope.flags.debug || scope.flags.bust) {
573
+ url += "?" + Math.random();
574
+ }
575
+ request.open("GET", url, xhr.async);
576
+ request.addEventListener("readystatechange", function(e) {
577
+ if (request.readyState === 4) {
578
+ var locationHeader = request.getResponseHeader("Location");
579
+ var redirectedUrl = null;
580
+ if (locationHeader) {
581
+ var redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
582
+ }
583
+ next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
584
+ }
585
+ });
586
+ request.send();
587
+ return request;
588
+ },
589
+ loadDocument: function(url, next, nextContext) {
590
+ this.load(url, next, nextContext).responseType = "document";
591
+ }
592
+ };
593
+ scope.xhr = xhr;
594
+ });
595
+
596
+ HTMLImports.addModule(function(scope) {
597
+ var xhr = scope.xhr;
598
+ var flags = scope.flags;
599
+ var Loader = function(onLoad, onComplete) {
600
+ this.cache = {};
601
+ this.onload = onLoad;
602
+ this.oncomplete = onComplete;
603
+ this.inflight = 0;
604
+ this.pending = {};
605
+ };
606
+ Loader.prototype = {
607
+ addNodes: function(nodes) {
608
+ this.inflight += nodes.length;
609
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
610
+ this.require(n);
611
+ }
612
+ this.checkDone();
613
+ },
614
+ addNode: function(node) {
615
+ this.inflight++;
616
+ this.require(node);
617
+ this.checkDone();
618
+ },
619
+ require: function(elt) {
620
+ var url = elt.src || elt.href;
621
+ elt.__nodeUrl = url;
622
+ if (!this.dedupe(url, elt)) {
623
+ this.fetch(url, elt);
624
+ }
625
+ },
626
+ dedupe: function(url, elt) {
627
+ if (this.pending[url]) {
628
+ this.pending[url].push(elt);
629
+ return true;
630
+ }
631
+ var resource;
632
+ if (this.cache[url]) {
633
+ this.onload(url, elt, this.cache[url]);
634
+ this.tail();
635
+ return true;
636
+ }
637
+ this.pending[url] = [ elt ];
638
+ return false;
639
+ },
640
+ fetch: function(url, elt) {
641
+ flags.load && console.log("fetch", url, elt);
642
+ if (!url) {
643
+ setTimeout(function() {
644
+ this.receive(url, elt, {
645
+ error: "href must be specified"
646
+ }, null);
647
+ }.bind(this), 0);
648
+ } else if (url.match(/^data:/)) {
649
+ var pieces = url.split(",");
650
+ var header = pieces[0];
651
+ var body = pieces[1];
652
+ if (header.indexOf(";base64") > -1) {
653
+ body = atob(body);
654
+ } else {
655
+ body = decodeURIComponent(body);
656
+ }
657
+ setTimeout(function() {
658
+ this.receive(url, elt, null, body);
659
+ }.bind(this), 0);
660
+ } else {
661
+ var receiveXhr = function(err, resource, redirectedUrl) {
662
+ this.receive(url, elt, err, resource, redirectedUrl);
663
+ }.bind(this);
664
+ xhr.load(url, receiveXhr);
665
+ }
666
+ },
667
+ receive: function(url, elt, err, resource, redirectedUrl) {
668
+ this.cache[url] = resource;
669
+ var $p = this.pending[url];
670
+ for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
671
+ this.onload(url, p, resource, err, redirectedUrl);
672
+ this.tail();
673
+ }
674
+ this.pending[url] = null;
675
+ },
676
+ tail: function() {
677
+ --this.inflight;
678
+ this.checkDone();
679
+ },
680
+ checkDone: function() {
681
+ if (!this.inflight) {
682
+ this.oncomplete();
683
+ }
684
+ }
685
+ };
686
+ scope.Loader = Loader;
687
+ });
688
+
689
+ HTMLImports.addModule(function(scope) {
690
+ var Observer = function(addCallback) {
691
+ this.addCallback = addCallback;
692
+ this.mo = new MutationObserver(this.handler.bind(this));
693
+ };
694
+ Observer.prototype = {
695
+ handler: function(mutations) {
696
+ for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) {
697
+ if (m.type === "childList" && m.addedNodes.length) {
698
+ this.addedNodes(m.addedNodes);
699
+ }
700
+ }
701
+ },
702
+ addedNodes: function(nodes) {
703
+ if (this.addCallback) {
704
+ this.addCallback(nodes);
705
+ }
706
+ for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) {
707
+ if (n.children && n.children.length) {
708
+ this.addedNodes(n.children);
709
+ }
710
+ }
711
+ },
712
+ observe: function(root) {
713
+ this.mo.observe(root, {
714
+ childList: true,
715
+ subtree: true
716
+ });
717
+ }
718
+ };
719
+ scope.Observer = Observer;
720
+ });
721
+
722
+ HTMLImports.addModule(function(scope) {
723
+ var path = scope.path;
724
+ var rootDocument = scope.rootDocument;
725
+ var flags = scope.flags;
726
+ var isIE = scope.isIE;
727
+ var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
728
+ var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]";
729
+ var importParser = {
730
+ documentSelectors: IMPORT_SELECTOR,
731
+ importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]", "style", "script:not([type])", 'script[type="text/javascript"]' ].join(","),
732
+ map: {
733
+ link: "parseLink",
734
+ script: "parseScript",
735
+ style: "parseStyle"
736
+ },
737
+ dynamicElements: [],
738
+ parseNext: function() {
739
+ var next = this.nextToParse();
740
+ if (next) {
741
+ this.parse(next);
742
+ }
743
+ },
744
+ parse: function(elt) {
745
+ if (this.isParsed(elt)) {
746
+ flags.parse && console.log("[%s] is already parsed", elt.localName);
747
+ return;
748
+ }
749
+ var fn = this[this.map[elt.localName]];
750
+ if (fn) {
751
+ this.markParsing(elt);
752
+ fn.call(this, elt);
753
+ }
754
+ },
755
+ parseDynamic: function(elt, quiet) {
756
+ this.dynamicElements.push(elt);
757
+ if (!quiet) {
758
+ this.parseNext();
759
+ }
760
+ },
761
+ markParsing: function(elt) {
762
+ flags.parse && console.log("parsing", elt);
763
+ this.parsingElement = elt;
764
+ },
765
+ markParsingComplete: function(elt) {
766
+ elt.__importParsed = true;
767
+ this.markDynamicParsingComplete(elt);
768
+ if (elt.__importElement) {
769
+ elt.__importElement.__importParsed = true;
770
+ this.markDynamicParsingComplete(elt.__importElement);
771
+ }
772
+ this.parsingElement = null;
773
+ flags.parse && console.log("completed", elt);
774
+ },
775
+ markDynamicParsingComplete: function(elt) {
776
+ var i = this.dynamicElements.indexOf(elt);
777
+ if (i >= 0) {
778
+ this.dynamicElements.splice(i, 1);
779
+ }
780
+ },
781
+ parseImport: function(elt) {
782
+ if (HTMLImports.__importsParsingHook) {
783
+ HTMLImports.__importsParsingHook(elt);
784
+ }
785
+ if (elt.import) {
786
+ elt.import.__importParsed = true;
787
+ }
788
+ this.markParsingComplete(elt);
789
+ if (elt.__resource && !elt.__error) {
790
+ elt.dispatchEvent(new CustomEvent("load", {
791
+ bubbles: false
792
+ }));
793
+ } else {
794
+ elt.dispatchEvent(new CustomEvent("error", {
795
+ bubbles: false
796
+ }));
797
+ }
798
+ if (elt.__pending) {
799
+ var fn;
800
+ while (elt.__pending.length) {
801
+ fn = elt.__pending.shift();
802
+ if (fn) {
803
+ fn({
804
+ target: elt
805
+ });
806
+ }
807
+ }
808
+ }
809
+ this.parseNext();
810
+ },
811
+ parseLink: function(linkElt) {
812
+ if (nodeIsImport(linkElt)) {
813
+ this.parseImport(linkElt);
814
+ } else {
815
+ linkElt.href = linkElt.href;
816
+ this.parseGeneric(linkElt);
817
+ }
818
+ },
819
+ parseStyle: function(elt) {
820
+ var src = elt;
821
+ elt = cloneStyle(elt);
822
+ elt.__importElement = src;
823
+ this.parseGeneric(elt);
824
+ },
825
+ parseGeneric: function(elt) {
826
+ this.trackElement(elt);
827
+ this.addElementToDocument(elt);
828
+ },
829
+ rootImportForElement: function(elt) {
830
+ var n = elt;
831
+ while (n.ownerDocument.__importLink) {
832
+ n = n.ownerDocument.__importLink;
833
+ }
834
+ return n;
835
+ },
836
+ addElementToDocument: function(elt) {
837
+ var port = this.rootImportForElement(elt.__importElement || elt);
838
+ port.parentNode.insertBefore(elt, port);
839
+ },
840
+ trackElement: function(elt, callback) {
841
+ var self = this;
842
+ var done = function(e) {
843
+ if (callback) {
844
+ callback(e);
845
+ }
846
+ self.markParsingComplete(elt);
847
+ self.parseNext();
848
+ };
849
+ elt.addEventListener("load", done);
850
+ elt.addEventListener("error", done);
851
+ if (isIE && elt.localName === "style") {
852
+ var fakeLoad = false;
853
+ if (elt.textContent.indexOf("@import") == -1) {
854
+ fakeLoad = true;
855
+ } else if (elt.sheet) {
856
+ fakeLoad = true;
857
+ var csr = elt.sheet.cssRules;
858
+ var len = csr ? csr.length : 0;
859
+ for (var i = 0, r; i < len && (r = csr[i]); i++) {
860
+ if (r.type === CSSRule.IMPORT_RULE) {
861
+ fakeLoad = fakeLoad && Boolean(r.styleSheet);
862
+ }
863
+ }
864
+ }
865
+ if (fakeLoad) {
866
+ elt.dispatchEvent(new CustomEvent("load", {
867
+ bubbles: false
868
+ }));
869
+ }
870
+ }
871
+ },
872
+ parseScript: function(scriptElt) {
873
+ var script = document.createElement("script");
874
+ script.__importElement = scriptElt;
875
+ script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
876
+ scope.currentScript = scriptElt;
877
+ this.trackElement(script, function(e) {
878
+ script.parentNode.removeChild(script);
879
+ scope.currentScript = null;
880
+ });
881
+ this.addElementToDocument(script);
882
+ },
883
+ nextToParse: function() {
884
+ this._mayParse = [];
885
+ return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic());
886
+ },
887
+ nextToParseInDoc: function(doc, link) {
888
+ if (doc && this._mayParse.indexOf(doc) < 0) {
889
+ this._mayParse.push(doc);
890
+ var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
891
+ for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) {
892
+ if (!this.isParsed(n)) {
893
+ if (this.hasResource(n)) {
894
+ return nodeIsImport(n) ? this.nextToParseInDoc(n.import, n) : n;
895
+ } else {
896
+ return;
897
+ }
898
+ }
899
+ }
900
+ }
901
+ return link;
902
+ },
903
+ nextToParseDynamic: function() {
904
+ return this.dynamicElements[0];
905
+ },
906
+ parseSelectorsForNode: function(node) {
907
+ var doc = node.ownerDocument || node;
908
+ return doc === rootDocument ? this.documentSelectors : this.importsSelectors;
909
+ },
910
+ isParsed: function(node) {
911
+ return node.__importParsed;
912
+ },
913
+ needsDynamicParsing: function(elt) {
914
+ return this.dynamicElements.indexOf(elt) >= 0;
915
+ },
916
+ hasResource: function(node) {
917
+ if (nodeIsImport(node) && node.import === undefined) {
918
+ return false;
919
+ }
920
+ return true;
921
+ }
922
+ };
923
+ function nodeIsImport(elt) {
924
+ return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE;
925
+ }
926
+ function generateScriptDataUrl(script) {
927
+ var scriptContent = generateScriptContent(script);
928
+ return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent);
929
+ }
930
+ function generateScriptContent(script) {
931
+ return script.textContent + generateSourceMapHint(script);
932
+ }
933
+ function generateSourceMapHint(script) {
934
+ var owner = script.ownerDocument;
935
+ owner.__importedScripts = owner.__importedScripts || 0;
936
+ var moniker = script.ownerDocument.baseURI;
937
+ var num = owner.__importedScripts ? "-" + owner.__importedScripts : "";
938
+ owner.__importedScripts++;
939
+ return "\n//# sourceURL=" + moniker + num + ".js\n";
940
+ }
941
+ function cloneStyle(style) {
942
+ var clone = style.ownerDocument.createElement("style");
943
+ clone.textContent = style.textContent;
944
+ path.resolveUrlsInStyle(clone);
945
+ return clone;
946
+ }
947
+ scope.parser = importParser;
948
+ scope.IMPORT_SELECTOR = IMPORT_SELECTOR;
949
+ });
950
+
951
+ HTMLImports.addModule(function(scope) {
952
+ var flags = scope.flags;
953
+ var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
954
+ var IMPORT_SELECTOR = scope.IMPORT_SELECTOR;
955
+ var rootDocument = scope.rootDocument;
956
+ var Loader = scope.Loader;
957
+ var Observer = scope.Observer;
958
+ var parser = scope.parser;
959
+ var importer = {
960
+ documents: {},
961
+ documentPreloadSelectors: IMPORT_SELECTOR,
962
+ importsPreloadSelectors: [ IMPORT_SELECTOR ].join(","),
963
+ loadNode: function(node) {
964
+ importLoader.addNode(node);
965
+ },
966
+ loadSubtree: function(parent) {
967
+ var nodes = this.marshalNodes(parent);
968
+ importLoader.addNodes(nodes);
969
+ },
970
+ marshalNodes: function(parent) {
971
+ return parent.querySelectorAll(this.loadSelectorsForNode(parent));
972
+ },
973
+ loadSelectorsForNode: function(node) {
974
+ var doc = node.ownerDocument || node;
975
+ return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors;
976
+ },
977
+ loaded: function(url, elt, resource, err, redirectedUrl) {
978
+ flags.load && console.log("loaded", url, elt);
979
+ elt.__resource = resource;
980
+ elt.__error = err;
981
+ if (isImportLink(elt)) {
982
+ var doc = this.documents[url];
983
+ if (doc === undefined) {
984
+ doc = err ? null : makeDocument(resource, redirectedUrl || url);
985
+ if (doc) {
986
+ doc.__importLink = elt;
987
+ this.bootDocument(doc);
988
+ }
989
+ this.documents[url] = doc;
990
+ }
991
+ elt.import = doc;
992
+ }
993
+ parser.parseNext();
994
+ },
995
+ bootDocument: function(doc) {
996
+ this.loadSubtree(doc);
997
+ this.observer.observe(doc);
998
+ parser.parseNext();
999
+ },
1000
+ loadedAll: function() {
1001
+ parser.parseNext();
1002
+ }
1003
+ };
1004
+ var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer));
1005
+ importer.observer = new Observer();
1006
+ function isImportLink(elt) {
1007
+ return isLinkRel(elt, IMPORT_LINK_TYPE);
1008
+ }
1009
+ function isLinkRel(elt, rel) {
1010
+ return elt.localName === "link" && elt.getAttribute("rel") === rel;
1011
+ }
1012
+ function hasBaseURIAccessor(doc) {
1013
+ return !!Object.getOwnPropertyDescriptor(doc, "baseURI");
1014
+ }
1015
+ function makeDocument(resource, url) {
1016
+ var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);
1017
+ doc._URL = url;
1018
+ var base = doc.createElement("base");
1019
+ base.setAttribute("href", url);
1020
+ if (!doc.baseURI && !hasBaseURIAccessor(doc)) {
1021
+ Object.defineProperty(doc, "baseURI", {
1022
+ value: url
1023
+ });
1024
+ }
1025
+ var meta = doc.createElement("meta");
1026
+ meta.setAttribute("charset", "utf-8");
1027
+ doc.head.appendChild(meta);
1028
+ doc.head.appendChild(base);
1029
+ doc.body.innerHTML = resource;
1030
+ if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {
1031
+ HTMLTemplateElement.bootstrap(doc);
1032
+ }
1033
+ return doc;
1034
+ }
1035
+ if (!document.baseURI) {
1036
+ var baseURIDescriptor = {
1037
+ get: function() {
1038
+ var base = document.querySelector("base");
1039
+ return base ? base.href : window.location.href;
1040
+ },
1041
+ configurable: true
1042
+ };
1043
+ Object.defineProperty(document, "baseURI", baseURIDescriptor);
1044
+ Object.defineProperty(rootDocument, "baseURI", baseURIDescriptor);
1045
+ }
1046
+ scope.importer = importer;
1047
+ scope.importLoader = importLoader;
1048
+ });
1049
+
1050
+ HTMLImports.addModule(function(scope) {
1051
+ var parser = scope.parser;
1052
+ var importer = scope.importer;
1053
+ var dynamic = {
1054
+ added: function(nodes) {
1055
+ var owner, parsed, loading;
1056
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
1057
+ if (!owner) {
1058
+ owner = n.ownerDocument;
1059
+ parsed = parser.isParsed(owner);
1060
+ }
1061
+ loading = this.shouldLoadNode(n);
1062
+ if (loading) {
1063
+ importer.loadNode(n);
1064
+ }
1065
+ if (this.shouldParseNode(n) && parsed) {
1066
+ parser.parseDynamic(n, loading);
1067
+ }
1068
+ }
1069
+ },
1070
+ shouldLoadNode: function(node) {
1071
+ return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node));
1072
+ },
1073
+ shouldParseNode: function(node) {
1074
+ return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node));
1075
+ }
1076
+ };
1077
+ importer.observer.addCallback = dynamic.added.bind(dynamic);
1078
+ var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector;
1079
+ });
1080
+
1081
+ (function(scope) {
1082
+ var initializeModules = scope.initializeModules;
1083
+ var isIE = scope.isIE;
1084
+ if (scope.useNative) {
1085
+ return;
1086
+ }
1087
+ if (isIE && typeof window.CustomEvent !== "function") {
1088
+ window.CustomEvent = function(inType, params) {
1089
+ params = params || {};
1090
+ var e = document.createEvent("CustomEvent");
1091
+ e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
1092
+ return e;
1093
+ };
1094
+ window.CustomEvent.prototype = window.Event.prototype;
1095
+ }
1096
+ initializeModules();
1097
+ var rootDocument = scope.rootDocument;
1098
+ function bootstrap() {
1099
+ HTMLImports.importer.bootDocument(rootDocument);
1100
+ }
1101
+ if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) {
1102
+ bootstrap();
1103
+ } else {
1104
+ document.addEventListener("DOMContentLoaded", bootstrap);
1105
+ }
1106
+ })(HTMLImports);
1107
+
1108
+ window.CustomElements = window.CustomElements || {
1109
+ flags: {}
1110
+ };
1111
+
1112
+ (function(scope) {
1113
+ var flags = scope.flags;
1114
+ var modules = [];
1115
+ var addModule = function(module) {
1116
+ modules.push(module);
1117
+ };
1118
+ var initializeModules = function() {
1119
+ modules.forEach(function(module) {
1120
+ module(scope);
1121
+ });
1122
+ };
1123
+ scope.addModule = addModule;
1124
+ scope.initializeModules = initializeModules;
1125
+ scope.hasNative = Boolean(document.registerElement);
1126
+ scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || HTMLImports.useNative);
1127
+ })(CustomElements);
1128
+
1129
+ CustomElements.addModule(function(scope) {
1130
+ var IMPORT_LINK_TYPE = window.HTMLImports ? HTMLImports.IMPORT_LINK_TYPE : "none";
1131
+ function forSubtree(node, cb) {
1132
+ findAllElements(node, function(e) {
1133
+ if (cb(e)) {
1134
+ return true;
1135
+ }
1136
+ forRoots(e, cb);
1137
+ });
1138
+ forRoots(node, cb);
1139
+ }
1140
+ function findAllElements(node, find, data) {
1141
+ var e = node.firstElementChild;
1142
+ if (!e) {
1143
+ e = node.firstChild;
1144
+ while (e && e.nodeType !== Node.ELEMENT_NODE) {
1145
+ e = e.nextSibling;
1146
+ }
1147
+ }
1148
+ while (e) {
1149
+ if (find(e, data) !== true) {
1150
+ findAllElements(e, find, data);
1151
+ }
1152
+ e = e.nextElementSibling;
1153
+ }
1154
+ return null;
1155
+ }
1156
+ function forRoots(node, cb) {
1157
+ var root = node.shadowRoot;
1158
+ while (root) {
1159
+ forSubtree(root, cb);
1160
+ root = root.olderShadowRoot;
1161
+ }
1162
+ }
1163
+ var processingDocuments;
1164
+ function forDocumentTree(doc, cb) {
1165
+ processingDocuments = [];
1166
+ _forDocumentTree(doc, cb);
1167
+ processingDocuments = null;
1168
+ }
1169
+ function _forDocumentTree(doc, cb) {
1170
+ doc = wrap(doc);
1171
+ if (processingDocuments.indexOf(doc) >= 0) {
1172
+ return;
1173
+ }
1174
+ processingDocuments.push(doc);
1175
+ var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
1176
+ for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
1177
+ if (n.import) {
1178
+ _forDocumentTree(n.import, cb);
1179
+ }
1180
+ }
1181
+ cb(doc);
1182
+ }
1183
+ scope.forDocumentTree = forDocumentTree;
1184
+ scope.forSubtree = forSubtree;
1185
+ });
1186
+
1187
+ CustomElements.addModule(function(scope) {
1188
+ var flags = scope.flags;
1189
+ var forSubtree = scope.forSubtree;
1190
+ var forDocumentTree = scope.forDocumentTree;
1191
+ function addedNode(node) {
1192
+ return added(node) || addedSubtree(node);
1193
+ }
1194
+ function added(node) {
1195
+ if (scope.upgrade(node)) {
1196
+ return true;
1197
+ }
1198
+ attached(node);
1199
+ }
1200
+ function addedSubtree(node) {
1201
+ forSubtree(node, function(e) {
1202
+ if (added(e)) {
1203
+ return true;
1204
+ }
1205
+ });
1206
+ }
1207
+ function attachedNode(node) {
1208
+ attached(node);
1209
+ if (inDocument(node)) {
1210
+ forSubtree(node, function(e) {
1211
+ attached(e);
1212
+ });
1213
+ }
1214
+ }
1215
+ var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
1216
+ scope.hasPolyfillMutations = hasPolyfillMutations;
1217
+ var isPendingMutations = false;
1218
+ var pendingMutations = [];
1219
+ function deferMutation(fn) {
1220
+ pendingMutations.push(fn);
1221
+ if (!isPendingMutations) {
1222
+ isPendingMutations = true;
1223
+ setTimeout(takeMutations);
1224
+ }
1225
+ }
1226
+ function takeMutations() {
1227
+ isPendingMutations = false;
1228
+ var $p = pendingMutations;
1229
+ for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
1230
+ p();
1231
+ }
1232
+ pendingMutations = [];
1233
+ }
1234
+ function attached(element) {
1235
+ if (hasPolyfillMutations) {
1236
+ deferMutation(function() {
1237
+ _attached(element);
1238
+ });
1239
+ } else {
1240
+ _attached(element);
1241
+ }
1242
+ }
1243
+ function _attached(element) {
1244
+ if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
1245
+ if (!element.__attached && inDocument(element)) {
1246
+ element.__attached = true;
1247
+ if (element.attachedCallback) {
1248
+ element.attachedCallback();
1249
+ }
1250
+ }
1251
+ }
1252
+ }
1253
+ function detachedNode(node) {
1254
+ detached(node);
1255
+ forSubtree(node, function(e) {
1256
+ detached(e);
1257
+ });
1258
+ }
1259
+ function detached(element) {
1260
+ if (hasPolyfillMutations) {
1261
+ deferMutation(function() {
1262
+ _detached(element);
1263
+ });
1264
+ } else {
1265
+ _detached(element);
1266
+ }
1267
+ }
1268
+ function _detached(element) {
1269
+ if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
1270
+ if (element.__attached && !inDocument(element)) {
1271
+ element.__attached = false;
1272
+ if (element.detachedCallback) {
1273
+ element.detachedCallback();
1274
+ }
1275
+ }
1276
+ }
1277
+ }
1278
+ function inDocument(element) {
1279
+ var p = element;
1280
+ var doc = wrap(document);
1281
+ while (p) {
1282
+ if (p == doc) {
1283
+ return true;
1284
+ }
1285
+ p = p.parentNode || p.host;
1286
+ }
1287
+ }
1288
+ function watchShadow(node) {
1289
+ if (node.shadowRoot && !node.shadowRoot.__watched) {
1290
+ flags.dom && console.log("watching shadow-root for: ", node.localName);
1291
+ var root = node.shadowRoot;
1292
+ while (root) {
1293
+ observe(root);
1294
+ root = root.olderShadowRoot;
1295
+ }
1296
+ }
1297
+ }
1298
+ function handler(mutations) {
1299
+ if (flags.dom) {
1300
+ var mx = mutations[0];
1301
+ if (mx && mx.type === "childList" && mx.addedNodes) {
1302
+ if (mx.addedNodes) {
1303
+ var d = mx.addedNodes[0];
1304
+ while (d && d !== document && !d.host) {
1305
+ d = d.parentNode;
1306
+ }
1307
+ var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
1308
+ u = u.split("/?").shift().split("/").pop();
1309
+ }
1310
+ }
1311
+ console.group("mutations (%d) [%s]", mutations.length, u || "");
1312
+ }
1313
+ mutations.forEach(function(mx) {
1314
+ if (mx.type === "childList") {
1315
+ forEach(mx.addedNodes, function(n) {
1316
+ if (!n.localName) {
1317
+ return;
1318
+ }
1319
+ addedNode(n);
1320
+ });
1321
+ forEach(mx.removedNodes, function(n) {
1322
+ if (!n.localName) {
1323
+ return;
1324
+ }
1325
+ detachedNode(n);
1326
+ });
1327
+ }
1328
+ });
1329
+ flags.dom && console.groupEnd();
1330
+ }
1331
+ function takeRecords(node) {
1332
+ node = wrap(node);
1333
+ if (!node) {
1334
+ node = wrap(document);
1335
+ }
1336
+ while (node.parentNode) {
1337
+ node = node.parentNode;
1338
+ }
1339
+ var observer = node.__observer;
1340
+ if (observer) {
1341
+ handler(observer.takeRecords());
1342
+ takeMutations();
1343
+ }
1344
+ }
1345
+ var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
1346
+ function observe(inRoot) {
1347
+ if (inRoot.__observer) {
1348
+ return;
1349
+ }
1350
+ var observer = new MutationObserver(handler);
1351
+ observer.observe(inRoot, {
1352
+ childList: true,
1353
+ subtree: true
1354
+ });
1355
+ inRoot.__observer = observer;
1356
+ }
1357
+ function upgradeDocument(doc) {
1358
+ doc = wrap(doc);
1359
+ flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
1360
+ addedNode(doc);
1361
+ observe(doc);
1362
+ flags.dom && console.groupEnd();
1363
+ }
1364
+ function upgradeDocumentTree(doc) {
1365
+ forDocumentTree(doc, upgradeDocument);
1366
+ }
1367
+ var originalCreateShadowRoot = Element.prototype.createShadowRoot;
1368
+ if (originalCreateShadowRoot) {
1369
+ Element.prototype.createShadowRoot = function() {
1370
+ var root = originalCreateShadowRoot.call(this);
1371
+ CustomElements.watchShadow(this);
1372
+ return root;
1373
+ };
1374
+ }
1375
+ scope.watchShadow = watchShadow;
1376
+ scope.upgradeDocumentTree = upgradeDocumentTree;
1377
+ scope.upgradeSubtree = addedSubtree;
1378
+ scope.upgradeAll = addedNode;
1379
+ scope.attachedNode = attachedNode;
1380
+ scope.takeRecords = takeRecords;
1381
+ });
1382
+
1383
+ CustomElements.addModule(function(scope) {
1384
+ var flags = scope.flags;
1385
+ function upgrade(node) {
1386
+ if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
1387
+ var is = node.getAttribute("is");
1388
+ var definition = scope.getRegisteredDefinition(is || node.localName);
1389
+ if (definition) {
1390
+ if (is && definition.tag == node.localName) {
1391
+ return upgradeWithDefinition(node, definition);
1392
+ } else if (!is && !definition.extends) {
1393
+ return upgradeWithDefinition(node, definition);
1394
+ }
1395
+ }
1396
+ }
1397
+ }
1398
+ function upgradeWithDefinition(element, definition) {
1399
+ flags.upgrade && console.group("upgrade:", element.localName);
1400
+ if (definition.is) {
1401
+ element.setAttribute("is", definition.is);
1402
+ }
1403
+ implementPrototype(element, definition);
1404
+ element.__upgraded__ = true;
1405
+ created(element);
1406
+ scope.attachedNode(element);
1407
+ scope.upgradeSubtree(element);
1408
+ flags.upgrade && console.groupEnd();
1409
+ return element;
1410
+ }
1411
+ function implementPrototype(element, definition) {
1412
+ if (Object.__proto__) {
1413
+ element.__proto__ = definition.prototype;
1414
+ } else {
1415
+ customMixin(element, definition.prototype, definition.native);
1416
+ element.__proto__ = definition.prototype;
1417
+ }
1418
+ }
1419
+ function customMixin(inTarget, inSrc, inNative) {
1420
+ var used = {};
1421
+ var p = inSrc;
1422
+ while (p !== inNative && p !== HTMLElement.prototype) {
1423
+ var keys = Object.getOwnPropertyNames(p);
1424
+ for (var i = 0, k; k = keys[i]; i++) {
1425
+ if (!used[k]) {
1426
+ Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
1427
+ used[k] = 1;
1428
+ }
1429
+ }
1430
+ p = Object.getPrototypeOf(p);
1431
+ }
1432
+ }
1433
+ function created(element) {
1434
+ if (element.createdCallback) {
1435
+ element.createdCallback();
1436
+ }
1437
+ }
1438
+ scope.upgrade = upgrade;
1439
+ scope.upgradeWithDefinition = upgradeWithDefinition;
1440
+ scope.implementPrototype = implementPrototype;
1441
+ });
1442
+
1443
+ CustomElements.addModule(function(scope) {
1444
+ var upgradeDocumentTree = scope.upgradeDocumentTree;
1445
+ var upgrade = scope.upgrade;
1446
+ var upgradeWithDefinition = scope.upgradeWithDefinition;
1447
+ var implementPrototype = scope.implementPrototype;
1448
+ var useNative = scope.useNative;
1449
+ function register(name, options) {
1450
+ var definition = options || {};
1451
+ if (!name) {
1452
+ throw new Error("document.registerElement: first argument `name` must not be empty");
1453
+ }
1454
+ if (name.indexOf("-") < 0) {
1455
+ throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
1456
+ }
1457
+ if (isReservedTag(name)) {
1458
+ throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
1459
+ }
1460
+ if (getRegisteredDefinition(name)) {
1461
+ throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
1462
+ }
1463
+ if (!definition.prototype) {
1464
+ definition.prototype = Object.create(HTMLElement.prototype);
1465
+ }
1466
+ definition.__name = name.toLowerCase();
1467
+ definition.lifecycle = definition.lifecycle || {};
1468
+ definition.ancestry = ancestry(definition.extends);
1469
+ resolveTagName(definition);
1470
+ resolvePrototypeChain(definition);
1471
+ overrideAttributeApi(definition.prototype);
1472
+ registerDefinition(definition.__name, definition);
1473
+ definition.ctor = generateConstructor(definition);
1474
+ definition.ctor.prototype = definition.prototype;
1475
+ definition.prototype.constructor = definition.ctor;
1476
+ if (scope.ready) {
1477
+ upgradeDocumentTree(document);
1478
+ }
1479
+ return definition.ctor;
1480
+ }
1481
+ function overrideAttributeApi(prototype) {
1482
+ if (prototype.setAttribute._polyfilled) {
1483
+ return;
1484
+ }
1485
+ var setAttribute = prototype.setAttribute;
1486
+ prototype.setAttribute = function(name, value) {
1487
+ changeAttribute.call(this, name, value, setAttribute);
1488
+ };
1489
+ var removeAttribute = prototype.removeAttribute;
1490
+ prototype.removeAttribute = function(name) {
1491
+ changeAttribute.call(this, name, null, removeAttribute);
1492
+ };
1493
+ prototype.setAttribute._polyfilled = true;
1494
+ }
1495
+ function changeAttribute(name, value, operation) {
1496
+ name = name.toLowerCase();
1497
+ var oldValue = this.getAttribute(name);
1498
+ operation.apply(this, arguments);
1499
+ var newValue = this.getAttribute(name);
1500
+ if (this.attributeChangedCallback && newValue !== oldValue) {
1501
+ this.attributeChangedCallback(name, oldValue, newValue);
1502
+ }
1503
+ }
1504
+ function isReservedTag(name) {
1505
+ for (var i = 0; i < reservedTagList.length; i++) {
1506
+ if (name === reservedTagList[i]) {
1507
+ return true;
1508
+ }
1509
+ }
1510
+ }
1511
+ var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
1512
+ function ancestry(extnds) {
1513
+ var extendee = getRegisteredDefinition(extnds);
1514
+ if (extendee) {
1515
+ return ancestry(extendee.extends).concat([ extendee ]);
1516
+ }
1517
+ return [];
1518
+ }
1519
+ function resolveTagName(definition) {
1520
+ var baseTag = definition.extends;
1521
+ for (var i = 0, a; a = definition.ancestry[i]; i++) {
1522
+ baseTag = a.is && a.tag;
1523
+ }
1524
+ definition.tag = baseTag || definition.__name;
1525
+ if (baseTag) {
1526
+ definition.is = definition.__name;
1527
+ }
1528
+ }
1529
+ function resolvePrototypeChain(definition) {
1530
+ if (!Object.__proto__) {
1531
+ var nativePrototype = HTMLElement.prototype;
1532
+ if (definition.is) {
1533
+ var inst = document.createElement(definition.tag);
1534
+ var expectedPrototype = Object.getPrototypeOf(inst);
1535
+ if (expectedPrototype === definition.prototype) {
1536
+ nativePrototype = expectedPrototype;
1537
+ }
1538
+ }
1539
+ var proto = definition.prototype, ancestor;
1540
+ while (proto && proto !== nativePrototype) {
1541
+ ancestor = Object.getPrototypeOf(proto);
1542
+ proto.__proto__ = ancestor;
1543
+ proto = ancestor;
1544
+ }
1545
+ definition.native = nativePrototype;
1546
+ }
1547
+ }
1548
+ function instantiate(definition) {
1549
+ return upgradeWithDefinition(domCreateElement(definition.tag), definition);
1550
+ }
1551
+ var registry = {};
1552
+ function getRegisteredDefinition(name) {
1553
+ if (name) {
1554
+ return registry[name.toLowerCase()];
1555
+ }
1556
+ }
1557
+ function registerDefinition(name, definition) {
1558
+ registry[name] = definition;
1559
+ }
1560
+ function generateConstructor(definition) {
1561
+ return function() {
1562
+ return instantiate(definition);
1563
+ };
1564
+ }
1565
+ var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
1566
+ function createElementNS(namespace, tag, typeExtension) {
1567
+ if (namespace === HTML_NAMESPACE) {
1568
+ return createElement(tag, typeExtension);
1569
+ } else {
1570
+ return domCreateElementNS(namespace, tag);
1571
+ }
1572
+ }
1573
+ function createElement(tag, typeExtension) {
1574
+ var definition = getRegisteredDefinition(typeExtension || tag);
1575
+ if (definition) {
1576
+ if (tag == definition.tag && typeExtension == definition.is) {
1577
+ return new definition.ctor();
1578
+ }
1579
+ if (!typeExtension && !definition.is) {
1580
+ return new definition.ctor();
1581
+ }
1582
+ }
1583
+ var element;
1584
+ if (typeExtension) {
1585
+ element = createElement(tag);
1586
+ element.setAttribute("is", typeExtension);
1587
+ return element;
1588
+ }
1589
+ element = domCreateElement(tag);
1590
+ if (tag.indexOf("-") >= 0) {
1591
+ implementPrototype(element, HTMLElement);
1592
+ }
1593
+ return element;
1594
+ }
1595
+ function cloneNode(deep) {
1596
+ var n = domCloneNode.call(this, deep);
1597
+ upgrade(n);
1598
+ return n;
1599
+ }
1600
+ var domCreateElement = document.createElement.bind(document);
1601
+ var domCreateElementNS = document.createElementNS.bind(document);
1602
+ var domCloneNode = Node.prototype.cloneNode;
1603
+ var isInstance;
1604
+ if (!Object.__proto__ && !useNative) {
1605
+ isInstance = function(obj, ctor) {
1606
+ var p = obj;
1607
+ while (p) {
1608
+ if (p === ctor.prototype) {
1609
+ return true;
1610
+ }
1611
+ p = p.__proto__;
1612
+ }
1613
+ return false;
1614
+ };
1615
+ } else {
1616
+ isInstance = function(obj, base) {
1617
+ return obj instanceof base;
1618
+ };
1619
+ }
1620
+ document.registerElement = register;
1621
+ document.createElement = createElement;
1622
+ document.createElementNS = createElementNS;
1623
+ Node.prototype.cloneNode = cloneNode;
1624
+ scope.registry = registry;
1625
+ scope.instanceof = isInstance;
1626
+ scope.reservedTagList = reservedTagList;
1627
+ scope.getRegisteredDefinition = getRegisteredDefinition;
1628
+ document.register = document.registerElement;
1629
+ });
1630
+
1631
+ (function(scope) {
1632
+ var useNative = scope.useNative;
1633
+ var initializeModules = scope.initializeModules;
1634
+ var isIE11OrOlder = /Trident/.test(navigator.userAgent);
1635
+ if (useNative) {
1636
+ var nop = function() {};
1637
+ scope.watchShadow = nop;
1638
+ scope.upgrade = nop;
1639
+ scope.upgradeAll = nop;
1640
+ scope.upgradeDocumentTree = nop;
1641
+ scope.upgradeSubtree = nop;
1642
+ scope.takeRecords = nop;
1643
+ scope.instanceof = function(obj, base) {
1644
+ return obj instanceof base;
1645
+ };
1646
+ } else {
1647
+ initializeModules();
1648
+ }
1649
+ var upgradeDocumentTree = scope.upgradeDocumentTree;
1650
+ if (!window.wrap) {
1651
+ if (window.ShadowDOMPolyfill) {
1652
+ window.wrap = ShadowDOMPolyfill.wrapIfNeeded;
1653
+ window.unwrap = ShadowDOMPolyfill.unwrapIfNeeded;
1654
+ } else {
1655
+ window.wrap = window.unwrap = function(node) {
1656
+ return node;
1657
+ };
1658
+ }
1659
+ }
1660
+ function bootstrap() {
1661
+ upgradeDocumentTree(wrap(document));
1662
+ if (window.HTMLImports) {
1663
+ HTMLImports.__importsParsingHook = function(elt) {
1664
+ upgradeDocumentTree(wrap(elt.import));
1665
+ };
1666
+ }
1667
+ CustomElements.ready = true;
1668
+ setTimeout(function() {
1669
+ CustomElements.readyTime = Date.now();
1670
+ if (window.HTMLImports) {
1671
+ CustomElements.elapsed = CustomElements.readyTime - HTMLImports.readyTime;
1672
+ }
1673
+ document.dispatchEvent(new CustomEvent("WebComponentsReady", {
1674
+ bubbles: true
1675
+ }));
1676
+ });
1677
+ }
1678
+ if (isIE11OrOlder && typeof window.CustomEvent !== "function") {
1679
+ window.CustomEvent = function(inType, params) {
1680
+ params = params || {};
1681
+ var e = document.createEvent("CustomEvent");
1682
+ e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
1683
+ return e;
1684
+ };
1685
+ window.CustomEvent.prototype = window.Event.prototype;
1686
+ }
1687
+ if (document.readyState === "complete" || scope.flags.eager) {
1688
+ bootstrap();
1689
+ } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
1690
+ bootstrap();
1691
+ } else {
1692
+ var loadEvent = window.HTMLImports && !HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
1693
+ window.addEventListener(loadEvent, bootstrap);
1694
+ }
1695
+ })(window.CustomElements);
1696
+
1697
+ if (typeof HTMLTemplateElement === "undefined") {
1698
+ (function() {
1699
+ var TEMPLATE_TAG = "template";
1700
+ HTMLTemplateElement = function() {};
1701
+ HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
1702
+ HTMLTemplateElement.decorate = function(template) {
1703
+ if (!template.content) {
1704
+ template.content = template.ownerDocument.createDocumentFragment();
1705
+ var child;
1706
+ while (child = template.firstChild) {
1707
+ template.content.appendChild(child);
1708
+ }
1709
+ }
1710
+ };
1711
+ HTMLTemplateElement.bootstrap = function(doc) {
1712
+ var templates = doc.querySelectorAll(TEMPLATE_TAG);
1713
+ for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
1714
+ HTMLTemplateElement.decorate(t);
1715
+ }
1716
+ };
1717
+ addEventListener("DOMContentLoaded", function() {
1718
+ HTMLTemplateElement.bootstrap(document);
1719
+ });
1720
+ })();
1721
+ }
1722
+
1723
+ (function(scope) {
1724
+ var style = document.createElement("style");
1725
+ style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n";
1726
+ var head = document.querySelector("head");
1727
+ head.insertBefore(style, head.firstChild);
1728
+ })(window.WebComponents);