OLD | NEW |
1 { | 1 { |
2 "version": 3, | 2 "version": 3, |
3 "file": "platform.concat.js", | 3 "file": "platform.concat.js", |
4 "sources": [ | 4 "sources": [ |
5 "build/boot.js", | 5 "build/boot.js", |
6 "../WeakMap/weakmap.js", | 6 "../WeakMap/weakmap.js", |
7 "../observe-js/src/observe.js", | 7 "../observe-js/src/observe.js", |
8 "build/if-poly.js", | 8 "build/if-poly.js", |
9 "../ShadowDOM/src/wrappers.js", | 9 "../ShadowDOM/src/wrappers.js", |
10 "../ShadowDOM/src/microtask.js", | 10 "../ShadowDOM/src/microtask.js", |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 "../ShadowDOM/src/wrappers/Document.js", | 50 "../ShadowDOM/src/wrappers/Document.js", |
51 "../ShadowDOM/src/wrappers/Window.js", | 51 "../ShadowDOM/src/wrappers/Window.js", |
52 "../ShadowDOM/src/wrappers/DataTransfer.js", | 52 "../ShadowDOM/src/wrappers/DataTransfer.js", |
53 "../ShadowDOM/src/wrappers/FormData.js", | 53 "../ShadowDOM/src/wrappers/FormData.js", |
54 "../ShadowDOM/src/wrappers/override-constructors.js", | 54 "../ShadowDOM/src/wrappers/override-constructors.js", |
55 "src/patches-shadowdom-polyfill.js", | 55 "src/patches-shadowdom-polyfill.js", |
56 "src/ShadowCSS.js", | 56 "src/ShadowCSS.js", |
57 "build/else.js", | 57 "build/else.js", |
58 "src/patches-shadowdom-native.js", | 58 "src/patches-shadowdom-native.js", |
59 "build/end-if.js", | 59 "build/end-if.js", |
60 "../URL/url.js", | |
61 "src/lang.js", | 60 "src/lang.js", |
62 "src/dom.js", | 61 "src/dom.js", |
63 "src/template.js", | 62 "src/template.js", |
64 "src/inspector.js", | 63 "src/inspector.js", |
65 "src/unresolved.js", | 64 "src/unresolved.js", |
66 "src/module.js", | 65 "src/module.js", |
67 "src/microtask.js", | 66 "src/microtask.js", |
68 "src/url.js", | 67 "src/url.js", |
69 "../MutationObservers/MutationObserver.js", | 68 "../MutationObservers/MutationObserver.js", |
70 "../HTMLImports/src/scope.js", | 69 "../HTMLImports/src/scope.js", |
71 "../HTMLImports/src/Loader.js", | 70 "../HTMLImports/src/Loader.js", |
72 "../HTMLImports/src/Parser.js", | 71 "../HTMLImports/src/Parser.js", |
73 "../HTMLImports/src/HTMLImports.js", | 72 "../HTMLImports/src/HTMLImports.js", |
74 "../HTMLImports/src/Observer.js", | 73 "../HTMLImports/src/Observer.js", |
75 "../HTMLImports/src/boot.js", | 74 "../HTMLImports/src/boot.js", |
76 "../CustomElements/src/scope.js", | 75 "../CustomElements/src/scope.js", |
77 "../CustomElements/src/Observer.js", | 76 "../CustomElements/src/Observer.js", |
78 "../CustomElements/src/CustomElements.js", | 77 "../CustomElements/src/CustomElements.js", |
79 "../CustomElements/src/Parser.js", | 78 "../CustomElements/src/Parser.js", |
80 "../CustomElements/src/boot.js", | 79 "../CustomElements/src/boot.js", |
81 "src/patches-custom-elements.js", | 80 "src/patches-custom-elements.js", |
82 "src/loader.js", | 81 "src/loader.js", |
83 "src/styleloader.js", | 82 "src/styleloader.js", |
84 "../NodeBind/src/NodeBind.js", | 83 "../NodeBind/src/NodeBind.js", |
85 "../TemplateBinding/src/TemplateBinding.js", | 84 "../TemplateBinding/src/TemplateBinding.js", |
86 "src/patches-mdv.js" | 85 "src/patches-mdv.js" |
87 ], | 86 ], |
88 "names": [], | 87 "names": [], |
89 "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;A;ACrrDA;AACA;A;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;A;AC/ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;A;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnXA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChFA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;A;ACn4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5HA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC
/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACdA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9tBA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;A;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1EA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5CA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrJA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;A;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtCA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;A;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1CA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtEA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;A;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;A
CzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9
DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;A;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpCA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;A;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;A;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;A;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvBA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzEA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjpBA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;A;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;A;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtBA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;A;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
A;ACtwBA,Q;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC
5CA,C;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;A;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;A;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;A;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;A;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChIA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjiBA;AACA;AACA;AAC
A;AACA;AACA,sD;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtLA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;A;ACxTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzSA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;A;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvDA;AACA;AACA;
AACA;AACA;AACA,4D;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvVA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3dA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0B;AC/DA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnEA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC
hCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;A;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtEA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;A;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtuCA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;A", | 88 "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;A;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;A;AC9rDA;AACA;A;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;A;ACzaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;A;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACn4BA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5HA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/CA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACdA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9tBA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;A;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;A;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;A;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;A;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1CA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;A;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;A;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;A;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;A;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpCA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9BA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3BA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;A;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;A;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzEA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjpBA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;A;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;A;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtFA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3GA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;A
CjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtwBA,Q;ACAA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5CA,C;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;A;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;A;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpMA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;A;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChIA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjiBA;AACA;AA
CA;AACA;AACA;AACA,sD;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtLA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;A;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;A
CzSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;A;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvDA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4D;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;A;AC1VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;A;AC5dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA,0B;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxEA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;A
ChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;A;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtEA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;A;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrwCA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;A", |
90 "sourcesContent": [ | 89 "sourcesContent": [ |
91 "/**\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved
.\n * This code may only be used under the BSD style license found at http://pol
ymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:
//polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be foun
d at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights gran
t found at http://polymer.github.io/PATENTS.txt\n */\n\nwindow.Platform = window
.Platform || {};\n// prepopulate window.logFlags if necessary\nwindow.logFlags =
window.logFlags || {};\n// process flags\n(function(scope){\n // import\n var
flags = scope.flags || {};\n // populate flags from location\n location.searc
h.slice(1).split('&').forEach(function(o) {\n o = o.split('=');\n o[0] &&
(flags[o[0]] = o[1] || true);\n });\n var entryPoint = document.currentScript
||\n document.querySelector('script[src*=\"platform.js\"]');\n if (entryPo
int) {\n var a = entryPoint.attributes;\n for (var i = 0, n; i < a.length;
i++) {\n n = a[i];\n if (n.name !== 'src') {\n flags[n.name] =
n.value || true;\n }\n }\n }\n if (flags.log) {\n flags.log.split(
',').forEach(function(f) {\n window.logFlags[f] = true;\n });\n }\n //
If any of these flags match 'native', then force native ShadowDOM; any\n // ot
her truthy value, or failure to detect native\n // ShadowDOM, results in polyfi
ll\n flags.shadow = flags.shadow || flags.shadowdom || flags.polyfill;\n if (f
lags.shadow === 'native') {\n flags.shadow = false;\n } else {\n flags.sh
adow = flags.shadow || !HTMLElement.prototype.createShadowRoot;\n }\n\n if (fl
ags.shadow && document.querySelectorAll('script').length > 1) {\n console.war
n('platform.js is not the first script on the page. ' +\n 'See http://www
.polymer-project.org/docs/start/platform.html#setup ' +\n 'for details.')
;\n }\n\n // CustomElements polyfill flag\n if (flags.register) {\n window
.CustomElements = window.CustomElements || {flags: {}};\n window.CustomElemen
ts.flags.register = flags.register;\n }\n\n if (flags.imports) {\n window.H
TMLImports = window.HTMLImports || {flags: {}};\n window.HTMLImports.flags.im
ports = flags.imports;\n }\n\n // export\n scope.flags = flags;\n})(Platform)
;\n", | 90 "/**\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved
.\n * This code may only be used under the BSD style license found at http://pol
ymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:
//polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be foun
d at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights gran
t found at http://polymer.github.io/PATENTS.txt\n */\n\nwindow.Platform = window
.Platform || {};\n// prepopulate window.logFlags if necessary\nwindow.logFlags =
window.logFlags || {};\n// process flags\n(function(scope){\n // import\n var
flags = scope.flags || {};\n // populate flags from location\n location.searc
h.slice(1).split('&').forEach(function(o) {\n o = o.split('=');\n o[0] &&
(flags[o[0]] = o[1] || true);\n });\n var entryPoint = document.currentScript
||\n document.querySelector('script[src*=\"platform.js\"]');\n if (entryPo
int) {\n var a = entryPoint.attributes;\n for (var i = 0, n; i < a.length;
i++) {\n n = a[i];\n if (n.name !== 'src') {\n flags[n.name] =
n.value || true;\n }\n }\n }\n if (flags.log) {\n flags.log.split(
',').forEach(function(f) {\n window.logFlags[f] = true;\n });\n }\n //
If any of these flags match 'native', then force native ShadowDOM; any\n // ot
her truthy value, or failure to detect native\n // ShadowDOM, results in polyfi
ll\n flags.shadow = flags.shadow || flags.shadowdom || flags.polyfill;\n if (f
lags.shadow === 'native') {\n flags.shadow = false;\n } else {\n flags.sh
adow = flags.shadow || !HTMLElement.prototype.createShadowRoot;\n }\n\n if (fl
ags.shadow && document.querySelectorAll('script').length > 1) {\n console.war
n('platform.js is not the first script on the page. ' +\n 'See http://www
.polymer-project.org/docs/start/platform.html#setup ' +\n 'for details.')
;\n }\n\n // CustomElements polyfill flag\n if (flags.register) {\n window
.CustomElements = window.CustomElements || {flags: {}};\n window.CustomElemen
ts.flags.register = flags.register;\n }\n\n if (flags.imports) {\n window.H
TMLImports = window.HTMLImports || {flags: {}};\n window.HTMLImports.flags.im
ports = flags.imports;\n }\n\n // export\n scope.flags = flags;\n})(Platform)
;\n", |
92 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\nif (typeof WeakMap === 'undefined') {\n (function() {\n
var defineProperty = Object.defineProperty;\n var counter = Date.now() % 1
e9;\n\n var WeakMap = function() {\n this.name = '__st' + (Math.random()
* 1e9 >>> 0) + (counter++ + '__');\n };\n\n WeakMap.prototype = {\n
set: function(key, value) {\n var entry = key[this.name];\n if (en
try && entry[0] === key)\n entry[1] = value;\n else\n d
efineProperty(key, this.name, {value: [key, value], writable: true});\n },\
n get: function(key) {\n var entry;\n return (entry = key[thi
s.name]) && entry[0] === key ?\n entry[1] : undefined;\n },\n
delete: function(key) {\n this.set(key, undefined);\n }\n };\n
\n window.WeakMap = WeakMap;\n })();\n}\n", | 91 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\nif (typeof WeakMap === 'undefined') {\n (function() {\n
var defineProperty = Object.defineProperty;\n var counter = Date.now() % 1
e9;\n\n var WeakMap = function() {\n this.name = '__st' + (Math.random()
* 1e9 >>> 0) + (counter++ + '__');\n };\n\n WeakMap.prototype = {\n
set: function(key, value) {\n var entry = key[this.name];\n if (en
try && entry[0] === key)\n entry[1] = value;\n else\n d
efineProperty(key, this.name, {value: [key, value], writable: true});\n },\
n get: function(key) {\n var entry;\n return (entry = key[thi
s.name]) && entry[0] === key ?\n entry[1] : undefined;\n },\n
delete: function(key) {\n var entry = key[this.name];\n if (!en
try) return false;\n var hasValue = entry[0] === key;\n entry[0] =
entry[1] = undefined;\n return hasValue;\n },\n has: function(
key) {\n var entry = key[this.name];\n if (!entry) return false;\n
return entry[0] === key;\n }\n };\n\n window.WeakMap = WeakMa
p;\n })();\n}\n", |
93 "// Copyright 2012 Google Inc.\n//\n// Licensed under the Apache License, Ve
rsion 2.0 (the \"License\");\n// you may not use this file except in compliance
with the License.\n// You may obtain a copy of the License at\n//\n// http:/
/www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o
r agreed to in writing, software\n// distributed under the License is distribute
d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe
r express or implied.\n// See the License for the specific language governing pe
rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use
strict';\n\n // Detect and do basic sanity checking on Object/Array.observe.\n
function detectObjectObserve() {\n if (typeof Object.observe !== 'function'
||\n typeof Array.observe !== 'function') {\n return false;\n }\n
\n var records = [];\n\n function callback(recs) {\n records = recs;\
n }\n\n var test = {};\n var arr = [];\n Object.observe(test, callba
ck);\n Array.observe(arr, callback);\n test.id = 1;\n test.id = 2;\n
delete test.id;\n arr.push(1, 2);\n arr.length = 0;\n\n Object.deliver
ChangeRecords(callback);\n if (records.length !== 5)\n return false;\n\n
if (records[0].type != 'add' ||\n records[1].type != 'update' ||\n
records[2].type != 'delete' ||\n records[3].type != 'splice' ||\n
records[4].type != 'splice') {\n return false;\n }\n\n Object.un
observe(test, callback);\n Array.unobserve(arr, callback);\n\n return true
;\n }\n\n var hasObserve = detectObjectObserve();\n\n function detectEval() {
\n // Don't test for eval if we're running in a Chrome App environment.\n
// We check for APIs set that only exist in a Chrome App context.\n if (typeo
f chrome !== 'undefined' && chrome.app && chrome.app.runtime) {\n return fa
lse;\n }\n\n try {\n var f = new Function('', 'return true;');\n
return f();\n } catch (ex) {\n return false;\n }\n }\n\n var hasEv
al = detectEval();\n\n function isIndex(s) {\n return +s === s >>> 0;\n }\n
\n function toNumber(s) {\n return +s;\n }\n\n function isObject(obj) {\n
return obj === Object(obj);\n }\n\n var numberIsNaN = global.Number.isNaN |
| function(value) {\n return typeof value === 'number' && global.isNaN(value)
;\n }\n\n function areSameValue(left, right) {\n if (left === right)\n
return left !== 0 || 1 / left === 1 / right;\n if (numberIsNaN(left) && numb
erIsNaN(right))\n return true;\n\n return left !== left && right !== rig
ht;\n }\n\n var createObject = ('__proto__' in {}) ?\n function(obj) { retu
rn obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!p
roto)\n return obj;\n var newObject = Object.create(proto);\n O
bject.getOwnPropertyNames(obj).forEach(function(name) {\n Object.definePr
operty(newObject, name,\n Object.getOwnPropertyDescr
iptor(obj, name));\n });\n return newObject;\n };\n\n var identSta
rt = '[\\$_a-zA-Z]';\n var identPart = '[\\$_a-zA-Z0-9]';\n var identRegExp =
new RegExp('^' + identStart + '+' + identPart + '*' + '$');\n\n function getPat
hCharType(char) {\n if (char === undefined)\n return 'eof';\n\n var c
ode = char.charCodeAt(0);\n\n switch(code) {\n case 0x5B: // [\n ca
se 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: /
/ '\n case 0x30: // 0\n return char;\n\n case 0x5F: // _\n
case 0x24: // $\n return 'ident';\n\n case 0x20: // Space\n ca
se 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n
case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n cas
e 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n
return 'ws';\n }\n\n // a-z, A-Z\n if ((0x61 <= code && code <= 0x7A)
|| (0x41 <= code && code <= 0x5A))\n return 'ident';\n\n // 1-9\n if
(0x31 <= code && code <= 0x39)\n return 'number';\n\n return 'else';\n
}\n\n var pathStateMachine = {\n 'beforePath': {\n 'ws': ['beforePath'
],\n 'ident': ['inIdent', 'append'],\n '[': ['beforeElement'],\n
'eof': ['afterPath']\n },\n\n 'inPath': {\n 'ws': ['inPath'],\n
'.': ['beforeIdent'],\n '[': ['beforeElement'],\n 'eof': ['afterPath']
\n },\n\n 'beforeIdent': {\n 'ws': ['beforeIdent'],\n 'ident': [
'inIdent', 'append']\n },\n\n 'inIdent': {\n 'ident': ['inIdent', 'ap
pend'],\n '0': ['inIdent', 'append'],\n 'number': ['inIdent', 'append'
],\n 'ws': ['inPath', 'push'],\n '.': ['beforeIdent', 'push'],\n
'[': ['beforeElement', 'push'],\n 'eof': ['afterPath', 'push']\n },\n\n
'beforeElement': {\n 'ws': ['beforeElement'],\n '0': ['afterZero',
'append'],\n 'number': ['inIndex', 'append'],\n \"'\": ['inSingleQuote
', 'append', ''],\n '\"': ['inDoubleQuote', 'append', '']\n },\n\n 'a
fterZero': {\n 'ws': ['afterElement', 'push'],\n ']': ['inPath', 'push
']\n },\n\n 'inIndex': {\n '0': ['inIndex', 'append'],\n 'number
': ['inIndex', 'append'],\n 'ws': ['afterElement'],\n ']': ['inPath',
'push']\n },\n\n 'inSingleQuote': {\n \"'\": ['afterElement'],\n
'eof': ['error'],\n 'else': ['inSingleQuote', 'append']\n },\n\n 'in
DoubleQuote': {\n '\"': ['afterElement'],\n 'eof': ['error'],\n '
else': ['inDoubleQuote', 'append']\n },\n\n 'afterElement': {\n 'ws':
['afterElement'],\n ']': ['inPath', 'push']\n }\n }\n\n function noop
() {}\n\n function parsePath(path) {\n var keys = [];\n var index = -1;\n
var c, newChar, key, type, transition, action, typeMap, mode = 'beforePath';
\n\n var actions = {\n push: function() {\n if (key === undefined
)\n return;\n\n keys.push(key);\n key = undefined;\n
},\n\n append: function() {\n if (key === undefined)\n key
= newChar\n else\n key += newChar;\n }\n };\n\n func
tion maybeUnescapeQuote() {\n if (index >= path.length)\n return;\n\
n var nextChar = path[index + 1];\n if ((mode == 'inSingleQuote' && ne
xtChar == \"'\") ||\n (mode == 'inDoubleQuote' && nextChar == '\"')) {\
n index++;\n newChar = nextChar;\n actions.append();\n
return true;\n }\n }\n\n while (mode) {\n index++;\n c =
path[index];\n\n if (c == '\\\\' && maybeUnescapeQuote(mode))\n con
tinue;\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mod
e];\n transition = typeMap[type] || typeMap['else'] || 'error';\n\n if
(transition == 'error')\n return; // parse error;\n\n mode = transi
tion[0];\n action = actions[transition[1]] || noop;\n newChar = transi
tion[2] === undefined ? c : transition[2];\n action();\n\n if (mode ==
= 'afterPath') {\n return keys;\n }\n }\n\n return; // parse e
rror\n }\n\n function isIdent(s) {\n return identRegExp.test(s);\n }\n\n
var constructorIsPrivate = {};\n\n function Path(parts, privateToken) {\n if
(privateToken !== constructorIsPrivate)\n throw Error('Use Path.get to ret
rieve path objects');\n\n for (var i = 0; i < parts.length; i++) {\n thi
s.push(String(parts[i]));\n }\n\n if (hasEval && this.length) {\n thi
s.getValueFrom = this.compiledGetValueFromFn();\n }\n }\n\n // TODO(rafaelw
): Make simple LRU cache\n var pathCache = {};\n\n function getPath(pathString
) {\n if (pathString instanceof Path)\n return pathString;\n\n if (pa
thString == null || pathString.length == 0)\n pathString = '';\n\n if (t
ypeof pathString != 'string') {\n if (isIndex(pathString.length)) {\n
// Constructed with array-like (pre-parsed) keys\n return new Path(path
String, constructorIsPrivate);\n }\n\n pathString = String(pathString)
;\n }\n\n var path = pathCache[pathString];\n if (path)\n return p
ath;\n\n var parts = parsePath(pathString);\n if (!parts)\n return in
validPath;\n\n var path = new Path(parts, constructorIsPrivate);\n pathCac
he[pathString] = path;\n return path;\n }\n\n Path.get = getPath;\n\n func
tion formatAccessor(key) {\n if (isIndex(key)) {\n return '[' + key + ']
';\n } else {\n return '[\"' + key.replace(/\"/g, '\\\\\"') + '\"]';\n
}\n }\n\n Path.prototype = createObject({\n __proto__: [],\n valid: tr
ue,\n\n toString: function() {\n var pathString = '';\n for (var i
= 0; i < this.length; i++) {\n var key = this[i];\n if (isIdent(ke
y)) {\n pathString += i ? '.' + key : key;\n } else {\n
pathString += formatAccessor(key);\n }\n }\n\n return pathStri
ng;\n },\n\n getValueFrom: function(obj, directObserver) {\n for (var
i = 0; i < this.length; i++) {\n if (obj == null)\n return;\n
obj = obj[this[i]];\n }\n return obj;\n },\n\n iterateObje
cts: function(obj, observe) {\n for (var i = 0; i < this.length; i++) {\n
if (i)\n obj = obj[this[i - 1]];\n if (!isObject(obj))\n
return;\n observe(obj, this[0]);\n }\n },\n\n compiled
GetValueFromFn: function() {\n var str = '';\n var pathString = 'obj';
\n str += 'if (obj != null';\n var i = 0;\n var key;\n for (
; i < (this.length - 1); i++) {\n key = this[i];\n pathString += i
sIdent(key) ? '.' + key : formatAccessor(key);\n str += ' &&\\n ' + p
athString + ' != null';\n }\n str += ')\\n';\n\n var key = this[i
];\n pathString += isIdent(key) ? '.' + key : formatAccessor(key);\n\n
str += ' return ' + pathString + ';\\nelse\\n return undefined;';\n retu
rn new Function('obj', str);\n },\n\n setValueFrom: function(obj, value) {
\n if (!this.length)\n return false;\n\n for (var i = 0; i < th
is.length - 1; i++) {\n if (!isObject(obj))\n return false;\n
obj = obj[this[i]];\n }\n\n if (!isObject(obj))\n return f
alse;\n\n obj[this[i]] = value;\n return true;\n }\n });\n\n var
invalidPath = new Path('', constructorIsPrivate);\n invalidPath.valid = false;\
n invalidPath.getValueFrom = invalidPath.setValueFrom = function() {};\n\n var
MAX_DIRTY_CHECK_CYCLES = 1000;\n\n function dirtyCheck(observer) {\n var cy
cles = 0;\n while (cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {\n
cycles++;\n }\n if (global.testingExposeCycleCount)\n global.dir
tyCheckCycleCount = cycles;\n\n return cycles > 0;\n }\n\n function objectI
sEmpty(object) {\n for (var prop in object)\n return false;\n return
true;\n }\n\n function diffIsEmpty(diff) {\n return objectIsEmpty(diff.adde
d) &&\n objectIsEmpty(diff.removed) &&\n objectIsEmpty(diff.
changed);\n }\n\n function diffObjectFromOldObject(object, oldObject) {\n v
ar added = {};\n var removed = {};\n var changed = {};\n\n for (var pro
p in oldObject) {\n var newValue = object[prop];\n\n if (newValue !==
undefined && newValue === oldObject[prop])\n continue;\n\n if (!(pro
p in object)) {\n removed[prop] = undefined;\n continue;\n }\
n\n if (newValue !== oldObject[prop])\n changed[prop] = newValue;\n
}\n\n for (var prop in object) {\n if (prop in oldObject)\n co
ntinue;\n\n added[prop] = object[prop];\n }\n\n if (Array.isArray(obj
ect) && object.length !== oldObject.length)\n changed.length = object.lengt
h;\n\n return {\n added: added,\n removed: removed,\n changed:
changed\n };\n }\n\n var eomTasks = [];\n function runEOMTasks() {\n i
f (!eomTasks.length)\n return false;\n\n for (var i = 0; i < eomTasks.le
ngth; i++) {\n eomTasks[i]();\n }\n eomTasks.length = 0;\n return
true;\n }\n\n var runEOM = hasObserve ? (function(){\n var eomObj = { pingP
ong: true };\n var eomRunScheduled = false;\n\n Object.observe(eomObj, fun
ction() {\n runEOMTasks();\n eomRunScheduled = false;\n });\n\n
return function(fn) {\n eomTasks.push(fn);\n if (!eomRunScheduled) {\n
eomRunScheduled = true;\n eomObj.pingPong = !eomObj.pingPong;\n
}\n };\n })() :\n (function() {\n return function(fn) {\n eomTa
sks.push(fn);\n };\n })();\n\n var observedObjectCache = [];\n\n function
newObservedObject() {\n var observer;\n var object;\n var discardRecord
s = false;\n var first = true;\n\n function callback(records) {\n if
(observer && observer.state_ === OPENED && !discardRecords)\n observer.ch
eck_(records);\n }\n\n return {\n open: function(obs) {\n if (
observer)\n throw Error('ObservedObject in use');\n\n if (!first
)\n Object.deliverChangeRecords(callback);\n\n observer = obs;\n
first = false;\n },\n observe: function(obj, arrayObserve) {\n
object = obj;\n if (arrayObserve)\n Array.observe(object
, callback);\n else\n Object.observe(object, callback);\n }
,\n deliver: function(discard) {\n discardRecords = discard;\n
Object.deliverChangeRecords(callback);\n discardRecords = false;\n
},\n close: function() {\n observer = undefined;\n Object.un
observe(object, callback);\n observedObjectCache.push(this);\n }\n
};\n }\n\n /*\n * The observedSet abstraction is a perf optimization which
reduces the total\n * number of Object.observe observations of a set of objec
ts. The idea is that\n * groups of Observers will have some object dependencie
s in common and this\n * observed set ensures that each object in the transiti
ve closure of\n * dependencies is only observed once. The observedSet acts as
a write barrier\n * such that whenever any change comes through, all Observers
are checked for\n * changed values.\n *\n * Note that this optimization i
s explicitly moving work from setup-time to\n * change-time.\n *\n * TODO(
rafaelw): Implement \"garbage collection\". In order to move work off\n * the
critical path, when Observers are closed, their observed objects are\n * not O
bject.unobserve(d). As a result, it's possible that if the observedSet\n * is
kept open, but some Observers have been closed, it could cause \"leaks\"\n * (
prevent otherwise collectable objects from being collected). At some\n * point
, we should implement incremental \"gc\" which keeps a list of\n * observedSet
s which may need clean-up and does small amounts of cleanup on a\n * timeout u
ntil all is clean.\n */\n\n function getObservedObject(observer, object, arra
yObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n
dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n
}\n\n var observedSetCache = [];\n\n function newObservedSet() {\n var ob
serverCount = 0;\n var observers = [];\n var objects = [];\n var rootOb
j;\n var rootObjProps;\n\n function observe(obj, prop) {\n if (!obj)\
n return;\n\n if (obj === rootObj)\n rootObjProps[prop] = tru
e;\n\n if (objects.indexOf(obj) < 0) {\n objects.push(obj);\n
Object.observe(obj, callback);\n }\n\n observe(Object.getPrototypeOf(
obj), prop);\n }\n\n function allRootObjNonObservedProps(recs) {\n fo
r (var i = 0; i < recs.length; i++) {\n var rec = recs[i];\n if (r
ec.object !== rootObj ||\n rootObjProps[rec.name] ||\n rec
.type === 'setPrototype') {\n return false;\n }\n }\n
return true;\n }\n\n function callback(recs) {\n if (allRootObjNonObs
ervedProps(recs))\n return;\n\n var observer;\n for (var i = 0;
i < observers.length; i++) {\n observer = observers[i];\n if (obs
erver.state_ == OPENED) {\n observer.iterateObjects_(observe);\n
}\n }\n\n for (var i = 0; i < observers.length; i++) {\n obser
ver = observers[i];\n if (observer.state_ == OPENED) {\n observe
r.check_();\n }\n }\n }\n\n var record = {\n object: unde
fined,\n objects: objects,\n open: function(obs, object) {\n if
(!rootObj) {\n rootObj = object;\n rootObjProps = {};\n
}\n\n observers.push(obs);\n observerCount++;\n obs.itera
teObjects_(observe);\n },\n close: function(obs) {\n observerCo
unt--;\n if (observerCount > 0) {\n return;\n }\n\n
for (var i = 0; i < objects.length; i++) {\n Object.unobserve(objects
[i], callback);\n Observer.unobservedCount++;\n }\n\n obs
ervers.length = 0;\n objects.length = 0;\n rootObj = undefined;\n
rootObjProps = undefined;\n observedSetCache.push(this);\n }\
n };\n\n return record;\n }\n\n var lastObservedSet;\n\n function getOb
servedSet(observer, obj) {\n if (!lastObservedSet || lastObservedSet.object !
== obj) {\n lastObservedSet = observedSetCache.pop() || newObservedSet();\n
lastObservedSet.object = obj;\n }\n lastObservedSet.open(observer, o
bj);\n return lastObservedSet;\n }\n\n var UNOPENED = 0;\n var OPENED = 1;
\n var CLOSED = 2;\n var RESETTING = 3;\n\n var nextObserverId = 1;\n\n func
tion Observer() {\n this.state_ = UNOPENED;\n this.callback_ = undefined;\
n this.target_ = undefined; // TODO(rafaelw): Should be WeakRef\n this.dir
ectObserver_ = undefined;\n this.value_ = undefined;\n this.id_ = nextObse
rverId++;\n }\n\n Observer.prototype = {\n open: function(callback, target)
{\n if (this.state_ != UNOPENED)\n throw Error('Observer has alread
y been opened.');\n\n addToAll(this);\n this.callback_ = callback;\n
this.target_ = target;\n this.connect_();\n this.state_ = OPENED;\
n return this.value_;\n },\n\n close: function() {\n if (this.st
ate_ != OPENED)\n return;\n\n removeFromAll(this);\n this.disco
nnect_();\n this.value_ = undefined;\n this.callback_ = undefined;\n
this.target_ = undefined;\n this.state_ = CLOSED;\n },\n\n delive
r: function() {\n if (this.state_ != OPENED)\n return;\n\n dirt
yCheck(this);\n },\n\n report_: function(changes) {\n try {\n
this.callback_.apply(this.target_, changes);\n } catch (ex) {\n Obse
rver._errorThrownDuringCallback = true;\n console.error('Exception caught
during observer callback: ' +\n (ex.stack || ex));\n
}\n },\n\n discardChanges: function() {\n this.check_(undefined, tru
e);\n return this.value_;\n }\n }\n\n var collectObservers = !hasObser
ve;\n var allObservers;\n Observer._allObserversCount = 0;\n\n if (collectObs
ervers) {\n allObservers = [];\n }\n\n function addToAll(observer) {\n O
bserver._allObserversCount++;\n if (!collectObservers)\n return;\n\n
allObservers.push(observer);\n }\n\n function removeFromAll(observer) {\n O
bserver._allObserversCount--;\n }\n\n var runningMicrotaskCheckpoint = false;\
n\n var hasDebugForceFullDelivery = hasObserve && hasEval && (function() {\n
try {\n eval('%RunMicrotasks()');\n return true;\n } catch (ex) {\
n return false;\n }\n })();\n\n global.Platform = global.Platform || {
};\n\n global.Platform.performMicrotaskCheckpoint = function() {\n if (runni
ngMicrotaskCheckpoint)\n return;\n\n if (hasDebugForceFullDelivery) {\n
eval('%RunMicrotasks()');\n return;\n }\n\n if (!collectObserver
s)\n return;\n\n runningMicrotaskCheckpoint = true;\n\n var cycles =
0;\n var anyChanged, toCheck;\n\n do {\n cycles++;\n toCheck = a
llObservers;\n allObservers = [];\n anyChanged = false;\n\n for (
var i = 0; i < toCheck.length; i++) {\n var observer = toCheck[i];\n
if (observer.state_ != OPENED)\n continue;\n\n if (observer.c
heck_())\n anyChanged = true;\n\n allObservers.push(observer);\n
}\n if (runEOMTasks())\n anyChanged = true;\n } while (cycl
es < MAX_DIRTY_CHECK_CYCLES && anyChanged);\n\n if (global.testingExposeCycle
Count)\n global.dirtyCheckCycleCount = cycles;\n\n runningMicrotaskCheck
point = false;\n };\n\n if (collectObservers) {\n global.Platform.clearObse
rvers = function() {\n allObservers = [];\n };\n }\n\n function Object
Observer(object) {\n Observer.call(this);\n this.value_ = object;\n thi
s.oldObject_ = undefined;\n }\n\n ObjectObserver.prototype = createObject({\n
__proto__: Observer.prototype,\n\n arrayObserve: false,\n\n connect_: f
unction(callback, target) {\n if (hasObserve) {\n this.directObserve
r_ = getObservedObject(this, this.value_,\n
this.arrayObserve);\n } else {\n this.oldObject_ = this.
copyObject(this.value_);\n }\n\n },\n\n copyObject: function(object)
{\n var copy = Array.isArray(object) ? [] : {};\n for (var prop in obj
ect) {\n copy[prop] = object[prop];\n };\n if (Array.isArray(ob
ject))\n copy.length = object.length;\n return copy;\n },\n\n
check_: function(changeRecords, skipChanges) {\n var diff;\n var oldVa
lues;\n if (hasObserve) {\n if (!changeRecords)\n return fa
lse;\n\n oldValues = {};\n diff = diffObjectFromChangeRecords(this
.value_, changeRecords,\n oldValues);\
n } else {\n oldValues = this.oldObject_;\n diff = diffObject
FromOldObject(this.value_, this.oldObject_);\n }\n\n if (diffIsEmpty(d
iff))\n return false;\n\n if (!hasObserve)\n this.oldObject_
= this.copyObject(this.value_);\n\n this.report_([\n diff.added || {
},\n diff.removed || {},\n diff.changed || {},\n function(p
roperty) {\n return oldValues[property];\n }\n ]);\n\n
return true;\n },\n\n disconnect_: function() {\n if (hasObserve) {\
n this.directObserver_.close();\n this.directObserver_ = undefined
;\n } else {\n this.oldObject_ = undefined;\n }\n },\n\n
deliver: function() {\n if (this.state_ != OPENED)\n return;\n\n
if (hasObserve)\n this.directObserver_.deliver(false);\n else\n
dirtyCheck(this);\n },\n\n discardChanges: function() {\n if (th
is.directObserver_)\n this.directObserver_.deliver(true);\n else\n
this.oldObject_ = this.copyObject(this.value_);\n\n return this.value
_;\n }\n });\n\n function ArrayObserver(array) {\n if (!Array.isArray(ar
ray))\n throw Error('Provided object is not an Array');\n ObjectObserver
.call(this, array);\n }\n\n ArrayObserver.prototype = createObject({\n\n __
proto__: ObjectObserver.prototype,\n\n arrayObserve: true,\n\n copyObject:
function(arr) {\n return arr.slice();\n },\n\n check_: function(chan
geRecords) {\n var splices;\n if (hasObserve) {\n if (!changeRe
cords)\n return false;\n splices = projectArraySplices(this.valu
e_, changeRecords);\n } else {\n splices = calcSplices(this.value_,
0, this.value_.length,\n this.oldObject_, 0, this.o
ldObject_.length);\n }\n\n if (!splices || !splices.length)\n r
eturn false;\n\n if (!hasObserve)\n this.oldObject_ = this.copyObjec
t(this.value_);\n\n this.report_([splices]);\n return true;\n }\n
});\n\n ArrayObserver.applySplices = function(previous, current, splices) {\n
splices.forEach(function(splice) {\n var spliceArgs = [splice.index, spli
ce.removed.length];\n var addIndex = splice.index;\n while (addIndex <
splice.index + splice.addedCount) {\n spliceArgs.push(current[addIndex])
;\n addIndex++;\n }\n\n Array.prototype.splice.apply(previous,
spliceArgs);\n });\n };\n\n function PathObserver(object, path) {\n Obse
rver.call(this);\n\n this.object_ = object;\n this.path_ = getPath(path);\
n this.directObserver_ = undefined;\n }\n\n PathObserver.prototype = create
Object({\n __proto__: Observer.prototype,\n\n get path() {\n return t
his.path_;\n },\n\n connect_: function() {\n if (hasObserve)\n
this.directObserver_ = getObservedSet(this, this.object_);\n\n this.check_
(undefined, true);\n },\n\n disconnect_: function() {\n this.value_ =
undefined;\n\n if (this.directObserver_) {\n this.directObserver_.c
lose(this);\n this.directObserver_ = undefined;\n }\n },\n\n i
terateObjects_: function(observe) {\n this.path_.iterateObjects(this.object
_, observe);\n },\n\n check_: function(changeRecords, skipChanges) {\n
var oldValue = this.value_;\n this.value_ = this.path_.getValueFrom(this.
object_);\n if (skipChanges || areSameValue(this.value_, oldValue))\n
return false;\n\n this.report_([this.value_, oldValue, this]);\n ret
urn true;\n },\n\n setValue: function(newValue) {\n if (this.path_)\n
this.path_.setValueFrom(this.object_, newValue);\n }\n });\n\n func
tion CompoundObserver(reportChangesOnOpen) {\n Observer.call(this);\n\n th
is.reportChangesOnOpen_ = reportChangesOnOpen;\n this.value_ = [];\n this.
directObserver_ = undefined;\n this.observed_ = [];\n }\n\n var observerSen
tinel = {};\n\n CompoundObserver.prototype = createObject({\n __proto__: Obs
erver.prototype,\n\n connect_: function() {\n if (hasObserve) {\n
var object;\n var needsDirectObserver = false;\n for (var i = 0;
i < this.observed_.length; i += 2) {\n object = this.observed_[i]\n
if (object !== observerSentinel) {\n needsDirectObserver = true
;\n break;\n }\n }\n\n if (needsDirectObserver
)\n this.directObserver_ = getObservedSet(this, object);\n }\n\n
this.check_(undefined, !this.reportChangesOnOpen_);\n },\n\n disconnec
t_: function() {\n for (var i = 0; i < this.observed_.length; i += 2) {\n
if (this.observed_[i] === observerSentinel)\n this.observed_[i +
1].close();\n }\n this.observed_.length = 0;\n this.value_.length
= 0;\n\n if (this.directObserver_) {\n this.directObserver_.close(t
his);\n this.directObserver_ = undefined;\n }\n },\n\n addPath
: function(object, path) {\n if (this.state_ != UNOPENED && this.state_ !=
RESETTING)\n throw Error('Cannot add paths once started.');\n\n var
path = getPath(path);\n this.observed_.push(object, path);\n if (!this
.reportChangesOnOpen_)\n return;\n var index = this.observed_.length
/ 2 - 1;\n this.value_[index] = path.getValueFrom(object);\n },\n\n
addObserver: function(observer) {\n if (this.state_ != UNOPENED && this.sta
te_ != RESETTING)\n throw Error('Cannot add observers once started.');\n\
n this.observed_.push(observerSentinel, observer);\n if (!this.reportC
hangesOnOpen_)\n return;\n var index = this.observed_.length / 2 - 1
;\n this.value_[index] = observer.open(this.deliver, this);\n },\n\n
startReset: function() {\n if (this.state_ != OPENED)\n throw Error(
'Can only reset while open');\n\n this.state_ = RESETTING;\n this.disc
onnect_();\n },\n\n finishReset: function() {\n if (this.state_ != RE
SETTING)\n throw Error('Can only finishReset after startReset');\n t
his.state_ = OPENED;\n this.connect_();\n\n return this.value_;\n }
,\n\n iterateObjects_: function(observe) {\n var object;\n for (var
i = 0; i < this.observed_.length; i += 2) {\n object = this.observed_[i]
\n if (object !== observerSentinel)\n this.observed_[i + 1].iter
ateObjects(object, observe)\n }\n },\n\n check_: function(changeRecor
ds, skipChanges) {\n var oldValues;\n for (var i = 0; i < this.observe
d_.length; i += 2) {\n var object = this.observed_[i];\n var path
= this.observed_[i+1];\n var value;\n if (object === observerSenti
nel) {\n var observable = path;\n value = this.state_ === UNOP
ENED ?\n observable.open(this.deliver, this) :\n obser
vable.discardChanges();\n } else {\n value = path.getValueFrom(o
bject);\n }\n\n if (skipChanges) {\n this.value_[i / 2] =
value;\n continue;\n }\n\n if (areSameValue(value, this.
value_[i / 2]))\n continue;\n\n oldValues = oldValues || [];\n
oldValues[i / 2] = this.value_[i / 2];\n this.value_[i / 2] = value
;\n }\n\n if (!oldValues)\n return false;\n\n // TODO(rafa
elw): Having observed_ as the third callback arg here is\n // pretty lame A
PI. Fix.\n this.report_([this.value_, oldValues, this.observed_]);\n r
eturn true;\n }\n });\n\n function identFn(value) { return value; }\n\n fu
nction ObserverTransform(observable, getValueFn, setValueFn,\n
dontPassThroughSet) {\n this.callback_ = undefined;\n this.targ
et_ = undefined;\n this.value_ = undefined;\n this.observable_ = observabl
e;\n this.getValueFn_ = getValueFn || identFn;\n this.setValueFn_ = setVal
ueFn || identFn;\n // TODO(rafaelw): This is a temporary hack. PolymerExpress
ions needs this\n // at the moment because of a bug in it's dependency tracki
ng.\n this.dontPassThroughSet_ = dontPassThroughSet;\n }\n\n ObserverTransf
orm.prototype = {\n open: function(callback, target) {\n this.callback_
= callback;\n this.target_ = target;\n this.value_ =\n this.g
etValueFn_(this.observable_.open(this.observedCallback_, this));\n return t
his.value_;\n },\n\n observedCallback_: function(value) {\n value = t
his.getValueFn_(value);\n if (areSameValue(value, this.value_))\n re
turn;\n var oldValue = this.value_;\n this.value_ = value;\n this
.callback_.call(this.target_, this.value_, oldValue);\n },\n\n discardChan
ges: function() {\n this.value_ = this.getValueFn_(this.observable_.discard
Changes());\n return this.value_;\n },\n\n deliver: function() {\n
return this.observable_.deliver();\n },\n\n setValue: function(value) {
\n value = this.setValueFn_(value);\n if (!this.dontPassThroughSet_ &&
this.observable_.setValue)\n return this.observable_.setValue(value);\n
},\n\n close: function() {\n if (this.observable_)\n this.obse
rvable_.close();\n this.callback_ = undefined;\n this.target_ = undefi
ned;\n this.observable_ = undefined;\n this.value_ = undefined;\n
this.getValueFn_ = undefined;\n this.setValueFn_ = undefined;\n }\n }\
n\n var expectedRecordTypes = {\n add: true,\n update: true,\n delete:
true\n };\n\n function diffObjectFromChangeRecords(object, changeRecords, old
Values) {\n var added = {};\n var removed = {};\n\n for (var i = 0; i <
changeRecords.length; i++) {\n var record = changeRecords[i];\n if (!
expectedRecordTypes[record.type]) {\n console.error('Unknown changeRecord
type: ' + record.type);\n console.error(record);\n continue;\n
}\n\n if (!(record.name in oldValues))\n oldValues[record.name] =
record.oldValue;\n\n if (record.type == 'update')\n continue;\n\n
if (record.type == 'add') {\n if (record.name in removed)\n
delete removed[record.name];\n else\n added[record.name] = true;
\n\n continue;\n }\n\n // type = 'delete'\n if (record.nam
e in added) {\n delete added[record.name];\n delete oldValues[reco
rd.name];\n } else {\n removed[record.name] = true;\n }\n }\
n\n for (var prop in added)\n added[prop] = object[prop];\n\n for (va
r prop in removed)\n removed[prop] = undefined;\n\n var changed = {};\n
for (var prop in oldValues) {\n if (prop in added || prop in removed)\n
continue;\n\n var newValue = object[prop];\n if (oldValues[prop
] !== newValue)\n changed[prop] = newValue;\n }\n\n return {\n
added: added,\n removed: removed,\n changed: changed\n };\n }\n\n
function newSplice(index, removed, addedCount) {\n return {\n index: i
ndex,\n removed: removed,\n addedCount: addedCount\n };\n }\n\n v
ar EDIT_LEAVE = 0;\n var EDIT_UPDATE = 1;\n var EDIT_ADD = 2;\n var EDIT_DELE
TE = 3;\n\n function ArraySplice() {}\n\n ArraySplice.prototype = {\n\n //
Note: This function is *based* on the computation of the Levenshtein\n // \"e
dit\" distance. The one change is that \"updates\" are treated as two\n // ed
its - not one. With Array splices, an update is really a delete\n // followed
by an add. By retaining this, we optimize for \"keeping\" the\n // maximum a
rray items in the original array. For example:\n //\n // 'xxxx123' -> '1
23yyyy'\n //\n // With 1-edit updates, the shortest path would be just to
update all seven\n // characters. With 2-edit updates, we delete 4, leave 3,
and add 4. This\n // leaves the substring '123' intact.\n calcEditDistance
s: function(current, currentStart, currentEnd,\n
old, oldStart, oldEnd) {\n // \"Deletion\" columns\n var rowCount = ol
dEnd - oldStart + 1;\n var columnCount = currentEnd - currentStart + 1;\n
var distances = new Array(rowCount);\n\n // \"Addition\" rows. Initiali
ze null column.\n for (var i = 0; i < rowCount; i++) {\n distances[i
] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // I
nitialize null row\n for (var j = 0; j < columnCount; j++)\n distanc
es[0][j] = j;\n\n for (var i = 1; i < rowCount; i++) {\n for (var j
= 1; j < columnCount; j++) {\n if (this.equals(current[currentStart + j
- 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j
- 1];\n else {\n var north = distances[i - 1][j] + 1;\n
var west = distances[i][j - 1] + 1;\n distances[i][j] = north
< west ? north : west;\n }\n }\n }\n\n return distanc
es;\n },\n\n // This starts at the final weight, and walks \"backward\" by
finding\n // the minimum previous weight recursively until the origin of the
weight\n // matrix.\n spliceOperationsFromEditDistances: function(distanc
es) {\n var i = distances.length - 1;\n var j = distances[0].length -
1;\n var current = distances[i][j];\n var edits = [];\n while (i
> 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n
j--;\n continue;\n }\n if (j == 0) {\n edits.
push(EDIT_DELETE);\n i--;\n continue;\n }\n var
northWest = distances[i - 1][j - 1];\n var west = distances[i - 1][j];\n
var north = distances[i][j - 1];\n\n var min;\n if (west <
north)\n min = west < northWest ? west : northWest;\n else\n
min = north < northWest ? north : northWest;\n\n if (min == northWe
st) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE)
;\n } else {\n edits.push(EDIT_UPDATE);\n current
= northWest;\n }\n i--;\n j--;\n } else if (m
in == west) {\n edits.push(EDIT_DELETE);\n i--;\n cur
rent = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\
n current = north;\n }\n }\n\n edits.reverse();\n
return edits;\n },\n\n /**\n * Splice Projection functions:\n *\n
* A splice map is a representation of how a previous array of items\n *
was transformed into a new array of items. Conceptually it is a list of\n *
tuples of\n *\n * <index, removed, addedCount>\n *\n * which
are kept in ascending index order of. The tuple represents that at\n * the |
index|, |removed| sequence of items were removed, and counting forward\n * f
rom |index|, |addedCount| items were added.\n */\n\n /**\n * Lacking
individual splice mutation information, the minimal set of\n * splices can b
e synthesized given the previous state and final state of an\n * array. The
basic approach is to calculate the edit distance matrix and\n * choose the s
hortest path through it.\n *\n * Complexity: O(l * p)\n * l: The l
ength of the current array\n * p: The length of the old array\n */\n
calcSplices: function(current, currentStart, currentEnd,\n
old, oldStart, oldEnd) {\n var prefixCount = 0;\n var suffixCoun
t = 0;\n\n var minLength = Math.min(currentEnd - currentStart, oldEnd - old
Start);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = th
is.sharedPrefix(current, old, minLength);\n\n if (currentEnd == current.len
gth && oldEnd == old.length)\n suffixCount = this.sharedSuffix(current, o
ld, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldSt
art += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCou
nt;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n
return [];\n\n if (currentStart == currentEnd) {\n var splice =
newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n sp
lice.removed.push(old[oldStart++]);\n\n return [ splice ];\n } else
if (oldStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd
- currentStart) ];\n\n var ops = this.spliceOperationsFromEditDistances(\n
this.calcEditDistances(current, currentStart, currentEnd,\n
old, oldStart, oldEnd));\n\n var splice = undefined;\
n var splices = [];\n var index = currentStart;\n var oldIndex =
oldStart;\n for (var i = 0; i < ops.length; i++) {\n switch(ops[i])
{\n case EDIT_LEAVE:\n if (splice) {\n splices.
push(splice);\n splice = undefined;\n }\n\n i
ndex++;\n oldIndex++;\n break;\n case EDIT_UPDATE
:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n
splice.addedCount++;\n index++;\n\n splice.rem
oved.push(old[oldIndex]);\n oldIndex++;\n break;\n
case EDIT_ADD:\n if (!splice)\n splice = newSplice(ind
ex, [], 0);\n\n splice.addedCount++;\n index++;\n
break;\n case EDIT_DELETE:\n if (!splice)\n
splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldInde
x]);\n oldIndex++;\n break;\n }\n }\n\n i
f (splice) {\n splices.push(splice);\n }\n return splices;\n
},\n\n sharedPrefix: function(current, old, searchLength) {\n for (var
i = 0; i < searchLength; i++)\n if (!this.equals(current[i], old[i]))\n
return i;\n return searchLength;\n },\n\n sharedSuffix: funct
ion(current, old, searchLength) {\n var index1 = current.length;\n var
index2 = old.length;\n var count = 0;\n while (count < searchLength &
& this.equals(current[--index1], old[--index2]))\n count++;\n\n retu
rn count;\n },\n\n calculateSplices: function(current, previous) {\n
return this.calcSplices(current, 0, current.length, previous, 0,\n
previous.length);\n },\n\n equals: function(currentValue,
previousValue) {\n return currentValue === previousValue;\n }\n };\n\n
var arraySplice = new ArraySplice();\n\n function calcSplices(current, current
Start, currentEnd,\n old, oldStart, oldEnd) {\n return
arraySplice.calcSplices(current, currentStart, currentEnd,\n
old, oldStart, oldEnd);\n }\n\n function intersect(start1, end1
, start2, end2) {\n // Disjoint\n if (end1 < start2 || end2 < start1)\n
return -1;\n\n // Adjacent\n if (end1 == start2 || end2 == start1)\n
return 0;\n\n // Non-zero intersect, span1 first\n if (start1 < start2)
{\n if (end1 < end2)\n return end1 - start2; // Overlap\n else
\n return end2 - start2; // Contained\n } else {\n // Non-zero in
tersect, span2 first\n if (end2 < end1)\n return end2 - start1; // O
verlap\n else\n return end1 - start1; // Contained\n }\n }\n\n
function mergeSplice(splices, index, removed, addedCount) {\n\n var splice =
newSplice(index, removed, addedCount);\n\n var inserted = false;\n var ins
ertionOffset = 0;\n\n for (var i = 0; i < splices.length; i++) {\n var c
urrent = splices[i];\n current.index += insertionOffset;\n\n if (inser
ted)\n continue;\n\n var intersectCount = intersect(splice.index,\n
splice.index + splice.removed.length,\n
current.index,\n
current.index + current.addedCount);\n\n if (intersectCount >= 0) {\n
// Merge the two splices\n\n splices.splice(i, 1);\n i--;\n
\n insertionOffset -= current.addedCount - current.removed.length;\n\n
splice.addedCount += current.addedCount - intersectCount;\n var dele
teCount = splice.removed.length +\n current.removed.len
gth - intersectCount;\n\n if (!splice.addedCount && !deleteCount) {\n
// merged splice is a noop. discard.\n inserted = true;\n
} else {\n var removed = current.removed;\n\n if (splice.index
< current.index) {\n // some prefix of splice.removed is prepended t
o current.removed.\n var prepend = splice.removed.slice(0, current.in
dex - splice.index);\n Array.prototype.push.apply(prepend, removed);\
n removed = prepend;\n }\n\n if (splice.index + spl
ice.removed.length > current.index + current.addedCount) {\n // some
suffix of splice.removed is appended to current.removed.\n var append
= splice.removed.slice(current.index + current.addedCount - splice.index);\n
Array.prototype.push.apply(removed, append);\n }\n\n
splice.removed = removed;\n if (current.index < splice.index) {\n
splice.index = current.index;\n }\n }\n } else if (sp
lice.index < current.index) {\n // Insert splice here.\n\n inserte
d = true;\n\n splices.splice(i, 0, splice);\n i++;\n\n var
offset = splice.addedCount - splice.removed.length\n current.index += off
set;\n insertionOffset += offset;\n }\n }\n\n if (!inserted)\n
splices.push(splice);\n }\n\n function createInitialSplices(array, chang
eRecords) {\n var splices = [];\n\n for (var i = 0; i < changeRecords.leng
th; i++) {\n var record = changeRecords[i];\n switch(record.type) {\n
case 'splice':\n mergeSplice(splices, record.index, record.remov
ed.slice(), record.addedCount);\n break;\n case 'add':\n
case 'update':\n case 'delete':\n if (!isIndex(record.name))\n
continue;\n var index = toNumber(record.name);\n if
(index < 0)\n continue;\n mergeSplice(splices, index, [recor
d.oldValue], 1);\n break;\n default:\n console.error('U
nexpected record type: ' + JSON.stringify(record));\n break;\n }\n
}\n\n return splices;\n }\n\n function projectArraySplices(array, chang
eRecords) {\n var splices = [];\n\n createInitialSplices(array, changeReco
rds).forEach(function(splice) {\n if (splice.addedCount == 1 && splice.remo
ved.length == 1) {\n if (splice.removed[0] !== array[splice.index])\n
splices.push(splice);\n\n return\n };\n\n splices = splic
es.concat(calcSplices(array, splice.index, splice.index + splice.addedCount,\n
splice.removed, 0, splice.removed.lengt
h));\n });\n\n return splices;\n }\n\n global.Observer = Observer;\n gl
obal.Observer.runEOM_ = runEOM;\n global.Observer.observerSentinel_ = observerS
entinel; // for testing.\n global.Observer.hasObjectObserve = hasObserve;\n gl
obal.ArrayObserver = ArrayObserver;\n global.ArrayObserver.calculateSplices = f
unction(current, previous) {\n return arraySplice.calculateSplices(current, p
revious);\n };\n\n global.ArraySplice = ArraySplice;\n global.ObjectObserver
= ObjectObserver;\n global.PathObserver = PathObserver;\n global.CompoundObser
ver = CompoundObserver;\n global.Path = Path;\n global.ObserverTransform = Obs
erverTransform;\n})(typeof global !== 'undefined' && global && typeof module !==
'undefined' && module ? global : this || window);\n", | 92 "// Copyright 2012 Google Inc.\n//\n// Licensed under the Apache License, Ve
rsion 2.0 (the \"License\");\n// you may not use this file except in compliance
with the License.\n// You may obtain a copy of the License at\n//\n// http:/
/www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o
r agreed to in writing, software\n// distributed under the License is distribute
d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe
r express or implied.\n// See the License for the specific language governing pe
rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use
strict';\n\n var testingExposeCycleCount = global.testingExposeCycleCount;\n\n
// Detect and do basic sanity checking on Object/Array.observe.\n function det
ectObjectObserve() {\n if (typeof Object.observe !== 'function' ||\n t
ypeof Array.observe !== 'function') {\n return false;\n }\n\n var rec
ords = [];\n\n function callback(recs) {\n records = recs;\n }\n\n
var test = {};\n var arr = [];\n Object.observe(test, callback);\n Arr
ay.observe(arr, callback);\n test.id = 1;\n test.id = 2;\n delete test.
id;\n arr.push(1, 2);\n arr.length = 0;\n\n Object.deliverChangeRecords
(callback);\n if (records.length !== 5)\n return false;\n\n if (recor
ds[0].type != 'add' ||\n records[1].type != 'update' ||\n records[
2].type != 'delete' ||\n records[3].type != 'splice' ||\n records[
4].type != 'splice') {\n return false;\n }\n\n Object.unobserve(test,
callback);\n Array.unobserve(arr, callback);\n\n return true;\n }\n\n v
ar hasObserve = detectObjectObserve();\n\n function detectEval() {\n // Don'
t test for eval if we're running in a Chrome App environment.\n // We check f
or APIs set that only exist in a Chrome App context.\n if (typeof chrome !==
'undefined' && chrome.app && chrome.app.runtime) {\n return false;\n }\n
\n // Firefox OS Apps do not allow eval. This feature detection is very hacky
\n // but even if some other platform adds support for this function this cod
e\n // will continue to work.\n if (navigator.getDeviceStorage) {\n r
eturn false;\n }\n\n try {\n var f = new Function('', 'return true;')
;\n return f();\n } catch (ex) {\n return false;\n }\n }\n\n v
ar hasEval = detectEval();\n\n function isIndex(s) {\n return +s === s >>> 0
;\n }\n\n function toNumber(s) {\n return +s;\n }\n\n function isObject(o
bj) {\n return obj === Object(obj);\n }\n\n var numberIsNaN = global.Number
.isNaN || function(value) {\n return typeof value === 'number' && global.isNa
N(value);\n }\n\n function areSameValue(left, right) {\n if (left === right
)\n return left !== 0 || 1 / left === 1 / right;\n if (numberIsNaN(left)
&& numberIsNaN(right))\n return true;\n\n return left !== left && right
!== right;\n }\n\n var createObject = ('__proto__' in {}) ?\n function(obj
) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n
if (!proto)\n return obj;\n var newObject = Object.create(proto);\
n Object.getOwnPropertyNames(obj).forEach(function(name) {\n Object.
defineProperty(newObject, name,\n Object.getOwnPrope
rtyDescriptor(obj, name));\n });\n return newObject;\n };\n\n var
identStart = '[\\$_a-zA-Z]';\n var identPart = '[\\$_a-zA-Z0-9]';\n var identR
egExp = new RegExp('^' + identStart + '+' + identPart + '*' + '$');\n\n functio
n getPathCharType(char) {\n if (char === undefined)\n return 'eof';\n\n
var code = char.charCodeAt(0);\n\n switch(code) {\n case 0x5B: // [\n
case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case
0x27: // '\n case 0x30: // 0\n return char;\n\n case 0x5F: //
_\n case 0x24: // $\n return 'ident';\n\n case 0x20: // Space\n
case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return
\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n
case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator
\n return 'ws';\n }\n\n // a-z, A-Z\n if ((0x61 <= code && code
<= 0x7A) || (0x41 <= code && code <= 0x5A))\n return 'ident';\n\n // 1-9
\n if (0x31 <= code && code <= 0x39)\n return 'number';\n\n return 'e
lse';\n }\n\n var pathStateMachine = {\n 'beforePath': {\n 'ws': ['bef
orePath'],\n 'ident': ['inIdent', 'append'],\n '[': ['beforeElement'],
\n 'eof': ['afterPath']\n },\n\n 'inPath': {\n 'ws': ['inPath'],
\n '.': ['beforeIdent'],\n '[': ['beforeElement'],\n 'eof': ['aft
erPath']\n },\n\n 'beforeIdent': {\n 'ws': ['beforeIdent'],\n 'i
dent': ['inIdent', 'append']\n },\n\n 'inIdent': {\n 'ident': ['inIde
nt', 'append'],\n '0': ['inIdent', 'append'],\n 'number': ['inIdent',
'append'],\n 'ws': ['inPath', 'push'],\n '.': ['beforeIdent', 'push'],
\n '[': ['beforeElement', 'push'],\n 'eof': ['afterPath', 'push']\n
},\n\n 'beforeElement': {\n 'ws': ['beforeElement'],\n '0': ['afte
rZero', 'append'],\n 'number': ['inIndex', 'append'],\n \"'\": ['inSin
gleQuote', 'append', ''],\n '\"': ['inDoubleQuote', 'append', '']\n },\n
\n 'afterZero': {\n 'ws': ['afterElement', 'push'],\n ']': ['inPath
', 'push']\n },\n\n 'inIndex': {\n '0': ['inIndex', 'append'],\n
'number': ['inIndex', 'append'],\n 'ws': ['afterElement'],\n ']': ['i
nPath', 'push']\n },\n\n 'inSingleQuote': {\n \"'\": ['afterElement']
,\n 'eof': ['error'],\n 'else': ['inSingleQuote', 'append']\n },\n\
n 'inDoubleQuote': {\n '\"': ['afterElement'],\n 'eof': ['error'],\
n 'else': ['inDoubleQuote', 'append']\n },\n\n 'afterElement': {\n
'ws': ['afterElement'],\n ']': ['inPath', 'push']\n }\n }\n\n funct
ion noop() {}\n\n function parsePath(path) {\n var keys = [];\n var index
= -1;\n var c, newChar, key, type, transition, action, typeMap, mode = 'befo
rePath';\n\n var actions = {\n push: function() {\n if (key === u
ndefined)\n return;\n\n keys.push(key);\n key = undefined
;\n },\n\n append: function() {\n if (key === undefined)\n
key = newChar\n else\n key += newChar;\n }\n };\n\n
function maybeUnescapeQuote() {\n if (index >= path.length)\n re
turn;\n\n var nextChar = path[index + 1];\n if ((mode == 'inSingleQuot
e' && nextChar == \"'\") ||\n (mode == 'inDoubleQuote' && nextChar == '
\"')) {\n index++;\n newChar = nextChar;\n actions.append()
;\n return true;\n }\n }\n\n while (mode) {\n index++;\n
c = path[index];\n\n if (c == '\\\\' && maybeUnescapeQuote(mode))\n
continue;\n\n type = getPathCharType(c);\n typeMap = pathStateMac
hine[mode];\n transition = typeMap[type] || typeMap['else'] || 'error';\n\n
if (transition == 'error')\n return; // parse error;\n\n mode
= transition[0];\n action = actions[transition[1]] || noop;\n newChar
= transition[2] === undefined ? c : transition[2];\n action();\n\n if
(mode === 'afterPath') {\n return keys;\n }\n }\n\n return; //
parse error\n }\n\n function isIdent(s) {\n return identRegExp.test(s);\n
}\n\n var constructorIsPrivate = {};\n\n function Path(parts, privateToken) {
\n if (privateToken !== constructorIsPrivate)\n throw Error('Use Path.ge
t to retrieve path objects');\n\n for (var i = 0; i < parts.length; i++) {\n
this.push(String(parts[i]));\n }\n\n if (hasEval && this.length) {\n
this.getValueFrom = this.compiledGetValueFromFn();\n }\n }\n\n // TODO
(rafaelw): Make simple LRU cache\n var pathCache = {};\n\n function getPath(pa
thString) {\n if (pathString instanceof Path)\n return pathString;\n\n
if (pathString == null || pathString.length == 0)\n pathString = '';\n\n
if (typeof pathString != 'string') {\n if (isIndex(pathString.length)) {
\n // Constructed with array-like (pre-parsed) keys\n return new P
ath(pathString, constructorIsPrivate);\n }\n\n pathString = String(pat
hString);\n }\n\n var path = pathCache[pathString];\n if (path)\n
return path;\n\n var parts = parsePath(pathString);\n if (!parts)\n r
eturn invalidPath;\n\n var path = new Path(parts, constructorIsPrivate);\n
pathCache[pathString] = path;\n return path;\n }\n\n Path.get = getPath;\n
\n function formatAccessor(key) {\n if (isIndex(key)) {\n return '[' +
key + ']';\n } else {\n return '[\"' + key.replace(/\"/g, '\\\\\"') + '\
"]';\n }\n }\n\n Path.prototype = createObject({\n __proto__: [],\n v
alid: true,\n\n toString: function() {\n var pathString = '';\n for
(var i = 0; i < this.length; i++) {\n var key = this[i];\n if (is
Ident(key)) {\n pathString += i ? '.' + key : key;\n } else {\n
pathString += formatAccessor(key);\n }\n }\n\n return
pathString;\n },\n\n getValueFrom: function(obj, directObserver) {\n
for (var i = 0; i < this.length; i++) {\n if (obj == null)\n ret
urn;\n obj = obj[this[i]];\n }\n return obj;\n },\n\n ite
rateObjects: function(obj, observe) {\n for (var i = 0; i < this.length; i+
+) {\n if (i)\n obj = obj[this[i - 1]];\n if (!isObject(o
bj))\n return;\n observe(obj, this[0]);\n }\n },\n\n
compiledGetValueFromFn: function() {\n var str = '';\n var pathString
= 'obj';\n str += 'if (obj != null';\n var i = 0;\n var key;\n
for (; i < (this.length - 1); i++) {\n key = this[i];\n pathStr
ing += isIdent(key) ? '.' + key : formatAccessor(key);\n str += ' &&\\n
' + pathString + ' != null';\n }\n str += ')\\n';\n\n var key
= this[i];\n pathString += isIdent(key) ? '.' + key : formatAccessor(key);\
n\n str += ' return ' + pathString + ';\\nelse\\n return undefined;';\n
return new Function('obj', str);\n },\n\n setValueFrom: function(obj,
value) {\n if (!this.length)\n return false;\n\n for (var i = 0
; i < this.length - 1; i++) {\n if (!isObject(obj))\n return fal
se;\n obj = obj[this[i]];\n }\n\n if (!isObject(obj))\n
return false;\n\n obj[this[i]] = value;\n return true;\n }\n });\n
\n var invalidPath = new Path('', constructorIsPrivate);\n invalidPath.valid =
false;\n invalidPath.getValueFrom = invalidPath.setValueFrom = function() {};\
n\n var MAX_DIRTY_CHECK_CYCLES = 1000;\n\n function dirtyCheck(observer) {\n
var cycles = 0;\n while (cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_
()) {\n cycles++;\n }\n if (testingExposeCycleCount)\n global.di
rtyCheckCycleCount = cycles;\n\n return cycles > 0;\n }\n\n function object
IsEmpty(object) {\n for (var prop in object)\n return false;\n return
true;\n }\n\n function diffIsEmpty(diff) {\n return objectIsEmpty(diff.add
ed) &&\n objectIsEmpty(diff.removed) &&\n objectIsEmpty(diff
.changed);\n }\n\n function diffObjectFromOldObject(object, oldObject) {\n
var added = {};\n var removed = {};\n var changed = {};\n\n for (var pr
op in oldObject) {\n var newValue = object[prop];\n\n if (newValue !==
undefined && newValue === oldObject[prop])\n continue;\n\n if (!(pr
op in object)) {\n removed[prop] = undefined;\n continue;\n }
\n\n if (newValue !== oldObject[prop])\n changed[prop] = newValue;\n
}\n\n for (var prop in object) {\n if (prop in oldObject)\n c
ontinue;\n\n added[prop] = object[prop];\n }\n\n if (Array.isArray(ob
ject) && object.length !== oldObject.length)\n changed.length = object.leng
th;\n\n return {\n added: added,\n removed: removed,\n changed
: changed\n };\n }\n\n var eomTasks = [];\n function runEOMTasks() {\n
if (!eomTasks.length)\n return false;\n\n for (var i = 0; i < eomTasks.l
ength; i++) {\n eomTasks[i]();\n }\n eomTasks.length = 0;\n return
true;\n }\n\n var runEOM = hasObserve ? (function(){\n var eomObj = { ping
Pong: true };\n var eomRunScheduled = false;\n\n Object.observe(eomObj, fu
nction() {\n runEOMTasks();\n eomRunScheduled = false;\n });\n\n
return function(fn) {\n eomTasks.push(fn);\n if (!eomRunScheduled) {\
n eomRunScheduled = true;\n eomObj.pingPong = !eomObj.pingPong;\n
}\n };\n })() :\n (function() {\n return function(fn) {\n eomT
asks.push(fn);\n };\n })();\n\n var observedObjectCache = [];\n\n function
newObservedObject() {\n var observer;\n var object;\n var discardRecor
ds = false;\n var first = true;\n\n function callback(records) {\n if
(observer && observer.state_ === OPENED && !discardRecords)\n observer.c
heck_(records);\n }\n\n return {\n open: function(obs) {\n if
(observer)\n throw Error('ObservedObject in use');\n\n if (!firs
t)\n Object.deliverChangeRecords(callback);\n\n observer = obs;\
n first = false;\n },\n observe: function(obj, arrayObserve) {\
n object = obj;\n if (arrayObserve)\n Array.observe(objec
t, callback);\n else\n Object.observe(object, callback);\n
},\n deliver: function(discard) {\n discardRecords = discard;\n
Object.deliverChangeRecords(callback);\n discardRecords = false;\n
},\n close: function() {\n observer = undefined;\n Object.u
nobserve(object, callback);\n observedObjectCache.push(this);\n }\n
};\n }\n\n /*\n * The observedSet abstraction is a perf optimization whic
h reduces the total\n * number of Object.observe observations of a set of obje
cts. The idea is that\n * groups of Observers will have some object dependenci
es in common and this\n * observed set ensures that each object in the transit
ive closure of\n * dependencies is only observed once. The observedSet acts as
a write barrier\n * such that whenever any change comes through, all Observer
s are checked for\n * changed values.\n *\n * Note that this optimization
is explicitly moving work from setup-time to\n * change-time.\n *\n * TODO
(rafaelw): Implement \"garbage collection\". In order to move work off\n * the
critical path, when Observers are closed, their observed objects are\n * not
Object.unobserve(d). As a result, it's possible that if the observedSet\n * is
kept open, but some Observers have been closed, it could cause \"leaks\"\n *
(prevent otherwise collectable objects from being collected). At some\n * poin
t, we should implement incremental \"gc\" which keeps a list of\n * observedSe
ts which may need clean-up and does small amounts of cleanup on a\n * timeout
until all is clean.\n */\n\n function getObservedObject(observer, object, arr
ayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n
dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\
n }\n\n var observedSetCache = [];\n\n function newObservedSet() {\n var o
bserverCount = 0;\n var observers = [];\n var objects = [];\n var rootO
bj;\n var rootObjProps;\n\n function observe(obj, prop) {\n if (!obj)
\n return;\n\n if (obj === rootObj)\n rootObjProps[prop] = tr
ue;\n\n if (objects.indexOf(obj) < 0) {\n objects.push(obj);\n
Object.observe(obj, callback);\n }\n\n observe(Object.getPrototypeOf
(obj), prop);\n }\n\n function allRootObjNonObservedProps(recs) {\n f
or (var i = 0; i < recs.length; i++) {\n var rec = recs[i];\n if (
rec.object !== rootObj ||\n rootObjProps[rec.name] ||\n re
c.type === 'setPrototype') {\n return false;\n }\n }\n
return true;\n }\n\n function callback(recs) {\n if (allRootObjNonOb
servedProps(recs))\n return;\n\n var observer;\n for (var i = 0
; i < observers.length; i++) {\n observer = observers[i];\n if (ob
server.state_ == OPENED) {\n observer.iterateObjects_(observe);\n
}\n }\n\n for (var i = 0; i < observers.length; i++) {\n obse
rver = observers[i];\n if (observer.state_ == OPENED) {\n observ
er.check_();\n }\n }\n }\n\n var record = {\n object: und
efined,\n objects: objects,\n open: function(obs, object) {\n i
f (!rootObj) {\n rootObj = object;\n rootObjProps = {};\n
}\n\n observers.push(obs);\n observerCount++;\n obs.iter
ateObjects_(observe);\n },\n close: function(obs) {\n observerC
ount--;\n if (observerCount > 0) {\n return;\n }\n\n
for (var i = 0; i < objects.length; i++) {\n Object.unobserve(object
s[i], callback);\n Observer.unobservedCount++;\n }\n\n ob
servers.length = 0;\n objects.length = 0;\n rootObj = undefined;\n
rootObjProps = undefined;\n observedSetCache.push(this);\n }
\n };\n\n return record;\n }\n\n var lastObservedSet;\n\n function getO
bservedSet(observer, obj) {\n if (!lastObservedSet || lastObservedSet.object
!== obj) {\n lastObservedSet = observedSetCache.pop() || newObservedSet();\
n lastObservedSet.object = obj;\n }\n lastObservedSet.open(observer,
obj);\n return lastObservedSet;\n }\n\n var UNOPENED = 0;\n var OPENED = 1
;\n var CLOSED = 2;\n var RESETTING = 3;\n\n var nextObserverId = 1;\n\n fun
ction Observer() {\n this.state_ = UNOPENED;\n this.callback_ = undefined;
\n this.target_ = undefined; // TODO(rafaelw): Should be WeakRef\n this.di
rectObserver_ = undefined;\n this.value_ = undefined;\n this.id_ = nextObs
erverId++;\n }\n\n Observer.prototype = {\n open: function(callback, target
) {\n if (this.state_ != UNOPENED)\n throw Error('Observer has alrea
dy been opened.');\n\n addToAll(this);\n this.callback_ = callback;\n
this.target_ = target;\n this.connect_();\n this.state_ = OPENED;
\n return this.value_;\n },\n\n close: function() {\n if (this.s
tate_ != OPENED)\n return;\n\n removeFromAll(this);\n this.disc
onnect_();\n this.value_ = undefined;\n this.callback_ = undefined;\n
this.target_ = undefined;\n this.state_ = CLOSED;\n },\n\n deliv
er: function() {\n if (this.state_ != OPENED)\n return;\n\n dir
tyCheck(this);\n },\n\n report_: function(changes) {\n try {\n
this.callback_.apply(this.target_, changes);\n } catch (ex) {\n Obs
erver._errorThrownDuringCallback = true;\n console.error('Exception caugh
t during observer callback: ' +\n (ex.stack || ex));\n
}\n },\n\n discardChanges: function() {\n this.check_(undefined, tr
ue);\n return this.value_;\n }\n }\n\n var collectObservers = !hasObse
rve;\n var allObservers;\n Observer._allObserversCount = 0;\n\n if (collectOb
servers) {\n allObservers = [];\n }\n\n function addToAll(observer) {\n
Observer._allObserversCount++;\n if (!collectObservers)\n return;\n\n
allObservers.push(observer);\n }\n\n function removeFromAll(observer) {\n
Observer._allObserversCount--;\n }\n\n var runningMicrotaskCheckpoint = false;
\n\n var hasDebugForceFullDelivery = hasObserve && hasEval && (function() {\n
try {\n eval('%RunMicrotasks()');\n return true;\n } catch (ex) {
\n return false;\n }\n })();\n\n global.Platform = global.Platform ||
{};\n\n global.Platform.performMicrotaskCheckpoint = function() {\n if (runn
ingMicrotaskCheckpoint)\n return;\n\n if (hasDebugForceFullDelivery) {\n
eval('%RunMicrotasks()');\n return;\n }\n\n if (!collectObserve
rs)\n return;\n\n runningMicrotaskCheckpoint = true;\n\n var cycles =
0;\n var anyChanged, toCheck;\n\n do {\n cycles++;\n toCheck =
allObservers;\n allObservers = [];\n anyChanged = false;\n\n for
(var i = 0; i < toCheck.length; i++) {\n var observer = toCheck[i];\n
if (observer.state_ != OPENED)\n continue;\n\n if (observer.
check_())\n anyChanged = true;\n\n allObservers.push(observer);\
n }\n if (runEOMTasks())\n anyChanged = true;\n } while (cyc
les < MAX_DIRTY_CHECK_CYCLES && anyChanged);\n\n if (testingExposeCycleCount)
\n global.dirtyCheckCycleCount = cycles;\n\n runningMicrotaskCheckpoint
= false;\n };\n\n if (collectObservers) {\n global.Platform.clearObservers
= function() {\n allObservers = [];\n };\n }\n\n function ObjectObserv
er(object) {\n Observer.call(this);\n this.value_ = object;\n this.oldO
bject_ = undefined;\n }\n\n ObjectObserver.prototype = createObject({\n __p
roto__: Observer.prototype,\n\n arrayObserve: false,\n\n connect_: functio
n(callback, target) {\n if (hasObserve) {\n this.directObserver_ = g
etObservedObject(this, this.value_,\n
this.arrayObserve);\n } else {\n this.oldObject_ = this.copyOb
ject(this.value_);\n }\n\n },\n\n copyObject: function(object) {\n
var copy = Array.isArray(object) ? [] : {};\n for (var prop in object) {
\n copy[prop] = object[prop];\n };\n if (Array.isArray(object))
\n copy.length = object.length;\n return copy;\n },\n\n check_
: function(changeRecords, skipChanges) {\n var diff;\n var oldValues;\
n if (hasObserve) {\n if (!changeRecords)\n return false;\n
\n oldValues = {};\n diff = diffObjectFromChangeRecords(this.value
_, changeRecords,\n oldValues);\n
} else {\n oldValues = this.oldObject_;\n diff = diffObjectFromOl
dObject(this.value_, this.oldObject_);\n }\n\n if (diffIsEmpty(diff))\
n return false;\n\n if (!hasObserve)\n this.oldObject_ = this
.copyObject(this.value_);\n\n this.report_([\n diff.added || {},\n
diff.removed || {},\n diff.changed || {},\n function(propert
y) {\n return oldValues[property];\n }\n ]);\n\n retur
n true;\n },\n\n disconnect_: function() {\n if (hasObserve) {\n
this.directObserver_.close();\n this.directObserver_ = undefined;\n
} else {\n this.oldObject_ = undefined;\n }\n },\n\n delive
r: function() {\n if (this.state_ != OPENED)\n return;\n\n if (
hasObserve)\n this.directObserver_.deliver(false);\n else\n d
irtyCheck(this);\n },\n\n discardChanges: function() {\n if (this.dir
ectObserver_)\n this.directObserver_.deliver(true);\n else\n
this.oldObject_ = this.copyObject(this.value_);\n\n return this.value_;\n
}\n });\n\n function ArrayObserver(array) {\n if (!Array.isArray(array))\
n throw Error('Provided object is not an Array');\n ObjectObserver.call(
this, array);\n }\n\n ArrayObserver.prototype = createObject({\n\n __proto_
_: ObjectObserver.prototype,\n\n arrayObserve: true,\n\n copyObject: funct
ion(arr) {\n return arr.slice();\n },\n\n check_: function(changeReco
rds) {\n var splices;\n if (hasObserve) {\n if (!changeRecords)
\n return false;\n splices = projectArraySplices(this.value_, ch
angeRecords);\n } else {\n splices = calcSplices(this.value_, 0, thi
s.value_.length,\n this.oldObject_, 0, this.oldObje
ct_.length);\n }\n\n if (!splices || !splices.length)\n return
false;\n\n if (!hasObserve)\n this.oldObject_ = this.copyObject(this
.value_);\n\n this.report_([splices]);\n return true;\n }\n });\n\
n ArrayObserver.applySplices = function(previous, current, splices) {\n spli
ces.forEach(function(splice) {\n var spliceArgs = [splice.index, splice.rem
oved.length];\n var addIndex = splice.index;\n while (addIndex < splic
e.index + splice.addedCount) {\n spliceArgs.push(current[addIndex]);\n
addIndex++;\n }\n\n Array.prototype.splice.apply(previous, splice
Args);\n });\n };\n\n function PathObserver(object, path) {\n Observer.c
all(this);\n\n this.object_ = object;\n this.path_ = getPath(path);\n t
his.directObserver_ = undefined;\n }\n\n PathObserver.prototype = createObject
({\n __proto__: Observer.prototype,\n\n get path() {\n return this.pa
th_;\n },\n\n connect_: function() {\n if (hasObserve)\n this.
directObserver_ = getObservedSet(this, this.object_);\n\n this.check_(undef
ined, true);\n },\n\n disconnect_: function() {\n this.value_ = undef
ined;\n\n if (this.directObserver_) {\n this.directObserver_.close(t
his);\n this.directObserver_ = undefined;\n }\n },\n\n iterate
Objects_: function(observe) {\n this.path_.iterateObjects(this.object_, obs
erve);\n },\n\n check_: function(changeRecords, skipChanges) {\n var
oldValue = this.value_;\n this.value_ = this.path_.getValueFrom(this.object
_);\n if (skipChanges || areSameValue(this.value_, oldValue))\n retu
rn false;\n\n this.report_([this.value_, oldValue, this]);\n return tr
ue;\n },\n\n setValue: function(newValue) {\n if (this.path_)\n
this.path_.setValueFrom(this.object_, newValue);\n }\n });\n\n function C
ompoundObserver(reportChangesOnOpen) {\n Observer.call(this);\n\n this.rep
ortChangesOnOpen_ = reportChangesOnOpen;\n this.value_ = [];\n this.direct
Observer_ = undefined;\n this.observed_ = [];\n }\n\n var observerSentinel
= {};\n\n CompoundObserver.prototype = createObject({\n __proto__: Observer.
prototype,\n\n connect_: function() {\n if (hasObserve) {\n var o
bject;\n var needsDirectObserver = false;\n for (var i = 0; i < th
is.observed_.length; i += 2) {\n object = this.observed_[i]\n
if (object !== observerSentinel) {\n needsDirectObserver = true;\n
break;\n }\n }\n\n if (needsDirectObserver)\n
this.directObserver_ = getObservedSet(this, object);\n }\n\n th
is.check_(undefined, !this.reportChangesOnOpen_);\n },\n\n disconnect_: fu
nction() {\n for (var i = 0; i < this.observed_.length; i += 2) {\n
if (this.observed_[i] === observerSentinel)\n this.observed_[i + 1].clo
se();\n }\n this.observed_.length = 0;\n this.value_.length = 0;\
n\n if (this.directObserver_) {\n this.directObserver_.close(this);\
n this.directObserver_ = undefined;\n }\n },\n\n addPath: func
tion(object, path) {\n if (this.state_ != UNOPENED && this.state_ != RESETT
ING)\n throw Error('Cannot add paths once started.');\n\n var path =
getPath(path);\n this.observed_.push(object, path);\n if (!this.repor
tChangesOnOpen_)\n return;\n var index = this.observed_.length / 2 -
1;\n this.value_[index] = path.getValueFrom(object);\n },\n\n addObs
erver: function(observer) {\n if (this.state_ != UNOPENED && this.state_ !=
RESETTING)\n throw Error('Cannot add observers once started.');\n\n
this.observed_.push(observerSentinel, observer);\n if (!this.reportChanges
OnOpen_)\n return;\n var index = this.observed_.length / 2 - 1;\n
this.value_[index] = observer.open(this.deliver, this);\n },\n\n startR
eset: function() {\n if (this.state_ != OPENED)\n throw Error('Can o
nly reset while open');\n\n this.state_ = RESETTING;\n this.disconnect
_();\n },\n\n finishReset: function() {\n if (this.state_ != RESETTIN
G)\n throw Error('Can only finishReset after startReset');\n this.st
ate_ = OPENED;\n this.connect_();\n\n return this.value_;\n },\n\n
iterateObjects_: function(observe) {\n var object;\n for (var i = 0
; i < this.observed_.length; i += 2) {\n object = this.observed_[i]\n
if (object !== observerSentinel)\n this.observed_[i + 1].iterateObj
ects(object, observe)\n }\n },\n\n check_: function(changeRecords, sk
ipChanges) {\n var oldValues;\n for (var i = 0; i < this.observed_.len
gth; i += 2) {\n var object = this.observed_[i];\n var path = this
.observed_[i+1];\n var value;\n if (object === observerSentinel) {
\n var observable = path;\n value = this.state_ === UNOPENED ?
\n observable.open(this.deliver, this) :\n observable.
discardChanges();\n } else {\n value = path.getValueFrom(object)
;\n }\n\n if (skipChanges) {\n this.value_[i / 2] = value
;\n continue;\n }\n\n if (areSameValue(value, this.value_
[i / 2]))\n continue;\n\n oldValues = oldValues || [];\n
oldValues[i / 2] = this.value_[i / 2];\n this.value_[i / 2] = value;\n
}\n\n if (!oldValues)\n return false;\n\n // TODO(rafaelw):
Having observed_ as the third callback arg here is\n // pretty lame API. Fi
x.\n this.report_([this.value_, oldValues, this.observed_]);\n return
true;\n }\n });\n\n function identFn(value) { return value; }\n\n function
ObserverTransform(observable, getValueFn, setValueFn,\n
dontPassThroughSet) {\n this.callback_ = undefined;\n this.target_ =
undefined;\n this.value_ = undefined;\n this.observable_ = observable;\n
this.getValueFn_ = getValueFn || identFn;\n this.setValueFn_ = setValueFn |
| identFn;\n // TODO(rafaelw): This is a temporary hack. PolymerExpressions n
eeds this\n // at the moment because of a bug in it's dependency tracking.\n
this.dontPassThroughSet_ = dontPassThroughSet;\n }\n\n ObserverTransform.pr
ototype = {\n open: function(callback, target) {\n this.callback_ = call
back;\n this.target_ = target;\n this.value_ =\n this.getValu
eFn_(this.observable_.open(this.observedCallback_, this));\n return this.va
lue_;\n },\n\n observedCallback_: function(value) {\n value = this.ge
tValueFn_(value);\n if (areSameValue(value, this.value_))\n return;\
n var oldValue = this.value_;\n this.value_ = value;\n this.callb
ack_.call(this.target_, this.value_, oldValue);\n },\n\n discardChanges: f
unction() {\n this.value_ = this.getValueFn_(this.observable_.discardChange
s());\n return this.value_;\n },\n\n deliver: function() {\n ret
urn this.observable_.deliver();\n },\n\n setValue: function(value) {\n
value = this.setValueFn_(value);\n if (!this.dontPassThroughSet_ && this.
observable_.setValue)\n return this.observable_.setValue(value);\n },\
n\n close: function() {\n if (this.observable_)\n this.observable
_.close();\n this.callback_ = undefined;\n this.target_ = undefined;\n
this.observable_ = undefined;\n this.value_ = undefined;\n this.
getValueFn_ = undefined;\n this.setValueFn_ = undefined;\n }\n }\n\n v
ar expectedRecordTypes = {\n add: true,\n update: true,\n delete: true\
n };\n\n function diffObjectFromChangeRecords(object, changeRecords, oldValues
) {\n var added = {};\n var removed = {};\n\n for (var i = 0; i < chang
eRecords.length; i++) {\n var record = changeRecords[i];\n if (!expect
edRecordTypes[record.type]) {\n console.error('Unknown changeRecord type:
' + record.type);\n console.error(record);\n continue;\n }\n
\n if (!(record.name in oldValues))\n oldValues[record.name] = recor
d.oldValue;\n\n if (record.type == 'update')\n continue;\n\n if
(record.type == 'add') {\n if (record.name in removed)\n delete
removed[record.name];\n else\n added[record.name] = true;\n\n
continue;\n }\n\n // type = 'delete'\n if (record.name in a
dded) {\n delete added[record.name];\n delete oldValues[record.nam
e];\n } else {\n removed[record.name] = true;\n }\n }\n\n
for (var prop in added)\n added[prop] = object[prop];\n\n for (var prop
in removed)\n removed[prop] = undefined;\n\n var changed = {};\n for
(var prop in oldValues) {\n if (prop in added || prop in removed)\n
continue;\n\n var newValue = object[prop];\n if (oldValues[prop] !==
newValue)\n changed[prop] = newValue;\n }\n\n return {\n added
: added,\n removed: removed,\n changed: changed\n };\n }\n\n func
tion newSplice(index, removed, addedCount) {\n return {\n index: index,\
n removed: removed,\n addedCount: addedCount\n };\n }\n\n var EDI
T_LEAVE = 0;\n var EDIT_UPDATE = 1;\n var EDIT_ADD = 2;\n var EDIT_DELETE = 3
;\n\n function ArraySplice() {}\n\n ArraySplice.prototype = {\n\n // Note:
This function is *based* on the computation of the Levenshtein\n // \"edit\"
distance. The one change is that \"updates\" are treated as two\n // edits -
not one. With Array splices, an update is really a delete\n // followed by an
add. By retaining this, we optimize for \"keeping\" the\n // maximum array i
tems in the original array. For example:\n //\n // 'xxxx123' -> '123yyyy
'\n //\n // With 1-edit updates, the shortest path would be just to update
all seven\n // characters. With 2-edit updates, we delete 4, leave 3, and ad
d 4. This\n // leaves the substring '123' intact.\n calcEditDistances: fun
ction(current, currentStart, currentEnd,\n old, o
ldStart, oldEnd) {\n // \"Deletion\" columns\n var rowCount = oldEnd -
oldStart + 1;\n var columnCount = currentEnd - currentStart + 1;\n va
r distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize nul
l column.\n for (var i = 0; i < rowCount; i++) {\n distances[i] = ne
w Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initial
ize null row\n for (var j = 0; j < columnCount; j++)\n distances[0][
j] = j;\n\n for (var i = 1; i < rowCount; i++) {\n for (var j = 1; j
< columnCount; j++) {\n if (this.equals(current[currentStart + j - 1],
old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];
\n else {\n var north = distances[i - 1][j] + 1;\n
var west = distances[i][j - 1] + 1;\n distances[i][j] = north < wes
t ? north : west;\n }\n }\n }\n\n return distances;\n
},\n\n // This starts at the final weight, and walks \"backward\" by findi
ng\n // the minimum previous weight recursively until the origin of the weigh
t\n // matrix.\n spliceOperationsFromEditDistances: function(distances) {\
n var i = distances.length - 1;\n var j = distances[0].length - 1;\n
var current = distances[i][j];\n var edits = [];\n while (i > 0 ||
j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--
;\n continue;\n }\n if (j == 0) {\n edits.push(E
DIT_DELETE);\n i--;\n continue;\n }\n var northW
est = distances[i - 1][j - 1];\n var west = distances[i - 1][j];\n
var north = distances[i][j - 1];\n\n var min;\n if (west < north)
\n min = west < northWest ? west : northWest;\n else\n
min = north < northWest ? north : northWest;\n\n if (min == northWest) {\
n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n
} else {\n edits.push(EDIT_UPDATE);\n current = nor
thWest;\n }\n i--;\n j--;\n } else if (min ==
west) {\n edits.push(EDIT_DELETE);\n i--;\n current =
west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n
current = north;\n }\n }\n\n edits.reverse();\n retur
n edits;\n },\n\n /**\n * Splice Projection functions:\n *\n *
A splice map is a representation of how a previous array of items\n * was t
ransformed into a new array of items. Conceptually it is a list of\n * tuple
s of\n *\n * <index, removed, addedCount>\n *\n * which are ke
pt in ascending index order of. The tuple represents that at\n * the |index|
, |removed| sequence of items were removed, and counting forward\n * from |i
ndex|, |addedCount| items were added.\n */\n\n /**\n * Lacking indivi
dual splice mutation information, the minimal set of\n * splices can be synt
hesized given the previous state and final state of an\n * array. The basic
approach is to calculate the edit distance matrix and\n * choose the shortes
t path through it.\n *\n * Complexity: O(l * p)\n * l: The length
of the current array\n * p: The length of the old array\n */\n calc
Splices: function(current, currentStart, currentEnd,\n
old, oldStart, oldEnd) {\n var prefixCount = 0;\n var suffixCount = 0;
\n\n var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart)
;\n if (currentStart == 0 && oldStart == 0)\n prefixCount = this.sha
redPrefix(current, old, minLength);\n\n if (currentEnd == current.length &&
oldEnd == old.length)\n suffixCount = this.sharedSuffix(current, old, mi
nLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart +=
prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\
n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n re
turn [];\n\n if (currentStart == currentEnd) {\n var splice = newSpl
ice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.r
emoved.push(old[oldStart++]);\n\n return [ splice ];\n } else if (ol
dStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd - cur
rentStart) ];\n\n var ops = this.spliceOperationsFromEditDistances(\n
this.calcEditDistances(current, currentStart, currentEnd,\n
old, oldStart, oldEnd));\n\n var splice = undefined;\n
var splices = [];\n var index = currentStart;\n var oldIndex = oldSta
rt;\n for (var i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n
case EDIT_LEAVE:\n if (splice) {\n splices.push(s
plice);\n splice = undefined;\n }\n\n index++
;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n
if (!splice)\n splice = newSplice(index, [], 0);\n\n
splice.addedCount++;\n index++;\n\n splice.removed.p
ush(old[oldIndex]);\n oldIndex++;\n break;\n case
EDIT_ADD:\n if (!splice)\n splice = newSplice(index, []
, 0);\n\n splice.addedCount++;\n index++;\n bre
ak;\n case EDIT_DELETE:\n if (!splice)\n splice
= newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n
oldIndex++;\n break;\n }\n }\n\n if (spl
ice) {\n splices.push(splice);\n }\n return splices;\n },\n\
n sharedPrefix: function(current, old, searchLength) {\n for (var i = 0;
i < searchLength; i++)\n if (!this.equals(current[i], old[i]))\n
return i;\n return searchLength;\n },\n\n sharedSuffix: function(cu
rrent, old, searchLength) {\n var index1 = current.length;\n var index
2 = old.length;\n var count = 0;\n while (count < searchLength && this
.equals(current[--index1], old[--index2]))\n count++;\n\n return cou
nt;\n },\n\n calculateSplices: function(current, previous) {\n return
this.calcSplices(current, 0, current.length, previous, 0,\n
previous.length);\n },\n\n equals: function(currentValue, previo
usValue) {\n return currentValue === previousValue;\n }\n };\n\n var a
rraySplice = new ArraySplice();\n\n function calcSplices(current, currentStart,
currentEnd,\n old, oldStart, oldEnd) {\n return arrayS
plice.calcSplices(current, currentStart, currentEnd,\n
old, oldStart, oldEnd);\n }\n\n function intersect(start1, end1, star
t2, end2) {\n // Disjoint\n if (end1 < start2 || end2 < start1)\n ret
urn -1;\n\n // Adjacent\n if (end1 == start2 || end2 == start1)\n ret
urn 0;\n\n // Non-zero intersect, span1 first\n if (start1 < start2) {\n
if (end1 < end2)\n return end1 - start2; // Overlap\n else\n
return end2 - start2; // Contained\n } else {\n // Non-zero intersec
t, span2 first\n if (end2 < end1)\n return end2 - start1; // Overlap
\n else\n return end1 - start1; // Contained\n }\n }\n\n functi
on mergeSplice(splices, index, removed, addedCount) {\n\n var splice = newSpl
ice(index, removed, addedCount);\n\n var inserted = false;\n var insertion
Offset = 0;\n\n for (var i = 0; i < splices.length; i++) {\n var current
= splices[i];\n current.index += insertionOffset;\n\n if (inserted)\n
continue;\n\n var intersectCount = intersect(splice.index,\n
splice.index + splice.removed.length,\n
current.index,\n c
urrent.index + current.addedCount);\n\n if (intersectCount >= 0) {\n
// Merge the two splices\n\n splices.splice(i, 1);\n i--;\n\n
insertionOffset -= current.addedCount - current.removed.length;\n\n s
plice.addedCount += current.addedCount - intersectCount;\n var deleteCoun
t = splice.removed.length +\n current.removed.length -
intersectCount;\n\n if (!splice.addedCount && !deleteCount) {\n
// merged splice is a noop. discard.\n inserted = true;\n } else
{\n var removed = current.removed;\n\n if (splice.index < cur
rent.index) {\n // some prefix of splice.removed is prepended to curr
ent.removed.\n var prepend = splice.removed.slice(0, current.index -
splice.index);\n Array.prototype.push.apply(prepend, removed);\n
removed = prepend;\n }\n\n if (splice.index + splice.re
moved.length > current.index + current.addedCount) {\n // some suffix
of splice.removed is appended to current.removed.\n var append = spl
ice.removed.slice(current.index + current.addedCount - splice.index);\n
Array.prototype.push.apply(removed, append);\n }\n\n splice
.removed = removed;\n if (current.index < splice.index) {\n
splice.index = current.index;\n }\n }\n } else if (splice.i
ndex < current.index) {\n // Insert splice here.\n\n inserted = tr
ue;\n\n splices.splice(i, 0, splice);\n i++;\n\n var offset
= splice.addedCount - splice.removed.length\n current.index += offset;\n
insertionOffset += offset;\n }\n }\n\n if (!inserted)\n
splices.push(splice);\n }\n\n function createInitialSplices(array, changeRecor
ds) {\n var splices = [];\n\n for (var i = 0; i < changeRecords.length; i+
+) {\n var record = changeRecords[i];\n switch(record.type) {\n
case 'splice':\n mergeSplice(splices, record.index, record.removed.sli
ce(), record.addedCount);\n break;\n case 'add':\n case '
update':\n case 'delete':\n if (!isIndex(record.name))\n
continue;\n var index = toNumber(record.name);\n if (index
< 0)\n continue;\n mergeSplice(splices, index, [record.oldV
alue], 1);\n break;\n default:\n console.error('Unexpec
ted record type: ' + JSON.stringify(record));\n break;\n }\n }\
n\n return splices;\n }\n\n function projectArraySplices(array, changeRecor
ds) {\n var splices = [];\n\n createInitialSplices(array, changeRecords).f
orEach(function(splice) {\n if (splice.addedCount == 1 && splice.removed.le
ngth == 1) {\n if (splice.removed[0] !== array[splice.index])\n
splices.push(splice);\n\n return\n };\n\n splices = splices.con
cat(calcSplices(array, splice.index, splice.index + splice.addedCount,\n
splice.removed, 0, splice.removed.length));\n
});\n\n return splices;\n }\n\n global.Observer = Observer;\n global.O
bserver.runEOM_ = runEOM;\n global.Observer.observerSentinel_ = observerSentine
l; // for testing.\n global.Observer.hasObjectObserve = hasObserve;\n global.A
rrayObserver = ArrayObserver;\n global.ArrayObserver.calculateSplices = functio
n(current, previous) {\n return arraySplice.calculateSplices(current, previou
s);\n };\n\n global.ArraySplice = ArraySplice;\n global.ObjectObserver = Obje
ctObserver;\n global.PathObserver = PathObserver;\n global.CompoundObserver =
CompoundObserver;\n global.Path = Path;\n global.ObserverTransform = ObserverT
ransform;\n})(typeof global !== 'undefined' && global && typeof module !== 'unde
fined' && module ? global : this || window);\n", |
94 "// select ShadowDOM impl\r\nif (Platform.flags.shadow) {\r\n", | 93 "// select ShadowDOM impl\r\nif (Platform.flags.shadow) {\r\n", |
95 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\nwindow.ShadowDOMPolyfill = {};\n\n(function(scope) {\n 'use stri
ct';\n\n var constructorTable = new WeakMap();\n var nativePrototypeTable = ne
w WeakMap();\n var wrappers = Object.create(null);\n\n function detectEval() {
\n // Don't test for eval if we're running in a Chrome App environment.\n
// We check for APIs set that only exist in a Chrome App context.\n if (typeo
f chrome !== 'undefined' && chrome.app && chrome.app.runtime) {\n return fa
lse;\n }\n\n try {\n var f = new Function('return true;');\n ret
urn f();\n } catch (ex) {\n return false;\n }\n }\n\n var hasEval =
detectEval();\n\n function assert(b) {\n if (!b)\n throw new Error('As
sertion failed');\n };\n\n var defineProperty = Object.defineProperty;\n var
getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertyDescripto
r = Object.getOwnPropertyDescriptor;\n\n function mixin(to, from) {\n var na
mes = getOwnPropertyNames(from);\n for (var i = 0; i < names.length; i++) {\n
var name = names[i];\n defineProperty(to, name, getOwnPropertyDescrip
tor(from, name));\n }\n return to;\n };\n\n function mixinStatics(to, fr
om) {\n var names = getOwnPropertyNames(from);\n for (var i = 0; i < names
.length; i++) {\n var name = names[i];\n switch (name) {\n case
'arguments':\n case 'caller':\n case 'length':\n case 'nam
e':\n case 'prototype':\n case 'toString':\n continue;\n
}\n defineProperty(to, name, getOwnPropertyDescriptor(from, name));\n
}\n return to;\n };\n\n function oneOf(object, propertyNames) {\n for
(var i = 0; i < propertyNames.length; i++) {\n if (propertyNames[i] in obj
ect)\n return propertyNames[i];\n }\n }\n\n var nonEnumerableDataDes
criptor = {\n value: undefined,\n configurable: true,\n enumerable: fal
se,\n writable: true\n };\n\n function defineNonEnumerableDataProperty(obje
ct, name, value) {\n nonEnumerableDataDescriptor.value = value;\n definePr
operty(object, name, nonEnumerableDataDescriptor);\n }\n\n // Mozilla's old DO
M bindings are bretty busted:\n // https://bugzilla.mozilla.org/show_bug.cgi?id
=855844\n // Make sure they are create before we start modifying things.\n get
OwnPropertyNames(window);\n\n function getWrapperConstructor(node) {\n var n
ativePrototype = node.__proto__ || Object.getPrototypeOf(node);\n var wrapper
Constructor = constructorTable.get(nativePrototype);\n if (wrapperConstructor
)\n return wrapperConstructor;\n\n var parentWrapperConstructor = getWra
pperConstructor(nativePrototype);\n\n var GeneratedWrapper = createWrapperCon
structor(parentWrapperConstructor);\n registerInternal(nativePrototype, Gener
atedWrapper, node);\n\n return GeneratedWrapper;\n }\n\n function addForwar
dingProperties(nativePrototype, wrapperPrototype) {\n installProperty(nativeP
rototype, wrapperPrototype, true);\n }\n\n function registerInstanceProperties
(wrapperPrototype, instanceObject) {\n installProperty(instanceObject, wrappe
rPrototype, false);\n }\n\n var isFirefox = /Firefox/.test(navigator.userAgent
);\n\n // This is used as a fallback when getting the descriptor fails in\n //
installProperty.\n var dummyDescriptor = {\n get: function() {},\n set:
function(v) {},\n configurable: true,\n enumerable: true\n };\n\n functi
on isEventHandlerName(name) {\n return /^on[a-z]+$/.test(name);\n }\n\n fun
ction isIdentifierName(name) {\n return /^\\w[a-zA-Z_0-9]*$/.test(name);\n }
\n\n function getGetter(name) {\n return hasEval && isIdentifierName(name) ?
\n new Function('return this.impl.' + name) :\n function() { retur
n this.impl[name]; };\n }\n\n function getSetter(name) {\n return hasEval &
& isIdentifierName(name) ?\n new Function('v', 'this.impl.' + name + ' =
v') :\n function(v) { this.impl[name] = v; };\n }\n\n function getMetho
d(name) {\n return hasEval && isIdentifierName(name) ?\n new Function(
'return this.impl.' + name +\n '.apply(this.impl, arguments)
') :\n function() { return this.impl[name].apply(this.impl, arguments); }
;\n }\n\n function getDescriptor(source, name) {\n try {\n return Obje
ct.getOwnPropertyDescriptor(source, name);\n } catch (ex) {\n // JSC and
V8 both use data properties instead of accessors which can\n // cause gett
ing the property desciptor to throw an exception.\n // https://bugs.webkit.
org/show_bug.cgi?id=49739\n return dummyDescriptor;\n }\n }\n\n functi
on installProperty(source, target, allowMethod, opt_blacklist) {\n var names
= getOwnPropertyNames(source);\n for (var i = 0; i < names.length; i++) {\n
var name = names[i];\n if (name === 'polymerBlackList_')\n conti
nue;\n\n if (name in target)\n continue;\n\n if (source.polymer
BlackList_ && source.polymerBlackList_[name])\n continue;\n\n if (is
Firefox) {\n // Tickle Firefox's old bindings.\n source.__lookupGe
tter__(name);\n }\n var descriptor = getDescriptor(source, name);\n
var getter, setter;\n if (allowMethod && typeof descriptor.value === 'fu
nction') {\n target[name] = getMethod(name);\n continue;\n }\
n\n var isEvent = isEventHandlerName(name);\n if (isEvent)\n ge
tter = scope.getEventHandlerGetter(name);\n else\n getter = getGette
r(name);\n\n if (descriptor.writable || descriptor.set) {\n if (isEv
ent)\n setter = scope.getEventHandlerSetter(name);\n else\n
setter = getSetter(name);\n }\n\n defineProperty(target, name, {\
n get: getter,\n set: setter,\n configurable: descriptor.co
nfigurable,\n enumerable: descriptor.enumerable\n });\n }\n }\n\
n /**\n * @param {Function} nativeConstructor\n * @param {Function} wrapper
Constructor\n * @param {Object=} opt_instance If present, this is used to extr
act\n * properties from an instance object.\n */\n function register(na
tiveConstructor, wrapperConstructor, opt_instance) {\n var nativePrototype =
nativeConstructor.prototype;\n registerInternal(nativePrototype, wrapperConst
ructor, opt_instance);\n mixinStatics(wrapperConstructor, nativeConstructor);
\n }\n\n function registerInternal(nativePrototype, wrapperConstructor, opt_in
stance) {\n var wrapperPrototype = wrapperConstructor.prototype;\n assert(
constructorTable.get(nativePrototype) === undefined);\n\n constructorTable.se
t(nativePrototype, wrapperConstructor);\n nativePrototypeTable.set(wrapperPro
totype, nativePrototype);\n\n addForwardingProperties(nativePrototype, wrappe
rPrototype);\n if (opt_instance)\n registerInstanceProperties(wrapperPro
totype, opt_instance);\n\n defineNonEnumerableDataProperty(\n wrapperP
rototype, 'constructor', wrapperConstructor);\n // Set it again. Some VMs opt
imizes objects that are used as prototypes.\n wrapperConstructor.prototype =
wrapperPrototype;\n }\n\n function isWrapperFor(wrapperConstructor, nativeCons
tructor) {\n return constructorTable.get(nativeConstructor.prototype) ===\n
wrapperConstructor;\n }\n\n /**\n * Creates a generic wrapper construc
tor based on |object| and its\n * constructor.\n * @param {Node} object\n
* @return {Function} The generated constructor.\n */\n function registerObjec
t(object) {\n var nativePrototype = Object.getPrototypeOf(object);\n\n var
superWrapperConstructor = getWrapperConstructor(nativePrototype);\n var Gene
ratedWrapper = createWrapperConstructor(superWrapperConstructor);\n registerI
nternal(nativePrototype, GeneratedWrapper, object);\n\n return GeneratedWrapp
er;\n }\n\n function createWrapperConstructor(superWrapperConstructor) {\n
function GeneratedWrapper(node) {\n superWrapperConstructor.call(this, node
);\n }\n var p = Object.create(superWrapperConstructor.prototype);\n p.
constructor = GeneratedWrapper;\n GeneratedWrapper.prototype = p;\n\n retu
rn GeneratedWrapper;\n }\n\n var OriginalDOMImplementation = window.DOMImpleme
ntation;\n var OriginalEventTarget = window.EventTarget;\n var OriginalEvent =
window.Event;\n var OriginalNode = window.Node;\n var OriginalWindow = window
.Window;\n var OriginalRange = window.Range;\n var OriginalCanvasRenderingCont
ext2D = window.CanvasRenderingContext2D;\n var OriginalWebGLRenderingContext =
window.WebGLRenderingContext;\n var OriginalSVGElementInstance = window.SVGElem
entInstance;\n\n function isWrapper(object) {\n return object instanceof wra
ppers.EventTarget ||\n object instanceof wrappers.Event ||\n
object instanceof wrappers.Range ||\n object instanceof wrappers.DOMI
mplementation ||\n object instanceof wrappers.CanvasRenderingContext2D
||\n wrappers.WebGLRenderingContext &&\n object instanc
eof wrappers.WebGLRenderingContext;\n }\n\n function isNative(object) {\n r
eturn OriginalEventTarget && object instanceof OriginalEventTarget ||\n
object instanceof OriginalNode ||\n object instanceof OriginalEvent
||\n object instanceof OriginalWindow ||\n object instanceof
OriginalRange ||\n object instanceof OriginalDOMImplementation ||\n
object instanceof OriginalCanvasRenderingContext2D ||\n Origi
nalWebGLRenderingContext &&\n object instanceof OriginalWebGLRende
ringContext ||\n OriginalSVGElementInstance &&\n object
instanceof OriginalSVGElementInstance;\n }\n\n /**\n * Wraps a node in a Wra
pperNode. If there already exists a wrapper for the\n * |node| that wrapper is
returned instead.\n * @param {Node} node\n * @return {WrapperNode}\n */\n
function wrap(impl) {\n if (impl === null)\n return null;\n\n asser
t(isNative(impl));\n return impl.polymerWrapper_ ||\n (impl.polymerWra
pper_ = new (getWrapperConstructor(impl))(impl));\n }\n\n /**\n * Unwraps a
wrapper and returns the node it is wrapping.\n * @param {WrapperNode} wrapper\
n * @return {Node}\n */\n function unwrap(wrapper) {\n if (wrapper === n
ull)\n return null;\n assert(isWrapper(wrapper));\n return wrapper.im
pl;\n }\n\n /**\n * Unwraps object if it is a wrapper.\n * @param {Object}
object\n * @return {Object} The native implementation object.\n */\n funct
ion unwrapIfNeeded(object) {\n return object && isWrapper(object) ? unwrap(ob
ject) : object;\n }\n\n /**\n * Wraps object if it is not a wrapper.\n * @
param {Object} object\n * @return {Object} The wrapper for object.\n */\n f
unction wrapIfNeeded(object) {\n return object && !isWrapper(object) ? wrap(o
bject) : object;\n }\n\n /**\n * Overrides the current wrapper (if any) for
node.\n * @param {Node} node\n * @param {WrapperNode=} wrapper If left out t
he wrapper will be created as\n * needed next time someone wraps the node.
\n */\n function rewrap(node, wrapper) {\n if (wrapper === null)\n re
turn;\n assert(isNative(node));\n assert(wrapper === undefined || isWrappe
r(wrapper));\n node.polymerWrapper_ = wrapper;\n }\n\n var getterDescriptor
= {\n get: undefined,\n configurable: true,\n enumerable: true\n };\n
\n function defineGetter(constructor, name, getter) {\n getterDescriptor.get
= getter;\n defineProperty(constructor.prototype, name, getterDescriptor);\n
}\n\n function defineWrapGetter(constructor, name) {\n defineGetter(constr
uctor, name, function() {\n return wrap(this.impl[name]);\n });\n }\n\n
/**\n * Forwards existing methods on the native object to the wrapper method
s.\n * This does not wrap any of the arguments or the return value since the\n
* wrapper implementation already takes care of that.\n * @param {Array.<Fun
ction>} constructors\n * @parem {Array.<string>} names\n */\n function forw
ardMethodsToWrapper(constructors, names) {\n constructors.forEach(function(co
nstructor) {\n names.forEach(function(name) {\n constructor.prototyp
e[name] = function() {\n var w = wrapIfNeeded(this);\n return
w[name].apply(w, arguments);\n };\n });\n });\n }\n\n scope.ass
ert = assert;\n scope.constructorTable = constructorTable;\n scope.defineGette
r = defineGetter;\n scope.defineWrapGetter = defineWrapGetter;\n scope.forward
MethodsToWrapper = forwardMethodsToWrapper;\n scope.isWrapper = isWrapper;\n s
cope.isWrapperFor = isWrapperFor;\n scope.mixin = mixin;\n scope.nativePrototy
peTable = nativePrototypeTable;\n scope.oneOf = oneOf;\n scope.registerObject
= registerObject;\n scope.registerWrapper = register;\n scope.rewrap = rewrap;
\n scope.unwrap = unwrap;\n scope.unwrapIfNeeded = unwrapIfNeeded;\n scope.wr
ap = wrap;\n scope.wrapIfNeeded = wrapIfNeeded;\n scope.wrappers = wrappers;\n
\n})(window.ShadowDOMPolyfill);\n", | 94 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\nwindow.ShadowDOMPolyfill = {};\n\n(function(scope) {\n 'use stri
ct';\n\n var constructorTable = new WeakMap();\n var nativePrototypeTable = ne
w WeakMap();\n var wrappers = Object.create(null);\n\n function detectEval() {
\n // Don't test for eval if we're running in a Chrome App environment.\n
// We check for APIs set that only exist in a Chrome App context.\n if (typeo
f chrome !== 'undefined' && chrome.app && chrome.app.runtime) {\n return fa
lse;\n }\n\n // Firefox OS Apps do not allow eval. This feature detection
is very hacky\n // but even if some other platform adds support for this func
tion this code\n // will continue to work.\n if (navigator.getDeviceStorag
e) {\n return false;\n }\n\n try {\n var f = new Function('retur
n true;');\n return f();\n } catch (ex) {\n return false;\n }\n
}\n\n var hasEval = detectEval();\n\n function assert(b) {\n if (!b)\n
throw new Error('Assertion failed');\n };\n\n var defineProperty = Object.de
fineProperty;\n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var ge
tOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n function mixin(to
, from) {\n var names = getOwnPropertyNames(from);\n for (var i = 0; i < n
ames.length; i++) {\n var name = names[i];\n defineProperty(to, name,
getOwnPropertyDescriptor(from, name));\n }\n return to;\n };\n\n functio
n mixinStatics(to, from) {\n var names = getOwnPropertyNames(from);\n for
(var i = 0; i < names.length; i++) {\n var name = names[i];\n switch (
name) {\n case 'arguments':\n case 'caller':\n case 'length
':\n case 'name':\n case 'prototype':\n case 'toString':\n
continue;\n }\n defineProperty(to, name, getOwnPropertyDescri
ptor(from, name));\n }\n return to;\n };\n\n function oneOf(object, prop
ertyNames) {\n for (var i = 0; i < propertyNames.length; i++) {\n if (pr
opertyNames[i] in object)\n return propertyNames[i];\n }\n }\n\n var
nonEnumerableDataDescriptor = {\n value: undefined,\n configurable: true,
\n enumerable: false,\n writable: true\n };\n\n function defineNonEnumer
ableDataProperty(object, name, value) {\n nonEnumerableDataDescriptor.value =
value;\n defineProperty(object, name, nonEnumerableDataDescriptor);\n }\n\n
// Mozilla's old DOM bindings are bretty busted:\n // https://bugzilla.mozill
a.org/show_bug.cgi?id=855844\n // Make sure they are create before we start mod
ifying things.\n getOwnPropertyNames(window);\n\n function getWrapperConstruct
or(node) {\n var nativePrototype = node.__proto__ || Object.getPrototypeOf(no
de);\n var wrapperConstructor = constructorTable.get(nativePrototype);\n i
f (wrapperConstructor)\n return wrapperConstructor;\n\n var parentWrappe
rConstructor = getWrapperConstructor(nativePrototype);\n\n var GeneratedWrapp
er = createWrapperConstructor(parentWrapperConstructor);\n registerInternal(n
ativePrototype, GeneratedWrapper, node);\n\n return GeneratedWrapper;\n }\n\
n function addForwardingProperties(nativePrototype, wrapperPrototype) {\n in
stallProperty(nativePrototype, wrapperPrototype, true);\n }\n\n function regis
terInstanceProperties(wrapperPrototype, instanceObject) {\n installProperty(i
nstanceObject, wrapperPrototype, false);\n }\n\n var isFirefox = /Firefox/.tes
t(navigator.userAgent);\n\n // This is used as a fallback when getting the desc
riptor fails in\n // installProperty.\n var dummyDescriptor = {\n get: func
tion() {},\n set: function(v) {},\n configurable: true,\n enumerable: t
rue\n };\n\n function isEventHandlerName(name) {\n return /^on[a-z]+$/.test
(name);\n }\n\n function isIdentifierName(name) {\n return /^\\w[a-zA-Z_0-9
]*$/.test(name);\n }\n\n function getGetter(name) {\n return hasEval && isI
dentifierName(name) ?\n new Function('return this.impl.' + name) :\n
function() { return this.impl[name]; };\n }\n\n function getSetter(name) {\
n return hasEval && isIdentifierName(name) ?\n new Function('v', 'this
.impl.' + name + ' = v') :\n function(v) { this.impl[name] = v; };\n }\n
\n function getMethod(name) {\n return hasEval && isIdentifierName(name) ?\n
new Function('return this.impl.' + name +\n '.apply(
this.impl, arguments)') :\n function() { return this.impl[name].apply(thi
s.impl, arguments); };\n }\n\n function getDescriptor(source, name) {\n try
{\n return Object.getOwnPropertyDescriptor(source, name);\n } catch (ex
) {\n // JSC and V8 both use data properties instead of accessors which can
\n // cause getting the property desciptor to throw an exception.\n //
https://bugs.webkit.org/show_bug.cgi?id=49739\n return dummyDescriptor;\n
}\n }\n\n function installProperty(source, target, allowMethod, opt_blackli
st) {\n var names = getOwnPropertyNames(source);\n for (var i = 0; i < nam
es.length; i++) {\n var name = names[i];\n if (name === 'polymerBlackL
ist_')\n continue;\n\n if (name in target)\n continue;\n\n
if (source.polymerBlackList_ && source.polymerBlackList_[name])\n cont
inue;\n\n if (isFirefox) {\n // Tickle Firefox's old bindings.\n
source.__lookupGetter__(name);\n }\n var descriptor = getDescripto
r(source, name);\n var getter, setter;\n if (allowMethod && typeof des
criptor.value === 'function') {\n target[name] = getMethod(name);\n
continue;\n }\n\n var isEvent = isEventHandlerName(name);\n if
(isEvent)\n getter = scope.getEventHandlerGetter(name);\n else\n
getter = getGetter(name);\n\n if (descriptor.writable || descriptor.set
) {\n if (isEvent)\n setter = scope.getEventHandlerSetter(name);
\n else\n setter = getSetter(name);\n }\n\n defineProp
erty(target, name, {\n get: getter,\n set: setter,\n config
urable: descriptor.configurable,\n enumerable: descriptor.enumerable\n
});\n }\n }\n\n /**\n * @param {Function} nativeConstructor\n * @par
am {Function} wrapperConstructor\n * @param {Object=} opt_instance If present,
this is used to extract\n * properties from an instance object.\n */\n
function register(nativeConstructor, wrapperConstructor, opt_instance) {\n v
ar nativePrototype = nativeConstructor.prototype;\n registerInternal(nativePr
ototype, wrapperConstructor, opt_instance);\n mixinStatics(wrapperConstructor
, nativeConstructor);\n }\n\n function registerInternal(nativePrototype, wrapp
erConstructor, opt_instance) {\n var wrapperPrototype = wrapperConstructor.pr
ototype;\n assert(constructorTable.get(nativePrototype) === undefined);\n\n
constructorTable.set(nativePrototype, wrapperConstructor);\n nativePrototyp
eTable.set(wrapperPrototype, nativePrototype);\n\n addForwardingProperties(na
tivePrototype, wrapperPrototype);\n if (opt_instance)\n registerInstance
Properties(wrapperPrototype, opt_instance);\n\n defineNonEnumerableDataProper
ty(\n wrapperPrototype, 'constructor', wrapperConstructor);\n // Set i
t again. Some VMs optimizes objects that are used as prototypes.\n wrapperCon
structor.prototype = wrapperPrototype;\n }\n\n function isWrapperFor(wrapperCo
nstructor, nativeConstructor) {\n return constructorTable.get(nativeConstruct
or.prototype) ===\n wrapperConstructor;\n }\n\n /**\n * Creates a gen
eric wrapper constructor based on |object| and its\n * constructor.\n * @par
am {Node} object\n * @return {Function} The generated constructor.\n */\n f
unction registerObject(object) {\n var nativePrototype = Object.getPrototypeO
f(object);\n\n var superWrapperConstructor = getWrapperConstructor(nativeProt
otype);\n var GeneratedWrapper = createWrapperConstructor(superWrapperConstru
ctor);\n registerInternal(nativePrototype, GeneratedWrapper, object);\n\n
return GeneratedWrapper;\n }\n\n function createWrapperConstructor(superWrappe
rConstructor) {\n function GeneratedWrapper(node) {\n superWrapperConstr
uctor.call(this, node);\n }\n var p = Object.create(superWrapperConstructo
r.prototype);\n p.constructor = GeneratedWrapper;\n GeneratedWrapper.proto
type = p;\n\n return GeneratedWrapper;\n }\n\n var OriginalDOMImplementatio
n = window.DOMImplementation;\n var OriginalEventTarget = window.EventTarget;\n
var OriginalEvent = window.Event;\n var OriginalNode = window.Node;\n var Or
iginalWindow = window.Window;\n var OriginalRange = window.Range;\n var Origin
alCanvasRenderingContext2D = window.CanvasRenderingContext2D;\n var OriginalWeb
GLRenderingContext = window.WebGLRenderingContext;\n var OriginalSVGElementInst
ance = window.SVGElementInstance;\n var OriginalFormData = window.FormData;\n
\n function isWrapper(object) {\n return object instanceof wrappers.EventTar
get ||\n object instanceof wrappers.Event ||\n object instan
ceof wrappers.Range ||\n object instanceof wrappers.DOMImplementation
||\n object instanceof wrappers.CanvasRenderingContext2D ||\n
object instanceof wrappers.FormData ||\n wrappers.WebGLRenderingCont
ext &&\n object instanceof wrappers.WebGLRenderingContext;\n }\n\
n function isNative(object) {\n return OriginalEventTarget && object instanc
eof OriginalEventTarget ||\n object instanceof OriginalNode ||\n
object instanceof OriginalEvent ||\n object instanceof OriginalWi
ndow ||\n object instanceof OriginalRange ||\n object instan
ceof OriginalDOMImplementation ||\n object instanceof OriginalCanvasRe
nderingContext2D ||\n object instanceof OriginalFormData ||\n
OriginalWebGLRenderingContext &&\n object instanceof OriginalWeb
GLRenderingContext ||\n OriginalSVGElementInstance &&\n
object instanceof OriginalSVGElementInstance;\n }\n\n /**\n * Wraps a node i
n a WrapperNode. If there already exists a wrapper for the\n * |node| that wra
pper is returned instead.\n * @param {Node} node\n * @return {WrapperNode}\n
*/\n function wrap(impl) {\n if (impl === null)\n return null;\n\n
assert(isNative(impl));\n return impl.polymerWrapper_ ||\n (impl.pol
ymerWrapper_ = new (getWrapperConstructor(impl))(impl));\n }\n\n /**\n * Unw
raps a wrapper and returns the node it is wrapping.\n * @param {WrapperNode} w
rapper\n * @return {Node}\n */\n function unwrap(wrapper) {\n if (wrappe
r === null)\n return null;\n assert(isWrapper(wrapper));\n return wra
pper.impl;\n }\n\n /**\n * Unwraps object if it is a wrapper.\n * @param {
Object} object\n * @return {Object} The native implementation object.\n */\n
function unwrapIfNeeded(object) {\n return object && isWrapper(object) ? un
wrap(object) : object;\n }\n\n /**\n * Wraps object if it is not a wrapper.\
n * @param {Object} object\n * @return {Object} The wrapper for object.\n
*/\n function wrapIfNeeded(object) {\n return object && !isWrapper(object) ?
wrap(object) : object;\n }\n\n /**\n * Overrides the current wrapper (if an
y) for node.\n * @param {Node} node\n * @param {WrapperNode=} wrapper If lef
t out the wrapper will be created as\n * needed next time someone wraps th
e node.\n */\n function rewrap(node, wrapper) {\n if (wrapper === null)\n
return;\n assert(isNative(node));\n assert(wrapper === undefined || i
sWrapper(wrapper));\n node.polymerWrapper_ = wrapper;\n }\n\n var getterDes
criptor = {\n get: undefined,\n configurable: true,\n enumerable: true\
n };\n\n function defineGetter(constructor, name, getter) {\n getterDescrip
tor.get = getter;\n defineProperty(constructor.prototype, name, getterDescrip
tor);\n }\n\n function defineWrapGetter(constructor, name) {\n defineGetter
(constructor, name, function() {\n return wrap(this.impl[name]);\n });\n
}\n\n /**\n * Forwards existing methods on the native object to the wrapper
methods.\n * This does not wrap any of the arguments or the return value sinc
e the\n * wrapper implementation already takes care of that.\n * @param {Arr
ay.<Function>} constructors\n * @parem {Array.<string>} names\n */\n functi
on forwardMethodsToWrapper(constructors, names) {\n constructors.forEach(func
tion(constructor) {\n names.forEach(function(name) {\n constructor.p
rototype[name] = function() {\n var w = wrapIfNeeded(this);\n
return w[name].apply(w, arguments);\n };\n });\n });\n }\n\n sc
ope.assert = assert;\n scope.constructorTable = constructorTable;\n scope.defi
neGetter = defineGetter;\n scope.defineWrapGetter = defineWrapGetter;\n scope.
forwardMethodsToWrapper = forwardMethodsToWrapper;\n scope.isWrapper = isWrappe
r;\n scope.isWrapperFor = isWrapperFor;\n scope.mixin = mixin;\n scope.native
PrototypeTable = nativePrototypeTable;\n scope.oneOf = oneOf;\n scope.register
Object = registerObject;\n scope.registerWrapper = register;\n scope.rewrap =
rewrap;\n scope.unwrap = unwrap;\n scope.unwrapIfNeeded = unwrapIfNeeded;\n s
cope.wrap = wrap;\n scope.wrapIfNeeded = wrapIfNeeded;\n scope.wrappers = wrap
pers;\n\n})(window.ShadowDOMPolyfill);\n", |
96 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(context) {\n 'use strict';\n\n var OriginalM
utationObserver = window.MutationObserver;\n var callbacks = [];\n var pending
= false;\n var timerFunc;\n\n function handle() {\n pending = false;\n
var copies = callbacks.slice(0);\n callbacks = [];\n for (var i = 0; i < c
opies.length; i++) {\n (0, copies[i])();\n }\n }\n\n if (OriginalMutat
ionObserver) {\n var counter = 1;\n var observer = new OriginalMutationObs
erver(handle);\n var textNode = document.createTextNode(counter);\n observ
er.observe(textNode, {characterData: true});\n\n timerFunc = function() {\n
counter = (counter + 1) % 2;\n textNode.data = counter;\n };\n\n }
else {\n timerFunc = window.setImmediate || window.setTimeout;\n }\n\n func
tion setEndOfMicrotask(func) {\n callbacks.push(func);\n if (pending)\n
return;\n pending = true;\n timerFunc(handle, 0);\n }\n\n context.set
EndOfMicrotask = setEndOfMicrotask;\n\n})(window.ShadowDOMPolyfill);\n", | 95 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(context) {\n 'use strict';\n\n var OriginalM
utationObserver = window.MutationObserver;\n var callbacks = [];\n var pending
= false;\n var timerFunc;\n\n function handle() {\n pending = false;\n
var copies = callbacks.slice(0);\n callbacks = [];\n for (var i = 0; i < c
opies.length; i++) {\n (0, copies[i])();\n }\n }\n\n if (OriginalMutat
ionObserver) {\n var counter = 1;\n var observer = new OriginalMutationObs
erver(handle);\n var textNode = document.createTextNode(counter);\n observ
er.observe(textNode, {characterData: true});\n\n timerFunc = function() {\n
counter = (counter + 1) % 2;\n textNode.data = counter;\n };\n\n }
else {\n timerFunc = window.setImmediate || window.setTimeout;\n }\n\n func
tion setEndOfMicrotask(func) {\n callbacks.push(func);\n if (pending)\n
return;\n pending = true;\n timerFunc(handle, 0);\n }\n\n context.set
EndOfMicrotask = setEndOfMicrotask;\n\n})(window.ShadowDOMPolyfill);\n", |
97 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var setEndOfMic
rotask = scope.setEndOfMicrotask\n var wrapIfNeeded = scope.wrapIfNeeded\n var
wrappers = scope.wrappers;\n\n var registrationsTable = new WeakMap();\n var
globalMutationObservers = [];\n var isScheduled = false;\n\n function schedule
Callback(observer) {\n if (isScheduled)\n return;\n setEndOfMicrotask
(notifyObservers);\n isScheduled = true;\n }\n\n // http://dom.spec.whatwg.
org/#mutation-observers\n function notifyObservers() {\n isScheduled = false
;\n\n do {\n var notifyList = globalMutationObservers.slice();\n va
r anyNonEmpty = false;\n for (var i = 0; i < notifyList.length; i++) {\n
var mo = notifyList[i];\n var queue = mo.takeRecords();\n rem
oveTransientObserversFor(mo);\n if (queue.length) {\n mo.callbac
k_(queue, mo);\n anyNonEmpty = true;\n }\n }\n } while (
anyNonEmpty);\n }\n\n /**\n * @param {string} type\n * @param {Node} targe
t\n * @constructor\n */\n function MutationRecord(type, target) {\n this
.type = type;\n this.target = target;\n this.addedNodes = new wrappers.Nod
eList();\n this.removedNodes = new wrappers.NodeList();\n this.previousSib
ling = null;\n this.nextSibling = null;\n this.attributeName = null;\n
this.attributeNamespace = null;\n this.oldValue = null;\n }\n\n /**\n * R
egisters transient observers to ancestor and its ancesors for the node\n * whi
ch was removed.\n * @param {!Node} ancestor\n * @param {!Node} node\n */\n
function registerTransientObservers(ancestor, node) {\n for (; ancestor; an
cestor = ancestor.parentNode) {\n var registrations = registrationsTable.ge
t(ancestor);\n if (!registrations)\n continue;\n for (var i = 0
; i < registrations.length; i++) {\n var registration = registrations[i];
\n if (registration.options.subtree)\n registration.addTransient
Observer(node);\n }\n }\n }\n\n function removeTransientObserversFor(o
bserver) {\n for (var i = 0; i < observer.nodes_.length; i++) {\n var no
de = observer.nodes_[i];\n var registrations = registrationsTable.get(node)
;\n if (!registrations)\n return;\n for (var j = 0; j < registr
ations.length; j++) {\n var registration = registrations[j];\n if
(registration.observer === observer)\n registration.removeTransientObse
rvers();\n }\n }\n }\n\n // http://dom.spec.whatwg.org/#queue-a-mutati
on-record\n function enqueueMutation(target, type, data) {\n // 1.\n var
interestedObservers = Object.create(null);\n var associatedStrings = Object.c
reate(null);\n\n // 2.\n for (var node = target; node; node = node.parentN
ode) {\n // 3.\n var registrations = registrationsTable.get(node);\n
if (!registrations)\n continue;\n for (var j = 0; j < registrati
ons.length; j++) {\n var registration = registrations[j];\n var op
tions = registration.options;\n // 1.\n if (node !== target && !op
tions.subtree)\n continue;\n\n // 2.\n if (type === 'attr
ibutes' && !options.attributes)\n continue;\n\n // 3. If type is
\"attributes\", options's attributeFilter is present, and\n // either op
tions's attributeFilter does not contain name or namespace\n // is non-nu
ll, continue.\n if (type === 'attributes' && options.attributeFilter &&\n
(data.namespace !== null ||\n options.attributeFilter.in
dexOf(data.name) === -1)) {\n continue;\n }\n\n // 4.\n
if (type === 'characterData' && !options.characterData)\n continu
e;\n\n // 5.\n if (type === 'childList' && !options.childList)\n
continue;\n\n // 6.\n var observer = registration.observer
;\n interestedObservers[observer.uid_] = observer;\n\n // 7. If ei
ther type is \"attributes\" and options's attributeOldValue is\n // true,
or type is \"characterData\" and options's characterDataOldValue\n // is
true, set the paired string of registered observer's observer in\n // in
terested observers to oldValue.\n if (type === 'attributes' && options.at
tributeOldValue ||\n type === 'characterData' && options.characterDat
aOldValue) {\n associatedStrings[observer.uid_] = data.oldValue;\n
}\n }\n }\n\n var anyRecordsEnqueued = false;\n\n // 4.\n fo
r (var uid in interestedObservers) {\n var observer = interestedObservers[u
id];\n var record = new MutationRecord(type, target);\n\n // 2.\n
if ('name' in data && 'namespace' in data) {\n record.attributeName = da
ta.name;\n record.attributeNamespace = data.namespace;\n }\n\n
// 3.\n if (data.addedNodes)\n record.addedNodes = data.addedNodes;\
n\n // 4.\n if (data.removedNodes)\n record.removedNodes = data
.removedNodes;\n\n // 5.\n if (data.previousSibling)\n record.p
reviousSibling = data.previousSibling;\n\n // 6.\n if (data.nextSiblin
g)\n record.nextSibling = data.nextSibling;\n\n // 7.\n if (ass
ociatedStrings[uid] !== undefined)\n record.oldValue = associatedStrings[
uid];\n\n // 8.\n observer.records_.push(record);\n\n anyRecordsE
nqueued = true;\n }\n\n if (anyRecordsEnqueued)\n scheduleCallback();
\n }\n\n var slice = Array.prototype.slice;\n\n /**\n * @param {!Object} op
tions\n * @constructor\n */\n function MutationObserverOptions(options) {\n
this.childList = !!options.childList;\n this.subtree = !!options.subtree;
\n\n // 1. If either options' attributeOldValue or attributeFilter is present
\n // and options' attributes is omitted, set options' attributes to true.\n
if (!('attributes' in options) &&\n ('attributeOldValue' in options ||
'attributeFilter' in options)) {\n this.attributes = true;\n } else {\n
this.attributes = !!options.attributes;\n }\n\n // 2. If options' ch
aracterDataOldValue is present and options'\n // characterData is omitted, se
t options' characterData to true.\n if ('characterDataOldValue' in options &&
!('characterData' in options))\n this.characterData = true;\n else\n
this.characterData = !!options.characterData;\n\n // 3. & 4.\n if (!thi
s.attributes &&\n (options.attributeOldValue || 'attributeFilter' in opti
ons) ||\n // 5.\n !this.characterData && options.characterDataOldV
alue) {\n throw new TypeError();\n }\n\n this.characterData = !!optio
ns.characterData;\n this.attributeOldValue = !!options.attributeOldValue;\n
this.characterDataOldValue = !!options.characterDataOldValue;\n if ('attrib
uteFilter' in options) {\n if (options.attributeFilter == null ||\n
typeof options.attributeFilter !== 'object') {\n throw new TypeError();
\n }\n this.attributeFilter = slice.call(options.attributeFilter);\n
} else {\n this.attributeFilter = null;\n }\n }\n\n var uidCounter =
0;\n\n /**\n * The class that maps to the DOM MutationObserver interface.\n
* @param {Function} callback.\n * @constructor\n */\n function MutationOb
server(callback) {\n this.callback_ = callback;\n this.nodes_ = [];\n t
his.records_ = [];\n this.uid_ = ++uidCounter;\n\n // This will leak. Ther
e is no way to implement this without WeakRefs :'(\n globalMutationObservers.
push(this);\n }\n\n MutationObserver.prototype = {\n // http://dom.spec.wha
twg.org/#dom-mutationobserver-observe\n observe: function(target, options) {\
n target = wrapIfNeeded(target);\n\n var newOptions = new MutationObse
rverOptions(options);\n\n // 6.\n var registration;\n var registr
ations = registrationsTable.get(target);\n if (!registrations)\n reg
istrationsTable.set(target, registrations = []);\n\n for (var i = 0; i < re
gistrations.length; i++) {\n if (registrations[i].observer === this) {\n
registration = registrations[i];\n // 6.1.\n registra
tion.removeTransientObservers();\n // 6.2.\n registration.opti
ons = newOptions;\n }\n }\n\n // 7.\n if (!registration) {
\n registration = new Registration(this, target, newOptions);\n re
gistrations.push(registration);\n this.nodes_.push(target);\n }\n
},\n\n // http://dom.spec.whatwg.org/#dom-mutationobserver-disconnect\n d
isconnect: function() {\n this.nodes_.forEach(function(node) {\n var
registrations = registrationsTable.get(node);\n for (var i = 0; i < regi
strations.length; i++) {\n var registration = registrations[i];\n
if (registration.observer === this) {\n registrations.splice(i, 1
);\n // Each node can only have one registered observer associated wi
th\n // this observer.\n break;\n }\n }\n
}, this);\n this.records_ = [];\n },\n\n takeRecords: function()
{\n var copyOfRecords = this.records_;\n this.records_ = [];\n r
eturn copyOfRecords;\n }\n };\n\n /**\n * Class used to represent a regis
tered observer.\n * @param {MutationObserver} observer\n * @param {Node} tar
get\n * @param {MutationObserverOptions} options\n * @constructor\n */\n
function Registration(observer, target, options) {\n this.observer = observer
;\n this.target = target;\n this.options = options;\n this.transientObs
ervedNodes = [];\n }\n\n Registration.prototype = {\n /**\n * Adds a tr
ansient observer on node. The transient observer gets removed\n * next time
we deliver the change records.\n * @param {Node} node\n */\n addTrans
ientObserver: function(node) {\n // Don't add transient observers on the ta
rget itself. We already have all\n // the required listeners set up on the
target.\n if (node === this.target)\n return;\n\n this.transien
tObservedNodes.push(node);\n var registrations = registrationsTable.get(nod
e);\n if (!registrations)\n registrationsTable.set(node, registratio
ns = []);\n\n // We know that registrations does not contain this because w
e already\n // checked if node === this.target.\n registrations.push(t
his);\n },\n\n removeTransientObservers: function() {\n var transient
ObservedNodes = this.transientObservedNodes;\n this.transientObservedNodes
= [];\n\n for (var i = 0; i < transientObservedNodes.length; i++) {\n
var node = transientObservedNodes[i];\n var registrations = registratio
nsTable.get(node);\n for (var j = 0; j < registrations.length; j++) {\n
if (registrations[j] === this) {\n registrations.splice(j, 1)
;\n // Each node can only have one registered observer associated wit
h\n // this observer.\n break;\n }\n }\n
}\n }\n };\n\n scope.enqueueMutation = enqueueMutation;\n scope.regist
erTransientObservers = registerTransientObservers;\n scope.wrappers.MutationObs
erver = MutationObserver;\n scope.wrappers.MutationRecord = MutationRecord;\n\n
})(window.ShadowDOMPolyfill);\n", | 96 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var setEndOfMic
rotask = scope.setEndOfMicrotask\n var wrapIfNeeded = scope.wrapIfNeeded\n var
wrappers = scope.wrappers;\n\n var registrationsTable = new WeakMap();\n var
globalMutationObservers = [];\n var isScheduled = false;\n\n function schedule
Callback(observer) {\n if (isScheduled)\n return;\n setEndOfMicrotask
(notifyObservers);\n isScheduled = true;\n }\n\n // http://dom.spec.whatwg.
org/#mutation-observers\n function notifyObservers() {\n isScheduled = false
;\n\n do {\n var notifyList = globalMutationObservers.slice();\n va
r anyNonEmpty = false;\n for (var i = 0; i < notifyList.length; i++) {\n
var mo = notifyList[i];\n var queue = mo.takeRecords();\n rem
oveTransientObserversFor(mo);\n if (queue.length) {\n mo.callbac
k_(queue, mo);\n anyNonEmpty = true;\n }\n }\n } while (
anyNonEmpty);\n }\n\n /**\n * @param {string} type\n * @param {Node} targe
t\n * @constructor\n */\n function MutationRecord(type, target) {\n this
.type = type;\n this.target = target;\n this.addedNodes = new wrappers.Nod
eList();\n this.removedNodes = new wrappers.NodeList();\n this.previousSib
ling = null;\n this.nextSibling = null;\n this.attributeName = null;\n
this.attributeNamespace = null;\n this.oldValue = null;\n }\n\n /**\n * R
egisters transient observers to ancestor and its ancesors for the node\n * whi
ch was removed.\n * @param {!Node} ancestor\n * @param {!Node} node\n */\n
function registerTransientObservers(ancestor, node) {\n for (; ancestor; an
cestor = ancestor.parentNode) {\n var registrations = registrationsTable.ge
t(ancestor);\n if (!registrations)\n continue;\n for (var i = 0
; i < registrations.length; i++) {\n var registration = registrations[i];
\n if (registration.options.subtree)\n registration.addTransient
Observer(node);\n }\n }\n }\n\n function removeTransientObserversFor(o
bserver) {\n for (var i = 0; i < observer.nodes_.length; i++) {\n var no
de = observer.nodes_[i];\n var registrations = registrationsTable.get(node)
;\n if (!registrations)\n return;\n for (var j = 0; j < registr
ations.length; j++) {\n var registration = registrations[j];\n if
(registration.observer === observer)\n registration.removeTransientObse
rvers();\n }\n }\n }\n\n // http://dom.spec.whatwg.org/#queue-a-mutati
on-record\n function enqueueMutation(target, type, data) {\n // 1.\n var
interestedObservers = Object.create(null);\n var associatedStrings = Object.c
reate(null);\n\n // 2.\n for (var node = target; node; node = node.parentN
ode) {\n // 3.\n var registrations = registrationsTable.get(node);\n
if (!registrations)\n continue;\n for (var j = 0; j < registrati
ons.length; j++) {\n var registration = registrations[j];\n var op
tions = registration.options;\n // 1.\n if (node !== target && !op
tions.subtree)\n continue;\n\n // 2.\n if (type === 'attr
ibutes' && !options.attributes)\n continue;\n\n // 3. If type is
\"attributes\", options's attributeFilter is present, and\n // either op
tions's attributeFilter does not contain name or namespace\n // is non-nu
ll, continue.\n if (type === 'attributes' && options.attributeFilter &&\n
(data.namespace !== null ||\n options.attributeFilter.in
dexOf(data.name) === -1)) {\n continue;\n }\n\n // 4.\n
if (type === 'characterData' && !options.characterData)\n continu
e;\n\n // 5.\n if (type === 'childList' && !options.childList)\n
continue;\n\n // 6.\n var observer = registration.observer
;\n interestedObservers[observer.uid_] = observer;\n\n // 7. If ei
ther type is \"attributes\" and options's attributeOldValue is\n // true,
or type is \"characterData\" and options's characterDataOldValue\n // is
true, set the paired string of registered observer's observer in\n // in
terested observers to oldValue.\n if (type === 'attributes' && options.at
tributeOldValue ||\n type === 'characterData' && options.characterDat
aOldValue) {\n associatedStrings[observer.uid_] = data.oldValue;\n
}\n }\n }\n\n var anyRecordsEnqueued = false;\n\n // 4.\n fo
r (var uid in interestedObservers) {\n var observer = interestedObservers[u
id];\n var record = new MutationRecord(type, target);\n\n // 2.\n
if ('name' in data && 'namespace' in data) {\n record.attributeName = da
ta.name;\n record.attributeNamespace = data.namespace;\n }\n\n
// 3.\n if (data.addedNodes)\n record.addedNodes = data.addedNodes;\
n\n // 4.\n if (data.removedNodes)\n record.removedNodes = data
.removedNodes;\n\n // 5.\n if (data.previousSibling)\n record.p
reviousSibling = data.previousSibling;\n\n // 6.\n if (data.nextSiblin
g)\n record.nextSibling = data.nextSibling;\n\n // 7.\n if (ass
ociatedStrings[uid] !== undefined)\n record.oldValue = associatedStrings[
uid];\n\n // 8.\n observer.records_.push(record);\n\n anyRecordsE
nqueued = true;\n }\n\n if (anyRecordsEnqueued)\n scheduleCallback();
\n }\n\n var slice = Array.prototype.slice;\n\n /**\n * @param {!Object} op
tions\n * @constructor\n */\n function MutationObserverOptions(options) {\n
this.childList = !!options.childList;\n this.subtree = !!options.subtree;
\n\n // 1. If either options' attributeOldValue or attributeFilter is present
\n // and options' attributes is omitted, set options' attributes to true.\n
if (!('attributes' in options) &&\n ('attributeOldValue' in options ||
'attributeFilter' in options)) {\n this.attributes = true;\n } else {\n
this.attributes = !!options.attributes;\n }\n\n // 2. If options' ch
aracterDataOldValue is present and options'\n // characterData is omitted, se
t options' characterData to true.\n if ('characterDataOldValue' in options &&
!('characterData' in options))\n this.characterData = true;\n else\n
this.characterData = !!options.characterData;\n\n // 3. & 4.\n if (!thi
s.attributes &&\n (options.attributeOldValue || 'attributeFilter' in opti
ons) ||\n // 5.\n !this.characterData && options.characterDataOldV
alue) {\n throw new TypeError();\n }\n\n this.characterData = !!optio
ns.characterData;\n this.attributeOldValue = !!options.attributeOldValue;\n
this.characterDataOldValue = !!options.characterDataOldValue;\n if ('attrib
uteFilter' in options) {\n if (options.attributeFilter == null ||\n
typeof options.attributeFilter !== 'object') {\n throw new TypeError();
\n }\n this.attributeFilter = slice.call(options.attributeFilter);\n
} else {\n this.attributeFilter = null;\n }\n }\n\n var uidCounter =
0;\n\n /**\n * The class that maps to the DOM MutationObserver interface.\n
* @param {Function} callback.\n * @constructor\n */\n function MutationOb
server(callback) {\n this.callback_ = callback;\n this.nodes_ = [];\n t
his.records_ = [];\n this.uid_ = ++uidCounter;\n\n // This will leak. Ther
e is no way to implement this without WeakRefs :'(\n globalMutationObservers.
push(this);\n }\n\n MutationObserver.prototype = {\n // http://dom.spec.wha
twg.org/#dom-mutationobserver-observe\n observe: function(target, options) {\
n target = wrapIfNeeded(target);\n\n var newOptions = new MutationObse
rverOptions(options);\n\n // 6.\n var registration;\n var registr
ations = registrationsTable.get(target);\n if (!registrations)\n reg
istrationsTable.set(target, registrations = []);\n\n for (var i = 0; i < re
gistrations.length; i++) {\n if (registrations[i].observer === this) {\n
registration = registrations[i];\n // 6.1.\n registra
tion.removeTransientObservers();\n // 6.2.\n registration.opti
ons = newOptions;\n }\n }\n\n // 7.\n if (!registration) {
\n registration = new Registration(this, target, newOptions);\n re
gistrations.push(registration);\n this.nodes_.push(target);\n }\n
},\n\n // http://dom.spec.whatwg.org/#dom-mutationobserver-disconnect\n d
isconnect: function() {\n this.nodes_.forEach(function(node) {\n var
registrations = registrationsTable.get(node);\n for (var i = 0; i < regi
strations.length; i++) {\n var registration = registrations[i];\n
if (registration.observer === this) {\n registrations.splice(i, 1
);\n // Each node can only have one registered observer associated wi
th\n // this observer.\n break;\n }\n }\n
}, this);\n this.records_ = [];\n },\n\n takeRecords: function()
{\n var copyOfRecords = this.records_;\n this.records_ = [];\n r
eturn copyOfRecords;\n }\n };\n\n /**\n * Class used to represent a regis
tered observer.\n * @param {MutationObserver} observer\n * @param {Node} tar
get\n * @param {MutationObserverOptions} options\n * @constructor\n */\n
function Registration(observer, target, options) {\n this.observer = observer
;\n this.target = target;\n this.options = options;\n this.transientObs
ervedNodes = [];\n }\n\n Registration.prototype = {\n /**\n * Adds a tr
ansient observer on node. The transient observer gets removed\n * next time
we deliver the change records.\n * @param {Node} node\n */\n addTrans
ientObserver: function(node) {\n // Don't add transient observers on the ta
rget itself. We already have all\n // the required listeners set up on the
target.\n if (node === this.target)\n return;\n\n this.transien
tObservedNodes.push(node);\n var registrations = registrationsTable.get(nod
e);\n if (!registrations)\n registrationsTable.set(node, registratio
ns = []);\n\n // We know that registrations does not contain this because w
e already\n // checked if node === this.target.\n registrations.push(t
his);\n },\n\n removeTransientObservers: function() {\n var transient
ObservedNodes = this.transientObservedNodes;\n this.transientObservedNodes
= [];\n\n for (var i = 0; i < transientObservedNodes.length; i++) {\n
var node = transientObservedNodes[i];\n var registrations = registratio
nsTable.get(node);\n for (var j = 0; j < registrations.length; j++) {\n
if (registrations[j] === this) {\n registrations.splice(j, 1)
;\n // Each node can only have one registered observer associated wit
h\n // this observer.\n break;\n }\n }\n
}\n }\n };\n\n scope.enqueueMutation = enqueueMutation;\n scope.regist
erTransientObservers = registerTransientObservers;\n scope.wrappers.MutationObs
erver = MutationObserver;\n scope.wrappers.MutationRecord = MutationRecord;\n\n
})(window.ShadowDOMPolyfill);\n", |
98 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n /**\n * A tr
ee scope represents the root of a tree. All nodes in a tree point to\n * the s
ame TreeScope object. The tree scope of a node get set the first time\n * it i
s accessed or when a node is added or remove to a tree.\n *\n * The root is
a Node that has no parent.\n *\n * The parent is another TreeScope. For Shad
owRoots, it is the TreeScope of\n * the host of the ShadowRoot.\n *\n * @p
aram {!Node} root\n * @param {TreeScope} parent\n * @constructor\n */\n f
unction TreeScope(root, parent) {\n /** @type {!Node} */\n this.root = roo
t;\n\n /** @type {TreeScope} */\n this.parent = parent;\n }\n\n TreeScop
e.prototype = {\n get renderer() {\n if (this.root instanceof scope.wrap
pers.ShadowRoot) {\n return scope.getRendererForHost(this.root.host);\n
}\n return null;\n },\n\n contains: function(treeScope) {\n
for (; treeScope; treeScope = treeScope.parent) {\n if (treeScope === thi
s)\n return true;\n }\n return false;\n }\n };\n\n funct
ion setTreeScope(node, treeScope) {\n if (node.treeScope_ !== treeScope) {\n
node.treeScope_ = treeScope;\n for (var sr = node.shadowRoot; sr; sr =
sr.olderShadowRoot) {\n sr.treeScope_.parent = treeScope;\n }\n
for (var child = node.firstChild; child; child = child.nextSibling) {\n
setTreeScope(child, treeScope);\n }\n }\n }\n\n function getTreeScope
(node) {\n if (node instanceof scope.wrappers.Window) {\n debugger;\n
}\n\n if (node.treeScope_)\n return node.treeScope_;\n var parent =
node.parentNode;\n var treeScope;\n if (parent)\n treeScope = getTree
Scope(parent);\n else\n treeScope = new TreeScope(node, null);\n retu
rn node.treeScope_ = treeScope;\n }\n\n scope.TreeScope = TreeScope;\n scope.
getTreeScope = getTreeScope;\n scope.setTreeScope = setTreeScope;\n\n})(window.
ShadowDOMPolyfill);\n", | 97 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n /**\n * A tr
ee scope represents the root of a tree. All nodes in a tree point to\n * the s
ame TreeScope object. The tree scope of a node get set the first time\n * it i
s accessed or when a node is added or remove to a tree.\n *\n * The root is
a Node that has no parent.\n *\n * The parent is another TreeScope. For Shad
owRoots, it is the TreeScope of\n * the host of the ShadowRoot.\n *\n * @p
aram {!Node} root\n * @param {TreeScope} parent\n * @constructor\n */\n f
unction TreeScope(root, parent) {\n /** @type {!Node} */\n this.root = roo
t;\n\n /** @type {TreeScope} */\n this.parent = parent;\n }\n\n TreeScop
e.prototype = {\n get renderer() {\n if (this.root instanceof scope.wrap
pers.ShadowRoot) {\n return scope.getRendererForHost(this.root.host);\n
}\n return null;\n },\n\n contains: function(treeScope) {\n
for (; treeScope; treeScope = treeScope.parent) {\n if (treeScope === thi
s)\n return true;\n }\n return false;\n }\n };\n\n funct
ion setTreeScope(node, treeScope) {\n if (node.treeScope_ !== treeScope) {\n
node.treeScope_ = treeScope;\n for (var sr = node.shadowRoot; sr; sr =
sr.olderShadowRoot) {\n sr.treeScope_.parent = treeScope;\n }\n
for (var child = node.firstChild; child; child = child.nextSibling) {\n
setTreeScope(child, treeScope);\n }\n }\n }\n\n function getTreeScope
(node) {\n if (node instanceof scope.wrappers.Window) {\n debugger;\n
}\n\n if (node.treeScope_)\n return node.treeScope_;\n var parent =
node.parentNode;\n var treeScope;\n if (parent)\n treeScope = getTree
Scope(parent);\n else\n treeScope = new TreeScope(node, null);\n retu
rn node.treeScope_ = treeScope;\n }\n\n scope.TreeScope = TreeScope;\n scope.
getTreeScope = getTreeScope;\n scope.setTreeScope = setTreeScope;\n\n})(window.
ShadowDOMPolyfill);\n", |
99 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var forwardMethodsToWrap
per = scope.forwardMethodsToWrapper;\n var getTreeScope = scope.getTreeScope;\n
var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n va
r unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers = scope.wrapp
ers;\n\n var wrappedFuns = new WeakMap();\n var listenersTable = new WeakMap()
;\n var handledEventsTable = new WeakMap();\n var currentlyDispatchingEvents =
new WeakMap();\n var targetTable = new WeakMap();\n var currentTargetTable =
new WeakMap();\n var relatedTargetTable = new WeakMap();\n var eventPhaseTable
= new WeakMap();\n var stopPropagationTable = new WeakMap();\n var stopImmedi
atePropagationTable = new WeakMap();\n var eventHandlersTable = new WeakMap();\
n var eventPathTable = new WeakMap();\n\n function isShadowRoot(node) {\n r
eturn node instanceof wrappers.ShadowRoot;\n }\n\n function rootOfNode(node) {
\n return getTreeScope(node).root;\n }\n\n // http://w3c.github.io/webcompo
nents/spec/shadow/#event-paths\n function getEventPath(node, event) {\n var
path = [];\n var current = node;\n path.push(current);\n while (current
) {\n // 4.1.\n var destinationInsertionPoints = getDestinationInserti
onPoints(current);\n if (destinationInsertionPoints && destinationInsertion
Points.length > 0) {\n // 4.1.1\n for (var i = 0; i < destinationI
nsertionPoints.length; i++) {\n var insertionPoint = destinationInserti
onPoints[i];\n // 4.1.1.1\n if (isShadowInsertionPoint(inserti
onPoint)) {\n var shadowRoot = rootOfNode(insertionPoint);\n
// 4.1.1.1.2\n var olderShadowRoot = shadowRoot.olderShadowRoot;\n
if (olderShadowRoot)\n path.push(olderShadowRoot);\n
}\n\n // 4.1.1.2\n path.push(insertionPoint);\n
}\n\n // 4.1.2\n current = destinationInsertionPoints[\n
destinationInsertionPoints.length - 1];\n\n // 4.2\n } else {\n
if (isShadowRoot(current)) {\n if (inSameTree(node, current) && even
tMustBeStopped(event)) {\n // Stop this algorithm\n break;
\n }\n current = current.host;\n path.push(current);\
n\n // 4.2.2\n } else {\n current = current.parentNode;\n
if (current)\n path.push(current);\n }\n }\n
}\n\n return path;\n }\n\n // http://w3c.github.io/webcomponents/spec/shad
ow/#dfn-events-always-stopped\n function eventMustBeStopped(event) {\n if (!
event)\n return false;\n\n switch (event.type) {\n case 'abort':\n
case 'error':\n case 'select':\n case 'change':\n case 'load
':\n case 'reset':\n case 'resize':\n case 'scroll':\n case
'selectstart':\n return true;\n }\n return false;\n }\n\n // http
://w3c.github.io/webcomponents/spec/shadow/#dfn-shadow-insertion-point\n functi
on isShadowInsertionPoint(node) {\n return node instanceof HTMLShadowElement;
\n // and make sure that there are no shadow precing this?\n // and that t
here is no content ancestor?\n }\n\n function getDestinationInsertionPoints(no
de) {\n return scope.getDestinationInsertionPoints(node);\n }\n\n // http:/
/w3c.github.io/webcomponents/spec/shadow/#event-retargeting\n function eventRet
argetting(path, currentTarget) {\n if (path.length === 0)\n return curre
ntTarget;\n\n // The currentTarget might be the window object. Use its docume
nt for the\n // purpose of finding the retargetted node.\n if (currentTarg
et instanceof wrappers.Window)\n currentTarget = currentTarget.document;\n\
n var currentTargetTree = getTreeScope(currentTarget);\n var originalTarge
t = path[0];\n var originalTargetTree = getTreeScope(originalTarget);\n va
r relativeTargetTree =\n lowestCommonInclusiveAncestor(currentTargetTree,
originalTargetTree);\n\n for (var i = 0; i < path.length; i++) {\n var
node = path[i];\n if (getTreeScope(node) === relativeTargetTree)\n r
eturn node;\n }\n\n return path[path.length - 1];\n }\n\n function getTr
eeScopeAncestors(treeScope) {\n var ancestors = [];\n for (;treeScope; tre
eScope = treeScope.parent) {\n ancestors.push(treeScope);\n }\n retur
n ancestors;\n }\n\n function lowestCommonInclusiveAncestor(tsA, tsB) {\n v
ar ancestorsA = getTreeScopeAncestors(tsA);\n var ancestorsB = getTreeScopeAn
cestors(tsB);\n\n var result = null;\n while (ancestorsA.length > 0 && anc
estorsB.length > 0) {\n var a = ancestorsA.pop();\n var b = ancestorsB
.pop();\n if (a === b)\n result = a;\n else\n break;\n
}\n return result;\n }\n\n function getTreeScopeRoot(ts) {\n if (!ts.p
arent)\n return ts;\n return getTreeScopeRoot(ts.parent);\n }\n\n func
tion relatedTargetResolution(event, currentTarget, relatedTarget) {\n // In c
ase the current target is a window use its document for the purpose\n // of r
etargetting the related target.\n if (currentTarget instanceof wrappers.Windo
w)\n currentTarget = currentTarget.document;\n\n var currentTargetTree =
getTreeScope(currentTarget);\n var relatedTargetTree = getTreeScope(relatedT
arget);\n\n var relatedTargetEventPath = getEventPath(relatedTarget, event);\
n\n var lowestCommonAncestorTree;\n\n // 4\n var lowestCommonAncestorTr
ee =\n lowestCommonInclusiveAncestor(currentTargetTree, relatedTargetTree
);\n\n // 5\n if (!lowestCommonAncestorTree)\n lowestCommonAncestorTr
ee = relatedTargetTree.root;\n\n // 6\n for (var commonAncestorTree = lowe
stCommonAncestorTree;\n commonAncestorTree;\n commonAncestorTree
= commonAncestorTree.parent) {\n // 6.1\n var adjustedRelatedTarget;\
n for (var i = 0; i < relatedTargetEventPath.length; i++) {\n var no
de = relatedTargetEventPath[i];\n if (getTreeScope(node) === commonAncest
orTree)\n return node;\n }\n }\n\n return null;\n }\n\n fu
nction inSameTree(a, b) {\n return getTreeScope(a) === getTreeScope(b);\n }\
n\n var NONE = 0;\n var CAPTURING_PHASE = 1;\n var AT_TARGET = 2;\n var BUBB
LING_PHASE = 3;\n\n // pendingError is used to rethrow the first error we got d
uring an event\n // dispatch. The browser actually reports all errors but to do
that we would\n // need to rethrow the error asynchronously.\n var pendingErr
or;\n\n function dispatchOriginalEvent(originalEvent) {\n // Make sure this
event is only dispatched once.\n if (handledEventsTable.get(originalEvent))\n
return;\n handledEventsTable.set(originalEvent, true);\n dispatchEve
nt(wrap(originalEvent), wrap(originalEvent.target));\n if (pendingError) {\n
var err = pendingError;\n pendingError = null;\n throw err;\n
}\n }\n\n function dispatchEvent(event, originalWrapperTarget) {\n if (curr
entlyDispatchingEvents.get(event))\n throw new Error('InvalidStateError');\
n\n currentlyDispatchingEvents.set(event, true);\n\n // Render to ensure t
hat the event path is correct.\n scope.renderAllPending();\n var eventPath
;\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappap
is.html#events-and-the-window-object\n // All events dispatched on Nodes with
a default view, except load events,\n // should propagate to the Window.\n\n
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#
the-end\n var overrideTarget;\n var win;\n var type = event.type;\n\n
// Should really be not cancelable too but since Firefox has a bug there\n
// we skip that check.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=9994
56\n if (type === 'load' && !event.bubbles) {\n var doc = originalWrappe
rTarget;\n if (doc instanceof wrappers.Document && (win = doc.defaultView))
{\n overrideTarget = doc;\n eventPath = [];\n }\n }\n\n
if (!eventPath) {\n if (originalWrapperTarget instanceof wrappers.Window)
{\n win = originalWrapperTarget;\n eventPath = [];\n } else
{\n eventPath = getEventPath(originalWrapperTarget, event);\n\n if
(event.type !== 'load') {\n var doc = eventPath[eventPath.length - 1];
\n if (doc instanceof wrappers.Document)\n win = doc.default
View;\n }\n }\n }\n\n eventPathTable.set(event, eventPath);\n\
n if (dispatchCapturing(event, eventPath, win, overrideTarget)) {\n if (
dispatchAtTarget(event, eventPath, win, overrideTarget)) {\n dispatchBubb
ling(event, eventPath, win, overrideTarget);\n }\n }\n\n eventPhaseTa
ble.set(event, NONE);\n currentTargetTable.delete(event, null);\n currentl
yDispatchingEvents.delete(event);\n\n return event.defaultPrevented;\n }\n\n
function dispatchCapturing(event, eventPath, win, overrideTarget) {\n var p
hase = CAPTURING_PHASE;\n\n if (win) {\n if (!invoke(win, event, phase,
eventPath, overrideTarget))\n return false;\n }\n\n for (var i = ev
entPath.length - 1; i > 0; i--) {\n if (!invoke(eventPath[i], event, phase,
eventPath, overrideTarget))\n return false;\n }\n\n return true;\n
}\n\n function dispatchAtTarget(event, eventPath, win, overrideTarget) {\n
var phase = AT_TARGET;\n var currentTarget = eventPath[0] || win;\n retur
n invoke(currentTarget, event, phase, eventPath, overrideTarget);\n }\n\n func
tion dispatchBubbling(event, eventPath, win, overrideTarget) {\n var phase =
BUBBLING_PHASE;\n for (var i = 1; i < eventPath.length; i++) {\n if (!in
voke(eventPath[i], event, phase, eventPath, overrideTarget))\n return;\n
}\n\n if (win && eventPath.length > 0) {\n invoke(win, event, phase,
eventPath, overrideTarget);\n }\n }\n\n function invoke(currentTarget, even
t, phase, eventPath, overrideTarget) {\n var listeners = listenersTable.get(c
urrentTarget);\n if (!listeners)\n return true;\n\n var target = over
rideTarget || eventRetargetting(eventPath, currentTarget);\n\n if (target ===
currentTarget) {\n if (phase === CAPTURING_PHASE)\n return true;\n\
n if (phase === BUBBLING_PHASE)\n phase = AT_TARGET;\n\n } else
if (phase === BUBBLING_PHASE && !event.bubbles) {\n return true;\n }\n\n
if ('relatedTarget' in event) {\n var originalEvent = unwrap(event);\n
var unwrappedRelatedTarget = originalEvent.relatedTarget;\n\n // X-Tag
sets relatedTarget on a CustomEvent. If they do that there is no\n // way
to have relatedTarget return the adjusted target but worse is that\n // the
originalEvent might not have a relatedTarget so we hit an assert\n // when
we try to wrap it.\n if (unwrappedRelatedTarget) {\n // In IE we ca
n get objects that are not EventTargets at this point.\n // Safari does n
ot have an EventTarget interface so revert to checking\n // for addEventL
istener as an approximation.\n if (unwrappedRelatedTarget instanceof Obje
ct &&\n unwrappedRelatedTarget.addEventListener) {\n var rel
atedTarget = wrap(unwrappedRelatedTarget);\n\n var adjusted =\n
relatedTargetResolution(event, currentTarget, relatedTarget);\n i
f (adjusted === target)\n return true;\n } else {\n a
djusted = null;\n }\n relatedTargetTable.set(event, adjusted);\n
}\n }\n\n eventPhaseTable.set(event, phase);\n var type = event.typ
e;\n\n var anyRemoved = false;\n // targetTable.set(event, target);\n t
argetTable.set(event, target);\n currentTargetTable.set(event, currentTarget)
;\n\n // Keep track of the invoke depth so that we only clean up the removed\
n // listeners if we are in the outermost invoke.\n listeners.depth++;\n\n
for (var i = 0, len = listeners.length; i < len; i++) {\n var listener
= listeners[i];\n if (listener.removed) {\n anyRemoved = true;\n
continue;\n }\n\n if (listener.type !== type ||\n !listen
er.capture && phase === CAPTURING_PHASE ||\n listener.capture && phase
=== BUBBLING_PHASE) {\n continue;\n }\n\n try {\n if (ty
peof listener.handler === 'function')\n listener.handler.call(currentTa
rget, event);\n else\n listener.handler.handleEvent(event);\n\n
if (stopImmediatePropagationTable.get(event))\n return false;\n\
n } catch (ex) {\n if (!pendingError)\n pendingError = ex;\
n }\n }\n\n listeners.depth--;\n\n if (anyRemoved && listeners.dep
th === 0) {\n var copy = listeners.slice();\n listeners.length = 0;\n
for (var i = 0; i < copy.length; i++) {\n if (!copy[i].removed)\n
listeners.push(copy[i]);\n }\n }\n\n return !stopPropagationTa
ble.get(event);\n }\n\n function Listener(type, handler, capture) {\n this.
type = type;\n this.handler = handler;\n this.capture = Boolean(capture);\
n }\n Listener.prototype = {\n equals: function(that) {\n return this.
handler === that.handler && this.type === that.type &&\n this.capture =
== that.capture;\n },\n get removed() {\n return this.handler === nul
l;\n },\n remove: function() {\n this.handler = null;\n }\n };\n\
n var OriginalEvent = window.Event;\n OriginalEvent.prototype.polymerBlackList
_ = {\n returnValue: true,\n // TODO(arv): keyLocation is part of Keyboard
Event but Firefox does not\n // support constructable KeyboardEvent so we kee
p it here for now.\n keyLocation: true\n };\n\n /**\n * Creates a new Eve
nt wrapper or wraps an existin native Event object.\n * @param {string|Event}
type\n * @param {Object=} options\n * @constructor\n */\n function Event(
type, options) {\n if (type instanceof OriginalEvent) {\n var impl = typ
e;\n if (!OriginalBeforeUnloadEvent && impl.type === 'beforeunload')\n
return new BeforeUnloadEvent(impl);\n this.impl = impl;\n } else {\n
return wrap(constructEvent(OriginalEvent, 'Event', type, options));\n }\
n }\n Event.prototype = {\n get target() {\n return targetTable.get(th
is);\n },\n get currentTarget() {\n return currentTargetTable.get(thi
s);\n },\n get eventPhase() {\n return eventPhaseTable.get(this);\n
},\n get path() {\n var eventPath = eventPathTable.get(this);\n i
f (!eventPath)\n return [];\n // TODO(arv): Event path should contai
n window.\n return eventPath.slice();\n },\n stopPropagation: functio
n() {\n stopPropagationTable.set(this, true);\n },\n stopImmediatePro
pagation: function() {\n stopPropagationTable.set(this, true);\n stopI
mmediatePropagationTable.set(this, true);\n }\n };\n registerWrapper(Origin
alEvent, Event, document.createEvent('Event'));\n\n function unwrapOptions(opti
ons) {\n if (!options || !options.relatedTarget)\n return options;\n
return Object.create(options, {\n relatedTarget: {value: unwrap(options.rel
atedTarget)}\n });\n }\n\n function registerGenericEvent(name, SuperEvent,
prototype) {\n var OriginalEvent = window[name];\n var GenericEvent = func
tion(type, options) {\n if (type instanceof OriginalEvent)\n this.im
pl = type;\n else\n return wrap(constructEvent(OriginalEvent, name,
type, options));\n };\n GenericEvent.prototype = Object.create(SuperEvent.
prototype);\n if (prototype)\n mixin(GenericEvent.prototype, prototype);
\n if (OriginalEvent) {\n // - Old versions of Safari fails on new Focus
Event (and others?).\n // - IE does not support event constructors.\n
// - createEvent('FocusEvent') throws in Firefox.\n // => Try the best prac
tice solution first and fallback to the old way\n // if needed.\n try
{\n registerWrapper(OriginalEvent, GenericEvent, new OriginalEvent('temp'
));\n } catch (ex) {\n registerWrapper(OriginalEvent, GenericEvent,\
n document.createEvent(name));\n }\n }\n retur
n GenericEvent;\n }\n\n var UIEvent = registerGenericEvent('UIEvent', Event);\
n var CustomEvent = registerGenericEvent('CustomEvent', Event);\n\n var relate
dTargetProto = {\n get relatedTarget() {\n var relatedTarget = relatedTa
rgetTable.get(this);\n // relatedTarget can be null.\n if (relatedTarg
et !== undefined)\n return relatedTarget;\n return wrap(unwrap(this)
.relatedTarget);\n }\n };\n\n function getInitFunction(name, relatedTargetI
ndex) {\n return function() {\n arguments[relatedTargetIndex] = unwrap(a
rguments[relatedTargetIndex]);\n var impl = unwrap(this);\n impl[name]
.apply(impl, arguments);\n };\n }\n\n var mouseEventProto = mixin({\n in
itMouseEvent: getInitFunction('initMouseEvent', 14)\n }, relatedTargetProto);\n
\n var focusEventProto = mixin({\n initFocusEvent: getInitFunction('initFocu
sEvent', 5)\n }, relatedTargetProto);\n\n var MouseEvent = registerGenericEven
t('MouseEvent', UIEvent, mouseEventProto);\n var FocusEvent = registerGenericEv
ent('FocusEvent', UIEvent, focusEventProto);\n\n // In case the browser does no
t support event constructors we polyfill that\n // by calling `createEvent('Foo
')` and `initFooEvent` where the arguments to\n // `initFooEvent` are derived f
rom the registered default event init dict.\n var defaultInitDicts = Object.cre
ate(null);\n\n var supportsEventConstructors = (function() {\n try {\n
new window.FocusEvent('focus');\n } catch (ex) {\n return false;\n }\
n return true;\n })();\n\n /**\n * Constructs a new native event.\n */\
n function constructEvent(OriginalEvent, name, type, options) {\n if (suppor
tsEventConstructors)\n return new OriginalEvent(type, unwrapOptions(options
));\n\n // Create the arguments from the default dictionary.\n var event =
unwrap(document.createEvent(name));\n var defaultDict = defaultInitDicts[nam
e];\n var args = [type];\n Object.keys(defaultDict).forEach(function(key)
{\n var v = options != null && key in options ?\n options[key] : d
efaultDict[key];\n if (key === 'relatedTarget')\n v = unwrap(v);\n
args.push(v);\n });\n event['init' + name].apply(event, args);\n re
turn event;\n }\n\n if (!supportsEventConstructors) {\n var configureEventC
onstructor = function(name, initDict, superName) {\n if (superName) {\n
var superDict = defaultInitDicts[superName];\n initDict = mixin(mixin
({}, superDict), initDict);\n }\n\n defaultInitDicts[name] = initDict;
\n };\n\n // The order of the default event init dictionary keys is import
ant, the\n // arguments to initFooEvent is derived from that.\n configureE
ventConstructor('Event', {bubbles: false, cancelable: false});\n configureEve
ntConstructor('CustomEvent', {detail: null}, 'Event');\n configureEventConstr
uctor('UIEvent', {view: null, detail: 0}, 'Event');\n configureEventConstruct
or('MouseEvent', {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n
clientY: 0,\n ctrlKey: false,\n altKey: false,\n shiftKey: fal
se,\n metaKey: false,\n button: 0,\n relatedTarget: null\n },
'UIEvent');\n configureEventConstructor('FocusEvent', {relatedTarget: null},
'UIEvent');\n }\n\n // Safari 7 does not yet have BeforeUnloadEvent.\n // htt
ps://bugs.webkit.org/show_bug.cgi?id=120849\n var OriginalBeforeUnloadEvent = w
indow.BeforeUnloadEvent;\n\n function BeforeUnloadEvent(impl) {\n Event.call
(this, impl);\n }\n BeforeUnloadEvent.prototype = Object.create(Event.prototyp
e);\n mixin(BeforeUnloadEvent.prototype, {\n get returnValue() {\n retu
rn this.impl.returnValue;\n },\n set returnValue(v) {\n this.impl.ret
urnValue = v;\n }\n });\n\n if (OriginalBeforeUnloadEvent)\n registerWra
pper(OriginalBeforeUnloadEvent, BeforeUnloadEvent);\n\n function isValidListene
r(fun) {\n if (typeof fun === 'function')\n return true;\n return fun
&& fun.handleEvent;\n }\n\n function isMutationEvent(type) {\n switch (typ
e) {\n case 'DOMAttrModified':\n case 'DOMAttributeNameChanged':\n
case 'DOMCharacterDataModified':\n case 'DOMElementNameChanged':\n c
ase 'DOMNodeInserted':\n case 'DOMNodeInsertedIntoDocument':\n case 'D
OMNodeRemoved':\n case 'DOMNodeRemovedFromDocument':\n case 'DOMSubtre
eModified':\n return true;\n }\n return false;\n }\n\n var Origin
alEventTarget = window.EventTarget;\n\n /**\n * This represents a wrapper for
an EventTarget.\n * @param {!EventTarget} impl The original event target.\n
* @constructor\n */\n function EventTarget(impl) {\n this.impl = impl;\n
}\n\n // Node and Window have different internal type checks in WebKit so we c
annot\n // use the same method as the original function.\n var methodNames = [
\n 'addEventListener',\n 'removeEventListener',\n 'dispatchEvent'\n ];
\n\n [Node, Window].forEach(function(constructor) {\n var p = constructor.pr
ototype;\n methodNames.forEach(function(name) {\n Object.defineProperty(
p, name + '_', {value: p[name]});\n });\n });\n\n function getTargetToListe
nAt(wrapper) {\n if (wrapper instanceof wrappers.ShadowRoot)\n wrapper =
wrapper.host;\n return unwrap(wrapper);\n }\n\n EventTarget.prototype = {\
n addEventListener: function(type, fun, capture) {\n if (!isValidListene
r(fun) || isMutationEvent(type))\n return;\n\n var listener = new Li
stener(type, fun, capture);\n var listeners = listenersTable.get(this);\n
if (!listeners) {\n listeners = [];\n listeners.depth = 0;\n
listenersTable.set(this, listeners);\n } else {\n // Might hav
e a duplicate.\n for (var i = 0; i < listeners.length; i++) {\n
if (listener.equals(listeners[i]))\n return;\n }\n }\n\n
listeners.push(listener);\n\n var target = getTargetToListenAt(this);\
n target.addEventListener_(type, dispatchOriginalEvent, true);\n },\n
removeEventListener: function(type, fun, capture) {\n capture = Boolean(ca
pture);\n var listeners = listenersTable.get(this);\n if (!listeners)\
n return;\n var count = 0, found = false;\n for (var i = 0; i <
listeners.length; i++) {\n if (listeners[i].type === type && listeners[i
].capture === capture) {\n count++;\n if (listeners[i].handler
=== fun) {\n found = true;\n listeners[i].remove();\n
}\n }\n }\n\n if (found && count === 1) {\n var ta
rget = getTargetToListenAt(this);\n target.removeEventListener_(type, dis
patchOriginalEvent, true);\n }\n },\n dispatchEvent: function(event)
{\n // We want to use the native dispatchEvent because it triggers the defa
ult\n // actions (like checking a checkbox). However, if there are no liste
ners\n // in the composed tree then there are no events that will trigger a
nd\n // listeners in the non composed tree that are part of the event path
are\n // not notified.\n //\n // If we find out that there are no
listeners in the composed tree we add\n // a temporary listener to the tar
get which makes us get called back even\n // in that case.\n\n var nat
iveEvent = unwrap(event);\n var eventType = nativeEvent.type;\n\n // A
llow dispatching the same event again. This is safe because if user\n // co
de calls this during an existing dispatch of the same event the\n // native
dispatchEvent throws (that is required by the spec).\n handledEventsTable.
set(nativeEvent, false);\n\n // Force rendering since we prefer native disp
atch and that works on the\n // composed tree.\n scope.renderAllPendin
g();\n\n var tempListener;\n if (!hasListenerInAncestors(this, eventTy
pe)) {\n tempListener = function() {};\n this.addEventListener(eve
ntType, tempListener, true);\n }\n\n try {\n return unwrap(this
).dispatchEvent_(nativeEvent);\n } finally {\n if (tempListener)\n
this.removeEventListener(eventType, tempListener, true);\n }\n }
\n };\n\n function hasListener(node, type) {\n var listeners = listenersTab
le.get(node);\n if (listeners) {\n for (var i = 0; i < listeners.length;
i++) {\n if (!listeners[i].removed && listeners[i].type === type)\n
return true;\n }\n }\n return false;\n }\n\n function hasListe
nerInAncestors(target, type) {\n for (var node = unwrap(target); node; node =
node.parentNode) {\n if (hasListener(wrap(node), type))\n return tr
ue;\n }\n return false;\n }\n\n if (OriginalEventTarget)\n registerWr
apper(OriginalEventTarget, EventTarget);\n\n function wrapEventTargetMethods(co
nstructors) {\n forwardMethodsToWrapper(constructors, methodNames);\n }\n\n
var originalElementFromPoint = document.elementFromPoint;\n\n function element
FromPoint(self, document, x, y) {\n scope.renderAllPending();\n\n var elem
ent = wrap(originalElementFromPoint.call(document.impl, x, y));\n if (!elemen
t)\n return null;\n var path = getEventPath(element, null);\n\n // sc
ope the path to this TreeScope\n var idx = path.lastIndexOf(self);\n if (i
dx == -1)\n return null;\n else\n path = path.slice(0, idx);\n\n
// TODO(dfreedm): pass idx to eventRetargetting to avoid array copy\n return
eventRetargetting(path, self);\n }\n\n /**\n * Returns a function that is t
o be used as a getter for `onfoo` properties.\n * @param {string} name\n * @
return {Function}\n */\n function getEventHandlerGetter(name) {\n return f
unction() {\n var inlineEventHandlers = eventHandlersTable.get(this);\n
return inlineEventHandlers && inlineEventHandlers[name] &&\n inlineEv
entHandlers[name].value || null;\n };\n }\n\n /**\n * Returns a function
that is to be used as a setter for `onfoo` properties.\n * @param {string} na
me\n * @return {Function}\n */\n function getEventHandlerSetter(name) {\n
var eventType = name.slice(2);\n return function(value) {\n var inline
EventHandlers = eventHandlersTable.get(this);\n if (!inlineEventHandlers) {
\n inlineEventHandlers = Object.create(null);\n eventHandlersTable
.set(this, inlineEventHandlers);\n }\n\n var old = inlineEventHandlers
[name];\n if (old)\n this.removeEventListener(eventType, old.wrapped
, false);\n\n if (typeof value === 'function') {\n var wrapped = fun
ction(e) {\n var rv = value.call(this, e);\n if (rv === false)
\n e.preventDefault();\n else if (name === 'onbeforeunload'
&& typeof rv === 'string')\n e.returnValue = rv;\n // mouseo
ver uses true for preventDefault but preventDefault for\n // mouseover
is ignored by browsers these day.\n };\n\n this.addEventListener(e
ventType, wrapped, false);\n inlineEventHandlers[name] = {\n val
ue: value,\n wrapped: wrapped\n };\n }\n };\n }\n\n sc
ope.elementFromPoint = elementFromPoint;\n scope.getEventHandlerGetter = getEve
ntHandlerGetter;\n scope.getEventHandlerSetter = getEventHandlerSetter;\n scop
e.wrapEventTargetMethods = wrapEventTargetMethods;\n scope.wrappers.BeforeUnloa
dEvent = BeforeUnloadEvent;\n scope.wrappers.CustomEvent = CustomEvent;\n scop
e.wrappers.Event = Event;\n scope.wrappers.EventTarget = EventTarget;\n scope.
wrappers.FocusEvent = FocusEvent;\n scope.wrappers.MouseEvent = MouseEvent;\n
scope.wrappers.UIEvent = UIEvent;\n\n})(window.ShadowDOMPolyfill);\n", | 98 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var forwardMethodsToWrap
per = scope.forwardMethodsToWrapper;\n var getTreeScope = scope.getTreeScope;\n
var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n va
r unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers = scope.wrapp
ers;\n\n var wrappedFuns = new WeakMap();\n var listenersTable = new WeakMap()
;\n var handledEventsTable = new WeakMap();\n var currentlyDispatchingEvents =
new WeakMap();\n var targetTable = new WeakMap();\n var currentTargetTable =
new WeakMap();\n var relatedTargetTable = new WeakMap();\n var eventPhaseTable
= new WeakMap();\n var stopPropagationTable = new WeakMap();\n var stopImmedi
atePropagationTable = new WeakMap();\n var eventHandlersTable = new WeakMap();\
n var eventPathTable = new WeakMap();\n\n function isShadowRoot(node) {\n r
eturn node instanceof wrappers.ShadowRoot;\n }\n\n function rootOfNode(node) {
\n return getTreeScope(node).root;\n }\n\n // http://w3c.github.io/webcompo
nents/spec/shadow/#event-paths\n function getEventPath(node, event) {\n var
path = [];\n var current = node;\n path.push(current);\n while (current
) {\n // 4.1.\n var destinationInsertionPoints = getDestinationInserti
onPoints(current);\n if (destinationInsertionPoints && destinationInsertion
Points.length > 0) {\n // 4.1.1\n for (var i = 0; i < destinationI
nsertionPoints.length; i++) {\n var insertionPoint = destinationInserti
onPoints[i];\n // 4.1.1.1\n if (isShadowInsertionPoint(inserti
onPoint)) {\n var shadowRoot = rootOfNode(insertionPoint);\n
// 4.1.1.1.2\n var olderShadowRoot = shadowRoot.olderShadowRoot;\n
if (olderShadowRoot)\n path.push(olderShadowRoot);\n
}\n\n // 4.1.1.2\n path.push(insertionPoint);\n
}\n\n // 4.1.2\n current = destinationInsertionPoints[\n
destinationInsertionPoints.length - 1];\n\n // 4.2\n } else {\n
if (isShadowRoot(current)) {\n if (inSameTree(node, current) && even
tMustBeStopped(event)) {\n // Stop this algorithm\n break;
\n }\n current = current.host;\n path.push(current);\
n\n // 4.2.2\n } else {\n current = current.parentNode;\n
if (current)\n path.push(current);\n }\n }\n
}\n\n return path;\n }\n\n // http://w3c.github.io/webcomponents/spec/shad
ow/#dfn-events-always-stopped\n function eventMustBeStopped(event) {\n if (!
event)\n return false;\n\n switch (event.type) {\n case 'abort':\n
case 'error':\n case 'select':\n case 'change':\n case 'load
':\n case 'reset':\n case 'resize':\n case 'scroll':\n case
'selectstart':\n return true;\n }\n return false;\n }\n\n // http
://w3c.github.io/webcomponents/spec/shadow/#dfn-shadow-insertion-point\n functi
on isShadowInsertionPoint(node) {\n return node instanceof HTMLShadowElement;
\n // and make sure that there are no shadow precing this?\n // and that t
here is no content ancestor?\n }\n\n function getDestinationInsertionPoints(no
de) {\n return scope.getDestinationInsertionPoints(node);\n }\n\n // http:/
/w3c.github.io/webcomponents/spec/shadow/#event-retargeting\n function eventRet
argetting(path, currentTarget) {\n if (path.length === 0)\n return curre
ntTarget;\n\n // The currentTarget might be the window object. Use its docume
nt for the\n // purpose of finding the retargetted node.\n if (currentTarg
et instanceof wrappers.Window)\n currentTarget = currentTarget.document;\n\
n var currentTargetTree = getTreeScope(currentTarget);\n var originalTarge
t = path[0];\n var originalTargetTree = getTreeScope(originalTarget);\n va
r relativeTargetTree =\n lowestCommonInclusiveAncestor(currentTargetTree,
originalTargetTree);\n\n for (var i = 0; i < path.length; i++) {\n var
node = path[i];\n if (getTreeScope(node) === relativeTargetTree)\n r
eturn node;\n }\n\n return path[path.length - 1];\n }\n\n function getTr
eeScopeAncestors(treeScope) {\n var ancestors = [];\n for (;treeScope; tre
eScope = treeScope.parent) {\n ancestors.push(treeScope);\n }\n retur
n ancestors;\n }\n\n function lowestCommonInclusiveAncestor(tsA, tsB) {\n v
ar ancestorsA = getTreeScopeAncestors(tsA);\n var ancestorsB = getTreeScopeAn
cestors(tsB);\n\n var result = null;\n while (ancestorsA.length > 0 && anc
estorsB.length > 0) {\n var a = ancestorsA.pop();\n var b = ancestorsB
.pop();\n if (a === b)\n result = a;\n else\n break;\n
}\n return result;\n }\n\n function getTreeScopeRoot(ts) {\n if (!ts.p
arent)\n return ts;\n return getTreeScopeRoot(ts.parent);\n }\n\n func
tion relatedTargetResolution(event, currentTarget, relatedTarget) {\n // In c
ase the current target is a window use its document for the purpose\n // of r
etargetting the related target.\n if (currentTarget instanceof wrappers.Windo
w)\n currentTarget = currentTarget.document;\n\n var currentTargetTree =
getTreeScope(currentTarget);\n var relatedTargetTree = getTreeScope(relatedT
arget);\n\n var relatedTargetEventPath = getEventPath(relatedTarget, event);\
n\n var lowestCommonAncestorTree;\n\n // 4\n var lowestCommonAncestorTr
ee =\n lowestCommonInclusiveAncestor(currentTargetTree, relatedTargetTree
);\n\n // 5\n if (!lowestCommonAncestorTree)\n lowestCommonAncestorTr
ee = relatedTargetTree.root;\n\n // 6\n for (var commonAncestorTree = lowe
stCommonAncestorTree;\n commonAncestorTree;\n commonAncestorTree
= commonAncestorTree.parent) {\n // 6.1\n var adjustedRelatedTarget;\
n for (var i = 0; i < relatedTargetEventPath.length; i++) {\n var no
de = relatedTargetEventPath[i];\n if (getTreeScope(node) === commonAncest
orTree)\n return node;\n }\n }\n\n return null;\n }\n\n fu
nction inSameTree(a, b) {\n return getTreeScope(a) === getTreeScope(b);\n }\
n\n var NONE = 0;\n var CAPTURING_PHASE = 1;\n var AT_TARGET = 2;\n var BUBB
LING_PHASE = 3;\n\n // pendingError is used to rethrow the first error we got d
uring an event\n // dispatch. The browser actually reports all errors but to do
that we would\n // need to rethrow the error asynchronously.\n var pendingErr
or;\n\n function dispatchOriginalEvent(originalEvent) {\n // Make sure this
event is only dispatched once.\n if (handledEventsTable.get(originalEvent))\n
return;\n handledEventsTable.set(originalEvent, true);\n dispatchEve
nt(wrap(originalEvent), wrap(originalEvent.target));\n if (pendingError) {\n
var err = pendingError;\n pendingError = null;\n throw err;\n
}\n }\n\n function dispatchEvent(event, originalWrapperTarget) {\n if (curr
entlyDispatchingEvents.get(event))\n throw new Error('InvalidStateError');\
n\n currentlyDispatchingEvents.set(event, true);\n\n // Render to ensure t
hat the event path is correct.\n scope.renderAllPending();\n var eventPath
;\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappap
is.html#events-and-the-window-object\n // All events dispatched on Nodes with
a default view, except load events,\n // should propagate to the Window.\n\n
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#
the-end\n var overrideTarget;\n var win;\n var type = event.type;\n\n
// Should really be not cancelable too but since Firefox has a bug there\n
// we skip that check.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=9994
56\n if (type === 'load' && !event.bubbles) {\n var doc = originalWrappe
rTarget;\n if (doc instanceof wrappers.Document && (win = doc.defaultView))
{\n overrideTarget = doc;\n eventPath = [];\n }\n }\n\n
if (!eventPath) {\n if (originalWrapperTarget instanceof wrappers.Window)
{\n win = originalWrapperTarget;\n eventPath = [];\n } else
{\n eventPath = getEventPath(originalWrapperTarget, event);\n\n if
(event.type !== 'load') {\n var doc = eventPath[eventPath.length - 1];
\n if (doc instanceof wrappers.Document)\n win = doc.default
View;\n }\n }\n }\n\n eventPathTable.set(event, eventPath);\n\
n if (dispatchCapturing(event, eventPath, win, overrideTarget)) {\n if (
dispatchAtTarget(event, eventPath, win, overrideTarget)) {\n dispatchBubb
ling(event, eventPath, win, overrideTarget);\n }\n }\n\n eventPhaseTa
ble.set(event, NONE);\n currentTargetTable.delete(event, null);\n currentl
yDispatchingEvents.delete(event);\n\n return event.defaultPrevented;\n }\n\n
function dispatchCapturing(event, eventPath, win, overrideTarget) {\n var p
hase = CAPTURING_PHASE;\n\n if (win) {\n if (!invoke(win, event, phase,
eventPath, overrideTarget))\n return false;\n }\n\n for (var i = ev
entPath.length - 1; i > 0; i--) {\n if (!invoke(eventPath[i], event, phase,
eventPath, overrideTarget))\n return false;\n }\n\n return true;\n
}\n\n function dispatchAtTarget(event, eventPath, win, overrideTarget) {\n
var phase = AT_TARGET;\n var currentTarget = eventPath[0] || win;\n retur
n invoke(currentTarget, event, phase, eventPath, overrideTarget);\n }\n\n func
tion dispatchBubbling(event, eventPath, win, overrideTarget) {\n var phase =
BUBBLING_PHASE;\n for (var i = 1; i < eventPath.length; i++) {\n if (!in
voke(eventPath[i], event, phase, eventPath, overrideTarget))\n return;\n
}\n\n if (win && eventPath.length > 0) {\n invoke(win, event, phase,
eventPath, overrideTarget);\n }\n }\n\n function invoke(currentTarget, even
t, phase, eventPath, overrideTarget) {\n var listeners = listenersTable.get(c
urrentTarget);\n if (!listeners)\n return true;\n\n var target = over
rideTarget || eventRetargetting(eventPath, currentTarget);\n\n if (target ===
currentTarget) {\n if (phase === CAPTURING_PHASE)\n return true;\n\
n if (phase === BUBBLING_PHASE)\n phase = AT_TARGET;\n\n } else
if (phase === BUBBLING_PHASE && !event.bubbles) {\n return true;\n }\n\n
if ('relatedTarget' in event) {\n var originalEvent = unwrap(event);\n
var unwrappedRelatedTarget = originalEvent.relatedTarget;\n\n // X-Tag
sets relatedTarget on a CustomEvent. If they do that there is no\n // way
to have relatedTarget return the adjusted target but worse is that\n // the
originalEvent might not have a relatedTarget so we hit an assert\n // when
we try to wrap it.\n if (unwrappedRelatedTarget) {\n // In IE we ca
n get objects that are not EventTargets at this point.\n // Safari does n
ot have an EventTarget interface so revert to checking\n // for addEventL
istener as an approximation.\n if (unwrappedRelatedTarget instanceof Obje
ct &&\n unwrappedRelatedTarget.addEventListener) {\n var rel
atedTarget = wrap(unwrappedRelatedTarget);\n\n var adjusted =\n
relatedTargetResolution(event, currentTarget, relatedTarget);\n i
f (adjusted === target)\n return true;\n } else {\n a
djusted = null;\n }\n relatedTargetTable.set(event, adjusted);\n
}\n }\n\n eventPhaseTable.set(event, phase);\n var type = event.typ
e;\n\n var anyRemoved = false;\n // targetTable.set(event, target);\n t
argetTable.set(event, target);\n currentTargetTable.set(event, currentTarget)
;\n\n // Keep track of the invoke depth so that we only clean up the removed\
n // listeners if we are in the outermost invoke.\n listeners.depth++;\n\n
for (var i = 0, len = listeners.length; i < len; i++) {\n var listener
= listeners[i];\n if (listener.removed) {\n anyRemoved = true;\n
continue;\n }\n\n if (listener.type !== type ||\n !listen
er.capture && phase === CAPTURING_PHASE ||\n listener.capture && phase
=== BUBBLING_PHASE) {\n continue;\n }\n\n try {\n if (ty
peof listener.handler === 'function')\n listener.handler.call(currentTa
rget, event);\n else\n listener.handler.handleEvent(event);\n\n
if (stopImmediatePropagationTable.get(event))\n return false;\n\
n } catch (ex) {\n if (!pendingError)\n pendingError = ex;\
n }\n }\n\n listeners.depth--;\n\n if (anyRemoved && listeners.dep
th === 0) {\n var copy = listeners.slice();\n listeners.length = 0;\n
for (var i = 0; i < copy.length; i++) {\n if (!copy[i].removed)\n
listeners.push(copy[i]);\n }\n }\n\n return !stopPropagationTa
ble.get(event);\n }\n\n function Listener(type, handler, capture) {\n this.
type = type;\n this.handler = handler;\n this.capture = Boolean(capture);\
n }\n Listener.prototype = {\n equals: function(that) {\n return this.
handler === that.handler && this.type === that.type &&\n this.capture =
== that.capture;\n },\n get removed() {\n return this.handler === nul
l;\n },\n remove: function() {\n this.handler = null;\n }\n };\n\
n var OriginalEvent = window.Event;\n OriginalEvent.prototype.polymerBlackList
_ = {\n returnValue: true,\n // TODO(arv): keyLocation is part of Keyboard
Event but Firefox does not\n // support constructable KeyboardEvent so we kee
p it here for now.\n keyLocation: true\n };\n\n /**\n * Creates a new Eve
nt wrapper or wraps an existin native Event object.\n * @param {string|Event}
type\n * @param {Object=} options\n * @constructor\n */\n function Event(
type, options) {\n if (type instanceof OriginalEvent) {\n var impl = typ
e;\n if (!OriginalBeforeUnloadEvent && impl.type === 'beforeunload')\n
return new BeforeUnloadEvent(impl);\n this.impl = impl;\n } else {\n
return wrap(constructEvent(OriginalEvent, 'Event', type, options));\n }\
n }\n Event.prototype = {\n get target() {\n return targetTable.get(th
is);\n },\n get currentTarget() {\n return currentTargetTable.get(thi
s);\n },\n get eventPhase() {\n return eventPhaseTable.get(this);\n
},\n get path() {\n var eventPath = eventPathTable.get(this);\n i
f (!eventPath)\n return [];\n // TODO(arv): Event path should contai
n window.\n return eventPath.slice();\n },\n stopPropagation: functio
n() {\n stopPropagationTable.set(this, true);\n },\n stopImmediatePro
pagation: function() {\n stopPropagationTable.set(this, true);\n stopI
mmediatePropagationTable.set(this, true);\n }\n };\n registerWrapper(Origin
alEvent, Event, document.createEvent('Event'));\n\n function unwrapOptions(opti
ons) {\n if (!options || !options.relatedTarget)\n return options;\n
return Object.create(options, {\n relatedTarget: {value: unwrap(options.rel
atedTarget)}\n });\n }\n\n function registerGenericEvent(name, SuperEvent,
prototype) {\n var OriginalEvent = window[name];\n var GenericEvent = func
tion(type, options) {\n if (type instanceof OriginalEvent)\n this.im
pl = type;\n else\n return wrap(constructEvent(OriginalEvent, name,
type, options));\n };\n GenericEvent.prototype = Object.create(SuperEvent.
prototype);\n if (prototype)\n mixin(GenericEvent.prototype, prototype);
\n if (OriginalEvent) {\n // - Old versions of Safari fails on new Focus
Event (and others?).\n // - IE does not support event constructors.\n
// - createEvent('FocusEvent') throws in Firefox.\n // => Try the best prac
tice solution first and fallback to the old way\n // if needed.\n try
{\n registerWrapper(OriginalEvent, GenericEvent, new OriginalEvent('temp'
));\n } catch (ex) {\n registerWrapper(OriginalEvent, GenericEvent,\
n document.createEvent(name));\n }\n }\n retur
n GenericEvent;\n }\n\n var UIEvent = registerGenericEvent('UIEvent', Event);\
n var CustomEvent = registerGenericEvent('CustomEvent', Event);\n\n var relate
dTargetProto = {\n get relatedTarget() {\n var relatedTarget = relatedTa
rgetTable.get(this);\n // relatedTarget can be null.\n if (relatedTarg
et !== undefined)\n return relatedTarget;\n return wrap(unwrap(this)
.relatedTarget);\n }\n };\n\n function getInitFunction(name, relatedTargetI
ndex) {\n return function() {\n arguments[relatedTargetIndex] = unwrap(a
rguments[relatedTargetIndex]);\n var impl = unwrap(this);\n impl[name]
.apply(impl, arguments);\n };\n }\n\n var mouseEventProto = mixin({\n in
itMouseEvent: getInitFunction('initMouseEvent', 14)\n }, relatedTargetProto);\n
\n var focusEventProto = mixin({\n initFocusEvent: getInitFunction('initFocu
sEvent', 5)\n }, relatedTargetProto);\n\n var MouseEvent = registerGenericEven
t('MouseEvent', UIEvent, mouseEventProto);\n var FocusEvent = registerGenericEv
ent('FocusEvent', UIEvent, focusEventProto);\n\n // In case the browser does no
t support event constructors we polyfill that\n // by calling `createEvent('Foo
')` and `initFooEvent` where the arguments to\n // `initFooEvent` are derived f
rom the registered default event init dict.\n var defaultInitDicts = Object.cre
ate(null);\n\n var supportsEventConstructors = (function() {\n try {\n
new window.FocusEvent('focus');\n } catch (ex) {\n return false;\n }\
n return true;\n })();\n\n /**\n * Constructs a new native event.\n */\
n function constructEvent(OriginalEvent, name, type, options) {\n if (suppor
tsEventConstructors)\n return new OriginalEvent(type, unwrapOptions(options
));\n\n // Create the arguments from the default dictionary.\n var event =
unwrap(document.createEvent(name));\n var defaultDict = defaultInitDicts[nam
e];\n var args = [type];\n Object.keys(defaultDict).forEach(function(key)
{\n var v = options != null && key in options ?\n options[key] : d
efaultDict[key];\n if (key === 'relatedTarget')\n v = unwrap(v);\n
args.push(v);\n });\n event['init' + name].apply(event, args);\n re
turn event;\n }\n\n if (!supportsEventConstructors) {\n var configureEventC
onstructor = function(name, initDict, superName) {\n if (superName) {\n
var superDict = defaultInitDicts[superName];\n initDict = mixin(mixin
({}, superDict), initDict);\n }\n\n defaultInitDicts[name] = initDict;
\n };\n\n // The order of the default event init dictionary keys is import
ant, the\n // arguments to initFooEvent is derived from that.\n configureE
ventConstructor('Event', {bubbles: false, cancelable: false});\n configureEve
ntConstructor('CustomEvent', {detail: null}, 'Event');\n configureEventConstr
uctor('UIEvent', {view: null, detail: 0}, 'Event');\n configureEventConstruct
or('MouseEvent', {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n
clientY: 0,\n ctrlKey: false,\n altKey: false,\n shiftKey: fal
se,\n metaKey: false,\n button: 0,\n relatedTarget: null\n },
'UIEvent');\n configureEventConstructor('FocusEvent', {relatedTarget: null},
'UIEvent');\n }\n\n // Safari 7 does not yet have BeforeUnloadEvent.\n // htt
ps://bugs.webkit.org/show_bug.cgi?id=120849\n var OriginalBeforeUnloadEvent = w
indow.BeforeUnloadEvent;\n\n function BeforeUnloadEvent(impl) {\n Event.call
(this, impl);\n }\n BeforeUnloadEvent.prototype = Object.create(Event.prototyp
e);\n mixin(BeforeUnloadEvent.prototype, {\n get returnValue() {\n retu
rn this.impl.returnValue;\n },\n set returnValue(v) {\n this.impl.ret
urnValue = v;\n }\n });\n\n if (OriginalBeforeUnloadEvent)\n registerWra
pper(OriginalBeforeUnloadEvent, BeforeUnloadEvent);\n\n function isValidListene
r(fun) {\n if (typeof fun === 'function')\n return true;\n return fun
&& fun.handleEvent;\n }\n\n function isMutationEvent(type) {\n switch (typ
e) {\n case 'DOMAttrModified':\n case 'DOMAttributeNameChanged':\n
case 'DOMCharacterDataModified':\n case 'DOMElementNameChanged':\n c
ase 'DOMNodeInserted':\n case 'DOMNodeInsertedIntoDocument':\n case 'D
OMNodeRemoved':\n case 'DOMNodeRemovedFromDocument':\n case 'DOMSubtre
eModified':\n return true;\n }\n return false;\n }\n\n var Origin
alEventTarget = window.EventTarget;\n\n /**\n * This represents a wrapper for
an EventTarget.\n * @param {!EventTarget} impl The original event target.\n
* @constructor\n */\n function EventTarget(impl) {\n this.impl = impl;\n
}\n\n // Node and Window have different internal type checks in WebKit so we c
annot\n // use the same method as the original function.\n var methodNames = [
\n 'addEventListener',\n 'removeEventListener',\n 'dispatchEvent'\n ];
\n\n [Node, Window].forEach(function(constructor) {\n var p = constructor.pr
ototype;\n methodNames.forEach(function(name) {\n Object.defineProperty(
p, name + '_', {value: p[name]});\n });\n });\n\n function getTargetToListe
nAt(wrapper) {\n if (wrapper instanceof wrappers.ShadowRoot)\n wrapper =
wrapper.host;\n return unwrap(wrapper);\n }\n\n EventTarget.prototype = {\
n addEventListener: function(type, fun, capture) {\n if (!isValidListene
r(fun) || isMutationEvent(type))\n return;\n\n var listener = new Li
stener(type, fun, capture);\n var listeners = listenersTable.get(this);\n
if (!listeners) {\n listeners = [];\n listeners.depth = 0;\n
listenersTable.set(this, listeners);\n } else {\n // Might hav
e a duplicate.\n for (var i = 0; i < listeners.length; i++) {\n
if (listener.equals(listeners[i]))\n return;\n }\n }\n\n
listeners.push(listener);\n\n var target = getTargetToListenAt(this);\
n target.addEventListener_(type, dispatchOriginalEvent, true);\n },\n
removeEventListener: function(type, fun, capture) {\n capture = Boolean(ca
pture);\n var listeners = listenersTable.get(this);\n if (!listeners)\
n return;\n var count = 0, found = false;\n for (var i = 0; i <
listeners.length; i++) {\n if (listeners[i].type === type && listeners[i
].capture === capture) {\n count++;\n if (listeners[i].handler
=== fun) {\n found = true;\n listeners[i].remove();\n
}\n }\n }\n\n if (found && count === 1) {\n var ta
rget = getTargetToListenAt(this);\n target.removeEventListener_(type, dis
patchOriginalEvent, true);\n }\n },\n dispatchEvent: function(event)
{\n // We want to use the native dispatchEvent because it triggers the defa
ult\n // actions (like checking a checkbox). However, if there are no liste
ners\n // in the composed tree then there are no events that will trigger a
nd\n // listeners in the non composed tree that are part of the event path
are\n // not notified.\n //\n // If we find out that there are no
listeners in the composed tree we add\n // a temporary listener to the tar
get which makes us get called back even\n // in that case.\n\n var nat
iveEvent = unwrap(event);\n var eventType = nativeEvent.type;\n\n // A
llow dispatching the same event again. This is safe because if user\n // co
de calls this during an existing dispatch of the same event the\n // native
dispatchEvent throws (that is required by the spec).\n handledEventsTable.
set(nativeEvent, false);\n\n // Force rendering since we prefer native disp
atch and that works on the\n // composed tree.\n scope.renderAllPendin
g();\n\n var tempListener;\n if (!hasListenerInAncestors(this, eventTy
pe)) {\n tempListener = function() {};\n this.addEventListener(eve
ntType, tempListener, true);\n }\n\n try {\n return unwrap(this
).dispatchEvent_(nativeEvent);\n } finally {\n if (tempListener)\n
this.removeEventListener(eventType, tempListener, true);\n }\n }
\n };\n\n function hasListener(node, type) {\n var listeners = listenersTab
le.get(node);\n if (listeners) {\n for (var i = 0; i < listeners.length;
i++) {\n if (!listeners[i].removed && listeners[i].type === type)\n
return true;\n }\n }\n return false;\n }\n\n function hasListe
nerInAncestors(target, type) {\n for (var node = unwrap(target); node; node =
node.parentNode) {\n if (hasListener(wrap(node), type))\n return tr
ue;\n }\n return false;\n }\n\n if (OriginalEventTarget)\n registerWr
apper(OriginalEventTarget, EventTarget);\n\n function wrapEventTargetMethods(co
nstructors) {\n forwardMethodsToWrapper(constructors, methodNames);\n }\n\n
var originalElementFromPoint = document.elementFromPoint;\n\n function element
FromPoint(self, document, x, y) {\n scope.renderAllPending();\n\n var elem
ent = wrap(originalElementFromPoint.call(document.impl, x, y));\n if (!elemen
t)\n return null;\n var path = getEventPath(element, null);\n\n // sc
ope the path to this TreeScope\n var idx = path.lastIndexOf(self);\n if (i
dx == -1)\n return null;\n else\n path = path.slice(0, idx);\n\n
// TODO(dfreedm): pass idx to eventRetargetting to avoid array copy\n return
eventRetargetting(path, self);\n }\n\n /**\n * Returns a function that is t
o be used as a getter for `onfoo` properties.\n * @param {string} name\n * @
return {Function}\n */\n function getEventHandlerGetter(name) {\n return f
unction() {\n var inlineEventHandlers = eventHandlersTable.get(this);\n
return inlineEventHandlers && inlineEventHandlers[name] &&\n inlineEv
entHandlers[name].value || null;\n };\n }\n\n /**\n * Returns a function
that is to be used as a setter for `onfoo` properties.\n * @param {string} na
me\n * @return {Function}\n */\n function getEventHandlerSetter(name) {\n
var eventType = name.slice(2);\n return function(value) {\n var inline
EventHandlers = eventHandlersTable.get(this);\n if (!inlineEventHandlers) {
\n inlineEventHandlers = Object.create(null);\n eventHandlersTable
.set(this, inlineEventHandlers);\n }\n\n var old = inlineEventHandlers
[name];\n if (old)\n this.removeEventListener(eventType, old.wrapped
, false);\n\n if (typeof value === 'function') {\n var wrapped = fun
ction(e) {\n var rv = value.call(this, e);\n if (rv === false)
\n e.preventDefault();\n else if (name === 'onbeforeunload'
&& typeof rv === 'string')\n e.returnValue = rv;\n // mouseo
ver uses true for preventDefault but preventDefault for\n // mouseover
is ignored by browsers these day.\n };\n\n this.addEventListener(e
ventType, wrapped, false);\n inlineEventHandlers[name] = {\n val
ue: value,\n wrapped: wrapped\n };\n }\n };\n }\n\n sc
ope.elementFromPoint = elementFromPoint;\n scope.getEventHandlerGetter = getEve
ntHandlerGetter;\n scope.getEventHandlerSetter = getEventHandlerSetter;\n scop
e.wrapEventTargetMethods = wrapEventTargetMethods;\n scope.wrappers.BeforeUnloa
dEvent = BeforeUnloadEvent;\n scope.wrappers.CustomEvent = CustomEvent;\n scop
e.wrappers.Event = Event;\n scope.wrappers.EventTarget = EventTarget;\n scope.
wrappers.FocusEvent = FocusEvent;\n scope.wrappers.MouseEvent = MouseEvent;\n
scope.wrappers.UIEvent = UIEvent;\n\n})(window.ShadowDOMPolyfill);\n", |
100 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var UIEvent = s
cope.wrappers.UIEvent;\n var mixin = scope.mixin;\n var registerWrapper = scop
e.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n
// TouchEvent is WebKit/Blink only.\n var OriginalTouchEvent = window.TouchEven
t;\n if (!OriginalTouchEvent)\n return;\n\n var nativeEvent;\n try {\n
nativeEvent = document.createEvent('TouchEvent');\n } catch (ex) {\n // In C
hrome creating a TouchEvent fails if the feature is not turned on\n // which
it isn't on desktop Chrome.\n return;\n }\n\n var nonEnumDescriptor = {enum
erable: false};\n\n function nonEnum(obj, prop) {\n Object.defineProperty(ob
j, prop, nonEnumDescriptor);\n }\n\n function Touch(impl) {\n this.impl = i
mpl;\n }\n\n Touch.prototype = {\n get target() {\n return wrap(this.i
mpl.target);\n }\n };\n\n var descr = {\n configurable: true,\n enume
rable: true,\n get: null\n };\n\n [\n 'clientX',\n 'clientY',\n 's
creenX',\n 'screenY',\n 'pageX',\n 'pageY',\n 'identifier',\n 'we
bkitRadiusX',\n 'webkitRadiusY',\n 'webkitRotationAngle',\n 'webkitForc
e'\n ].forEach(function(name) {\n descr.get = function() {\n return thi
s.impl[name];\n };\n Object.defineProperty(Touch.prototype, name, descr);\
n });\n\n function TouchList() {\n this.length = 0;\n nonEnum(this, 'len
gth');\n }\n\n TouchList.prototype = {\n item: function(index) {\n ret
urn this[index];\n }\n };\n\n function wrapTouchList(nativeTouchList) {\n
var list = new TouchList();\n for (var i = 0; i < nativeTouchList.length; i
++) {\n list[i] = new Touch(nativeTouchList[i]);\n }\n list.length =
i;\n return list;\n }\n\n function TouchEvent(impl) {\n UIEvent.call(thi
s, impl);\n }\n\n TouchEvent.prototype = Object.create(UIEvent.prototype);\n\n
mixin(TouchEvent.prototype, {\n get touches() {\n return wrapTouchList
(unwrap(this).touches);\n },\n\n get targetTouches() {\n return wrapT
ouchList(unwrap(this).targetTouches);\n },\n\n get changedTouches() {\n
return wrapTouchList(unwrap(this).changedTouches);\n },\n\n initTouchEv
ent: function() {\n // The only way to use this is to reuse the TouchList f
rom an existing\n // TouchEvent. Since this is WebKit/Blink proprietary API
we will not\n // implement this until someone screams.\n throw new Er
ror('Not implemented');\n }\n });\n\n registerWrapper(OriginalTouchEvent, T
ouchEvent, nativeEvent);\n\n scope.wrappers.Touch = Touch;\n scope.wrappers.To
uchEvent = TouchEvent;\n scope.wrappers.TouchList = TouchList;\n\n})(window.Sha
dowDOMPolyfill);\n\n", | 99 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var UIEvent = s
cope.wrappers.UIEvent;\n var mixin = scope.mixin;\n var registerWrapper = scop
e.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n
// TouchEvent is WebKit/Blink only.\n var OriginalTouchEvent = window.TouchEven
t;\n if (!OriginalTouchEvent)\n return;\n\n var nativeEvent;\n try {\n
nativeEvent = document.createEvent('TouchEvent');\n } catch (ex) {\n // In C
hrome creating a TouchEvent fails if the feature is not turned on\n // which
it isn't on desktop Chrome.\n return;\n }\n\n var nonEnumDescriptor = {enum
erable: false};\n\n function nonEnum(obj, prop) {\n Object.defineProperty(ob
j, prop, nonEnumDescriptor);\n }\n\n function Touch(impl) {\n this.impl = i
mpl;\n }\n\n Touch.prototype = {\n get target() {\n return wrap(this.i
mpl.target);\n }\n };\n\n var descr = {\n configurable: true,\n enume
rable: true,\n get: null\n };\n\n [\n 'clientX',\n 'clientY',\n 's
creenX',\n 'screenY',\n 'pageX',\n 'pageY',\n 'identifier',\n 'we
bkitRadiusX',\n 'webkitRadiusY',\n 'webkitRotationAngle',\n 'webkitForc
e'\n ].forEach(function(name) {\n descr.get = function() {\n return thi
s.impl[name];\n };\n Object.defineProperty(Touch.prototype, name, descr);\
n });\n\n function TouchList() {\n this.length = 0;\n nonEnum(this, 'len
gth');\n }\n\n TouchList.prototype = {\n item: function(index) {\n ret
urn this[index];\n }\n };\n\n function wrapTouchList(nativeTouchList) {\n
var list = new TouchList();\n for (var i = 0; i < nativeTouchList.length; i
++) {\n list[i] = new Touch(nativeTouchList[i]);\n }\n list.length =
i;\n return list;\n }\n\n function TouchEvent(impl) {\n UIEvent.call(thi
s, impl);\n }\n\n TouchEvent.prototype = Object.create(UIEvent.prototype);\n\n
mixin(TouchEvent.prototype, {\n get touches() {\n return wrapTouchList
(unwrap(this).touches);\n },\n\n get targetTouches() {\n return wrapT
ouchList(unwrap(this).targetTouches);\n },\n\n get changedTouches() {\n
return wrapTouchList(unwrap(this).changedTouches);\n },\n\n initTouchEv
ent: function() {\n // The only way to use this is to reuse the TouchList f
rom an existing\n // TouchEvent. Since this is WebKit/Blink proprietary API
we will not\n // implement this until someone screams.\n throw new Er
ror('Not implemented');\n }\n });\n\n registerWrapper(OriginalTouchEvent, T
ouchEvent, nativeEvent);\n\n scope.wrappers.Touch = Touch;\n scope.wrappers.To
uchEvent = TouchEvent;\n scope.wrappers.TouchList = TouchList;\n\n})(window.Sha
dowDOMPolyfill);\n\n", |
101 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var wrap = scope.wrap;\n
\n var nonEnumDescriptor = {enumerable: false};\n\n function nonEnum(obj, prop
) {\n Object.defineProperty(obj, prop, nonEnumDescriptor);\n }\n\n function
NodeList() {\n this.length = 0;\n nonEnum(this, 'length');\n }\n NodeLi
st.prototype = {\n item: function(index) {\n return this[index];\n }\
n };\n nonEnum(NodeList.prototype, 'item');\n\n function wrapNodeList(list) {
\n if (list == null)\n return list;\n var wrapperList = new NodeList(
);\n for (var i = 0, length = list.length; i < length; i++) {\n wrapperL
ist[i] = wrap(list[i]);\n }\n wrapperList.length = length;\n return wra
pperList;\n }\n\n function addWrapNodeListMethod(wrapperConstructor, name) {\n
wrapperConstructor.prototype[name] = function() {\n return wrapNodeList
(this.impl[name].apply(this.impl, arguments));\n };\n }\n\n scope.wrappers.
NodeList = NodeList;\n scope.addWrapNodeListMethod = addWrapNodeListMethod;\n
scope.wrapNodeList = wrapNodeList;\n\n})(window.ShadowDOMPolyfill);\n", | 100 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var wrap = scope.wrap;\n
\n var nonEnumDescriptor = {enumerable: false};\n\n function nonEnum(obj, prop
) {\n Object.defineProperty(obj, prop, nonEnumDescriptor);\n }\n\n function
NodeList() {\n this.length = 0;\n nonEnum(this, 'length');\n }\n NodeLi
st.prototype = {\n item: function(index) {\n return this[index];\n }\
n };\n nonEnum(NodeList.prototype, 'item');\n\n function wrapNodeList(list) {
\n if (list == null)\n return list;\n var wrapperList = new NodeList(
);\n for (var i = 0, length = list.length; i < length; i++) {\n wrapperL
ist[i] = wrap(list[i]);\n }\n wrapperList.length = length;\n return wra
pperList;\n }\n\n function addWrapNodeListMethod(wrapperConstructor, name) {\n
wrapperConstructor.prototype[name] = function() {\n return wrapNodeList
(this.impl[name].apply(this.impl, arguments));\n };\n }\n\n scope.wrappers.
NodeList = NodeList;\n scope.addWrapNodeListMethod = addWrapNodeListMethod;\n
scope.wrapNodeList = wrapNodeList;\n\n})(window.ShadowDOMPolyfill);\n", |
102 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n // TODO(arv): I
mplement.\n\n scope.wrapHTMLCollection = scope.wrapNodeList;\n scope.wrappers.
HTMLCollection = scope.wrappers.NodeList;\n\n})(window.ShadowDOMPolyfill);\n", | 101 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n // TODO(arv): I
mplement.\n\n scope.wrapHTMLCollection = scope.wrapNodeList;\n scope.wrappers.
HTMLCollection = scope.wrappers.NodeList;\n\n})(window.ShadowDOMPolyfill);\n", |
103 "/**\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var EventTarge
t = scope.wrappers.EventTarget;\n var NodeList = scope.wrappers.NodeList;\n va
r TreeScope = scope.TreeScope;\n var assert = scope.assert;\n var defineWrapGe
tter = scope.defineWrapGetter;\n var enqueueMutation = scope.enqueueMutation;\n
var getTreeScope = scope.getTreeScope;\n var isWrapper = scope.isWrapper;\n
var mixin = scope.mixin;\n var registerTransientObservers = scope.registerTrans
ientObservers;\n var registerWrapper = scope.registerWrapper;\n var setTreeSco
pe = scope.setTreeScope;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = s
cope.unwrapIfNeeded;\n var wrap = scope.wrap;\n var wrapIfNeeded = scope.wrapI
fNeeded;\n var wrappers = scope.wrappers;\n\n function assertIsNodeWrapper(nod
e) {\n assert(node instanceof Node);\n }\n\n function createOneElementNodeL
ist(node) {\n var nodes = new NodeList();\n nodes[0] = node;\n nodes.le
ngth = 1;\n return nodes;\n }\n\n var surpressMutations = false;\n\n /**\n
* Called before node is inserted into a node to enqueue its removal from its\
n * old parent.\n * @param {!Node} node The node that is about to be removed
.\n * @param {!Node} parent The parent node that the node is being removed fro
m.\n * @param {!NodeList} nodes The collected nodes.\n */\n function enqueu
eRemovalForInsertedNodes(node, parent, nodes) {\n enqueueMutation(parent, 'ch
ildList', {\n removedNodes: nodes,\n previousSibling: node.previousSib
ling,\n nextSibling: node.nextSibling\n });\n }\n\n function enqueueRe
movalForInsertedDocumentFragment(df, nodes) {\n enqueueMutation(df, 'childLis
t', {\n removedNodes: nodes\n });\n }\n\n /**\n * Collects nodes fro
m a DocumentFragment or a Node for removal followed\n * by an insertion.\n *
\n * This updates the internal pointers for node, previousNode and nextNode.\n
*/\n function collectNodes(node, parentNode, previousNode, nextNode) {\n
if (node instanceof DocumentFragment) {\n var nodes = collectNodesForDocume
ntFragment(node);\n\n // The extra loop is to work around bugs with Documen
tFragments in IE.\n surpressMutations = true;\n for (var i = nodes.len
gth - 1; i >= 0; i--) {\n node.removeChild(nodes[i]);\n nodes[i].p
arentNode_ = parentNode;\n }\n surpressMutations = false;\n\n for
(var i = 0; i < nodes.length; i++) {\n nodes[i].previousSibling_ = nodes
[i - 1] || previousNode;\n nodes[i].nextSibling_ = nodes[i + 1] || nextNo
de;\n }\n\n if (previousNode)\n previousNode.nextSibling_ = nod
es[0];\n if (nextNode)\n nextNode.previousSibling_ = nodes[nodes.len
gth - 1];\n\n return nodes;\n }\n\n var nodes = createOneElementNodeL
ist(node);\n var oldParent = node.parentNode;\n if (oldParent) {\n //
This will enqueue the mutation record for the removal as needed.\n oldPare
nt.removeChild(node);\n }\n\n node.parentNode_ = parentNode;\n node.pre
viousSibling_ = previousNode;\n node.nextSibling_ = nextNode;\n if (previo
usNode)\n previousNode.nextSibling_ = node;\n if (nextNode)\n nextN
ode.previousSibling_ = node;\n\n return nodes;\n }\n\n function collectNode
sNative(node) {\n if (node instanceof DocumentFragment)\n return collect
NodesForDocumentFragment(node);\n\n var nodes = createOneElementNodeList(node
);\n var oldParent = node.parentNode;\n if (oldParent)\n enqueueRemov
alForInsertedNodes(node, oldParent, nodes);\n return nodes;\n }\n\n functio
n collectNodesForDocumentFragment(node) {\n var nodes = new NodeList();\n
var i = 0;\n for (var child = node.firstChild; child; child = child.nextSibli
ng) {\n nodes[i++] = child;\n }\n nodes.length = i;\n enqueueRemov
alForInsertedDocumentFragment(node, nodes);\n return nodes;\n }\n\n functio
n snapshotNodeList(nodeList) {\n // NodeLists are not live at the moment so j
ust return the same object.\n return nodeList;\n }\n\n // http://dom.spec.w
hatwg.org/#node-is-inserted\n function nodeWasAdded(node, treeScope) {\n set
TreeScope(node, treeScope);\n node.nodeIsInserted_();\n }\n\n function node
sWereAdded(nodes, parent) {\n var treeScope = getTreeScope(parent);\n for
(var i = 0; i < nodes.length; i++) {\n nodeWasAdded(nodes[i], treeScope);\n
}\n }\n\n // http://dom.spec.whatwg.org/#node-is-removed\n function nodeW
asRemoved(node) {\n setTreeScope(node, new TreeScope(node, null));\n }\n\n
function nodesWereRemoved(nodes) {\n for (var i = 0; i < nodes.length; i++) {
\n nodeWasRemoved(nodes[i]);\n }\n }\n\n function ensureSameOwnerDocum
ent(parent, child) {\n var ownerDoc = parent.nodeType === Node.DOCUMENT_NODE
?\n parent : parent.ownerDocument;\n if (ownerDoc !== child.ownerDocum
ent)\n ownerDoc.adoptNode(child);\n }\n\n function adoptNodesIfNeeded(own
er, nodes) {\n if (!nodes.length)\n return;\n\n var ownerDoc = owner.
ownerDocument;\n\n // All nodes have the same ownerDocument when we get here.
\n if (ownerDoc === nodes[0].ownerDocument)\n return;\n\n for (var i
= 0; i < nodes.length; i++) {\n scope.adoptNodeNoRemove(nodes[i], ownerDoc)
;\n }\n }\n\n function unwrapNodesForInsertion(owner, nodes) {\n adoptNo
desIfNeeded(owner, nodes);\n var length = nodes.length;\n\n if (length ===
1)\n return unwrap(nodes[0]);\n\n var df = unwrap(owner.ownerDocument.c
reateDocumentFragment());\n for (var i = 0; i < length; i++) {\n df.appe
ndChild(unwrap(nodes[i]));\n }\n return df;\n }\n\n function clearChildN
odes(wrapper) {\n if (wrapper.firstChild_ !== undefined) {\n var child =
wrapper.firstChild_;\n while (child) {\n var tmp = child;\n
child = child.nextSibling_;\n tmp.parentNode_ = tmp.previousSibling_ = tm
p.nextSibling_ = undefined;\n }\n }\n wrapper.firstChild_ = wrapper.l
astChild_ = undefined;\n }\n\n function removeAllChildNodes(wrapper) {\n if
(wrapper.invalidateShadowRenderer()) {\n var childWrapper = wrapper.firstC
hild;\n while (childWrapper) {\n assert(childWrapper.parentNode ===
wrapper);\n var nextSibling = childWrapper.nextSibling;\n var chil
dNode = unwrap(childWrapper);\n var parentNode = childNode.parentNode;\n
if (parentNode)\n originalRemoveChild.call(parentNode, childNode
);\n childWrapper.previousSibling_ = childWrapper.nextSibling_ =\n
childWrapper.parentNode_ = null;\n childWrapper = nextSibling;\n
}\n wrapper.firstChild_ = wrapper.lastChild_ = null;\n } else {\n
var node = unwrap(wrapper);\n var child = node.firstChild;\n var next
Sibling;\n while (child) {\n nextSibling = child.nextSibling;\n
originalRemoveChild.call(node, child);\n child = nextSibling;\n }
\n }\n }\n\n function invalidateParent(node) {\n var p = node.parentNode
;\n return p && p.invalidateShadowRenderer();\n }\n\n function cleanupNodes
(nodes) {\n for (var i = 0, n; i < nodes.length; i++) {\n n = nodes[i];\
n n.parentNode.removeChild(n);\n }\n }\n\n var originalImportNode = do
cument.importNode;\n var originalCloneNode = window.Node.prototype.cloneNode;\n
\n function cloneNode(node, deep, opt_doc) {\n var clone;\n if (opt_doc)\
n clone = wrap(originalImportNode.call(opt_doc, node.impl, false));\n el
se\n clone = wrap(originalCloneNode.call(node.impl, false));\n\n if (dee
p) {\n for (var child = node.firstChild; child; child = child.nextSibling)
{\n clone.appendChild(cloneNode(child, true, opt_doc));\n }\n\n
if (node instanceof wrappers.HTMLTemplateElement) {\n var cloneContent =
clone.content;\n for (var child = node.content.firstChild;\n
child;\n child = child.nextSibling) {\n cloneContent.append
Child(cloneNode(child, true, opt_doc));\n }\n }\n }\n // TODO(
arv): Some HTML elements also clone other data like value.\n return clone;\n
}\n\n function contains(self, child) {\n if (!child || getTreeScope(self) !
== getTreeScope(child))\n return false;\n\n for (var node = child; node;
node = node.parentNode) {\n if (node === self)\n return true;\n
}\n return false;\n }\n\n var OriginalNode = window.Node;\n\n /**\n * Th
is represents a wrapper of a native DOM node.\n * @param {!Node} original The
original DOM node, aka, the visual DOM node.\n * @constructor\n * @extends {
EventTarget}\n */\n function Node(original) {\n assert(original instanceof
OriginalNode);\n\n EventTarget.call(this, original);\n\n // These propert
ies are used to override the visual references with the\n // logical ones. If
the value is undefined it means that the logical is the\n // same as the vis
ual.\n\n /**\n * @type {Node|undefined}\n * @private\n */\n th
is.parentNode_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @p
rivate\n */\n this.firstChild_ = undefined;\n\n /**\n * @type {Nod
e|undefined}\n * @private\n */\n this.lastChild_ = undefined;\n\n
/**\n * @type {Node|undefined}\n * @private\n */\n this.nextSibli
ng_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @private\n
*/\n this.previousSibling_ = undefined;\n\n this.treeScope_ = undefined;
\n }\n\n var OriginalDocumentFragment = window.DocumentFragment;\n var origin
alAppendChild = OriginalNode.prototype.appendChild;\n var originalCompareDocume
ntPosition =\n OriginalNode.prototype.compareDocumentPosition;\n var origi
nalInsertBefore = OriginalNode.prototype.insertBefore;\n var originalRemoveChil
d = OriginalNode.prototype.removeChild;\n var originalReplaceChild = OriginalNo
de.prototype.replaceChild;\n\n var isIe = /Trident/.test(navigator.userAgent);\
n\n var removeChildOriginalHelper = isIe ?\n function(parent, child) {\n
try {\n originalRemoveChild.call(parent, child);\n } catch
(ex) {\n if (!(parent instanceof OriginalDocumentFragment))\n
throw ex;\n }\n } :\n function(parent, child) {\n ori
ginalRemoveChild.call(parent, child);\n };\n\n Node.prototype = Object.cre
ate(EventTarget.prototype);\n mixin(Node.prototype, {\n appendChild: functio
n(childWrapper) {\n return this.insertBefore(childWrapper, null);\n },\n
\n insertBefore: function(childWrapper, refWrapper) {\n assertIsNodeWrap
per(childWrapper);\n\n var refNode;\n if (refWrapper) {\n if (i
sWrapper(refWrapper)) {\n refNode = unwrap(refWrapper);\n } else
{\n refNode = refWrapper;\n refWrapper = wrap(refNode);\n
}\n } else {\n refWrapper = null;\n refNode = null;\n
}\n\n refWrapper && assert(refWrapper.parentNode === this);\n\n var
nodes;\n var previousNode =\n refWrapper ? refWrapper.previousSibl
ing : this.lastChild;\n\n var useNative = !this.invalidateShadowRenderer()
&&\n !invalidateParent(childWrapper);\n\n if (useNativ
e)\n nodes = collectNodesNative(childWrapper);\n else\n nodes
= collectNodes(childWrapper, this, previousNode, refWrapper);\n\n if (useN
ative) {\n ensureSameOwnerDocument(this, childWrapper);\n clearChi
ldNodes(this);\n originalInsertBefore.call(this.impl, unwrap(childWrapper
), refNode);\n } else {\n if (!previousNode)\n this.firstCh
ild_ = nodes[0];\n if (!refWrapper) {\n this.lastChild_ = nodes[
nodes.length - 1];\n if (this.firstChild_ === undefined)\n t
his.firstChild_ = this.firstChild;\n }\n\n var parentNode = refNod
e ? refNode.parentNode : this.impl;\n\n // insertBefore refWrapper no mat
ter what the parent is?\n if (parentNode) {\n originalInsertBefo
re.call(parentNode,\n unwrapNodesForInsertion(this, nodes), refNode
);\n } else {\n adoptNodesIfNeeded(this, nodes);\n }\n
}\n\n enqueueMutation(this, 'childList', {\n addedNodes: nodes,\n
nextSibling: refWrapper,\n previousSibling: previousNode\n }
);\n\n nodesWereAdded(nodes, this);\n\n return childWrapper;\n },\n
\n removeChild: function(childWrapper) {\n assertIsNodeWrapper(childWrap
per);\n if (childWrapper.parentNode !== this) {\n // IE has invalid
DOM trees at times.\n var found = false;\n var childNodes = this.c
hildNodes;\n for (var ieChild = this.firstChild; ieChild;\n i
eChild = ieChild.nextSibling) {\n if (ieChild === childWrapper) {\n
found = true;\n break;\n }\n }\n if (!
found) {\n // TODO(arv): DOMException\n throw new Error('NotFo
undError');\n }\n }\n\n var childNode = unwrap(childWrapper);\n
var childWrapperNextSibling = childWrapper.nextSibling;\n var childWr
apperPreviousSibling = childWrapper.previousSibling;\n\n if (this.invalidat
eShadowRenderer()) {\n // We need to remove the real node from the DOM be
fore updating the\n // pointers. This is so that that mutation event is d
ispatched before\n // the pointers have changed.\n var thisFirstCh
ild = this.firstChild;\n var thisLastChild = this.lastChild;\n\n v
ar parentNode = childNode.parentNode;\n if (parentNode)\n remove
ChildOriginalHelper(parentNode, childNode);\n\n if (thisFirstChild === ch
ildWrapper)\n this.firstChild_ = childWrapperNextSibling;\n if (
thisLastChild === childWrapper)\n this.lastChild_ = childWrapperPreviou
sSibling;\n if (childWrapperPreviousSibling)\n childWrapperPrevi
ousSibling.nextSibling_ = childWrapperNextSibling;\n if (childWrapperNext
Sibling) {\n childWrapperNextSibling.previousSibling_ =\n
childWrapperPreviousSibling;\n }\n\n childWrapper.previousSibling_
= childWrapper.nextSibling_ =\n childWrapper.parentNode_ = undefined
;\n } else {\n clearChildNodes(this);\n removeChildOriginalHe
lper(this.impl, childNode);\n }\n\n if (!surpressMutations) {\n
enqueueMutation(this, 'childList', {\n removedNodes: createOneElementN
odeList(childWrapper),\n nextSibling: childWrapperNextSibling,\n
previousSibling: childWrapperPreviousSibling\n });\n }\n\n r
egisterTransientObservers(this, childWrapper);\n\n return childWrapper;\n
},\n\n replaceChild: function(newChildWrapper, oldChildWrapper) {\n as
sertIsNodeWrapper(newChildWrapper);\n\n var oldChildNode;\n if (isWrap
per(oldChildWrapper)) {\n oldChildNode = unwrap(oldChildWrapper);\n
} else {\n oldChildNode = oldChildWrapper;\n oldChildWrapper = wra
p(oldChildNode);\n }\n\n if (oldChildWrapper.parentNode !== this) {\n
// TODO(arv): DOMException\n throw new Error('NotFoundError');\n
}\n\n var nextNode = oldChildWrapper.nextSibling;\n var previousNo
de = oldChildWrapper.previousSibling;\n var nodes;\n\n var useNative =
!this.invalidateShadowRenderer() &&\n !invalidateParent(ne
wChildWrapper);\n\n if (useNative) {\n nodes = collectNodesNative(ne
wChildWrapper);\n } else {\n if (nextNode === newChildWrapper)\n
nextNode = newChildWrapper.nextSibling;\n nodes = collectNodes(newC
hildWrapper, this, previousNode, nextNode);\n }\n\n if (!useNative) {\
n if (this.firstChild === oldChildWrapper)\n this.firstChild_ =
nodes[0];\n if (this.lastChild === oldChildWrapper)\n this.lastC
hild_ = nodes[nodes.length - 1];\n\n oldChildWrapper.previousSibling_ = o
ldChildWrapper.nextSibling_ =\n oldChildWrapper.parentNode_ = undefin
ed;\n\n // replaceChild no matter what the parent is?\n if (oldChi
ldNode.parentNode) {\n originalReplaceChild.call(\n oldChi
ldNode.parentNode,\n unwrapNodesForInsertion(this, nodes),\n
oldChildNode);\n }\n } else {\n ensureSameOwnerDocumen
t(this, newChildWrapper);\n clearChildNodes(this);\n originalRepla
ceChild.call(this.impl, unwrap(newChildWrapper),\n
oldChildNode);\n }\n\n enqueueMutation(this, 'childList', {\n
addedNodes: nodes,\n removedNodes: createOneElementNodeList(oldChildWr
apper),\n nextSibling: nextNode,\n previousSibling: previousNode\n
});\n\n nodeWasRemoved(oldChildWrapper);\n nodesWereAdded(nodes,
this);\n\n return oldChildWrapper;\n },\n\n /**\n * Called after
a node was inserted. Subclasses override this to invalidate\n * the rendere
r as needed.\n * @private\n */\n nodeIsInserted_: function() {\n
for (var child = this.firstChild; child; child = child.nextSibling) {\n
child.nodeIsInserted_();\n }\n },\n\n hasChildNodes: function() {\n
return this.firstChild !== null;\n },\n\n /** @type {Node} */\n get
parentNode() {\n // If the parentNode has not been overridden, use the ori
ginal parentNode.\n return this.parentNode_ !== undefined ?\n this
.parentNode_ : wrap(this.impl.parentNode);\n },\n\n /** @type {Node} */\n
get firstChild() {\n return this.firstChild_ !== undefined ?\n
this.firstChild_ : wrap(this.impl.firstChild);\n },\n\n /** @type {Node} *
/\n get lastChild() {\n return this.lastChild_ !== undefined ?\n
this.lastChild_ : wrap(this.impl.lastChild);\n },\n\n /** @type {Node} *
/\n get nextSibling() {\n return this.nextSibling_ !== undefined ?\n
this.nextSibling_ : wrap(this.impl.nextSibling);\n },\n\n /** @type
{Node} */\n get previousSibling() {\n return this.previousSibling_ !== u
ndefined ?\n this.previousSibling_ : wrap(this.impl.previousSibling);\n
},\n\n get parentElement() {\n var p = this.parentNode;\n while
(p && p.nodeType !== Node.ELEMENT_NODE) {\n p = p.parentNode;\n }\n
return p;\n },\n\n get textContent() {\n // TODO(arv): This sho
uld fallback to this.impl.textContent if there\n // are no shadow trees bel
ow or above the context node.\n var s = '';\n for (var child = this.fi
rstChild; child; child = child.nextSibling) {\n if (child.nodeType != Nod
e.COMMENT_NODE) {\n s += child.textContent;\n }\n }\n
return s;\n },\n set textContent(textContent) {\n var removedNodes =
snapshotNodeList(this.childNodes);\n\n if (this.invalidateShadowRenderer())
{\n removeAllChildNodes(this);\n if (textContent !== '') {\n
var textNode = this.impl.ownerDocument.createTextNode(textContent);\n
this.appendChild(textNode);\n }\n } else {\n clearChildNo
des(this);\n this.impl.textContent = textContent;\n }\n\n var a
ddedNodes = snapshotNodeList(this.childNodes);\n\n enqueueMutation(this, 'c
hildList', {\n addedNodes: addedNodes,\n removedNodes: removedNode
s\n });\n\n nodesWereRemoved(removedNodes);\n nodesWereAdded(adde
dNodes, this);\n },\n\n get childNodes() {\n var wrapperList = new No
deList();\n var i = 0;\n for (var child = this.firstChild; child; chil
d = child.nextSibling) {\n wrapperList[i++] = child;\n }\n wrap
perList.length = i;\n return wrapperList;\n },\n\n cloneNode: functio
n(deep) {\n return cloneNode(this, deep);\n },\n\n contains: function
(child) {\n return contains(this, wrapIfNeeded(child));\n },\n\n comp
areDocumentPosition: function(otherNode) {\n // This only wraps, it therefo
re only operates on the composed DOM and not\n // the logical DOM.\n r
eturn originalCompareDocumentPosition.call(this.impl,\n
unwrapIfNeeded(otherNode));\n },\n\n normalize: f
unction() {\n var nodes = snapshotNodeList(this.childNodes);\n var rem
Nodes = [];\n var s = '';\n var modNode;\n\n for (var i = 0, n; i
< nodes.length; i++) {\n n = nodes[i];\n if (n.nodeType === Node.
TEXT_NODE) {\n if (!modNode && !n.data.length)\n this.remove
Node(n);\n else if (!modNode)\n modNode = n;\n else
{\n s += n.data;\n remNodes.push(n);\n }\n
} else {\n if (modNode && remNodes.length) {\n modNode.dat
a += s;\n cleanupNodes(remNodes);\n }\n remNodes =
[];\n s = '';\n modNode = null;\n if (n.childNodes.le
ngth)\n n.normalize();\n }\n }\n\n // handle case wh
ere >1 text nodes are the last children\n if (modNode && remNodes.length) {
\n modNode.data += s;\n cleanupNodes(remNodes);\n }\n }\n
});\n\n defineWrapGetter(Node, 'ownerDocument');\n\n // We use a DocumentFrag
ment as a base and then delete the properties of\n // DocumentFragment.prototyp
e from the wrapper Node. Since delete makes\n // objects slow in some JS engine
s we recreate the prototype object.\n registerWrapper(OriginalNode, Node, docum
ent.createDocumentFragment());\n delete Node.prototype.querySelector;\n delete
Node.prototype.querySelectorAll;\n Node.prototype = mixin(Object.create(EventT
arget.prototype), Node.prototype);\n\n scope.cloneNode = cloneNode;\n scope.no
deWasAdded = nodeWasAdded;\n scope.nodeWasRemoved = nodeWasRemoved;\n scope.no
desWereAdded = nodesWereAdded;\n scope.nodesWereRemoved = nodesWereRemoved;\n
scope.snapshotNodeList = snapshotNodeList;\n scope.wrappers.Node = Node;\n\n})(
window.ShadowDOMPolyfill);\n", | 102 "/**\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var EventTarge
t = scope.wrappers.EventTarget;\n var NodeList = scope.wrappers.NodeList;\n va
r TreeScope = scope.TreeScope;\n var assert = scope.assert;\n var defineWrapGe
tter = scope.defineWrapGetter;\n var enqueueMutation = scope.enqueueMutation;\n
var getTreeScope = scope.getTreeScope;\n var isWrapper = scope.isWrapper;\n
var mixin = scope.mixin;\n var registerTransientObservers = scope.registerTrans
ientObservers;\n var registerWrapper = scope.registerWrapper;\n var setTreeSco
pe = scope.setTreeScope;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = s
cope.unwrapIfNeeded;\n var wrap = scope.wrap;\n var wrapIfNeeded = scope.wrapI
fNeeded;\n var wrappers = scope.wrappers;\n\n function assertIsNodeWrapper(nod
e) {\n assert(node instanceof Node);\n }\n\n function createOneElementNodeL
ist(node) {\n var nodes = new NodeList();\n nodes[0] = node;\n nodes.le
ngth = 1;\n return nodes;\n }\n\n var surpressMutations = false;\n\n /**\n
* Called before node is inserted into a node to enqueue its removal from its\
n * old parent.\n * @param {!Node} node The node that is about to be removed
.\n * @param {!Node} parent The parent node that the node is being removed fro
m.\n * @param {!NodeList} nodes The collected nodes.\n */\n function enqueu
eRemovalForInsertedNodes(node, parent, nodes) {\n enqueueMutation(parent, 'ch
ildList', {\n removedNodes: nodes,\n previousSibling: node.previousSib
ling,\n nextSibling: node.nextSibling\n });\n }\n\n function enqueueRe
movalForInsertedDocumentFragment(df, nodes) {\n enqueueMutation(df, 'childLis
t', {\n removedNodes: nodes\n });\n }\n\n /**\n * Collects nodes fro
m a DocumentFragment or a Node for removal followed\n * by an insertion.\n *
\n * This updates the internal pointers for node, previousNode and nextNode.\n
*/\n function collectNodes(node, parentNode, previousNode, nextNode) {\n
if (node instanceof DocumentFragment) {\n var nodes = collectNodesForDocume
ntFragment(node);\n\n // The extra loop is to work around bugs with Documen
tFragments in IE.\n surpressMutations = true;\n for (var i = nodes.len
gth - 1; i >= 0; i--) {\n node.removeChild(nodes[i]);\n nodes[i].p
arentNode_ = parentNode;\n }\n surpressMutations = false;\n\n for
(var i = 0; i < nodes.length; i++) {\n nodes[i].previousSibling_ = nodes
[i - 1] || previousNode;\n nodes[i].nextSibling_ = nodes[i + 1] || nextNo
de;\n }\n\n if (previousNode)\n previousNode.nextSibling_ = nod
es[0];\n if (nextNode)\n nextNode.previousSibling_ = nodes[nodes.len
gth - 1];\n\n return nodes;\n }\n\n var nodes = createOneElementNodeL
ist(node);\n var oldParent = node.parentNode;\n if (oldParent) {\n //
This will enqueue the mutation record for the removal as needed.\n oldPare
nt.removeChild(node);\n }\n\n node.parentNode_ = parentNode;\n node.pre
viousSibling_ = previousNode;\n node.nextSibling_ = nextNode;\n if (previo
usNode)\n previousNode.nextSibling_ = node;\n if (nextNode)\n nextN
ode.previousSibling_ = node;\n\n return nodes;\n }\n\n function collectNode
sNative(node) {\n if (node instanceof DocumentFragment)\n return collect
NodesForDocumentFragment(node);\n\n var nodes = createOneElementNodeList(node
);\n var oldParent = node.parentNode;\n if (oldParent)\n enqueueRemov
alForInsertedNodes(node, oldParent, nodes);\n return nodes;\n }\n\n functio
n collectNodesForDocumentFragment(node) {\n var nodes = new NodeList();\n
var i = 0;\n for (var child = node.firstChild; child; child = child.nextSibli
ng) {\n nodes[i++] = child;\n }\n nodes.length = i;\n enqueueRemov
alForInsertedDocumentFragment(node, nodes);\n return nodes;\n }\n\n functio
n snapshotNodeList(nodeList) {\n // NodeLists are not live at the moment so j
ust return the same object.\n return nodeList;\n }\n\n // http://dom.spec.w
hatwg.org/#node-is-inserted\n function nodeWasAdded(node, treeScope) {\n set
TreeScope(node, treeScope);\n node.nodeIsInserted_();\n }\n\n function node
sWereAdded(nodes, parent) {\n var treeScope = getTreeScope(parent);\n for
(var i = 0; i < nodes.length; i++) {\n nodeWasAdded(nodes[i], treeScope);\n
}\n }\n\n // http://dom.spec.whatwg.org/#node-is-removed\n function nodeW
asRemoved(node) {\n setTreeScope(node, new TreeScope(node, null));\n }\n\n
function nodesWereRemoved(nodes) {\n for (var i = 0; i < nodes.length; i++) {
\n nodeWasRemoved(nodes[i]);\n }\n }\n\n function ensureSameOwnerDocum
ent(parent, child) {\n var ownerDoc = parent.nodeType === Node.DOCUMENT_NODE
?\n parent : parent.ownerDocument;\n if (ownerDoc !== child.ownerDocum
ent)\n ownerDoc.adoptNode(child);\n }\n\n function adoptNodesIfNeeded(own
er, nodes) {\n if (!nodes.length)\n return;\n\n var ownerDoc = owner.
ownerDocument;\n\n // All nodes have the same ownerDocument when we get here.
\n if (ownerDoc === nodes[0].ownerDocument)\n return;\n\n for (var i
= 0; i < nodes.length; i++) {\n scope.adoptNodeNoRemove(nodes[i], ownerDoc)
;\n }\n }\n\n function unwrapNodesForInsertion(owner, nodes) {\n adoptNo
desIfNeeded(owner, nodes);\n var length = nodes.length;\n\n if (length ===
1)\n return unwrap(nodes[0]);\n\n var df = unwrap(owner.ownerDocument.c
reateDocumentFragment());\n for (var i = 0; i < length; i++) {\n df.appe
ndChild(unwrap(nodes[i]));\n }\n return df;\n }\n\n function clearChildN
odes(wrapper) {\n if (wrapper.firstChild_ !== undefined) {\n var child =
wrapper.firstChild_;\n while (child) {\n var tmp = child;\n
child = child.nextSibling_;\n tmp.parentNode_ = tmp.previousSibling_ = tm
p.nextSibling_ = undefined;\n }\n }\n wrapper.firstChild_ = wrapper.l
astChild_ = undefined;\n }\n\n function removeAllChildNodes(wrapper) {\n if
(wrapper.invalidateShadowRenderer()) {\n var childWrapper = wrapper.firstC
hild;\n while (childWrapper) {\n assert(childWrapper.parentNode ===
wrapper);\n var nextSibling = childWrapper.nextSibling;\n var chil
dNode = unwrap(childWrapper);\n var parentNode = childNode.parentNode;\n
if (parentNode)\n originalRemoveChild.call(parentNode, childNode
);\n childWrapper.previousSibling_ = childWrapper.nextSibling_ =\n
childWrapper.parentNode_ = null;\n childWrapper = nextSibling;\n
}\n wrapper.firstChild_ = wrapper.lastChild_ = null;\n } else {\n
var node = unwrap(wrapper);\n var child = node.firstChild;\n var next
Sibling;\n while (child) {\n nextSibling = child.nextSibling;\n
originalRemoveChild.call(node, child);\n child = nextSibling;\n }
\n }\n }\n\n function invalidateParent(node) {\n var p = node.parentNode
;\n return p && p.invalidateShadowRenderer();\n }\n\n function cleanupNodes
(nodes) {\n for (var i = 0, n; i < nodes.length; i++) {\n n = nodes[i];\
n n.parentNode.removeChild(n);\n }\n }\n\n var originalImportNode = do
cument.importNode;\n var originalCloneNode = window.Node.prototype.cloneNode;\n
\n function cloneNode(node, deep, opt_doc) {\n var clone;\n if (opt_doc)\
n clone = wrap(originalImportNode.call(opt_doc, node.impl, false));\n el
se\n clone = wrap(originalCloneNode.call(node.impl, false));\n\n if (dee
p) {\n for (var child = node.firstChild; child; child = child.nextSibling)
{\n clone.appendChild(cloneNode(child, true, opt_doc));\n }\n\n
if (node instanceof wrappers.HTMLTemplateElement) {\n var cloneContent =
clone.content;\n for (var child = node.content.firstChild;\n
child;\n child = child.nextSibling) {\n cloneContent.append
Child(cloneNode(child, true, opt_doc));\n }\n }\n }\n // TODO(
arv): Some HTML elements also clone other data like value.\n return clone;\n
}\n\n function contains(self, child) {\n if (!child || getTreeScope(self) !
== getTreeScope(child))\n return false;\n\n for (var node = child; node;
node = node.parentNode) {\n if (node === self)\n return true;\n
}\n return false;\n }\n\n var OriginalNode = window.Node;\n\n /**\n * Th
is represents a wrapper of a native DOM node.\n * @param {!Node} original The
original DOM node, aka, the visual DOM node.\n * @constructor\n * @extends {
EventTarget}\n */\n function Node(original) {\n assert(original instanceof
OriginalNode);\n\n EventTarget.call(this, original);\n\n // These propert
ies are used to override the visual references with the\n // logical ones. If
the value is undefined it means that the logical is the\n // same as the vis
ual.\n\n /**\n * @type {Node|undefined}\n * @private\n */\n th
is.parentNode_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @p
rivate\n */\n this.firstChild_ = undefined;\n\n /**\n * @type {Nod
e|undefined}\n * @private\n */\n this.lastChild_ = undefined;\n\n
/**\n * @type {Node|undefined}\n * @private\n */\n this.nextSibli
ng_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @private\n
*/\n this.previousSibling_ = undefined;\n\n this.treeScope_ = undefined;
\n }\n\n var OriginalDocumentFragment = window.DocumentFragment;\n var origin
alAppendChild = OriginalNode.prototype.appendChild;\n var originalCompareDocume
ntPosition =\n OriginalNode.prototype.compareDocumentPosition;\n var origi
nalInsertBefore = OriginalNode.prototype.insertBefore;\n var originalRemoveChil
d = OriginalNode.prototype.removeChild;\n var originalReplaceChild = OriginalNo
de.prototype.replaceChild;\n\n var isIe = /Trident/.test(navigator.userAgent);\
n\n var removeChildOriginalHelper = isIe ?\n function(parent, child) {\n
try {\n originalRemoveChild.call(parent, child);\n } catch
(ex) {\n if (!(parent instanceof OriginalDocumentFragment))\n
throw ex;\n }\n } :\n function(parent, child) {\n ori
ginalRemoveChild.call(parent, child);\n };\n\n Node.prototype = Object.cre
ate(EventTarget.prototype);\n mixin(Node.prototype, {\n appendChild: functio
n(childWrapper) {\n return this.insertBefore(childWrapper, null);\n },\n
\n insertBefore: function(childWrapper, refWrapper) {\n assertIsNodeWrap
per(childWrapper);\n\n var refNode;\n if (refWrapper) {\n if (i
sWrapper(refWrapper)) {\n refNode = unwrap(refWrapper);\n } else
{\n refNode = refWrapper;\n refWrapper = wrap(refNode);\n
}\n } else {\n refWrapper = null;\n refNode = null;\n
}\n\n refWrapper && assert(refWrapper.parentNode === this);\n\n var
nodes;\n var previousNode =\n refWrapper ? refWrapper.previousSibl
ing : this.lastChild;\n\n var useNative = !this.invalidateShadowRenderer()
&&\n !invalidateParent(childWrapper);\n\n if (useNativ
e)\n nodes = collectNodesNative(childWrapper);\n else\n nodes
= collectNodes(childWrapper, this, previousNode, refWrapper);\n\n if (useN
ative) {\n ensureSameOwnerDocument(this, childWrapper);\n clearChi
ldNodes(this);\n originalInsertBefore.call(this.impl, unwrap(childWrapper
), refNode);\n } else {\n if (!previousNode)\n this.firstCh
ild_ = nodes[0];\n if (!refWrapper) {\n this.lastChild_ = nodes[
nodes.length - 1];\n if (this.firstChild_ === undefined)\n t
his.firstChild_ = this.firstChild;\n }\n\n var parentNode = refNod
e ? refNode.parentNode : this.impl;\n\n // insertBefore refWrapper no mat
ter what the parent is?\n if (parentNode) {\n originalInsertBefo
re.call(parentNode,\n unwrapNodesForInsertion(this, nodes), refNode
);\n } else {\n adoptNodesIfNeeded(this, nodes);\n }\n
}\n\n enqueueMutation(this, 'childList', {\n addedNodes: nodes,\n
nextSibling: refWrapper,\n previousSibling: previousNode\n }
);\n\n nodesWereAdded(nodes, this);\n\n return childWrapper;\n },\n
\n removeChild: function(childWrapper) {\n assertIsNodeWrapper(childWrap
per);\n if (childWrapper.parentNode !== this) {\n // IE has invalid
DOM trees at times.\n var found = false;\n var childNodes = this.c
hildNodes;\n for (var ieChild = this.firstChild; ieChild;\n i
eChild = ieChild.nextSibling) {\n if (ieChild === childWrapper) {\n
found = true;\n break;\n }\n }\n if (!
found) {\n // TODO(arv): DOMException\n throw new Error('NotFo
undError');\n }\n }\n\n var childNode = unwrap(childWrapper);\n
var childWrapperNextSibling = childWrapper.nextSibling;\n var childWr
apperPreviousSibling = childWrapper.previousSibling;\n\n if (this.invalidat
eShadowRenderer()) {\n // We need to remove the real node from the DOM be
fore updating the\n // pointers. This is so that that mutation event is d
ispatched before\n // the pointers have changed.\n var thisFirstCh
ild = this.firstChild;\n var thisLastChild = this.lastChild;\n\n v
ar parentNode = childNode.parentNode;\n if (parentNode)\n remove
ChildOriginalHelper(parentNode, childNode);\n\n if (thisFirstChild === ch
ildWrapper)\n this.firstChild_ = childWrapperNextSibling;\n if (
thisLastChild === childWrapper)\n this.lastChild_ = childWrapperPreviou
sSibling;\n if (childWrapperPreviousSibling)\n childWrapperPrevi
ousSibling.nextSibling_ = childWrapperNextSibling;\n if (childWrapperNext
Sibling) {\n childWrapperNextSibling.previousSibling_ =\n
childWrapperPreviousSibling;\n }\n\n childWrapper.previousSibling_
= childWrapper.nextSibling_ =\n childWrapper.parentNode_ = undefined
;\n } else {\n clearChildNodes(this);\n removeChildOriginalHe
lper(this.impl, childNode);\n }\n\n if (!surpressMutations) {\n
enqueueMutation(this, 'childList', {\n removedNodes: createOneElementN
odeList(childWrapper),\n nextSibling: childWrapperNextSibling,\n
previousSibling: childWrapperPreviousSibling\n });\n }\n\n r
egisterTransientObservers(this, childWrapper);\n\n return childWrapper;\n
},\n\n replaceChild: function(newChildWrapper, oldChildWrapper) {\n as
sertIsNodeWrapper(newChildWrapper);\n\n var oldChildNode;\n if (isWrap
per(oldChildWrapper)) {\n oldChildNode = unwrap(oldChildWrapper);\n
} else {\n oldChildNode = oldChildWrapper;\n oldChildWrapper = wra
p(oldChildNode);\n }\n\n if (oldChildWrapper.parentNode !== this) {\n
// TODO(arv): DOMException\n throw new Error('NotFoundError');\n
}\n\n var nextNode = oldChildWrapper.nextSibling;\n var previousNo
de = oldChildWrapper.previousSibling;\n var nodes;\n\n var useNative =
!this.invalidateShadowRenderer() &&\n !invalidateParent(ne
wChildWrapper);\n\n if (useNative) {\n nodes = collectNodesNative(ne
wChildWrapper);\n } else {\n if (nextNode === newChildWrapper)\n
nextNode = newChildWrapper.nextSibling;\n nodes = collectNodes(newC
hildWrapper, this, previousNode, nextNode);\n }\n\n if (!useNative) {\
n if (this.firstChild === oldChildWrapper)\n this.firstChild_ =
nodes[0];\n if (this.lastChild === oldChildWrapper)\n this.lastC
hild_ = nodes[nodes.length - 1];\n\n oldChildWrapper.previousSibling_ = o
ldChildWrapper.nextSibling_ =\n oldChildWrapper.parentNode_ = undefin
ed;\n\n // replaceChild no matter what the parent is?\n if (oldChi
ldNode.parentNode) {\n originalReplaceChild.call(\n oldChi
ldNode.parentNode,\n unwrapNodesForInsertion(this, nodes),\n
oldChildNode);\n }\n } else {\n ensureSameOwnerDocumen
t(this, newChildWrapper);\n clearChildNodes(this);\n originalRepla
ceChild.call(this.impl, unwrap(newChildWrapper),\n
oldChildNode);\n }\n\n enqueueMutation(this, 'childList', {\n
addedNodes: nodes,\n removedNodes: createOneElementNodeList(oldChildWr
apper),\n nextSibling: nextNode,\n previousSibling: previousNode\n
});\n\n nodeWasRemoved(oldChildWrapper);\n nodesWereAdded(nodes,
this);\n\n return oldChildWrapper;\n },\n\n /**\n * Called after
a node was inserted. Subclasses override this to invalidate\n * the rendere
r as needed.\n * @private\n */\n nodeIsInserted_: function() {\n
for (var child = this.firstChild; child; child = child.nextSibling) {\n
child.nodeIsInserted_();\n }\n },\n\n hasChildNodes: function() {\n
return this.firstChild !== null;\n },\n\n /** @type {Node} */\n get
parentNode() {\n // If the parentNode has not been overridden, use the ori
ginal parentNode.\n return this.parentNode_ !== undefined ?\n this
.parentNode_ : wrap(this.impl.parentNode);\n },\n\n /** @type {Node} */\n
get firstChild() {\n return this.firstChild_ !== undefined ?\n
this.firstChild_ : wrap(this.impl.firstChild);\n },\n\n /** @type {Node} *
/\n get lastChild() {\n return this.lastChild_ !== undefined ?\n
this.lastChild_ : wrap(this.impl.lastChild);\n },\n\n /** @type {Node} *
/\n get nextSibling() {\n return this.nextSibling_ !== undefined ?\n
this.nextSibling_ : wrap(this.impl.nextSibling);\n },\n\n /** @type
{Node} */\n get previousSibling() {\n return this.previousSibling_ !== u
ndefined ?\n this.previousSibling_ : wrap(this.impl.previousSibling);\n
},\n\n get parentElement() {\n var p = this.parentNode;\n while
(p && p.nodeType !== Node.ELEMENT_NODE) {\n p = p.parentNode;\n }\n
return p;\n },\n\n get textContent() {\n // TODO(arv): This sho
uld fallback to this.impl.textContent if there\n // are no shadow trees bel
ow or above the context node.\n var s = '';\n for (var child = this.fi
rstChild; child; child = child.nextSibling) {\n if (child.nodeType != Nod
e.COMMENT_NODE) {\n s += child.textContent;\n }\n }\n
return s;\n },\n set textContent(textContent) {\n var removedNodes =
snapshotNodeList(this.childNodes);\n\n if (this.invalidateShadowRenderer())
{\n removeAllChildNodes(this);\n if (textContent !== '') {\n
var textNode = this.impl.ownerDocument.createTextNode(textContent);\n
this.appendChild(textNode);\n }\n } else {\n clearChildNo
des(this);\n this.impl.textContent = textContent;\n }\n\n var a
ddedNodes = snapshotNodeList(this.childNodes);\n\n enqueueMutation(this, 'c
hildList', {\n addedNodes: addedNodes,\n removedNodes: removedNode
s\n });\n\n nodesWereRemoved(removedNodes);\n nodesWereAdded(adde
dNodes, this);\n },\n\n get childNodes() {\n var wrapperList = new No
deList();\n var i = 0;\n for (var child = this.firstChild; child; chil
d = child.nextSibling) {\n wrapperList[i++] = child;\n }\n wrap
perList.length = i;\n return wrapperList;\n },\n\n cloneNode: functio
n(deep) {\n return cloneNode(this, deep);\n },\n\n contains: function
(child) {\n return contains(this, wrapIfNeeded(child));\n },\n\n comp
areDocumentPosition: function(otherNode) {\n // This only wraps, it therefo
re only operates on the composed DOM and not\n // the logical DOM.\n r
eturn originalCompareDocumentPosition.call(this.impl,\n
unwrapIfNeeded(otherNode));\n },\n\n normalize: f
unction() {\n var nodes = snapshotNodeList(this.childNodes);\n var rem
Nodes = [];\n var s = '';\n var modNode;\n\n for (var i = 0, n; i
< nodes.length; i++) {\n n = nodes[i];\n if (n.nodeType === Node.
TEXT_NODE) {\n if (!modNode && !n.data.length)\n this.remove
Node(n);\n else if (!modNode)\n modNode = n;\n else
{\n s += n.data;\n remNodes.push(n);\n }\n
} else {\n if (modNode && remNodes.length) {\n modNode.dat
a += s;\n cleanupNodes(remNodes);\n }\n remNodes =
[];\n s = '';\n modNode = null;\n if (n.childNodes.le
ngth)\n n.normalize();\n }\n }\n\n // handle case wh
ere >1 text nodes are the last children\n if (modNode && remNodes.length) {
\n modNode.data += s;\n cleanupNodes(remNodes);\n }\n }\n
});\n\n defineWrapGetter(Node, 'ownerDocument');\n\n // We use a DocumentFrag
ment as a base and then delete the properties of\n // DocumentFragment.prototyp
e from the wrapper Node. Since delete makes\n // objects slow in some JS engine
s we recreate the prototype object.\n registerWrapper(OriginalNode, Node, docum
ent.createDocumentFragment());\n delete Node.prototype.querySelector;\n delete
Node.prototype.querySelectorAll;\n Node.prototype = mixin(Object.create(EventT
arget.prototype), Node.prototype);\n\n scope.cloneNode = cloneNode;\n scope.no
deWasAdded = nodeWasAdded;\n scope.nodeWasRemoved = nodeWasRemoved;\n scope.no
desWereAdded = nodesWereAdded;\n scope.nodesWereRemoved = nodesWereRemoved;\n
scope.snapshotNodeList = snapshotNodeList;\n scope.wrappers.Node = Node;\n\n})(
window.ShadowDOMPolyfill);\n", |
104 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is governed by a BSD-style\n// license that can be found in the LIC
ENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLCollection = scop
e.wrappers.HTMLCollection;\n var NodeList = scope.wrappers.NodeList;\n\n funct
ion findOne(node, selector) {\n var m, el = node.firstElementChild;\n whil
e (el) {\n if (el.matches(selector))\n return el;\n m = findOne
(el, selector);\n if (m)\n return m;\n el = el.nextElementSibli
ng;\n }\n return null;\n }\n\n function matchesSelector(el, selector) {\
n return el.matches(selector);\n }\n\n var XHTML_NS = 'http://www.w3.org/19
99/xhtml';\n\n function matchesTagName(el, localName, localNameLowerCase) {\n
var ln = el.localName;\n return ln === localName ||\n ln === localNa
meLowerCase && el.namespaceURI === XHTML_NS;\n }\n\n function matchesEveryThin
g() {\n return true;\n }\n\n function matchesLocalName(el, localName) {\n
return el.localName === localName;\n }\n\n function matchesNameSpace(el, ns)
{\n return el.namespaceURI === ns;\n }\n\n function matchesLocalNameNS(el,
ns, localName) {\n return el.namespaceURI === ns && el.localName === localNa
me;\n }\n\n function findElements(node, result, p, arg0, arg1) {\n var el =
node.firstElementChild;\n while (el) {\n if (p(el, arg0, arg1))\n
result[result.length++] = el;\n findElements(el, result, p, arg0, arg1);\
n el = el.nextElementSibling;\n }\n return result;\n }\n\n // find
and findAll will only match Simple Selectors,\n // Structural Pseudo Classes ar
e not guarenteed to be correct\n // http://www.w3.org/TR/css3-selectors/#simple
-selectors\n\n var SelectorsInterface = {\n querySelector: function(selector
) {\n return findOne(this, selector);\n },\n querySelectorAll: functi
on(selector) {\n return findElements(this, new NodeList(), matchesSelector,
selector);\n }\n };\n\n var GetElementsByInterface = {\n getElementsByT
agName: function(localName) {\n var result = new HTMLCollection();\n i
f (localName === '*')\n return findElements(this, result, matchesEveryThi
ng);\n\n return findElements(this, result,\n matchesTagName,\n
localName,\n localName.toLowerCase());\n },\n\n getElements
ByClassName: function(className) {\n // TODO(arv): Check className?\n
return this.querySelectorAll('.' + className);\n },\n\n getElementsByTagNa
meNS: function(ns, localName) {\n var result = new HTMLCollection();\n\n
if (ns === '') {\n ns = null;\n } else if (ns === '*') {\n
if (localName === '*')\n return findElements(this, result, matchesEver
yThing);\n return findElements(this, result, matchesLocalName, localName)
;\n }\n\n if (localName === '*')\n return findElements(this, re
sult, matchesNameSpace, ns);\n\n return findElements(this, result, matchesL
ocalNameNS, ns, localName);\n }\n };\n\n scope.GetElementsByInterface = Get
ElementsByInterface;\n scope.SelectorsInterface = SelectorsInterface;\n\n})(win
dow.ShadowDOMPolyfill);\n", | 103 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is governed by a BSD-style\n// license that can be found in the LIC
ENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLCollection = scop
e.wrappers.HTMLCollection;\n var NodeList = scope.wrappers.NodeList;\n var get
TreeScope = scope.getTreeScope;\n var wrap = scope.wrap;\n\n var originalDocum
entQuerySelector = document.querySelector;\n var originalElementQuerySelector =
document.documentElement.querySelector;\n\n var originalDocumentQuerySelectorA
ll = document.querySelectorAll;\n var originalElementQuerySelectorAll = documen
t.documentElement.querySelectorAll;\n\n var originalDocumentGetElementsByTagNam
e = document.getElementsByTagName;\n var originalElementGetElementsByTagName =
document.documentElement.getElementsByTagName;\n\n var originalDocumentGetEleme
ntsByTagNameNS = document.getElementsByTagNameNS;\n var originalElementGetEleme
ntsByTagNameNS = document.documentElement.getElementsByTagNameNS;\n\n var Origi
nalElement = window.Element;\n var OriginalDocument = window.HTMLDocument;\n\n
function filterNodeList(list, index, result) {\n var wrappedItem = null;\n
var root = null;\n for (var i = 0, length = list.length; i < length; i++) {
\n wrappedItem = wrap(list[i]);\n if (root = getTreeScope(wrappedItem)
.root) {\n if (root instanceof scope.wrappers.ShadowRoot) {\n co
ntinue;\n }\n }\n result[index++] = wrappedItem;\n }\n \n
return index;\n }\n\n function findOne(node, selector) {\n var m, el =
node.firstElementChild;\n while (el) {\n if (el.matches(selector))\n
return el;\n m = findOne(el, selector);\n if (m)\n return m
;\n el = el.nextElementSibling;\n }\n return null;\n }\n\n function
matchesSelector(el, selector) {\n return el.matches(selector);\n }\n\n var
XHTML_NS = 'http://www.w3.org/1999/xhtml';\n\n function matchesTagName(el, loc
alName, localNameLowerCase) {\n var ln = el.localName;\n return ln === loc
alName ||\n ln === localNameLowerCase && el.namespaceURI === XHTML_NS;\n
}\n\n function matchesEveryThing() {\n return true;\n }\n\n function matc
hesLocalNameOnly(el, ns, localName) {\n return el.localName === localName;\n
}\n\n function matchesNameSpace(el, ns) {\n return el.namespaceURI === ns;\
n }\n\n function matchesLocalNameNS(el, ns, localName) {\n return el.namesp
aceURI === ns && el.localName === localName;\n }\n\n function findElements(nod
e, index, result, p, arg0, arg1) {\n var el = node.firstElementChild;\n wh
ile (el) {\n if (p(el, arg0, arg1))\n result[index++] = el;\n i
ndex = findElements(el, index, result, p, arg0, arg1);\n el = el.nextElemen
tSibling;\n }\n return index;\n }\n\n // find and findAll will only matc
h Simple Selectors,\n // Structural Pseudo Classes are not guarenteed to be cor
rect\n // http://www.w3.org/TR/css3-selectors/#simple-selectors\n\n function q
uerySelectorAllFiltered (p, index, result, selector) {\n var target = this.im
pl;\n var list;\n var root = getTreeScope(this).root;\n if (root instan
ceof scope.wrappers.ShadowRoot) {\n // We are in the shadow tree and the lo
gical tree is\n // going to be disconnected so we do a manual tree traversa
l\n return findElements(this, index, result, p, selector, null);\n } els
e if (target instanceof OriginalElement) {\n list = originalElementQuerySel
ectorAll.call(target, selector);\n } else if (target instanceof OriginalDocum
ent) {\n list = originalDocumentQuerySelectorAll.call(target, selector);\n
} else {\n // When we get a ShadowRoot the logical tree is going to be d
isconnected\n // so we do a manual tree traversal\n return findElement
s(this, index, result, p, selector, null);\n }\n\n return filterNodeList(l
ist, index, result);\n }\n\n var SelectorsInterface = {\n querySelector: fu
nction(selector) {\n var target = this.impl;\n var wrappedItem;\n
var root = getTreeScope(this).root;\n if (root instanceof scope.wrappers.S
hadowRoot) {\n // We are in the shadow tree and the logical tree is\n
// going to be disconnected so we do a manual tree traversal\n return
findOne(this, selector);\n } else if (target instanceof OriginalElement) {
\n wrappedItem = wrap(originalElementQuerySelector.call(target, selector)
);\n } else if (target instanceof OriginalDocument) {\n wrappedItem
= wrap(originalDocumentQuerySelector.call(target, selector));\n } else {\n
// When we get a ShadowRoot the logical tree is going to be disconnected\
n // so we do a manual tree traversal\n return findOne(this, selec
tor);\n }\n\n if (!wrappedItem) {\n // When the original query
returns nothing\n // we return nothing (to be consistent with the other w
rapped calls)\n return wrappedItem;\n } else if (root = getTreeScope
(wrappedItem).root) {\n if (root instanceof scope.wrappers.ShadowRoot) {\
n // When the original query returns an element in the ShadowDOM\n
// we must do a manual tree traversal\n return findOne(this, selec
tor);\n }\n }\n\n return wrappedItem;\n },\n querySelecto
rAll: function(selector) {\n var result = new NodeList();\n\n result.l
ength = querySelectorAllFiltered.call(this,\n matchesSelector,\n
0,\n result,\n selector);\n\n return result;\n }\n
};\n\n function getElementsByTagNameFiltered (p, index, result, localName, low
ercase) {\n var target = this.impl;\n var list;\n var root = getTreeSco
pe(this).root;\n if (root instanceof scope.wrappers.ShadowRoot) {\n // W
e are in the shadow tree and the logical tree is\n // going to be disconnec
ted so we do a manual tree traversal\n return findElements(this, index, res
ult, p, localName, lowercase);\n } else if (target instanceof OriginalElement
) {\n list = originalElementGetElementsByTagName.call(target, localName, lo
wercase);\n } else if (target instanceof OriginalDocument) {\n list = or
iginalDocumentGetElementsByTagName.call(target, localName, lowercase);\n } el
se {\n // When we get a ShadowRoot the logical tree is going to be disconne
cted\n // so we do a manual tree traversal\n return findElements(this,
index, result, p, localName, lowercase);\n }\n\n return filterNodeList(li
st, index, result);\n }\n\n function getElementsByTagNameNSFiltered (p, index,
result, ns, localName) {\n var target = this.impl;\n var list;\n var r
oot = getTreeScope(this).root;\n if (root instanceof scope.wrappers.ShadowRoo
t) {\n // We are in the shadow tree and the logical tree is\n // going
to be disconnected so we do a manual tree traversal\n return findElements(
this, index, result, p, ns, localName);\n } else if (target instanceof Origin
alElement) {\n list = originalElementGetElementsByTagNameNS.call(target, ns
, localName);\n } else if (target instanceof OriginalDocument) {\n list
= originalDocumentGetElementsByTagNameNS.call(target, ns, localName);\n } els
e {\n // When we get a ShadowRoot the logical tree is going to be disconnec
ted\n // so we do a manual tree traversal\n return findElements(this,
index, result, p, ns, localName);\n }\n\n return filterNodeList(list, inde
x, result);\n }\n\n var GetElementsByInterface = {\n getElementsByTagName:
function(localName) {\n var result = new HTMLCollection();\n var match
= localName === '*' ? matchesEveryThing : matchesTagName;\n\n result.lengt
h = getElementsByTagNameFiltered.call(this, \n match,\n 0, \n
result,\n localName,\n localName.toLowerCase());\n\n
return result;\n },\n\n getElementsByClassName: function(className) {
\n // TODO(arv): Check className?\n return this.querySelectorAll('.' +
className);\n },\n\n getElementsByTagNameNS: function(ns, localName) {\n
var result = new HTMLCollection();\n var match = null;\n\n if (ns
=== '*') {\n match = localName === '*' ? matchesEveryThing : matchesLoca
lNameOnly;\n } else {\n match = localName === '*' ? matchesNameSpace
: matchesLocalNameNS;\n }\n \n result.length = getElementsByTagN
ameNSFiltered.call(this, \n match,\n 0,\n result,\n
ns || null,\n localName);\n\n return result;\n }\n };\
n\n scope.GetElementsByInterface = GetElementsByInterface;\n scope.SelectorsIn
terface = SelectorsInterface;\n\n})(window.ShadowDOMPolyfill);\n", |
105 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var NodeList = scope.wra
ppers.NodeList;\n\n function forwardElement(node) {\n while (node && node.no
deType !== Node.ELEMENT_NODE) {\n node = node.nextSibling;\n }\n retu
rn node;\n }\n\n function backwardsElement(node) {\n while (node && node.no
deType !== Node.ELEMENT_NODE) {\n node = node.previousSibling;\n }\n
return node;\n }\n\n var ParentNodeInterface = {\n get firstElementChild()
{\n return forwardElement(this.firstChild);\n },\n\n get lastElementC
hild() {\n return backwardsElement(this.lastChild);\n },\n\n get chil
dElementCount() {\n var count = 0;\n for (var child = this.firstElemen
tChild;\n child;\n child = child.nextElementSibling) {\n
count++;\n }\n return count;\n },\n\n get children() {\n
var wrapperList = new NodeList();\n var i = 0;\n for (var child = th
is.firstElementChild;\n child;\n child = child.nextElementSi
bling) {\n wrapperList[i++] = child;\n }\n wrapperList.length =
i;\n return wrapperList;\n },\n\n remove: function() {\n var p
= this.parentNode;\n if (p)\n p.removeChild(this);\n }\n };\n\n
var ChildNodeInterface = {\n get nextElementSibling() {\n return forwar
dElement(this.nextSibling);\n },\n\n get previousElementSibling() {\n
return backwardsElement(this.previousSibling);\n }\n };\n\n scope.ChildNod
eInterface = ChildNodeInterface;\n scope.ParentNodeInterface = ParentNodeInterf
ace;\n\n})(window.ShadowDOMPolyfill);\n", | 104 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var NodeList = scope.wra
ppers.NodeList;\n\n function forwardElement(node) {\n while (node && node.no
deType !== Node.ELEMENT_NODE) {\n node = node.nextSibling;\n }\n retu
rn node;\n }\n\n function backwardsElement(node) {\n while (node && node.no
deType !== Node.ELEMENT_NODE) {\n node = node.previousSibling;\n }\n
return node;\n }\n\n var ParentNodeInterface = {\n get firstElementChild()
{\n return forwardElement(this.firstChild);\n },\n\n get lastElementC
hild() {\n return backwardsElement(this.lastChild);\n },\n\n get chil
dElementCount() {\n var count = 0;\n for (var child = this.firstElemen
tChild;\n child;\n child = child.nextElementSibling) {\n
count++;\n }\n return count;\n },\n\n get children() {\n
var wrapperList = new NodeList();\n var i = 0;\n for (var child = th
is.firstElementChild;\n child;\n child = child.nextElementSi
bling) {\n wrapperList[i++] = child;\n }\n wrapperList.length =
i;\n return wrapperList;\n },\n\n remove: function() {\n var p
= this.parentNode;\n if (p)\n p.removeChild(this);\n }\n };\n\n
var ChildNodeInterface = {\n get nextElementSibling() {\n return forwar
dElement(this.nextSibling);\n },\n\n get previousElementSibling() {\n
return backwardsElement(this.previousSibling);\n }\n };\n\n scope.ChildNod
eInterface = ChildNodeInterface;\n scope.ParentNodeInterface = ParentNodeInterf
ace;\n\n})(window.ShadowDOMPolyfill);\n", |
106 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface =
scope.ChildNodeInterface;\n var Node = scope.wrappers.Node;\n var enqueueMuta
tion = scope.enqueueMutation;\n var mixin = scope.mixin;\n var registerWrapper
= scope.registerWrapper;\n\n var OriginalCharacterData = window.CharacterData;
\n\n function CharacterData(node) {\n Node.call(this, node);\n }\n Charact
erData.prototype = Object.create(Node.prototype);\n mixin(CharacterData.prototy
pe, {\n get textContent() {\n return this.data;\n },\n set textCon
tent(value) {\n this.data = value;\n },\n get data() {\n return
this.impl.data;\n },\n set data(value) {\n var oldValue = this.impl.d
ata;\n enqueueMutation(this, 'characterData', {\n oldValue: oldValue
\n });\n this.impl.data = value;\n }\n });\n\n mixin(CharacterDat
a.prototype, ChildNodeInterface);\n\n registerWrapper(OriginalCharacterData, Ch
aracterData,\n document.createTextNode(''));\n\n scope.wrapper
s.CharacterData = CharacterData;\n})(window.ShadowDOMPolyfill);\n", | 105 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface =
scope.ChildNodeInterface;\n var Node = scope.wrappers.Node;\n var enqueueMuta
tion = scope.enqueueMutation;\n var mixin = scope.mixin;\n var registerWrapper
= scope.registerWrapper;\n\n var OriginalCharacterData = window.CharacterData;
\n\n function CharacterData(node) {\n Node.call(this, node);\n }\n Charact
erData.prototype = Object.create(Node.prototype);\n mixin(CharacterData.prototy
pe, {\n get textContent() {\n return this.data;\n },\n set textCon
tent(value) {\n this.data = value;\n },\n get data() {\n return
this.impl.data;\n },\n set data(value) {\n var oldValue = this.impl.d
ata;\n enqueueMutation(this, 'characterData', {\n oldValue: oldValue
\n });\n this.impl.data = value;\n }\n });\n\n mixin(CharacterDat
a.prototype, ChildNodeInterface);\n\n registerWrapper(OriginalCharacterData, Ch
aracterData,\n document.createTextNode(''));\n\n scope.wrapper
s.CharacterData = CharacterData;\n})(window.ShadowDOMPolyfill);\n", |
107 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var CharacterData = scop
e.wrappers.CharacterData;\n var enqueueMutation = scope.enqueueMutation;\n var
mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n funct
ion toUInt32(x) {\n return x >>> 0;\n }\n\n var OriginalText = window.Text;
\n\n function Text(node) {\n CharacterData.call(this, node);\n }\n Text.pr
ototype = Object.create(CharacterData.prototype);\n mixin(Text.prototype, {\n
splitText: function(offset) {\n offset = toUInt32(offset);\n var s =
this.data;\n if (offset > s.length)\n throw new Error('IndexSizeErr
or');\n var head = s.slice(0, offset);\n var tail = s.slice(offset);\n
this.data = head;\n var newTextNode = this.ownerDocument.createTextNo
de(tail);\n if (this.parentNode)\n this.parentNode.insertBefore(newT
extNode, this.nextSibling);\n return newTextNode;\n }\n });\n\n regist
erWrapper(OriginalText, Text, document.createTextNode(''));\n\n scope.wrappers.
Text = Text;\n})(window.ShadowDOMPolyfill);\n", | 106 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var CharacterData = scop
e.wrappers.CharacterData;\n var enqueueMutation = scope.enqueueMutation;\n var
mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n funct
ion toUInt32(x) {\n return x >>> 0;\n }\n\n var OriginalText = window.Text;
\n\n function Text(node) {\n CharacterData.call(this, node);\n }\n Text.pr
ototype = Object.create(CharacterData.prototype);\n mixin(Text.prototype, {\n
splitText: function(offset) {\n offset = toUInt32(offset);\n var s =
this.data;\n if (offset > s.length)\n throw new Error('IndexSizeErr
or');\n var head = s.slice(0, offset);\n var tail = s.slice(offset);\n
this.data = head;\n var newTextNode = this.ownerDocument.createTextNo
de(tail);\n if (this.parentNode)\n this.parentNode.insertBefore(newT
extNode, this.nextSibling);\n return newTextNode;\n }\n });\n\n regist
erWrapper(OriginalText, Text, document.createTextNode(''));\n\n scope.wrappers.
Text = Text;\n})(window.ShadowDOMPolyfill);\n", |
108 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n function invalidateClass
(el) {\n scope.invalidateRendererBasedOnAttribute(el, 'class');\n }\n\n fun
ction DOMTokenList(impl, ownerElement) {\n this.impl = impl;\n this.ownerE
lement_ = ownerElement;\n }\n\n DOMTokenList.prototype = {\n get length() {
\n return this.impl.length;\n },\n item: function(index) {\n ret
urn this.impl.item(index);\n },\n contains: function(token) {\n retur
n this.impl.contains(token);\n },\n add: function() {\n this.impl.add
.apply(this.impl, arguments);\n invalidateClass(this.ownerElement_);\n }
,\n remove: function() {\n this.impl.remove.apply(this.impl, arguments);
\n invalidateClass(this.ownerElement_);\n },\n toggle: function(token
) {\n var rv = this.impl.toggle.apply(this.impl, arguments);\n invalid
ateClass(this.ownerElement_);\n return rv;\n },\n toString: function(
) {\n return this.impl.toString();\n }\n };\n\n scope.wrappers.DOMToke
nList = DOMTokenList;\n})(window.ShadowDOMPolyfill);\n", | 107 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n function invalidateClass
(el) {\n scope.invalidateRendererBasedOnAttribute(el, 'class');\n }\n\n fun
ction DOMTokenList(impl, ownerElement) {\n this.impl = impl;\n this.ownerE
lement_ = ownerElement;\n }\n\n DOMTokenList.prototype = {\n get length() {
\n return this.impl.length;\n },\n item: function(index) {\n ret
urn this.impl.item(index);\n },\n contains: function(token) {\n retur
n this.impl.contains(token);\n },\n add: function() {\n this.impl.add
.apply(this.impl, arguments);\n invalidateClass(this.ownerElement_);\n }
,\n remove: function() {\n this.impl.remove.apply(this.impl, arguments);
\n invalidateClass(this.ownerElement_);\n },\n toggle: function(token
) {\n var rv = this.impl.toggle.apply(this.impl, arguments);\n invalid
ateClass(this.ownerElement_);\n return rv;\n },\n toString: function(
) {\n return this.impl.toString();\n }\n };\n\n scope.wrappers.DOMToke
nList = DOMTokenList;\n})(window.ShadowDOMPolyfill);\n", |
109 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface =
scope.ChildNodeInterface;\n var GetElementsByInterface = scope.GetElementsByIn
terface;\n var Node = scope.wrappers.Node;\n var DOMTokenList = scope.wrappers
.DOMTokenList;\n var ParentNodeInterface = scope.ParentNodeInterface;\n var Se
lectorsInterface = scope.SelectorsInterface;\n var addWrapNodeListMethod = scop
e.addWrapNodeListMethod;\n var enqueueMutation = scope.enqueueMutation;\n var
mixin = scope.mixin;\n var oneOf = scope.oneOf;\n var registerWrapper = scope.
registerWrapper;\n var unwrap = scope.unwrap;\n var wrappers = scope.wrappers;
\n\n var OriginalElement = window.Element;\n\n var matchesNames = [\n 'matc
hes', // needs to come first.\n 'mozMatchesSelector',\n 'msMatchesSelecto
r',\n 'webkitMatchesSelector',\n ].filter(function(name) {\n return Origi
nalElement.prototype[name];\n });\n\n var matchesName = matchesNames[0];\n\n
var originalMatches = OriginalElement.prototype[matchesName];\n\n function inva
lidateRendererBasedOnAttribute(element, name) {\n // Only invalidate if paren
t node is a shadow host.\n var p = element.parentNode;\n if (!p || !p.shad
owRoot)\n return;\n\n var renderer = scope.getRendererForHost(p);\n i
f (renderer.dependsOnAttribute(name))\n renderer.invalidate();\n }\n\n fu
nction enqueAttributeChange(element, name, oldValue) {\n // This is not fully
spec compliant. We should use localName (which might\n // have a different c
ase than name) and the namespace (which requires us\n // to get the Attr obje
ct).\n enqueueMutation(element, 'attributes', {\n name: name,\n nam
espace: null,\n oldValue: oldValue\n });\n }\n\n var classListTable =
new WeakMap();\n\n function Element(node) {\n Node.call(this, node);\n }\n
Element.prototype = Object.create(Node.prototype);\n mixin(Element.prototype,
{\n createShadowRoot: function() {\n var newShadowRoot = new wrappers.Sh
adowRoot(this);\n this.impl.polymerShadowRoot_ = newShadowRoot;\n\n va
r renderer = scope.getRendererForHost(this);\n renderer.invalidate();\n\n
return newShadowRoot;\n },\n\n get shadowRoot() {\n return this.i
mpl.polymerShadowRoot_ || null;\n },\n\n // getDestinationInsertionPoints
added in ShadowRenderer.js\n\n setAttribute: function(name, value) {\n v
ar oldValue = this.impl.getAttribute(name);\n this.impl.setAttribute(name,
value);\n enqueAttributeChange(this, name, oldValue);\n invalidateRend
ererBasedOnAttribute(this, name);\n },\n\n removeAttribute: function(name)
{\n var oldValue = this.impl.getAttribute(name);\n this.impl.removeAt
tribute(name);\n enqueAttributeChange(this, name, oldValue);\n invalid
ateRendererBasedOnAttribute(this, name);\n },\n\n matches: function(select
or) {\n return originalMatches.call(this.impl, selector);\n },\n\n ge
t classList() {\n var list = classListTable.get(this);\n if (!list) {\
n classListTable.set(this,\n list = new DOMTokenList(unwrap(th
is).classList, this));\n }\n return list;\n },\n\n get className
() {\n return unwrap(this).className;\n },\n\n set className(v) {\n
this.setAttribute('class', v);\n },\n\n get id() {\n return unwra
p(this).id;\n },\n\n set id(v) {\n this.setAttribute('id', v);\n }
\n });\n\n matchesNames.forEach(function(name) {\n if (name !== 'matches')
{\n Element.prototype[name] = function(selector) {\n return this.mat
ches(selector);\n };\n }\n });\n\n if (OriginalElement.prototype.webki
tCreateShadowRoot) {\n Element.prototype.webkitCreateShadowRoot =\n El
ement.prototype.createShadowRoot;\n }\n\n mixin(Element.prototype, ChildNodeIn
terface);\n mixin(Element.prototype, GetElementsByInterface);\n mixin(Element.
prototype, ParentNodeInterface);\n mixin(Element.prototype, SelectorsInterface)
;\n\n registerWrapper(OriginalElement, Element,\n document.cre
ateElementNS(null, 'x'));\n\n scope.invalidateRendererBasedOnAttribute = invali
dateRendererBasedOnAttribute;\n scope.matchesNames = matchesNames;\n scope.wra
ppers.Element = Element;\n})(window.ShadowDOMPolyfill);\n", | 108 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface =
scope.ChildNodeInterface;\n var GetElementsByInterface = scope.GetElementsByIn
terface;\n var Node = scope.wrappers.Node;\n var DOMTokenList = scope.wrappers
.DOMTokenList;\n var ParentNodeInterface = scope.ParentNodeInterface;\n var Se
lectorsInterface = scope.SelectorsInterface;\n var addWrapNodeListMethod = scop
e.addWrapNodeListMethod;\n var enqueueMutation = scope.enqueueMutation;\n var
mixin = scope.mixin;\n var oneOf = scope.oneOf;\n var registerWrapper = scope.
registerWrapper;\n var unwrap = scope.unwrap;\n var wrappers = scope.wrappers;
\n\n var OriginalElement = window.Element;\n\n var matchesNames = [\n 'matc
hes', // needs to come first.\n 'mozMatchesSelector',\n 'msMatchesSelecto
r',\n 'webkitMatchesSelector',\n ].filter(function(name) {\n return Origi
nalElement.prototype[name];\n });\n\n var matchesName = matchesNames[0];\n\n
var originalMatches = OriginalElement.prototype[matchesName];\n\n function inva
lidateRendererBasedOnAttribute(element, name) {\n // Only invalidate if paren
t node is a shadow host.\n var p = element.parentNode;\n if (!p || !p.shad
owRoot)\n return;\n\n var renderer = scope.getRendererForHost(p);\n i
f (renderer.dependsOnAttribute(name))\n renderer.invalidate();\n }\n\n fu
nction enqueAttributeChange(element, name, oldValue) {\n // This is not fully
spec compliant. We should use localName (which might\n // have a different c
ase than name) and the namespace (which requires us\n // to get the Attr obje
ct).\n enqueueMutation(element, 'attributes', {\n name: name,\n nam
espace: null,\n oldValue: oldValue\n });\n }\n\n var classListTable =
new WeakMap();\n\n function Element(node) {\n Node.call(this, node);\n }\n
Element.prototype = Object.create(Node.prototype);\n mixin(Element.prototype,
{\n createShadowRoot: function() {\n var newShadowRoot = new wrappers.Sh
adowRoot(this);\n this.impl.polymerShadowRoot_ = newShadowRoot;\n\n va
r renderer = scope.getRendererForHost(this);\n renderer.invalidate();\n\n
return newShadowRoot;\n },\n\n get shadowRoot() {\n return this.i
mpl.polymerShadowRoot_ || null;\n },\n\n // getDestinationInsertionPoints
added in ShadowRenderer.js\n\n setAttribute: function(name, value) {\n v
ar oldValue = this.impl.getAttribute(name);\n this.impl.setAttribute(name,
value);\n enqueAttributeChange(this, name, oldValue);\n invalidateRend
ererBasedOnAttribute(this, name);\n },\n\n removeAttribute: function(name)
{\n var oldValue = this.impl.getAttribute(name);\n this.impl.removeAt
tribute(name);\n enqueAttributeChange(this, name, oldValue);\n invalid
ateRendererBasedOnAttribute(this, name);\n },\n\n matches: function(select
or) {\n return originalMatches.call(this.impl, selector);\n },\n\n ge
t classList() {\n var list = classListTable.get(this);\n if (!list) {\
n classListTable.set(this,\n list = new DOMTokenList(unwrap(th
is).classList, this));\n }\n return list;\n },\n\n get className
() {\n return unwrap(this).className;\n },\n\n set className(v) {\n
this.setAttribute('class', v);\n },\n\n get id() {\n return unwra
p(this).id;\n },\n\n set id(v) {\n this.setAttribute('id', v);\n }
\n });\n\n matchesNames.forEach(function(name) {\n if (name !== 'matches')
{\n Element.prototype[name] = function(selector) {\n return this.mat
ches(selector);\n };\n }\n });\n\n if (OriginalElement.prototype.webki
tCreateShadowRoot) {\n Element.prototype.webkitCreateShadowRoot =\n El
ement.prototype.createShadowRoot;\n }\n\n mixin(Element.prototype, ChildNodeIn
terface);\n mixin(Element.prototype, GetElementsByInterface);\n mixin(Element.
prototype, ParentNodeInterface);\n mixin(Element.prototype, SelectorsInterface)
;\n\n registerWrapper(OriginalElement, Element,\n document.cre
ateElementNS(null, 'x'));\n\n scope.invalidateRendererBasedOnAttribute = invali
dateRendererBasedOnAttribute;\n scope.matchesNames = matchesNames;\n scope.wra
ppers.Element = Element;\n})(window.ShadowDOMPolyfill);\n", |
110 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrap
pers.Element;\n var defineGetter = scope.defineGetter;\n var enqueueMutation =
scope.enqueueMutation;\n var mixin = scope.mixin;\n var nodesWereAdded = scop
e.nodesWereAdded;\n var nodesWereRemoved = scope.nodesWereRemoved;\n var regis
terWrapper = scope.registerWrapper;\n var snapshotNodeList = scope.snapshotNode
List;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers =
scope.wrappers;\n\n ///////////////////////////////////////////////////////////
//////////////////\n // innerHTML and outerHTML\n\n // http://www.whatwg.org/s
pecs/web-apps/current-work/multipage/the-end.html#escapingString\n var escapeAt
trRegExp = /[&\\u00A0\"]/g;\n var escapeDataRegExp = /[&\\u00A0<>]/g;\n\n func
tion escapeReplace(c) {\n switch (c) {\n case '&':\n return '&
;';\n case '<':\n return '<';\n case '>':\n return '&
gt;';\n case '\"':\n return '"'\n case '\\u00A0':\n
return ' ';\n }\n }\n\n function escapeAttr(s) {\n return s.replac
e(escapeAttrRegExp, escapeReplace);\n }\n\n function escapeData(s) {\n retu
rn s.replace(escapeDataRegExp, escapeReplace);\n }\n\n function makeSet(arr) {
\n var set = {};\n for (var i = 0; i < arr.length; i++) {\n set[arr[i
]] = true;\n }\n return set;\n }\n\n // http://www.whatwg.org/specs/web-
apps/current-work/#void-elements\n var voidElements = makeSet([\n 'area',\n
'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n
'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n
'source',\n 'track',\n 'wbr'\n ]);\n\n var plaintextParents = makeSet([
\n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'n
oframes',\n 'plaintext',\n 'noscript'\n ]);\n\n function getOuterHTML(no
de, parentNode) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n
var tagName = node.tagName.toLowerCase();\n var s = '<' + tagName
;\n var attrs = node.attributes;\n for (var i = 0, attr; attr = at
trs[i]; i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value)
+ '\"';\n }\n s += '>';\n if (voidElements[tagName])\n
return s;\n\n return s + getInnerHTML(node) + '</' + tagName + '>';\
n\n case Node.TEXT_NODE:\n var data = node.data;\n if (parent
Node && plaintextParents[parentNode.localName])\n return data;\n
return escapeData(data);\n\n case Node.COMMENT_NODE:\n return '<!--
' + node.data + '-->';\n\n default:\n console.error(node);\n
throw new Error('not implemented');\n }\n }\n\n function getInnerHTML(node)
{\n if (node instanceof wrappers.HTMLTemplateElement)\n node = node.con
tent;\n\n var s = '';\n for (var child = node.firstChild; child; child = c
hild.nextSibling) {\n s += getOuterHTML(child, node);\n }\n return s;
\n }\n\n function setInnerHTML(node, value, opt_tagName) {\n var tagName =
opt_tagName || 'div';\n node.textContent = '';\n var tempElement = unwrap(
node.ownerDocument.createElement(tagName));\n tempElement.innerHTML = value;\
n var firstChild;\n while (firstChild = tempElement.firstChild) {\n n
ode.appendChild(wrap(firstChild));\n }\n }\n\n // IE11 does not have MSIE i
n the user agent string.\n var oldIe = /MSIE/.test(navigator.userAgent);\n\n v
ar OriginalHTMLElement = window.HTMLElement;\n var OriginalHTMLTemplateElement
= window.HTMLTemplateElement;\n\n function HTMLElement(node) {\n Element.cal
l(this, node);\n }\n HTMLElement.prototype = Object.create(Element.prototype);
\n mixin(HTMLElement.prototype, {\n get innerHTML() {\n return getInner
HTML(this);\n },\n set innerHTML(value) {\n // IE9 does not handle se
t innerHTML correctly on plaintextParents. It\n // creates element children
. For example\n //\n // scriptElement.innerHTML = '<a>test</a>'\n
//\n // Creates a single HTMLAnchorElement child.\n if (oldIe && pl
aintextParents[this.localName]) {\n this.textContent = value;\n re
turn;\n }\n\n var removedNodes = snapshotNodeList(this.childNodes);\n\
n if (this.invalidateShadowRenderer()) {\n if (this instanceof wrapp
ers.HTMLTemplateElement)\n setInnerHTML(this.content, value);\n
else\n setInnerHTML(this, value, this.tagName);\n\n // If we have
a non native template element we need to handle this\n // manually since se
tting impl.innerHTML would add the html as direct\n // children and not be
moved over to the content fragment.\n } else if (!OriginalHTMLTemplateEleme
nt &&\n this instanceof wrappers.HTMLTemplateElement) {\n
setInnerHTML(this.content, value);\n } else {\n this.impl.innerHTML
= value;\n }\n\n var addedNodes = snapshotNodeList(this.childNodes);\
n\n enqueueMutation(this, 'childList', {\n addedNodes: addedNodes,\n
removedNodes: removedNodes\n });\n\n nodesWereRemoved(removedN
odes);\n nodesWereAdded(addedNodes, this);\n },\n\n get outerHTML() {
\n return getOuterHTML(this, this.parentNode);\n },\n set outerHTML(v
alue) {\n var p = this.parentNode;\n if (p) {\n p.invalidateSha
dowRenderer();\n var df = frag(p, value);\n p.replaceChild(df, thi
s);\n }\n },\n\n insertAdjacentHTML: function(position, text) {\n
var contextElement, refNode;\n switch (String(position).toLowerCase()) {\
n case 'beforebegin':\n contextElement = this.parentNode;\n
refNode = this;\n break;\n case 'afterend':\n cont
extElement = this.parentNode;\n refNode = this.nextSibling;\n
break;\n case 'afterbegin':\n contextElement = this;\n
refNode = this.firstChild;\n break;\n case 'beforeend':\n
contextElement = this;\n refNode = null;\n break;\n
default:\n return;\n }\n\n var df = frag(contextElement, text
);\n contextElement.insertBefore(df, refNode);\n }\n });\n\n function
frag(contextElement, html) {\n // TODO(arv): This does not work with SVG and
other non HTML elements.\n var p = unwrap(contextElement.cloneNode(false));\n
p.innerHTML = html;\n var df = unwrap(document.createDocumentFragment());
\n var c;\n while (c = p.firstChild) {\n df.appendChild(c);\n }\n
return wrap(df);\n }\n\n function getter(name) {\n return function() {\n
scope.renderAllPending();\n return this.impl[name];\n };\n }\n\n
function getterRequiresRendering(name) {\n defineGetter(HTMLElement, name, g
etter(name));\n }\n\n [\n 'clientHeight',\n 'clientLeft',\n 'clientTo
p',\n 'clientWidth',\n 'offsetHeight',\n 'offsetLeft',\n 'offsetTop'
,\n 'offsetWidth',\n 'scrollHeight',\n 'scrollWidth',\n ].forEach(gett
erRequiresRendering);\n\n function getterAndSetterRequiresRendering(name) {\n
Object.defineProperty(HTMLElement.prototype, name, {\n get: getter(name),
\n set: function(v) {\n scope.renderAllPending();\n this.impl
[name] = v;\n },\n configurable: true,\n enumerable: true\n })
;\n }\n\n [\n 'scrollLeft',\n 'scrollTop',\n ].forEach(getterAndSetterR
equiresRendering);\n\n function methodRequiresRendering(name) {\n Object.def
ineProperty(HTMLElement.prototype, name, {\n value: function() {\n s
cope.renderAllPending();\n return this.impl[name].apply(this.impl, argume
nts);\n },\n configurable: true,\n enumerable: true\n });\n }
\n\n [\n 'getBoundingClientRect',\n 'getClientRects',\n 'scrollIntoVie
w'\n ].forEach(methodRequiresRendering);\n\n // HTMLElement is abstract so we
use a subclass that has no members.\n registerWrapper(OriginalHTMLElement, HTML
Element,\n document.createElement('b'));\n\n scope.wrappers.HT
MLElement = HTMLElement;\n\n // TODO: Find a better way to share these two with
WrapperShadowRoot.\n scope.getInnerHTML = getInnerHTML;\n scope.setInnerHTML
= setInnerHTML\n})(window.ShadowDOMPolyfill);\n", | 109 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrap
pers.Element;\n var defineGetter = scope.defineGetter;\n var enqueueMutation =
scope.enqueueMutation;\n var mixin = scope.mixin;\n var nodesWereAdded = scop
e.nodesWereAdded;\n var nodesWereRemoved = scope.nodesWereRemoved;\n var regis
terWrapper = scope.registerWrapper;\n var snapshotNodeList = scope.snapshotNode
List;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers =
scope.wrappers;\n\n ///////////////////////////////////////////////////////////
//////////////////\n // innerHTML and outerHTML\n\n // http://www.whatwg.org/s
pecs/web-apps/current-work/multipage/the-end.html#escapingString\n var escapeAt
trRegExp = /[&\\u00A0\"]/g;\n var escapeDataRegExp = /[&\\u00A0<>]/g;\n\n func
tion escapeReplace(c) {\n switch (c) {\n case '&':\n return '&
;';\n case '<':\n return '<';\n case '>':\n return '&
gt;';\n case '\"':\n return '"'\n case '\\u00A0':\n
return ' ';\n }\n }\n\n function escapeAttr(s) {\n return s.replac
e(escapeAttrRegExp, escapeReplace);\n }\n\n function escapeData(s) {\n retu
rn s.replace(escapeDataRegExp, escapeReplace);\n }\n\n function makeSet(arr) {
\n var set = {};\n for (var i = 0; i < arr.length; i++) {\n set[arr[i
]] = true;\n }\n return set;\n }\n\n // http://www.whatwg.org/specs/web-
apps/current-work/#void-elements\n var voidElements = makeSet([\n 'area',\n
'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n
'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n
'source',\n 'track',\n 'wbr'\n ]);\n\n var plaintextParents = makeSet([
\n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'n
oframes',\n 'plaintext',\n 'noscript'\n ]);\n\n function getOuterHTML(no
de, parentNode) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n
var tagName = node.tagName.toLowerCase();\n var s = '<' + tagName
;\n var attrs = node.attributes;\n for (var i = 0, attr; attr = at
trs[i]; i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value)
+ '\"';\n }\n s += '>';\n if (voidElements[tagName])\n
return s;\n\n return s + getInnerHTML(node) + '</' + tagName + '>';\
n\n case Node.TEXT_NODE:\n var data = node.data;\n if (parent
Node && plaintextParents[parentNode.localName])\n return data;\n
return escapeData(data);\n\n case Node.COMMENT_NODE:\n return '<!--
' + node.data + '-->';\n\n default:\n console.error(node);\n
throw new Error('not implemented');\n }\n }\n\n function getInnerHTML(node)
{\n if (node instanceof wrappers.HTMLTemplateElement)\n node = node.con
tent;\n\n var s = '';\n for (var child = node.firstChild; child; child = c
hild.nextSibling) {\n s += getOuterHTML(child, node);\n }\n return s;
\n }\n\n function setInnerHTML(node, value, opt_tagName) {\n var tagName =
opt_tagName || 'div';\n node.textContent = '';\n var tempElement = unwrap(
node.ownerDocument.createElement(tagName));\n tempElement.innerHTML = value;\
n var firstChild;\n while (firstChild = tempElement.firstChild) {\n n
ode.appendChild(wrap(firstChild));\n }\n }\n\n // IE11 does not have MSIE i
n the user agent string.\n var oldIe = /MSIE/.test(navigator.userAgent);\n\n v
ar OriginalHTMLElement = window.HTMLElement;\n var OriginalHTMLTemplateElement
= window.HTMLTemplateElement;\n\n function HTMLElement(node) {\n Element.cal
l(this, node);\n }\n HTMLElement.prototype = Object.create(Element.prototype);
\n mixin(HTMLElement.prototype, {\n get innerHTML() {\n return getInner
HTML(this);\n },\n set innerHTML(value) {\n // IE9 does not handle se
t innerHTML correctly on plaintextParents. It\n // creates element children
. For example\n //\n // scriptElement.innerHTML = '<a>test</a>'\n
//\n // Creates a single HTMLAnchorElement child.\n if (oldIe && pl
aintextParents[this.localName]) {\n this.textContent = value;\n re
turn;\n }\n\n var removedNodes = snapshotNodeList(this.childNodes);\n\
n if (this.invalidateShadowRenderer()) {\n if (this instanceof wrapp
ers.HTMLTemplateElement)\n setInnerHTML(this.content, value);\n
else\n setInnerHTML(this, value, this.tagName);\n\n // If we have
a non native template element we need to handle this\n // manually since se
tting impl.innerHTML would add the html as direct\n // children and not be
moved over to the content fragment.\n } else if (!OriginalHTMLTemplateEleme
nt &&\n this instanceof wrappers.HTMLTemplateElement) {\n
setInnerHTML(this.content, value);\n } else {\n this.impl.innerHTML
= value;\n }\n\n var addedNodes = snapshotNodeList(this.childNodes);\
n\n enqueueMutation(this, 'childList', {\n addedNodes: addedNodes,\n
removedNodes: removedNodes\n });\n\n nodesWereRemoved(removedN
odes);\n nodesWereAdded(addedNodes, this);\n },\n\n get outerHTML() {
\n return getOuterHTML(this, this.parentNode);\n },\n set outerHTML(v
alue) {\n var p = this.parentNode;\n if (p) {\n p.invalidateSha
dowRenderer();\n var df = frag(p, value);\n p.replaceChild(df, thi
s);\n }\n },\n\n insertAdjacentHTML: function(position, text) {\n
var contextElement, refNode;\n switch (String(position).toLowerCase()) {\
n case 'beforebegin':\n contextElement = this.parentNode;\n
refNode = this;\n break;\n case 'afterend':\n cont
extElement = this.parentNode;\n refNode = this.nextSibling;\n
break;\n case 'afterbegin':\n contextElement = this;\n
refNode = this.firstChild;\n break;\n case 'beforeend':\n
contextElement = this;\n refNode = null;\n break;\n
default:\n return;\n }\n\n var df = frag(contextElement, text
);\n contextElement.insertBefore(df, refNode);\n },\n\n get hidden()
{\n return this.hasAttribute('hidden');\n },\n set hidden(v) {\n
if (v) {\n this.setAttribute('hidden', '');\n } else {\n thi
s.removeAttribute('hidden');\n }\n }\n });\n\n function frag(contextEl
ement, html) {\n // TODO(arv): This does not work with SVG and other non HTML
elements.\n var p = unwrap(contextElement.cloneNode(false));\n p.innerHTM
L = html;\n var df = unwrap(document.createDocumentFragment());\n var c;\n
while (c = p.firstChild) {\n df.appendChild(c);\n }\n return wrap
(df);\n }\n\n function getter(name) {\n return function() {\n scope.re
nderAllPending();\n return this.impl[name];\n };\n }\n\n function gett
erRequiresRendering(name) {\n defineGetter(HTMLElement, name, getter(name));\
n }\n\n [\n 'clientHeight',\n 'clientLeft',\n 'clientTop',\n 'clie
ntWidth',\n 'offsetHeight',\n 'offsetLeft',\n 'offsetTop',\n 'offset
Width',\n 'scrollHeight',\n 'scrollWidth',\n ].forEach(getterRequiresRend
ering);\n\n function getterAndSetterRequiresRendering(name) {\n Object.defin
eProperty(HTMLElement.prototype, name, {\n get: getter(name),\n set: f
unction(v) {\n scope.renderAllPending();\n this.impl[name] = v;\n
},\n configurable: true,\n enumerable: true\n });\n }\n\n [\
n 'scrollLeft',\n 'scrollTop',\n ].forEach(getterAndSetterRequiresRenderi
ng);\n\n function methodRequiresRendering(name) {\n Object.defineProperty(HT
MLElement.prototype, name, {\n value: function() {\n scope.renderAll
Pending();\n return this.impl[name].apply(this.impl, arguments);\n }
,\n configurable: true,\n enumerable: true\n });\n }\n\n [\n '
getBoundingClientRect',\n 'getClientRects',\n 'scrollIntoView'\n ].forEac
h(methodRequiresRendering);\n\n // HTMLElement is abstract so we use a subclass
that has no members.\n registerWrapper(OriginalHTMLElement, HTMLElement,\n
document.createElement('b'));\n\n scope.wrappers.HTMLElement = HT
MLElement;\n\n // TODO: Find a better way to share these two with WrapperShadow
Root.\n scope.getInnerHTML = getInnerHTML;\n scope.setInnerHTML = setInnerHTML
\n})(window.ShadowDOMPolyfill);\n", |
111 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalHTMLCanvasElement =
window.HTMLCanvasElement;\n\n function HTMLCanvasElement(node) {\n HTMLElem
ent.call(this, node);\n }\n HTMLCanvasElement.prototype = Object.create(HTMLEl
ement.prototype);\n\n mixin(HTMLCanvasElement.prototype, {\n getContext: fun
ction() {\n var context = this.impl.getContext.apply(this.impl, arguments);
\n return context && wrap(context);\n }\n });\n\n registerWrapper(Orig
inalHTMLCanvasElement, HTMLCanvasElement,\n document.createElem
ent('canvas'));\n\n scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;\n})(w
indow.ShadowDOMPolyfill);\n", | 110 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalHTMLCanvasElement =
window.HTMLCanvasElement;\n\n function HTMLCanvasElement(node) {\n HTMLElem
ent.call(this, node);\n }\n HTMLCanvasElement.prototype = Object.create(HTMLEl
ement.prototype);\n\n mixin(HTMLCanvasElement.prototype, {\n getContext: fun
ction() {\n var context = this.impl.getContext.apply(this.impl, arguments);
\n return context && wrap(context);\n }\n });\n\n registerWrapper(Orig
inalHTMLCanvasElement, HTMLCanvasElement,\n document.createElem
ent('canvas'));\n\n scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;\n})(w
indow.ShadowDOMPolyfill);\n", |
112 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n\n var OriginalHTMLContentElement = window.HTMLContentElemen
t;\n\n function HTMLContentElement(node) {\n HTMLElement.call(this, node);\n
}\n HTMLContentElement.prototype = Object.create(HTMLElement.prototype);\n m
ixin(HTMLContentElement.prototype, {\n get select() {\n return this.getA
ttribute('select');\n },\n set select(value) {\n this.setAttribute('s
elect', value);\n },\n\n setAttribute: function(n, v) {\n HTMLElement
.prototype.setAttribute.call(this, n, v);\n if (String(n).toLowerCase() ===
'select')\n this.invalidateShadowRenderer(true);\n }\n\n // getDis
tributedNodes is added in ShadowRenderer\n });\n\n if (OriginalHTMLContentElem
ent)\n registerWrapper(OriginalHTMLContentElement, HTMLContentElement);\n\n
scope.wrappers.HTMLContentElement = HTMLContentElement;\n})(window.ShadowDOMPoly
fill);\n", | 111 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n\n var OriginalHTMLContentElement = window.HTMLContentElemen
t;\n\n function HTMLContentElement(node) {\n HTMLElement.call(this, node);\n
}\n HTMLContentElement.prototype = Object.create(HTMLElement.prototype);\n m
ixin(HTMLContentElement.prototype, {\n get select() {\n return this.getA
ttribute('select');\n },\n set select(value) {\n this.setAttribute('s
elect', value);\n },\n\n setAttribute: function(n, v) {\n HTMLElement
.prototype.setAttribute.call(this, n, v);\n if (String(n).toLowerCase() ===
'select')\n this.invalidateShadowRenderer(true);\n }\n\n // getDis
tributedNodes is added in ShadowRenderer\n });\n\n if (OriginalHTMLContentElem
ent)\n registerWrapper(OriginalHTMLContentElement, HTMLContentElement);\n\n
scope.wrappers.HTMLContentElement = HTMLContentElement;\n})(window.ShadowDOMPoly
fill);\n", |
113 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper
= scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection;\
n var unwrap = scope.unwrap;\n\n var OriginalHTMLFormElement = window.HTMLForm
Element;\n\n function HTMLFormElement(node) {\n HTMLElement.call(this, node)
;\n }\n HTMLFormElement.prototype = Object.create(HTMLElement.prototype);\n m
ixin(HTMLFormElement.prototype, {\n get elements() {\n // Note: technica
lly this should be an HTMLFormControlsCollection, but\n // that inherits fr
om HTMLCollection, so should be good enough. Spec:\n // http://www.whatwg.o
rg/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlformcont
rolscollection\n return wrapHTMLCollection(unwrap(this).elements);\n }\n
});\n\n registerWrapper(OriginalHTMLFormElement, HTMLFormElement,\n
document.createElement('form'));\n\n scope.wrappers.HTMLFormElement = H
TMLFormElement;\n})(window.ShadowDOMPolyfill);\n", | 112 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper
= scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection;\
n var unwrap = scope.unwrap;\n\n var OriginalHTMLFormElement = window.HTMLForm
Element;\n\n function HTMLFormElement(node) {\n HTMLElement.call(this, node)
;\n }\n HTMLFormElement.prototype = Object.create(HTMLElement.prototype);\n m
ixin(HTMLFormElement.prototype, {\n get elements() {\n // Note: technica
lly this should be an HTMLFormControlsCollection, but\n // that inherits fr
om HTMLCollection, so should be good enough. Spec:\n // http://www.whatwg.o
rg/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlformcont
rolscollection\n return wrapHTMLCollection(unwrap(this).elements);\n }\n
});\n\n registerWrapper(OriginalHTMLFormElement, HTMLFormElement,\n
document.createElement('form'));\n\n scope.wrappers.HTMLFormElement = H
TMLFormElement;\n})(window.ShadowDOMPolyfill);\n", |
114 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n var unw
rap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTMLImageElem
ent = window.HTMLImageElement;\n\n function HTMLImageElement(node) {\n HTMLE
lement.call(this, node);\n }\n HTMLImageElement.prototype = Object.create(HTML
Element.prototype);\n\n registerWrapper(OriginalHTMLImageElement, HTMLImageElem
ent,\n document.createElement('img'));\n\n function Image(widt
h, height) {\n if (!(this instanceof Image)) {\n throw new TypeError(\n
'DOM object constructor cannot be called as a function.');\n }\n\n
var node = unwrap(document.createElement('img'));\n HTMLElement.call(this,
node);\n rewrap(node, this);\n\n if (width !== undefined)\n node.widt
h = width;\n if (height !== undefined)\n node.height = height;\n }\n\n
Image.prototype = HTMLImageElement.prototype;\n\n scope.wrappers.HTMLImageElem
ent = HTMLImageElement;\n scope.wrappers.Image = Image;\n})(window.ShadowDOMPol
yfill);\n", | 113 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n var unw
rap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTMLImageElem
ent = window.HTMLImageElement;\n\n function HTMLImageElement(node) {\n HTMLE
lement.call(this, node);\n }\n HTMLImageElement.prototype = Object.create(HTML
Element.prototype);\n\n registerWrapper(OriginalHTMLImageElement, HTMLImageElem
ent,\n document.createElement('img'));\n\n function Image(widt
h, height) {\n if (!(this instanceof Image)) {\n throw new TypeError(\n
'DOM object constructor cannot be called as a function.');\n }\n\n
var node = unwrap(document.createElement('img'));\n HTMLElement.call(this,
node);\n rewrap(node, this);\n\n if (width !== undefined)\n node.widt
h = width;\n if (height !== undefined)\n node.height = height;\n }\n\n
Image.prototype = HTMLImageElement.prototype;\n\n scope.wrappers.HTMLImageElem
ent = HTMLImageElement;\n scope.wrappers.Image = Image;\n})(window.ShadowDOMPol
yfill);\n", |
115 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var NodeList = scope.wrappe
rs.NodeList;\n var registerWrapper = scope.registerWrapper;\n\n var OriginalHT
MLShadowElement = window.HTMLShadowElement;\n\n function HTMLShadowElement(node
) {\n HTMLElement.call(this, node);\n }\n HTMLShadowElement.prototype = Obj
ect.create(HTMLElement.prototype);\n\n // getDistributedNodes is added in Shado
wRenderer\n\n if (OriginalHTMLShadowElement)\n registerWrapper(OriginalHTMLS
hadowElement, HTMLShadowElement);\n\n scope.wrappers.HTMLShadowElement = HTMLSh
adowElement;\n})(window.ShadowDOMPolyfill);\n", | 114 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var NodeList = scope.wrappe
rs.NodeList;\n var registerWrapper = scope.registerWrapper;\n\n var OriginalHT
MLShadowElement = window.HTMLShadowElement;\n\n function HTMLShadowElement(node
) {\n HTMLElement.call(this, node);\n }\n HTMLShadowElement.prototype = Obj
ect.create(HTMLElement.prototype);\n\n // getDistributedNodes is added in Shado
wRenderer\n\n if (OriginalHTMLShadowElement)\n registerWrapper(OriginalHTMLS
hadowElement, HTMLShadowElement);\n\n scope.wrappers.HTMLShadowElement = HTMLSh
adowElement;\n})(window.ShadowDOMPolyfill);\n", |
116 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v
ar contentTable = new WeakMap();\n var templateContentsOwnerTable = new WeakMap
();\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/inde
x.html#dfn-template-contents-owner\n function getTemplateContentsOwner(doc) {\n
if (!doc.defaultView)\n return doc;\n var d = templateContentsOwnerT
able.get(doc);\n if (!d) {\n // TODO(arv): This should either be a Docum
ent or HTMLDocument depending\n // on doc.\n d = doc.implementation.cr
eateHTMLDocument('');\n while (d.lastChild) {\n d.removeChild(d.last
Child);\n }\n templateContentsOwnerTable.set(doc, d);\n }\n retu
rn d;\n }\n\n function extractContent(templateElement) {\n // templateEleme
nt is not a wrapper here.\n var doc = getTemplateContentsOwner(templateElemen
t.ownerDocument);\n var df = unwrap(doc.createDocumentFragment());\n var c
hild;\n while (child = templateElement.firstChild) {\n df.appendChild(ch
ild);\n }\n return df;\n }\n\n var OriginalHTMLTemplateElement = window.
HTMLTemplateElement;\n\n function HTMLTemplateElement(node) {\n HTMLElement.
call(this, node);\n if (!OriginalHTMLTemplateElement) {\n var content =
extractContent(node);\n contentTable.set(this, wrap(content));\n }\n }\
n HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);\n\n mi
xin(HTMLTemplateElement.prototype, {\n get content() {\n if (OriginalHTM
LTemplateElement)\n return wrap(this.impl.content);\n return content
Table.get(this);\n },\n\n // TODO(arv): cloneNode needs to clone content.\
n\n });\n\n if (OriginalHTMLTemplateElement)\n registerWrapper(OriginalHTML
TemplateElement, HTMLTemplateElement);\n\n scope.wrappers.HTMLTemplateElement =
HTMLTemplateElement;\n})(window.ShadowDOMPolyfill);\n", | 115 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v
ar contentTable = new WeakMap();\n var templateContentsOwnerTable = new WeakMap
();\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/inde
x.html#dfn-template-contents-owner\n function getTemplateContentsOwner(doc) {\n
if (!doc.defaultView)\n return doc;\n var d = templateContentsOwnerT
able.get(doc);\n if (!d) {\n // TODO(arv): This should either be a Docum
ent or HTMLDocument depending\n // on doc.\n d = doc.implementation.cr
eateHTMLDocument('');\n while (d.lastChild) {\n d.removeChild(d.last
Child);\n }\n templateContentsOwnerTable.set(doc, d);\n }\n retu
rn d;\n }\n\n function extractContent(templateElement) {\n // templateEleme
nt is not a wrapper here.\n var doc = getTemplateContentsOwner(templateElemen
t.ownerDocument);\n var df = unwrap(doc.createDocumentFragment());\n var c
hild;\n while (child = templateElement.firstChild) {\n df.appendChild(ch
ild);\n }\n return df;\n }\n\n var OriginalHTMLTemplateElement = window.
HTMLTemplateElement;\n\n function HTMLTemplateElement(node) {\n HTMLElement.
call(this, node);\n if (!OriginalHTMLTemplateElement) {\n var content =
extractContent(node);\n contentTable.set(this, wrap(content));\n }\n }\
n HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);\n\n mi
xin(HTMLTemplateElement.prototype, {\n get content() {\n if (OriginalHTM
LTemplateElement)\n return wrap(this.impl.content);\n return content
Table.get(this);\n },\n\n // TODO(arv): cloneNode needs to clone content.\
n\n });\n\n if (OriginalHTMLTemplateElement)\n registerWrapper(OriginalHTML
TemplateElement, HTMLTemplateElement);\n\n scope.wrappers.HTMLTemplateElement =
HTMLTemplateElement;\n})(window.ShadowDOMPolyfill);\n", |
117 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n\n var O
riginalHTMLMediaElement = window.HTMLMediaElement;\n\n function HTMLMediaElemen
t(node) {\n HTMLElement.call(this, node);\n }\n HTMLMediaElement.prototype
= Object.create(HTMLElement.prototype);\n\n registerWrapper(OriginalHTMLMediaEl
ement, HTMLMediaElement,\n document.createElement('audio'));\n\
n scope.wrappers.HTMLMediaElement = HTMLMediaElement;\n})(window.ShadowDOMPolyf
ill);\n", | 116 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n\n var O
riginalHTMLMediaElement = window.HTMLMediaElement;\n\n function HTMLMediaElemen
t(node) {\n HTMLElement.call(this, node);\n }\n HTMLMediaElement.prototype
= Object.create(HTMLElement.prototype);\n\n registerWrapper(OriginalHTMLMediaEl
ement, HTMLMediaElement,\n document.createElement('audio'));\n\
n scope.wrappers.HTMLMediaElement = HTMLMediaElement;\n})(window.ShadowDOMPolyf
ill);\n", |
118 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLMediaElement = s
cope.wrappers.HTMLMediaElement;\n var registerWrapper = scope.registerWrapper;\
n var unwrap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTM
LAudioElement = window.HTMLAudioElement;\n\n function HTMLAudioElement(node) {\
n HTMLMediaElement.call(this, node);\n }\n HTMLAudioElement.prototype = Obj
ect.create(HTMLMediaElement.prototype);\n\n registerWrapper(OriginalHTMLAudioEl
ement, HTMLAudioElement,\n document.createElement('audio'));\n\
n function Audio(src) {\n if (!(this instanceof Audio)) {\n throw new T
ypeError(\n 'DOM object constructor cannot be called as a function.');\
n }\n\n var node = unwrap(document.createElement('audio'));\n HTMLMedia
Element.call(this, node);\n rewrap(node, this);\n\n node.setAttribute('pre
load', 'auto');\n if (src !== undefined)\n node.setAttribute('src', src)
;\n }\n\n Audio.prototype = HTMLAudioElement.prototype;\n\n scope.wrappers.HT
MLAudioElement = HTMLAudioElement;\n scope.wrappers.Audio = Audio;\n})(window.S
hadowDOMPolyfill);\n", | 117 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLMediaElement = s
cope.wrappers.HTMLMediaElement;\n var registerWrapper = scope.registerWrapper;\
n var unwrap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTM
LAudioElement = window.HTMLAudioElement;\n\n function HTMLAudioElement(node) {\
n HTMLMediaElement.call(this, node);\n }\n HTMLAudioElement.prototype = Obj
ect.create(HTMLMediaElement.prototype);\n\n registerWrapper(OriginalHTMLAudioEl
ement, HTMLAudioElement,\n document.createElement('audio'));\n\
n function Audio(src) {\n if (!(this instanceof Audio)) {\n throw new T
ypeError(\n 'DOM object constructor cannot be called as a function.');\
n }\n\n var node = unwrap(document.createElement('audio'));\n HTMLMedia
Element.call(this, node);\n rewrap(node, this);\n\n node.setAttribute('pre
load', 'auto');\n if (src !== undefined)\n node.setAttribute('src', src)
;\n }\n\n Audio.prototype = HTMLAudioElement.prototype;\n\n scope.wrappers.HT
MLAudioElement = HTMLAudioElement;\n scope.wrappers.Audio = Audio;\n})(window.S
hadowDOMPolyfill);\n", |
119 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var rewrap = scope.rewrap;\n var unwrap = scope.unwrap;\n
var wrap = scope.wrap;\n\n var OriginalHTMLOptionElement = window.HTMLOptionEl
ement;\n\n function trimText(s) {\n return s.replace(/\\s+/g, ' ').trim();\n
}\n\n function HTMLOptionElement(node) {\n HTMLElement.call(this, node);\n
}\n HTMLOptionElement.prototype = Object.create(HTMLElement.prototype);\n mi
xin(HTMLOptionElement.prototype, {\n get text() {\n return trimText(this
.textContent);\n },\n set text(value) {\n this.textContent = trimText
(String(value));\n },\n get form() {\n return wrap(unwrap(this).form)
;\n }\n });\n\n registerWrapper(OriginalHTMLOptionElement, HTMLOptionElemen
t,\n document.createElement('option'));\n\n function Option(te
xt, value, defaultSelected, selected) {\n if (!(this instanceof Option)) {\n
throw new TypeError(\n 'DOM object constructor cannot be called as
a function.');\n }\n\n var node = unwrap(document.createElement('option')
);\n HTMLElement.call(this, node);\n rewrap(node, this);\n\n if (text !
== undefined)\n node.text = text;\n if (value !== undefined)\n node
.setAttribute('value', value);\n if (defaultSelected === true)\n node.se
tAttribute('selected', '');\n node.selected = selected === true;\n }\n\n Op
tion.prototype = HTMLOptionElement.prototype;\n\n scope.wrappers.HTMLOptionElem
ent = HTMLOptionElement;\n scope.wrappers.Option = Option;\n})(window.ShadowDOM
Polyfill);\n", | 118 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var rewrap = scope.rewrap;\n var unwrap = scope.unwrap;\n
var wrap = scope.wrap;\n\n var OriginalHTMLOptionElement = window.HTMLOptionEl
ement;\n\n function trimText(s) {\n return s.replace(/\\s+/g, ' ').trim();\n
}\n\n function HTMLOptionElement(node) {\n HTMLElement.call(this, node);\n
}\n HTMLOptionElement.prototype = Object.create(HTMLElement.prototype);\n mi
xin(HTMLOptionElement.prototype, {\n get text() {\n return trimText(this
.textContent);\n },\n set text(value) {\n this.textContent = trimText
(String(value));\n },\n get form() {\n return wrap(unwrap(this).form)
;\n }\n });\n\n registerWrapper(OriginalHTMLOptionElement, HTMLOptionElemen
t,\n document.createElement('option'));\n\n function Option(te
xt, value, defaultSelected, selected) {\n if (!(this instanceof Option)) {\n
throw new TypeError(\n 'DOM object constructor cannot be called as
a function.');\n }\n\n var node = unwrap(document.createElement('option')
);\n HTMLElement.call(this, node);\n rewrap(node, this);\n\n if (text !
== undefined)\n node.text = text;\n if (value !== undefined)\n node
.setAttribute('value', value);\n if (defaultSelected === true)\n node.se
tAttribute('selected', '');\n node.selected = selected === true;\n }\n\n Op
tion.prototype = HTMLOptionElement.prototype;\n\n scope.wrappers.HTMLOptionElem
ent = HTMLOptionElement;\n scope.wrappers.Option = Option;\n})(window.ShadowDOM
Polyfill);\n", |
120 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v
ar OriginalHTMLSelectElement = window.HTMLSelectElement;\n\n function HTMLSelec
tElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLSelectElement.pr
ototype = Object.create(HTMLElement.prototype);\n mixin(HTMLSelectElement.proto
type, {\n add: function(element, before) {\n if (typeof before === 'obje
ct') // also includes null\n before = unwrap(before);\n unwrap(this
).add(unwrap(element), before);\n },\n\n remove: function(indexOrNode) {\n
// Spec only allows index but implementations allow index or node.\n
// remove() is also allowed which is same as remove(undefined)\n if (indexO
rNode === undefined) {\n HTMLElement.prototype.remove.call(this);\n
return;\n }\n\n if (typeof indexOrNode === 'object')\n indexO
rNode = unwrap(indexOrNode);\n\n unwrap(this).remove(indexOrNode);\n },\
n\n get form() {\n return wrap(unwrap(this).form);\n }\n });\n\n re
gisterWrapper(OriginalHTMLSelectElement, HTMLSelectElement,\n d
ocument.createElement('select'));\n\n scope.wrappers.HTMLSelectElement = HTMLSe
lectElement;\n})(window.ShadowDOMPolyfill);\n", | 119 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v
ar OriginalHTMLSelectElement = window.HTMLSelectElement;\n\n function HTMLSelec
tElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLSelectElement.pr
ototype = Object.create(HTMLElement.prototype);\n mixin(HTMLSelectElement.proto
type, {\n add: function(element, before) {\n if (typeof before === 'obje
ct') // also includes null\n before = unwrap(before);\n unwrap(this
).add(unwrap(element), before);\n },\n\n remove: function(indexOrNode) {\n
// Spec only allows index but implementations allow index or node.\n
// remove() is also allowed which is same as remove(undefined)\n if (indexO
rNode === undefined) {\n HTMLElement.prototype.remove.call(this);\n
return;\n }\n\n if (typeof indexOrNode === 'object')\n indexO
rNode = unwrap(indexOrNode);\n\n unwrap(this).remove(indexOrNode);\n },\
n\n get form() {\n return wrap(unwrap(this).form);\n }\n });\n\n re
gisterWrapper(OriginalHTMLSelectElement, HTMLSelectElement,\n d
ocument.createElement('select'));\n\n scope.wrappers.HTMLSelectElement = HTMLSe
lectElement;\n})(window.ShadowDOMPolyfill);\n", |
121 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe
r = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wra
p;\n var wrapHTMLCollection = scope.wrapHTMLCollection;\n\n var OriginalHTMLTa
bleElement = window.HTMLTableElement;\n\n function HTMLTableElement(node) {\n
HTMLElement.call(this, node);\n }\n HTMLTableElement.prototype = Object.crea
te(HTMLElement.prototype);\n mixin(HTMLTableElement.prototype, {\n get capti
on() {\n return wrap(unwrap(this).caption);\n },\n createCaption: fun
ction() {\n return wrap(unwrap(this).createCaption());\n },\n\n get t
Head() {\n return wrap(unwrap(this).tHead);\n },\n createTHead: funct
ion() {\n return wrap(unwrap(this).createTHead());\n },\n\n createTFo
ot: function() {\n return wrap(unwrap(this).createTFoot());\n },\n ge
t tFoot() {\n return wrap(unwrap(this).tFoot);\n },\n\n get tBodies()
{\n return wrapHTMLCollection(unwrap(this).tBodies);\n },\n createTB
ody: function() {\n return wrap(unwrap(this).createTBody());\n },\n\n
get rows() {\n return wrapHTMLCollection(unwrap(this).rows);\n },\n
insertRow: function(index) {\n return wrap(unwrap(this).insertRow(index));\
n }\n });\n\n registerWrapper(OriginalHTMLTableElement, HTMLTableElement,\n
document.createElement('table'));\n\n scope.wrappers.HTMLTabl
eElement = HTMLTableElement;\n})(window.ShadowDOMPolyfill);\n", | 120 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe
r = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wra
p;\n var wrapHTMLCollection = scope.wrapHTMLCollection;\n\n var OriginalHTMLTa
bleElement = window.HTMLTableElement;\n\n function HTMLTableElement(node) {\n
HTMLElement.call(this, node);\n }\n HTMLTableElement.prototype = Object.crea
te(HTMLElement.prototype);\n mixin(HTMLTableElement.prototype, {\n get capti
on() {\n return wrap(unwrap(this).caption);\n },\n createCaption: fun
ction() {\n return wrap(unwrap(this).createCaption());\n },\n\n get t
Head() {\n return wrap(unwrap(this).tHead);\n },\n createTHead: funct
ion() {\n return wrap(unwrap(this).createTHead());\n },\n\n createTFo
ot: function() {\n return wrap(unwrap(this).createTFoot());\n },\n ge
t tFoot() {\n return wrap(unwrap(this).tFoot);\n },\n\n get tBodies()
{\n return wrapHTMLCollection(unwrap(this).tBodies);\n },\n createTB
ody: function() {\n return wrap(unwrap(this).createTBody());\n },\n\n
get rows() {\n return wrapHTMLCollection(unwrap(this).rows);\n },\n
insertRow: function(index) {\n return wrap(unwrap(this).insertRow(index));\
n }\n });\n\n registerWrapper(OriginalHTMLTableElement, HTMLTableElement,\n
document.createElement('table'));\n\n scope.wrappers.HTMLTabl
eElement = HTMLTableElement;\n})(window.ShadowDOMPolyfill);\n", |
122 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe
r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection;
\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa
bleSectionElement = window.HTMLTableSectionElement;\n\n function HTMLTableSecti
onElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLTableSectionEle
ment.prototype = Object.create(HTMLElement.prototype);\n mixin(HTMLTableSection
Element.prototype, {\n get rows() {\n return wrapHTMLCollection(unwrap(t
his).rows);\n },\n insertRow: function(index) {\n return wrap(unwrap(
this).insertRow(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableSec
tionElement, HTMLTableSectionElement,\n document.createElement(
'thead'));\n\n scope.wrappers.HTMLTableSectionElement = HTMLTableSectionElement
;\n})(window.ShadowDOMPolyfill);\n", | 121 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe
r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection;
\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa
bleSectionElement = window.HTMLTableSectionElement;\n\n function HTMLTableSecti
onElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLTableSectionEle
ment.prototype = Object.create(HTMLElement.prototype);\n mixin(HTMLTableSection
Element.prototype, {\n get rows() {\n return wrapHTMLCollection(unwrap(t
his).rows);\n },\n insertRow: function(index) {\n return wrap(unwrap(
this).insertRow(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableSec
tionElement, HTMLTableSectionElement,\n document.createElement(
'thead'));\n\n scope.wrappers.HTMLTableSectionElement = HTMLTableSectionElement
;\n})(window.ShadowDOMPolyfill);\n", |
123 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe
r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection;
\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa
bleRowElement = window.HTMLTableRowElement;\n\n function HTMLTableRowElement(no
de) {\n HTMLElement.call(this, node);\n }\n HTMLTableRowElement.prototype =
Object.create(HTMLElement.prototype);\n mixin(HTMLTableRowElement.prototype, {
\n get cells() {\n return wrapHTMLCollection(unwrap(this).cells);\n }
,\n\n insertCell: function(index) {\n return wrap(unwrap(this).insertCel
l(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableRowElement, HTMLT
ableRowElement,\n document.createElement('tr'));\n\n scope.wra
ppers.HTMLTableRowElement = HTMLTableRowElement;\n})(window.ShadowDOMPolyfill);\
n", | 122 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement
= scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe
r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection;
\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa
bleRowElement = window.HTMLTableRowElement;\n\n function HTMLTableRowElement(no
de) {\n HTMLElement.call(this, node);\n }\n HTMLTableRowElement.prototype =
Object.create(HTMLElement.prototype);\n mixin(HTMLTableRowElement.prototype, {
\n get cells() {\n return wrapHTMLCollection(unwrap(this).cells);\n }
,\n\n insertCell: function(index) {\n return wrap(unwrap(this).insertCel
l(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableRowElement, HTMLT
ableRowElement,\n document.createElement('tr'));\n\n scope.wra
ppers.HTMLTableRowElement = HTMLTableRowElement;\n})(window.ShadowDOMPolyfill);\
n", |
124 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLContentElement =
scope.wrappers.HTMLContentElement;\n var HTMLElement = scope.wrappers.HTMLElem
ent;\n var HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var HTMLTem
plateElement = scope.wrappers.HTMLTemplateElement;\n var mixin = scope.mixin;\n
var registerWrapper = scope.registerWrapper;\n\n var OriginalHTMLUnknownEleme
nt = window.HTMLUnknownElement;\n\n function HTMLUnknownElement(node) {\n sw
itch (node.localName) {\n case 'content':\n return new HTMLContentEl
ement(node);\n case 'shadow':\n return new HTMLShadowElement(node);\
n case 'template':\n return new HTMLTemplateElement(node);\n }\n
HTMLElement.call(this, node);\n }\n HTMLUnknownElement.prototype = Object.c
reate(HTMLElement.prototype);\n registerWrapper(OriginalHTMLUnknownElement, HTM
LUnknownElement);\n scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;\n})
(window.ShadowDOMPolyfill);\n", | 123 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLContentElement =
scope.wrappers.HTMLContentElement;\n var HTMLElement = scope.wrappers.HTMLElem
ent;\n var HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var HTMLTem
plateElement = scope.wrappers.HTMLTemplateElement;\n var mixin = scope.mixin;\n
var registerWrapper = scope.registerWrapper;\n\n var OriginalHTMLUnknownEleme
nt = window.HTMLUnknownElement;\n\n function HTMLUnknownElement(node) {\n sw
itch (node.localName) {\n case 'content':\n return new HTMLContentEl
ement(node);\n case 'shadow':\n return new HTMLShadowElement(node);\
n case 'template':\n return new HTMLTemplateElement(node);\n }\n
HTMLElement.call(this, node);\n }\n HTMLUnknownElement.prototype = Object.c
reate(HTMLElement.prototype);\n registerWrapper(OriginalHTMLUnknownElement, HTM
LUnknownElement);\n scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;\n})
(window.ShadowDOMPolyfill);\n", |
125 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrap
pers.Element;\n var HTMLElement = scope.wrappers.HTMLElement;\n var registerOb
ject = scope.registerObject;\n\n var SVG_NS = 'http://www.w3.org/2000/svg';\n
var svgTitleElement = document.createElementNS(SVG_NS, 'title');\n var SVGTitle
Element = registerObject(svgTitleElement);\n var SVGElement = Object.getPrototy
peOf(SVGTitleElement.prototype).constructor;\n\n // IE11 does not have classLis
t for SVG elements. The spec says that classList\n // is an accessor on Element
, but IE11 puts classList on HTMLElement, leaving\n // SVGElement without a cla
ssList property. We therefore move the accessor for\n // IE11.\n if (!('classL
ist' in svgTitleElement)) {\n var descr = Object.getOwnPropertyDescriptor(Ele
ment.prototype, 'classList');\n Object.defineProperty(HTMLElement.prototype,
'classList', descr);\n delete Element.prototype.classList;\n }\n\n scope.wr
appers.SVGElement = SVGElement;\n})(window.ShadowDOMPolyfill);\n", | 124 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrap
pers.Element;\n var HTMLElement = scope.wrappers.HTMLElement;\n var registerOb
ject = scope.registerObject;\n\n var SVG_NS = 'http://www.w3.org/2000/svg';\n
var svgTitleElement = document.createElementNS(SVG_NS, 'title');\n var SVGTitle
Element = registerObject(svgTitleElement);\n var SVGElement = Object.getPrototy
peOf(SVGTitleElement.prototype).constructor;\n\n // IE11 does not have classLis
t for SVG elements. The spec says that classList\n // is an accessor on Element
, but IE11 puts classList on HTMLElement, leaving\n // SVGElement without a cla
ssList property. We therefore move the accessor for\n // IE11.\n if (!('classL
ist' in svgTitleElement)) {\n var descr = Object.getOwnPropertyDescriptor(Ele
ment.prototype, 'classList');\n Object.defineProperty(HTMLElement.prototype,
'classList', descr);\n delete Element.prototype.classList;\n }\n\n scope.wr
appers.SVGElement = SVGElement;\n})(window.ShadowDOMPolyfill);\n", |
126 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin;
\n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n
var wrap = scope.wrap;\n\n var OriginalSVGUseElement = window.SVGUseElement;\
n\n // IE uses SVGElement as parent interface, SVG2 (Blink & Gecko) uses\n //
SVGGraphicsElement. Use the <g> element to get the right prototype.\n\n var SVG
_NS = 'http://www.w3.org/2000/svg';\n var gWrapper = wrap(document.createElemen
tNS(SVG_NS, 'g'));\n var useElement = document.createElementNS(SVG_NS, 'use');\
n var SVGGElement = gWrapper.constructor;\n var parentInterfacePrototype = Obj
ect.getPrototypeOf(SVGGElement.prototype);\n var parentInterface = parentInterf
acePrototype.constructor;\n\n function SVGUseElement(impl) {\n parentInterfa
ce.call(this, impl);\n }\n\n SVGUseElement.prototype = Object.create(parentInt
erfacePrototype);\n\n // Firefox does not expose instanceRoot.\n if ('instance
Root' in useElement) {\n mixin(SVGUseElement.prototype, {\n get instance
Root() {\n return wrap(unwrap(this).instanceRoot);\n },\n get a
nimatedInstanceRoot() {\n return wrap(unwrap(this).animatedInstanceRoot);
\n },\n });\n }\n\n registerWrapper(OriginalSVGUseElement, SVGUseEleme
nt, useElement);\n\n scope.wrappers.SVGUseElement = SVGUseElement;\n})(window.S
hadowDOMPolyfill);\n", | 125 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin;
\n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n
var wrap = scope.wrap;\n\n var OriginalSVGUseElement = window.SVGUseElement;\
n\n // IE uses SVGElement as parent interface, SVG2 (Blink & Gecko) uses\n //
SVGGraphicsElement. Use the <g> element to get the right prototype.\n\n var SVG
_NS = 'http://www.w3.org/2000/svg';\n var gWrapper = wrap(document.createElemen
tNS(SVG_NS, 'g'));\n var useElement = document.createElementNS(SVG_NS, 'use');\
n var SVGGElement = gWrapper.constructor;\n var parentInterfacePrototype = Obj
ect.getPrototypeOf(SVGGElement.prototype);\n var parentInterface = parentInterf
acePrototype.constructor;\n\n function SVGUseElement(impl) {\n parentInterfa
ce.call(this, impl);\n }\n\n SVGUseElement.prototype = Object.create(parentInt
erfacePrototype);\n\n // Firefox does not expose instanceRoot.\n if ('instance
Root' in useElement) {\n mixin(SVGUseElement.prototype, {\n get instance
Root() {\n return wrap(unwrap(this).instanceRoot);\n },\n get a
nimatedInstanceRoot() {\n return wrap(unwrap(this).animatedInstanceRoot);
\n },\n });\n }\n\n registerWrapper(OriginalSVGUseElement, SVGUseEleme
nt, useElement);\n\n scope.wrappers.SVGUseElement = SVGUseElement;\n})(window.S
hadowDOMPolyfill);\n", |
127 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope.
wrappers.EventTarget;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalSVGElementInstance
= window.SVGElementInstance;\n if (!OriginalSVGElementInstance)\n return;\n\
n function SVGElementInstance(impl) {\n EventTarget.call(this, impl);\n }\n
\n SVGElementInstance.prototype = Object.create(EventTarget.prototype);\n mixi
n(SVGElementInstance.prototype, {\n /** @type {SVGElement} */\n get corres
pondingElement() {\n return wrap(this.impl.correspondingElement);\n },\n
\n /** @type {SVGUseElement} */\n get correspondingUseElement() {\n r
eturn wrap(this.impl.correspondingUseElement);\n },\n\n /** @type {SVGElem
entInstance} */\n get parentNode() {\n return wrap(this.impl.parentNode)
;\n },\n\n /** @type {SVGElementInstanceList} */\n get childNodes() {\n
throw new Error('Not implemented');\n },\n\n /** @type {SVGElementIn
stance} */\n get firstChild() {\n return wrap(this.impl.firstChild);\n
},\n\n /** @type {SVGElementInstance} */\n get lastChild() {\n retu
rn wrap(this.impl.lastChild);\n },\n\n /** @type {SVGElementInstance} */\n
get previousSibling() {\n return wrap(this.impl.previousSibling);\n
},\n\n /** @type {SVGElementInstance} */\n get nextSibling() {\n retu
rn wrap(this.impl.nextSibling);\n }\n });\n\n registerWrapper(OriginalSVGEl
ementInstance, SVGElementInstance);\n\n scope.wrappers.SVGElementInstance = SVG
ElementInstance;\n})(window.ShadowDOMPolyfill);\n", | 126 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope.
wrappers.EventTarget;\n var mixin = scope.mixin;\n var registerWrapper = scope
.registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalSVGElementInstance
= window.SVGElementInstance;\n if (!OriginalSVGElementInstance)\n return;\n\
n function SVGElementInstance(impl) {\n EventTarget.call(this, impl);\n }\n
\n SVGElementInstance.prototype = Object.create(EventTarget.prototype);\n mixi
n(SVGElementInstance.prototype, {\n /** @type {SVGElement} */\n get corres
pondingElement() {\n return wrap(this.impl.correspondingElement);\n },\n
\n /** @type {SVGUseElement} */\n get correspondingUseElement() {\n r
eturn wrap(this.impl.correspondingUseElement);\n },\n\n /** @type {SVGElem
entInstance} */\n get parentNode() {\n return wrap(this.impl.parentNode)
;\n },\n\n /** @type {SVGElementInstanceList} */\n get childNodes() {\n
throw new Error('Not implemented');\n },\n\n /** @type {SVGElementIn
stance} */\n get firstChild() {\n return wrap(this.impl.firstChild);\n
},\n\n /** @type {SVGElementInstance} */\n get lastChild() {\n retu
rn wrap(this.impl.lastChild);\n },\n\n /** @type {SVGElementInstance} */\n
get previousSibling() {\n return wrap(this.impl.previousSibling);\n
},\n\n /** @type {SVGElementInstance} */\n get nextSibling() {\n retu
rn wrap(this.impl.nextSibling);\n }\n });\n\n registerWrapper(OriginalSVGEl
ementInstance, SVGElementInstance);\n\n scope.wrappers.SVGElementInstance = SVG
ElementInstance;\n})(window.ShadowDOMPolyfill);\n", |
128 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin;
\n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n
var unwrapIfNeeded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var
OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;\n\n functio
n CanvasRenderingContext2D(impl) {\n this.impl = impl;\n }\n\n mixin(Canvas
RenderingContext2D.prototype, {\n get canvas() {\n return wrap(this.impl
.canvas);\n },\n\n drawImage: function() {\n arguments[0] = unwrapIfN
eeded(arguments[0]);\n this.impl.drawImage.apply(this.impl, arguments);\n
},\n\n createPattern: function() {\n arguments[0] = unwrap(arguments[0
]);\n return this.impl.createPattern.apply(this.impl, arguments);\n }\n
});\n\n registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingConte
xt2D,\n document.createElement('canvas').getContext('2d'));\n\n
scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;\n})(window
.ShadowDOMPolyfill);\n", | 127 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin;
\n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n
var unwrapIfNeeded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var
OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;\n\n functio
n CanvasRenderingContext2D(impl) {\n this.impl = impl;\n }\n\n mixin(Canvas
RenderingContext2D.prototype, {\n get canvas() {\n return wrap(this.impl
.canvas);\n },\n\n drawImage: function() {\n arguments[0] = unwrapIfN
eeded(arguments[0]);\n this.impl.drawImage.apply(this.impl, arguments);\n
},\n\n createPattern: function() {\n arguments[0] = unwrap(arguments[0
]);\n return this.impl.createPattern.apply(this.impl, arguments);\n }\n
});\n\n registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingConte
xt2D,\n document.createElement('canvas').getContext('2d'));\n\n
scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;\n})(window
.ShadowDOMPolyfill);\n", |
129 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin;
\n var registerWrapper = scope.registerWrapper;\n var unwrapIfNeeded = scope.u
nwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWebGLRenderingContext
= window.WebGLRenderingContext;\n\n // IE10 does not have WebGL.\n if (!Origin
alWebGLRenderingContext)\n return;\n\n function WebGLRenderingContext(impl)
{\n this.impl = impl;\n }\n\n mixin(WebGLRenderingContext.prototype, {\n
get canvas() {\n return wrap(this.impl.canvas);\n },\n\n texImage2D:
function() {\n arguments[5] = unwrapIfNeeded(arguments[5]);\n this.im
pl.texImage2D.apply(this.impl, arguments);\n },\n\n texSubImage2D: functio
n() {\n arguments[6] = unwrapIfNeeded(arguments[6]);\n this.impl.texSu
bImage2D.apply(this.impl, arguments);\n }\n });\n\n // Blink/WebKit has bro
ken DOM bindings. Usually we would create an instance\n // of the object and pa
ss it into registerWrapper as a \"blueprint\" but\n // creating WebGL contexts
is expensive and might fail so we use a dummy\n // object with dummy instance p
roperties for these broken browsers.\n var instanceProperties = /WebKit/.test(n
avigator.userAgent) ?\n {drawingBufferHeight: null, drawingBufferWidth: nul
l} : {};\n\n registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingConte
xt,\n instanceProperties);\n\n scope.wrappers.WebGLRenderingContext = WebG
LRenderingContext;\n})(window.ShadowDOMPolyfill);\n", | 128 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin;
\n var registerWrapper = scope.registerWrapper;\n var unwrapIfNeeded = scope.u
nwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWebGLRenderingContext
= window.WebGLRenderingContext;\n\n // IE10 does not have WebGL.\n if (!Origin
alWebGLRenderingContext)\n return;\n\n function WebGLRenderingContext(impl)
{\n this.impl = impl;\n }\n\n mixin(WebGLRenderingContext.prototype, {\n
get canvas() {\n return wrap(this.impl.canvas);\n },\n\n texImage2D:
function() {\n arguments[5] = unwrapIfNeeded(arguments[5]);\n this.im
pl.texImage2D.apply(this.impl, arguments);\n },\n\n texSubImage2D: functio
n() {\n arguments[6] = unwrapIfNeeded(arguments[6]);\n this.impl.texSu
bImage2D.apply(this.impl, arguments);\n }\n });\n\n // Blink/WebKit has bro
ken DOM bindings. Usually we would create an instance\n // of the object and pa
ss it into registerWrapper as a \"blueprint\" but\n // creating WebGL contexts
is expensive and might fail so we use a dummy\n // object with dummy instance p
roperties for these broken browsers.\n var instanceProperties = /WebKit/.test(n
avigator.userAgent) ?\n {drawingBufferHeight: null, drawingBufferWidth: nul
l} : {};\n\n registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingConte
xt,\n instanceProperties);\n\n scope.wrappers.WebGLRenderingContext = WebG
LRenderingContext;\n})(window.ShadowDOMPolyfill);\n", |
130 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc
ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope
.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalRange = window.Range
;\n\n function Range(impl) {\n this.impl = impl;\n }\n Range.prototype = {
\n get startContainer() {\n return wrap(this.impl.startContainer);\n
},\n get endContainer() {\n return wrap(this.impl.endContainer);\n },
\n get commonAncestorContainer() {\n return wrap(this.impl.commonAncesto
rContainer);\n },\n setStart: function(refNode,offset) {\n this.impl.
setStart(unwrapIfNeeded(refNode), offset);\n },\n setEnd: function(refNode
,offset) {\n this.impl.setEnd(unwrapIfNeeded(refNode), offset);\n },\n
setStartBefore: function(refNode) {\n this.impl.setStartBefore(unwrapIfNe
eded(refNode));\n },\n setStartAfter: function(refNode) {\n this.impl
.setStartAfter(unwrapIfNeeded(refNode));\n },\n setEndBefore: function(ref
Node) {\n this.impl.setEndBefore(unwrapIfNeeded(refNode));\n },\n set
EndAfter: function(refNode) {\n this.impl.setEndAfter(unwrapIfNeeded(refNod
e));\n },\n selectNode: function(refNode) {\n this.impl.selectNode(un
wrapIfNeeded(refNode));\n },\n selectNodeContents: function(refNode) {\n
this.impl.selectNodeContents(unwrapIfNeeded(refNode));\n },\n compareB
oundaryPoints: function(how, sourceRange) {\n return this.impl.compareBound
aryPoints(how, unwrap(sourceRange));\n },\n extractContents: function() {\
n return wrap(this.impl.extractContents());\n },\n cloneContents: fun
ction() {\n return wrap(this.impl.cloneContents());\n },\n insertNode
: function(node) {\n this.impl.insertNode(unwrapIfNeeded(node));\n },\n
surroundContents: function(newParent) {\n this.impl.surroundContents(unw
rapIfNeeded(newParent));\n },\n cloneRange: function() {\n return wra
p(this.impl.cloneRange());\n },\n isPointInRange: function(node, offset) {
\n return this.impl.isPointInRange(unwrapIfNeeded(node), offset);\n },\n
comparePoint: function(node, offset) {\n return this.impl.comparePoint(
unwrapIfNeeded(node), offset);\n },\n intersectsNode: function(node) {\n
return this.impl.intersectsNode(unwrapIfNeeded(node));\n },\n toString
: function() {\n return this.impl.toString();\n }\n };\n\n // IE9 does
not have createContextualFragment.\n if (OriginalRange.prototype.createContext
ualFragment) {\n Range.prototype.createContextualFragment = function(html) {\
n return wrap(this.impl.createContextualFragment(html));\n };\n }\n\n
registerWrapper(window.Range, Range, document.createRange());\n\n scope.wrapper
s.Range = Range;\n\n})(window.ShadowDOMPolyfill);\n", | 129 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc
ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope
.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalRange = window.Range
;\n\n function Range(impl) {\n this.impl = impl;\n }\n Range.prototype = {
\n get startContainer() {\n return wrap(this.impl.startContainer);\n
},\n get endContainer() {\n return wrap(this.impl.endContainer);\n },
\n get commonAncestorContainer() {\n return wrap(this.impl.commonAncesto
rContainer);\n },\n setStart: function(refNode,offset) {\n this.impl.
setStart(unwrapIfNeeded(refNode), offset);\n },\n setEnd: function(refNode
,offset) {\n this.impl.setEnd(unwrapIfNeeded(refNode), offset);\n },\n
setStartBefore: function(refNode) {\n this.impl.setStartBefore(unwrapIfNe
eded(refNode));\n },\n setStartAfter: function(refNode) {\n this.impl
.setStartAfter(unwrapIfNeeded(refNode));\n },\n setEndBefore: function(ref
Node) {\n this.impl.setEndBefore(unwrapIfNeeded(refNode));\n },\n set
EndAfter: function(refNode) {\n this.impl.setEndAfter(unwrapIfNeeded(refNod
e));\n },\n selectNode: function(refNode) {\n this.impl.selectNode(un
wrapIfNeeded(refNode));\n },\n selectNodeContents: function(refNode) {\n
this.impl.selectNodeContents(unwrapIfNeeded(refNode));\n },\n compareB
oundaryPoints: function(how, sourceRange) {\n return this.impl.compareBound
aryPoints(how, unwrap(sourceRange));\n },\n extractContents: function() {\
n return wrap(this.impl.extractContents());\n },\n cloneContents: fun
ction() {\n return wrap(this.impl.cloneContents());\n },\n insertNode
: function(node) {\n this.impl.insertNode(unwrapIfNeeded(node));\n },\n
surroundContents: function(newParent) {\n this.impl.surroundContents(unw
rapIfNeeded(newParent));\n },\n cloneRange: function() {\n return wra
p(this.impl.cloneRange());\n },\n isPointInRange: function(node, offset) {
\n return this.impl.isPointInRange(unwrapIfNeeded(node), offset);\n },\n
comparePoint: function(node, offset) {\n return this.impl.comparePoint(
unwrapIfNeeded(node), offset);\n },\n intersectsNode: function(node) {\n
return this.impl.intersectsNode(unwrapIfNeeded(node));\n },\n toString
: function() {\n return this.impl.toString();\n }\n };\n\n // IE9 does
not have createContextualFragment.\n if (OriginalRange.prototype.createContext
ualFragment) {\n Range.prototype.createContextualFragment = function(html) {\
n return wrap(this.impl.createContextualFragment(html));\n };\n }\n\n
registerWrapper(window.Range, Range, document.createRange());\n\n scope.wrapper
s.Range = Range;\n\n})(window.ShadowDOMPolyfill);\n", |
131 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa
ce = scope.GetElementsByInterface;\n var ParentNodeInterface = scope.ParentNode
Interface;\n var SelectorsInterface = scope.SelectorsInterface;\n var mixin =
scope.mixin;\n var registerObject = scope.registerObject;\n\n var DocumentFrag
ment = registerObject(document.createDocumentFragment());\n mixin(DocumentFragm
ent.prototype, ParentNodeInterface);\n mixin(DocumentFragment.prototype, Select
orsInterface);\n mixin(DocumentFragment.prototype, GetElementsByInterface);\n\n
var Comment = registerObject(document.createComment(''));\n\n scope.wrappers.
Comment = Comment;\n scope.wrappers.DocumentFragment = DocumentFragment;\n\n})(
window.ShadowDOMPolyfill);\n", | 130 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa
ce = scope.GetElementsByInterface;\n var ParentNodeInterface = scope.ParentNode
Interface;\n var SelectorsInterface = scope.SelectorsInterface;\n var mixin =
scope.mixin;\n var registerObject = scope.registerObject;\n\n var DocumentFrag
ment = registerObject(document.createDocumentFragment());\n mixin(DocumentFragm
ent.prototype, ParentNodeInterface);\n mixin(DocumentFragment.prototype, Select
orsInterface);\n mixin(DocumentFragment.prototype, GetElementsByInterface);\n\n
var Comment = registerObject(document.createComment(''));\n\n scope.wrappers.
Comment = Comment;\n scope.wrappers.DocumentFragment = DocumentFragment;\n\n})(
window.ShadowDOMPolyfill);\n", |
132 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var DocumentFragment = s
cope.wrappers.DocumentFragment;\n var TreeScope = scope.TreeScope;\n var eleme
ntFromPoint = scope.elementFromPoint;\n var getInnerHTML = scope.getInnerHTML;\
n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n var rew
rap = scope.rewrap;\n var setInnerHTML = scope.setInnerHTML;\n var unwrap = sc
ope.unwrap;\n\n var shadowHostTable = new WeakMap();\n var nextOlderShadowTree
Table = new WeakMap();\n\n var spaceCharRe = /[ \\t\\n\\r\\f]/;\n\n function S
hadowRoot(hostWrapper) {\n var node = unwrap(hostWrapper.impl.ownerDocument.c
reateDocumentFragment());\n DocumentFragment.call(this, node);\n\n // crea
teDocumentFragment associates the node with a wrapper\n // DocumentFragment i
nstance. Override that.\n rewrap(node, this);\n\n var oldShadowRoot = host
Wrapper.shadowRoot;\n nextOlderShadowTreeTable.set(this, oldShadowRoot);\n\n
this.treeScope_ =\n new TreeScope(this, getTreeScope(oldShadowRoot ||
hostWrapper));\n\n shadowHostTable.set(this, hostWrapper);\n }\n ShadowRoot
.prototype = Object.create(DocumentFragment.prototype);\n mixin(ShadowRoot.prot
otype, {\n get innerHTML() {\n return getInnerHTML(this);\n },\n s
et innerHTML(value) {\n setInnerHTML(this, value);\n this.invalidateSh
adowRenderer();\n },\n\n get olderShadowRoot() {\n return nextOlderSh
adowTreeTable.get(this) || null;\n },\n\n get host() {\n return shado
wHostTable.get(this) || null;\n },\n\n invalidateShadowRenderer: function(
) {\n return shadowHostTable.get(this).invalidateShadowRenderer();\n },\
n\n elementFromPoint: function(x, y) {\n return elementFromPoint(this, t
his.ownerDocument, x, y);\n },\n\n getElementById: function(id) {\n i
f (spaceCharRe.test(id))\n return null;\n return this.querySelector(
'[id=\"' + id + '\"]');\n }\n });\n\n scope.wrappers.ShadowRoot = ShadowRoo
t;\n\n})(window.ShadowDOMPolyfill);\n", | 131 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var DocumentFragment = s
cope.wrappers.DocumentFragment;\n var TreeScope = scope.TreeScope;\n var eleme
ntFromPoint = scope.elementFromPoint;\n var getInnerHTML = scope.getInnerHTML;\
n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n var rew
rap = scope.rewrap;\n var setInnerHTML = scope.setInnerHTML;\n var unwrap = sc
ope.unwrap;\n\n var shadowHostTable = new WeakMap();\n var nextOlderShadowTree
Table = new WeakMap();\n\n var spaceCharRe = /[ \\t\\n\\r\\f]/;\n\n function S
hadowRoot(hostWrapper) {\n var node = unwrap(hostWrapper.impl.ownerDocument.c
reateDocumentFragment());\n DocumentFragment.call(this, node);\n\n // crea
teDocumentFragment associates the node with a wrapper\n // DocumentFragment i
nstance. Override that.\n rewrap(node, this);\n\n var oldShadowRoot = host
Wrapper.shadowRoot;\n nextOlderShadowTreeTable.set(this, oldShadowRoot);\n\n
this.treeScope_ =\n new TreeScope(this, getTreeScope(oldShadowRoot ||
hostWrapper));\n\n shadowHostTable.set(this, hostWrapper);\n }\n ShadowRoot
.prototype = Object.create(DocumentFragment.prototype);\n mixin(ShadowRoot.prot
otype, {\n get innerHTML() {\n return getInnerHTML(this);\n },\n s
et innerHTML(value) {\n setInnerHTML(this, value);\n this.invalidateSh
adowRenderer();\n },\n\n get olderShadowRoot() {\n return nextOlderSh
adowTreeTable.get(this) || null;\n },\n\n get host() {\n return shado
wHostTable.get(this) || null;\n },\n\n invalidateShadowRenderer: function(
) {\n return shadowHostTable.get(this).invalidateShadowRenderer();\n },\
n\n elementFromPoint: function(x, y) {\n return elementFromPoint(this, t
his.ownerDocument, x, y);\n },\n\n getElementById: function(id) {\n i
f (spaceCharRe.test(id))\n return null;\n return this.querySelector(
'[id=\"' + id + '\"]');\n }\n });\n\n scope.wrappers.ShadowRoot = ShadowRoo
t;\n\n})(window.ShadowDOMPolyfill);\n", |
133 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is governed by a BSD-style\n// license that can be found in the LIC
ENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrapp
ers.Element;\n var HTMLContentElement = scope.wrappers.HTMLContentElement;\n v
ar HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var Node = scope.wra
ppers.Node;\n var ShadowRoot = scope.wrappers.ShadowRoot;\n var assert = scope
.assert;\n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n
var oneOf = scope.oneOf;\n var unwrap = scope.unwrap;\n var wrap = scope.wra
p;\n\n /**\n * Updates the fields of a wrapper to a snapshot of the logical D
OM as needed.\n * Up means parentNode\n * Sideways means previous and next s
ibling.\n * @param {!Node} wrapper\n */\n function updateWrapperUpAndSidewa
ys(wrapper) {\n wrapper.previousSibling_ = wrapper.previousSibling;\n wrap
per.nextSibling_ = wrapper.nextSibling;\n wrapper.parentNode_ = wrapper.paren
tNode;\n }\n\n /**\n * Updates the fields of a wrapper to a snapshot of the
logical DOM as needed.\n * Down means first and last child\n * @param {!Node
} wrapper\n */\n function updateWrapperDown(wrapper) {\n wrapper.firstChil
d_ = wrapper.firstChild;\n wrapper.lastChild_ = wrapper.lastChild;\n }\n\n
function updateAllChildNodes(parentNodeWrapper) {\n assert(parentNodeWrapper
instanceof Node);\n for (var childWrapper = parentNodeWrapper.firstChild;\n
childWrapper;\n childWrapper = childWrapper.nextSibling) {\n
updateWrapperUpAndSideways(childWrapper);\n }\n updateWrapperDown(parentN
odeWrapper);\n }\n\n function insertBefore(parentNodeWrapper, newChildWrapper,
refChildWrapper) {\n var parentNode = unwrap(parentNodeWrapper);\n var ne
wChild = unwrap(newChildWrapper);\n var refChild = refChildWrapper ? unwrap(r
efChildWrapper) : null;\n\n remove(newChildWrapper);\n updateWrapperUpAndS
ideways(newChildWrapper);\n\n if (!refChildWrapper) {\n parentNodeWrappe
r.lastChild_ = parentNodeWrapper.lastChild;\n if (parentNodeWrapper.lastChi
ld === parentNodeWrapper.firstChild)\n parentNodeWrapper.firstChild_ = pa
rentNodeWrapper.firstChild;\n\n var lastChildWrapper = wrap(parentNode.last
Child);\n if (lastChildWrapper)\n lastChildWrapper.nextSibling_ = la
stChildWrapper.nextSibling;\n } else {\n if (parentNodeWrapper.firstChil
d === refChildWrapper)\n parentNodeWrapper.firstChild_ = refChildWrapper;
\n\n refChildWrapper.previousSibling_ = refChildWrapper.previousSibling;\n
}\n\n parentNode.insertBefore(newChild, refChild);\n }\n\n function remo
ve(nodeWrapper) {\n var node = unwrap(nodeWrapper)\n var parentNode = node
.parentNode;\n if (!parentNode)\n return;\n\n var parentNodeWrapper =
wrap(parentNode);\n updateWrapperUpAndSideways(nodeWrapper);\n\n if (node
Wrapper.previousSibling)\n nodeWrapper.previousSibling.nextSibling_ = nodeW
rapper;\n if (nodeWrapper.nextSibling)\n nodeWrapper.nextSibling.previou
sSibling_ = nodeWrapper;\n\n if (parentNodeWrapper.lastChild === nodeWrapper)
\n parentNodeWrapper.lastChild_ = nodeWrapper;\n if (parentNodeWrapper.f
irstChild === nodeWrapper)\n parentNodeWrapper.firstChild_ = nodeWrapper;\n
\n parentNode.removeChild(node);\n }\n\n var distributedNodesTable = new We
akMap();\n var destinationInsertionPointsTable = new WeakMap();\n var renderer
ForHostTable = new WeakMap();\n\n function resetDistributedNodes(insertionPoint
) {\n distributedNodesTable.set(insertionPoint, []);\n }\n\n function getDi
stributedNodes(insertionPoint) {\n var rv = distributedNodesTable.get(inserti
onPoint);\n if (!rv)\n distributedNodesTable.set(insertionPoint, rv = []
);\n return rv;\n }\n\n function getChildNodesSnapshot(node) {\n var res
ult = [], i = 0;\n for (var child = node.firstChild; child; child = child.nex
tSibling) {\n result[i++] = child;\n }\n return result;\n }\n\n var
request = oneOf(window, [\n 'requestAnimationFrame',\n 'mozRequestAnimati
onFrame',\n 'webkitRequestAnimationFrame',\n 'setTimeout'\n ]);\n\n var
pendingDirtyRenderers = [];\n var renderTimer;\n\n function renderAllPending()
{\n // TODO(arv): Order these in document order. That way we do not have to\
n // render something twice.\n for (var i = 0; i < pendingDirtyRenderers.l
ength; i++) {\n var renderer = pendingDirtyRenderers[i];\n var parentR
enderer = renderer.parentRenderer;\n if (parentRenderer && parentRenderer.d
irty)\n continue;\n renderer.render();\n }\n\n pendingDirtyRen
derers = [];\n }\n\n function handleRequestAnimationFrame() {\n renderTimer
= null;\n renderAllPending();\n }\n\n /**\n * Returns existing shadow re
nderer for a host or creates it if it is needed.\n * @params {!Element} host\n
* @return {!ShadowRenderer}\n */\n function getRendererForHost(host) {\n
var renderer = rendererForHostTable.get(host);\n if (!renderer) {\n re
nderer = new ShadowRenderer(host);\n rendererForHostTable.set(host, rendere
r);\n }\n return renderer;\n }\n\n function getShadowRootAncestor(node)
{\n var root = getTreeScope(node).root;\n if (root instanceof ShadowRoot)\
n return root;\n return null;\n }\n\n function getRendererForShadowRoo
t(shadowRoot) {\n return getRendererForHost(shadowRoot.host);\n }\n\n var s
pliceDiff = new ArraySplice();\n spliceDiff.equals = function(renderNode, rawNo
de) {\n return unwrap(renderNode.node) === rawNode;\n };\n\n /**\n * Rend
erNode is used as an in memory \"render tree\". When we render the\n * compose
d tree we create a tree of RenderNodes, then we diff this against\n * the real
DOM tree and make minimal changes as needed.\n */\n function RenderNode(node
) {\n this.skip = false;\n this.node = node;\n this.childNodes = [];\n
}\n\n RenderNode.prototype = {\n append: function(node) {\n var rv = n
ew RenderNode(node);\n this.childNodes.push(rv);\n return rv;\n },\
n\n sync: function(opt_added) {\n if (this.skip)\n return;\n\n
var nodeWrapper = this.node;\n // plain array of RenderNodes\n var
newChildren = this.childNodes;\n // plain array of real nodes.\n var o
ldChildren = getChildNodesSnapshot(unwrap(nodeWrapper));\n var added = opt_
added || new WeakMap();\n\n var splices = spliceDiff.calculateSplices(newCh
ildren, oldChildren);\n\n var newIndex = 0, oldIndex = 0;\n var lastIn
dex = 0;\n for (var i = 0; i < splices.length; i++) {\n var splice =
splices[i];\n for (; lastIndex < splice.index; lastIndex++) {\n
oldIndex++;\n newChildren[newIndex++].sync(added);\n }\n\n
var removedCount = splice.removed.length;\n for (var j = 0; j < remove
dCount; j++) {\n var wrapper = wrap(oldChildren[oldIndex++]);\n
if (!added.get(wrapper))\n remove(wrapper);\n }\n\n v
ar addedCount = splice.addedCount;\n var refNode = oldChildren[oldIndex]
&& wrap(oldChildren[oldIndex]);\n for (var j = 0; j < addedCount; j++) {\
n var newChildRenderNode = newChildren[newIndex++];\n var newC
hildWrapper = newChildRenderNode.node;\n insertBefore(nodeWrapper, newC
hildWrapper, refNode);\n\n // Keep track of added so that we do not rem
ove the node after it\n // has been added.\n added.set(newChil
dWrapper, true);\n\n newChildRenderNode.sync(added);\n }\n\n
lastIndex += addedCount;\n }\n\n for (var i = lastIndex; i < newCh
ildren.length; i++) {\n newChildren[i].sync(added);\n }\n }\n };
\n\n function ShadowRenderer(host) {\n this.host = host;\n this.dirty = f
alse;\n this.invalidateAttributes();\n this.associateNode(host);\n }\n\n
ShadowRenderer.prototype = {\n\n // http://dvcs.w3.org/hg/webcomponents/raw-
file/tip/spec/shadow/index.html#rendering-shadow-trees\n render: function(opt
_renderNode) {\n if (!this.dirty)\n return;\n\n this.invalidate
Attributes();\n\n var host = this.host;\n\n this.distribution(host);\n
var renderNode = opt_renderNode || new RenderNode(host);\n this.build
RenderTree(renderNode, host);\n\n var topMostRenderer = !opt_renderNode;\n
if (topMostRenderer)\n renderNode.sync();\n\n this.dirty = fals
e;\n },\n\n get parentRenderer() {\n return getTreeScope(this.host).r
enderer;\n },\n\n invalidate: function() {\n if (!this.dirty) {\n
this.dirty = true;\n var parentRenderer = this.parentRenderer;\n
if (parentRenderer)\n parentRenderer.invalidate();\n pendingD
irtyRenderers.push(this);\n if (renderTimer)\n return;\n
renderTimer = window[request](handleRequestAnimationFrame, 0);\n }\n },\
n\n // http://w3c.github.io/webcomponents/spec/shadow/#distribution-algorithm
s\n distribution: function(root) {\n this.resetAll(root);\n this.di
stributionResolution(root);\n },\n\n resetAll: function(node) {\n if
(isInsertionPoint(node))\n resetDistributedNodes(node);\n else\n
resetDestinationInsertionPoints(node);\n\n for (var child = node.firstC
hild; child; child = child.nextSibling) {\n this.resetAll(child);\n
}\n\n if (node.shadowRoot)\n this.resetAll(node.shadowRoot);\n\n
if (node.olderShadowRoot)\n this.resetAll(node.olderShadowRoot);\n }
,\n\n // http://w3c.github.io/webcomponents/spec/shadow/#distribution-results
\n distributionResolution: function(node) {\n if (isShadowHost(node)) {\
n var shadowHost = node;\n // 1.1\n var pool = poolPopulati
on(shadowHost);\n\n var shadowTrees = getShadowTrees(shadowHost);\n\n
// 1.2\n for (var i = 0; i < shadowTrees.length; i++) {\n //
1.2.1\n this.poolDistribution(shadowTrees[i], pool);\n }\n\n
// 1.3\n for (var i = shadowTrees.length - 1; i >= 0; i--) {\n
var shadowTree = shadowTrees[i];\n\n // 1.3.1\n // TODO(ar
v): We should keep the shadow insertion points on the\n // shadow root
(or renderer) so we don't have to search the tree\n // every time.\n
var shadow = getShadowInsertionPoint(shadowTree);\n\n // 1.3.2\n
if (shadow) {\n\n // 1.3.2.1\n var olderShadowRo
ot = shadowTree.olderShadowRoot;\n if (olderShadowRoot) {\n
// 1.3.2.1.1\n pool = poolPopulation(olderShadowRoot);\n
}\n\n // 1.3.2.2\n for (var j = 0; j < pool.length; j
++) {\n // 1.3.2.2.1\n destributeNodeInto(pool[j], sha
dow);\n }\n }\n\n // 1.3.3\n this.distribu
tionResolution(shadowTree);\n }\n }\n\n for (var child = node.f
irstChild; child; child = child.nextSibling) {\n this.distributionResolut
ion(child);\n }\n },\n\n // http://w3c.github.io/webcomponents/spec/s
hadow/#dfn-pool-distribution-algorithm\n poolDistribution: function (node, po
ol) {\n if (node instanceof HTMLShadowElement)\n return;\n\n if
(node instanceof HTMLContentElement) {\n var content = node;\n th
is.updateDependentAttributes(content.getAttribute('select'));\n\n var any
Distributed = false;\n\n // 1.1\n for (var i = 0; i < pool.length;
i++) {\n var node = pool[i];\n if (!node)\n contin
ue;\n if (matches(node, content)) {\n destributeNodeInto(nod
e, content);\n pool[i] = undefined;\n anyDistributed = tru
e;\n }\n }\n\n // 1.2\n // Fallback content\n
if (!anyDistributed) {\n for (var child = content.firstChild;\n
child;\n child = child.nextSibling) {\n destr
ibuteNodeInto(child, content);\n }\n }\n\n return;\n
}\n\n for (var child = node.firstChild; child; child = child.nextSibling)
{\n this.poolDistribution(child, pool);\n }\n },\n\n buildRend
erTree: function(renderNode, node) {\n var children = this.compose(node);\n
for (var i = 0; i < children.length; i++) {\n var child = children[
i];\n var childRenderNode = renderNode.append(child);\n this.build
RenderTree(childRenderNode, child);\n }\n\n if (isShadowHost(node)) {\
n var renderer = getRendererForHost(node);\n renderer.dirty = fals
e;\n }\n\n },\n\n compose: function(node) {\n var children = [];
\n var p = node.shadowRoot || node;\n for (var child = p.firstChild; c
hild; child = child.nextSibling) {\n if (isInsertionPoint(child)) {\n
this.associateNode(p);\n var distributedNodes = getDistributedNod
es(child);\n for (var j = 0; j < distributedNodes.length; j++) {\n
var distributedNode = distributedNodes[j];\n if (isFinalDestin
ation(child, distributedNode))\n children.push(distributedNode);\n
}\n } else {\n children.push(child);\n }\n
}\n return children;\n },\n\n /**\n * Invalidates the attributes
used to keep track of which attributes may\n * cause the renderer to be inva
lidated.\n */\n invalidateAttributes: function() {\n this.attributes
= Object.create(null);\n },\n\n /**\n * Parses the selector and makes
this renderer dependent on the attribute\n * being used in the selector.\n
* @param {string} selector\n */\n updateDependentAttributes: function
(selector) {\n if (!selector)\n return;\n\n var attributes = th
is.attributes;\n\n // .class\n if (/\\.\\w+/.test(selector))\n
attributes['class'] = true;\n\n // #id\n if (/#\\w+/.test(selector))\n
attributes['id'] = true;\n\n selector.replace(/\\[\\s*([^\\s=\\|~\\
]]+)/g, function(_, name) {\n attributes[name] = true;\n });\n\n
// Pseudo selectors have been removed from the spec.\n },\n\n dependsOnA
ttribute: function(name) {\n return this.attributes[name];\n },\n\n a
ssociateNode: function(node) {\n node.impl.polymerShadowRenderer_ = this;\n
}\n };\n\n // http://w3c.github.io/webcomponents/spec/shadow/#dfn-pool-pop
ulation-algorithm\n function poolPopulation(node) {\n var pool = [];\n fo
r (var child = node.firstChild; child; child = child.nextSibling) {\n if (i
sInsertionPoint(child)) {\n pool.push.apply(pool, getDistributedNodes(chi
ld));\n } else {\n pool.push(child);\n }\n }\n return poo
l;\n }\n\n function getShadowInsertionPoint(node) {\n if (node instanceof H
TMLShadowElement)\n return node;\n if (node instanceof HTMLContentElemen
t)\n return null;\n for (var child = node.firstChild; child; child = chi
ld.nextSibling) {\n var res = getShadowInsertionPoint(child);\n if (re
s)\n return res;\n }\n return null;\n }\n\n function destributeNo
deInto(child, insertionPoint) {\n getDistributedNodes(insertionPoint).push(ch
ild);\n var points = destinationInsertionPointsTable.get(child);\n if (!po
ints)\n destinationInsertionPointsTable.set(child, [insertionPoint]);\n
else\n points.push(insertionPoint);\n }\n\n function getDestinationInsert
ionPoints(node) {\n return destinationInsertionPointsTable.get(node);\n }\n\
n function resetDestinationInsertionPoints(node) {\n // IE11 crashes when de
lete is used.\n destinationInsertionPointsTable.set(node, undefined);\n }\n\
n // AllowedSelectors :\n // TypeSelector\n // *\n // ClassSelector\n
// IDSelector\n // AttributeSelector\n var selectorStartCharRe = /^[*.#[a
-zA-Z_|]/;\n\n function matches(node, contentElement) {\n var select = conte
ntElement.getAttribute('select');\n if (!select)\n return true;\n\n /
/ Here we know the select attribute is a non empty string.\n select = select.
trim();\n if (!select)\n return true;\n\n if (!(node instanceof Eleme
nt))\n return false;\n\n if (!selectorStartCharRe.test(select))\n r
eturn false;\n\n try {\n return node.matches(select);\n } catch (ex)
{\n // Invalid selector.\n return false;\n }\n }\n\n function isF
inalDestination(insertionPoint, node) {\n var points = getDestinationInsertio
nPoints(node);\n return points && points[points.length - 1] === insertionPoin
t;\n }\n\n function isInsertionPoint(node) {\n return node instanceof HTMLC
ontentElement ||\n node instanceof HTMLShadowElement;\n }\n\n functi
on isShadowHost(shadowHost) {\n return shadowHost.shadowRoot;\n }\n\n // Re
turns the shadow trees as an array, with the youngest tree at the\n // beginnin
g of the array.\n function getShadowTrees(host) {\n var trees = [];\n\n f
or (var tree = host.shadowRoot; tree; tree = tree.olderShadowRoot) {\n tree
s.push(tree);\n }\n return trees;\n }\n\n function render(host) {\n n
ew ShadowRenderer(host).render();\n };\n\n // Need to rerender shadow host whe
n:\n //\n // - a direct child to the ShadowRoot is added or removed\n // - a
direct child to the host is added or removed\n // - a new shadow root is create
d\n // - a direct child to a content/shadow element is added or removed\n // -
a sibling to a content/shadow element is added or removed\n // - content[selec
t] is changed\n // - an attribute in a direct child to a host is modified\n\n
/**\n * This gets called when a node was added or removed to it.\n */\n Nod
e.prototype.invalidateShadowRenderer = function(force) {\n var renderer = thi
s.impl.polymerShadowRenderer_;\n if (renderer) {\n renderer.invalidate()
;\n return true;\n }\n\n return false;\n };\n\n HTMLContentElement.
prototype.getDistributedNodes =\n HTMLShadowElement.prototype.getDistributedNod
es = function() {\n // TODO(arv): We should only rerender the dirty ancestor
renderers (from\n // the root and down).\n renderAllPending();\n return
getDistributedNodes(this);\n };\n\n Element.prototype.getDestinationInsertion
Points = function() {\n renderAllPending();\n return getDestinationInserti
onPoints(this) || [];\n };\n\n HTMLContentElement.prototype.nodeIsInserted_ =\
n HTMLShadowElement.prototype.nodeIsInserted_ = function() {\n // Invalidate
old renderer if any.\n this.invalidateShadowRenderer();\n\n var shadowRoo
t = getShadowRootAncestor(this);\n var renderer;\n if (shadowRoot)\n
renderer = getRendererForShadowRoot(shadowRoot);\n this.impl.polymerShadowRen
derer_ = renderer;\n if (renderer)\n renderer.invalidate();\n };\n\n s
cope.getRendererForHost = getRendererForHost;\n scope.getShadowTrees = getShado
wTrees;\n scope.renderAllPending = renderAllPending;\n\n scope.getDestinationI
nsertionPoints = getDestinationInsertionPoints;\n\n // Exposed for testing\n s
cope.visual = {\n insertBefore: insertBefore,\n remove: remove,\n };\n\n}
)(window.ShadowDOMPolyfill);\n", | 132 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is governed by a BSD-style\n// license that can be found in the LIC
ENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrapp
ers.Element;\n var HTMLContentElement = scope.wrappers.HTMLContentElement;\n v
ar HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var Node = scope.wra
ppers.Node;\n var ShadowRoot = scope.wrappers.ShadowRoot;\n var assert = scope
.assert;\n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n
var oneOf = scope.oneOf;\n var unwrap = scope.unwrap;\n var wrap = scope.wra
p;\n\n /**\n * Updates the fields of a wrapper to a snapshot of the logical D
OM as needed.\n * Up means parentNode\n * Sideways means previous and next s
ibling.\n * @param {!Node} wrapper\n */\n function updateWrapperUpAndSidewa
ys(wrapper) {\n wrapper.previousSibling_ = wrapper.previousSibling;\n wrap
per.nextSibling_ = wrapper.nextSibling;\n wrapper.parentNode_ = wrapper.paren
tNode;\n }\n\n /**\n * Updates the fields of a wrapper to a snapshot of the
logical DOM as needed.\n * Down means first and last child\n * @param {!Node
} wrapper\n */\n function updateWrapperDown(wrapper) {\n wrapper.firstChil
d_ = wrapper.firstChild;\n wrapper.lastChild_ = wrapper.lastChild;\n }\n\n
function updateAllChildNodes(parentNodeWrapper) {\n assert(parentNodeWrapper
instanceof Node);\n for (var childWrapper = parentNodeWrapper.firstChild;\n
childWrapper;\n childWrapper = childWrapper.nextSibling) {\n
updateWrapperUpAndSideways(childWrapper);\n }\n updateWrapperDown(parentN
odeWrapper);\n }\n\n function insertBefore(parentNodeWrapper, newChildWrapper,
refChildWrapper) {\n var parentNode = unwrap(parentNodeWrapper);\n var ne
wChild = unwrap(newChildWrapper);\n var refChild = refChildWrapper ? unwrap(r
efChildWrapper) : null;\n\n remove(newChildWrapper);\n updateWrapperUpAndS
ideways(newChildWrapper);\n\n if (!refChildWrapper) {\n parentNodeWrappe
r.lastChild_ = parentNodeWrapper.lastChild;\n if (parentNodeWrapper.lastChi
ld === parentNodeWrapper.firstChild)\n parentNodeWrapper.firstChild_ = pa
rentNodeWrapper.firstChild;\n\n var lastChildWrapper = wrap(parentNode.last
Child);\n if (lastChildWrapper)\n lastChildWrapper.nextSibling_ = la
stChildWrapper.nextSibling;\n } else {\n if (parentNodeWrapper.firstChil
d === refChildWrapper)\n parentNodeWrapper.firstChild_ = refChildWrapper;
\n\n refChildWrapper.previousSibling_ = refChildWrapper.previousSibling;\n
}\n\n parentNode.insertBefore(newChild, refChild);\n }\n\n function remo
ve(nodeWrapper) {\n var node = unwrap(nodeWrapper)\n var parentNode = node
.parentNode;\n if (!parentNode)\n return;\n\n var parentNodeWrapper =
wrap(parentNode);\n updateWrapperUpAndSideways(nodeWrapper);\n\n if (node
Wrapper.previousSibling)\n nodeWrapper.previousSibling.nextSibling_ = nodeW
rapper;\n if (nodeWrapper.nextSibling)\n nodeWrapper.nextSibling.previou
sSibling_ = nodeWrapper;\n\n if (parentNodeWrapper.lastChild === nodeWrapper)
\n parentNodeWrapper.lastChild_ = nodeWrapper;\n if (parentNodeWrapper.f
irstChild === nodeWrapper)\n parentNodeWrapper.firstChild_ = nodeWrapper;\n
\n parentNode.removeChild(node);\n }\n\n var distributedNodesTable = new We
akMap();\n var destinationInsertionPointsTable = new WeakMap();\n var renderer
ForHostTable = new WeakMap();\n\n function resetDistributedNodes(insertionPoint
) {\n distributedNodesTable.set(insertionPoint, []);\n }\n\n function getDi
stributedNodes(insertionPoint) {\n var rv = distributedNodesTable.get(inserti
onPoint);\n if (!rv)\n distributedNodesTable.set(insertionPoint, rv = []
);\n return rv;\n }\n\n function getChildNodesSnapshot(node) {\n var res
ult = [], i = 0;\n for (var child = node.firstChild; child; child = child.nex
tSibling) {\n result[i++] = child;\n }\n return result;\n }\n\n var
request = oneOf(window, [\n 'requestAnimationFrame',\n 'mozRequestAnimati
onFrame',\n 'webkitRequestAnimationFrame',\n 'setTimeout'\n ]);\n\n var
pendingDirtyRenderers = [];\n var renderTimer;\n\n function renderAllPending()
{\n // TODO(arv): Order these in document order. That way we do not have to\
n // render something twice.\n for (var i = 0; i < pendingDirtyRenderers.l
ength; i++) {\n var renderer = pendingDirtyRenderers[i];\n var parentR
enderer = renderer.parentRenderer;\n if (parentRenderer && parentRenderer.d
irty)\n continue;\n renderer.render();\n }\n\n pendingDirtyRen
derers = [];\n }\n\n function handleRequestAnimationFrame() {\n renderTimer
= null;\n renderAllPending();\n }\n\n /**\n * Returns existing shadow re
nderer for a host or creates it if it is needed.\n * @params {!Element} host\n
* @return {!ShadowRenderer}\n */\n function getRendererForHost(host) {\n
var renderer = rendererForHostTable.get(host);\n if (!renderer) {\n re
nderer = new ShadowRenderer(host);\n rendererForHostTable.set(host, rendere
r);\n }\n return renderer;\n }\n\n function getShadowRootAncestor(node)
{\n var root = getTreeScope(node).root;\n if (root instanceof ShadowRoot)\
n return root;\n return null;\n }\n\n function getRendererForShadowRoo
t(shadowRoot) {\n return getRendererForHost(shadowRoot.host);\n }\n\n var s
pliceDiff = new ArraySplice();\n spliceDiff.equals = function(renderNode, rawNo
de) {\n return unwrap(renderNode.node) === rawNode;\n };\n\n /**\n * Rend
erNode is used as an in memory \"render tree\". When we render the\n * compose
d tree we create a tree of RenderNodes, then we diff this against\n * the real
DOM tree and make minimal changes as needed.\n */\n function RenderNode(node
) {\n this.skip = false;\n this.node = node;\n this.childNodes = [];\n
}\n\n RenderNode.prototype = {\n append: function(node) {\n var rv = n
ew RenderNode(node);\n this.childNodes.push(rv);\n return rv;\n },\
n\n sync: function(opt_added) {\n if (this.skip)\n return;\n\n
var nodeWrapper = this.node;\n // plain array of RenderNodes\n var
newChildren = this.childNodes;\n // plain array of real nodes.\n var o
ldChildren = getChildNodesSnapshot(unwrap(nodeWrapper));\n var added = opt_
added || new WeakMap();\n\n var splices = spliceDiff.calculateSplices(newCh
ildren, oldChildren);\n\n var newIndex = 0, oldIndex = 0;\n var lastIn
dex = 0;\n for (var i = 0; i < splices.length; i++) {\n var splice =
splices[i];\n for (; lastIndex < splice.index; lastIndex++) {\n
oldIndex++;\n newChildren[newIndex++].sync(added);\n }\n\n
var removedCount = splice.removed.length;\n for (var j = 0; j < remove
dCount; j++) {\n var wrapper = wrap(oldChildren[oldIndex++]);\n
if (!added.get(wrapper))\n remove(wrapper);\n }\n\n v
ar addedCount = splice.addedCount;\n var refNode = oldChildren[oldIndex]
&& wrap(oldChildren[oldIndex]);\n for (var j = 0; j < addedCount; j++) {\
n var newChildRenderNode = newChildren[newIndex++];\n var newC
hildWrapper = newChildRenderNode.node;\n insertBefore(nodeWrapper, newC
hildWrapper, refNode);\n\n // Keep track of added so that we do not rem
ove the node after it\n // has been added.\n added.set(newChil
dWrapper, true);\n\n newChildRenderNode.sync(added);\n }\n\n
lastIndex += addedCount;\n }\n\n for (var i = lastIndex; i < newCh
ildren.length; i++) {\n newChildren[i].sync(added);\n }\n }\n };
\n\n function ShadowRenderer(host) {\n this.host = host;\n this.dirty = f
alse;\n this.invalidateAttributes();\n this.associateNode(host);\n }\n\n
ShadowRenderer.prototype = {\n\n // http://dvcs.w3.org/hg/webcomponents/raw-
file/tip/spec/shadow/index.html#rendering-shadow-trees\n render: function(opt
_renderNode) {\n if (!this.dirty)\n return;\n\n this.invalidate
Attributes();\n\n var host = this.host;\n\n this.distribution(host);\n
var renderNode = opt_renderNode || new RenderNode(host);\n this.build
RenderTree(renderNode, host);\n\n var topMostRenderer = !opt_renderNode;\n
if (topMostRenderer)\n renderNode.sync();\n\n this.dirty = fals
e;\n },\n\n get parentRenderer() {\n return getTreeScope(this.host).r
enderer;\n },\n\n invalidate: function() {\n if (!this.dirty) {\n
this.dirty = true;\n var parentRenderer = this.parentRenderer;\n
if (parentRenderer)\n parentRenderer.invalidate();\n pendingD
irtyRenderers.push(this);\n if (renderTimer)\n return;\n
renderTimer = window[request](handleRequestAnimationFrame, 0);\n }\n },\
n\n // http://w3c.github.io/webcomponents/spec/shadow/#distribution-algorithm
s\n distribution: function(root) {\n this.resetAll(root);\n this.di
stributionResolution(root);\n },\n\n resetAll: function(node) {\n if
(isInsertionPoint(node))\n resetDistributedNodes(node);\n else\n
resetDestinationInsertionPoints(node);\n\n for (var child = node.firstC
hild; child; child = child.nextSibling) {\n this.resetAll(child);\n
}\n\n if (node.shadowRoot)\n this.resetAll(node.shadowRoot);\n\n
if (node.olderShadowRoot)\n this.resetAll(node.olderShadowRoot);\n }
,\n\n // http://w3c.github.io/webcomponents/spec/shadow/#distribution-results
\n distributionResolution: function(node) {\n if (isShadowHost(node)) {\
n var shadowHost = node;\n // 1.1\n var pool = poolPopulati
on(shadowHost);\n\n var shadowTrees = getShadowTrees(shadowHost);\n\n
// 1.2\n for (var i = 0; i < shadowTrees.length; i++) {\n //
1.2.1\n this.poolDistribution(shadowTrees[i], pool);\n }\n\n
// 1.3\n for (var i = shadowTrees.length - 1; i >= 0; i--) {\n
var shadowTree = shadowTrees[i];\n\n // 1.3.1\n // TODO(ar
v): We should keep the shadow insertion points on the\n // shadow root
(or renderer) so we don't have to search the tree\n // every time.\n
var shadow = getShadowInsertionPoint(shadowTree);\n\n // 1.3.2\n
if (shadow) {\n\n // 1.3.2.1\n var olderShadowRo
ot = shadowTree.olderShadowRoot;\n if (olderShadowRoot) {\n
// 1.3.2.1.1\n pool = poolPopulation(olderShadowRoot);\n
}\n\n // 1.3.2.2\n for (var j = 0; j < pool.length; j
++) {\n // 1.3.2.2.1\n destributeNodeInto(pool[j], sha
dow);\n }\n }\n\n // 1.3.3\n this.distribu
tionResolution(shadowTree);\n }\n }\n\n for (var child = node.f
irstChild; child; child = child.nextSibling) {\n this.distributionResolut
ion(child);\n }\n },\n\n // http://w3c.github.io/webcomponents/spec/s
hadow/#dfn-pool-distribution-algorithm\n poolDistribution: function (node, po
ol) {\n if (node instanceof HTMLShadowElement)\n return;\n\n if
(node instanceof HTMLContentElement) {\n var content = node;\n th
is.updateDependentAttributes(content.getAttribute('select'));\n\n var any
Distributed = false;\n\n // 1.1\n for (var i = 0; i < pool.length;
i++) {\n var node = pool[i];\n if (!node)\n contin
ue;\n if (matches(node, content)) {\n destributeNodeInto(nod
e, content);\n pool[i] = undefined;\n anyDistributed = tru
e;\n }\n }\n\n // 1.2\n // Fallback content\n
if (!anyDistributed) {\n for (var child = content.firstChild;\n
child;\n child = child.nextSibling) {\n destr
ibuteNodeInto(child, content);\n }\n }\n\n return;\n
}\n\n for (var child = node.firstChild; child; child = child.nextSibling)
{\n this.poolDistribution(child, pool);\n }\n },\n\n buildRend
erTree: function(renderNode, node) {\n var children = this.compose(node);\n
for (var i = 0; i < children.length; i++) {\n var child = children[
i];\n var childRenderNode = renderNode.append(child);\n this.build
RenderTree(childRenderNode, child);\n }\n\n if (isShadowHost(node)) {\
n var renderer = getRendererForHost(node);\n renderer.dirty = fals
e;\n }\n\n },\n\n compose: function(node) {\n var children = [];
\n var p = node.shadowRoot || node;\n for (var child = p.firstChild; c
hild; child = child.nextSibling) {\n if (isInsertionPoint(child)) {\n
this.associateNode(p);\n var distributedNodes = getDistributedNod
es(child);\n for (var j = 0; j < distributedNodes.length; j++) {\n
var distributedNode = distributedNodes[j];\n if (isFinalDestin
ation(child, distributedNode))\n children.push(distributedNode);\n
}\n } else {\n children.push(child);\n }\n
}\n return children;\n },\n\n /**\n * Invalidates the attributes
used to keep track of which attributes may\n * cause the renderer to be inva
lidated.\n */\n invalidateAttributes: function() {\n this.attributes
= Object.create(null);\n },\n\n /**\n * Parses the selector and makes
this renderer dependent on the attribute\n * being used in the selector.\n
* @param {string} selector\n */\n updateDependentAttributes: function
(selector) {\n if (!selector)\n return;\n\n var attributes = th
is.attributes;\n\n // .class\n if (/\\.\\w+/.test(selector))\n
attributes['class'] = true;\n\n // #id\n if (/#\\w+/.test(selector))\n
attributes['id'] = true;\n\n selector.replace(/\\[\\s*([^\\s=\\|~\\
]]+)/g, function(_, name) {\n attributes[name] = true;\n });\n\n
// Pseudo selectors have been removed from the spec.\n },\n\n dependsOnA
ttribute: function(name) {\n return this.attributes[name];\n },\n\n a
ssociateNode: function(node) {\n node.impl.polymerShadowRenderer_ = this;\n
}\n };\n\n // http://w3c.github.io/webcomponents/spec/shadow/#dfn-pool-pop
ulation-algorithm\n function poolPopulation(node) {\n var pool = [];\n fo
r (var child = node.firstChild; child; child = child.nextSibling) {\n if (i
sInsertionPoint(child)) {\n pool.push.apply(pool, getDistributedNodes(chi
ld));\n } else {\n pool.push(child);\n }\n }\n return poo
l;\n }\n\n function getShadowInsertionPoint(node) {\n if (node instanceof H
TMLShadowElement)\n return node;\n if (node instanceof HTMLContentElemen
t)\n return null;\n for (var child = node.firstChild; child; child = chi
ld.nextSibling) {\n var res = getShadowInsertionPoint(child);\n if (re
s)\n return res;\n }\n return null;\n }\n\n function destributeNo
deInto(child, insertionPoint) {\n getDistributedNodes(insertionPoint).push(ch
ild);\n var points = destinationInsertionPointsTable.get(child);\n if (!po
ints)\n destinationInsertionPointsTable.set(child, [insertionPoint]);\n
else\n points.push(insertionPoint);\n }\n\n function getDestinationInsert
ionPoints(node) {\n return destinationInsertionPointsTable.get(node);\n }\n\
n function resetDestinationInsertionPoints(node) {\n // IE11 crashes when de
lete is used.\n destinationInsertionPointsTable.set(node, undefined);\n }\n\
n // AllowedSelectors :\n // TypeSelector\n // *\n // ClassSelector\n
// IDSelector\n // AttributeSelector\n var selectorStartCharRe = /^[*.#[a
-zA-Z_|]/;\n\n function matches(node, contentElement) {\n var select = conte
ntElement.getAttribute('select');\n if (!select)\n return true;\n\n /
/ Here we know the select attribute is a non empty string.\n select = select.
trim();\n if (!select)\n return true;\n\n if (!(node instanceof Eleme
nt))\n return false;\n\n if (!selectorStartCharRe.test(select))\n r
eturn false;\n\n try {\n return node.matches(select);\n } catch (ex)
{\n // Invalid selector.\n return false;\n }\n }\n\n function isF
inalDestination(insertionPoint, node) {\n var points = getDestinationInsertio
nPoints(node);\n return points && points[points.length - 1] === insertionPoin
t;\n }\n\n function isInsertionPoint(node) {\n return node instanceof HTMLC
ontentElement ||\n node instanceof HTMLShadowElement;\n }\n\n functi
on isShadowHost(shadowHost) {\n return shadowHost.shadowRoot;\n }\n\n // Re
turns the shadow trees as an array, with the youngest tree at the\n // beginnin
g of the array.\n function getShadowTrees(host) {\n var trees = [];\n\n f
or (var tree = host.shadowRoot; tree; tree = tree.olderShadowRoot) {\n tree
s.push(tree);\n }\n return trees;\n }\n\n function render(host) {\n n
ew ShadowRenderer(host).render();\n };\n\n // Need to rerender shadow host whe
n:\n //\n // - a direct child to the ShadowRoot is added or removed\n // - a
direct child to the host is added or removed\n // - a new shadow root is create
d\n // - a direct child to a content/shadow element is added or removed\n // -
a sibling to a content/shadow element is added or removed\n // - content[selec
t] is changed\n // - an attribute in a direct child to a host is modified\n\n
/**\n * This gets called when a node was added or removed to it.\n */\n Nod
e.prototype.invalidateShadowRenderer = function(force) {\n var renderer = thi
s.impl.polymerShadowRenderer_;\n if (renderer) {\n renderer.invalidate()
;\n return true;\n }\n\n return false;\n };\n\n HTMLContentElement.
prototype.getDistributedNodes =\n HTMLShadowElement.prototype.getDistributedNod
es = function() {\n // TODO(arv): We should only rerender the dirty ancestor
renderers (from\n // the root and down).\n renderAllPending();\n return
getDistributedNodes(this);\n };\n\n Element.prototype.getDestinationInsertion
Points = function() {\n renderAllPending();\n return getDestinationInserti
onPoints(this) || [];\n };\n\n HTMLContentElement.prototype.nodeIsInserted_ =\
n HTMLShadowElement.prototype.nodeIsInserted_ = function() {\n // Invalidate
old renderer if any.\n this.invalidateShadowRenderer();\n\n var shadowRoo
t = getShadowRootAncestor(this);\n var renderer;\n if (shadowRoot)\n
renderer = getRendererForShadowRoot(shadowRoot);\n this.impl.polymerShadowRen
derer_ = renderer;\n if (renderer)\n renderer.invalidate();\n };\n\n s
cope.getRendererForHost = getRendererForHost;\n scope.getShadowTrees = getShado
wTrees;\n scope.renderAllPending = renderAllPending;\n\n scope.getDestinationI
nsertionPoints = getDestinationInsertionPoints;\n\n // Exposed for testing\n s
cope.visual = {\n insertBefore: insertBefore,\n remove: remove,\n };\n\n}
)(window.ShadowDOMPolyfill);\n", |
134 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var assert = scope.assert;\n var mixin = scope.mixin;\
n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n
var wrap = scope.wrap;\n\n var elementsWithFormProperty = [\n 'HTMLButtonEl
ement',\n 'HTMLFieldSetElement',\n 'HTMLInputElement',\n 'HTMLKeygenEle
ment',\n 'HTMLLabelElement',\n 'HTMLLegendElement',\n 'HTMLObjectElemen
t',\n // HTMLOptionElement is handled in HTMLOptionElement.js\n 'HTMLOutpu
tElement',\n // HTMLSelectElement is handled in HTMLSelectElement.js\n 'HT
MLTextAreaElement',\n ];\n\n function createWrapperConstructor(name) {\n if
(!window[name])\n return;\n\n // Ensure we are not overriding an alread
y existing constructor.\n assert(!scope.wrappers[name]);\n\n var Generated
Wrapper = function(node) {\n // At this point all of them extend HTMLElemen
t.\n HTMLElement.call(this, node);\n }\n GeneratedWrapper.prototype =
Object.create(HTMLElement.prototype);\n mixin(GeneratedWrapper.prototype, {\
n get form() {\n return wrap(unwrap(this).form);\n },\n });\
n\n registerWrapper(window[name], GeneratedWrapper,\n document.createE
lement(name.slice(4, -7)));\n scope.wrappers[name] = GeneratedWrapper;\n }\n
\n elementsWithFormProperty.forEach(createWrapperConstructor);\n\n})(window.Sha
dowDOMPolyfill);\n", | 133 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.
wrappers.HTMLElement;\n var assert = scope.assert;\n var mixin = scope.mixin;\
n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n
var wrap = scope.wrap;\n\n var elementsWithFormProperty = [\n 'HTMLButtonEl
ement',\n 'HTMLFieldSetElement',\n 'HTMLInputElement',\n 'HTMLKeygenEle
ment',\n 'HTMLLabelElement',\n 'HTMLLegendElement',\n 'HTMLObjectElemen
t',\n // HTMLOptionElement is handled in HTMLOptionElement.js\n 'HTMLOutpu
tElement',\n // HTMLSelectElement is handled in HTMLSelectElement.js\n 'HT
MLTextAreaElement',\n ];\n\n function createWrapperConstructor(name) {\n if
(!window[name])\n return;\n\n // Ensure we are not overriding an alread
y existing constructor.\n assert(!scope.wrappers[name]);\n\n var Generated
Wrapper = function(node) {\n // At this point all of them extend HTMLElemen
t.\n HTMLElement.call(this, node);\n }\n GeneratedWrapper.prototype =
Object.create(HTMLElement.prototype);\n mixin(GeneratedWrapper.prototype, {\
n get form() {\n return wrap(unwrap(this).form);\n },\n });\
n\n registerWrapper(window[name], GeneratedWrapper,\n document.createE
lement(name.slice(4, -7)));\n scope.wrappers[name] = GeneratedWrapper;\n }\n
\n elementsWithFormProperty.forEach(createWrapperConstructor);\n\n})(window.Sha
dowDOMPolyfill);\n", |
135 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc
ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope
.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalSelection = window.S
election;\n\n function Selection(impl) {\n this.impl = impl;\n }\n Selecti
on.prototype = {\n get anchorNode() {\n return wrap(this.impl.anchorNode
);\n },\n get focusNode() {\n return wrap(this.impl.focusNode);\n
},\n addRange: function(range) {\n this.impl.addRange(unwrap(range));\n
},\n collapse: function(node, index) {\n this.impl.collapse(unwrapIfN
eeded(node), index);\n },\n containsNode: function(node, allowPartial) {\n
return this.impl.containsNode(unwrapIfNeeded(node), allowPartial);\n },
\n extend: function(node, offset) {\n this.impl.extend(unwrapIfNeeded(no
de), offset);\n },\n getRangeAt: function(index) {\n return wrap(this
.impl.getRangeAt(index));\n },\n removeRange: function(range) {\n thi
s.impl.removeRange(unwrap(range));\n },\n selectAllChildren: function(node
) {\n this.impl.selectAllChildren(unwrapIfNeeded(node));\n },\n toStr
ing: function() {\n return this.impl.toString();\n }\n };\n\n // WebKi
t extensions. Not implemented.\n // readonly attribute Node baseNode;\n // rea
donly attribute long baseOffset;\n // readonly attribute Node extentNode;\n //
readonly attribute long extentOffset;\n // [RaisesException] void setBaseAndEx
tent([Default=Undefined] optional Node baseNode,\n // [De
fault=Undefined] optional long baseOffset,\n // [Default=
Undefined] optional Node extentNode,\n // [Default=Undefi
ned] optional long extentOffset);\n // [RaisesException, ImplementedAs=collapse
] void setPosition([Default=Undefined] optional Node node,\n //
[Default=Undefined] optional long offset);\n\n registerWrapper(window.Selecti
on, Selection, window.getSelection());\n\n scope.wrappers.Selection = Selection
;\n\n})(window.ShadowDOMPolyfill);\n", | 134 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc
ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope
.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalSelection = window.S
election;\n\n function Selection(impl) {\n this.impl = impl;\n }\n Selecti
on.prototype = {\n get anchorNode() {\n return wrap(this.impl.anchorNode
);\n },\n get focusNode() {\n return wrap(this.impl.focusNode);\n
},\n addRange: function(range) {\n this.impl.addRange(unwrap(range));\n
},\n collapse: function(node, index) {\n this.impl.collapse(unwrapIfN
eeded(node), index);\n },\n containsNode: function(node, allowPartial) {\n
return this.impl.containsNode(unwrapIfNeeded(node), allowPartial);\n },
\n extend: function(node, offset) {\n this.impl.extend(unwrapIfNeeded(no
de), offset);\n },\n getRangeAt: function(index) {\n return wrap(this
.impl.getRangeAt(index));\n },\n removeRange: function(range) {\n thi
s.impl.removeRange(unwrap(range));\n },\n selectAllChildren: function(node
) {\n this.impl.selectAllChildren(unwrapIfNeeded(node));\n },\n toStr
ing: function() {\n return this.impl.toString();\n }\n };\n\n // WebKi
t extensions. Not implemented.\n // readonly attribute Node baseNode;\n // rea
donly attribute long baseOffset;\n // readonly attribute Node extentNode;\n //
readonly attribute long extentOffset;\n // [RaisesException] void setBaseAndEx
tent([Default=Undefined] optional Node baseNode,\n // [De
fault=Undefined] optional long baseOffset,\n // [Default=
Undefined] optional Node extentNode,\n // [Default=Undefi
ned] optional long extentOffset);\n // [RaisesException, ImplementedAs=collapse
] void setPosition([Default=Undefined] optional Node node,\n //
[Default=Undefined] optional long offset);\n\n registerWrapper(window.Selecti
on, Selection, window.getSelection());\n\n scope.wrappers.Selection = Selection
;\n\n})(window.ShadowDOMPolyfill);\n", |
136 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa
ce = scope.GetElementsByInterface;\n var Node = scope.wrappers.Node;\n var Par
entNodeInterface = scope.ParentNodeInterface;\n var Selection = scope.wrappers.
Selection;\n var SelectorsInterface = scope.SelectorsInterface;\n var ShadowRo
ot = scope.wrappers.ShadowRoot;\n var TreeScope = scope.TreeScope;\n var clone
Node = scope.cloneNode;\n var defineWrapGetter = scope.defineWrapGetter;\n var
elementFromPoint = scope.elementFromPoint;\n var forwardMethodsToWrapper = sco
pe.forwardMethodsToWrapper;\n var matchesNames = scope.matchesNames;\n var mix
in = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderA
llPending = scope.renderAllPending;\n var rewrap = scope.rewrap;\n var unwrap
= scope.unwrap;\n var wrap = scope.wrap;\n var wrapEventTargetMethods = scope.
wrapEventTargetMethods;\n var wrapNodeList = scope.wrapNodeList;\n\n var imple
mentationTable = new WeakMap();\n\n function Document(node) {\n Node.call(th
is, node);\n this.treeScope_ = new TreeScope(this, null);\n }\n Document.pr
ototype = Object.create(Node.prototype);\n\n defineWrapGetter(Document, 'docume
ntElement');\n\n // Conceptually both body and head can be in a shadow but supo
rting that seems\n // overkill at this point.\n defineWrapGetter(Document, 'bo
dy');\n defineWrapGetter(Document, 'head');\n\n // document cannot be overridd
en so we override a bunch of its methods\n // directly on the instance.\n\n fu
nction wrapMethod(name) {\n var original = document[name];\n Document.prot
otype[name] = function() {\n return wrap(original.apply(this.impl, argument
s));\n };\n }\n\n [\n 'createComment',\n 'createDocumentFragment',\n
'createElement',\n 'createElementNS',\n 'createEvent',\n 'createEven
tNS',\n 'createRange',\n 'createTextNode',\n 'getElementById'\n ].forE
ach(wrapMethod);\n\n var originalAdoptNode = document.adoptNode;\n\n function
adoptNodeNoRemove(node, doc) {\n originalAdoptNode.call(doc.impl, unwrap(node
));\n adoptSubtree(node, doc);\n }\n\n function adoptSubtree(node, doc) {\n
if (node.shadowRoot)\n doc.adoptNode(node.shadowRoot);\n if (node in
stanceof ShadowRoot)\n adoptOlderShadowRoots(node, doc);\n for (var chil
d = node.firstChild; child; child = child.nextSibling) {\n adoptSubtree(chi
ld, doc);\n }\n }\n\n function adoptOlderShadowRoots(shadowRoot, doc) {\n
var oldShadowRoot = shadowRoot.olderShadowRoot;\n if (oldShadowRoot)\n
doc.adoptNode(oldShadowRoot);\n }\n\n var originalGetSelection = document.get
Selection;\n\n mixin(Document.prototype, {\n adoptNode: function(node) {\n
if (node.parentNode)\n node.parentNode.removeChild(node);\n adop
tNodeNoRemove(node, this);\n return node;\n },\n elementFromPoint: fu
nction(x, y) {\n return elementFromPoint(this, this, x, y);\n },\n im
portNode: function(node, deep) {\n return cloneNode(node, deep, this.impl);
\n },\n getSelection: function() {\n renderAllPending();\n retur
n new Selection(originalGetSelection.call(unwrap(this)));\n },\n getElemen
tsByName: function(name) {\n return SelectorsInterface.querySelectorAll.cal
l(this,\n '[name=' + JSON.stringify(String(name)) + ']');\n }\n });
\n\n if (document.registerElement) {\n var originalRegisterElement = documen
t.registerElement;\n Document.prototype.registerElement = function(tagName, o
bject) {\n var prototype, extendsOption;\n if (object !== undefined) {
\n prototype = object.prototype;\n extendsOption = object.extends;
\n }\n\n if (!prototype)\n prototype = Object.create(HTMLElemen
t.prototype);\n\n\n // If we already used the object as a prototype for ano
ther custom\n // element.\n if (scope.nativePrototypeTable.get(prototy
pe)) {\n // TODO(arv): DOMException\n throw new Error('NotSupporte
dError');\n }\n\n // Find first object on the prototype chain that alr
eady have a native\n // prototype. Keep track of all the objects before tha
t so we can create\n // a similar structure for the native case.\n var
proto = Object.getPrototypeOf(prototype);\n var nativePrototype;\n va
r prototypes = [];\n while (proto) {\n nativePrototype = scope.nativ
ePrototypeTable.get(proto);\n if (nativePrototype)\n break;\n
prototypes.push(proto);\n proto = Object.getPrototypeOf(proto);\n
}\n\n if (!nativePrototype) {\n // TODO(arv): DOMException\n
throw new Error('NotSupportedError');\n }\n\n // This works by crea
ting a new prototype object that is empty, but has\n // the native prototyp
e as its proto. The original prototype object\n // passed into register is
used as the wrapper prototype.\n\n var newPrototype = Object.create(nativeP
rototype);\n for (var i = prototypes.length - 1; i >= 0; i--) {\n ne
wPrototype = Object.create(newPrototype);\n }\n\n // Add callbacks if
present.\n // Names are taken from:\n // https://code.google.com/p/c
hromium/codesearch#chromium/src/third_party/WebKit/Source/bindings/v8/CustomElem
entConstructorBuilder.cpp&sq=package:chromium&type=cs&l=156\n // and not fr
om the spec since the spec is out of date.\n [\n 'createdCallback',\
n 'attachedCallback',\n 'detachedCallback',\n 'attributeCha
ngedCallback',\n ].forEach(function(name) {\n var f = prototype[name
];\n if (!f)\n return;\n newPrototype[name] = function()
{\n // if this element has been wrapped prior to registration,\n
// the wrapper is stale; in this case rewrap\n if (!(wrap(this) inst
anceof CustomElementConstructor)) {\n rewrap(this);\n }\n
f.apply(wrap(this), arguments);\n };\n });\n\n var p = {
prototype: newPrototype};\n if (extendsOption)\n p.extends = extends
Option;\n\n function CustomElementConstructor(node) {\n if (!node) {
\n if (extendsOption) {\n return document.createElement(exte
ndsOption, tagName);\n } else {\n return document.createElem
ent(tagName);\n }\n }\n this.impl = node;\n }\n
CustomElementConstructor.prototype = prototype;\n CustomElementConstructor
.prototype.constructor = CustomElementConstructor;\n\n scope.constructorTab
le.set(newPrototype, CustomElementConstructor);\n scope.nativePrototypeTabl
e.set(prototype, newPrototype);\n\n // registration is synchronous so do it
last\n var nativeConstructor = originalRegisterElement.call(unwrap(this),\
n tagName, p);\n return CustomElementConstructor;\n };\n\n f
orwardMethodsToWrapper([\n window.HTMLDocument || window.Document, // Geck
o adds these to HTMLDocument\n ], [\n 'registerElement',\n ]);\n }\n
\n // We also override some of the methods on document.body and document.head\n
// for convenience.\n forwardMethodsToWrapper([\n window.HTMLBodyElement,\
n window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocumen
t\n window.HTMLHeadElement,\n window.HTMLHtmlElement,\n ], [\n 'append
Child',\n 'compareDocumentPosition',\n 'contains',\n 'getElementsByClas
sName',\n 'getElementsByTagName',\n 'getElementsByTagNameNS',\n 'insert
Before',\n 'querySelector',\n 'querySelectorAll',\n 'removeChild',\n
'replaceChild',\n ].concat(matchesNames));\n\n forwardMethodsToWrapper([\n
window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocument\n
], [\n 'adoptNode',\n 'importNode',\n 'contains',\n 'createComment'
,\n 'createDocumentFragment',\n 'createElement',\n 'createElementNS',\n
'createEvent',\n 'createEventNS',\n 'createRange',\n 'createTextNod
e',\n 'elementFromPoint',\n 'getElementById',\n 'getElementsByName',\n
'getSelection',\n ]);\n\n mixin(Document.prototype, GetElementsByInterface)
;\n mixin(Document.prototype, ParentNodeInterface);\n mixin(Document.prototype
, SelectorsInterface);\n\n mixin(Document.prototype, {\n get implementation(
) {\n var implementation = implementationTable.get(this);\n if (implem
entation)\n return implementation;\n implementation =\n new
DOMImplementation(unwrap(this).implementation);\n implementationTable.set(
this, implementation);\n return implementation;\n },\n\n get defaultV
iew() {\n return wrap(unwrap(this).defaultView);\n }\n });\n\n registe
rWrapper(window.Document, Document,\n document.implementation.createHTMLDoc
ument(''));\n\n // Both WebKit and Gecko uses HTMLDocument for document. HTML5/
DOM only has\n // one Document interface and IE implements the standard correct
ly.\n if (window.HTMLDocument)\n registerWrapper(window.HTMLDocument, Docume
nt);\n\n wrapEventTargetMethods([\n window.HTMLBodyElement,\n window.HTML
Document || window.Document, // Gecko adds these to HTMLDocument\n window.HT
MLHeadElement,\n ]);\n\n function DOMImplementation(impl) {\n this.impl = i
mpl;\n }\n\n function wrapImplMethod(constructor, name) {\n var original =
document.implementation[name];\n constructor.prototype[name] = function() {\n
return wrap(original.apply(this.impl, arguments));\n };\n }\n\n funct
ion forwardImplMethod(constructor, name) {\n var original = document.implemen
tation[name];\n constructor.prototype[name] = function() {\n return orig
inal.apply(this.impl, arguments);\n };\n }\n\n wrapImplMethod(DOMImplementa
tion, 'createDocumentType');\n wrapImplMethod(DOMImplementation, 'createDocumen
t');\n wrapImplMethod(DOMImplementation, 'createHTMLDocument');\n forwardImplM
ethod(DOMImplementation, 'hasFeature');\n\n registerWrapper(window.DOMImplement
ation, DOMImplementation);\n\n forwardMethodsToWrapper([\n window.DOMImpleme
ntation,\n ], [\n 'createDocumentType',\n 'createDocument',\n 'createH
TMLDocument',\n 'hasFeature',\n ]);\n\n scope.adoptNodeNoRemove = adoptNode
NoRemove;\n scope.wrappers.DOMImplementation = DOMImplementation;\n scope.wrap
pers.Document = Document;\n\n})(window.ShadowDOMPolyfill);\n", | 135 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa
ce = scope.GetElementsByInterface;\n var Node = scope.wrappers.Node;\n var Par
entNodeInterface = scope.ParentNodeInterface;\n var Selection = scope.wrappers.
Selection;\n var SelectorsInterface = scope.SelectorsInterface;\n var ShadowRo
ot = scope.wrappers.ShadowRoot;\n var TreeScope = scope.TreeScope;\n var clone
Node = scope.cloneNode;\n var defineWrapGetter = scope.defineWrapGetter;\n var
elementFromPoint = scope.elementFromPoint;\n var forwardMethodsToWrapper = sco
pe.forwardMethodsToWrapper;\n var matchesNames = scope.matchesNames;\n var mix
in = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderA
llPending = scope.renderAllPending;\n var rewrap = scope.rewrap;\n var unwrap
= scope.unwrap;\n var wrap = scope.wrap;\n var wrapEventTargetMethods = scope.
wrapEventTargetMethods;\n var wrapNodeList = scope.wrapNodeList;\n\n var imple
mentationTable = new WeakMap();\n\n function Document(node) {\n Node.call(th
is, node);\n this.treeScope_ = new TreeScope(this, null);\n }\n Document.pr
ototype = Object.create(Node.prototype);\n\n defineWrapGetter(Document, 'docume
ntElement');\n\n // Conceptually both body and head can be in a shadow but supo
rting that seems\n // overkill at this point.\n defineWrapGetter(Document, 'bo
dy');\n defineWrapGetter(Document, 'head');\n\n // document cannot be overridd
en so we override a bunch of its methods\n // directly on the instance.\n\n fu
nction wrapMethod(name) {\n var original = document[name];\n Document.prot
otype[name] = function() {\n return wrap(original.apply(this.impl, argument
s));\n };\n }\n\n [\n 'createComment',\n 'createDocumentFragment',\n
'createElement',\n 'createElementNS',\n 'createEvent',\n 'createEven
tNS',\n 'createRange',\n 'createTextNode',\n 'getElementById'\n ].forE
ach(wrapMethod);\n\n var originalAdoptNode = document.adoptNode;\n\n function
adoptNodeNoRemove(node, doc) {\n originalAdoptNode.call(doc.impl, unwrap(node
));\n adoptSubtree(node, doc);\n }\n\n function adoptSubtree(node, doc) {\n
if (node.shadowRoot)\n doc.adoptNode(node.shadowRoot);\n if (node in
stanceof ShadowRoot)\n adoptOlderShadowRoots(node, doc);\n for (var chil
d = node.firstChild; child; child = child.nextSibling) {\n adoptSubtree(chi
ld, doc);\n }\n }\n\n function adoptOlderShadowRoots(shadowRoot, doc) {\n
var oldShadowRoot = shadowRoot.olderShadowRoot;\n if (oldShadowRoot)\n
doc.adoptNode(oldShadowRoot);\n }\n\n var originalGetSelection = document.get
Selection;\n\n mixin(Document.prototype, {\n adoptNode: function(node) {\n
if (node.parentNode)\n node.parentNode.removeChild(node);\n adop
tNodeNoRemove(node, this);\n return node;\n },\n elementFromPoint: fu
nction(x, y) {\n return elementFromPoint(this, this, x, y);\n },\n im
portNode: function(node, deep) {\n return cloneNode(node, deep, this.impl);
\n },\n getSelection: function() {\n renderAllPending();\n retur
n new Selection(originalGetSelection.call(unwrap(this)));\n },\n getElemen
tsByName: function(name) {\n return SelectorsInterface.querySelectorAll.cal
l(this,\n '[name=' + JSON.stringify(String(name)) + ']');\n }\n });
\n\n if (document.registerElement) {\n var originalRegisterElement = documen
t.registerElement;\n Document.prototype.registerElement = function(tagName, o
bject) {\n var prototype, extendsOption;\n if (object !== undefined) {
\n prototype = object.prototype;\n extendsOption = object.extends;
\n }\n\n if (!prototype)\n prototype = Object.create(HTMLElemen
t.prototype);\n\n\n // If we already used the object as a prototype for ano
ther custom\n // element.\n if (scope.nativePrototypeTable.get(prototy
pe)) {\n // TODO(arv): DOMException\n throw new Error('NotSupporte
dError');\n }\n\n // Find first object on the prototype chain that alr
eady have a native\n // prototype. Keep track of all the objects before tha
t so we can create\n // a similar structure for the native case.\n var
proto = Object.getPrototypeOf(prototype);\n var nativePrototype;\n va
r prototypes = [];\n while (proto) {\n nativePrototype = scope.nativ
ePrototypeTable.get(proto);\n if (nativePrototype)\n break;\n
prototypes.push(proto);\n proto = Object.getPrototypeOf(proto);\n
}\n\n if (!nativePrototype) {\n // TODO(arv): DOMException\n
throw new Error('NotSupportedError');\n }\n\n // This works by crea
ting a new prototype object that is empty, but has\n // the native prototyp
e as its proto. The original prototype object\n // passed into register is
used as the wrapper prototype.\n\n var newPrototype = Object.create(nativeP
rototype);\n for (var i = prototypes.length - 1; i >= 0; i--) {\n ne
wPrototype = Object.create(newPrototype);\n }\n\n // Add callbacks if
present.\n // Names are taken from:\n // https://code.google.com/p/c
hromium/codesearch#chromium/src/third_party/WebKit/Source/bindings/v8/CustomElem
entConstructorBuilder.cpp&sq=package:chromium&type=cs&l=156\n // and not fr
om the spec since the spec is out of date.\n [\n 'createdCallback',\
n 'attachedCallback',\n 'detachedCallback',\n 'attributeCha
ngedCallback',\n ].forEach(function(name) {\n var f = prototype[name
];\n if (!f)\n return;\n newPrototype[name] = function()
{\n // if this element has been wrapped prior to registration,\n
// the wrapper is stale; in this case rewrap\n if (!(wrap(this) inst
anceof CustomElementConstructor)) {\n rewrap(this);\n }\n
f.apply(wrap(this), arguments);\n };\n });\n\n var p = {
prototype: newPrototype};\n if (extendsOption)\n p.extends = extends
Option;\n\n function CustomElementConstructor(node) {\n if (!node) {
\n if (extendsOption) {\n return document.createElement(exte
ndsOption, tagName);\n } else {\n return document.createElem
ent(tagName);\n }\n }\n this.impl = node;\n }\n
CustomElementConstructor.prototype = prototype;\n CustomElementConstructor
.prototype.constructor = CustomElementConstructor;\n\n scope.constructorTab
le.set(newPrototype, CustomElementConstructor);\n scope.nativePrototypeTabl
e.set(prototype, newPrototype);\n\n // registration is synchronous so do it
last\n var nativeConstructor = originalRegisterElement.call(unwrap(this),\
n tagName, p);\n return CustomElementConstructor;\n };\n\n f
orwardMethodsToWrapper([\n window.HTMLDocument || window.Document, // Geck
o adds these to HTMLDocument\n ], [\n 'registerElement',\n ]);\n }\n
\n // We also override some of the methods on document.body and document.head\n
// for convenience.\n forwardMethodsToWrapper([\n window.HTMLBodyElement,\
n window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocumen
t\n window.HTMLHeadElement,\n window.HTMLHtmlElement,\n ], [\n 'append
Child',\n 'compareDocumentPosition',\n 'contains',\n 'getElementsByClas
sName',\n 'getElementsByTagName',\n 'getElementsByTagNameNS',\n 'insert
Before',\n 'querySelector',\n 'querySelectorAll',\n 'removeChild',\n
'replaceChild',\n ].concat(matchesNames));\n\n forwardMethodsToWrapper([\n
window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocument\n
], [\n 'adoptNode',\n 'importNode',\n 'contains',\n 'createComment'
,\n 'createDocumentFragment',\n 'createElement',\n 'createElementNS',\n
'createEvent',\n 'createEventNS',\n 'createRange',\n 'createTextNod
e',\n 'elementFromPoint',\n 'getElementById',\n 'getElementsByName',\n
'getSelection',\n ]);\n\n mixin(Document.prototype, GetElementsByInterface)
;\n mixin(Document.prototype, ParentNodeInterface);\n mixin(Document.prototype
, SelectorsInterface);\n\n mixin(Document.prototype, {\n get implementation(
) {\n var implementation = implementationTable.get(this);\n if (implem
entation)\n return implementation;\n implementation =\n new
DOMImplementation(unwrap(this).implementation);\n implementationTable.set(
this, implementation);\n return implementation;\n },\n\n get defaultV
iew() {\n return wrap(unwrap(this).defaultView);\n }\n });\n\n registe
rWrapper(window.Document, Document,\n document.implementation.createHTMLDoc
ument(''));\n\n // Both WebKit and Gecko uses HTMLDocument for document. HTML5/
DOM only has\n // one Document interface and IE implements the standard correct
ly.\n if (window.HTMLDocument)\n registerWrapper(window.HTMLDocument, Docume
nt);\n\n wrapEventTargetMethods([\n window.HTMLBodyElement,\n window.HTML
Document || window.Document, // Gecko adds these to HTMLDocument\n window.HT
MLHeadElement,\n ]);\n\n function DOMImplementation(impl) {\n this.impl = i
mpl;\n }\n\n function wrapImplMethod(constructor, name) {\n var original =
document.implementation[name];\n constructor.prototype[name] = function() {\n
return wrap(original.apply(this.impl, arguments));\n };\n }\n\n funct
ion forwardImplMethod(constructor, name) {\n var original = document.implemen
tation[name];\n constructor.prototype[name] = function() {\n return orig
inal.apply(this.impl, arguments);\n };\n }\n\n wrapImplMethod(DOMImplementa
tion, 'createDocumentType');\n wrapImplMethod(DOMImplementation, 'createDocumen
t');\n wrapImplMethod(DOMImplementation, 'createHTMLDocument');\n forwardImplM
ethod(DOMImplementation, 'hasFeature');\n\n registerWrapper(window.DOMImplement
ation, DOMImplementation);\n\n forwardMethodsToWrapper([\n window.DOMImpleme
ntation,\n ], [\n 'createDocumentType',\n 'createDocument',\n 'createH
TMLDocument',\n 'hasFeature',\n ]);\n\n scope.adoptNodeNoRemove = adoptNode
NoRemove;\n scope.wrappers.DOMImplementation = DOMImplementation;\n scope.wrap
pers.Document = Document;\n\n})(window.ShadowDOMPolyfill);\n", |
137 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope.
wrappers.EventTarget;\n var Selection = scope.wrappers.Selection;\n var mixin
= scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderAllP
ending = scope.renderAllPending;\n var unwrap = scope.unwrap;\n var unwrapIfNe
eded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWindow =
window.Window;\n var originalGetComputedStyle = window.getComputedStyle;\n va
r originalGetSelection = window.getSelection;\n\n function Window(impl) {\n
EventTarget.call(this, impl);\n }\n Window.prototype = Object.create(EventTarg
et.prototype);\n\n OriginalWindow.prototype.getComputedStyle = function(el, pse
udo) {\n return wrap(this || window).getComputedStyle(unwrapIfNeeded(el), pse
udo);\n };\n\n OriginalWindow.prototype.getSelection = function() {\n retur
n wrap(this || window).getSelection();\n };\n\n // Work around for https://bug
zilla.mozilla.org/show_bug.cgi?id=943065\n delete window.getComputedStyle;\n d
elete window.getSelection;\n\n ['addEventListener', 'removeEventListener', 'dis
patchEvent'].forEach(\n function(name) {\n OriginalWindow.prototype[
name] = function() {\n var w = wrap(this || window);\n return
w[name].apply(w, arguments);\n };\n\n // Work around for https://b
ugzilla.mozilla.org/show_bug.cgi?id=943065\n delete window[name];\n
});\n\n mixin(Window.prototype, {\n getComputedStyle: function(el, pseudo) {
\n renderAllPending();\n return originalGetComputedStyle.call(unwrap(t
his), unwrapIfNeeded(el),\n pseudo);\n
},\n getSelection: function() {\n renderAllPending();\n return
new Selection(originalGetSelection.call(unwrap(this)));\n },\n\n get docum
ent() {\n return wrap(unwrap(this).document);\n }\n });\n\n registerWr
apper(OriginalWindow, Window, window);\n\n scope.wrappers.Window = Window;\n\n}
)(window.ShadowDOMPolyfill);\n", | 136 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope.
wrappers.EventTarget;\n var Selection = scope.wrappers.Selection;\n var mixin
= scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderAllP
ending = scope.renderAllPending;\n var unwrap = scope.unwrap;\n var unwrapIfNe
eded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWindow =
window.Window;\n var originalGetComputedStyle = window.getComputedStyle;\n va
r originalGetDefaultComputedStyle = window.getDefaultComputedStyle;\n var origi
nalGetSelection = window.getSelection;\n\n function Window(impl) {\n EventTa
rget.call(this, impl);\n }\n Window.prototype = Object.create(EventTarget.prot
otype);\n\n OriginalWindow.prototype.getComputedStyle = function(el, pseudo) {\
n return wrap(this || window).getComputedStyle(unwrapIfNeeded(el), pseudo);\n
};\n\n // Mozilla proprietary extension.\n if (originalGetDefaultComputedSty
le) {\n OriginalWindow.prototype.getDefaultComputedStyle = function(el, pseud
o) {\n return wrap(this || window).getDefaultComputedStyle(\n unwr
apIfNeeded(el), pseudo);\n };\n }\n\n OriginalWindow.prototype.getSelection
= function() {\n return wrap(this || window).getSelection();\n };\n\n // W
ork around for https://bugzilla.mozilla.org/show_bug.cgi?id=943065\n delete win
dow.getComputedStyle;\n delete window.getSelection;\n\n ['addEventListener', '
removeEventListener', 'dispatchEvent'].forEach(\n function(name) {\n
OriginalWindow.prototype[name] = function() {\n var w = wrap(this || w
indow);\n return w[name].apply(w, arguments);\n };\n\n //
Work around for https://bugzilla.mozilla.org/show_bug.cgi?id=943065\n de
lete window[name];\n });\n\n mixin(Window.prototype, {\n getComputedSty
le: function(el, pseudo) {\n renderAllPending();\n return originalGetC
omputedStyle.call(unwrap(this), unwrapIfNeeded(el),\n
pseudo);\n },\n getSelection: function() {\n renderAl
lPending();\n return new Selection(originalGetSelection.call(unwrap(this)))
;\n },\n\n get document() {\n return wrap(unwrap(this).document);\n
}\n });\n\n // Mozilla proprietary extension.\n if (originalGetDefaultCompu
tedStyle) {\n Window.prototype.getDefaultComputedStyle = function(el, pseudo)
{\n renderAllPending();\n return originalGetDefaultComputedStyle.call
(unwrap(this),\n unwrapIfNeeded(el),pseudo);\n };\n }\n\n register
Wrapper(OriginalWindow, Window, window);\n\n scope.wrappers.Window = Window;\n\
n})(window.ShadowDOMPolyfill);\n", |
138 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var unwrap = s
cope.unwrap;\n\n // DataTransfer (Clipboard in old Blink/WebKit) has a single m
ethod that\n // requires wrapping. Since it is only a method we do not need a r
eal wrapper,\n // we can just override the method.\n\n var OriginalDataTransfe
r = window.DataTransfer || window.Clipboard;\n var OriginalDataTransferSetDragI
mage =\n OriginalDataTransfer.prototype.setDragImage;\n\n if (OriginalData
TransferSetDragImage) {\n OriginalDataTransfer.prototype.setDragImage = funct
ion(image, x, y) {\n OriginalDataTransferSetDragImage.call(this, unwrap(ima
ge), x, y);\n };\n }\n\n})(window.ShadowDOMPolyfill);\n", | 137 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var unwrap = s
cope.unwrap;\n\n // DataTransfer (Clipboard in old Blink/WebKit) has a single m
ethod that\n // requires wrapping. Since it is only a method we do not need a r
eal wrapper,\n // we can just override the method.\n\n var OriginalDataTransfe
r = window.DataTransfer || window.Clipboard;\n var OriginalDataTransferSetDragI
mage =\n OriginalDataTransfer.prototype.setDragImage;\n\n if (OriginalData
TransferSetDragImage) {\n OriginalDataTransfer.prototype.setDragImage = funct
ion(image, x, y) {\n OriginalDataTransferSetDragImage.call(this, unwrap(ima
ge), x, y);\n };\n }\n\n})(window.ShadowDOMPolyfill);\n", |
139 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var registerWr
apper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n\n var OriginalFo
rmData = window.FormData;\n\n function FormData(formElement) {\n this.impl =
new OriginalFormData(formElement && unwrap(formElement));\n }\n\n registerWra
pper(OriginalFormData, FormData, new OriginalFormData());\n\n scope.wrappers.Fo
rmData = FormData;\n\n})(window.ShadowDOMPolyfill);\n", | 138 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in t
he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var registerWr
apper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n\n var OriginalFo
rmData = window.FormData;\n\n function FormData(formElement) {\n if (formEle
ment instanceof OriginalFormData)\n this.impl = formElement;\n else\n
this.impl = new OriginalFormData(formElement && unwrap(formElement));\n }\n\
n registerWrapper(OriginalFormData, FormData, new OriginalFormData());\n\n sco
pe.wrappers.FormData = FormData;\n\n})(window.ShadowDOMPolyfill);\n", |
140 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var isWrapperFor = scope
.isWrapperFor;\n\n // This is a list of the elements we currently override the
global constructor\n // for.\n var elements = {\n 'a': 'HTMLAnchorElement',
\n // Do not create an applet element by default since it shows a warning in\
n // IE.\n // https://github.com/Polymer/polymer/issues/217\n // 'apple
t': 'HTMLAppletElement',\n 'area': 'HTMLAreaElement',\n 'audio': 'HTMLAudi
oElement',\n 'base': 'HTMLBaseElement',\n 'body': 'HTMLBodyElement',\n
'br': 'HTMLBRElement',\n 'button': 'HTMLButtonElement',\n 'canvas': 'HTMLC
anvasElement',\n 'caption': 'HTMLTableCaptionElement',\n 'col': 'HTMLTable
ColElement',\n // 'command': 'HTMLCommandElement', // Not fully implemented
in Gecko.\n 'content': 'HTMLContentElement',\n 'data': 'HTMLDataElement',\
n 'datalist': 'HTMLDataListElement',\n 'del': 'HTMLModElement',\n 'dir'
: 'HTMLDirectoryElement',\n 'div': 'HTMLDivElement',\n 'dl': 'HTMLDListEle
ment',\n 'embed': 'HTMLEmbedElement',\n 'fieldset': 'HTMLFieldSetElement',
\n 'font': 'HTMLFontElement',\n 'form': 'HTMLFormElement',\n 'frame': '
HTMLFrameElement',\n 'frameset': 'HTMLFrameSetElement',\n 'h1': 'HTMLHeadi
ngElement',\n 'head': 'HTMLHeadElement',\n 'hr': 'HTMLHRElement',\n 'ht
ml': 'HTMLHtmlElement',\n 'iframe': 'HTMLIFrameElement',\n 'img': 'HTMLIma
geElement',\n 'input': 'HTMLInputElement',\n 'keygen': 'HTMLKeygenElement'
,\n 'label': 'HTMLLabelElement',\n 'legend': 'HTMLLegendElement',\n 'li
': 'HTMLLIElement',\n 'link': 'HTMLLinkElement',\n 'map': 'HTMLMapElement'
,\n 'marquee': 'HTMLMarqueeElement',\n 'menu': 'HTMLMenuElement',\n 'me
nuitem': 'HTMLMenuItemElement',\n 'meta': 'HTMLMetaElement',\n 'meter': 'H
TMLMeterElement',\n 'object': 'HTMLObjectElement',\n 'ol': 'HTMLOListEleme
nt',\n 'optgroup': 'HTMLOptGroupElement',\n 'option': 'HTMLOptionElement',
\n 'output': 'HTMLOutputElement',\n 'p': 'HTMLParagraphElement',\n 'par
am': 'HTMLParamElement',\n 'pre': 'HTMLPreElement',\n 'progress': 'HTMLPro
gressElement',\n 'q': 'HTMLQuoteElement',\n 'script': 'HTMLScriptElement',
\n 'select': 'HTMLSelectElement',\n 'shadow': 'HTMLShadowElement',\n 's
ource': 'HTMLSourceElement',\n 'span': 'HTMLSpanElement',\n 'style': 'HTML
StyleElement',\n 'table': 'HTMLTableElement',\n 'tbody': 'HTMLTableSection
Element',\n // WebKit and Moz are wrong:\n // https://bugs.webkit.org/show
_bug.cgi?id=111469\n // https://bugzilla.mozilla.org/show_bug.cgi?id=848096\n
// 'td': 'HTMLTableCellElement',\n 'template': 'HTMLTemplateElement',\n
'textarea': 'HTMLTextAreaElement',\n 'thead': 'HTMLTableSectionElement',\n
'time': 'HTMLTimeElement',\n 'title': 'HTMLTitleElement',\n 'tr': 'HTML
TableRowElement',\n 'track': 'HTMLTrackElement',\n 'ul': 'HTMLUListElement
',\n 'video': 'HTMLVideoElement',\n };\n\n function overrideConstructor(tag
Name) {\n var nativeConstructorName = elements[tagName];\n var nativeConst
ructor = window[nativeConstructorName];\n if (!nativeConstructor)\n retu
rn;\n var element = document.createElement(tagName);\n var wrapperConstruc
tor = element.constructor;\n window[nativeConstructorName] = wrapperConstruct
or;\n }\n\n Object.keys(elements).forEach(overrideConstructor);\n\n Object.ge
tOwnPropertyNames(scope.wrappers).forEach(function(name) {\n window[name] = s
cope.wrappers[name]\n });\n\n})(window.ShadowDOMPolyfill);\n", | 139 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this
source code is goverened by a BSD-style\n// license that can be found in the LI
CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var isWrapperFor = scope
.isWrapperFor;\n\n // This is a list of the elements we currently override the
global constructor\n // for.\n var elements = {\n 'a': 'HTMLAnchorElement',
\n // Do not create an applet element by default since it shows a warning in\
n // IE.\n // https://github.com/Polymer/polymer/issues/217\n // 'apple
t': 'HTMLAppletElement',\n 'area': 'HTMLAreaElement',\n 'audio': 'HTMLAudi
oElement',\n 'base': 'HTMLBaseElement',\n 'body': 'HTMLBodyElement',\n
'br': 'HTMLBRElement',\n 'button': 'HTMLButtonElement',\n 'canvas': 'HTMLC
anvasElement',\n 'caption': 'HTMLTableCaptionElement',\n 'col': 'HTMLTable
ColElement',\n // 'command': 'HTMLCommandElement', // Not fully implemented
in Gecko.\n 'content': 'HTMLContentElement',\n 'data': 'HTMLDataElement',\
n 'datalist': 'HTMLDataListElement',\n 'del': 'HTMLModElement',\n 'dir'
: 'HTMLDirectoryElement',\n 'div': 'HTMLDivElement',\n 'dl': 'HTMLDListEle
ment',\n 'embed': 'HTMLEmbedElement',\n 'fieldset': 'HTMLFieldSetElement',
\n 'font': 'HTMLFontElement',\n 'form': 'HTMLFormElement',\n 'frame': '
HTMLFrameElement',\n 'frameset': 'HTMLFrameSetElement',\n 'h1': 'HTMLHeadi
ngElement',\n 'head': 'HTMLHeadElement',\n 'hr': 'HTMLHRElement',\n 'ht
ml': 'HTMLHtmlElement',\n 'iframe': 'HTMLIFrameElement',\n 'img': 'HTMLIma
geElement',\n 'input': 'HTMLInputElement',\n 'keygen': 'HTMLKeygenElement'
,\n 'label': 'HTMLLabelElement',\n 'legend': 'HTMLLegendElement',\n 'li
': 'HTMLLIElement',\n 'link': 'HTMLLinkElement',\n 'map': 'HTMLMapElement'
,\n 'marquee': 'HTMLMarqueeElement',\n 'menu': 'HTMLMenuElement',\n 'me
nuitem': 'HTMLMenuItemElement',\n 'meta': 'HTMLMetaElement',\n 'meter': 'H
TMLMeterElement',\n 'object': 'HTMLObjectElement',\n 'ol': 'HTMLOListEleme
nt',\n 'optgroup': 'HTMLOptGroupElement',\n 'option': 'HTMLOptionElement',
\n 'output': 'HTMLOutputElement',\n 'p': 'HTMLParagraphElement',\n 'par
am': 'HTMLParamElement',\n 'pre': 'HTMLPreElement',\n 'progress': 'HTMLPro
gressElement',\n 'q': 'HTMLQuoteElement',\n 'script': 'HTMLScriptElement',
\n 'select': 'HTMLSelectElement',\n 'shadow': 'HTMLShadowElement',\n 's
ource': 'HTMLSourceElement',\n 'span': 'HTMLSpanElement',\n 'style': 'HTML
StyleElement',\n 'table': 'HTMLTableElement',\n 'tbody': 'HTMLTableSection
Element',\n // WebKit and Moz are wrong:\n // https://bugs.webkit.org/show
_bug.cgi?id=111469\n // https://bugzilla.mozilla.org/show_bug.cgi?id=848096\n
// 'td': 'HTMLTableCellElement',\n 'template': 'HTMLTemplateElement',\n
'textarea': 'HTMLTextAreaElement',\n 'thead': 'HTMLTableSectionElement',\n
'time': 'HTMLTimeElement',\n 'title': 'HTMLTitleElement',\n 'tr': 'HTML
TableRowElement',\n 'track': 'HTMLTrackElement',\n 'ul': 'HTMLUListElement
',\n 'video': 'HTMLVideoElement',\n };\n\n function overrideConstructor(tag
Name) {\n var nativeConstructorName = elements[tagName];\n var nativeConst
ructor = window[nativeConstructorName];\n if (!nativeConstructor)\n retu
rn;\n var element = document.createElement(tagName);\n var wrapperConstruc
tor = element.constructor;\n window[nativeConstructorName] = wrapperConstruct
or;\n }\n\n Object.keys(elements).forEach(overrideConstructor);\n\n Object.ge
tOwnPropertyNames(scope.wrappers).forEach(function(name) {\n window[name] = s
cope.wrappers[name]\n });\n\n})(window.ShadowDOMPolyfill);\n", |
141 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n /
/ convenient global\n window.wrap = ShadowDOMPolyfill.wrapIfNeeded;\n window.u
nwrap = ShadowDOMPolyfill.unwrapIfNeeded;\n\n // users may want to customize ot
her types\n // TODO(sjmiles): 'button' is now supported by ShadowDOMPolyfill, b
ut\n // I've left this code here in case we need to temporarily patch another\n
// type\n /*\n (function() {\n var elts = {HTMLButtonElement: 'button'};\
n for (var c in elts) {\n window[c] = function() { throw 'Patched Constr
uctor'; };\n window[c].prototype = Object.getPrototypeOf(\n docume
nt.createElement(elts[c]));\n }\n })();\n */\n\n // patch in prefixed name
\n Object.defineProperty(Element.prototype, 'webkitShadowRoot',\n Object.g
etOwnPropertyDescriptor(Element.prototype, 'shadowRoot'));\n\n var originalCrea
teShadowRoot = Element.prototype.createShadowRoot;\n Element.prototype.createSh
adowRoot = function() {\n var root = originalCreateShadowRoot.call(this);\n
CustomElements.watchShadow(this);\n return root;\n };\n\n Element.prototy
pe.webkitCreateShadowRoot = Element.prototype.createShadowRoot;\n\n function qu
eryShadow(node, selector) {\n var m, el = node.firstElementChild;\n var sh
adows, sr, i;\n shadows = [];\n sr = node.shadowRoot;\n while(sr) {\n
shadows.push(sr);\n sr = sr.olderShadowRoot;\n }\n for(i = shadow
s.length - 1; i >= 0; i--) {\n m = shadows[i].querySelector(selector);\n
if (m) {\n return m;\n }\n }\n while(el) {\n m = query
Shadow(el, selector);\n if (m) {\n return m;\n }\n el = el
.nextElementSibling;\n }\n return null;\n }\n\n function queryAllShadows
(node, selector, results) {\n var el = node.firstElementChild;\n var temp,
sr, shadows, i, j;\n shadows = [];\n sr = node.shadowRoot;\n while(sr)
{\n shadows.push(sr);\n sr = sr.olderShadowRoot;\n }\n for (i =
shadows.length - 1; i >= 0; i--) {\n temp = shadows[i].querySelectorAll(se
lector);\n for(j = 0; j < temp.length; j++) {\n results.push(temp[j]
);\n }\n }\n while (el) {\n queryAllShadows(el, selector, result
s);\n el = el.nextElementSibling;\n }\n return results;\n }\n\n sco
pe.queryAllShadows = function(node, selector, all) {\n if (all) {\n retu
rn queryAllShadows(node, selector, []);\n } else {\n return queryShadow(
node, selector);\n }\n };\n})(window.Platform);\n", | 140 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n /
/ convenient global\n window.wrap = ShadowDOMPolyfill.wrapIfNeeded;\n window.u
nwrap = ShadowDOMPolyfill.unwrapIfNeeded;\n\n // users may want to customize ot
her types\n // TODO(sjmiles): 'button' is now supported by ShadowDOMPolyfill, b
ut\n // I've left this code here in case we need to temporarily patch another\n
// type\n /*\n (function() {\n var elts = {HTMLButtonElement: 'button'};\
n for (var c in elts) {\n window[c] = function() { throw 'Patched Constr
uctor'; };\n window[c].prototype = Object.getPrototypeOf(\n docume
nt.createElement(elts[c]));\n }\n })();\n */\n\n // patch in prefixed name
\n Object.defineProperty(Element.prototype, 'webkitShadowRoot',\n Object.g
etOwnPropertyDescriptor(Element.prototype, 'shadowRoot'));\n\n var originalCrea
teShadowRoot = Element.prototype.createShadowRoot;\n Element.prototype.createSh
adowRoot = function() {\n var root = originalCreateShadowRoot.call(this);\n
CustomElements.watchShadow(this);\n return root;\n };\n\n Element.prototy
pe.webkitCreateShadowRoot = Element.prototype.createShadowRoot;\n\n function qu
eryShadow(node, selector) {\n var m, el = node.firstElementChild;\n var sh
adows, sr, i;\n shadows = [];\n sr = node.shadowRoot;\n while(sr) {\n
shadows.push(sr);\n sr = sr.olderShadowRoot;\n }\n for(i = shadow
s.length - 1; i >= 0; i--) {\n m = shadows[i].querySelector(selector);\n
if (m) {\n return m;\n }\n }\n while(el) {\n m = query
Shadow(el, selector);\n if (m) {\n return m;\n }\n el = el
.nextElementSibling;\n }\n return null;\n }\n\n function queryAllShadows
(node, selector, results) {\n var el = node.firstElementChild;\n var temp,
sr, shadows, i, j;\n shadows = [];\n sr = node.shadowRoot;\n while(sr)
{\n shadows.push(sr);\n sr = sr.olderShadowRoot;\n }\n for (i =
shadows.length - 1; i >= 0; i--) {\n temp = shadows[i].querySelectorAll(se
lector);\n for(j = 0; j < temp.length; j++) {\n results.push(temp[j]
);\n }\n }\n while (el) {\n queryAllShadows(el, selector, result
s);\n el = el.nextElementSibling;\n }\n return results;\n }\n\n sco
pe.queryAllShadows = function(node, selector, all) {\n if (all) {\n retu
rn queryAllShadows(node, selector, []);\n } else {\n return queryShadow(
node, selector);\n }\n };\n})(window.Platform);\n", |
142 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n/*\n This is a limited s
him for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/
tip/spec/shadow/index.html#styles\n \n The intention here is to support only t
he styling features which can be \n relatively simply implemented. The goal is
to allow users to avoid the \n most obvious pitfalls and do so without compromi
sing performance significantly. \n For ShadowDOM styling that's not covered her
e, a set of best practices\n can be provided that should allow users to accompl
ish more complex styling.\n\n The following is a list of specific ShadowDOM sty
ling features and a brief\n discussion of the approach used to shim.\n\n Shimm
ed features:\n\n * :host, :host-context: ShadowDOM allows styling of the shadow
Root's host\n element using the :host rule. To shim this feature, the :host sty
les are \n reformatted and prefixed with a given scope name and promoted to a \
n document level stylesheet.\n For example, given a scope name of .foo, a rule
like this:\n \n :host {\n background: red;\n }\n }\n \n be
comes:\n \n .foo {\n background: red;\n }\n \n * encapsultion: Sty
les defined within ShadowDOM, apply only to \n dom inside the ShadowDOM. Polyme
r uses one of two techniques to imlement\n this feature.\n \n By default, rul
es are prefixed with the host element tag name \n as a descendant selector. Thi
s ensures styling does not leak out of the 'top'\n of the element's ShadowDOM.
For example,\n\n div {\n font-weight: bold;\n }\n \n becomes:\n\n x-
foo div {\n font-weight: bold;\n }\n \n becomes:\n\n\n Alternatively,
if Platform.ShadowCSS.strictStyling is set to true then \n selectors are scope
d by adding an attribute selector suffix to each\n simple selector that contain
s the host element tag name. Each element \n in the element's ShadowDOM templat
e is also given the scope attribute. \n Thus, these rules match only elements t
hat have the scope attribute.\n For example, given a scope name of x-foo, a rul
e like this:\n \n div {\n font-weight: bold;\n }\n \n becomes:\n
\n div[x-foo] {\n font-weight: bold;\n }\n\n Note that elements that
are dynamically added to a scope must have the scope\n selector added to them
manually.\n\n * upper/lower bound encapsulation: Styles which are defined outsi
de a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\
n inside a shadowRoot.\n\n This styling behavior is not emulated. Some possibl
e ways to do this that \n were rejected due to complexity and/or performance co
ncerns include: (1) reset\n every possible property for every possible selector
for a given scope name;\n (2) re-implement css in javascript.\n \n As an alt
ernative, users should make sure to use selectors\n specific to the scope in wh
ich they are working.\n \n * ::distributed: This behavior is not emulated. It'
s often not necessary\n to style the contents of a specific insertion point and
instead, descendants\n of the host element can be styled selectively. Users ca
n also create an \n extra node around an insertion point and style that node's
contents\n via descendent selectors. For example, with a shadowRoot like this:\
n \n <style>\n ::content(div) {\n background: red;\n }\n
</style>\n <content></content>\n \n could become:\n \n <style>\n
/ *@polyfill .content-container div * / \n ::content(div) {\n backgr
ound: red;\n }\n </style>\n <div class=\"content-container\">\n
<content></content>\n </div>\n \n Note the use of @polyfill in the comment
above a ShadowDOM specific style\n declaration. This is a directive to the styl
ing shim to use the selector \n in comments in lieu of the next selector when r
unning under polyfill.\n*/\n(function(scope) {\n\nvar ShadowCSS = {\n strictSty
ling: false,\n registry: {},\n // Shim styles for a given root associated with
a name and extendsName\n // 1. cache root styles by name\n // 2. optionally t
ag root nodes with scope name\n // 3. shim polyfill directives /* @polyfill */
and /* @polyfill-rule */\n // 4. shim :host and scoping\n shimStyling: functio
n(root, name, extendsName) {\n var scopeStyles = this.prepareRoot(root, name,
extendsName);\n var typeExtension = this.isTypeExtension(extendsName);\n
var scopeSelector = this.makeScopeSelector(name, typeExtension);\n // use cac
hing to make working with styles nodes easier and to facilitate\n // lookup o
f extendee\n var cssText = stylesToCssText(scopeStyles, true);\n cssText =
this.scopeCssText(cssText, scopeSelector);\n // cache shimmed css on root fo
r user extensibility\n if (root) {\n root.shimmedStyle = cssText;\n }
\n // add style to document\n this.addCssToDocument(cssText, name);\n },\
n /*\n * Shim a style element with the given selector. Returns cssText that ca
n\n * be included in the document via Platform.ShadowCSS.addCssToDocument(css).
\n */\n shimStyle: function(style, selector) {\n return this.shimCssText(st
yle.textContent, selector);\n },\n /*\n * Shim some cssText with the given se
lector. Returns cssText that can\n * be included in the document via Platform.S
hadowCSS.addCssToDocument(css).\n */\n shimCssText: function(cssText, selector
) {\n cssText = this.insertDirectives(cssText);\n return this.scopeCssText
(cssText, selector);\n },\n makeScopeSelector: function(name, typeExtension) {
\n if (name) {\n return typeExtension ? '[is=' + name + ']' : name;\n
}\n return '';\n },\n isTypeExtension: function(extendsName) {\n return
extendsName && extendsName.indexOf('-') < 0;\n },\n prepareRoot: function(roo
t, name, extendsName) {\n var def = this.registerRoot(root, name, extendsName
);\n this.replaceTextInStyles(def.rootStyles, this.insertDirectives);\n //
remove existing style elements\n this.removeStyles(root, def.rootStyles);\n
// apply strict attr\n if (this.strictStyling) {\n this.applyScopeToC
ontent(root, name);\n }\n return def.scopeStyles;\n },\n removeStyles: f
unction(root, styles) {\n for (var i=0, l=styles.length, s; (i<l) && (s=style
s[i]); i++) {\n s.parentNode.removeChild(s);\n }\n },\n registerRoot:
function(root, name, extendsName) {\n var def = this.registry[name] = {\n
root: root,\n name: name,\n extendsName: extendsName\n }\n var
styles = this.findStyles(root);\n def.rootStyles = styles;\n def.scopeSty
les = def.rootStyles;\n var extendee = this.registry[def.extendsName];\n i
f (extendee) {\n def.scopeStyles = extendee.scopeStyles.concat(def.scopeSty
les);\n }\n return def;\n },\n findStyles: function(root) {\n if (!ro
ot) {\n return [];\n }\n var styles = root.querySelectorAll('style');
\n return Array.prototype.filter.call(styles, function(s) {\n return !s.
hasAttribute(NO_SHIM_ATTRIBUTE);\n });\n },\n applyScopeToContent: function
(root, name) {\n if (root) {\n // add the name attribute to each node in
root.\n Array.prototype.forEach.call(root.querySelectorAll('*'),\n
function(node) {\n node.setAttribute(name, '');\n });\n
// and template contents too\n Array.prototype.forEach.call(root.querySe
lectorAll('template'),\n function(template) {\n this.applySc
opeToContent(template.content, name);\n },\n this);\n }\n
},\n insertDirectives: function(cssText) {\n cssText = this.insertPolyfillDi
rectivesInCssText(cssText);\n return this.insertPolyfillRulesInCssText(cssTex
t);\n },\n /*\n * Process styles to convert native ShadowDOM rules that will
trip\n * up the css parser; we rely on decorating the stylesheet with inert r
ules.\n * \n * For example, we convert this rule:\n * \n * polyfill-next
-selector { content: ':host menu-item'; }\n * ::content menu-item {\n * \n
* to this:\n * \n * scopeName menu-item {\n *\n **/\n insertPolyfillDir
ectivesInCssText: function(cssText) {\n // TODO(sorvell): remove either conte
nt or comment\n cssText = cssText.replace(cssCommentNextSelectorRe, function(
match, p1) {\n // remove end comment delimiter and add block start\n r
eturn p1.slice(0, -2) + '{';\n });\n return cssText.replace(cssContentNext
SelectorRe, function(match, p1) {\n return p1 + ' {';\n });\n },\n /*\
n * Process styles to add rules which will only apply under the polyfill\n *
\n * For example, we convert this rule:\n * \n * polyfill-rule {\n *
content: ':host menu-item';\n * ...\n * }\n * \n * to this:\n * \n *
scopeName menu-item {...}\n *\n **/\n insertPolyfillRulesInCssText: functio
n(cssText) {\n // TODO(sorvell): remove either content or comment\n cssTex
t = cssText.replace(cssCommentRuleRe, function(match, p1) {\n // remove end
comment delimiter\n return p1.slice(0, -1);\n });\n return cssText.r
eplace(cssContentRuleRe, function(match, p1, p2, p3) {\n var rule = match.r
eplace(p1, '').replace(p2, '');\n return p3 + rule;\n });\n },\n /* En
sure styles are scoped. Pseudo-scoping takes a rule like:\n * \n * .foo {..
. } \n * \n * and converts this to\n * \n * scopeName .foo { ... }\n
*/\n scopeCssText: function(cssText, scopeSelector) {\n var unscoped = thi
s.extractUnscopedRulesFromCssText(cssText);\n cssText = this.insertPolyfillHo
stInCssText(cssText);\n cssText = this.convertColonHost(cssText);\n cssTex
t = this.convertColonHostContext(cssText);\n cssText = this.convertShadowDOMS
electors(cssText);\n if (scopeSelector) {\n var self = this, cssText;\n
withCssRules(cssText, function(rules) {\n cssText = self.scopeRules(
rules, scopeSelector);\n });\n\n }\n cssText = cssText + '\\n' + unsc
oped;\n return cssText.trim();\n },\n /*\n * Process styles to add rules
which will only apply under the polyfill\n * and do not process via CSSOM. (CS
SOM is destructive to rules on rare \n * occasions, e.g. -webkit-calc on Safar
i.)\n * For example, we convert this rule:\n * \n * (comment start) @polyf
ill-unscoped-rule menu-item { \n * ... } (comment end)\n * \n * to this:\n
* \n * menu-item {...}\n *\n **/\n extractUnscopedRulesFromCssText: fun
ction(cssText) {\n // TODO(sorvell): remove either content or comment\n va
r r = '', m;\n while (m = cssCommentUnscopedRuleRe.exec(cssText)) {\n r
+= m[1].slice(0, -1) + '\\n\\n';\n }\n while (m = cssContentUnscopedRuleRe
.exec(cssText)) {\n r += m[0].replace(m[2], '').replace(m[1], m[3]) + '\\n\
\n';\n }\n return r;\n },\n /*\n * convert a rule like :host(.foo) > .
bar { }\n *\n * to\n *\n * scopeName.foo > .bar\n */\n convertColonHos
t: function(cssText) {\n return this.convertColonRule(cssText, cssColonHostRe
,\n this.colonHostPartReplacer);\n },\n /*\n * convert a rule like :h
ost-context(.foo) > .bar { }\n *\n * to\n *\n * scopeName.foo > .bar, .f
oo scopeName > .bar { }\n * \n * and\n *\n * :host-context(.foo:host) .b
ar { ... }\n * \n * to\n * \n * scopeName.foo .bar { ... }\n */\n conv
ertColonHostContext: function(cssText) {\n return this.convertColonRule(cssTe
xt, cssColonHostContextRe,\n this.colonHostContextPartReplacer);\n },\n
convertColonRule: function(cssText, regExp, partReplacer) {\n // p1 = :host,
p2 = contents of (), p3 rest of rule\n return cssText.replace(regExp, functi
on(m, p1, p2, p3) {\n p1 = polyfillHostNoCombinator;\n if (p2) {\n
var parts = p2.split(','), r = [];\n for (var i=0, l=parts.length, p;
(i<l) && (p=parts[i]); i++) {\n p = p.trim();\n r.push(partRe
placer(p1, p, p3));\n }\n return r.join(',');\n } else {\n
return p1 + p3;\n }\n });\n },\n colonHostContextPartReplacer: fu
nction(host, part, suffix) {\n if (part.match(polyfillHost)) {\n return
this.colonHostPartReplacer(host, part, suffix);\n } else {\n return host
+ part + suffix + ', ' + part + ' ' + host + suffix;\n }\n },\n colonHostP
artReplacer: function(host, part, suffix) {\n return host + part.replace(poly
fillHost, '') + suffix;\n },\n /*\n * Convert combinators like ::shadow and
pseudo-elements like ::content\n * by replacing with space.\n */\n convertSh
adowDOMSelectors: function(cssText) {\n for (var i=0; i < shadowDOMSelectorsR
e.length; i++) {\n cssText = cssText.replace(shadowDOMSelectorsRe[i], ' ');
\n }\n return cssText;\n },\n // change a selector like 'div' to 'name d
iv'\n scopeRules: function(cssRules, scopeSelector) {\n var cssText = '';\n
if (cssRules) {\n Array.prototype.forEach.call(cssRules, function(rule)
{\n if (rule.selectorText && (rule.style && rule.style.cssText !== undefi
ned)) {\n cssText += this.scopeSelector(rule.selectorText, scopeSelecto
r, \n this.strictStyling) + ' {\\n\\t';\n cssText += this.pr
opertiesFromRule(rule) + '\\n}\\n\\n';\n } else if (rule.type === CSSRule
.MEDIA_RULE) {\n cssText += '@media ' + rule.media.mediaText + ' {\\n';
\n cssText += this.scopeRules(rule.cssRules, scopeSelector);\n
cssText += '\\n}\\n\\n';\n } else {\n // TODO(sjmiles): KEYFRAM
ES_RULE in IE11 throws when we query cssText\n // 'cssText' in rule ret
urns true, but rule.cssText throws anyway\n // We can test the rule typ
e, e.g.\n // else if (rule.type !== CSSRule.KEYFRAMES_RULE && rule.cs
sText) {\n // but this will prevent cssText propagation in other browse
rs which\n // support it.\n // KEYFRAMES_RULE has a CSSRuleSet
, so the text can probably be reconstructed\n // from that collection;
this would be a proper fix.\n // For now, I'm trapping the exception so
IE11 is unblocked in other areas.\n try {\n if (rule.cssTex
t) {\n cssText += rule.cssText + '\\n\\n';\n }\n
} catch(x) {\n // squelch\n }\n }\n }, this);\
n }\n return cssText;\n },\n scopeSelector: function(selector, scopeSele
ctor, strict) {\n var r = [], parts = selector.split(',');\n parts.forEach
(function(p) {\n p = p.trim();\n if (this.selectorNeedsScoping(p, scop
eSelector)) {\n p = (strict && !p.match(polyfillHostNoCombinator)) ? \n
this.applyStrictSelectorScope(p, scopeSelector) :\n this.ap
plySelectorScope(p, scopeSelector);\n }\n r.push(p);\n }, this);\n
return r.join(', ');\n },\n selectorNeedsScoping: function(selector, scopeS
elector) {\n if (Array.isArray(scopeSelector)) {\n return true;\n }\n
var re = this.makeScopeMatcher(scopeSelector);\n return !selector.match(r
e);\n },\n makeScopeMatcher: function(scopeSelector) {\n scopeSelector = sc
opeSelector.replace(/\\[/g, '\\\\[').replace(/\\[/g, '\\\\]');\n return new R
egExp('^(' + scopeSelector + ')' + selectorReSuffix, 'm');\n },\n applySelecto
rScope: function(selector, selectorScope) {\n return Array.isArray(selectorSc
ope) ?\n this.applySelectorScopeList(selector, selectorScope) :\n
this.applySimpleSelectorScope(selector, selectorScope);\n },\n // apply an arr
ay of selectors\n applySelectorScopeList: function(selector, scopeSelectorList)
{\n var r = [];\n for (var i=0, s; (s=scopeSelectorList[i]); i++) {\n
r.push(this.applySimpleSelectorScope(selector, s));\n }\n return r.join(
', ');\n },\n // scope via name and [is=name]\n applySimpleSelectorScope: fun
ction(selector, scopeSelector) {\n if (selector.match(polyfillHostRe)) {\n
selector = selector.replace(polyfillHostNoCombinator, scopeSelector);\n
return selector.replace(polyfillHostRe, scopeSelector + ' ');\n } else {\n
return scopeSelector + ' ' + selector;\n }\n },\n // return a selector w
ith [name] suffix on each simple selector\n // e.g. .foo.bar > .zot becomes .fo
o[name].bar[name] > .zot[name]\n applyStrictSelectorScope: function(selector, s
copeSelector) {\n scopeSelector = scopeSelector.replace(/\\[is=([^\\]]*)\\]/g
, '$1');\n var splits = [' ', '>', '+', '~'],\n scoped = selector,\n
attrName = '[' + scopeSelector + ']';\n splits.forEach(function(sep) {\n
var parts = scoped.split(sep);\n scoped = parts.map(function(p) {\n
// remove :host since it should be unnecessary\n var t = p.trim().repl
ace(polyfillHostRe, '');\n if (t && (splits.indexOf(t) < 0) && (t.indexOf
(attrName) < 0)) {\n p = t.replace(/([^:]*)(:*)(.*)/, '$1' + attrName +
'$2$3')\n }\n return p;\n }).join(sep);\n });\n return
scoped;\n },\n insertPolyfillHostInCssText: function(selector) {\n return
selector.replace(colonHostContextRe, polyfillHostContext).replace(\n colo
nHostRe, polyfillHost);\n },\n propertiesFromRule: function(rule) {\n var c
ssText = rule.style.cssText;\n // TODO(sorvell): Safari cssom incorrectly rem
oves quotes from the content\n // property. (https://bugs.webkit.org/show_bug
.cgi?id=118045)\n // don't replace attr rules\n if (rule.style.content &&
!rule.style.content.match(/['\"]+|attr/)) {\n cssText = cssText.replace(/co
ntent:[^;]*;/g, 'content: \\'' + \n rule.style.content + '\\';');\n
}\n // TODO(sorvell): we can workaround this issue here, but we need a list\n
// of troublesome properties to fix https://github.com/Polymer/platform/issu
es/53\n //\n // inherit rules can be omitted from cssText\n // TODO(sor
vell): remove when Blink bug is fixed:\n // https://code.google.com/p/chromiu
m/issues/detail?id=358273\n var style = rule.style;\n for (var i in style)
{\n if (style[i] === 'initial') {\n cssText += i + ': initial; ';\n
}\n }\n return cssText;\n },\n replaceTextInStyles: function(style
s, action) {\n if (styles && action) {\n if (!(styles instanceof Array))
{\n styles = [styles];\n }\n Array.prototype.forEach.call(styl
es, function(s) {\n s.textContent = action.call(this, s.textContent);\n
}, this);\n }\n },\n addCssToDocument: function(cssText, name) {\n i
f (cssText.match('@import')) {\n addOwnSheet(cssText, name);\n } else {\
n addCssToDocument(cssText);\n }\n }\n};\n\nvar selectorRe = /([^{]*)({
[\\s\\S]*?})/gim,\n cssCommentRe = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\
n // TODO(sorvell): remove either content or comment\n cssCommentNextSelec
torRe = /\\/\\*\\s*@polyfill ([^*]*\\*+([^/*][^*]*\\*+)*\\/)([^{]*?){/gim,\n
cssContentNextSelectorRe = /polyfill-next-selector[^}]*content\\:[\\s]*['|\"]([^
'\"]*)['|\"][^}]*}([^{]*?){/gim,\n // TODO(sorvell): remove either content or
comment\n cssCommentRuleRe = /\\/\\*\\s@polyfill-rule([^*]*\\*+([^/*][^*]*\\
*+)*)\\//gim,\n cssContentRuleRe = /(polyfill-rule)[^}]*(content\\:[\\s]*['|\
"]([^'\"]*)['|\"][^;]*;)[^}]*}/gim,\n // TODO(sorvell): remove either content
or comment\n cssCommentUnscopedRuleRe = /\\/\\*\\s@polyfill-unscoped-rule([^
*]*\\*+([^/*][^*]*\\*+)*)\\//gim,\n cssContentUnscopedRuleRe = /(polyfill-uns
coped-rule)[^}]*(content\\:[\\s]*['|\"]([^'\"]*)['|\"][^;]*;)[^}]*}/gim,\n cs
sPseudoRe = /::(x-[^\\s{,(]*)/gim,\n cssPartRe = /::part\\(([^)]*)\\)/gim,\n
// note: :host pre-processed to -shadowcsshost.\n polyfillHost = '-shadowc
sshost',\n // note: :host-context pre-processed to -shadowcsshostcontext.\n
polyfillHostContext = '-shadowcsscontext',\n parenSuffix = ')(?:\\\\((' +\n
'(?:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n ')\\\\))?([^,{]*)';\n cssC
olonHostRe = new RegExp('(' + polyfillHost + parenSuffix, 'gim'),\n cssColonH
ostContextRe = new RegExp('(' + polyfillHostContext + parenSuffix, 'gim'),\n
selectorReSuffix = '([>\\\\s~+\\[.,{:][\\\\s\\\\S]*)?$',\n colonHostRe = /\\:
host/gim,\n colonHostContextRe = /\\:host-context/gim,\n /* host name with
out combinator */\n polyfillHostNoCombinator = polyfillHost + '-no-combinator
',\n polyfillHostRe = new RegExp(polyfillHost, 'gim'),\n polyfillHostConte
xtRe = new RegExp(polyfillHostContext, 'gim'),\n shadowDOMSelectorsRe = [\n
/\\^\\^/g,\n /\\^/g,\n /\\/shadow\\//g,\n /\\/shadow-deep\\//
g,\n /::shadow/g,\n /\\/deep\\//g,\n /::content/g\n ];\n\nfunc
tion stylesToCssText(styles, preserveComments) {\n var cssText = '';\n Array.p
rototype.forEach.call(styles, function(s) {\n cssText += s.textContent + '\\n
\\n';\n });\n // strip comments for easier processing\n if (!preserveComments
) {\n cssText = cssText.replace(cssCommentRe, '');\n }\n return cssText;\n}
\n\nfunction cssTextToStyle(cssText) {\n var style = document.createElement('st
yle');\n style.textContent = cssText;\n return style;\n}\n\nfunction cssToRule
s(cssText) {\n var style = cssTextToStyle(cssText);\n document.head.appendChil
d(style);\n var rules = [];\n if (style.sheet) {\n // TODO(sorvell): Firefo
x throws when accessing the rules of a stylesheet\n // with an @import\n /
/ https://bugzilla.mozilla.org/show_bug.cgi?id=625013\n try {\n rules =
style.sheet.cssRules;\n } catch(e) {\n //\n }\n } else {\n consol
e.warn('sheet not found', style);\n }\n style.parentNode.removeChild(style);\n
return rules;\n}\n\nvar frame = document.createElement('iframe');\nframe.style
.display = 'none';\n\nfunction initFrame() {\n frame.initialized = true;\n doc
ument.body.appendChild(frame);\n var doc = frame.contentDocument;\n var base =
doc.createElement('base');\n base.href = document.baseURI;\n doc.head.appendC
hild(base);\n}\n\nfunction inFrame(fn) {\n if (!frame.initialized) {\n initF
rame();\n }\n document.body.appendChild(frame);\n fn(frame.contentDocument);\
n document.body.removeChild(frame);\n}\n\n// TODO(sorvell): use an iframe if th
e cssText contains an @import to workaround\n// https://code.google.com/p/chromi
um/issues/detail?id=345114\nvar isChrome = navigator.userAgent.match('Chrome');\
nfunction withCssRules(cssText, callback) {\n if (!callback) {\n return;\n
}\n var rules;\n if (cssText.match('@import') && isChrome) {\n var style =
cssTextToStyle(cssText);\n inFrame(function(doc) {\n doc.head.appendChil
d(style.impl);\n rules = style.sheet.cssRules;\n callback(rules);\n
});\n } else {\n rules = cssToRules(cssText);\n callback(rules);\n }\n}
\n\nfunction rulesToCss(cssRules) {\n for (var i=0, css=[]; i < cssRules.length
; i++) {\n css.push(cssRules[i].cssText);\n }\n return css.join('\\n\\n');\
n}\n\nfunction addCssToDocument(cssText) {\n if (cssText) {\n getSheet().app
endChild(document.createTextNode(cssText));\n }\n}\n\nfunction addOwnSheet(cssT
ext, name) {\n var style = cssTextToStyle(cssText);\n style.setAttribute(name,
'');\n style.setAttribute(SHIMMED_ATTRIBUTE, '');\n document.head.appendChild
(style);\n}\n\nvar SHIM_ATTRIBUTE = 'shim-shadowdom';\nvar SHIMMED_ATTRIBUTE = '
shim-shadowdom-css';\nvar NO_SHIM_ATTRIBUTE = 'no-shim';\n\nvar sheet;\nfunction
getSheet() {\n if (!sheet) {\n sheet = document.createElement(\"style\");\n
sheet.setAttribute(SHIMMED_ATTRIBUTE, '');\n sheet[SHIMMED_ATTRIBUTE] = t
rue;\n }\n return sheet;\n}\n\n// add polyfill stylesheet to document\nif (win
dow.ShadowDOMPolyfill) {\n addCssToDocument('style { display: none !important;
}\\n');\n var doc = wrap(document);\n var head = doc.querySelector('head');\n
head.insertBefore(getSheet(), head.childNodes[0]);\n\n // TODO(sorvell): monke
y-patching HTMLImports is abusive;\n // consider a better solution.\n document
.addEventListener('DOMContentLoaded', function() {\n var urlResolver = scope.
urlResolver;\n \n if (window.HTMLImports && !HTMLImports.useNative) {\n
var SHIM_SHEET_SELECTOR = 'link[rel=stylesheet]' +\n '[' + SHIM_ATTR
IBUTE + ']';\n var SHIM_STYLE_SELECTOR = 'style[' + SHIM_ATTRIBUTE + ']';\n
HTMLImports.importer.documentPreloadSelectors += ',' + SHIM_SHEET_SELECTOR
;\n HTMLImports.importer.importsPreloadSelectors += ',' + SHIM_SHEET_SELECT
OR;\n\n HTMLImports.parser.documentSelectors = [\n HTMLImports.parse
r.documentSelectors,\n SHIM_SHEET_SELECTOR,\n SHIM_STYLE_SELECTOR\
n ].join(',');\n \n var originalParseGeneric = HTMLImports.parser.par
seGeneric;\n\n HTMLImports.parser.parseGeneric = function(elt) {\n i
f (elt[SHIMMED_ATTRIBUTE]) {\n return;\n }\n var style =
elt.__importElement || elt;\n if (!style.hasAttribute(SHIM_ATTRIBUTE)) {\
n originalParseGeneric.call(this, elt);\n return;\n }\n
if (elt.__resource) {\n style = elt.ownerDocument.createElement
('style');\n style.textContent = urlResolver.resolveCssText(\n
elt.__resource, elt.href);\n } else {\n urlResolver.resolve
Style(style); \n }\n style.textContent = ShadowCSS.shimStyle(styl
e);\n style.removeAttribute(SHIM_ATTRIBUTE, '');\n style.setAttrib
ute(SHIMMED_ATTRIBUTE, '');\n style[SHIMMED_ATTRIBUTE] = true;\n /
/ place in document\n if (style.parentNode !== head) {\n // repl
ace links in head\n if (elt.parentNode === head) {\n head.re
placeChild(style, elt);\n } else {\n head.appendChild(style)
;\n }\n }\n style.__importParsed = true;\n this.ma
rkParsingComplete(elt);\n this.parseNext();\n }\n\n var hasReso
urce = HTMLImports.parser.hasResource;\n HTMLImports.parser.hasResource = f
unction(node) {\n if (node.localName === 'link' && node.rel === 'styleshe
et' &&\n node.hasAttribute(SHIM_ATTRIBUTE)) {\n return (node
.__resource);\n } else {\n return hasResource.call(this, node);\
n }\n }\n\n }\n });\n}\n\n// exports\nscope.ShadowCSS = ShadowCS
S;\n\n})(window.Platform);\n", | 141 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n/*\n This is a limited s
him for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/
tip/spec/shadow/index.html#styles\n \n The intention here is to support only t
he styling features which can be \n relatively simply implemented. The goal is
to allow users to avoid the \n most obvious pitfalls and do so without compromi
sing performance significantly. \n For ShadowDOM styling that's not covered her
e, a set of best practices\n can be provided that should allow users to accompl
ish more complex styling.\n\n The following is a list of specific ShadowDOM sty
ling features and a brief\n discussion of the approach used to shim.\n\n Shimm
ed features:\n\n * :host, :host-context: ShadowDOM allows styling of the shadow
Root's host\n element using the :host rule. To shim this feature, the :host sty
les are \n reformatted and prefixed with a given scope name and promoted to a \
n document level stylesheet.\n For example, given a scope name of .foo, a rule
like this:\n \n :host {\n background: red;\n }\n }\n \n be
comes:\n \n .foo {\n background: red;\n }\n \n * encapsultion: Sty
les defined within ShadowDOM, apply only to \n dom inside the ShadowDOM. Polyme
r uses one of two techniques to imlement\n this feature.\n \n By default, rul
es are prefixed with the host element tag name \n as a descendant selector. Thi
s ensures styling does not leak out of the 'top'\n of the element's ShadowDOM.
For example,\n\n div {\n font-weight: bold;\n }\n \n becomes:\n\n x-
foo div {\n font-weight: bold;\n }\n \n becomes:\n\n\n Alternatively,
if Platform.ShadowCSS.strictStyling is set to true then \n selectors are scope
d by adding an attribute selector suffix to each\n simple selector that contain
s the host element tag name. Each element \n in the element's ShadowDOM templat
e is also given the scope attribute. \n Thus, these rules match only elements t
hat have the scope attribute.\n For example, given a scope name of x-foo, a rul
e like this:\n \n div {\n font-weight: bold;\n }\n \n becomes:\n
\n div[x-foo] {\n font-weight: bold;\n }\n\n Note that elements that
are dynamically added to a scope must have the scope\n selector added to them
manually.\n\n * upper/lower bound encapsulation: Styles which are defined outsi
de a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\
n inside a shadowRoot.\n\n This styling behavior is not emulated. Some possibl
e ways to do this that \n were rejected due to complexity and/or performance co
ncerns include: (1) reset\n every possible property for every possible selector
for a given scope name;\n (2) re-implement css in javascript.\n \n As an alt
ernative, users should make sure to use selectors\n specific to the scope in wh
ich they are working.\n \n * ::distributed: This behavior is not emulated. It'
s often not necessary\n to style the contents of a specific insertion point and
instead, descendants\n of the host element can be styled selectively. Users ca
n also create an \n extra node around an insertion point and style that node's
contents\n via descendent selectors. For example, with a shadowRoot like this:\
n \n <style>\n ::content(div) {\n background: red;\n }\n
</style>\n <content></content>\n \n could become:\n \n <style>\n
/ *@polyfill .content-container div * / \n ::content(div) {\n backgr
ound: red;\n }\n </style>\n <div class=\"content-container\">\n
<content></content>\n </div>\n \n Note the use of @polyfill in the comment
above a ShadowDOM specific style\n declaration. This is a directive to the styl
ing shim to use the selector \n in comments in lieu of the next selector when r
unning under polyfill.\n*/\n(function(scope) {\n\nvar ShadowCSS = {\n strictSty
ling: false,\n registry: {},\n // Shim styles for a given root associated with
a name and extendsName\n // 1. cache root styles by name\n // 2. optionally t
ag root nodes with scope name\n // 3. shim polyfill directives /* @polyfill */
and /* @polyfill-rule */\n // 4. shim :host and scoping\n shimStyling: functio
n(root, name, extendsName) {\n var scopeStyles = this.prepareRoot(root, name,
extendsName);\n var typeExtension = this.isTypeExtension(extendsName);\n
var scopeSelector = this.makeScopeSelector(name, typeExtension);\n // use cac
hing to make working with styles nodes easier and to facilitate\n // lookup o
f extendee\n var cssText = stylesToCssText(scopeStyles, true);\n cssText =
this.scopeCssText(cssText, scopeSelector);\n // cache shimmed css on root fo
r user extensibility\n if (root) {\n root.shimmedStyle = cssText;\n }
\n // add style to document\n this.addCssToDocument(cssText, name);\n },\
n /*\n * Shim a style element with the given selector. Returns cssText that ca
n\n * be included in the document via Platform.ShadowCSS.addCssToDocument(css).
\n */\n shimStyle: function(style, selector) {\n return this.shimCssText(st
yle.textContent, selector);\n },\n /*\n * Shim some cssText with the given se
lector. Returns cssText that can\n * be included in the document via Platform.S
hadowCSS.addCssToDocument(css).\n */\n shimCssText: function(cssText, selector
) {\n cssText = this.insertDirectives(cssText);\n return this.scopeCssText
(cssText, selector);\n },\n makeScopeSelector: function(name, typeExtension) {
\n if (name) {\n return typeExtension ? '[is=' + name + ']' : name;\n
}\n return '';\n },\n isTypeExtension: function(extendsName) {\n return
extendsName && extendsName.indexOf('-') < 0;\n },\n prepareRoot: function(roo
t, name, extendsName) {\n var def = this.registerRoot(root, name, extendsName
);\n this.replaceTextInStyles(def.rootStyles, this.insertDirectives);\n //
remove existing style elements\n this.removeStyles(root, def.rootStyles);\n
// apply strict attr\n if (this.strictStyling) {\n this.applyScopeToC
ontent(root, name);\n }\n return def.scopeStyles;\n },\n removeStyles: f
unction(root, styles) {\n for (var i=0, l=styles.length, s; (i<l) && (s=style
s[i]); i++) {\n s.parentNode.removeChild(s);\n }\n },\n registerRoot:
function(root, name, extendsName) {\n var def = this.registry[name] = {\n
root: root,\n name: name,\n extendsName: extendsName\n }\n var
styles = this.findStyles(root);\n def.rootStyles = styles;\n def.scopeSty
les = def.rootStyles;\n var extendee = this.registry[def.extendsName];\n i
f (extendee) {\n def.scopeStyles = extendee.scopeStyles.concat(def.scopeSty
les);\n }\n return def;\n },\n findStyles: function(root) {\n if (!ro
ot) {\n return [];\n }\n var styles = root.querySelectorAll('style');
\n return Array.prototype.filter.call(styles, function(s) {\n return !s.
hasAttribute(NO_SHIM_ATTRIBUTE);\n });\n },\n applyScopeToContent: function
(root, name) {\n if (root) {\n // add the name attribute to each node in
root.\n Array.prototype.forEach.call(root.querySelectorAll('*'),\n
function(node) {\n node.setAttribute(name, '');\n });\n
// and template contents too\n Array.prototype.forEach.call(root.querySe
lectorAll('template'),\n function(template) {\n this.applySc
opeToContent(template.content, name);\n },\n this);\n }\n
},\n insertDirectives: function(cssText) {\n cssText = this.insertPolyfillDi
rectivesInCssText(cssText);\n return this.insertPolyfillRulesInCssText(cssTex
t);\n },\n /*\n * Process styles to convert native ShadowDOM rules that will
trip\n * up the css parser; we rely on decorating the stylesheet with inert r
ules.\n * \n * For example, we convert this rule:\n * \n * polyfill-next
-selector { content: ':host menu-item'; }\n * ::content menu-item {\n * \n
* to this:\n * \n * scopeName menu-item {\n *\n **/\n insertPolyfillDir
ectivesInCssText: function(cssText) {\n // TODO(sorvell): remove either conte
nt or comment\n cssText = cssText.replace(cssCommentNextSelectorRe, function(
match, p1) {\n // remove end comment delimiter and add block start\n r
eturn p1.slice(0, -2) + '{';\n });\n return cssText.replace(cssContentNext
SelectorRe, function(match, p1) {\n return p1 + ' {';\n });\n },\n /*\
n * Process styles to add rules which will only apply under the polyfill\n *
\n * For example, we convert this rule:\n * \n * polyfill-rule {\n *
content: ':host menu-item';\n * ...\n * }\n * \n * to this:\n * \n *
scopeName menu-item {...}\n *\n **/\n insertPolyfillRulesInCssText: functio
n(cssText) {\n // TODO(sorvell): remove either content or comment\n cssTex
t = cssText.replace(cssCommentRuleRe, function(match, p1) {\n // remove end
comment delimiter\n return p1.slice(0, -1);\n });\n return cssText.r
eplace(cssContentRuleRe, function(match, p1, p2, p3) {\n var rule = match.r
eplace(p1, '').replace(p2, '');\n return p3 + rule;\n });\n },\n /* En
sure styles are scoped. Pseudo-scoping takes a rule like:\n * \n * .foo {..
. } \n * \n * and converts this to\n * \n * scopeName .foo { ... }\n
*/\n scopeCssText: function(cssText, scopeSelector) {\n var unscoped = thi
s.extractUnscopedRulesFromCssText(cssText);\n cssText = this.insertPolyfillHo
stInCssText(cssText);\n cssText = this.convertColonHost(cssText);\n cssTex
t = this.convertColonHostContext(cssText);\n cssText = this.convertShadowDOMS
electors(cssText);\n if (scopeSelector) {\n var self = this, cssText;\n
withCssRules(cssText, function(rules) {\n cssText = self.scopeRules(
rules, scopeSelector);\n });\n\n }\n cssText = cssText + '\\n' + unsc
oped;\n return cssText.trim();\n },\n /*\n * Process styles to add rules
which will only apply under the polyfill\n * and do not process via CSSOM. (CS
SOM is destructive to rules on rare \n * occasions, e.g. -webkit-calc on Safar
i.)\n * For example, we convert this rule:\n * \n * (comment start) @polyf
ill-unscoped-rule menu-item { \n * ... } (comment end)\n * \n * to this:\n
* \n * menu-item {...}\n *\n **/\n extractUnscopedRulesFromCssText: fun
ction(cssText) {\n // TODO(sorvell): remove either content or comment\n va
r r = '', m;\n while (m = cssCommentUnscopedRuleRe.exec(cssText)) {\n r
+= m[1].slice(0, -1) + '\\n\\n';\n }\n while (m = cssContentUnscopedRuleRe
.exec(cssText)) {\n r += m[0].replace(m[2], '').replace(m[1], m[3]) + '\\n\
\n';\n }\n return r;\n },\n /*\n * convert a rule like :host(.foo) > .
bar { }\n *\n * to\n *\n * scopeName.foo > .bar\n */\n convertColonHos
t: function(cssText) {\n return this.convertColonRule(cssText, cssColonHostRe
,\n this.colonHostPartReplacer);\n },\n /*\n * convert a rule like :h
ost-context(.foo) > .bar { }\n *\n * to\n *\n * scopeName.foo > .bar, .f
oo scopeName > .bar { }\n * \n * and\n *\n * :host-context(.foo:host) .b
ar { ... }\n * \n * to\n * \n * scopeName.foo .bar { ... }\n */\n conv
ertColonHostContext: function(cssText) {\n return this.convertColonRule(cssTe
xt, cssColonHostContextRe,\n this.colonHostContextPartReplacer);\n },\n
convertColonRule: function(cssText, regExp, partReplacer) {\n // p1 = :host,
p2 = contents of (), p3 rest of rule\n return cssText.replace(regExp, functi
on(m, p1, p2, p3) {\n p1 = polyfillHostNoCombinator;\n if (p2) {\n
var parts = p2.split(','), r = [];\n for (var i=0, l=parts.length, p;
(i<l) && (p=parts[i]); i++) {\n p = p.trim();\n r.push(partRe
placer(p1, p, p3));\n }\n return r.join(',');\n } else {\n
return p1 + p3;\n }\n });\n },\n colonHostContextPartReplacer: fu
nction(host, part, suffix) {\n if (part.match(polyfillHost)) {\n return
this.colonHostPartReplacer(host, part, suffix);\n } else {\n return host
+ part + suffix + ', ' + part + ' ' + host + suffix;\n }\n },\n colonHostP
artReplacer: function(host, part, suffix) {\n return host + part.replace(poly
fillHost, '') + suffix;\n },\n /*\n * Convert combinators like ::shadow and
pseudo-elements like ::content\n * by replacing with space.\n */\n convertSh
adowDOMSelectors: function(cssText) {\n for (var i=0; i < shadowDOMSelectorsR
e.length; i++) {\n cssText = cssText.replace(shadowDOMSelectorsRe[i], ' ');
\n }\n return cssText;\n },\n // change a selector like 'div' to 'name d
iv'\n scopeRules: function(cssRules, scopeSelector) {\n var cssText = '';\n
if (cssRules) {\n Array.prototype.forEach.call(cssRules, function(rule)
{\n if (rule.selectorText && (rule.style && rule.style.cssText !== undefi
ned)) {\n cssText += this.scopeSelector(rule.selectorText, scopeSelecto
r, \n this.strictStyling) + ' {\\n\\t';\n cssText += this.pr
opertiesFromRule(rule) + '\\n}\\n\\n';\n } else if (rule.type === CSSRule
.MEDIA_RULE) {\n cssText += '@media ' + rule.media.mediaText + ' {\\n';
\n cssText += this.scopeRules(rule.cssRules, scopeSelector);\n
cssText += '\\n}\\n\\n';\n } else {\n // TODO(sjmiles): KEYFRAM
ES_RULE in IE11 throws when we query cssText\n // 'cssText' in rule ret
urns true, but rule.cssText throws anyway\n // We can test the rule typ
e, e.g.\n // else if (rule.type !== CSSRule.KEYFRAMES_RULE && rule.cs
sText) {\n // but this will prevent cssText propagation in other browse
rs which\n // support it.\n // KEYFRAMES_RULE has a CSSRuleSet
, so the text can probably be reconstructed\n // from that collection;
this would be a proper fix.\n // For now, I'm trapping the exception so
IE11 is unblocked in other areas.\n try {\n if (rule.cssTex
t) {\n cssText += rule.cssText + '\\n\\n';\n }\n
} catch(x) {\n // squelch\n }\n }\n }, this);\
n }\n return cssText;\n },\n scopeSelector: function(selector, scopeSele
ctor, strict) {\n var r = [], parts = selector.split(',');\n parts.forEach
(function(p) {\n p = p.trim();\n if (this.selectorNeedsScoping(p, scop
eSelector)) {\n p = (strict && !p.match(polyfillHostNoCombinator)) ? \n
this.applyStrictSelectorScope(p, scopeSelector) :\n this.ap
plySelectorScope(p, scopeSelector);\n }\n r.push(p);\n }, this);\n
return r.join(', ');\n },\n selectorNeedsScoping: function(selector, scopeS
elector) {\n if (Array.isArray(scopeSelector)) {\n return true;\n }\n
var re = this.makeScopeMatcher(scopeSelector);\n return !selector.match(r
e);\n },\n makeScopeMatcher: function(scopeSelector) {\n scopeSelector = sc
opeSelector.replace(/\\[/g, '\\\\[').replace(/\\[/g, '\\\\]');\n return new R
egExp('^(' + scopeSelector + ')' + selectorReSuffix, 'm');\n },\n applySelecto
rScope: function(selector, selectorScope) {\n return Array.isArray(selectorSc
ope) ?\n this.applySelectorScopeList(selector, selectorScope) :\n
this.applySimpleSelectorScope(selector, selectorScope);\n },\n // apply an arr
ay of selectors\n applySelectorScopeList: function(selector, scopeSelectorList)
{\n var r = [];\n for (var i=0, s; (s=scopeSelectorList[i]); i++) {\n
r.push(this.applySimpleSelectorScope(selector, s));\n }\n return r.join(
', ');\n },\n // scope via name and [is=name]\n applySimpleSelectorScope: fun
ction(selector, scopeSelector) {\n if (selector.match(polyfillHostRe)) {\n
selector = selector.replace(polyfillHostNoCombinator, scopeSelector);\n
return selector.replace(polyfillHostRe, scopeSelector + ' ');\n } else {\n
return scopeSelector + ' ' + selector;\n }\n },\n // return a selector w
ith [name] suffix on each simple selector\n // e.g. .foo.bar > .zot becomes .fo
o[name].bar[name] > .zot[name]\n applyStrictSelectorScope: function(selector, s
copeSelector) {\n scopeSelector = scopeSelector.replace(/\\[is=([^\\]]*)\\]/g
, '$1');\n var splits = [' ', '>', '+', '~'],\n scoped = selector,\n
attrName = '[' + scopeSelector + ']';\n splits.forEach(function(sep) {\n
var parts = scoped.split(sep);\n scoped = parts.map(function(p) {\n
// remove :host since it should be unnecessary\n var t = p.trim().repl
ace(polyfillHostRe, '');\n if (t && (splits.indexOf(t) < 0) && (t.indexOf
(attrName) < 0)) {\n p = t.replace(/([^:]*)(:*)(.*)/, '$1' + attrName +
'$2$3')\n }\n return p;\n }).join(sep);\n });\n return
scoped;\n },\n insertPolyfillHostInCssText: function(selector) {\n return
selector.replace(colonHostContextRe, polyfillHostContext).replace(\n colo
nHostRe, polyfillHost);\n },\n propertiesFromRule: function(rule) {\n var c
ssText = rule.style.cssText;\n // TODO(sorvell): Safari cssom incorrectly rem
oves quotes from the content\n // property. (https://bugs.webkit.org/show_bug
.cgi?id=118045)\n // don't replace attr rules\n if (rule.style.content &&
!rule.style.content.match(/['\"]+|attr/)) {\n cssText = cssText.replace(/co
ntent:[^;]*;/g, 'content: \\'' + \n rule.style.content + '\\';');\n
}\n // TODO(sorvell): we can workaround this issue here, but we need a list\n
// of troublesome properties to fix https://github.com/Polymer/platform/issu
es/53\n //\n // inherit rules can be omitted from cssText\n // TODO(sor
vell): remove when Blink bug is fixed:\n // https://code.google.com/p/chromiu
m/issues/detail?id=358273\n var style = rule.style;\n for (var i in style)
{\n if (style[i] === 'initial') {\n cssText += i + ': initial; ';\n
}\n }\n return cssText;\n },\n replaceTextInStyles: function(style
s, action) {\n if (styles && action) {\n if (!(styles instanceof Array))
{\n styles = [styles];\n }\n Array.prototype.forEach.call(styl
es, function(s) {\n s.textContent = action.call(this, s.textContent);\n
}, this);\n }\n },\n addCssToDocument: function(cssText, name) {\n i
f (cssText.match('@import')) {\n addOwnSheet(cssText, name);\n } else {\
n addCssToDocument(cssText);\n }\n }\n};\n\nvar selectorRe = /([^{]*)({
[\\s\\S]*?})/gim,\n cssCommentRe = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\
n // TODO(sorvell): remove either content or comment\n cssCommentNextSelec
torRe = /\\/\\*\\s*@polyfill ([^*]*\\*+([^/*][^*]*\\*+)*\\/)([^{]*?){/gim,\n
cssContentNextSelectorRe = /polyfill-next-selector[^}]*content\\:[\\s]*?['\"](.*
?)['\"][;\\s]*}([^{]*?){/gim, \n // TODO(sorvell): remove either content or
comment\n cssCommentRuleRe = /\\/\\*\\s@polyfill-rule([^*]*\\*+([^/*][^*]*\\*
+)*)\\//gim,\n cssContentRuleRe = /(polyfill-rule)[^}]*(content\\:[\\s]*['\"]
(.*?)['\"])[;\\s]*[^}]*}/gim,\n // TODO(sorvell): remove either content or co
mment\n cssCommentUnscopedRuleRe = /\\/\\*\\s@polyfill-unscoped-rule([^*]*\\*
+([^/*][^*]*\\*+)*)\\//gim,\n cssContentUnscopedRuleRe = /(polyfill-unscoped-
rule)[^}]*(content\\:[\\s]*['\"](.*?)['\"])[;\\s]*[^}]*}/gim,\n cssPseudoRe =
/::(x-[^\\s{,(]*)/gim,\n cssPartRe = /::part\\(([^)]*)\\)/gim,\n // note:
:host pre-processed to -shadowcsshost.\n polyfillHost = '-shadowcsshost',\n
// note: :host-context pre-processed to -shadowcsshostcontext.\n polyfillH
ostContext = '-shadowcsscontext',\n parenSuffix = ')(?:\\\\((' +\n '(?
:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n ')\\\\))?([^,{]*)';\n cssColonHostRe
= new RegExp('(' + polyfillHost + parenSuffix, 'gim'),\n cssColonHostContextR
e = new RegExp('(' + polyfillHostContext + parenSuffix, 'gim'),\n selectorReS
uffix = '([>\\\\s~+\\[.,{:][\\\\s\\\\S]*)?$',\n colonHostRe = /\\:host/gim,\n
colonHostContextRe = /\\:host-context/gim,\n /* host name without combina
tor */\n polyfillHostNoCombinator = polyfillHost + '-no-combinator',\n pol
yfillHostRe = new RegExp(polyfillHost, 'gim'),\n polyfillHostContextRe = new
RegExp(polyfillHostContext, 'gim'),\n shadowDOMSelectorsRe = [\n /\\^\\^
/g,\n /\\^/g,\n /\\/shadow\\//g,\n /\\/shadow-deep\\//g,\n /
::shadow/g,\n /\\/deep\\//g,\n /::content/g\n ];\n\nfunction styles
ToCssText(styles, preserveComments) {\n var cssText = '';\n Array.prototype.fo
rEach.call(styles, function(s) {\n cssText += s.textContent + '\\n\\n';\n })
;\n // strip comments for easier processing\n if (!preserveComments) {\n cs
sText = cssText.replace(cssCommentRe, '');\n }\n return cssText;\n}\n\nfunctio
n cssTextToStyle(cssText) {\n var style = document.createElement('style');\n s
tyle.textContent = cssText;\n return style;\n}\n\nfunction cssToRules(cssText)
{\n var style = cssTextToStyle(cssText);\n document.head.appendChild(style);\n
var rules = [];\n if (style.sheet) {\n // TODO(sorvell): Firefox throws wh
en accessing the rules of a stylesheet\n // with an @import\n // https://b
ugzilla.mozilla.org/show_bug.cgi?id=625013\n try {\n rules = style.sheet
.cssRules;\n } catch(e) {\n //\n }\n } else {\n console.warn('she
et not found', style);\n }\n style.parentNode.removeChild(style);\n return ru
les;\n}\n\nvar frame = document.createElement('iframe');\nframe.style.display =
'none';\n\nfunction initFrame() {\n frame.initialized = true;\n document.body.
appendChild(frame);\n var doc = frame.contentDocument;\n var base = doc.create
Element('base');\n base.href = document.baseURI;\n doc.head.appendChild(base);
\n}\n\nfunction inFrame(fn) {\n if (!frame.initialized) {\n initFrame();\n
}\n document.body.appendChild(frame);\n fn(frame.contentDocument);\n document
.body.removeChild(frame);\n}\n\n// TODO(sorvell): use an iframe if the cssText c
ontains an @import to workaround\n// https://code.google.com/p/chromium/issues/d
etail?id=345114\nvar isChrome = navigator.userAgent.match('Chrome');\nfunction w
ithCssRules(cssText, callback) {\n if (!callback) {\n return;\n }\n var ru
les;\n if (cssText.match('@import') && isChrome) {\n var style = cssTextToSt
yle(cssText);\n inFrame(function(doc) {\n doc.head.appendChild(style.imp
l);\n rules = style.sheet.cssRules;\n callback(rules);\n });\n } e
lse {\n rules = cssToRules(cssText);\n callback(rules);\n }\n}\n\nfunctio
n rulesToCss(cssRules) {\n for (var i=0, css=[]; i < cssRules.length; i++) {\n
css.push(cssRules[i].cssText);\n }\n return css.join('\\n\\n');\n}\n\nfunct
ion addCssToDocument(cssText) {\n if (cssText) {\n getSheet().appendChild(do
cument.createTextNode(cssText));\n }\n}\n\nfunction addOwnSheet(cssText, name)
{\n var style = cssTextToStyle(cssText);\n style.setAttribute(name, '');\n st
yle.setAttribute(SHIMMED_ATTRIBUTE, '');\n document.head.appendChild(style);\n}
\n\nvar SHIM_ATTRIBUTE = 'shim-shadowdom';\nvar SHIMMED_ATTRIBUTE = 'shim-shadow
dom-css';\nvar NO_SHIM_ATTRIBUTE = 'no-shim';\n\nvar sheet;\nfunction getSheet()
{\n if (!sheet) {\n sheet = document.createElement(\"style\");\n sheet.s
etAttribute(SHIMMED_ATTRIBUTE, '');\n sheet[SHIMMED_ATTRIBUTE] = true;\n }\n
return sheet;\n}\n\n// add polyfill stylesheet to document\nif (window.ShadowD
OMPolyfill) {\n addCssToDocument('style { display: none !important; }\\n');\n
var doc = wrap(document);\n var head = doc.querySelector('head');\n head.inser
tBefore(getSheet(), head.childNodes[0]);\n\n // TODO(sorvell): monkey-patching
HTMLImports is abusive;\n // consider a better solution.\n document.addEventLi
stener('DOMContentLoaded', function() {\n var urlResolver = scope.urlResolver
;\n \n if (window.HTMLImports && !HTMLImports.useNative) {\n var SHIM
_SHEET_SELECTOR = 'link[rel=stylesheet]' +\n '[' + SHIM_ATTRIBUTE + ']'
;\n var SHIM_STYLE_SELECTOR = 'style[' + SHIM_ATTRIBUTE + ']';\n HTMLI
mports.importer.documentPreloadSelectors += ',' + SHIM_SHEET_SELECTOR;\n HT
MLImports.importer.importsPreloadSelectors += ',' + SHIM_SHEET_SELECTOR;\n\n
HTMLImports.parser.documentSelectors = [\n HTMLImports.parser.documentS
electors,\n SHIM_SHEET_SELECTOR,\n SHIM_STYLE_SELECTOR\n ].jo
in(',');\n \n var originalParseGeneric = HTMLImports.parser.parseGeneric;\
n\n HTMLImports.parser.parseGeneric = function(elt) {\n if (elt[SHIM
MED_ATTRIBUTE]) {\n return;\n }\n var style = elt.__impor
tElement || elt;\n if (!style.hasAttribute(SHIM_ATTRIBUTE)) {\n
originalParseGeneric.call(this, elt);\n return;\n }\n if
(elt.__resource) {\n style = elt.ownerDocument.createElement('style');\
n style.textContent = urlResolver.resolveCssText(\n elt.__
resource, elt.href);\n } else {\n urlResolver.resolveStyle(style
); \n }\n style.textContent = ShadowCSS.shimStyle(style);\n
style.removeAttribute(SHIM_ATTRIBUTE, '');\n style.setAttribute(SHIMMED
_ATTRIBUTE, '');\n style[SHIMMED_ATTRIBUTE] = true;\n // place in
document\n if (style.parentNode !== head) {\n // replace links i
n head\n if (elt.parentNode === head) {\n head.replaceChild(
style, elt);\n } else {\n this.addElementToDocument(style);\
n }\n }\n style.__importParsed = true;\n this.mark
ParsingComplete(elt);\n this.parseNext();\n }\n\n var hasResour
ce = HTMLImports.parser.hasResource;\n HTMLImports.parser.hasResource = fun
ction(node) {\n if (node.localName === 'link' && node.rel === 'stylesheet
' &&\n node.hasAttribute(SHIM_ATTRIBUTE)) {\n return (node._
_resource);\n } else {\n return hasResource.call(this, node);\n
}\n }\n\n }\n });\n}\n\n// exports\nscope.ShadowCSS = ShadowCSS;
\n\n})(window.Platform);\n", |
143 "} else {", | 142 "} else {", |
144 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n /
/ so we can call wrap/unwrap without testing for ShadowDOMPolyfill\n window.wra
p = window.unwrap = function(n){\n return n;\n }\n\n addEventListener('DOMC
ontentLoaded', function() {\n if (CustomElements.useNative === false) {\n
var originalCreateShadowRoot = Element.prototype.createShadowRoot;\n Elem
ent.prototype.createShadowRoot = function() {\n var root = originalCreate
ShadowRoot.call(this);\n CustomElements.watchShadow(this);\n retur
n root;\n };\n }\n });\n\n Platform.templateContent = function(inTempl
ate) {\n // if MDV exists, it may need to boostrap this template to reveal co
ntent\n if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n
HTMLTemplateElement.bootstrap(inTemplate);\n }\n // fallback when the
re is no Shadow DOM polyfill, no MDV polyfill, and no\n // native template su
pport\n if (!inTemplate.content && !inTemplate._content) {\n var frag =
document.createDocumentFragment();\n while (inTemplate.firstChild) {\n
frag.appendChild(inTemplate.firstChild);\n }\n inTemplate._content
= frag;\n }\n return inTemplate.content || inTemplate._content;\n };\n\n}
)(window.Platform);\n", | 143 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n /
/ so we can call wrap/unwrap without testing for ShadowDOMPolyfill\n window.wra
p = window.unwrap = function(n){\n return n;\n }\n\n addEventListener('DOMC
ontentLoaded', function() {\n if (CustomElements.useNative === false) {\n
var originalCreateShadowRoot = Element.prototype.createShadowRoot;\n Elem
ent.prototype.createShadowRoot = function() {\n var root = originalCreate
ShadowRoot.call(this);\n CustomElements.watchShadow(this);\n retur
n root;\n };\n }\n });\n\n Platform.templateContent = function(inTempl
ate) {\n // if MDV exists, it may need to boostrap this template to reveal co
ntent\n if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n
HTMLTemplateElement.bootstrap(inTemplate);\n }\n // fallback when the
re is no Shadow DOM polyfill, no MDV polyfill, and no\n // native template su
pport\n if (!inTemplate.content && !inTemplate._content) {\n var frag =
document.createDocumentFragment();\n while (inTemplate.firstChild) {\n
frag.appendChild(inTemplate.firstChild);\n }\n inTemplate._content
= frag;\n }\n return inTemplate.content || inTemplate._content;\n };\n\n}
)(window.Platform);\n", |
145 "}", | 144 "}", |
146 "/* Any copyright is dedicated to the Public Domain.\n * http://creativecomm
ons.org/publicdomain/zero/1.0/ */\n\n(function(scope) {\n 'use strict';\n\n //
feature detect for URL constructor\n var hasWorkingUrl = false;\n if (!scope.
forceJURL) {\n try {\n var u = new URL('b', 'http://a');\n hasWorki
ngUrl = u.href === 'http://a/b';\n } catch(e) {}\n }\n\n if (hasWorkingUrl)
\n return;\n\n var relative = Object.create(null);\n relative['ftp'] = 21;\
n relative['file'] = 0;\n relative['gopher'] = 70;\n relative['http'] = 80;\n
relative['https'] = 443;\n relative['ws'] = 80;\n relative['wss'] = 443;\n\n
var relativePathDotMapping = Object.create(null);\n relativePathDotMapping['%
2e'] = '.';\n relativePathDotMapping['.%2e'] = '..';\n relativePathDotMapping[
'%2e.'] = '..';\n relativePathDotMapping['%2e%2e'] = '..';\n\n function isRela
tiveScheme(scheme) {\n return relative[scheme] !== undefined;\n }\n\n funct
ion invalid() {\n clear.call(this);\n this._isInvalid = true;\n }\n\n fu
nction IDNAToASCII(h) {\n if ('' == h) {\n invalid.call(this)\n }\n
// XXX\n return h.toLowerCase()\n }\n\n function percentEscape(c) {\n
var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F
&&\n // \" # < > ? `\n [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf
(unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponen
t(c);\n }\n\n function percentEscapeQuery(c) {\n // XXX This actually needs
to encode c using encoding and then\n // convert the bytes one-by-one.\n\n
var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x
7F &&\n // \" # < > ` (do not escape '?')\n [0x22, 0x23, 0x3C, 0x3E,
0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return enc
odeURIComponent(c);\n }\n\n var EOF = undefined,\n ALPHA = /[a-zA-Z]/,\n
ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n\n function parse(input, stateOver
ride, base) {\n function err(message) {\n errors.push(message)\n }\n\
n var state = stateOverride || 'scheme start',\n cursor = 0,\n
buffer = '',\n seenAt = false,\n seenBracket = false,\n err
ors = [];\n\n loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this
._isInvalid) {\n var c = input[cursor];\n switch (state) {\n ca
se 'scheme start':\n if (c && ALPHA.test(c)) {\n buffer += c
.toLowerCase(); // ASCII-safe\n state = 'scheme';\n } else i
f (!stateOverride) {\n buffer = '';\n state = 'no scheme';
\n continue;\n } else {\n err('Invalid scheme.');
\n break loop;\n }\n break;\n\n case 'scheme
':\n if (c && ALPHANUMERIC.test(c)) {\n buffer += c.toLowerC
ase(); // ASCII-safe\n } else if (':' == c) {\n this._scheme
= buffer;\n buffer = '';\n if (stateOverride) {\n
break loop;\n }\n if (isRelativeScheme(this._scheme)
) {\n this._isRelative = true;\n }\n if ('fil
e' == this._scheme) {\n state = 'relative';\n } else if
(this._isRelative && base && base._scheme == this._scheme) {\n stat
e = 'relative or authority';\n } else if (this._isRelative) {\n
state = 'authority first slash';\n } else {\n st
ate = 'scheme data';\n }\n } else if (!stateOverride) {\n
buffer = '';\n cursor = 0;\n state = 'no scheme';
\n continue;\n } else if (EOF == c) {\n break loo
p;\n } else {\n err('Code point not allowed in scheme: ' + c
)\n break loop;\n }\n break;\n\n case 'schem
e data':\n if ('?' == c) {\n query = '?';\n state
= 'query';\n } else if ('#' == c) {\n this._fragment = '#';
\n state = 'fragment';\n } else {\n // XXX error
handling\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\
n this._schemeData += percentEscape(c);\n }\n }
\n break;\n\n case 'no scheme':\n if (!base || !(isRela
tiveScheme(base._scheme))) {\n err('Missing scheme.');\n i
nvalid.call(this);\n } else {\n state = 'relative';\n
continue;\n }\n break;\n\n case 'relative or autho
rity':\n if ('/' == c && '/' == input[cursor+1]) {\n state =
'authority ignore slashes';\n } else {\n err('Expected /, g
ot: ' + c);\n state = 'relative';\n continue\n }\
n break;\n\n case 'relative':\n this._isRelative = true
;\n if ('file' != this._scheme)\n this._scheme = base._schem
e;\n if (EOF == c) {\n this._host = base._host;\n
this._port = base._port;\n this._path = base._path.slice();\n
this._query = base._query;\n break loop;\n } else if ('
/' == c || '\\\\' == c) {\n if ('\\\\' == c)\n err('\\\\
is an invalid code point.');\n state = 'relative slash';\n
} else if ('?' == c) {\n this._host = base._host;\n this._
port = base._port;\n this._path = base._path.slice();\n th
is._query = '?';\n state = 'query';\n } else if ('#' == c) {
\n this._host = base._host;\n this._port = base._port;\n
this._path = base._path.slice();\n this._query = base._quer
y;\n this._fragment = '#';\n state = 'fragment';\n
} else {\n var nextC = input[cursor+1]\n var nextNextC =
input[cursor+2]\n if (\n 'file' != this._scheme || !ALP
HA.test(c) ||\n (nextC != ':' && nextC != '|') ||\n (E
OF != nextNextC && '/' != nextNextC && '\\\\' != nextNextC && '?' != nextNextC &
& '#' != nextNextC)) {\n this._host = base._host;\n th
is._port = base._port;\n this._path = base._path.slice();\n
this._path.pop();\n }\n state = 'relative path';\n
continue;\n }\n break;\n\n case 'relative sla
sh':\n if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c) {\n
err('\\\\ is an invalid code point.');\n }\n
if ('file' == this._scheme) {\n state = 'file host';\n
} else {\n state = 'authority ignore slashes';\n }\n
} else {\n if ('file' != this._scheme) {\n this._h
ost = base._host;\n this._port = base._port;\n }\n
state = 'relative path';\n continue;\n }\n br
eak;\n\n case 'authority first slash':\n if ('/' == c) {\n
state = 'authority second slash';\n } else {\n err(\"E
xpected '/', got: \" + c);\n state = 'authority ignore slashes';\n
continue;\n }\n break;\n\n case 'authority sec
ond slash':\n state = 'authority ignore slashes';\n if ('/' !=
c) {\n err(\"Expected '/', got: \" + c);\n continue;\n
}\n break;\n\n case 'authority ignore slashes':\n
if ('/' != c && '\\\\' != c) {\n state = 'authority';\n
continue;\n } else {\n err('Expected authority, got: ' + c);
\n }\n break;\n\n case 'authority':\n if ('@'
== c) {\n if (seenAt) {\n err('@ already seen.');\n
buffer += '%40';\n }\n seenAt = true;\n
for (var i = 0; i < buffer.length; i++) {\n var cp = buffer[i];\n
if ('\\t' == cp || '\\n' == cp || '\\r' == cp) {\n
err('Invalid whitespace in authority.');\n continue;\n
}\n // XXX check URL code points\n if (':' == cp &&
null === this._password) {\n this._password = '';\n
continue;\n }\n var tempC = percentEscape(cp);\n
(null !== this._password) ? this._password += tempC : this._username
+= tempC;\n }\n buffer = '';\n } else if (EOF ==
c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n cursor -= b
uffer.length;\n buffer = '';\n state = 'host';\n
continue;\n } else {\n buffer += c;\n }\n
break;\n\n case 'file host':\n if (EOF == c || '/' == c || '\\
\\' == c || '?' == c || '#' == c) {\n if (buffer.length == 2 && ALPHA
.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {\n sta
te = 'relative path';\n } else if (buffer.length == 0) {\n
state = 'relative path start';\n } else {\n this._hos
t = IDNAToASCII.call(this, buffer);\n buffer = '';\n s
tate = 'relative path start';\n }\n continue;\n }
else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid wh
itespace in file host.');\n } else {\n buffer += c;\n
}\n break;\n\n case 'host':\n case 'hostname':\n
if (':' == c && !seenBracket) {\n // XXX host parsing\n
this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n
state = 'port';\n if ('hostname' == stateOverride) {\n
break loop;\n }\n } else if (EOF == c || '/' == c || '\
\\\' == c || '?' == c || '#' == c) {\n this._host = IDNAToASCII.call(
this, buffer);\n buffer = '';\n state = 'relative path sta
rt';\n if (stateOverride) {\n break loop;\n }
\n continue;\n } else if ('\\t' != c && '\\n' != c && '\\r'
!= c) {\n if ('[' == c) {\n seenBracket = true;\n
} else if (']' == c) {\n seenBracket = false;\n }\n
buffer += c;\n } else {\n err('Invalid code poin
t in host/hostname: ' + c);\n }\n break;\n\n case 'port
':\n if (/[0-9]/.test(c)) {\n buffer += c;\n } else
if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c || stateOverrid
e) {\n if ('' != buffer) {\n var temp = parseInt(buffer,
10);\n if (temp != relative[this._scheme]) {\n this
._port = temp + '';\n }\n buffer = '';\n }\
n if (stateOverride) {\n break loop;\n }\n
state = 'relative path start';\n continue;\n } else
if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid code po
int in port: ' + c);\n } else {\n invalid.call(this);\n
}\n break;\n\n case 'relative path start':\n if ('
\\\\' == c)\n err(\"'\\\\' not allowed in path.\");\n state
= 'relative path';\n if ('/' != c && '\\\\' != c) {\n contin
ue;\n }\n break;\n\n case 'relative path':\n i
f (EOF == c || '/' == c || '\\\\' == c || (!stateOverride && ('?' == c || '#' ==
c))) {\n if ('\\\\' == c) {\n err('\\\\ not allowed in
relative path.');\n }\n var tmp;\n if (tmp = re
lativePathDotMapping[buffer.toLowerCase()]) {\n buffer = tmp;\n
}\n if ('..' == buffer) {\n this._path.pop();\n
if ('/' != c && '\\\\' != c) {\n this._path.push('')
;\n }\n } else if ('.' == buffer && '/' != c && '\\\\' !
= c) {\n this._path.push('');\n } else if ('.' != buffer
) {\n if ('file' == this._scheme && this._path.length == 0 && buffe
r.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {\n b
uffer = buffer[0] + ':';\n }\n this._path.push(buffer)
;\n }\n buffer = '';\n if ('?' == c) {\n
this._query = '?';\n state = 'query';\n } else if
('#' == c) {\n this._fragment = '#';\n state = 'fragm
ent';\n }\n } else if ('\\t' != c && '\\n' != c && '\\r' !=
c) {\n buffer += percentEscape(c);\n }\n break;\n\n
case 'query':\n if (!stateOverride && '#' == c) {\n
this._fragment = '#';\n state = 'fragment';\n } else if (EOF
!= c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._query += p
ercentEscapeQuery(c);\n }\n break;\n\n case 'fragment':
\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n
this._fragment += c;\n }\n break;\n }\n\n cursor+
+;\n }\n }\n\n function clear() {\n this._scheme = '';\n this._scheme
Data = '';\n this._username = '';\n this._password = null;\n this._host
= '';\n this._port = '';\n this._path = [];\n this._query = '';\n t
his._fragment = '';\n this._isInvalid = false;\n this._isRelative = false;
\n }\n\n // Does not process domain names or IP addresses.\n // Does not hand
le encoding for the query parameter.\n function jURL(url, base /* , encoding */
) {\n if (base !== undefined && !(base instanceof jURL))\n base = new jU
RL(String(base));\n\n this._url = url;\n clear.call(this);\n\n var inpu
t = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, '');\n // encoding =
encoding || 'utf-8'\n\n parse.call(this, input, null, base);\n }\n\n jURL.p
rototype = {\n get href() {\n if (this._isInvalid)\n return this.
_url;\n\n var authority = '';\n if ('' != this._username || null != th
is._password) {\n authority = this._username +\n (null != this
._password ? ':' + this._password : '') + '@';\n }\n\n return this.pro
tocol +\n (this._isRelative ? '//' + authority + this.host : '') +\n
this.pathname + this._query + this._fragment;\n },\n set href(href)
{\n clear.call(this);\n parse.call(this, href);\n },\n\n get pr
otocol() {\n return this._scheme + ':';\n },\n set protocol(protocol)
{\n if (this._isInvalid)\n return;\n parse.call(this, protocol
+ ':', 'scheme start');\n },\n\n get host() {\n return this._isInval
id ? '' : this._port ?\n this._host + ':' + this._port : this._host;\n
},\n set host(host) {\n if (this._isInvalid || !this._isRelative)\n
return;\n parse.call(this, host, 'host');\n },\n\n get hostname
() {\n return this._host;\n },\n set hostname(hostname) {\n if (
this._isInvalid || !this._isRelative)\n return;\n parse.call(this, h
ostname, 'hostname');\n },\n\n get port() {\n return this._port;\n
},\n set port(port) {\n if (this._isInvalid || !this._isRelative)\n
return;\n parse.call(this, port, 'port');\n },\n\n get pathname()
{\n return this._isInvalid ? '' : this._isRelative ?\n '/' + this
._path.join('/') : this._schemeData;\n },\n set pathname(pathname) {\n
if (this._isInvalid || !this._isRelative)\n return;\n this._path =
[];\n parse.call(this, pathname, 'relative path start');\n },\n\n ge
t search() {\n return this._isInvalid || !this._query || '?' == this._query
?\n '' : this._query;\n },\n set search(search) {\n if (thi
s._isInvalid || !this._isRelative)\n return;\n this._query = '?';\n
if ('?' == search[0])\n search = search.slice(1);\n parse.call(
this, search, 'query');\n },\n\n get hash() {\n return this._isInvali
d || !this._fragment || '#' == this._fragment ?\n '' : this._fragment;\
n },\n set hash(hash) {\n if (this._isInvalid)\n return;\n
this._fragment = '#';\n if ('#' == hash[0])\n hash = hash.slice(1)
;\n parse.call(this, hash, 'fragment');\n }\n };\n\n scope.URL = jURL;
\n\n})(window);\n", | |
147 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n//
Old versions of iOS do not have bind.\n\nif (!Function.prototype.bind) {\n Func
tion.prototype.bind = function(scope) {\n var self = this;\n var args = Ar
ray.prototype.slice.call(arguments, 1);\n return function() {\n var args
2 = args.slice();\n args2.push.apply(args2, arguments);\n return self.
apply(scope, args2);\n };\n };\n}\n\n// mixin\n\n// copy all properties from
inProps (et al) to inObj\nfunction mixin(inObj/*, inProps, inMoreProps, ...*/)
{\n var obj = inObj || {};\n for (var i = 1; i < arguments.length; i++) {\n
var p = arguments[i];\n try {\n for (var n in p) {\n copyPropert
y(n, p, obj);\n }\n } catch(x) {\n }\n }\n return obj;\n}\n\n// cop
y property inName from inSource object to inTarget object\nfunction copyProperty
(inName, inSource, inTarget) {\n var pd = getPropertyDescriptor(inSource, inNam
e);\n Object.defineProperty(inTarget, inName, pd);\n}\n\n// get property descri
ptor for inName on inObject, even if\n// inName exists on some link in inObject'
s prototype chain\nfunction getPropertyDescriptor(inObject, inName) {\n if (inO
bject) {\n var pd = Object.getOwnPropertyDescriptor(inObject, inName);\n r
eturn pd || getPropertyDescriptor(Object.getPrototypeOf(inObject), inName);\n }
\n}\n\n// export\n\nscope.mixin = mixin;\n\n})(window.Platform);\n", | 145 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n//
Old versions of iOS do not have bind.\n\nif (!Function.prototype.bind) {\n Func
tion.prototype.bind = function(scope) {\n var self = this;\n var args = Ar
ray.prototype.slice.call(arguments, 1);\n return function() {\n var args
2 = args.slice();\n args2.push.apply(args2, arguments);\n return self.
apply(scope, args2);\n };\n };\n}\n\n// mixin\n\n// copy all properties from
inProps (et al) to inObj\nfunction mixin(inObj/*, inProps, inMoreProps, ...*/)
{\n var obj = inObj || {};\n for (var i = 1; i < arguments.length; i++) {\n
var p = arguments[i];\n try {\n for (var n in p) {\n copyPropert
y(n, p, obj);\n }\n } catch(x) {\n }\n }\n return obj;\n}\n\n// cop
y property inName from inSource object to inTarget object\nfunction copyProperty
(inName, inSource, inTarget) {\n var pd = getPropertyDescriptor(inSource, inNam
e);\n Object.defineProperty(inTarget, inName, pd);\n}\n\n// get property descri
ptor for inName on inObject, even if\n// inName exists on some link in inObject'
s prototype chain\nfunction getPropertyDescriptor(inObject, inName) {\n if (inO
bject) {\n var pd = Object.getOwnPropertyDescriptor(inObject, inName);\n r
eturn pd || getPropertyDescriptor(Object.getPrototypeOf(inObject), inName);\n }
\n}\n\n// export\n\nscope.mixin = mixin;\n\n})(window.Platform);\n", |
148 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n '
use strict';\n\n // polyfill DOMTokenList\n // * add/remove: allow these metho
ds to take multiple classNames\n // * toggle: add a 2nd argument which forces t
he given state rather\n // than toggling.\n\n var add = DOMTokenList.prototyp
e.add;\n var remove = DOMTokenList.prototype.remove;\n DOMTokenList.prototype.
add = function() {\n for (var i = 0; i < arguments.length; i++) {\n add.
call(this, arguments[i]);\n }\n };\n DOMTokenList.prototype.remove = functi
on() {\n for (var i = 0; i < arguments.length; i++) {\n remove.call(this
, arguments[i]);\n }\n };\n DOMTokenList.prototype.toggle = function(name,
bool) {\n if (arguments.length == 1) {\n bool = !this.contains(name);\n
}\n bool ? this.add(name) : this.remove(name);\n };\n DOMTokenList.proto
type.switch = function(oldName, newName) {\n oldName && this.remove(oldName);
\n newName && this.add(newName);\n };\n\n // add array() to NodeList, Named
NodeMap, HTMLCollection\n\n var ArraySlice = function() {\n return Array.pro
totype.slice.call(this);\n };\n\n var namedNodeMap = (window.NamedNodeMap || w
indow.MozNamedAttrMap || {});\n\n NodeList.prototype.array = ArraySlice;\n nam
edNodeMap.prototype.array = ArraySlice;\n HTMLCollection.prototype.array = Arra
ySlice;\n\n // polyfill performance.now\n\n if (!window.performance) {\n va
r start = Date.now();\n // only at millisecond precision\n window.performa
nce = {now: function(){ return Date.now() - start }};\n }\n\n // polyfill for
requestAnimationFrame\n\n if (!window.requestAnimationFrame) {\n window.requ
estAnimationFrame = (function() {\n var nativeRaf = window.webkitRequestAni
mationFrame ||\n window.mozRequestAnimationFrame;\n\n return nativeR
af ?\n function(callback) {\n return nativeRaf(function() {\n
callback(performance.now());\n });\n } :\n funct
ion( callback ){\n return window.setTimeout(callback, 1000 / 60);\n
};\n })();\n }\n\n if (!window.cancelAnimationFrame) {\n window.canc
elAnimationFrame = (function() {\n return window.webkitCancelAnimationFram
e ||\n window.mozCancelAnimationFrame ||\n function(id) {\n
clearTimeout(id);\n };\n })();\n }\n\n // utility\n\n function c
reateDOM(inTagOrNode, inHTML, inAttrs) {\n var dom = typeof inTagOrNode == 's
tring' ?\n document.createElement(inTagOrNode) : inTagOrNode.cloneNode(tr
ue);\n dom.innerHTML = inHTML;\n if (inAttrs) {\n for (var n in inAtt
rs) {\n dom.setAttribute(n, inAttrs[n]);\n }\n }\n return dom;
\n }\n // Make a stub for Polymer() for polyfill purposes; under the HTMLImpor
ts\n // polyfill, scripts in the main document run before imports. That means\n
// if (1) polymer is imported and (2) Polymer() is called in the main document
\n // in a script after the import, 2 occurs before 1. We correct this here\n
// by specfiically patching Polymer(); this is not necessary under native\n //
HTMLImports.\n var elementDeclarations = [];\n\n var polymerStub = function(na
me, dictionary) {\n elementDeclarations.push(arguments);\n }\n window.Polym
er = polymerStub;\n\n // deliver queued delcarations\n scope.deliverDeclaratio
ns = function() {\n scope.deliverDeclarations = function() {\n throw 'Pos
sible attempt to load Polymer twice';\n };\n return elementDeclarations;\n
}\n\n // Once DOMContent has loaded, any main document scripts that depend on
\n // Polymer() should have run. Calling Polymer() now is an error until\n //
polymer is imported.\n window.addEventListener('DOMContentLoaded', function() {
\n if (window.Polymer === polymerStub) {\n window.Polymer = function() {
\n console.error('You tried to use polymer without loading it first. To '
+\n 'load polymer, <link rel=\"import\" href=\"' + \n 'compon
ents/polymer/polymer.html\">');\n };\n }\n });\n\n // exports\n scope
.createDOM = createDOM;\n\n})(window.Platform);\n", | 146 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n '
use strict';\n\n // polyfill DOMTokenList\n // * add/remove: allow these metho
ds to take multiple classNames\n // * toggle: add a 2nd argument which forces t
he given state rather\n // than toggling.\n\n var add = DOMTokenList.prototyp
e.add;\n var remove = DOMTokenList.prototype.remove;\n DOMTokenList.prototype.
add = function() {\n for (var i = 0; i < arguments.length; i++) {\n add.
call(this, arguments[i]);\n }\n };\n DOMTokenList.prototype.remove = functi
on() {\n for (var i = 0; i < arguments.length; i++) {\n remove.call(this
, arguments[i]);\n }\n };\n DOMTokenList.prototype.toggle = function(name,
bool) {\n if (arguments.length == 1) {\n bool = !this.contains(name);\n
}\n bool ? this.add(name) : this.remove(name);\n };\n DOMTokenList.proto
type.switch = function(oldName, newName) {\n oldName && this.remove(oldName);
\n newName && this.add(newName);\n };\n\n // add array() to NodeList, Named
NodeMap, HTMLCollection\n\n var ArraySlice = function() {\n return Array.pro
totype.slice.call(this);\n };\n\n var namedNodeMap = (window.NamedNodeMap || w
indow.MozNamedAttrMap || {});\n\n NodeList.prototype.array = ArraySlice;\n nam
edNodeMap.prototype.array = ArraySlice;\n HTMLCollection.prototype.array = Arra
ySlice;\n\n // polyfill performance.now\n\n if (!window.performance) {\n va
r start = Date.now();\n // only at millisecond precision\n window.performa
nce = {now: function(){ return Date.now() - start }};\n }\n\n // polyfill for
requestAnimationFrame\n\n if (!window.requestAnimationFrame) {\n window.requ
estAnimationFrame = (function() {\n var nativeRaf = window.webkitRequestAni
mationFrame ||\n window.mozRequestAnimationFrame;\n\n return nativeR
af ?\n function(callback) {\n return nativeRaf(function() {\n
callback(performance.now());\n });\n } :\n funct
ion( callback ){\n return window.setTimeout(callback, 1000 / 60);\n
};\n })();\n }\n\n if (!window.cancelAnimationFrame) {\n window.canc
elAnimationFrame = (function() {\n return window.webkitCancelAnimationFram
e ||\n window.mozCancelAnimationFrame ||\n function(id) {\n
clearTimeout(id);\n };\n })();\n }\n\n // utility\n\n function c
reateDOM(inTagOrNode, inHTML, inAttrs) {\n var dom = typeof inTagOrNode == 's
tring' ?\n document.createElement(inTagOrNode) : inTagOrNode.cloneNode(tr
ue);\n dom.innerHTML = inHTML;\n if (inAttrs) {\n for (var n in inAtt
rs) {\n dom.setAttribute(n, inAttrs[n]);\n }\n }\n return dom;
\n }\n // Make a stub for Polymer() for polyfill purposes; under the HTMLImpor
ts\n // polyfill, scripts in the main document run before imports. That means\n
// if (1) polymer is imported and (2) Polymer() is called in the main document
\n // in a script after the import, 2 occurs before 1. We correct this here\n
// by specfiically patching Polymer(); this is not necessary under native\n //
HTMLImports.\n var elementDeclarations = [];\n\n var polymerStub = function(na
me, dictionary) {\n elementDeclarations.push(arguments);\n }\n window.Polym
er = polymerStub;\n\n // deliver queued delcarations\n scope.deliverDeclaratio
ns = function() {\n scope.deliverDeclarations = function() {\n throw 'Pos
sible attempt to load Polymer twice';\n };\n return elementDeclarations;\n
}\n\n // Once DOMContent has loaded, any main document scripts that depend on
\n // Polymer() should have run. Calling Polymer() now is an error until\n //
polymer is imported.\n window.addEventListener('DOMContentLoaded', function() {
\n if (window.Polymer === polymerStub) {\n window.Polymer = function() {
\n console.error('You tried to use polymer without loading it first. To '
+\n 'load polymer, <link rel=\"import\" href=\"' + \n 'compon
ents/polymer/polymer.html\">');\n };\n }\n });\n\n // exports\n scope
.createDOM = createDOM;\n\n})(window.Platform);\n", |
149 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n// poor man's adapter for
template.content on various platform scenarios\n(function(scope) {\n scope.tem
plateContent = scope.templateContent || function(inTemplate) {\n return inTem
plate.content;\n };\n})(window.Platform);\n", | 147 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n// poor man's adapter for
template.content on various platform scenarios\n(function(scope) {\n scope.tem
plateContent = scope.templateContent || function(inTemplate) {\n return inTem
plate.content;\n };\n})(window.Platform);\n", |
150 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n \n
scope = scope || (window.Inspector = {});\n \n var inspector;\n\n window.sin
spect = function(inNode, inProxy) {\n if (!inspector) {\n inspector = wi
ndow.open('', 'ShadowDOM Inspector', null, true);\n inspector.document.writ
e(inspectorHTML);\n //inspector.document.close();\n inspector.api = {\
n shadowize: shadowize\n };\n }\n inspect(inNode || wrap(docum
ent.body), inProxy);\n };\n\n var inspectorHTML = [\n '<!DOCTYPE html>',\n
'<html>',\n ' <head>',\n ' <title>ShadowDOM Inspector</title>',\n
' <style>',\n ' body {',\n ' }',\n ' pre {',\n '
font: 9pt \"Courier New\", monospace;',\n ' line-height: 1.5em
;',\n ' }',\n ' tag {',\n ' color: purple;',\n '
}',\n ' ul {',\n ' margin: 0;',\n ' padding: 0;
',\n ' list-style: none;',\n ' }',\n ' li {',\n '
display: inline-block;',\n ' background-color: #f1f1f1;',\n
' padding: 4px 6px;',\n ' border-radius: 4px;',\n '
margin-right: 4px;',\n ' }',\n ' </style>',\n ' </head>',\
n ' <body>',\n ' <ul id=\"crumbs\">',\n ' </ul>',\n ' <div
id=\"tree\"></div>',\n ' </body>',\n '</html>'\n ].join('\\n');\n \n
var crumbs = [];\n\n var displayCrumbs = function() {\n // alias our documen
t\n var d = inspector.document;\n // get crumbbar\n var cb = d.querySel
ector('#crumbs');\n // clear crumbs\n cb.textContent = '';\n // build n
ew crumbs\n for (var i=0, c; c=crumbs[i]; i++) {\n var a = d.createEleme
nt('a');\n a.href = '#';\n a.textContent = c.localName;\n a.idx =
i;\n a.onclick = function(event) {\n var c;\n while (crumbs.
length > this.idx) {\n c = crumbs.pop();\n }\n inspect(c.
shadow || c, c);\n event.preventDefault();\n };\n cb.appendChil
d(d.createElement('li')).appendChild(a);\n }\n };\n\n var inspect = functio
n(inNode, inProxy) {\n // alias our document\n var d = inspector.document;
\n // reset list of drillable nodes\n drillable = [];\n // memoize our
crumb proxy\n var proxy = inProxy || inNode;\n crumbs.push(proxy);\n //
update crumbs\n displayCrumbs();\n // reflect local tree\n d.body.quer
ySelector('#tree').innerHTML =\n '<pre>' + output(inNode, inNode.childNod
es) + '</pre>';\n };\n\n var forEach = Array.prototype.forEach.call.bind(Array
.prototype.forEach);\n\n var blacklisted = {STYLE:1, SCRIPT:1, \"#comment\": 1,
TEMPLATE: 1};\n var blacklist = function(inNode) {\n return blacklisted[inN
ode.nodeName];\n };\n\n var output = function(inNode, inChildNodes, inIndent)
{\n if (blacklist(inNode)) {\n return '';\n }\n var indent = inInd
ent || '';\n if (inNode.localName || inNode.nodeType == 11) {\n var name
= inNode.localName || 'shadow-root';\n //inChildNodes = ShadowDOM.localNod
es(inNode);\n var info = indent + describe(inNode);\n // if only textN
odes\n // TODO(sjmiles): make correct for ShadowDOM\n /*if (!inNode.ch
ildren.length && inNode.localName !== 'content' && inNode.localName !== 'shadow'
) {\n info += catTextContent(inChildNodes);\n } else*/ {\n //
TODO(sjmiles): native <shadow> has no reference to its projection\n if (
name == 'content' /*|| name == 'shadow'*/) {\n inChildNodes = inNode.ge
tDistributedNodes();\n }\n info += '<br/>';\n var ind = ind
ent + ' ';\n forEach(inChildNodes, function(n) {\n in
fo += output(n, n.childNodes, ind);\n });\n info += indent;\n
}\n if (!({br:1}[name])) {\n info += '<tag></' + name + '></t
ag>';\n info += '<br/>';\n }\n } else {\n var text = inNode.
textContent.trim();\n info = text ? indent + '\"' + text + '\"' + '<br/>' :
'';\n }\n return info;\n };\n\n var catTextContent = function(inChildNo
des) {\n var info = '';\n forEach(inChildNodes, function(n) {\n info
+= n.textContent.trim();\n });\n return info;\n };\n\n var drillable = [
];\n\n var describe = function(inNode) {\n var tag = '<tag>' + '<';\n
var name = inNode.localName || 'shadow-root';\n if (inNode.webkitShadowRoot |
| inNode.shadowRoot) {\n tag += ' <button idx=\"' + drillable.length +\n
'\" onclick=\"api.shadowize.call(this)\">' + name + '</button>';\n dri
llable.push(inNode);\n } else {\n tag += name || 'shadow-root';\n }\n
if (inNode.attributes) {\n forEach(inNode.attributes, function(a) {\n
tag += ' ' + a.name + (a.value ? '=\"' + a.value + '\"' : '');\n });\
n }\n tag += '>'+ '</tag>';\n return tag;\n };\n\n // remote api\n
\n shadowize = function() {\n var idx = Number(this.attributes.idx.value);\n
//alert(idx);\n var node = drillable[idx];\n if (node) {\n inspec
t(node.webkitShadowRoot || node.shadowRoot, node)\n } else {\n console.l
og(\"bad shadowize node\");\n console.dir(this);\n }\n };\n \n // exp
ort\n \n scope.output = output;\n \n})(window.Inspector);\n", | 148 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n \n
scope = scope || (window.Inspector = {});\n \n var inspector;\n\n window.sin
spect = function(inNode, inProxy) {\n if (!inspector) {\n inspector = wi
ndow.open('', 'ShadowDOM Inspector', null, true);\n inspector.document.writ
e(inspectorHTML);\n //inspector.document.close();\n inspector.api = {\
n shadowize: shadowize\n };\n }\n inspect(inNode || wrap(docum
ent.body), inProxy);\n };\n\n var inspectorHTML = [\n '<!DOCTYPE html>',\n
'<html>',\n ' <head>',\n ' <title>ShadowDOM Inspector</title>',\n
' <style>',\n ' body {',\n ' }',\n ' pre {',\n '
font: 9pt \"Courier New\", monospace;',\n ' line-height: 1.5em
;',\n ' }',\n ' tag {',\n ' color: purple;',\n '
}',\n ' ul {',\n ' margin: 0;',\n ' padding: 0;
',\n ' list-style: none;',\n ' }',\n ' li {',\n '
display: inline-block;',\n ' background-color: #f1f1f1;',\n
' padding: 4px 6px;',\n ' border-radius: 4px;',\n '
margin-right: 4px;',\n ' }',\n ' </style>',\n ' </head>',\
n ' <body>',\n ' <ul id=\"crumbs\">',\n ' </ul>',\n ' <div
id=\"tree\"></div>',\n ' </body>',\n '</html>'\n ].join('\\n');\n \n
var crumbs = [];\n\n var displayCrumbs = function() {\n // alias our documen
t\n var d = inspector.document;\n // get crumbbar\n var cb = d.querySel
ector('#crumbs');\n // clear crumbs\n cb.textContent = '';\n // build n
ew crumbs\n for (var i=0, c; c=crumbs[i]; i++) {\n var a = d.createEleme
nt('a');\n a.href = '#';\n a.textContent = c.localName;\n a.idx =
i;\n a.onclick = function(event) {\n var c;\n while (crumbs.
length > this.idx) {\n c = crumbs.pop();\n }\n inspect(c.
shadow || c, c);\n event.preventDefault();\n };\n cb.appendChil
d(d.createElement('li')).appendChild(a);\n }\n };\n\n var inspect = functio
n(inNode, inProxy) {\n // alias our document\n var d = inspector.document;
\n // reset list of drillable nodes\n drillable = [];\n // memoize our
crumb proxy\n var proxy = inProxy || inNode;\n crumbs.push(proxy);\n //
update crumbs\n displayCrumbs();\n // reflect local tree\n d.body.quer
ySelector('#tree').innerHTML =\n '<pre>' + output(inNode, inNode.childNod
es) + '</pre>';\n };\n\n var forEach = Array.prototype.forEach.call.bind(Array
.prototype.forEach);\n\n var blacklisted = {STYLE:1, SCRIPT:1, \"#comment\": 1,
TEMPLATE: 1};\n var blacklist = function(inNode) {\n return blacklisted[inN
ode.nodeName];\n };\n\n var output = function(inNode, inChildNodes, inIndent)
{\n if (blacklist(inNode)) {\n return '';\n }\n var indent = inInd
ent || '';\n if (inNode.localName || inNode.nodeType == 11) {\n var name
= inNode.localName || 'shadow-root';\n //inChildNodes = ShadowDOM.localNod
es(inNode);\n var info = indent + describe(inNode);\n // if only textN
odes\n // TODO(sjmiles): make correct for ShadowDOM\n /*if (!inNode.ch
ildren.length && inNode.localName !== 'content' && inNode.localName !== 'shadow'
) {\n info += catTextContent(inChildNodes);\n } else*/ {\n //
TODO(sjmiles): native <shadow> has no reference to its projection\n if (
name == 'content' /*|| name == 'shadow'*/) {\n inChildNodes = inNode.ge
tDistributedNodes();\n }\n info += '<br/>';\n var ind = ind
ent + ' ';\n forEach(inChildNodes, function(n) {\n in
fo += output(n, n.childNodes, ind);\n });\n info += indent;\n
}\n if (!({br:1}[name])) {\n info += '<tag></' + name + '></t
ag>';\n info += '<br/>';\n }\n } else {\n var text = inNode.
textContent.trim();\n info = text ? indent + '\"' + text + '\"' + '<br/>' :
'';\n }\n return info;\n };\n\n var catTextContent = function(inChildNo
des) {\n var info = '';\n forEach(inChildNodes, function(n) {\n info
+= n.textContent.trim();\n });\n return info;\n };\n\n var drillable = [
];\n\n var describe = function(inNode) {\n var tag = '<tag>' + '<';\n
var name = inNode.localName || 'shadow-root';\n if (inNode.webkitShadowRoot |
| inNode.shadowRoot) {\n tag += ' <button idx=\"' + drillable.length +\n
'\" onclick=\"api.shadowize.call(this)\">' + name + '</button>';\n dri
llable.push(inNode);\n } else {\n tag += name || 'shadow-root';\n }\n
if (inNode.attributes) {\n forEach(inNode.attributes, function(a) {\n
tag += ' ' + a.name + (a.value ? '=\"' + a.value + '\"' : '');\n });\
n }\n tag += '>'+ '</tag>';\n return tag;\n };\n\n // remote api\n
\n shadowize = function() {\n var idx = Number(this.attributes.idx.value);\n
//alert(idx);\n var node = drillable[idx];\n if (node) {\n inspec
t(node.webkitShadowRoot || node.shadowRoot, node)\n } else {\n console.l
og(\"bad shadowize node\");\n console.dir(this);\n }\n };\n \n // exp
ort\n \n scope.output = output;\n \n})(window.Inspector);\n", |
151 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n /
/ TODO(sorvell): It's desireable to provide a default stylesheet \n // that's c
onvenient for styling unresolved elements, but\n // it's cumbersome to have to
include this manually in every page.\n // It would make sense to put inside som
e HTMLImport but \n // the HTMLImports polyfill does not allow loading of style
sheets \n // that block rendering. Therefore this injection is tolerated here.\
n\n var style = document.createElement('style');\n style.textContent = ''\n
+ 'body {'\n + 'transition: opacity ease-in 0.2s;' \n + ' } \\n'\n
+ 'body[unresolved] {'\n + 'opacity: 0; display: block; overflow: hidd
en;' \n + ' } \\n'\n ;\n var head = document.querySelector('head');\n
head.insertBefore(style, head.firstChild);\n\n})(Platform);\n", | 149 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n /
/ TODO(sorvell): It's desireable to provide a default stylesheet \n // that's c
onvenient for styling unresolved elements, but\n // it's cumbersome to have to
include this manually in every page.\n // It would make sense to put inside som
e HTMLImport but \n // the HTMLImports polyfill does not allow loading of style
sheets \n // that block rendering. Therefore this injection is tolerated here.\
n\n var style = document.createElement('style');\n style.textContent = ''\n
+ 'body {'\n + 'transition: opacity ease-in 0.2s;' \n + ' } \\n'\n
+ 'body[unresolved] {'\n + 'opacity: 0; display: block; overflow: hidd
en;' \n + ' } \\n'\n ;\n var head = document.querySelector('head');\n
head.insertBefore(style, head.firstChild);\n\n})(Platform);\n", |
152 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n f
unction withDependencies(task, depends) {\n depends = depends || [];\n if
(!depends.map) {\n depends = [depends];\n }\n return task.apply(this,
depends.map(marshal));\n }\n\n function module(name, dependsOrFactory, module
Factory) {\n var module;\n switch (arguments.length) {\n case 0:\n
return;\n case 1:\n module = null;\n break;\n case
2:\n // dependsOrFactory is `factory` in this case\n module = depe
ndsOrFactory.apply(this);\n break;\n default:\n // dependsOrF
actory is `depends` in this case\n module = withDependencies(moduleFactor
y, dependsOrFactory);\n break;\n }\n modules[name] = module;\n };\
n\n function marshal(name) {\n return modules[name];\n }\n\n var modules =
{};\n\n function using(depends, task) {\n HTMLImports.whenImportsReady(func
tion() {\n withDependencies(task, depends);\n });\n };\n\n // exports\
n\n scope.marshal = marshal;\n // `module` confuses commonjs detectors\n scop
e.modularize = module;\n scope.using = using;\n\n})(window);\n", | 150 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n f
unction withDependencies(task, depends) {\n depends = depends || [];\n if
(!depends.map) {\n depends = [depends];\n }\n return task.apply(this,
depends.map(marshal));\n }\n\n function module(name, dependsOrFactory, module
Factory) {\n var module;\n switch (arguments.length) {\n case 0:\n
return;\n case 1:\n module = null;\n break;\n case
2:\n // dependsOrFactory is `factory` in this case\n module = depe
ndsOrFactory.apply(this);\n break;\n default:\n // dependsOrF
actory is `depends` in this case\n module = withDependencies(moduleFactor
y, dependsOrFactory);\n break;\n }\n modules[name] = module;\n };\
n\n function marshal(name) {\n return modules[name];\n }\n\n var modules =
{};\n\n function using(depends, task) {\n HTMLImports.whenImportsReady(func
tion() {\n withDependencies(task, depends);\n });\n };\n\n // exports\
n\n scope.marshal = marshal;\n // `module` confuses commonjs detectors\n scop
e.modularize = module;\n scope.using = using;\n\n})(window);\n", |
153 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\nvar
iterations = 0;\nvar callbacks = [];\nvar twiddle = document.createTextNode('')
;\n\nfunction endOfMicrotask(callback) {\n twiddle.textContent = iterations++;\
n callbacks.push(callback);\n}\n\nfunction atEndOfMicrotask() {\n while (callb
acks.length) {\n callbacks.shift()();\n }\n}\n\nnew (window.MutationObserver
|| JsMutationObserver)(atEndOfMicrotask)\n .observe(twiddle, {characterData: t
rue})\n ;\n\n// exports\n\nscope.endOfMicrotask = endOfMicrotask;\n\n})(Platfor
m);\n\n", | 151 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\nvar
iterations = 0;\nvar callbacks = [];\nvar twiddle = document.createTextNode('')
;\n\nfunction endOfMicrotask(callback) {\n twiddle.textContent = iterations++;\
n callbacks.push(callback);\n}\n\nfunction atEndOfMicrotask() {\n while (callb
acks.length) {\n callbacks.shift()();\n }\n}\n\nnew (window.MutationObserver
|| JsMutationObserver)(atEndOfMicrotask)\n .observe(twiddle, {characterData: t
rue})\n ;\n\n// exports\n\nscope.endOfMicrotask = endOfMicrotask;\n\n})(Platfor
m);\n\n", |
154 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\nvar
urlResolver = {\n resolveDom: function(root, url) {\n url = url || root.own
erDocument.baseURI;\n this.resolveAttributes(root, url);\n this.resolveSty
les(root, url);\n // handle template.content\n var templates = root.queryS
electorAll('template');\n if (templates) {\n for (var i = 0, l = templat
es.length, t; (i < l) && (t = templates[i]); i++) {\n if (t.content) {\n
this.resolveDom(t.content, url);\n }\n }\n }\n },\n re
solveTemplate: function(template) {\n this.resolveDom(template.content, templ
ate.ownerDocument.baseURI);\n },\n resolveStyles: function(root, url) {\n v
ar styles = root.querySelectorAll('style');\n if (styles) {\n for (var i
= 0, l = styles.length, s; (i < l) && (s = styles[i]); i++) {\n this.res
olveStyle(s, url);\n }\n }\n },\n resolveStyle: function(style, url) {
\n url = url || style.ownerDocument.baseURI;\n style.textContent = this.re
solveCssText(style.textContent, url);\n },\n resolveCssText: function(cssText,
baseUrl, keepAbsolute) {\n cssText = replaceUrlsInCssText(cssText, baseUrl,
keepAbsolute, CSS_URL_REGEXP);\n return replaceUrlsInCssText(cssText, baseUrl
, keepAbsolute, CSS_IMPORT_REGEXP);\n },\n resolveAttributes: function(root, u
rl) {\n if (root.hasAttributes && root.hasAttributes()) {\n this.resolve
ElementAttributes(root, url);\n }\n // search for attributes that host url
s\n var nodes = root && root.querySelectorAll(URL_ATTRS_SELECTOR);\n if (n
odes) {\n for (var i = 0, l = nodes.length, n; (i < l) && (n = nodes[i]); i
++) {\n this.resolveElementAttributes(n, url);\n }\n }\n },\n r
esolveElementAttributes: function(node, url) {\n url = url || node.ownerDocum
ent.baseURI;\n URL_ATTRS.forEach(function(v) {\n var attr = node.attribu
tes[v];\n var value = attr && attr.value;\n var replacement;\n if
(value && value.search(URL_TEMPLATE_SEARCH) < 0) {\n if (v === 'style')
{\n replacement = replaceUrlsInCssText(value, url, false, CSS_URL_REGEX
P);\n } else {\n replacement = resolveRelativeUrl(url, value);\n
}\n attr.value = replacement;\n }\n });\n }\n};\n\nvar C
SS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]
+(?!url\\())([^;]*)(;)/g;\nvar URL_ATTRS = ['href', 'src', 'action', 'style', 'u
rl'];\nvar URL_ATTRS_SELECTOR = '[' + URL_ATTRS.join('],[') + ']';\nvar URL_TEMP
LATE_SEARCH = '{{.*}}';\n\nfunction replaceUrlsInCssText(cssText, baseUrl, keepA
bsolute, regexp) {\n return cssText.replace(regexp, function(m, pre, url, post)
{\n var urlPath = url.replace(/[\"']/g, '');\n urlPath = resolveRelativeU
rl(baseUrl, urlPath, keepAbsolute);\n return pre + '\\'' + urlPath + '\\'' +
post;\n });\n}\n\nfunction resolveRelativeUrl(baseUrl, url, keepAbsolute) {\n
// do not resolve '/' absolute urls\n if (url && url[0] === '/') {\n return
url;\n }\n var u = new URL(url, baseUrl);\n return keepAbsolute ? u.href : ma
keDocumentRelPath(u.href);\n}\n\nfunction makeDocumentRelPath(url) {\n var root
= new URL(document.baseURI);\n var u = new URL(url, root);\n if (u.host === r
oot.host && u.port === root.port &&\n u.protocol === root.protocol) {\n
return makeRelPath(root, u);\n } else {\n return url;\n }\n}\n\n// make a r
elative path from source to target\nfunction makeRelPath(sourceUrl, targetUrl) {
\n var source = sourceUrl.pathname;\n var target = targetUrl.pathname;\n var
s = source.split('/');\n var t = target.split('/');\n while (s.length && s[0]
=== t[0]){\n s.shift();\n t.shift();\n }\n for (var i = 0, l = s.length
- 1; i < l; i++) {\n t.unshift('..');\n }\n return t.join('/') + targetUrl.
search + targetUrl.hash;\n}\n\n// exports\nscope.urlResolver = urlResolver;\n\n}
)(Platform);\n", | 152 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\nvar
urlResolver = {\n resolveDom: function(root, url) {\n url = url || root.own
erDocument.baseURI;\n this.resolveAttributes(root, url);\n this.resolveSty
les(root, url);\n // handle template.content\n var templates = root.queryS
electorAll('template');\n if (templates) {\n for (var i = 0, l = templat
es.length, t; (i < l) && (t = templates[i]); i++) {\n if (t.content) {\n
this.resolveDom(t.content, url);\n }\n }\n }\n },\n re
solveTemplate: function(template) {\n this.resolveDom(template.content, templ
ate.ownerDocument.baseURI);\n },\n resolveStyles: function(root, url) {\n v
ar styles = root.querySelectorAll('style');\n if (styles) {\n for (var i
= 0, l = styles.length, s; (i < l) && (s = styles[i]); i++) {\n this.res
olveStyle(s, url);\n }\n }\n },\n resolveStyle: function(style, url) {
\n url = url || style.ownerDocument.baseURI;\n style.textContent = this.re
solveCssText(style.textContent, url);\n },\n resolveCssText: function(cssText,
baseUrl, keepAbsolute) {\n cssText = replaceUrlsInCssText(cssText, baseUrl,
keepAbsolute, CSS_URL_REGEXP);\n return replaceUrlsInCssText(cssText, baseUrl
, keepAbsolute, CSS_IMPORT_REGEXP);\n },\n resolveAttributes: function(root, u
rl) {\n if (root.hasAttributes && root.hasAttributes()) {\n this.resolve
ElementAttributes(root, url);\n }\n // search for attributes that host url
s\n var nodes = root && root.querySelectorAll(URL_ATTRS_SELECTOR);\n if (n
odes) {\n for (var i = 0, l = nodes.length, n; (i < l) && (n = nodes[i]); i
++) {\n this.resolveElementAttributes(n, url);\n }\n }\n },\n r
esolveElementAttributes: function(node, url) {\n url = url || node.ownerDocum
ent.baseURI;\n URL_ATTRS.forEach(function(v) {\n var attr = node.attribu
tes[v];\n var value = attr && attr.value;\n var replacement;\n if
(value && value.search(URL_TEMPLATE_SEARCH) < 0) {\n if (v === 'style')
{\n replacement = replaceUrlsInCssText(value, url, false, CSS_URL_REGEX
P);\n } else {\n replacement = resolveRelativeUrl(url, value);\n
}\n attr.value = replacement;\n }\n });\n }\n};\n\nvar C
SS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]
+(?!url\\())([^;]*)(;)/g;\nvar URL_ATTRS = ['href', 'src', 'action', 'style', 'u
rl'];\nvar URL_ATTRS_SELECTOR = '[' + URL_ATTRS.join('],[') + ']';\nvar URL_TEMP
LATE_SEARCH = '{{.*}}';\n\nfunction replaceUrlsInCssText(cssText, baseUrl, keepA
bsolute, regexp) {\n return cssText.replace(regexp, function(m, pre, url, post)
{\n var urlPath = url.replace(/[\"']/g, '');\n urlPath = resolveRelativeU
rl(baseUrl, urlPath, keepAbsolute);\n return pre + '\\'' + urlPath + '\\'' +
post;\n });\n}\n\nfunction resolveRelativeUrl(baseUrl, url, keepAbsolute) {\n
// do not resolve '/' absolute urls\n if (url && url[0] === '/') {\n return
url;\n }\n var u = new URL(url, baseUrl);\n return keepAbsolute ? u.href : ma
keDocumentRelPath(u.href);\n}\n\nfunction makeDocumentRelPath(url) {\n var root
= new URL(document.baseURI);\n var u = new URL(url, root);\n if (u.host === r
oot.host && u.port === root.port &&\n u.protocol === root.protocol) {\n
return makeRelPath(root, u);\n } else {\n return url;\n }\n}\n\n// make a r
elative path from source to target\nfunction makeRelPath(sourceUrl, targetUrl) {
\n var source = sourceUrl.pathname;\n var target = targetUrl.pathname;\n var
s = source.split('/');\n var t = target.split('/');\n while (s.length && s[0]
=== t[0]){\n s.shift();\n t.shift();\n }\n for (var i = 0, l = s.length
- 1; i < l; i++) {\n t.unshift('..');\n }\n return t.join('/') + targetUrl.
search + targetUrl.hash;\n}\n\n// exports\nscope.urlResolver = urlResolver;\n\n}
)(Platform);\n", |
155 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(global) {\n\n var registrationsTable = new We
akMap();\n\n // We use setImmediate or postMessage for our future callback.\n
var setImmediate = window.msSetImmediate;\n\n // Use post message to emulate se
tImmediate.\n if (!setImmediate) {\n var setImmediateQueue = [];\n var se
ntinel = String(Math.random());\n window.addEventListener('message', function
(e) {\n if (e.data === sentinel) {\n var queue = setImmediateQueue;\
n setImmediateQueue = [];\n queue.forEach(function(func) {\n
func();\n });\n }\n });\n setImmediate = function(func) {\
n setImmediateQueue.push(func);\n window.postMessage(sentinel, '*');\n
};\n }\n\n // This is used to ensure that we never schedule 2 callas to se
tImmediate\n var isScheduled = false;\n\n // Keep track of observers that need
s to be notified next time.\n var scheduledObservers = [];\n\n /**\n * Sched
ules |dispatchCallback| to be called in the future.\n * @param {MutationObserv
er} observer\n */\n function scheduleCallback(observer) {\n scheduledObser
vers.push(observer);\n if (!isScheduled) {\n isScheduled = true;\n
setImmediate(dispatchCallbacks);\n }\n }\n\n function wrapIfNeeded(node) {\
n return window.ShadowDOMPolyfill &&\n window.ShadowDOMPolyfill.wrapIf
Needed(node) ||\n node;\n }\n\n function dispatchCallbacks() {\n //
http://dom.spec.whatwg.org/#mutation-observers\n\n isScheduled = false; // Us
ed to allow a new setImmediate call above.\n\n var observers = scheduledObser
vers;\n scheduledObservers = [];\n // Sort observers based on their creati
on UID (incremental).\n observers.sort(function(o1, o2) {\n return o1.ui
d_ - o2.uid_;\n });\n\n var anyNonEmpty = false;\n observers.forEach(fu
nction(observer) {\n\n // 2.1, 2.2\n var queue = observer.takeRecords(
);\n // 2.3. Remove all transient registered observers whose observer is mo
.\n removeTransientObserversFor(observer);\n\n // 2.4\n if (queue
.length) {\n observer.callback_(queue, observer);\n anyNonEmpty =
true;\n }\n });\n\n // 3.\n if (anyNonEmpty)\n dispatchCallba
cks();\n }\n\n function removeTransientObserversFor(observer) {\n observer.
nodes_.forEach(function(node) {\n var registrations = registrationsTable.ge
t(node);\n if (!registrations)\n return;\n registrations.forEac
h(function(registration) {\n if (registration.observer === observer)\n
registration.removeTransientObservers();\n });\n });\n }\n\n /*
*\n * This function is used for the \"For each registered observer observer (w
ith\n * observer's options as options) in target's list of registered observer
s,\n * run these substeps:\" and the \"For each ancestor ancestor of target, a
nd for\n * each registered observer observer (with options options) in ancesto
r's list\n * of registered observers, run these substeps:\" part of the algori
thms. The\n * |options.subtree| is checked to ensure that the callback is call
ed\n * correctly.\n *\n * @param {Node} target\n * @param {function(Muta
tionObserverInit):MutationRecord} callback\n */\n function forEachAncestorAnd
ObserverEnqueueRecord(target, callback) {\n for (var node = target; node; nod
e = node.parentNode) {\n var registrations = registrationsTable.get(node);\
n\n if (registrations) {\n for (var j = 0; j < registrations.length;
j++) {\n var registration = registrations[j];\n var options =
registration.options;\n\n // Only target ignores subtree.\n i
f (node !== target && !options.subtree)\n continue;\n\n var
record = callback(options);\n if (record)\n registration.enq
ueue(record);\n }\n }\n }\n }\n\n var uidCounter = 0;\n\n /**\
n * The class that maps to the DOM MutationObserver interface.\n * @param {F
unction} callback.\n * @constructor\n */\n function JsMutationObserver(call
back) {\n this.callback_ = callback;\n this.nodes_ = [];\n this.records
_ = [];\n this.uid_ = ++uidCounter;\n }\n\n JsMutationObserver.prototype =
{\n observe: function(target, options) {\n target = wrapIfNeeded(target)
;\n\n // 1.1\n if (!options.childList && !options.attributes && !optio
ns.characterData ||\n\n // 1.2\n options.attributeOldValue &&
!options.attributes ||\n\n // 1.3\n options.attributeFilter &&
options.attributeFilter.length &&\n !options.attributes ||\n\n
// 1.4\n options.characterDataOldValue && !options.characterData)
{\n\n throw new SyntaxError();\n }\n\n var registrations = reg
istrationsTable.get(target);\n if (!registrations)\n registrationsTa
ble.set(target, registrations = []);\n\n // 2\n // If target's list of
registered observers already includes a registered\n // observer associate
d with the context object, replace that registered\n // observer's options
with options.\n var registration;\n for (var i = 0; i < registrations.
length; i++) {\n if (registrations[i].observer === this) {\n reg
istration = registrations[i];\n registration.removeListeners();\n
registration.options = options;\n break;\n }\n }\n\n
// 3.\n // Otherwise, add a new registered observer to target's list of
registered\n // observers with the context object as the observer and optio
ns as the\n // options, and add target to context object's list of nodes on
which it\n // is registered.\n if (!registration) {\n registra
tion = new Registration(this, target, options);\n registrations.push(regi
stration);\n this.nodes_.push(target);\n }\n\n registration.add
Listeners();\n },\n\n disconnect: function() {\n this.nodes_.forEach(
function(node) {\n var registrations = registrationsTable.get(node);\n
for (var i = 0; i < registrations.length; i++) {\n var registratio
n = registrations[i];\n if (registration.observer === this) {\n
registration.removeListeners();\n registrations.splice(i, 1);\n
// Each node can only have one registered observer associated with\n
// this observer.\n break;\n }\n }\n }
, this);\n this.records_ = [];\n },\n\n takeRecords: function() {\n
var copyOfRecords = this.records_;\n this.records_ = [];\n return
copyOfRecords;\n }\n };\n\n /**\n * @param {string} type\n * @param {No
de} target\n * @constructor\n */\n function MutationRecord(type, target) {\
n this.type = type;\n this.target = target;\n this.addedNodes = [];\n
this.removedNodes = [];\n this.previousSibling = null;\n this.nextSiblin
g = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n
this.oldValue = null;\n }\n\n function copyMutationRecord(original) {\n
var record = new MutationRecord(original.type, original.target);\n record.ad
dedNodes = original.addedNodes.slice();\n record.removedNodes = original.remo
vedNodes.slice();\n record.previousSibling = original.previousSibling;\n r
ecord.nextSibling = original.nextSibling;\n record.attributeName = original.a
ttributeName;\n record.attributeNamespace = original.attributeNamespace;\n
record.oldValue = original.oldValue;\n return record;\n };\n\n // We keep
track of the two (possibly one) records used in a single mutation.\n var curren
tRecord, recordWithOldValue;\n\n /**\n * Creates a record without |oldValue|
and caches it as |currentRecord| for\n * later use.\n * @param {string} oldV
alue\n * @return {MutationRecord}\n */\n function getRecord(type, target) {
\n return currentRecord = new MutationRecord(type, target);\n }\n\n /**\n
* Gets or creates a record with |oldValue| based in the |currentRecord|\n * @
param {string} oldValue\n * @return {MutationRecord}\n */\n function getRec
ordWithOldValue(oldValue) {\n if (recordWithOldValue)\n return recordWit
hOldValue;\n recordWithOldValue = copyMutationRecord(currentRecord);\n rec
ordWithOldValue.oldValue = oldValue;\n return recordWithOldValue;\n }\n\n f
unction clearRecords() {\n currentRecord = recordWithOldValue = undefined;\n
}\n\n /**\n * @param {MutationRecord} record\n * @return {boolean} Whether
the record represents a record from the current\n * mutation event.\n */\n
function recordRepresentsCurrentMutation(record) {\n return record === recor
dWithOldValue || record === currentRecord;\n }\n\n /**\n * Selects which rec
ord, if any, to replace the last record in the queue.\n * This returns |null|
if no record should be replaced.\n *\n * @param {MutationRecord} lastRecord\
n * @param {MutationRecord} newRecord\n * @param {MutationRecord}\n */\n
function selectRecord(lastRecord, newRecord) {\n if (lastRecord === newRecord
)\n return lastRecord;\n\n // Check if the the record we are adding repr
esents the same record. If\n // so, we keep the one with the oldValue in it.\
n if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord))\n
return recordWithOldValue;\n\n return null;\n }\n\n /**\n * Class used
to represent a registered observer.\n * @param {MutationObserver} observer\n
* @param {Node} target\n * @param {MutationObserverInit} options\n * @cons
tructor\n */\n function Registration(observer, target, options) {\n this.o
bserver = observer;\n this.target = target;\n this.options = options;\n
this.transientObservedNodes = [];\n }\n\n Registration.prototype = {\n enq
ueue: function(record) {\n var records = this.observer.records_;\n var
length = records.length;\n\n // There are cases where we replace the last
record with the new record.\n // For example if the record represents the s
ame mutation we need to use\n // the one with the oldValue. If we get same
record (this can happen as we\n // walk up the tree) we ignore the new reco
rd.\n if (records.length > 0) {\n var lastRecord = records[length -
1];\n var recordToReplaceLast = selectRecord(lastRecord, record);\n
if (recordToReplaceLast) {\n records[length - 1] = recordToReplaceLas
t;\n return;\n }\n } else {\n scheduleCallback(this.
observer);\n }\n\n records[length] = record;\n },\n\n addListene
rs: function() {\n this.addListeners_(this.target);\n },\n\n addListe
ners_: function(node) {\n var options = this.options;\n if (options.at
tributes)\n node.addEventListener('DOMAttrModified', this, true);\n\n
if (options.characterData)\n node.addEventListener('DOMCharacterDataMod
ified', this, true);\n\n if (options.childList)\n node.addEventListe
ner('DOMNodeInserted', this, true);\n\n if (options.childList || options.su
btree)\n node.addEventListener('DOMNodeRemoved', this, true);\n },\n\n
removeListeners: function() {\n this.removeListeners_(this.target);\n
},\n\n removeListeners_: function(node) {\n var options = this.options
;\n if (options.attributes)\n node.removeEventListener('DOMAttrModif
ied', this, true);\n\n if (options.characterData)\n node.removeEvent
Listener('DOMCharacterDataModified', this, true);\n\n if (options.childList
)\n node.removeEventListener('DOMNodeInserted', this, true);\n\n if
(options.childList || options.subtree)\n node.removeEventListener('DOMNod
eRemoved', this, true);\n },\n\n /**\n * Adds a transient observer on
node. The transient observer gets removed\n * next time we deliver the chang
e records.\n * @param {Node} node\n */\n addTransientObserver: functi
on(node) {\n // Don't add transient observers on the target itself. We alre
ady have all\n // the required listeners set up on the target.\n if (n
ode === this.target)\n return;\n\n this.addListeners_(node);\n
this.transientObservedNodes.push(node);\n var registrations = registrations
Table.get(node);\n if (!registrations)\n registrationsTable.set(node
, registrations = []);\n\n // We know that registrations does not contain t
his because we already\n // checked if node === this.target.\n registr
ations.push(this);\n },\n\n removeTransientObservers: function() {\n
var transientObservedNodes = this.transientObservedNodes;\n this.transientO
bservedNodes = [];\n\n transientObservedNodes.forEach(function(node) {\n
// Transient observers are never added to the target.\n this.removeL
isteners_(node);\n\n var registrations = registrationsTable.get(node);\n
for (var i = 0; i < registrations.length; i++) {\n if (registrat
ions[i] === this) {\n registrations.splice(i, 1);\n // Eac
h node can only have one registered observer associated with\n // thi
s observer.\n break;\n }\n }\n }, this);\n },
\n\n handleEvent: function(e) {\n // Stop propagation since we are manag
ing the propagation manually.\n // This means that other mutation events on
the page will not work\n // correctly but that is by design.\n e.stop
ImmediatePropagation();\n\n switch (e.type) {\n case 'DOMAttrModifie
d':\n // http://dom.spec.whatwg.org/#concept-mo-queue-attributes\n\n
var name = e.attrName;\n var namespace = e.relatedNode.namespace
URI;\n var target = e.target;\n\n // 1.\n var record
= new getRecord('attributes', target);\n record.attributeName = name;\n
record.attributeNamespace = namespace;\n\n // 2.\n v
ar oldValue =\n e.attrChange === MutationEvent.ADDITION ? null : e.
prevValue;\n\n forEachAncestorAndObserverEnqueueRecord(target, function
(options) {\n // 3.1, 4.2\n if (!options.attributes)\n
return;\n\n // 3.2, 4.3\n if (options.attributeF
ilter && options.attributeFilter.length &&\n options.attributeFil
ter.indexOf(name) === -1 &&\n options.attributeFilter.indexOf(nam
espace) === -1) {\n return;\n }\n // 3.3, 4.4
\n if (options.attributeOldValue)\n return getRecordWith
OldValue(oldValue);\n\n // 3.4, 4.5\n return record;\n
});\n\n break;\n\n case 'DOMCharacterDataModified':\n
// http://dom.spec.whatwg.org/#concept-mo-queue-characterdata\n va
r target = e.target;\n\n // 1.\n var record = getRecord('chara
cterData', target);\n\n // 2.\n var oldValue = e.prevValue;\n\
n\n forEachAncestorAndObserverEnqueueRecord(target, function(options) {
\n // 3.1, 4.2\n if (!options.characterData)\n
return;\n\n // 3.2, 4.3\n if (options.characterDataOldVa
lue)\n return getRecordWithOldValue(oldValue);\n\n // 3.
3, 4.4\n return record;\n });\n\n break;\n\n
case 'DOMNodeRemoved':\n this.addTransientObserver(e.target);\n
// Fall through.\n case 'DOMNodeInserted':\n // http://dom.sp
ec.whatwg.org/#concept-mo-queue-childlist\n var target = e.relatedNode;
\n var changedNode = e.target;\n var addedNodes, removedNodes;
\n if (e.type === 'DOMNodeInserted') {\n addedNodes = [chang
edNode];\n removedNodes = [];\n } else {\n\n adde
dNodes = [];\n removedNodes = [changedNode];\n }\n
var previousSibling = changedNode.previousSibling;\n var nextSibling =
changedNode.nextSibling;\n\n // 1.\n var record = getRecord('c
hildList', target);\n record.addedNodes = addedNodes;\n record
.removedNodes = removedNodes;\n record.previousSibling = previousSiblin
g;\n record.nextSibling = nextSibling;\n\n forEachAncestorAndO
bserverEnqueueRecord(target, function(options) {\n // 2.1, 3.2\n
if (!options.childList)\n return;\n\n // 2.2, 3.3
\n return record;\n });\n\n }\n\n clearRecords();\
n }\n };\n\n global.JsMutationObserver = JsMutationObserver;\n\n if (!glob
al.MutationObserver)\n global.MutationObserver = JsMutationObserver;\n\n\n})(
this);\n", | 153 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of
this source code is goverened by a BSD-style\n * license that can be found in th
e LICENSE file.\n */\n\n(function(global) {\n\n var registrationsTable = new We
akMap();\n\n // We use setImmediate or postMessage for our future callback.\n
var setImmediate = window.msSetImmediate;\n\n // Use post message to emulate se
tImmediate.\n if (!setImmediate) {\n var setImmediateQueue = [];\n var se
ntinel = String(Math.random());\n window.addEventListener('message', function
(e) {\n if (e.data === sentinel) {\n var queue = setImmediateQueue;\
n setImmediateQueue = [];\n queue.forEach(function(func) {\n
func();\n });\n }\n });\n setImmediate = function(func) {\
n setImmediateQueue.push(func);\n window.postMessage(sentinel, '*');\n
};\n }\n\n // This is used to ensure that we never schedule 2 callas to se
tImmediate\n var isScheduled = false;\n\n // Keep track of observers that need
s to be notified next time.\n var scheduledObservers = [];\n\n /**\n * Sched
ules |dispatchCallback| to be called in the future.\n * @param {MutationObserv
er} observer\n */\n function scheduleCallback(observer) {\n scheduledObser
vers.push(observer);\n if (!isScheduled) {\n isScheduled = true;\n
setImmediate(dispatchCallbacks);\n }\n }\n\n function wrapIfNeeded(node) {\
n return window.ShadowDOMPolyfill &&\n window.ShadowDOMPolyfill.wrapIf
Needed(node) ||\n node;\n }\n\n function dispatchCallbacks() {\n //
http://dom.spec.whatwg.org/#mutation-observers\n\n isScheduled = false; // Us
ed to allow a new setImmediate call above.\n\n var observers = scheduledObser
vers;\n scheduledObservers = [];\n // Sort observers based on their creati
on UID (incremental).\n observers.sort(function(o1, o2) {\n return o1.ui
d_ - o2.uid_;\n });\n\n var anyNonEmpty = false;\n observers.forEach(fu
nction(observer) {\n\n // 2.1, 2.2\n var queue = observer.takeRecords(
);\n // 2.3. Remove all transient registered observers whose observer is mo
.\n removeTransientObserversFor(observer);\n\n // 2.4\n if (queue
.length) {\n observer.callback_(queue, observer);\n anyNonEmpty =
true;\n }\n });\n\n // 3.\n if (anyNonEmpty)\n dispatchCallba
cks();\n }\n\n function removeTransientObserversFor(observer) {\n observer.
nodes_.forEach(function(node) {\n var registrations = registrationsTable.ge
t(node);\n if (!registrations)\n return;\n registrations.forEac
h(function(registration) {\n if (registration.observer === observer)\n
registration.removeTransientObservers();\n });\n });\n }\n\n /*
*\n * This function is used for the \"For each registered observer observer (w
ith\n * observer's options as options) in target's list of registered observer
s,\n * run these substeps:\" and the \"For each ancestor ancestor of target, a
nd for\n * each registered observer observer (with options options) in ancesto
r's list\n * of registered observers, run these substeps:\" part of the algori
thms. The\n * |options.subtree| is checked to ensure that the callback is call
ed\n * correctly.\n *\n * @param {Node} target\n * @param {function(Muta
tionObserverInit):MutationRecord} callback\n */\n function forEachAncestorAnd
ObserverEnqueueRecord(target, callback) {\n for (var node = target; node; nod
e = node.parentNode) {\n var registrations = registrationsTable.get(node);\
n\n if (registrations) {\n for (var j = 0; j < registrations.length;
j++) {\n var registration = registrations[j];\n var options =
registration.options;\n\n // Only target ignores subtree.\n i
f (node !== target && !options.subtree)\n continue;\n\n var
record = callback(options);\n if (record)\n registration.enq
ueue(record);\n }\n }\n }\n }\n\n var uidCounter = 0;\n\n /**\
n * The class that maps to the DOM MutationObserver interface.\n * @param {F
unction} callback.\n * @constructor\n */\n function JsMutationObserver(call
back) {\n this.callback_ = callback;\n this.nodes_ = [];\n this.records
_ = [];\n this.uid_ = ++uidCounter;\n }\n\n JsMutationObserver.prototype =
{\n observe: function(target, options) {\n target = wrapIfNeeded(target)
;\n\n // 1.1\n if (!options.childList && !options.attributes && !optio
ns.characterData ||\n\n // 1.2\n options.attributeOldValue &&
!options.attributes ||\n\n // 1.3\n options.attributeFilter &&
options.attributeFilter.length &&\n !options.attributes ||\n\n
// 1.4\n options.characterDataOldValue && !options.characterData)
{\n\n throw new SyntaxError();\n }\n\n var registrations = reg
istrationsTable.get(target);\n if (!registrations)\n registrationsTa
ble.set(target, registrations = []);\n\n // 2\n // If target's list of
registered observers already includes a registered\n // observer associate
d with the context object, replace that registered\n // observer's options
with options.\n var registration;\n for (var i = 0; i < registrations.
length; i++) {\n if (registrations[i].observer === this) {\n reg
istration = registrations[i];\n registration.removeListeners();\n
registration.options = options;\n break;\n }\n }\n\n
// 3.\n // Otherwise, add a new registered observer to target's list of
registered\n // observers with the context object as the observer and optio
ns as the\n // options, and add target to context object's list of nodes on
which it\n // is registered.\n if (!registration) {\n registra
tion = new Registration(this, target, options);\n registrations.push(regi
stration);\n this.nodes_.push(target);\n }\n\n registration.add
Listeners();\n },\n\n disconnect: function() {\n this.nodes_.forEach(
function(node) {\n var registrations = registrationsTable.get(node);\n
for (var i = 0; i < registrations.length; i++) {\n var registratio
n = registrations[i];\n if (registration.observer === this) {\n
registration.removeListeners();\n registrations.splice(i, 1);\n
// Each node can only have one registered observer associated with\n
// this observer.\n break;\n }\n }\n }
, this);\n this.records_ = [];\n },\n\n takeRecords: function() {\n
var copyOfRecords = this.records_;\n this.records_ = [];\n return
copyOfRecords;\n }\n };\n\n /**\n * @param {string} type\n * @param {No
de} target\n * @constructor\n */\n function MutationRecord(type, target) {\
n this.type = type;\n this.target = target;\n this.addedNodes = [];\n
this.removedNodes = [];\n this.previousSibling = null;\n this.nextSiblin
g = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n
this.oldValue = null;\n }\n\n function copyMutationRecord(original) {\n
var record = new MutationRecord(original.type, original.target);\n record.ad
dedNodes = original.addedNodes.slice();\n record.removedNodes = original.remo
vedNodes.slice();\n record.previousSibling = original.previousSibling;\n r
ecord.nextSibling = original.nextSibling;\n record.attributeName = original.a
ttributeName;\n record.attributeNamespace = original.attributeNamespace;\n
record.oldValue = original.oldValue;\n return record;\n };\n\n // We keep
track of the two (possibly one) records used in a single mutation.\n var curren
tRecord, recordWithOldValue;\n\n /**\n * Creates a record without |oldValue|
and caches it as |currentRecord| for\n * later use.\n * @param {string} oldV
alue\n * @return {MutationRecord}\n */\n function getRecord(type, target) {
\n return currentRecord = new MutationRecord(type, target);\n }\n\n /**\n
* Gets or creates a record with |oldValue| based in the |currentRecord|\n * @
param {string} oldValue\n * @return {MutationRecord}\n */\n function getRec
ordWithOldValue(oldValue) {\n if (recordWithOldValue)\n return recordWit
hOldValue;\n recordWithOldValue = copyMutationRecord(currentRecord);\n rec
ordWithOldValue.oldValue = oldValue;\n return recordWithOldValue;\n }\n\n f
unction clearRecords() {\n currentRecord = recordWithOldValue = undefined;\n
}\n\n /**\n * @param {MutationRecord} record\n * @return {boolean} Whether
the record represents a record from the current\n * mutation event.\n */\n
function recordRepresentsCurrentMutation(record) {\n return record === recor
dWithOldValue || record === currentRecord;\n }\n\n /**\n * Selects which rec
ord, if any, to replace the last record in the queue.\n * This returns |null|
if no record should be replaced.\n *\n * @param {MutationRecord} lastRecord\
n * @param {MutationRecord} newRecord\n * @param {MutationRecord}\n */\n
function selectRecord(lastRecord, newRecord) {\n if (lastRecord === newRecord
)\n return lastRecord;\n\n // Check if the the record we are adding repr
esents the same record. If\n // so, we keep the one with the oldValue in it.\
n if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord))\n
return recordWithOldValue;\n\n return null;\n }\n\n /**\n * Class used
to represent a registered observer.\n * @param {MutationObserver} observer\n
* @param {Node} target\n * @param {MutationObserverInit} options\n * @cons
tructor\n */\n function Registration(observer, target, options) {\n this.o
bserver = observer;\n this.target = target;\n this.options = options;\n
this.transientObservedNodes = [];\n }\n\n Registration.prototype = {\n enq
ueue: function(record) {\n var records = this.observer.records_;\n var
length = records.length;\n\n // There are cases where we replace the last
record with the new record.\n // For example if the record represents the s
ame mutation we need to use\n // the one with the oldValue. If we get same
record (this can happen as we\n // walk up the tree) we ignore the new reco
rd.\n if (records.length > 0) {\n var lastRecord = records[length -
1];\n var recordToReplaceLast = selectRecord(lastRecord, record);\n
if (recordToReplaceLast) {\n records[length - 1] = recordToReplaceLas
t;\n return;\n }\n } else {\n scheduleCallback(this.
observer);\n }\n\n records[length] = record;\n },\n\n addListene
rs: function() {\n this.addListeners_(this.target);\n },\n\n addListe
ners_: function(node) {\n var options = this.options;\n if (options.at
tributes)\n node.addEventListener('DOMAttrModified', this, true);\n\n
if (options.characterData)\n node.addEventListener('DOMCharacterDataMod
ified', this, true);\n\n if (options.childList)\n node.addEventListe
ner('DOMNodeInserted', this, true);\n\n if (options.childList || options.su
btree)\n node.addEventListener('DOMNodeRemoved', this, true);\n },\n\n
removeListeners: function() {\n this.removeListeners_(this.target);\n
},\n\n removeListeners_: function(node) {\n var options = this.options
;\n if (options.attributes)\n node.removeEventListener('DOMAttrModif
ied', this, true);\n\n if (options.characterData)\n node.removeEvent
Listener('DOMCharacterDataModified', this, true);\n\n if (options.childList
)\n node.removeEventListener('DOMNodeInserted', this, true);\n\n if
(options.childList || options.subtree)\n node.removeEventListener('DOMNod
eRemoved', this, true);\n },\n\n /**\n * Adds a transient observer on
node. The transient observer gets removed\n * next time we deliver the chang
e records.\n * @param {Node} node\n */\n addTransientObserver: functi
on(node) {\n // Don't add transient observers on the target itself. We alre
ady have all\n // the required listeners set up on the target.\n if (n
ode === this.target)\n return;\n\n this.addListeners_(node);\n
this.transientObservedNodes.push(node);\n var registrations = registrations
Table.get(node);\n if (!registrations)\n registrationsTable.set(node
, registrations = []);\n\n // We know that registrations does not contain t
his because we already\n // checked if node === this.target.\n registr
ations.push(this);\n },\n\n removeTransientObservers: function() {\n
var transientObservedNodes = this.transientObservedNodes;\n this.transientO
bservedNodes = [];\n\n transientObservedNodes.forEach(function(node) {\n
// Transient observers are never added to the target.\n this.removeL
isteners_(node);\n\n var registrations = registrationsTable.get(node);\n
for (var i = 0; i < registrations.length; i++) {\n if (registrat
ions[i] === this) {\n registrations.splice(i, 1);\n // Eac
h node can only have one registered observer associated with\n // thi
s observer.\n break;\n }\n }\n }, this);\n },
\n\n handleEvent: function(e) {\n // Stop propagation since we are manag
ing the propagation manually.\n // This means that other mutation events on
the page will not work\n // correctly but that is by design.\n e.stop
ImmediatePropagation();\n\n switch (e.type) {\n case 'DOMAttrModifie
d':\n // http://dom.spec.whatwg.org/#concept-mo-queue-attributes\n\n
var name = e.attrName;\n var namespace = e.relatedNode.namespace
URI;\n var target = e.target;\n\n // 1.\n var record
= new getRecord('attributes', target);\n record.attributeName = name;\n
record.attributeNamespace = namespace;\n\n // 2.\n v
ar oldValue =\n e.attrChange === MutationEvent.ADDITION ? null : e.
prevValue;\n\n forEachAncestorAndObserverEnqueueRecord(target, function
(options) {\n // 3.1, 4.2\n if (!options.attributes)\n
return;\n\n // 3.2, 4.3\n if (options.attributeF
ilter && options.attributeFilter.length &&\n options.attributeFil
ter.indexOf(name) === -1 &&\n options.attributeFilter.indexOf(nam
espace) === -1) {\n return;\n }\n // 3.3, 4.4
\n if (options.attributeOldValue)\n return getRecordWith
OldValue(oldValue);\n\n // 3.4, 4.5\n return record;\n
});\n\n break;\n\n case 'DOMCharacterDataModified':\n
// http://dom.spec.whatwg.org/#concept-mo-queue-characterdata\n va
r target = e.target;\n\n // 1.\n var record = getRecord('chara
cterData', target);\n\n // 2.\n var oldValue = e.prevValue;\n\
n\n forEachAncestorAndObserverEnqueueRecord(target, function(options) {
\n // 3.1, 4.2\n if (!options.characterData)\n
return;\n\n // 3.2, 4.3\n if (options.characterDataOldVa
lue)\n return getRecordWithOldValue(oldValue);\n\n // 3.
3, 4.4\n return record;\n });\n\n break;\n\n
case 'DOMNodeRemoved':\n this.addTransientObserver(e.target);\n
// Fall through.\n case 'DOMNodeInserted':\n // http://dom.sp
ec.whatwg.org/#concept-mo-queue-childlist\n var target = e.relatedNode;
\n var changedNode = e.target;\n var addedNodes, removedNodes;
\n if (e.type === 'DOMNodeInserted') {\n addedNodes = [chang
edNode];\n removedNodes = [];\n } else {\n\n adde
dNodes = [];\n removedNodes = [changedNode];\n }\n
var previousSibling = changedNode.previousSibling;\n var nextSibling =
changedNode.nextSibling;\n\n // 1.\n var record = getRecord('c
hildList', target);\n record.addedNodes = addedNodes;\n record
.removedNodes = removedNodes;\n record.previousSibling = previousSiblin
g;\n record.nextSibling = nextSibling;\n\n forEachAncestorAndO
bserverEnqueueRecord(target, function(options) {\n // 2.1, 3.2\n
if (!options.childList)\n return;\n\n // 2.2, 3.3
\n return record;\n });\n\n }\n\n clearRecords();\
n }\n };\n\n global.JsMutationObserver = JsMutationObserver;\n\n if (!glob
al.MutationObserver)\n global.MutationObserver = JsMutationObserver;\n\n\n})(
this);\n", |
156 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\nwindow.HTMLImports = window.HTMLImports || {flags:{}};", | 154 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\nwindow.HTMLImports = window.HTMLImports || {flags:{}};", |
157 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\n // imports\n var path = scope.pa
th;\n var xhr = scope.xhr;\n var flags = scope.flags;\n\n // TODO(sorvell): t
his loader supports a dynamic list of urls\n // and an oncomplete callback that
is called when the loader is done.\n // The polyfill currently does *not* need
this dynamism or the onComplete\n // concept. Because of this, the loader coul
d be simplified quite a bit.\n var Loader = function(onLoad, onComplete) {\n
this.cache = {};\n this.onload = onLoad;\n this.oncomplete = onComplete;\
n this.inflight = 0;\n this.pending = {};\n };\n\n Loader.prototype = {\
n addNodes: function(nodes) {\n // number of transactions to complete\n
this.inflight += nodes.length;\n // commence transactions\n for (
var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++) {\n this.require(
n);\n }\n // anything to do?\n this.checkDone();\n },\n add
Node: function(node) {\n // number of transactions to complete\n this.
inflight++;\n // commence transactions\n this.require(node);\n //
anything to do?\n this.checkDone();\n },\n require: function(elt) {\
n var url = elt.src || elt.href;\n // ensure we have a standard url th
at can be used\n // reliably for deduping.\n // TODO(sjmiles): ad-hoc\
n elt.__nodeUrl = url;\n // deduplication\n if (!this.dedupe(url,
elt)) {\n // fetch this resource\n this.fetch(url, elt);\n }
\n },\n dedupe: function(url, elt) {\n if (this.pending[url]) {\n
// add to list of nodes waiting for inUrl\n this.pending[url].push(el
t);\n // don't need fetch\n return true;\n }\n var resou
rce;\n if (this.cache[url]) {\n this.onload(url, elt, this.cache[url
]);\n // finished this transaction\n this.tail();\n // don'
t need fetch\n return true;\n }\n // first node waiting for inU
rl\n this.pending[url] = [elt];\n // need fetch (not a dupe)\n re
turn false;\n },\n fetch: function(url, elt) {\n flags.load && consol
e.log('fetch', url, elt);\n if (url.match(/^data:/)) {\n // Handle D
ata URI Scheme\n var pieces = url.split(',');\n var header = piece
s[0];\n var body = pieces[1];\n if(header.indexOf(';base64') > -1)
{\n body = atob(body);\n } else {\n body = decodeURICo
mponent(body);\n }\n setTimeout(function() {\n this.rec
eive(url, elt, null, body);\n }.bind(this), 0);\n } else {\n
var receiveXhr = function(err, resource, redirectedUrl) {\n this.receiv
e(url, elt, err, resource, redirectedUrl);\n }.bind(this);\n xhr.l
oad(url, receiveXhr);\n // TODO(sorvell): blocked on)\n // https:/
/code.google.com/p/chromium/issues/detail?id=257221\n // xhr'ing for a do
cument makes scripts in imports runnable; otherwise\n // they are not; ho
wever, it requires that we have doctype=html in\n // the import which is
unacceptable. This is only needed on Chrome\n // to avoid the bug above.\
n /*\n if (isDocumentLink(elt)) {\n xhr.loadDocument(url,
receiveXhr);\n } else {\n xhr.load(url, receiveXhr);\n }
\n */\n }\n },\n receive: function(url, elt, err, resource, re
directedUrl) {\n this.cache[url] = resource;\n var $p = this.pending[u
rl];\n if ( redirectedUrl && redirectedUrl !== url ) {\n this.cache[
redirectedUrl] = resource;\n $p = $p.concat(this.pending[redirectedUrl]);
\n }\n for (var i=0, l=$p.length, p; (i<l) && (p=$p[i]); i++) {\n
//if (!err) {\n // If url was redirected, use the redirected locatio
n so paths are\n // calculated relative to that.\n this.onload
(redirectedUrl || url, p, resource);\n //}\n this.tail();\n }
\n this.pending[url] = null;\n if ( redirectedUrl && redirectedUrl !==
url ) {\n this.pending[redirectedUrl] = null;\n }\n },\n tail
: function() {\n --this.inflight;\n this.checkDone();\n },\n che
ckDone: function() {\n if (!this.inflight) {\n this.oncomplete();\n
}\n }\n };\n\n xhr = xhr || {\n async: true,\n ok: function(requ
est) {\n return (request.status >= 200 && request.status < 300)\n
|| (request.status === 304)\n || (request.status === 0);\n },\n l
oad: function(url, next, nextContext) {\n var request = new XMLHttpRequest(
);\n if (scope.flags.debug || scope.flags.bust) {\n url += '?' + Mat
h.random();\n }\n request.open('GET', url, xhr.async);\n request.
addEventListener('readystatechange', function(e) {\n if (request.readySta
te === 4) {\n // Servers redirecting an import can add a Location heade
r to help us\n // polyfill correctly.\n var locationHeader = r
equest.getResponseHeader(\"Location\");\n var redirectedUrl = null;\n
if (locationHeader) {\n var redirectedUrl = (locationHeader.s
ubstr( 0, 1 ) === \"/\")\n ? location.origin + locationHeader // L
ocation is a relative path\n : redirectedUrl; //
Full path\n }\n next.call(nextContext, !xhr.ok(request) && re
quest,\n request.response || request.responseText, redirectedUrl);\
n }\n });\n request.send();\n return request;\n },\n
loadDocument: function(url, next, nextContext) {\n this.load(url, next, ne
xtContext).responseType = 'document';\n }\n };\n\n // exports\n scope.xhr
= xhr;\n scope.Loader = Loader;\n\n})(window.HTMLImports);\n", | 155 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\n // imports\n var path = scope.pa
th;\n var xhr = scope.xhr;\n var flags = scope.flags;\n\n // TODO(sorvell): t
his loader supports a dynamic list of urls\n // and an oncomplete callback that
is called when the loader is done.\n // The polyfill currently does *not* need
this dynamism or the onComplete\n // concept. Because of this, the loader coul
d be simplified quite a bit.\n var Loader = function(onLoad, onComplete) {\n
this.cache = {};\n this.onload = onLoad;\n this.oncomplete = onComplete;\
n this.inflight = 0;\n this.pending = {};\n };\n\n Loader.prototype = {\
n addNodes: function(nodes) {\n // number of transactions to complete\n
this.inflight += nodes.length;\n // commence transactions\n for (
var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++) {\n this.require(
n);\n }\n // anything to do?\n this.checkDone();\n },\n add
Node: function(node) {\n // number of transactions to complete\n this.
inflight++;\n // commence transactions\n this.require(node);\n //
anything to do?\n this.checkDone();\n },\n require: function(elt) {\
n var url = elt.src || elt.href;\n // ensure we have a standard url th
at can be used\n // reliably for deduping.\n // TODO(sjmiles): ad-hoc\
n elt.__nodeUrl = url;\n // deduplication\n if (!this.dedupe(url,
elt)) {\n // fetch this resource\n this.fetch(url, elt);\n }
\n },\n dedupe: function(url, elt) {\n if (this.pending[url]) {\n
// add to list of nodes waiting for inUrl\n this.pending[url].push(el
t);\n // don't need fetch\n return true;\n }\n var resou
rce;\n if (this.cache[url]) {\n this.onload(url, elt, this.cache[url
]);\n // finished this transaction\n this.tail();\n // don'
t need fetch\n return true;\n }\n // first node waiting for inU
rl\n this.pending[url] = [elt];\n // need fetch (not a dupe)\n re
turn false;\n },\n fetch: function(url, elt) {\n flags.load && consol
e.log('fetch', url, elt);\n if (url.match(/^data:/)) {\n // Handle D
ata URI Scheme\n var pieces = url.split(',');\n var header = piece
s[0];\n var body = pieces[1];\n if(header.indexOf(';base64') > -1)
{\n body = atob(body);\n } else {\n body = decodeURICo
mponent(body);\n }\n setTimeout(function() {\n this.rec
eive(url, elt, null, body);\n }.bind(this), 0);\n } else {\n
var receiveXhr = function(err, resource, redirectedUrl) {\n this.receiv
e(url, elt, err, resource, redirectedUrl);\n }.bind(this);\n xhr.l
oad(url, receiveXhr);\n // TODO(sorvell): blocked on)\n // https:/
/code.google.com/p/chromium/issues/detail?id=257221\n // xhr'ing for a do
cument makes scripts in imports runnable; otherwise\n // they are not; ho
wever, it requires that we have doctype=html in\n // the import which is
unacceptable. This is only needed on Chrome\n // to avoid the bug above.\
n /*\n if (isDocumentLink(elt)) {\n xhr.loadDocument(url,
receiveXhr);\n } else {\n xhr.load(url, receiveXhr);\n }
\n */\n }\n },\n receive: function(url, elt, err, resource, re
directedUrl) {\n this.cache[url] = resource;\n var $p = this.pending[u
rl];\n if ( redirectedUrl && redirectedUrl !== url ) {\n this.cache[
redirectedUrl] = resource;\n $p = $p.concat(this.pending[redirectedUrl]);
\n }\n for (var i=0, l=$p.length, p; (i<l) && (p=$p[i]); i++) {\n
//if (!err) {\n // If url was redirected, use the redirected locatio
n so paths are\n // calculated relative to that.\n this.onload
(redirectedUrl || url, p, resource);\n //}\n this.tail();\n }
\n this.pending[url] = null;\n if ( redirectedUrl && redirectedUrl !==
url ) {\n this.pending[redirectedUrl] = null;\n }\n },\n tail
: function() {\n --this.inflight;\n this.checkDone();\n },\n che
ckDone: function() {\n if (!this.inflight) {\n this.oncomplete();\n
}\n }\n };\n\n xhr = xhr || {\n async: true,\n ok: function(requ
est) {\n return (request.status >= 200 && request.status < 300)\n
|| (request.status === 304)\n || (request.status === 0);\n },\n l
oad: function(url, next, nextContext) {\n var request = new XMLHttpRequest(
);\n if (scope.flags.debug || scope.flags.bust) {\n url += '?' + Mat
h.random();\n }\n request.open('GET', url, xhr.async);\n request.
addEventListener('readystatechange', function(e) {\n if (request.readySta
te === 4) {\n // Servers redirecting an import can add a Location heade
r to help us\n // polyfill correctly.\n var locationHeader = r
equest.getResponseHeader(\"Location\");\n var redirectedUrl = null;\n
if (locationHeader) {\n var redirectedUrl = (locationHeader.s
ubstr( 0, 1 ) === \"/\")\n ? location.origin + locationHeader // L
ocation is a relative path\n : redirectedUrl; //
Full path\n }\n next.call(nextContext, !xhr.ok(request) && re
quest,\n request.response || request.responseText, redirectedUrl);\
n }\n });\n request.send();\n return request;\n },\n
loadDocument: function(url, next, nextContext) {\n this.load(url, next, ne
xtContext).responseType = 'document';\n }\n };\n\n // exports\n scope.xhr
= xhr;\n scope.Loader = Loader;\n\n})(window.HTMLImports);\n", |
158 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\nvar IMPORT_LINK_TYPE = 'import';\nv
ar flags = scope.flags;\nvar isIe = /Trident/.test(navigator.userAgent);\n// TOD
O(sorvell): SD polyfill intrusion\nvar mainDoc = window.ShadowDOMPolyfill ? \n
window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// importParser
\n// highlander object to manage parsing of imports\n// parses import related el
ements\n// and ensures proper parse order\n// parse order is enforced by crawlin
g the tree and monitoring which elements\n// have been parsed; async parsing is
also supported.\n\n// highlander object for parsing a document tree\nvar importP
arser = {\n // parse selectors for main document elements\n documentSelectors:
'link[rel=' + IMPORT_LINK_TYPE + ']',\n // parse selectors for import document
elements\n importsSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']',\n
'link[rel=stylesheet]',\n 'style',\n 'script:not([type])',\n 'script[t
ype=\"text/javascript\"]'\n ].join(','),\n map: {\n link: 'parseLink',\n
script: 'parseScript',\n style: 'parseStyle'\n },\n // try to parse the ne
xt import in the tree\n parseNext: function() {\n var next = this.nextToPars
e();\n if (next) {\n this.parse(next);\n }\n },\n parse: function(e
lt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log('[%s] is
already parsed', elt.localName);\n return;\n }\n var fn = this[this.m
ap[elt.localName]];\n if (fn) {\n this.markParsing(elt);\n fn.call(
this, elt);\n }\n },\n // only 1 element may be parsed at a time; parsing i
s async so each\n // parsing implementation must inform the system that parsing
is complete\n // via markParsingComplete.\n // To prompt the system to parse
the next element, parseNext should then be\n // called.\n // Note, parseNext u
sed to be included at the end of markParsingComplete, but\n // we must not do t
his so that, for example, we can (1) mark parsing complete \n // then (2) fire
an import load event, and then (3) parse the next resource.\n markParsing: func
tion(elt) {\n flags.parse && console.log('parsing', elt);\n this.parsingEl
ement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__importPars
ed = true;\n if (elt.__importElement) {\n elt.__importElement.__importPa
rsed = true;\n }\n this.parsingElement = null;\n flags.parse && console
.log('completed', elt);\n },\n invalidateParse: function(doc) {\n if (doc &
& doc.__importLink) {\n doc.__importParsed = doc.__importLink.__importParse
d = false;\n this.parseSoon();\n }\n },\n parseSoon: function() {\n
if (this._parseSoon) {\n cancelAnimationFrame(this._parseDelay);\n }\n
var parser = this;\n this._parseSoon = requestAnimationFrame(function() {\
n parser.parseNext();\n });\n },\n parseImport: function(elt) {\n /
/ TODO(sorvell): consider if there's a better way to do this;\n // expose an
imports parsing hook; this is needed, for example, by the\n // CustomElements
polyfill.\n if (HTMLImports.__importsParsingHook) {\n HTMLImports.__imp
ortsParsingHook(elt);\n }\n elt.import.__importParsed = true;\n this.ma
rkParsingComplete(elt);\n // fire load event\n if (elt.__resource) {\n
elt.dispatchEvent(new CustomEvent('load', {bubbles: false})); \n } else
{\n elt.dispatchEvent(new CustomEvent('error', {bubbles: false}));\n }\n
// TODO(sorvell): workaround for Safari addEventListener not working\n //
for elements not in the main document.\n if (elt.__pending) {\n var fn;
\n while (elt.__pending.length) {\n fn = elt.__pending.shift();\n
if (fn) {\n fn({target: elt});\n }\n }\n }\n thi
s.parseNext();\n },\n parseLink: function(linkElt) {\n if (nodeIsImport(lin
kElt)) {\n this.parseImport(linkElt);\n } else {\n // make href abs
olute\n linkElt.href = linkElt.href;\n this.parseGeneric(linkElt);\n
}\n },\n parseStyle: function(elt) {\n // TODO(sorvell): style element lo
ad event can just not fire so clone styles\n var src = elt;\n elt = cloneS
tyle(elt);\n elt.__importElement = src;\n this.parseGeneric(elt);\n },\n
parseGeneric: function(elt) {\n this.trackElement(elt);\n document.head.a
ppendChild(elt);\n },\n // tracks when a loadable element has loaded\n trackE
lement: function(elt, callback) {\n var self = this;\n var done = function
(e) {\n if (callback) {\n callback(e);\n }\n self.markPars
ingComplete(elt);\n self.parseNext();\n };\n elt.addEventListener('lo
ad', done);\n elt.addEventListener('error', done);\n\n // NOTE: IE does no
t fire \"load\" event for styles that have already loaded\n // This is in vio
lation of the spec, so we try our hardest to work around it\n if (isIe && elt
.localName === 'style') {\n var fakeLoad = false;\n // If there's not
@import in the textContent, assume it has loaded\n if (elt.textContent.inde
xOf('@import') == -1) {\n fakeLoad = true;\n // if we have a sheet,
we have been parsed\n } else if (elt.sheet) {\n fakeLoad = true;\n
var csr = elt.sheet.cssRules;\n var len = csr ? csr.length : 0;\n
// search the rules for @import's\n for (var i = 0, r; (i < len) &&
(r = csr[i]); i++) {\n if (r.type === CSSRule.IMPORT_RULE) {\n
// if every @import has resolved, fake the load\n fakeLoad = fake
Load && Boolean(r.styleSheet);\n }\n }\n }\n // dispat
ch a fake load event and continue parsing\n if (fakeLoad) {\n elt.di
spatchEvent(new CustomEvent('load', {bubbles: false}));\n }\n }\n },\n
// NOTE: execute scripts by injecting them and watching for the load/error\n /
/ event. Inline scripts are handled via dataURL's because browsers tend to\n //
provide correct parsing errors in this case. If this has any compatibility\n /
/ issues, we can switch to injecting the inline script with textContent.\n // S
cripts with dataURL's do not appear to generate load events and therefore\n //
we assume they execute synchronously.\n parseScript: function(scriptElt) {\n
var script = document.createElement('script');\n script.__importElement = sc
riptElt;\n script.src = scriptElt.src ? scriptElt.src : \n generateScr
iptDataUrl(scriptElt);\n scope.currentScript = scriptElt;\n this.trackElem
ent(script, function(e) {\n script.parentNode.removeChild(script);\n s
cope.currentScript = null; \n });\n document.head.appendChild(script);\n
},\n // determine the next element in the tree which should be parsed\n nextT
oParse: function() {\n return !this.parsingElement && this.nextToParseInDoc(m
ainDoc);\n },\n nextToParseInDoc: function(doc, link) {\n var nodes = doc.q
uerySelectorAll(this.parseSelectorsForNode(doc));\n for (var i=0, l=nodes.len
gth, p=0, n; (i<l) && (n=nodes[i]); i++) {\n if (!this.isParsed(n)) {\n
if (this.hasResource(n)) {\n return nodeIsImport(n) ? this.nextToPa
rseInDoc(n.import, n) : n;\n } else {\n return;\n }\n
}\n }\n // all nodes have been parsed, ready to parse import, if any\n
return link;\n },\n // return the set of parse selectors relevant for this n
ode.\n parseSelectorsForNode: function(node) {\n var doc = node.ownerDocumen
t || node;\n return doc === mainDoc ? this.documentSelectors : this.importsSe
lectors;\n },\n isParsed: function(node) {\n return node.__importParsed;\n
},\n hasResource: function(node) {\n if (nodeIsImport(node) && !node.import
) {\n return false;\n }\n return true;\n }\n};\n\nfunction nodeIsImp
ort(elt) {\n return (elt.localName === 'link') && (elt.rel === IMPORT_LINK_TYPE
);\n}\n\nfunction generateScriptDataUrl(script) {\n var scriptContent = generat
eScriptContent(script);\n var b64 = 'data:text/javascript';\n // base64 may be
smaller, but does not handle unicode characters\n // attempt base64 first, fal
l back to escaped text\n try {\n b64 += (';base64,' + btoa(scriptContent));\
n } catch(e) {\n b64 += (';charset=utf-8,' + encodeURIComponent(scriptConten
t));\n }\n return b64;\n}\n\nfunction generateScriptContent(script) {\n retur
n script.textContent + generateSourceMapHint(script);\n}\n\n// calculate source
map hint\nfunction generateSourceMapHint(script) {\n var moniker = script.__nod
eUrl;\n if (!moniker) {\n moniker = script.ownerDocument.baseURI;\n // th
ere could be more than one script this url\n var tag = '[' + Math.floor((Math
.random()+1)*1000) + ']';\n // TODO(sjmiles): Polymer hack, should be pluggab
le if we need to allow \n // this sort of thing\n var matches = script.tex
tContent.match(/Polymer\\(['\"]([^'\"]*)/);\n tag = matches && matches[1] ||
tag;\n // tag the moniker\n moniker += '/' + tag + '.js';\n }\n return '
\\n//# sourceURL=' + moniker + '\\n';\n}\n\n// style/stylesheet handling\n\n// c
lone style with proper path resolution for main document\n// NOTE: styles are th
e only elements that require direct path fixup.\nfunction cloneStyle(style) {\n
var clone = style.ownerDocument.createElement('style');\n clone.textContent =
style.textContent;\n path.resolveUrlsInStyle(clone);\n return clone;\n}\n\n//
path fixup: style elements in imports must be made relative to the main \n// doc
ument. We fixup url's in url() and @import.\nvar CSS_URL_REGEXP = /(url\\()([^)]
*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n\nv
ar path = {\n resolveUrlsInStyle: function(style) {\n var doc = style.ownerD
ocument;\n var resolver = doc.createElement('a');\n style.textContent = th
is.resolveUrlsInCssText(style.textContent, resolver);\n return style; \n },
\n resolveUrlsInCssText: function(cssText, urlObj) {\n var r = this.replaceU
rls(cssText, urlObj, CSS_URL_REGEXP);\n r = this.replaceUrls(r, urlObj, CSS_I
MPORT_REGEXP);\n return r;\n },\n replaceUrls: function(text, urlObj, regex
p) {\n return text.replace(regexp, function(m, pre, url, post) {\n var u
rlPath = url.replace(/[\"']/g, '');\n urlObj.href = urlPath;\n urlPath
= urlObj.href;\n return pre + '\\'' + urlPath + '\\'' + post;\n });
\n }\n}\n\n// exports\nscope.parser = importParser;\nscope.path = path;\nscope.
isIE = isIe;\n\n})(HTMLImports);\n", | 156 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\nvar IMPORT_LINK_TYPE = 'import';\nv
ar flags = scope.flags;\nvar isIe = /Trident/.test(navigator.userAgent);\n// TOD
O(sorvell): SD polyfill intrusion\nvar mainDoc = window.ShadowDOMPolyfill ? \n
window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// importParser
\n// highlander object to manage parsing of imports\n// parses import related el
ements\n// and ensures proper parse order\n// parse order is enforced by crawlin
g the tree and monitoring which elements\n// have been parsed; async parsing is
also supported.\n\n// highlander object for parsing a document tree\nvar importP
arser = {\n // parse selectors for main document elements\n documentSelectors:
'link[rel=' + IMPORT_LINK_TYPE + ']',\n // parse selectors for import document
elements\n importsSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']',\n
'link[rel=stylesheet]',\n 'style',\n 'script:not([type])',\n 'script[t
ype=\"text/javascript\"]'\n ].join(','),\n map: {\n link: 'parseLink',\n
script: 'parseScript',\n style: 'parseStyle'\n },\n // try to parse the ne
xt import in the tree\n parseNext: function() {\n var next = this.nextToPars
e();\n if (next) {\n this.parse(next);\n }\n },\n parse: function(e
lt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log('[%s] is
already parsed', elt.localName);\n return;\n }\n var fn = this[this.m
ap[elt.localName]];\n if (fn) {\n this.markParsing(elt);\n fn.call(
this, elt);\n }\n },\n // only 1 element may be parsed at a time; parsing i
s async so each\n // parsing implementation must inform the system that parsing
is complete\n // via markParsingComplete.\n // To prompt the system to parse
the next element, parseNext should then be\n // called.\n // Note, parseNext u
sed to be included at the end of markParsingComplete, but\n // we must not do t
his so that, for example, we can (1) mark parsing complete \n // then (2) fire
an import load event, and then (3) parse the next resource.\n markParsing: func
tion(elt) {\n flags.parse && console.log('parsing', elt);\n this.parsingEl
ement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__importPars
ed = true;\n if (elt.__importElement) {\n elt.__importElement.__importPa
rsed = true;\n }\n this.parsingElement = null;\n flags.parse && console
.log('completed', elt);\n },\n invalidateParse: function(doc) {\n if (doc &
& doc.__importLink) {\n doc.__importParsed = doc.__importLink.__importParse
d = false;\n this.parseSoon();\n }\n },\n parseSoon: function() {\n
if (this._parseSoon) {\n cancelAnimationFrame(this._parseDelay);\n }\n
var parser = this;\n this._parseSoon = requestAnimationFrame(function() {\
n parser.parseNext();\n });\n },\n parseImport: function(elt) {\n /
/ TODO(sorvell): consider if there's a better way to do this;\n // expose an
imports parsing hook; this is needed, for example, by the\n // CustomElements
polyfill.\n if (HTMLImports.__importsParsingHook) {\n HTMLImports.__imp
ortsParsingHook(elt);\n }\n elt.import.__importParsed = true;\n this.ma
rkParsingComplete(elt);\n // fire load event\n if (elt.__resource) {\n
elt.dispatchEvent(new CustomEvent('load', {bubbles: false})); \n } else
{\n elt.dispatchEvent(new CustomEvent('error', {bubbles: false}));\n }\n
// TODO(sorvell): workaround for Safari addEventListener not working\n //
for elements not in the main document.\n if (elt.__pending) {\n var fn;
\n while (elt.__pending.length) {\n fn = elt.__pending.shift();\n
if (fn) {\n fn({target: elt});\n }\n }\n }\n thi
s.parseNext();\n },\n parseLink: function(linkElt) {\n if (nodeIsImport(lin
kElt)) {\n this.parseImport(linkElt);\n } else {\n // make href abs
olute\n linkElt.href = linkElt.href;\n this.parseGeneric(linkElt);\n
}\n },\n parseStyle: function(elt) {\n // TODO(sorvell): style element lo
ad event can just not fire so clone styles\n var src = elt;\n elt = cloneS
tyle(elt);\n elt.__importElement = src;\n this.parseGeneric(elt);\n },\n
parseGeneric: function(elt) {\n this.trackElement(elt);\n this.addElement
ToDocument(elt);\n },\n rootImportForElement: function(elt) {\n var n = elt
;\n while (n.ownerDocument.__importLink) {\n n = n.ownerDocument.__impor
tLink;\n }\n return n;\n },\n addElementToDocument: function(elt) {\n
var port = this.rootImportForElement(elt.__importElement || elt);\n var l =
port.__insertedElements = port.__insertedElements || 0;\n var refNode = port.
nextElementSibling;\n for (var i=0; i < l; i++) {\n refNode = refNode &&
refNode.nextElementSibling;\n }\n port.parentNode.insertBefore(elt, refNo
de);\n },\n // tracks when a loadable element has loaded\n trackElement: func
tion(elt, callback) {\n var self = this;\n var done = function(e) {\n
if (callback) {\n callback(e);\n }\n self.markParsingComplete(
elt);\n self.parseNext();\n };\n elt.addEventListener('load', done);\
n elt.addEventListener('error', done);\n\n // NOTE: IE does not fire \"loa
d\" event for styles that have already loaded\n // This is in violation of th
e spec, so we try our hardest to work around it\n if (isIe && elt.localName =
== 'style') {\n var fakeLoad = false;\n // If there's not @import in t
he textContent, assume it has loaded\n if (elt.textContent.indexOf('@import
') == -1) {\n fakeLoad = true;\n // if we have a sheet, we have been
parsed\n } else if (elt.sheet) {\n fakeLoad = true;\n var cs
r = elt.sheet.cssRules;\n var len = csr ? csr.length : 0;\n // sea
rch the rules for @import's\n for (var i = 0, r; (i < len) && (r = csr[i]
); i++) {\n if (r.type === CSSRule.IMPORT_RULE) {\n // if ev
ery @import has resolved, fake the load\n fakeLoad = fakeLoad && Bool
ean(r.styleSheet);\n }\n }\n }\n // dispatch a fake lo
ad event and continue parsing\n if (fakeLoad) {\n elt.dispatchEvent(
new CustomEvent('load', {bubbles: false}));\n }\n }\n },\n // NOTE: ex
ecute scripts by injecting them and watching for the load/error\n // event. Inl
ine scripts are handled via dataURL's because browsers tend to\n // provide cor
rect parsing errors in this case. If this has any compatibility\n // issues, we
can switch to injecting the inline script with textContent.\n // Scripts with
dataURL's do not appear to generate load events and therefore\n // we assume th
ey execute synchronously.\n parseScript: function(scriptElt) {\n var script
= document.createElement('script');\n script.__importElement = scriptElt;\n
script.src = scriptElt.src ? scriptElt.src : \n generateScriptDataUrl(s
criptElt);\n scope.currentScript = scriptElt;\n this.trackElement(script,
function(e) {\n script.parentNode.removeChild(script);\n scope.current
Script = null; \n });\n this.addElementToDocument(script);\n },\n // de
termine the next element in the tree which should be parsed\n nextToParse: func
tion() {\n return !this.parsingElement && this.nextToParseInDoc(mainDoc);\n
},\n nextToParseInDoc: function(doc, link) {\n var nodes = doc.querySelector
All(this.parseSelectorsForNode(doc));\n for (var i=0, l=nodes.length, p=0, n;
(i<l) && (n=nodes[i]); i++) {\n if (!this.isParsed(n)) {\n if (this
.hasResource(n)) {\n return nodeIsImport(n) ? this.nextToParseInDoc(n.i
mport, n) : n;\n } else {\n return;\n }\n }\n }\n
// all nodes have been parsed, ready to parse import, if any\n return lin
k;\n },\n // return the set of parse selectors relevant for this node.\n pars
eSelectorsForNode: function(node) {\n var doc = node.ownerDocument || node;\n
return doc === mainDoc ? this.documentSelectors : this.importsSelectors;\n
},\n isParsed: function(node) {\n return node.__importParsed;\n },\n hasRe
source: function(node) {\n if (nodeIsImport(node) && !node.import) {\n r
eturn false;\n }\n return true;\n }\n};\n\nfunction nodeIsImport(elt) {\n
return (elt.localName === 'link') && (elt.rel === IMPORT_LINK_TYPE);\n}\n\nfun
ction generateScriptDataUrl(script) {\n var scriptContent = generateScriptConte
nt(script);\n var b64 = 'data:text/javascript';\n // base64 may be smaller, bu
t does not handle unicode characters\n // attempt base64 first, fall back to es
caped text\n try {\n b64 += (';base64,' + btoa(scriptContent));\n } catch(e
) {\n b64 += (';charset=utf-8,' + encodeURIComponent(scriptContent));\n }\n
return b64;\n}\n\nfunction generateScriptContent(script) {\n return script.tex
tContent + generateSourceMapHint(script);\n}\n\n// calculate source map hint\nfu
nction generateSourceMapHint(script) {\n var moniker = script.__nodeUrl;\n if
(!moniker) {\n moniker = script.ownerDocument.baseURI;\n // there could be
more than one script this url\n var tag = '[' + Math.floor((Math.random()+1)
*1000) + ']';\n // TODO(sjmiles): Polymer hack, should be pluggable if we nee
d to allow \n // this sort of thing\n var matches = script.textContent.mat
ch(/Polymer\\(['\"]([^'\"]*)/);\n tag = matches && matches[1] || tag;\n //
tag the moniker\n moniker += '/' + tag + '.js';\n }\n return '\\n//# sourc
eURL=' + moniker + '\\n';\n}\n\n// style/stylesheet handling\n\n// clone style w
ith proper path resolution for main document\n// NOTE: styles are the only eleme
nts that require direct path fixup.\nfunction cloneStyle(style) {\n var clone =
style.ownerDocument.createElement('style');\n clone.textContent = style.textCo
ntent;\n path.resolveUrlsInStyle(clone);\n return clone;\n}\n\n// path fixup:
style elements in imports must be made relative to the main \n// document. We fi
xup url's in url() and @import.\nvar CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n
var CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n\nvar path = {\
n resolveUrlsInStyle: function(style) {\n var doc = style.ownerDocument;\n
var resolver = doc.createElement('a');\n style.textContent = this.resolveUr
lsInCssText(style.textContent, resolver);\n return style; \n },\n resolveU
rlsInCssText: function(cssText, urlObj) {\n var r = this.replaceUrls(cssText,
urlObj, CSS_URL_REGEXP);\n r = this.replaceUrls(r, urlObj, CSS_IMPORT_REGEXP
);\n return r;\n },\n replaceUrls: function(text, urlObj, regexp) {\n re
turn text.replace(regexp, function(m, pre, url, post) {\n var urlPath = url
.replace(/[\"']/g, '');\n urlObj.href = urlPath;\n urlPath = urlObj.hr
ef;\n return pre + '\\'' + urlPath + '\\'' + post;\n }); \n }\n}\n\n
// exports\nscope.parser = importParser;\nscope.path = path;\nscope.isIE = isIe;
\n\n})(HTMLImports);\n", |
159 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\nvar hasNative = ('import' in docume
nt.createElement('link'));\nvar useNative = hasNative;\nvar flags = scope.flags;
\nvar IMPORT_LINK_TYPE = 'import';\n\n// TODO(sorvell): SD polyfill intrusion\nv
ar mainDoc = window.ShadowDOMPolyfill ? \n ShadowDOMPolyfill.wrapIfNeeded(doc
ument) : document;\n\nif (!useNative) {\n\n // imports\n var xhr = scope.xhr;\
n var Loader = scope.Loader;\n var parser = scope.parser;\n\n // importer\n
// highlander object to manage loading of imports\n\n // for any document, impo
rter:\n // - loads any linked import documents (with deduping)\n\n var importe
r = {\n documents: {},\n // nodes to load in the mian document\n docume
ntPreloadSelectors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // nodes to load
in imports\n importsPreloadSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE
+ ']'\n ].join(','),\n loadNode: function(node) {\n importLoader.add
Node(node);\n },\n // load all loadable elements within the parent element
\n loadSubtree: function(parent) {\n var nodes = this.marshalNodes(paren
t);\n // add these nodes to loader's queue\n importLoader.addNodes(nod
es);\n },\n marshalNodes: function(parent) {\n // all preloadable nod
es in inDocument\n return parent.querySelectorAll(this.loadSelectorsForNode
(parent));\n },\n // find the proper set of load selectors for a given nod
e\n loadSelectorsForNode: function(node) {\n var doc = node.ownerDocumen
t || node;\n return doc === mainDoc ? this.documentPreloadSelectors :\n
this.importsPreloadSelectors;\n },\n loaded: function(url, elt, reso
urce) {\n flags.load && console.log('loaded', url, elt);\n // store ge
neric resource\n // TODO(sorvell): fails for nodes inside <template>.conten
t\n // see https://code.google.com/p/chromium/issues/detail?id=249381.\n
elt.__resource = resource;\n if (isDocumentLink(elt)) {\n var doc
= this.documents[url];\n // if we've never seen a document at this url\n
if (!doc) {\n // generate an HTMLDocument from data\n
doc = makeDocument(resource, url);\n doc.__importLink = elt;\n
// TODO(sorvell): we cannot use MO to detect parsed nodes because\n //
SD polyfill does not report these as mutations.\n this.bootDocument(do
c);\n // cache document\n this.documents[url] = doc;\n
}\n // don't store import record until we're actually loaded\n //
store document resource\n elt.import = doc;\n }\n parser.parseN
ext();\n },\n bootDocument: function(doc) {\n this.loadSubtree(doc);\
n this.observe(doc);\n parser.parseNext();\n },\n loadedAll: fun
ction() {\n parser.parseNext();\n }\n };\n\n // loader singleton\n va
r importLoader = new Loader(importer.loaded.bind(importer), \n importer.loa
dedAll.bind(importer));\n\n function isDocumentLink(elt) {\n return isLinkRe
l(elt, IMPORT_LINK_TYPE);\n }\n\n function isLinkRel(elt, rel) {\n return e
lt.localName === 'link' && elt.getAttribute('rel') === rel;\n }\n\n function i
sScript(elt) {\n return elt.localName === 'script';\n }\n\n function makeDo
cument(resource, url) {\n // create a new HTML document\n var doc = resour
ce;\n if (!(doc instanceof Document)) {\n doc = document.implementation.
createHTMLDocument(IMPORT_LINK_TYPE);\n }\n // cache the new document's so
urce url\n doc._URL = url;\n // establish a relative path via <base>\n
var base = doc.createElement('base');\n base.setAttribute('href', url);\n
// add baseURI support to browsers (IE) that lack it.\n if (!doc.baseURI) {\n
doc.baseURI = url;\n }\n // ensure UTF-8 charset\n var meta = doc
.createElement('meta');\n meta.setAttribute('charset', 'utf-8');\n\n doc.h
ead.appendChild(meta);\n doc.head.appendChild(base);\n // install HTML las
t as it may trigger CustomElement upgrades\n // TODO(sjmiles): problem wrt to
template boostrapping below,\n // template bootstrapping must (?) come befor
e element upgrade\n // but we cannot bootstrap templates until they are in a
document\n // which is too late\n if (!(resource instanceof Document)) {\n
// install html\n doc.body.innerHTML = resource;\n }\n // TODO(
sorvell): ideally this code is not aware of Template polyfill,\n // but for n
ow the polyfill needs help to bootstrap these templates\n if (window.HTMLTemp
lateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.boots
trap(doc);\n }\n return doc;\n }\n} else {\n // do nothing if using nati
ve imports\n var importer = {};\n}\n\n// NOTE: We cannot polyfill document.curr
entScript because it's not possible\n// both to override and maintain the abilit
y to capture the native value;\n// therefore we choose to expose _currentScript
both when native imports\n// and the polyfill are in use.\nvar currentScriptDesc
riptor = {\n get: function() {\n return HTMLImports.currentScript || documen
t.currentScript;\n },\n configurable: true\n};\n\nObject.defineProperty(docume
nt, '_currentScript', currentScriptDescriptor);\nObject.defineProperty(mainDoc,
'_currentScript', currentScriptDescriptor);\n\n// Polyfill document.baseURI for
browsers without it.\nif (!document.baseURI) {\n var baseURIDescriptor = {\n
get: function() {\n return window.location.href;\n },\n configurable
: true\n };\n\n Object.defineProperty(document, 'baseURI', baseURIDescriptor);
\n Object.defineProperty(mainDoc, 'baseURI', baseURIDescriptor);\n}\n\n// call
a callback when all HTMLImports in the document at call (or at least\n// docume
nt ready) time have loaded.\n// 1. ensure the document is in a ready state (has
dom), then \n// 2. watch for loading of imports and call callback when done\nfun
ction whenImportsReady(callback, doc) {\n doc = doc || mainDoc;\n // if docume
nt is loading, wait and try again\n whenDocumentReady(function() {\n watchIm
portsLoad(callback, doc);\n }, doc);\n}\n\n// call the callback when the docume
nt is in a ready state (has dom)\nvar requiredReadyState = HTMLImports.isIE ? 'c
omplete' : 'interactive';\nvar READY_EVENT = 'readystatechange';\nfunction isDoc
umentReady(doc) {\n return (doc.readyState === 'complete' ||\n doc.readySt
ate === requiredReadyState);\n}\n\n// call <callback> when we ensure the documen
t is in a ready state\nfunction whenDocumentReady(callback, doc) {\n if (!isDoc
umentReady(doc)) {\n var checkReady = function() {\n if (doc.readyState
=== 'complete' || \n doc.readyState === requiredReadyState) {\n
doc.removeEventListener(READY_EVENT, checkReady);\n whenDocumentReady(cal
lback, doc);\n }\n }\n doc.addEventListener(READY_EVENT, checkReady);
\n } else if (callback) {\n callback();\n }\n}\n\n// call <callback> when w
e ensure all imports have loaded\nfunction watchImportsLoad(callback, doc) {\n
var imports = doc.querySelectorAll('link[rel=import]');\n var loaded = 0, l = i
mports.length;\n function checkDone(d) { \n if (loaded == l) {\n callba
ck && callback();\n }\n }\n function loadedImport(e) {\n loaded++;\n
checkDone();\n }\n if (l) {\n for (var i=0, imp; (i<l) && (imp=imports[i]);
i++) {\n if (isImportLoaded(imp)) {\n loadedImport.call(imp);\n
} else {\n imp.addEventListener('load', loadedImport);\n imp.add
EventListener('error', loadedImport);\n }\n }\n } else {\n checkDone
();\n }\n}\n\nfunction isImportLoaded(link) {\n return useNative ? (link.impor
t && (link.import.readyState !== 'loading')) || link.__loaded :\n link.__im
portParsed;\n}\n\n// TODO(sorvell): install a mutation observer to see if HTMLIm
ports have loaded\n// this is a workaround for https://www.w3.org/Bugs/Public/sh
ow_bug.cgi?id=25007\n// and should be removed when this bug is addressed.\nif (u
seNative) {\n new MutationObserver(function(mxns) {\n for (var i=0, l=mxns.l
ength, m; (i < l) && (m=mxns[i]); i++) {\n if (m.addedNodes) {\n han
dleImports(m.addedNodes);\n }\n }\n }).observe(document.head, {childLis
t: true});\n\n function handleImports(nodes) {\n for (var i=0, l=nodes.lengt
h, n; (i<l) && (n=nodes[i]); i++) {\n if (isImport(n)) {\n handleImp
ort(n); \n }\n }\n }\n\n function isImport(element) {\n return ele
ment.localName === 'link' && element.rel === 'import';\n }\n\n function handle
Import(element) {\n var loaded = element.import;\n if (loaded) {\n ma
rkTargetLoaded({target: element});\n } else {\n element.addEventListener
('load', markTargetLoaded);\n element.addEventListener('error', markTargetL
oaded);\n }\n }\n\n function markTargetLoaded(event) {\n event.target.__
loaded = true;\n }\n\n}\n\n// exports\nscope.hasNative = hasNative;\nscope.useN
ative = useNative;\nscope.importer = importer;\nscope.IMPORT_LINK_TYPE = IMPORT_
LINK_TYPE;\nscope.isImportLoaded = isImportLoaded;\nscope.importLoader = importL
oader;\nscope.whenReady = whenImportsReady;\n\n// deprecated\nscope.whenImportsR
eady = whenImportsReady;\n\n})(window.HTMLImports);\n", | 157 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\nvar hasNative = ('import' in docume
nt.createElement('link'));\nvar useNative = hasNative;\nvar flags = scope.flags;
\nvar IMPORT_LINK_TYPE = 'import';\n\n// TODO(sorvell): SD polyfill intrusion\nv
ar mainDoc = window.ShadowDOMPolyfill ? \n ShadowDOMPolyfill.wrapIfNeeded(doc
ument) : document;\n\nif (!useNative) {\n\n // imports\n var xhr = scope.xhr;\
n var Loader = scope.Loader;\n var parser = scope.parser;\n\n // importer\n
// highlander object to manage loading of imports\n\n // for any document, impo
rter:\n // - loads any linked import documents (with deduping)\n\n var importe
r = {\n documents: {},\n // nodes to load in the mian document\n docume
ntPreloadSelectors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // nodes to load
in imports\n importsPreloadSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE
+ ']'\n ].join(','),\n loadNode: function(node) {\n importLoader.add
Node(node);\n },\n // load all loadable elements within the parent element
\n loadSubtree: function(parent) {\n var nodes = this.marshalNodes(paren
t);\n // add these nodes to loader's queue\n importLoader.addNodes(nod
es);\n },\n marshalNodes: function(parent) {\n // all preloadable nod
es in inDocument\n return parent.querySelectorAll(this.loadSelectorsForNode
(parent));\n },\n // find the proper set of load selectors for a given nod
e\n loadSelectorsForNode: function(node) {\n var doc = node.ownerDocumen
t || node;\n return doc === mainDoc ? this.documentPreloadSelectors :\n
this.importsPreloadSelectors;\n },\n loaded: function(url, elt, reso
urce) {\n flags.load && console.log('loaded', url, elt);\n // store ge
neric resource\n // TODO(sorvell): fails for nodes inside <template>.conten
t\n // see https://code.google.com/p/chromium/issues/detail?id=249381.\n
elt.__resource = resource;\n if (isDocumentLink(elt)) {\n var doc
= this.documents[url];\n // if we've never seen a document at this url\n
if (!doc) {\n // generate an HTMLDocument from data\n
doc = makeDocument(resource, url);\n doc.__importLink = elt;\n
// TODO(sorvell): we cannot use MO to detect parsed nodes because\n //
SD polyfill does not report these as mutations.\n this.bootDocument(do
c);\n // cache document\n this.documents[url] = doc;\n
}\n // don't store import record until we're actually loaded\n //
store document resource\n elt.import = doc;\n }\n parser.parseN
ext();\n },\n bootDocument: function(doc) {\n this.loadSubtree(doc);\
n this.observe(doc);\n parser.parseNext();\n },\n loadedAll: fun
ction() {\n parser.parseNext();\n }\n };\n\n // loader singleton\n va
r importLoader = new Loader(importer.loaded.bind(importer), \n importer.loa
dedAll.bind(importer));\n\n function isDocumentLink(elt) {\n return isLinkRe
l(elt, IMPORT_LINK_TYPE);\n }\n\n function isLinkRel(elt, rel) {\n return e
lt.localName === 'link' && elt.getAttribute('rel') === rel;\n }\n\n function i
sScript(elt) {\n return elt.localName === 'script';\n }\n\n function makeDo
cument(resource, url) {\n // create a new HTML document\n var doc = resour
ce;\n if (!(doc instanceof Document)) {\n doc = document.implementation.
createHTMLDocument(IMPORT_LINK_TYPE);\n }\n // cache the new document's so
urce url\n doc._URL = url;\n // establish a relative path via <base>\n
var base = doc.createElement('base');\n base.setAttribute('href', url);\n
// add baseURI support to browsers (IE) that lack it.\n if (!doc.baseURI) {\n
doc.baseURI = url;\n }\n // ensure UTF-8 charset\n var meta = doc
.createElement('meta');\n meta.setAttribute('charset', 'utf-8');\n\n doc.h
ead.appendChild(meta);\n doc.head.appendChild(base);\n // install HTML las
t as it may trigger CustomElement upgrades\n // TODO(sjmiles): problem wrt to
template boostrapping below,\n // template bootstrapping must (?) come befor
e element upgrade\n // but we cannot bootstrap templates until they are in a
document\n // which is too late\n if (!(resource instanceof Document)) {\n
// install html\n doc.body.innerHTML = resource;\n }\n // TODO(
sorvell): ideally this code is not aware of Template polyfill,\n // but for n
ow the polyfill needs help to bootstrap these templates\n if (window.HTMLTemp
lateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.boots
trap(doc);\n }\n return doc;\n }\n} else {\n // do nothing if using nati
ve imports\n var importer = {};\n}\n\n// NOTE: We cannot polyfill document.curr
entScript because it's not possible\n// both to override and maintain the abilit
y to capture the native value;\n// therefore we choose to expose _currentScript
both when native imports\n// and the polyfill are in use.\nvar currentScriptDesc
riptor = {\n get: function() {\n return HTMLImports.currentScript || documen
t.currentScript;\n },\n configurable: true\n};\n\nObject.defineProperty(docume
nt, '_currentScript', currentScriptDescriptor);\nObject.defineProperty(mainDoc,
'_currentScript', currentScriptDescriptor);\n\n// Polyfill document.baseURI for
browsers without it.\nif (!document.baseURI) {\n var baseURIDescriptor = {\n
get: function() {\n return window.location.href;\n },\n configurable
: true\n };\n\n Object.defineProperty(document, 'baseURI', baseURIDescriptor);
\n Object.defineProperty(mainDoc, 'baseURI', baseURIDescriptor);\n}\n\n// call
a callback when all HTMLImports in the document at call (or at least\n// docume
nt ready) time have loaded.\n// 1. ensure the document is in a ready state (has
dom), then \n// 2. watch for loading of imports and call callback when done\nfun
ction whenImportsReady(callback, doc) {\n doc = doc || mainDoc;\n // if docume
nt is loading, wait and try again\n whenDocumentReady(function() {\n watchIm
portsLoad(callback, doc);\n }, doc);\n}\n\n// call the callback when the docume
nt is in a ready state (has dom)\nvar requiredReadyState = HTMLImports.isIE ? 'c
omplete' : 'interactive';\nvar READY_EVENT = 'readystatechange';\nfunction isDoc
umentReady(doc) {\n return (doc.readyState === 'complete' ||\n doc.readySt
ate === requiredReadyState);\n}\n\n// call <callback> when we ensure the documen
t is in a ready state\nfunction whenDocumentReady(callback, doc) {\n if (!isDoc
umentReady(doc)) {\n var checkReady = function() {\n if (doc.readyState
=== 'complete' || \n doc.readyState === requiredReadyState) {\n
doc.removeEventListener(READY_EVENT, checkReady);\n whenDocumentReady(cal
lback, doc);\n }\n }\n doc.addEventListener(READY_EVENT, checkReady);
\n } else if (callback) {\n callback();\n }\n}\n\n// call <callback> when w
e ensure all imports have loaded\nfunction watchImportsLoad(callback, doc) {\n
var imports = doc.querySelectorAll('link[rel=import]');\n var loaded = 0, l = i
mports.length;\n function checkDone(d) { \n if (loaded == l) {\n callba
ck && callback();\n }\n }\n function loadedImport(e) {\n loaded++;\n
checkDone();\n }\n if (l) {\n for (var i=0, imp; (i<l) && (imp=imports[i]);
i++) {\n if (isImportLoaded(imp)) {\n loadedImport.call(imp);\n
} else {\n imp.addEventListener('load', loadedImport);\n imp.add
EventListener('error', loadedImport);\n }\n }\n } else {\n checkDone
();\n }\n}\n\nfunction isImportLoaded(link) {\n return useNative ? (link.impor
t && (link.import.readyState !== 'loading')) || link.__loaded :\n link.__im
portParsed;\n}\n\n// TODO(sorvell): install a mutation observer to see if HTMLIm
ports have loaded\n// this is a workaround for https://www.w3.org/Bugs/Public/sh
ow_bug.cgi?id=25007\n// and should be removed when this bug is addressed.\nif (u
seNative) {\n new MutationObserver(function(mxns) {\n for (var i=0, l=mxns.l
ength, m; (i < l) && (m=mxns[i]); i++) {\n if (m.addedNodes) {\n han
dleImports(m.addedNodes);\n }\n }\n }).observe(document.head, {childLis
t: true});\n\n function handleImports(nodes) {\n for (var i=0, l=nodes.lengt
h, n; (i<l) && (n=nodes[i]); i++) {\n if (isImport(n)) {\n handleImp
ort(n); \n }\n }\n }\n\n function isImport(element) {\n return ele
ment.localName === 'link' && element.rel === 'import';\n }\n\n function handle
Import(element) {\n var loaded = element.import;\n if (loaded) {\n ma
rkTargetLoaded({target: element});\n } else {\n element.addEventListener
('load', markTargetLoaded);\n element.addEventListener('error', markTargetL
oaded);\n }\n }\n\n function markTargetLoaded(event) {\n event.target.__
loaded = true;\n }\n\n}\n\n// exports\nscope.hasNative = hasNative;\nscope.useN
ative = useNative;\nscope.importer = importer;\nscope.IMPORT_LINK_TYPE = IMPORT_
LINK_TYPE;\nscope.isImportLoaded = isImportLoaded;\nscope.importLoader = importL
oader;\nscope.whenReady = whenImportsReady;\n\n// deprecated\nscope.whenImportsR
eady = whenImportsReady;\n\n})(window.HTMLImports);\n", |
160 " /*\nCopyright 2013 The Polymer Authors. All rights reserved.\nUse of this
source code is governed by a BSD-style\nlicense that can be found in the LICENSE
file.\n*/\n\n(function(scope){\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE
;\nvar importSelector = 'link[rel=' + IMPORT_LINK_TYPE + ']';\nvar importer = sc
ope.importer;\nvar parser = scope.parser;\n\n// we track mutations for addedNode
s, looking for imports\nfunction handler(mutations) {\n for (var i=0, l=mutatio
ns.length, m; (i<l) && (m=mutations[i]); i++) {\n if (m.type === 'childList'
&& m.addedNodes.length) {\n addedNodes(m.addedNodes);\n }\n }\n}\n\n//
find loadable elements and add them to the importer\nfunction addedNodes(nodes)
{\n var owner;\n for (var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++)
{\n owner = owner || n.ownerDocument;\n if (shouldLoadNode(n)) {\n im
porter.loadNode(n);\n }\n if (n.children && n.children.length) {\n ad
dedNodes(n.children);\n }\n }\n // TODO(sorvell): This is not the right app
roach here. We shouldn't need to\n // invalidate parsing when an element is add
ed. Disabling this code \n // until a better approach is found.\n /*\n if (ow
ner) {\n parser.invalidateParse(owner);\n }\n */\n}\n\nfunction shouldLoadN
ode(node) {\n return (node.nodeType === 1) && matches.call(node,\n importe
r.loadSelectorsForNode(node));\n}\n\n// x-plat matches\nvar matches = HTMLElemen
t.prototype.matches || \n HTMLElement.prototype.matchesSelector || \n HTML
Element.prototype.webkitMatchesSelector ||\n HTMLElement.prototype.mozMatches
Selector ||\n HTMLElement.prototype.msMatchesSelector;\n\nvar observer = new
MutationObserver(handler);\n\n// observe the given root for loadable elements\nf
unction observe(root) {\n observer.observe(root, {childList: true, subtree: tru
e});\n}\n\n// exports\n// TODO(sorvell): factor so can put on scope\nscope.obser
ve = observe;\nimporter.observe = observe;\n\n})(HTMLImports);\n", | 158 " /*\nCopyright 2013 The Polymer Authors. All rights reserved.\nUse of this
source code is governed by a BSD-style\nlicense that can be found in the LICENSE
file.\n*/\n\n(function(scope){\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE
;\nvar importSelector = 'link[rel=' + IMPORT_LINK_TYPE + ']';\nvar importer = sc
ope.importer;\nvar parser = scope.parser;\n\n// we track mutations for addedNode
s, looking for imports\nfunction handler(mutations) {\n for (var i=0, l=mutatio
ns.length, m; (i<l) && (m=mutations[i]); i++) {\n if (m.type === 'childList'
&& m.addedNodes.length) {\n addedNodes(m.addedNodes);\n }\n }\n}\n\n//
find loadable elements and add them to the importer\nfunction addedNodes(nodes)
{\n var owner;\n for (var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++)
{\n owner = owner || n.ownerDocument;\n if (shouldLoadNode(n)) {\n im
porter.loadNode(n);\n }\n if (n.children && n.children.length) {\n ad
dedNodes(n.children);\n }\n }\n // TODO(sorvell): This is not the right app
roach here. We shouldn't need to\n // invalidate parsing when an element is add
ed. Disabling this code \n // until a better approach is found.\n /*\n if (ow
ner) {\n parser.invalidateParse(owner);\n }\n */\n}\n\nfunction shouldLoadN
ode(node) {\n return (node.nodeType === 1) && matches.call(node,\n importe
r.loadSelectorsForNode(node));\n}\n\n// x-plat matches\nvar matches = HTMLElemen
t.prototype.matches || \n HTMLElement.prototype.matchesSelector || \n HTML
Element.prototype.webkitMatchesSelector ||\n HTMLElement.prototype.mozMatches
Selector ||\n HTMLElement.prototype.msMatchesSelector;\n\nvar observer = new
MutationObserver(handler);\n\n// observe the given root for loadable elements\nf
unction observe(root) {\n observer.observe(root, {childList: true, subtree: tru
e});\n}\n\n// exports\n// TODO(sorvell): factor so can put on scope\nscope.obser
ve = observe;\nimporter.observe = observe;\n\n})(HTMLImports);\n", |
161 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n(function(){\n\n// bootstrap\n\n// IE shim for CustomEvent\
nif (typeof window.CustomEvent !== 'function') {\n window.CustomEvent = functio
n(inType, dictionary) {\n var e = document.createEvent('HTMLEvents');\n
e.initEvent(inType,\n dictionary.bubbles === false ? false : true,\n
dictionary.cancelable === false ? false : true,\n dictionary.detail);\
n return e;\n };\n}\n\n// TODO(sorvell): SD polyfill intrusion\nvar doc = w
indow.ShadowDOMPolyfill ? \n window.ShadowDOMPolyfill.wrapIfNeeded(document)
: document;\n\n// Fire the 'HTMLImportsLoaded' event when imports in document at
load time \n// have loaded. This event is required to simulate the script block
ing \n// behavior of native imports. A main document script that needs to be sur
e\n// imports have loaded should wait for this event.\nHTMLImports.whenImportsRe
ady(function() {\n HTMLImports.ready = true;\n HTMLImports.readyTime = new Dat
e().getTime();\n doc.dispatchEvent(\n new CustomEvent('HTMLImportsLoaded', {
bubbles: true})\n );\n});\n\n\n// no need to bootstrap the polyfill when native
imports is available.\nif (!HTMLImports.useNative) {\n function bootstrap() {\
n HTMLImports.importer.bootDocument(doc);\n }\n \n // TODO(sorvell): SD
polyfill does *not* generate mutations for nodes added\n // by the parser. For
this reason, we must wait until the dom exists to \n // bootstrap.\n if (docum
ent.readyState === 'complete' ||\n (document.readyState === 'interactive' &
& !window.attachEvent)) {\n bootstrap();\n } else {\n document.addEventLi
stener('DOMContentLoaded', bootstrap);\n }\n}\n\n})();\n", | 159 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n(function(){\n\n// bootstrap\n\n// IE shim for CustomEvent\
nif (typeof window.CustomEvent !== 'function') {\n window.CustomEvent = functio
n(inType, dictionary) {\n var e = document.createEvent('HTMLEvents');\n
e.initEvent(inType,\n dictionary.bubbles === false ? false : true,\n
dictionary.cancelable === false ? false : true,\n dictionary.detail);\
n return e;\n };\n}\n\n// TODO(sorvell): SD polyfill intrusion\nvar doc = w
indow.ShadowDOMPolyfill ? \n window.ShadowDOMPolyfill.wrapIfNeeded(document)
: document;\n\n// Fire the 'HTMLImportsLoaded' event when imports in document at
load time \n// have loaded. This event is required to simulate the script block
ing \n// behavior of native imports. A main document script that needs to be sur
e\n// imports have loaded should wait for this event.\nHTMLImports.whenImportsRe
ady(function() {\n HTMLImports.ready = true;\n HTMLImports.readyTime = new Dat
e().getTime();\n doc.dispatchEvent(\n new CustomEvent('HTMLImportsLoaded', {
bubbles: true})\n );\n});\n\n\n// no need to bootstrap the polyfill when native
imports is available.\nif (!HTMLImports.useNative) {\n function bootstrap() {\
n HTMLImports.importer.bootDocument(doc);\n }\n \n // TODO(sorvell): SD
polyfill does *not* generate mutations for nodes added\n // by the parser. For
this reason, we must wait until the dom exists to \n // bootstrap.\n if (docum
ent.readyState === 'complete' ||\n (document.readyState === 'interactive' &
& !window.attachEvent)) {\n bootstrap();\n } else {\n document.addEventLi
stener('DOMContentLoaded', bootstrap);\n }\n}\n\n})();\n", |
162 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\nwindow.CustomElements = window.CustomElements || {flags:{}}
;", | 160 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\nwindow.CustomElements = win
dow.CustomElements || {flags:{}};", |
163 " /*\r\nCopyright 2013 The Polymer Authors. All rights reserved.\r\nUse of t
his source code is governed by a BSD-style\r\nlicense that can be found in the L
ICENSE file.\r\n*/\r\n\r\n(function(scope){\r\n\r\nvar logFlags = window.logFlag
s || {};\r\nvar IMPORT_LINK_TYPE = window.HTMLImports ? HTMLImports.IMPORT_LINK_
TYPE : 'none';\r\n\r\n// walk the subtree rooted at node, applying 'find(element
, data)' function\r\n// to each element\r\n// if 'find' returns true for 'elemen
t', do not search element's subtree\r\nfunction findAll(node, find, data) {\r\n
var e = node.firstElementChild;\r\n if (!e) {\r\n e = node.firstChild;\r\n
while (e && e.nodeType !== Node.ELEMENT_NODE) {\r\n e = e.nextSibling;\r
\n }\r\n }\r\n while (e) {\r\n if (find(e, data) !== true) {\r\n fi
ndAll(e, find, data);\r\n }\r\n e = e.nextElementSibling;\r\n }\r\n retu
rn null;\r\n}\r\n\r\n// walk all shadowRoots on a given node.\r\nfunction forRoo
ts(node, cb) {\r\n var root = node.shadowRoot;\r\n while(root) {\r\n forSub
tree(root, cb);\r\n root = root.olderShadowRoot;\r\n }\r\n}\r\n\r\n// walk t
he subtree rooted at node, including descent into shadow-roots,\r\n// applying '
cb' to each element\r\nfunction forSubtree(node, cb) {\r\n //logFlags.dom && no
de.childNodes && node.childNodes.length && console.group('subTree: ', node);\r\n
findAll(node, function(e) {\r\n if (cb(e)) {\r\n return true;\r\n }
\r\n forRoots(e, cb);\r\n });\r\n forRoots(node, cb);\r\n //logFlags.dom &
& node.childNodes && node.childNodes.length && console.groupEnd();\r\n}\r\n\r\n/
/ manage lifecycle on added node\r\nfunction added(node) {\r\n if (upgrade(node
)) {\r\n insertedNode(node);\r\n return true;\r\n }\r\n inserted(node);\
r\n}\r\n\r\n// manage lifecycle on added node's subtree only\r\nfunction addedSu
btree(node) {\r\n forSubtree(node, function(e) {\r\n if (added(e)) {\r\n
return true;\r\n }\r\n });\r\n}\r\n\r\n// manage lifecycle on added node a
nd it's subtree\r\nfunction addedNode(node) {\r\n return added(node) || addedSu
btree(node);\r\n}\r\n\r\n// upgrade custom elements at node, if applicable\r\nfu
nction upgrade(node) {\r\n if (!node.__upgraded__ && node.nodeType === Node.ELE
MENT_NODE) {\r\n var type = node.getAttribute('is') || node.localName;\r\n
var definition = scope.registry[type];\r\n if (definition) {\r\n logFla
gs.dom && console.group('upgrade:', node.localName);\r\n scope.upgrade(node
);\r\n logFlags.dom && console.groupEnd();\r\n return true;\r\n }\r
\n }\r\n}\r\n\r\nfunction insertedNode(node) {\r\n inserted(node);\r\n if (in
Document(node)) {\r\n forSubtree(node, function(e) {\r\n inserted(e);\r\
n });\r\n }\r\n}\r\n\r\n// TODO(sorvell): on platforms without MutationObser
ver, mutations may not be\r\n// reliable and therefore attached/detached are not
reliable.\r\n// To make these callbacks less likely to fail, we defer all inser
ts and removes\r\n// to give a chance for elements to be inserted into dom.\r\n/
/ This ensures attachedCallback fires for elements that are created and\r\n// im
mediately added to dom.\r\nvar hasPolyfillMutations = (!window.MutationObserver
||\r\n (window.MutationObserver === window.JsMutationObserver));\r\nscope.has
PolyfillMutations = hasPolyfillMutations;\r\n\r\nvar isPendingMutations = false;
\r\nvar pendingMutations = [];\r\nfunction deferMutation(fn) {\r\n pendingMutat
ions.push(fn);\r\n if (!isPendingMutations) {\r\n isPendingMutations = true;
\r\n var async = (window.Platform && window.Platform.endOfMicrotask) ||\r\n
setTimeout;\r\n async(takeMutations);\r\n }\r\n}\r\n\r\nfunction takeM
utations() {\r\n isPendingMutations = false;\r\n var $p = pendingMutations;\r\
n for (var i=0, l=$p.length, p; (i<l) && (p=$p[i]); i++) {\r\n p();\r\n }\r
\n pendingMutations = [];\r\n}\r\n\r\nfunction inserted(element) {\r\n if (has
PolyfillMutations) {\r\n deferMutation(function() {\r\n _inserted(elemen
t);\r\n });\r\n } else {\r\n _inserted(element);\r\n }\r\n}\r\n\r\n// TO
DO(sjmiles): if there are descents into trees that can never have inDocument(*)
true, fix this\r\nfunction _inserted(element) {\r\n // TODO(sjmiles): it's poss
ible we were inserted and removed in the space\r\n // of one microtask, in whic
h case we won't be 'inDocument' here\r\n // But there are other cases where we
are testing for inserted without\r\n // specific knowledge of mutations, and mu
st test 'inDocument' to determine\r\n // whether to call inserted\r\n // If we
can factor these cases into separate code paths we can have\r\n // better diag
nostics.\r\n // TODO(sjmiles): when logging, do work on all custom elements so
we can\r\n // track behavior even when callbacks not defined\r\n //console.log
('inserted: ', element.localName);\r\n if (element.attachedCallback || element.
detachedCallback || (element.__upgraded__ && logFlags.dom)) {\r\n logFlags.do
m && console.group('inserted:', element.localName);\r\n if (inDocument(elemen
t)) {\r\n element.__inserted = (element.__inserted || 0) + 1;\r\n // i
f we are in a 'removed' state, bluntly adjust to an 'inserted' state\r\n if
(element.__inserted < 1) {\r\n element.__inserted = 1;\r\n }\r\n
// if we are 'over inserted', squelch the callback\r\n if (element.__ins
erted > 1) {\r\n logFlags.dom && console.warn('inserted:', element.localN
ame,\r\n 'insert/remove count:', element.__inserted)\r\n } else if
(element.attachedCallback) {\r\n logFlags.dom && console.log('inserted:'
, element.localName);\r\n element.attachedCallback();\r\n }\r\n }
\r\n logFlags.dom && console.groupEnd();\r\n }\r\n}\r\n\r\nfunction removedN
ode(node) {\r\n removed(node);\r\n forSubtree(node, function(e) {\r\n remov
ed(e);\r\n });\r\n}\r\n\r\nfunction removed(element) {\r\n if (hasPolyfillMuta
tions) {\r\n deferMutation(function() {\r\n _removed(element);\r\n })
;\r\n } else {\r\n _removed(element);\r\n }\r\n}\r\n\r\nfunction _removed(e
lement) {\r\n // TODO(sjmiles): temporary: do work on all custom elements so we
can track\r\n // behavior even when callbacks not defined\r\n if (element.att
achedCallback || element.detachedCallback || (element.__upgraded__ && logFlags.d
om)) {\r\n logFlags.dom && console.group('removed:', element.localName);\r\n
if (!inDocument(element)) {\r\n element.__inserted = (element.__inserted
|| 0) - 1;\r\n // if we are in a 'inserted' state, bluntly adjust to an 'r
emoved' state\r\n if (element.__inserted > 0) {\r\n element.__insert
ed = 0;\r\n }\r\n // if we are 'over removed', squelch the callback\r\
n if (element.__inserted < 0) {\r\n logFlags.dom && console.warn('re
moved:', element.localName,\r\n 'insert/remove count:', element.__ins
erted)\r\n } else if (element.detachedCallback) {\r\n element.detach
edCallback();\r\n }\r\n }\r\n logFlags.dom && console.groupEnd();\r\n
}\r\n}\r\n\r\n// SD polyfill intrustion due mainly to the fact that 'document'
\r\n// is not entirely wrapped\r\nfunction wrapIfNeeded(node) {\r\n return wind
ow.ShadowDOMPolyfill ? ShadowDOMPolyfill.wrapIfNeeded(node)\r\n : node;\r\n
}\r\n\r\nfunction inDocument(element) {\r\n var p = element;\r\n var doc = wra
pIfNeeded(document);\r\n while (p) {\r\n if (p == doc) {\r\n return tru
e;\r\n }\r\n p = p.parentNode || p.host;\r\n }\r\n}\r\n\r\nfunction watch
Shadow(node) {\r\n if (node.shadowRoot && !node.shadowRoot.__watched) {\r\n
logFlags.dom && console.log('watching shadow-root for: ', node.localName);\r\n
// watch all unwatched roots...\r\n var root = node.shadowRoot;\r\n whil
e (root) {\r\n watchRoot(root);\r\n root = root.olderShadowRoot;\r\n
}\r\n }\r\n}\r\n\r\nfunction watchRoot(root) {\r\n if (!root.__watched) {\r\
n observe(root);\r\n root.__watched = true;\r\n }\r\n}\r\n\r\nfunction ha
ndler(mutations) {\r\n //\r\n if (logFlags.dom) {\r\n var mx = mutations[0]
;\r\n if (mx && mx.type === 'childList' && mx.addedNodes) {\r\n if (mx
.addedNodes) {\r\n var d = mx.addedNodes[0];\r\n while (d && d
!== document && !d.host) {\r\n d = d.parentNode;\r\n }\r\n
var u = d && (d.URL || d._URL || (d.host && d.host.localName)) || '';\r
\n u = u.split('/?').shift().split('/').pop();\r\n }\r\n }\r\
n console.group('mutations (%d) [%s]', mutations.length, u || '');\r\n }\r\n
//\r\n mutations.forEach(function(mx) {\r\n //logFlags.dom && console.grou
p('mutation');\r\n if (mx.type === 'childList') {\r\n forEach(mx.addedNo
des, function(n) {\r\n //logFlags.dom && console.log(n.localName);\r\n
if (!n.localName) {\r\n return;\r\n }\r\n // nodes a
dded may need lifecycle management\r\n addedNode(n);\r\n });\r\n
// removed nodes may need lifecycle management\r\n forEach(mx.removedNode
s, function(n) {\r\n //logFlags.dom && console.log(n.localName);\r\n
if (!n.localName) {\r\n return;\r\n }\r\n removedNode(
n);\r\n });\r\n }\r\n //logFlags.dom && console.groupEnd();\r\n });\
r\n logFlags.dom && console.groupEnd();\r\n};\r\n\r\nvar observer = new Mutatio
nObserver(handler);\r\n\r\nfunction takeRecords() {\r\n // TODO(sjmiles): ask R
af why we have to call handler ourselves\r\n handler(observer.takeRecords());\r
\n takeMutations();\r\n}\r\n\r\nvar forEach = Array.prototype.forEach.call.bind
(Array.prototype.forEach);\r\n\r\nfunction observe(inRoot) {\r\n observer.obser
ve(inRoot, {childList: true, subtree: true});\r\n}\r\n\r\nfunction observeDocume
nt(doc) {\r\n observe(doc);\r\n}\r\n\r\nfunction upgradeDocument(doc) {\r\n lo
gFlags.dom && console.group('upgradeDocument: ', (doc.baseURI).split('/').pop())
;\r\n addedNode(doc);\r\n logFlags.dom && console.groupEnd();\r\n}\r\n\r\nfunc
tion upgradeDocumentTree(doc) {\r\n doc = wrapIfNeeded(doc);\r\n //console.log
('upgradeDocumentTree: ', (doc.baseURI).split('/').pop());\r\n // upgrade conta
ined imported documents\r\n var imports = doc.querySelectorAll('link[rel=' + IM
PORT_LINK_TYPE + ']');\r\n for (var i=0, l=imports.length, n; (i<l) && (n=impor
ts[i]); i++) {\r\n if (n.import && n.import.__parsed) {\r\n upgradeDocum
entTree(n.import);\r\n }\r\n }\r\n upgradeDocument(doc);\r\n}\r\n\r\n// exp
orts\r\nscope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\r\nscope.watchShadow = watchS
hadow;\r\nscope.upgradeDocumentTree = upgradeDocumentTree;\r\nscope.upgradeAll =
addedNode;\r\nscope.upgradeSubtree = addedSubtree;\r\nscope.insertedNode = inse
rtedNode;\r\n\r\nscope.observeDocument = observeDocument;\r\nscope.upgradeDocume
nt = upgradeDocument;\r\n\r\nscope.takeRecords = takeRecords;\r\n\r\n})(window.C
ustomElements);\r\n", | 161 "/*\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserve
d.\r\n * This code may only be used under the BSD style license found at http://
polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may
be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by
Google as part of the polymer project is also\r\n * subject to an additional IP
rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(functi
on(scope){\r\n\r\nvar logFlags = window.logFlags || {};\r\nvar IMPORT_LINK_TYPE
= window.HTMLImports ? HTMLImports.IMPORT_LINK_TYPE : 'none';\r\n\r\n// walk the
subtree rooted at node, applying 'find(element, data)' function\r\n// to each e
lement\r\n// if 'find' returns true for 'element', do not search element's subtr
ee\r\nfunction findAll(node, find, data) {\r\n var e = node.firstElementChild;\
r\n if (!e) {\r\n e = node.firstChild;\r\n while (e && e.nodeType !== Nod
e.ELEMENT_NODE) {\r\n e = e.nextSibling;\r\n }\r\n }\r\n while (e) {\r
\n if (find(e, data) !== true) {\r\n findAll(e, find, data);\r\n }\r\
n e = e.nextElementSibling;\r\n }\r\n return null;\r\n}\r\n\r\n// walk all
shadowRoots on a given node.\r\nfunction forRoots(node, cb) {\r\n var root = no
de.shadowRoot;\r\n while(root) {\r\n forSubtree(root, cb);\r\n root = roo
t.olderShadowRoot;\r\n }\r\n}\r\n\r\n// walk the subtree rooted at node, includ
ing descent into shadow-roots,\r\n// applying 'cb' to each element\r\nfunction f
orSubtree(node, cb) {\r\n //logFlags.dom && node.childNodes && node.childNodes.
length && console.group('subTree: ', node);\r\n findAll(node, function(e) {\r\n
if (cb(e)) {\r\n return true;\r\n }\r\n forRoots(e, cb);\r\n });
\r\n forRoots(node, cb);\r\n //logFlags.dom && node.childNodes && node.childNo
des.length && console.groupEnd();\r\n}\r\n\r\n// manage lifecycle on added node\
r\nfunction added(node) {\r\n if (upgrade(node)) {\r\n insertedNode(node);\r
\n return true;\r\n }\r\n inserted(node);\r\n}\r\n\r\n// manage lifecycle o
n added node's subtree only\r\nfunction addedSubtree(node) {\r\n forSubtree(nod
e, function(e) {\r\n if (added(e)) {\r\n return true;\r\n }\r\n });\
r\n}\r\n\r\n// manage lifecycle on added node and it's subtree\r\nfunction added
Node(node) {\r\n return added(node) || addedSubtree(node);\r\n}\r\n\r\n// upgra
de custom elements at node, if applicable\r\nfunction upgrade(node) {\r\n if (!
node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {\r\n var type = no
de.getAttribute('is') || node.localName;\r\n var definition = scope.registry[
type];\r\n if (definition) {\r\n logFlags.dom && console.group('upgrade:
', node.localName);\r\n scope.upgrade(node);\r\n logFlags.dom && conso
le.groupEnd();\r\n return true;\r\n }\r\n }\r\n}\r\n\r\nfunction insert
edNode(node) {\r\n inserted(node);\r\n if (inDocument(node)) {\r\n forSubtr
ee(node, function(e) {\r\n inserted(e);\r\n });\r\n }\r\n}\r\n\r\n// TO
DO(sorvell): on platforms without MutationObserver, mutations may not be\r\n// r
eliable and therefore attached/detached are not reliable.\r\n// To make these ca
llbacks less likely to fail, we defer all inserts and removes\r\n// to give a ch
ance for elements to be inserted into dom.\r\n// This ensures attachedCallback f
ires for elements that are created and\r\n// immediately added to dom.\r\nvar ha
sPolyfillMutations = (!window.MutationObserver ||\r\n (window.MutationObserve
r === window.JsMutationObserver));\r\nscope.hasPolyfillMutations = hasPolyfillMu
tations;\r\n\r\nvar isPendingMutations = false;\r\nvar pendingMutations = [];\r\
nfunction deferMutation(fn) {\r\n pendingMutations.push(fn);\r\n if (!isPendin
gMutations) {\r\n isPendingMutations = true;\r\n var async = (window.Platf
orm && window.Platform.endOfMicrotask) ||\r\n setTimeout;\r\n async(ta
keMutations);\r\n }\r\n}\r\n\r\nfunction takeMutations() {\r\n isPendingMutati
ons = false;\r\n var $p = pendingMutations;\r\n for (var i=0, l=$p.length, p;
(i<l) && (p=$p[i]); i++) {\r\n p();\r\n }\r\n pendingMutations = [];\r\n}\r
\n\r\nfunction inserted(element) {\r\n if (hasPolyfillMutations) {\r\n defer
Mutation(function() {\r\n _inserted(element);\r\n });\r\n } else {\r\n
_inserted(element);\r\n }\r\n}\r\n\r\n// TODO(sjmiles): if there are descent
s into trees that can never have inDocument(*) true, fix this\r\nfunction _inser
ted(element) {\r\n // TODO(sjmiles): it's possible we were inserted and removed
in the space\r\n // of one microtask, in which case we won't be 'inDocument' h
ere\r\n // But there are other cases where we are testing for inserted without\
r\n // specific knowledge of mutations, and must test 'inDocument' to determine
\r\n // whether to call inserted\r\n // If we can factor these cases into sepa
rate code paths we can have\r\n // better diagnostics.\r\n // TODO(sjmiles): w
hen logging, do work on all custom elements so we can\r\n // track behavior eve
n when callbacks not defined\r\n //console.log('inserted: ', element.localName)
;\r\n if (element.attachedCallback || element.detachedCallback || (element.__up
graded__ && logFlags.dom)) {\r\n logFlags.dom && console.group('inserted:', e
lement.localName);\r\n if (inDocument(element)) {\r\n element.__inserted
= (element.__inserted || 0) + 1;\r\n // if we are in a 'removed' state, bl
untly adjust to an 'inserted' state\r\n if (element.__inserted < 1) {\r\n
element.__inserted = 1;\r\n }\r\n // if we are 'over inserted',
squelch the callback\r\n if (element.__inserted > 1) {\r\n logFlags.
dom && console.warn('inserted:', element.localName,\r\n 'insert/remove
count:', element.__inserted)\r\n } else if (element.attachedCallback) {\r\n
logFlags.dom && console.log('inserted:', element.localName);\r\n
element.attachedCallback();\r\n }\r\n }\r\n logFlags.dom && console.g
roupEnd();\r\n }\r\n}\r\n\r\nfunction removedNode(node) {\r\n removed(node);\r
\n forSubtree(node, function(e) {\r\n removed(e);\r\n });\r\n}\r\n\r\nfunct
ion removed(element) {\r\n if (hasPolyfillMutations) {\r\n deferMutation(fun
ction() {\r\n _removed(element);\r\n });\r\n } else {\r\n _removed(e
lement);\r\n }\r\n}\r\n\r\nfunction _removed(element) {\r\n // TODO(sjmiles):
temporary: do work on all custom elements so we can track\r\n // behavior even
when callbacks not defined\r\n if (element.attachedCallback || element.detached
Callback || (element.__upgraded__ && logFlags.dom)) {\r\n logFlags.dom && con
sole.group('removed:', element.localName);\r\n if (!inDocument(element)) {\r\
n element.__inserted = (element.__inserted || 0) - 1;\r\n // if we are
in a 'inserted' state, bluntly adjust to an 'removed' state\r\n if (elemen
t.__inserted > 0) {\r\n element.__inserted = 0;\r\n }\r\n // if
we are 'over removed', squelch the callback\r\n if (element.__inserted < 0
) {\r\n logFlags.dom && console.warn('removed:', element.localName,\r\n
'insert/remove count:', element.__inserted)\r\n } else if (elemen
t.detachedCallback) {\r\n element.detachedCallback();\r\n }\r\n }
\r\n logFlags.dom && console.groupEnd();\r\n }\r\n}\r\n\r\n// SD polyfill in
trustion due mainly to the fact that 'document'\r\n// is not entirely wrapped\r\
nfunction wrapIfNeeded(node) {\r\n return window.ShadowDOMPolyfill ? ShadowDOMP
olyfill.wrapIfNeeded(node)\r\n : node;\r\n}\r\n\r\nfunction inDocument(elem
ent) {\r\n var p = element;\r\n var doc = wrapIfNeeded(document);\r\n while (
p) {\r\n if (p == doc) {\r\n return true;\r\n }\r\n p = p.parentNo
de || p.host;\r\n }\r\n}\r\n\r\nfunction watchShadow(node) {\r\n if (node.shad
owRoot && !node.shadowRoot.__watched) {\r\n logFlags.dom && console.log('watc
hing shadow-root for: ', node.localName);\r\n // watch all unwatched roots...
\r\n var root = node.shadowRoot;\r\n while (root) {\r\n watchRoot(roo
t);\r\n root = root.olderShadowRoot;\r\n }\r\n }\r\n}\r\n\r\nfunction w
atchRoot(root) {\r\n if (!root.__watched) {\r\n observe(root);\r\n root._
_watched = true;\r\n }\r\n}\r\n\r\nfunction handler(mutations) {\r\n //\r\n i
f (logFlags.dom) {\r\n var mx = mutations[0];\r\n if (mx && mx.type === 'c
hildList' && mx.addedNodes) {\r\n if (mx.addedNodes) {\r\n var d
= mx.addedNodes[0];\r\n while (d && d !== document && !d.host) {\r\n
d = d.parentNode;\r\n }\r\n var u = d && (d.URL || d
._URL || (d.host && d.host.localName)) || '';\r\n u = u.split('/?').shi
ft().split('/').pop();\r\n }\r\n }\r\n console.group('mutations (%d
) [%s]', mutations.length, u || '');\r\n }\r\n //\r\n mutations.forEach(funct
ion(mx) {\r\n //logFlags.dom && console.group('mutation');\r\n if (mx.type
=== 'childList') {\r\n forEach(mx.addedNodes, function(n) {\r\n //l
ogFlags.dom && console.log(n.localName);\r\n if (!n.localName) {\r\n
return;\r\n }\r\n // nodes added may need lifecycle managemen
t\r\n addedNode(n);\r\n });\r\n // removed nodes may need lifec
ycle management\r\n forEach(mx.removedNodes, function(n) {\r\n //log
Flags.dom && console.log(n.localName);\r\n if (!n.localName) {\r\n
return;\r\n }\r\n removedNode(n);\r\n });\r\n }\r\n
//logFlags.dom && console.groupEnd();\r\n });\r\n logFlags.dom && console.grou
pEnd();\r\n};\r\n\r\nvar observer = new MutationObserver(handler);\r\n\r\nfuncti
on takeRecords() {\r\n // TODO(sjmiles): ask Raf why we have to call handler ou
rselves\r\n handler(observer.takeRecords());\r\n takeMutations();\r\n}\r\n\r\n
var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);\r\n\r\
nfunction observe(inRoot) {\r\n observer.observe(inRoot, {childList: true, subt
ree: true});\r\n}\r\n\r\nfunction observeDocument(doc) {\r\n observe(doc);\r\n}
\r\n\r\nfunction upgradeDocument(doc) {\r\n logFlags.dom && console.group('upgr
adeDocument: ', (doc.baseURI).split('/').pop());\r\n addedNode(doc);\r\n logFl
ags.dom && console.groupEnd();\r\n}\r\n\r\nfunction upgradeDocumentTree(doc) {\r
\n doc = wrapIfNeeded(doc);\r\n //console.log('upgradeDocumentTree: ', (doc.ba
seURI).split('/').pop());\r\n // upgrade contained imported documents\r\n var
imports = doc.querySelectorAll('link[rel=' + IMPORT_LINK_TYPE + ']');\r\n for (
var i=0, l=imports.length, n; (i<l) && (n=imports[i]); i++) {\r\n if (n.impor
t && n.import.__parsed) {\r\n upgradeDocumentTree(n.import);\r\n }\r\n
}\r\n upgradeDocument(doc);\r\n}\r\n\r\n// exports\r\nscope.IMPORT_LINK_TYPE =
IMPORT_LINK_TYPE;\r\nscope.watchShadow = watchShadow;\r\nscope.upgradeDocumentTr
ee = upgradeDocumentTree;\r\nscope.upgradeAll = addedNode;\r\nscope.upgradeSubtr
ee = addedSubtree;\r\nscope.insertedNode = insertedNode;\r\n\r\nscope.observeDoc
ument = observeDocument;\r\nscope.upgradeDocument = upgradeDocument;\r\n\r\nscop
e.takeRecords = takeRecords;\r\n\r\n})(window.CustomElements);\r\n", |
164 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n/**\n * Implements `document.register`\n * @module Custom
Elements\n*/\n\n/**\n * Polyfilled extensions to the `document` object.\n * @cla
ss Document\n*/\n\n(function(scope) {\n\n// imports\n\nif (!scope) {\n scope =
window.CustomElements = {flags:{}};\n}\nvar flags = scope.flags;\n\n// native do
cument.registerElement?\n\nvar hasNative = Boolean(document.registerElement);\n/
/ For consistent timing, use native custom elements only when not polyfilling\n/
/ other key related web components features.\nvar useNative = !flags.register &&
hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || HTMLImports.u
seNative);\n\nif (useNative) {\n\n // stub\n var nop = function() {};\n\n //
exports\n scope.registry = {};\n scope.upgradeElement = nop;\n\n scope.watchS
hadow = nop;\n scope.upgrade = nop;\n scope.upgradeAll = nop;\n scope.upgrade
Subtree = nop;\n scope.observeDocument = nop;\n scope.upgradeDocument = nop;\n
scope.upgradeDocumentTree = nop;\n scope.takeRecords = nop;\n scope.reserved
TagList = [];\n\n} else {\n\n /**\n * Registers a custom tag name with the do
cument.\n *\n * When a registered element is created, a `readyCallback` meth
od is called\n * in the scope of the element. The `readyCallback` method can b
e specified on\n * either `options.prototype` or `options.lifecycle` with the
latter taking\n * precedence.\n *\n * @method register\n * @param {Strin
g} name The tag name to register. Must include a dash ('-'),\n * for exampl
e 'x-component'.\n * @param {Object} options\n * @param {String} [options
.extends]\n * (_off spec_) Tag name of an element to extend (or blank for
a new\n * element). This parameter is not part of the specification, but
instead\n * is a hint for the polyfill because the extendee is difficult
to infer.\n * Remember that the input prototype must chain to the extend
ed element's\n * prototype (or HTMLElement.prototype) regardless of the v
alue of\n * `extends`.\n * @param {Object} options.prototype The pro
totype to use for the new\n * element. The prototype must inherit from HT
MLElement.\n * @param {Object} [options.lifecycle]\n * Callbacks tha
t fire at important phases in the life of the custom\n * element.\n *\n
* @example\n * FancyButton = document.registerElement(\"fancy-button\"
, {\n * extends: 'button',\n * prototype: Object.create(HTMLBu
ttonElement.prototype, {\n * readyCallback: {\n * value:
function() {\n * console.log(\"a fancy-button was created\",\n
* }\n * }\n * })\n * });\n * @return {F
unction} Constructor for the newly registered type.\n */\n function register(
name, options) {\n //console.warn('document.registerElement(\"' + name + '\",
', options, ')');\n // construct a defintion out of options\n // TODO(sjm
iles): probably should clone options instead of mutating it\n var definition
= options || {};\n if (!name) {\n // TODO(sjmiles): replace with more ap
propriate error (EricB can probably\n // offer guidance)\n throw new E
rror('document.registerElement: first argument `name` must not be empty');\n
}\n if (name.indexOf('-') < 0) {\n // TODO(sjmiles): replace with more a
ppropriate error (EricB can probably\n // offer guidance)\n throw new
Error('document.registerElement: first argument (\\'name\\') must contain a dash
(\\'-\\'). Argument provided was \\'' + String(name) + '\\'.');\n }\n //
prevent registering reserved names\n if (isReservedTag(name)) {\n throw
new Error('Failed to execute \\'registerElement\\' on \\'Document\\': Registrati
on failed for type \\'' + String(name) + '\\'. The type name is invalid.');\n
}\n // elements may only be registered once\n if (getRegisteredDefinition
(name)) {\n throw new Error('DuplicateDefinitionError: a type with name \\'
' + String(name) + '\\' is already registered');\n }\n // must have a prot
otype, default to an extension of HTMLElement\n // TODO(sjmiles): probably sh
ould throw if no prototype, check spec\n if (!definition.prototype) {\n
// TODO(sjmiles): replace with more appropriate error (EricB can probably\n
// offer guidance)\n throw new Error('Options missing required prototype p
roperty');\n }\n // record name\n definition.__name = name.toLowerCase(
);\n // ensure a lifecycle object so we don't have to null test it\n defin
ition.lifecycle = definition.lifecycle || {};\n // build a list of ancestral
custom elements (for native base detection)\n // TODO(sjmiles): we used to ne
ed to store this, but current code only\n // uses it in 'resolveTagName': it
should probably be inlined\n definition.ancestry = ancestry(definition.extend
s);\n // extensions of native specializations of HTMLElement require localNam
e\n // to remain native, and use secondary 'is' specifier for extension type\
n resolveTagName(definition);\n // some platforms require modifications to
the user-supplied prototype\n // chain\n resolvePrototypeChain(definition
);\n // overrides to implement attributeChanged callback\n overrideAttribu
teApi(definition.prototype);\n // 7.1.5: Register the DEFINITION with DOCUMEN
T\n registerDefinition(definition.__name, definition);\n // 7.1.7. Run cus
tom element constructor generation algorithm with PROTOTYPE\n // 7.1.8. Retur
n the output of the previous step.\n definition.ctor = generateConstructor(de
finition);\n definition.ctor.prototype = definition.prototype;\n // force
our .constructor to be our actual constructor\n definition.prototype.construc
tor = definition.ctor;\n // if initial parsing is complete\n if (scope.rea
dy) {\n // upgrade any pre-existing nodes of this type\n scope.upgrade
DocumentTree(document);\n }\n return definition.ctor;\n }\n\n function i
sReservedTag(name) {\n for (var i = 0; i < reservedTagList.length; i++) {\n
if (name === reservedTagList[i]) {\n return true;\n }\n }\n
}\n\n var reservedTagList = [\n 'annotation-xml', 'color-profile', 'font-fac
e', 'font-face-src',\n 'font-face-uri', 'font-face-format', 'font-face-name',
'missing-glyph'\n ];\n\n function ancestry(extnds) {\n var extendee = getR
egisteredDefinition(extnds);\n if (extendee) {\n return ancestry(extende
e.extends).concat([extendee]);\n }\n return [];\n }\n\n function resolve
TagName(definition) {\n // if we are explicitly extending something, that thi
ng is our\n // baseTag, unless it represents a custom component\n var base
Tag = definition.extends;\n // if our ancestry includes custom components, we
only have a\n // baseTag if one of them does\n for (var i=0, a; (a=defini
tion.ancestry[i]); i++) {\n baseTag = a.is && a.tag;\n }\n // our tag
is our baseTag, if it exists, and otherwise just our name\n definition.tag =
baseTag || definition.__name;\n if (baseTag) {\n // if there is a base
tag, use secondary 'is' specifier\n definition.is = definition.__name;\n
}\n }\n\n function resolvePrototypeChain(definition) {\n // if we don't su
pport __proto__ we need to locate the native level\n // prototype for precise
mixing in\n if (!Object.__proto__) {\n // default prototype\n var
nativePrototype = HTMLElement.prototype;\n // work out prototype when using
type-extension\n if (definition.is) {\n var inst = document.createE
lement(definition.tag);\n var expectedPrototype = Object.getPrototypeOf(i
nst);\n // only set nativePrototype if it will actually appear in the def
inition's chain\n if (expectedPrototype === definition.prototype) {\n
nativePrototype = expectedPrototype;\n }\n }\n // ensure
__proto__ reference is installed at each point on the prototype\n // chain.
\n // NOTE: On platforms without __proto__, a mixin strategy is used instea
d\n // of prototype swizzling. In this case, this generated __proto__ provi
des\n // limited support for prototype traversal.\n var proto = defini
tion.prototype, ancestor;\n while (proto && (proto !== nativePrototype)) {\
n ancestor = Object.getPrototypeOf(proto);\n proto.__proto__ = anc
estor;\n proto = ancestor;\n }\n // cache this in case of mixin
\n definition.native = nativePrototype;\n }\n }\n\n // SECTION 4\n\n
function instantiate(definition) {\n // 4.a.1. Create a new object that imple
ments PROTOTYPE\n // 4.a.2. Let ELEMENT by this new object\n //\n // th
e custom element instantiation algorithm must also ensure that the\n // outpu
t is a valid DOM element with the proper wrapper in place.\n //\n return u
pgrade(domCreateElement(definition.tag), definition);\n }\n\n function upgrade
(element, definition) {\n // some definitions specify an 'is' attribute\n
if (definition.is) {\n element.setAttribute('is', definition.is);\n }\n
// remove 'unresolved' attr, which is a standin for :unresolved.\n element
.removeAttribute('unresolved');\n // make 'element' implement definition.prot
otype\n implement(element, definition);\n // flag as upgraded\n element
.__upgraded__ = true;\n // lifecycle management\n created(element);\n /
/ attachedCallback fires in tree order, call before recursing\n scope.inserte
dNode(element);\n // there should never be a shadow root on element at this p
oint\n scope.upgradeSubtree(element);\n // OUTPUT\n return element;\n
}\n\n function implement(element, definition) {\n // prototype swizzling is
best\n if (Object.__proto__) {\n element.__proto__ = definition.prototyp
e;\n } else {\n // where above we can re-acquire inPrototype via\n
// getPrototypeOf(Element), we cannot do so when\n // we use mixin, so we i
nstall a magic reference\n customMixin(element, definition.prototype, defin
ition.native);\n element.__proto__ = definition.prototype;\n }\n }\n\n
function customMixin(inTarget, inSrc, inNative) {\n // TODO(sjmiles): 'used'
allows us to only copy the 'youngest' version of\n // any property. This set
should be precalculated. We also need to\n // consider this for supporting '
super'.\n var used = {};\n // start with inSrc\n var p = inSrc;\n //
The default is HTMLElement.prototype, so we add a test to avoid mixing in\n
// native prototypes\n while (p !== inNative && p !== HTMLElement.prototype)
{\n var keys = Object.getOwnPropertyNames(p);\n for (var i=0, k; k=key
s[i]; i++) {\n if (!used[k]) {\n Object.defineProperty(inTarget,
k,\n Object.getOwnPropertyDescriptor(p, k));\n used[k] =
1;\n }\n }\n p = Object.getPrototypeOf(p);\n }\n }\n\n fun
ction created(element) {\n // invoke createdCallback\n if (element.created
Callback) {\n element.createdCallback();\n }\n }\n\n // attribute watc
hing\n\n function overrideAttributeApi(prototype) {\n // overrides to implem
ent callbacks\n // TODO(sjmiles): should support access via .attributes Named
NodeMap\n // TODO(sjmiles): preserves user defined overrides, if any\n if
(prototype.setAttribute._polyfilled) {\n return;\n }\n var setAttribu
te = prototype.setAttribute;\n prototype.setAttribute = function(name, value)
{\n changeAttribute.call(this, name, value, setAttribute);\n }\n var
removeAttribute = prototype.removeAttribute;\n prototype.removeAttribute = f
unction(name) {\n changeAttribute.call(this, name, null, removeAttribute);\
n }\n prototype.setAttribute._polyfilled = true;\n }\n\n // https://dvcs
.w3.org/hg/webcomponents/raw-file/tip/spec/custom/\n // index.html#dfn-attribut
e-changed-callback\n function changeAttribute(name, value, operation) {\n na
me = name.toLowerCase();\n var oldValue = this.getAttribute(name);\n opera
tion.apply(this, arguments);\n var newValue = this.getAttribute(name);\n i
f (this.attributeChangedCallback\n && (newValue !== oldValue)) {\n t
his.attributeChangedCallback(name, oldValue, newValue);\n }\n }\n\n // elem
ent registry (maps tag names to definitions)\n\n var registry = {};\n\n functi
on getRegisteredDefinition(name) {\n if (name) {\n return registry[name.
toLowerCase()];\n }\n }\n\n function registerDefinition(name, definition) {
\n registry[name] = definition;\n }\n\n function generateConstructor(defini
tion) {\n return function() {\n return instantiate(definition);\n };\
n }\n\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n function creat
eElementNS(namespace, tag, typeExtension) {\n // NOTE: we do not support non-
HTML elements,\n // just call createElementNS for non HTML Elements\n if (
namespace === HTML_NAMESPACE) {\n return createElement(tag, typeExtension);
\n } else {\n return domCreateElementNS(namespace, tag);\n }\n }\n\n
function createElement(tag, typeExtension) {\n // TODO(sjmiles): ignore 'ta
g' when using 'typeExtension', we could\n // error check it, or perhaps there
should only ever be one argument\n var definition = getRegisteredDefinition(
typeExtension || tag);\n if (definition) {\n if (tag == definition.tag &
& typeExtension == definition.is) {\n return new definition.ctor();\n
}\n // Handle empty string for type extension.\n if (!typeExtension
&& !definition.is) {\n return new definition.ctor();\n }\n }\n\n
if (typeExtension) {\n var element = createElement(tag);\n element.
setAttribute('is', typeExtension);\n return element;\n }\n var elemen
t = domCreateElement(tag);\n // Custom tags should be HTMLElements even if no
t upgraded.\n if (tag.indexOf('-') >= 0) {\n implement(element, HTMLElem
ent);\n }\n return element;\n }\n\n function upgradeElement(element) {\n
if (!element.__upgraded__ && (element.nodeType === Node.ELEMENT_NODE)) {\n
var is = element.getAttribute('is');\n var definition = getRegisteredDe
finition(is || element.localName);\n if (definition) {\n if (is && d
efinition.tag == element.localName) {\n return upgrade(element, definit
ion);\n } else if (!is && !definition.extends) {\n return upgrad
e(element, definition);\n }\n }\n }\n }\n\n function cloneNode(
deep) {\n // call original clone\n var n = domCloneNode.call(this, deep);\
n // upgrade the element and subtree\n scope.upgradeAll(n);\n // return
the clone\n return n;\n }\n // capture native createElement before we over
ride it\n\n var domCreateElement = document.createElement.bind(document);\n va
r domCreateElementNS = document.createElementNS.bind(document);\n\n // capture
native cloneNode before we override it\n\n var domCloneNode = Node.prototype.cl
oneNode;\n\n // exports\n\n document.registerElement = register;\n document.c
reateElement = createElement; // override\n document.createElementNS = createEl
ementNS; // override\n Node.prototype.cloneNode = cloneNode; // override\n\n s
cope.registry = registry;\n\n /**\n * Upgrade an element to a custom element.
Upgrading an element\n * causes the custom prototype to be applied, an `is` a
ttribute\n * to be attached (as needed), and invocation of the `readyCallback`
.\n * `upgrade` does nothing if the element is already upgraded, or\n * if i
t matches no registered custom tag name.\n *\n * @method ugprade\n * @para
m {Element} element The element to upgrade.\n * @return {Element} The upgraded
element.\n */\n scope.upgrade = upgradeElement;\n}\n\n// Create a custom 'in
stanceof'. This is necessary when CustomElements\n// are implemented via a mixin
strategy, as for example on IE10.\nvar isInstance;\nif (!Object.__proto__ && !u
seNative) {\n isInstance = function(obj, ctor) {\n var p = obj;\n while (
p) {\n // NOTE: this is not technically correct since we're not checking if
\n // an object is an instance of a constructor; however, this should\n
// be good enough for the mixin strategy.\n if (p === ctor.prototype) {\n
return true;\n }\n p = p.__proto__;\n }\n return false;\
n }\n} else {\n isInstance = function(obj, base) {\n return obj instanceof
base;\n }\n}\n\n// exports\nscope.instanceof = isInstance;\nscope.reservedTagLi
st = reservedTagList;\n\n// bc\ndocument.register = document.registerElement;\n\
nscope.hasNative = hasNative;\nscope.useNative = useNative;\n\n})(window.CustomE
lements);\n", | 162 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * Implements `docum
ent.registerElement`\n * @module CustomElements\n*/\n\n/**\n * Polyfilled extens
ions to the `document` object.\n * @class Document\n*/\n\n(function(scope) {\n\n
// imports\n\nif (!scope) {\n scope = window.CustomElements = {flags:{}};\n}\nv
ar flags = scope.flags;\n\n// native document.registerElement?\n\nvar hasNative
= Boolean(document.registerElement);\n// For consistent timing, use native custo
m elements only when not polyfilling\n// other key related web components featur
es.\nvar useNative = !flags.register && hasNative && !window.ShadowDOMPolyfill &
& (!window.HTMLImports || HTMLImports.useNative);\n\nif (useNative) {\n\n // st
ub\n var nop = function() {};\n\n // exports\n scope.registry = {};\n scope.
upgradeElement = nop;\n\n scope.watchShadow = nop;\n scope.upgrade = nop;\n s
cope.upgradeAll = nop;\n scope.upgradeSubtree = nop;\n scope.observeDocument =
nop;\n scope.upgradeDocument = nop;\n scope.upgradeDocumentTree = nop;\n sco
pe.takeRecords = nop;\n scope.reservedTagList = [];\n\n} else {\n\n /**\n *
Registers a custom tag name with the document.\n *\n * When a registered ele
ment is created, a `readyCallback` method is called\n * in the scope of the el
ement. The `readyCallback` method can be specified on\n * either `options.prot
otype` or `options.lifecycle` with the latter taking\n * precedence.\n *\n
* @method register\n * @param {String} name The tag name to register. Must in
clude a dash ('-'),\n * for example 'x-component'.\n * @param {Object} op
tions\n * @param {String} [options.extends]\n * (_off spec_) Tag nam
e of an element to extend (or blank for a new\n * element). This paramete
r is not part of the specification, but instead\n * is a hint for the pol
yfill because the extendee is difficult to infer.\n * Remember that the i
nput prototype must chain to the extended element's\n * prototype (or HTM
LElement.prototype) regardless of the value of\n * `extends`.\n * @p
aram {Object} options.prototype The prototype to use for the new\n * elem
ent. The prototype must inherit from HTMLElement.\n * @param {Object} [opti
ons.lifecycle]\n * Callbacks that fire at important phases in the life of
the custom\n * element.\n *\n * @example\n * FancyButton = do
cument.registerElement(\"fancy-button\", {\n * extends: 'button',\n *
prototype: Object.create(HTMLButtonElement.prototype, {\n * r
eadyCallback: {\n * value: function() {\n * console.
log(\"a fancy-button was created\",\n * }\n * }\n *
})\n * });\n * @return {Function} Constructor for the newly regist
ered type.\n */\n function register(name, options) {\n //console.warn('doc
ument.registerElement(\"' + name + '\", ', options, ')');\n // construct a de
fintion out of options\n // TODO(sjmiles): probably should clone options inst
ead of mutating it\n var definition = options || {};\n if (!name) {\n
// TODO(sjmiles): replace with more appropriate error (EricB can probably\n
// offer guidance)\n throw new Error('document.registerElement: first arg
ument `name` must not be empty');\n }\n if (name.indexOf('-') < 0) {\n
// TODO(sjmiles): replace with more appropriate error (EricB can probably\n
// offer guidance)\n throw new Error('document.registerElement: first ar
gument (\\'name\\') must contain a dash (\\'-\\'). Argument provided was \\'' +
String(name) + '\\'.');\n }\n // prevent registering reserved names\n i
f (isReservedTag(name)) {\n throw new Error('Failed to execute \\'registerE
lement\\' on \\'Document\\': Registration failed for type \\'' + String(name) +
'\\'. The type name is invalid.');\n }\n // elements may only be registere
d once\n if (getRegisteredDefinition(name)) {\n throw new Error('Duplica
teDefinitionError: a type with name \\'' + String(name) + '\\' is already regist
ered');\n }\n // must have a prototype, default to an extension of HTMLEle
ment\n // TODO(sjmiles): probably should throw if no prototype, check spec\n
if (!definition.prototype) {\n // TODO(sjmiles): replace with more appro
priate error (EricB can probably\n // offer guidance)\n throw new Erro
r('Options missing required prototype property');\n }\n // record name\n
definition.__name = name.toLowerCase();\n // ensure a lifecycle object so w
e don't have to null test it\n definition.lifecycle = definition.lifecycle ||
{};\n // build a list of ancestral custom elements (for native base detectio
n)\n // TODO(sjmiles): we used to need to store this, but current code only\n
// uses it in 'resolveTagName': it should probably be inlined\n definitio
n.ancestry = ancestry(definition.extends);\n // extensions of native speciali
zations of HTMLElement require localName\n // to remain native, and use secon
dary 'is' specifier for extension type\n resolveTagName(definition);\n //
some platforms require modifications to the user-supplied prototype\n // chai
n\n resolvePrototypeChain(definition);\n // overrides to implement attribu
teChanged callback\n overrideAttributeApi(definition.prototype);\n // 7.1.
5: Register the DEFINITION with DOCUMENT\n registerDefinition(definition.__na
me, definition);\n // 7.1.7. Run custom element constructor generation algori
thm with PROTOTYPE\n // 7.1.8. Return the output of the previous step.\n d
efinition.ctor = generateConstructor(definition);\n definition.ctor.prototype
= definition.prototype;\n // force our .constructor to be our actual constru
ctor\n definition.prototype.constructor = definition.ctor;\n // if initial
parsing is complete\n if (scope.ready) {\n // upgrade any pre-existing
nodes of this type\n scope.upgradeDocumentTree(document);\n }\n retur
n definition.ctor;\n }\n\n function isReservedTag(name) {\n for (var i = 0;
i < reservedTagList.length; i++) {\n if (name === reservedTagList[i]) {\n
return true;\n }\n }\n }\n\n var reservedTagList = [\n 'anno
tation-xml', 'color-profile', 'font-face', 'font-face-src',\n 'font-face-uri'
, 'font-face-format', 'font-face-name', 'missing-glyph'\n ];\n\n function ance
stry(extnds) {\n var extendee = getRegisteredDefinition(extnds);\n if (ext
endee) {\n return ancestry(extendee.extends).concat([extendee]);\n }\n
return [];\n }\n\n function resolveTagName(definition) {\n // if we are e
xplicitly extending something, that thing is our\n // baseTag, unless it repr
esents a custom component\n var baseTag = definition.extends;\n // if our
ancestry includes custom components, we only have a\n // baseTag if one of th
em does\n for (var i=0, a; (a=definition.ancestry[i]); i++) {\n baseTag
= a.is && a.tag;\n }\n // our tag is our baseTag, if it exists, and otherw
ise just our name\n definition.tag = baseTag || definition.__name;\n if (b
aseTag) {\n // if there is a base tag, use secondary 'is' specifier\n
definition.is = definition.__name;\n }\n }\n\n function resolvePrototypeCha
in(definition) {\n // if we don't support __proto__ we need to locate the nat
ive level\n // prototype for precise mixing in\n if (!Object.__proto__) {\
n // default prototype\n var nativePrototype = HTMLElement.prototype;\
n // work out prototype when using type-extension\n if (definition.is)
{\n var inst = document.createElement(definition.tag);\n var expe
ctedPrototype = Object.getPrototypeOf(inst);\n // only set nativePrototyp
e if it will actually appear in the definition's chain\n if (expectedProt
otype === definition.prototype) {\n nativePrototype = expectedPrototype
;\n }\n }\n // ensure __proto__ reference is installed at each
point on the prototype\n // chain.\n // NOTE: On platforms without __p
roto__, a mixin strategy is used instead\n // of prototype swizzling. In th
is case, this generated __proto__ provides\n // limited support for prototy
pe traversal.\n var proto = definition.prototype, ancestor;\n while (p
roto && (proto !== nativePrototype)) {\n ancestor = Object.getPrototypeOf
(proto);\n proto.__proto__ = ancestor;\n proto = ancestor;\n
}\n // cache this in case of mixin\n definition.native = nativePrototy
pe;\n }\n }\n\n // SECTION 4\n\n function instantiate(definition) {\n /
/ 4.a.1. Create a new object that implements PROTOTYPE\n // 4.a.2. Let ELEMEN
T by this new object\n //\n // the custom element instantiation algorithm
must also ensure that the\n // output is a valid DOM element with the proper
wrapper in place.\n //\n return upgrade(domCreateElement(definition.tag),
definition);\n }\n\n function upgrade(element, definition) {\n // some defi
nitions specify an 'is' attribute\n if (definition.is) {\n element.setAt
tribute('is', definition.is);\n }\n // make 'element' implement definition
.prototype\n implement(element, definition);\n // flag as upgraded\n el
ement.__upgraded__ = true;\n // lifecycle management\n created(element);\n
// attachedCallback fires in tree order, call before recursing\n scope.in
sertedNode(element);\n // there should never be a shadow root on element at t
his point\n scope.upgradeSubtree(element);\n // OUTPUT\n return element
;\n }\n\n function implement(element, definition) {\n // prototype swizzlin
g is best\n if (Object.__proto__) {\n element.__proto__ = definition.pro
totype;\n } else {\n // where above we can re-acquire inPrototype via\n
// getPrototypeOf(Element), we cannot do so when\n // we use mixin, so
we install a magic reference\n customMixin(element, definition.prototype,
definition.native);\n element.__proto__ = definition.prototype;\n }\n }
\n\n function customMixin(inTarget, inSrc, inNative) {\n // TODO(sjmiles): '
used' allows us to only copy the 'youngest' version of\n // any property. Thi
s set should be precalculated. We also need to\n // consider this for support
ing 'super'.\n var used = {};\n // start with inSrc\n var p = inSrc;\n
// The default is HTMLElement.prototype, so we add a test to avoid mixing in\
n // native prototypes\n while (p !== inNative && p !== HTMLElement.protot
ype) {\n var keys = Object.getOwnPropertyNames(p);\n for (var i=0, k;
k=keys[i]; i++) {\n if (!used[k]) {\n Object.defineProperty(inTa
rget, k,\n Object.getOwnPropertyDescriptor(p, k));\n used[
k] = 1;\n }\n }\n p = Object.getPrototypeOf(p);\n }\n }\n\n
function created(element) {\n // invoke createdCallback\n if (element.cr
eatedCallback) {\n element.createdCallback();\n }\n }\n\n // attribute
watching\n\n function overrideAttributeApi(prototype) {\n // overrides to i
mplement callbacks\n // TODO(sjmiles): should support access via .attributes
NamedNodeMap\n // TODO(sjmiles): preserves user defined overrides, if any\n
if (prototype.setAttribute._polyfilled) {\n return;\n }\n var setAt
tribute = prototype.setAttribute;\n prototype.setAttribute = function(name, v
alue) {\n changeAttribute.call(this, name, value, setAttribute);\n }\n
var removeAttribute = prototype.removeAttribute;\n prototype.removeAttribut
e = function(name) {\n changeAttribute.call(this, name, null, removeAttribu
te);\n }\n prototype.setAttribute._polyfilled = true;\n }\n\n // https:/
/dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/\n // index.html#dfn-att
ribute-changed-callback\n function changeAttribute(name, value, operation) {\n
name = name.toLowerCase();\n var oldValue = this.getAttribute(name);\n
operation.apply(this, arguments);\n var newValue = this.getAttribute(name);\n
if (this.attributeChangedCallback\n && (newValue !== oldValue)) {\n
this.attributeChangedCallback(name, oldValue, newValue);\n }\n }\n\n //
element registry (maps tag names to definitions)\n\n var registry = {};\n\n f
unction getRegisteredDefinition(name) {\n if (name) {\n return registry[
name.toLowerCase()];\n }\n }\n\n function registerDefinition(name, definiti
on) {\n registry[name] = definition;\n }\n\n function generateConstructor(d
efinition) {\n return function() {\n return instantiate(definition);\n
};\n }\n\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n function
createElementNS(namespace, tag, typeExtension) {\n // NOTE: we do not support
non-HTML elements,\n // just call createElementNS for non HTML Elements\n
if (namespace === HTML_NAMESPACE) {\n return createElement(tag, typeExtens
ion);\n } else {\n return domCreateElementNS(namespace, tag);\n }\n
}\n\n function createElement(tag, typeExtension) {\n // TODO(sjmiles): ignor
e 'tag' when using 'typeExtension', we could\n // error check it, or perhaps
there should only ever be one argument\n var definition = getRegisteredDefini
tion(typeExtension || tag);\n if (definition) {\n if (tag == definition.
tag && typeExtension == definition.is) {\n return new definition.ctor();\
n }\n // Handle empty string for type extension.\n if (!typeExten
sion && !definition.is) {\n return new definition.ctor();\n }\n }
\n\n if (typeExtension) {\n var element = createElement(tag);\n ele
ment.setAttribute('is', typeExtension);\n return element;\n }\n var e
lement = domCreateElement(tag);\n // Custom tags should be HTMLElements even
if not upgraded.\n if (tag.indexOf('-') >= 0) {\n implement(element, HTM
LElement);\n }\n return element;\n }\n\n function upgradeElement(element
) {\n if (!element.__upgraded__ && (element.nodeType === Node.ELEMENT_NODE))
{\n var is = element.getAttribute('is');\n var definition = getRegiste
redDefinition(is || element.localName);\n if (definition) {\n if (is
&& definition.tag == element.localName) {\n return upgrade(element, de
finition);\n } else if (!is && !definition.extends) {\n return u
pgrade(element, definition);\n }\n }\n }\n }\n\n function clone
Node(deep) {\n // call original clone\n var n = domCloneNode.call(this, de
ep);\n // upgrade the element and subtree\n scope.upgradeAll(n);\n // r
eturn the clone\n return n;\n }\n // capture native createElement before we
override it\n\n var domCreateElement = document.createElement.bind(document);\
n var domCreateElementNS = document.createElementNS.bind(document);\n\n // cap
ture native cloneNode before we override it\n\n var domCloneNode = Node.prototy
pe.cloneNode;\n\n // exports\n\n document.registerElement = register;\n docum
ent.createElement = createElement; // override\n document.createElementNS = cre
ateElementNS; // override\n Node.prototype.cloneNode = cloneNode; // override\n
\n scope.registry = registry;\n\n /**\n * Upgrade an element to a custom ele
ment. Upgrading an element\n * causes the custom prototype to be applied, an `
is` attribute\n * to be attached (as needed), and invocation of the `readyCall
back`.\n * `upgrade` does nothing if the element is already upgraded, or\n *
if it matches no registered custom tag name.\n *\n * @method ugprade\n *
@param {Element} element The element to upgrade.\n * @return {Element} The upg
raded element.\n */\n scope.upgrade = upgradeElement;\n}\n\n// Create a custo
m 'instanceof'. This is necessary when CustomElements\n// are implemented via a
mixin strategy, as for example on IE10.\nvar isInstance;\nif (!Object.__proto__
&& !useNative) {\n isInstance = function(obj, ctor) {\n var p = obj;\n wh
ile (p) {\n // NOTE: this is not technically correct since we're not checki
ng if\n // an object is an instance of a constructor; however, this should\
n // be good enough for the mixin strategy.\n if (p === ctor.prototype
) {\n return true;\n }\n p = p.__proto__;\n }\n return fa
lse;\n }\n} else {\n isInstance = function(obj, base) {\n return obj instan
ceof base;\n }\n}\n\n// exports\nscope.instanceof = isInstance;\nscope.reserved
TagList = reservedTagList;\n\n// bc\ndocument.register = document.registerElemen
t;\n\nscope.hasNative = hasNative;\nscope.useNative = useNative;\n\n})(window.Cu
stomElements);\n", |
165 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n\n(function(scope) {\n\n// import\n\nvar IMPORT_LINK_TYPE =
scope.IMPORT_LINK_TYPE;\n\n// highlander object for parsing a document tree\n\n
var parser = {\n selectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ],\n
map: {\n link: 'parseLink'\n },\n parse: function(inDocument) {\n if (
!inDocument.__parsed) {\n // only parse once\n inDocument.__parsed = t
rue;\n // all parsable elements in inDocument (depth-first pre-order traver
sal)\n var elts = inDocument.querySelectorAll(parser.selectors);\n //
for each parsable node type, call the mapped parsing method\n forEach(elts,
function(e) {\n parser[parser.map[e.localName]](e);\n });\n //
upgrade all upgradeable static elements, anything dynamically\n // created
should be caught by observer\n CustomElements.upgradeDocument(inDocument);
\n // observe document for dom changes\n CustomElements.observeDocumen
t(inDocument);\n }\n },\n parseLink: function(linkElt) {\n // imports\n
if (isDocumentLink(linkElt)) {\n this.parseImport(linkElt);\n }\n },
\n parseImport: function(linkElt) {\n if (linkElt.import) {\n parser.pa
rse(linkElt.import);\n }\n }\n};\n\nfunction isDocumentLink(inElt) {\n retu
rn (inElt.localName === 'link'\n && inElt.getAttribute('rel') === IMPORT_LI
NK_TYPE);\n}\n\nvar forEach = Array.prototype.forEach.call.bind(Array.prototype.
forEach);\n\n// exports\n\nscope.parser = parser;\nscope.IMPORT_LINK_TYPE = IMPO
RT_LINK_TYPE;\n\n})(window.CustomElements);", | 163 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n//
import\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n\n// highlander object
for parsing a document tree\n\nvar parser = {\n selectors: [\n 'link[rel='
+ IMPORT_LINK_TYPE + ']'\n ],\n map: {\n link: 'parseLink'\n },\n parse:
function(inDocument) {\n if (!inDocument.__parsed) {\n // only parse onc
e\n inDocument.__parsed = true;\n // all parsable elements in inDocume
nt (depth-first pre-order traversal)\n var elts = inDocument.querySelectorA
ll(parser.selectors);\n // for each parsable node type, call the mapped par
sing method\n forEach(elts, function(e) {\n parser[parser.map[e.loca
lName]](e);\n });\n // upgrade all upgradeable static elements, anythi
ng dynamically\n // created should be caught by observer\n CustomEleme
nts.upgradeDocument(inDocument);\n // observe document for dom changes\n
CustomElements.observeDocument(inDocument);\n }\n },\n parseLink: functi
on(linkElt) {\n // imports\n if (isDocumentLink(linkElt)) {\n this.pa
rseImport(linkElt);\n }\n },\n parseImport: function(linkElt) {\n if (li
nkElt.import) {\n parser.parse(linkElt.import);\n }\n }\n};\n\nfunction
isDocumentLink(inElt) {\n return (inElt.localName === 'link'\n && inElt.g
etAttribute('rel') === IMPORT_LINK_TYPE);\n}\n\nvar forEach = Array.prototype.fo
rEach.call.bind(Array.prototype.forEach);\n\n// exports\n\nscope.parser = parser
;\nscope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\n\n})(window.CustomElements);", |
166 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of
this source code is governed by a BSD-style\n * license that can be found in the
LICENSE file.\n */\n(function(scope){\n\n// bootstrap parsing\nfunction bootstr
ap() {\n // parse document\n CustomElements.parser.parse(document);\n // one
more pass before register is 'live'\n CustomElements.upgradeDocument(document);
\n // choose async\n var async = window.Platform && Platform.endOfMicrotask ?
\n Platform.endOfMicrotask :\n setTimeout;\n async(function() {\n // s
et internal 'ready' flag, now document.registerElement will trigger \n // syn
chronous upgrades\n CustomElements.ready = true;\n // capture blunt profil
ing data\n CustomElements.readyTime = Date.now();\n if (window.HTMLImports
) {\n CustomElements.elapsed = CustomElements.readyTime - HTMLImports.ready
Time;\n }\n // notify the system that we are bootstrapped\n document.di
spatchEvent(\n new CustomEvent('WebComponentsReady', {bubbles: true})\n
);\n\n // install upgrade hook if HTMLImports are available\n if (window.H
TMLImports) {\n HTMLImports.__importsParsingHook = function(elt) {\n
CustomElements.parser.parse(elt.import);\n }\n }\n });\n}\n\n// Custom
Event shim for IE\nif (typeof window.CustomEvent !== 'function') {\n window.Cus
tomEvent = function(inType) {\n var e = document.createEvent('HTMLEvents');\n
e.initEvent(inType, true, true);\n return e;\n };\n}\n\n// When loading
at readyState complete time (or via flag), boot custom elements\n// immediately.
\n// If relevant, HTMLImports must already be loaded.\nif (document.readyState =
== 'complete' || scope.flags.eager) {\n bootstrap();\n// When loading at readyS
tate interactive time, bootstrap only if HTMLImports\n// are not pending. Also a
void IE as the semantics of this state are unreliable.\n} else if (document.read
yState === 'interactive' && !window.attachEvent &&\n (!window.HTMLImports ||
window.HTMLImports.ready)) {\n bootstrap();\n// When loading at other readyStat
es, wait for the appropriate DOM event to \n// bootstrap.\n} else {\n var loadE
vent = window.HTMLImports && !HTMLImports.ready ?\n 'HTMLImportsLoaded' : '
DOMContentLoaded';\n window.addEventListener(loadEvent, bootstrap);\n}\n\n})(wi
ndow.CustomElements);\n", | 164 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n(function(scope){\n\n// boo
tstrap parsing\nfunction bootstrap() {\n // parse document\n CustomElements.pa
rser.parse(document);\n // one more pass before register is 'live'\n CustomEle
ments.upgradeDocument(document);\n // choose async\n var async = window.Platfo
rm && Platform.endOfMicrotask ? \n Platform.endOfMicrotask :\n setTimeout;
\n async(function() {\n // set internal 'ready' flag, now document.registerE
lement will trigger \n // synchronous upgrades\n CustomElements.ready = tr
ue;\n // capture blunt profiling data\n CustomElements.readyTime = Date.no
w();\n if (window.HTMLImports) {\n CustomElements.elapsed = CustomElemen
ts.readyTime - HTMLImports.readyTime;\n }\n // notify the system that we a
re bootstrapped\n document.dispatchEvent(\n new CustomEvent('WebComponen
tsReady', {bubbles: true})\n );\n\n // install upgrade hook if HTMLImports
are available\n if (window.HTMLImports) {\n HTMLImports.__importsParsin
gHook = function(elt) {\n CustomElements.parser.parse(elt.import);\n
}\n }\n });\n}\n\n// CustomEvent shim for IE\nif (typeof window.CustomEvent
!== 'function') {\n window.CustomEvent = function(inType, params) {\n param
s = params || {};\n var e = document.createEvent('CustomEvent');\n e.initC
ustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.d
etail);\n return e;\n };\n window.CustomEvent.prototype = window.Event.prot
otype;\n}\n\n// When loading at readyState complete time (or via flag), boot cus
tom elements\n// immediately.\n// If relevant, HTMLImports must already be loade
d.\nif (document.readyState === 'complete' || scope.flags.eager) {\n bootstrap(
);\n// When loading at readyState interactive time, bootstrap only if HTMLImport
s\n// are not pending. Also avoid IE as the semantics of this state are unreliab
le.\n} else if (document.readyState === 'interactive' && !window.attachEvent &&\
n (!window.HTMLImports || window.HTMLImports.ready)) {\n bootstrap();\n// Wh
en loading at other readyStates, wait for the appropriate DOM event to \n// boot
strap.\n} else {\n var loadEvent = window.HTMLImports && !HTMLImports.ready ?\n
'HTMLImportsLoaded' : 'DOMContentLoaded';\n window.addEventListener(loadE
vent, bootstrap);\n}\n\n})(window.CustomElements);\n", |
167 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function() {\n\nif (wind
ow.ShadowDOMPolyfill) {\n\n // ensure wrapped inputs for these functions\n var
fns = ['upgradeAll', 'upgradeSubtree', 'observeDocument',\n 'upgradeDocume
nt'];\n\n // cache originals\n var original = {};\n fns.forEach(function(fn)
{\n original[fn] = CustomElements[fn];\n });\n\n // override\n fns.forEach
(function(fn) {\n CustomElements[fn] = function(inNode) {\n return origi
nal[fn](wrap(inNode));\n };\n });\n\n}\n\n})();\n", | 165 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function() {\n\nif (wind
ow.ShadowDOMPolyfill) {\n\n // ensure wrapped inputs for these functions\n var
fns = ['upgradeAll', 'upgradeSubtree', 'observeDocument',\n 'upgradeDocume
nt'];\n\n // cache originals\n var original = {};\n fns.forEach(function(fn)
{\n original[fn] = CustomElements[fn];\n });\n\n // override\n fns.forEach
(function(fn) {\n CustomElements[fn] = function(inNode) {\n return origi
nal[fn](wrap(inNode));\n };\n });\n\n}\n\n})();\n", |
168 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var
endOfMicrotask = scope.endOfMicrotask;\n\n // Generic url loader\n function L
oader(regex) {\n this.cache = Object.create(null);\n this.map = Object.cre
ate(null);\n this.requests = 0;\n this.regex = regex;\n }\n Loader.proto
type = {\n\n // TODO(dfreedm): there may be a better factoring here\n // e
xtract absolute urls from the text (full of relative urls)\n extractUrls: fun
ction(text, base) {\n var matches = [];\n var matched, u;\n while
((matched = this.regex.exec(text))) {\n u = new URL(matched[1], base);\n
matches.push({matched: matched[0], url: u.href});\n }\n return
matches;\n },\n // take a text blob, a root url, and a callback and load
all the urls found within the text\n // returns a map of absolute url to text
\n process: function(text, root, callback) {\n var matches = this.extrac
tUrls(text, root);\n\n // every call to process returns all the text this l
oader has ever received\n var done = callback.bind(null, this.map);\n
this.fetch(matches, done);\n },\n // build a mapping of url -> text from m
atches\n fetch: function(matches, callback) {\n var inflight = matches.l
ength;\n\n // return early if there is no fetching to be done\n if (!i
nflight) {\n return callback();\n }\n\n // wait for all subrequ
ests to return\n var done = function() {\n if (--inflight === 0) {\n
callback();\n }\n };\n\n // start fetching all subreq
uests\n var m, req, url;\n for (var i = 0; i < inflight; i++) {\n
m = matches[i];\n url = m.url;\n req = this.cache[url];\n
// if this url has already been requested, skip requesting it again\n i
f (!req) {\n req = this.xhr(url);\n req.match = m;\n
this.cache[url] = req;\n }\n // wait for the request to process it
s subrequests\n req.wait(done);\n }\n },\n handleXhr: function
(request) {\n var match = request.match;\n var url = match.url;\n\n
// handle errors with an empty string\n var response = request.response
|| request.responseText || '';\n this.map[url] = response;\n this.fetc
h(this.extractUrls(response, url), request.resolve);\n },\n xhr: function(
url) {\n this.requests++;\n var request = new XMLHttpRequest();\n
request.open('GET', url, true);\n request.send();\n request.onerror =
request.onload = this.handleXhr.bind(this, request);\n\n // queue of tasks
to run after XHR returns\n request.pending = [];\n request.resolve =
function() {\n var pending = request.pending;\n for(var i = 0; i <
pending.length; i++) {\n pending[i]();\n }\n request.pen
ding = null;\n };\n\n // if we have already resolved, pending is null,
async call the callback\n request.wait = function(fn) {\n if (reque
st.pending) {\n request.pending.push(fn);\n } else {\n
endOfMicrotask(fn);\n }\n };\n\n return request;\n }\n };\n
\n scope.Loader = Loader;\n})(window.Platform);\n", | 166 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var
endOfMicrotask = scope.endOfMicrotask;\n\n // Generic url loader\n function L
oader(regex) {\n this.cache = Object.create(null);\n this.map = Object.cre
ate(null);\n this.requests = 0;\n this.regex = regex;\n }\n Loader.proto
type = {\n\n // TODO(dfreedm): there may be a better factoring here\n // e
xtract absolute urls from the text (full of relative urls)\n extractUrls: fun
ction(text, base) {\n var matches = [];\n var matched, u;\n while
((matched = this.regex.exec(text))) {\n u = new URL(matched[1], base);\n
matches.push({matched: matched[0], url: u.href});\n }\n return
matches;\n },\n // take a text blob, a root url, and a callback and load
all the urls found within the text\n // returns a map of absolute url to text
\n process: function(text, root, callback) {\n var matches = this.extrac
tUrls(text, root);\n\n // every call to process returns all the text this l
oader has ever received\n var done = callback.bind(null, this.map);\n
this.fetch(matches, done);\n },\n // build a mapping of url -> text from m
atches\n fetch: function(matches, callback) {\n var inflight = matches.l
ength;\n\n // return early if there is no fetching to be done\n if (!i
nflight) {\n return callback();\n }\n\n // wait for all subrequ
ests to return\n var done = function() {\n if (--inflight === 0) {\n
callback();\n }\n };\n\n // start fetching all subreq
uests\n var m, req, url;\n for (var i = 0; i < inflight; i++) {\n
m = matches[i];\n url = m.url;\n req = this.cache[url];\n
// if this url has already been requested, skip requesting it again\n i
f (!req) {\n req = this.xhr(url);\n req.match = m;\n
this.cache[url] = req;\n }\n // wait for the request to process it
s subrequests\n req.wait(done);\n }\n },\n handleXhr: function
(request) {\n var match = request.match;\n var url = match.url;\n\n
// handle errors with an empty string\n var response = request.response
|| request.responseText || '';\n this.map[url] = response;\n this.fetc
h(this.extractUrls(response, url), request.resolve);\n },\n xhr: function(
url) {\n this.requests++;\n var request = new XMLHttpRequest();\n
request.open('GET', url, true);\n request.send();\n request.onerror =
request.onload = this.handleXhr.bind(this, request);\n\n // queue of tasks
to run after XHR returns\n request.pending = [];\n request.resolve =
function() {\n var pending = request.pending;\n for(var i = 0; i <
pending.length; i++) {\n pending[i]();\n }\n request.pen
ding = null;\n };\n\n // if we have already resolved, pending is null,
async call the callback\n request.wait = function(fn) {\n if (reque
st.pending) {\n request.pending.push(fn);\n } else {\n
endOfMicrotask(fn);\n }\n };\n\n return request;\n }\n };\n
\n scope.Loader = Loader;\n})(window.Platform);\n", |
169 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\nvar
urlResolver = scope.urlResolver;\nvar Loader = scope.Loader;\n\nfunction StyleR
esolver() {\n this.loader = new Loader(this.regex);\n}\nStyleResolver.prototype
= {\n regex: /@import\\s+(?:url)?[\"'\\(]*([^'\"\\)]*)['\"\\)]*;/g,\n // Recu
rsively replace @imports with the text at that url\n resolve: function(text, ur
l, callback) {\n var done = function(map) {\n callback(this.flatten(text
, url, map));\n }.bind(this);\n this.loader.process(text, url, done);\n }
,\n // resolve the textContent of a style node\n resolveNode: function(style,
url, callback) {\n var text = style.textContent;\n var done = function(tex
t) {\n style.textContent = text;\n callback(style);\n };\n this.
resolve(text, url, done);\n },\n // flatten all the @imports to text\n flatte
n: function(text, base, map) {\n var matches = this.loader.extractUrls(text,
base);\n var match, url, intermediate;\n for (var i = 0; i < matches.lengt
h; i++) {\n match = matches[i];\n url = match.url;\n // resolve a
ny css text to be relative to the importer, keep absolute url\n intermediat
e = urlResolver.resolveCssText(map[url], url, true);\n // flatten intermedi
ate @imports\n intermediate = this.flatten(intermediate, base, map);\n
text = text.replace(match.matched, intermediate);\n }\n return text;\n }
,\n loadStyles: function(styles, base, callback) {\n var loaded=0, l = style
s.length;\n // called in the context of the style\n function loadedStyle(s
tyle) {\n loaded++;\n if (loaded === l && callback) {\n callbac
k();\n }\n }\n for (var i=0, s; (i<l) && (s=styles[i]); i++) {\n
this.resolveNode(s, base, loadedStyle);\n }\n }\n};\n\nvar styleResolver =
new StyleResolver();\n\n// exports\nscope.styleResolver = styleResolver;\n\n})(w
indow.Platform);\n", | 167 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\nvar
urlResolver = scope.urlResolver;\nvar Loader = scope.Loader;\n\nfunction StyleR
esolver() {\n this.loader = new Loader(this.regex);\n}\nStyleResolver.prototype
= {\n regex: /@import\\s+(?:url)?[\"'\\(]*([^'\"\\)]*)['\"\\)]*;/g,\n // Recu
rsively replace @imports with the text at that url\n resolve: function(text, ur
l, callback) {\n var done = function(map) {\n callback(this.flatten(text
, url, map));\n }.bind(this);\n this.loader.process(text, url, done);\n }
,\n // resolve the textContent of a style node\n resolveNode: function(style,
url, callback) {\n var text = style.textContent;\n var done = function(tex
t) {\n style.textContent = text;\n callback(style);\n };\n this.
resolve(text, url, done);\n },\n // flatten all the @imports to text\n flatte
n: function(text, base, map) {\n var matches = this.loader.extractUrls(text,
base);\n var match, url, intermediate;\n for (var i = 0; i < matches.lengt
h; i++) {\n match = matches[i];\n url = match.url;\n // resolve a
ny css text to be relative to the importer, keep absolute url\n intermediat
e = urlResolver.resolveCssText(map[url], url, true);\n // flatten intermedi
ate @imports\n intermediate = this.flatten(intermediate, base, map);\n
text = text.replace(match.matched, intermediate);\n }\n return text;\n }
,\n loadStyles: function(styles, base, callback) {\n var loaded=0, l = style
s.length;\n // called in the context of the style\n function loadedStyle(s
tyle) {\n loaded++;\n if (loaded === l && callback) {\n callbac
k();\n }\n }\n for (var i=0, s; (i<l) && (s=styles[i]); i++) {\n
this.resolveNode(s, base, loadedStyle);\n }\n }\n};\n\nvar styleResolver =
new StyleResolver();\n\n// exports\nscope.styleResolver = styleResolver;\n\n})(w
indow.Platform);\n", |
170 "// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n//
This code may only be used under the BSD style license found at http://polymer.
github.io/LICENSE.txt\n// The complete set of authors may be found at http://pol
ymer.github.io/AUTHORS.txt\n// The complete set of contributors may be found at
http://polymer.github.io/CONTRIBUTORS.txt\n// Code distributed by Google as part
of the polymer project is also\n// subject to an additional IP rights grant fou
nd at http://polymer.github.io/PATENTS.txt\n\n(function(global) {\n 'use strict
';\n\n var filter = Array.prototype.filter.call.bind(Array.prototype.filter);\n
\n function getTreeScope(node) {\n while (node.parentNode) {\n node = n
ode.parentNode;\n }\n\n return typeof node.getElementById === 'function' ?
node : null;\n }\n\n Node.prototype.bind = function(name, observable) {\n
console.error('Unhandled binding to Node: ', this, name, observable);\n };\n\n
Node.prototype.bindFinished = function() {};\n\n function updateBindings(node,
name, binding) {\n var bindings = node.bindings_;\n if (!bindings)\n
bindings = node.bindings_ = {};\n\n if (bindings[name])\n binding[name]
.close();\n\n return bindings[name] = binding;\n }\n\n function returnBindi
ng(node, name, binding) {\n return binding;\n }\n\n function sanitizeValue(
value) {\n return value == null ? '' : value;\n }\n\n function updateText(n
ode, value) {\n node.data = sanitizeValue(value);\n }\n\n function textBind
ing(node) {\n return function(value) {\n return updateText(node, value);
\n };\n }\n\n var maybeUpdateBindings = returnBinding;\n\n Object.definePr
operty(Platform, 'enableBindingsReflection', {\n get: function() {\n ret
urn maybeUpdateBindings === updateBindings;\n },\n set: function(enable) {
\n maybeUpdateBindings = enable ? updateBindings : returnBinding;\n re
turn enable;\n },\n configurable: true\n });\n\n Text.prototype.bind = f
unction(name, value, oneTime) {\n if (name !== 'textContent')\n return N
ode.prototype.bind.call(this, name, value, oneTime);\n\n if (oneTime)\n
return updateText(this, value);\n\n var observable = value;\n updateText(t
his, observable.open(textBinding(this)));\n return maybeUpdateBindings(this,
name, observable);\n }\n\n function updateAttribute(el, name, conditional, val
ue) {\n if (conditional) {\n if (value)\n el.setAttribute(name, '
');\n else\n el.removeAttribute(name);\n return;\n }\n\n
el.setAttribute(name, sanitizeValue(value));\n }\n\n function attributeBinding
(el, name, conditional) {\n return function(value) {\n updateAttribute(e
l, name, conditional, value);\n };\n }\n\n Element.prototype.bind = functio
n(name, value, oneTime) {\n var conditional = name[name.length - 1] == '?';\n
if (conditional) {\n this.removeAttribute(name);\n name = name.sli
ce(0, -1);\n }\n\n if (oneTime)\n return updateAttribute(this, name,
conditional, value);\n\n\n var observable = value;\n updateAttribute(this,
name, conditional,\n observable.open(attributeBinding(this, name, condit
ional)));\n\n return maybeUpdateBindings(this, name, observable);\n };\n\n
var checkboxEventType;\n (function() {\n // Attempt to feature-detect which
event (change or click) is fired first\n // for checkboxes.\n var div = do
cument.createElement('div');\n var checkbox = div.appendChild(document.create
Element('input'));\n checkbox.setAttribute('type', 'checkbox');\n var firs
t;\n var count = 0;\n checkbox.addEventListener('click', function(e) {\n
count++;\n first = first || 'click';\n });\n checkbox.addEventLis
tener('change', function() {\n count++;\n first = first || 'change';\n
});\n\n var event = document.createEvent('MouseEvent');\n event.initMo
useEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false,\n false, fa
lse, false, 0, null);\n checkbox.dispatchEvent(event);\n // WebKit/Blink d
on't fire the change event if the element is outside the\n // document, so as
sume 'change' for that case.\n checkboxEventType = count == 1 ? 'change' : fi
rst;\n })();\n\n function getEventForInputType(element) {\n switch (element
.type) {\n case 'checkbox':\n return checkboxEventType;\n case
'radio':\n case 'select-multiple':\n case 'select-one':\n retur
n 'change';\n case 'range':\n if (/Trident|MSIE/.test(navigator.user
Agent))\n return 'change';\n default:\n return 'input';\n
}\n }\n\n function updateInput(input, property, value, santizeFn) {\n inp
ut[property] = (santizeFn || sanitizeValue)(value);\n }\n\n function inputBind
ing(input, property, santizeFn) {\n return function(value) {\n return up
dateInput(input, property, value, santizeFn);\n }\n }\n\n function noop() {
}\n\n function bindInputEvent(input, property, observable, postEventFn) {\n
var eventType = getEventForInputType(input);\n\n function eventHandler() {\n
observable.setValue(input[property]);\n observable.discardChanges();\n
(postEventFn || noop)(input);\n Platform.performMicrotaskCheckpoint()
;\n }\n input.addEventListener(eventType, eventHandler);\n\n return {\n
close: function() {\n input.removeEventListener(eventType, eventHan
dler);\n observable.close();\n },\n\n observable_: observable\n
}\n }\n\n function booleanSanitize(value) {\n return Boolean(value);\n
}\n\n // |element| is assumed to be an HTMLInputElement with |type| == 'radio'
.\n // Returns an array containing all radio buttons other than |element| that\
n // have the same |name|, either in the form that |element| belongs to or,\n
// if no form, in the document tree to which |element| belongs.\n //\n // This
implementation is based upon the HTML spec definition of a\n // \"radio button
group\":\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/nu
mber-state.html#radio-button-group\n //\n function getAssociatedRadioButtons(e
lement) {\n if (element.form) {\n return filter(element.form.elements, f
unction(el) {\n return el != element &&\n el.tagName == 'INPUT
' &&\n el.type == 'radio' &&\n el.name == element.name;\n
});\n } else {\n var treeScope = getTreeScope(element);\n if (
!treeScope)\n return [];\n var radios = treeScope.querySelectorAll(\
n 'input[type=\"radio\"][name=\"' + element.name + '\"]');\n retur
n filter(radios, function(el) {\n return el != element && !el.form;\n
});\n }\n }\n\n function checkedPostEvent(input) {\n // Only the radio
button that is getting checked gets an event. We\n // therefore find all the
associated radio buttons and update their\n // check binding manually.\n
if (input.tagName === 'INPUT' &&\n input.type === 'radio') {\n getAs
sociatedRadioButtons(input).forEach(function(radio) {\n var checkedBindin
g = radio.bindings_.checked;\n if (checkedBinding) {\n // Set th
e value directly to avoid an infinite call stack.\n checkedBinding.obse
rvable_.setValue(false);\n }\n });\n }\n }\n\n HTMLInputElement
.prototype.bind = function(name, value, oneTime) {\n if (name !== 'value' &&
name !== 'checked')\n return HTMLElement.prototype.bind.call(this, name, va
lue, oneTime);\n\n this.removeAttribute(name);\n var sanitizeFn = name ==
'checked' ? booleanSanitize : sanitizeValue;\n var postEventFn = name == 'che
cked' ? checkedPostEvent : noop;\n\n if (oneTime)\n return updateInput(t
his, name, value, sanitizeFn);\n\n\n var observable = value;\n var binding
= bindInputEvent(this, name, observable, postEventFn);\n updateInput(this, n
ame,\n observable.open(inputBinding(this, name, sanitizeFn)),\n
sanitizeFn);\n\n // Checkboxes may need to update bindings of o
ther checkboxes.\n return updateBindings(this, name, binding);\n }\n\n HTML
TextAreaElement.prototype.bind = function(name, value, oneTime) {\n if (name
!== 'value')\n return HTMLElement.prototype.bind.call(this, name, value, on
eTime);\n\n this.removeAttribute('value');\n\n if (oneTime)\n return
updateInput(this, 'value', value);\n\n var observable = value;\n var bindi
ng = bindInputEvent(this, 'value', observable);\n updateInput(this, 'value',\
n observable.open(inputBinding(this, 'value', sanitizeValue)));\n
return maybeUpdateBindings(this, name, binding);\n }\n\n function updateOp
tion(option, value) {\n var parentNode = option.parentNode;;\n var select;
\n var selectBinding;\n var oldValue;\n if (parentNode instanceof HTMLS
electElement &&\n parentNode.bindings_ &&\n parentNode.bindings_.v
alue) {\n select = parentNode;\n selectBinding = select.bindings_.valu
e;\n oldValue = select.value;\n }\n\n option.value = sanitizeValue(va
lue);\n\n if (select && select.value != oldValue) {\n selectBinding.obse
rvable_.setValue(select.value);\n selectBinding.observable_.discardChanges(
);\n Platform.performMicrotaskCheckpoint();\n }\n }\n\n function optio
nBinding(option) {\n return function(value) {\n updateOption(option, val
ue);\n }\n }\n\n HTMLOptionElement.prototype.bind = function(name, value, o
neTime) {\n if (name !== 'value')\n return HTMLElement.prototype.bind.ca
ll(this, name, value, oneTime);\n\n this.removeAttribute('value');\n\n if
(oneTime)\n return updateOption(this, value);\n\n var observable = value
;\n var binding = bindInputEvent(this, 'value', observable);\n updateOptio
n(this, observable.open(optionBinding(this)));\n return maybeUpdateBindings(t
his, name, binding);\n }\n\n HTMLSelectElement.prototype.bind = function(name,
value, oneTime) {\n if (name === 'selectedindex')\n name = 'selectedInd
ex';\n\n if (name !== 'selectedIndex' && name !== 'value')\n return HTML
Element.prototype.bind.call(this, name, value, oneTime);\n\n this.removeAttri
bute(name);\n\n if (oneTime)\n return updateInput(this, name, value);\n\
n var observable = value;\n var binding = bindInputEvent(this, name, obser
vable);\n updateInput(this, name,\n observable.open(inputBindi
ng(this, name)));\n\n // Option update events may need to access select bindi
ngs.\n return updateBindings(this, name, binding);\n }\n})(this);\n", | 168 "// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n//
This code may only be used under the BSD style license found at http://polymer.
github.io/LICENSE.txt\n// The complete set of authors may be found at http://pol
ymer.github.io/AUTHORS.txt\n// The complete set of contributors may be found at
http://polymer.github.io/CONTRIBUTORS.txt\n// Code distributed by Google as part
of the polymer project is also\n// subject to an additional IP rights grant fou
nd at http://polymer.github.io/PATENTS.txt\n\n(function(global) {\n 'use strict
';\n\n var filter = Array.prototype.filter.call.bind(Array.prototype.filter);\n
\n function getTreeScope(node) {\n while (node.parentNode) {\n node = n
ode.parentNode;\n }\n\n return typeof node.getElementById === 'function' ?
node : null;\n }\n\n Node.prototype.bind = function(name, observable) {\n
console.error('Unhandled binding to Node: ', this, name, observable);\n };\n\n
Node.prototype.bindFinished = function() {};\n\n function updateBindings(node,
name, binding) {\n var bindings = node.bindings_;\n if (!bindings)\n
bindings = node.bindings_ = {};\n\n if (bindings[name])\n binding[name]
.close();\n\n return bindings[name] = binding;\n }\n\n function returnBindi
ng(node, name, binding) {\n return binding;\n }\n\n function sanitizeValue(
value) {\n return value == null ? '' : value;\n }\n\n function updateText(n
ode, value) {\n node.data = sanitizeValue(value);\n }\n\n function textBind
ing(node) {\n return function(value) {\n return updateText(node, value);
\n };\n }\n\n var maybeUpdateBindings = returnBinding;\n\n Object.definePr
operty(Platform, 'enableBindingsReflection', {\n get: function() {\n ret
urn maybeUpdateBindings === updateBindings;\n },\n set: function(enable) {
\n maybeUpdateBindings = enable ? updateBindings : returnBinding;\n re
turn enable;\n },\n configurable: true\n });\n\n Text.prototype.bind = f
unction(name, value, oneTime) {\n if (name !== 'textContent')\n return N
ode.prototype.bind.call(this, name, value, oneTime);\n\n if (oneTime)\n
return updateText(this, value);\n\n var observable = value;\n updateText(t
his, observable.open(textBinding(this)));\n return maybeUpdateBindings(this,
name, observable);\n }\n\n function updateAttribute(el, name, conditional, val
ue) {\n if (conditional) {\n if (value)\n el.setAttribute(name, '
');\n else\n el.removeAttribute(name);\n return;\n }\n\n
el.setAttribute(name, sanitizeValue(value));\n }\n\n function attributeBinding
(el, name, conditional) {\n return function(value) {\n updateAttribute(e
l, name, conditional, value);\n };\n }\n\n Element.prototype.bind = functio
n(name, value, oneTime) {\n var conditional = name[name.length - 1] == '?';\n
if (conditional) {\n this.removeAttribute(name);\n name = name.sli
ce(0, -1);\n }\n\n if (oneTime)\n return updateAttribute(this, name,
conditional, value);\n\n\n var observable = value;\n updateAttribute(this,
name, conditional,\n observable.open(attributeBinding(this, name, condit
ional)));\n\n return maybeUpdateBindings(this, name, observable);\n };\n\n
var checkboxEventType;\n (function() {\n // Attempt to feature-detect which
event (change or click) is fired first\n // for checkboxes.\n var div = do
cument.createElement('div');\n var checkbox = div.appendChild(document.create
Element('input'));\n checkbox.setAttribute('type', 'checkbox');\n var firs
t;\n var count = 0;\n checkbox.addEventListener('click', function(e) {\n
count++;\n first = first || 'click';\n });\n checkbox.addEventLis
tener('change', function() {\n count++;\n first = first || 'change';\n
});\n\n var event = document.createEvent('MouseEvent');\n event.initMo
useEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false,\n false, fa
lse, false, 0, null);\n checkbox.dispatchEvent(event);\n // WebKit/Blink d
on't fire the change event if the element is outside the\n // document, so as
sume 'change' for that case.\n checkboxEventType = count == 1 ? 'change' : fi
rst;\n })();\n\n function getEventForInputType(element) {\n switch (element
.type) {\n case 'checkbox':\n return checkboxEventType;\n case
'radio':\n case 'select-multiple':\n case 'select-one':\n retur
n 'change';\n case 'range':\n if (/Trident|MSIE/.test(navigator.user
Agent))\n return 'change';\n default:\n return 'input';\n
}\n }\n\n function updateInput(input, property, value, santizeFn) {\n inp
ut[property] = (santizeFn || sanitizeValue)(value);\n }\n\n function inputBind
ing(input, property, santizeFn) {\n return function(value) {\n return up
dateInput(input, property, value, santizeFn);\n }\n }\n\n function noop() {
}\n\n function bindInputEvent(input, property, observable, postEventFn) {\n
var eventType = getEventForInputType(input);\n\n function eventHandler() {\n
observable.setValue(input[property]);\n observable.discardChanges();\n
(postEventFn || noop)(input);\n Platform.performMicrotaskCheckpoint()
;\n }\n input.addEventListener(eventType, eventHandler);\n\n return {\n
close: function() {\n input.removeEventListener(eventType, eventHan
dler);\n observable.close();\n },\n\n observable_: observable\n
}\n }\n\n function booleanSanitize(value) {\n return Boolean(value);\n
}\n\n // |element| is assumed to be an HTMLInputElement with |type| == 'radio'
.\n // Returns an array containing all radio buttons other than |element| that\
n // have the same |name|, either in the form that |element| belongs to or,\n
// if no form, in the document tree to which |element| belongs.\n //\n // This
implementation is based upon the HTML spec definition of a\n // \"radio button
group\":\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/nu
mber-state.html#radio-button-group\n //\n function getAssociatedRadioButtons(e
lement) {\n if (element.form) {\n return filter(element.form.elements, f
unction(el) {\n return el != element &&\n el.tagName == 'INPUT
' &&\n el.type == 'radio' &&\n el.name == element.name;\n
});\n } else {\n var treeScope = getTreeScope(element);\n if (
!treeScope)\n return [];\n var radios = treeScope.querySelectorAll(\
n 'input[type=\"radio\"][name=\"' + element.name + '\"]');\n retur
n filter(radios, function(el) {\n return el != element && !el.form;\n
});\n }\n }\n\n function checkedPostEvent(input) {\n // Only the radio
button that is getting checked gets an event. We\n // therefore find all the
associated radio buttons and update their\n // check binding manually.\n
if (input.tagName === 'INPUT' &&\n input.type === 'radio') {\n getAs
sociatedRadioButtons(input).forEach(function(radio) {\n var checkedBindin
g = radio.bindings_.checked;\n if (checkedBinding) {\n // Set th
e value directly to avoid an infinite call stack.\n checkedBinding.obse
rvable_.setValue(false);\n }\n });\n }\n }\n\n HTMLInputElement
.prototype.bind = function(name, value, oneTime) {\n if (name !== 'value' &&
name !== 'checked')\n return HTMLElement.prototype.bind.call(this, name, va
lue, oneTime);\n\n this.removeAttribute(name);\n var sanitizeFn = name ==
'checked' ? booleanSanitize : sanitizeValue;\n var postEventFn = name == 'che
cked' ? checkedPostEvent : noop;\n\n if (oneTime)\n return updateInput(t
his, name, value, sanitizeFn);\n\n\n var observable = value;\n var binding
= bindInputEvent(this, name, observable, postEventFn);\n updateInput(this, n
ame,\n observable.open(inputBinding(this, name, sanitizeFn)),\n
sanitizeFn);\n\n // Checkboxes may need to update bindings of o
ther checkboxes.\n return updateBindings(this, name, binding);\n }\n\n HTML
TextAreaElement.prototype.bind = function(name, value, oneTime) {\n if (name
!== 'value')\n return HTMLElement.prototype.bind.call(this, name, value, on
eTime);\n\n this.removeAttribute('value');\n\n if (oneTime)\n return
updateInput(this, 'value', value);\n\n var observable = value;\n var bindi
ng = bindInputEvent(this, 'value', observable);\n updateInput(this, 'value',\
n observable.open(inputBinding(this, 'value', sanitizeValue)));\n
return maybeUpdateBindings(this, name, binding);\n }\n\n function updateOp
tion(option, value) {\n var parentNode = option.parentNode;;\n var select;
\n var selectBinding;\n var oldValue;\n if (parentNode instanceof HTMLS
electElement &&\n parentNode.bindings_ &&\n parentNode.bindings_.v
alue) {\n select = parentNode;\n selectBinding = select.bindings_.valu
e;\n oldValue = select.value;\n }\n\n option.value = sanitizeValue(va
lue);\n\n if (select && select.value != oldValue) {\n selectBinding.obse
rvable_.setValue(select.value);\n selectBinding.observable_.discardChanges(
);\n Platform.performMicrotaskCheckpoint();\n }\n }\n\n function optio
nBinding(option) {\n return function(value) {\n updateOption(option, val
ue);\n }\n }\n\n HTMLOptionElement.prototype.bind = function(name, value, o
neTime) {\n if (name !== 'value')\n return HTMLElement.prototype.bind.ca
ll(this, name, value, oneTime);\n\n this.removeAttribute('value');\n\n if
(oneTime)\n return updateOption(this, value);\n\n var observable = value
;\n var binding = bindInputEvent(this, 'value', observable);\n updateOptio
n(this, observable.open(optionBinding(this)));\n return maybeUpdateBindings(t
his, name, binding);\n }\n\n HTMLSelectElement.prototype.bind = function(name,
value, oneTime) {\n if (name === 'selectedindex')\n name = 'selectedInd
ex';\n\n if (name !== 'selectedIndex' && name !== 'value')\n return HTML
Element.prototype.bind.call(this, name, value, oneTime);\n\n this.removeAttri
bute(name);\n\n if (oneTime)\n return updateInput(this, name, value);\n\
n var observable = value;\n var binding = bindInputEvent(this, name, obser
vable);\n updateInput(this, name,\n observable.open(inputBindi
ng(this, name)));\n\n // Option update events may need to access select bindi
ngs.\n return updateBindings(this, name, binding);\n }\n})(this);\n", |
171 "// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n//
This code may only be used under the BSD style license found at http://polymer.
github.io/LICENSE.txt\n// The complete set of authors may be found at http://pol
ymer.github.io/AUTHORS.txt\n// The complete set of contributors may be found at
http://polymer.github.io/CONTRIBUTORS.txt\n// Code distributed by Google as part
of the polymer project is also\n// subject to an additional IP rights grant fou
nd at http://polymer.github.io/PATENTS.txt\n\n(function(global) {\n 'use strict
';\n\n function assert(v) {\n if (!v)\n throw new Error('Assertion fail
ed');\n }\n\n var forEach = Array.prototype.forEach.call.bind(Array.prototype.
forEach);\n\n function getFragmentRoot(node) {\n var p;\n while (p = node
.parentNode) {\n node = p;\n }\n\n return node;\n }\n\n function se
archRefId(node, id) {\n if (!id)\n return;\n\n var ref;\n var sele
ctor = '#' + id;\n while (!ref) {\n node = getFragmentRoot(node);\n\n
if (node.protoContent_)\n ref = node.protoContent_.querySelector(selec
tor);\n else if (node.getElementById)\n ref = node.getElementById(id
);\n\n if (ref || !node.templateCreator_)\n break\n\n node = no
de.templateCreator_;\n }\n\n return ref;\n }\n\n function getInstanceRoo
t(node) {\n while (node.parentNode) {\n node = node.parentNode;\n }\n
return node.templateCreator_ ? node : null;\n }\n\n var Map;\n if (global
.Map && typeof global.Map.prototype.forEach === 'function') {\n Map = global.
Map;\n } else {\n Map = function() {\n this.keys = [];\n this.valu
es = [];\n };\n\n Map.prototype = {\n set: function(key, value) {\n
var index = this.keys.indexOf(key);\n if (index < 0) {\n t
his.keys.push(key);\n this.values.push(value);\n } else {\n
this.values[index] = value;\n }\n },\n\n get: function(key
) {\n var index = this.keys.indexOf(key);\n if (index < 0)\n
return;\n\n return this.values[index];\n },\n\n delete: fun
ction(key, value) {\n var index = this.keys.indexOf(key);\n if (in
dex < 0)\n return false;\n\n this.keys.splice(index, 1);\n
this.values.splice(index, 1);\n return true;\n },\n\n forEach
: function(f, opt_this) {\n for (var i = 0; i < this.keys.length; i++)\n
f.call(opt_this || this, this.values[i], this.keys[i], this);\n }\
n };\n }\n\n // JScript does not have __proto__. We wrap all object literal
s with\n // createObject which uses Object.create, Object.defineProperty and\n
// Object.getOwnPropertyDescriptor to create a new object that does the exact\n
// same thing. The main downside to this solution is that we have to extract\n
// all those property descriptors for IE.\n var createObject = ('__proto__' i
n {}) ?\n function(obj) { return obj; } :\n function(obj) {\n v
ar proto = obj.__proto__;\n if (!proto)\n return obj;\n v
ar newObject = Object.create(proto);\n Object.getOwnPropertyNames(obj).fo
rEach(function(name) {\n Object.defineProperty(newObject, name,\n
Object.getOwnPropertyDescriptor(obj, name));\n }
);\n return newObject;\n };\n\n // IE does not support have Documen
t.prototype.contains.\n if (typeof document.contains != 'function') {\n Docu
ment.prototype.contains = function(node) {\n if (node === this || node.pare
ntNode === this)\n return true;\n return this.documentElement.contai
ns(node);\n }\n }\n\n var BIND = 'bind';\n var REPEAT = 'repeat';\n var I
F = 'if';\n\n var templateAttributeDirectives = {\n 'template': true,\n '
repeat': true,\n 'bind': true,\n 'ref': true\n };\n\n var semanticTempla
teElements = {\n 'THEAD': true,\n 'TBODY': true,\n 'TFOOT': true,\n
'TH': true,\n 'TR': true,\n 'TD': true,\n 'COLGROUP': true,\n 'COL':
true,\n 'CAPTION': true,\n 'OPTION': true,\n 'OPTGROUP': true\n };\n\
n var hasTemplateElement = typeof HTMLTemplateElement !== 'undefined';\n if (h
asTemplateElement) {\n // TODO(rafaelw): Remove when fix for\n // https://
codereview.chromium.org/164803002/\n // makes it to Chrome release.\n (fun
ction() {\n var t = document.createElement('template');\n var d = t.co
ntent.ownerDocument;\n var html = d.appendChild(d.createElement('html'));\n
var head = html.appendChild(d.createElement('head'));\n var base = d.
createElement('base');\n base.href = document.baseURI;\n head.appendCh
ild(base);\n })();\n }\n\n var allTemplatesSelectors = 'template, ' +\n
Object.keys(semanticTemplateElements).map(function(tagName) {\n return
tagName.toLowerCase() + '[template]';\n }).join(', ');\n\n function isSVGT
emplate(el) {\n return el.tagName == 'template' &&\n el.namespaceUR
I == 'http://www.w3.org/2000/svg';\n }\n\n function isHTMLTemplate(el) {\n
return el.tagName == 'TEMPLATE' &&\n el.namespaceURI == 'http://www.w3
.org/1999/xhtml';\n }\n\n function isAttributeTemplate(el) {\n return Boole
an(semanticTemplateElements[el.tagName] &&\n el.hasAttribute('
template'));\n }\n\n function isTemplate(el) {\n if (el.isTemplate_ === und
efined)\n el.isTemplate_ = el.tagName == 'TEMPLATE' || isAttributeTemplate(
el);\n\n return el.isTemplate_;\n }\n\n // FIXME: Observe templates being a
dded/removed from documents\n // FIXME: Expose imperative API to decorate and o
bserve templates in\n // \"disconnected tress\" (e.g. ShadowRoot)\n document.a
ddEventListener('DOMContentLoaded', function(e) {\n bootstrapTemplatesRecursi
velyFrom(document);\n // FIXME: Is this needed? Seems like it shouldn't be.\n
Platform.performMicrotaskCheckpoint();\n }, false);\n\n function forAllTem
platesFrom(node, fn) {\n var subTemplates = node.querySelectorAll(allTemplate
sSelectors);\n\n if (isTemplate(node))\n fn(node)\n forEach(subTempla
tes, fn);\n }\n\n function bootstrapTemplatesRecursivelyFrom(node) {\n func
tion bootstrap(template) {\n if (!HTMLTemplateElement.decorate(template))\n
bootstrapTemplatesRecursivelyFrom(template.content);\n }\n\n forAl
lTemplatesFrom(node, bootstrap);\n }\n\n if (!hasTemplateElement) {\n /**\n
* This represents a <template> element.\n * @constructor\n * @exten
ds {HTMLElement}\n */\n global.HTMLTemplateElement = function() {\n
throw TypeError('Illegal constructor');\n };\n }\n\n var hasProto = '__prot
o__' in {};\n\n function mixin(to, from) {\n Object.getOwnPropertyNames(from
).forEach(function(name) {\n Object.defineProperty(to, name,\n
Object.getOwnPropertyDescriptor(from, name));\n });\n }\n\n
// http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#df
n-template-contents-owner\n function getOrCreateTemplateContentsOwner(template)
{\n var doc = template.ownerDocument\n if (!doc.defaultView)\n retur
n doc;\n var d = doc.templateContentsOwner_;\n if (!d) {\n // TODO(ar
v): This should either be a Document or HTMLDocument depending\n // on doc.
\n d = doc.implementation.createHTMLDocument('');\n while (d.lastChild
) {\n d.removeChild(d.lastChild);\n }\n doc.templateContentsOwn
er_ = d;\n }\n return d;\n }\n\n function getTemplateStagingDocument(tem
plate) {\n if (!template.stagingDocument_) {\n var owner = template.owne
rDocument;\n if (!owner.stagingDocument_) {\n owner.stagingDocument_
= owner.implementation.createHTMLDocument('');\n owner.stagingDocument_.
isStagingDocument = true;\n // TODO(rafaelw): Remove when fix for\n
// https://codereview.chromium.org/164803002/\n // makes it to Chrome r
elease.\n var base = owner.stagingDocument_.createElement('base');\n
base.href = document.baseURI;\n owner.stagingDocument_.head.appendChil
d(base);\n\n owner.stagingDocument_.stagingDocument_ = owner.stagingDocum
ent_;\n }\n\n template.stagingDocument_ = owner.stagingDocument_;\n
}\n\n return template.stagingDocument_;\n }\n\n // For non-template browse
rs, the parser will disallow <template> in certain\n // locations, so we allow
\"attribute templates\" which combine the template\n // element with the top-le
vel container node of the content, e.g.\n //\n // <tr template repeat=\"{{ f
oo }}\"\" class=\"bar\"><td>Bar</td></tr>\n //\n // becomes\n //\n // <tem
plate repeat=\"{{ foo }}\">\n // + #document-fragment\n // + <tr class=\
"bar\">\n // + <td>Bar</td>\n //\n function extractTemplateFromAttribut
eTemplate(el) {\n var template = el.ownerDocument.createElement('template');\
n el.parentNode.insertBefore(template, el);\n\n var attribs = el.attribute
s;\n var count = attribs.length;\n while (count-- > 0) {\n var attrib
= attribs[count];\n if (templateAttributeDirectives[attrib.name]) {\n
if (attrib.name !== 'template')\n template.setAttribute(attrib.name,
attrib.value);\n el.removeAttribute(attrib.name);\n }\n }\n\n
return template;\n }\n\n function extractTemplateFromSVGTemplate(el) {\n v
ar template = el.ownerDocument.createElement('template');\n el.parentNode.ins
ertBefore(template, el);\n\n var attribs = el.attributes;\n var count = at
tribs.length;\n while (count-- > 0) {\n var attrib = attribs[count];\n
template.setAttribute(attrib.name, attrib.value);\n el.removeAttribute(
attrib.name);\n }\n\n el.parentNode.removeChild(el);\n return template;
\n }\n\n function liftNonNativeTemplateChildrenIntoContent(template, el, useRo
ot) {\n var content = template.content;\n if (useRoot) {\n content.ap
pendChild(el);\n return;\n }\n\n var child;\n while (child = el.fi
rstChild) {\n content.appendChild(child);\n }\n }\n\n var templateObse
rver;\n if (typeof MutationObserver == 'function') {\n templateObserver = ne
w MutationObserver(function(records) {\n for (var i = 0; i < records.length
; i++) {\n records[i].target.refChanged_();\n }\n });\n }\n\n /
**\n * Ensures proper API and content model for template elements.\n * @para
m {HTMLTemplateElement} opt_instanceRef The template element which\n * |el
| template element will return as the value of its ref(), and whose\n * co
ntent will be used as source when createInstance() is invoked.\n */\n HTMLTem
plateElement.decorate = function(el, opt_instanceRef) {\n if (el.templateIsDe
corated_)\n return false;\n\n var templateElement = el;\n templateEle
ment.templateIsDecorated_ = true;\n\n var isNativeHTMLTemplate = isHTMLTempla
te(templateElement) &&\n hasTemplateElement;\n
var bootstrapContents = isNativeHTMLTemplate;\n var liftContents = !isNativeH
TMLTemplate;\n var liftRoot = false;\n\n if (!isNativeHTMLTemplate) {\n
if (isAttributeTemplate(templateElement)) {\n assert(!opt_instanceRef)
;\n templateElement = extractTemplateFromAttributeTemplate(el);\n
templateElement.templateIsDecorated_ = true;\n isNativeHTMLTemplate = has
TemplateElement;\n liftRoot = true;\n } else if (isSVGTemplate(templ
ateElement)) {\n templateElement = extractTemplateFromSVGTemplate(el);\n
templateElement.templateIsDecorated_ = true;\n isNativeHTMLTemplat
e = hasTemplateElement;\n }\n }\n\n if (!isNativeHTMLTemplate) {\n
fixTemplateElementPrototype(templateElement);\n var doc = getOrCreateTem
plateContentsOwner(templateElement);\n templateElement.content_ = doc.creat
eDocumentFragment();\n }\n\n if (opt_instanceRef) {\n // template is
contained within an instance, its direct content must be\n // empty\n
templateElement.instanceRef_ = opt_instanceRef;\n } else if (liftContents) {\
n liftNonNativeTemplateChildrenIntoContent(templateElement,\n
el,\n
liftRoot);\n } else if (bootstrapContents) {\n bootstrapTemplatesRe
cursivelyFrom(templateElement.content);\n }\n\n return true;\n };\n\n //
TODO(rafaelw): This used to decorate recursively all templates from a given\n
// node. This happens by default on 'DOMContentLoaded', but may be needed\n //
in subtrees not descendent from document (e.g. ShadowRoot).\n // Review whether
this is the right public API.\n HTMLTemplateElement.bootstrap = bootstrapTempl
atesRecursivelyFrom;\n\n var htmlElement = global.HTMLUnknownElement || HTMLEle
ment;\n\n var contentDescriptor = {\n get: function() {\n return this.c
ontent_;\n },\n enumerable: true,\n configurable: true\n };\n\n if (!
hasTemplateElement) {\n // Gecko is more picky with the prototype than WebKit
. Make sure to use the\n // same prototype as created in the constructor.\n
HTMLTemplateElement.prototype = Object.create(htmlElement.prototype);\n\n O
bject.defineProperty(HTMLTemplateElement.prototype, 'content',\n
contentDescriptor);\n }\n\n function fixTemplateElementPrototype(el)
{\n if (hasProto)\n el.__proto__ = HTMLTemplateElement.prototype;\n
else\n mixin(el, HTMLTemplateElement.prototype);\n }\n\n function ensureS
etModelScheduled(template) {\n if (!template.setModelFn_) {\n template.s
etModelFn_ = function() {\n template.setModelFnScheduled_ = false;\n
var map = getBindings(template,\n template.delegate_ && template.d
elegate_.prepareBinding);\n processBindings(template, map, template.model
_);\n };\n }\n\n if (!template.setModelFnScheduled_) {\n templat
e.setModelFnScheduled_ = true;\n Observer.runEOM_(template.setModelFn_);\n
}\n }\n\n mixin(HTMLTemplateElement.prototype, {\n bind: function(name,
value, oneTime) {\n if (name != 'ref')\n return Element.prototype.bi
nd.call(this, name, value, oneTime);\n\n var self = this;\n var ref =
oneTime ? value : value.open(function(ref) {\n self.setAttribute('ref', r
ef);\n self.refChanged_();\n });\n\n this.setAttribute('ref', r
ef);\n this.refChanged_();\n if (oneTime)\n return;\n\n if
(!this.bindings_) {\n this.bindings_ = { ref: value };\n } else {\n
this.bindings_.ref = value;\n }\n\n return value;\n },\n\n
processBindingDirectives_: function(directives) {\n if (this.iterator_)\
n this.iterator_.closeDeps();\n\n if (!directives.if && !directives.
bind && !directives.repeat) {\n if (this.iterator_) {\n this.ite
rator_.close();\n this.iterator_ = undefined;\n }\n\n ret
urn;\n }\n\n if (!this.iterator_) {\n this.iterator_ = new Temp
lateIterator(this);\n }\n\n this.iterator_.updateDependencies(directiv
es, this.model_);\n\n if (templateObserver) {\n templateObserver.obs
erve(this, { attributes: true,\n attribu
teFilter: ['ref'] });\n }\n\n return this.iterator_;\n },\n\n cr
eateInstance: function(model, bindingDelegate, delegate_) {\n if (bindingDe
legate)\n delegate_ = this.newDelegate_(bindingDelegate);\n else if
(!delegate_)\n delegate_ = this.delegate_;\n\n if (!this.refContent_
)\n this.refContent_ = this.ref_.content;\n var content = this.refCo
ntent_;\n if (content.firstChild === null)\n return emptyInstance;\n
\n var map = getInstanceBindingMap(content, delegate_);\n var stagingD
ocument = getTemplateStagingDocument(this);\n var instance = stagingDocumen
t.createDocumentFragment();\n instance.templateCreator_ = this;\n inst
ance.protoContent_ = content;\n instance.bindings_ = [];\n instance.te
rminator_ = null;\n var instanceRecord = instance.templateInstance_ = {\n
firstNode: null,\n lastNode: null,\n model: model\n };\
n\n var i = 0;\n var collectTerminator = false;\n for (var child
= content.firstChild; child; child = child.nextSibling) {\n // The termin
ator of the instance is the clone of the last child of the\n // content.
If the last child is an active template, it may produce\n // instances as
a result of production, so simply collecting the last\n // child of the
instance after it has finished producing may be wrong.\n if (child.nextSi
bling === null)\n collectTerminator = true;\n\n var clone = clon
eAndBindInstance(child, instance, stagingDocument,\n
map.children[i++],\n model,
\n delegate_,\n
instance.bindings_);\n clone.templateInstance_ = instance
Record;\n if (collectTerminator)\n instance.terminator_ = clone;
\n }\n\n instanceRecord.firstNode = instance.firstChild;\n instan
ceRecord.lastNode = instance.lastChild;\n instance.templateCreator_ = undef
ined;\n instance.protoContent_ = undefined;\n return instance;\n },
\n\n get model() {\n return this.model_;\n },\n\n set model(model)
{\n this.model_ = model;\n ensureSetModelScheduled(this);\n },\n\n
get bindingDelegate() {\n return this.delegate_ && this.delegate_.raw;\
n },\n\n refChanged_: function() {\n if (!this.iterator_ || this.refC
ontent_ === this.ref_.content)\n return;\n\n this.refContent_ = unde
fined;\n this.iterator_.valueChanged();\n this.iterator_.updateIterate
dValue();\n },\n\n clear: function() {\n this.model_ = undefined;\n
this.delegate_ = undefined;\n if (this.bindings_ && this.bindings_.ref)
\n this.bindings_.ref.close()\n this.refContent_ = undefined;\n
if (!this.iterator_)\n return;\n this.iterator_.valueChanged();\n
this.iterator_.close()\n this.iterator_ = undefined;\n },\n\n set
Delegate_: function(delegate) {\n this.delegate_ = delegate;\n this.bi
ndingMap_ = undefined;\n if (this.iterator_) {\n this.iterator_.inst
ancePositionChangedFn_ = undefined;\n this.iterator_.instanceModelFn_ = u
ndefined;\n }\n },\n\n newDelegate_: function(bindingDelegate) {\n
if (!bindingDelegate)\n return;\n\n function delegateFn(name) {\n
var fn = bindingDelegate && bindingDelegate[name];\n if (typeof f
n != 'function')\n return;\n\n return function() {\n re
turn fn.apply(bindingDelegate, arguments);\n };\n }\n\n return
{\n bindingMaps: {},\n raw: bindingDelegate,\n prepareBindi
ng: delegateFn('prepareBinding'),\n prepareInstanceModel: delegateFn('pre
pareInstanceModel'),\n prepareInstancePositionChanged:\n deleg
ateFn('prepareInstancePositionChanged')\n };\n },\n\n set bindingDele
gate(bindingDelegate) {\n if (this.delegate_) {\n throw Error('Templ
ate must be cleared before a new bindingDelegate ' +\n 'can b
e assigned');\n }\n\n this.setDelegate_(this.newDelegate_(bindingDeleg
ate));\n },\n\n get ref_() {\n var ref = searchRefId(this, this.getAt
tribute('ref'));\n if (!ref)\n ref = this.instanceRef_;\n\n if
(!ref)\n return this;\n\n var nextRef = ref.ref_;\n return next
Ref ? nextRef : ref;\n }\n });\n\n // Returns\n // a) undefined if there
are no mustaches.\n // b) [TEXT, (ONE_TIME?, PATH, DELEGATE_FN, TEXT)+] if t
here is at least one mustache.\n function parseMustaches(s, name, node, prepare
BindingFn) {\n if (!s || !s.length)\n return;\n\n var tokens;\n va
r length = s.length;\n var startIndex = 0, lastIndex = 0, endIndex = 0;\n
var onlyOneTime = true;\n while (lastIndex < length) {\n var startIndex
= s.indexOf('{{', lastIndex);\n var oneTimeStart = s.indexOf('[[', lastInde
x);\n var oneTime = false;\n var terminator = '}}';\n\n if (oneTi
meStart >= 0 &&\n (startIndex < 0 || oneTimeStart < startIndex)) {\n
startIndex = oneTimeStart;\n oneTime = true;\n terminator = '
]]';\n }\n\n endIndex = startIndex < 0 ? -1 : s.indexOf(terminator, st
artIndex + 2);\n\n if (endIndex < 0) {\n if (!tokens)\n ret
urn;\n\n tokens.push(s.slice(lastIndex)); // TEXT\n break;\n
}\n\n tokens = tokens || [];\n tokens.push(s.slice(lastIndex, startInd
ex)); // TEXT\n var pathString = s.slice(startIndex + 2, endIndex).trim();\
n tokens.push(oneTime); // ONE_TIME?\n onlyOneTime = onlyOneTime && on
eTime;\n var delegateFn = prepareBindingFn &&\n prepa
reBindingFn(pathString, name, node);\n // Don't try to parse the expression
if there's a prepareBinding function\n if (delegateFn == null) {\n
tokens.push(Path.get(pathString)); // PATH\n } else {\n tokens.push(
null);\n }\n tokens.push(delegateFn); // DELEGATE_FN\n lastIndex
= endIndex + 2;\n }\n\n if (lastIndex === length)\n tokens.push('');
// TEXT\n\n tokens.hasOnePath = tokens.length === 5;\n tokens.isSimplePath
= tokens.hasOnePath &&\n tokens[0] == '' &&\n
tokens[4] == '';\n tokens.onlyOneTime = onlyOneTime;\n\n
tokens.combinator = function(values) {\n var newValue = tokens[0];\n\n
for (var i = 1; i < tokens.length; i += 4) {\n var value = tokens.hasOne
Path ? values : values[(i - 1) / 4];\n if (value !== undefined)\n
newValue += value;\n newValue += tokens[i + 3];\n }\n\n retur
n newValue;\n }\n\n return tokens;\n };\n\n function processOneTimeBindi
ng(name, tokens, node, model) {\n if (tokens.hasOnePath) {\n var delegat
eFn = tokens[3];\n var value = delegateFn ? delegateFn(model, node, true) :
\n tokens[2].getValueFrom(model);\n return to
kens.isSimplePath ? value : tokens.combinator(value);\n }\n\n var values =
[];\n for (var i = 1; i < tokens.length; i += 4) {\n var delegateFn = t
okens[i + 2];\n values[(i - 1) / 4] = delegateFn ? delegateFn(model, node)
:\n tokens[i + 1].getValueFrom(model);\n }\n\n return tokens.comb
inator(values);\n }\n\n function processSinglePathBinding(name, tokens, node,
model) {\n var delegateFn = tokens[3];\n var observer = delegateFn ? deleg
ateFn(model, node, false) :\n new PathObserver(model, tokens[2]);\n\n
return tokens.isSimplePath ? observer :\n new ObserverTransform(observer,
tokens.combinator);\n }\n\n function processBinding(name, tokens, node, model
) {\n if (tokens.onlyOneTime)\n return processOneTimeBinding(name, token
s, node, model);\n\n if (tokens.hasOnePath)\n return processSinglePathBi
nding(name, tokens, node, model);\n\n var observer = new CompoundObserver();\
n\n for (var i = 1; i < tokens.length; i += 4) {\n var oneTime = tokens[
i];\n var delegateFn = tokens[i + 2];\n\n if (delegateFn) {\n v
ar value = delegateFn(model, node, oneTime);\n if (oneTime)\n ob
server.addPath(value)\n else\n observer.addObserver(value);\n
continue;\n }\n\n var path = tokens[i + 1];\n if (oneTime)\n
observer.addPath(path.getValueFrom(model))\n else\n observer
.addPath(model, path);\n }\n\n return new ObserverTransform(observer, toke
ns.combinator);\n }\n\n function processBindings(node, bindings, model, instan
ceBindings) {\n for (var i = 0; i < bindings.length; i += 2) {\n var nam
e = bindings[i]\n var tokens = bindings[i + 1];\n var value = processB
inding(name, tokens, node, model);\n var binding = node.bind(name, value, t
okens.onlyOneTime);\n if (binding && instanceBindings)\n instanceBin
dings.push(binding);\n }\n\n node.bindFinished();\n if (!bindings.isTem
plate)\n return;\n\n node.model_ = model;\n var iter = node.processBi
ndingDirectives_(bindings);\n if (instanceBindings && iter)\n instanceBi
ndings.push(iter);\n }\n\n function parseWithDefault(el, name, prepareBindingF
n) {\n var v = el.getAttribute(name);\n return parseMustaches(v == '' ? '{
{}}' : v, name, el, prepareBindingFn);\n }\n\n function parseAttributeBindings
(element, prepareBindingFn) {\n assert(element);\n\n var bindings = [];\n
var ifFound = false;\n var bindFound = false;\n\n for (var i = 0; i < e
lement.attributes.length; i++) {\n var attr = element.attributes[i];\n
var name = attr.name;\n var value = attr.value;\n\n // Allow bindings
expressed in attributes to be prefixed with underbars.\n // We do this to
allow correct semantics for browsers that don't implement\n // <template> w
here certain attributes might trigger side-effects -- and\n // for IE which
sanitizes certain attributes, disallowing mustache\n // replacements in th
eir text.\n while (name[0] === '_') {\n name = name.substring(1);\n
}\n\n if (isTemplate(element) &&\n (name === IF || name === B
IND || name === REPEAT)) {\n continue;\n }\n\n var tokens = par
seMustaches(value, name, element,\n prepareBind
ingFn);\n if (!tokens)\n continue;\n\n bindings.push(name, toke
ns);\n }\n\n if (isTemplate(element)) {\n bindings.isTemplate = true;
\n bindings.if = parseWithDefault(element, IF, prepareBindingFn);\n bi
ndings.bind = parseWithDefault(element, BIND, prepareBindingFn);\n bindings
.repeat = parseWithDefault(element, REPEAT, prepareBindingFn);\n\n if (bind
ings.if && !bindings.bind && !bindings.repeat)\n bindings.bind = parseMus
taches('{{}}', BIND, element, prepareBindingFn);\n }\n\n return bindings;\
n }\n\n function getBindings(node, prepareBindingFn) {\n if (node.nodeType
=== Node.ELEMENT_NODE)\n return parseAttributeBindings(node, prepareBinding
Fn);\n\n if (node.nodeType === Node.TEXT_NODE) {\n var tokens = parseMus
taches(node.data, 'textContent', node,\n prepar
eBindingFn);\n if (tokens)\n return ['textContent', tokens];\n }\
n\n return [];\n }\n\n function cloneAndBindInstance(node, parent, stagingD
ocument, bindings, model,\n delegate,\n
instanceBindings,\n instanc
eRecord) {\n var clone = parent.appendChild(stagingDocument.importNode(node,
false));\n\n var i = 0;\n for (var child = node.firstChild; child; child =
child.nextSibling) {\n cloneAndBindInstance(child, clone, stagingDocument,
\n bindings.children[i++],\n
model,\n delegate,\n in
stanceBindings);\n }\n\n if (bindings.isTemplate) {\n HTMLTemplateEle
ment.decorate(clone, node);\n if (delegate)\n clone.setDelegate_(del
egate);\n }\n\n processBindings(clone, bindings, model, instanceBindings);
\n return clone;\n }\n\n function createInstanceBindingMap(node, prepareBin
dingFn) {\n var map = getBindings(node, prepareBindingFn);\n map.children
= {};\n var index = 0;\n for (var child = node.firstChild; child; child =
child.nextSibling) {\n map.children[index++] = createInstanceBindingMap(chi
ld, prepareBindingFn);\n }\n\n return map;\n }\n\n var contentUidCounter
= 1;\n\n // TODO(rafaelw): Setup a MutationObserver on content which clears th
e id\n // so that bindingMaps regenerate when the template.content changes.\n
function getContentUid(content) {\n var id = content.id_;\n if (!id)\n
id = content.id_ = contentUidCounter++;\n return id;\n }\n\n // Each dele
gate is associated with a set of bindingMaps, one for each\n // content which m
ay be used by a template. The intent is that each binding\n // delegate gets th
e opportunity to prepare the instance (via the prepare*\n // delegate calls) on
ce across all uses.\n // TODO(rafaelw): Separate out the parse map from the bin
ding map. In the\n // current implementation, if two delegates need a binding m
ap for the same\n // content, the second will have to reparse.\n function getI
nstanceBindingMap(content, delegate_) {\n var contentId = getContentUid(conte
nt);\n if (delegate_) {\n var map = delegate_.bindingMaps[contentId];\n
if (!map) {\n map = delegate_.bindingMaps[contentId] =\n
createInstanceBindingMap(content, delegate_.prepareBinding) || [];\n }\n
return map;\n }\n\n var map = content.bindingMap_;\n if (!map) {\n
map = content.bindingMap_ =\n createInstanceBindingMap(content, und
efined) || [];\n }\n return map;\n }\n\n Object.defineProperty(Node.prot
otype, 'templateInstance', {\n get: function() {\n var instance = this.t
emplateInstance_;\n return instance ? instance :\n (this.parentNod
e ? this.parentNode.templateInstance : undefined);\n }\n });\n\n var emptyI
nstance = document.createDocumentFragment();\n emptyInstance.bindings_ = [];\n
emptyInstance.terminator_ = null;\n\n function TemplateIterator(templateElemen
t) {\n this.closed = false;\n this.templateElement_ = templateElement;\n
this.instances = [];\n this.deps = undefined;\n this.iteratedValue = [];
\n this.presentValue = undefined;\n this.arrayObserver = undefined;\n }\n
\n TemplateIterator.prototype = {\n closeDeps: function() {\n var deps
= this.deps;\n if (deps) {\n if (deps.ifOneTime === false)\n
deps.ifValue.close();\n if (deps.oneTime === false)\n deps.val
ue.close();\n }\n },\n\n updateDependencies: function(directives, mod
el) {\n this.closeDeps();\n\n var deps = this.deps = {};\n var te
mplate = this.templateElement_;\n\n if (directives.if) {\n deps.hasI
f = true;\n deps.ifOneTime = directives.if.onlyOneTime;\n deps.ifV
alue = processBinding(IF, directives.if, template, model);\n\n // oneTime
if & predicate is false. nothing else to do.\n if (deps.ifOneTime && !de
ps.ifValue) {\n this.updateIteratedValue();\n return;\n
}\n\n if (!deps.ifOneTime)\n deps.ifValue.open(this.updateItera
tedValue, this);\n }\n\n if (directives.repeat) {\n deps.repeat
= true;\n deps.oneTime = directives.repeat.onlyOneTime;\n deps.va
lue = processBinding(REPEAT, directives.repeat, template, model);\n } else
{\n deps.repeat = false;\n deps.oneTime = directives.bind.onlyOneT
ime;\n deps.value = processBinding(BIND, directives.bind, template, model
);\n }\n\n if (!deps.oneTime)\n deps.value.open(this.updateIter
atedValue, this);\n\n this.updateIteratedValue();\n },\n\n updateIter
atedValue: function() {\n if (this.deps.hasIf) {\n var ifValue = thi
s.deps.ifValue;\n if (!this.deps.ifOneTime)\n ifValue = ifValue.
discardChanges();\n if (!ifValue) {\n this.valueChanged();\n
return;\n }\n }\n\n var value = this.deps.value;\n i
f (!this.deps.oneTime)\n value = value.discardChanges();\n if (!this
.deps.repeat)\n value = [value];\n var observe = this.deps.repeat &&
\n !this.deps.oneTime &&\n Array.isArray(v
alue);\n this.valueChanged(value, observe);\n },\n\n valueChanged: fu
nction(value, observeValue) {\n if (!Array.isArray(value))\n value =
[];\n\n if (value === this.iteratedValue)\n return;\n\n this.u
nobserve();\n this.presentValue = value;\n if (observeValue) {\n
this.arrayObserver = new ArrayObserver(this.presentValue);\n this.array
Observer.open(this.handleSplices, this);\n }\n\n this.handleSplices(Ar
rayObserver.calculateSplices(this.presentValue,\n
this.iteratedValue));\n },\n\n getLastInstanceNod
e: function(index) {\n if (index == -1)\n return this.templateElemen
t_;\n var instance = this.instances[index];\n var terminator = instanc
e.terminator_;\n if (!terminator)\n return this.getLastInstanceNode(
index - 1);\n\n if (terminator.nodeType !== Node.ELEMENT_NODE ||\n
this.templateElement_ === terminator) {\n return terminator;\n }\n\
n var subtemplateIterator = terminator.iterator_;\n if (!subtemplateIt
erator)\n return terminator;\n\n return subtemplateIterator.getLastT
emplateNode();\n },\n\n getLastTemplateNode: function() {\n return th
is.getLastInstanceNode(this.instances.length - 1);\n },\n\n insertInstance
At: function(index, fragment) {\n var previousInstanceLast = this.getLastIn
stanceNode(index - 1);\n var parent = this.templateElement_.parentNode;\n
this.instances.splice(index, 0, fragment);\n\n parent.insertBefore(frag
ment, previousInstanceLast.nextSibling);\n },\n\n extractInstanceAt: funct
ion(index) {\n var previousInstanceLast = this.getLastInstanceNode(index -
1);\n var lastNode = this.getLastInstanceNode(index);\n var parent = t
his.templateElement_.parentNode;\n var instance = this.instances.splice(ind
ex, 1)[0];\n\n while (lastNode !== previousInstanceLast) {\n var nod
e = previousInstanceLast.nextSibling;\n if (node == lastNode)\n
lastNode = previousInstanceLast;\n\n instance.appendChild(parent.removeCh
ild(node));\n }\n\n return instance;\n },\n\n getDelegateFn: fun
ction(fn) {\n fn = fn && fn(this.templateElement_);\n return typeof fn
=== 'function' ? fn : null;\n },\n\n handleSplices: function(splices) {\n
if (this.closed || !splices.length)\n return;\n\n var template
= this.templateElement_;\n\n if (!template.parentNode) {\n this.clo
se();\n return;\n }\n\n ArrayObserver.applySplices(this.iterate
dValue, this.presentValue,\n splices);\n\n
var delegate = template.delegate_;\n if (this.instanceModelFn_ === undefine
d) {\n this.instanceModelFn_ =\n this.getDelegateFn(delegate &
& delegate.prepareInstanceModel);\n }\n\n if (this.instancePositionCha
ngedFn_ === undefined) {\n this.instancePositionChangedFn_ =\n
this.getDelegateFn(delegate &&\n delegate.prepare
InstancePositionChanged);\n }\n\n // Instance Removals\n var inst
anceCache = new Map;\n var removeDelta = 0;\n for (var i = 0; i < spli
ces.length; i++) {\n var splice = splices[i];\n var removed = spli
ce.removed;\n for (var j = 0; j < removed.length; j++) {\n var m
odel = removed[j];\n var instance = this.extractInstanceAt(splice.index
+ removeDelta);\n if (instance !== emptyInstance) {\n insta
nceCache.set(model, instance);\n }\n }\n\n removeDelta -=
splice.addedCount;\n }\n\n // Instance Insertions\n for (var i =
0; i < splices.length; i++) {\n var splice = splices[i];\n var ad
dIndex = splice.index;\n for (; addIndex < splice.index + splice.addedCou
nt; addIndex++) {\n var model = this.iteratedValue[addIndex];\n
var instance = instanceCache.get(model);\n if (instance) {\n
instanceCache.delete(model);\n } else {\n if (this.instan
ceModelFn_) {\n model = this.instanceModelFn_(model);\n
}\n\n if (model === undefined) {\n instance = emptyInsta
nce;\n } else {\n instance = template.createInstance(mod
el, undefined, delegate);\n }\n }\n\n this.insertIn
stanceAt(addIndex, instance);\n }\n }\n\n instanceCache.forEach
(function(instance) {\n this.closeInstanceBindings(instance);\n }, t
his);\n\n if (this.instancePositionChangedFn_)\n this.reportInstance
sMoved(splices);\n },\n\n reportInstanceMoved: function(index) {\n va
r instance = this.instances[index];\n if (instance === emptyInstance)\n
return;\n\n this.instancePositionChangedFn_(instance.templateInstance_,
index);\n },\n\n reportInstancesMoved: function(splices) {\n var ind
ex = 0;\n var offset = 0;\n for (var i = 0; i < splices.length; i++) {
\n var splice = splices[i];\n if (offset != 0) {\n while
(index < splice.index) {\n this.reportInstanceMoved(index);\n
index++;\n }\n } else {\n index = splice.index;\n
}\n\n while (index < splice.index + splice.addedCount) {\n
this.reportInstanceMoved(index);\n index++;\n }\n\n offs
et += splice.addedCount - splice.removed.length;\n }\n\n if (offset ==
0)\n return;\n\n var length = this.instances.length;\n while (
index < length) {\n this.reportInstanceMoved(index);\n index++;\n
}\n },\n\n closeInstanceBindings: function(instance) {\n var bin
dings = instance.bindings_;\n for (var i = 0; i < bindings.length; i++) {\n
bindings[i].close();\n }\n },\n\n unobserve: function() {\n
if (!this.arrayObserver)\n return;\n\n this.arrayObserver.close(
);\n this.arrayObserver = undefined;\n },\n\n close: function() {\n
if (this.closed)\n return;\n this.unobserve();\n for (var i
= 0; i < this.instances.length; i++) {\n this.closeInstanceBindings(this
.instances[i]);\n }\n\n this.instances.length = 0;\n this.closeDe
ps();\n this.templateElement_.iterator_ = undefined;\n this.closed = t
rue;\n }\n };\n\n // Polyfill-specific API.\n HTMLTemplateElement.forAllTe
mplatesFrom_ = forAllTemplatesFrom;\n})(this);\n", | 169 "// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n//
This code may only be used under the BSD style license found at http://polymer.
github.io/LICENSE.txt\n// The complete set of authors may be found at http://pol
ymer.github.io/AUTHORS.txt\n// The complete set of contributors may be found at
http://polymer.github.io/CONTRIBUTORS.txt\n// Code distributed by Google as part
of the polymer project is also\n// subject to an additional IP rights grant fou
nd at http://polymer.github.io/PATENTS.txt\n\n(function(global) {\n 'use strict
';\n\n function assert(v) {\n if (!v)\n throw new Error('Assertion fail
ed');\n }\n\n var forEach = Array.prototype.forEach.call.bind(Array.prototype.
forEach);\n\n function getFragmentRoot(node) {\n var p;\n while (p = node
.parentNode) {\n node = p;\n }\n\n return node;\n }\n\n function se
archRefId(node, id) {\n if (!id)\n return;\n\n var ref;\n var sele
ctor = '#' + id;\n while (!ref) {\n node = getFragmentRoot(node);\n\n
if (node.protoContent_)\n ref = node.protoContent_.querySelector(selec
tor);\n else if (node.getElementById)\n ref = node.getElementById(id
);\n\n if (ref || !node.templateCreator_)\n break\n\n node = no
de.templateCreator_;\n }\n\n return ref;\n }\n\n function getInstanceRoo
t(node) {\n while (node.parentNode) {\n node = node.parentNode;\n }\n
return node.templateCreator_ ? node : null;\n }\n\n var Map;\n if (global
.Map && typeof global.Map.prototype.forEach === 'function') {\n Map = global.
Map;\n } else {\n Map = function() {\n this.keys = [];\n this.valu
es = [];\n };\n\n Map.prototype = {\n set: function(key, value) {\n
var index = this.keys.indexOf(key);\n if (index < 0) {\n t
his.keys.push(key);\n this.values.push(value);\n } else {\n
this.values[index] = value;\n }\n },\n\n get: function(key
) {\n var index = this.keys.indexOf(key);\n if (index < 0)\n
return;\n\n return this.values[index];\n },\n\n delete: fun
ction(key, value) {\n var index = this.keys.indexOf(key);\n if (in
dex < 0)\n return false;\n\n this.keys.splice(index, 1);\n
this.values.splice(index, 1);\n return true;\n },\n\n forEach
: function(f, opt_this) {\n for (var i = 0; i < this.keys.length; i++)\n
f.call(opt_this || this, this.values[i], this.keys[i], this);\n }\
n };\n }\n\n // JScript does not have __proto__. We wrap all object literal
s with\n // createObject which uses Object.create, Object.defineProperty and\n
// Object.getOwnPropertyDescriptor to create a new object that does the exact\n
// same thing. The main downside to this solution is that we have to extract\n
// all those property descriptors for IE.\n var createObject = ('__proto__' i
n {}) ?\n function(obj) { return obj; } :\n function(obj) {\n v
ar proto = obj.__proto__;\n if (!proto)\n return obj;\n v
ar newObject = Object.create(proto);\n Object.getOwnPropertyNames(obj).fo
rEach(function(name) {\n Object.defineProperty(newObject, name,\n
Object.getOwnPropertyDescriptor(obj, name));\n }
);\n return newObject;\n };\n\n // IE does not support have Documen
t.prototype.contains.\n if (typeof document.contains != 'function') {\n Docu
ment.prototype.contains = function(node) {\n if (node === this || node.pare
ntNode === this)\n return true;\n return this.documentElement.contai
ns(node);\n }\n }\n\n var BIND = 'bind';\n var REPEAT = 'repeat';\n var I
F = 'if';\n\n var templateAttributeDirectives = {\n 'template': true,\n '
repeat': true,\n 'bind': true,\n 'ref': true\n };\n\n var semanticTempla
teElements = {\n 'THEAD': true,\n 'TBODY': true,\n 'TFOOT': true,\n
'TH': true,\n 'TR': true,\n 'TD': true,\n 'COLGROUP': true,\n 'COL':
true,\n 'CAPTION': true,\n 'OPTION': true,\n 'OPTGROUP': true\n };\n\
n var hasTemplateElement = typeof HTMLTemplateElement !== 'undefined';\n if (h
asTemplateElement) {\n // TODO(rafaelw): Remove when fix for\n // https://
codereview.chromium.org/164803002/\n // makes it to Chrome release.\n (fun
ction() {\n var t = document.createElement('template');\n var d = t.co
ntent.ownerDocument;\n var html = d.appendChild(d.createElement('html'));\n
var head = html.appendChild(d.createElement('head'));\n var base = d.
createElement('base');\n base.href = document.baseURI;\n head.appendCh
ild(base);\n })();\n }\n\n var allTemplatesSelectors = 'template, ' +\n
Object.keys(semanticTemplateElements).map(function(tagName) {\n return
tagName.toLowerCase() + '[template]';\n }).join(', ');\n\n function isSVGT
emplate(el) {\n return el.tagName == 'template' &&\n el.namespaceUR
I == 'http://www.w3.org/2000/svg';\n }\n\n function isHTMLTemplate(el) {\n
return el.tagName == 'TEMPLATE' &&\n el.namespaceURI == 'http://www.w3
.org/1999/xhtml';\n }\n\n function isAttributeTemplate(el) {\n return Boole
an(semanticTemplateElements[el.tagName] &&\n el.hasAttribute('
template'));\n }\n\n function isTemplate(el) {\n if (el.isTemplate_ === und
efined)\n el.isTemplate_ = el.tagName == 'TEMPLATE' || isAttributeTemplate(
el);\n\n return el.isTemplate_;\n }\n\n // FIXME: Observe templates being a
dded/removed from documents\n // FIXME: Expose imperative API to decorate and o
bserve templates in\n // \"disconnected tress\" (e.g. ShadowRoot)\n document.a
ddEventListener('DOMContentLoaded', function(e) {\n bootstrapTemplatesRecursi
velyFrom(document);\n // FIXME: Is this needed? Seems like it shouldn't be.\n
Platform.performMicrotaskCheckpoint();\n }, false);\n\n function forAllTem
platesFrom(node, fn) {\n var subTemplates = node.querySelectorAll(allTemplate
sSelectors);\n\n if (isTemplate(node))\n fn(node)\n forEach(subTempla
tes, fn);\n }\n\n function bootstrapTemplatesRecursivelyFrom(node) {\n func
tion bootstrap(template) {\n if (!HTMLTemplateElement.decorate(template))\n
bootstrapTemplatesRecursivelyFrom(template.content);\n }\n\n forAl
lTemplatesFrom(node, bootstrap);\n }\n\n if (!hasTemplateElement) {\n /**\n
* This represents a <template> element.\n * @constructor\n * @exten
ds {HTMLElement}\n */\n global.HTMLTemplateElement = function() {\n
throw TypeError('Illegal constructor');\n };\n }\n\n var hasProto = '__prot
o__' in {};\n\n function mixin(to, from) {\n Object.getOwnPropertyNames(from
).forEach(function(name) {\n Object.defineProperty(to, name,\n
Object.getOwnPropertyDescriptor(from, name));\n });\n }\n\n
// http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#df
n-template-contents-owner\n function getOrCreateTemplateContentsOwner(template)
{\n var doc = template.ownerDocument\n if (!doc.defaultView)\n retur
n doc;\n var d = doc.templateContentsOwner_;\n if (!d) {\n // TODO(ar
v): This should either be a Document or HTMLDocument depending\n // on doc.
\n d = doc.implementation.createHTMLDocument('');\n while (d.lastChild
) {\n d.removeChild(d.lastChild);\n }\n doc.templateContentsOwn
er_ = d;\n }\n return d;\n }\n\n function getTemplateStagingDocument(tem
plate) {\n if (!template.stagingDocument_) {\n var owner = template.owne
rDocument;\n if (!owner.stagingDocument_) {\n owner.stagingDocument_
= owner.implementation.createHTMLDocument('');\n owner.stagingDocument_.
isStagingDocument = true;\n // TODO(rafaelw): Remove when fix for\n
// https://codereview.chromium.org/164803002/\n // makes it to Chrome r
elease.\n var base = owner.stagingDocument_.createElement('base');\n
base.href = document.baseURI;\n owner.stagingDocument_.head.appendChil
d(base);\n\n owner.stagingDocument_.stagingDocument_ = owner.stagingDocum
ent_;\n }\n\n template.stagingDocument_ = owner.stagingDocument_;\n
}\n\n return template.stagingDocument_;\n }\n\n // For non-template browse
rs, the parser will disallow <template> in certain\n // locations, so we allow
\"attribute templates\" which combine the template\n // element with the top-le
vel container node of the content, e.g.\n //\n // <tr template repeat=\"{{ f
oo }}\"\" class=\"bar\"><td>Bar</td></tr>\n //\n // becomes\n //\n // <tem
plate repeat=\"{{ foo }}\">\n // + #document-fragment\n // + <tr class=\
"bar\">\n // + <td>Bar</td>\n //\n function extractTemplateFromAttribut
eTemplate(el) {\n var template = el.ownerDocument.createElement('template');\
n el.parentNode.insertBefore(template, el);\n\n var attribs = el.attribute
s;\n var count = attribs.length;\n while (count-- > 0) {\n var attrib
= attribs[count];\n if (templateAttributeDirectives[attrib.name]) {\n
if (attrib.name !== 'template')\n template.setAttribute(attrib.name,
attrib.value);\n el.removeAttribute(attrib.name);\n }\n }\n\n
return template;\n }\n\n function extractTemplateFromSVGTemplate(el) {\n v
ar template = el.ownerDocument.createElement('template');\n el.parentNode.ins
ertBefore(template, el);\n\n var attribs = el.attributes;\n var count = at
tribs.length;\n while (count-- > 0) {\n var attrib = attribs[count];\n
template.setAttribute(attrib.name, attrib.value);\n el.removeAttribute(
attrib.name);\n }\n\n el.parentNode.removeChild(el);\n return template;
\n }\n\n function liftNonNativeTemplateChildrenIntoContent(template, el, useRo
ot) {\n var content = template.content;\n if (useRoot) {\n content.ap
pendChild(el);\n return;\n }\n\n var child;\n while (child = el.fi
rstChild) {\n content.appendChild(child);\n }\n }\n\n var templateObse
rver;\n if (typeof MutationObserver == 'function') {\n templateObserver = ne
w MutationObserver(function(records) {\n for (var i = 0; i < records.length
; i++) {\n records[i].target.refChanged_();\n }\n });\n }\n\n /
**\n * Ensures proper API and content model for template elements.\n * @para
m {HTMLTemplateElement} opt_instanceRef The template element which\n * |el
| template element will return as the value of its ref(), and whose\n * co
ntent will be used as source when createInstance() is invoked.\n */\n HTMLTem
plateElement.decorate = function(el, opt_instanceRef) {\n if (el.templateIsDe
corated_)\n return false;\n\n var templateElement = el;\n templateEle
ment.templateIsDecorated_ = true;\n\n var isNativeHTMLTemplate = isHTMLTempla
te(templateElement) &&\n hasTemplateElement;\n
var bootstrapContents = isNativeHTMLTemplate;\n var liftContents = !isNativeH
TMLTemplate;\n var liftRoot = false;\n\n if (!isNativeHTMLTemplate) {\n
if (isAttributeTemplate(templateElement)) {\n assert(!opt_instanceRef)
;\n templateElement = extractTemplateFromAttributeTemplate(el);\n
templateElement.templateIsDecorated_ = true;\n isNativeHTMLTemplate = has
TemplateElement;\n liftRoot = true;\n } else if (isSVGTemplate(templ
ateElement)) {\n templateElement = extractTemplateFromSVGTemplate(el);\n
templateElement.templateIsDecorated_ = true;\n isNativeHTMLTemplat
e = hasTemplateElement;\n }\n }\n\n if (!isNativeHTMLTemplate) {\n
fixTemplateElementPrototype(templateElement);\n var doc = getOrCreateTem
plateContentsOwner(templateElement);\n templateElement.content_ = doc.creat
eDocumentFragment();\n }\n\n if (opt_instanceRef) {\n // template is
contained within an instance, its direct content must be\n // empty\n
templateElement.instanceRef_ = opt_instanceRef;\n } else if (liftContents) {\
n liftNonNativeTemplateChildrenIntoContent(templateElement,\n
el,\n
liftRoot);\n } else if (bootstrapContents) {\n bootstrapTemplatesRe
cursivelyFrom(templateElement.content);\n }\n\n return true;\n };\n\n //
TODO(rafaelw): This used to decorate recursively all templates from a given\n
// node. This happens by default on 'DOMContentLoaded', but may be needed\n //
in subtrees not descendent from document (e.g. ShadowRoot).\n // Review whether
this is the right public API.\n HTMLTemplateElement.bootstrap = bootstrapTempl
atesRecursivelyFrom;\n\n var htmlElement = global.HTMLUnknownElement || HTMLEle
ment;\n\n var contentDescriptor = {\n get: function() {\n return this.c
ontent_;\n },\n enumerable: true,\n configurable: true\n };\n\n if (!
hasTemplateElement) {\n // Gecko is more picky with the prototype than WebKit
. Make sure to use the\n // same prototype as created in the constructor.\n
HTMLTemplateElement.prototype = Object.create(htmlElement.prototype);\n\n O
bject.defineProperty(HTMLTemplateElement.prototype, 'content',\n
contentDescriptor);\n }\n\n function fixTemplateElementPrototype(el)
{\n if (hasProto)\n el.__proto__ = HTMLTemplateElement.prototype;\n
else\n mixin(el, HTMLTemplateElement.prototype);\n }\n\n function ensureS
etModelScheduled(template) {\n if (!template.setModelFn_) {\n template.s
etModelFn_ = function() {\n template.setModelFnScheduled_ = false;\n
var map = getBindings(template,\n template.delegate_ && template.d
elegate_.prepareBinding);\n processBindings(template, map, template.model
_);\n };\n }\n\n if (!template.setModelFnScheduled_) {\n templat
e.setModelFnScheduled_ = true;\n Observer.runEOM_(template.setModelFn_);\n
}\n }\n\n mixin(HTMLTemplateElement.prototype, {\n bind: function(name,
value, oneTime) {\n if (name != 'ref')\n return Element.prototype.bi
nd.call(this, name, value, oneTime);\n\n var self = this;\n var ref =
oneTime ? value : value.open(function(ref) {\n self.setAttribute('ref', r
ef);\n self.refChanged_();\n });\n\n this.setAttribute('ref', r
ef);\n this.refChanged_();\n if (oneTime)\n return;\n\n if
(!this.bindings_) {\n this.bindings_ = { ref: value };\n } else {\n
this.bindings_.ref = value;\n }\n\n return value;\n },\n\n
processBindingDirectives_: function(directives) {\n if (this.iterator_)\
n this.iterator_.closeDeps();\n\n if (!directives.if && !directives.
bind && !directives.repeat) {\n if (this.iterator_) {\n this.ite
rator_.close();\n this.iterator_ = undefined;\n }\n\n ret
urn;\n }\n\n if (!this.iterator_) {\n this.iterator_ = new Temp
lateIterator(this);\n }\n\n this.iterator_.updateDependencies(directiv
es, this.model_);\n\n if (templateObserver) {\n templateObserver.obs
erve(this, { attributes: true,\n attribu
teFilter: ['ref'] });\n }\n\n return this.iterator_;\n },\n\n cr
eateInstance: function(model, bindingDelegate, delegate_) {\n if (bindingDe
legate)\n delegate_ = this.newDelegate_(bindingDelegate);\n else if
(!delegate_)\n delegate_ = this.delegate_;\n\n if (!this.refContent_
)\n this.refContent_ = this.ref_.content;\n var content = this.refCo
ntent_;\n if (content.firstChild === null)\n return emptyInstance;\n
\n var map = getInstanceBindingMap(content, delegate_);\n var stagingD
ocument = getTemplateStagingDocument(this);\n var instance = stagingDocumen
t.createDocumentFragment();\n instance.templateCreator_ = this;\n inst
ance.protoContent_ = content;\n instance.bindings_ = [];\n instance.te
rminator_ = null;\n var instanceRecord = instance.templateInstance_ = {\n
firstNode: null,\n lastNode: null,\n model: model\n };\
n\n var i = 0;\n var collectTerminator = false;\n for (var child
= content.firstChild; child; child = child.nextSibling) {\n // The termin
ator of the instance is the clone of the last child of the\n // content.
If the last child is an active template, it may produce\n // instances as
a result of production, so simply collecting the last\n // child of the
instance after it has finished producing may be wrong.\n if (child.nextSi
bling === null)\n collectTerminator = true;\n\n var clone = clon
eAndBindInstance(child, instance, stagingDocument,\n
map.children[i++],\n model,
\n delegate_,\n
instance.bindings_);\n clone.templateInstance_ = instance
Record;\n if (collectTerminator)\n instance.terminator_ = clone;
\n }\n\n instanceRecord.firstNode = instance.firstChild;\n instan
ceRecord.lastNode = instance.lastChild;\n instance.templateCreator_ = undef
ined;\n instance.protoContent_ = undefined;\n return instance;\n },
\n\n get model() {\n return this.model_;\n },\n\n set model(model)
{\n this.model_ = model;\n ensureSetModelScheduled(this);\n },\n\n
get bindingDelegate() {\n return this.delegate_ && this.delegate_.raw;\
n },\n\n refChanged_: function() {\n if (!this.iterator_ || this.refC
ontent_ === this.ref_.content)\n return;\n\n this.refContent_ = unde
fined;\n this.iterator_.valueChanged();\n this.iterator_.updateIterate
dValue(this.iterator_.getUpdatedValue());\n },\n\n clear: function() {\n
this.model_ = undefined;\n this.delegate_ = undefined;\n if (this.
bindings_ && this.bindings_.ref)\n this.bindings_.ref.close()\n this
.refContent_ = undefined;\n if (!this.iterator_)\n return;\n th
is.iterator_.valueChanged();\n this.iterator_.close()\n this.iterator_
= undefined;\n },\n\n setDelegate_: function(delegate) {\n this.dele
gate_ = delegate;\n this.bindingMap_ = undefined;\n if (this.iterator_
) {\n this.iterator_.instancePositionChangedFn_ = undefined;\n thi
s.iterator_.instanceModelFn_ = undefined;\n }\n },\n\n newDelegate_:
function(bindingDelegate) {\n if (!bindingDelegate)\n return;\n\n
function delegateFn(name) {\n var fn = bindingDelegate && bindingDeleg
ate[name];\n if (typeof fn != 'function')\n return;\n\n r
eturn function() {\n return fn.apply(bindingDelegate, arguments);\n
};\n }\n\n return {\n bindingMaps: {},\n raw: bindin
gDelegate,\n prepareBinding: delegateFn('prepareBinding'),\n prepa
reInstanceModel: delegateFn('prepareInstanceModel'),\n prepareInstancePos
itionChanged:\n delegateFn('prepareInstancePositionChanged')\n }
;\n },\n\n set bindingDelegate(bindingDelegate) {\n if (this.delegate
_) {\n throw Error('Template must be cleared before a new bindingDelegate
' +\n 'can be assigned');\n }\n\n this.setDelegate
_(this.newDelegate_(bindingDelegate));\n },\n\n get ref_() {\n var re
f = searchRefId(this, this.getAttribute('ref'));\n if (!ref)\n ref =
this.instanceRef_;\n\n if (!ref)\n return this;\n\n var nextRe
f = ref.ref_;\n return nextRef ? nextRef : ref;\n }\n });\n\n // Retur
ns\n // a) undefined if there are no mustaches.\n // b) [TEXT, (ONE_TIME?,
PATH, DELEGATE_FN, TEXT)+] if there is at least one mustache.\n function parse
Mustaches(s, name, node, prepareBindingFn) {\n if (!s || !s.length)\n re
turn;\n\n var tokens;\n var length = s.length;\n var startIndex = 0, la
stIndex = 0, endIndex = 0;\n var onlyOneTime = true;\n while (lastIndex <
length) {\n var startIndex = s.indexOf('{{', lastIndex);\n var oneTime
Start = s.indexOf('[[', lastIndex);\n var oneTime = false;\n var termi
nator = '}}';\n\n if (oneTimeStart >= 0 &&\n (startIndex < 0 || on
eTimeStart < startIndex)) {\n startIndex = oneTimeStart;\n oneTime
= true;\n terminator = ']]';\n }\n\n endIndex = startIndex < 0
? -1 : s.indexOf(terminator, startIndex + 2);\n\n if (endIndex < 0) {\n
if (!tokens)\n return;\n\n tokens.push(s.slice(lastIndex));
// TEXT\n break;\n }\n\n tokens = tokens || [];\n tokens.
push(s.slice(lastIndex, startIndex)); // TEXT\n var pathString = s.slice(st
artIndex + 2, endIndex).trim();\n tokens.push(oneTime); // ONE_TIME?\n
onlyOneTime = onlyOneTime && oneTime;\n var delegateFn = prepareBindingFn
&&\n prepareBindingFn(pathString, name, node);\n // D
on't try to parse the expression if there's a prepareBinding function\n if
(delegateFn == null) {\n tokens.push(Path.get(pathString)); // PATH\n
} else {\n tokens.push(null);\n }\n tokens.push(delegateFn);
// DELEGATE_FN\n lastIndex = endIndex + 2;\n }\n\n if (lastIndex ===
length)\n tokens.push(''); // TEXT\n\n tokens.hasOnePath = tokens.length
=== 5;\n tokens.isSimplePath = tokens.hasOnePath &&\n
tokens[0] == '' &&\n tokens[4] == '';\n tokens.on
lyOneTime = onlyOneTime;\n\n tokens.combinator = function(values) {\n va
r newValue = tokens[0];\n\n for (var i = 1; i < tokens.length; i += 4) {\n
var value = tokens.hasOnePath ? values : values[(i - 1) / 4];\n if
(value !== undefined)\n newValue += value;\n newValue += tokens
[i + 3];\n }\n\n return newValue;\n }\n\n return tokens;\n };\n
\n function processOneTimeBinding(name, tokens, node, model) {\n if (tokens.
hasOnePath) {\n var delegateFn = tokens[3];\n var value = delegateFn ?
delegateFn(model, node, true) :\n tokens[2].getVa
lueFrom(model);\n return tokens.isSimplePath ? value : tokens.combinator(va
lue);\n }\n\n var values = [];\n for (var i = 1; i < tokens.length; i +
= 4) {\n var delegateFn = tokens[i + 2];\n values[(i - 1) / 4] = deleg
ateFn ? delegateFn(model, node) :\n tokens[i + 1].getValueFrom(model);\
n }\n\n return tokens.combinator(values);\n }\n\n function processSingle
PathBinding(name, tokens, node, model) {\n var delegateFn = tokens[3];\n v
ar observer = delegateFn ? delegateFn(model, node, false) :\n new PathObs
erver(model, tokens[2]);\n\n return tokens.isSimplePath ? observer :\n
new ObserverTransform(observer, tokens.combinator);\n }\n\n function processB
inding(name, tokens, node, model) {\n if (tokens.onlyOneTime)\n return p
rocessOneTimeBinding(name, tokens, node, model);\n\n if (tokens.hasOnePath)\n
return processSinglePathBinding(name, tokens, node, model);\n\n var obs
erver = new CompoundObserver();\n\n for (var i = 1; i < tokens.length; i += 4
) {\n var oneTime = tokens[i];\n var delegateFn = tokens[i + 2];\n\n
if (delegateFn) {\n var value = delegateFn(model, node, oneTime);\n
if (oneTime)\n observer.addPath(value)\n else\n o
bserver.addObserver(value);\n continue;\n }\n\n var path = toke
ns[i + 1];\n if (oneTime)\n observer.addPath(path.getValueFrom(model
))\n else\n observer.addPath(model, path);\n }\n\n return new
ObserverTransform(observer, tokens.combinator);\n }\n\n function processBindin
gs(node, bindings, model, instanceBindings) {\n for (var i = 0; i < bindings.
length; i += 2) {\n var name = bindings[i]\n var tokens = bindings[i +
1];\n var value = processBinding(name, tokens, node, model);\n var bi
nding = node.bind(name, value, tokens.onlyOneTime);\n if (binding && instan
ceBindings)\n instanceBindings.push(binding);\n }\n\n node.bindFini
shed();\n if (!bindings.isTemplate)\n return;\n\n node.model_ = model
;\n var iter = node.processBindingDirectives_(bindings);\n if (instanceBin
dings && iter)\n instanceBindings.push(iter);\n }\n\n function parseWithD
efault(el, name, prepareBindingFn) {\n var v = el.getAttribute(name);\n re
turn parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn);\n }\n\n
function parseAttributeBindings(element, prepareBindingFn) {\n assert(elemen
t);\n\n var bindings = [];\n var ifFound = false;\n var bindFound = fal
se;\n\n for (var i = 0; i < element.attributes.length; i++) {\n var attr
= element.attributes[i];\n var name = attr.name;\n var value = attr.v
alue;\n\n // Allow bindings expressed in attributes to be prefixed with und
erbars.\n // We do this to allow correct semantics for browsers that don't
implement\n // <template> where certain attributes might trigger side-effec
ts -- and\n // for IE which sanitizes certain attributes, disallowing musta
che\n // replacements in their text.\n while (name[0] === '_') {\n
name = name.substring(1);\n }\n\n if (isTemplate(element) &&\n
(name === IF || name === BIND || name === REPEAT)) {\n continue;\n
}\n\n var tokens = parseMustaches(value, name, element,\n
prepareBindingFn);\n if (!tokens)\n continue;\n
\n bindings.push(name, tokens);\n }\n\n if (isTemplate(element)) {\n
bindings.isTemplate = true;\n bindings.if = parseWithDefault(element,
IF, prepareBindingFn);\n bindings.bind = parseWithDefault(element, BIND, pr
epareBindingFn);\n bindings.repeat = parseWithDefault(element, REPEAT, prep
areBindingFn);\n\n if (bindings.if && !bindings.bind && !bindings.repeat)\n
bindings.bind = parseMustaches('{{}}', BIND, element, prepareBindingFn);
\n }\n\n return bindings;\n }\n\n function getBindings(node, prepareBind
ingFn) {\n if (node.nodeType === Node.ELEMENT_NODE)\n return parseAttrib
uteBindings(node, prepareBindingFn);\n\n if (node.nodeType === Node.TEXT_NODE
) {\n var tokens = parseMustaches(node.data, 'textContent', node,\n
prepareBindingFn);\n if (tokens)\n return
['textContent', tokens];\n }\n\n return [];\n }\n\n function cloneAndBin
dInstance(node, parent, stagingDocument, bindings, model,\n
delegate,\n instanceBindings,\n
instanceRecord) {\n var clone = parent.appendChild(s
tagingDocument.importNode(node, false));\n\n var i = 0;\n for (var child =
node.firstChild; child; child = child.nextSibling) {\n cloneAndBindInstanc
e(child, clone, stagingDocument,\n bindings.children[
i++],\n model,\n delegate,
\n instanceBindings);\n }\n\n if (bindings.isTe
mplate) {\n HTMLTemplateElement.decorate(clone, node);\n if (delegate)
\n clone.setDelegate_(delegate);\n }\n\n processBindings(clone, bin
dings, model, instanceBindings);\n return clone;\n }\n\n function createIns
tanceBindingMap(node, prepareBindingFn) {\n var map = getBindings(node, prepa
reBindingFn);\n map.children = {};\n var index = 0;\n for (var child =
node.firstChild; child; child = child.nextSibling) {\n map.children[index++
] = createInstanceBindingMap(child, prepareBindingFn);\n }\n\n return map;
\n }\n\n var contentUidCounter = 1;\n\n // TODO(rafaelw): Setup a MutationObs
erver on content which clears the id\n // so that bindingMaps regenerate when t
he template.content changes.\n function getContentUid(content) {\n var id =
content.id_;\n if (!id)\n id = content.id_ = contentUidCounter++;\n r
eturn id;\n }\n\n // Each delegate is associated with a set of bindingMaps, on
e for each\n // content which may be used by a template. The intent is that eac
h binding\n // delegate gets the opportunity to prepare the instance (via the p
repare*\n // delegate calls) once across all uses.\n // TODO(rafaelw): Separat
e out the parse map from the binding map. In the\n // current implementation, i
f two delegates need a binding map for the same\n // content, the second will h
ave to reparse.\n function getInstanceBindingMap(content, delegate_) {\n var
contentId = getContentUid(content);\n if (delegate_) {\n var map = dele
gate_.bindingMaps[contentId];\n if (!map) {\n map = delegate_.bindin
gMaps[contentId] =\n createInstanceBindingMap(content, delegate_.prep
areBinding) || [];\n }\n return map;\n }\n\n var map = content.b
indingMap_;\n if (!map) {\n map = content.bindingMap_ =\n creat
eInstanceBindingMap(content, undefined) || [];\n }\n return map;\n }\n\n
Object.defineProperty(Node.prototype, 'templateInstance', {\n get: function(
) {\n var instance = this.templateInstance_;\n return instance ? insta
nce :\n (this.parentNode ? this.parentNode.templateInstance : undefined
);\n }\n });\n\n var emptyInstance = document.createDocumentFragment();\n
emptyInstance.bindings_ = [];\n emptyInstance.terminator_ = null;\n\n function
TemplateIterator(templateElement) {\n this.closed = false;\n this.templat
eElement_ = templateElement;\n this.instances = [];\n this.deps = undefine
d;\n this.iteratedValue = [];\n this.presentValue = undefined;\n this.a
rrayObserver = undefined;\n }\n\n TemplateIterator.prototype = {\n closeDep
s: function() {\n var deps = this.deps;\n if (deps) {\n if (dep
s.ifOneTime === false)\n deps.ifValue.close();\n if (deps.oneTim
e === false)\n deps.value.close();\n }\n },\n\n updateDepend
encies: function(directives, model) {\n this.closeDeps();\n\n var deps
= this.deps = {};\n var template = this.templateElement_;\n\n var ifV
alue = true;\n if (directives.if) {\n deps.hasIf = true;\n de
ps.ifOneTime = directives.if.onlyOneTime;\n deps.ifValue = processBinding
(IF, directives.if, template, model);\n\n ifValue = deps.ifValue;\n\n
// oneTime if & predicate is false. nothing else to do.\n if (deps.if
OneTime && !ifValue) {\n this.valueChanged();\n return;\n
}\n\n if (!deps.ifOneTime)\n ifValue = ifValue.open(this.upda
teIfValue, this);\n }\n\n if (directives.repeat) {\n deps.repea
t = true;\n deps.oneTime = directives.repeat.onlyOneTime;\n deps.v
alue = processBinding(REPEAT, directives.repeat, template, model);\n } else
{\n deps.repeat = false;\n deps.oneTime = directives.bind.onlyOne
Time;\n deps.value = processBinding(BIND, directives.bind, template, mode
l);\n }\n\n var value = deps.value;\n if (!deps.oneTime)\n
value = value.open(this.updateIteratedValue, this);\n\n if (!ifValue) {\n
this.valueChanged();\n return;\n }\n\n this.updateValue(
value);\n },\n\n /**\n * Gets the updated value of the bind/repeat. Th
is can potentially call\n * user code (if a bindingDelegate is set up) so we
try to avoid it if we\n * already have the value in hand (from Observer.ope
n).\n */\n getUpdatedValue: function() {\n var value = this.deps.val
ue;\n if (!this.deps.oneTime)\n value = value.discardChanges();\n
return value;\n },\n\n updateIfValue: function(ifValue) {\n if (!i
fValue) {\n this.valueChanged();\n return;\n }\n\n this.
updateValue(this.getUpdatedValue());\n },\n\n updateIteratedValue: functio
n(value) {\n if (this.deps.hasIf) {\n var ifValue = this.deps.ifValu
e;\n if (!this.deps.ifOneTime)\n ifValue = ifValue.discardChange
s();\n if (!ifValue) {\n this.valueChanged();\n return;
\n }\n }\n\n this.updateValue(value);\n },\n\n updateValu
e: function(value) {\n if (!this.deps.repeat)\n value = [value];\n
var observe = this.deps.repeat &&\n !this.deps.oneTime &&
\n Array.isArray(value);\n this.valueChanged(value, obse
rve);\n },\n\n valueChanged: function(value, observeValue) {\n if (!A
rray.isArray(value))\n value = [];\n\n if (value === this.iteratedVa
lue)\n return;\n\n this.unobserve();\n this.presentValue = valu
e;\n if (observeValue) {\n this.arrayObserver = new ArrayObserver(th
is.presentValue);\n this.arrayObserver.open(this.handleSplices, this);\n
}\n\n this.handleSplices(ArrayObserver.calculateSplices(this.presentVa
lue,\n this.iteratedValue
));\n },\n\n getLastInstanceNode: function(index) {\n if (index == -1
)\n return this.templateElement_;\n var instance = this.instances[in
dex];\n var terminator = instance.terminator_;\n if (!terminator)\n
return this.getLastInstanceNode(index - 1);\n\n if (terminator.nodeTyp
e !== Node.ELEMENT_NODE ||\n this.templateElement_ === terminator) {\n
return terminator;\n }\n\n var subtemplateIterator = terminator
.iterator_;\n if (!subtemplateIterator)\n return terminator;\n\n
return subtemplateIterator.getLastTemplateNode();\n },\n\n getLastTempla
teNode: function() {\n return this.getLastInstanceNode(this.instances.lengt
h - 1);\n },\n\n insertInstanceAt: function(index, fragment) {\n var
previousInstanceLast = this.getLastInstanceNode(index - 1);\n var parent =
this.templateElement_.parentNode;\n this.instances.splice(index, 0, fragmen
t);\n\n parent.insertBefore(fragment, previousInstanceLast.nextSibling);\n
},\n\n extractInstanceAt: function(index) {\n var previousInstanceLas
t = this.getLastInstanceNode(index - 1);\n var lastNode = this.getLastInsta
nceNode(index);\n var parent = this.templateElement_.parentNode;\n var
instance = this.instances.splice(index, 1)[0];\n\n while (lastNode !== pre
viousInstanceLast) {\n var node = previousInstanceLast.nextSibling;\n
if (node == lastNode)\n lastNode = previousInstanceLast;\n\n
instance.appendChild(parent.removeChild(node));\n }\n\n return instan
ce;\n },\n\n getDelegateFn: function(fn) {\n fn = fn && fn(this.templ
ateElement_);\n return typeof fn === 'function' ? fn : null;\n },\n\n
handleSplices: function(splices) {\n if (this.closed || !splices.length)\n
return;\n\n var template = this.templateElement_;\n\n if (!tem
plate.parentNode) {\n this.close();\n return;\n }\n\n Ar
rayObserver.applySplices(this.iteratedValue, this.presentValue,\n
splices);\n\n var delegate = template.delegate_;\n i
f (this.instanceModelFn_ === undefined) {\n this.instanceModelFn_ =\n
this.getDelegateFn(delegate && delegate.prepareInstanceModel);\n }\
n\n if (this.instancePositionChangedFn_ === undefined) {\n this.inst
ancePositionChangedFn_ =\n this.getDelegateFn(delegate &&\n
delegate.prepareInstancePositionChanged);\n }\n\n
// Instance Removals\n var instanceCache = new Map;\n var removeDelta
= 0;\n for (var i = 0; i < splices.length; i++) {\n var splice = sp
lices[i];\n var removed = splice.removed;\n for (var j = 0; j < re
moved.length; j++) {\n var model = removed[j];\n var instance
= this.extractInstanceAt(splice.index + removeDelta);\n if (instance !=
= emptyInstance) {\n instanceCache.set(model, instance);\n }
\n }\n\n removeDelta -= splice.addedCount;\n }\n\n // In
stance Insertions\n for (var i = 0; i < splices.length; i++) {\n var
splice = splices[i];\n var addIndex = splice.index;\n for (; addI
ndex < splice.index + splice.addedCount; addIndex++) {\n var model = th
is.iteratedValue[addIndex];\n var instance = instanceCache.get(model);\
n if (instance) {\n instanceCache.delete(model);\n
} else {\n if (this.instanceModelFn_) {\n model = this.i
nstanceModelFn_(model);\n }\n\n if (model === undefined) {
\n instance = emptyInstance;\n } else {\n i
nstance = template.createInstance(model, undefined, delegate);\n }\n
}\n\n this.insertInstanceAt(addIndex, instance);\n }\n
}\n\n instanceCache.forEach(function(instance) {\n this.closeIn
stanceBindings(instance);\n }, this);\n\n if (this.instancePositionCha
ngedFn_)\n this.reportInstancesMoved(splices);\n },\n\n reportInsta
nceMoved: function(index) {\n var instance = this.instances[index];\n
if (instance === emptyInstance)\n return;\n\n this.instancePositionC
hangedFn_(instance.templateInstance_, index);\n },\n\n reportInstancesMove
d: function(splices) {\n var index = 0;\n var offset = 0;\n for (
var i = 0; i < splices.length; i++) {\n var splice = splices[i];\n
if (offset != 0) {\n while (index < splice.index) {\n this.
reportInstanceMoved(index);\n index++;\n }\n } else {
\n index = splice.index;\n }\n\n while (index < splice.in
dex + splice.addedCount) {\n this.reportInstanceMoved(index);\n
index++;\n }\n\n offset += splice.addedCount - splice.removed.le
ngth;\n }\n\n if (offset == 0)\n return;\n\n var length =
this.instances.length;\n while (index < length) {\n this.reportInsta
nceMoved(index);\n index++;\n }\n },\n\n closeInstanceBindings
: function(instance) {\n var bindings = instance.bindings_;\n for (var
i = 0; i < bindings.length; i++) {\n bindings[i].close();\n }\n
},\n\n unobserve: function() {\n if (!this.arrayObserver)\n retur
n;\n\n this.arrayObserver.close();\n this.arrayObserver = undefined;\n
},\n\n close: function() {\n if (this.closed)\n return;\n
this.unobserve();\n for (var i = 0; i < this.instances.length; i++) {\n
this.closeInstanceBindings(this.instances[i]);\n }\n\n this.inst
ances.length = 0;\n this.closeDeps();\n this.templateElement_.iterator
_ = undefined;\n this.closed = true;\n }\n };\n\n // Polyfill-specific
API.\n HTMLTemplateElement.forAllTemplatesFrom_ = forAllTemplatesFrom;\n})(thi
s);\n", |
172 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n//
inject style sheet\nvar style = document.createElement('style');\nstyle.textCont
ent = 'template {display: none !important;} /* injected by platform.js */';\nvar
head = document.querySelector('head');\nhead.insertBefore(style, head.firstChil
d);\n\n// flush (with logging)\nvar flushing;\nfunction flush() {\n if (!flushi
ng) {\n flushing = true;\n scope.endOfMicrotask(function() {\n flushi
ng = false;\n logFlags.data && console.group('Platform.flush()');\n sc
ope.performMicrotaskCheckpoint();\n logFlags.data && console.groupEnd();\n
});\n }\n};\n\n// polling dirty checker\n// flush periodically if platform d
oes not have object observe.\nif (!Observer.hasObjectObserve) {\n var FLUSH_POL
L_INTERVAL = 125;\n window.addEventListener('WebComponentsReady', function() {\
n flush();\n scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);\n
});\n} else {\n // make flush a no-op when we have Object.observe\n flush = f
unction() {};\n}\n\nif (window.CustomElements && !CustomElements.useNative) {\n
var originalImportNode = Document.prototype.importNode;\n Document.prototype.i
mportNode = function(node, deep) {\n var imported = originalImportNode.call(t
his, node, deep);\n CustomElements.upgradeAll(imported);\n return imported
;\n }\n}\n\n// exports\nscope.flush = flush;\n\n})(window.Platform);\n\n" | 170 "/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
\n * This code may only be used under the BSD style license found at http://poly
mer.github.io/LICENSE.txt\n * The complete set of authors may be found at http:/
/polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found
at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as
part of the polymer project is also\n * subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n//
inject style sheet\nvar style = document.createElement('style');\nstyle.textCont
ent = 'template {display: none !important;} /* injected by platform.js */';\nvar
head = document.querySelector('head');\nhead.insertBefore(style, head.firstChil
d);\n\n// flush (with logging)\nvar flushing;\nfunction flush() {\n if (!flushi
ng) {\n flushing = true;\n scope.endOfMicrotask(function() {\n flushi
ng = false;\n logFlags.data && console.group('Platform.flush()');\n sc
ope.performMicrotaskCheckpoint();\n logFlags.data && console.groupEnd();\n
});\n }\n};\n\n// polling dirty checker\n// flush periodically if platform d
oes not have object observe.\nif (!Observer.hasObjectObserve) {\n var FLUSH_POL
L_INTERVAL = 125;\n window.addEventListener('WebComponentsReady', function() {\
n flush();\n scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);\n
});\n} else {\n // make flush a no-op when we have Object.observe\n flush = f
unction() {};\n}\n\nif (window.CustomElements && !CustomElements.useNative) {\n
var originalImportNode = Document.prototype.importNode;\n Document.prototype.i
mportNode = function(node, deep) {\n var imported = originalImportNode.call(t
his, node, deep);\n CustomElements.upgradeAll(imported);\n return imported
;\n }\n}\n\n// exports\nscope.flush = flush;\n\n})(window.Platform);\n\n" |
173 ] | 171 ] |
174 } | 172 } |
OLD | NEW |