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 "build/if-poly.js", |
7 "../observe-js/src/observe.js", | 8 "../observe-js/src/observe.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", |
11 "../ShadowDOM/src/MutationObserver.js", | 11 "../ShadowDOM/src/MutationObserver.js", |
12 "../ShadowDOM/src/TreeScope.js", | 12 "../ShadowDOM/src/TreeScope.js", |
13 "../ShadowDOM/src/wrappers/events.js", | 13 "../ShadowDOM/src/wrappers/events.js", |
14 "../ShadowDOM/src/wrappers/TouchEvent.js", | 14 "../ShadowDOM/src/wrappers/TouchEvent.js", |
15 "../ShadowDOM/src/wrappers/NodeList.js", | 15 "../ShadowDOM/src/wrappers/NodeList.js", |
16 "../ShadowDOM/src/wrappers/HTMLCollection.js", | 16 "../ShadowDOM/src/wrappers/HTMLCollection.js", |
17 "../ShadowDOM/src/wrappers/Node.js", | 17 "../ShadowDOM/src/wrappers/Node.js", |
18 "../ShadowDOM/src/querySelector.js", | 18 "../ShadowDOM/src/querySelector.js", |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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", | 60 "../URL/url.js", |
61 "src/lang.js", | 61 "src/lang.js", |
62 "src/dom.js", | 62 "src/dom.js", |
63 "src/template.js", | |
64 "src/inspector.js", | |
65 "src/unresolved.js", | |
66 "src/module.js", | |
67 "src/microtask.js", | |
68 "src/url.js", | |
69 "../MutationObservers/MutationObserver.js", | 63 "../MutationObservers/MutationObserver.js", |
70 "../HTMLImports/src/scope.js", | 64 "../HTMLImports/src/scope.js", |
71 "../HTMLImports/src/base.js", | 65 "../HTMLImports/src/base.js", |
72 "../HTMLImports/src/Loader.js", | 66 "../HTMLImports/src/Loader.js", |
73 "../HTMLImports/src/Parser.js", | 67 "../HTMLImports/src/Parser.js", |
74 "../HTMLImports/src/HTMLImports.js", | 68 "../HTMLImports/src/HTMLImports.js", |
75 "../HTMLImports/src/Observer.js", | 69 "../HTMLImports/src/Observer.js", |
76 "../HTMLImports/src/boot.js", | 70 "../HTMLImports/src/boot.js", |
77 "../CustomElements/src/scope.js", | 71 "../CustomElements/src/scope.js", |
78 "../CustomElements/src/Observer.js", | 72 "../CustomElements/src/Observer.js", |
79 "../CustomElements/src/CustomElements.js", | 73 "../CustomElements/src/CustomElements.js", |
80 "../CustomElements/src/Parser.js", | 74 "../CustomElements/src/Parser.js", |
81 "../CustomElements/src/boot.js", | 75 "../CustomElements/src/boot.js", |
82 "src/patches-custom-elements.js", | 76 "src/patches-custom-elements.js", |
83 "src/loader.js", | 77 "src/unresolved.js", |
84 "src/styleloader.js", | 78 "src/module.js" |
85 "../NodeBind/src/NodeBind.js", | |
86 "../TemplateBinding/src/TemplateBinding.js", | |
87 "src/patches-mdv.js" | |
88 ], | 79 ], |
89 "names": [], | 80 "names": [], |
90 "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;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACrXA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;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;ACv4BA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;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;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;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;A
ACA;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;AACA;A;AC/tBA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;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;AC7QA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;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;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACzCA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACtUA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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
/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;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;ACxCA;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;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;AACA;AACA;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;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;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;ACxEA;AACA;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;ACvBA;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;A;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;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;A
ACA;AACA;AACA;AACA;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;ACpCA;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;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;AACA;AACA;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;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;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;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;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;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;A;ACn
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;A;AChGA;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;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
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;AC5EA;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;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnpBA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;A;ACpEA;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;A;AC5UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;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;ACvFA;AA
CA;AACA;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;A;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC3GA;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;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;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;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACjkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC5IA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACdA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC1DA;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;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;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
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;ACjiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A,sD;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;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;AC3KA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC/KA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACrUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC3LA;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;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;A;ACjCA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA,4D;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC1VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC5dA;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,0B;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;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;A
ACA;AACA;AACA;AACA;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;AChCA;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;ACjHA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;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;ACtVA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACrwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;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", | 81 "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;A;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC9rDA;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;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACrXA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;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;ACv4BA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;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;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;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;A
ACA;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;AACA;A;AC/tBA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;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;AC7QA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;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;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACzCA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACtUA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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
/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;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;ACxCA;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;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;AACA;AACA;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;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;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;ACxEA;AACA;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;ACvBA;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;A;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;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;A
ACA;AACA;AACA;AACA;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;ACpCA;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;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;AACA;AACA;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;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;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;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;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;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;A;ACn
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;A;AChGA;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;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
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;AC5EA;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;AACA;AACA;AAC
A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnpBA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;A;ACpEA;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;A;AC5UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;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;ACvFA;AA
CA;AACA;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;A;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AC3GA;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;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;AACA;AACA;
AACA;AACA;AACA;A;AC3wBA,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;A;AC3BA,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;A;ACjkBA;AACA;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;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;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;ACxFA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;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;ACjiBA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA,sD;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uB;ACjMA;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;A;AC/KA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;ACrUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;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;AC3LA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;A
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;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC
A,4D;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;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;AC1VA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA
CA;AACA;AACA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AA
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;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;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;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A
ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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", |
91 "sourcesContent": [ | 82 "sourcesContent": [ |
92 "/**\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", | 83 "/**\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", |
93 "/*\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", | 84 "/*\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", |
| 85 "// select ShadowDOM impl\r\nif (Platform.flags.shadow) {\r\n", |
94 "// 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", | 86 "// 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", |
95 "// select ShadowDOM impl\r\nif (Platform.flags.shadow) {\r\n", | |
96 "// 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 // The name of the implementation property is intenti
onally hard to\n // remember. Unfortunately, browsers are slower doing obj[expr
] than\n // obj.foo so we resort to repeat this ugly name. This ugly name is ne
ver\n // used outside of this file though.\n\n function getGetter(name) {\n
return hasEval && isIdentifierName(name) ?\n new Function('return this._
_impl4cf1e782hg__.' + name) :\n function() { return this.__impl4cf1e782hg
__[name]; };\n }\n\n function getSetter(name) {\n return hasEval && isIdent
ifierName(name) ?\n new Function('v', 'this.__impl4cf1e782hg__.' + name +
' = v') :\n function(v) { this.__impl4cf1e782hg__[name] = v; };\n }\n\n
function getMethod(name) {\n return hasEval && isIdentifierName(name) ?\n
new Function('return this.__impl4cf1e782hg__.' + name +\n
'.apply(this.__impl4cf1e782hg__, arguments)') :\n function() {\n
return this.__impl4cf1e782hg__[name].apply(\n this.__impl4cf1e
782hg__, arguments);\n };\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 dummyDesc
riptor;\n }\n }\n\n function installProperty(source, target, allowMethod, o
pt_blacklist) {\n var names = getOwnPropertyNames(source);\n for (var i =
0; i < names.length; i++) {\n var name = names[i];\n if (name === 'pol
ymerBlackList_')\n continue;\n\n if (name in target)\n contin
ue;\n\n if (source.polymerBlackList_ && source.polymerBlackList_[name])\n
continue;\n\n if (isFirefox) {\n // Tickle Firefox's old bindi
ngs.\n source.__lookupGetter__(name);\n }\n var descriptor = ge
tDescriptor(source, name);\n var getter, setter;\n if (allowMethod &&
typeof descriptor.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 || desc
riptor.set) {\n if (isEvent)\n setter = scope.getEventHandlerSet
ter(name);\n else\n setter = getSetter(name);\n }\n\n
defineProperty(target, name, {\n get: getter,\n set: setter,\n
configurable: descriptor.configurable,\n enumerable: descriptor.enume
rable\n });\n }\n }\n\n /**\n * @param {Function} nativeConstructor\
n * @param {Function} wrapperConstructor\n * @param {Object=} opt_instance I
f present, this is used to extract\n * properties from an instance object.
\n */\n function register(nativeConstructor, wrapperConstructor, opt_instance
) {\n var nativePrototype = nativeConstructor.prototype;\n registerInterna
l(nativePrototype, wrapperConstructor, opt_instance);\n mixinStatics(wrapperC
onstructor, nativeConstructor);\n }\n\n function registerInternal(nativeProtot
ype, wrapperConstructor, opt_instance) {\n var wrapperPrototype = wrapperCons
tructor.prototype;\n assert(constructorTable.get(nativePrototype) === undefin
ed);\n\n constructorTable.set(nativePrototype, wrapperConstructor);\n nati
vePrototypeTable.set(wrapperPrototype, nativePrototype);\n\n addForwardingPro
perties(nativePrototype, wrapperPrototype);\n if (opt_instance)\n regist
erInstanceProperties(wrapperPrototype, opt_instance);\n\n defineNonEnumerable
DataProperty(\n wrapperPrototype, 'constructor', wrapperConstructor);\n
// Set it again. Some VMs optimizes objects that are used as prototypes.\n
wrapperConstructor.prototype = wrapperPrototype;\n }\n\n function isWrapperFor
(wrapperConstructor, nativeConstructor) {\n return constructorTable.get(nativ
eConstructor.prototype) ===\n wrapperConstructor;\n }\n\n /**\n * Cre
ates a generic wrapper constructor based on |object| and its\n * constructor.\
n * @param {Node} object\n * @return {Function} The generated constructor.\n
*/\n function registerObject(object) {\n var nativePrototype = Object.get
PrototypeOf(object);\n\n var superWrapperConstructor = getWrapperConstructor(
nativePrototype);\n var GeneratedWrapper = createWrapperConstructor(superWrap
perConstructor);\n registerInternal(nativePrototype, GeneratedWrapper, object
);\n\n return GeneratedWrapper;\n }\n\n function createWrapperConstructor(s
uperWrapperConstructor) {\n function GeneratedWrapper(node) {\n superWra
pperConstructor.call(this, node);\n }\n var p = Object.create(superWrapper
Constructor.prototype);\n p.constructor = GeneratedWrapper;\n GeneratedWra
pper.prototype = p;\n\n return GeneratedWrapper;\n }\n\n function isWrapper
(object) {\n return object && object.__impl4cf1e782hg__;\n }\n\n function i
sNative(object) {\n return !isWrapper(object);\n }\n\n /**\n * Wraps a no
de in a WrapperNode. If there already exists a wrapper for the\n * |node| that
wrapper is returned instead.\n * @param {Node} node\n * @return {WrapperNod
e}\n */\n function wrap(impl) {\n if (impl === null)\n return null;\n
\n assert(isNative(impl));\n return impl.__wrapper8e3dd93a60__ ||\n
(impl.__wrapper8e3dd93a60__ = 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 === null)\n return null;\n assert(isWrapper(wrapper));
\n return wrapper.__impl4cf1e782hg__;\n }\n\n function unsafeUnwrap(wrapper
) {\n return wrapper.__impl4cf1e782hg__;\n }\n\n function setWrapper(impl,
wrapper) {\n wrapper.__impl4cf1e782hg__ = impl;\n impl.__wrapper8e3dd93a60
__ = wrapper;\n }\n\n /**\n * Unwraps object if it is a wrapper.\n * @para
m {Object} object\n * @return {Object} The native implementation object.\n *
/\n function unwrapIfNeeded(object) {\n return object && isWrapper(object) ?
unwrap(object) : object;\n }\n\n /**\n * Wraps object if it is not a wrappe
r.\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
any) for node.\n * @param {Node} node\n * @param {WrapperNode=} wrapper If
left out the wrapper will be created as\n * needed next time someone wraps
the node.\n */\n function rewrap(node, wrapper) {\n if (wrapper === null)
\n return;\n assert(isNative(node));\n assert(wrapper === undefined |
| isWrapper(wrapper));\n node.__wrapper8e3dd93a60__ = wrapper;\n }\n\n var
getterDescriptor = {\n get: undefined,\n configurable: true,\n enumerab
le: true\n };\n\n function defineGetter(constructor, name, getter) {\n gett
erDescriptor.get = getter;\n defineProperty(constructor.prototype, name, gett
erDescriptor);\n }\n\n function defineWrapGetter(constructor, name) {\n def
ineGetter(constructor, name, function() {\n return wrap(this.__impl4cf1e782
hg__[name]);\n });\n }\n\n /**\n * Forwards existing methods on the nativ
e object to the wrapper methods.\n * This does not wrap any of the arguments o
r the return value since the\n * wrapper implementation already takes care of
that.\n * @param {Array.<Function>} constructors\n * @parem {Array.<string>}
names\n */\n function forwardMethodsToWrapper(constructors, names) {\n co
nstructors.forEach(function(constructor) {\n names.forEach(function(name) {
\n constructor.prototype[name] = function() {\n var w = wrapIfNe
eded(this);\n return w[name].apply(w, arguments);\n };\n })
;\n });\n }\n\n scope.assert = assert;\n scope.constructorTable = construc
torTable;\n scope.defineGetter = defineGetter;\n scope.defineWrapGetter = defi
neWrapGetter;\n scope.forwardMethodsToWrapper = forwardMethodsToWrapper;\n sco
pe.isWrapper = isWrapper;\n scope.isWrapperFor = isWrapperFor;\n scope.mixin =
mixin;\n scope.nativePrototypeTable = nativePrototypeTable;\n scope.oneOf = o
neOf;\n scope.registerObject = registerObject;\n scope.registerWrapper = regis
ter;\n scope.rewrap = rewrap;\n scope.setWrapper = setWrapper;\n scope.unsafe
Unwrap = unsafeUnwrap;\n scope.unwrap = unwrap;\n scope.unwrapIfNeeded = unwra
pIfNeeded;\n scope.wrap = wrap;\n scope.wrapIfNeeded = wrapIfNeeded;\n scope.
wrappers = wrappers;\n\n})(window.ShadowDOMPolyfill);\n", | 87 "// 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 // The name of the implementation property is intenti
onally hard to\n // remember. Unfortunately, browsers are slower doing obj[expr
] than\n // obj.foo so we resort to repeat this ugly name. This ugly name is ne
ver\n // used outside of this file though.\n\n function getGetter(name) {\n
return hasEval && isIdentifierName(name) ?\n new Function('return this._
_impl4cf1e782hg__.' + name) :\n function() { return this.__impl4cf1e782hg
__[name]; };\n }\n\n function getSetter(name) {\n return hasEval && isIdent
ifierName(name) ?\n new Function('v', 'this.__impl4cf1e782hg__.' + name +
' = v') :\n function(v) { this.__impl4cf1e782hg__[name] = v; };\n }\n\n
function getMethod(name) {\n return hasEval && isIdentifierName(name) ?\n
new Function('return this.__impl4cf1e782hg__.' + name +\n
'.apply(this.__impl4cf1e782hg__, arguments)') :\n function() {\n
return this.__impl4cf1e782hg__[name].apply(\n this.__impl4cf1e
782hg__, arguments);\n };\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 dummyDesc
riptor;\n }\n }\n\n function installProperty(source, target, allowMethod, o
pt_blacklist) {\n var names = getOwnPropertyNames(source);\n for (var i =
0; i < names.length; i++) {\n var name = names[i];\n if (name === 'pol
ymerBlackList_')\n continue;\n\n if (name in target)\n contin
ue;\n\n if (source.polymerBlackList_ && source.polymerBlackList_[name])\n
continue;\n\n if (isFirefox) {\n // Tickle Firefox's old bindi
ngs.\n source.__lookupGetter__(name);\n }\n var descriptor = ge
tDescriptor(source, name);\n var getter, setter;\n if (allowMethod &&
typeof descriptor.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 || desc
riptor.set) {\n if (isEvent)\n setter = scope.getEventHandlerSet
ter(name);\n else\n setter = getSetter(name);\n }\n\n
defineProperty(target, name, {\n get: getter,\n set: setter,\n
configurable: descriptor.configurable,\n enumerable: descriptor.enume
rable\n });\n }\n }\n\n /**\n * @param {Function} nativeConstructor\
n * @param {Function} wrapperConstructor\n * @param {Object=} opt_instance I
f present, this is used to extract\n * properties from an instance object.
\n */\n function register(nativeConstructor, wrapperConstructor, opt_instance
) {\n var nativePrototype = nativeConstructor.prototype;\n registerInterna
l(nativePrototype, wrapperConstructor, opt_instance);\n mixinStatics(wrapperC
onstructor, nativeConstructor);\n }\n\n function registerInternal(nativeProtot
ype, wrapperConstructor, opt_instance) {\n var wrapperPrototype = wrapperCons
tructor.prototype;\n assert(constructorTable.get(nativePrototype) === undefin
ed);\n\n constructorTable.set(nativePrototype, wrapperConstructor);\n nati
vePrototypeTable.set(wrapperPrototype, nativePrototype);\n\n addForwardingPro
perties(nativePrototype, wrapperPrototype);\n if (opt_instance)\n regist
erInstanceProperties(wrapperPrototype, opt_instance);\n\n defineNonEnumerable
DataProperty(\n wrapperPrototype, 'constructor', wrapperConstructor);\n
// Set it again. Some VMs optimizes objects that are used as prototypes.\n
wrapperConstructor.prototype = wrapperPrototype;\n }\n\n function isWrapperFor
(wrapperConstructor, nativeConstructor) {\n return constructorTable.get(nativ
eConstructor.prototype) ===\n wrapperConstructor;\n }\n\n /**\n * Cre
ates a generic wrapper constructor based on |object| and its\n * constructor.\
n * @param {Node} object\n * @return {Function} The generated constructor.\n
*/\n function registerObject(object) {\n var nativePrototype = Object.get
PrototypeOf(object);\n\n var superWrapperConstructor = getWrapperConstructor(
nativePrototype);\n var GeneratedWrapper = createWrapperConstructor(superWrap
perConstructor);\n registerInternal(nativePrototype, GeneratedWrapper, object
);\n\n return GeneratedWrapper;\n }\n\n function createWrapperConstructor(s
uperWrapperConstructor) {\n function GeneratedWrapper(node) {\n superWra
pperConstructor.call(this, node);\n }\n var p = Object.create(superWrapper
Constructor.prototype);\n p.constructor = GeneratedWrapper;\n GeneratedWra
pper.prototype = p;\n\n return GeneratedWrapper;\n }\n\n function isWrapper
(object) {\n return object && object.__impl4cf1e782hg__;\n }\n\n function i
sNative(object) {\n return !isWrapper(object);\n }\n\n /**\n * Wraps a no
de in a WrapperNode. If there already exists a wrapper for the\n * |node| that
wrapper is returned instead.\n * @param {Node} node\n * @return {WrapperNod
e}\n */\n function wrap(impl) {\n if (impl === null)\n return null;\n
\n assert(isNative(impl));\n return impl.__wrapper8e3dd93a60__ ||\n
(impl.__wrapper8e3dd93a60__ = 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 === null)\n return null;\n assert(isWrapper(wrapper));
\n return wrapper.__impl4cf1e782hg__;\n }\n\n function unsafeUnwrap(wrapper
) {\n return wrapper.__impl4cf1e782hg__;\n }\n\n function setWrapper(impl,
wrapper) {\n wrapper.__impl4cf1e782hg__ = impl;\n impl.__wrapper8e3dd93a60
__ = wrapper;\n }\n\n /**\n * Unwraps object if it is a wrapper.\n * @para
m {Object} object\n * @return {Object} The native implementation object.\n *
/\n function unwrapIfNeeded(object) {\n return object && isWrapper(object) ?
unwrap(object) : object;\n }\n\n /**\n * Wraps object if it is not a wrappe
r.\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
any) for node.\n * @param {Node} node\n * @param {WrapperNode=} wrapper If
left out the wrapper will be created as\n * needed next time someone wraps
the node.\n */\n function rewrap(node, wrapper) {\n if (wrapper === null)
\n return;\n assert(isNative(node));\n assert(wrapper === undefined |
| isWrapper(wrapper));\n node.__wrapper8e3dd93a60__ = wrapper;\n }\n\n var
getterDescriptor = {\n get: undefined,\n configurable: true,\n enumerab
le: true\n };\n\n function defineGetter(constructor, name, getter) {\n gett
erDescriptor.get = getter;\n defineProperty(constructor.prototype, name, gett
erDescriptor);\n }\n\n function defineWrapGetter(constructor, name) {\n def
ineGetter(constructor, name, function() {\n return wrap(this.__impl4cf1e782
hg__[name]);\n });\n }\n\n /**\n * Forwards existing methods on the nativ
e object to the wrapper methods.\n * This does not wrap any of the arguments o
r the return value since the\n * wrapper implementation already takes care of
that.\n * @param {Array.<Function>} constructors\n * @parem {Array.<string>}
names\n */\n function forwardMethodsToWrapper(constructors, names) {\n co
nstructors.forEach(function(constructor) {\n names.forEach(function(name) {
\n constructor.prototype[name] = function() {\n var w = wrapIfNe
eded(this);\n return w[name].apply(w, arguments);\n };\n })
;\n });\n }\n\n scope.assert = assert;\n scope.constructorTable = construc
torTable;\n scope.defineGetter = defineGetter;\n scope.defineWrapGetter = defi
neWrapGetter;\n scope.forwardMethodsToWrapper = forwardMethodsToWrapper;\n sco
pe.isWrapper = isWrapper;\n scope.isWrapperFor = isWrapperFor;\n scope.mixin =
mixin;\n scope.nativePrototypeTable = nativePrototypeTable;\n scope.oneOf = o
neOf;\n scope.registerObject = registerObject;\n scope.registerWrapper = regis
ter;\n scope.rewrap = rewrap;\n scope.setWrapper = setWrapper;\n scope.unsafe
Unwrap = unsafeUnwrap;\n scope.unwrap = unwrap;\n scope.unwrapIfNeeded = unwra
pIfNeeded;\n scope.wrap = wrap;\n scope.wrapIfNeeded = wrapIfNeeded;\n scope.
wrappers = wrappers;\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(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", | 88 "/*\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", |
98 "/*\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 constructor: MutationO
bserver,\n\n // http://dom.spec.whatwg.org/#dom-mutationobserver-observe\n
observe: function(target, options) {\n target = wrapIfNeeded(target);\n\n
var newOptions = new MutationObserverOptions(options);\n\n // 6.\n
var registration;\n var registrations = registrationsTable.get(target);\n
if (!registrations)\n registrationsTable.set(target, registrations
= []);\n\n for (var i = 0; i < registrations.length; i++) {\n if (re
gistrations[i].observer === this) {\n registration = registrations[i];\
n // 6.1.\n registration.removeTransientObservers();\n
// 6.2.\n registration.options = newOptions;\n }\n }\n\n
// 7.\n if (!registration) {\n registration = new Registration(
this, target, newOptions);\n registrations.push(registration);\n t
his.nodes_.push(target);\n }\n },\n\n // http://dom.spec.whatwg.org/#
dom-mutationobserver-disconnect\n disconnect: function() {\n this.nodes_
.forEach(function(node) {\n var registrations = registrationsTable.get(no
de);\n for (var i = 0; i < registrations.length; i++) {\n var re
gistration = registrations[i];\n if (registration.observer === this) {\
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 * Class used to represent a registered observer.\n * @param {MutationObse
rver} observer\n * @param {Node} target\n * @param {MutationObserverOptions}
options\n * @constructor\n */\n function Registration(observer, target, op
tions) {\n this.observer = observer;\n this.target = target;\n this.opt
ions = options;\n this.transientObservedNodes = [];\n }\n\n Registration.pr
ototype = {\n /**\n * Adds a transient observer on node. The transient ob
server gets removed\n * next time we deliver the change records.\n * @pa
ram {Node} node\n */\n addTransientObserver: function(node) {\n // D
on't add transient observers on the target itself. We already have all\n //
the required listeners set up on the target.\n if (node === this.target)\n
return;\n\n this.transientObservedNodes.push(node);\n var regi
strations = registrationsTable.get(node);\n if (!registrations)\n re
gistrationsTable.set(node, registrations = []);\n\n // We know that registr
ations does not contain this because we already\n // checked if node === th
is.target.\n registrations.push(this);\n },\n\n removeTransientObserv
ers: function() {\n var transientObservedNodes = this.transientObservedNode
s;\n this.transientObservedNodes = [];\n\n for (var i = 0; i < transie
ntObservedNodes.length; i++) {\n var node = transientObservedNodes[i];\n
var registrations = registrationsTable.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 with\n // this observer.\n
break;\n }\n }\n }\n }\n };\n\n scope.enqueueMutat
ion = enqueueMutation;\n scope.registerTransientObservers = registerTransientOb
servers;\n scope.wrappers.MutationObserver = MutationObserver;\n scope.wrapper
s.MutationRecord = MutationRecord;\n\n})(window.ShadowDOMPolyfill);\n", | 89 "/*\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 constructor: MutationO
bserver,\n\n // http://dom.spec.whatwg.org/#dom-mutationobserver-observe\n
observe: function(target, options) {\n target = wrapIfNeeded(target);\n\n
var newOptions = new MutationObserverOptions(options);\n\n // 6.\n
var registration;\n var registrations = registrationsTable.get(target);\n
if (!registrations)\n registrationsTable.set(target, registrations
= []);\n\n for (var i = 0; i < registrations.length; i++) {\n if (re
gistrations[i].observer === this) {\n registration = registrations[i];\
n // 6.1.\n registration.removeTransientObservers();\n
// 6.2.\n registration.options = newOptions;\n }\n }\n\n
// 7.\n if (!registration) {\n registration = new Registration(
this, target, newOptions);\n registrations.push(registration);\n t
his.nodes_.push(target);\n }\n },\n\n // http://dom.spec.whatwg.org/#
dom-mutationobserver-disconnect\n disconnect: function() {\n this.nodes_
.forEach(function(node) {\n var registrations = registrationsTable.get(no
de);\n for (var i = 0; i < registrations.length; i++) {\n var re
gistration = registrations[i];\n if (registration.observer === this) {\
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 * Class used to represent a registered observer.\n * @param {MutationObse
rver} observer\n * @param {Node} target\n * @param {MutationObserverOptions}
options\n * @constructor\n */\n function Registration(observer, target, op
tions) {\n this.observer = observer;\n this.target = target;\n this.opt
ions = options;\n this.transientObservedNodes = [];\n }\n\n Registration.pr
ototype = {\n /**\n * Adds a transient observer on node. The transient ob
server gets removed\n * next time we deliver the change records.\n * @pa
ram {Node} node\n */\n addTransientObserver: function(node) {\n // D
on't add transient observers on the target itself. We already have all\n //
the required listeners set up on the target.\n if (node === this.target)\n
return;\n\n this.transientObservedNodes.push(node);\n var regi
strations = registrationsTable.get(node);\n if (!registrations)\n re
gistrationsTable.set(node, registrations = []);\n\n // We know that registr
ations does not contain this because we already\n // checked if node === th
is.target.\n registrations.push(this);\n },\n\n removeTransientObserv
ers: function() {\n var transientObservedNodes = this.transientObservedNode
s;\n this.transientObservedNodes = [];\n\n for (var i = 0; i < transie
ntObservedNodes.length; i++) {\n var node = transientObservedNodes[i];\n
var registrations = registrationsTable.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 with\n // this observer.\n
break;\n }\n }\n }\n }\n };\n\n scope.enqueueMutat
ion = enqueueMutation;\n scope.registerTransientObservers = registerTransientOb
servers;\n scope.wrappers.MutationObserver = MutationObserver;\n scope.wrapper
s.MutationRecord = MutationRecord;\n\n})(window.ShadowDOMPolyfill);\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 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", | 90 "/**\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", |
100 "// 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 setWrapper = scope.setWrapper;\n var unsafeUnwrap = scope.unsafeUnwrap;\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 }\n setWrapper(impl, this);
\n } else {\n return wrap(constructEvent(OriginalEvent, 'Event', type, o
ptions));\n }\n }\n Event.prototype = {\n get target() {\n return t
argetTable.get(this);\n },\n get currentTarget() {\n return currentTa
rgetTable.get(this);\n },\n get eventPhase() {\n return eventPhaseTab
le.get(this);\n },\n get path() {\n var eventPath = eventPathTable.ge
t(this);\n if (!eventPath)\n return [];\n // TODO(arv): Event p
ath should contain window.\n return eventPath.slice();\n },\n stopPro
pagation: function() {\n stopPropagationTable.set(this, true);\n },\n
stopImmediatePropagation: function() {\n stopPropagationTable.set(this, tr
ue);\n stopImmediatePropagationTable.set(this, true);\n }\n };\n regis
terWrapper(OriginalEvent, Event, document.createEvent('Event'));\n\n function u
nwrapOptions(options) {\n if (!options || !options.relatedTarget)\n retu
rn options;\n return Object.create(options, {\n relatedTarget: {value: u
nwrap(options.relatedTarget)}\n });\n }\n\n function registerGenericEvent(n
ame, SuperEvent, prototype) {\n var OriginalEvent = window[name];\n var Ge
nericEvent = function(type, options) {\n if (type instanceof OriginalEvent)
\n setWrapper(type, this);\n else\n return wrap(constructEven
t(OriginalEvent, name, type, options));\n };\n GenericEvent.prototype = Ob
ject.create(SuperEvent.prototype);\n if (prototype)\n mixin(GenericEvent
.prototype, prototype);\n if (OriginalEvent) {\n // - Old versions of Sa
fari fails on new FocusEvent (and others?).\n // - IE does not support even
t constructors.\n // - createEvent('FocusEvent') throws in Firefox.\n
// => Try the best practice solution first and fallback to the old way\n //
if needed.\n try {\n registerWrapper(OriginalEvent, GenericEvent, n
ew OriginalEvent('temp'));\n } catch (ex) {\n registerWrapper(Origin
alEvent, GenericEvent,\n document.createEvent(name));\n
}\n }\n return GenericEvent;\n }\n\n var UIEvent = registerGenericEv
ent('UIEvent', Event);\n var CustomEvent = registerGenericEvent('CustomEvent',
Event);\n\n var relatedTargetProto = {\n get relatedTarget() {\n var re
latedTarget = relatedTargetTable.get(this);\n // relatedTarget can be null.
\n if (relatedTarget !== undefined)\n return relatedTarget;\n r
eturn wrap(unwrap(this).relatedTarget);\n }\n };\n\n function getInitFuncti
on(name, relatedTargetIndex) {\n return function() {\n arguments[related
TargetIndex] = unwrap(arguments[relatedTargetIndex]);\n var impl = unwrap(t
his);\n impl[name].apply(impl, arguments);\n };\n }\n\n var mouseEvent
Proto = mixin({\n initMouseEvent: getInitFunction('initMouseEvent', 14)\n },
relatedTargetProto);\n\n var focusEventProto = mixin({\n initFocusEvent: ge
tInitFunction('initFocusEvent', 5)\n }, relatedTargetProto);\n\n var MouseEven
t = registerGenericEvent('MouseEvent', UIEvent, mouseEventProto);\n var FocusEv
ent = registerGenericEvent('FocusEvent', UIEvent, focusEventProto);\n\n // In c
ase the browser does not support event constructors we polyfill that\n // by ca
lling `createEvent('Foo')` and `initFooEvent` where the arguments to\n // `init
FooEvent` are derived from the registered default event init dict.\n var defaul
tInitDicts = Object.create(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 ne
w native event.\n */\n function constructEvent(OriginalEvent, name, type, opt
ions) {\n if (supportsEventConstructors)\n return new OriginalEvent(type
, unwrapOptions(options));\n\n // Create the arguments from the default dicti
onary.\n var event = unwrap(document.createEvent(name));\n var defaultDict
= defaultInitDicts[name];\n var args = [type];\n Object.keys(defaultDict)
.forEach(function(key) {\n var v = options != null && key in options ?\n
options[key] : defaultDict[key];\n if (key === 'relatedTarget')\n
v = unwrap(v);\n args.push(v);\n });\n event['init' + name].appl
y(event, args);\n return event;\n }\n\n if (!supportsEventConstructors) {\n
var configureEventConstructor = function(name, initDict, superName) {\n
if (superName) {\n var superDict = defaultInitDicts[superName];\n
initDict = mixin(mixin({}, superDict), initDict);\n }\n\n defaultInit
Dicts[name] = initDict;\n };\n\n // The order of the default event init di
ctionary keys is important, the\n // arguments to initFooEvent is derived fro
m that.\n configureEventConstructor('Event', {bubbles: false, cancelable: fal
se});\n configureEventConstructor('CustomEvent', {detail: null}, 'Event');\n
configureEventConstructor('UIEvent', {view: null, detail: 0}, 'Event');\n
configureEventConstructor('MouseEvent', {\n screenX: 0,\n screenY: 0,\
n clientX: 0,\n clientY: 0,\n ctrlKey: false,\n altKey: fals
e,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relat
edTarget: null\n }, 'UIEvent');\n configureEventConstructor('FocusEvent',
{relatedTarget: null}, 'UIEvent');\n }\n\n // Safari 7 does not yet have Befor
eUnloadEvent.\n // https://bugs.webkit.org/show_bug.cgi?id=120849\n var Origin
alBeforeUnloadEvent = window.BeforeUnloadEvent;\n\n function BeforeUnloadEvent(
impl) {\n Event.call(this, impl);\n }\n BeforeUnloadEvent.prototype = Objec
t.create(Event.prototype);\n mixin(BeforeUnloadEvent.prototype, {\n get retu
rnValue() {\n return unsafeUnwrap(this).returnValue;\n },\n set retur
nValue(v) {\n unsafeUnwrap(this).returnValue = v;\n }\n });\n\n if (Or
iginalBeforeUnloadEvent)\n registerWrapper(OriginalBeforeUnloadEvent, BeforeU
nloadEvent);\n\n function isValidListener(fun) {\n if (typeof fun === 'funct
ion')\n return true;\n return fun && fun.handleEvent;\n }\n\n function
isMutationEvent(type) {\n switch (type) {\n case 'DOMAttrModified':\n
case 'DOMAttributeNameChanged':\n case 'DOMCharacterDataModified':\n
case 'DOMElementNameChanged':\n case 'DOMNodeInserted':\n case 'DOM
NodeInsertedIntoDocument':\n case 'DOMNodeRemoved':\n case 'DOMNodeRem
ovedFromDocument':\n case 'DOMSubtreeModified':\n return true;\n
}\n return false;\n }\n\n var OriginalEventTarget = window.EventTarget;\n\n
/**\n * This represents a wrapper for an EventTarget.\n * @param {!EventTa
rget} impl The original event target.\n * @constructor\n */\n function Even
tTarget(impl) {\n setWrapper(impl, this);\n }\n\n // Node and Window have d
ifferent internal type checks in WebKit so we cannot\n // use the same method a
s the original function.\n var methodNames = [\n 'addEventListener',\n 'r
emoveEventListener',\n 'dispatchEvent'\n ];\n\n [Node, Window].forEach(func
tion(constructor) {\n var p = constructor.prototype;\n methodNames.forEach
(function(name) {\n Object.defineProperty(p, name + '_', {value: p[name]});
\n });\n });\n\n function getTargetToListenAt(wrapper) {\n if (wrapper i
nstanceof wrappers.ShadowRoot)\n wrapper = wrapper.host;\n return unwrap
(wrapper);\n }\n\n EventTarget.prototype = {\n addEventListener: function(t
ype, fun, capture) {\n if (!isValidListener(fun) || isMutationEvent(type))\
n return;\n\n var listener = new Listener(type, fun, capture);\n
var listeners = listenersTable.get(this);\n if (!listeners) {\n li
steners = [];\n listeners.depth = 0;\n listenersTable.set(this, li
steners);\n } else {\n // Might have 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_(t
ype, dispatchOriginalEvent, true);\n },\n removeEventListener: function(ty
pe, fun, capture) {\n capture = Boolean(capture);\n var listeners = li
stenersTable.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 target = getTargetToListenAt(this);
\n target.removeEventListener_(type, dispatchOriginalEvent, true);\n
}\n },\n dispatchEvent: function(event) {\n // We want to use the na
tive dispatchEvent because it triggers the default\n // actions (like check
ing a checkbox). However, if there are no listeners\n // in the composed tr
ee then there are no events that will trigger and\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 w
e add\n // a temporary listener to the target which makes us get called bac
k even\n // in that case.\n\n var nativeEvent = unwrap(event);\n
var eventType = nativeEvent.type;\n\n // Allow dispatching the same event a
gain. This is safe because if user\n // code calls this during an existing
dispatch of the same event the\n // native dispatchEvent throws (that is re
quired by the spec).\n handledEventsTable.set(nativeEvent, false);\n\n
// Force rendering since we prefer native dispatch and that works on the\n
// composed tree.\n scope.renderAllPending();\n\n var tempListener;\n
if (!hasListenerInAncestors(this, eventType)) {\n tempListener = fu
nction() {};\n this.addEventListener(eventType, 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 = listenersTable.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 hasListenerInAncestors(target, type) {\n
for (var node = unwrap(target); node; node = node.parentNode) {\n if (ha
sListener(wrap(node), type))\n return true;\n }\n return false;\n
}\n\n if (OriginalEventTarget)\n registerWrapper(OriginalEventTarget, EventT
arget);\n\n function wrapEventTargetMethods(constructors) {\n forwardMethods
ToWrapper(constructors, methodNames);\n }\n\n var originalElementFromPoint = d
ocument.elementFromPoint;\n\n function elementFromPoint(self, document, x, y) {
\n scope.renderAllPending();\n\n var element =\n wrap(originalEleme
ntFromPoint.call(unsafeUnwrap(document), x, y));\n if (!element)\n retur
n null;\n var path = getEventPath(element, null);\n\n // scope the path to
this TreeScope\n var idx = path.lastIndexOf(self);\n if (idx == -1)\n
return null;\n else\n path = path.slice(0, idx);\n\n // TODO(dfreed
m): pass idx to eventRetargetting to avoid array copy\n return eventRetargett
ing(path, self);\n }\n\n /**\n * Returns a function that is to be used as a
getter for `onfoo` properties.\n * @param {string} name\n * @return {Functio
n}\n */\n function getEventHandlerGetter(name) {\n return function() {\n
var inlineEventHandlers = eventHandlersTable.get(this);\n return inline
EventHandlers && inlineEventHandlers[name] &&\n inlineEventHandlers[nam
e].value || null;\n };\n }\n\n /**\n * Returns a function that is to be
used as a setter for `onfoo` properties.\n * @param {string} name\n * @retur
n {Function}\n */\n function getEventHandlerSetter(name) {\n var eventType
= name.slice(2);\n return function(value) {\n var inlineEventHandlers =
eventHandlersTable.get(this);\n if (!inlineEventHandlers) {\n inlin
eEventHandlers = Object.create(null);\n eventHandlersTable.set(this, inli
neEventHandlers);\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 = function(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 // mouseover uses true f
or preventDefault but preventDefault for\n // mouseover is ignored by b
rowsers these day.\n };\n\n this.addEventListener(eventType, wrapp
ed, false);\n inlineEventHandlers[name] = {\n value: value,\n
wrapped: wrapped\n };\n }\n };\n }\n\n scope.elementFrom
Point = elementFromPoint;\n scope.getEventHandlerGetter = getEventHandlerGetter
;\n scope.getEventHandlerSetter = getEventHandlerSetter;\n scope.wrapEventTarg
etMethods = wrapEventTargetMethods;\n scope.wrappers.BeforeUnloadEvent = Before
UnloadEvent;\n scope.wrappers.CustomEvent = CustomEvent;\n scope.wrappers.Even
t = Event;\n scope.wrappers.EventTarget = EventTarget;\n scope.wrappers.FocusE
vent = FocusEvent;\n scope.wrappers.MouseEvent = MouseEvent;\n scope.wrappers.
UIEvent = UIEvent;\n\n})(window.ShadowDOMPolyfill);\n", | 91 "// 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 setWrapper = scope.setWrapper;\n var unsafeUnwrap = scope.unsafeUnwrap;\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 }\n setWrapper(impl, this);
\n } else {\n return wrap(constructEvent(OriginalEvent, 'Event', type, o
ptions));\n }\n }\n Event.prototype = {\n get target() {\n return t
argetTable.get(this);\n },\n get currentTarget() {\n return currentTa
rgetTable.get(this);\n },\n get eventPhase() {\n return eventPhaseTab
le.get(this);\n },\n get path() {\n var eventPath = eventPathTable.ge
t(this);\n if (!eventPath)\n return [];\n // TODO(arv): Event p
ath should contain window.\n return eventPath.slice();\n },\n stopPro
pagation: function() {\n stopPropagationTable.set(this, true);\n },\n
stopImmediatePropagation: function() {\n stopPropagationTable.set(this, tr
ue);\n stopImmediatePropagationTable.set(this, true);\n }\n };\n regis
terWrapper(OriginalEvent, Event, document.createEvent('Event'));\n\n function u
nwrapOptions(options) {\n if (!options || !options.relatedTarget)\n retu
rn options;\n return Object.create(options, {\n relatedTarget: {value: u
nwrap(options.relatedTarget)}\n });\n }\n\n function registerGenericEvent(n
ame, SuperEvent, prototype) {\n var OriginalEvent = window[name];\n var Ge
nericEvent = function(type, options) {\n if (type instanceof OriginalEvent)
\n setWrapper(type, this);\n else\n return wrap(constructEven
t(OriginalEvent, name, type, options));\n };\n GenericEvent.prototype = Ob
ject.create(SuperEvent.prototype);\n if (prototype)\n mixin(GenericEvent
.prototype, prototype);\n if (OriginalEvent) {\n // - Old versions of Sa
fari fails on new FocusEvent (and others?).\n // - IE does not support even
t constructors.\n // - createEvent('FocusEvent') throws in Firefox.\n
// => Try the best practice solution first and fallback to the old way\n //
if needed.\n try {\n registerWrapper(OriginalEvent, GenericEvent, n
ew OriginalEvent('temp'));\n } catch (ex) {\n registerWrapper(Origin
alEvent, GenericEvent,\n document.createEvent(name));\n
}\n }\n return GenericEvent;\n }\n\n var UIEvent = registerGenericEv
ent('UIEvent', Event);\n var CustomEvent = registerGenericEvent('CustomEvent',
Event);\n\n var relatedTargetProto = {\n get relatedTarget() {\n var re
latedTarget = relatedTargetTable.get(this);\n // relatedTarget can be null.
\n if (relatedTarget !== undefined)\n return relatedTarget;\n r
eturn wrap(unwrap(this).relatedTarget);\n }\n };\n\n function getInitFuncti
on(name, relatedTargetIndex) {\n return function() {\n arguments[related
TargetIndex] = unwrap(arguments[relatedTargetIndex]);\n var impl = unwrap(t
his);\n impl[name].apply(impl, arguments);\n };\n }\n\n var mouseEvent
Proto = mixin({\n initMouseEvent: getInitFunction('initMouseEvent', 14)\n },
relatedTargetProto);\n\n var focusEventProto = mixin({\n initFocusEvent: ge
tInitFunction('initFocusEvent', 5)\n }, relatedTargetProto);\n\n var MouseEven
t = registerGenericEvent('MouseEvent', UIEvent, mouseEventProto);\n var FocusEv
ent = registerGenericEvent('FocusEvent', UIEvent, focusEventProto);\n\n // In c
ase the browser does not support event constructors we polyfill that\n // by ca
lling `createEvent('Foo')` and `initFooEvent` where the arguments to\n // `init
FooEvent` are derived from the registered default event init dict.\n var defaul
tInitDicts = Object.create(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 ne
w native event.\n */\n function constructEvent(OriginalEvent, name, type, opt
ions) {\n if (supportsEventConstructors)\n return new OriginalEvent(type
, unwrapOptions(options));\n\n // Create the arguments from the default dicti
onary.\n var event = unwrap(document.createEvent(name));\n var defaultDict
= defaultInitDicts[name];\n var args = [type];\n Object.keys(defaultDict)
.forEach(function(key) {\n var v = options != null && key in options ?\n
options[key] : defaultDict[key];\n if (key === 'relatedTarget')\n
v = unwrap(v);\n args.push(v);\n });\n event['init' + name].appl
y(event, args);\n return event;\n }\n\n if (!supportsEventConstructors) {\n
var configureEventConstructor = function(name, initDict, superName) {\n
if (superName) {\n var superDict = defaultInitDicts[superName];\n
initDict = mixin(mixin({}, superDict), initDict);\n }\n\n defaultInit
Dicts[name] = initDict;\n };\n\n // The order of the default event init di
ctionary keys is important, the\n // arguments to initFooEvent is derived fro
m that.\n configureEventConstructor('Event', {bubbles: false, cancelable: fal
se});\n configureEventConstructor('CustomEvent', {detail: null}, 'Event');\n
configureEventConstructor('UIEvent', {view: null, detail: 0}, 'Event');\n
configureEventConstructor('MouseEvent', {\n screenX: 0,\n screenY: 0,\
n clientX: 0,\n clientY: 0,\n ctrlKey: false,\n altKey: fals
e,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relat
edTarget: null\n }, 'UIEvent');\n configureEventConstructor('FocusEvent',
{relatedTarget: null}, 'UIEvent');\n }\n\n // Safari 7 does not yet have Befor
eUnloadEvent.\n // https://bugs.webkit.org/show_bug.cgi?id=120849\n var Origin
alBeforeUnloadEvent = window.BeforeUnloadEvent;\n\n function BeforeUnloadEvent(
impl) {\n Event.call(this, impl);\n }\n BeforeUnloadEvent.prototype = Objec
t.create(Event.prototype);\n mixin(BeforeUnloadEvent.prototype, {\n get retu
rnValue() {\n return unsafeUnwrap(this).returnValue;\n },\n set retur
nValue(v) {\n unsafeUnwrap(this).returnValue = v;\n }\n });\n\n if (Or
iginalBeforeUnloadEvent)\n registerWrapper(OriginalBeforeUnloadEvent, BeforeU
nloadEvent);\n\n function isValidListener(fun) {\n if (typeof fun === 'funct
ion')\n return true;\n return fun && fun.handleEvent;\n }\n\n function
isMutationEvent(type) {\n switch (type) {\n case 'DOMAttrModified':\n
case 'DOMAttributeNameChanged':\n case 'DOMCharacterDataModified':\n
case 'DOMElementNameChanged':\n case 'DOMNodeInserted':\n case 'DOM
NodeInsertedIntoDocument':\n case 'DOMNodeRemoved':\n case 'DOMNodeRem
ovedFromDocument':\n case 'DOMSubtreeModified':\n return true;\n
}\n return false;\n }\n\n var OriginalEventTarget = window.EventTarget;\n\n
/**\n * This represents a wrapper for an EventTarget.\n * @param {!EventTa
rget} impl The original event target.\n * @constructor\n */\n function Even
tTarget(impl) {\n setWrapper(impl, this);\n }\n\n // Node and Window have d
ifferent internal type checks in WebKit so we cannot\n // use the same method a
s the original function.\n var methodNames = [\n 'addEventListener',\n 'r
emoveEventListener',\n 'dispatchEvent'\n ];\n\n [Node, Window].forEach(func
tion(constructor) {\n var p = constructor.prototype;\n methodNames.forEach
(function(name) {\n Object.defineProperty(p, name + '_', {value: p[name]});
\n });\n });\n\n function getTargetToListenAt(wrapper) {\n if (wrapper i
nstanceof wrappers.ShadowRoot)\n wrapper = wrapper.host;\n return unwrap
(wrapper);\n }\n\n EventTarget.prototype = {\n addEventListener: function(t
ype, fun, capture) {\n if (!isValidListener(fun) || isMutationEvent(type))\
n return;\n\n var listener = new Listener(type, fun, capture);\n
var listeners = listenersTable.get(this);\n if (!listeners) {\n li
steners = [];\n listeners.depth = 0;\n listenersTable.set(this, li
steners);\n } else {\n // Might have 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_(t
ype, dispatchOriginalEvent, true);\n },\n removeEventListener: function(ty
pe, fun, capture) {\n capture = Boolean(capture);\n var listeners = li
stenersTable.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 target = getTargetToListenAt(this);
\n target.removeEventListener_(type, dispatchOriginalEvent, true);\n
}\n },\n dispatchEvent: function(event) {\n // We want to use the na
tive dispatchEvent because it triggers the default\n // actions (like check
ing a checkbox). However, if there are no listeners\n // in the composed tr
ee then there are no events that will trigger and\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 w
e add\n // a temporary listener to the target which makes us get called bac
k even\n // in that case.\n\n var nativeEvent = unwrap(event);\n
var eventType = nativeEvent.type;\n\n // Allow dispatching the same event a
gain. This is safe because if user\n // code calls this during an existing
dispatch of the same event the\n // native dispatchEvent throws (that is re
quired by the spec).\n handledEventsTable.set(nativeEvent, false);\n\n
// Force rendering since we prefer native dispatch and that works on the\n
// composed tree.\n scope.renderAllPending();\n\n var tempListener;\n
if (!hasListenerInAncestors(this, eventType)) {\n tempListener = fu
nction() {};\n this.addEventListener(eventType, 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 = listenersTable.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 hasListenerInAncestors(target, type) {\n
for (var node = unwrap(target); node; node = node.parentNode) {\n if (ha
sListener(wrap(node), type))\n return true;\n }\n return false;\n
}\n\n if (OriginalEventTarget)\n registerWrapper(OriginalEventTarget, EventT
arget);\n\n function wrapEventTargetMethods(constructors) {\n forwardMethods
ToWrapper(constructors, methodNames);\n }\n\n var originalElementFromPoint = d
ocument.elementFromPoint;\n\n function elementFromPoint(self, document, x, y) {
\n scope.renderAllPending();\n\n var element =\n wrap(originalEleme
ntFromPoint.call(unsafeUnwrap(document), x, y));\n if (!element)\n retur
n null;\n var path = getEventPath(element, null);\n\n // scope the path to
this TreeScope\n var idx = path.lastIndexOf(self);\n if (idx == -1)\n
return null;\n else\n path = path.slice(0, idx);\n\n // TODO(dfreed
m): pass idx to eventRetargetting to avoid array copy\n return eventRetargett
ing(path, self);\n }\n\n /**\n * Returns a function that is to be used as a
getter for `onfoo` properties.\n * @param {string} name\n * @return {Functio
n}\n */\n function getEventHandlerGetter(name) {\n return function() {\n
var inlineEventHandlers = eventHandlersTable.get(this);\n return inline
EventHandlers && inlineEventHandlers[name] &&\n inlineEventHandlers[nam
e].value || null;\n };\n }\n\n /**\n * Returns a function that is to be
used as a setter for `onfoo` properties.\n * @param {string} name\n * @retur
n {Function}\n */\n function getEventHandlerSetter(name) {\n var eventType
= name.slice(2);\n return function(value) {\n var inlineEventHandlers =
eventHandlersTable.get(this);\n if (!inlineEventHandlers) {\n inlin
eEventHandlers = Object.create(null);\n eventHandlersTable.set(this, inli
neEventHandlers);\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 = function(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 // mouseover uses true f
or preventDefault but preventDefault for\n // mouseover is ignored by b
rowsers these day.\n };\n\n this.addEventListener(eventType, wrapp
ed, false);\n inlineEventHandlers[name] = {\n value: value,\n
wrapped: wrapped\n };\n }\n };\n }\n\n scope.elementFrom
Point = elementFromPoint;\n scope.getEventHandlerGetter = getEventHandlerGetter
;\n scope.getEventHandlerSetter = getEventHandlerSetter;\n scope.wrapEventTarg
etMethods = wrapEventTargetMethods;\n scope.wrappers.BeforeUnloadEvent = Before
UnloadEvent;\n scope.wrappers.CustomEvent = CustomEvent;\n scope.wrappers.Even
t = Event;\n scope.wrappers.EventTarget = EventTarget;\n scope.wrappers.FocusE
vent = FocusEvent;\n scope.wrappers.MouseEvent = MouseEvent;\n scope.wrappers.
UIEvent = UIEvent;\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 var UIEvent = s
cope.wrappers.UIEvent;\n var mixin = scope.mixin;\n var registerWrapper = scop
e.registerWrapper;\n var setWrapper = scope.setWrapper;\n var unsafeUnwrap = s
cope.unsafeUnwrap;\n var wrap = scope.wrap;\n\n // TouchEvent is WebKit/Blink
only.\n var OriginalTouchEvent = window.TouchEvent;\n if (!OriginalTouchEvent)
\n return;\n\n var nativeEvent;\n try {\n nativeEvent = document.createE
vent('TouchEvent');\n } catch (ex) {\n // In Chrome creating a TouchEvent fa
ils if the feature is not turned on\n // which it isn't on desktop Chrome.\n
return;\n }\n\n var nonEnumDescriptor = {enumerable: false};\n\n function
nonEnum(obj, prop) {\n Object.defineProperty(obj, prop, nonEnumDescriptor);\n
}\n\n function Touch(impl) {\n setWrapper(impl, this);\n }\n\n Touch.pro
totype = {\n get target() {\n return wrap(unsafeUnwrap(this).target);\n
}\n };\n\n var descr = {\n configurable: true,\n enumerable: true,\n
get: null\n };\n\n [\n 'clientX',\n 'clientY',\n 'screenX',\n '
screenY',\n 'pageX',\n 'pageY',\n 'identifier',\n 'webkitRadiusX',\n
'webkitRadiusY',\n 'webkitRotationAngle',\n 'webkitForce'\n ].forEach
(function(name) {\n descr.get = function() {\n return unsafeUnwrap(this)
[name];\n };\n Object.defineProperty(Touch.prototype, name, descr);\n });
\n\n function TouchList() {\n this.length = 0;\n nonEnum(this, 'length');
\n }\n\n TouchList.prototype = {\n item: function(index) {\n return th
is[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(this, imp
l);\n }\n\n TouchEvent.prototype = Object.create(UIEvent.prototype);\n\n mixi
n(TouchEvent.prototype, {\n get touches() {\n return wrapTouchList(unsaf
eUnwrap(this).touches);\n },\n\n get targetTouches() {\n return wrapT
ouchList(unsafeUnwrap(this).targetTouches);\n },\n\n get changedTouches()
{\n return wrapTouchList(unsafeUnwrap(this).changedTouches);\n },\n\n
initTouchEvent: function() {\n // The only way to use this is to reuse the
TouchList from an existing\n // TouchEvent. Since this is WebKit/Blink pro
prietary API we will not\n // implement this until someone screams.\n
throw new Error('Not implemented');\n }\n });\n\n registerWrapper(OriginalT
ouchEvent, TouchEvent, nativeEvent);\n\n scope.wrappers.Touch = Touch;\n scope
.wrappers.TouchEvent = TouchEvent;\n scope.wrappers.TouchList = TouchList;\n\n}
)(window.ShadowDOMPolyfill);\n\n", | 92 "/*\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 setWrapper = scope.setWrapper;\n var unsafeUnwrap = s
cope.unsafeUnwrap;\n var wrap = scope.wrap;\n\n // TouchEvent is WebKit/Blink
only.\n var OriginalTouchEvent = window.TouchEvent;\n if (!OriginalTouchEvent)
\n return;\n\n var nativeEvent;\n try {\n nativeEvent = document.createE
vent('TouchEvent');\n } catch (ex) {\n // In Chrome creating a TouchEvent fa
ils if the feature is not turned on\n // which it isn't on desktop Chrome.\n
return;\n }\n\n var nonEnumDescriptor = {enumerable: false};\n\n function
nonEnum(obj, prop) {\n Object.defineProperty(obj, prop, nonEnumDescriptor);\n
}\n\n function Touch(impl) {\n setWrapper(impl, this);\n }\n\n Touch.pro
totype = {\n get target() {\n return wrap(unsafeUnwrap(this).target);\n
}\n };\n\n var descr = {\n configurable: true,\n enumerable: true,\n
get: null\n };\n\n [\n 'clientX',\n 'clientY',\n 'screenX',\n '
screenY',\n 'pageX',\n 'pageY',\n 'identifier',\n 'webkitRadiusX',\n
'webkitRadiusY',\n 'webkitRotationAngle',\n 'webkitForce'\n ].forEach
(function(name) {\n descr.get = function() {\n return unsafeUnwrap(this)
[name];\n };\n Object.defineProperty(Touch.prototype, name, descr);\n });
\n\n function TouchList() {\n this.length = 0;\n nonEnum(this, 'length');
\n }\n\n TouchList.prototype = {\n item: function(index) {\n return th
is[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(this, imp
l);\n }\n\n TouchEvent.prototype = Object.create(UIEvent.prototype);\n\n mixi
n(TouchEvent.prototype, {\n get touches() {\n return wrapTouchList(unsaf
eUnwrap(this).touches);\n },\n\n get targetTouches() {\n return wrapT
ouchList(unsafeUnwrap(this).targetTouches);\n },\n\n get changedTouches()
{\n return wrapTouchList(unsafeUnwrap(this).changedTouches);\n },\n\n
initTouchEvent: function() {\n // The only way to use this is to reuse the
TouchList from an existing\n // TouchEvent. Since this is WebKit/Blink pro
prietary API we will not\n // implement this until someone screams.\n
throw new Error('Not implemented');\n }\n });\n\n registerWrapper(OriginalT
ouchEvent, TouchEvent, nativeEvent);\n\n scope.wrappers.Touch = Touch;\n scope
.wrappers.TouchEvent = TouchEvent;\n scope.wrappers.TouchList = TouchList;\n\n}
)(window.ShadowDOMPolyfill);\n\n", |
102 "// 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 unsafeUnwrap = scope
.unsafeUnwrap;\n var wrap = scope.wrap;\n\n var nonEnumDescriptor = {enumerabl
e: false};\n\n function nonEnum(obj, prop) {\n Object.defineProperty(obj, pr
op, nonEnumDescriptor);\n }\n\n function NodeList() {\n this.length = 0;\n
nonEnum(this, 'length');\n }\n NodeList.prototype = {\n item: function(i
ndex) {\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 wrapperList[i] = wrap(list[i]);\n }\n wr
apperList.length = length;\n return wrapperList;\n }\n\n function addWrapNo
deListMethod(wrapperConstructor, name) {\n wrapperConstructor.prototype[name]
= function() {\n return wrapNodeList(\n unsafeUnwrap(this)[name].
apply(unsafeUnwrap(this), arguments));\n };\n }\n\n scope.wrappers.NodeList
= NodeList;\n scope.addWrapNodeListMethod = addWrapNodeListMethod;\n scope.wr
apNodeList = wrapNodeList;\n\n})(window.ShadowDOMPolyfill);\n", | 93 "// 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 unsafeUnwrap = scope
.unsafeUnwrap;\n var wrap = scope.wrap;\n\n var nonEnumDescriptor = {enumerabl
e: false};\n\n function nonEnum(obj, prop) {\n Object.defineProperty(obj, pr
op, nonEnumDescriptor);\n }\n\n function NodeList() {\n this.length = 0;\n
nonEnum(this, 'length');\n }\n NodeList.prototype = {\n item: function(i
ndex) {\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 wrapperList[i] = wrap(list[i]);\n }\n wr
apperList.length = length;\n return wrapperList;\n }\n\n function addWrapNo
deListMethod(wrapperConstructor, name) {\n wrapperConstructor.prototype[name]
= function() {\n return wrapNodeList(\n unsafeUnwrap(this)[name].
apply(unsafeUnwrap(this), arguments));\n };\n }\n\n scope.wrappers.NodeList
= NodeList;\n scope.addWrapNodeListMethod = addWrapNodeListMethod;\n scope.wr
apNodeList = wrapNodeList;\n\n})(window.ShadowDOMPolyfill);\n", |
103 "/*\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", | 94 "/*\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", |
104 "/**\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 unsafeUnwrap = scope.unsafeUnwrap;\n var unwrap
= scope.unwrap;\n var unwrapIfNeeded = scope.unwrapIfNeeded;\n var wrap = sco
pe.wrap;\n var wrapIfNeeded = scope.wrapIfNeeded;\n var wrappers = scope.wrapp
ers;\n\n function assertIsNodeWrapper(node) {\n assert(node instanceof Node)
;\n }\n\n function createOneElementNodeList(node) {\n var nodes = new NodeL
ist();\n nodes[0] = node;\n nodes.length = 1;\n return nodes;\n }\n\n
var surpressMutations = false;\n\n /**\n * Called before node is inserted in
to 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 pare
nt node that the node is being removed from.\n * @param {!NodeList} nodes The
collected nodes.\n */\n function enqueueRemovalForInsertedNodes(node, parent,
nodes) {\n enqueueMutation(parent, 'childList', {\n removedNodes: nodes
,\n previousSibling: node.previousSibling,\n nextSibling: node.nextSib
ling\n });\n }\n\n function enqueueRemovalForInsertedDocumentFragment(df, n
odes) {\n enqueueMutation(df, 'childList', {\n removedNodes: nodes\n
});\n }\n\n /**\n * Collects nodes from a DocumentFragment or a Node for rem
oval followed\n * by an insertion.\n *\n * This updates the internal point
ers for node, previousNode and nextNode.\n */\n function collectNodes(node, p
arentNode, previousNode, nextNode) {\n if (node instanceof DocumentFragment)
{\n var nodes = collectNodesForDocumentFragment(node);\n\n // The extr
a loop is to work around bugs with DocumentFragments in IE.\n surpressMutat
ions = true;\n for (var i = nodes.length - 1; i >= 0; i--) {\n node.
removeChild(nodes[i]);\n nodes[i].parentNode_ = parentNode;\n }\n
surpressMutations = false;\n\n for (var i = 0; i < nodes.length; i++) {\
n nodes[i].previousSibling_ = nodes[i - 1] || previousNode;\n node
s[i].nextSibling_ = nodes[i + 1] || nextNode;\n }\n\n if (previousNode
)\n previousNode.nextSibling_ = nodes[0];\n if (nextNode)\n n
extNode.previousSibling_ = nodes[nodes.length - 1];\n\n return nodes;\n
}\n\n var nodes = createOneElementNodeList(node);\n var oldParent = node.p
arentNode;\n if (oldParent) {\n // This will enqueue the mutation record
for the removal as needed.\n oldParent.removeChild(node);\n }\n\n no
de.parentNode_ = parentNode;\n node.previousSibling_ = previousNode;\n nod
e.nextSibling_ = nextNode;\n if (previousNode)\n previousNode.nextSiblin
g_ = node;\n if (nextNode)\n nextNode.previousSibling_ = node;\n\n re
turn nodes;\n }\n\n function collectNodesNative(node) {\n if (node instance
of DocumentFragment)\n return collectNodesForDocumentFragment(node);\n\n
var nodes = createOneElementNodeList(node);\n var oldParent = node.parentNod
e;\n if (oldParent)\n enqueueRemovalForInsertedNodes(node, oldParent, no
des);\n return nodes;\n }\n\n function collectNodesForDocumentFragment(node
) {\n var nodes = new NodeList();\n var i = 0;\n for (var child = node.
firstChild; child; child = child.nextSibling) {\n nodes[i++] = child;\n
}\n nodes.length = i;\n enqueueRemovalForInsertedDocumentFragment(node, no
des);\n return nodes;\n }\n\n function snapshotNodeList(nodeList) {\n //
NodeLists are not live at the moment so just return the same object.\n retur
n nodeList;\n }\n\n // http://dom.spec.whatwg.org/#node-is-inserted\n functio
n nodeWasAdded(node, treeScope) {\n setTreeScope(node, treeScope);\n node.
nodeIsInserted_();\n }\n\n function nodesWereAdded(nodes, parent) {\n var t
reeScope = getTreeScope(parent);\n for (var i = 0; i < nodes.length; i++) {\n
nodeWasAdded(nodes[i], treeScope);\n }\n }\n\n // http://dom.spec.wha
twg.org/#node-is-removed\n function nodeWasRemoved(node) {\n setTreeScope(no
de, 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 ensureSameOwnerDocument(parent, child) {\n var ownerDoc
= parent.nodeType === Node.DOCUMENT_NODE ?\n parent : parent.ownerDocume
nt;\n if (ownerDoc !== child.ownerDocument)\n ownerDoc.adoptNode(child);
\n }\n\n function adoptNodesIfNeeded(owner, nodes) {\n if (!nodes.length)\n
return;\n\n var ownerDoc = owner.ownerDocument;\n\n // All nodes hav
e the same ownerDocument when we get here.\n if (ownerDoc === nodes[0].ownerD
ocument)\n return;\n\n for (var i = 0; i < nodes.length; i++) {\n s
cope.adoptNodeNoRemove(nodes[i], ownerDoc);\n }\n }\n\n function unwrapNode
sForInsertion(owner, nodes) {\n adoptNodesIfNeeded(owner, nodes);\n var le
ngth = nodes.length;\n\n if (length === 1)\n return unwrap(nodes[0]);\n\
n var df = unwrap(owner.ownerDocument.createDocumentFragment());\n for (va
r i = 0; i < length; i++) {\n df.appendChild(unwrap(nodes[i]));\n }\n
return df;\n }\n\n function clearChildNodes(wrapper) {\n if (wrapper.first
Child_ !== undefined) {\n var child = wrapper.firstChild_;\n while (ch
ild) {\n var tmp = child;\n child = child.nextSibling_;\n t
mp.parentNode_ = tmp.previousSibling_ = tmp.nextSibling_ = undefined;\n }\n
}\n wrapper.firstChild_ = wrapper.lastChild_ = undefined;\n }\n\n funct
ion removeAllChildNodes(wrapper) {\n if (wrapper.invalidateShadowRenderer())
{\n var childWrapper = wrapper.firstChild;\n while (childWrapper) {\n
assert(childWrapper.parentNode === wrapper);\n var nextSibling = c
hildWrapper.nextSibling;\n var childNode = unwrap(childWrapper);\n
var parentNode = childNode.parentNode;\n if (parentNode)\n orig
inalRemoveChild.call(parentNode, childNode);\n childWrapper.previousSibli
ng_ = childWrapper.nextSibling_ =\n childWrapper.parentNode_ = null;\
n childWrapper = nextSibling;\n }\n wrapper.firstChild_ = wrapp
er.lastChild_ = null;\n } else {\n var node = unwrap(wrapper);\n va
r child = node.firstChild;\n var nextSibling;\n while (child) {\n
nextSibling = child.nextSibling;\n originalRemoveChild.call(node, chil
d);\n child = nextSibling;\n }\n }\n }\n\n function invalidateP
arent(node) {\n var p = node.parentNode;\n return p && p.invalidateShadowR
enderer();\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 = document.importNode;\n var originalClon
eNode = 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, unsafeUnwrap(node), false));\n else\n clone = wrap(origin
alCloneNode.call(unsafeUnwrap(node), false));\n\n if (deep) {\n for (var
child = node.firstChild; child; child = child.nextSibling) {\n clone.app
endChild(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.appendChild(cloneNode(chil
d, true, opt_doc));\n }\n }\n }\n // TODO(arv): Some HTML elem
ents also clone other data like value.\n return clone;\n }\n\n function con
tains(self, child) {\n if (!child || getTreeScope(self) !== getTreeScope(chil
d))\n return false;\n\n for (var node = child; node; node = node.parentN
ode) {\n if (node === self)\n return true;\n }\n return false;
\n }\n\n var OriginalNode = window.Node;\n\n /**\n * This represents a wrap
per of a native DOM node.\n * @param {!Node} original The original DOM node, a
ka, 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 properties are used to over
ride the visual references with the\n // logical ones. If the value is undefi
ned it means that the logical is the\n // same as the visual.\n\n /**\n
* @type {Node|undefined}\n * @private\n */\n this.parentNode_ = und
efined;\n\n /**\n * @type {Node|undefined}\n * @private\n */\n
this.firstChild_ = undefined;\n\n /**\n * @type {Node|undefined}\n *
@private\n */\n this.lastChild_ = undefined;\n\n /**\n * @type {N
ode|undefined}\n * @private\n */\n this.nextSibling_ = undefined;\n\n
/**\n * @type {Node|undefined}\n * @private\n */\n this.previ
ousSibling_ = undefined;\n\n this.treeScope_ = undefined;\n }\n\n var Origi
nalDocumentFragment = window.DocumentFragment;\n var originalAppendChild = Orig
inalNode.prototype.appendChild;\n var originalCompareDocumentPosition =\n
OriginalNode.prototype.compareDocumentPosition;\n var originalInsertBefore = Or
iginalNode.prototype.insertBefore;\n var originalRemoveChild = OriginalNode.pro
totype.removeChild;\n var originalReplaceChild = OriginalNode.prototype.replace
Child;\n\n var isIe = /Trident/.test(navigator.userAgent);\n\n var removeChild
OriginalHelper = isIe ?\n function(parent, child) {\n try {\n
originalRemoveChild.call(parent, child);\n } catch (ex) {\n i
f (!(parent instanceof OriginalDocumentFragment))\n throw ex;\n
}\n } :\n function(parent, child) {\n originalRemoveChild.cal
l(parent, child);\n };\n\n Node.prototype = Object.create(EventTarget.prot
otype);\n mixin(Node.prototype, {\n appendChild: function(childWrapper) {\n
return this.insertBefore(childWrapper, null);\n },\n\n insertBefore:
function(childWrapper, refWrapper) {\n assertIsNodeWrapper(childWrapper);\n
\n var refNode;\n if (refWrapper) {\n if (isWrapper(refWrapper)
) {\n refNode = unwrap(refWrapper);\n } else {\n refNod
e = refWrapper;\n refWrapper = wrap(refNode);\n }\n } else
{\n refWrapper = null;\n refNode = null;\n }\n\n refWrap
per && assert(refWrapper.parentNode === this);\n\n var nodes;\n var pr
eviousNode =\n refWrapper ? refWrapper.previousSibling : this.lastChild
;\n\n var useNative = !this.invalidateShadowRenderer() &&\n
!invalidateParent(childWrapper);\n\n if (useNative)\n nodes =
collectNodesNative(childWrapper);\n else\n nodes = collectNodes(chil
dWrapper, this, previousNode, refWrapper);\n\n if (useNative) {\n en
sureSameOwnerDocument(this, childWrapper);\n clearChildNodes(this);\n
originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode)
;\n } else {\n if (!previousNode)\n this.firstChild_ = node
s[0];\n if (!refWrapper) {\n this.lastChild_ = nodes[nodes.lengt
h - 1];\n if (this.firstChild_ === undefined)\n this.firstCh
ild_ = this.firstChild;\n }\n\n var parentNode = refNode ? refNode
.parentNode : unsafeUnwrap(this);\n\n // insertBefore refWrapper no matte
r what the parent is?\n if (parentNode) {\n originalInsertBefore
.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(childWrappe
r);\n if (childWrapper.parentNode !== this) {\n // IE has invalid DO
M trees at times.\n var found = false;\n var childNodes = this.chi
ldNodes;\n for (var ieChild = this.firstChild; ieChild;\n ieC
hild = ieChild.nextSibling) {\n if (ieChild === childWrapper) {\n
found = true;\n break;\n }\n }\n if (!fo
und) {\n // TODO(arv): DOMException\n throw new Error('NotFoun
dError');\n }\n }\n\n var childNode = unwrap(childWrapper);\n
var childWrapperNextSibling = childWrapper.nextSibling;\n var childWrap
perPreviousSibling = childWrapper.previousSibling;\n\n if (this.invalidateS
hadowRenderer()) {\n // We need to remove the real node from the DOM befo
re updating the\n // pointers. This is so that that mutation event is dis
patched before\n // the pointers have changed.\n var thisFirstChil
d = this.firstChild;\n var thisLastChild = this.lastChild;\n\n var
parentNode = childNode.parentNode;\n if (parentNode)\n removeCh
ildOriginalHelper(parentNode, childNode);\n\n if (thisFirstChild === chil
dWrapper)\n this.firstChild_ = childWrapperNextSibling;\n if (th
isLastChild === childWrapper)\n this.lastChild_ = childWrapperPreviousS
ibling;\n if (childWrapperPreviousSibling)\n childWrapperPreviou
sSibling.nextSibling_ = childWrapperNextSibling;\n if (childWrapperNextSi
bling) {\n childWrapperNextSibling.previousSibling_ =\n ch
ildWrapperPreviousSibling;\n }\n\n childWrapper.previousSibling_ =
childWrapper.nextSibling_ =\n childWrapper.parentNode_ = undefined;\
n } else {\n clearChildNodes(this);\n removeChildOriginalHelp
er(unsafeUnwrap(this), childNode);\n }\n\n if (!surpressMutations) {\n
enqueueMutation(this, 'childList', {\n removedNodes: createOneE
lementNodeList(childWrapper),\n nextSibling: childWrapperNextSibling,\n
previousSibling: childWrapperPreviousSibling\n });\n }\n\n
registerTransientObservers(this, childWrapper);\n\n return childWrapp
er;\n },\n\n replaceChild: function(newChildWrapper, oldChildWrapper) {\n
assertIsNodeWrapper(newChildWrapper);\n\n var oldChildNode;\n if
(isWrapper(oldChildWrapper)) {\n oldChildNode = unwrap(oldChildWrapper);\
n } else {\n oldChildNode = oldChildWrapper;\n oldChildWrappe
r = wrap(oldChildNode);\n }\n\n if (oldChildWrapper.parentNode !== thi
s) {\n // TODO(arv): DOMException\n throw new Error('NotFoundError
');\n }\n\n var nextNode = oldChildWrapper.nextSibling;\n var pre
viousNode = oldChildWrapper.previousSibling;\n var nodes;\n\n var useN
ative = !this.invalidateShadowRenderer() &&\n !invalidatePa
rent(newChildWrapper);\n\n if (useNative) {\n nodes = collectNodesNa
tive(newChildWrapper);\n } else {\n if (nextNode === newChildWrapper
)\n nextNode = newChildWrapper.nextSibling;\n nodes = collectNod
es(newChildWrapper, this, previousNode, nextNode);\n }\n\n if (!useNat
ive) {\n if (this.firstChild === oldChildWrapper)\n this.firstCh
ild_ = nodes[0];\n if (this.lastChild === oldChildWrapper)\n thi
s.lastChild_ = nodes[nodes.length - 1];\n\n oldChildWrapper.previousSibli
ng_ = oldChildWrapper.nextSibling_ =\n oldChildWrapper.parentNode_ =
undefined;\n\n // replaceChild no matter what the parent is?\n if
(oldChildNode.parentNode) {\n originalReplaceChild.call(\n
oldChildNode.parentNode,\n unwrapNodesForInsertion(this, nodes),\n
oldChildNode);\n }\n } else {\n ensureSameOwner
Document(this, newChildWrapper);\n clearChildNodes(this);\n origin
alReplaceChild.call(unsafeUnwrap(this), unwrap(newChildWrapper),\n
oldChildNode);\n }\n\n enqueueMutation(this, 'chil
dList', {\n addedNodes: nodes,\n removedNodes: createOneElementNod
eList(oldChildWrapper),\n nextSibling: nextNode,\n previousSibling
: previousNode\n });\n\n nodeWasRemoved(oldChildWrapper);\n nodes
WereAdded(nodes, this);\n\n return oldChildWrapper;\n },\n\n /**\n
* Called after a node was inserted. Subclasses override this to invalidate\n
* the renderer as needed.\n * @private\n */\n nodeIsInserted_: fun
ction() {\n for (var child = this.firstChild; child; child = child.nextSibl
ing) {\n child.nodeIsInserted_();\n }\n },\n\n hasChildNodes:
function() {\n return this.firstChild !== null;\n },\n\n /** @type {N
ode} */\n get parentNode() {\n // If the parentNode has not been overrid
den, use the original parentNode.\n return this.parentNode_ !== undefined ?
\n this.parentNode_ : wrap(unsafeUnwrap(this).parentNode);\n },\n\n
/** @type {Node} */\n get firstChild() {\n return this.firstChild_ !=
= undefined ?\n this.firstChild_ : wrap(unsafeUnwrap(this).firstChild);
\n },\n\n /** @type {Node} */\n get lastChild() {\n return this.la
stChild_ !== undefined ?\n this.lastChild_ : wrap(unsafeUnwrap(this).la
stChild);\n },\n\n /** @type {Node} */\n get nextSibling() {\n ret
urn this.nextSibling_ !== undefined ?\n this.nextSibling_ : wrap(unsafe
Unwrap(this).nextSibling);\n },\n\n /** @type {Node} */\n get previousS
ibling() {\n return this.previousSibling_ !== undefined ?\n this.p
reviousSibling_ : wrap(unsafeUnwrap(this).previousSibling);\n },\n\n get p
arentElement() {\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 should fallback to uns
afeUnwrap(this).textContent if there\n // are no shadow trees below or abov
e the context node.\n var s = '';\n for (var child = this.firstChild;
child; child = child.nextSibling) {\n if (child.nodeType != Node.COMMENT_
NODE) {\n s += child.textContent;\n }\n }\n return s;\
n },\n set textContent(textContent) {\n var removedNodes = snapshotNo
deList(this.childNodes);\n\n if (this.invalidateShadowRenderer()) {\n
removeAllChildNodes(this);\n if (textContent !== '') {\n var t
extNode = unsafeUnwrap(this).ownerDocument.createTextNode(textContent);\n
this.appendChild(textNode);\n }\n } else {\n clearChildNod
es(this);\n unsafeUnwrap(this).textContent = textContent;\n }\n\n
var addedNodes = snapshotNodeList(this.childNodes);\n\n enqueueMutation(
this, 'childList', {\n addedNodes: addedNodes,\n removedNodes: rem
ovedNodes\n });\n\n nodesWereRemoved(removedNodes);\n nodesWereAd
ded(addedNodes, this);\n },\n\n get childNodes() {\n var wrapperList
= new NodeList();\n var i = 0;\n for (var child = this.firstChild; chi
ld; child = child.nextSibling) {\n wrapperList[i++] = child;\n }\n
wrapperList.length = i;\n return wrapperList;\n },\n\n cloneNode:
function(deep) {\n return cloneNode(this, deep);\n },\n\n contains:
function(child) {\n return contains(this, wrapIfNeeded(child));\n },\n\n
compareDocumentPosition: function(otherNode) {\n // This only wraps, it
therefore only operates on the composed DOM and not\n // the logical DOM.\
n return originalCompareDocumentPosition.call(unsafeUnwrap(this),\n
unwrapIfNeeded(otherNode));\n },\n\
n normalize: function() {\n var nodes = snapshotNodeList(this.childNodes
);\n var remNodes = [];\n var s = '';\n var modNode;\n\n for
(var i = 0, n; i < nodes.length; i++) {\n n = nodes[i];\n if (n.n
odeType === Node.TEXT_NODE) {\n if (!modNode && !n.data.length)\n
this.removeNode(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.data += s;\n cleanupNodes(remNodes);\n }\n
remNodes = [];\n s = '';\n modNode = null;\n if
(n.childNodes.length)\n n.normalize();\n }\n }\n\n
// handle case where >1 text nodes are the last children\n if (modNode && r
emNodes.length) {\n modNode.data += s;\n cleanupNodes(remNodes);\n
}\n }\n });\n\n defineWrapGetter(Node, 'ownerDocument');\n\n // We u
se a DocumentFragment as a base and then delete the properties of\n // Document
Fragment.prototype from the wrapper Node. Since delete makes\n // objects slow
in some JS engines we recreate the prototype object.\n registerWrapper(Original
Node, Node, document.createDocumentFragment());\n delete Node.prototype.querySe
lector;\n delete Node.prototype.querySelectorAll;\n Node.prototype = mixin(Obj
ect.create(EventTarget.prototype), Node.prototype);\n\n scope.cloneNode = clone
Node;\n scope.nodeWasAdded = nodeWasAdded;\n scope.nodeWasRemoved = nodeWasRem
oved;\n scope.nodesWereAdded = nodesWereAdded;\n scope.nodesWereRemoved = node
sWereRemoved;\n scope.snapshotNodeList = snapshotNodeList;\n scope.wrappers.No
de = Node;\n\n})(window.ShadowDOMPolyfill);\n", | 95 "/**\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 unsafeUnwrap = scope.unsafeUnwrap;\n var unwrap
= scope.unwrap;\n var unwrapIfNeeded = scope.unwrapIfNeeded;\n var wrap = sco
pe.wrap;\n var wrapIfNeeded = scope.wrapIfNeeded;\n var wrappers = scope.wrapp
ers;\n\n function assertIsNodeWrapper(node) {\n assert(node instanceof Node)
;\n }\n\n function createOneElementNodeList(node) {\n var nodes = new NodeL
ist();\n nodes[0] = node;\n nodes.length = 1;\n return nodes;\n }\n\n
var surpressMutations = false;\n\n /**\n * Called before node is inserted in
to 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 pare
nt node that the node is being removed from.\n * @param {!NodeList} nodes The
collected nodes.\n */\n function enqueueRemovalForInsertedNodes(node, parent,
nodes) {\n enqueueMutation(parent, 'childList', {\n removedNodes: nodes
,\n previousSibling: node.previousSibling,\n nextSibling: node.nextSib
ling\n });\n }\n\n function enqueueRemovalForInsertedDocumentFragment(df, n
odes) {\n enqueueMutation(df, 'childList', {\n removedNodes: nodes\n
});\n }\n\n /**\n * Collects nodes from a DocumentFragment or a Node for rem
oval followed\n * by an insertion.\n *\n * This updates the internal point
ers for node, previousNode and nextNode.\n */\n function collectNodes(node, p
arentNode, previousNode, nextNode) {\n if (node instanceof DocumentFragment)
{\n var nodes = collectNodesForDocumentFragment(node);\n\n // The extr
a loop is to work around bugs with DocumentFragments in IE.\n surpressMutat
ions = true;\n for (var i = nodes.length - 1; i >= 0; i--) {\n node.
removeChild(nodes[i]);\n nodes[i].parentNode_ = parentNode;\n }\n
surpressMutations = false;\n\n for (var i = 0; i < nodes.length; i++) {\
n nodes[i].previousSibling_ = nodes[i - 1] || previousNode;\n node
s[i].nextSibling_ = nodes[i + 1] || nextNode;\n }\n\n if (previousNode
)\n previousNode.nextSibling_ = nodes[0];\n if (nextNode)\n n
extNode.previousSibling_ = nodes[nodes.length - 1];\n\n return nodes;\n
}\n\n var nodes = createOneElementNodeList(node);\n var oldParent = node.p
arentNode;\n if (oldParent) {\n // This will enqueue the mutation record
for the removal as needed.\n oldParent.removeChild(node);\n }\n\n no
de.parentNode_ = parentNode;\n node.previousSibling_ = previousNode;\n nod
e.nextSibling_ = nextNode;\n if (previousNode)\n previousNode.nextSiblin
g_ = node;\n if (nextNode)\n nextNode.previousSibling_ = node;\n\n re
turn nodes;\n }\n\n function collectNodesNative(node) {\n if (node instance
of DocumentFragment)\n return collectNodesForDocumentFragment(node);\n\n
var nodes = createOneElementNodeList(node);\n var oldParent = node.parentNod
e;\n if (oldParent)\n enqueueRemovalForInsertedNodes(node, oldParent, no
des);\n return nodes;\n }\n\n function collectNodesForDocumentFragment(node
) {\n var nodes = new NodeList();\n var i = 0;\n for (var child = node.
firstChild; child; child = child.nextSibling) {\n nodes[i++] = child;\n
}\n nodes.length = i;\n enqueueRemovalForInsertedDocumentFragment(node, no
des);\n return nodes;\n }\n\n function snapshotNodeList(nodeList) {\n //
NodeLists are not live at the moment so just return the same object.\n retur
n nodeList;\n }\n\n // http://dom.spec.whatwg.org/#node-is-inserted\n functio
n nodeWasAdded(node, treeScope) {\n setTreeScope(node, treeScope);\n node.
nodeIsInserted_();\n }\n\n function nodesWereAdded(nodes, parent) {\n var t
reeScope = getTreeScope(parent);\n for (var i = 0; i < nodes.length; i++) {\n
nodeWasAdded(nodes[i], treeScope);\n }\n }\n\n // http://dom.spec.wha
twg.org/#node-is-removed\n function nodeWasRemoved(node) {\n setTreeScope(no
de, 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 ensureSameOwnerDocument(parent, child) {\n var ownerDoc
= parent.nodeType === Node.DOCUMENT_NODE ?\n parent : parent.ownerDocume
nt;\n if (ownerDoc !== child.ownerDocument)\n ownerDoc.adoptNode(child);
\n }\n\n function adoptNodesIfNeeded(owner, nodes) {\n if (!nodes.length)\n
return;\n\n var ownerDoc = owner.ownerDocument;\n\n // All nodes hav
e the same ownerDocument when we get here.\n if (ownerDoc === nodes[0].ownerD
ocument)\n return;\n\n for (var i = 0; i < nodes.length; i++) {\n s
cope.adoptNodeNoRemove(nodes[i], ownerDoc);\n }\n }\n\n function unwrapNode
sForInsertion(owner, nodes) {\n adoptNodesIfNeeded(owner, nodes);\n var le
ngth = nodes.length;\n\n if (length === 1)\n return unwrap(nodes[0]);\n\
n var df = unwrap(owner.ownerDocument.createDocumentFragment());\n for (va
r i = 0; i < length; i++) {\n df.appendChild(unwrap(nodes[i]));\n }\n
return df;\n }\n\n function clearChildNodes(wrapper) {\n if (wrapper.first
Child_ !== undefined) {\n var child = wrapper.firstChild_;\n while (ch
ild) {\n var tmp = child;\n child = child.nextSibling_;\n t
mp.parentNode_ = tmp.previousSibling_ = tmp.nextSibling_ = undefined;\n }\n
}\n wrapper.firstChild_ = wrapper.lastChild_ = undefined;\n }\n\n funct
ion removeAllChildNodes(wrapper) {\n if (wrapper.invalidateShadowRenderer())
{\n var childWrapper = wrapper.firstChild;\n while (childWrapper) {\n
assert(childWrapper.parentNode === wrapper);\n var nextSibling = c
hildWrapper.nextSibling;\n var childNode = unwrap(childWrapper);\n
var parentNode = childNode.parentNode;\n if (parentNode)\n orig
inalRemoveChild.call(parentNode, childNode);\n childWrapper.previousSibli
ng_ = childWrapper.nextSibling_ =\n childWrapper.parentNode_ = null;\
n childWrapper = nextSibling;\n }\n wrapper.firstChild_ = wrapp
er.lastChild_ = null;\n } else {\n var node = unwrap(wrapper);\n va
r child = node.firstChild;\n var nextSibling;\n while (child) {\n
nextSibling = child.nextSibling;\n originalRemoveChild.call(node, chil
d);\n child = nextSibling;\n }\n }\n }\n\n function invalidateP
arent(node) {\n var p = node.parentNode;\n return p && p.invalidateShadowR
enderer();\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 = document.importNode;\n var originalClon
eNode = 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, unsafeUnwrap(node), false));\n else\n clone = wrap(origin
alCloneNode.call(unsafeUnwrap(node), false));\n\n if (deep) {\n for (var
child = node.firstChild; child; child = child.nextSibling) {\n clone.app
endChild(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.appendChild(cloneNode(chil
d, true, opt_doc));\n }\n }\n }\n // TODO(arv): Some HTML elem
ents also clone other data like value.\n return clone;\n }\n\n function con
tains(self, child) {\n if (!child || getTreeScope(self) !== getTreeScope(chil
d))\n return false;\n\n for (var node = child; node; node = node.parentN
ode) {\n if (node === self)\n return true;\n }\n return false;
\n }\n\n var OriginalNode = window.Node;\n\n /**\n * This represents a wrap
per of a native DOM node.\n * @param {!Node} original The original DOM node, a
ka, 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 properties are used to over
ride the visual references with the\n // logical ones. If the value is undefi
ned it means that the logical is the\n // same as the visual.\n\n /**\n
* @type {Node|undefined}\n * @private\n */\n this.parentNode_ = und
efined;\n\n /**\n * @type {Node|undefined}\n * @private\n */\n
this.firstChild_ = undefined;\n\n /**\n * @type {Node|undefined}\n *
@private\n */\n this.lastChild_ = undefined;\n\n /**\n * @type {N
ode|undefined}\n * @private\n */\n this.nextSibling_ = undefined;\n\n
/**\n * @type {Node|undefined}\n * @private\n */\n this.previ
ousSibling_ = undefined;\n\n this.treeScope_ = undefined;\n }\n\n var Origi
nalDocumentFragment = window.DocumentFragment;\n var originalAppendChild = Orig
inalNode.prototype.appendChild;\n var originalCompareDocumentPosition =\n
OriginalNode.prototype.compareDocumentPosition;\n var originalInsertBefore = Or
iginalNode.prototype.insertBefore;\n var originalRemoveChild = OriginalNode.pro
totype.removeChild;\n var originalReplaceChild = OriginalNode.prototype.replace
Child;\n\n var isIe = /Trident/.test(navigator.userAgent);\n\n var removeChild
OriginalHelper = isIe ?\n function(parent, child) {\n try {\n
originalRemoveChild.call(parent, child);\n } catch (ex) {\n i
f (!(parent instanceof OriginalDocumentFragment))\n throw ex;\n
}\n } :\n function(parent, child) {\n originalRemoveChild.cal
l(parent, child);\n };\n\n Node.prototype = Object.create(EventTarget.prot
otype);\n mixin(Node.prototype, {\n appendChild: function(childWrapper) {\n
return this.insertBefore(childWrapper, null);\n },\n\n insertBefore:
function(childWrapper, refWrapper) {\n assertIsNodeWrapper(childWrapper);\n
\n var refNode;\n if (refWrapper) {\n if (isWrapper(refWrapper)
) {\n refNode = unwrap(refWrapper);\n } else {\n refNod
e = refWrapper;\n refWrapper = wrap(refNode);\n }\n } else
{\n refWrapper = null;\n refNode = null;\n }\n\n refWrap
per && assert(refWrapper.parentNode === this);\n\n var nodes;\n var pr
eviousNode =\n refWrapper ? refWrapper.previousSibling : this.lastChild
;\n\n var useNative = !this.invalidateShadowRenderer() &&\n
!invalidateParent(childWrapper);\n\n if (useNative)\n nodes =
collectNodesNative(childWrapper);\n else\n nodes = collectNodes(chil
dWrapper, this, previousNode, refWrapper);\n\n if (useNative) {\n en
sureSameOwnerDocument(this, childWrapper);\n clearChildNodes(this);\n
originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode)
;\n } else {\n if (!previousNode)\n this.firstChild_ = node
s[0];\n if (!refWrapper) {\n this.lastChild_ = nodes[nodes.lengt
h - 1];\n if (this.firstChild_ === undefined)\n this.firstCh
ild_ = this.firstChild;\n }\n\n var parentNode = refNode ? refNode
.parentNode : unsafeUnwrap(this);\n\n // insertBefore refWrapper no matte
r what the parent is?\n if (parentNode) {\n originalInsertBefore
.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(childWrappe
r);\n if (childWrapper.parentNode !== this) {\n // IE has invalid DO
M trees at times.\n var found = false;\n var childNodes = this.chi
ldNodes;\n for (var ieChild = this.firstChild; ieChild;\n ieC
hild = ieChild.nextSibling) {\n if (ieChild === childWrapper) {\n
found = true;\n break;\n }\n }\n if (!fo
und) {\n // TODO(arv): DOMException\n throw new Error('NotFoun
dError');\n }\n }\n\n var childNode = unwrap(childWrapper);\n
var childWrapperNextSibling = childWrapper.nextSibling;\n var childWrap
perPreviousSibling = childWrapper.previousSibling;\n\n if (this.invalidateS
hadowRenderer()) {\n // We need to remove the real node from the DOM befo
re updating the\n // pointers. This is so that that mutation event is dis
patched before\n // the pointers have changed.\n var thisFirstChil
d = this.firstChild;\n var thisLastChild = this.lastChild;\n\n var
parentNode = childNode.parentNode;\n if (parentNode)\n removeCh
ildOriginalHelper(parentNode, childNode);\n\n if (thisFirstChild === chil
dWrapper)\n this.firstChild_ = childWrapperNextSibling;\n if (th
isLastChild === childWrapper)\n this.lastChild_ = childWrapperPreviousS
ibling;\n if (childWrapperPreviousSibling)\n childWrapperPreviou
sSibling.nextSibling_ = childWrapperNextSibling;\n if (childWrapperNextSi
bling) {\n childWrapperNextSibling.previousSibling_ =\n ch
ildWrapperPreviousSibling;\n }\n\n childWrapper.previousSibling_ =
childWrapper.nextSibling_ =\n childWrapper.parentNode_ = undefined;\
n } else {\n clearChildNodes(this);\n removeChildOriginalHelp
er(unsafeUnwrap(this), childNode);\n }\n\n if (!surpressMutations) {\n
enqueueMutation(this, 'childList', {\n removedNodes: createOneE
lementNodeList(childWrapper),\n nextSibling: childWrapperNextSibling,\n
previousSibling: childWrapperPreviousSibling\n });\n }\n\n
registerTransientObservers(this, childWrapper);\n\n return childWrapp
er;\n },\n\n replaceChild: function(newChildWrapper, oldChildWrapper) {\n
assertIsNodeWrapper(newChildWrapper);\n\n var oldChildNode;\n if
(isWrapper(oldChildWrapper)) {\n oldChildNode = unwrap(oldChildWrapper);\
n } else {\n oldChildNode = oldChildWrapper;\n oldChildWrappe
r = wrap(oldChildNode);\n }\n\n if (oldChildWrapper.parentNode !== thi
s) {\n // TODO(arv): DOMException\n throw new Error('NotFoundError
');\n }\n\n var nextNode = oldChildWrapper.nextSibling;\n var pre
viousNode = oldChildWrapper.previousSibling;\n var nodes;\n\n var useN
ative = !this.invalidateShadowRenderer() &&\n !invalidatePa
rent(newChildWrapper);\n\n if (useNative) {\n nodes = collectNodesNa
tive(newChildWrapper);\n } else {\n if (nextNode === newChildWrapper
)\n nextNode = newChildWrapper.nextSibling;\n nodes = collectNod
es(newChildWrapper, this, previousNode, nextNode);\n }\n\n if (!useNat
ive) {\n if (this.firstChild === oldChildWrapper)\n this.firstCh
ild_ = nodes[0];\n if (this.lastChild === oldChildWrapper)\n thi
s.lastChild_ = nodes[nodes.length - 1];\n\n oldChildWrapper.previousSibli
ng_ = oldChildWrapper.nextSibling_ =\n oldChildWrapper.parentNode_ =
undefined;\n\n // replaceChild no matter what the parent is?\n if
(oldChildNode.parentNode) {\n originalReplaceChild.call(\n
oldChildNode.parentNode,\n unwrapNodesForInsertion(this, nodes),\n
oldChildNode);\n }\n } else {\n ensureSameOwner
Document(this, newChildWrapper);\n clearChildNodes(this);\n origin
alReplaceChild.call(unsafeUnwrap(this), unwrap(newChildWrapper),\n
oldChildNode);\n }\n\n enqueueMutation(this, 'chil
dList', {\n addedNodes: nodes,\n removedNodes: createOneElementNod
eList(oldChildWrapper),\n nextSibling: nextNode,\n previousSibling
: previousNode\n });\n\n nodeWasRemoved(oldChildWrapper);\n nodes
WereAdded(nodes, this);\n\n return oldChildWrapper;\n },\n\n /**\n
* Called after a node was inserted. Subclasses override this to invalidate\n
* the renderer as needed.\n * @private\n */\n nodeIsInserted_: fun
ction() {\n for (var child = this.firstChild; child; child = child.nextSibl
ing) {\n child.nodeIsInserted_();\n }\n },\n\n hasChildNodes:
function() {\n return this.firstChild !== null;\n },\n\n /** @type {N
ode} */\n get parentNode() {\n // If the parentNode has not been overrid
den, use the original parentNode.\n return this.parentNode_ !== undefined ?
\n this.parentNode_ : wrap(unsafeUnwrap(this).parentNode);\n },\n\n
/** @type {Node} */\n get firstChild() {\n return this.firstChild_ !=
= undefined ?\n this.firstChild_ : wrap(unsafeUnwrap(this).firstChild);
\n },\n\n /** @type {Node} */\n get lastChild() {\n return this.la
stChild_ !== undefined ?\n this.lastChild_ : wrap(unsafeUnwrap(this).la
stChild);\n },\n\n /** @type {Node} */\n get nextSibling() {\n ret
urn this.nextSibling_ !== undefined ?\n this.nextSibling_ : wrap(unsafe
Unwrap(this).nextSibling);\n },\n\n /** @type {Node} */\n get previousS
ibling() {\n return this.previousSibling_ !== undefined ?\n this.p
reviousSibling_ : wrap(unsafeUnwrap(this).previousSibling);\n },\n\n get p
arentElement() {\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 should fallback to uns
afeUnwrap(this).textContent if there\n // are no shadow trees below or abov
e the context node.\n var s = '';\n for (var child = this.firstChild;
child; child = child.nextSibling) {\n if (child.nodeType != Node.COMMENT_
NODE) {\n s += child.textContent;\n }\n }\n return s;\
n },\n set textContent(textContent) {\n var removedNodes = snapshotNo
deList(this.childNodes);\n\n if (this.invalidateShadowRenderer()) {\n
removeAllChildNodes(this);\n if (textContent !== '') {\n var t
extNode = unsafeUnwrap(this).ownerDocument.createTextNode(textContent);\n
this.appendChild(textNode);\n }\n } else {\n clearChildNod
es(this);\n unsafeUnwrap(this).textContent = textContent;\n }\n\n
var addedNodes = snapshotNodeList(this.childNodes);\n\n enqueueMutation(
this, 'childList', {\n addedNodes: addedNodes,\n removedNodes: rem
ovedNodes\n });\n\n nodesWereRemoved(removedNodes);\n nodesWereAd
ded(addedNodes, this);\n },\n\n get childNodes() {\n var wrapperList
= new NodeList();\n var i = 0;\n for (var child = this.firstChild; chi
ld; child = child.nextSibling) {\n wrapperList[i++] = child;\n }\n
wrapperList.length = i;\n return wrapperList;\n },\n\n cloneNode:
function(deep) {\n return cloneNode(this, deep);\n },\n\n contains:
function(child) {\n return contains(this, wrapIfNeeded(child));\n },\n\n
compareDocumentPosition: function(otherNode) {\n // This only wraps, it
therefore only operates on the composed DOM and not\n // the logical DOM.\
n return originalCompareDocumentPosition.call(unsafeUnwrap(this),\n
unwrapIfNeeded(otherNode));\n },\n\
n normalize: function() {\n var nodes = snapshotNodeList(this.childNodes
);\n var remNodes = [];\n var s = '';\n var modNode;\n\n for
(var i = 0, n; i < nodes.length; i++) {\n n = nodes[i];\n if (n.n
odeType === Node.TEXT_NODE) {\n if (!modNode && !n.data.length)\n
this.removeNode(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.data += s;\n cleanupNodes(remNodes);\n }\n
remNodes = [];\n s = '';\n modNode = null;\n if
(n.childNodes.length)\n n.normalize();\n }\n }\n\n
// handle case where >1 text nodes are the last children\n if (modNode && r
emNodes.length) {\n modNode.data += s;\n cleanupNodes(remNodes);\n
}\n }\n });\n\n defineWrapGetter(Node, 'ownerDocument');\n\n // We u
se a DocumentFragment as a base and then delete the properties of\n // Document
Fragment.prototype from the wrapper Node. Since delete makes\n // objects slow
in some JS engines we recreate the prototype object.\n registerWrapper(Original
Node, Node, document.createDocumentFragment());\n delete Node.prototype.querySe
lector;\n delete Node.prototype.querySelectorAll;\n Node.prototype = mixin(Obj
ect.create(EventTarget.prototype), Node.prototype);\n\n scope.cloneNode = clone
Node;\n scope.nodeWasAdded = nodeWasAdded;\n scope.nodeWasRemoved = nodeWasRem
oved;\n scope.nodesWereAdded = nodesWereAdded;\n scope.nodesWereRemoved = node
sWereRemoved;\n scope.snapshotNodeList = snapshotNodeList;\n scope.wrappers.No
de = Node;\n\n})(window.ShadowDOMPolyfill);\n", |
105 "// 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 unsafeUnwrap = scope.unsafeUnwrap;\n var
wrap = scope.wrap;\n\n var originalDocumentQuerySelector = document.querySelec
tor;\n var originalElementQuerySelector = document.documentElement.querySelecto
r;\n\n var originalDocumentQuerySelectorAll = document.querySelectorAll;\n var
originalElementQuerySelectorAll = document.documentElement.querySelectorAll;\n\
n var originalDocumentGetElementsByTagName = document.getElementsByTagName;\n
var originalElementGetElementsByTagName = document.documentElement.getElementsBy
TagName;\n\n var originalDocumentGetElementsByTagNameNS = document.getElementsB
yTagNameNS;\n var originalElementGetElementsByTagNameNS = document.documentElem
ent.getElementsByTagNameNS;\n\n var OriginalElement = window.Element;\n var Or
iginalDocument = window.HTMLDocument || window.Document;\n\n function filterNod
eList(list, index, result, deep) {\n var wrappedItem = null;\n var root =
null;\n for (var i = 0, length = list.length; i < length; i++) {\n wrapp
edItem = wrap(list[i]);\n if (!deep && (root = getTreeScope(wrappedItem).ro
ot)) {\n if (root instanceof scope.wrappers.ShadowRoot) {\n cont
inue;\n }\n }\n result[index++] = wrappedItem;\n }\n\n re
turn index;\n }\n\n function shimSelector(selector) {\n return String(selec
tor).replace(/\\/deep\\//g, ' ');\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 matche
sTagName(el, localName, localNameLowerCase) {\n var ln = el.localName;\n r
eturn ln === localName ||\n ln === localNameLowerCase && el.namespaceURI
=== XHTML_NS;\n }\n\n function matchesEveryThing() {\n return true;\n }\n\
n function matchesLocalNameOnly(el, ns, localName) {\n return el.localName =
== localName;\n }\n\n function matchesNameSpace(el, ns) {\n return el.names
paceURI === ns;\n }\n\n function matchesLocalNameNS(el, ns, localName) {\n
return el.namespaceURI === ns && el.localName === localName;\n }\n\n function
findElements(node, index, result, p, arg0, arg1) {\n var el = node.firstEleme
ntChild;\n while (el) {\n if (p(el, arg0, arg1))\n result[index++
] = el;\n index = findElements(el, index, result, p, arg0, arg1);\n el
= el.nextElementSibling;\n }\n return index;\n }\n\n // find and findAl
l will only match Simple Selectors,\n // Structural Pseudo Classes are not guar
enteed to be correct\n // http://www.w3.org/TR/css3-selectors/#simple-selectors
\n\n function querySelectorAllFiltered(p, index, result, selector, deep) {\n
var target = unsafeUnwrap(this);\n var list;\n var root = getTreeScope(th
is).root;\n if (root instanceof scope.wrappers.ShadowRoot) {\n // We are
in the shadow tree and the logical tree is\n // going to be disconnected s
o we do a manual tree traversal\n return findElements(this, index, result,
p, selector, null);\n } else if (target instanceof OriginalElement) {\n
list = originalElementQuerySelectorAll.call(target, selector);\n } else if (t
arget instanceof OriginalDocument) {\n list = originalDocumentQuerySelector
All.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 trave
rsal\n return findElements(this, index, result, p, selector, null);\n }\
n\n return filterNodeList(list, index, result, deep);\n }\n\n var Selectors
Interface = {\n querySelector: function(selector) {\n var shimmed = shim
Selector(selector);\n var deep = shimmed !== selector;\n selector = sh
immed;\n\n var target = unsafeUnwrap(this);\n var wrappedItem;\n
var root = getTreeScope(this).root;\n if (root instanceof scope.wrappers.Sh
adowRoot) {\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, select
or);\n }\n\n if (!wrappedItem) {\n // When the original query r
eturns nothing\n // we return nothing (to be consistent with the other wr
apped calls)\n return wrappedItem;\n } else if (!deep && (root = get
TreeScope(wrappedItem).root)) {\n if (root instanceof scope.wrappers.Shad
owRoot) {\n // When the original query returns an element in the Shadow
DOM\n // we must do a manual tree traversal\n return findOne(t
his, selector);\n }\n }\n\n return wrappedItem;\n },\n qu
erySelectorAll: function(selector) {\n var shimmed = shimSelector(selector)
;\n var deep = shimmed !== selector;\n selector = shimmed;\n\n va
r result = new NodeList();\n\n result.length = querySelectorAllFiltered.cal
l(this,\n matchesSelector,\n 0,\n result,\n
selector,\n deep);\n\n return result;\n }\n };\n\n function g
etElementsByTagNameFiltered(p, index, result, localName,\n
lowercase) {\n var target = unsafeUnwrap(this);\n var li
st;\n var root = getTreeScope(this).root;\n if (root instanceof scope.wrap
pers.ShadowRoot) {\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, localName, lowercase);\n } else if (tar
get instanceof OriginalElement) {\n list = originalElementGetElementsByTagN
ame.call(target, localName,\n
lowercase);\n } else if (target instanceof OriginalDocument) {\n list
= originalDocumentGetElementsByTagName.call(target, localName,\n
lowercase);\n } else {\n // When
we get a ShadowRoot the logical tree is going to be disconnected\n // so w
e do a manual tree traversal\n return findElements(this, index, result, p,
localName, lowercase);\n }\n\n return filterNodeList(list, index, result,
false);\n }\n\n function getElementsByTagNameNSFiltered(p, index, result, ns,
localName) {\n var target = unsafeUnwrap(this);\n var list;\n var root
= getTreeScope(this).root;\n if (root instanceof scope.wrappers.ShadowRoot) {
\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 OriginalEl
ement) {\n list = originalElementGetElementsByTagNameNS.call(target, ns, lo
calName);\n } else if (target instanceof OriginalDocument) {\n list = or
iginalDocumentGetElementsByTagNameNS.call(target, ns, localName);\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 findElements(this, inde
x, result, p, ns, localName);\n }\n\n return filterNodeList(list, index, r
esult, false);\n }\n\n var GetElementsByInterface = {\n getElementsByTagNam
e: function(localName) {\n var result = new HTMLCollection();\n var ma
tch = localName === '*' ? matchesEveryThing : matchesTagName;\n\n result.le
ngth = 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 (n
s === '*') {\n match = localName === '*' ? matchesEveryThing : matchesLoc
alNameOnly;\n } else {\n match = localName === '*' ? matchesNameSpac
e : matchesLocalNameNS;\n }\n\n result.length = getElementsByTagNameNS
Filtered.call(this,\n match,\n 0,\n result,\n
ns || null,\n localName);\n\n return result;\n }\n };\n\n s
cope.GetElementsByInterface = GetElementsByInterface;\n scope.SelectorsInterfac
e = SelectorsInterface;\n\n})(window.ShadowDOMPolyfill);\n", | 96 "// 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 unsafeUnwrap = scope.unsafeUnwrap;\n var
wrap = scope.wrap;\n\n var originalDocumentQuerySelector = document.querySelec
tor;\n var originalElementQuerySelector = document.documentElement.querySelecto
r;\n\n var originalDocumentQuerySelectorAll = document.querySelectorAll;\n var
originalElementQuerySelectorAll = document.documentElement.querySelectorAll;\n\
n var originalDocumentGetElementsByTagName = document.getElementsByTagName;\n
var originalElementGetElementsByTagName = document.documentElement.getElementsBy
TagName;\n\n var originalDocumentGetElementsByTagNameNS = document.getElementsB
yTagNameNS;\n var originalElementGetElementsByTagNameNS = document.documentElem
ent.getElementsByTagNameNS;\n\n var OriginalElement = window.Element;\n var Or
iginalDocument = window.HTMLDocument || window.Document;\n\n function filterNod
eList(list, index, result, deep) {\n var wrappedItem = null;\n var root =
null;\n for (var i = 0, length = list.length; i < length; i++) {\n wrapp
edItem = wrap(list[i]);\n if (!deep && (root = getTreeScope(wrappedItem).ro
ot)) {\n if (root instanceof scope.wrappers.ShadowRoot) {\n cont
inue;\n }\n }\n result[index++] = wrappedItem;\n }\n\n re
turn index;\n }\n\n function shimSelector(selector) {\n return String(selec
tor).replace(/\\/deep\\//g, ' ');\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 matche
sTagName(el, localName, localNameLowerCase) {\n var ln = el.localName;\n r
eturn ln === localName ||\n ln === localNameLowerCase && el.namespaceURI
=== XHTML_NS;\n }\n\n function matchesEveryThing() {\n return true;\n }\n\
n function matchesLocalNameOnly(el, ns, localName) {\n return el.localName =
== localName;\n }\n\n function matchesNameSpace(el, ns) {\n return el.names
paceURI === ns;\n }\n\n function matchesLocalNameNS(el, ns, localName) {\n
return el.namespaceURI === ns && el.localName === localName;\n }\n\n function
findElements(node, index, result, p, arg0, arg1) {\n var el = node.firstEleme
ntChild;\n while (el) {\n if (p(el, arg0, arg1))\n result[index++
] = el;\n index = findElements(el, index, result, p, arg0, arg1);\n el
= el.nextElementSibling;\n }\n return index;\n }\n\n // find and findAl
l will only match Simple Selectors,\n // Structural Pseudo Classes are not guar
enteed to be correct\n // http://www.w3.org/TR/css3-selectors/#simple-selectors
\n\n function querySelectorAllFiltered(p, index, result, selector, deep) {\n
var target = unsafeUnwrap(this);\n var list;\n var root = getTreeScope(th
is).root;\n if (root instanceof scope.wrappers.ShadowRoot) {\n // We are
in the shadow tree and the logical tree is\n // going to be disconnected s
o we do a manual tree traversal\n return findElements(this, index, result,
p, selector, null);\n } else if (target instanceof OriginalElement) {\n
list = originalElementQuerySelectorAll.call(target, selector);\n } else if (t
arget instanceof OriginalDocument) {\n list = originalDocumentQuerySelector
All.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 trave
rsal\n return findElements(this, index, result, p, selector, null);\n }\
n\n return filterNodeList(list, index, result, deep);\n }\n\n var Selectors
Interface = {\n querySelector: function(selector) {\n var shimmed = shim
Selector(selector);\n var deep = shimmed !== selector;\n selector = sh
immed;\n\n var target = unsafeUnwrap(this);\n var wrappedItem;\n
var root = getTreeScope(this).root;\n if (root instanceof scope.wrappers.Sh
adowRoot) {\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, select
or);\n }\n\n if (!wrappedItem) {\n // When the original query r
eturns nothing\n // we return nothing (to be consistent with the other wr
apped calls)\n return wrappedItem;\n } else if (!deep && (root = get
TreeScope(wrappedItem).root)) {\n if (root instanceof scope.wrappers.Shad
owRoot) {\n // When the original query returns an element in the Shadow
DOM\n // we must do a manual tree traversal\n return findOne(t
his, selector);\n }\n }\n\n return wrappedItem;\n },\n qu
erySelectorAll: function(selector) {\n var shimmed = shimSelector(selector)
;\n var deep = shimmed !== selector;\n selector = shimmed;\n\n va
r result = new NodeList();\n\n result.length = querySelectorAllFiltered.cal
l(this,\n matchesSelector,\n 0,\n result,\n
selector,\n deep);\n\n return result;\n }\n };\n\n function g
etElementsByTagNameFiltered(p, index, result, localName,\n
lowercase) {\n var target = unsafeUnwrap(this);\n var li
st;\n var root = getTreeScope(this).root;\n if (root instanceof scope.wrap
pers.ShadowRoot) {\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, localName, lowercase);\n } else if (tar
get instanceof OriginalElement) {\n list = originalElementGetElementsByTagN
ame.call(target, localName,\n
lowercase);\n } else if (target instanceof OriginalDocument) {\n list
= originalDocumentGetElementsByTagName.call(target, localName,\n
lowercase);\n } else {\n // When
we get a ShadowRoot the logical tree is going to be disconnected\n // so w
e do a manual tree traversal\n return findElements(this, index, result, p,
localName, lowercase);\n }\n\n return filterNodeList(list, index, result,
false);\n }\n\n function getElementsByTagNameNSFiltered(p, index, result, ns,
localName) {\n var target = unsafeUnwrap(this);\n var list;\n var root
= getTreeScope(this).root;\n if (root instanceof scope.wrappers.ShadowRoot) {
\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 OriginalEl
ement) {\n list = originalElementGetElementsByTagNameNS.call(target, ns, lo
calName);\n } else if (target instanceof OriginalDocument) {\n list = or
iginalDocumentGetElementsByTagNameNS.call(target, ns, localName);\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 findElements(this, inde
x, result, p, ns, localName);\n }\n\n return filterNodeList(list, index, r
esult, false);\n }\n\n var GetElementsByInterface = {\n getElementsByTagNam
e: function(localName) {\n var result = new HTMLCollection();\n var ma
tch = localName === '*' ? matchesEveryThing : matchesTagName;\n\n result.le
ngth = 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 (n
s === '*') {\n match = localName === '*' ? matchesEveryThing : matchesLoc
alNameOnly;\n } else {\n match = localName === '*' ? matchesNameSpac
e : matchesLocalNameNS;\n }\n\n result.length = getElementsByTagNameNS
Filtered.call(this,\n match,\n 0,\n result,\n
ns || null,\n localName);\n\n return result;\n }\n };\n\n s
cope.GetElementsByInterface = GetElementsByInterface;\n scope.SelectorsInterfac
e = SelectorsInterface;\n\n})(window.ShadowDOMPolyfill);\n", |
(...skipping 27 matching lines...) Expand all Loading... |
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 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 unsafeUnwra
p = scope.unsafeUnwrap;\n var unwrap = scope.unwrap;\n\n var shadowHostTable =
new WeakMap();\n var nextOlderShadowTreeTable = new WeakMap();\n\n var spaceC
harRe = /[ \\t\\n\\r\\f]/;\n\n function ShadowRoot(hostWrapper) {\n var node
= unwrap(unsafeUnwrap(hostWrapper).ownerDocument.createDocumentFragment());\n
DocumentFragment.call(this, node);\n\n // createDocumentFragment associates
the node with a wrapper\n // DocumentFragment instance. Override that.\n
rewrap(node, this);\n\n var oldShadowRoot = hostWrapper.shadowRoot;\n next
OlderShadowTreeTable.set(this, oldShadowRoot);\n\n this.treeScope_ =\n
new TreeScope(this, getTreeScope(oldShadowRoot || hostWrapper));\n\n shadowH
ostTable.set(this, hostWrapper);\n }\n ShadowRoot.prototype = Object.create(Do
cumentFragment.prototype);\n mixin(ShadowRoot.prototype, {\n constructor: Sh
adowRoot,\n\n get innerHTML() {\n return getInnerHTML(this);\n },\n
set innerHTML(value) {\n setInnerHTML(this, value);\n this.invalidat
eShadowRenderer();\n },\n\n get olderShadowRoot() {\n return nextOlde
rShadowTreeTable.get(this) || null;\n },\n\n get host() {\n return sh
adowHostTable.get(this) || null;\n },\n\n invalidateShadowRenderer: functi
on() {\n return shadowHostTable.get(this).invalidateShadowRenderer();\n
},\n\n elementFromPoint: function(x, y) {\n return elementFromPoint(this
, this.ownerDocument, x, y);\n },\n\n getElementById: function(id) {\n
if (spaceCharRe.test(id))\n return null;\n return this.querySelect
or('[id=\"' + id + '\"]');\n }\n });\n\n scope.wrappers.ShadowRoot = Shadow
Root;\n\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 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 unsafeUnwra
p = scope.unsafeUnwrap;\n var unwrap = scope.unwrap;\n\n var shadowHostTable =
new WeakMap();\n var nextOlderShadowTreeTable = new WeakMap();\n\n var spaceC
harRe = /[ \\t\\n\\r\\f]/;\n\n function ShadowRoot(hostWrapper) {\n var node
= unwrap(unsafeUnwrap(hostWrapper).ownerDocument.createDocumentFragment());\n
DocumentFragment.call(this, node);\n\n // createDocumentFragment associates
the node with a wrapper\n // DocumentFragment instance. Override that.\n
rewrap(node, this);\n\n var oldShadowRoot = hostWrapper.shadowRoot;\n next
OlderShadowTreeTable.set(this, oldShadowRoot);\n\n this.treeScope_ =\n
new TreeScope(this, getTreeScope(oldShadowRoot || hostWrapper));\n\n shadowH
ostTable.set(this, hostWrapper);\n }\n ShadowRoot.prototype = Object.create(Do
cumentFragment.prototype);\n mixin(ShadowRoot.prototype, {\n constructor: Sh
adowRoot,\n\n get innerHTML() {\n return getInnerHTML(this);\n },\n
set innerHTML(value) {\n setInnerHTML(this, value);\n this.invalidat
eShadowRenderer();\n },\n\n get olderShadowRoot() {\n return nextOlde
rShadowTreeTable.get(this) || null;\n },\n\n get host() {\n return sh
adowHostTable.get(this) || null;\n },\n\n invalidateShadowRenderer: functi
on() {\n return shadowHostTable.get(this).invalidateShadowRenderer();\n
},\n\n elementFromPoint: function(x, y) {\n return elementFromPoint(this
, this.ownerDocument, x, y);\n },\n\n getElementById: function(id) {\n
if (spaceCharRe.test(id))\n return null;\n return this.querySelect
or('[id=\"' + id + '\"]');\n }\n });\n\n scope.wrappers.ShadowRoot = Shadow
Root;\n\n})(window.ShadowDOMPolyfill);\n", |
134 "// 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 unsafeUnwrap = scope.unsafeUnwrap;\n var unwr
ap = scope.unwrap;\n var wrap = scope.wrap;\n\n /**\n * Updates the fields o
f a wrapper to a snapshot of the logical DOM as needed.\n * Up means parentNod
e\n * Sideways means previous and next sibling.\n * @param {!Node} wrapper\n
*/\n function updateWrapperUpAndSideways(wrapper) {\n wrapper.previousSib
ling_ = wrapper.previousSibling;\n wrapper.nextSibling_ = wrapper.nextSibling
;\n wrapper.parentNode_ = wrapper.parentNode;\n }\n\n /**\n * Updates the
fields of a wrapper to a snapshot of the logical DOM as needed.\n * Down mean
s first and last child\n * @param {!Node} wrapper\n */\n function updateWra
pperDown(wrapper) {\n wrapper.firstChild_ = wrapper.firstChild;\n wrapper.
lastChild_ = wrapper.lastChild;\n }\n\n function updateAllChildNodes(parentNod
eWrapper) {\n assert(parentNodeWrapper instanceof Node);\n for (var childW
rapper = parentNodeWrapper.firstChild;\n childWrapper;\n childWr
apper = childWrapper.nextSibling) {\n updateWrapperUpAndSideways(childWrapp
er);\n }\n updateWrapperDown(parentNodeWrapper);\n }\n\n function insert
Before(parentNodeWrapper, newChildWrapper, refChildWrapper) {\n var parentNod
e = unwrap(parentNodeWrapper);\n var newChild = unwrap(newChildWrapper);\n
var refChild = refChildWrapper ? unwrap(refChildWrapper) : null;\n\n remove(
newChildWrapper);\n updateWrapperUpAndSideways(newChildWrapper);\n\n if (!
refChildWrapper) {\n parentNodeWrapper.lastChild_ = parentNodeWrapper.lastC
hild;\n if (parentNodeWrapper.lastChild === parentNodeWrapper.firstChild)\n
parentNodeWrapper.firstChild_ = parentNodeWrapper.firstChild;\n\n v
ar lastChildWrapper = wrap(parentNode.lastChild);\n if (lastChildWrapper)\n
lastChildWrapper.nextSibling_ = lastChildWrapper.nextSibling;\n } els
e {\n if (parentNodeWrapper.firstChild === refChildWrapper)\n parent
NodeWrapper.firstChild_ = refChildWrapper;\n\n refChildWrapper.previousSibl
ing_ = refChildWrapper.previousSibling;\n }\n\n parentNode.insertBefore(ne
wChild, refChild);\n }\n\n function remove(nodeWrapper) {\n var node = unwr
ap(nodeWrapper)\n var parentNode = node.parentNode;\n if (!parentNode)\n
return;\n\n var parentNodeWrapper = wrap(parentNode);\n updateWrapperU
pAndSideways(nodeWrapper);\n\n if (nodeWrapper.previousSibling)\n nodeWr
apper.previousSibling.nextSibling_ = nodeWrapper;\n if (nodeWrapper.nextSibli
ng)\n nodeWrapper.nextSibling.previousSibling_ = nodeWrapper;\n\n if (pa
rentNodeWrapper.lastChild === nodeWrapper)\n parentNodeWrapper.lastChild_ =
nodeWrapper;\n if (parentNodeWrapper.firstChild === nodeWrapper)\n pare
ntNodeWrapper.firstChild_ = nodeWrapper;\n\n parentNode.removeChild(node);\n
}\n\n var distributedNodesTable = new WeakMap();\n var destinationInsertionPo
intsTable = new WeakMap();\n var rendererForHostTable = new WeakMap();\n\n fun
ction resetDistributedNodes(insertionPoint) {\n distributedNodesTable.set(ins
ertionPoint, []);\n }\n\n function getDistributedNodes(insertionPoint) {\n
var rv = distributedNodesTable.get(insertionPoint);\n if (!rv)\n distrib
utedNodesTable.set(insertionPoint, rv = []);\n return rv;\n }\n\n function
getChildNodesSnapshot(node) {\n var result = [], i = 0;\n for (var child =
node.firstChild; child; child = child.nextSibling) {\n result[i++] = child
;\n }\n return result;\n }\n\n var request = oneOf(window, [\n 'reque
stAnimationFrame',\n 'mozRequestAnimationFrame',\n 'webkitRequestAnimation
Frame',\n 'setTimeout'\n ]);\n\n var pendingDirtyRenderers = [];\n var ren
derTimer;\n\n function renderAllPending() {\n // TODO(arv): Order these in d
ocument order. That way we do not have to\n // render something twice.\n f
or (var i = 0; i < pendingDirtyRenderers.length; i++) {\n var renderer = pe
ndingDirtyRenderers[i];\n var parentRenderer = renderer.parentRenderer;\n
if (parentRenderer && parentRenderer.dirty)\n continue;\n render
er.render();\n }\n\n pendingDirtyRenderers = [];\n }\n\n function handle
RequestAnimationFrame() {\n renderTimer = null;\n renderAllPending();\n }
\n\n /**\n * Returns existing shadow renderer 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 renderer = new ShadowRenderer(host);\n
rendererForHostTable.set(host, renderer);\n }\n return renderer;\n }\
n\n function getShadowRootAncestor(node) {\n var root = getTreeScope(node).r
oot;\n if (root instanceof ShadowRoot)\n return root;\n return null;\
n }\n\n function getRendererForShadowRoot(shadowRoot) {\n return getRendere
rForHost(shadowRoot.host);\n }\n\n var spliceDiff = new ArraySplice();\n spli
ceDiff.equals = function(renderNode, rawNode) {\n return unwrap(renderNode.no
de) === rawNode;\n };\n\n /**\n * RenderNode is used as an in memory \"rende
r tree\". When we render the\n * composed 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 = new RenderNode(node);\n this.child
Nodes.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 oldChildren = getChildNodesSnapshot(unw
rap(nodeWrapper));\n var added = opt_added || new WeakMap();\n\n var s
plices = spliceDiff.calculateSplices(newChildren, oldChildren);\n\n var new
Index = 0, oldIndex = 0;\n var lastIndex = 0;\n for (var i = 0; i < sp
lices.length; i++) {\n var splice = splices[i];\n for (; lastIndex
< splice.index; lastIndex++) {\n oldIndex++;\n newChildren[ne
wIndex++].sync(added);\n }\n\n var removedCount = splice.removed.l
ength;\n for (var j = 0; j < removedCount; j++) {\n var wrapper
= wrap(oldChildren[oldIndex++]);\n if (!added.get(wrapper))\n
remove(wrapper);\n }\n\n var addedCount = splice.addedCount;\n
var refNode = oldChildren[oldIndex] && wrap(oldChildren[oldIndex]);\n
for (var j = 0; j < addedCount; j++) {\n var newChildRenderNode = ne
wChildren[newIndex++];\n var newChildWrapper = newChildRenderNode.node;
\n insertBefore(nodeWrapper, newChildWrapper, refNode);\n\n //
Keep track of added so that we do not remove the node after it\n // ha
s been added.\n added.set(newChildWrapper, true);\n\n newChild
RenderNode.sync(added);\n }\n\n lastIndex += addedCount;\n }\
n\n for (var i = lastIndex; i < newChildren.length; i++) {\n newChil
dren[i].sync(added);\n }\n }\n };\n\n function ShadowRenderer(host) {\
n this.host = host;\n this.dirty = false;\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#render
ing-shadow-trees\n render: function(opt_renderNode) {\n if (!this.dirty)
\n return;\n\n this.invalidateAttributes();\n\n var host = this
.host;\n\n this.distribution(host);\n var renderNode = opt_renderNode
|| new RenderNode(host);\n this.buildRenderTree(renderNode, host);\n\n
var topMostRenderer = !opt_renderNode;\n if (topMostRenderer)\n ren
derNode.sync();\n\n this.dirty = false;\n },\n\n get parentRenderer()
{\n return getTreeScope(this.host).renderer;\n },\n\n invalidate: fu
nction() {\n if (!this.dirty) {\n this.dirty = true;\n var pa
rentRenderer = this.parentRenderer;\n if (parentRenderer)\n pare
ntRenderer.invalidate();\n pendingDirtyRenderers.push(this);\n if
(renderTimer)\n return;\n renderTimer = window[request](handleRe
questAnimationFrame, 0);\n }\n },\n\n // http://w3c.github.io/webcomp
onents/spec/shadow/#distribution-algorithms\n distribution: function(root) {\
n this.resetAll(root);\n this.distributionResolution(root);\n },\n\
n resetAll: function(node) {\n if (isInsertionPoint(node))\n rese
tDistributedNodes(node);\n else\n resetDestinationInsertionPoints(no
de);\n\n for (var child = node.firstChild; 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 t
his.resetAll(node.olderShadowRoot);\n },\n\n // http://w3c.github.io/webco
mponents/spec/shadow/#distribution-results\n distributionResolution: function
(node) {\n if (isShadowHost(node)) {\n var shadowHost = node;\n
// 1.1\n var pool = poolPopulation(shadowHost);\n\n var shadowT
rees = getShadowTrees(shadowHost);\n\n // 1.2\n for (var i = 0; i
< shadowTrees.length; i++) {\n // 1.2.1\n this.poolDistributio
n(shadowTrees[i], pool);\n }\n\n // 1.3\n for (var i = shad
owTrees.length - 1; i >= 0; i--) {\n var shadowTree = shadowTrees[i];\n
\n // 1.3.1\n // TODO(arv): We should keep the shadow insertio
n points on the\n // shadow root (or renderer) so we don't have to sear
ch the tree\n // every time.\n var shadow = getShadowInsertion
Point(shadowTree);\n\n // 1.3.2\n if (shadow) {\n\n
// 1.3.2.1\n var olderShadowRoot = 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], shadow);\n }\n }\n\n
// 1.3.3\n this.distributionResolution(shadowTree);\n }
\n }\n\n for (var child = node.firstChild; child; child = child.nextSi
bling) {\n this.distributionResolution(child);\n }\n },\n\n //
http://w3c.github.io/webcomponents/spec/shadow/#dfn-pool-distribution-algorithm
\n poolDistribution: function (node, pool) {\n if (node instanceof HTMLS
hadowElement)\n return;\n\n if (node instanceof HTMLContentElement)
{\n var content = node;\n this.updateDependentAttributes(content.g
etAttribute('select'));\n\n var anyDistributed = false;\n\n // 1.1
\n for (var i = 0; i < pool.length; i++) {\n var node = pool[i];
\n if (!node)\n continue;\n if (matches(node, conte
nt)) {\n destributeNodeInto(node, content);\n pool[i] = un
defined;\n anyDistributed = true;\n }\n }\n\n
// 1.2\n // Fallback content\n if (!anyDistributed) {\n f
or (var child = content.firstChild;\n child;\n child
= child.nextSibling) {\n destributeNodeInto(child, content);\n
}\n }\n\n return;\n }\n\n for (var child = node.firs
tChild; child; child = child.nextSibling) {\n this.poolDistribution(child
, pool);\n }\n },\n\n buildRenderTree: function(renderNode, node) {\n
var children = this.compose(node);\n for (var i = 0; i < children.len
gth; i++) {\n var child = children[i];\n var childRenderNode = ren
derNode.append(child);\n this.buildRenderTree(childRenderNode, child);\n
}\n\n if (isShadowHost(node)) {\n var renderer = getRendererFor
Host(node);\n renderer.dirty = false;\n }\n\n },\n\n compose:
function(node) {\n var children = [];\n var p = node.shadowRoot || nod
e;\n for (var child = p.firstChild; child; child = child.nextSibling) {\n
if (isInsertionPoint(child)) {\n this.associateNode(p);\n
var distributedNodes = getDistributedNodes(child);\n for (var j = 0;
j < distributedNodes.length; j++) {\n var distributedNode = distribut
edNodes[j];\n if (isFinalDestination(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 invalidated.\n */\n invalidateAttri
butes: function() {\n this.attributes = Object.create(null);\n },\n\n
/**\n * Parses the selector and makes this renderer dependent on the attrib
ute\n * being used in the selector.\n * @param {string} selector\n *
/\n updateDependentAttributes: function(selector) {\n if (!selector)\n
return;\n\n var attributes = this.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 a
ttributes[name] = true;\n });\n\n // Pseudo selectors have been remove
d from the spec.\n },\n\n dependsOnAttribute: function(name) {\n retu
rn this.attributes[name];\n },\n\n associateNode: function(node) {\n
unsafeUnwrap(node).polymerShadowRenderer_ = this;\n }\n };\n\n // http://w3
c.github.io/webcomponents/spec/shadow/#dfn-pool-population-algorithm\n function
poolPopulation(node) {\n var pool = [];\n for (var child = node.firstChil
d; child; child = child.nextSibling) {\n if (isInsertionPoint(child)) {\n
pool.push.apply(pool, getDistributedNodes(child));\n } else {\n
pool.push(child);\n }\n }\n return pool;\n }\n\n function getShad
owInsertionPoint(node) {\n if (node instanceof HTMLShadowElement)\n retu
rn node;\n if (node instanceof HTMLContentElement)\n return null;\n f
or (var child = node.firstChild; child; child = child.nextSibling) {\n var
res = getShadowInsertionPoint(child);\n if (res)\n return res;\n
}\n return null;\n }\n\n function destributeNodeInto(child, insertionPoint)
{\n getDistributedNodes(insertionPoint).push(child);\n var points = desti
nationInsertionPointsTable.get(child);\n if (!points)\n destinationInser
tionPointsTable.set(child, [insertionPoint]);\n else\n points.push(inser
tionPoint);\n }\n\n function getDestinationInsertionPoints(node) {\n return
destinationInsertionPointsTable.get(node);\n }\n\n function resetDestinationI
nsertionPoints(node) {\n // IE11 crashes when delete is used.\n destinatio
nInsertionPointsTable.set(node, undefined);\n }\n\n // AllowedSelectors :\n /
/ TypeSelector\n // *\n // ClassSelector\n // IDSelector\n // Attr
ibuteSelector\n // negation\n var selectorStartCharRe = /^(:not\\()?[*.#[a-z
A-Z_|]/;\n\n function matches(node, contentElement) {\n var select = content
Element.getAttribute('select');\n if (!select)\n return true;\n\n //
Here we know the select attribute is a non empty string.\n select = select.tr
im();\n if (!select)\n return true;\n\n if (!(node instanceof Element
))\n return false;\n\n if (!selectorStartCharRe.test(select))\n ret
urn false;\n\n try {\n return node.matches(select);\n } catch (ex) {\
n // Invalid selector.\n return false;\n }\n }\n\n function isFin
alDestination(insertionPoint, node) {\n var points = getDestinationInsertionP
oints(node);\n return points && points[points.length - 1] === insertionPoint;
\n }\n\n function isInsertionPoint(node) {\n return node instanceof HTMLCon
tentElement ||\n node instanceof HTMLShadowElement;\n }\n\n function
isShadowHost(shadowHost) {\n return shadowHost.shadowRoot;\n }\n\n // Retu
rns the shadow trees as an array, with the youngest tree at the\n // beginning
of the array.\n function getShadowTrees(host) {\n var trees = [];\n\n for
(var tree = host.shadowRoot; tree; tree = tree.olderShadowRoot) {\n trees.
push(tree);\n }\n return trees;\n }\n\n function render(host) {\n new
ShadowRenderer(host).render();\n };\n\n // Need to rerender shadow host when:
\n //\n // - a direct child to the ShadowRoot is added or removed\n // - a di
rect child to the host is added or removed\n // - a new shadow root is created\
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[select]
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 Node.
prototype.invalidateShadowRenderer = function(force) {\n var renderer = unsaf
eUnwrap(this).polymerShadowRenderer_;\n if (renderer) {\n renderer.inval
idate();\n return true;\n }\n\n return false;\n };\n\n HTMLContentE
lement.prototype.getDistributedNodes =\n HTMLShadowElement.prototype.getDistrib
utedNodes = function() {\n // TODO(arv): We should only rerender the dirty an
cestor renderers (from\n // the root and down).\n renderAllPending();\n
return getDistributedNodes(this);\n };\n\n Element.prototype.getDestinationIn
sertionPoints = function() {\n renderAllPending();\n return getDestination
InsertionPoints(this) || [];\n };\n\n HTMLContentElement.prototype.nodeIsInser
ted_ =\n HTMLShadowElement.prototype.nodeIsInserted_ = function() {\n // Inv
alidate old renderer if any.\n this.invalidateShadowRenderer();\n\n var sh
adowRoot = getShadowRootAncestor(this);\n var renderer;\n if (shadowRoot)\
n renderer = getRendererForShadowRoot(shadowRoot);\n unsafeUnwrap(this).
polymerShadowRenderer_ = renderer;\n if (renderer)\n renderer.invalidate
();\n };\n\n scope.getRendererForHost = getRendererForHost;\n scope.getShadow
Trees = getShadowTrees;\n scope.renderAllPending = renderAllPending;\n\n scope
.getDestinationInsertionPoints = getDestinationInsertionPoints;\n\n // Exposed
for testing\n scope.visual = {\n insertBefore: insertBefore,\n remove: re
move,\n };\n\n})(window.ShadowDOMPolyfill);\n", | 125 "// 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 unsafeUnwrap = scope.unsafeUnwrap;\n var unwr
ap = scope.unwrap;\n var wrap = scope.wrap;\n\n /**\n * Updates the fields o
f a wrapper to a snapshot of the logical DOM as needed.\n * Up means parentNod
e\n * Sideways means previous and next sibling.\n * @param {!Node} wrapper\n
*/\n function updateWrapperUpAndSideways(wrapper) {\n wrapper.previousSib
ling_ = wrapper.previousSibling;\n wrapper.nextSibling_ = wrapper.nextSibling
;\n wrapper.parentNode_ = wrapper.parentNode;\n }\n\n /**\n * Updates the
fields of a wrapper to a snapshot of the logical DOM as needed.\n * Down mean
s first and last child\n * @param {!Node} wrapper\n */\n function updateWra
pperDown(wrapper) {\n wrapper.firstChild_ = wrapper.firstChild;\n wrapper.
lastChild_ = wrapper.lastChild;\n }\n\n function updateAllChildNodes(parentNod
eWrapper) {\n assert(parentNodeWrapper instanceof Node);\n for (var childW
rapper = parentNodeWrapper.firstChild;\n childWrapper;\n childWr
apper = childWrapper.nextSibling) {\n updateWrapperUpAndSideways(childWrapp
er);\n }\n updateWrapperDown(parentNodeWrapper);\n }\n\n function insert
Before(parentNodeWrapper, newChildWrapper, refChildWrapper) {\n var parentNod
e = unwrap(parentNodeWrapper);\n var newChild = unwrap(newChildWrapper);\n
var refChild = refChildWrapper ? unwrap(refChildWrapper) : null;\n\n remove(
newChildWrapper);\n updateWrapperUpAndSideways(newChildWrapper);\n\n if (!
refChildWrapper) {\n parentNodeWrapper.lastChild_ = parentNodeWrapper.lastC
hild;\n if (parentNodeWrapper.lastChild === parentNodeWrapper.firstChild)\n
parentNodeWrapper.firstChild_ = parentNodeWrapper.firstChild;\n\n v
ar lastChildWrapper = wrap(parentNode.lastChild);\n if (lastChildWrapper)\n
lastChildWrapper.nextSibling_ = lastChildWrapper.nextSibling;\n } els
e {\n if (parentNodeWrapper.firstChild === refChildWrapper)\n parent
NodeWrapper.firstChild_ = refChildWrapper;\n\n refChildWrapper.previousSibl
ing_ = refChildWrapper.previousSibling;\n }\n\n parentNode.insertBefore(ne
wChild, refChild);\n }\n\n function remove(nodeWrapper) {\n var node = unwr
ap(nodeWrapper)\n var parentNode = node.parentNode;\n if (!parentNode)\n
return;\n\n var parentNodeWrapper = wrap(parentNode);\n updateWrapperU
pAndSideways(nodeWrapper);\n\n if (nodeWrapper.previousSibling)\n nodeWr
apper.previousSibling.nextSibling_ = nodeWrapper;\n if (nodeWrapper.nextSibli
ng)\n nodeWrapper.nextSibling.previousSibling_ = nodeWrapper;\n\n if (pa
rentNodeWrapper.lastChild === nodeWrapper)\n parentNodeWrapper.lastChild_ =
nodeWrapper;\n if (parentNodeWrapper.firstChild === nodeWrapper)\n pare
ntNodeWrapper.firstChild_ = nodeWrapper;\n\n parentNode.removeChild(node);\n
}\n\n var distributedNodesTable = new WeakMap();\n var destinationInsertionPo
intsTable = new WeakMap();\n var rendererForHostTable = new WeakMap();\n\n fun
ction resetDistributedNodes(insertionPoint) {\n distributedNodesTable.set(ins
ertionPoint, []);\n }\n\n function getDistributedNodes(insertionPoint) {\n
var rv = distributedNodesTable.get(insertionPoint);\n if (!rv)\n distrib
utedNodesTable.set(insertionPoint, rv = []);\n return rv;\n }\n\n function
getChildNodesSnapshot(node) {\n var result = [], i = 0;\n for (var child =
node.firstChild; child; child = child.nextSibling) {\n result[i++] = child
;\n }\n return result;\n }\n\n var request = oneOf(window, [\n 'reque
stAnimationFrame',\n 'mozRequestAnimationFrame',\n 'webkitRequestAnimation
Frame',\n 'setTimeout'\n ]);\n\n var pendingDirtyRenderers = [];\n var ren
derTimer;\n\n function renderAllPending() {\n // TODO(arv): Order these in d
ocument order. That way we do not have to\n // render something twice.\n f
or (var i = 0; i < pendingDirtyRenderers.length; i++) {\n var renderer = pe
ndingDirtyRenderers[i];\n var parentRenderer = renderer.parentRenderer;\n
if (parentRenderer && parentRenderer.dirty)\n continue;\n render
er.render();\n }\n\n pendingDirtyRenderers = [];\n }\n\n function handle
RequestAnimationFrame() {\n renderTimer = null;\n renderAllPending();\n }
\n\n /**\n * Returns existing shadow renderer 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 renderer = new ShadowRenderer(host);\n
rendererForHostTable.set(host, renderer);\n }\n return renderer;\n }\
n\n function getShadowRootAncestor(node) {\n var root = getTreeScope(node).r
oot;\n if (root instanceof ShadowRoot)\n return root;\n return null;\
n }\n\n function getRendererForShadowRoot(shadowRoot) {\n return getRendere
rForHost(shadowRoot.host);\n }\n\n var spliceDiff = new ArraySplice();\n spli
ceDiff.equals = function(renderNode, rawNode) {\n return unwrap(renderNode.no
de) === rawNode;\n };\n\n /**\n * RenderNode is used as an in memory \"rende
r tree\". When we render the\n * composed 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 = new RenderNode(node);\n this.child
Nodes.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 oldChildren = getChildNodesSnapshot(unw
rap(nodeWrapper));\n var added = opt_added || new WeakMap();\n\n var s
plices = spliceDiff.calculateSplices(newChildren, oldChildren);\n\n var new
Index = 0, oldIndex = 0;\n var lastIndex = 0;\n for (var i = 0; i < sp
lices.length; i++) {\n var splice = splices[i];\n for (; lastIndex
< splice.index; lastIndex++) {\n oldIndex++;\n newChildren[ne
wIndex++].sync(added);\n }\n\n var removedCount = splice.removed.l
ength;\n for (var j = 0; j < removedCount; j++) {\n var wrapper
= wrap(oldChildren[oldIndex++]);\n if (!added.get(wrapper))\n
remove(wrapper);\n }\n\n var addedCount = splice.addedCount;\n
var refNode = oldChildren[oldIndex] && wrap(oldChildren[oldIndex]);\n
for (var j = 0; j < addedCount; j++) {\n var newChildRenderNode = ne
wChildren[newIndex++];\n var newChildWrapper = newChildRenderNode.node;
\n insertBefore(nodeWrapper, newChildWrapper, refNode);\n\n //
Keep track of added so that we do not remove the node after it\n // ha
s been added.\n added.set(newChildWrapper, true);\n\n newChild
RenderNode.sync(added);\n }\n\n lastIndex += addedCount;\n }\
n\n for (var i = lastIndex; i < newChildren.length; i++) {\n newChil
dren[i].sync(added);\n }\n }\n };\n\n function ShadowRenderer(host) {\
n this.host = host;\n this.dirty = false;\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#render
ing-shadow-trees\n render: function(opt_renderNode) {\n if (!this.dirty)
\n return;\n\n this.invalidateAttributes();\n\n var host = this
.host;\n\n this.distribution(host);\n var renderNode = opt_renderNode
|| new RenderNode(host);\n this.buildRenderTree(renderNode, host);\n\n
var topMostRenderer = !opt_renderNode;\n if (topMostRenderer)\n ren
derNode.sync();\n\n this.dirty = false;\n },\n\n get parentRenderer()
{\n return getTreeScope(this.host).renderer;\n },\n\n invalidate: fu
nction() {\n if (!this.dirty) {\n this.dirty = true;\n var pa
rentRenderer = this.parentRenderer;\n if (parentRenderer)\n pare
ntRenderer.invalidate();\n pendingDirtyRenderers.push(this);\n if
(renderTimer)\n return;\n renderTimer = window[request](handleRe
questAnimationFrame, 0);\n }\n },\n\n // http://w3c.github.io/webcomp
onents/spec/shadow/#distribution-algorithms\n distribution: function(root) {\
n this.resetAll(root);\n this.distributionResolution(root);\n },\n\
n resetAll: function(node) {\n if (isInsertionPoint(node))\n rese
tDistributedNodes(node);\n else\n resetDestinationInsertionPoints(no
de);\n\n for (var child = node.firstChild; 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 t
his.resetAll(node.olderShadowRoot);\n },\n\n // http://w3c.github.io/webco
mponents/spec/shadow/#distribution-results\n distributionResolution: function
(node) {\n if (isShadowHost(node)) {\n var shadowHost = node;\n
// 1.1\n var pool = poolPopulation(shadowHost);\n\n var shadowT
rees = getShadowTrees(shadowHost);\n\n // 1.2\n for (var i = 0; i
< shadowTrees.length; i++) {\n // 1.2.1\n this.poolDistributio
n(shadowTrees[i], pool);\n }\n\n // 1.3\n for (var i = shad
owTrees.length - 1; i >= 0; i--) {\n var shadowTree = shadowTrees[i];\n
\n // 1.3.1\n // TODO(arv): We should keep the shadow insertio
n points on the\n // shadow root (or renderer) so we don't have to sear
ch the tree\n // every time.\n var shadow = getShadowInsertion
Point(shadowTree);\n\n // 1.3.2\n if (shadow) {\n\n
// 1.3.2.1\n var olderShadowRoot = 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], shadow);\n }\n }\n\n
// 1.3.3\n this.distributionResolution(shadowTree);\n }
\n }\n\n for (var child = node.firstChild; child; child = child.nextSi
bling) {\n this.distributionResolution(child);\n }\n },\n\n //
http://w3c.github.io/webcomponents/spec/shadow/#dfn-pool-distribution-algorithm
\n poolDistribution: function (node, pool) {\n if (node instanceof HTMLS
hadowElement)\n return;\n\n if (node instanceof HTMLContentElement)
{\n var content = node;\n this.updateDependentAttributes(content.g
etAttribute('select'));\n\n var anyDistributed = false;\n\n // 1.1
\n for (var i = 0; i < pool.length; i++) {\n var node = pool[i];
\n if (!node)\n continue;\n if (matches(node, conte
nt)) {\n destributeNodeInto(node, content);\n pool[i] = un
defined;\n anyDistributed = true;\n }\n }\n\n
// 1.2\n // Fallback content\n if (!anyDistributed) {\n f
or (var child = content.firstChild;\n child;\n child
= child.nextSibling) {\n destributeNodeInto(child, content);\n
}\n }\n\n return;\n }\n\n for (var child = node.firs
tChild; child; child = child.nextSibling) {\n this.poolDistribution(child
, pool);\n }\n },\n\n buildRenderTree: function(renderNode, node) {\n
var children = this.compose(node);\n for (var i = 0; i < children.len
gth; i++) {\n var child = children[i];\n var childRenderNode = ren
derNode.append(child);\n this.buildRenderTree(childRenderNode, child);\n
}\n\n if (isShadowHost(node)) {\n var renderer = getRendererFor
Host(node);\n renderer.dirty = false;\n }\n\n },\n\n compose:
function(node) {\n var children = [];\n var p = node.shadowRoot || nod
e;\n for (var child = p.firstChild; child; child = child.nextSibling) {\n
if (isInsertionPoint(child)) {\n this.associateNode(p);\n
var distributedNodes = getDistributedNodes(child);\n for (var j = 0;
j < distributedNodes.length; j++) {\n var distributedNode = distribut
edNodes[j];\n if (isFinalDestination(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 invalidated.\n */\n invalidateAttri
butes: function() {\n this.attributes = Object.create(null);\n },\n\n
/**\n * Parses the selector and makes this renderer dependent on the attrib
ute\n * being used in the selector.\n * @param {string} selector\n *
/\n updateDependentAttributes: function(selector) {\n if (!selector)\n
return;\n\n var attributes = this.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 a
ttributes[name] = true;\n });\n\n // Pseudo selectors have been remove
d from the spec.\n },\n\n dependsOnAttribute: function(name) {\n retu
rn this.attributes[name];\n },\n\n associateNode: function(node) {\n
unsafeUnwrap(node).polymerShadowRenderer_ = this;\n }\n };\n\n // http://w3
c.github.io/webcomponents/spec/shadow/#dfn-pool-population-algorithm\n function
poolPopulation(node) {\n var pool = [];\n for (var child = node.firstChil
d; child; child = child.nextSibling) {\n if (isInsertionPoint(child)) {\n
pool.push.apply(pool, getDistributedNodes(child));\n } else {\n
pool.push(child);\n }\n }\n return pool;\n }\n\n function getShad
owInsertionPoint(node) {\n if (node instanceof HTMLShadowElement)\n retu
rn node;\n if (node instanceof HTMLContentElement)\n return null;\n f
or (var child = node.firstChild; child; child = child.nextSibling) {\n var
res = getShadowInsertionPoint(child);\n if (res)\n return res;\n
}\n return null;\n }\n\n function destributeNodeInto(child, insertionPoint)
{\n getDistributedNodes(insertionPoint).push(child);\n var points = desti
nationInsertionPointsTable.get(child);\n if (!points)\n destinationInser
tionPointsTable.set(child, [insertionPoint]);\n else\n points.push(inser
tionPoint);\n }\n\n function getDestinationInsertionPoints(node) {\n return
destinationInsertionPointsTable.get(node);\n }\n\n function resetDestinationI
nsertionPoints(node) {\n // IE11 crashes when delete is used.\n destinatio
nInsertionPointsTable.set(node, undefined);\n }\n\n // AllowedSelectors :\n /
/ TypeSelector\n // *\n // ClassSelector\n // IDSelector\n // Attr
ibuteSelector\n // negation\n var selectorStartCharRe = /^(:not\\()?[*.#[a-z
A-Z_|]/;\n\n function matches(node, contentElement) {\n var select = content
Element.getAttribute('select');\n if (!select)\n return true;\n\n //
Here we know the select attribute is a non empty string.\n select = select.tr
im();\n if (!select)\n return true;\n\n if (!(node instanceof Element
))\n return false;\n\n if (!selectorStartCharRe.test(select))\n ret
urn false;\n\n try {\n return node.matches(select);\n } catch (ex) {\
n // Invalid selector.\n return false;\n }\n }\n\n function isFin
alDestination(insertionPoint, node) {\n var points = getDestinationInsertionP
oints(node);\n return points && points[points.length - 1] === insertionPoint;
\n }\n\n function isInsertionPoint(node) {\n return node instanceof HTMLCon
tentElement ||\n node instanceof HTMLShadowElement;\n }\n\n function
isShadowHost(shadowHost) {\n return shadowHost.shadowRoot;\n }\n\n // Retu
rns the shadow trees as an array, with the youngest tree at the\n // beginning
of the array.\n function getShadowTrees(host) {\n var trees = [];\n\n for
(var tree = host.shadowRoot; tree; tree = tree.olderShadowRoot) {\n trees.
push(tree);\n }\n return trees;\n }\n\n function render(host) {\n new
ShadowRenderer(host).render();\n };\n\n // Need to rerender shadow host when:
\n //\n // - a direct child to the ShadowRoot is added or removed\n // - a di
rect child to the host is added or removed\n // - a new shadow root is created\
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[select]
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 Node.
prototype.invalidateShadowRenderer = function(force) {\n var renderer = unsaf
eUnwrap(this).polymerShadowRenderer_;\n if (renderer) {\n renderer.inval
idate();\n return true;\n }\n\n return false;\n };\n\n HTMLContentE
lement.prototype.getDistributedNodes =\n HTMLShadowElement.prototype.getDistrib
utedNodes = function() {\n // TODO(arv): We should only rerender the dirty an
cestor renderers (from\n // the root and down).\n renderAllPending();\n
return getDistributedNodes(this);\n };\n\n Element.prototype.getDestinationIn
sertionPoints = function() {\n renderAllPending();\n return getDestination
InsertionPoints(this) || [];\n };\n\n HTMLContentElement.prototype.nodeIsInser
ted_ =\n HTMLShadowElement.prototype.nodeIsInserted_ = function() {\n // Inv
alidate old renderer if any.\n this.invalidateShadowRenderer();\n\n var sh
adowRoot = getShadowRootAncestor(this);\n var renderer;\n if (shadowRoot)\
n renderer = getRendererForShadowRoot(shadowRoot);\n unsafeUnwrap(this).
polymerShadowRenderer_ = renderer;\n if (renderer)\n renderer.invalidate
();\n };\n\n scope.getRendererForHost = getRendererForHost;\n scope.getShadow
Trees = getShadowTrees;\n scope.renderAllPending = renderAllPending;\n\n scope
.getDestinationInsertionPoints = getDestinationInsertionPoints;\n\n // Exposed
for testing\n scope.visual = {\n insertBefore: insertBefore,\n remove: re
move,\n };\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 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", | 126 "// 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", |
136 "// 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 setWrapper = scope.setWrapper;\n var unsafeUnwrap =
scope.unsafeUnwrap;\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 setWrapper(impl, this);\n }\n S
election.prototype = {\n get anchorNode() {\n return wrap(unsafeUnwrap(t
his).anchorNode);\n },\n get focusNode() {\n return wrap(unsafeUnwrap
(this).focusNode);\n },\n addRange: function(range) {\n unsafeUnwrap(
this).addRange(unwrap(range));\n },\n collapse: function(node, index) {\n
unsafeUnwrap(this).collapse(unwrapIfNeeded(node), index);\n },\n cont
ainsNode: function(node, allowPartial) {\n return unsafeUnwrap(this).contai
nsNode(unwrapIfNeeded(node), allowPartial);\n },\n extend: function(node,
offset) {\n unsafeUnwrap(this).extend(unwrapIfNeeded(node), offset);\n }
,\n getRangeAt: function(index) {\n return wrap(unsafeUnwrap(this).getRa
ngeAt(index));\n },\n removeRange: function(range) {\n unsafeUnwrap(t
his).removeRange(unwrap(range));\n },\n selectAllChildren: function(node)
{\n unsafeUnwrap(this).selectAllChildren(unwrapIfNeeded(node));\n },\n
toString: function() {\n return unsafeUnwrap(this).toString();\n }\n
};\n\n // WebKit extensions. Not implemented.\n // readonly attribute Node bas
eNode;\n // readonly attribute long baseOffset;\n // readonly attribute Node e
xtentNode;\n // readonly attribute long extentOffset;\n // [RaisesException] v
oid setBaseAndExtent([Default=Undefined] optional Node baseNode,\n //
[Default=Undefined] optional long baseOffset,\n //
[Default=Undefined] optional Node extentNode,\n //
[Default=Undefined] optional long extentOffset);\n // [RaisesException, Implem
entedAs=collapse] void setPosition([Default=Undefined] optional Node node,\n //
[Default=Undefined] optional long offset);\n\n registerWrappe
r(window.Selection, Selection, window.getSelection());\n\n scope.wrappers.Selec
tion = Selection;\n\n})(window.ShadowDOMPolyfill);\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 registerWrapper = sc
ope.registerWrapper;\n var setWrapper = scope.setWrapper;\n var unsafeUnwrap =
scope.unsafeUnwrap;\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 setWrapper(impl, this);\n }\n S
election.prototype = {\n get anchorNode() {\n return wrap(unsafeUnwrap(t
his).anchorNode);\n },\n get focusNode() {\n return wrap(unsafeUnwrap
(this).focusNode);\n },\n addRange: function(range) {\n unsafeUnwrap(
this).addRange(unwrap(range));\n },\n collapse: function(node, index) {\n
unsafeUnwrap(this).collapse(unwrapIfNeeded(node), index);\n },\n cont
ainsNode: function(node, allowPartial) {\n return unsafeUnwrap(this).contai
nsNode(unwrapIfNeeded(node), allowPartial);\n },\n extend: function(node,
offset) {\n unsafeUnwrap(this).extend(unwrapIfNeeded(node), offset);\n }
,\n getRangeAt: function(index) {\n return wrap(unsafeUnwrap(this).getRa
ngeAt(index));\n },\n removeRange: function(range) {\n unsafeUnwrap(t
his).removeRange(unwrap(range));\n },\n selectAllChildren: function(node)
{\n unsafeUnwrap(this).selectAllChildren(unwrapIfNeeded(node));\n },\n
toString: function() {\n return unsafeUnwrap(this).toString();\n }\n
};\n\n // WebKit extensions. Not implemented.\n // readonly attribute Node bas
eNode;\n // readonly attribute long baseOffset;\n // readonly attribute Node e
xtentNode;\n // readonly attribute long extentOffset;\n // [RaisesException] v
oid setBaseAndExtent([Default=Undefined] optional Node baseNode,\n //
[Default=Undefined] optional long baseOffset,\n //
[Default=Undefined] optional Node extentNode,\n //
[Default=Undefined] optional long extentOffset);\n // [RaisesException, Implem
entedAs=collapse] void setPosition([Default=Undefined] optional Node node,\n //
[Default=Undefined] optional long offset);\n\n registerWrappe
r(window.Selection, Selection, window.getSelection());\n\n scope.wrappers.Selec
tion = Selection;\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 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 setWrap
per = scope.setWrapper;\n var unsafeUnwrap = scope.unsafeUnwrap;\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(unsafeUnwrap(this),
arguments));\n };\n }\n\n [\n 'createComment',\n 'createDocumentFrag
ment',\n 'createElement',\n 'createElementNS',\n 'createEvent',\n 'c
reateEventNS',\n 'createRange',\n 'createTextNode',\n 'getElementById'\
n ].forEach(wrapMethod);\n\n var originalAdoptNode = document.adoptNode;\n\n
function adoptNodeNoRemove(node, doc) {\n originalAdoptNode.call(unsafeUnwrap
(doc), unwrap(node));\n adoptSubtree(node, doc);\n }\n\n function adoptSubt
ree(node, doc) {\n if (node.shadowRoot)\n doc.adoptNode(node.shadowRoot)
;\n if (node instanceof ShadowRoot)\n adoptOlderShadowRoots(node, doc);\
n for (var child = node.firstChild; child; child = child.nextSibling) {\n
adoptSubtree(child, doc);\n }\n }\n\n function adoptOlderShadowRoots(shad
owRoot, doc) {\n var oldShadowRoot = shadowRoot.olderShadowRoot;\n if (old
ShadowRoot)\n doc.adoptNode(oldShadowRoot);\n }\n\n var originalGetSelect
ion = document.getSelection;\n\n mixin(Document.prototype, {\n adoptNode: fu
nction(node) {\n if (node.parentNode)\n node.parentNode.removeChild(
node);\n adoptNodeNoRemove(node, this);\n return node;\n },\n el
ementFromPoint: function(x, y) {\n return elementFromPoint(this, this, x, y
);\n },\n importNode: function(node, deep) {\n return cloneNode(node,
deep, unsafeUnwrap(this));\n },\n getSelection: function() {\n rende
rAllPending();\n return new Selection(originalGetSelection.call(unwrap(this
)));\n },\n getElementsByName: function(name) {\n return SelectorsInt
erface.querySelectorAll.call(this,\n '[name=' + JSON.stringify(String(n
ame)) + ']');\n }\n });\n\n if (document.registerElement) {\n var origin
alRegisterElement = document.registerElement;\n Document.prototype.registerEl
ement = function(tagName, object) {\n var prototype, extendsOption;\n
if (object !== undefined) {\n prototype = object.prototype;\n exte
ndsOption = object.extends;\n }\n\n if (!prototype)\n prototype
= Object.create(HTMLElement.prototype);\n\n\n // If we already used the ob
ject as a prototype for another custom\n // element.\n if (scope.nativ
ePrototypeTable.get(prototype)) {\n // TODO(arv): DOMException\n t
hrow new Error('NotSupportedError');\n }\n\n // Find first object on t
he prototype chain that already have a native\n // prototype. Keep track of
all the objects before that so we can create\n // a similar structure for
the native case.\n var proto = Object.getPrototypeOf(prototype);\n var
nativePrototype;\n var prototypes = [];\n while (proto) {\n na
tivePrototype = scope.nativePrototypeTable.get(proto);\n if (nativeProtot
ype)\n break;\n prototypes.push(proto);\n proto = Object.
getPrototypeOf(proto);\n }\n\n if (!nativePrototype) {\n // TOD
O(arv): DOMException\n throw new Error('NotSupportedError');\n }\n\n
// This works by creating a new prototype object that is empty, but has\n
// the native prototype as its proto. The original prototype object\n
// passed into register is used as the wrapper prototype.\n\n var newProtot
ype = Object.create(nativePrototype);\n for (var i = prototypes.length - 1;
i >= 0; i--) {\n newPrototype = Object.create(newPrototype);\n }\n\
n // Add callbacks if present.\n // Names are taken from:\n //
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/So
urce/bindings/v8/CustomElementConstructorBuilder.cpp&sq=package:chromium&type=cs
&l=156\n // and not from the spec since the spec is out of date.\n [\n
'createdCallback',\n 'attachedCallback',\n 'detachedCallba
ck',\n 'attributeChangedCallback',\n ].forEach(function(name) {\n
var f = prototype[name];\n if (!f)\n return;\n newPr
ototype[name] = function() {\n // if this element has been wrapped prio
r to registration,\n // the wrapper is stale; in this case rewrap\n
if (!(wrap(this) instanceof CustomElementConstructor)) {\n rewr
ap(this);\n }\n f.apply(wrap(this), arguments);\n };\n
});\n\n var p = {prototype: newPrototype};\n if (extendsOption)\n
p.extends = extendsOption;\n\n function CustomElementConstructor(no
de) {\n if (!node) {\n if (extendsOption) {\n return
document.createElement(extendsOption, tagName);\n } else {\n
return document.createElement(tagName);\n }\n }\n setWra
pper(node, this);\n }\n CustomElementConstructor.prototype = prototype
;\n CustomElementConstructor.prototype.constructor = CustomElementConstruct
or;\n\n scope.constructorTable.set(newPrototype, CustomElementConstructor);
\n scope.nativePrototypeTable.set(prototype, newPrototype);\n\n // reg
istration is synchronous so do it last\n var nativeConstructor = originalRe
gisterElement.call(unwrap(this),\n tagName, p);\n return CustomEle
mentConstructor;\n };\n\n forwardMethodsToWrapper([\n window.HTMLDocu
ment || window.Document, // Gecko 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 forwardMethodsToWrappe
r([\n window.HTMLBodyElement,\n window.HTMLDocument || window.Document, /
/ Gecko adds these to HTMLDocument\n window.HTMLHeadElement,\n window.HTML
HtmlElement,\n ], [\n 'appendChild',\n 'compareDocumentPosition',\n 'c
ontains',\n 'getElementsByClassName',\n 'getElementsByTagName',\n 'getE
lementsByTagNameNS',\n 'insertBefore',\n 'querySelector',\n 'querySelec
torAll',\n 'removeChild',\n 'replaceChild',\n ].concat(matchesNames));\n\
n forwardMethodsToWrapper([\n window.HTMLDocument || window.Document, // Ge
cko adds these to HTMLDocument\n ], [\n 'adoptNode',\n 'importNode',\n
'contains',\n 'createComment',\n 'createDocumentFragment',\n 'createEl
ement',\n 'createElementNS',\n 'createEvent',\n 'createEventNS',\n '
createRange',\n 'createTextNode',\n 'elementFromPoint',\n 'getElementBy
Id',\n 'getElementsByName',\n 'getSelection',\n ]);\n\n mixin(Document.p
rototype, GetElementsByInterface);\n mixin(Document.prototype, ParentNodeInterf
ace);\n mixin(Document.prototype, SelectorsInterface);\n\n mixin(Document.prot
otype, {\n get implementation() {\n var implementation = implementationT
able.get(this);\n if (implementation)\n return implementation;\n
implementation =\n new DOMImplementation(unwrap(this).implementation)
;\n implementationTable.set(this, implementation);\n return implementa
tion;\n },\n\n get defaultView() {\n return wrap(unwrap(this).default
View);\n }\n });\n\n registerWrapper(window.Document, Document,\n docu
ment.implementation.createHTMLDocument(''));\n\n // Both WebKit and Gecko uses
HTMLDocument for document. HTML5/DOM only has\n // one Document interface and I
E implements the standard correctly.\n if (window.HTMLDocument)\n registerWr
apper(window.HTMLDocument, Document);\n\n wrapEventTargetMethods([\n window.
HTMLBodyElement,\n window.HTMLDocument || window.Document, // Gecko adds the
se to HTMLDocument\n window.HTMLHeadElement,\n ]);\n\n function DOMImplemen
tation(impl) {\n setWrapper(impl, this);\n }\n\n function wrapImplMethod(co
nstructor, name) {\n var original = document.implementation[name];\n const
ructor.prototype[name] = function() {\n return wrap(original.apply(unsafeUn
wrap(this), arguments));\n };\n }\n\n function forwardImplMethod(constructo
r, name) {\n var original = document.implementation[name];\n constructor.p
rototype[name] = function() {\n return original.apply(unsafeUnwrap(this), a
rguments);\n };\n }\n\n wrapImplMethod(DOMImplementation, 'createDocumentTy
pe');\n wrapImplMethod(DOMImplementation, 'createDocument');\n wrapImplMethod(
DOMImplementation, 'createHTMLDocument');\n forwardImplMethod(DOMImplementation
, 'hasFeature');\n\n registerWrapper(window.DOMImplementation, DOMImplementatio
n);\n\n forwardMethodsToWrapper([\n window.DOMImplementation,\n ], [\n '
createDocumentType',\n 'createDocument',\n 'createHTMLDocument',\n 'has
Feature',\n ]);\n\n scope.adoptNodeNoRemove = adoptNodeNoRemove;\n scope.wrap
pers.DOMImplementation = DOMImplementation;\n scope.wrappers.Document = Documen
t;\n\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 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 setWrap
per = scope.setWrapper;\n var unsafeUnwrap = scope.unsafeUnwrap;\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(unsafeUnwrap(this),
arguments));\n };\n }\n\n [\n 'createComment',\n 'createDocumentFrag
ment',\n 'createElement',\n 'createElementNS',\n 'createEvent',\n 'c
reateEventNS',\n 'createRange',\n 'createTextNode',\n 'getElementById'\
n ].forEach(wrapMethod);\n\n var originalAdoptNode = document.adoptNode;\n\n
function adoptNodeNoRemove(node, doc) {\n originalAdoptNode.call(unsafeUnwrap
(doc), unwrap(node));\n adoptSubtree(node, doc);\n }\n\n function adoptSubt
ree(node, doc) {\n if (node.shadowRoot)\n doc.adoptNode(node.shadowRoot)
;\n if (node instanceof ShadowRoot)\n adoptOlderShadowRoots(node, doc);\
n for (var child = node.firstChild; child; child = child.nextSibling) {\n
adoptSubtree(child, doc);\n }\n }\n\n function adoptOlderShadowRoots(shad
owRoot, doc) {\n var oldShadowRoot = shadowRoot.olderShadowRoot;\n if (old
ShadowRoot)\n doc.adoptNode(oldShadowRoot);\n }\n\n var originalGetSelect
ion = document.getSelection;\n\n mixin(Document.prototype, {\n adoptNode: fu
nction(node) {\n if (node.parentNode)\n node.parentNode.removeChild(
node);\n adoptNodeNoRemove(node, this);\n return node;\n },\n el
ementFromPoint: function(x, y) {\n return elementFromPoint(this, this, x, y
);\n },\n importNode: function(node, deep) {\n return cloneNode(node,
deep, unsafeUnwrap(this));\n },\n getSelection: function() {\n rende
rAllPending();\n return new Selection(originalGetSelection.call(unwrap(this
)));\n },\n getElementsByName: function(name) {\n return SelectorsInt
erface.querySelectorAll.call(this,\n '[name=' + JSON.stringify(String(n
ame)) + ']');\n }\n });\n\n if (document.registerElement) {\n var origin
alRegisterElement = document.registerElement;\n Document.prototype.registerEl
ement = function(tagName, object) {\n var prototype, extendsOption;\n
if (object !== undefined) {\n prototype = object.prototype;\n exte
ndsOption = object.extends;\n }\n\n if (!prototype)\n prototype
= Object.create(HTMLElement.prototype);\n\n\n // If we already used the ob
ject as a prototype for another custom\n // element.\n if (scope.nativ
ePrototypeTable.get(prototype)) {\n // TODO(arv): DOMException\n t
hrow new Error('NotSupportedError');\n }\n\n // Find first object on t
he prototype chain that already have a native\n // prototype. Keep track of
all the objects before that so we can create\n // a similar structure for
the native case.\n var proto = Object.getPrototypeOf(prototype);\n var
nativePrototype;\n var prototypes = [];\n while (proto) {\n na
tivePrototype = scope.nativePrototypeTable.get(proto);\n if (nativeProtot
ype)\n break;\n prototypes.push(proto);\n proto = Object.
getPrototypeOf(proto);\n }\n\n if (!nativePrototype) {\n // TOD
O(arv): DOMException\n throw new Error('NotSupportedError');\n }\n\n
// This works by creating a new prototype object that is empty, but has\n
// the native prototype as its proto. The original prototype object\n
// passed into register is used as the wrapper prototype.\n\n var newProtot
ype = Object.create(nativePrototype);\n for (var i = prototypes.length - 1;
i >= 0; i--) {\n newPrototype = Object.create(newPrototype);\n }\n\
n // Add callbacks if present.\n // Names are taken from:\n //
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/So
urce/bindings/v8/CustomElementConstructorBuilder.cpp&sq=package:chromium&type=cs
&l=156\n // and not from the spec since the spec is out of date.\n [\n
'createdCallback',\n 'attachedCallback',\n 'detachedCallba
ck',\n 'attributeChangedCallback',\n ].forEach(function(name) {\n
var f = prototype[name];\n if (!f)\n return;\n newPr
ototype[name] = function() {\n // if this element has been wrapped prio
r to registration,\n // the wrapper is stale; in this case rewrap\n
if (!(wrap(this) instanceof CustomElementConstructor)) {\n rewr
ap(this);\n }\n f.apply(wrap(this), arguments);\n };\n
});\n\n var p = {prototype: newPrototype};\n if (extendsOption)\n
p.extends = extendsOption;\n\n function CustomElementConstructor(no
de) {\n if (!node) {\n if (extendsOption) {\n return
document.createElement(extendsOption, tagName);\n } else {\n
return document.createElement(tagName);\n }\n }\n setWra
pper(node, this);\n }\n CustomElementConstructor.prototype = prototype
;\n CustomElementConstructor.prototype.constructor = CustomElementConstruct
or;\n\n scope.constructorTable.set(newPrototype, CustomElementConstructor);
\n scope.nativePrototypeTable.set(prototype, newPrototype);\n\n // reg
istration is synchronous so do it last\n var nativeConstructor = originalRe
gisterElement.call(unwrap(this),\n tagName, p);\n return CustomEle
mentConstructor;\n };\n\n forwardMethodsToWrapper([\n window.HTMLDocu
ment || window.Document, // Gecko 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 forwardMethodsToWrappe
r([\n window.HTMLBodyElement,\n window.HTMLDocument || window.Document, /
/ Gecko adds these to HTMLDocument\n window.HTMLHeadElement,\n window.HTML
HtmlElement,\n ], [\n 'appendChild',\n 'compareDocumentPosition',\n 'c
ontains',\n 'getElementsByClassName',\n 'getElementsByTagName',\n 'getE
lementsByTagNameNS',\n 'insertBefore',\n 'querySelector',\n 'querySelec
torAll',\n 'removeChild',\n 'replaceChild',\n ].concat(matchesNames));\n\
n forwardMethodsToWrapper([\n window.HTMLDocument || window.Document, // Ge
cko adds these to HTMLDocument\n ], [\n 'adoptNode',\n 'importNode',\n
'contains',\n 'createComment',\n 'createDocumentFragment',\n 'createEl
ement',\n 'createElementNS',\n 'createEvent',\n 'createEventNS',\n '
createRange',\n 'createTextNode',\n 'elementFromPoint',\n 'getElementBy
Id',\n 'getElementsByName',\n 'getSelection',\n ]);\n\n mixin(Document.p
rototype, GetElementsByInterface);\n mixin(Document.prototype, ParentNodeInterf
ace);\n mixin(Document.prototype, SelectorsInterface);\n\n mixin(Document.prot
otype, {\n get implementation() {\n var implementation = implementationT
able.get(this);\n if (implementation)\n return implementation;\n
implementation =\n new DOMImplementation(unwrap(this).implementation)
;\n implementationTable.set(this, implementation);\n return implementa
tion;\n },\n\n get defaultView() {\n return wrap(unwrap(this).default
View);\n }\n });\n\n registerWrapper(window.Document, Document,\n docu
ment.implementation.createHTMLDocument(''));\n\n // Both WebKit and Gecko uses
HTMLDocument for document. HTML5/DOM only has\n // one Document interface and I
E implements the standard correctly.\n if (window.HTMLDocument)\n registerWr
apper(window.HTMLDocument, Document);\n\n wrapEventTargetMethods([\n window.
HTMLBodyElement,\n window.HTMLDocument || window.Document, // Gecko adds the
se to HTMLDocument\n window.HTMLHeadElement,\n ]);\n\n function DOMImplemen
tation(impl) {\n setWrapper(impl, this);\n }\n\n function wrapImplMethod(co
nstructor, name) {\n var original = document.implementation[name];\n const
ructor.prototype[name] = function() {\n return wrap(original.apply(unsafeUn
wrap(this), arguments));\n };\n }\n\n function forwardImplMethod(constructo
r, name) {\n var original = document.implementation[name];\n constructor.p
rototype[name] = function() {\n return original.apply(unsafeUnwrap(this), a
rguments);\n };\n }\n\n wrapImplMethod(DOMImplementation, 'createDocumentTy
pe');\n wrapImplMethod(DOMImplementation, 'createDocument');\n wrapImplMethod(
DOMImplementation, 'createHTMLDocument');\n forwardImplMethod(DOMImplementation
, 'hasFeature');\n\n registerWrapper(window.DOMImplementation, DOMImplementatio
n);\n\n forwardMethodsToWrapper([\n window.DOMImplementation,\n ], [\n '
createDocumentType',\n 'createDocument',\n 'createHTMLDocument',\n 'has
Feature',\n ]);\n\n scope.adoptNodeNoRemove = adoptNodeNoRemove;\n scope.wrap
pers.DOMImplementation = DOMImplementation;\n scope.wrappers.Document = Documen
t;\n\n})(window.ShadowDOMPolyfill);\n", |
138 "// 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.getDefaultComputedStyle;\n delete window
.getSelection;\n\n ['addEventListener', 'removeEventListener', 'dispatchEvent']
.forEach(\n function(name) {\n OriginalWindow.prototype[name] = func
tion() {\n var w = wrap(this || window);\n return w[name].appl
y(w, arguments);\n };\n\n // Work around for https://bugzilla.mozi
lla.org/show_bug.cgi?id=943065\n delete window[name];\n });\n\n mix
in(Window.prototype, {\n getComputedStyle: function(el, pseudo) {\n rend
erAllPending();\n return originalGetComputedStyle.call(unwrap(this), unwrap
IfNeeded(el),\n pseudo);\n },\n
getSelection: function() {\n renderAllPending();\n return new Selectio
n(originalGetSelection.call(unwrap(this)));\n },\n\n get document() {\n
return wrap(unwrap(this).document);\n }\n });\n\n // Mozilla proprietary
extension.\n if (originalGetDefaultComputedStyle) {\n Window.prototype.getD
efaultComputedStyle = function(el, pseudo) {\n renderAllPending();\n r
eturn originalGetDefaultComputedStyle.call(unwrap(this),\n unwrapIfNeed
ed(el),pseudo);\n };\n }\n\n registerWrapper(OriginalWindow, Window, window
);\n\n scope.wrappers.Window = Window;\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 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.getDefaultComputedStyle;\n delete window
.getSelection;\n\n ['addEventListener', 'removeEventListener', 'dispatchEvent']
.forEach(\n function(name) {\n OriginalWindow.prototype[name] = func
tion() {\n var w = wrap(this || window);\n return w[name].appl
y(w, arguments);\n };\n\n // Work around for https://bugzilla.mozi
lla.org/show_bug.cgi?id=943065\n delete window[name];\n });\n\n mix
in(Window.prototype, {\n getComputedStyle: function(el, pseudo) {\n rend
erAllPending();\n return originalGetComputedStyle.call(unwrap(this), unwrap
IfNeeded(el),\n pseudo);\n },\n
getSelection: function() {\n renderAllPending();\n return new Selectio
n(originalGetSelection.call(unwrap(this)));\n },\n\n get document() {\n
return wrap(unwrap(this).document);\n }\n });\n\n // Mozilla proprietary
extension.\n if (originalGetDefaultComputedStyle) {\n Window.prototype.getD
efaultComputedStyle = function(el, pseudo) {\n renderAllPending();\n r
eturn originalGetDefaultComputedStyle.call(unwrap(this),\n unwrapIfNeed
ed(el),pseudo);\n };\n }\n\n registerWrapper(OriginalWindow, Window, window
);\n\n scope.wrappers.Window = Window;\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 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", | 130 "/**\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", |
140 "/**\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 setWrapper = scope.setWrapper;\n var unwr
ap = scope.unwrap;\n\n var OriginalFormData = window.FormData;\n\n function Fo
rmData(formElement) {\n var impl;\n if (formElement instanceof OriginalFor
mData) {\n impl = formElement;\n } else {\n impl = new OriginalForm
Data(formElement && unwrap(formElement));\n }\n setWrapper(impl, this);\n
}\n\n registerWrapper(OriginalFormData, FormData, new OriginalFormData());\n\n
scope.wrappers.FormData = FormData;\n\n})(window.ShadowDOMPolyfill);\n", | 131 "/**\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 setWrapper = scope.setWrapper;\n var unwr
ap = scope.unwrap;\n\n var OriginalFormData = window.FormData;\n\n function Fo
rmData(formElement) {\n var impl;\n if (formElement instanceof OriginalFor
mData) {\n impl = formElement;\n } else {\n impl = new OriginalForm
Data(formElement && unwrap(formElement));\n }\n setWrapper(impl, this);\n
}\n\n registerWrapper(OriginalFormData, FormData, new OriginalFormData());\n\n
scope.wrappers.FormData = FormData;\n\n})(window.ShadowDOMPolyfill);\n", |
141 "// 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", | 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 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", |
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(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", | 133 "/*\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", |
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/*\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", | 134 "/*\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 // KEYFRAMES_RULE in IE t
hrows when we query cssText\n // when it contains a -webkit- property.\
n // if this happens, we fallback to constructing the rule\n /
/ from the CSSRuleSet\n // https://connect.microsoft.com/IE/feedbackdet
ail/view/955703/accessing-csstext-of-a-keyframe-rule-that-contains-a-webkit-prop
erty-via-cssom-generates-exception\n try {\n if (rule.cssTex
t) {\n cssText += rule.cssText + '\\n\\n';\n }\n
} catch(x) {\n if (rule.type === CSSRule.KEYFRAMES_RULE && rule.css
Rules) {\n cssText += this.ieSafeCssTextFromKeyFrameRule(rule);\n
}\n }\n }\n }, this);\n }\n return cssText;
\n },\n ieSafeCssTextFromKeyFrameRule: function(rule) {\n var cssText = '@k
eyframes ' + rule.name + ' {';\n Array.prototype.forEach.call(rule.cssRules,
function(rule) {\n cssText += ' ' + rule.keyText + ' {' + rule.style.cssTex
t + '}';\n });\n cssText += ' }';\n return cssText;\n },\n scopeSelec
tor: function(selector, scopeSelector, strict) {\n var r = [], parts = select
or.split(',');\n parts.forEach(function(p) {\n p = p.trim();\n if (
this.selectorNeedsScoping(p, scopeSelector)) {\n p = (strict && !p.match(
polyfillHostNoCombinator)) ? \n this.applyStrictSelectorScope(p, scop
eSelector) :\n this.applySelectorScope(p, scopeSelector);\n }\n
r.push(p);\n }, this);\n return r.join(', ');\n },\n selectorNeedsS
coping: function(selector, scopeSelector) {\n if (Array.isArray(scopeSelector
)) {\n return true;\n }\n var re = this.makeScopeMatcher(scopeSelecto
r);\n return !selector.match(re);\n },\n makeScopeMatcher: function(scopeSe
lector) {\n scopeSelector = scopeSelector.replace(/\\[/g, '\\\\[').replace(/\
\[/g, '\\\\]');\n return new RegExp('^(' + scopeSelector + ')' + selectorReSu
ffix, 'm');\n },\n applySelectorScope: function(selector, selectorScope) {\n
return Array.isArray(selectorScope) ?\n this.applySelectorScopeList(sel
ector, selectorScope) :\n this.applySimpleSelectorScope(selector, selecto
rScope);\n },\n // apply an array of selectors\n applySelectorScopeList: func
tion(selector, scopeSelectorList) {\n var r = [];\n for (var i=0, s; (s=sc
opeSelectorList[i]); i++) {\n r.push(this.applySimpleSelectorScope(selector
, s));\n }\n return r.join(', ');\n },\n // scope via name and [is=name]
\n applySimpleSelectorScope: function(selector, scopeSelector) {\n if (selec
tor.match(polyfillHostRe)) {\n selector = selector.replace(polyfillHostNoCo
mbinator, scopeSelector);\n return selector.replace(polyfillHostRe, scopeSe
lector + ' ');\n } else {\n return scopeSelector + ' ' + selector;\n
}\n },\n // return a selector with [name] suffix on each simple selector\n //
e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name]\n applyStrictSe
lectorScope: function(selector, scopeSelector) {\n scopeSelector = scopeSelec
tor.replace(/\\[is=([^\\]]*)\\]/g, '$1');\n var splits = [' ', '>', '+', '~']
,\n scoped = selector,\n attrName = '[' + scopeSelector + ']';\n sp
lits.forEach(function(sep) {\n var parts = scoped.split(sep);\n scoped
= parts.map(function(p) {\n // remove :host since it should be unnecessa
ry\n var t = p.trim().replace(polyfillHostRe, '');\n if (t && (spl
its.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, polyfillHo
stContext).replace(\n colonHostRe, polyfillHost);\n },\n propertiesFrom
Rule: function(rule) {\n var cssText = rule.style.cssText;\n // TODO(sorve
ll): Safari cssom incorrectly removes quotes from the content\n // property.
(https://bugs.webkit.org/show_bug.cgi?id=118045)\n // don't replace attr rule
s\n if (rule.style.content && !rule.style.content.match(/['\"]+|attr/)) {\n
cssText = cssText.replace(/content:[^;]*;/g, 'content: \\'' + \n ru
le.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/issues/53\n //\n // inherit rules can be omit
ted from cssText\n // TODO(sorvell): remove when Blink bug is fixed:\n //
https://code.google.com/p/chromium/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 re
placeTextInStyles: function(styles, action) {\n if (styles && action) {\n
if (!(styles instanceof Array)) {\n styles = [styles];\n }\n
Array.prototype.forEach.call(styles, function(s) {\n s.textContent = acti
on.call(this, s.textContent);\n }, this);\n }\n },\n addCssToDocument:
function(cssText, name) {\n if (cssText.match('@import')) {\n addOwnShe
et(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 cssCommentNextSelectorRe = /\\/\\*\\s*@polyfill ([^*]*\\*+([^/*][^
*]*\\*+)*\\/)([^{]*?){/gim,\n cssContentNextSelectorRe = /polyfill-next-selec
tor[^}]*content\\:[\\s]*?['\"](.*?)['\"][;\\s]*}([^{]*?){/gim, \n // TODO(so
rvell): remove either content or comment\n cssCommentRuleRe = /\\/\\*\\s@poly
fill-rule([^*]*\\*+([^/*][^*]*\\*+)*)\\//gim,\n cssContentRuleRe = /(polyfill
-rule)[^}]*(content\\:[\\s]*['\"](.*?)['\"])[;\\s]*[^}]*}/gim,\n // TODO(sorv
ell): remove either content or comment\n cssCommentUnscopedRuleRe = /\\/\\*\\
s@polyfill-unscoped-rule([^*]*\\*+([^/*][^*]*\\*+)*)\\//gim,\n cssContentUnsc
opedRuleRe = /(polyfill-unscoped-rule)[^}]*(content\\:[\\s]*['\"](.*?)['\"])[;\\
s]*[^}]*}/gim,\n cssPseudoRe = /::(x-[^\\s{,(]*)/gim,\n cssPartRe = /::par
t\\(([^)]*)\\)/gim,\n // note: :host pre-processed to -shadowcsshost.\n po
lyfillHost = '-shadowcsshost',\n // note: :host-context pre-processed to -sha
dowcsshostcontext.\n polyfillHostContext = '-shadowcsscontext',\n parenSuf
fix = ')(?:\\\\((' +\n '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n ')\\\\)
)?([^,{]*)';\n cssColonHostRe = new RegExp('(' + polyfillHost + parenSuffix,
'gim'),\n cssColonHostContextRe = new RegExp('(' + polyfillHostContext + pare
nSuffix, 'gim'),\n selectorReSuffix = '([>\\\\s~+\\[.,{:][\\\\s\\\\S]*)?$',\n
colonHostRe = /\\:host/gim,\n colonHostContextRe = /\\:host-context/gim,\
n /* host name without combinator */\n polyfillHostNoCombinator = polyfill
Host + '-no-combinator',\n polyfillHostRe = new RegExp(polyfillHost, 'gim'),\
n polyfillHostContextRe = new RegExp(polyfillHostContext, 'gim'),\n shadow
DOMSelectorsRe = [\n /\\^\\^/g,\n /\\^/g,\n /\\/shadow\\//g,\n
/\\/shadow-deep\\//g,\n /::shadow/g,\n /\\/deep\\//g,\n /::con
tent/g\n ];\n\nfunction stylesToCssText(styles, preserveComments) {\n var cs
sText = '';\n Array.prototype.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 = docu
ment.createElement('style');\n style.textContent = cssText;\n return style;\n}
\n\nfunction cssToRules(cssText) {\n var style = cssTextToStyle(cssText);\n do
cument.head.appendChild(style);\n var rules = [];\n if (style.sheet) {\n //
TODO(sorvell): Firefox 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 console.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.init
ialized = true;\n document.body.appendChild(frame);\n var doc = frame.contentD
ocument;\n var base = doc.createElement('base');\n base.href = document.baseUR
I;\n doc.head.appendChild(base);\n}\n\nfunction inFrame(fn) {\n if (!frame.ini
tialized) {\n initFrame();\n }\n document.body.appendChild(frame);\n fn(fr
ame.contentDocument);\n document.body.removeChild(frame);\n}\n\n// TODO(sorvell
): use an iframe if the cssText contains an @import to workaround\n// https://co
de.google.com/p/chromium/issues/detail?id=345114\nvar isChrome = navigator.userA
gent.match('Chrome');\nfunction withCssRules(cssText, callback) {\n if (!callba
ck) {\n return;\n }\n var rules;\n if (cssText.match('@import') && isChrom
e) {\n var style = cssTextToStyle(cssText);\n inFrame(function(doc) {\n
doc.head.appendChild(style.impl);\n rules = Array.prototype.slice.call(s
tyle.sheet.cssRules, 0);\n callback(rules);\n });\n } else {\n rules
= cssToRules(cssText);\n callback(rules);\n }\n}\n\nfunction rulesToCss(css
Rules) {\n for (var i=0, css=[]; i < cssRules.length; i++) {\n css.push(cssR
ules[i].cssText);\n }\n return css.join('\\n\\n');\n}\n\nfunction addCssToDocu
ment(cssText) {\n if (cssText) {\n getSheet().appendChild(document.createTex
tNode(cssText));\n }\n}\n\nfunction addOwnSheet(cssText, name) {\n var style =
cssTextToStyle(cssText);\n style.setAttribute(name, '');\n style.setAttribute
(SHIMMED_ATTRIBUTE, '');\n document.head.appendChild(style);\n}\n\nvar SHIM_ATT
RIBUTE = 'shim-shadowdom';\nvar SHIMMED_ATTRIBUTE = 'shim-shadowdom-css';\nvar N
O_SHIM_ATTRIBUTE = 'no-shim';\n\nvar sheet;\nfunction getSheet() {\n if (!sheet
) {\n sheet = document.createElement(\"style\");\n sheet.setAttribute(SHIM
MED_ATTRIBUTE, '');\n sheet[SHIMMED_ATTRIBUTE] = true;\n }\n return sheet;\
n}\n\n// add polyfill stylesheet to document\nif (window.ShadowDOMPolyfill) {\n
addCssToDocument('style { display: none !important; }\\n');\n var doc = wrap(d
ocument);\n var head = doc.querySelector('head');\n head.insertBefore(getSheet
(), head.childNodes[0]);\n\n // TODO(sorvell): monkey-patching HTMLImports is a
busive;\n // consider a better solution.\n document.addEventListener('DOMConte
ntLoaded', 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 SHI
M_STYLE_SELECTOR = 'style[' + SHIM_ATTRIBUTE + ']';\n HTMLImports.importer.
documentPreloadSelectors += ',' + SHIM_SHEET_SELECTOR;\n HTMLImports.import
er.importsPreloadSelectors += ',' + SHIM_SHEET_SELECTOR;\n\n HTMLImports.pa
rser.documentSelectors = [\n HTMLImports.parser.documentSelectors,\n
SHIM_SHEET_SELECTOR,\n SHIM_STYLE_SELECTOR\n ].join(',');\n \n
var originalParseGeneric = HTMLImports.parser.parseGeneric;\n\n HTMLImp
orts.parser.parseGeneric = function(elt) {\n if (elt[SHIMMED_ATTRIBUTE])
{\n return;\n }\n var style = elt.__importElement || elt;
\n if (!style.hasAttribute(SHIM_ATTRIBUTE)) {\n originalParseGen
eric.call(this, elt);\n return;\n }\n if (elt.__resource)
{\n style = elt.ownerDocument.createElement('style');\n style
.textContent = elt.__resource;\n }\n // relay on HTMLImports for p
ath fixup\n HTMLImports.path.resolveUrlsInStyle(style);\n style.te
xtContent = ShadowCSS.shimStyle(style);\n style.removeAttribute(SHIM_ATTR
IBUTE, '');\n style.setAttribute(SHIMMED_ATTRIBUTE, '');\n style[S
HIMMED_ATTRIBUTE] = true;\n // place in document\n if (style.paren
tNode !== head) {\n // replace links in head\n if (elt.parentN
ode === head) {\n head.replaceChild(style, elt);\n } else {\
n this.addElementToDocument(style);\n }\n }\n
style.__importParsed = true;\n this.markParsingComplete(elt);\n th
is.parseNext();\n }\n\n var hasResource = HTMLImports.parser.hasResour
ce;\n HTMLImports.parser.hasResource = function(node) {\n if (node.l
ocalName === 'link' && node.rel === 'stylesheet' &&\n node.hasAttribu
te(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", |
144 "} else {", | 135 "} else {", |
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 /
/ 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", | 136 "/*\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})(window.Platform);\n", |
146 "}", | 137 "}", |
147 "/* 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 // Copy over the
static methods\n var OriginalURL = scope.URL;\n if (OriginalURL) {\n jURL.c
reateObjectURL = function(blob) {\n // IE extension allows a second optiona
l options argument.\n // http://msdn.microsoft.com/en-us/library/ie/hh77230
2(v=vs.85).aspx\n return OriginalURL.createObjectURL.apply(OriginalURL, arg
uments);\n };\n jURL.revokeObjectURL = function(url) {\n OriginalURL.
revokeObjectURL(url);\n };\n }\n\n scope.URL = jURL;\n\n})(this);\n", | 138 "/* 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 // Copy over the
static methods\n var OriginalURL = scope.URL;\n if (OriginalURL) {\n jURL.c
reateObjectURL = function(blob) {\n // IE extension allows a second optiona
l options argument.\n // http://msdn.microsoft.com/en-us/library/ie/hh77230
2(v=vs.85).aspx\n return OriginalURL.createObjectURL.apply(OriginalURL, arg
uments);\n };\n jURL.revokeObjectURL = function(url) {\n OriginalURL.
revokeObjectURL(url);\n };\n }\n\n scope.URL = jURL;\n\n})(this);\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//
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", | 139 "/*\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})(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(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", | 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 '
use strict';\n\n // polyfill performance.now\n\n if (!window.performance) {\n
var start = Date.now();\n // only at millisecond precision\n window.per
formance = {now: function(){ return Date.now() - start }};\n }\n\n // polyfill
for requestAnimationFrame\n\n if (!window.requestAnimationFrame) {\n window
.requestAnimationFrame = (function() {\n var nativeRaf = window.webkitReque
stAnimationFrame ||\n window.mozRequestAnimationFrame;\n\n return na
tiveRaf ?\n function(callback) {\n return nativeRaf(function() {
\n callback(performance.now());\n });\n } :\n
function( callback ){\n return window.setTimeout(callback, 1000 / 60);\
n };\n })();\n }\n\n if (!window.cancelAnimationFrame) {\n window
.cancelAnimationFrame = (function() {\n return window.webkitCancelAnimatio
nFrame ||\n window.mozCancelAnimationFrame ||\n function(id) {\n
clearTimeout(id);\n };\n })();\n }\n\n // Make a stub for Po
lymer() for polyfill purposes; under the HTMLImports\n // polyfill, scripts in
the main document run before imports. That means\n // if (1) polymer is importe
d and (2) Polymer() is called in the main document\n // in a script after the i
mport, 2 occurs before 1. We correct this here\n // by specfiically patching Po
lymer(); this is not necessary under native\n // HTMLImports.\n var elementDec
larations = [];\n\n var polymerStub = function(name, dictionary) {\n Array.p
rototype.push.call(arguments, document._currentScript);\n elementDeclarations
.push(arguments);\n };\n window.Polymer = polymerStub;\n\n // deliver queued
delcarations\n scope.consumeDeclarations = function(callback) {\n scope.cons
umeDeclarations = function() {\n throw 'Possible attempt to load Polymer twi
ce';\n };\n if (callback) {\n callback(elementDeclarations);\n }\n
elementDeclarations = null;\n };\n\n // Once DOMContent has loaded, any ma
in document scripts that depend on\n // Polymer() should have run. Calling Poly
mer() now is an error until\n // polymer is imported.\n window.addEventListene
r('DOMContentLoaded', function() {\n if (window.Polymer === polymerStub) {\n
window.Polymer = function() {\n console.error('You tried to use poly
mer without loading it first. To ' +\n 'load polymer, <link rel=\"impor
t\" href=\"' + \n 'components/polymer/polymer.html\">');\n };\n
}\n });\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// 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", | |
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
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", | |
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 /
/ 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", | |
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\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", | |
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
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", | |
155 "/*\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", | |
156 "/*\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", | 141 "/*\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", |
157 "/*\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.HTMLImports = window
.HTMLImports || {flags:{}};", | 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 */\nwindow.HTMLImports = window
.HTMLImports || {flags:{}};", |
158 "/*\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 */(function(scope) {\n\nvar has
Native = ('import' in document.createElement('link'));\nvar useNative = hasNativ
e;\n\nisIE = /Trident/.test(navigator.userAgent);\n\n// TODO(sorvell): SD polyfi
ll intrusion\nvar hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);\nvar
wrap = function(node) {\n return hasShadowDOMPolyfill ? ShadowDOMPolyfill.wrap
IfNeeded(node) : node;\n};\nvar mainDoc = wrap(document);\n \n// NOTE: We can
not polyfill document.currentScript because it's not possible\n// both to overri
de and maintain the ability to capture the native value;\n// therefore we choose
to expose _currentScript both when native imports\n// and the polyfill are in u
se.\nvar currentScriptDescriptor = {\n get: function() {\n var script = HTML
Imports.currentScript || document.currentScript ||\n // NOTE: only works
when called in synchronously executing code.\n // readyState should check
if `loading` but IE10 is \n // interactive when scripts run so we cheat.
\n (document.readyState !== 'complete' ? \n document.scripts[docum
ent.scripts.length - 1] : null);\n return wrap(script);\n },\n configurable
: true\n};\n\nObject.defineProperty(document, '_currentScript', currentScriptDes
criptor);\nObject.defineProperty(mainDoc, '_currentScript', currentScriptDescrip
tor);\n\n// call a callback when all HTMLImports in the document at call (or at
least\n// document 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 callba
ck when done\nfunction whenImportsReady(callback, doc) {\n doc = doc || mainDoc
;\n // if document is loading, wait and try again\n whenDocumentReady(function
() {\n watchImportsLoad(callback, doc);\n }, doc);\n}\n\n// call the callbac
k when the document is in a ready state (has dom)\nvar requiredReadyState = isIE
? 'complete' : 'interactive';\nvar READY_EVENT = 'readystatechange';\nfunction
isDocumentReady(doc) {\n return (doc.readyState === 'complete' ||\n doc.re
adyState === requiredReadyState);\n}\n\n// call <callback> when we ensure the do
cument is in a ready state\nfunction whenDocumentReady(callback, doc) {\n if (!
isDocumentReady(doc)) {\n var checkReady = function() {\n if (doc.readyS
tate === 'complete' || \n doc.readyState === requiredReadyState) {\n
doc.removeEventListener(READY_EVENT, checkReady);\n whenDocumentRead
y(callback, doc);\n }\n }\n doc.addEventListener(READY_EVENT, checkRe
ady);\n } else if (callback) {\n callback();\n }\n}\n\n// call <callback> w
hen we ensure all imports have loaded\nfunction watchImportsLoad(callback, doc)
{\n var imports = doc.querySelectorAll('link[rel=import]');\n var loaded = 0,
l = imports.length;\n function checkDone(d) { \n if (loaded == l) {\n c
allback && 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 im
p.addEventListener('error', loadedImport);\n }\n }\n } else {\n chec
kDone();\n }\n}\n\n// NOTE: test for native imports loading is based on explici
tly watching\n// all imports (see below).\nfunction isImportLoaded(link) {\n re
turn useNative ? link.__loaded : link.__importParsed;\n}\n\n// TODO(sorvell): in
stall a mutation observer to see if HTMLImports have loaded\n// this is a workar
ound for https://www.w3.org/Bugs/Public/show_bug.cgi?id=25007\n// and should be
removed when this bug is addressed.\nif (useNative) {\n new MutationObserver(fu
nction(mxns) {\n for (var i=0, l=mxns.length, m; (i < l) && (m=mxns[i]); i++)
{\n if (m.addedNodes) {\n handleImports(m.addedNodes);\n }\n
}\n }).observe(document.head, {childList: true});\n\n function handleImports
(nodes) {\n for (var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++) {\n
if (isImport(n)) {\n handleImport(n); \n }\n }\n }\n\n fu
nction isImport(element) {\n return element.localName === 'link' && element.r
el === 'import';\n }\n\n function handleImport(element) {\n var loaded = el
ement.import;\n if (loaded) {\n markTargetLoaded({target: element});\n
} else {\n element.addEventListener('load', markTargetLoaded);\n ele
ment.addEventListener('error', markTargetLoaded);\n }\n }\n\n function mark
TargetLoaded(event) {\n event.target.__loaded = true;\n }\n\n}\n\n// Fire th
e 'HTMLImportsLoaded' event when imports in document at load time \n// have load
ed. This event is required to simulate the script blocking \n// behavior of nati
ve imports. A main document script that needs to be sure\n// imports have loaded
should wait for this event.\nwhenImportsReady(function() {\n HTMLImports.ready
= true;\n HTMLImports.readyTime = new Date().getTime();\n mainDoc.dispatchEve
nt(\n new CustomEvent('HTMLImportsLoaded', {bubbles: true})\n );\n});\n\n//
exports\nscope.useNative = useNative;\nscope.isImportLoaded = isImportLoaded;\ns
cope.whenReady = whenImportsReady;\nscope.isIE = isIE;\n\n// deprecated\nscope.w
henImportsReady = whenImportsReady;\n\n})(window.HTMLImports);\n", | 143 "/*\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 hasNative = ('import' in document.createElement('link'));
\r\nvar useNative = hasNative;\r\n\r\nisIE = /Trident/.test(navigator.userAgent)
;\r\n\r\n// TODO(sorvell): SD polyfill intrusion\r\nvar hasShadowDOMPolyfill = B
oolean(window.ShadowDOMPolyfill);\r\nvar wrap = function(node) {\r\n return has
ShadowDOMPolyfill ? ShadowDOMPolyfill.wrapIfNeeded(node) : node;\r\n};\r\nvar ma
inDoc = wrap(document);\r\n \r\n// NOTE: We cannot polyfill document.currentS
cript because it's not possible\r\n// both to override and maintain the ability
to capture the native value;\r\n// therefore we choose to expose _currentScript
both when native imports\r\n// and the polyfill are in use.\r\nvar currentScript
Descriptor = {\r\n get: function() {\r\n var script = HTMLImports.currentScr
ipt || document.currentScript ||\r\n // NOTE: only works when called in s
ynchronously executing code.\r\n // readyState should check if `loading`
but IE10 is \r\n // interactive when scripts run so we cheat.\r\n
(document.readyState !== 'complete' ? \r\n document.scripts[document.scri
pts.length - 1] : null);\r\n return wrap(script);\r\n },\r\n configurable:
true\r\n};\r\n\r\nObject.defineProperty(document, '_currentScript', currentScrip
tDescriptor);\r\nObject.defineProperty(mainDoc, '_currentScript', currentScriptD
escriptor);\r\n\r\n// call a callback when all HTMLImports in the document at ca
ll (or at least\r\n// document ready) time have loaded.\r\n// 1. ensure the doc
ument is in a ready state (has dom), then \r\n// 2. watch for loading of imports
and call callback when done\r\nfunction whenImportsReady(callback, doc) {\r\n
doc = doc || mainDoc;\r\n // if document is loading, wait and try again\r\n wh
enDocumentReady(function() {\r\n watchImportsLoad(callback, doc);\r\n }, doc
);\r\n}\r\n\r\n// call the callback when the document is in a ready state (has d
om)\r\nvar requiredReadyState = isIE ? 'complete' : 'interactive';\r\nvar READY_
EVENT = 'readystatechange';\r\nfunction isDocumentReady(doc) {\r\n return (doc.
readyState === 'complete' ||\r\n doc.readyState === requiredReadyState);\r\
n}\r\n\r\n// call <callback> when we ensure the document is in a ready state\r\n
function whenDocumentReady(callback, doc) {\r\n if (!isDocumentReady(doc)) {\r\
n var checkReady = function() {\r\n if (doc.readyState === 'complete' ||
\r\n doc.readyState === requiredReadyState) {\r\n doc.removeEve
ntListener(READY_EVENT, checkReady);\r\n whenDocumentReady(callback, doc)
;\r\n }\r\n };\r\n doc.addEventListener(READY_EVENT, checkReady);\r\n
} else if (callback) {\r\n callback();\r\n }\r\n}\r\n\r\nfunction markTarg
etLoaded(event) {\r\n event.target.__loaded = true;\r\n}\r\n\r\n// call <callba
ck> when we ensure all imports have loaded\r\nfunction watchImportsLoad(callback
, doc) {\r\n var imports = doc.querySelectorAll('link[rel=import]');\r\n var l
oaded = 0, l = imports.length;\r\n function checkDone(d) { \r\n if (loaded =
= l) {\r\n callback && callback();\r\n }\r\n }\r\n function loadedImpo
rt(e) {\r\n markTargetLoaded(e);\r\n loaded++;\r\n checkDone();\r\n }\
r\n if (l) {\r\n for (var i=0, imp; (i<l) && (imp=imports[i]); i++) {\r\n
if (isImportLoaded(imp)) {\r\n loadedImport.call(imp, {target: imp});\
r\n } else {\r\n imp.addEventListener('load', loadedImport);\r\n
imp.addEventListener('error', loadedImport);\r\n }\r\n }\r\n } else
{\r\n checkDone();\r\n }\r\n}\r\n\r\n// NOTE: test for native imports loadi
ng is based on explicitly watching\r\n// all imports (see below).\r\nfunction is
ImportLoaded(link) {\r\n return useNative ? link.__loaded : link.__importParsed
;\r\n}\r\n\r\n// TODO(sorvell): Workaround for \r\n// https://www.w3.org/Bugs/Pu
blic/show_bug.cgi?id=25007, should be removed when\r\n// this bug is addressed.\
r\n// (1) Install a mutation observer to see when HTMLImports have loaded\r\n//
(2) if this script is run during document load it will watch any existing\r\n//
imports for loading.\r\n//\r\n// NOTE: The workaround has restricted functionali
ty: (1) it's only compatible\r\n// with imports that are added to document.head
since the mutation observer \r\n// watches only head for perf reasons, (2) it re
quires this script\r\n// to run before any imports have completed loading.\r\nif
(useNative) {\r\n new MutationObserver(function(mxns) {\r\n for (var i=0, l
=mxns.length, m; (i < l) && (m=mxns[i]); i++) {\r\n if (m.addedNodes) {\r\n
handleImports(m.addedNodes);\r\n }\r\n }\r\n }).observe(documen
t.head, {childList: true});\r\n\r\n function handleImports(nodes) {\r\n for
(var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++) {\r\n if (isImport
(n)) {\r\n handleImport(n); \r\n }\r\n }\r\n }\r\n\r\n functio
n isImport(element) {\r\n return element.localName === 'link' && element.rel
=== 'import';\r\n }\r\n\r\n function handleImport(element) {\r\n var loaded
= element.import;\r\n if (loaded) {\r\n markTargetLoaded({target: eleme
nt});\r\n } else {\r\n element.addEventListener('load', markTargetLoaded
);\r\n element.addEventListener('error', markTargetLoaded);\r\n }\r\n }
\r\n\r\n // make sure to catch any imports that are in the process of loading\r
\n // when this script is run.\r\n (function() {\r\n if (document.readyStat
e === 'loading') {\r\n var imports = document.querySelectorAll('link[rel=im
port]');\r\n for (var i=0, l=imports.length, imp; (i<l) && (imp=imports[i])
; i++) {\r\n handleImport(imp);\r\n }\r\n }\r\n })();\r\n\r\n}\r
\n\r\n// Fire the 'HTMLImportsLoaded' event when imports in document at load tim
e \r\n// have loaded. This event is required to simulate the script blocking \r\
n// behavior of native imports. A main document script that needs to be sure\r\n
// imports have loaded should wait for this event.\r\nwhenImportsReady(function(
) {\r\n HTMLImports.ready = true;\r\n HTMLImports.readyTime = new Date().getTi
me();\r\n mainDoc.dispatchEvent(\r\n new CustomEvent('HTMLImportsLoaded', {b
ubbles: true})\r\n );\r\n});\r\n\r\n// exports\r\nscope.useNative = useNative;\
r\nscope.isImportLoaded = isImportLoaded;\r\nscope.whenReady = whenImportsReady;
\r\nscope.isIE = isIE;\r\n\r\n// deprecated\r\nscope.whenImportsReady = whenImpo
rtsReady;\r\n\r\n})(window.HTMLImports);", |
159 "/*\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 //
imports\n var path = scope.path;\n var xhr = scope.xhr;\n var flags = scope.f
lags;\n\n // TODO(sorvell): this loader supports a dynamic list of urls\n // a
nd an oncomplete callback that is called when the loader is done.\n // The poly
fill currently does *not* need this dynamism or the onComplete\n // concept. Be
cause of this, the loader could be simplified quite a bit.\n var Loader = funct
ion(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 // comm
ence 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 addNode: function(node) {\n // number of transac
tions 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 // en
sure we have a standard url that can be used\n // reliably for deduping.\n
// TODO(sjmiles): ad-hoc\n elt.__nodeUrl = url;\n // deduplicatio
n\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(elt);\n // don't need fetch\n return t
rue;\n }\n var resource;\n if (this.cache[url]) {\n this.o
nload(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 inUrl\n this.pending[url] = [elt];\n // nee
d fetch (not a dupe)\n return false;\n },\n fetch: function(url, elt)
{\n flags.load && console.log('fetch', url, elt);\n if (url.match(/^d
ata:/)) {\n // Handle Data URI Scheme\n var pieces = url.split(','
);\n var header = pieces[0];\n var body = pieces[1];\n if(h
eader.indexOf(';base64') > -1) {\n body = atob(body);\n } else {
\n body = decodeURIComponent(body);\n }\n setTimeout(func
tion() {\n this.receive(url, elt, null, body);\n }.bind(this),
0);\n } else {\n var receiveXhr = function(err, resource, redirecte
dUrl) {\n this.receive(url, elt, err, resource, redirectedUrl);\n
}.bind(this);\n xhr.load(url, receiveXhr);\n // TODO(sorvell): b
locked on)\n // https://code.google.com/p/chromium/issues/detail?id=25722
1\n // xhr'ing for a document makes scripts in imports runnable; otherwis
e\n // they are not; however, 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.loa
d(url, receiveXhr);\n }\n */\n }\n },\n receive: functi
on(url, elt, err, resource, redirectedUrl) {\n this.cache[url] = resource;\
n var $p = this.pending[url];\n for (var i=0, l=$p.length, p; (i<l) &&
(p=$p[i]); i++) {\n // If url was redirected, use the redirected locatio
n so paths are\n // calculated relative to that.\n this.onload(url
, p, resource, err, redirectedUrl);\n this.tail();\n }\n this.p
ending[url] = null;\n },\n tail: function() {\n --this.inflight;\n
this.checkDone();\n },\n checkDone: function() {\n if (!this.infli
ght) {\n this.oncomplete();\n }\n }\n };\n\n xhr = xhr || {\n
async: true,\n ok: function(request) {\n return (request.status >= 200
&& request.status < 300)\n || (request.status === 304)\n || (
request.status === 0);\n },\n load: function(url, next, nextContext) {\n
var request = new XMLHttpRequest();\n if (scope.flags.debug || scope.fl
ags.bust) {\n url += '?' + Math.random();\n }\n request.open('G
ET', url, xhr.async);\n request.addEventListener('readystatechange', functi
on(e) {\n if (request.readyState === 4) {\n // Servers redirecti
ng an import can add a Location header to help us\n // polyfill correct
ly.\n var locationHeader = request.getResponseHeader(\"Location\");\n
var redirectedUrl = null;\n if (locationHeader) {\n
var redirectedUrl = (locationHeader.substr( 0, 1 ) === \"/\")\n ? l
ocation.origin + locationHeader // Location is a relative path\n :
locationHeader; // Full path\n }\n next.ca
ll(nextContext, !xhr.ok(request) && request,\n request.response ||
request.responseText, redirectedUrl);\n }\n });\n request.send(
);\n return request;\n },\n loadDocument: function(url, next, nextCon
text) {\n this.load(url, next, nextContext).responseType = 'document';\n
}\n };\n\n // exports\n scope.xhr = xhr;\n scope.Loader = Loader;\n\n})(win
dow.HTMLImports);\n", | 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(function(scope) {\n\n //
imports\n var path = scope.path;\n var xhr = scope.xhr;\n var flags = scope.f
lags;\n\n // TODO(sorvell): this loader supports a dynamic list of urls\n // a
nd an oncomplete callback that is called when the loader is done.\n // The poly
fill currently does *not* need this dynamism or the onComplete\n // concept. Be
cause of this, the loader could be simplified quite a bit.\n var Loader = funct
ion(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 // comm
ence 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 addNode: function(node) {\n // number of transac
tions 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 // en
sure we have a standard url that can be used\n // reliably for deduping.\n
// TODO(sjmiles): ad-hoc\n elt.__nodeUrl = url;\n // deduplicatio
n\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(elt);\n // don't need fetch\n return t
rue;\n }\n var resource;\n if (this.cache[url]) {\n this.o
nload(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 inUrl\n this.pending[url] = [elt];\n // nee
d fetch (not a dupe)\n return false;\n },\n fetch: function(url, elt)
{\n flags.load && console.log('fetch', url, elt);\n if (url.match(/^d
ata:/)) {\n // Handle Data URI Scheme\n var pieces = url.split(','
);\n var header = pieces[0];\n var body = pieces[1];\n if(h
eader.indexOf(';base64') > -1) {\n body = atob(body);\n } else {
\n body = decodeURIComponent(body);\n }\n setTimeout(func
tion() {\n this.receive(url, elt, null, body);\n }.bind(this),
0);\n } else {\n var receiveXhr = function(err, resource, redirecte
dUrl) {\n this.receive(url, elt, err, resource, redirectedUrl);\n
}.bind(this);\n xhr.load(url, receiveXhr);\n // TODO(sorvell): b
locked on)\n // https://code.google.com/p/chromium/issues/detail?id=25722
1\n // xhr'ing for a document makes scripts in imports runnable; otherwis
e\n // they are not; however, 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.loa
d(url, receiveXhr);\n }\n */\n }\n },\n receive: functi
on(url, elt, err, resource, redirectedUrl) {\n this.cache[url] = resource;\
n var $p = this.pending[url];\n for (var i=0, l=$p.length, p; (i<l) &&
(p=$p[i]); i++) {\n // If url was redirected, use the redirected locatio
n so paths are\n // calculated relative to that.\n this.onload(url
, p, resource, err, redirectedUrl);\n this.tail();\n }\n this.p
ending[url] = null;\n },\n tail: function() {\n --this.inflight;\n
this.checkDone();\n },\n checkDone: function() {\n if (!this.infli
ght) {\n this.oncomplete();\n }\n }\n };\n\n xhr = xhr || {\n
async: true,\n ok: function(request) {\n return (request.status >= 200
&& request.status < 300)\n || (request.status === 304)\n || (
request.status === 0);\n },\n load: function(url, next, nextContext) {\n
var request = new XMLHttpRequest();\n if (scope.flags.debug || scope.fl
ags.bust) {\n url += '?' + Math.random();\n }\n request.open('G
ET', url, xhr.async);\n request.addEventListener('readystatechange', functi
on(e) {\n if (request.readyState === 4) {\n // Servers redirecti
ng an import can add a Location header to help us\n // polyfill correct
ly.\n var locationHeader = request.getResponseHeader(\"Location\");\n
var redirectedUrl = null;\n if (locationHeader) {\n
var redirectedUrl = (locationHeader.substr( 0, 1 ) === \"/\")\n ? l
ocation.origin + locationHeader // Location is a relative path\n :
locationHeader; // Full path\n }\n next.ca
ll(nextContext, !xhr.ok(request) && request,\n request.response ||
request.responseText, redirectedUrl);\n }\n });\n request.send(
);\n return request;\n },\n loadDocument: function(url, next, nextCon
text) {\n this.load(url, next, nextContext).responseType = 'document';\n
}\n };\n\n // exports\n scope.xhr = xhr;\n scope.Loader = Loader;\n\n})(win
dow.HTMLImports);\n", |
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 */\n(function(scope) {\n\nvar I
MPORT_LINK_TYPE = 'import';\nvar flags = scope.flags;\nvar isIE = scope.isIE;\n/
/ TODO(sorvell): SD polyfill intrusion\nvar mainDoc = window.ShadowDOMPolyfill ?
\n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// importP
arser\n// highlander object to manage parsing of imports\n// parses import relat
ed elements\n// and ensures proper parse order\n// parse order is enforced by cr
awling the tree and monitoring which elements\n// have been parsed; async parsin
g is also supported.\n\n// highlander object for parsing a document tree\nvar im
portParser = {\n // parse selectors for main document elements\n documentSelec
tors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // parse selectors for import doc
ument elements\n importsSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']',
\n 'link[rel=stylesheet]',\n 'style',\n 'script:not([type])',\n 'scr
ipt[type=\"text/javascript\"]'\n ].join(','),\n map: {\n link: 'parseLink',
\n script: 'parseScript',\n style: 'parseStyle'\n },\n // try to parse t
he next import in the tree\n parseNext: function() {\n var next = this.nextT
oParse();\n if (next) {\n this.parse(next);\n }\n },\n parse: funct
ion(elt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log('[%s
] is already parsed', elt.localName);\n return;\n }\n var fn = this[t
his.map[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; pars
ing is async so each\n // parsing implementation must inform the system that pa
rsing is complete\n // via markParsingComplete.\n // To prompt the system to p
arse the next element, parseNext should then be\n // called.\n // Note, parseN
ext used to be included at the end of markParsingComplete, but\n // we must not
do this 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:
function(elt) {\n flags.parse && console.log('parsing', elt);\n this.pars
ingElement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__impor
tParsed = true;\n if (elt.__importElement) {\n elt.__importElement.__imp
ortParsed = true;\n }\n this.parsingElement = null;\n flags.parse && co
nsole.log('completed', elt);\n },\n invalidateParse: function(doc) {\n if (
doc && doc.__importLink) {\n doc.__importParsed = doc.__importLink.__import
Parsed = 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 // expos
e an imports parsing hook; this is needed, for example, by the\n // CustomEle
ments polyfill.\n if (HTMLImports.__importsParsingHook) {\n HTMLImports.
__importsParsingHook(elt);\n }\n if (elt.import) {\n elt.import.__imp
ortParsed = true;\n }\n this.markParsingComplete(elt);\n // fire load e
vent\n if (elt.__resource && !elt.__error) {\n elt.dispatchEvent(new Cus
tomEvent('load', {bubbles: false})); \n } else {\n elt.dispatchEvent(
new CustomEvent('error', {bubbles: false}));\n }\n // TODO(sorvell): worka
round for Safari addEventListener not working\n // for elements not in the ma
in document.\n if (elt.__pending) {\n var fn;\n while (elt.__pendin
g.length) {\n fn = elt.__pending.shift();\n if (fn) {\n f
n({target: elt});\n }\n }\n }\n this.parseNext();\n },\n par
seLink: function(linkElt) {\n if (nodeIsImport(linkElt)) {\n this.parseI
mport(linkElt);\n } else {\n // make href absolute\n linkElt.href =
linkElt.href;\n this.parseGeneric(linkElt);\n }\n },\n parseStyle: fu
nction(elt) {\n // TODO(sorvell): style element load event can just not fire
so clone styles\n var src = elt;\n elt = cloneStyle(elt);\n elt.__impor
tElement = src;\n this.parseGeneric(elt);\n },\n parseGeneric: function(elt
) {\n this.trackElement(elt);\n this.addElementToDocument(elt);\n },\n r
ootImportForElement: function(elt) {\n var n = elt;\n while (n.ownerDocume
nt.__importLink) {\n n = n.ownerDocument.__importLink;\n }\n return n
;\n },\n addElementToDocument: function(elt) {\n var port = this.rootImport
ForElement(elt.__importElement || elt);\n var l = port.__insertedElements = p
ort.__insertedElements || 0;\n var refNode = port.nextElementSibling;\n fo
r (var i=0; i < l; i++) {\n refNode = refNode && refNode.nextElementSibling
;\n }\n port.parentNode.insertBefore(elt, refNode);\n },\n // tracks whe
n a loadable element has loaded\n trackElement: function(elt, callback) {\n
var self = this;\n var done = function(e) {\n if (callback) {\n c
allback(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 \"load\" event for styles that h
ave already loaded\n // This is in violation of the spec, so we try our harde
st to work around it\n if (isIE && elt.localName === 'style') {\n var fa
keLoad = false;\n // If there's not @import in the textContent, assume it h
as loaded\n if (elt.textContent.indexOf('@import') == -1) {\n fakeLo
ad = true;\n // if we have a sheet, we have been parsed\n } else if (e
lt.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, f
ake the load\n fakeLoad = fakeLoad && Boolean(r.styleSheet);\n
}\n }\n }\n // dispatch a fake load event and continue parsi
ng\n if (fakeLoad) {\n elt.dispatchEvent(new CustomEvent('load', {bu
bbles: 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 th
e inline script with textContent.\n // Scripts 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('s
cript');\n script.__importElement = scriptElt;\n script.src = scriptElt.sr
c ? scriptElt.src : \n generateScriptDataUrl(scriptElt);\n scope.curre
ntScript = scriptElt;\n this.trackElement(script, function(e) {\n script
.parentNode.removeChild(script);\n scope.currentScript = null; \n });\n
this.addElementToDocument(script);\n },\n // determine the next element in
the tree which should be parsed\n nextToParse: function() {\n return !this.
parsingElement && this.nextToParseInDoc(mainDoc);\n },\n nextToParseInDoc: fun
ction(doc, link) {\n if (doc) {\n var nodes = doc.querySelectorAll(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.ha
sResource(n)) {\n return nodeIsImport(n) ? this.nextToParseInDoc(n.im
port, n) : n;\n } else {\n return;\n }\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 th
is node.\n parseSelectorsForNode: function(node) {\n var doc = node.ownerDoc
ument || node;\n return doc === mainDoc ? this.documentSelectors : this.impor
tsSelectors;\n },\n isParsed: function(node) {\n return node.__importParsed
;\n },\n hasResource: function(node) {\n if (nodeIsImport(node) && (node.im
port === undefined)) {\n return false;\n }\n return true;\n }\n};\n\
nfunction nodeIsImport(elt) {\n return (elt.localName === 'link') && (elt.rel =
== IMPORT_LINK_TYPE);\n}\n\nfunction generateScriptDataUrl(script) {\n var scri
ptContent = generateScriptContent(script);\n return 'data:text/javascript;chars
et=utf-8,' + encodeURIComponent(scriptContent);\n}\n\nfunction generateScriptCon
tent(script) {\n return script.textContent + generateSourceMapHint(script);\n}\
n\n// calculate source map hint\nfunction generateSourceMapHint(script) {\n var
moniker = script.__nodeUrl;\n if (!moniker) {\n moniker = script.ownerDocum
ent.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 need to allow \n // this sort of thing\n v
ar matches = script.textContent.match(/Polymer\\(['\"]([^'\"]*)/);\n tag = ma
tches && matches[1] || tag;\n // tag the moniker\n moniker += '/' + tag +
'.js';\n }\n return '\\n//# sourceURL=' + moniker + '\\n';\n}\n\n// style/styl
esheet handling\n\n// clone style with proper path resolution for main document\
n// NOTE: styles are the 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 relati
ve to the main \n// document. We fixup url's in url() and @import.\nvar CSS_URL_
REGEXP = /(url\\()([^)]*)(\\))/g;\nvar 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.resolveUrlsInCssText(style.textContent, resolver);\n
return style; \n },\n resolveUrlsInCssText: function(cssText, urlObj) {\n
var r = this.replaceUrls(cssText, urlObj, CSS_URL_REGEXP);\n r = this.repla
ceUrls(r, urlObj, CSS_IMPORT_REGEXP);\n return r;\n },\n replaceUrls: funct
ion(text, urlObj, regexp) {\n return text.replace(regexp, function(m, pre, ur
l, post) {\n var urlPath = 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;\nsco
pe.path = path;\n\n})(HTMLImports);\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(function(scope) {\n\nvar I
MPORT_LINK_TYPE = 'import';\nvar flags = scope.flags;\nvar isIE = scope.isIE;\n/
/ TODO(sorvell): SD polyfill intrusion\nvar mainDoc = window.ShadowDOMPolyfill ?
\n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// importP
arser\n// highlander object to manage parsing of imports\n// parses import relat
ed elements\n// and ensures proper parse order\n// parse order is enforced by cr
awling the tree and monitoring which elements\n// have been parsed; async parsin
g is also supported.\n\n// highlander object for parsing a document tree\nvar im
portParser = {\n // parse selectors for main document elements\n documentSelec
tors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // parse selectors for import doc
ument elements\n importsSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']',
\n 'link[rel=stylesheet]',\n 'style',\n 'script:not([type])',\n 'scr
ipt[type=\"text/javascript\"]'\n ].join(','),\n map: {\n link: 'parseLink',
\n script: 'parseScript',\n style: 'parseStyle'\n },\n // try to parse t
he next import in the tree\n parseNext: function() {\n var next = this.nextT
oParse();\n if (next) {\n this.parse(next);\n }\n },\n parse: funct
ion(elt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log('[%s
] is already parsed', elt.localName);\n return;\n }\n var fn = this[t
his.map[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; pars
ing is async so each\n // parsing implementation must inform the system that pa
rsing is complete\n // via markParsingComplete.\n // To prompt the system to p
arse the next element, parseNext should then be\n // called.\n // Note, parseN
ext used to be included at the end of markParsingComplete, but\n // we must not
do this 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:
function(elt) {\n flags.parse && console.log('parsing', elt);\n this.pars
ingElement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__impor
tParsed = true;\n if (elt.__importElement) {\n elt.__importElement.__imp
ortParsed = true;\n }\n this.parsingElement = null;\n flags.parse && co
nsole.log('completed', elt);\n },\n invalidateParse: function(doc) {\n if (
doc && doc.__importLink) {\n doc.__importParsed = doc.__importLink.__import
Parsed = 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 // expos
e an imports parsing hook; this is needed, for example, by the\n // CustomEle
ments polyfill.\n if (HTMLImports.__importsParsingHook) {\n HTMLImports.
__importsParsingHook(elt);\n }\n if (elt.import) {\n elt.import.__imp
ortParsed = true;\n }\n this.markParsingComplete(elt);\n // fire load e
vent\n if (elt.__resource && !elt.__error) {\n elt.dispatchEvent(new Cus
tomEvent('load', {bubbles: false})); \n } else {\n elt.dispatchEvent(
new CustomEvent('error', {bubbles: false}));\n }\n // TODO(sorvell): worka
round for Safari addEventListener not working\n // for elements not in the ma
in document.\n if (elt.__pending) {\n var fn;\n while (elt.__pendin
g.length) {\n fn = elt.__pending.shift();\n if (fn) {\n f
n({target: elt});\n }\n }\n }\n this.parseNext();\n },\n par
seLink: function(linkElt) {\n if (nodeIsImport(linkElt)) {\n this.parseI
mport(linkElt);\n } else {\n // make href absolute\n linkElt.href =
linkElt.href;\n this.parseGeneric(linkElt);\n }\n },\n parseStyle: fu
nction(elt) {\n // TODO(sorvell): style element load event can just not fire
so clone styles\n var src = elt;\n elt = cloneStyle(elt);\n elt.__impor
tElement = src;\n this.parseGeneric(elt);\n },\n parseGeneric: function(elt
) {\n this.trackElement(elt);\n this.addElementToDocument(elt);\n },\n r
ootImportForElement: function(elt) {\n var n = elt;\n while (n.ownerDocume
nt.__importLink) {\n n = n.ownerDocument.__importLink;\n }\n return n
;\n },\n addElementToDocument: function(elt) {\n var port = this.rootImport
ForElement(elt.__importElement || elt);\n var l = port.__insertedElements = p
ort.__insertedElements || 0;\n var refNode = port.nextElementSibling;\n fo
r (var i=0; i < l; i++) {\n refNode = refNode && refNode.nextElementSibling
;\n }\n port.parentNode.insertBefore(elt, refNode);\n },\n // tracks whe
n a loadable element has loaded\n trackElement: function(elt, callback) {\n
var self = this;\n var done = function(e) {\n if (callback) {\n c
allback(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 \"load\" event for styles that h
ave already loaded\n // This is in violation of the spec, so we try our harde
st to work around it\n if (isIE && elt.localName === 'style') {\n var fa
keLoad = false;\n // If there's not @import in the textContent, assume it h
as loaded\n if (elt.textContent.indexOf('@import') == -1) {\n fakeLo
ad = true;\n // if we have a sheet, we have been parsed\n } else if (e
lt.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, f
ake the load\n fakeLoad = fakeLoad && Boolean(r.styleSheet);\n
}\n }\n }\n // dispatch a fake load event and continue parsi
ng\n if (fakeLoad) {\n elt.dispatchEvent(new CustomEvent('load', {bu
bbles: 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 th
e inline script with textContent.\n // Scripts 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('s
cript');\n script.__importElement = scriptElt;\n script.src = scriptElt.sr
c ? scriptElt.src : \n generateScriptDataUrl(scriptElt);\n scope.curre
ntScript = scriptElt;\n this.trackElement(script, function(e) {\n script
.parentNode.removeChild(script);\n scope.currentScript = null; \n });\n
this.addElementToDocument(script);\n },\n // determine the next element in
the tree which should be parsed\n nextToParse: function() {\n return !this.
parsingElement && this.nextToParseInDoc(mainDoc);\n },\n nextToParseInDoc: fun
ction(doc, link) {\n if (doc) {\n var nodes = doc.querySelectorAll(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.ha
sResource(n)) {\n return nodeIsImport(n) ? this.nextToParseInDoc(n.im
port, n) : n;\n } else {\n return;\n }\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 th
is node.\n parseSelectorsForNode: function(node) {\n var doc = node.ownerDoc
ument || node;\n return doc === mainDoc ? this.documentSelectors : this.impor
tsSelectors;\n },\n isParsed: function(node) {\n return node.__importParsed
;\n },\n hasResource: function(node) {\n if (nodeIsImport(node) && (node.im
port === undefined)) {\n return false;\n }\n return true;\n }\n};\n\
nfunction nodeIsImport(elt) {\n return (elt.localName === 'link') && (elt.rel =
== IMPORT_LINK_TYPE);\n}\n\nfunction generateScriptDataUrl(script) {\n var scri
ptContent = generateScriptContent(script);\n return 'data:text/javascript;chars
et=utf-8,' + encodeURIComponent(scriptContent);\n}\n\nfunction generateScriptCon
tent(script) {\n return script.textContent + generateSourceMapHint(script);\n}\
n\n// calculate source map hint\nfunction generateSourceMapHint(script) {\n var
moniker = script.__nodeUrl;\n if (!moniker) {\n moniker = script.ownerDocum
ent.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 need to allow \n // this sort of thing\n v
ar matches = script.textContent.match(/Polymer\\(['\"]([^'\"]*)/);\n tag = ma
tches && matches[1] || tag;\n // tag the moniker\n moniker += '/' + tag +
'.js';\n }\n return '\\n//# sourceURL=' + moniker + '\\n';\n}\n\n// style/styl
esheet handling\n\n// clone style with proper path resolution for main document\
n// NOTE: styles are the 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 relati
ve to the main \n// document. We fixup url's in url() and @import.\nvar CSS_URL_
REGEXP = /(url\\()([^)]*)(\\))/g;\nvar 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.resolveUrlsInCssText(style.textContent, resolver);\n
return style; \n },\n resolveUrlsInCssText: function(cssText, urlObj) {\n
var r = this.replaceUrls(cssText, urlObj, CSS_URL_REGEXP);\n r = this.repla
ceUrls(r, urlObj, CSS_IMPORT_REGEXP);\n return r;\n },\n replaceUrls: funct
ion(text, urlObj, regexp) {\n return text.replace(regexp, function(m, pre, ur
l, post) {\n var urlPath = 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;\nsco
pe.path = path;\n\n})(HTMLImports);\n", |
161 "/*\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\nvar
useNative = scope.useNative;\nvar flags = scope.flags;\nvar IMPORT_LINK_TYPE = '
import';\n\n// TODO(sorvell): SD polyfill intrusion\nvar mainDoc = window.Shadow
DOMPolyfill ? \n ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\nif (
!useNative) {\n\n // imports\n var xhr = scope.xhr;\n var Loader = scope.Load
er;\n var parser = scope.parser;\n\n // importer\n // highlander object to ma
nage loading of imports\n\n // for any document, importer:\n // - loads any li
nked import documents (with deduping)\n\n var importer = {\n documents: {},\
n // nodes to load in the mian document\n documentPreloadSelectors: 'link[
rel=' + IMPORT_LINK_TYPE + ']',\n // nodes to load in imports\n importsPre
loadSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ].join(','),\n
loadNode: function(node) {\n importLoader.addNode(node);\n },\n /
/ load all loadable elements within the parent element\n loadSubtree: functio
n(parent) {\n var nodes = this.marshalNodes(parent);\n // add these no
des to loader's queue\n importLoader.addNodes(nodes);\n },\n marshalN
odes: function(parent) {\n // all preloadable nodes in inDocument\n re
turn parent.querySelectorAll(this.loadSelectorsForNode(parent));\n },\n //
find the proper set of load selectors for a given node\n loadSelectorsForNod
e: function(node) {\n var doc = node.ownerDocument || node;\n return d
oc === mainDoc ? this.documentPreloadSelectors :\n this.importsPreloadS
electors;\n },\n loaded: function(url, elt, resource, err, redirectedUrl)
{\n flags.load && console.log('loaded', url, elt);\n // store generic
resource\n // TODO(sorvell): fails for nodes inside <template>.content\n
// see https://code.google.com/p/chromium/issues/detail?id=249381.\n elt
.__resource = resource;\n elt.__error = err;\n if (isDocumentLink(elt)
) {\n var doc = this.documents[url];\n // if we've never seen a do
cument at this url\n if (doc === undefined) {\n // generate an H
TMLDocument from data\n doc = err ? null : makeDocument(resource, redir
ectedUrl || url);\n if (doc) {\n doc.__importLink = elt;\n
// note, we cannot use MO to detect parsed nodes because\n
// SD polyfill does not report these as mutations.\n this.bootDocumen
t(doc);\n }\n // cache document\n this.documents[url]
= doc;\n }\n // don't store import record until we're actually lo
aded\n // store document resource\n elt.import = doc;\n }\n
parser.parseNext();\n },\n bootDocument: function(doc) {\n this.l
oadSubtree(doc);\n this.observe(doc);\n parser.parseNext();\n },\n
loadedAll: function() {\n parser.parseNext();\n }\n };\n\n // loade
r singleton\n var importLoader = new Loader(importer.loaded.bind(importer), \n
importer.loadedAll.bind(importer));\n\n function isDocumentLink(elt) {\n
return isLinkRel(elt, IMPORT_LINK_TYPE);\n }\n\n function isLinkRel(elt, rel
) {\n return elt.localName === 'link' && elt.getAttribute('rel') === rel;\n
}\n\n function isScript(elt) {\n return elt.localName === 'script';\n }\n\n
function makeDocument(resource, url) {\n // create a new HTML document\n
var doc = resource;\n if (!(doc instanceof Document)) {\n doc = documen
t.implementation.createHTMLDocument(IMPORT_LINK_TYPE);\n }\n // cache the
new document's source url\n doc._URL = url;\n // establish a relative path
via <base>\n var base = doc.createElement('base');\n base.setAttribute('h
ref', 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.head.appendChild(meta);\n doc.head.appendChild(base);\n //
install HTML last as it may trigger CustomElement upgrades\n // TODO(sjmiles
): problem wrt to template boostrapping below,\n // template bootstrapping mu
st (?) come before element upgrade\n // but we cannot bootstrap templates unt
il they are in a document\n // which is too late\n if (!(resource instance
of 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 now the polyfill needs help to bootstrap these templates\n if
(window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemp
lateElement.bootstrap(doc);\n }\n return doc;\n }\n\n // Polyfill docume
nt.baseURI for browsers without it.\n if (!document.baseURI) {\n var baseURI
Descriptor = {\n get: function() {\n var base = document.querySelect
or('base');\n return base ? base.href : window.location.href;\n },\n
configurable: true\n };\n\n Object.defineProperty(document, 'baseURI
', baseURIDescriptor);\n Object.defineProperty(mainDoc, 'baseURI', baseURIDes
criptor);\n }\n\n // IE shim for CustomEvent\n if (typeof window.CustomEvent
!== 'function') {\n window.CustomEvent = function(inType, dictionary) {\n
var e = document.createEvent('HTMLEvents');\n e.initEvent(inType,\n
dictionary.bubbles === false ? false : true,\n dictionary.cancela
ble === false ? false : true,\n dictionary.detail);\n return e;\n
};\n }\n\n} else {\n // do nothing if using native imports\n var importer
= {};\n}\n\n// exports\nscope.importer = importer;\nscope.IMPORT_LINK_TYPE = IM
PORT_LINK_TYPE;\nscope.importLoader = importLoader;\n\n\n})(window.HTMLImports);
\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 (function(scope) {\n\nvar
useNative = scope.useNative;\nvar flags = scope.flags;\nvar IMPORT_LINK_TYPE = '
import';\n\n// TODO(sorvell): SD polyfill intrusion\nvar mainDoc = window.Shadow
DOMPolyfill ? \n ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\nif (
!useNative) {\n\n // imports\n var xhr = scope.xhr;\n var Loader = scope.Load
er;\n var parser = scope.parser;\n\n // importer\n // highlander object to ma
nage loading of imports\n\n // for any document, importer:\n // - loads any li
nked import documents (with deduping)\n\n var importer = {\n documents: {},\
n // nodes to load in the mian document\n documentPreloadSelectors: 'link[
rel=' + IMPORT_LINK_TYPE + ']',\n // nodes to load in imports\n importsPre
loadSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ].join(','),\n
loadNode: function(node) {\n importLoader.addNode(node);\n },\n /
/ load all loadable elements within the parent element\n loadSubtree: functio
n(parent) {\n var nodes = this.marshalNodes(parent);\n // add these no
des to loader's queue\n importLoader.addNodes(nodes);\n },\n marshalN
odes: function(parent) {\n // all preloadable nodes in inDocument\n re
turn parent.querySelectorAll(this.loadSelectorsForNode(parent));\n },\n //
find the proper set of load selectors for a given node\n loadSelectorsForNod
e: function(node) {\n var doc = node.ownerDocument || node;\n return d
oc === mainDoc ? this.documentPreloadSelectors :\n this.importsPreloadS
electors;\n },\n loaded: function(url, elt, resource, err, redirectedUrl)
{\n flags.load && console.log('loaded', url, elt);\n // store generic
resource\n // TODO(sorvell): fails for nodes inside <template>.content\n
// see https://code.google.com/p/chromium/issues/detail?id=249381.\n elt
.__resource = resource;\n elt.__error = err;\n if (isDocumentLink(elt)
) {\n var doc = this.documents[url];\n // if we've never seen a do
cument at this url\n if (doc === undefined) {\n // generate an H
TMLDocument from data\n doc = err ? null : makeDocument(resource, redir
ectedUrl || url);\n if (doc) {\n doc.__importLink = elt;\n
// note, we cannot use MO to detect parsed nodes because\n
// SD polyfill does not report these as mutations.\n this.bootDocumen
t(doc);\n }\n // cache document\n this.documents[url]
= doc;\n }\n // don't store import record until we're actually lo
aded\n // store document resource\n elt.import = doc;\n }\n
parser.parseNext();\n },\n bootDocument: function(doc) {\n this.l
oadSubtree(doc);\n this.observe(doc);\n parser.parseNext();\n },\n
loadedAll: function() {\n parser.parseNext();\n }\n };\n\n // loade
r singleton\n var importLoader = new Loader(importer.loaded.bind(importer), \n
importer.loadedAll.bind(importer));\n\n function isDocumentLink(elt) {\n
return isLinkRel(elt, IMPORT_LINK_TYPE);\n }\n\n function isLinkRel(elt, rel
) {\n return elt.localName === 'link' && elt.getAttribute('rel') === rel;\n
}\n\n function isScript(elt) {\n return elt.localName === 'script';\n }\n\n
function makeDocument(resource, url) {\n // create a new HTML document\n
var doc = resource;\n if (!(doc instanceof Document)) {\n doc = documen
t.implementation.createHTMLDocument(IMPORT_LINK_TYPE);\n }\n // cache the
new document's source url\n doc._URL = url;\n // establish a relative path
via <base>\n var base = doc.createElement('base');\n base.setAttribute('h
ref', 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.head.appendChild(meta);\n doc.head.appendChild(base);\n //
install HTML last as it may trigger CustomElement upgrades\n // TODO(sjmiles
): problem wrt to template boostrapping below,\n // template bootstrapping mu
st (?) come before element upgrade\n // but we cannot bootstrap templates unt
il they are in a document\n // which is too late\n if (!(resource instance
of 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 now the polyfill needs help to bootstrap these templates\n if
(window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemp
lateElement.bootstrap(doc);\n }\n return doc;\n }\n\n // Polyfill docume
nt.baseURI for browsers without it.\n if (!document.baseURI) {\n var baseURI
Descriptor = {\n get: function() {\n var base = document.querySelect
or('base');\n return base ? base.href : window.location.href;\n },\n
configurable: true\n };\n\n Object.defineProperty(document, 'baseURI
', baseURIDescriptor);\n Object.defineProperty(mainDoc, 'baseURI', baseURIDes
criptor);\n }\n\n // IE shim for CustomEvent\n if (typeof window.CustomEvent
!== 'function') {\n window.CustomEvent = function(inType, dictionary) {\n
var e = document.createEvent('HTMLEvents');\n e.initEvent(inType,\n
dictionary.bubbles === false ? false : true,\n dictionary.cancela
ble === false ? false : true,\n dictionary.detail);\n return e;\n
};\n }\n\n} else {\n // do nothing if using native imports\n var importer
= {};\n}\n\n// exports\nscope.importer = importer;\nscope.IMPORT_LINK_TYPE = IM
PORT_LINK_TYPE;\nscope.importLoader = importLoader;\n\n\n})(window.HTMLImports);
\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(function(scope){\n\nvar IM
PORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\nvar importSelector = 'link[rel=' + IMP
ORT_LINK_TYPE + ']';\nvar importer = scope.importer;\nvar parser = scope.parser;
\n\n// we track mutations for addedNodes, looking for imports\nfunction handler(
mutations) {\n for (var i=0, l=mutations.length, m; (i<l) && (m=mutations[i]);
i++) {\n if (m.type === 'childList' && m.addedNodes.length) {\n addedNod
es(m.addedNodes);\n }\n }\n}\n\n// find loadable elements and add them to th
e 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 importer.loadNode(n);\n }\n if (n.chi
ldren && n.children.length) {\n addedNodes(n.children);\n }\n }\n // T
ODO(sorvell): This is not the right approach here. We shouldn't need to\n // in
validate parsing when an element is added. Disabling this code \n // until a be
tter approach is found.\n /*\n if (owner) {\n parser.invalidateParse(owner)
;\n }\n */\n}\n\nfunction shouldLoadNode(node) {\n return (node.nodeType ===
1) && matches.call(node,\n importer.loadSelectorsForNode(node));\n}\n\n// x
-plat matches\nvar matches = HTMLElement.prototype.matches || \n HTMLElement.
prototype.matchesSelector || \n HTMLElement.prototype.webkitMatchesSelector |
|\n HTMLElement.prototype.mozMatchesSelector ||\n HTMLElement.prototype.ms
MatchesSelector;\n\nvar observer = new MutationObserver(handler);\n\n// observe
the given root for loadable elements\nfunction observe(root) {\n observer.obser
ve(root, {childList: true, subtree: true});\n}\n\n// exports\n// TODO(sorvell):
factor so can put on scope\nscope.observe = observe;\nimporter.observe = observe
;\n\n})(HTMLImports);\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(function(scope){\n\nvar IM
PORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\nvar importSelector = 'link[rel=' + IMP
ORT_LINK_TYPE + ']';\nvar importer = scope.importer;\nvar parser = scope.parser;
\n\n// we track mutations for addedNodes, looking for imports\nfunction handler(
mutations) {\n for (var i=0, l=mutations.length, m; (i<l) && (m=mutations[i]);
i++) {\n if (m.type === 'childList' && m.addedNodes.length) {\n addedNod
es(m.addedNodes);\n }\n }\n}\n\n// find loadable elements and add them to th
e 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 importer.loadNode(n);\n }\n if (n.chi
ldren && n.children.length) {\n addedNodes(n.children);\n }\n }\n // T
ODO(sorvell): This is not the right approach here. We shouldn't need to\n // in
validate parsing when an element is added. Disabling this code \n // until a be
tter approach is found.\n /*\n if (owner) {\n parser.invalidateParse(owner)
;\n }\n */\n}\n\nfunction shouldLoadNode(node) {\n return (node.nodeType ===
1) && matches.call(node,\n importer.loadSelectorsForNode(node));\n}\n\n// x
-plat matches\nvar matches = HTMLElement.prototype.matches || \n HTMLElement.
prototype.matchesSelector || \n HTMLElement.prototype.webkitMatchesSelector |
|\n HTMLElement.prototype.mozMatchesSelector ||\n HTMLElement.prototype.ms
MatchesSelector;\n\nvar observer = new MutationObserver(handler);\n\n// observe
the given root for loadable elements\nfunction observe(root) {\n observer.obser
ve(root, {childList: true, subtree: true});\n}\n\n// exports\n// TODO(sorvell):
factor so can put on scope\nscope.observe = observe;\nimporter.observe = observe
;\n\n})(HTMLImports);\n", |
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(function(){\n\n// bootstra
p\n\n// TODO(sorvell): SD polyfill intrusion\nvar doc = window.ShadowDOMPolyfill
? \n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// no ne
ed to bootstrap the polyfill when native imports is available.\nif (!HTMLImports
.useNative) {\n function bootstrap() {\n HTMLImports.importer.bootDocument(d
oc);\n }\n \n // TODO(sorvell): SD polyfill does *not* generate mutations f
or nodes added\n // by the parser. For this reason, we must wait until the dom
exists to \n // bootstrap.\n if (document.readyState === 'complete' ||\n
(document.readyState === 'interactive' && !window.attachEvent)) {\n bootstrap
();\n } else {\n document.addEventListener('DOMContentLoaded', bootstrap);\n
}\n}\n\n})();\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(function(){\n\n// bootstra
p\n\n// TODO(sorvell): SD polyfill intrusion\nvar doc = window.ShadowDOMPolyfill
? \n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// no ne
ed to bootstrap the polyfill when native imports is available.\nif (!HTMLImports
.useNative) {\n function bootstrap() {\n HTMLImports.importer.bootDocument(d
oc);\n }\n \n // TODO(sorvell): SD polyfill does *not* generate mutations f
or nodes added\n // by the parser. For this reason, we must wait until the dom
exists to \n // bootstrap.\n if (document.readyState === 'complete' ||\n
(document.readyState === 'interactive' && !window.attachEvent)) {\n bootstrap
();\n } else {\n document.addEventListener('DOMContentLoaded', bootstrap);\n
}\n}\n\n})();\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 */\nwindow.CustomElements = win
dow.CustomElements || {flags:{}};", | 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 */\nwindow.CustomElements = win
dow.CustomElements || {flags:{}};", |
165 "/*\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", | 150 "/*\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", |
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/**\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", | 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/**\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", |
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\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);", | 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//
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);", |
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(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 // install upgrade hook if HTMLImports are a
vailable\n if (window.HTMLImports) {\n HTMLImports.__importsParsingHook = fu
nction(elt) {\n CustomElements.parser.parse(elt.import);\n }\n }\n //
set internal 'ready' flag, now document.registerElement will trigger \n // sync
hronous upgrades\n CustomElements.ready = true;\n // async to ensure *native*
custom elements upgrade prior to this\n // DOMContentLoaded can fire before ele
ments upgrade (e.g. when there's\n // an external script)\n setTimeout(functio
n() {\n // capture blunt profiling data\n CustomElements.readyTime = Date.
now();\n if (window.HTMLImports) {\n CustomElements.elapsed = CustomElem
ents.readyTime - HTMLImports.readyTime;\n }\n // notify the system that we
are bootstrapped\n document.dispatchEvent(\n new CustomEvent('WebCompon
entsReady', {bubbles: true})\n );\n });\n}\n\n// CustomEvent shim for IE\nif
(typeof window.CustomEvent !== 'function') {\n window.CustomEvent = function(i
nType, params) {\n params = params || {};\n var e = document.createEvent('
CustomEvent');\n e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(p
arams.cancelable), params.detail);\n return e;\n };\n window.CustomEvent.pr
ototype = window.Event.prototype;\n}\n\n// When loading at readyState complete t
ime (or via flag), boot custom elements\n// immediately.\n// If relevant, HTMLIm
ports must already be loaded.\nif (document.readyState === 'complete' || scope.f
lags.eager) {\n bootstrap();\n// When loading at readyState interactive time, b
ootstrap only if HTMLImports\n// are not pending. Also avoid IE as the semantics
of this state are unreliable.\n} else if (document.readyState === 'interactive'
&& !window.attachEvent &&\n (!window.HTMLImports || window.HTMLImports.ready
)) {\n bootstrap();\n// When loading at other readyStates, wait for the appropr
iate DOM event to \n// bootstrap.\n} else {\n var loadEvent = window.HTMLImport
s && !HTMLImports.ready ?\n 'HTMLImportsLoaded' : 'DOMContentLoaded';\n wi
ndow.addEventListener(loadEvent, bootstrap);\n}\n\n})(window.CustomElements);\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(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 // install upgrade hook if HTMLImports are a
vailable\n if (window.HTMLImports) {\n HTMLImports.__importsParsingHook = fu
nction(elt) {\n CustomElements.parser.parse(elt.import);\n }\n }\n //
set internal 'ready' flag, now document.registerElement will trigger \n // sync
hronous upgrades\n CustomElements.ready = true;\n // async to ensure *native*
custom elements upgrade prior to this\n // DOMContentLoaded can fire before ele
ments upgrade (e.g. when there's\n // an external script)\n setTimeout(functio
n() {\n // capture blunt profiling data\n CustomElements.readyTime = Date.
now();\n if (window.HTMLImports) {\n CustomElements.elapsed = CustomElem
ents.readyTime - HTMLImports.readyTime;\n }\n // notify the system that we
are bootstrapped\n document.dispatchEvent(\n new CustomEvent('WebCompon
entsReady', {bubbles: true})\n );\n });\n}\n\n// CustomEvent shim for IE\nif
(typeof window.CustomEvent !== 'function') {\n window.CustomEvent = function(i
nType, params) {\n params = params || {};\n var e = document.createEvent('
CustomEvent');\n e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(p
arams.cancelable), params.detail);\n return e;\n };\n window.CustomEvent.pr
ototype = window.Event.prototype;\n}\n\n// When loading at readyState complete t
ime (or via flag), boot custom elements\n// immediately.\n// If relevant, HTMLIm
ports must already be loaded.\nif (document.readyState === 'complete' || scope.f
lags.eager) {\n bootstrap();\n// When loading at readyState interactive time, b
ootstrap only if HTMLImports\n// are not pending. Also avoid IE as the semantics
of this state are unreliable.\n} else if (document.readyState === 'interactive'
&& !window.attachEvent &&\n (!window.HTMLImports || window.HTMLImports.ready
)) {\n bootstrap();\n// When loading at other readyStates, wait for the appropr
iate DOM event to \n// bootstrap.\n} else {\n var loadEvent = window.HTMLImport
s && !HTMLImports.ready ?\n 'HTMLImportsLoaded' : 'DOMContentLoaded';\n wi
ndow.addEventListener(loadEvent, bootstrap);\n}\n\n})(window.CustomElements);\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() {\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", | 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() {\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", |
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 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", | 155 "/*\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", |
171 "/*\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", | 156 "/*\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" |
172 "// 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", | |
173 "// 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", | |
174 "/*\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" | |
175 ] | 157 ] |
176 } | 158 } |
OLD | NEW |