├── .gitignore ├── README.md ├── angular ├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── README.md ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── slider.gif ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ ├── .gitkeep │ │ ├── build │ │ │ ├── app.js │ │ │ └── app │ │ │ │ ├── 0sefzzse.es5.js │ │ │ │ ├── 0sefzzse.js │ │ │ │ ├── 1yscrcuc.es5.js │ │ │ │ ├── 1yscrcuc.js │ │ │ │ ├── app.d9guwbls.js │ │ │ │ ├── app.global.js │ │ │ │ ├── app.pu4pwxws.js │ │ │ │ ├── app.registry.json │ │ │ │ ├── gifh2jkr.es5.js │ │ │ │ ├── gifh2jkr.js │ │ │ │ ├── mfcxg1az.es5.js │ │ │ │ ├── mfcxg1az.js │ │ │ │ ├── mh7pqpgg.es5.js │ │ │ │ ├── mh7pqpgg.js │ │ │ │ ├── zji8cqpi.es5.js │ │ │ │ └── zji8cqpi.js │ │ ├── icon │ │ │ └── favicon.ico │ │ └── img │ │ │ └── icon.png │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json └── tslint.json └── stencil ├── .gitignore ├── LICENSE ├── package.json ├── readme.md ├── src ├── assets │ ├── icon │ │ └── favicon.ico │ └── img │ │ └── icon.png ├── components.d.ts ├── components │ └── slider │ │ ├── slider.scss │ │ └── slider.tsx ├── index.html └── manifest.json ├── stencil.config.js ├── tsconfig.json └── www ├── assets ├── icon │ └── favicon.ico └── img │ └── icon.png ├── favicon.ico ├── host.config.json ├── manifest.json ├── sw.js ├── workbox-sw.prod.v2.0.1.js └── workbox-sw.prod.v2.0.1.js.map /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | angular/dist 5 | angular/tmp 6 | angular/out-tsc 7 | 8 | # dependencies 9 | angular/node_modules 10 | 11 | # IDEs and editors 12 | angular/.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | angular/.sass-cache 29 | angular/connect.lock 30 | angular/coverage 31 | angular/libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | angular/typings 35 | yarn-error.log 36 | 37 | # e2e 38 | angular/e2e/*.js 39 | angular/e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | 45 | stencil/dist/ 46 | stencil/www/build 47 | stencil/www/assets/build 48 | stencil/www/index.html 49 | 50 | *~ 51 | *.sw[mnpcod] 52 | *.log 53 | *.lock 54 | *.tmp 55 | *.tmp.* 56 | log.txt 57 | *.sublime-project 58 | *.sublime-workspace 59 | 60 | .idea/ 61 | .vscode/ 62 | .sass-cache/ 63 | .versions/ 64 | stencil/node_modules/ 65 | $RECYCLE.BIN/ 66 | 67 | .DS_Store 68 | Thumbs.db 69 | UserInterfaceState.xcuserstate 70 | .env -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular-stencil 2 | ![](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square) 3 | 4 | This project shows a very basic example of how to connect a web component (generated with [Stencil](https://stenciljs.com/)) with a basic angular project. 5 | 6 | The following steps explain what I've done to get this working. 7 | 8 | ## steps 9 | 10 | ### a basic stencil component 11 | 12 | The idea is to have a web component that can be data-bound via properties and return its changes by custom events. 13 | For this example I've picked nothing special but a simple slider component. The following code shows the `@Component` decorator. This decorator adds meta-information to you component like its selector `tag`. Our slider should use the custom element selector tag `fwt-slider` (so we can use `` later in the DOM). 14 | 15 | ```jsx 16 | import { Component } from '@stencil/core'; 17 | 18 | @Component({ 19 | tag: 'fwt-slider' 20 | }) 21 | export class SliderComponent { 22 | ... 23 | } 24 | ``` 25 | Stencil components are very similar to react components. They have the same lifecycle methods and of course they also need a `render` function. So let's add one: 26 | 27 | ```jsx 28 | import { Component } from '@stencil/core'; 29 | 30 | @Component({ 31 | tag: 'fwt-slider' 32 | }) 33 | export class SliderComponent { 34 | 35 | render() { 36 | return ( 37 |
38 | ... 39 |
40 | ) 41 | } 42 | } 43 | ``` 44 | 45 | ### add properties 46 | 47 | Our slider will have a min and a max property and an initial value property. Adding a property to a stencil component is very easy. All you have to do is to use the `@Prop` decorator: 48 | 49 | ```jsx 50 | import { Component, Prop } from '@stencil/core'; 51 | 52 | @Component({ 53 | tag: 'fwt-slider' 54 | }) 55 | export class SliderComponent { 56 | 57 | @Prop() min: number; 58 | @Prop() max: number; 59 | @Prop() value: number; 60 | 61 | render() { 62 | return ( 63 |
64 | 65 | 66 |
67 | ) 68 | } 69 | } 70 | ``` 71 | 72 | ### emit data using events 73 | 74 | Ok so far so good. 75 | How about emitting an event when the value has been changed? That's actually a good idea. For this purpose we only have to use another decorator called `@Event`. This decorator is used in combination with the `EventEmitter` interface. This will create a custom event that is called like the event property. You can change the name and other event properties by passing `EventOptions` to the `@Event` decorator but for our example we keep things simple. 76 | In this example I'm listening to changes by the range input and pass the current value via the `EventEmitter` using its `emit` function. 77 | I've also added some style to our slider by setting the `styleUrl` (Stencil supports scss and css) in the `@Component` decorator. 78 | 79 | ### final component 80 | #### final slider.tsx 81 | ```jsx 82 | import { Component, Prop, Event, EventEmitter } from '@stencil/core'; 83 | 84 | @Component({ 85 | tag: 'fwt-slider', 86 | styleUrl: 'slider.scss' 87 | }) 88 | export class SliderComponent { 89 | 90 | @Prop() min: number; 91 | @Prop() max: number; 92 | @Prop() value: number; 93 | 94 | @Event() valueChanged: EventEmitter; 95 | 96 | valueChangedHandler(event: any) { 97 | this.valueChanged.emit(event.target.value); 98 | } 99 | 100 | render() { 101 | return ( 102 |
103 | this.valueChangedHandler(event)}> 105 | 106 |
107 | ); 108 | } 109 | } 110 | ``` 111 | 112 | #### final slider.scss 113 | ```scss 114 | fwt-slider { 115 | 116 | .slider-container { 117 | width: 100%; 118 | 119 | .slider { 120 | -webkit-appearance: none; 121 | appearance: none; 122 | width: 100%; 123 | height: 15px; 124 | border-radius: 5px; 125 | background: #d3d3d3; 126 | outline: none; 127 | opacity: 0.7; 128 | transition: opacity .2s; 129 | 130 | &:hover { 131 | opacity: 1; 132 | } 133 | 134 | &::-webkit-slider-thumb { 135 | -webkit-appearance: none; 136 | appearance: none; 137 | width: 25px; 138 | height: 25px; 139 | border-radius: 50%; 140 | background: #4CAF50; 141 | cursor: pointer; 142 | } 143 | 144 | &::-moz-range-thumb { 145 | width: 25px; 146 | height: 25px; 147 | border-radius: 50%; 148 | background: #4CAF50; 149 | cursor: pointer; 150 | } 151 | } 152 | } 153 | } 154 | ``` 155 | 156 | ### build it for a angular-cli project 157 | 158 | I'm going to add the build output of stencil to `www/assets/build` because later I will copy this output into the assets folder of a angular-cli project. 159 | Normally the build output will be put to `www/build` but this can be changed in the `stencil.config.js`. 160 | I also register my `fwt-slider` component there. 161 | 162 | ```javascript 163 | exports.config = { 164 | bundles: [ 165 | { components: ['fwt-slider'] } 166 | ], 167 | buildDir: 'assets/build', 168 | collections: [ 169 | ] 170 | }; 171 | 172 | exports.devServer = { 173 | root: 'www', 174 | watchGlob: '**/**' 175 | } 176 | 177 | ``` 178 | 179 | Ok let's start the build with `npm run build` inside the `stencil` dir. 180 | After the build is done you must copy the whole `build` dir from `/stencil/www/assets/` to `/angular/src/assets/`. 181 | 182 | ### make angular ready for web components 183 | 184 | Our angular project only has one basic app module containing only one simple app component. 185 | To enable the use of web components we must add the `CUSTOM_ELEMENTS_SCHEMA` from the `@angular/core` module to our app module. 186 | 187 | ```typescript 188 | import { BrowserModule } from '@angular/platform-browser'; 189 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 190 | 191 | import { AppComponent } from './app.component'; 192 | 193 | @NgModule({ 194 | declarations: [ 195 | AppComponent 196 | ], 197 | imports: [ 198 | BrowserModule 199 | ], 200 | providers: [], 201 | schemas: [ 202 | CUSTOM_ELEMENTS_SCHEMA 203 | ], 204 | bootstrap: [AppComponent] 205 | }) 206 | export class AppModule { } 207 | ``` 208 | ### add the stencil javascript to our angular index.html 209 | 210 | Next we need to add the generated javascript of our stencil project to our angular project. To do this we add a script tag somewhere in the head of the `index.html` of our angular project: 211 | ```html 212 | 213 | ``` 214 | An even better way would be to add your additional web component scripts to the `.angular-cli.json` config file as explained [here](https://github.com/angular/angular-cli/wiki/stories-global-scripts). 215 | 216 | ### add angular data-binding 217 | 218 | We said that our slider component has three properties (min, max, value). So let's establish angular data-binding to these properties in our app component. 219 | 220 | ```typescript 221 | import { Component } from '@angular/core'; 222 | 223 | @Component({ 224 | selector: 'app-root', 225 | templateUrl: './app.component.html', 226 | styleUrls: ['./app.component.css'] 227 | }) 228 | export class AppComponent { 229 | min = 0; 230 | max = 100; 231 | value = 50; 232 | } 233 | ``` 234 | 235 | And in the `app.component.html` we are adding our slider web component like this: 236 | 237 | ```html 238 | 239 | ``` 240 | 241 | ### play around with events 242 | 243 | One last thing I want to show is how we can listen to the custom events and use them to update the data-bound properties. So let's add another slider with its own value and two event handlers that set the value property of the other slider component ('yeah I know, very clever example'). 244 | 245 | ```typescript 246 | import { Component } from '@angular/core'; 247 | 248 | @Component({ 249 | selector: 'app-root', 250 | templateUrl: './app.component.html', 251 | styleUrls: ['./app.component.css'] 252 | }) 253 | export class AppComponent { 254 | min = 0; 255 | max = 100; 256 | value1 = 50; 257 | value2 = 50; 258 | 259 | onValue1Changed(event: CustomEvent) { 260 | console.log(event.detail); 261 | this.value2 = event.detail; 262 | } 263 | 264 | onValue2Changed(event: CustomEvent) { 265 | console.log(event.detail); 266 | this.value1 = event.detail; 267 | } 268 | } 269 | ``` 270 | 271 | ```html 272 | 274 | 275 | 277 | 278 | ``` 279 | 280 | ### run the angular app 281 | See what we have done by running `npm start` inside the angular directory. 282 | 283 | ![final slider](https://raw.githubusercontent.com/seveves/angular-stencil/master/angular/slider.gif) 284 | -------------------------------------------------------------------------------- /angular/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "angular" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | } 30 | } 31 | ], 32 | "e2e": { 33 | "protractor": { 34 | "config": "./protractor.conf.js" 35 | } 36 | }, 37 | "lint": [ 38 | { 39 | "project": "src/tsconfig.app.json", 40 | "exclude": "**/node_modules/**" 41 | }, 42 | { 43 | "project": "src/tsconfig.spec.json", 44 | "exclude": "**/node_modules/**" 45 | }, 46 | { 47 | "project": "e2e/tsconfig.e2e.json", 48 | "exclude": "**/node_modules/**" 49 | } 50 | ], 51 | "test": { 52 | "karma": { 53 | "config": "./karma.conf.js" 54 | } 55 | }, 56 | "defaults": { 57 | "styleExt": "css", 58 | "component": {} 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | yarn-error.log 36 | 37 | # e2e 38 | /e2e/*.js 39 | /e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /angular/README.md: -------------------------------------------------------------------------------- 1 | # Angular 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | Before running the tests make sure you are serving the app via `ng serve`. 25 | 26 | ## Further help 27 | 28 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 29 | -------------------------------------------------------------------------------- /angular/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('angular App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /angular/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /angular/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "5.2.2", 16 | "@angular/common": "5.2.2", 17 | "@angular/compiler": "5.2.2", 18 | "@angular/core": "5.2.2", 19 | "@angular/forms": "5.2.2", 20 | "@angular/http": "5.2.2", 21 | "@angular/platform-browser": "5.2.2", 22 | "@angular/platform-browser-dynamic": "5.2.2", 23 | "@angular/router": "5.2.2", 24 | "core-js": "2.5.3", 25 | "rxjs": "5.5.6", 26 | "zone.js": "0.8.20" 27 | }, 28 | "devDependencies": { 29 | "@angular/cli": "^1.6.5", 30 | "@angular/compiler-cli": "5.2.2", 31 | "@angular/language-service": "5.2.2", 32 | "@types/jasmine": "2.8.5", 33 | "@types/jasminewd2": "2.0.3", 34 | "@types/node": "9.3.0", 35 | "codelyzer": "4.1.0", 36 | "jasmine-core": "2.9.1", 37 | "jasmine-spec-reporter": "4.2.1", 38 | "karma": "~1.7.0", 39 | "karma-chrome-launcher": "~2.1.1", 40 | "karma-cli": "~1.0.1", 41 | "karma-coverage-istanbul-reporter": "^1.2.1", 42 | "karma-jasmine": "~1.1.0", 43 | "karma-jasmine-html-reporter": "^0.2.2", 44 | "protractor": "~5.1.2", 45 | "ts-node": "~3.2.0", 46 | "tslint": "~5.3.2", 47 | "typescript": "2.6.2" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /angular/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /angular/slider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/angular/slider.gif -------------------------------------------------------------------------------- /angular/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/angular/src/app/app.component.css -------------------------------------------------------------------------------- /angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 | -------------------------------------------------------------------------------- /angular/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | }).compileComponents(); 12 | })); 13 | 14 | it('should create the app', async(() => { 15 | const fixture = TestBed.createComponent(AppComponent); 16 | const app = fixture.debugElement.componentInstance; 17 | expect(app).toBeTruthy(); 18 | })); 19 | 20 | it(`should have as title 'app'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app'); 24 | })); 25 | 26 | it('should render title in a h1 tag', async(() => { 27 | const fixture = TestBed.createComponent(AppComponent); 28 | fixture.detectChanges(); 29 | const compiled = fixture.debugElement.nativeElement; 30 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | 11 | min = 0; 12 | max = 100; 13 | value1 = 50; 14 | value2 = 50; 15 | 16 | onValue1Changed(event: CustomEvent) { 17 | console.log(event.detail); 18 | this.value2 = event.detail; 19 | } 20 | 21 | onValue2Changed(event: CustomEvent) { 22 | console.log(event.detail); 23 | this.value1 = event.detail; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ 11 | BrowserModule 12 | ], 13 | providers: [], 14 | schemas: [ 15 | CUSTOM_ELEMENTS_SCHEMA 16 | ], 17 | bootstrap: [AppComponent] 18 | }) 19 | export class AppModule { } 20 | -------------------------------------------------------------------------------- /angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular/src/assets/build/app.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | !function(t,e,i,c,r,n,o,a,s,u){!function(t,e,i,c,r,n,o,a,s,u,l){(t[i]=t[i]||{}).components=s,(l=s.filter(function(t){return t[2]}).map(function(t){return t[0]})).length&&((u=e.createElement("style")).innerHTML=l.join()+"{visibility:hidden}."+a+"{visibility:inherit}",u.setAttribute("data-visibility",""),e.head.insertBefore(u,e.head.firstChild)),(u=e.scripts[e.scripts.length-1])&&u.src&&(r=(l=u.src.split("/").slice(0,-1)).join("/")+(l.length?"/":"")+c+"/"),(u=e.createElement("script")).src=r+(function(t){return t.customElements}(t)&&function(t){if(!("noModule"in t))return!1;try{return new Function('import("")'),!0}catch(t){return!1}}(u)&&function(t){return t.fetch}(t)&&function(t){return t.CSS&&t.CSS.supports&&t.CSS.supports("color","var(--c)")}(t)?n:o),u.setAttribute("data-path",r),u.setAttribute("data-namespace",c),e.head.appendChild(u)}(window,document,"App","app","/assets/build/app/","app.d9guwbls.js","app.pu4pwxws.js","hydrated",[["fwt-slider","zji8cqpi",1,[["max",1,1,4],["min",1,1,4],["value",1,1,4]]],["stencil-async-content","mfcxg1az",0,[["content",5],["documentLocation",1,1,2]]],["stencil-route","mfcxg1az",0,[["activeRouter",3,0,0,"activeRouter"],["component",1,1,2],["componentProps",1,1,1],["exact",1,1,3],["group",1,1,2],["location",3,0,0,"location"],["match",5],["routeRender",1,1,1],["url",1,1,1]]],["stencil-route-link","mfcxg1az",0,[["activeClass",1,1,2],["activeRouter",3,0,0,"activeRouter"],["custom",1,1,3],["exact",1,1,3],["location",3,0,0,"location"],["match",5],["url",1,1,2],["urlMatch",1,1,1]]],["stencil-route-title","mfcxg1az",0,[["activeRouter",3,0,0,"activeRouter"],["title",1,1,2]]],["stencil-router","mfcxg1az",0,[["activeRouter",3,0,0,"activeRouter"],["match",5],["root",1,1,2],["titleSuffix",1,1,2]]],["stencil-router-redirect","mfcxg1az",0,[["activeRouter",3,0,0,"activeRouter"],["url",1,1,2]]],["test-app","mh7pqpgg"],["test-demo-four","0sefzzse",0,[["history",1,1,1],["match",1,1,1],["pages",1,1,1]]],["test-demo-six","gifh2jkr",0,[["history",1,1,1],["match",1,1,1],["pages",1,1,1]]],["test-demo-three","1yscrcuc",0,[["history",1,1,1],["match",1,1,1],["pages",1,1,1]]]],void 0)}(); -------------------------------------------------------------------------------- /angular/src/assets/build/app/0sefzzse.es5.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | App.loadComponents(function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.handleClick=function(e,t){e.preventDefault(),this.history.push(t,{blue:"blue"})},e.prototype.render=function(){var e=this;return t("div",null,t("a",{href:"/demo3/page1",onClick:function(t){return e.handleClick(t,"/demo3/page1")}},"History push to ","/demo3/page1"),t("pre",null,t("b",null,"this.pages"),":",t("br",null),JSON.stringify(this.pages,null,2)),t("pre",null,t("b",null,"this.match"),":",t("br",null),JSON.stringify(this.match,null,2)),t("pre",null,t("b",null,"this.history.location"),":",t("br",null),JSON.stringify(this.history.location,null,2)))},Object.defineProperty(e,"is",{get:function(){return"test-demo-four"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{history:{type:"Any"},match:{type:"Any"},pages:{type:"Any"}}},enumerable:!0,configurable:!0}),e}();e.TestDemoFour=r},"0sefzzse"); -------------------------------------------------------------------------------- /angular/src/assets/build/app/0sefzzse.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | const{h,Context}=window.App;class TestDemoFour{handleClick(t,e){t.preventDefault(),this.history.push(e,{blue:"blue"})}render(){return h("div",null,h("a",{href:"/demo3/page1",onClick:t=>this.handleClick(t,"/demo3/page1")},"History push to ","/demo3/page1"),h("pre",null,h("b",null,"this.pages"),":",h("br",null),JSON.stringify(this.pages,null,2)),h("pre",null,h("b",null,"this.match"),":",h("br",null),JSON.stringify(this.match,null,2)),h("pre",null,h("b",null,"this.history.location"),":",h("br",null),JSON.stringify(this.history.location,null,2)))}static get is(){return"test-demo-four"}static get properties(){return{history:{type:"Any"},match:{type:"Any"},pages:{type:"Any"}}}}export{TestDemoFour}; -------------------------------------------------------------------------------- /angular/src/assets/build/app/1yscrcuc.es5.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | App.loadComponents(function(e,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(){}return e.prototype.render=function(){var e=this;return[n("span",null,"Demo 3 Test Page",n("br",null)),n("stencil-route",{url:"/demo3/page1",exact:!0,routeRender:function(r){return[n("a",{href:"#",onClick:function(n){n.preventDefault(),e.history.push("/demo3/page2",{blue:"blue"})}},"History push to /demo3/page2"),n("pre",null,n("b",null,"props.pages"),":",n("br",null),JSON.stringify(e.pages,null,2)),n("pre",null,n("b",null,"props.match"),":",n("br",null),JSON.stringify(e.match,null,2)),n("pre",null,n("b",null,"props.history.location"),":",n("br",null),JSON.stringify(e.history.location,null,2))]}}),n("stencil-route",{url:"/demo3/page2",exact:!0,routeRender:function(r){return[n("a",{href:"#",onClick:function(n){n.preventDefault(),e.history.push("/demo3/page1",{red:"red"})}},"History push to /demo3/page1"),n("pre",null,n("b",null,"props.pages"),":",n("br",null),JSON.stringify(e.pages,null,2)),n("pre",null,n("b",null,"props.match"),":",n("br",null),JSON.stringify(e.match,null,2)),n("pre",null,n("b",null,"props.history.location"),":",n("br",null),JSON.stringify(e.history.location,null,2))]}})]},Object.defineProperty(e,"is",{get:function(){return"test-demo-three"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{history:{type:"Any"},match:{type:"Any"},pages:{type:"Any"}}},enumerable:!0,configurable:!0}),e}();e.TestDemoThree=t},"1yscrcuc"); -------------------------------------------------------------------------------- /angular/src/assets/build/app/1yscrcuc.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | const{h,Context}=window.App;class TestDemoThree{render(){return[h("span",null,"Demo 3 Test Page",h("br",null)),h("stencil-route",{url:"/demo3/page1",exact:!0,routeRender:e=>[h("a",{href:"#",onClick:e=>{e.preventDefault(),this.history.push("/demo3/page2",{blue:"blue"})}},"History push to /demo3/page2"),h("pre",null,h("b",null,"props.pages"),":",h("br",null),JSON.stringify(this.pages,null,2)),h("pre",null,h("b",null,"props.match"),":",h("br",null),JSON.stringify(this.match,null,2)),h("pre",null,h("b",null,"props.history.location"),":",h("br",null),JSON.stringify(this.history.location,null,2))]}),h("stencil-route",{url:"/demo3/page2",exact:!0,routeRender:e=>[h("a",{href:"#",onClick:e=>{e.preventDefault(),this.history.push("/demo3/page1",{red:"red"})}},"History push to /demo3/page1"),h("pre",null,h("b",null,"props.pages"),":",h("br",null),JSON.stringify(this.pages,null,2)),h("pre",null,h("b",null,"props.match"),":",h("br",null),JSON.stringify(this.match,null,2)),h("pre",null,h("b",null,"props.history.location"),":",h("br",null),JSON.stringify(this.history.location,null,2))]})]}static get is(){return"test-demo-three"}static get properties(){return{history:{type:"Any"},match:{type:"Any"},pages:{type:"Any"}}}}export{TestDemoThree}; -------------------------------------------------------------------------------- /angular/src/assets/build/app/app.d9guwbls.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | (function(Context,appNamespace,hydratedCssClass,publicPath){"use strict"; 3 | var s=document.querySelector("script[data-namespace='app']");if(s){publicPath=s.getAttribute('data-path');} 4 | (function(publicPath){Context.activeRouter=function(){let t={},n={},o={};const e=[];return{set:function(n){t=Object.assign({},t,n),o={},function(){const t=e;for(let n=0;nn!==t)}},didGroupAlreadyMatch:function(t){return!!t&&!0===o[t]},setGroupMatched:function(t){o[t]=!0}}}(); 5 | })(publicPath); 6 | (function(n,t,e,o,i){"use strict";function c(n,t,e,o,i,c){let l=t.is+(e||""),f=t[l];if(f||(f=t[l=t.is]),f){let e=n.n;if(n.t)if("shadow"===t.e)e=o.shadowRoot;else for(;o=n.o(o);)if(o.host&&o.host.shadowRoot){e=o.host.shadowRoot;break}const i=e.i=e.i||{};if(!i[l]){c=f.content.cloneNode(!0);const t=e.querySelector("[data-visibility]");n.c(e,c,t&&t.nextSibling||e.l),i[l]=!0}}}function l(n){return{f:n[0],u:n[1],r:!!n[2],s:!!n[3],a:!!n[4]}}function f(n,t){if(S(t)){if(n===Boolean||3===n)return"false"!==t&&(""===t||!!t);if(n===Number||4===n)return parseFloat(t)}return t}function u(n,t,e){n.d&&((e=n.d.$activeLoading)&&((t=e.indexOf(n))>-1&&e.splice(t,1),!e.length&&n.d.$initLoad()),n.d=null)}function r(n,t,e){let o,i=!1,c=!1;for(var l=arguments.length;l-- >2;)B.push(arguments[l]);for(;B.length;)if((e=B.pop())&&void 0!==e.pop)for(l=e.length;l--;)B.push(e[l]);else"boolean"==typeof e&&(e=null),(c="function"!=typeof n)&&(null==e?e="":"number"==typeof e?e=String(e):"string"!=typeof e&&(c=!1)),c&&i?o[o.length-1].p+=e:void 0===o?o=[c?s(e):e]:o.push(c?s(e):e),i=c;const f=new P;if(f.m=n,f.b=o,t&&(f.y=t,f.v=t.w,f.g=t.ref,t.className&&(t.class=t.className),"object"==typeof t.class)){for(l in t.class)t.class[l]&&B.push(l);t.class=B.join(" "),B.length=0}return f}function s(n){const t=new P;return t.p=n,t}function a(n,t){t.C||(t.C=!0,n.N.add(()=>{t.C=!1,function n(t,e){if(!e.j){const o=!e.O;let i;if(o){const o=e.d;if(o&&!o.$rendered)return void(o.$onRender=o.$onRender||[]).push(()=>{n(t,e)});(function o(n,t,e){try{e=n.x(t).k,t.O=new e,function o(n,t,e,i,c,l){for(l in i.S=e,e.T=e.T||{},(c=Object.assign({color:{type:String}},t.properties)).mode={type:String},c)p(n,c[l],e,i,l)}(n,e,t,t.O),function i(n,t,e){t&&t.forEach(t=>{e[t.method]={emit:o=>{n.M(e.S,t.name,{bubbles:t.bubbles,composed:t.composed,cancelable:t.cancelable,detail:o})}}})}(n,e.events,t.O)}catch(e){t.O={},n.A(e,7,t,!0)}})(t,e);try{e.O.componentWillLoad&&(i=e.O.componentWillLoad())}catch(n){t.A(n,3,e)}}i&&i.then?i.then(()=>d(t,e,o)):d(t,e,o)}}(n,t)}))}function d(n,t,e){(function o(n,t,e,i){try{const o=t.O,c=e.host;if(o.render||o.hostData||c){n.P=!0;const c=o.render&&o.render();let l;n.P=!1;const f=t.B||new P;f.L=t,t.B=n.render(f,r(null,l,c),i,t.R,e.e)}n.q(n.D,e,o.mode,t),t.$rendered=!0,t.$onRender&&(t.$onRender.forEach(n=>n()),t.$onRender=null)}catch(e){n.P=!1,n.A(e,8,t,!0)}})(n,t,n.x(t).k,!e);try{e&&t.$initLoad()}catch(e){n.A(e,6,t,!0)}}function p(n,t,e,o,i){if(t.type||t.state){if(!t.state){if(t.attr&&(void 0===e.T[i]||""===e.T[i])){const o=n.D.H(e,t.attr);null!=o&&(e.T[i]=f(t.type,o))}e.hasOwnProperty(i)&&(void 0===e.T[i]&&(e.T[i]=e[i]),delete e[i])}o.hasOwnProperty(i)&&void 0===e.T[i]&&(e.T[i]=o[i]),t.watchCallbacks&&(e.T[L+i]=t.watchCallbacks.slice()),b(o,i,function c(n){return(n=this.S)&&n.T&&n.T[i]},function l(e,o){(o=this.S)&&(t.state||t.mutable)&&m(n,o,i,e)})}else if(t.context){const c=n.z(t.context);c&&h(o,i,c.F&&c.F(e)||c)}}function m(n,t,e,o,i,c,l){const f=(i=t.T=t.T||{})[e];if(o!==f&&(i[e]=o,c=t.O)){if(l=i[L+e])for(let n=0;nt!==n[l]));for(l=0,f=e.length;lb?o(n,null==r[$+1]?null:r[$+1].L,r,h,$):h>$&&i(n,u,m,b)}(s,a,d):S(d)?(S(u.p)&&t.in(s,""),o(s,null,d,0,d.length-1)):S(a)&&i(s,a,0,a.length-1);else if(s.R&&s.R.U){const n=s.R.U[0].parentElement;t.in(n,r.p),s.R.U=[n.childNodes[0]]}else u.p!==r.p&&t.in(s,r.p)}(a,d),d}}function g(n,t){n&&(n.g&&n.g(t?null:n.L),n.b&&n.b.forEach(n=>{g(n,t)}))}function C(n,t,e,o,i){const c=n.cn(t);let l,f,u,r;if(i&&1===c){(f=n.H(t,E))&&(u=f.split("."))[0]===o&&((r=new P).m=n.en(r.L=t),e.b||(e.b=[]),e.b[u[1]]=r,e=r,i=""!==u[2]);for(let c=0;c{let i=t[e];i||(i=n.fn.querySelector(e)),i||(i=t[e]=n._(e),n.X(n.fn,i)),i.componentOnReady(o)})}(n,t,e).then(n=>n[o].apply(n,i))}}const j="data-ssrv",E="data-ssrc",O={},k=[],x={enter:13,escape:27,space:32,tab:9,left:37,up:38,right:39,down:40},S=n=>void 0!==n&&null!==n,T=n=>void 0===n||null===n,M=n=>n.toLowerCase(),A=()=>{};class P{}const B=[],L="wc-",R={allowfullscreen:1,async:1,autofocus:1,autoplay:1,checked:1,controls:1,disabled:1,enabled:1,formnovalidate:1,hidden:1,multiple:1,noresize:1,readonly:1,required:1,selected:1,spellcheck:1},q="http://www.w3.org/1999/xlink";let D=!1;const H=n[o]=n[o]||{};{const o=function z(t,e,o,i,s,d){const p={html:{}},y={},v=function $(n,t){const e=new WeakMap,o={un:t.documentElement,n:t.head,fn:t.body,rn:!1,cn:n=>n.nodeType,_:n=>t.createElement(n),sn:(n,e)=>t.createElementNS(n,e),Z:n=>t.createTextNode(n),an:n=>t.createComment(n),c:(n,t,e)=>n.insertBefore(t,e),Y:(n,t)=>n.removeChild(t),X:(n,t)=>n.appendChild(t),dn:n=>n.childNodes,o:n=>n.parentNode,on:n=>n.nextSibling,en:n=>M(n.tagName),ln:n=>n.textContent,in:(n,t)=>n.textContent=t,H:(n,t)=>n.getAttribute(t),K:(n,t,e)=>n.setAttribute(t,e),pn:(n,t,e,o)=>n.setAttributeNS(t,e,o),mn:(n,t)=>n.removeAttribute(t),hn:(e,i)=>"child"===i?e.firstElementChild:"parent"===i?o.bn(e):"body"===i?o.fn:"document"===i?t:"window"===i?n:e,W:(n,t,i,c,l,f,u,r)=>{const s=t;let a=n,d=e.get(n);if(d&&d[s]&&d[s](),"string"==typeof f?a=o.hn(n,f):"object"==typeof f?a=f:(r=t.split(":")).length>1&&(a=o.hn(n,r[0]),t=r[1]),!a)return;let p=i;(r=t.split(".")).length>1&&(t=r[0],p=(n=>{n.keyCode===x[r[1]]&&i(n)})),u=o.rn?{capture:!!c,passive:!!l}:!!c,a.addEventListener(t,p,u),d||e.set(n,d={}),d[s]=(()=>{a&&a.removeEventListener(t,p,u),d[s]=null})},G:(n,t)=>{const o=e.get(n);o&&(t?o[t]&&o[t]():(Object.keys(o).forEach(n=>{o[n]&&o[n]()}),e.delete(n)))},yn:(t,e,o)=>t&&t.dispatchEvent(new n.CustomEvent(e,o))};try{n.addEventListener("e",null,Object.defineProperty({},"passive",{get:()=>o.rn=!0}))}catch(n){}return o.bn=((n,t)=>(t=o.o(n))&&11===o.cn(t)?t.host:t),o}(o,i);t.isServer=t.isPrerender=!(t.isClient=!0),t.window=o,t.location=o.location,t.document=i,t.publicPath=s,t.emit=((n,e,o)=>v.yn(n,t.eventNameFn?t.eventNameFn(e):e,o)),e.h=r,e.Context=t;const E=o.$definedCmps=o.$definedCmps||{},O={vn:function k(n,e){e.mode||(e.mode=v.H(e,"mode")||t.mode),v.H(e,j)||function o(n,t){return n&&1===t.e}(v.t,n)||function i(n,t,e,o){let i,c,l;t.$defaultHolder||n.c(t,t.$defaultHolder=n.an(""),e[0]);let f=0;for(;f{n.vn(t,o),n.Nn(t,o.mode,()=>a(n,o))},3))})(n,t,this)},o.attributeChangedCallback=function(n,e,o){(function i(n,t,e,o,c,l){if(o!==c&&n)for(l in e=M(e),n)if(n[l].jn===e){t[l]=f(n[l].En,c);break}})(t.I,this,n,e,o)},o.disconnectedCallback=function(){(function t(n,e){!n.V&&function o(n,t){for(;t;){if(!n.o(t))return 9!==n.cn(t);t=n.o(t)}}(n.D,e)&&(e.j=!0,u(e),g(e.B,!0),n.D.G(e),e.R&&(e.R=e.R.U=e.R.Q=null),e.O&&(e.O.componentDidUnload&&e.O.componentDidUnload(),e.O=e.O.S=null),e.$activeLoading=e.$connected=e.$defaultHolder=e.On=e.T=e.B=e.d=e.Cn=e.C=e.kn=null)})(n,this)},o.componentOnReady=function(n,t){return n||(t=new Promise(t=>n=t)),function e(n,t){n.j||(n.Cn?t(n):(n.xn=n.xn||[]).push(t))}(this,n),t},o.$initLoad=function(){(function t(n,e,o){if(e.O&&!e.j&&(!e.$activeLoading||!e.$activeLoading.length)){e.$activeLoading=null,e.Cn=!0;try{g(e.B),e.xn&&(e.xn.forEach(n=>n(e)),e.xn=null)}catch(t){n.A(t,4,e)}e.classList.add(o),u(e)}})(n,this,i)},o.Sn=function(){a(n,this)},function c(n,t,e){t&&Object.keys(t).forEach(o=>{const i=t[o].Tn;1===i||2===i?b(e,o,function n(){return(this.T=this.T||{})[o]},function t(e){m(n,this,o,e)}):6===i&&h(e,o,A)})}(n,t.I,o)}(O,n,t.prototype,d);{const e=[];for(const o in n.I)n.I[o].jn&&e.push(n.I[o].jn),t.observedAttributes=e}o.customElements.define(n.wn,t)}},M:t.emit,x:n=>p[v.en(n)],z:n=>t[n],isClient:!0,gn:n=>!(!E[v.en(n)]&&!O.x(n)),Nn:function T(n,t,e){if(n.k)e();else{const o=n.Mn[t]||n.Mn,i=s+o+(function o(n,t){return 2===t.e||1===t.e&&!n}(v.t,n)?".sc":"")+".js";import(i).then(t=>{try{n.k||(n.k=t[(n=>M(n).split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""))(n.wn)]),function o(n,t){const e=t.style;if(e){const o=t.is+(t.styleMode||"");if(!t[o]){const i=n._("template");t[o]=i,i.innerHTML="",n.X(n.n,i)}}}(v,n.k)}catch(t){n.k=class{}}e()}).catch(n=>void 0)}},A:(n,t,e)=>void 0,An:n=>(function t(n,e,o){return{create:N(n,e,o,"create"),componentOnReady:N(n,e,o,"componentOnReady")}})(v,y,n),N:function B(t,e,o){function i(){for(;s.length>0;)s.shift()();e=!1}function c(n){for(n=f(),i();a.length>0&&f()-n<40;)a.shift()();(o=a.length>0)&&u(l)}function l(n){for(i(),n=4+f();a.length>0&&f()0)&&u(c)}const f=()=>t.performance.now(),u=t=>n.requestAnimationFrame(t),r=Promise.resolve(),s=[],a=[];return{add:(n,t)=>{3===t?(s.push(n),e||(e=!0,r.then(i))):(a.push(n),o||(o=!0,u(c)))}}}(o),Pn:n=>(n||[]).map(n=>(function t(n,e,o,i){const c={wn:n[0],I:{color:{jn:"color"}}};c.Mn=n[1];const f=n[3];if(f)for(o=0;oL.Cn=!0),function R(n,t){const e=t.querySelectorAll(`[${j}]`),o=e.length;let i,c,l,f,u,r;if(t.Cn=o>0)for(f=0;fo.$n(n,class extends HTMLElement{}))}})(window,document,Context,appNamespace,publicPath); 7 | })({},"App","hydrated","/assets/build/app/"); -------------------------------------------------------------------------------- /angular/src/assets/build/app/app.global.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | (function(appNamespace,publicPath){"use strict"; 3 | (function(publicPath){Context.activeRouter=function(){var n={},t={},o={},e=[];return{set:function(t){n=Object.assign({},n,t),o={},function(){for(var n=e,t=0;t"+this.innerHTML+""},set:function(a){if(this.parentNode){d.body.innerHTML=a;for(a=document.createDocumentFragment();d.body.firstChild;)a.appendChild(d.body.firstChild);this.parentNode.replaceChild(a, 14 | this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};q(b.prototype);r(b.prototype);b.bootstrap=function(a){a=a.querySelectorAll("template");for(var c=0,f=a.length,d;c]/g, 15 | x=function(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case "\u00a0":return" "}}}if(e||l)b._cloneNode=function(a,b){var c=g.call(a,!1);this.decorate&&this.decorate(c);b&&(c.content.appendChild(g.call(a.content,!0)),this.fixClonedDom(c.content,a.content));return c},b.prototype.cloneNode=function(a){return b._cloneNode(this,a)},b.fixClonedDom=function(a,b){if(b.querySelectorAll)for(var c=b.querySelectorAll("template"),d=a.querySelectorAll("template"),e=0,g=d.length, 16 | h,k;e1)&&Zt(this)}}}),ot(u,h,{value:function(e){-1<_.call(a,e)&&o[h].apply(this,arguments)}}),o[d]&&ot(u,p,{value:o[d]}),o[v]&&ot(u,g,{value:o[v]}),i&&(f[c]=i),e=e.toUpperCase(),G[e]={constructor:t,create:i?[i,et(e)]:[e]},Z.set(t,e),n[s](e.toLowerCase(),f),en(e),Y[e].r()}function Gt(e){var t=G[e.toUpperCase()];return t&&t.constructor}function Yt(e){return typeof e=="string"?e:e&&e.is||""}function Zt(e){var t=e[h],n=t?e.attributes:j,r=n.length,i;while(r--)i=n[r],t.call(e,i.name||i.nodeName,null,i.value||i.nodeValue)}function en(e){return e=e.toUpperCase(),e in Y||(Y[e]={},Y[e].p=new K(function(t){Y[e].r=t})),Y[e].p}function tn(){X&&delete e.customElements,B(e,"customElements",{configurable:!0,value:new Kt}),B(e,"CustomElementRegistry",{configurable:!0,value:Kt});for(var t=function(t){var r=e[t];if(r){e[t]=function(t){var i,s;return t||(t=this),t[W]||(Q=!0,i=G[Z.get(t.constructor)],s=V&&i.create.length===1,t=s?Reflect.construct(r,j,i.constructor):n.createElement.apply(n,i.create),t[W]=!0,Q=!1,s||Zt(t)),t},e[t].prototype=r.prototype;try{r.prototype.constructor=e[t]}catch(i){z=!0,B(r,W,{value:e[t]})}}},r=i.get(/^HTML[A-Z]*[a-z]/),o=r.length;o--;t(r[o]));n.createElement=function(e,t){var n=Yt(t);return n?gt.call(this,e,et(n)):gt.call(this,e)},St||(Tt=!0,n[s](""))}var n=e.document,r=e.Object,i=function(e){var t=/^[A-Z]+[a-z]/,n=function(e){var t=[],n;for(n in s)e.test(n)&&t.push(n);return t},i=function(e,t){t=t.toLowerCase(),t in s||(s[e]=(s[e]||[]).concat(t),s[t]=s[t.toUpperCase()]=e)},s=(r.create||r)(null),o={},u,a,f,l;for(a in e)for(l in e[a]){f=e[a][l],s[l]=f;for(u=0;u>0),u="addEventListener",a="attached",f="Callback",l="detached",c="extends",h="attributeChanged"+f,p=a+f,d="connected"+f,v="disconnected"+f,m="created"+f,g=l+f,y="ADDITION",b="MODIFICATION",w="REMOVAL",E="DOMAttrModified",S="DOMContentLoaded",x="DOMSubtreeModified",T="<",N="=",C=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,k=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],L=[],A=[],O="",M=n.documentElement,_=L.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},D=r.prototype,P=D.hasOwnProperty,H=D.isPrototypeOf,B=r.defineProperty,j=[],F=r.getOwnPropertyDescriptor,I=r.getOwnPropertyNames,q=r.getPrototypeOf,R=r.setPrototypeOf,U=!!r.__proto__,z=!1,W="__dreCEv1",X=e.customElements,V=!/^force/.test(t.type)&&!!(X&&X.define&&X.get&&X.whenDefined),$=r.create||r,J=e.Map||function(){var t=[],n=[],r;return{get:function(e){return n[_.call(t,e)]},set:function(e,i){r=_.call(t,e),r<0?n[t.push(e)-1]=i:n[r]=i}}},K=e.Promise||function(e){function i(e){n=!0;while(t.length)t.shift()(e)}var t=[],n=!1,r={"catch":function(){return r},then:function(e){return t.push(e),n&&setTimeout(i,1),r}};return e(i),r},Q=!1,G=$(null),Y=$(null),Z=new J,et=function(e){return e.toLowerCase()},tt=r.create||function sn(e){return e?(sn.prototype=e,new sn):this},nt=R||(U?function(e,t){return e.__proto__=t,e}:I&&F?function(){function e(e,t){for(var n,r=I(t),i=0,s=r.length;i>>0;if("function"!==typeof c)throw new TypeError("predicate must be a function");for(var a=0;athis.status;this.statusText="statusText"in b?b.statusText:"OK";this.headers=new d(b.headers);this.url=b.url||"";this._initBody(a)}if(!e.fetch){var D="Symbol"in e&&"iterator"in Symbol,m;if(m="FileReader"in e&&"Blob"in e)try{new Blob,m=!0}catch(a){m=!1}var g={searchParams:"URLSearchParams"in e,iterable:D, 49 | blob:m,formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(g.arrayBuffer){var E="[object Int8Array];[object Uint8Array];[object Uint8ClampedArray];[object Int16Array];[object Uint16Array];[object Int32Array];[object Uint32Array];[object Float32Array];[object Float64Array]".split(";");var y=function(a){return a&&DataView.prototype.isPrototypeOf(a)};var z=ArrayBuffer.isView||function(a){return a&&-1-1&&r.splice(t,1),!r.length&&n.o.$initLoad()),n.o=null)}function c(n,t,r){for(var i,e=!1,u=!1,o=arguments.length;o-- >2;)I.push(arguments[o]);for(;I.length;)if((r=I.pop())&&void 0!==r.pop)for(o=r.length;o--;)I.push(r[o]);else"boolean"==typeof r&&(r=null),(u="function"!=typeof n)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(u=!1)),u&&e?i[i.length-1].f+=r:void 0===i?i=[u?a(r):r]:i.push(u?a(r):r),e=u;var f=new H;if(f.c=n,f.a=i,t&&(f.l=t,f.s=t.v,f.d=t.ref,t.className&&(t.class=t.className),"object"==typeof t.class)){for(o in t.class)t.class[o]&&I.push(o);t.class=I.join(" "),I.length=0}return f}function a(n){var t=new H;return t.f=n,t}function l(n,t){t.p||(t.p=!0,n.m.add(function(){t.p=!1,function n(t,r){if(!r.y){var i=!r.b,e=void 0;if(i){var u=r.o;if(u&&!u.$rendered)return void(u.$onRender=u.$onRender||[]).push(function(){n(t,r)});(function o(n,t,r){try{r=n.w(t).g,t.b=new r,function i(n,t,r,e,u,o){for(o in e.j=r,r.C=r.C||{},(u=Object.assign({color:{type:String}},t.properties)).mode={type:String},u)v(n,u[o],r,e,o)}(n,r,t,t.b),function e(n,t,r){t&&t.forEach(function(t){r[t.method]={emit:function(i){n.O(r.j,t.name,{bubbles:t.bubbles,composed:t.composed,cancelable:t.cancelable,detail:i})}}})}(n,r.events,t.b)}catch(r){t.b={},n.N(r,7,t,!0)}})(t,r);try{r.b.componentWillLoad&&(e=r.b.componentWillLoad())}catch(n){t.N(n,3,r)}}e&&e.then?e.then(function(){return s(t,r,i)}):s(t,r,i)}}(n,t)}))}function s(n,t,r){(function i(n,t,r,e){try{var u=t.b,o=r.host;if(u.render||u.hostData||o){n.k=!0;var f=u.render&&u.render();n.k=!1;var a=t.T||new H;a.x=t,t.T=n.render(a,c(null,void 0,f),e,t.P,r.S)}n.A(n.M,r,u.mode,t),t.$rendered=!0,t.$onRender&&(t.$onRender.forEach(function(n){return n()}),t.$onRender=null)}catch(r){n.k=!1,n.N(r,8,t,!0)}})(n,t,n.w(t).g,!r);try{r&&t.$initLoad()}catch(r){n.N(r,6,t,!0)}}function v(n,t,r,i,e){if(t.type||t.state){if(!t.state){if(t.attr&&(void 0===r.C[e]||""===r.C[e])){var u=n.M._(r,t.attr);null!=u&&(r.C[e]=o(t.type,u))}r.hasOwnProperty(e)&&(void 0===r.C[e]&&(r.C[e]=r[e]),delete r[e])}i.hasOwnProperty(e)&&void 0===r.C[e]&&(r.C[e]=i[e]),t.watchCallbacks&&(r.C[R+e]=t.watchCallbacks.slice()),p(i,e,function f(n){return(n=this.j)&&n.C&&n.C[e]},function c(r,i){(i=this.j)&&(t.state||t.mutable)&&h(n,i,e,r)})}else if(t.context){var a=n.L(t.context);a&&d(i,e,a.B&&a.B(r)||a)}}function h(n,t,r,i,e,u,o){var f=(e=t.C=t.C||{})[r];if(i!==f&&(e[r]=i,u=t.b)){if(o=e[R+r])for(var c=0;cm?i(n,null==a[g+1]?null:a[g+1].x,a,p,g):p>g&&e(n,c,d,m)}(l,s,v):M(v)?(M(c.f)&&t.rn(l,""),i(l,null,v,0,v.length-1)):M(s)&&e(l,s,0,s.length-1);else if(l.P&&l.P.F){var d=l.P.F[0].parentElement;t.rn(d,a.f),l.P.F=[d.childNodes[0]]}else c.f!==a.f&&t.rn(l,a.f)}(s,v),v}}function w(n,t){n&&(n.d&&n.d(t?null:n.x),n.a&&n.a.forEach(function(n){w(n,t)}))}function $(n,t,r,i,e){var u,o,f,c,l=n.in(t);if(e&&1===l){(o=n._(t,x))&&(f=o.split("."))[0]===i&&((c=new H).c=n.nn(c.x=t),r.a||(r.a=[]),r.a[f[1]]=c,r=c,e=""!==f[2]);for(var s=0;s-1||i.indexOf("var(")>-1){var e=n.createElement("style");return e.innerHTML=i,r.parentNode.insertBefore(e,r),t.bn(e).then(function(){r.parentNode.removeChild(r)})}return Promise.resolve()}).catch(function(n){})}var T="data-ssrv",x="data-ssrc",P={},S=[],A={enter:13,escape:27,space:32,tab:9,left:37,up:38,right:39,down:40},M=function(n){return void 0!==n&&null!==n},_=function(n){return void 0===n||null===n},L=function(n){return n.toLowerCase()},B=function(){},H=function H(){},I=[],R="wc-",q={allowfullscreen:1,async:1,autofocus:1,autoplay:1,checked:1,controls:1,disabled:1,enabled:1,formnovalidate:1,hidden:1,multiple:1,noresize:1,readonly:1,required:1,selected:1,spellcheck:1},D="http://www.w3.org/1999/xlink",z=!1,F=function F(){this.mn=null,this.on=0,this.fn=0,this.ln=null,this.sn=null,this.cn="",this.an="",this.vn="",this.dn=!1,this.hn="",this.type=0,this.pn=""},W=function(){function n(n){this.gn=n||null,this.wn=null}return n.get=function(n){return n?n[rn]:null},n.set=function(n,t){return n[rn]=t,t},n}(),Z="{",G="}",J=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,K=/@import[^;]*;/gim,Q=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,U=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,V=/^@[^\s]*keyframes/,X=/\s+/g,Y="--",nn="@media",tn="@",rn="__styleInfo",en=/@media\s(.*)/,un=function(){function n(n){var t;this.$n=n,this.matchesSelector=(t=n.Element.prototype).matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.webkitMatchesSelector}return n.prototype.jn=function(n){if(n.Cn)return n.Cn;var t={},r={};return this.On(n,r)&&(t.properties=r,n.mn=null),t.an=n.cn,n.Cn=t,t},n.prototype.On=function(n,t){var r=n.Cn;if(!r){for(var i=void 0,e=n.cn,u=void 0,o=void 0;i=on.exec(e);)"inherit"===(u=(i[2]||i[3]).trim())&&"unset"===u||(t[i[1].trim()]=u),o=!0;return o}if(r.properties)return Object.assign(t,r.properties),!0},n.prototype.Nn=function(n){for(var t=Object.getOwnPropertyNames(n),r=0,i=void 0;r=0?this.En(n,t):function n(t,r){var i=t.indexOf("var(");if(-1===i)return r(t,"","","");var e=function u(n,t){for(var r=0,i=t,e=n.length;i1&&(s=i.nt(n,a[0]),t=a[1]),s){var h=e;(a=t.split(".")).length>1&&(t=a[0],h=function(n){n.keyCode===A[a[1]]&&e(n)}),c=i.Kn?{capture:!!u,passive:!!o}:!!u,s.addEventListener(t,h,c),v||r.set(n,v={}),v[l]=function(){s&&s.removeEventListener(t,h,c),v[l]=null}}},R:function(n,t){var i=r.get(n);i&&(t?i[t]&&i[t]():(Object.keys(i).forEach(function(n){i[n]&&i[n]()}),r.delete(n)))}};"function"!=typeof n.CustomEvent&&(n.CustomEvent=function(n,r,i){return(i=t.createEvent("CustomEvent")).initCustomEvent(n,r.bubbles,r.cancelable,r.detail),i},n.CustomEvent.prototype=n.Event.prototype),i.rt=function(t,r,i){return t&&t.dispatchEvent(new n.CustomEvent(r,i))};try{n.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){return i.Kn=!0}}))}catch(n){}return i.tt=function(n,t){return(t=i.J(n))&&11===i.in(t)?t.host:t},i}(i,e);t.isServer=t.isPrerender=!(t.isClient=!0),t.window=i,t.location=i.location,t.document=e,t.publicPath=a,t.emit=function(n,r,i){return N.rt(n,t.eventNameFn?t.eventNameFn(r):r,i)},r.h=c,r.Context=t;var x=i.$definedCmps=i.$definedCmps||{},P={it:function S(n,r){r.mode||(r.mode=N._(r,"mode")||t.mode),N._(r,T)||function i(n,t){return n&&1===t.S}(N.Y,n)||function e(n,t,r,i){var e,u,o;t.$defaultHolder||n.V(t,t.$defaultHolder=n.Un(""),r[0]);for(var f=0;f0;)l.shift()();r=!1}function u(n){for(n=f(),e();s.length>0&&f()-n<40;)s.shift()();(i=s.length>0)&&c(o)}function o(n){for(e(),n=4+f();s.length>0&&f()0)&&c(u)}var f=function(){return t.performance.now()},c=function(t){return n.requestAnimationFrame(t)},a=Promise.resolve(),l=[],s=[];return{add:function(n,t){3===t?(l.push(n),r||(r=!0,a.then(e))):(s.push(n),i||(i=!0,c(u)))}}}(i),bt:function(n){return(n||[]).map(function(n){return function t(n,r,i,e){var o={ut:n[0],H:{color:{at:"color"}}};o.mt=n[1];var f=n[3];if(f)for(i=0;i0)for(u=0;u[h("h1",null,"One"),h("stencil-route-link",{url:"/demo6/asdf"},"Next")]}),h("stencil-route",{url:"/demo6/:any*",group:"main",routeRender:e=>[h("h1",null,"Two: ",e.match),h("stencil-route-link",{url:"/demo6/"},"Back")]})]}static get is(){return"test-demo-six"}static get properties(){return{history:{type:"Any"},match:{type:"Any"},pages:{type:"Any"}}}}export{TestDemoSix}; -------------------------------------------------------------------------------- /angular/src/assets/build/app/mfcxg1az.es5.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | App.loadComponents(function(t,e,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.ionViewWillLoad=function(){return this.fetchNewContent()},t.prototype.fetchNewContent=function(){var t=this;return fetch(this.documentLocation).then(function(t){return t.text()}).then(function(e){t.content=e})},t.prototype.render=function(){return e("div",{innerHTML:this.content})},Object.defineProperty(t,"is",{get:function(){return"stencil-async-content"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{content:{state:!0},doc:{watchCallbacks:["fetchNewContent"]},documentLocation:{type:String}}},enumerable:!0,configurable:!0}),t}(),o=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},i=b,a=l,c=function(t,e){return f(l(t,e))},u=f,s=y,h=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function l(t,e){for(var n,r=[],o=0,i=0,a="",c=e&&e.delimiter||"/";null!=(n=h.exec(t));){var u=n[0],s=n[1],l=n.index;if(a+=t.slice(i,l),i=l+u.length,s)a+=s[1];else{var p=t[i],f=n[2],v=n[3],m=n[4],y=n[5],b=n[6],w=n[7];a&&(r.push(a),a="");var x=null!=f&&null!=p&&p!==f,R="+"===b||"*"===b,O="?"===b||"*"===b,k=n[2]||c,S=m||y;r.push({name:v||o++,prefix:f||"",delimiter:k,optional:O,repeat:R,partial:x,asterisk:!!w,pattern:S?g(S):w?".*":"[^"+d(k)+"]+?"})}}return i wasn\'t passed an instance of the router as the "router" prop!')},t.prototype.getUrl=function(t){var e=this.activeRouter.get("root")||"/";return"/"==t.charAt(0)&&"/"==e.charAt(e.length-1)?e.slice(0,e.length-1)+t:e+t},t.prototype.render=function(){var t,n=((t={})[this.activeClass]=null!==this.match,t);return this.custom?e("span",{class:n,onClick:this.handleClick.bind(this)},e("slot",null)):e("a",{class:n,href:this.url,onClick:this.handleClick.bind(this)},e("slot",null))},Object.defineProperty(t,"is",{get:function(){return"stencil-route-link"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{activeClass:{type:String},activeRouter:{context:"activeRouter"},custom:{type:Boolean},exact:{type:Boolean},location:{context:"location"},match:{state:!0},url:{type:String},urlMatch:{type:"Any"}}},enumerable:!0,configurable:!0}),t}(),A=function(){function t(){}return t.prototype.componentWillLoad=function(){var t=this.activeRouter&&this.activeRouter.get("titleSuffix")||"";document.title=""+this.title+t},t.prototype.render=function(){return null},Object.defineProperty(t,"is",{get:function(){return"stencil-route-title"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{activeRouter:{context:"activeRouter"},title:{type:String}}},enumerable:!0,configurable:!0}),t}();function E(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)}function P(t){return"/"===t.charAt(0)}function j(t,e){for(var n=e,r=n+1,o=t.length;r=0;h--){var l=o[h];"."===l?j(o,h):".."===l?(j(o,h),s++):s&&(j(o,h),s--)}if(!c)for(;s--;s)o.unshift("..");!c||""===o[0]||o[0]&&P(o[0])||o.unshift("");var p=o.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o.query=(i=o.search)?(/^[?#]/.test(i)?i.slice(1):i).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],o=n[1];return t[r]=o?decodeURIComponent(o.replace(/\+/g," ")):"",t},{}):{},o}function L(t){for(var e=[],n=1;nt.text()).then(t=>{this.content=t})}render(){return h("div",{innerHTML:this.content})}static get is(){return"stencil-async-content"}static get properties(){return{content:{state:!0},doc:{watchCallbacks:["fetchNewContent"]},documentLocation:{type:String}}}}var isarray=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},pathToRegexp_1=pathToRegexp,parse_1=parse,compile_1=compile,tokensToFunction_1=tokensToFunction,tokensToRegExp_1=tokensToRegExp,PATH_REGEXP=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function parse(t,e){for(var n,o=[],r=0,i=0,a="",s=e&&e.delimiter||"/";null!=(n=PATH_REGEXP.exec(t));){var c=n[0],h=n[1],u=n.index;if(a+=t.slice(i,u),i=u+c.length,h)a+=h[1];else{var l=t[i],p=n[2],g=n[3],d=n[4],f=n[5],m=n[6],y=n[7];a&&(o.push(a),a="");var v=null!=p&&null!=l&&l!==p,R="+"===m||"*"===m,w="?"===m||"*"===m,x=n[2]||s,b=d||f;o.push({name:g||r++,prefix:p||"",delimiter:x,optional:w,repeat:R,partial:v,asterisk:!!y,pattern:b?escapeGroup(b):y?".*":"[^"+escapeString(x)+"]+?"})}}return i(t[e.name]=h[n],t),{})}}class Route{constructor(){this.unsubscribe=(()=>{}),this.componentProps={},this.exact=!1,this.group=null,this.routeRender=null,this.match=null}computeMatch(t){t||(t=this.activeRouter.get("location").pathname);const e=matchPath(t,{path:this.url,exact:this.exact,strict:!0});if(e){if(this.group&&this.activeRouter.didGroupAlreadyMatch(this.group))return null;this.group&&this.activeRouter.setGroupMatched(this.group)}return e}componentWillLoad(){this.group&&this.activeRouter.addToGroup(this,this.group),this.unsubscribe=this.activeRouter.subscribe(()=>{this.match=this.computeMatch()}),this.match=this.computeMatch()}componentDidUnload(){this.activeRouter.removeFromGroups(this),this.unsubscribe()}render(){if(!this.activeRouter||!this.match)return null;const t=Object.assign({},this.componentProps,{history:this.activeRouter.get("history"),match:this.match});if(this.routeRender)return this.routeRender(Object.assign({},t,{component:this.component}));if(this.component){const e=this.component;return h(e,Object.assign({},t))}}static get is(){return"stencil-route"}static get properties(){return{activeRouter:{context:"activeRouter"},component:{type:String},componentProps:{type:"Any"},exact:{type:Boolean},group:{type:String},location:{context:"location"},match:{state:!0},routeRender:{type:"Any"},url:{type:"Any"}}}}class RouteLink{constructor(){this.unsubscribe=(()=>{}),this.exact=!1,this.custom=!1,this.activeClass="link-active",this.match=null}computeMatch(t){t||(t=this.activeRouter.get("location").pathname);return matchPath(t,{path:this.urlMatch||this.url,exact:this.exact,strict:!0})}componentWillLoad(){this.unsubscribe=this.activeRouter.subscribe(()=>{this.match=this.computeMatch()}),this.match=this.computeMatch()}componentDidUnload(){this.unsubscribe()}handleClick(t){if(t.preventDefault(),!this.activeRouter)return void console.warn(' wasn\'t passed an instance of the router as the "router" prop!');return this.activeRouter.get("history").push(this.getUrl(this.url),{})}getUrl(t){const e=this.activeRouter.get("root")||"/";return"/"==t.charAt(0)&&"/"==e.charAt(e.length-1)?e.slice(0,e.length-1)+t:e+t}render(){const t={[this.activeClass]:null!==this.match};return this.custom?h("span",{class:t,onClick:this.handleClick.bind(this)},h("slot",null)):h("a",{class:t,href:this.url,onClick:this.handleClick.bind(this)},h("slot",null))}static get is(){return"stencil-route-link"}static get properties(){return{activeClass:{type:String},activeRouter:{context:"activeRouter"},custom:{type:Boolean},exact:{type:Boolean},location:{context:"location"},match:{state:!0},url:{type:String},urlMatch:{type:"Any"}}}}class RouteTitle{componentWillLoad(){const t=this.activeRouter&&this.activeRouter.get("titleSuffix")||"";document.title=`${this.title}${t}`}render(){return null}static get is(){return"stencil-route-title"}static get properties(){return{activeRouter:{context:"activeRouter"},title:{type:String}}}}function hasBasename(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)}function stripBasename(t,e){return hasBasename(t,e)?t.substr(e.length):t}function stripTrailingSlash(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function addLeadingSlash(t){return"/"===t.charAt(0)?t:"/"+t}function parsePath(t){let e=t||"/",n="",o="";const r=e.indexOf("#");-1!==r&&(o=e.substr(r),e=e.substr(0,r));const i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===o?"":o}}function createPath(t){const{pathname:e,search:n,hash:o}=t;let r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:`?${n}`),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:`#${o}`),r}function parseQueryString(t){return t?(/^[?#]/.test(t)?t.slice(1):t).split("&").reduce((t,e)=>{let[n,o]=e.split("=");return t[n]=o?decodeURIComponent(o.replace(/\+/g," ")):"",t},{}):{}}function isAbsolute(t){return"/"===t.charAt(0)}function spliceOne(t,e){for(let n=e,o=n+1,r=t.length;o=0;t--){const e=o[t];"."===e?spliceOne(o,t):".."===e?(spliceOne(o,t),c++):c&&(spliceOne(o,t),c--)}if(!a)for(;c--;c)o.unshift("..");!a||""===o[0]||o[0]&&isAbsolute(o[0])||o.unshift("");let h=o.join("/");return s&&"/"!==h.substr(-1)&&(h+="/"),h}function createLocation(t,e,n,o){let r;"string"==typeof t?(r=parsePath(t)).state=e:(void 0===(r=Object.assign({},t)).pathname&&(r.pathname=""),r.search?"?"!==r.search.charAt(0)&&(r.search="?"+r.search):r.search="",r.hash?"#"!==r.hash.charAt(0)&&(r.hash="#"+r.hash):r.hash="",void 0!==e&&void 0===r.state&&(r.state=e));try{r.pathname=decodeURI(r.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+r.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(r.key=n),o?r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=resolvePathname(r.pathname,o.pathname)):r.pathname=o.pathname:r.pathname||(r.pathname="/"),r.query=parseQueryString(r.search),r}function invariant(t,...e){t||console.error(...e)}function warning(t,...e){t||console.warn(...e)}const createTransitionManager=()=>{let t=null;let e=[];return{setPrompt:e=>(warning(null==t,"A history supports only one prompt at a time"),t=e,()=>{t===e&&(t=null)}),confirmTransitionTo:(e,n,o,r)=>{if(null!=t){const i="function"==typeof t?t(e,n):t;"string"==typeof i?"function"==typeof o?o(i,r):(warning(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),r(!0)):r(!1!==i)}else r(!0)},appendListener:t=>{let n=!0;const o=(...e)=>{n&&t(...e)};return e.push(o),()=>{n=!1,e=e.filter(t=>t!==o)}},notifyListeners:(...t)=>{e.forEach(e=>e(...t))}}},canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),addEventListener=(t,e,n)=>t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n),removeEventListener=(t,e,n)=>t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n),getConfirmation=(t,e)=>e(window.confirm(t)),supportsHistory=()=>{const t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},supportsPopStateOnHashChange=()=>-1===window.navigator.userAgent.indexOf("Trident"),isExtraneousPopstateEvent=t=>void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS"),PopStateEvent="popstate",HashChangeEvent="hashchange",getHistoryState=()=>{try{return window.history.state||{}}catch(t){return{}}},createBrowserHistory=(t={})=>{invariant(canUseDOM,"Browser history needs a DOM");const e=window.history,n=supportsHistory(),o=!supportsPopStateOnHashChange(),{forceRefresh:r=!1,getUserConfirmation:i=getConfirmation,keyLength:a=6}=t,s=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"",c=t=>{t=t||{};const{key:e,state:n}=t,{pathname:o,search:r,hash:i}=window.location;let a=o+r+i;return warning(!s||hasBasename(a,s),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+a+'" to begin with "'+s+'".'),s&&(a=stripBasename(a,s)),createLocation(a,n,e)},h=()=>Math.random().toString(36).substr(2,a),u=createTransitionManager(),l=t=>{Object.assign(T,t),T.length=e.length,u.notifyListeners(T.location,T.action)},p=t=>{isExtraneousPopstateEvent(t)||f(c(t.state))},g=()=>{f(c(getHistoryState()))};let d=!1;const f=t=>{if(d)d=!1,l();else{const e="POP";u.confirmTransitionTo(t,e,i,n=>{n?l({action:e,location:t}):m(t)})}},m=t=>{const e=T.location;let n=v.indexOf(e.key);-1===n&&(n=0);let o=v.indexOf(t.key);-1===o&&(o=0);const r=n-o;r&&(d=!0,w(r))},y=c(getHistoryState());let v=[y.key];const R=t=>s+createPath(t),w=t=>{e.go(t)};let x=0;const b=t=>{1===(x+=t)?(addEventListener(window,"popstate",p),o&&addEventListener(window,"hashchange",g)):0===x&&(removeEventListener(window,"popstate",p),o&&removeEventListener(window,"hashchange",g))};let E=!1;const T={length:e.length,action:"POP",location:y,createHref:R,push:(t,o)=>{warning(!("object"==typeof t&&void 0!==t.state&&void 0!==o),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");const a=createLocation(t,o,h(),T.location);u.confirmTransitionTo(a,"PUSH",i,t=>{if(!t)return;const o=R(a),{key:i,state:s}=a;if(n)if(e.pushState({key:i,state:s},null,o),r)window.location.href=o;else{const t=v.indexOf(T.location.key),e=v.slice(0,-1===t?0:t+1);e.push(a.key),v=e,l({action:"PUSH",location:a})}else warning(void 0===s,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=o})},replace:(t,o)=>{warning(!("object"==typeof t&&void 0!==t.state&&void 0!==o),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");const a=createLocation(t,o,h(),T.location);u.confirmTransitionTo(a,"REPLACE",i,t=>{if(!t)return;const o=R(a),{key:i,state:s}=a;if(n)if(e.replaceState({key:i,state:s},null,o),r)window.location.replace(o);else{const t=v.indexOf(T.location.key);-1!==t&&(v[t]=a.key),l({action:"REPLACE",location:a})}else warning(void 0===s,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(o)})},go:w,goBack:()=>w(-1),goForward:()=>w(1),block:(t="")=>{const e=u.setPrompt(t);return E||(b(1),E=!0),()=>(E&&(E=!1,b(-1)),e())},listen:t=>{const e=u.appendListener(t);return b(1),()=>{b(-1),e()}}};return T};class Router{constructor(){this.root="/",this.titleSuffix="",this.unsubscribe=(()=>{}),this.match=null}titleSuffixChanged(t){this.activeRouter.set({titleSuffix:t})}computeMatch(t){return{path:this.root,url:this.root,isExact:t===this.root,params:{}}}componentWillLoad(){const t=createBrowserHistory();t.listen(t=>{this.activeRouter.set({location:this.getLocation(t)})}),this.activeRouter.set({location:this.getLocation(t.location),titleSuffix:this.titleSuffix,root:this.root,history:t}),this.unsubscribe=this.activeRouter.subscribe(()=>{this.match=this.computeMatch()}),this.match=this.computeMatch()}getLocation(t){const e=0==t.pathname.indexOf(this.root)?"/"+t.pathname.slice(this.root.length):t.pathname;return Object.assign({},t,{pathname:e})}componentDidUnload(){this.unsubscribe()}render(){return h("slot",null)}static get is(){return"stencil-router"}static get properties(){return{activeRouter:{context:"activeRouter"},match:{state:!0},root:{type:String},titleSuffix:{type:String,watchCallbacks:["titleSuffixChanged"]}}}}class Redirect{componentWillLoad(){const t=this.activeRouter.get("history");if(t)return t.replace(this.getUrl(this.url),{})}getUrl(t){const e=this.activeRouter.get("root")||"/";return"/"==t.charAt(0)&&"/"==e.charAt(e.length-1)?e.slice(0,e.length-1)+t:e+t}static get is(){return"stencil-router-redirect"}static get properties(){return{activeRouter:{context:"activeRouter"},url:{type:String}}}}export{AsyncContent as StencilAsyncContent,Route as StencilRoute,RouteLink as StencilRouteLink,RouteTitle as StencilRouteTitle,Router as StencilRouter,Redirect as StencilRouterRedirect}; -------------------------------------------------------------------------------- /angular/src/assets/build/app/mh7pqpgg.es5.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | App.loadComponents(function(e,n,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function e(){}return e.prototype.render=function(){return n("stencil-router",{"title-suffix":" - Stencil Router Demos"},n("ul",null,n("li",null,n("stencil-route-link",{url:"/",exact:!0},"Exact Base Link")),n("li",null,n("stencil-route-link",{url:"/"},"Base Link")),n("li",null,n("stencil-route-link",{url:"/demo",urlMatch:["/demo","/demox"],exact:!0},"Demo Link")),n("li",null,n("stencil-route-link",{url:"/demo2"},"Demo2 Link")),n("li",null,n("stencil-route-link",{url:"/demo3"},"Demo3 Link")),n("li",null,n("stencil-route-link",{url:"/demo3/page1"},"Demo3 Page1 Link")),n("li",null,n("stencil-route-link",{url:"/demo3/page2"},"Demo3 Page2 Link")),n("li",null,n("stencil-route-link",{url:"/demo4"},"Demo4 Link")),n("li",null,n("stencil-route-link",{url:"/demo6/"},"Demo6 Link"))),n("stencil-route",{url:"/",exact:!0,routeRender:function(e){return n("span",null,"rendering /")}}),n("stencil-route",{url:["/demo","/demox"],exact:!0,routeRender:function(e){return[n("stencil-route-title",{title:"DEMO"}),n("span",null,"rendering /demo")]}}),n("stencil-route",{url:"/demo2",exact:!0,routeRender:function(e){return[n("span",null,"rendering /demo2"),n("stencil-router-redirect",{url:"/demo3"})]}}),n("stencil-route",{url:"/demo3",exact:!0,routeRender:function(e){return[n("stencil-route-title",{title:"Demo 3"}),n("span",null,"rendering /demo 3")]}}),n("stencil-route",{url:"/demo3",componentProps:{pages:["intro/index.html"]},component:"test-demo-three"}),n("stencil-route",{url:"/demo4",component:"test-demo-four"}),n("stencil-route",{url:"/demo5",component:"async-content",componentProps:{location:"/"}}),n("stencil-route",{url:"/demo6",component:"test-demo-six"}))},Object.defineProperty(e,"is",{get:function(){return"test-app"},enumerable:!0,configurable:!0}),e}();e.TestApp=l},"mh7pqpgg"); -------------------------------------------------------------------------------- /angular/src/assets/build/app/mh7pqpgg.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | const{h,Context}=window.App;class TestApp{render(){return h("stencil-router",{"title-suffix":" - Stencil Router Demos"},h("ul",null,h("li",null,h("stencil-route-link",{url:"/",exact:!0},"Exact Base Link")),h("li",null,h("stencil-route-link",{url:"/"},"Base Link")),h("li",null,h("stencil-route-link",{url:"/demo",urlMatch:["/demo","/demox"],exact:!0},"Demo Link")),h("li",null,h("stencil-route-link",{url:"/demo2"},"Demo2 Link")),h("li",null,h("stencil-route-link",{url:"/demo3"},"Demo3 Link")),h("li",null,h("stencil-route-link",{url:"/demo3/page1"},"Demo3 Page1 Link")),h("li",null,h("stencil-route-link",{url:"/demo3/page2"},"Demo3 Page2 Link")),h("li",null,h("stencil-route-link",{url:"/demo4"},"Demo4 Link")),h("li",null,h("stencil-route-link",{url:"/demo6/"},"Demo6 Link"))),h("stencil-route",{url:"/",exact:!0,routeRender:e=>h("span",null,"rendering /")}),h("stencil-route",{url:["/demo","/demox"],exact:!0,routeRender:e=>[h("stencil-route-title",{title:"DEMO"}),h("span",null,"rendering /demo")]}),h("stencil-route",{url:"/demo2",exact:!0,routeRender:e=>[h("span",null,"rendering /demo2"),h("stencil-router-redirect",{url:"/demo3"})]}),h("stencil-route",{url:"/demo3",exact:!0,routeRender:e=>[h("stencil-route-title",{title:"Demo 3"}),h("span",null,"rendering /demo 3")]}),h("stencil-route",{url:"/demo3",componentProps:{pages:["intro/index.html"]},component:"test-demo-three"}),h("stencil-route",{url:"/demo4",component:"test-demo-four"}),h("stencil-route",{url:"/demo5",component:"async-content",componentProps:{location:"/"}}),h("stencil-route",{url:"/demo6",component:"test-demo-six"}))}static get is(){return"test-app"}}export{TestApp}; -------------------------------------------------------------------------------- /angular/src/assets/build/app/zji8cqpi.es5.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | App.loadComponents(function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.valueChangedHandler=function(e){this.valueChanged.emit(e.target.value)},e.prototype.render=function(){var e=this;return t("div",{class:"slider-container"},t("input",{type:"range",min:this.min,max:this.max,value:this.value,class:"slider",onChange:function(t){return e.valueChangedHandler(t)}}))},Object.defineProperty(e,"is",{get:function(){return"fwt-slider"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{max:{type:Number,attr:"max"},min:{type:Number,attr:"min"},value:{type:Number,attr:"value"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"valueChanged",method:"valueChanged",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return"fwt-slider .slider-container{width:100%}fwt-slider .slider{-webkit-appearance:none;appearance:none;width:100%;height:15px;border-radius:5px;background:#d3d3d3;outline:0;opacity:.7;transition:opacity .2s}fwt-slider .slider:hover{opacity:1}fwt-slider .slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:25px;height:25px;border-radius:50%;background:#4caf50;cursor:pointer}fwt-slider .slider::-moz-range-thumb{width:25px;height:25px;border-radius:50%;background:#4caf50;cursor:pointer}"},enumerable:!0,configurable:!0}),e}();e.FwtSlider=r},"zji8cqpi"); -------------------------------------------------------------------------------- /angular/src/assets/build/app/zji8cqpi.js: -------------------------------------------------------------------------------- 1 | /*! Built with http://stenciljs.com */ 2 | const{h,Context}=window.App;class SliderComponent{valueChangedHandler(e){this.valueChanged.emit(e.target.value)}render(){return h("div",{class:"slider-container"},h("input",{type:"range",min:this.min,max:this.max,value:this.value,class:"slider",onChange:e=>this.valueChangedHandler(e)}))}static get is(){return"fwt-slider"}static get properties(){return{max:{type:Number,attr:"max"},min:{type:Number,attr:"min"},value:{type:Number,attr:"value"}}}static get events(){return[{name:"valueChanged",method:"valueChanged",bubbles:!0,cancelable:!0,composed:!0}]}static get style(){return"fwt-slider .slider-container{width:100%}fwt-slider .slider{-webkit-appearance:none;appearance:none;width:100%;height:15px;border-radius:5px;background:#d3d3d3;outline:0;opacity:.7;transition:opacity .2s}fwt-slider .slider:hover{opacity:1}fwt-slider .slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:25px;height:25px;border-radius:50%;background:#4caf50;cursor:pointer}fwt-slider .slider::-moz-range-thumb{width:25px;height:25px;border-radius:50%;background:#4caf50;cursor:pointer}"}}export{SliderComponent as FwtSlider}; -------------------------------------------------------------------------------- /angular/src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/angular/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /angular/src/assets/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/angular/src/assets/img/icon.png -------------------------------------------------------------------------------- /angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/angular/src/favicon.ico -------------------------------------------------------------------------------- /angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /angular/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** Evergreen browsers require these. **/ 41 | import 'core-js/es6/reflect'; 42 | import 'core-js/es7/reflect'; 43 | 44 | 45 | /** 46 | * Required to support Web Animations `@angular/animation`. 47 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 48 | **/ 49 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 50 | 51 | 52 | 53 | /*************************************************************************************************** 54 | * Zone JS is required by Angular itself. 55 | */ 56 | import 'zone.js/dist/zone'; // Included with Angular CLI. 57 | 58 | 59 | 60 | /*************************************************************************************************** 61 | * APPLICATION IMPORTS 62 | */ 63 | 64 | /** 65 | * Date, currency, decimal and percent pipes. 66 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 67 | */ 68 | // import 'intl'; // Run `npm install --save intl`. 69 | /** 70 | * Need to import at least one locale-data with intl. 71 | */ 72 | // import 'intl/locale-data/jsonp/en'; 73 | -------------------------------------------------------------------------------- /angular/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /angular/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /angular/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /angular/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /angular/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "eofline": true, 15 | "forin": true, 16 | "import-blacklist": [ 17 | true, 18 | "rxjs" 19 | ], 20 | "import-spacing": true, 21 | "indent": [ 22 | true, 23 | "spaces" 24 | ], 25 | "interface-over-type-literal": true, 26 | "label-position": true, 27 | "max-line-length": [ 28 | true, 29 | 140 30 | ], 31 | "member-access": false, 32 | "member-ordering": [ 33 | true, 34 | { 35 | "order": [ 36 | "static-field", 37 | "instance-field", 38 | "static-method", 39 | "instance-method" 40 | ] 41 | } 42 | ], 43 | "no-arg": true, 44 | "no-bitwise": true, 45 | "no-console": [ 46 | true, 47 | "debug", 48 | "info", 49 | "time", 50 | "timeEnd", 51 | "trace" 52 | ], 53 | "no-construct": true, 54 | "no-debugger": true, 55 | "no-duplicate-super": true, 56 | "no-empty": false, 57 | "no-empty-interface": true, 58 | "no-eval": true, 59 | "no-inferrable-types": [ 60 | true, 61 | "ignore-params" 62 | ], 63 | "no-misused-new": true, 64 | "no-non-null-assertion": true, 65 | "no-shadowed-variable": true, 66 | "no-string-literal": false, 67 | "no-string-throw": true, 68 | "no-switch-case-fall-through": true, 69 | "no-trailing-whitespace": true, 70 | "no-unnecessary-initializer": true, 71 | "no-unused-expression": true, 72 | "no-use-before-declare": true, 73 | "no-var-keyword": true, 74 | "object-literal-sort-keys": false, 75 | "one-line": [ 76 | true, 77 | "check-open-brace", 78 | "check-catch", 79 | "check-else", 80 | "check-whitespace" 81 | ], 82 | "prefer-const": true, 83 | "quotemark": [ 84 | true, 85 | "single" 86 | ], 87 | "radix": true, 88 | "semicolon": [ 89 | true, 90 | "always" 91 | ], 92 | "triple-equals": [ 93 | true, 94 | "allow-null-check" 95 | ], 96 | "typedef-whitespace": [ 97 | true, 98 | { 99 | "call-signature": "nospace", 100 | "index-signature": "nospace", 101 | "parameter": "nospace", 102 | "property-declaration": "nospace", 103 | "variable-declaration": "nospace" 104 | } 105 | ], 106 | "typeof-compare": true, 107 | "unified-signatures": true, 108 | "variable-name": false, 109 | "whitespace": [ 110 | true, 111 | "check-branch", 112 | "check-decl", 113 | "check-operator", 114 | "check-separator", 115 | "check-type" 116 | ], 117 | "directive-selector": [ 118 | true, 119 | "attribute", 120 | "app", 121 | "camelCase" 122 | ], 123 | "component-selector": [ 124 | true, 125 | "element", 126 | "app", 127 | "kebab-case" 128 | ], 129 | "use-input-property-decorator": true, 130 | "use-output-property-decorator": true, 131 | "use-host-property-decorator": true, 132 | "no-input-rename": true, 133 | "no-output-rename": true, 134 | "use-life-cycle-interface": true, 135 | "use-pipe-transform-interface": true, 136 | "component-class-suffix": true, 137 | "directive-class-suffix": true, 138 | "no-access-missing-member": true, 139 | "templates-use-public": true, 140 | "invoke-injectable": true 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /stencil/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | www/build 3 | www/index.html 4 | 5 | *~ 6 | *.sw[mnpcod] 7 | *.log 8 | *.lock 9 | *.tmp 10 | *.tmp.* 11 | log.txt 12 | *.sublime-project 13 | *.sublime-workspace 14 | 15 | .idea/ 16 | .vscode/ 17 | .sass-cache/ 18 | .versions/ 19 | node_modules/ 20 | $RECYCLE.BIN/ 21 | 22 | .DS_Store 23 | Thumbs.db 24 | UserInterfaceState.xcuserstate 25 | .env -------------------------------------------------------------------------------- /stencil/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ionic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /stencil/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stencil/starter", 3 | "private": true, 4 | "version": "0.0.1", 5 | "description": "Stencil Starter App", 6 | "files": [ 7 | "dist" 8 | ], 9 | "scripts": { 10 | "build": "stencil build --prerender", 11 | "dev": "sd concurrent \"stencil build --dev --watch\" \"stencil-dev-server\" ", 12 | "serve": "stencil-dev-server", 13 | "start": "npm run dev" 14 | }, 15 | "dependencies": { 16 | "@stencil/core": "0.2.3", 17 | "@stencil/router": "0.0.23" 18 | }, 19 | "devDependencies": { 20 | "@stencil/dev-server": "0.0.18", 21 | "@stencil/utils": "0.0.4" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "git+https://github.com/ionic-team/stencil-starter.git" 26 | }, 27 | "author": "Ionic Team", 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/ionic-team/stencil" 31 | }, 32 | "homepage": "https://github.com/ionic-team/stencil" 33 | } 34 | -------------------------------------------------------------------------------- /stencil/readme.md: -------------------------------------------------------------------------------- 1 | # Stencil Starter App 2 | 3 | Stencil is a compiler for building fast web apps using Web Components. 4 | 5 | Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec. 6 | 7 | Stencil components are just Web Components, so they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend frameworks given the capabilities now available in the browser, though using it as such is certainly not required. 8 | 9 | Stencil also enables a number of key capabilities on top of Web Components, in particular Server Side Rendering (SSR) without the need to run a headless browser, pre-rendering, and objects-as-properties (instead of just strings). 10 | 11 | ## Getting Started 12 | 13 | To start a new project using Stencil, clone this repo to a new directory: 14 | 15 | ```bash 16 | git clone git@github.com:ionic-team/stencil-starter.git my-app 17 | cd my-app 18 | git remote rm origin 19 | ``` 20 | 21 | and run: 22 | 23 | ```bash 24 | npm install 25 | npm start 26 | ``` 27 | 28 | To view the build, start an HTTP server inside of the `/www` directory. 29 | 30 | To watch for file changes during develop, run: 31 | 32 | ```bash 33 | npm run dev 34 | ``` 35 | 36 | To build the app for production, run: 37 | 38 | ```bash 39 | npm run build 40 | ``` 41 | 42 | -------------------------------------------------------------------------------- /stencil/src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/stencil/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /stencil/src/assets/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/stencil/src/assets/img/icon.png -------------------------------------------------------------------------------- /stencil/src/components.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is an autogenerated file created by the Stencil build process. 3 | * It contains typing information for all components that exist in this project 4 | * and imports for stencil collections that might be configured in your stencil.config.js file 5 | */ 6 | 7 | import '@stencil/router'; 8 | 9 | 10 | import { 11 | SliderComponent as FwtSlider 12 | } from './components/slider/slider'; 13 | 14 | declare global { 15 | interface HTMLFwtSliderElement extends FwtSlider, HTMLElement { 16 | } 17 | var HTMLFwtSliderElement: { 18 | prototype: HTMLFwtSliderElement; 19 | new (): HTMLFwtSliderElement; 20 | }; 21 | interface HTMLElementTagNameMap { 22 | "fwt-slider": HTMLFwtSliderElement; 23 | } 24 | interface ElementTagNameMap { 25 | "fwt-slider": HTMLFwtSliderElement; 26 | } 27 | namespace JSX { 28 | interface IntrinsicElements { 29 | "fwt-slider": JSXElements.FwtSliderAttributes; 30 | } 31 | } 32 | namespace JSXElements { 33 | export interface FwtSliderAttributes extends HTMLAttributes { 34 | max?: number; 35 | min?: number; 36 | value?: number; 37 | } 38 | } 39 | } 40 | 41 | declare global { namespace JSX { interface StencilJSX {} } } 42 | -------------------------------------------------------------------------------- /stencil/src/components/slider/slider.scss: -------------------------------------------------------------------------------- 1 | fwt-slider { 2 | 3 | .slider-container { 4 | width: 100%; 5 | } 6 | 7 | .slider { 8 | -webkit-appearance: none; 9 | appearance: none; 10 | width: 100%; 11 | height: 15px; 12 | border-radius: 5px; 13 | background: #d3d3d3; 14 | outline: none; 15 | opacity: 0.7; 16 | transition: opacity .2s; 17 | 18 | &:hover { 19 | opacity: 1; 20 | } 21 | 22 | &::-webkit-slider-thumb { 23 | -webkit-appearance: none; 24 | appearance: none; 25 | width: 25px; 26 | height: 25px; 27 | border-radius: 50%; 28 | background: #4CAF50; 29 | cursor: pointer; 30 | } 31 | 32 | &::-moz-range-thumb { 33 | width: 25px; 34 | height: 25px; 35 | border-radius: 50%; 36 | background: #4CAF50; 37 | cursor: pointer; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /stencil/src/components/slider/slider.tsx: -------------------------------------------------------------------------------- 1 | import { Component, Prop, Event, EventEmitter } from '@stencil/core'; 2 | 3 | @Component({ 4 | tag: 'fwt-slider', 5 | styleUrl: 'slider.scss' 6 | }) 7 | export class SliderComponent { 8 | 9 | @Prop() min: number; 10 | @Prop() max: number; 11 | @Prop() value: number; 12 | 13 | @Event() valueChanged: EventEmitter; 14 | 15 | valueChangedHandler(event: any) { 16 | this.valueChanged.emit(event.target.value); 17 | } 18 | 19 | render() { 20 | return ( 21 |
22 | this.valueChangedHandler(event)}> 23 |
24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /stencil/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stencil Starter App 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /stencil/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Stencil Starter", 3 | "short_name": "Stencil", 4 | "start_url": "/", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/img/icon.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#16161d", 12 | "theme_color": "#16161d" 13 | } -------------------------------------------------------------------------------- /stencil/stencil.config.js: -------------------------------------------------------------------------------- 1 | exports.config = { 2 | bundles: [ 3 | { components: ['fwt-slider'] } 4 | ], 5 | buildDir: 'assets/build', 6 | collections: [ 7 | { name: '@stencil/router' } 8 | ] 9 | }; 10 | 11 | exports.devServer = { 12 | root: 'www', 13 | watchGlob: '**/**' 14 | } 15 | -------------------------------------------------------------------------------- /stencil/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "allowUnreachableCode": false, 5 | "declaration": false, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "moduleResolution": "node", 12 | "module": "es2015", 13 | "target": "es2015", 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "jsx": "react", 17 | "jsxFactory": "h" 18 | }, 19 | "include": [ 20 | "src", 21 | "types/jsx.d.ts" 22 | ], 23 | "exclude": [ 24 | "node_modules" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /stencil/www/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/stencil/www/assets/icon/favicon.ico -------------------------------------------------------------------------------- /stencil/www/assets/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/stencil/www/assets/img/icon.png -------------------------------------------------------------------------------- /stencil/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seveves/angular-stencil/11fbfad471efffbb960765112c4942202571071a/stencil/www/favicon.ico -------------------------------------------------------------------------------- /stencil/www/host.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "rules": [ 4 | { 5 | "include": "/", 6 | "headers": [ 7 | { 8 | "name": "Link", 9 | "value": ";rel=preload;as=script" 10 | }, 11 | { 12 | "name": "Link", 13 | "value": ";rel=preload;as=script" 14 | } 15 | ] 16 | }, 17 | { 18 | "include": "/assets/build/app/**", 19 | "headers": [ 20 | { 21 | "name": "Cache-Control", 22 | "value": "public, max-age=31536000" 23 | } 24 | ] 25 | }, 26 | { 27 | "include": "/sw.js", 28 | "headers": [ 29 | { 30 | "name": "Cache-Control", 31 | "value": "no-cache, no-store, must-revalidate" 32 | } 33 | ] 34 | } 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /stencil/www/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Stencil Starter", 3 | "short_name": "Stencil", 4 | "start_url": "/", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/img/icon.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#16161d", 12 | "theme_color": "#16161d" 13 | } -------------------------------------------------------------------------------- /stencil/www/sw.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Welcome to your Workbox-powered service worker! 3 | * 4 | * You'll need to register this file in your web app and you should 5 | * disable HTTP caching for this file too. 6 | * See https://goo.gl/nhQhGp 7 | * 8 | * The rest of the code is auto-generated. Please don't update this file 9 | * directly; instead, make changes to your Workbox build configuration 10 | * and re-run your build process. 11 | * See https://goo.gl/YYPcyY 12 | */ 13 | 14 | 15 | importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.0.0-alpha.3/workbox-sw.js"); 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | /** 26 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to 27 | * requests for URLs in the manifest. 28 | * See https://goo.gl/S9QRab 29 | */ 30 | self.__precacheManifest = [ 31 | { 32 | "url": "assets/build/app.global.js", 33 | "revision": "874fca11d857bb2de14f9b0d097c39c6" 34 | }, 35 | { 36 | "url": "assets/build/app.js", 37 | "revision": "99165c3a997d99cddcdcdee585cf4fea" 38 | }, 39 | { 40 | "url": "assets/build/app.registry.json", 41 | "revision": "64bde8a0bbfe19a61039044c4a4f96cd" 42 | }, 43 | { 44 | "url": "assets/build/app/2tlvz7ue.js", 45 | "revision": "4acc73208963d0c1a8f9eabe17b8cdb6" 46 | }, 47 | { 48 | "url": "assets/build/app/app.a11spwg7.js", 49 | "revision": "788ef400097ab5e8e8464746de2599a9" 50 | }, 51 | { 52 | "url": "assets/build/app/app.aysob2df.pf.js", 53 | "revision": "096df62626f17d447d0854f778cbaf36" 54 | }, 55 | { 56 | "url": "assets/build/app/if0opbrp.js", 57 | "revision": "921a0f2053ba0a1728845286a22d9e61" 58 | }, 59 | { 60 | "url": "assets/build/app/imd9xidt.js", 61 | "revision": "2286d47e08db8815a3d1046e6f67975d" 62 | }, 63 | { 64 | "url": "assets/build/app/wzflf8ma.css", 65 | "revision": "5c7aa5b95da3e8f5aaf0afe29e300895" 66 | }, 67 | { 68 | "url": "assets/icon/favicon.ico", 69 | "revision": "d2f619d796fbe8bed6200da2691aa5b6" 70 | }, 71 | { 72 | "url": "assets/img/icon.png", 73 | "revision": "b96ad6e1e0b755c8cd45e6aec40bca25" 74 | }, 75 | { 76 | "url": "favicon.ico", 77 | "revision": "d2f619d796fbe8bed6200da2691aa5b6" 78 | }, 79 | { 80 | "url": "index.html", 81 | "revision": "c04aa2dc47a5d31d1cb6e83f2869dc3b" 82 | }, 83 | { 84 | "url": "manifest.json", 85 | "revision": "7f958ca5432ddd771183989b1c015833" 86 | }, 87 | { 88 | "url": "workbox-sw.prod.v2.0.1.js", 89 | "revision": "679d4e73dc756b21e46ee8f1bb52c882" 90 | } 91 | ].concat(self.__precacheManifest || []); 92 | 93 | if (Array.isArray(self.__precacheManifest)) { 94 | workbox.precaching.suppressWarnings(); 95 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 96 | } 97 | -------------------------------------------------------------------------------- /stencil/www/workbox-sw.prod.v2.0.1.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Google Inc. All Rights Reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | */ 15 | 16 | var WorkboxSW = (function () { 17 | 'use strict'; 18 | 19 | class ErrorFactory$1{constructor(a){this._errors=a;}createError(a,b){if(!(a in this._errors))throw new Error(`Unable to generate error '${a}'.`);let c=this._errors[a].replace(/\s+/g,' '),d=null;b&&(c+=` [${b.message}]`,d=b.stack);const e=new Error;return e.name=a,e.message=c,e.stack=d,e}} 20 | 21 | const errors={"not-in-sw":'workbox-sw must be loaded in your service worker file.',"unsupported-route-type":'The first parameter to registerRoute() should be either an Express-style path string, a RegExp, or a function.',"empty-express-string":'The Express style route string must have some characters, an empty string is invalid.',"bad-revisioned-cache-list":`The 'precache()' method expects`+`an array of revisioned urls like so: ['/example/hello.1234.txt', `+`{path: 'hello.txt', revision: '1234'}]`,"navigation-route-url-string":`The registerNavigationRoute() method `+`expects a URL string as its first parameter.`,"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character`,"bad-skip-waiting":`The 'skipWaiting' parameter must be a boolean.`,"bad-clients-claim":`The 'clientsClaim' parameter must be a boolean.`,"bad-directory-index":`The 'directoryIndex' parameter must be a boolean.`};var ErrorFactory = new ErrorFactory$1(errors); 22 | 23 | const errors$1={"express-route-invalid-path":`When using ExpressRoute, you must 24 | provide a path that starts with a '/' character (to match same-origin 25 | requests) or that starts with 'http' (to match cross-origin requests)`};var ErrorFactory$3 = new ErrorFactory$1(errors$1); 26 | 27 | var ErrorStackParser = {parse:()=>[]}; 28 | 29 | function atLeastOne(a){const b=Object.keys(a);b.some((c)=>a[c]!==void 0)||throwError('Please set at least one of the following parameters: '+b.map((c)=>`'${c}'`).join(', '));}function hasMethod(a,b){const c=Object.keys(a).pop(),d=typeof a[c][b];'function'!=d&&throwError(`The '${c}' parameter must be an object that exposes a 30 | '${b}' method.`);}function isInstance(a,b){const c=Object.keys(a).pop();a[c]instanceof b||throwError(`The '${c}' parameter must be an instance of 31 | '${b.name}'`);}function isOneOf(a,b){const c=Object.keys(a).pop();b.includes(a[c])||throwError(`The '${c}' parameter must be set to one of the 32 | following: ${b}`);}function isType(a,b){const c=Object.keys(a).pop(),d=typeof a[c];d!==b&&throwError(`The '${c}' parameter has the wrong type. (Expected: 33 | ${b}, actual: ${d})`);}function isArrayOfType(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing 34 | one or more '${b}' elements.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])typeof e!==b&&throwError(d);}function isArrayOfClass(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing 35 | one or more '${b.name}' instances.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])e instanceof b||throwError(d);}function throwError(a){a=a.replace(/\s+/g,' ');const b=new Error(a);b.name='assertion-failed';const c=ErrorStackParser.parse(b);throw 3<=c.length&&(b.message=`Invalid call to ${c[2].functionName}() — `+a),b} 36 | 37 | function normalizeHandler(a){return'object'==typeof a?(hasMethod({handler:a},'handle'),a):(isType({handler:a},'function'),{handle:a})} 38 | 39 | const defaultMethod='GET';const validMethods=['DELETE','GET','HEAD','POST','PUT']; 40 | 41 | class Route{constructor({match:a,handler:b,method:c}={}){this.handler=normalizeHandler(b),isType({match:a},'function'),this.match=a,c?(isOneOf({method:c},validMethods),this.method=c):this.method=defaultMethod;}} 42 | 43 | var isarray=Array.isArray||function(a){return'[object Array]'==Object.prototype.toString.call(a)}; 44 | 45 | var pathToRegexp_1=pathToRegexp; var parse_1=parse; var compile_1=compile; var tokensToFunction_1=tokensToFunction; var tokensToRegExp_1=tokensToRegExp; var PATH_REGEXP=new RegExp(['(\\\\.)','([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'].join('|'),'g');function parse(a,b){for(var k,d=[],e=0,f=0,g='',h=b&&b.delimiter||'/';null!=(k=PATH_REGEXP.exec(a));){var l=k[0],n=k[1],o=k.index;if(g+=a.slice(f,o),f=o+l.length,n){g+=n[1];continue}var p=a[f],q=k[2],r=k[3],s=k[4],t=k[5],u=k[6],v=k[7];g&&(d.push(g),g='');var z=k[2]||h,A=s||t;d.push({name:r||e++,prefix:q||'',delimiter:z,optional:'?'===u||'*'===u,repeat:'+'===u||'*'===u,partial:null!=q&&null!=p&&p!==q,asterisk:!!v,pattern:A?escapeGroup(A):v?'.*':'[^'+escapeString(z)+']+?'});}return f{if(a.startsWith('/')&&g.origin!==location.origin)return null;const h=a.startsWith('/')?g.pathname:g.href,i=h.match(e);if(!i)return null;const j={};return d.forEach((k,l)=>{j[k.name]=i[l+1];}),j},handler:b,method:c});}} 48 | 49 | class LogGroup{constructor(){this._logs=[],this._childGroups=[],this._isFallbackMode=!1;const a=/Firefox\/(\d*)\.\d*/.exec(navigator.userAgent);if(a)try{const b=parseInt(a[1],10);55>b&&(this._isFallbackMode=!0);}catch(b){this._isFallbackMode=!0;}/Edge\/\d*\.\d*/.exec(navigator.userAgent)&&(this._isFallbackMode=!0);}addPrimaryLog(a){this._primaryLog=a;}addLog(a){this._logs.push(a);}addChildGroup(a){0===a._logs.length||this._childGroups.push(a);}print(){return 0===this._logs.length&&0===this._childGroups.length?void this._printLogDetails(this._primaryLog):void(this._primaryLog&&(this._isFallbackMode?this._printLogDetails(this._primaryLog):console.groupCollapsed(...this._getLogContent(this._primaryLog))),this._logs.forEach((a)=>{this._printLogDetails(a);}),this._childGroups.forEach((a)=>{a.print();}),this._primaryLog&&!this._isFallbackMode&&console.groupEnd())}_printLogDetails(a){const b=a.logFunc?a.logFunc:console.log;b(...this._getLogContent(a));}_getLogContent(a){let b=a.message;this._isFallbackMode&&'string'==typeof b&&(b=b.replace(/%c/g,''));let c=[b];return!this._isFallbackMode&&a.colors&&(c=c.concat(a.colors)),a.args&&(c=c.concat(a.args)),c}} 50 | 51 | function isServiceWorkerGlobalScope(){return'ServiceWorkerGlobalScope'in self&&self instanceof ServiceWorkerGlobalScope}function isDevBuild(){return`dev`==`prod`}function isLocalhost(){return!!('localhost'===location.hostname||'[::1]'===location.hostname||location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))} 52 | 53 | self.workbox=self.workbox||{},self.workbox.LOG_LEVEL=self.workbox.LOG_LEVEL||{none:-1,verbose:0,debug:1,warn:2,error:3};const LIGHT_GREY=`#bdc3c7`; const DARK_GREY=`#7f8c8d`; const LIGHT_GREEN=`#2ecc71`; const LIGHT_YELLOW=`#f1c40f`; const LIGHT_RED=`#e74c3c`; const LIGHT_BLUE=`#3498db`;class LogHelper{constructor(){this._defaultLogLevel=isDevBuild()?self.workbox.LOG_LEVEL.debug:self.workbox.LOG_LEVEL.warn;}log(a){this._printMessage(self.workbox.LOG_LEVEL.verbose,a);}debug(a){this._printMessage(self.workbox.LOG_LEVEL.debug,a);}warn(a){this._printMessage(self.workbox.LOG_LEVEL.warn,a);}error(a){this._printMessage(self.workbox.LOG_LEVEL.error,a);}_printMessage(a,b){if(this._shouldLogMessage(a,b)){const c=this._getAllLogGroups(a,b);c.print();}}_getAllLogGroups(a,b){const c=new LogGroup,d=this._getPrimaryMessageDetails(a,b);if(c.addPrimaryLog(d),b.error){const f={message:b.error,logFunc:console.error};c.addLog(f);}const e=new LogGroup;if(b.that&&b.that.constructor&&b.that.constructor.name){const f=b.that.constructor.name;e.addLog(this._getKeyValueDetails('class',f));}return b.data&&('object'!=typeof b.data||b.data instanceof Array?e.addLog(this._getKeyValueDetails('additionalData',b.data)):Object.keys(b.data).forEach((f)=>{e.addLog(this._getKeyValueDetails(f,b.data[f]));})),c.addChildGroup(e),c}_getKeyValueDetails(a,b){return{message:`%c${a}: `,colors:[`color: ${LIGHT_BLUE}`],args:b}}_getPrimaryMessageDetails(a,b){let c,d;a===self.workbox.LOG_LEVEL.verbose?(c='Info',d=LIGHT_GREY):a===self.workbox.LOG_LEVEL.debug?(c='Debug',d=LIGHT_GREEN):a===self.workbox.LOG_LEVEL.warn?(c='Warn',d=LIGHT_YELLOW):a===self.workbox.LOG_LEVEL.error?(c='Error',d=LIGHT_RED):void 0;let e=`%c🔧 %c[${c}]`;const f=[`color: ${LIGHT_GREY}`,`color: ${d}`];let g;return'string'==typeof b?g=b:b.message&&(g=b.message),g&&(g=g.replace(/\s+/g,' '),e+=`%c ${g}`,f.push(`color: ${DARK_GREY}; font-weight: normal`)),{message:e,colors:f}}_shouldLogMessage(a,b){if(!b)return!1;let c=this._defaultLogLevel;return self&&self.workbox&&'number'==typeof self.workbox.logLevel&&(c=self.workbox.logLevel),c===self.workbox.LOG_LEVEL.none||a{let g=!1,h;if('navigate'===e.request.mode){const i=f.pathname+f.search;a.some((j)=>j.test(i))?b.some((j)=>j.test(i))?h=`The navigation route is not being used, since the `+`request URL matches both the whitelist and blacklist.`:(h=`The navigation route is being used.`,g=!0):h=`The navigation route is not being used, since the `+`URL being navigated to doesn't match the whitelist.`,logHelper.debug({that:this,message:h,data:{"request-url":f.href,whitelist:a,blacklist:b,handler:c}});}return g},handler:c,method:'GET'});}} 56 | 57 | class RegExpRoute extends Route{constructor({regExp:a,handler:b,method:c}){isInstance({regExp:a},RegExp);super({match:({url:e})=>{const f=a.exec(e.href);return f?e.origin!==location.origin&&0!==f.index?(logHelper.debug({that:this,message:`Skipping route, because the RegExp match didn't occur `+`at the start of the URL.`,data:{url:e.href,regExp:a}}),null):f.slice(1):null},handler:b,method:c});}} 58 | 59 | class Router$2{constructor(){this._routes=new Map,this._isListenerRegistered=!1;}addFetchListener(){return this._isListenerRegistered?(logHelper.warn({that:this,message:`addFetchListener() has already been called for this Router.`}),!1):(this._isListenerRegistered=!0,self.addEventListener('fetch',(a)=>{const b=this.handleRequest({event:a});b&&a.respondWith(b);}),!0)}handleRequest({event:a}){isInstance({event:a},FetchEvent);const b=new URL(a.request.url);if(!b.protocol.startsWith('http'))return void logHelper.log({that:this,message:`The URL does not start with HTTP, so it can't be handled.`,data:{request:a.request}});let{handler:c,params:d}=this._findHandlerAndParams({event:a,url:b});if(!c&&this.defaultHandler&&(c=this.defaultHandler),c){let e=c.handle({url:b,event:a,params:d});return this.catchHandler&&(e=e.catch((f)=>{return this.catchHandler.handle({url:b,event:a,error:f})})),e}}_findHandlerAndParams({event:a,url:b}){const c=this._routes.get(a.request.method)||[];for(const d of c){let e=d.match({url:b,event:a});if(e)return logHelper.log({that:this,message:'The router found a matching route.',data:{route:d,request:a.request}}),Array.isArray(e)&&0===e.length?e=void 0:e.constructor===Object&&0===Object.keys(e).length&&(e=void 0),{params:e,handler:d.handler}}return{handler:void 0,params:void 0}}setDefaultHandler({handler:a}={}){this.defaultHandler=normalizeHandler(a);}setCatchHandler({handler:a}={}){this.catchHandler=normalizeHandler(a);}registerRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a)this._routes.has(b.method)||this._routes.set(b.method,[]),this._routes.get(b.method).unshift(b);}registerRoute({route:a}={}){isInstance({route:a},Route),this.registerRoutes({routes:[a]});}unregisterRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a){this._routes.has(b.method)||logHelper.error({that:this,message:`Can't unregister route; there are no ${b.method} 60 | routes registered.`,data:{route:b}});const c=this._routes.get(b.method).indexOf(b);-1caches.match(a,{cacheName:c}),whitelist:b.whitelist||[/./],blacklist:b.blacklist||[]})});}} 64 | 65 | const errors$2={"multiple-cache-will-update-plugins":'You cannot register more than one plugin that implements cacheWillUpdate.',"multiple-cached-response-will-be-used-plugins":'You cannot register more than one plugin that implements cachedResponseWillBeUsed.',"invalid-response-for-caching":'The fetched response could not be cached due to an invalid response code.',"no-response-received":'No response received; falling back to cache.',"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character.`};var ErrorFactory$4 = new ErrorFactory$1(errors$2); 66 | 67 | class CacheableResponse{constructor({statuses:a,headers:b}={}){atLeastOne({statuses:a,headers:b}),a!==void 0&&isArrayOfType({statuses:a},'number'),b!==void 0&&isType({headers:b},'object'),this.statuses=a,this.headers=b;}isResponseCacheable({request:a,response:b}={}){isInstance({response:b},Response);let c=!0;if(this.statuses&&(c=this.statuses.includes(b.status)),this.headers&&c&&(c=Object.keys(this.headers).some((d)=>{return b.headers.get(d)===this.headers[d]})),!c){const d={response:b};this.statuses&&(d['valid-status-codes']=JSON.stringify(this.statuses)),this.headers&&(d['valid-headers']=JSON.stringify(this.headers)),a&&(d.request=a),logHelper.debug({message:`The response does not meet the criteria for being added to the 68 | cache.`,data:d});}return c}} 69 | 70 | class CacheableResponsePlugin extends CacheableResponse{cacheWillUpdate({request:a,response:b}={}){return this.isResponseCacheable({request:a,response:b})}} 71 | 72 | const getDefaultCacheName=({cacheId:a}={})=>{let b=`workbox-runtime-caching`;return a&&(b=`${a}-${b}`),self&&self.registration&&(b+=`-${self.registration.scope}`),b}; 73 | const pluginCallbacks=['cacheDidUpdate','cachedResponseWillBeUsed','cacheWillUpdate','fetchDidFail','requestWillFetch']; 74 | 75 | var cleanResponseCopy = (({response:a})=>{isInstance({response:a},Response);const b=a.clone(),c='body'in b?Promise.resolve(b.body):b.blob();return c.then((d)=>{return new Response(d,{headers:b.headers,status:b.status,statusText:b.statusText})})}); 76 | 77 | class RequestWrapper{constructor({cacheName:a,cacheId:b,plugins:c,fetchOptions:d,matchOptions:e}={}){if(b&&('string'!=typeof b||0===b.length))throw ErrorFactory$4.createError('bad-cache-id');a?(isType({cacheName:a},'string'),this.cacheName=a,b&&(this.cacheName=`${b}-${this.cacheName}`)):this.cacheName=getDefaultCacheName({cacheId:b}),d&&(isType({fetchOptions:d},'object'),this.fetchOptions=d),e&&(isType({matchOptions:e},'object'),this.matchOptions=e),this.plugins=new Map,c&&(isArrayOfType({plugins:c},'object'),c.forEach((f)=>{for(let g of pluginCallbacks)if('function'==typeof f[g]){if(!this.plugins.has(g))this.plugins.set(g,[]);else if('cacheWillUpdate'===g)throw ErrorFactory$4.createError('multiple-cache-will-update-plugins');else if('cachedResponseWillBeUsed'===g)throw ErrorFactory$4.createError('multiple-cached-response-will-be-used-plugins');this.plugins.get(g).push(f);}})),this.plugins.has('cacheWillUpdate')&&(this._userSpecifiedCachableResponsePlugin=this.plugins.get('cacheWillUpdate')[0]);}getDefaultCacheableResponsePlugin(){return this._defaultCacheableResponsePlugin||(this._defaultCacheableResponsePlugin=new CacheableResponsePlugin({statuses:[200]})),this._defaultCacheableResponsePlugin}async getCache(){return this._cache||(this._cache=await caches.open(this.cacheName)),this._cache}async match({request:a}){atLeastOne({request:a});const b=await this.getCache();let c=await b.match(a,this.matchOptions);if(this.plugins.has('cachedResponseWillBeUsed')){const d=this.plugins.get('cachedResponseWillBeUsed')[0];c=await d.cachedResponseWillBeUsed({request:a,cache:b,cachedResponse:c,matchOptions:this.matchOptions,cacheName:this.cacheName});}return c}async fetch({request:a}){'string'==typeof a?a=new Request(a):isInstance({request:a},Request);const b=this.plugins.has('fetchDidFail')?a.clone():null;if(this.plugins.has('requestWillFetch'))for(let c of this.plugins.get('requestWillFetch')){const d=await c.requestWillFetch({request:a});isInstance({returnedRequest:d},Request),a=d;}try{return await fetch(a,this.fetchOptions)}catch(c){if(this.plugins.has('fetchDidFail'))for(let d of this.plugins.get('fetchDidFail'))await d.fetchDidFail({request:b.clone()});throw c}}async fetchAndCache({request:a,waitOnCache:b,cacheKey:c,cacheResponsePlugin:d,cleanRedirects:e}){atLeastOne({request:a});let f;const g=await this.fetch({request:a}),h=this._userSpecifiedCachableResponsePlugin||d||this.getDefaultCacheableResponsePlugin(),i=await h.cacheWillUpdate({request:a,response:g});if(i){const j=e&&g.redirected?await cleanResponseCopy({response:g}):g.clone();f=this.getCache().then(async(k)=>{let l;const m=c||a;if('opaque'!==g.type&&this.plugins.has('cacheDidUpdate')&&(l=await this.match({request:m})),await k.put(m,j),this.plugins.has('cacheDidUpdate'))for(let n of this.plugins.get('cacheDidUpdate'))await n.cacheDidUpdate({cacheName:this.cacheName,oldResponse:l,newResponse:j,url:'url'in m?m.url:m});});}else if(!i&&b)throw ErrorFactory$4.createError('invalid-response-for-caching');return b&&f&&(await f),g}} 78 | 79 | class Handler{constructor({requestWrapper:a,waitOnCache:b}={}){this.requestWrapper=a?a:new RequestWrapper,this.waitOnCache=!!b;}handle({event:a,params:b}={}){throw Error('This abstract method must be implemented in a subclass.')}} 80 | 81 | class CacheFirst extends Handler{async handle({event:a}={}){isInstance({event:a},FetchEvent);const b=await this.requestWrapper.match({request:a.request});return b||(await this.requestWrapper.fetchAndCache({request:a.request,waitOnCache:this.waitOnCache}))}} 82 | 83 | class CacheOnly extends Handler{async handle({event:a}={}){return isInstance({event:a},FetchEvent),await this.requestWrapper.match({request:a.request})}} 84 | 85 | class NetworkFirst extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});const{networkTimeoutSeconds:b}=a;b&&(isType({networkTimeoutSeconds:b},'number'),this.networkTimeoutSeconds=b);}async handle({event:a}={}){isInstance({event:a},FetchEvent);const b=[];let c;this.networkTimeoutSeconds&&b.push(new Promise((e)=>{c=setTimeout(()=>{e(this.requestWrapper.match({request:a.request}));},1e3*this.networkTimeoutSeconds);}));const d=this.requestWrapper.fetchAndCache({request:a.request,waitOnCache:this.waitOnCache,cacheResponsePlugin:this._cacheablePlugin}).then((e)=>{return c&&clearTimeout(c),e?e:Promise.reject(ErrorFactory$4.createError('no-response-received'))}).catch(()=>this.requestWrapper.match({request:a.request}));return b.push(d),Promise.race(b)}} 86 | 87 | class NetworkOnly extends Handler{async handle({event:a}={}){return isInstance({event:a},FetchEvent),await this.requestWrapper.fetch({request:a.request})}} 88 | 89 | class StaleWhileRevalidate extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});}async handle({event:a}={}){isInstance({event:a},FetchEvent);const b=this.requestWrapper.fetchAndCache({request:a.request,waitOnCache:this.waitOnCache,cacheResponsePlugin:this._cacheablePlugin}).catch(()=>Response.error()),c=await this.requestWrapper.match({request:a.request});return c||(await b)}} 90 | 91 | let tmpIdbName=`workbox-cache-expiration`;self&&self.registration&&(tmpIdbName+=`-${self.registration.scope}`);const idbName=tmpIdbName;const idbVersion=1;const urlPropertyName='url';const timestampPropertyName='timestamp'; 92 | 93 | function createCommonjsModule(fn, module) { 94 | return module = { exports: {} }, fn(module, module.exports), module.exports; 95 | } 96 | 97 | var idb=createCommonjsModule(function(a){'use strict';(function(){function b(r){return Array.prototype.slice.call(r)}function c(r){return new Promise(function(s,t){r.onsuccess=function(){s(r.result);},r.onerror=function(){t(r.error);};})}function d(r,s,t){var u,v=new Promise(function(w,x){u=r[s].apply(r,t),c(u).then(w,x);});return v.request=u,v}function e(r,s,t){var u=d(r,s,t);return u.then(function(v){return v?new k(v,u.request):void 0})}function f(r,s,t){t.forEach(function(u){Object.defineProperty(r.prototype,u,{get:function(){return this[s][u]},set:function(v){this[s][u]=v;}});});}function g(r,s,t,u){u.forEach(function(v){v in t.prototype&&(r.prototype[v]=function(){return d(this[s],v,arguments)});});}function h(r,s,t,u){u.forEach(function(v){v in t.prototype&&(r.prototype[v]=function(){return this[s][v].apply(this[s],arguments)});});}function i(r,s,t,u){u.forEach(function(v){v in t.prototype&&(r.prototype[v]=function(){return e(this[s],v,arguments)});});}function j(r){this._index=r;}function k(r,s){this._cursor=r,this._request=s;}function l(r){this._store=r;}function m(r){this._tx=r,this.complete=new Promise(function(s,t){r.oncomplete=function(){s();},r.onerror=function(){t(r.error);},r.onabort=function(){t(r.error);};});}function n(r,s,t){this._db=r,this.oldVersion=s,this.transaction=new m(t);}function o(r){this._db=r;}f(j,'_index',['name','keyPath','multiEntry','unique']),g(j,'_index',IDBIndex,['get','getKey','getAll','getAllKeys','count']),i(j,'_index',IDBIndex,['openCursor','openKeyCursor']),f(k,'_cursor',['direction','key','primaryKey','value']),g(k,'_cursor',IDBCursor,['update','delete']),['advance','continue','continuePrimaryKey'].forEach(function(r){r in IDBCursor.prototype&&(k.prototype[r]=function(){var s=this,t=arguments;return Promise.resolve().then(function(){return s._cursor[r].apply(s._cursor,t),c(s._request).then(function(u){return u?new k(u,s._request):void 0})})});}),l.prototype.createIndex=function(){return new j(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new j(this._store.index.apply(this._store,arguments))},f(l,'_store',['name','keyPath','indexNames','autoIncrement']),g(l,'_store',IDBObjectStore,['put','add','delete','clear','get','getAll','getKey','getAllKeys','count']),i(l,'_store',IDBObjectStore,['openCursor','openKeyCursor']),h(l,'_store',IDBObjectStore,['deleteIndex']),m.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},f(m,'_tx',['objectStoreNames','mode']),h(m,'_tx',IDBTransaction,['abort']),n.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},f(n,'_db',['name','version','objectStoreNames']),h(n,'_db',IDBDatabase,['deleteObjectStore','close']),o.prototype.transaction=function(){return new m(this._db.transaction.apply(this._db,arguments))},f(o,'_db',['name','version','objectStoreNames']),h(o,'_db',IDBDatabase,['close']),['openCursor','openKeyCursor'].forEach(function(r){[l,j].forEach(function(s){s.prototype[r.replace('open','iterate')]=function(){var t=b(arguments),u=t[t.length-1],v=this._store||this._index,w=v[r].apply(v,t.slice(0,-1));w.onsuccess=function(){u(w.result);};};});}),[j,l].forEach(function(r){r.prototype.getAll||(r.prototype.getAll=function(s,t){var u=this,v=[];return new Promise(function(w){u.iterateCursor(s,function(x){return x?(v.push(x.value),void 0!==t&&v.length==t?void w(v):void x.continue()):void w(v)});})});});var q={open:function(r,s,t){var u=d(indexedDB,'open',[r,s]),v=u.request;return v.onupgradeneeded=function(w){t&&t(new n(v.result,w.oldVersion,v.transaction));},u.then(function(w){return new o(w)})},delete:function(r){return d(indexedDB,'deleteDatabase',[r])}};a.exports=q,a.exports.default=a.exports;})();}); 98 | 99 | const errors$3={"max-entries-or-age-required":`Either the maxEntries or maxAgeSeconds 100 | parameters (or both) are required when constructing Plugin.`,"max-entries-must-be-number":`The maxEntries parameter to the Plugin 101 | constructor must either be a number or undefined.`,"max-age-seconds-must-be-number":`The maxAgeSeconds parameter to the Plugin 102 | constructor must either be a number or undefined.`};var ErrorFactory$5 = new ErrorFactory$1(errors$3); 103 | 104 | class CacheExpiration{constructor({maxEntries:a,maxAgeSeconds:b}={}){if(!(a||b))throw ErrorFactory$5.createError('max-entries-or-age-required');if(a&&'number'!=typeof a)throw ErrorFactory$5.createError('max-entries-must-be-number');if(b&&'number'!=typeof b)throw ErrorFactory$5.createError('max-age-seconds-must-be-number');this.maxEntries=a,this.maxAgeSeconds=b,this._dbs=new Map,this._caches=new Map,this._expirationMutex=!1,this._timestampForNextRun=null;}async getDB({cacheName:a}={}){isType({cacheName:a},'string');const b=`${idbName}-${a}`;if(!this._dbs.has(b)){const c=await idb.open(b,idbVersion,(d)=>{const e=d.createObjectStore(a,{keyPath:urlPropertyName});e.createIndex(timestampPropertyName,timestampPropertyName,{unique:!1});});this._dbs.set(b,c);}return this._dbs.get(b)}async getCache({cacheName:a}={}){if(isType({cacheName:a},'string'),!this._caches.has(a)){const b=await caches.open(a);this._caches.set(a,b);}return this._caches.get(a)}isResponseFresh({cacheName:a,cachedResponse:b,now:c}={}){if(b&&this.maxAgeSeconds){isInstance({cachedResponse:b},Response);const d=b.headers.get('date');if(d){'undefined'==typeof c&&(c=Date.now());const e=new Date(d),f=e.getTime();return!!isNaN(f)||f+1e3*this.maxAgeSeconds>c}return this.expireEntries({cacheName:a,now:c}),!0}return!0}async updateTimestamp({cacheName:a,url:b,now:c}={}){isType({url:b},'string'),isType({cacheName:a},'string');const d=new URL(b,location);d.hash='','undefined'==typeof c&&(c=Date.now());const e=await this.getDB({cacheName:a}),f=e.transaction(a,'readwrite');f.objectStore(a).put({[timestampPropertyName]:c,[urlPropertyName]:d.href}),await f.complete;}async expireEntries({cacheName:a,now:b}={}){if(this._expirationMutex)return void(this._timestampForNextRun=b);this._expirationMutex=!0,isType({cacheName:a},'string'),'undefined'==typeof b&&(b=Date.now());const c=this.maxAgeSeconds?await this.findOldEntries({cacheName:a,now:b}):[],d=this.maxEntries?await this.findExtraEntries({cacheName:a}):[],e=[...new Set(c.concat(d))];if(await this.deleteFromCacheAndIDB({cacheName:a,urls:e}),0{i&&(i.value[timestampPropertyName]this.maxEntries&&(d=c.transaction(a,'readonly'),e=d.objectStore(a),f=e.index(timestampPropertyName),f.iterateCursor((h)=>{h&&(b.push(h.value[urlPropertyName]),g-b.length>this.maxEntries&&h.continue());})),await d.complete,b}async deleteFromCacheAndIDB({cacheName:a,urls:b}={}){if(isType({cacheName:a},'string'),isArrayOfType({urls:b},'string'),0{return a.headers.has(e)&&b.headers.has(e)});return d?c.every((e)=>{return a.headers.has(e)===b.headers.has(e)&&a.headers.get(e)===b.headers.get(e)}):(logHelper.log({message:`Unable to determine whether the response has been updated 119 | because none of the headers that would be checked are present.`,data:{"First Response":a,"Second Response":b,"Headers To Check":JSON.stringify(c)}}),!0)} 120 | 121 | class BroadcastCacheUpdate{constructor({channelName:a,headersToCheck:b,source:c}={}){if('string'!=typeof a||0===a.length)throw ErrorFactory$6.createError('channel-name-required');this.channelName=a,this.headersToCheck=b||defaultHeadersToCheck,this.source=c||defaultSource;}get channel(){return this._channel||(this._channel=new BroadcastChannel(this.channelName)),this._channel}notifyIfUpdated({first:a,second:b,cacheName:c,url:d}){isType({cacheName:c},'string'),responsesAreSame({first:a,second:b,headersToCheck:this.headersToCheck})||broadcastUpdate({cacheName:c,url:d,channel:this.channel,source:this.source});}} 122 | 123 | class BroadcastCacheUpdatePlugin extends BroadcastCacheUpdate{cacheDidUpdate({cacheName:a,oldResponse:b,newResponse:c,url:d}){isType({cacheName:a},'string'),isInstance({newResponse:c},Response),b&&this.notifyIfUpdated({cacheName:a,first:b,second:c,url:d});}} 124 | 125 | class Strategies{constructor({cacheId:a}={}){this._cacheId=a;}cacheFirst(a){return this._getCachingMechanism(CacheFirst,a)}cacheOnly(a){return this._getCachingMechanism(CacheOnly,a)}networkFirst(a){return this._getCachingMechanism(NetworkFirst,a)}networkOnly(a){return this._getCachingMechanism(NetworkOnly,a)}staleWhileRevalidate(a){return this._getCachingMechanism(StaleWhileRevalidate,a)}_getCachingMechanism(a,b={}){const c={cacheExpiration:CacheExpirationPlugin,broadcastCacheUpdate:BroadcastCacheUpdatePlugin,cacheableResponse:CacheableResponsePlugin},d={plugins:[]};b.excludeCacheId||(d.cacheId=this._cacheId),b.cacheName&&(d.cacheName=b.cacheName);const e=Object.keys(c);return e.forEach((f)=>{if(b[f]){const g=c[f],h=b[f];d.plugins.push(new g(h));}}),b.plugins&&b.plugins.forEach((f)=>{d.plugins.push(f);}),b.requestWrapper=new RequestWrapper(d),new a(b)}} 126 | 127 | const errorMessageFactory=(a,b)=>{let c=`An error was thrown by workbox with error code: `+`;'${a}'`;return b&&(c+=` with extras: '${JSON.stringify(b)}'`),c}; 128 | 129 | class WorkboxError extends Error{constructor(a,b){super(),this.name=a,this.message=errorMessageFactory(a,b),b&&(this.extras=b);}} 130 | 131 | class BaseCacheManager{constructor({cacheName:a,cacheId:b,plugins:c}={}){if(b&&('string'!=typeof b||0===b.length))throw new WorkboxError('bad-cache-id',{cacheId:b});this._entriesToCache=new Map,this._requestWrapper=new RequestWrapper({cacheName:a,cacheId:b,plugins:c,fetchOptions:{credentials:'same-origin'}});}_addEntries(a){this._parsedCacheUrls=null,a.forEach((b)=>{this._addEntryToInstallList(this._parseEntry(b));});}getCacheName(){return this._requestWrapper.cacheName}getCachedUrls(){return this._parsedCacheUrls||(this._parsedCacheUrls=Array.from(this._entriesToCache.keys()).map((a)=>new URL(a,location).href)),this._parsedCacheUrls}_addEntryToInstallList(a){const b=a.entryID,c=this._entriesToCache.get(a.entryID);return c?void this._onDuplicateInstallEntryFound(a,c):void this._entriesToCache.set(b,a)}async install(){if(0===this._entriesToCache.size)return[];const a=[];return this._entriesToCache.forEach((b)=>{a.push(this._cacheEntry(b));}),Promise.all(a)}async _cacheEntry(a){const b=await this._isAlreadyCached(a),c={url:a.request.url,revision:a.revision,wasUpdated:!b};if(b)return c;try{return await this._requestWrapper.fetchAndCache({request:a.getNetworkRequest(),waitOnCache:!0,cacheKey:a.request,cleanRedirects:!0}),await this._onEntryCached(a),c}catch(d){throw new WorkboxError('request-not-cached',{url:a.request.url,error:d})}}async cleanup(){if(!(await caches.has(this.getCacheName())))return;const a=[];this._entriesToCache.forEach((e)=>{a.push(e.request.url);});const b=await this._getCache(),c=await b.keys(),d=c.filter((e)=>!a.includes(e.url));return Promise.all(d.map(async(e)=>{await b.delete(e),await this._onEntryDeleted(e.url);}))}async _getCache(){return this._cache||(this._cache=await caches.open(this.getCacheName())),this._cache}_parseEntry(){throw new WorkboxError('requires-overriding')}_onDuplicateEntryFound(){throw new WorkboxError('requires-overriding')}_isAlreadyCached(){throw new WorkboxError('requires-overriding')}_onEntryCached(){throw new WorkboxError('requires-overriding')}_onEntryDeleted(){throw new WorkboxError('requires-overriding')}} 132 | 133 | class IDBHelper{constructor(a,b,c){if(a==void 0||b==void 0||c==void 0)throw Error('name, version, storeName must be passed to the constructor.');this._name=a,this._version=b,this._storeName=c;}_getDb(){return this._dbPromise?this._dbPromise:(this._dbPromise=idb.open(this._name,this._version,(a)=>{a.createObjectStore(this._storeName);}).then((a)=>{return a}),this._dbPromise)}close(){return this._dbPromise?this._dbPromise.then((a)=>{a.close(),this._dbPromise=null;}):void 0}put(a,b){return this._getDb().then((c)=>{const d=c.transaction(this._storeName,'readwrite'),e=d.objectStore(this._storeName);return e.put(b,a),d.complete})}delete(a){return this._getDb().then((b)=>{const c=b.transaction(this._storeName,'readwrite'),d=c.objectStore(this._storeName);return d.delete(a),c.complete})}get(a){return this._getDb().then((b)=>{return b.transaction(this._storeName).objectStore(this._storeName).get(a)})}getAllValues(){return this._getDb().then((a)=>{return a.transaction(this._storeName).objectStore(this._storeName).getAll()})}getAllKeys(){return this._getDb().then((a)=>{return a.transaction(this._storeName).objectStore(this._storeName).getAllKeys()})}} 134 | 135 | const cacheBustParamName='_workbox-precaching';const version='v1';const dbName='workbox-precaching';const dbVersion='1';const dbStorename='asset-revisions';let tmpRevisionedCacheName=`workbox-precaching-revisioned-${version}`;self&&self.registration&&(tmpRevisionedCacheName+=`-${self.registration.scope}`);const defaultRevisionedCacheName=tmpRevisionedCacheName; 136 | 137 | class RevisionDetailsModel{constructor(){this._idbHelper=new IDBHelper(dbName,dbVersion,dbStorename);}get(a){return this._idbHelper.get(a)}put(a,b){return this._idbHelper.put(a,b)}delete(a){return this._idbHelper.delete(a)}_close(){this._idbHelper.close();}} 138 | 139 | class BaseCacheEntry{constructor({entryID:a,revision:b,request:c,cacheBust:d}){this.entryID=a,this.revision=b,this.request=c,this.cacheBust=d;}getNetworkRequest(){if(!0!==this.cacheBust)return this.request;let a=this.request.url;const b={};if(!0===this.cacheBust)if('cache'in Request.prototype)b.cache='reload';else{const c=new URL(a,location);c.search+=(c.search?'&':'')+encodeURIComponent(cacheBustParamName)+'='+encodeURIComponent(this.revision),a=c.toString();}return new Request(a,b)}} 140 | 141 | class StringCacheEntry extends BaseCacheEntry{constructor(a){if(isType({url:a},'string'),0===a.length)throw new WorkboxError('invalid-string-entry',{url:a});super({entryID:a,revision:a,request:new Request(a),cacheBust:!1});}} 142 | 143 | class ObjectCacheEntry extends BaseCacheEntry{constructor({entryID:a,revision:b,url:c,cacheBust:d}){if('undefined'!=typeof b&&(isType({revision:b},'string'),0===b.length))throw new WorkboxError('invalid-object-entry',{problemParam:'revision',problemValue:b});if('undefined'==typeof d&&(d=!!b),isType({cacheBust:d},'boolean'),isType({url:c},'string'),0===c.length)throw new WorkboxError('invalid-object-entry',{problemParam:'url',problemValue:c});if('undefined'==typeof a)a=new URL(c,location).toString();else if(0===a.length)throw new WorkboxError('invalid-object-entry',{problemParam:'entryID',problemValue:a});super({entryID:a,revision:b||c,request:new Request(c),cacheBust:d});}} 144 | 145 | class RevisionedCacheManager extends BaseCacheManager{constructor(a={}){a.cacheName=a.cacheName||defaultRevisionedCacheName,super(a),this._revisionDetailsModel=new RevisionDetailsModel;}addToCacheList({revisionedFiles:a}={}){isInstance({revisionedFiles:a},Array),super._addEntries(a);const b=a.filter((c)=>'string'==typeof c||!c.revision);0{return this._close()})}_createLogFriendlyString(a){let b=`\n`;return a.forEach((c)=>{b+=` URL: '${c.url}' Revision: `+`'${c.revision}'\n`;}),b}install(){return super.install().then((a)=>{const b=[],c=[];a.forEach((e)=>{e.wasUpdated?b.push({url:e.url,revision:e.revision}):c.push({url:e.url,revision:e.revision});});const d={};return 0{const d=this._revisionedCacheManager.getCachedUrls();0{if(a)return self.skipWaiting()}));}),self.addEventListener('activate',(c)=>{c.waitUntil(this._revisionedCacheManager.cleanup().then(()=>{if(b)return self.clients.claim()}));});}_registerDefaultRoutes(a,b){const c=[];(a||b)&&c.push(this._getCacheMatchPlugin(a,b));const d=this.strategies.cacheFirst({cacheName:this._revisionedCacheManager.getCacheName(),plugins:c,excludeCacheId:!0});this.router.registerRoute(({url:f})=>{f.hash='';const g=this._revisionedCacheManager.getCachedUrls();if(-1!==g.indexOf(f.href))return!0;let h=this._removeIgnoreUrlParams(f.href,a);return-1!==g.indexOf(h.href)||b&&h.pathname.endsWith('/')&&(h.pathname+=b,-1!==g.indexOf(h.href))},d);}_getCacheMatchPlugin(a,b){return{cachedResponseWillBeUsed:async({request:d,cache:e,cachedResponse:f,matchOptions:g})=>{if(f)return f;let h=this._removeIgnoreUrlParams(d.url,a);return e.match(h.toString(),g).then((i)=>{return!i&&h.pathname.endsWith('/')?(h.pathname+=b,e.match(h.toString(),g)):i})}}}_removeIgnoreUrlParams(a,b){const c=new URL(a),d=c.search.slice(1),e=d.split('&'),f=e.map((i)=>{return i.split('=')}),g=f.filter((i)=>{return b.every((j)=>{return!j.test(i[0])})}),h=g.map((i)=>{return i.join('=')});return c.search=h.join('&'),c}} 154 | 155 | return WorkboxSW$1; 156 | 157 | }()); 158 | //# sourceMappingURL=workbox-sw.prod.v2.0.1.js.map 159 | --------------------------------------------------------------------------------