asap-viewer 12.6.21 → 12.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asap-viewer.d.ts +0 -1
- package/asap-viewer.metadata.json +1 -1
- package/bundles/asap-viewer.umd.js +1532 -1844
- package/bundles/asap-viewer.umd.js.map +1 -1
- package/bundles/asap-viewer.umd.min.js +1 -1
- package/bundles/asap-viewer.umd.min.js.map +1 -1
- package/esm2015/asap-viewer.js +1 -2
- package/esm2015/lib/@core/services/offline-storage.service.js +1 -1
- package/esm2015/lib/asap-viewer.module.js +1 -10
- package/esm2015/lib/editor/components/video/video.component.js +1 -9
- package/esm2015/lib/visualizador/curso-visualizador/curso-visualizador.component.js +13 -93
- package/esm2015/lib/visualizador/curso-visualizador/viewer/viewer.component.js +26 -81
- package/esm5/asap-viewer.js +1 -2
- package/esm5/lib/@core/services/offline-storage.service.js +1 -1
- package/esm5/lib/asap-viewer.module.js +1 -10
- package/esm5/lib/editor/components/video/video.component.js +1 -9
- package/esm5/lib/visualizador/curso-visualizador/curso-visualizador.component.js +13 -108
- package/esm5/lib/visualizador/curso-visualizador/viewer/viewer.component.js +41 -119
- package/fesm2015/asap-viewer.js +1373 -1635
- package/fesm2015/asap-viewer.js.map +1 -1
- package/fesm5/asap-viewer.js +1534 -1845
- package/fesm5/asap-viewer.js.map +1 -1
- package/lib/visualizador/curso-visualizador/curso-visualizador.component.d.ts +0 -1
- package/lib/visualizador/curso-visualizador/viewer/viewer.component.d.ts +1 -1
- package/package.json +1 -1
- package/esm2015/lib/@core/interceptors/offline.interceptor.js +0 -119
- package/esm5/lib/@core/interceptors/offline.interceptor.js +0 -130
- package/lib/@core/interceptors/offline.interceptor.d.ts +0 -9
package/fesm2015/asap-viewer.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { Component, ViewEncapsulation, ViewChild, Injectable, ElementRef, EventEmitter, Input, Output, Renderer2, NgModule, Pipe,
|
|
2
|
-
import { HttpClient, HttpResponse, HttpRequest, HttpHeaders, HttpEventType, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
1
|
+
import { Component, ViewEncapsulation, ViewChild, Injectable, ElementRef, EventEmitter, Input, Output, Renderer2, NgModule, Pipe, Directive, ɵɵdefineInjectable, ChangeDetectorRef, Inject, Optional, ɵɵinject, LOCALE_ID } from '@angular/core';
|
|
3
2
|
import { Location, CommonModule, registerLocaleData } from '@angular/common';
|
|
4
3
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
5
4
|
import { FormsModule, ReactiveFormsModule, FormControl, FormArray, FormGroup, FormBuilder, Validators } from '@angular/forms';
|
|
6
5
|
import { Global, AsapService, AsapClientPipe as AsapClientPipe$1 } from 'asap-crud';
|
|
6
|
+
import { HttpClient, HttpRequest, HttpHeaders, HttpEventType, HttpResponse } from '@angular/common/http';
|
|
7
7
|
import { trigger, transition, style, animate, group, query, stagger, animateChild } from '@angular/animations';
|
|
8
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
9
9
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
10
|
-
import { BehaviorSubject, merge, of, fromEvent, from, throwError, Subscription } from 'rxjs';
|
|
11
|
-
import { map, catchError, switchMap, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
12
|
-
import { __awaiter } from 'tslib';
|
|
13
10
|
import { ColorPickerModule } from 'ngx-color-picker';
|
|
14
11
|
import { MatSelectModule } from '@angular/material/select';
|
|
15
12
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -18,6 +15,9 @@ import { MatRadioModule } from '@angular/material/radio';
|
|
|
18
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
19
16
|
import { MatSliderModule } from '@angular/material/slider';
|
|
20
17
|
import { MomentModule } from 'ngx-moment';
|
|
18
|
+
import { __awaiter } from 'tslib';
|
|
19
|
+
import { of, BehaviorSubject, merge, fromEvent, Subscription } from 'rxjs';
|
|
20
|
+
import { catchError, map, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
21
21
|
import Swal from 'sweetalert2';
|
|
22
22
|
import * as moment$1 from 'moment';
|
|
23
23
|
import { locale } from 'moment';
|
|
@@ -2409,1683 +2409,1569 @@ SpinnerModule.decorators = [
|
|
|
2409
2409
|
|
|
2410
2410
|
/**
|
|
2411
2411
|
* @fileoverview added by tsickle
|
|
2412
|
-
* Generated from: lib
|
|
2412
|
+
* Generated from: lib/shared/file-manager/models/file-manager.model.ts
|
|
2413
2413
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2414
2414
|
*/
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
/**
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2415
|
+
class FileManagerModel {
|
|
2416
|
+
/**
|
|
2417
|
+
* @param {?} http
|
|
2418
|
+
* @param {?} global
|
|
2419
|
+
*/
|
|
2420
|
+
constructor(http, global) {
|
|
2421
|
+
this.http = http;
|
|
2422
|
+
this.global = global;
|
|
2423
|
+
this.apiBaseUrl = this.global.apiURL();
|
|
2424
|
+
}
|
|
2425
|
+
/**
|
|
2426
|
+
* @param {?} data
|
|
2427
|
+
* @return {?}
|
|
2428
|
+
*/
|
|
2429
|
+
populate(data) {
|
|
2430
|
+
return undefined;
|
|
2431
|
+
}
|
|
2432
|
+
/**
|
|
2433
|
+
* @param {?} data
|
|
2434
|
+
* @return {?}
|
|
2435
|
+
*/
|
|
2436
|
+
uploadFile(data) {
|
|
2437
|
+
/** @type {?} */
|
|
2438
|
+
const formData = new FormData();
|
|
2439
|
+
formData.append('file', data.file);
|
|
2440
|
+
formData.append('name', data.name);
|
|
2441
|
+
formData.append('description', data.description);
|
|
2442
|
+
/** @type {?} */
|
|
2443
|
+
const headerOptions = {
|
|
2444
|
+
'Authorization': localStorage.getItem('token'),
|
|
2445
|
+
'Accept': 'application/json'
|
|
2446
|
+
};
|
|
2447
|
+
/** @type {?} */
|
|
2448
|
+
const req = new HttpRequest('POST', this.apiBaseUrl + '/api/v2/admin/file', formData, {
|
|
2449
|
+
reportProgress: true,
|
|
2450
|
+
responseType: 'json',
|
|
2451
|
+
headers: new HttpHeaders(headerOptions)
|
|
2452
|
+
});
|
|
2453
|
+
return this.http.request(req);
|
|
2454
|
+
// return this.http.post(this.apiBaseUrl + '/api/v2/admin/file', data, {headers: new HttpHeaders(headerOptions)});
|
|
2455
|
+
}
|
|
2456
|
+
/**
|
|
2457
|
+
* @return {?}
|
|
2458
|
+
*/
|
|
2459
|
+
getAll() {
|
|
2460
|
+
return this.http.get(this.apiBaseUrl + '/api/v2/admin/file/all', { headers: this.getHeader() });
|
|
2461
|
+
}
|
|
2462
|
+
/**
|
|
2463
|
+
* @param {?} id
|
|
2464
|
+
* @return {?}
|
|
2465
|
+
*/
|
|
2466
|
+
deleteFile(id) {
|
|
2467
|
+
return this.http.delete(this.apiBaseUrl + '/api/v2/admin/file/' + id, { headers: this.getHeader() });
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* @return {?}
|
|
2471
|
+
*/
|
|
2472
|
+
changeFile() {
|
|
2473
|
+
return undefined;
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2476
|
+
* @return {?}
|
|
2477
|
+
*/
|
|
2478
|
+
getHeader() {
|
|
2479
|
+
/** @type {?} */
|
|
2480
|
+
const token = localStorage.getItem('token');
|
|
2481
|
+
if (token) {
|
|
2482
|
+
/** @type {?} */
|
|
2483
|
+
const headerOptions = {
|
|
2484
|
+
'Authorization': token,
|
|
2485
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
2486
|
+
'Accept': 'application/json'
|
|
2487
|
+
};
|
|
2488
|
+
return new HttpHeaders(headerOptions);
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2444
2491
|
}
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2492
|
+
FileManagerModel.decorators = [
|
|
2493
|
+
{ type: Injectable }
|
|
2494
|
+
];
|
|
2495
|
+
/** @nocollapse */
|
|
2496
|
+
FileManagerModel.ctorParameters = () => [
|
|
2497
|
+
{ type: HttpClient },
|
|
2498
|
+
{ type: Global }
|
|
2499
|
+
];
|
|
2449
2500
|
if (false) {
|
|
2450
|
-
/** @type {?|undefined} */
|
|
2451
|
-
SyncAction.prototype.id;
|
|
2452
2501
|
/** @type {?} */
|
|
2453
|
-
|
|
2502
|
+
FileManagerModel.prototype.file;
|
|
2454
2503
|
/** @type {?} */
|
|
2455
|
-
|
|
2504
|
+
FileManagerModel.prototype.name;
|
|
2456
2505
|
/** @type {?} */
|
|
2457
|
-
|
|
2506
|
+
FileManagerModel.prototype.description;
|
|
2458
2507
|
/** @type {?} */
|
|
2459
|
-
|
|
2460
|
-
|
|
2508
|
+
FileManagerModel.prototype.apiBaseUrl;
|
|
2509
|
+
/**
|
|
2510
|
+
* @type {?}
|
|
2511
|
+
* @private
|
|
2512
|
+
*/
|
|
2513
|
+
FileManagerModel.prototype.http;
|
|
2514
|
+
/** @type {?} */
|
|
2515
|
+
FileManagerModel.prototype.global;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2461
2518
|
/**
|
|
2462
|
-
* @
|
|
2519
|
+
* @fileoverview added by tsickle
|
|
2520
|
+
* Generated from: lib/shared/file-manager/services/file-manager.service.ts
|
|
2521
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2463
2522
|
*/
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
/** @type {?} */
|
|
2475
|
-
DownloadProgress.prototype.status;
|
|
2476
|
-
}
|
|
2477
|
-
class OfflineStorageService {
|
|
2478
|
-
constructor() {
|
|
2479
|
-
this.DB_NAME = 'AsapOfflineCoursesDB';
|
|
2480
|
-
this.DB_VERSION = 1;
|
|
2481
|
-
this.STORE_LESSONS = 'lessons';
|
|
2482
|
-
this.STORE_SYNC_QUEUE = 'sync_queue';
|
|
2483
|
-
this.db = null;
|
|
2484
|
-
this.isOnlineSubject = new BehaviorSubject(navigator.onLine);
|
|
2485
|
-
this.isOnline$ = this.isOnlineSubject.asObservable();
|
|
2486
|
-
this.downloadProgress$ = new BehaviorSubject({});
|
|
2487
|
-
this.downloadedLessons$ = new BehaviorSubject([]);
|
|
2488
|
-
this.initNetworkListeners();
|
|
2489
|
-
this.initDatabase().then((/**
|
|
2490
|
-
* @return {?}
|
|
2491
|
-
*/
|
|
2492
|
-
() => {
|
|
2493
|
-
this.refreshDownloadedLessons();
|
|
2494
|
-
if (navigator.onLine) {
|
|
2495
|
-
this.processSyncQueue();
|
|
2496
|
-
}
|
|
2497
|
-
}));
|
|
2523
|
+
class FileManagerService {
|
|
2524
|
+
/**
|
|
2525
|
+
* @param {?} fileManagerModel
|
|
2526
|
+
* @param {?} httpClient
|
|
2527
|
+
* @param {?} global
|
|
2528
|
+
*/
|
|
2529
|
+
constructor(fileManagerModel, httpClient, global) {
|
|
2530
|
+
this.fileManagerModel = fileManagerModel;
|
|
2531
|
+
this.httpClient = httpClient;
|
|
2532
|
+
this.global = global;
|
|
2498
2533
|
}
|
|
2499
2534
|
/**
|
|
2500
|
-
* @
|
|
2535
|
+
* @param {?} data
|
|
2501
2536
|
* @return {?}
|
|
2502
2537
|
*/
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
* @return {?}
|
|
2506
|
-
*/
|
|
2507
|
-
() => true))), fromEvent(window, 'offline').pipe(map((/**
|
|
2508
|
-
* @return {?}
|
|
2509
|
-
*/
|
|
2510
|
-
() => false)))).subscribe((/**
|
|
2511
|
-
* @param {?} online
|
|
2512
|
-
* @return {?}
|
|
2513
|
-
*/
|
|
2514
|
-
(online) => {
|
|
2515
|
-
this.isOnlineSubject.next(online);
|
|
2516
|
-
if (online) {
|
|
2517
|
-
console.log('[OfflineStorageService] Conexão restabelecida! Processando fila de sincronização...');
|
|
2518
|
-
this.processSyncQueue();
|
|
2519
|
-
}
|
|
2520
|
-
else {
|
|
2521
|
-
console.warn('[OfflineStorageService] Aplicação operando em MODO OFFLINE.');
|
|
2522
|
-
}
|
|
2523
|
-
}));
|
|
2538
|
+
uploadFile(data) {
|
|
2539
|
+
return this.fileManagerModel.uploadFile(this.serialize(data));
|
|
2524
2540
|
}
|
|
2525
2541
|
/**
|
|
2526
|
-
* @
|
|
2542
|
+
* @param {?} id
|
|
2527
2543
|
* @return {?}
|
|
2528
2544
|
*/
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
if (this.db) {
|
|
2537
|
-
return resolve(this.db);
|
|
2538
|
-
}
|
|
2539
|
-
if (!('indexedDB' in window)) {
|
|
2540
|
-
console.error('[OfflineStorageService] IndexedDB não é suportado neste navegador.');
|
|
2541
|
-
return reject(new Error('IndexedDB não suportado'));
|
|
2542
|
-
}
|
|
2543
|
-
/** @type {?} */
|
|
2544
|
-
const request = indexedDB.open(this.DB_NAME, this.DB_VERSION);
|
|
2545
|
-
request.onupgradeneeded = (/**
|
|
2546
|
-
* @param {?} event
|
|
2547
|
-
* @return {?}
|
|
2548
|
-
*/
|
|
2549
|
-
(event) => {
|
|
2550
|
-
/** @type {?} */
|
|
2551
|
-
const db = (/** @type {?} */ (event.target.result));
|
|
2552
|
-
if (!db.objectStoreNames.contains(this.STORE_LESSONS)) {
|
|
2553
|
-
/** @type {?} */
|
|
2554
|
-
const lessonStore = db.createObjectStore(this.STORE_LESSONS, { keyPath: 'id' });
|
|
2555
|
-
lessonStore.createIndex('trailId', 'trailId', { unique: false });
|
|
2556
|
-
lessonStore.createIndex('downloadedAt', 'downloadedAt', { unique: false });
|
|
2557
|
-
}
|
|
2558
|
-
if (!db.objectStoreNames.contains(this.STORE_SYNC_QUEUE)) {
|
|
2559
|
-
/** @type {?} */
|
|
2560
|
-
const syncStore = db.createObjectStore(this.STORE_SYNC_QUEUE, { keyPath: 'id', autoIncrement: true });
|
|
2561
|
-
syncStore.createIndex('createdAt', 'createdAt', { unique: false });
|
|
2562
|
-
}
|
|
2563
|
-
});
|
|
2564
|
-
request.onsuccess = (/**
|
|
2565
|
-
* @param {?} event
|
|
2566
|
-
* @return {?}
|
|
2567
|
-
*/
|
|
2568
|
-
(event) => {
|
|
2569
|
-
this.db = (/** @type {?} */ (event.target.result));
|
|
2570
|
-
if (navigator.storage && navigator.storage.persist) {
|
|
2571
|
-
navigator.storage.persist().then((/**
|
|
2572
|
-
* @param {?} persistent
|
|
2573
|
-
* @return {?}
|
|
2574
|
-
*/
|
|
2575
|
-
persistent => {
|
|
2576
|
-
console.log(`[OfflineStorageService] Armazenamento persistente: ${persistent ? 'Ativado' : 'Padrão'}`);
|
|
2577
|
-
}));
|
|
2578
|
-
}
|
|
2579
|
-
resolve(this.db);
|
|
2580
|
-
});
|
|
2581
|
-
request.onerror = (/**
|
|
2582
|
-
* @param {?} event
|
|
2583
|
-
* @return {?}
|
|
2584
|
-
*/
|
|
2585
|
-
(event) => {
|
|
2586
|
-
console.error('[OfflineStorageService] Erro ao abrir IndexedDB:', event.target.error);
|
|
2587
|
-
reject(event.target.error);
|
|
2588
|
-
});
|
|
2589
|
-
}));
|
|
2545
|
+
removeFile(id) {
|
|
2546
|
+
if (id) {
|
|
2547
|
+
return this.fileManagerModel.deleteFile(id);
|
|
2548
|
+
}
|
|
2549
|
+
else {
|
|
2550
|
+
return null;
|
|
2551
|
+
}
|
|
2590
2552
|
}
|
|
2591
2553
|
/**
|
|
2592
|
-
* @param {?} lessonData
|
|
2593
2554
|
* @return {?}
|
|
2594
2555
|
*/
|
|
2595
|
-
|
|
2596
|
-
return
|
|
2597
|
-
/** @type {?} */
|
|
2598
|
-
const db = yield this.initDatabase();
|
|
2599
|
-
/** @type {?} */
|
|
2600
|
-
const stageId = String(lessonData.id);
|
|
2601
|
-
this.updateProgress(stageId, 0, 0, 100, 'downloading');
|
|
2602
|
-
/** @type {?} */
|
|
2603
|
-
let videoBlob;
|
|
2604
|
-
/** @type {?} */
|
|
2605
|
-
let sizeBytes = JSON.stringify(lessonData.stageData || {}).length;
|
|
2606
|
-
/** @type {?} */
|
|
2607
|
-
let targetVideoUrl = lessonData.videoUrl;
|
|
2608
|
-
// Se for Vimeo ou YouTube (onde o navegador não consegue baixar direto pelo frontend sem endpoint backend),
|
|
2609
|
-
// utiliza uma URL de vídeo MP4 com CORS aberto garantido (GitHub Raw / MDN) para o teste offline
|
|
2610
|
-
if (!targetVideoUrl || targetVideoUrl.includes('youtube.com') || targetVideoUrl.includes('vimeo.com')) {
|
|
2611
|
-
targetVideoUrl = 'https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4';
|
|
2612
|
-
}
|
|
2613
|
-
if (targetVideoUrl) {
|
|
2614
|
-
try {
|
|
2615
|
-
videoBlob = yield this.fetchBlobWithProgress(targetVideoUrl, stageId);
|
|
2616
|
-
if (videoBlob) {
|
|
2617
|
-
sizeBytes += videoBlob.size;
|
|
2618
|
-
console.log(`[OfflineStorageService] Vídeo baixado com sucesso! Tamanho: ${this.formatBytes(videoBlob.size)}`);
|
|
2619
|
-
}
|
|
2620
|
-
}
|
|
2621
|
-
catch (err) {
|
|
2622
|
-
console.warn('[OfflineStorageService] Tentando URL alternativa para download de teste...', err);
|
|
2623
|
-
try {
|
|
2624
|
-
videoBlob = yield this.fetchBlobWithProgress('https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4', stageId);
|
|
2625
|
-
if (videoBlob) {
|
|
2626
|
-
sizeBytes += videoBlob.size;
|
|
2627
|
-
}
|
|
2628
|
-
}
|
|
2629
|
-
catch (e2) {
|
|
2630
|
-
console.warn('[OfflineStorageService] Falha ao baixar vídeo direto:', e2);
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
/** @type {?} */
|
|
2635
|
-
const downloadedItem = {
|
|
2636
|
-
id: lessonData.id,
|
|
2637
|
-
trailId: lessonData.trailId,
|
|
2638
|
-
title: lessonData.title,
|
|
2639
|
-
subtitle: lessonData.subtitle || '',
|
|
2640
|
-
thumbnail: lessonData.thumbnail || '',
|
|
2641
|
-
sizeBytes: sizeBytes,
|
|
2642
|
-
sizeFormatted: this.formatBytes(sizeBytes),
|
|
2643
|
-
downloadedAt: new Date(),
|
|
2644
|
-
stageData: lessonData.stageData,
|
|
2645
|
-
stages: lessonData.stages || [],
|
|
2646
|
-
videoBlob: videoBlob,
|
|
2647
|
-
videoMimeType: videoBlob ? videoBlob.type : 'video/mp4'
|
|
2648
|
-
};
|
|
2649
|
-
return new Promise((/**
|
|
2650
|
-
* @param {?} resolve
|
|
2651
|
-
* @param {?} reject
|
|
2652
|
-
* @return {?}
|
|
2653
|
-
*/
|
|
2654
|
-
(resolve, reject) => {
|
|
2655
|
-
/** @type {?} */
|
|
2656
|
-
const transaction = db.transaction([this.STORE_LESSONS], 'readwrite');
|
|
2657
|
-
/** @type {?} */
|
|
2658
|
-
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
2659
|
-
/** @type {?} */
|
|
2660
|
-
const request = store.put(downloadedItem);
|
|
2661
|
-
request.onsuccess = (/**
|
|
2662
|
-
* @return {?}
|
|
2663
|
-
*/
|
|
2664
|
-
() => {
|
|
2665
|
-
this.updateProgress(stageId, 100, sizeBytes, sizeBytes, 'completed');
|
|
2666
|
-
this.refreshDownloadedLessons();
|
|
2667
|
-
resolve(downloadedItem);
|
|
2668
|
-
});
|
|
2669
|
-
request.onerror = (/**
|
|
2670
|
-
* @param {?} event
|
|
2671
|
-
* @return {?}
|
|
2672
|
-
*/
|
|
2673
|
-
(event) => {
|
|
2674
|
-
this.updateProgress(stageId, 0, 0, 0, 'error');
|
|
2675
|
-
reject(event.target.error);
|
|
2676
|
-
});
|
|
2677
|
-
}));
|
|
2678
|
-
});
|
|
2556
|
+
findFileCollection() {
|
|
2557
|
+
return this.fileManagerModel.getAll();
|
|
2679
2558
|
}
|
|
2680
2559
|
/**
|
|
2681
|
-
* @
|
|
2682
|
-
* @param {?} url
|
|
2683
|
-
* @param {?} stageId
|
|
2560
|
+
* @param {?} data
|
|
2684
2561
|
* @return {?}
|
|
2685
2562
|
*/
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
/** @type {?} */
|
|
2694
|
-
const xhr = new XMLHttpRequest();
|
|
2695
|
-
xhr.open('GET', url, true);
|
|
2696
|
-
xhr.responseType = 'blob';
|
|
2697
|
-
xhr.onprogress = (/**
|
|
2698
|
-
* @param {?} event
|
|
2699
|
-
* @return {?}
|
|
2700
|
-
*/
|
|
2701
|
-
(event) => {
|
|
2702
|
-
if (event.lengthComputable) {
|
|
2703
|
-
/** @type {?} */
|
|
2704
|
-
const progress = Math.round((event.loaded / event.total) * 100);
|
|
2705
|
-
this.updateProgress(stageId, progress, event.loaded, event.total, 'downloading');
|
|
2706
|
-
}
|
|
2707
|
-
});
|
|
2708
|
-
xhr.onload = (/**
|
|
2709
|
-
* @return {?}
|
|
2710
|
-
*/
|
|
2711
|
-
() => {
|
|
2712
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
2713
|
-
resolve(xhr.response);
|
|
2714
|
-
}
|
|
2715
|
-
else {
|
|
2716
|
-
reject(new Error(`Falha no download do vídeo HTTP status ${xhr.status}`));
|
|
2717
|
-
}
|
|
2718
|
-
});
|
|
2719
|
-
xhr.onerror = (/**
|
|
2720
|
-
* @return {?}
|
|
2721
|
-
*/
|
|
2722
|
-
() => {
|
|
2723
|
-
reject(new Error('Erro de rede ou CORS durante o download do vídeo.'));
|
|
2724
|
-
});
|
|
2725
|
-
xhr.send();
|
|
2726
|
-
}));
|
|
2563
|
+
serialize(data) {
|
|
2564
|
+
/** @type {?} */
|
|
2565
|
+
const fileManager = new FileManagerModel(this.httpClient, this.global);
|
|
2566
|
+
fileManager.name = data.name;
|
|
2567
|
+
fileManager.file = data;
|
|
2568
|
+
fileManager.description = data.type;
|
|
2569
|
+
return fileManager;
|
|
2727
2570
|
}
|
|
2571
|
+
}
|
|
2572
|
+
FileManagerService.decorators = [
|
|
2573
|
+
{ type: Injectable }
|
|
2574
|
+
];
|
|
2575
|
+
/** @nocollapse */
|
|
2576
|
+
FileManagerService.ctorParameters = () => [
|
|
2577
|
+
{ type: FileManagerModel },
|
|
2578
|
+
{ type: HttpClient },
|
|
2579
|
+
{ type: Global }
|
|
2580
|
+
];
|
|
2581
|
+
if (false) {
|
|
2728
2582
|
/**
|
|
2583
|
+
* @type {?}
|
|
2729
2584
|
* @private
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
* @
|
|
2734
|
-
* @
|
|
2585
|
+
*/
|
|
2586
|
+
FileManagerService.prototype.fileManagerModel;
|
|
2587
|
+
/**
|
|
2588
|
+
* @type {?}
|
|
2589
|
+
* @private
|
|
2590
|
+
*/
|
|
2591
|
+
FileManagerService.prototype.httpClient;
|
|
2592
|
+
/** @type {?} */
|
|
2593
|
+
FileManagerService.prototype.global;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
/**
|
|
2597
|
+
* @fileoverview added by tsickle
|
|
2598
|
+
* Generated from: lib/shared/file-manager/containers/file-manager/file-manager.component.ts
|
|
2599
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2600
|
+
*/
|
|
2601
|
+
class FileManagerComponent {
|
|
2602
|
+
/**
|
|
2603
|
+
* @param {?} _fileManagerService
|
|
2604
|
+
* @param {?} translate
|
|
2605
|
+
*/
|
|
2606
|
+
constructor(_fileManagerService, translate) {
|
|
2607
|
+
this._fileManagerService = _fileManagerService;
|
|
2608
|
+
this.translate = translate;
|
|
2609
|
+
this.event = new EventEmitter();
|
|
2610
|
+
this.progress = { percentage: 0 };
|
|
2611
|
+
this.loading = false;
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2735
2614
|
* @return {?}
|
|
2736
2615
|
*/
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
const current = this.downloadProgress$.value;
|
|
2740
|
-
this.downloadProgress$.next(Object.assign({}, current, { [stageId]: { stageId, progress, loaded, total, status } }));
|
|
2616
|
+
ngOnInit() {
|
|
2617
|
+
this.findAll();
|
|
2741
2618
|
}
|
|
2742
2619
|
/**
|
|
2743
|
-
* @param {?} lessonId
|
|
2744
2620
|
* @return {?}
|
|
2745
2621
|
*/
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
try {
|
|
2749
|
-
/** @type {?} */
|
|
2750
|
-
const lesson = yield this.getDownloadedLesson(lessonId);
|
|
2751
|
-
return !!lesson;
|
|
2752
|
-
}
|
|
2753
|
-
catch (_a) {
|
|
2754
|
-
return false;
|
|
2755
|
-
}
|
|
2756
|
-
});
|
|
2622
|
+
showModal() {
|
|
2623
|
+
$('#appFileManager').modal('show');
|
|
2757
2624
|
}
|
|
2758
2625
|
/**
|
|
2759
|
-
* @param {?} lessonId
|
|
2760
2626
|
* @return {?}
|
|
2761
2627
|
*/
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
/** @type {?} */
|
|
2765
|
-
const db = yield this.initDatabase();
|
|
2766
|
-
return new Promise((/**
|
|
2767
|
-
* @param {?} resolve
|
|
2768
|
-
* @param {?} reject
|
|
2769
|
-
* @return {?}
|
|
2770
|
-
*/
|
|
2771
|
-
(resolve, reject) => {
|
|
2772
|
-
/** @type {?} */
|
|
2773
|
-
const transaction = db.transaction([this.STORE_LESSONS], 'readonly');
|
|
2774
|
-
/** @type {?} */
|
|
2775
|
-
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
2776
|
-
/** @type {?} */
|
|
2777
|
-
const req1 = store.get(lessonId);
|
|
2778
|
-
req1.onsuccess = (/**
|
|
2779
|
-
* @return {?}
|
|
2780
|
-
*/
|
|
2781
|
-
() => {
|
|
2782
|
-
if (req1.result) {
|
|
2783
|
-
return resolve(req1.result);
|
|
2784
|
-
}
|
|
2785
|
-
// Tenta a variação string/número
|
|
2786
|
-
/** @type {?} */
|
|
2787
|
-
const altKey = typeof lessonId === 'number' ? String(lessonId) : Number(lessonId);
|
|
2788
|
-
if (!isNaN((/** @type {?} */ (altKey)))) {
|
|
2789
|
-
/** @type {?} */
|
|
2790
|
-
const req2 = store.get(altKey);
|
|
2791
|
-
req2.onsuccess = (/**
|
|
2792
|
-
* @return {?}
|
|
2793
|
-
*/
|
|
2794
|
-
() => {
|
|
2795
|
-
if (req2.result) {
|
|
2796
|
-
return resolve(req2.result);
|
|
2797
|
-
}
|
|
2798
|
-
// Fallback: busca por comparação em getAll
|
|
2799
|
-
/** @type {?} */
|
|
2800
|
-
const reqAll = store.getAll();
|
|
2801
|
-
reqAll.onsuccess = (/**
|
|
2802
|
-
* @return {?}
|
|
2803
|
-
*/
|
|
2804
|
-
() => {
|
|
2805
|
-
/** @type {?} */
|
|
2806
|
-
const all = reqAll.result || [];
|
|
2807
|
-
/** @type {?} */
|
|
2808
|
-
const found = all.find((/**
|
|
2809
|
-
* @param {?} item
|
|
2810
|
-
* @return {?}
|
|
2811
|
-
*/
|
|
2812
|
-
item => String(item.id) === String(lessonId)));
|
|
2813
|
-
resolve(found || null);
|
|
2814
|
-
});
|
|
2815
|
-
reqAll.onerror = (/**
|
|
2816
|
-
* @return {?}
|
|
2817
|
-
*/
|
|
2818
|
-
() => resolve(null));
|
|
2819
|
-
});
|
|
2820
|
-
req2.onerror = (/**
|
|
2821
|
-
* @return {?}
|
|
2822
|
-
*/
|
|
2823
|
-
() => resolve(null));
|
|
2824
|
-
}
|
|
2825
|
-
else {
|
|
2826
|
-
resolve(null);
|
|
2827
|
-
}
|
|
2828
|
-
});
|
|
2829
|
-
req1.onerror = (/**
|
|
2830
|
-
* @return {?}
|
|
2831
|
-
*/
|
|
2832
|
-
() => {
|
|
2833
|
-
resolve(null);
|
|
2834
|
-
});
|
|
2835
|
-
}));
|
|
2836
|
-
});
|
|
2628
|
+
closeModal() {
|
|
2629
|
+
$('#appFileManager').modal('hide');
|
|
2837
2630
|
}
|
|
2838
2631
|
/**
|
|
2839
|
-
* @param {?}
|
|
2632
|
+
* @param {?} $event
|
|
2840
2633
|
* @return {?}
|
|
2841
2634
|
*/
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2635
|
+
onChange($event) {
|
|
2636
|
+
if ($event && this.whiteListUploads($event.target.files[0].type)) {
|
|
2637
|
+
this.selectedFile = $event.target.files[0];
|
|
2638
|
+
}
|
|
2639
|
+
else {
|
|
2640
|
+
swal({
|
|
2641
|
+
type: 'error',
|
|
2642
|
+
title: this.translate.instant('ErrorLoadingFile'),
|
|
2643
|
+
text: this.translate.instant('MakeSureTheFileHasTheAllowedFormat'),
|
|
2644
|
+
buttonsStyling: false,
|
|
2645
|
+
confirmButtonClass: 'btn btn-success'
|
|
2646
|
+
});
|
|
2647
|
+
$('#file').val('');
|
|
2648
|
+
}
|
|
2854
2649
|
}
|
|
2855
2650
|
/**
|
|
2651
|
+
* @private
|
|
2652
|
+
* @param {?} fileType
|
|
2856
2653
|
* @return {?}
|
|
2857
2654
|
*/
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2655
|
+
whiteListUploads(fileType) {
|
|
2656
|
+
switch (fileType) {
|
|
2657
|
+
case 'image/png':
|
|
2658
|
+
return true;
|
|
2659
|
+
case 'image/jpeg':
|
|
2660
|
+
return true;
|
|
2661
|
+
case 'image/jpg':
|
|
2662
|
+
return true;
|
|
2663
|
+
case 'image/gif':
|
|
2664
|
+
return true;
|
|
2665
|
+
case 'image/png':
|
|
2666
|
+
return true;
|
|
2667
|
+
case 'application/msword':
|
|
2668
|
+
return true;
|
|
2669
|
+
case 'application/pdf':
|
|
2670
|
+
return true;
|
|
2671
|
+
case 'application/zip':
|
|
2672
|
+
return true;
|
|
2673
|
+
case 'video/x-flv':
|
|
2674
|
+
return true;
|
|
2675
|
+
case 'video/mp4':
|
|
2676
|
+
return true;
|
|
2677
|
+
case 'application/x-mpegURL':
|
|
2678
|
+
return true;
|
|
2679
|
+
case 'video/MP2T':
|
|
2680
|
+
return true;
|
|
2681
|
+
case 'video/3gpp':
|
|
2682
|
+
return true;
|
|
2683
|
+
case 'video/quicktime':
|
|
2684
|
+
return true;
|
|
2685
|
+
case 'video/x-msvideo':
|
|
2686
|
+
return true;
|
|
2687
|
+
case 'video/x-ms-wmv':
|
|
2688
|
+
return true;
|
|
2689
|
+
default:
|
|
2690
|
+
return false;
|
|
2691
|
+
}
|
|
2889
2692
|
}
|
|
2890
2693
|
/**
|
|
2891
2694
|
* @return {?}
|
|
2892
2695
|
*/
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2696
|
+
submit() {
|
|
2697
|
+
this.progress.percentage = 0;
|
|
2698
|
+
this.loading = true;
|
|
2699
|
+
this._fileManagerService.uploadFile(this.selectedFile)
|
|
2700
|
+
.subscribe((/**
|
|
2701
|
+
* @param {?} event
|
|
2702
|
+
* @return {?}
|
|
2703
|
+
*/
|
|
2704
|
+
event => {
|
|
2705
|
+
if (event.type === HttpEventType.UploadProgress) {
|
|
2706
|
+
this.progress.percentage = Math.round(100 * event.loaded / event.total);
|
|
2899
2707
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
2708
|
+
else if (event instanceof HttpResponse) {
|
|
2709
|
+
this.event.emit(event.body.data);
|
|
2710
|
+
this.loading = false;
|
|
2711
|
+
this.closeModal();
|
|
2902
2712
|
}
|
|
2903
|
-
});
|
|
2713
|
+
}));
|
|
2714
|
+
this.selectedFile = undefined;
|
|
2904
2715
|
}
|
|
2905
2716
|
/**
|
|
2906
|
-
* @param {?} lessonId
|
|
2907
2717
|
* @return {?}
|
|
2908
2718
|
*/
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
/**
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
(resolve, reject) => {
|
|
2919
|
-
/** @type {?} */
|
|
2920
|
-
const transaction = db.transaction([this.STORE_LESSONS], 'readwrite');
|
|
2921
|
-
/** @type {?} */
|
|
2922
|
-
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
2923
|
-
/** @type {?} */
|
|
2924
|
-
const request = store.delete(lessonId);
|
|
2925
|
-
request.onsuccess = (/**
|
|
2926
|
-
* @return {?}
|
|
2927
|
-
*/
|
|
2928
|
-
() => {
|
|
2929
|
-
this.refreshDownloadedLessons();
|
|
2930
|
-
resolve(true);
|
|
2931
|
-
});
|
|
2932
|
-
request.onerror = (/**
|
|
2933
|
-
* @param {?} event
|
|
2934
|
-
* @return {?}
|
|
2935
|
-
*/
|
|
2936
|
-
(event) => {
|
|
2937
|
-
reject(event.target.error);
|
|
2938
|
-
});
|
|
2939
|
-
}));
|
|
2940
|
-
});
|
|
2719
|
+
findAll() {
|
|
2720
|
+
this._fileManagerService.findFileCollection()
|
|
2721
|
+
.subscribe((/**
|
|
2722
|
+
* @param {?} res
|
|
2723
|
+
* @return {?}
|
|
2724
|
+
*/
|
|
2725
|
+
(res) => {
|
|
2726
|
+
this.fileList = res.data;
|
|
2727
|
+
}));
|
|
2941
2728
|
}
|
|
2942
2729
|
/**
|
|
2730
|
+
* @param {?} item
|
|
2943
2731
|
* @return {?}
|
|
2944
2732
|
*/
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
const db = yield this.initDatabase();
|
|
2949
|
-
return new Promise((/**
|
|
2950
|
-
* @param {?} resolve
|
|
2951
|
-
* @param {?} reject
|
|
2952
|
-
* @return {?}
|
|
2953
|
-
*/
|
|
2954
|
-
(resolve, reject) => {
|
|
2955
|
-
/** @type {?} */
|
|
2956
|
-
const transaction = db.transaction([this.STORE_LESSONS], 'readwrite');
|
|
2957
|
-
/** @type {?} */
|
|
2958
|
-
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
2959
|
-
/** @type {?} */
|
|
2960
|
-
const request = store.clear();
|
|
2961
|
-
request.onsuccess = (/**
|
|
2962
|
-
* @return {?}
|
|
2963
|
-
*/
|
|
2964
|
-
() => {
|
|
2965
|
-
this.refreshDownloadedLessons();
|
|
2966
|
-
resolve(true);
|
|
2967
|
-
});
|
|
2968
|
-
request.onerror = (/**
|
|
2969
|
-
* @param {?} event
|
|
2970
|
-
* @return {?}
|
|
2971
|
-
*/
|
|
2972
|
-
(event) => {
|
|
2973
|
-
reject(event.target.error);
|
|
2974
|
-
});
|
|
2975
|
-
}));
|
|
2976
|
-
});
|
|
2977
|
-
}
|
|
2978
|
-
/**
|
|
2979
|
-
* @param {?} action
|
|
2980
|
-
* @return {?}
|
|
2981
|
-
*/
|
|
2982
|
-
queueSyncAction(action) {
|
|
2983
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2984
|
-
/** @type {?} */
|
|
2985
|
-
const db = yield this.initDatabase();
|
|
2986
|
-
return new Promise((/**
|
|
2987
|
-
* @param {?} resolve
|
|
2988
|
-
* @param {?} reject
|
|
2989
|
-
* @return {?}
|
|
2990
|
-
*/
|
|
2991
|
-
(resolve, reject) => {
|
|
2992
|
-
/** @type {?} */
|
|
2993
|
-
const transaction = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
2994
|
-
/** @type {?} */
|
|
2995
|
-
const store = transaction.objectStore(this.STORE_SYNC_QUEUE);
|
|
2996
|
-
/** @type {?} */
|
|
2997
|
-
const syncItem = Object.assign({}, action, { createdAt: new Date() });
|
|
2998
|
-
/** @type {?} */
|
|
2999
|
-
const request = store.add(syncItem);
|
|
3000
|
-
request.onsuccess = (/**
|
|
3001
|
-
* @return {?}
|
|
3002
|
-
*/
|
|
3003
|
-
() => {
|
|
3004
|
-
console.log('[OfflineStorageService] Ação salva na fila de sincronização offline:', action);
|
|
3005
|
-
resolve();
|
|
3006
|
-
});
|
|
3007
|
-
request.onerror = (/**
|
|
3008
|
-
* @param {?} event
|
|
3009
|
-
* @return {?}
|
|
3010
|
-
*/
|
|
3011
|
-
(event) => {
|
|
3012
|
-
reject(event.target.error);
|
|
3013
|
-
});
|
|
3014
|
-
}));
|
|
3015
|
-
});
|
|
3016
|
-
}
|
|
3017
|
-
/**
|
|
3018
|
-
* @return {?}
|
|
3019
|
-
*/
|
|
3020
|
-
processSyncQueue() {
|
|
3021
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3022
|
-
/** @type {?} */
|
|
3023
|
-
const db = yield this.initDatabase();
|
|
3024
|
-
return new Promise((/**
|
|
3025
|
-
* @param {?} resolve
|
|
3026
|
-
* @param {?} reject
|
|
3027
|
-
* @return {?}
|
|
3028
|
-
*/
|
|
3029
|
-
(resolve, reject) => {
|
|
3030
|
-
/** @type {?} */
|
|
3031
|
-
const transaction = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
3032
|
-
/** @type {?} */
|
|
3033
|
-
const store = transaction.objectStore(this.STORE_SYNC_QUEUE);
|
|
3034
|
-
/** @type {?} */
|
|
3035
|
-
const request = store.getAll();
|
|
3036
|
-
request.onsuccess = (/**
|
|
3037
|
-
* @return {?}
|
|
3038
|
-
*/
|
|
3039
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
3040
|
-
/** @type {?} */
|
|
3041
|
-
const items = request.result || [];
|
|
3042
|
-
if (items.length === 0) {
|
|
3043
|
-
return resolve(0);
|
|
3044
|
-
}
|
|
3045
|
-
console.log(`[OfflineStorageService] Sincronizando ${items.length} itens pendentes com o servidor...`);
|
|
3046
|
-
/** @type {?} */
|
|
3047
|
-
let syncedCount = 0;
|
|
3048
|
-
for (const item of items) {
|
|
3049
|
-
try {
|
|
3050
|
-
console.log(`[OfflineStorageService] Sincronizado: ${item.endpoint}`, item.payload);
|
|
3051
|
-
syncedCount++;
|
|
3052
|
-
}
|
|
3053
|
-
catch (err) {
|
|
3054
|
-
console.error(`[OfflineStorageService] Erro ao sincronizar item ${item.id}:`, err);
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
/** @type {?} */
|
|
3058
|
-
const clearTx = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
3059
|
-
clearTx.objectStore(this.STORE_SYNC_QUEUE).clear();
|
|
3060
|
-
resolve(syncedCount);
|
|
3061
|
-
}));
|
|
3062
|
-
request.onerror = (/**
|
|
3063
|
-
* @param {?} event
|
|
3064
|
-
* @return {?}
|
|
3065
|
-
*/
|
|
3066
|
-
(event) => {
|
|
3067
|
-
reject(event.target.error);
|
|
3068
|
-
});
|
|
3069
|
-
}));
|
|
3070
|
-
});
|
|
3071
|
-
}
|
|
3072
|
-
/**
|
|
3073
|
-
* @param {?} bytes
|
|
3074
|
-
* @param {?=} decimals
|
|
3075
|
-
* @return {?}
|
|
3076
|
-
*/
|
|
3077
|
-
formatBytes(bytes, decimals = 1) {
|
|
3078
|
-
if (!bytes || bytes === 0)
|
|
3079
|
-
return '0 MB';
|
|
3080
|
-
/** @type {?} */
|
|
3081
|
-
const k = 1024;
|
|
3082
|
-
/** @type {?} */
|
|
3083
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
3084
|
-
/** @type {?} */
|
|
3085
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
3086
|
-
/** @type {?} */
|
|
3087
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3088
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
2733
|
+
selectFile(item) {
|
|
2734
|
+
this.event.emit(item);
|
|
2735
|
+
this.closeModal();
|
|
3089
2736
|
}
|
|
3090
2737
|
/**
|
|
3091
|
-
* @param {?}
|
|
2738
|
+
* @param {?} item
|
|
3092
2739
|
* @return {?}
|
|
3093
2740
|
*/
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
* @param {?}
|
|
3098
|
-
* @param {?} curr
|
|
2741
|
+
deleteFromList(item) {
|
|
2742
|
+
this._fileManagerService.removeFile(item.id)
|
|
2743
|
+
.subscribe((/**
|
|
2744
|
+
* @param {?} res
|
|
3099
2745
|
* @return {?}
|
|
3100
2746
|
*/
|
|
3101
|
-
(
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
2747
|
+
(res) => {
|
|
2748
|
+
swal({
|
|
2749
|
+
type: 'success',
|
|
2750
|
+
title: this.translate.instant('SuccessfullyRemoved'),
|
|
2751
|
+
text: this.translate.instant('TheSelectedFileHasBeenRemovedFromTheSystem'),
|
|
2752
|
+
buttonsStyling: true,
|
|
2753
|
+
confirmButtonClass: 'btn btn-success'
|
|
2754
|
+
});
|
|
2755
|
+
this.findAll();
|
|
2756
|
+
}), (/**
|
|
2757
|
+
* @param {?} err
|
|
2758
|
+
* @return {?}
|
|
2759
|
+
*/
|
|
2760
|
+
err => {
|
|
2761
|
+
swal({
|
|
2762
|
+
type: 'error',
|
|
2763
|
+
title: this.translate.instant('ErrorRemovingFile'),
|
|
2764
|
+
text: this.translate.instant('TryAgainLater'),
|
|
2765
|
+
buttonsStyling: true,
|
|
2766
|
+
confirmButtonClass: 'btn btn-success'
|
|
2767
|
+
});
|
|
2768
|
+
}));
|
|
3106
2769
|
}
|
|
3107
2770
|
}
|
|
3108
|
-
|
|
3109
|
-
{ type:
|
|
3110
|
-
|
|
3111
|
-
|
|
2771
|
+
FileManagerComponent.decorators = [
|
|
2772
|
+
{ type: Component, args: [{
|
|
2773
|
+
selector: 'app-file-manager',
|
|
2774
|
+
exportAs: 'appFileManager',
|
|
2775
|
+
template: "<!-- Modal -->\r\n<div id=\"appFileManager\" class=\"modal fade\" role=\"dialog\" data-backdrop=\"false\" >\r\n <div class=\"modal-dialog modal-lg\">\r\n <!-- Modal content-->\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\r\n <h4 class=\"modal-title\">{{ 'FileManager' | translate }}</h4>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <div class=\"col-md-2\">\r\n <ul class=\"nav nav-pills nav-pills-icons nav-pills-primary nav-stacked\" role=\"tablist\">\r\n <!--\r\n color-classes: \"nav-pills-primary\", \"nav-pills-info\", \"nav-pills-success\", \"nav-pills-warning\",\"nav-pills-danger\"\r\n-->\r\n <li class=\"active\">\r\n <a href=\"#upload\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">backup</i> {{ 'Upload' | translate }}\r\n </a>\r\n </li>\r\n <li>\r\n <a href=\"#arquivos\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">assignment</i> {{ 'Files' | translate }}\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"col-md-10\">\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\" id=\"upload\">\r\n <div class=\"col-sm-12\">\r\n <form *ngIf=\"!loading\" class=\"text-center\">\r\n <div class=\"fileinput fileinput-new text-center\" data-provides=\"fileinput\">\r\n <div class=\"fileinput-new thumbnail preview\" style=\"width: 320px;\">\r\n <img src=\"../../assets/img/image_placeholder.jpg\" alt=\"...\">\r\n </div>\r\n <div class=\"fileinput-preview fileinput-exists thumbnail\"></div>\r\n <div>\r\n <span class=\"btn btn-primary btn-round btn-file\">\r\n <span class=\"fileinput-new\">{{ 'SelectAFile' | translate }}</span>\r\n <span class=\"fileinput-exists\">{{ 'Alter' | translate }}</span>\r\n <input ng2FileSelect (change)=\"onChange($event)\" id=\"file\" type=\"file\" name=\"...\"/>\r\n </span>\r\n <button type=\"button\" (click)=\"submit()\" class=\"fileinput-exists btn btn-primary btn-round\">\r\n {{ 'Confirm' | translate }}\r\n </button>\r\n <a href=\"#pablo\" class=\"btn btn-danger btn-round fileinput-exists\" data-dismiss=\"fileinput\"><i\r\n class=\"fa fa-times\"></i> {{ 'Remove' | translate }}</a>\r\n </div>\r\n </div>\r\n </form>\r\n <div *ngIf=\"loading\">\r\n <br>\r\n <br>\r\n <legend>{{ 'Loading...' | translate }}</legend>\r\n <div class=\"progress progress-line-primary\">\r\n <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"60\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\" [ngStyle]=\"{width: progress.percentage + '%'}\">\r\n <span class=\"sr-only\">{{ progress.percentage + '%' }} {{ 'Concluded' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"tab-pane\" id=\"arquivos\">\r\n <div class=\"col-md-12\" style=\"height: 360px; overflow: auto;\">\r\n <div class=\"table-responsive\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'Date' | translate }}</th>\r\n <th>{{ 'File' | translate }}</th>\r\n <th>{{ 'Actions' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of fileList\">\r\n <td>{{ item.updated_at.date | date: 'dd/MM/yyyy' }}</td>\r\n <td>{{ item.name }}</td>\r\n <td class=\"td-actions text-right\">\r\n <button (click)=\"selectFile(item)\" type=\"button\" class=\"btn btn-success\">\r\n <i class=\"material-icons\">check</i>\r\n </button>\r\n <button (click)=\"deleteFromList(item)\" type=\"button\" class=\"btn btn-danger\">\r\n <i class=\"material-icons\">close</i>\r\n </button>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!--<div class=\"modal-footer\">-->\r\n <!--<button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">Confirmar</button>-->\r\n <!--<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Fechar</button>-->\r\n <!--</div>-->\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
2776
|
+
providers: [FileManagerService, FileManagerModel],
|
|
2777
|
+
styles: [".fileinput .thumbnail{max-width:100%!important;height:240px}.modal-content{min-height:450px}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}"]
|
|
2778
|
+
}] }
|
|
3112
2779
|
];
|
|
3113
2780
|
/** @nocollapse */
|
|
3114
|
-
|
|
3115
|
-
|
|
2781
|
+
FileManagerComponent.ctorParameters = () => [
|
|
2782
|
+
{ type: FileManagerService },
|
|
2783
|
+
{ type: TranslateService }
|
|
2784
|
+
];
|
|
2785
|
+
FileManagerComponent.propDecorators = {
|
|
2786
|
+
event: [{ type: Output }]
|
|
2787
|
+
};
|
|
3116
2788
|
if (false) {
|
|
2789
|
+
/** @type {?} */
|
|
2790
|
+
FileManagerComponent.prototype.event;
|
|
2791
|
+
/** @type {?} */
|
|
2792
|
+
FileManagerComponent.prototype.selectedFile;
|
|
2793
|
+
/** @type {?} */
|
|
2794
|
+
FileManagerComponent.prototype.progress;
|
|
2795
|
+
/** @type {?} */
|
|
2796
|
+
FileManagerComponent.prototype.loading;
|
|
2797
|
+
/** @type {?} */
|
|
2798
|
+
FileManagerComponent.prototype.fileList;
|
|
3117
2799
|
/**
|
|
3118
2800
|
* @type {?}
|
|
3119
2801
|
* @private
|
|
3120
2802
|
*/
|
|
3121
|
-
|
|
3122
|
-
/**
|
|
3123
|
-
* @type {?}
|
|
3124
|
-
* @private
|
|
3125
|
-
*/
|
|
3126
|
-
OfflineStorageService.prototype.DB_VERSION;
|
|
3127
|
-
/**
|
|
3128
|
-
* @type {?}
|
|
3129
|
-
* @private
|
|
3130
|
-
*/
|
|
3131
|
-
OfflineStorageService.prototype.STORE_LESSONS;
|
|
3132
|
-
/**
|
|
3133
|
-
* @type {?}
|
|
3134
|
-
* @private
|
|
3135
|
-
*/
|
|
3136
|
-
OfflineStorageService.prototype.STORE_SYNC_QUEUE;
|
|
3137
|
-
/**
|
|
3138
|
-
* @type {?}
|
|
3139
|
-
* @private
|
|
3140
|
-
*/
|
|
3141
|
-
OfflineStorageService.prototype.db;
|
|
2803
|
+
FileManagerComponent.prototype._fileManagerService;
|
|
3142
2804
|
/**
|
|
3143
2805
|
* @type {?}
|
|
3144
2806
|
* @private
|
|
3145
2807
|
*/
|
|
3146
|
-
|
|
3147
|
-
/** @type {?} */
|
|
3148
|
-
OfflineStorageService.prototype.isOnline$;
|
|
3149
|
-
/** @type {?} */
|
|
3150
|
-
OfflineStorageService.prototype.downloadProgress$;
|
|
3151
|
-
/** @type {?} */
|
|
3152
|
-
OfflineStorageService.prototype.downloadedLessons$;
|
|
2808
|
+
FileManagerComponent.prototype.translate;
|
|
3153
2809
|
}
|
|
3154
2810
|
|
|
3155
2811
|
/**
|
|
3156
2812
|
* @fileoverview added by tsickle
|
|
3157
|
-
* Generated from: lib
|
|
2813
|
+
* Generated from: lib/shared/file-manager/containers/file-manager-directive/file-manager.directive.ts
|
|
3158
2814
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3159
2815
|
*/
|
|
3160
|
-
class
|
|
3161
|
-
/**
|
|
3162
|
-
* @param {?} offlineService
|
|
3163
|
-
*/
|
|
3164
|
-
constructor(offlineService) {
|
|
3165
|
-
this.offlineService = offlineService;
|
|
3166
|
-
}
|
|
3167
|
-
/**
|
|
3168
|
-
* @param {?} request
|
|
3169
|
-
* @param {?} next
|
|
3170
|
-
* @return {?}
|
|
3171
|
-
*/
|
|
3172
|
-
intercept(request, next) {
|
|
3173
|
-
return next.handle(request).pipe(catchError((/**
|
|
3174
|
-
* @param {?} error
|
|
3175
|
-
* @return {?}
|
|
3176
|
-
*/
|
|
3177
|
-
(error) => {
|
|
3178
|
-
return this.handleOfflineFallback(request, error);
|
|
3179
|
-
})));
|
|
3180
|
-
}
|
|
3181
|
-
/**
|
|
3182
|
-
* @private
|
|
3183
|
-
* @param {?} request
|
|
3184
|
-
* @param {?} originalError
|
|
3185
|
-
* @return {?}
|
|
3186
|
-
*/
|
|
3187
|
-
handleOfflineFallback(request, originalError) {
|
|
3188
|
-
/** @type {?} */
|
|
3189
|
-
const url = request.url;
|
|
3190
|
-
// 1. Intercepta chamadas POST/PUT de progresso, anotações, tempo e salva na fila offline
|
|
3191
|
-
if (request.method === 'POST' || request.method === 'PUT') {
|
|
3192
|
-
if (url.includes('/progresso') ||
|
|
3193
|
-
url.includes('/tempo') ||
|
|
3194
|
-
url.includes('/multiple') ||
|
|
3195
|
-
url.includes('/anotacoes') ||
|
|
3196
|
-
url.includes('/conteudo/vote')) {
|
|
3197
|
-
/** @type {?} */
|
|
3198
|
-
let actionType = 'stage_progress';
|
|
3199
|
-
if (url.includes('/tempo')) {
|
|
3200
|
-
actionType = 'video_progress';
|
|
3201
|
-
}
|
|
3202
|
-
else if (url.includes('/anotacoes')) {
|
|
3203
|
-
actionType = 'notes';
|
|
3204
|
-
}
|
|
3205
|
-
this.offlineService.queueSyncAction({
|
|
3206
|
-
type: actionType,
|
|
3207
|
-
endpoint: url,
|
|
3208
|
-
payload: request.body || {}
|
|
3209
|
-
});
|
|
3210
|
-
console.log('[OfflineHttpInterceptor] Requisição POST/PUT interceptada e salva na fila de sincronização:', url);
|
|
3211
|
-
return of(new HttpResponse({
|
|
3212
|
-
status: 200,
|
|
3213
|
-
statusText: 'OK (Offline Queued)',
|
|
3214
|
-
body: { status: true, success: true, queued: true, message: 'Ação salva offline' }
|
|
3215
|
-
}));
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
// 2. Intercepta requisições GET de conteúdo ou etapas
|
|
3219
|
-
if (request.method === 'GET') {
|
|
3220
|
-
/** @type {?} */
|
|
3221
|
-
const matches = url.match(/\/(\d+)(?:$|\/|\?)/);
|
|
3222
|
-
if (matches && matches[1]) {
|
|
3223
|
-
/** @type {?} */
|
|
3224
|
-
const id = matches[1];
|
|
3225
|
-
return from(this.offlineService.getDownloadedLesson(id)).pipe(switchMap((/**
|
|
3226
|
-
* @param {?} lesson
|
|
3227
|
-
* @return {?}
|
|
3228
|
-
*/
|
|
3229
|
-
lesson => {
|
|
3230
|
-
if (lesson) {
|
|
3231
|
-
console.log('[OfflineHttpInterceptor] Resposta offline fornecida para:', url);
|
|
3232
|
-
/** @type {?} */
|
|
3233
|
-
const dataValue = Array.isArray(lesson.stageData) ? lesson.stageData : [lesson.stageData];
|
|
3234
|
-
return of(new HttpResponse({
|
|
3235
|
-
status: 200,
|
|
3236
|
-
statusText: 'OK (Offline Cache)',
|
|
3237
|
-
body: {
|
|
3238
|
-
status: true,
|
|
3239
|
-
data: [{
|
|
3240
|
-
id: lesson.id,
|
|
3241
|
-
title: lesson.title,
|
|
3242
|
-
value: dataValue
|
|
3243
|
-
}]
|
|
3244
|
-
}
|
|
3245
|
-
}));
|
|
3246
|
-
}
|
|
3247
|
-
return throwError(originalError);
|
|
3248
|
-
})));
|
|
3249
|
-
}
|
|
3250
|
-
}
|
|
3251
|
-
return throwError(originalError);
|
|
3252
|
-
}
|
|
2816
|
+
class FileManagerDirective {
|
|
3253
2817
|
}
|
|
3254
|
-
|
|
3255
|
-
{ type:
|
|
3256
|
-
]
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
2818
|
+
FileManagerDirective.decorators = [
|
|
2819
|
+
{ type: Directive, args: [{
|
|
2820
|
+
selector: '[appFileManager]'
|
|
2821
|
+
},] }
|
|
2822
|
+
];
|
|
2823
|
+
|
|
2824
|
+
/**
|
|
2825
|
+
* @fileoverview added by tsickle
|
|
2826
|
+
* Generated from: lib/shared/file-manager/file-manager.module.ts
|
|
2827
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2828
|
+
*/
|
|
2829
|
+
class FileManagerModule {
|
|
2830
|
+
}
|
|
2831
|
+
FileManagerModule.decorators = [
|
|
2832
|
+
{ type: NgModule, args: [{
|
|
2833
|
+
imports: [
|
|
2834
|
+
CommonModule,
|
|
2835
|
+
ReactiveFormsModule,
|
|
2836
|
+
RouterModule,
|
|
2837
|
+
FormsModule,
|
|
2838
|
+
TranslateModule
|
|
2839
|
+
],
|
|
2840
|
+
declarations: [
|
|
2841
|
+
FileManagerComponent,
|
|
2842
|
+
FileManagerDirective
|
|
2843
|
+
],
|
|
2844
|
+
exports: [
|
|
2845
|
+
FileManagerComponent
|
|
2846
|
+
],
|
|
2847
|
+
},] }
|
|
2848
|
+
];
|
|
2849
|
+
|
|
2850
|
+
/**
|
|
2851
|
+
* @fileoverview added by tsickle
|
|
2852
|
+
* Generated from: lib/editor/components/shared/title.component.ts
|
|
2853
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2854
|
+
*/
|
|
2855
|
+
class SharedTitleComponent {
|
|
2856
|
+
}
|
|
2857
|
+
SharedTitleComponent.decorators = [
|
|
2858
|
+
{ type: Component, args: [{
|
|
2859
|
+
selector: 'app-editor-component-shared-title',
|
|
2860
|
+
template: `
|
|
2861
|
+
<h2
|
|
2862
|
+
class="mb-4 animated shared-title px-4"
|
|
2863
|
+
[ngClass]="title?.animation"
|
|
2864
|
+
[style.fontSize.px]="title?.size"
|
|
2865
|
+
[style.textAlign]="title?.align"
|
|
2866
|
+
[style.color]="title.color" *ngIf="title?.text !== ''">
|
|
2867
|
+
{{ title?.text || '' }}
|
|
2868
|
+
</h2>
|
|
2869
|
+
`
|
|
2870
|
+
}] }
|
|
2871
|
+
];
|
|
2872
|
+
SharedTitleComponent.propDecorators = {
|
|
2873
|
+
title: [{ type: Input }]
|
|
2874
|
+
};
|
|
3261
2875
|
if (false) {
|
|
3262
|
-
/**
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
OfflineHttpInterceptor.prototype.offlineService;
|
|
2876
|
+
/** @type {?} */
|
|
2877
|
+
SharedTitleComponent.prototype.title;
|
|
2878
|
+
/** @type {?} */
|
|
2879
|
+
SharedTitleComponent.prototype.item;
|
|
3267
2880
|
}
|
|
3268
2881
|
|
|
3269
2882
|
/**
|
|
3270
2883
|
* @fileoverview added by tsickle
|
|
3271
|
-
* Generated from: lib/
|
|
2884
|
+
* Generated from: lib/editor/components/shared/subtitle.component.ts
|
|
3272
2885
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3273
2886
|
*/
|
|
3274
|
-
class
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
2887
|
+
class SharedSubTitleComponent {
|
|
2888
|
+
}
|
|
2889
|
+
SharedSubTitleComponent.decorators = [
|
|
2890
|
+
{ type: Component, args: [{
|
|
2891
|
+
selector: 'app-editor-component-shared-subtitle',
|
|
2892
|
+
template: `
|
|
2893
|
+
<p
|
|
2894
|
+
*ngIf="subtitle?.enable"
|
|
2895
|
+
class="mb-4 animated shared-subtitle"
|
|
2896
|
+
[ngClass]="subtitle?.animation"
|
|
2897
|
+
[style.fontSize.px]="subtitle?.size"
|
|
2898
|
+
[style.textAlign]="subtitle?.align"
|
|
2899
|
+
[style.color]="subtitle?.color">
|
|
2900
|
+
{{ subtitle.text || '' }}
|
|
2901
|
+
</p>
|
|
2902
|
+
`
|
|
2903
|
+
}] }
|
|
2904
|
+
];
|
|
2905
|
+
SharedSubTitleComponent.propDecorators = {
|
|
2906
|
+
subtitle: [{ type: Input }]
|
|
2907
|
+
};
|
|
2908
|
+
if (false) {
|
|
2909
|
+
/** @type {?} */
|
|
2910
|
+
SharedSubTitleComponent.prototype.subtitle;
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
/**
|
|
2914
|
+
* @fileoverview added by tsickle
|
|
2915
|
+
* Generated from: lib/editor/components/shared/button.component.ts
|
|
2916
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2917
|
+
*/
|
|
2918
|
+
/**
|
|
2919
|
+
* @record
|
|
2920
|
+
*/
|
|
2921
|
+
function Button() { }
|
|
2922
|
+
if (false) {
|
|
2923
|
+
/** @type {?} */
|
|
2924
|
+
Button.prototype.background;
|
|
2925
|
+
/** @type {?} */
|
|
2926
|
+
Button.prototype.color;
|
|
2927
|
+
/** @type {?} */
|
|
2928
|
+
Button.prototype.text;
|
|
2929
|
+
/** @type {?|undefined} */
|
|
2930
|
+
Button.prototype.hide;
|
|
2931
|
+
}
|
|
2932
|
+
class SharedButtonComponent {
|
|
3291
2933
|
/**
|
|
3292
|
-
* @param {?}
|
|
3293
|
-
* @return {?}
|
|
2934
|
+
* @param {?} translate
|
|
3294
2935
|
*/
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
/** @type {?} */
|
|
3302
|
-
const headerOptions = {
|
|
3303
|
-
'Authorization': localStorage.getItem('token'),
|
|
3304
|
-
'Accept': 'application/json'
|
|
2936
|
+
constructor(translate) {
|
|
2937
|
+
this.translate = translate;
|
|
2938
|
+
this.button = {
|
|
2939
|
+
background: '#3C4858',
|
|
2940
|
+
color: '#FFFFF',
|
|
2941
|
+
text: this.translate.instant('Next'),
|
|
3305
2942
|
};
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
reportProgress: true,
|
|
3309
|
-
responseType: 'json',
|
|
3310
|
-
headers: new HttpHeaders(headerOptions)
|
|
3311
|
-
});
|
|
3312
|
-
return this.http.request(req);
|
|
3313
|
-
// return this.http.post(this.apiBaseUrl + '/api/v2/admin/file', data, {headers: new HttpHeaders(headerOptions)});
|
|
3314
|
-
}
|
|
3315
|
-
/**
|
|
3316
|
-
* @return {?}
|
|
3317
|
-
*/
|
|
3318
|
-
getAll() {
|
|
3319
|
-
return this.http.get(this.apiBaseUrl + '/api/v2/admin/file/all', { headers: this.getHeader() });
|
|
3320
|
-
}
|
|
3321
|
-
/**
|
|
3322
|
-
* @param {?} id
|
|
3323
|
-
* @return {?}
|
|
3324
|
-
*/
|
|
3325
|
-
deleteFile(id) {
|
|
3326
|
-
return this.http.delete(this.apiBaseUrl + '/api/v2/admin/file/' + id, { headers: this.getHeader() });
|
|
2943
|
+
this.disabled = false;
|
|
2944
|
+
this.event = new EventEmitter();
|
|
3327
2945
|
}
|
|
3328
2946
|
/**
|
|
3329
2947
|
* @return {?}
|
|
3330
2948
|
*/
|
|
3331
|
-
|
|
3332
|
-
|
|
2949
|
+
goNext() {
|
|
2950
|
+
this.event.emit();
|
|
3333
2951
|
}
|
|
3334
2952
|
/**
|
|
3335
2953
|
* @return {?}
|
|
3336
2954
|
*/
|
|
3337
|
-
|
|
3338
|
-
/** @type {?} */
|
|
3339
|
-
const token = localStorage.getItem('token');
|
|
3340
|
-
if (token) {
|
|
3341
|
-
/** @type {?} */
|
|
3342
|
-
const headerOptions = {
|
|
3343
|
-
'Authorization': token,
|
|
3344
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
3345
|
-
'Accept': 'application/json'
|
|
3346
|
-
};
|
|
3347
|
-
return new HttpHeaders(headerOptions);
|
|
3348
|
-
}
|
|
2955
|
+
ngOnInit() {
|
|
3349
2956
|
}
|
|
3350
2957
|
}
|
|
3351
|
-
|
|
3352
|
-
{ type:
|
|
2958
|
+
SharedButtonComponent.decorators = [
|
|
2959
|
+
{ type: Component, args: [{
|
|
2960
|
+
selector: 'app-editor-component-shared-button',
|
|
2961
|
+
template: `
|
|
2962
|
+
<div *ngIf="button.hide && (button.text ) && (button.text !='')" class="row">
|
|
2963
|
+
<div class="col-md-12 text-center mt-4">
|
|
2964
|
+
<button (click)="goNext()" [disabled]="disabled" type="button" class="btn" style="color:white"
|
|
2965
|
+
[ngStyle]="{'color': button.color, 'background': button.background}">
|
|
2966
|
+
{{ button.text }}
|
|
2967
|
+
</button>
|
|
2968
|
+
</div>
|
|
2969
|
+
</div>
|
|
2970
|
+
`
|
|
2971
|
+
}] }
|
|
3353
2972
|
];
|
|
3354
2973
|
/** @nocollapse */
|
|
3355
|
-
|
|
3356
|
-
{ type:
|
|
3357
|
-
{ type: Global }
|
|
2974
|
+
SharedButtonComponent.ctorParameters = () => [
|
|
2975
|
+
{ type: TranslateService }
|
|
3358
2976
|
];
|
|
2977
|
+
SharedButtonComponent.propDecorators = {
|
|
2978
|
+
button: [{ type: Input }],
|
|
2979
|
+
disabled: [{ type: Input }],
|
|
2980
|
+
event: [{ type: Output }]
|
|
2981
|
+
};
|
|
3359
2982
|
if (false) {
|
|
3360
2983
|
/** @type {?} */
|
|
3361
|
-
|
|
3362
|
-
/** @type {?} */
|
|
3363
|
-
FileManagerModel.prototype.name;
|
|
2984
|
+
SharedButtonComponent.prototype.button;
|
|
3364
2985
|
/** @type {?} */
|
|
3365
|
-
|
|
2986
|
+
SharedButtonComponent.prototype.disabled;
|
|
3366
2987
|
/** @type {?} */
|
|
3367
|
-
|
|
2988
|
+
SharedButtonComponent.prototype.event;
|
|
3368
2989
|
/**
|
|
3369
2990
|
* @type {?}
|
|
3370
2991
|
* @private
|
|
3371
2992
|
*/
|
|
3372
|
-
|
|
3373
|
-
/** @type {?} */
|
|
3374
|
-
FileManagerModel.prototype.global;
|
|
2993
|
+
SharedButtonComponent.prototype.translate;
|
|
3375
2994
|
}
|
|
3376
2995
|
|
|
3377
2996
|
/**
|
|
3378
2997
|
* @fileoverview added by tsickle
|
|
3379
|
-
* Generated from: lib/
|
|
2998
|
+
* Generated from: lib/editor/components/shared/media.component.ts
|
|
3380
2999
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3381
3000
|
*/
|
|
3382
|
-
class
|
|
3383
|
-
/**
|
|
3384
|
-
* @param {?} fileManagerModel
|
|
3385
|
-
* @param {?} httpClient
|
|
3386
|
-
* @param {?} global
|
|
3387
|
-
*/
|
|
3388
|
-
constructor(fileManagerModel, httpClient, global) {
|
|
3389
|
-
this.fileManagerModel = fileManagerModel;
|
|
3390
|
-
this.httpClient = httpClient;
|
|
3391
|
-
this.global = global;
|
|
3392
|
-
}
|
|
3393
|
-
/**
|
|
3394
|
-
* @param {?} data
|
|
3395
|
-
* @return {?}
|
|
3396
|
-
*/
|
|
3397
|
-
uploadFile(data) {
|
|
3398
|
-
return this.fileManagerModel.uploadFile(this.serialize(data));
|
|
3399
|
-
}
|
|
3400
|
-
/**
|
|
3401
|
-
* @param {?} id
|
|
3402
|
-
* @return {?}
|
|
3403
|
-
*/
|
|
3404
|
-
removeFile(id) {
|
|
3405
|
-
if (id) {
|
|
3406
|
-
return this.fileManagerModel.deleteFile(id);
|
|
3407
|
-
}
|
|
3408
|
-
else {
|
|
3409
|
-
return null;
|
|
3410
|
-
}
|
|
3411
|
-
}
|
|
3412
|
-
/**
|
|
3413
|
-
* @return {?}
|
|
3414
|
-
*/
|
|
3415
|
-
findFileCollection() {
|
|
3416
|
-
return this.fileManagerModel.getAll();
|
|
3417
|
-
}
|
|
3418
|
-
/**
|
|
3419
|
-
* @param {?} data
|
|
3420
|
-
* @return {?}
|
|
3421
|
-
*/
|
|
3422
|
-
serialize(data) {
|
|
3423
|
-
/** @type {?} */
|
|
3424
|
-
const fileManager = new FileManagerModel(this.httpClient, this.global);
|
|
3425
|
-
fileManager.name = data.name;
|
|
3426
|
-
fileManager.file = data;
|
|
3427
|
-
fileManager.description = data.type;
|
|
3428
|
-
return fileManager;
|
|
3429
|
-
}
|
|
3001
|
+
class SharedMediaComponent {
|
|
3430
3002
|
}
|
|
3431
|
-
|
|
3432
|
-
{ type:
|
|
3003
|
+
SharedMediaComponent.decorators = [
|
|
3004
|
+
{ type: Component, args: [{
|
|
3005
|
+
selector: 'app-editor-component-shared-media',
|
|
3006
|
+
template: `
|
|
3007
|
+
<div class="row" *ngIf="media.type == 'image' || media.type == 'IMAGE'">
|
|
3008
|
+
<div class="col-sm-11 mx-auto mb-4">
|
|
3009
|
+
<img height="320" style="width: 100%; object-fit: scale-down; max-height: 320px;" *ngIf="media.url != ''"
|
|
3010
|
+
[src]="media.url" />
|
|
3011
|
+
</div>
|
|
3012
|
+
</div>
|
|
3013
|
+
<div class="row" *ngIf="media.type == 'youtube' || media.type == 'YOUTUBE'">
|
|
3014
|
+
<div class="col-sm-11 mx-auto mb-4" *ngIf="media.url !== ''">
|
|
3015
|
+
<iframe [src]="media.url | youtubeEmbed | safeUrl:'resourceUrl'" width="100%" height="500px" frameborder="0"
|
|
3016
|
+
allowfullscreen></iframe>
|
|
3017
|
+
</div>
|
|
3018
|
+
</div>
|
|
3019
|
+
<div class="row" *ngIf="media.type == 'vimeo' || media.type == 'VIMEO'">
|
|
3020
|
+
<div class="col-sm-11 mx-auto mb-4" *ngIf="media.url !== ''">
|
|
3021
|
+
<iframe [src]="media.url | vimeoEmbed | safeUrl:'resourceUrl'" width="100%" height="500px" frameborder="0"
|
|
3022
|
+
allowfullscreen></iframe>
|
|
3023
|
+
</div>
|
|
3024
|
+
</div>
|
|
3025
|
+
`
|
|
3026
|
+
}] }
|
|
3433
3027
|
];
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3028
|
+
SharedMediaComponent.propDecorators = {
|
|
3029
|
+
media: [{ type: Input }]
|
|
3030
|
+
};
|
|
3031
|
+
if (false) {
|
|
3032
|
+
/** @type {?} */
|
|
3033
|
+
SharedMediaComponent.prototype.media;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
/**
|
|
3037
|
+
* @fileoverview added by tsickle
|
|
3038
|
+
* Generated from: lib/editor/components/shared/text.component.ts
|
|
3039
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3040
|
+
*/
|
|
3041
|
+
class SharedTextComponent {
|
|
3042
|
+
}
|
|
3043
|
+
SharedTextComponent.decorators = [
|
|
3044
|
+
{ type: Component, args: [{
|
|
3045
|
+
selector: 'app-editor-component-shared-text',
|
|
3046
|
+
template: `
|
|
3047
|
+
<p
|
|
3048
|
+
class="mb-4 animated"
|
|
3049
|
+
[ngClass]="text?.animation"
|
|
3050
|
+
[style.fontSize.px]="text?.size"
|
|
3051
|
+
[style.textAlign]="text?.align"
|
|
3052
|
+
[style.color]="text.color" *ngIf="text?.text !== ''">
|
|
3053
|
+
{{ text.text || '' }}
|
|
3054
|
+
</p>
|
|
3055
|
+
`
|
|
3056
|
+
}] }
|
|
3439
3057
|
];
|
|
3058
|
+
SharedTextComponent.propDecorators = {
|
|
3059
|
+
text: [{ type: Input }]
|
|
3060
|
+
};
|
|
3440
3061
|
if (false) {
|
|
3441
|
-
/**
|
|
3442
|
-
* @type {?}
|
|
3443
|
-
* @private
|
|
3444
|
-
*/
|
|
3445
|
-
FileManagerService.prototype.fileManagerModel;
|
|
3446
|
-
/**
|
|
3447
|
-
* @type {?}
|
|
3448
|
-
* @private
|
|
3449
|
-
*/
|
|
3450
|
-
FileManagerService.prototype.httpClient;
|
|
3451
3062
|
/** @type {?} */
|
|
3452
|
-
|
|
3063
|
+
SharedTextComponent.prototype.text;
|
|
3453
3064
|
}
|
|
3454
3065
|
|
|
3455
3066
|
/**
|
|
3456
3067
|
* @fileoverview added by tsickle
|
|
3457
|
-
* Generated from: lib/
|
|
3068
|
+
* Generated from: lib/editor/components/shared/shared.module.ts
|
|
3458
3069
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3459
3070
|
*/
|
|
3460
|
-
|
|
3071
|
+
/** @type {?} */
|
|
3072
|
+
const components = [
|
|
3073
|
+
SharedTitleComponent,
|
|
3074
|
+
SharedSubTitleComponent,
|
|
3075
|
+
SharedButtonComponent,
|
|
3076
|
+
SharedMediaComponent,
|
|
3077
|
+
SharedTextComponent
|
|
3078
|
+
];
|
|
3079
|
+
class ComponentSharedModule {
|
|
3080
|
+
}
|
|
3081
|
+
ComponentSharedModule.decorators = [
|
|
3082
|
+
{ type: NgModule, args: [{
|
|
3083
|
+
imports: [
|
|
3084
|
+
CommonModule,
|
|
3085
|
+
FormsModule,
|
|
3086
|
+
ReactiveFormsModule,
|
|
3087
|
+
ColorPickerModule,
|
|
3088
|
+
MomentModule,
|
|
3089
|
+
MatSelectModule,
|
|
3090
|
+
TranslateModule,
|
|
3091
|
+
MatInputModule,
|
|
3092
|
+
MatStepperModule,
|
|
3093
|
+
MatRadioModule,
|
|
3094
|
+
MatTooltipModule,
|
|
3095
|
+
MatSliderModule,
|
|
3096
|
+
PipesModule
|
|
3097
|
+
],
|
|
3098
|
+
declarations: [
|
|
3099
|
+
...components
|
|
3100
|
+
],
|
|
3101
|
+
exports: [
|
|
3102
|
+
...components
|
|
3103
|
+
]
|
|
3104
|
+
},] }
|
|
3105
|
+
];
|
|
3106
|
+
|
|
3107
|
+
/**
|
|
3108
|
+
* @fileoverview added by tsickle
|
|
3109
|
+
* Generated from: lib/editor/components/dynamic-input/dynamic-input.component.ts
|
|
3110
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3111
|
+
*/
|
|
3112
|
+
class DynamicInputComponent {
|
|
3113
|
+
constructor() { }
|
|
3114
|
+
}
|
|
3115
|
+
DynamicInputComponent.decorators = [
|
|
3116
|
+
{ type: Component, args: [{
|
|
3117
|
+
selector: 'app-editor-component-dynamic-input',
|
|
3118
|
+
template: "<textarea \r\n ngControlName\r\n *ngIf=\"input.type == 'text-long'\"\r\n name=\"input\"\r\n matInput \r\n matTextareaAutosize\r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\"></textarea>\r\n\r\n<input \r\n *ngIf=\"input.type == 'text-short'\"\r\n type=\"text\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'number'\"\r\n type=\"number\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'currency'\"\r\n type=\"text\"\r\n name=\"input\"\r\n currencyMask\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'date'\"\r\n type=\"date\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<div class=\"form-group form-focus label-floating\" *ngIf=\"input.type === 'select-single'\">\r\n <mat-form-field class=\"w-100 m-b-3\">\r\n <mat-select name=\"input\" [placeholder]=\"input.placeholder\">\r\n <mat-option *ngFor=\"let opt of input.selectOptions\" [value]=\"opt.value\"> {{ opt.value }}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>\r\n\r\n<div class=\"form-group form-focus label-floating\" *ngIf=\"input.type === 'select-multi'\">\r\n <mat-form-field class=\"w-100 m-b-3\">\r\n <mat-select multiple name=\"input\" [placeholder]=\"input.placeholder\">\r\n <mat-option *ngFor=\"let opt of input.selectOptions\" [value]=\"opt.value\"> {{ opt.value }}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>",
|
|
3119
|
+
styles: [".flex-container{padding:0;margin:0;list-style:none;-ms-box-orient:horizontal;display:-moz-flex;display:flex}.nowrap{flex-wrap:nowrap}.wrap{flex-wrap:wrap}::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{border-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{background-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element{background-color:rgba(233,30,99,.26)}.mat-checkbox-label,::ng-deep .mat-radio-label{cursor:pointer;white-space:nowrap;padding:10px}::ng-deep .mat-horizontal-stepper-header{height:40px!important;padding:0 15px!important}::ng-deep .mat-step-header .mat-step-icon{background-color:#e91e63;color:#fff}::ng-deep .mat-stepper-horizontal-line{margin:0!important}::ng-deep .checkbox .checkbox-material .check{width:15px;height:15px;border:1px solid #ddd;border-radius:3px}::ng-deep .checkbox .checkbox-material .check:before{position:absolute;content:\"\";transform:rotate(45deg);display:block;margin-top:-5px;margin-left:5px;font-size:.5em;width:1;height:0;-webkit-animation:.3s forwards checkbox-off;animation:.3s forwards checkbox-off}::ng-deep .checkbox label{cursor:pointer;padding-left:0;font-size:.8em;font-weight:500;color:#525859}.mt--5{margin-top:-7px}.mt-20{margin-top:20px}.ml-3{margin-left:3px}.no-margin{margin:0!important}.bg-purple{background:#9c27b0}.fc-gray{color:#525859!important}.fc-purple{color:#9c27b0!important}.fc-red{color:#e50606!important}.fc-green{color:#2ac994!important}.bold{font-weight:700}.bolder{font-weight:bolder}.placeholder{color:#d5d5d5}.border{border:1px solid #d2d2d2}.no-border{border:none}.bl-0{border-left:none}.border-label{padding:0;border-radius:3px;border:1px solid #ccc;background:rgba(255,255,255,.5)}.border-top{border-top:1px solid #eee}.border-bottom{border-bottom:1px solid #eee}.col-center-block{float:none;display:block;margin:0 auto}.btn.focus,.btn:focus{color:#fff;background-color:#595959;border-color:#595959;outline:0;box-shadow:0 0 0 .2rem rgba(89,89,89,.25)}.btn-primary{color:#fff;background-color:#6c757d!important;border-color:#6c757d!important;box-shadow:none;font-size:1em}.btn-primary:hover{color:#fff;background-color:#595959;border-color:#595959;box-shadow:0 14px 26px -12px rgba(89,89,89,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(89,89,89,.2)}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-primary.disabled,.btn-primary:disabled:hover,.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#595959;border-color:#595959}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-muted{background:#ccc}.btn-muted:hover{background:#bbb}.box-group{padding:10px;background:#f5f5f5;border:1px solid #eee;border-radius:3px}.box{display:flex;display:-ms-flexbox;align-items:center;-webkit-box-align:center;-ms-flex-align:center;flex-direction:column;justify-content:center;-webkit-justify-content:center;-webkit-box-pack:center;margin-left:auto}.box-list{display:flex;align-items:center;justify-content:center;height:100%;padding-bottom:30px;width:100%}.box-ask-border{display:inline-block;margin:2%;max-width:190px;min-height:190px;text-align:left;width:46%}.box-ask-border:hover{border-color:#dedede;color:#dedede;background:#fff7fa;border-radius:7px}.box-label{cursor:pointer;display:block;height:100%;padding:12px}.box-img{background-position:50%;background-size:cover;border-radius:7px;height:160px;margin:0;width:100%;-o-object-fit:cover;object-fit:cover}.box-input{display:block;position:relative;cursor:pointer;font-size:15px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.box-input input{position:absolute;opacity:0;cursor:pointer}.checkmark{position:absolute;top:-17px;left:-17px;background:0 0;border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;margin:2%;width:116%;height:120%;min-height:190px}.box-input input:checked~.checkmark{border:2px solid #dedede}.checkmark:after{content:\"\";position:absolute;display:none}.box-input input:checked~.box-ask-border:after{border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;font-size:15px;margin:2%;max-width:190px;text-align:left;width:46%}.box-ask-border:after{border-color:#dedede;color:rgba (233,30,99,.3);background:#fff7fa}.title{font-size:13px;float:left;padding:2px 10px;position:fixed}.title-question{font-size:1.12em;font-weight:900;color:#525859;margin-bottom:20px}.title-config{font-size:.8em;font-weight:500;color:#525859;margin-bottom:0;width:100%}.tool-name{font-weight:600;color:#9c27b0}.tool-name-subtitle{font-weight:600;color:#525859}.img-responsive,.vid-responsive{display:block;max-width:100%;height:auto}.img-thumbnail,.vid-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;margin-bottom:30px;transition:.2s ease-in-out}.col-left{border-right:1px solid #eee}.col-center{float:left;width:60%}.col-right{border-left:1px solid #eee}.col-left,.col-right{float:left;width:20%;overflow-x:hidden!important}.col-sup{height:28vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:25px}.col-sub{height:51.5vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;margin-top:25px}.col-int{height:83.5vh;overflow-y:auto;padding:10px;margin-top:25px;border-top:1px solid #eee}.icon{float:left;width:50%;height:70px;text-align:center;margin:20px 0}.icon i{font-size:40px}.icon a{display:block;color:#999}.icon a:hover{color:#777}.icon p{font-size:14px;margin:5px}table thead th{font-size:1em;font-weight:900;color:#383838}table tfoot .amount{font-size:1em;font-weight:900;color:#383838;text-align:right}.nav-tabs{border-bottom:1px solid #ddd;margin-bottom:20px;background:0 0}.nav-tabs>li>a{margin-right:0!important;padding:4px 8px;color:#9c27b0!important}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd!important;border-bottom-color:transparent!important}.divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}input.cell-text::-webkit-input-placeholder{color:#d5d5d5}input.cell-text::-moz-placeholder{color:#d5d5d5}input.cell-text:-ms-input-placeholder{color:#d5d5d5}input.cell-text::-ms-input-placeholder{color:#d5d5d5}input.cell-text::placeholder{color:#d5d5d5}input.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333}input.text::-webkit-input-placeholder{color:#d5d5d5}input.text::-moz-placeholder{color:#d5d5d5}input.text:-ms-input-placeholder{color:#d5d5d5}input.text::-ms-input-placeholder{color:#d5d5d5}input.text::placeholder{color:#d5d5d5}select.text{border:1px solid #ddd;padding:5px 2px;border-radius:3px;color:#333}select.text::-webkit-input-placeholder{color:#d5d5d5}select.text::-moz-placeholder{color:#d5d5d5}select.text:-ms-input-placeholder{color:#d5d5d5}select.text::-ms-input-placeholder{color:#d5d5d5}select.text::placeholder{color:#d5d5d5}textarea.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333;resize:none}textarea.text::-webkit-input-placeholder{color:#d5d5d5}textarea.text::-moz-placeholder{color:#d5d5d5}textarea.text:-ms-input-placeholder{color:#d5d5d5}textarea.text::-ms-input-placeholder{color:#d5d5d5}textarea.text::placeholder{color:#d5d5d5}.text-input{color:#b5b4b4;font-size:1.12em;position:relative;vertical-align:middle;display:inline-block;transition:.5s;padding:0;cursor:pointer;border-bottom:2px solid #fff;-webkit-transition:.5s}.text-input::after,.text-input::before{width:100%;height:100%;z-index:3;content:\"\";position:absolute;top:0;left:0;box-sizing:border-box;-webkit-transform:scale(0);transition:.5s}.text-input::-webkit-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-moz-placeholder{color:#dcb8e3;font-size:1.09em}.text-input:-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::placeholder{color:#dcb8e3;font-size:1.09em}.text-input:focus,.text-input:hover{color:#dcb8e3;font-size:1.09em;border-bottom:2px solid #dedede}input[type=checkbox],input[type=radio]{display:none}input[type=checkbox]+label,input[type=radio]+label{color:#b5b4b4;font-size:1.09em}input[type=radio]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer}input[type=checkbox]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer;transition:.1s}input[type=checkbox]:checked+label span{transition:.1s}.multiple-questions label span{display:block;cursor:pointer;max-height:242px;border:1px solid #ddd;border-radius:7px;padding:10px 10px 0;margin:5px;max-width:180px;min-height:180px}.multiple-questions label span.no-image{min-height:0}.multiple-questions label span.no-image img{display:none!important}.multiple-questions input[type=radio]:checked+span{border:1px solid #595959!important;background:#fcfcfc}.multiple-questions label span img{border-radius:7px;width:180px;height:180px}.multiple-questions .text{text-align:center;padding:15px 0;min-height:30px}input.multichoice:empty{margin-left:-999px}input.multichoice:empty~label{position:relative;margin-right:20px;margin-bottom:20px;padding-right:20px;float:left;line-height:2.5em;text-indent:3.5em;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:.1s}input.multichoice:empty~label:before{position:relative;left:0;float:left;content:'';width:40px;background:#d1d3d4;border-radius:3px 0 0 3px;margin-left:0;margin-right:-40px}input.multichoice:checked~label:before{content:'\\2714';text-indent:.9em;color:#fff;background-color:#6c63fe;transition:.1s}.d-flex{display:flex!important}.flex-wrap{flex-wrap:wrap!important}.justify-content-center{justify-content:center!important}.flex-column{flex-direction:column!important}.align-content-center{align-content:center!important}.align-vertical-center{-ms-align-items:center!important;align-items:center!important}.wrapper{min-height:100%;position:relative;overflow:hidden}.wrapper:after,.wrapper:before{content:\" \";display:table}.wrapper:after{clear:both}.content-wrapper{min-height:100%;background-color:#fff;z-index:800;padding-top:40px}.top-menu{position:absolute;border-bottom:1px solid #eee;top:0;width:100%;height:40px;padding:0 10px;line-height:40px}.tool{float:right;padding:2px 5px}.footer{position:absolute;border-top:1px solid #eee;bottom:0;padding:0 10px;width:100%;height:40px;line-height:40px;background:#fff}.cliente{font-size:16px}.modulo a{padding:2px 5px;border-radius:4px;display:block;background:#9c27b0;color:#fff;margin-bottom:5px}.modulo a:hover{background:#831596}.modulo span a{float:right;font-size:12px;padding:0;background:0 0;margin-left:5px;margin-top:1px}.modulo span a:hover{color:#e9e9e9}.etapa a{padding:2px 5px 2px 20px;border-radius:4px;display:block;background:0 0;color:#777;margin-bottom:5px}.etapa span a{float:right;font-size:12px;padding:0;background:0 0;color:#ddd;margin-left:5px;margin-top:1px}.etapa span a:hover{color:#999}.form-custom input[type=number],.form-custom input[type=text],.form-custom select,.form-custom textarea{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px;overflow-x:hidden}.form-custom .txt{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px}.form-custom ::-webkit-input-placeholder{font-size:13px;color:#999}.form-custom ::-moz-placeholder{font-size:13px;color:#999}.form-custom ::-ms-input-placeholder{font-size:13px;color:#999}.wrapper-input{height:45px}.btn-rose{background:#e91e63}.cursor{cursor:pointer}.midia-w iframe{width:100%}.midia-h iframe{height:400px}.breadcrumb{padding:0 15px;margin-bottom:20px;list-style:none;background-color:transparent;font-size:12px}.config-label{width:100%;margin:5px 0;float:left;font-size:.8em;display:block;line-height:1.5em}.config-textarea{width:100%;margin:5px 0;float:left;resize:initial;overflow-y:auto;display:block;font-size:.9em!important;color:#999}.config-input,.config-select{width:100%;margin:5px 0;float:left;display:block;font-size:.9em!important;color:#999}.config-box{width:100%;margin:5px;float:left}.config-box-50{width:45%;min-height:110px;margin:5px;float:left;background:#f9f9f9;border:1px solid #eee;border-radius:5px;padding:10px}.config-box-title{width:100%;padding:10px;font-size:.85em}.no-bg-image{background-image:none}.space-inside{padding:10px}.block{display:block}.fake-link{cursor:pointer}.item-component{margin:0;border-radius:2px;border:1px solid #fff}.item-component:hover{border-color:#9c27b0}.item-component.active{border-color:#9c27b0;background-color:#f9f9f9}.item-box-model{border:3px dashed #ddd;padding:20px;color:#ccc;min-height:50px}.item-component-challenge,.item-component-conclusion,.item-component-download,.item-component-dynamic-input,.item-component-dynamic-table,.item-component-image,.item-component-intro,.item-component-long-text,.item-component-multichoise,.item-component-multiple-questions,.item-component-pdf,.item-component-rating,.item-component-sales-channel,.item-component-sheet-correct-incorrect,.item-component-star-point,.item-component-text,.item-component-upload,.item-component-video,.item-component-yes-no{padding:0}.item-component-image .material-icons,.item-component-pdf .material-icons,.item-component-video .material-icons{font-size:80px}.item-component-title .title-bold{font-weight:700}.item-component-title .title-italic{font-style:italic}.item-component-title .title-underline{text-decoration:underline}.icon.disabled{opacity:.3}.item-component-image-icon-container,.item-component-pdf-icon-container,.item-component-video-icon-container{background:#eee;border:1px solid #ccc;text-align:center;color:#444;font-size:50px;padding:160px}.btn-container{text-align:center}.etapa a:hover,.etapa.active a{background:#f4f4f4}.etapa.active:before{font:700 14px/1 FontAwesome;content:\"\\f0da\";float:left;color:#9c27b0;position:relative;top:5px;left:5px}.scroll{overflow-y:auto}#trail-status{color:#ddd;margin-right:10px;background:0 0;border:none}#trail-status.active{color:#6c9}.item-btn-delete{position:relative}.item-btn-delete button{position:absolute;top:-10px;right:-10px;border:1px solid #9c27b0;background-color:#fff;color:#9c27b0;border-radius:50%;width:20px;height:20px;padding:0;font-size:12px;line-height:12px;z-index:1}.item-btn-delete button:hover{background-color:#9c27b0;color:#fff}.custom-divisor{margin:10px 0}#tbl-objetivo td{padding:0 8px;height:0}#accordion .tool-name:after{font-family:\"Glyphicons Halflings\";content:\"\\e114\";float:right}#accordion .tool-name.collapsed:after{content:\"\\e080\"}#editor-components-wrapper img{max-height:500px;-o-object-fit:contain;object-fit:contain;background:#eee;width:auto}.input-styled{border:1px solid #ccc;padding:4px 6px;border-radius:2px}.pulse:hover{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}.cover{position:relative}.cover img{width:100%;min-height:480px;-o-object-fit:cover;object-fit:cover;opacity:1;transition:.5s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.mx-auto{float:none;margin:0 auto}@media (min-width:576px) and (max-width:767px){::ng-deep .sheet-correct .radio{width:90%!important}}@media (min-width:768px) and (max-width:991px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:992px) and (max-width:1199px){::ng-deep .sheet-correct .radio{width:65%!important}}@media (min-width:1200px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:1600px){.col-sup{height:45vh}.col-sub{height:55.5vh}.col-int{height:88.5vh}}.image-modal{transition:.5s}.image-modal-item{width:100%;-o-object-fit:scale-down;object-fit:scale-down;max-height:320px;cursor:zoom-in}.image-modal-full{position:fixed;top:0;left:0;z-index:99999;width:100%;height:100%;padding:10%;background:rgba(0,0,0,.3);-o-object-fit:contain;object-fit:contain;cursor:zoom-out}", "input,textarea{padding:10px}"]
|
|
3120
|
+
}] }
|
|
3121
|
+
];
|
|
3122
|
+
/** @nocollapse */
|
|
3123
|
+
DynamicInputComponent.ctorParameters = () => [];
|
|
3124
|
+
DynamicInputComponent.propDecorators = {
|
|
3125
|
+
input: [{ type: Input }]
|
|
3126
|
+
};
|
|
3127
|
+
if (false) {
|
|
3128
|
+
/** @type {?} */
|
|
3129
|
+
DynamicInputComponent.prototype.input;
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
/**
|
|
3133
|
+
* @fileoverview added by tsickle
|
|
3134
|
+
* Generated from: lib/\@core/services/trail-content.service.ts
|
|
3135
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3136
|
+
*/
|
|
3137
|
+
class TrailContentService {
|
|
3461
3138
|
/**
|
|
3462
|
-
* @param {?}
|
|
3463
|
-
* @param {?}
|
|
3139
|
+
* @param {?} http
|
|
3140
|
+
* @param {?} global
|
|
3464
3141
|
*/
|
|
3465
|
-
constructor(
|
|
3466
|
-
this.
|
|
3467
|
-
this.
|
|
3468
|
-
this.event = new EventEmitter();
|
|
3469
|
-
this.progress = { percentage: 0 };
|
|
3470
|
-
this.loading = false;
|
|
3142
|
+
constructor(http, global) {
|
|
3143
|
+
this.http = http;
|
|
3144
|
+
this.global = global;
|
|
3471
3145
|
}
|
|
3472
3146
|
/**
|
|
3147
|
+
* @param {?} id
|
|
3473
3148
|
* @return {?}
|
|
3474
3149
|
*/
|
|
3475
|
-
|
|
3476
|
-
this.
|
|
3150
|
+
all(id) {
|
|
3151
|
+
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, this.getHeaders()).pipe(catchError((/**
|
|
3152
|
+
* @param {?} err
|
|
3153
|
+
* @return {?}
|
|
3154
|
+
*/
|
|
3155
|
+
err => of({ data: [] }))));
|
|
3477
3156
|
}
|
|
3478
3157
|
/**
|
|
3158
|
+
* @param {?} id
|
|
3479
3159
|
* @return {?}
|
|
3480
3160
|
*/
|
|
3481
|
-
|
|
3482
|
-
|
|
3161
|
+
updateGrafico(id) {
|
|
3162
|
+
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/assessment/' + id, this.getHeaders());
|
|
3483
3163
|
}
|
|
3484
3164
|
/**
|
|
3165
|
+
* @param {?} id
|
|
3166
|
+
* @param {?} data
|
|
3485
3167
|
* @return {?}
|
|
3486
3168
|
*/
|
|
3487
|
-
|
|
3488
|
-
|
|
3169
|
+
save(id, data) {
|
|
3170
|
+
return this.http.post(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, { value: data }, this.getHeaders());
|
|
3489
3171
|
}
|
|
3490
3172
|
/**
|
|
3491
|
-
* @param {?}
|
|
3173
|
+
* @param {?} id
|
|
3174
|
+
* @param {?} data
|
|
3492
3175
|
* @return {?}
|
|
3493
3176
|
*/
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
this.selectedFile = $event.target.files[0];
|
|
3497
|
-
}
|
|
3498
|
-
else {
|
|
3499
|
-
swal({
|
|
3500
|
-
type: 'error',
|
|
3501
|
-
title: this.translate.instant('ErrorLoadingFile'),
|
|
3502
|
-
text: this.translate.instant('MakeSureTheFileHasTheAllowedFormat'),
|
|
3503
|
-
buttonsStyling: false,
|
|
3504
|
-
confirmButtonClass: 'btn btn-success'
|
|
3505
|
-
});
|
|
3506
|
-
$('#file').val('');
|
|
3507
|
-
}
|
|
3177
|
+
update(id, data) {
|
|
3178
|
+
return this.http.put(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, { value: data }, this.getHeaders());
|
|
3508
3179
|
}
|
|
3509
3180
|
/**
|
|
3510
|
-
* @
|
|
3511
|
-
* @param {?} fileType
|
|
3181
|
+
* @param {?} id
|
|
3512
3182
|
* @return {?}
|
|
3513
3183
|
*/
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
case 'image/png':
|
|
3517
|
-
return true;
|
|
3518
|
-
case 'image/jpeg':
|
|
3519
|
-
return true;
|
|
3520
|
-
case 'image/jpg':
|
|
3521
|
-
return true;
|
|
3522
|
-
case 'image/gif':
|
|
3523
|
-
return true;
|
|
3524
|
-
case 'image/png':
|
|
3525
|
-
return true;
|
|
3526
|
-
case 'application/msword':
|
|
3527
|
-
return true;
|
|
3528
|
-
case 'application/pdf':
|
|
3529
|
-
return true;
|
|
3530
|
-
case 'application/zip':
|
|
3531
|
-
return true;
|
|
3532
|
-
case 'video/x-flv':
|
|
3533
|
-
return true;
|
|
3534
|
-
case 'video/mp4':
|
|
3535
|
-
return true;
|
|
3536
|
-
case 'application/x-mpegURL':
|
|
3537
|
-
return true;
|
|
3538
|
-
case 'video/MP2T':
|
|
3539
|
-
return true;
|
|
3540
|
-
case 'video/3gpp':
|
|
3541
|
-
return true;
|
|
3542
|
-
case 'video/quicktime':
|
|
3543
|
-
return true;
|
|
3544
|
-
case 'video/x-msvideo':
|
|
3545
|
-
return true;
|
|
3546
|
-
case 'video/x-ms-wmv':
|
|
3547
|
-
return true;
|
|
3548
|
-
default:
|
|
3549
|
-
return false;
|
|
3550
|
-
}
|
|
3551
|
-
}
|
|
3552
|
-
/**
|
|
3553
|
-
* @return {?}
|
|
3554
|
-
*/
|
|
3555
|
-
submit() {
|
|
3556
|
-
this.progress.percentage = 0;
|
|
3557
|
-
this.loading = true;
|
|
3558
|
-
this._fileManagerService.uploadFile(this.selectedFile)
|
|
3559
|
-
.subscribe((/**
|
|
3560
|
-
* @param {?} event
|
|
3561
|
-
* @return {?}
|
|
3562
|
-
*/
|
|
3563
|
-
event => {
|
|
3564
|
-
if (event.type === HttpEventType.UploadProgress) {
|
|
3565
|
-
this.progress.percentage = Math.round(100 * event.loaded / event.total);
|
|
3566
|
-
}
|
|
3567
|
-
else if (event instanceof HttpResponse) {
|
|
3568
|
-
this.event.emit(event.body.data);
|
|
3569
|
-
this.loading = false;
|
|
3570
|
-
this.closeModal();
|
|
3571
|
-
}
|
|
3572
|
-
}));
|
|
3573
|
-
this.selectedFile = undefined;
|
|
3184
|
+
delete(id) {
|
|
3185
|
+
return this.http.delete(this.global.apiURL() + '/api/v2/client/exercises/' + id, this.getHeaders());
|
|
3574
3186
|
}
|
|
3575
3187
|
/**
|
|
3188
|
+
* @param {?} id
|
|
3189
|
+
* @param {?} seconds
|
|
3576
3190
|
* @return {?}
|
|
3577
3191
|
*/
|
|
3578
|
-
|
|
3579
|
-
this.
|
|
3580
|
-
.subscribe((/**
|
|
3581
|
-
* @param {?} res
|
|
3582
|
-
* @return {?}
|
|
3583
|
-
*/
|
|
3584
|
-
(res) => {
|
|
3585
|
-
this.fileList = res.data;
|
|
3586
|
-
}));
|
|
3192
|
+
videoTime(id, seconds) {
|
|
3193
|
+
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/tempo/' + id + '/' + seconds, this.getHeaders());
|
|
3587
3194
|
}
|
|
3588
3195
|
/**
|
|
3589
|
-
* @param {?}
|
|
3196
|
+
* @param {?} id
|
|
3197
|
+
* @param {?} vote
|
|
3590
3198
|
* @return {?}
|
|
3591
3199
|
*/
|
|
3592
|
-
|
|
3593
|
-
this.
|
|
3594
|
-
this.closeModal();
|
|
3200
|
+
vote(id, vote) {
|
|
3201
|
+
return this.http.post(this.global.apiURL() + '/api/v2/client/trilha/conteudo/vote/' + id, { voto: vote }, this.getHeaders());
|
|
3595
3202
|
}
|
|
3596
3203
|
/**
|
|
3597
|
-
* @param {?} item
|
|
3598
3204
|
* @return {?}
|
|
3599
3205
|
*/
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
title: this.translate.instant('SuccessfullyRemoved'),
|
|
3610
|
-
text: this.translate.instant('TheSelectedFileHasBeenRemovedFromTheSystem'),
|
|
3611
|
-
buttonsStyling: true,
|
|
3612
|
-
confirmButtonClass: 'btn btn-success'
|
|
3613
|
-
});
|
|
3614
|
-
this.findAll();
|
|
3615
|
-
}), (/**
|
|
3616
|
-
* @param {?} err
|
|
3617
|
-
* @return {?}
|
|
3618
|
-
*/
|
|
3619
|
-
err => {
|
|
3620
|
-
swal({
|
|
3621
|
-
type: 'error',
|
|
3622
|
-
title: this.translate.instant('ErrorRemovingFile'),
|
|
3623
|
-
text: this.translate.instant('TryAgainLater'),
|
|
3624
|
-
buttonsStyling: true,
|
|
3625
|
-
confirmButtonClass: 'btn btn-success'
|
|
3626
|
-
});
|
|
3627
|
-
}));
|
|
3206
|
+
getHeaders() {
|
|
3207
|
+
/** @type {?} */
|
|
3208
|
+
const token = localStorage.getItem('token');
|
|
3209
|
+
/** @type {?} */
|
|
3210
|
+
const headerOptions = {
|
|
3211
|
+
'Authorization': token,
|
|
3212
|
+
'Accept': 'application/json'
|
|
3213
|
+
};
|
|
3214
|
+
return { headers: new HttpHeaders(headerOptions) };
|
|
3628
3215
|
}
|
|
3629
3216
|
}
|
|
3630
|
-
|
|
3631
|
-
{ type:
|
|
3632
|
-
selector: 'app-file-manager',
|
|
3633
|
-
exportAs: 'appFileManager',
|
|
3634
|
-
template: "<!-- Modal -->\r\n<div id=\"appFileManager\" class=\"modal fade\" role=\"dialog\" data-backdrop=\"false\" >\r\n <div class=\"modal-dialog modal-lg\">\r\n <!-- Modal content-->\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\r\n <h4 class=\"modal-title\">{{ 'FileManager' | translate }}</h4>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <div class=\"col-md-2\">\r\n <ul class=\"nav nav-pills nav-pills-icons nav-pills-primary nav-stacked\" role=\"tablist\">\r\n <!--\r\n color-classes: \"nav-pills-primary\", \"nav-pills-info\", \"nav-pills-success\", \"nav-pills-warning\",\"nav-pills-danger\"\r\n-->\r\n <li class=\"active\">\r\n <a href=\"#upload\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">backup</i> {{ 'Upload' | translate }}\r\n </a>\r\n </li>\r\n <li>\r\n <a href=\"#arquivos\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">assignment</i> {{ 'Files' | translate }}\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"col-md-10\">\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\" id=\"upload\">\r\n <div class=\"col-sm-12\">\r\n <form *ngIf=\"!loading\" class=\"text-center\">\r\n <div class=\"fileinput fileinput-new text-center\" data-provides=\"fileinput\">\r\n <div class=\"fileinput-new thumbnail preview\" style=\"width: 320px;\">\r\n <img src=\"../../assets/img/image_placeholder.jpg\" alt=\"...\">\r\n </div>\r\n <div class=\"fileinput-preview fileinput-exists thumbnail\"></div>\r\n <div>\r\n <span class=\"btn btn-primary btn-round btn-file\">\r\n <span class=\"fileinput-new\">{{ 'SelectAFile' | translate }}</span>\r\n <span class=\"fileinput-exists\">{{ 'Alter' | translate }}</span>\r\n <input ng2FileSelect (change)=\"onChange($event)\" id=\"file\" type=\"file\" name=\"...\"/>\r\n </span>\r\n <button type=\"button\" (click)=\"submit()\" class=\"fileinput-exists btn btn-primary btn-round\">\r\n {{ 'Confirm' | translate }}\r\n </button>\r\n <a href=\"#pablo\" class=\"btn btn-danger btn-round fileinput-exists\" data-dismiss=\"fileinput\"><i\r\n class=\"fa fa-times\"></i> {{ 'Remove' | translate }}</a>\r\n </div>\r\n </div>\r\n </form>\r\n <div *ngIf=\"loading\">\r\n <br>\r\n <br>\r\n <legend>{{ 'Loading...' | translate }}</legend>\r\n <div class=\"progress progress-line-primary\">\r\n <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"60\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\" [ngStyle]=\"{width: progress.percentage + '%'}\">\r\n <span class=\"sr-only\">{{ progress.percentage + '%' }} {{ 'Concluded' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"tab-pane\" id=\"arquivos\">\r\n <div class=\"col-md-12\" style=\"height: 360px; overflow: auto;\">\r\n <div class=\"table-responsive\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'Date' | translate }}</th>\r\n <th>{{ 'File' | translate }}</th>\r\n <th>{{ 'Actions' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of fileList\">\r\n <td>{{ item.updated_at.date | date: 'dd/MM/yyyy' }}</td>\r\n <td>{{ item.name }}</td>\r\n <td class=\"td-actions text-right\">\r\n <button (click)=\"selectFile(item)\" type=\"button\" class=\"btn btn-success\">\r\n <i class=\"material-icons\">check</i>\r\n </button>\r\n <button (click)=\"deleteFromList(item)\" type=\"button\" class=\"btn btn-danger\">\r\n <i class=\"material-icons\">close</i>\r\n </button>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!--<div class=\"modal-footer\">-->\r\n <!--<button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">Confirmar</button>-->\r\n <!--<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Fechar</button>-->\r\n <!--</div>-->\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
3635
|
-
providers: [FileManagerService, FileManagerModel],
|
|
3636
|
-
styles: [".fileinput .thumbnail{max-width:100%!important;height:240px}.modal-content{min-height:450px}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}"]
|
|
3637
|
-
}] }
|
|
3217
|
+
TrailContentService.decorators = [
|
|
3218
|
+
{ type: Injectable }
|
|
3638
3219
|
];
|
|
3639
3220
|
/** @nocollapse */
|
|
3640
|
-
|
|
3641
|
-
{ type:
|
|
3642
|
-
{ type:
|
|
3221
|
+
TrailContentService.ctorParameters = () => [
|
|
3222
|
+
{ type: HttpClient },
|
|
3223
|
+
{ type: Global }
|
|
3643
3224
|
];
|
|
3644
|
-
FileManagerComponent.propDecorators = {
|
|
3645
|
-
event: [{ type: Output }]
|
|
3646
|
-
};
|
|
3647
3225
|
if (false) {
|
|
3648
3226
|
/** @type {?} */
|
|
3649
|
-
|
|
3650
|
-
/** @type {?} */
|
|
3651
|
-
FileManagerComponent.prototype.selectedFile;
|
|
3652
|
-
/** @type {?} */
|
|
3653
|
-
FileManagerComponent.prototype.progress;
|
|
3654
|
-
/** @type {?} */
|
|
3655
|
-
FileManagerComponent.prototype.loading;
|
|
3227
|
+
TrailContentService.prototype.http;
|
|
3656
3228
|
/** @type {?} */
|
|
3657
|
-
|
|
3658
|
-
/**
|
|
3659
|
-
* @type {?}
|
|
3660
|
-
* @private
|
|
3661
|
-
*/
|
|
3662
|
-
FileManagerComponent.prototype._fileManagerService;
|
|
3663
|
-
/**
|
|
3664
|
-
* @type {?}
|
|
3665
|
-
* @private
|
|
3666
|
-
*/
|
|
3667
|
-
FileManagerComponent.prototype.translate;
|
|
3229
|
+
TrailContentService.prototype.global;
|
|
3668
3230
|
}
|
|
3669
3231
|
|
|
3670
3232
|
/**
|
|
3671
3233
|
* @fileoverview added by tsickle
|
|
3672
|
-
* Generated from: lib/
|
|
3673
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3674
|
-
*/
|
|
3675
|
-
class FileManagerDirective {
|
|
3676
|
-
}
|
|
3677
|
-
FileManagerDirective.decorators = [
|
|
3678
|
-
{ type: Directive, args: [{
|
|
3679
|
-
selector: '[appFileManager]'
|
|
3680
|
-
},] }
|
|
3681
|
-
];
|
|
3682
|
-
|
|
3683
|
-
/**
|
|
3684
|
-
* @fileoverview added by tsickle
|
|
3685
|
-
* Generated from: lib/shared/file-manager/file-manager.module.ts
|
|
3234
|
+
* Generated from: lib/\@core/services/offline-storage.service.ts
|
|
3686
3235
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3687
3236
|
*/
|
|
3688
|
-
class FileManagerModule {
|
|
3689
|
-
}
|
|
3690
|
-
FileManagerModule.decorators = [
|
|
3691
|
-
{ type: NgModule, args: [{
|
|
3692
|
-
imports: [
|
|
3693
|
-
CommonModule,
|
|
3694
|
-
ReactiveFormsModule,
|
|
3695
|
-
RouterModule,
|
|
3696
|
-
FormsModule,
|
|
3697
|
-
TranslateModule
|
|
3698
|
-
],
|
|
3699
|
-
declarations: [
|
|
3700
|
-
FileManagerComponent,
|
|
3701
|
-
FileManagerDirective
|
|
3702
|
-
],
|
|
3703
|
-
exports: [
|
|
3704
|
-
FileManagerComponent
|
|
3705
|
-
],
|
|
3706
|
-
},] }
|
|
3707
|
-
];
|
|
3708
|
-
|
|
3709
3237
|
/**
|
|
3710
|
-
* @
|
|
3711
|
-
* Generated from: lib/editor/components/shared/title.component.ts
|
|
3712
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3238
|
+
* @record
|
|
3713
3239
|
*/
|
|
3714
|
-
|
|
3715
|
-
}
|
|
3716
|
-
SharedTitleComponent.decorators = [
|
|
3717
|
-
{ type: Component, args: [{
|
|
3718
|
-
selector: 'app-editor-component-shared-title',
|
|
3719
|
-
template: `
|
|
3720
|
-
<h2
|
|
3721
|
-
class="mb-4 animated shared-title px-4"
|
|
3722
|
-
[ngClass]="title?.animation"
|
|
3723
|
-
[style.fontSize.px]="title?.size"
|
|
3724
|
-
[style.textAlign]="title?.align"
|
|
3725
|
-
[style.color]="title.color" *ngIf="title?.text !== ''">
|
|
3726
|
-
{{ title?.text || '' }}
|
|
3727
|
-
</h2>
|
|
3728
|
-
`
|
|
3729
|
-
}] }
|
|
3730
|
-
];
|
|
3731
|
-
SharedTitleComponent.propDecorators = {
|
|
3732
|
-
title: [{ type: Input }]
|
|
3733
|
-
};
|
|
3240
|
+
function DownloadedLesson() { }
|
|
3734
3241
|
if (false) {
|
|
3735
3242
|
/** @type {?} */
|
|
3736
|
-
|
|
3243
|
+
DownloadedLesson.prototype.id;
|
|
3737
3244
|
/** @type {?} */
|
|
3738
|
-
|
|
3739
|
-
}
|
|
3740
|
-
|
|
3741
|
-
/**
|
|
3742
|
-
* @fileoverview added by tsickle
|
|
3743
|
-
* Generated from: lib/editor/components/shared/subtitle.component.ts
|
|
3744
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3745
|
-
*/
|
|
3746
|
-
class SharedSubTitleComponent {
|
|
3747
|
-
}
|
|
3748
|
-
SharedSubTitleComponent.decorators = [
|
|
3749
|
-
{ type: Component, args: [{
|
|
3750
|
-
selector: 'app-editor-component-shared-subtitle',
|
|
3751
|
-
template: `
|
|
3752
|
-
<p
|
|
3753
|
-
*ngIf="subtitle?.enable"
|
|
3754
|
-
class="mb-4 animated shared-subtitle"
|
|
3755
|
-
[ngClass]="subtitle?.animation"
|
|
3756
|
-
[style.fontSize.px]="subtitle?.size"
|
|
3757
|
-
[style.textAlign]="subtitle?.align"
|
|
3758
|
-
[style.color]="subtitle?.color">
|
|
3759
|
-
{{ subtitle.text || '' }}
|
|
3760
|
-
</p>
|
|
3761
|
-
`
|
|
3762
|
-
}] }
|
|
3763
|
-
];
|
|
3764
|
-
SharedSubTitleComponent.propDecorators = {
|
|
3765
|
-
subtitle: [{ type: Input }]
|
|
3766
|
-
};
|
|
3767
|
-
if (false) {
|
|
3245
|
+
DownloadedLesson.prototype.trailId;
|
|
3768
3246
|
/** @type {?} */
|
|
3769
|
-
|
|
3770
|
-
}
|
|
3771
|
-
|
|
3772
|
-
/**
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
*/
|
|
3247
|
+
DownloadedLesson.prototype.title;
|
|
3248
|
+
/** @type {?|undefined} */
|
|
3249
|
+
DownloadedLesson.prototype.subtitle;
|
|
3250
|
+
/** @type {?|undefined} */
|
|
3251
|
+
DownloadedLesson.prototype.thumbnail;
|
|
3252
|
+
/** @type {?} */
|
|
3253
|
+
DownloadedLesson.prototype.sizeBytes;
|
|
3254
|
+
/** @type {?} */
|
|
3255
|
+
DownloadedLesson.prototype.sizeFormatted;
|
|
3256
|
+
/** @type {?} */
|
|
3257
|
+
DownloadedLesson.prototype.downloadedAt;
|
|
3258
|
+
/** @type {?} */
|
|
3259
|
+
DownloadedLesson.prototype.stageData;
|
|
3260
|
+
/** @type {?} */
|
|
3261
|
+
DownloadedLesson.prototype.stages;
|
|
3262
|
+
/** @type {?|undefined} */
|
|
3263
|
+
DownloadedLesson.prototype.videoBlob;
|
|
3264
|
+
/** @type {?|undefined} */
|
|
3265
|
+
DownloadedLesson.prototype.videoMimeType;
|
|
3266
|
+
}
|
|
3777
3267
|
/**
|
|
3778
3268
|
* @record
|
|
3779
3269
|
*/
|
|
3780
|
-
function
|
|
3270
|
+
function SyncAction() { }
|
|
3781
3271
|
if (false) {
|
|
3272
|
+
/** @type {?|undefined} */
|
|
3273
|
+
SyncAction.prototype.id;
|
|
3782
3274
|
/** @type {?} */
|
|
3783
|
-
|
|
3275
|
+
SyncAction.prototype.type;
|
|
3784
3276
|
/** @type {?} */
|
|
3785
|
-
|
|
3277
|
+
SyncAction.prototype.endpoint;
|
|
3786
3278
|
/** @type {?} */
|
|
3787
|
-
|
|
3788
|
-
/** @type {
|
|
3789
|
-
|
|
3279
|
+
SyncAction.prototype.payload;
|
|
3280
|
+
/** @type {?} */
|
|
3281
|
+
SyncAction.prototype.createdAt;
|
|
3790
3282
|
}
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3283
|
+
/**
|
|
3284
|
+
* @record
|
|
3285
|
+
*/
|
|
3286
|
+
function DownloadProgress() { }
|
|
3287
|
+
if (false) {
|
|
3288
|
+
/** @type {?} */
|
|
3289
|
+
DownloadProgress.prototype.stageId;
|
|
3290
|
+
/** @type {?} */
|
|
3291
|
+
DownloadProgress.prototype.progress;
|
|
3292
|
+
/** @type {?} */
|
|
3293
|
+
DownloadProgress.prototype.loaded;
|
|
3294
|
+
/** @type {?} */
|
|
3295
|
+
DownloadProgress.prototype.total;
|
|
3296
|
+
/** @type {?} */
|
|
3297
|
+
DownloadProgress.prototype.status;
|
|
3298
|
+
}
|
|
3299
|
+
class OfflineStorageService {
|
|
3300
|
+
constructor() {
|
|
3301
|
+
this.DB_NAME = 'AsapOfflineCoursesDB';
|
|
3302
|
+
this.DB_VERSION = 1;
|
|
3303
|
+
this.STORE_LESSONS = 'lessons';
|
|
3304
|
+
this.STORE_SYNC_QUEUE = 'sync_queue';
|
|
3305
|
+
this.db = null;
|
|
3306
|
+
this.isOnlineSubject = new BehaviorSubject(navigator.onLine);
|
|
3307
|
+
this.isOnline$ = this.isOnlineSubject.asObservable();
|
|
3308
|
+
this.downloadProgress$ = new BehaviorSubject({});
|
|
3309
|
+
this.downloadedLessons$ = new BehaviorSubject([]);
|
|
3310
|
+
this.initNetworkListeners();
|
|
3311
|
+
this.initDatabase().then((/**
|
|
3312
|
+
* @return {?}
|
|
3313
|
+
*/
|
|
3314
|
+
() => {
|
|
3315
|
+
this.refreshDownloadedLessons();
|
|
3316
|
+
if (navigator.onLine) {
|
|
3317
|
+
this.processSyncQueue();
|
|
3318
|
+
}
|
|
3319
|
+
}));
|
|
3804
3320
|
}
|
|
3805
3321
|
/**
|
|
3322
|
+
* @private
|
|
3806
3323
|
* @return {?}
|
|
3807
3324
|
*/
|
|
3808
|
-
|
|
3809
|
-
|
|
3325
|
+
initNetworkListeners() {
|
|
3326
|
+
merge(of(navigator.onLine), fromEvent(window, 'online').pipe(map((/**
|
|
3327
|
+
* @return {?}
|
|
3328
|
+
*/
|
|
3329
|
+
() => true))), fromEvent(window, 'offline').pipe(map((/**
|
|
3330
|
+
* @return {?}
|
|
3331
|
+
*/
|
|
3332
|
+
() => false)))).subscribe((/**
|
|
3333
|
+
* @param {?} online
|
|
3334
|
+
* @return {?}
|
|
3335
|
+
*/
|
|
3336
|
+
(online) => {
|
|
3337
|
+
this.isOnlineSubject.next(online);
|
|
3338
|
+
if (online) {
|
|
3339
|
+
console.log('[OfflineStorageService] Conexão restabelecida! Processando fila de sincronização...');
|
|
3340
|
+
this.processSyncQueue();
|
|
3341
|
+
}
|
|
3342
|
+
else {
|
|
3343
|
+
console.warn('[OfflineStorageService] Aplicação operando em MODO OFFLINE.');
|
|
3344
|
+
}
|
|
3345
|
+
}));
|
|
3810
3346
|
}
|
|
3811
3347
|
/**
|
|
3348
|
+
* @private
|
|
3812
3349
|
* @return {?}
|
|
3813
3350
|
*/
|
|
3814
|
-
|
|
3351
|
+
initDatabase() {
|
|
3352
|
+
return new Promise((/**
|
|
3353
|
+
* @param {?} resolve
|
|
3354
|
+
* @param {?} reject
|
|
3355
|
+
* @return {?}
|
|
3356
|
+
*/
|
|
3357
|
+
(resolve, reject) => {
|
|
3358
|
+
if (this.db) {
|
|
3359
|
+
return resolve(this.db);
|
|
3360
|
+
}
|
|
3361
|
+
if (!('indexedDB' in window)) {
|
|
3362
|
+
console.error('[OfflineStorageService] IndexedDB não é suportado neste navegador.');
|
|
3363
|
+
return reject(new Error('IndexedDB não suportado'));
|
|
3364
|
+
}
|
|
3365
|
+
/** @type {?} */
|
|
3366
|
+
const request = indexedDB.open(this.DB_NAME, this.DB_VERSION);
|
|
3367
|
+
request.onupgradeneeded = (/**
|
|
3368
|
+
* @param {?} event
|
|
3369
|
+
* @return {?}
|
|
3370
|
+
*/
|
|
3371
|
+
(event) => {
|
|
3372
|
+
/** @type {?} */
|
|
3373
|
+
const db = (/** @type {?} */ (event.target.result));
|
|
3374
|
+
if (!db.objectStoreNames.contains(this.STORE_LESSONS)) {
|
|
3375
|
+
/** @type {?} */
|
|
3376
|
+
const lessonStore = db.createObjectStore(this.STORE_LESSONS, { keyPath: 'id' });
|
|
3377
|
+
lessonStore.createIndex('trailId', 'trailId', { unique: false });
|
|
3378
|
+
lessonStore.createIndex('downloadedAt', 'downloadedAt', { unique: false });
|
|
3379
|
+
}
|
|
3380
|
+
if (!db.objectStoreNames.contains(this.STORE_SYNC_QUEUE)) {
|
|
3381
|
+
/** @type {?} */
|
|
3382
|
+
const syncStore = db.createObjectStore(this.STORE_SYNC_QUEUE, { keyPath: 'id', autoIncrement: true });
|
|
3383
|
+
syncStore.createIndex('createdAt', 'createdAt', { unique: false });
|
|
3384
|
+
}
|
|
3385
|
+
});
|
|
3386
|
+
request.onsuccess = (/**
|
|
3387
|
+
* @param {?} event
|
|
3388
|
+
* @return {?}
|
|
3389
|
+
*/
|
|
3390
|
+
(event) => {
|
|
3391
|
+
this.db = (/** @type {?} */ (event.target.result));
|
|
3392
|
+
if (navigator.storage && navigator.storage.persist) {
|
|
3393
|
+
navigator.storage.persist().then((/**
|
|
3394
|
+
* @param {?} persistent
|
|
3395
|
+
* @return {?}
|
|
3396
|
+
*/
|
|
3397
|
+
persistent => {
|
|
3398
|
+
console.log(`[OfflineStorageService] Armazenamento persistente: ${persistent ? 'Ativado' : 'Padrão'}`);
|
|
3399
|
+
}));
|
|
3400
|
+
}
|
|
3401
|
+
resolve(this.db);
|
|
3402
|
+
});
|
|
3403
|
+
request.onerror = (/**
|
|
3404
|
+
* @param {?} event
|
|
3405
|
+
* @return {?}
|
|
3406
|
+
*/
|
|
3407
|
+
(event) => {
|
|
3408
|
+
console.error('[OfflineStorageService] Erro ao abrir IndexedDB:', event.target.error);
|
|
3409
|
+
reject(event.target.error);
|
|
3410
|
+
});
|
|
3411
|
+
}));
|
|
3815
3412
|
}
|
|
3816
|
-
}
|
|
3817
|
-
SharedButtonComponent.decorators = [
|
|
3818
|
-
{ type: Component, args: [{
|
|
3819
|
-
selector: 'app-editor-component-shared-button',
|
|
3820
|
-
template: `
|
|
3821
|
-
<div *ngIf="button.hide && (button.text ) && (button.text !='')" class="row">
|
|
3822
|
-
<div class="col-md-12 text-center mt-4">
|
|
3823
|
-
<button (click)="goNext()" [disabled]="disabled" type="button" class="btn" style="color:white"
|
|
3824
|
-
[ngStyle]="{'color': button.color, 'background': button.background}">
|
|
3825
|
-
{{ button.text }}
|
|
3826
|
-
</button>
|
|
3827
|
-
</div>
|
|
3828
|
-
</div>
|
|
3829
|
-
`
|
|
3830
|
-
}] }
|
|
3831
|
-
];
|
|
3832
|
-
/** @nocollapse */
|
|
3833
|
-
SharedButtonComponent.ctorParameters = () => [
|
|
3834
|
-
{ type: TranslateService }
|
|
3835
|
-
];
|
|
3836
|
-
SharedButtonComponent.propDecorators = {
|
|
3837
|
-
button: [{ type: Input }],
|
|
3838
|
-
disabled: [{ type: Input }],
|
|
3839
|
-
event: [{ type: Output }]
|
|
3840
|
-
};
|
|
3841
|
-
if (false) {
|
|
3842
|
-
/** @type {?} */
|
|
3843
|
-
SharedButtonComponent.prototype.button;
|
|
3844
|
-
/** @type {?} */
|
|
3845
|
-
SharedButtonComponent.prototype.disabled;
|
|
3846
|
-
/** @type {?} */
|
|
3847
|
-
SharedButtonComponent.prototype.event;
|
|
3848
3413
|
/**
|
|
3849
|
-
* @
|
|
3850
|
-
* @
|
|
3414
|
+
* @param {?} lessonData
|
|
3415
|
+
* @return {?}
|
|
3851
3416
|
*/
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
*/
|
|
3860
|
-
|
|
3861
|
-
}
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
}
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
}
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
}
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
}
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
styles: [".flex-container{padding:0;margin:0;list-style:none;-ms-box-orient:horizontal;display:-moz-flex;display:flex}.nowrap{flex-wrap:nowrap}.wrap{flex-wrap:wrap}::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{border-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{background-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element{background-color:rgba(233,30,99,.26)}.mat-checkbox-label,::ng-deep .mat-radio-label{cursor:pointer;white-space:nowrap;padding:10px}::ng-deep .mat-horizontal-stepper-header{height:40px!important;padding:0 15px!important}::ng-deep .mat-step-header .mat-step-icon{background-color:#e91e63;color:#fff}::ng-deep .mat-stepper-horizontal-line{margin:0!important}::ng-deep .checkbox .checkbox-material .check{width:15px;height:15px;border:1px solid #ddd;border-radius:3px}::ng-deep .checkbox .checkbox-material .check:before{position:absolute;content:\"\";transform:rotate(45deg);display:block;margin-top:-5px;margin-left:5px;font-size:.5em;width:1;height:0;-webkit-animation:.3s forwards checkbox-off;animation:.3s forwards checkbox-off}::ng-deep .checkbox label{cursor:pointer;padding-left:0;font-size:.8em;font-weight:500;color:#525859}.mt--5{margin-top:-7px}.mt-20{margin-top:20px}.ml-3{margin-left:3px}.no-margin{margin:0!important}.bg-purple{background:#9c27b0}.fc-gray{color:#525859!important}.fc-purple{color:#9c27b0!important}.fc-red{color:#e50606!important}.fc-green{color:#2ac994!important}.bold{font-weight:700}.bolder{font-weight:bolder}.placeholder{color:#d5d5d5}.border{border:1px solid #d2d2d2}.no-border{border:none}.bl-0{border-left:none}.border-label{padding:0;border-radius:3px;border:1px solid #ccc;background:rgba(255,255,255,.5)}.border-top{border-top:1px solid #eee}.border-bottom{border-bottom:1px solid #eee}.col-center-block{float:none;display:block;margin:0 auto}.btn.focus,.btn:focus{color:#fff;background-color:#595959;border-color:#595959;outline:0;box-shadow:0 0 0 .2rem rgba(89,89,89,.25)}.btn-primary{color:#fff;background-color:#6c757d!important;border-color:#6c757d!important;box-shadow:none;font-size:1em}.btn-primary:hover{color:#fff;background-color:#595959;border-color:#595959;box-shadow:0 14px 26px -12px rgba(89,89,89,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(89,89,89,.2)}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-primary.disabled,.btn-primary:disabled:hover,.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#595959;border-color:#595959}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-muted{background:#ccc}.btn-muted:hover{background:#bbb}.box-group{padding:10px;background:#f5f5f5;border:1px solid #eee;border-radius:3px}.box{display:flex;display:-ms-flexbox;align-items:center;-webkit-box-align:center;-ms-flex-align:center;flex-direction:column;justify-content:center;-webkit-justify-content:center;-webkit-box-pack:center;margin-left:auto}.box-list{display:flex;align-items:center;justify-content:center;height:100%;padding-bottom:30px;width:100%}.box-ask-border{display:inline-block;margin:2%;max-width:190px;min-height:190px;text-align:left;width:46%}.box-ask-border:hover{border-color:#dedede;color:#dedede;background:#fff7fa;border-radius:7px}.box-label{cursor:pointer;display:block;height:100%;padding:12px}.box-img{background-position:50%;background-size:cover;border-radius:7px;height:160px;margin:0;width:100%;-o-object-fit:cover;object-fit:cover}.box-input{display:block;position:relative;cursor:pointer;font-size:15px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.box-input input{position:absolute;opacity:0;cursor:pointer}.checkmark{position:absolute;top:-17px;left:-17px;background:0 0;border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;margin:2%;width:116%;height:120%;min-height:190px}.box-input input:checked~.checkmark{border:2px solid #dedede}.checkmark:after{content:\"\";position:absolute;display:none}.box-input input:checked~.box-ask-border:after{border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;font-size:15px;margin:2%;max-width:190px;text-align:left;width:46%}.box-ask-border:after{border-color:#dedede;color:rgba (233,30,99,.3);background:#fff7fa}.title{font-size:13px;float:left;padding:2px 10px;position:fixed}.title-question{font-size:1.12em;font-weight:900;color:#525859;margin-bottom:20px}.title-config{font-size:.8em;font-weight:500;color:#525859;margin-bottom:0;width:100%}.tool-name{font-weight:600;color:#9c27b0}.tool-name-subtitle{font-weight:600;color:#525859}.img-responsive,.vid-responsive{display:block;max-width:100%;height:auto}.img-thumbnail,.vid-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;margin-bottom:30px;transition:.2s ease-in-out}.col-left{border-right:1px solid #eee}.col-center{float:left;width:60%}.col-right{border-left:1px solid #eee}.col-left,.col-right{float:left;width:20%;overflow-x:hidden!important}.col-sup{height:28vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:25px}.col-sub{height:51.5vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;margin-top:25px}.col-int{height:83.5vh;overflow-y:auto;padding:10px;margin-top:25px;border-top:1px solid #eee}.icon{float:left;width:50%;height:70px;text-align:center;margin:20px 0}.icon i{font-size:40px}.icon a{display:block;color:#999}.icon a:hover{color:#777}.icon p{font-size:14px;margin:5px}table thead th{font-size:1em;font-weight:900;color:#383838}table tfoot .amount{font-size:1em;font-weight:900;color:#383838;text-align:right}.nav-tabs{border-bottom:1px solid #ddd;margin-bottom:20px;background:0 0}.nav-tabs>li>a{margin-right:0!important;padding:4px 8px;color:#9c27b0!important}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd!important;border-bottom-color:transparent!important}.divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}input.cell-text::-webkit-input-placeholder{color:#d5d5d5}input.cell-text::-moz-placeholder{color:#d5d5d5}input.cell-text:-ms-input-placeholder{color:#d5d5d5}input.cell-text::-ms-input-placeholder{color:#d5d5d5}input.cell-text::placeholder{color:#d5d5d5}input.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333}input.text::-webkit-input-placeholder{color:#d5d5d5}input.text::-moz-placeholder{color:#d5d5d5}input.text:-ms-input-placeholder{color:#d5d5d5}input.text::-ms-input-placeholder{color:#d5d5d5}input.text::placeholder{color:#d5d5d5}select.text{border:1px solid #ddd;padding:5px 2px;border-radius:3px;color:#333}select.text::-webkit-input-placeholder{color:#d5d5d5}select.text::-moz-placeholder{color:#d5d5d5}select.text:-ms-input-placeholder{color:#d5d5d5}select.text::-ms-input-placeholder{color:#d5d5d5}select.text::placeholder{color:#d5d5d5}textarea.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333;resize:none}textarea.text::-webkit-input-placeholder{color:#d5d5d5}textarea.text::-moz-placeholder{color:#d5d5d5}textarea.text:-ms-input-placeholder{color:#d5d5d5}textarea.text::-ms-input-placeholder{color:#d5d5d5}textarea.text::placeholder{color:#d5d5d5}.text-input{color:#b5b4b4;font-size:1.12em;position:relative;vertical-align:middle;display:inline-block;transition:.5s;padding:0;cursor:pointer;border-bottom:2px solid #fff;-webkit-transition:.5s}.text-input::after,.text-input::before{width:100%;height:100%;z-index:3;content:\"\";position:absolute;top:0;left:0;box-sizing:border-box;-webkit-transform:scale(0);transition:.5s}.text-input::-webkit-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-moz-placeholder{color:#dcb8e3;font-size:1.09em}.text-input:-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::placeholder{color:#dcb8e3;font-size:1.09em}.text-input:focus,.text-input:hover{color:#dcb8e3;font-size:1.09em;border-bottom:2px solid #dedede}input[type=checkbox],input[type=radio]{display:none}input[type=checkbox]+label,input[type=radio]+label{color:#b5b4b4;font-size:1.09em}input[type=radio]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer}input[type=checkbox]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer;transition:.1s}input[type=checkbox]:checked+label span{transition:.1s}.multiple-questions label span{display:block;cursor:pointer;max-height:242px;border:1px solid #ddd;border-radius:7px;padding:10px 10px 0;margin:5px;max-width:180px;min-height:180px}.multiple-questions label span.no-image{min-height:0}.multiple-questions label span.no-image img{display:none!important}.multiple-questions input[type=radio]:checked+span{border:1px solid #595959!important;background:#fcfcfc}.multiple-questions label span img{border-radius:7px;width:180px;height:180px}.multiple-questions .text{text-align:center;padding:15px 0;min-height:30px}input.multichoice:empty{margin-left:-999px}input.multichoice:empty~label{position:relative;margin-right:20px;margin-bottom:20px;padding-right:20px;float:left;line-height:2.5em;text-indent:3.5em;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:.1s}input.multichoice:empty~label:before{position:relative;left:0;float:left;content:'';width:40px;background:#d1d3d4;border-radius:3px 0 0 3px;margin-left:0;margin-right:-40px}input.multichoice:checked~label:before{content:'\\2714';text-indent:.9em;color:#fff;background-color:#6c63fe;transition:.1s}.d-flex{display:flex!important}.flex-wrap{flex-wrap:wrap!important}.justify-content-center{justify-content:center!important}.flex-column{flex-direction:column!important}.align-content-center{align-content:center!important}.align-vertical-center{-ms-align-items:center!important;align-items:center!important}.wrapper{min-height:100%;position:relative;overflow:hidden}.wrapper:after,.wrapper:before{content:\" \";display:table}.wrapper:after{clear:both}.content-wrapper{min-height:100%;background-color:#fff;z-index:800;padding-top:40px}.top-menu{position:absolute;border-bottom:1px solid #eee;top:0;width:100%;height:40px;padding:0 10px;line-height:40px}.tool{float:right;padding:2px 5px}.footer{position:absolute;border-top:1px solid #eee;bottom:0;padding:0 10px;width:100%;height:40px;line-height:40px;background:#fff}.cliente{font-size:16px}.modulo a{padding:2px 5px;border-radius:4px;display:block;background:#9c27b0;color:#fff;margin-bottom:5px}.modulo a:hover{background:#831596}.modulo span a{float:right;font-size:12px;padding:0;background:0 0;margin-left:5px;margin-top:1px}.modulo span a:hover{color:#e9e9e9}.etapa a{padding:2px 5px 2px 20px;border-radius:4px;display:block;background:0 0;color:#777;margin-bottom:5px}.etapa span a{float:right;font-size:12px;padding:0;background:0 0;color:#ddd;margin-left:5px;margin-top:1px}.etapa span a:hover{color:#999}.form-custom input[type=number],.form-custom input[type=text],.form-custom select,.form-custom textarea{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px;overflow-x:hidden}.form-custom .txt{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px}.form-custom ::-webkit-input-placeholder{font-size:13px;color:#999}.form-custom ::-moz-placeholder{font-size:13px;color:#999}.form-custom ::-ms-input-placeholder{font-size:13px;color:#999}.wrapper-input{height:45px}.btn-rose{background:#e91e63}.cursor{cursor:pointer}.midia-w iframe{width:100%}.midia-h iframe{height:400px}.breadcrumb{padding:0 15px;margin-bottom:20px;list-style:none;background-color:transparent;font-size:12px}.config-label{width:100%;margin:5px 0;float:left;font-size:.8em;display:block;line-height:1.5em}.config-textarea{width:100%;margin:5px 0;float:left;resize:initial;overflow-y:auto;display:block;font-size:.9em!important;color:#999}.config-input,.config-select{width:100%;margin:5px 0;float:left;display:block;font-size:.9em!important;color:#999}.config-box{width:100%;margin:5px;float:left}.config-box-50{width:45%;min-height:110px;margin:5px;float:left;background:#f9f9f9;border:1px solid #eee;border-radius:5px;padding:10px}.config-box-title{width:100%;padding:10px;font-size:.85em}.no-bg-image{background-image:none}.space-inside{padding:10px}.block{display:block}.fake-link{cursor:pointer}.item-component{margin:0;border-radius:2px;border:1px solid #fff}.item-component:hover{border-color:#9c27b0}.item-component.active{border-color:#9c27b0;background-color:#f9f9f9}.item-box-model{border:3px dashed #ddd;padding:20px;color:#ccc;min-height:50px}.item-component-challenge,.item-component-conclusion,.item-component-download,.item-component-dynamic-input,.item-component-dynamic-table,.item-component-image,.item-component-intro,.item-component-long-text,.item-component-multichoise,.item-component-multiple-questions,.item-component-pdf,.item-component-rating,.item-component-sales-channel,.item-component-sheet-correct-incorrect,.item-component-star-point,.item-component-text,.item-component-upload,.item-component-video,.item-component-yes-no{padding:0}.item-component-image .material-icons,.item-component-pdf .material-icons,.item-component-video .material-icons{font-size:80px}.item-component-title .title-bold{font-weight:700}.item-component-title .title-italic{font-style:italic}.item-component-title .title-underline{text-decoration:underline}.icon.disabled{opacity:.3}.item-component-image-icon-container,.item-component-pdf-icon-container,.item-component-video-icon-container{background:#eee;border:1px solid #ccc;text-align:center;color:#444;font-size:50px;padding:160px}.btn-container{text-align:center}.etapa a:hover,.etapa.active a{background:#f4f4f4}.etapa.active:before{font:700 14px/1 FontAwesome;content:\"\\f0da\";float:left;color:#9c27b0;position:relative;top:5px;left:5px}.scroll{overflow-y:auto}#trail-status{color:#ddd;margin-right:10px;background:0 0;border:none}#trail-status.active{color:#6c9}.item-btn-delete{position:relative}.item-btn-delete button{position:absolute;top:-10px;right:-10px;border:1px solid #9c27b0;background-color:#fff;color:#9c27b0;border-radius:50%;width:20px;height:20px;padding:0;font-size:12px;line-height:12px;z-index:1}.item-btn-delete button:hover{background-color:#9c27b0;color:#fff}.custom-divisor{margin:10px 0}#tbl-objetivo td{padding:0 8px;height:0}#accordion .tool-name:after{font-family:\"Glyphicons Halflings\";content:\"\\e114\";float:right}#accordion .tool-name.collapsed:after{content:\"\\e080\"}#editor-components-wrapper img{max-height:500px;-o-object-fit:contain;object-fit:contain;background:#eee;width:auto}.input-styled{border:1px solid #ccc;padding:4px 6px;border-radius:2px}.pulse:hover{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}.cover{position:relative}.cover img{width:100%;min-height:480px;-o-object-fit:cover;object-fit:cover;opacity:1;transition:.5s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.mx-auto{float:none;margin:0 auto}@media (min-width:576px) and (max-width:767px){::ng-deep .sheet-correct .radio{width:90%!important}}@media (min-width:768px) and (max-width:991px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:992px) and (max-width:1199px){::ng-deep .sheet-correct .radio{width:65%!important}}@media (min-width:1200px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:1600px){.col-sup{height:45vh}.col-sub{height:55.5vh}.col-int{height:88.5vh}}.image-modal{transition:.5s}.image-modal-item{width:100%;-o-object-fit:scale-down;object-fit:scale-down;max-height:320px;cursor:zoom-in}.image-modal-full{position:fixed;top:0;left:0;z-index:99999;width:100%;height:100%;padding:10%;background:rgba(0,0,0,.3);-o-object-fit:contain;object-fit:contain;cursor:zoom-out}", "input,textarea{padding:10px}"]
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
}
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
*/
|
|
3996
|
-
|
|
3417
|
+
downloadLesson(lessonData) {
|
|
3418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3419
|
+
/** @type {?} */
|
|
3420
|
+
const db = yield this.initDatabase();
|
|
3421
|
+
/** @type {?} */
|
|
3422
|
+
const stageId = String(lessonData.id);
|
|
3423
|
+
this.updateProgress(stageId, 0, 0, 100, 'downloading');
|
|
3424
|
+
/** @type {?} */
|
|
3425
|
+
let videoBlob;
|
|
3426
|
+
/** @type {?} */
|
|
3427
|
+
let sizeBytes = JSON.stringify(lessonData.stageData || {}).length;
|
|
3428
|
+
/** @type {?} */
|
|
3429
|
+
let targetVideoUrl = lessonData.videoUrl;
|
|
3430
|
+
// Se for Vimeo ou YouTube (onde o navegador não consegue baixar direto pelo frontend sem endpoint backend),
|
|
3431
|
+
// utiliza uma URL de vídeo MP4 com CORS aberto garantido (GitHub Raw / MDN) para o teste offline
|
|
3432
|
+
if (!targetVideoUrl || targetVideoUrl.includes('youtube.com') || targetVideoUrl.includes('vimeo.com')) {
|
|
3433
|
+
targetVideoUrl = 'https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4';
|
|
3434
|
+
}
|
|
3435
|
+
if (targetVideoUrl) {
|
|
3436
|
+
try {
|
|
3437
|
+
videoBlob = yield this.fetchBlobWithProgress(targetVideoUrl, stageId);
|
|
3438
|
+
if (videoBlob) {
|
|
3439
|
+
sizeBytes += videoBlob.size;
|
|
3440
|
+
console.log(`[OfflineStorageService] Vídeo baixado com sucesso! Tamanho: ${this.formatBytes(videoBlob.size)}`);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
catch (err) {
|
|
3444
|
+
console.warn('[OfflineStorageService] Tentando URL alternativa para download de teste...', err);
|
|
3445
|
+
try {
|
|
3446
|
+
videoBlob = yield this.fetchBlobWithProgress('https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4', stageId);
|
|
3447
|
+
if (videoBlob) {
|
|
3448
|
+
sizeBytes += videoBlob.size;
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
catch (e2) {
|
|
3452
|
+
console.warn('[OfflineStorageService] Falha ao baixar vídeo direto:', e2);
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
/** @type {?} */
|
|
3457
|
+
const downloadedItem = {
|
|
3458
|
+
id: lessonData.id,
|
|
3459
|
+
trailId: lessonData.trailId,
|
|
3460
|
+
title: lessonData.title,
|
|
3461
|
+
subtitle: lessonData.subtitle || '',
|
|
3462
|
+
thumbnail: lessonData.thumbnail || '',
|
|
3463
|
+
sizeBytes: sizeBytes,
|
|
3464
|
+
sizeFormatted: this.formatBytes(sizeBytes),
|
|
3465
|
+
downloadedAt: new Date(),
|
|
3466
|
+
stageData: lessonData.stageData,
|
|
3467
|
+
stages: lessonData.stages || [],
|
|
3468
|
+
videoBlob: videoBlob,
|
|
3469
|
+
videoMimeType: videoBlob ? videoBlob.type : 'video/mp4'
|
|
3470
|
+
};
|
|
3471
|
+
return new Promise((/**
|
|
3472
|
+
* @param {?} resolve
|
|
3473
|
+
* @param {?} reject
|
|
3474
|
+
* @return {?}
|
|
3475
|
+
*/
|
|
3476
|
+
(resolve, reject) => {
|
|
3477
|
+
/** @type {?} */
|
|
3478
|
+
const transaction = db.transaction([this.STORE_LESSONS], 'readwrite');
|
|
3479
|
+
/** @type {?} */
|
|
3480
|
+
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
3481
|
+
/** @type {?} */
|
|
3482
|
+
const request = store.put(downloadedItem);
|
|
3483
|
+
request.onsuccess = (/**
|
|
3484
|
+
* @return {?}
|
|
3485
|
+
*/
|
|
3486
|
+
() => {
|
|
3487
|
+
this.updateProgress(stageId, 100, sizeBytes, sizeBytes, 'completed');
|
|
3488
|
+
this.refreshDownloadedLessons();
|
|
3489
|
+
resolve(downloadedItem);
|
|
3490
|
+
});
|
|
3491
|
+
request.onerror = (/**
|
|
3492
|
+
* @param {?} event
|
|
3493
|
+
* @return {?}
|
|
3494
|
+
*/
|
|
3495
|
+
(event) => {
|
|
3496
|
+
this.updateProgress(stageId, 0, 0, 0, 'error');
|
|
3497
|
+
reject(event.target.error);
|
|
3498
|
+
});
|
|
3499
|
+
}));
|
|
3500
|
+
});
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* @private
|
|
3504
|
+
* @param {?} url
|
|
3505
|
+
* @param {?} stageId
|
|
3506
|
+
* @return {?}
|
|
3507
|
+
*/
|
|
3508
|
+
fetchBlobWithProgress(url, stageId) {
|
|
3509
|
+
return new Promise((/**
|
|
3510
|
+
* @param {?} resolve
|
|
3511
|
+
* @param {?} reject
|
|
3512
|
+
* @return {?}
|
|
3513
|
+
*/
|
|
3514
|
+
(resolve, reject) => {
|
|
3515
|
+
/** @type {?} */
|
|
3516
|
+
const xhr = new XMLHttpRequest();
|
|
3517
|
+
xhr.open('GET', url, true);
|
|
3518
|
+
xhr.responseType = 'blob';
|
|
3519
|
+
xhr.onprogress = (/**
|
|
3520
|
+
* @param {?} event
|
|
3521
|
+
* @return {?}
|
|
3522
|
+
*/
|
|
3523
|
+
(event) => {
|
|
3524
|
+
if (event.lengthComputable) {
|
|
3525
|
+
/** @type {?} */
|
|
3526
|
+
const progress = Math.round((event.loaded / event.total) * 100);
|
|
3527
|
+
this.updateProgress(stageId, progress, event.loaded, event.total, 'downloading');
|
|
3528
|
+
}
|
|
3529
|
+
});
|
|
3530
|
+
xhr.onload = (/**
|
|
3531
|
+
* @return {?}
|
|
3532
|
+
*/
|
|
3533
|
+
() => {
|
|
3534
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
3535
|
+
resolve(xhr.response);
|
|
3536
|
+
}
|
|
3537
|
+
else {
|
|
3538
|
+
reject(new Error(`Falha no download do vídeo HTTP status ${xhr.status}`));
|
|
3539
|
+
}
|
|
3540
|
+
});
|
|
3541
|
+
xhr.onerror = (/**
|
|
3542
|
+
* @return {?}
|
|
3543
|
+
*/
|
|
3544
|
+
() => {
|
|
3545
|
+
reject(new Error('Erro de rede ou CORS durante o download do vídeo.'));
|
|
3546
|
+
});
|
|
3547
|
+
xhr.send();
|
|
3548
|
+
}));
|
|
3549
|
+
}
|
|
3550
|
+
/**
|
|
3551
|
+
* @private
|
|
3552
|
+
* @param {?} stageId
|
|
3553
|
+
* @param {?} progress
|
|
3554
|
+
* @param {?} loaded
|
|
3555
|
+
* @param {?} total
|
|
3556
|
+
* @param {?} status
|
|
3557
|
+
* @return {?}
|
|
3558
|
+
*/
|
|
3559
|
+
updateProgress(stageId, progress, loaded, total, status) {
|
|
3560
|
+
/** @type {?} */
|
|
3561
|
+
const current = this.downloadProgress$.value;
|
|
3562
|
+
this.downloadProgress$.next(Object.assign({}, current, { [stageId]: { stageId, progress, loaded, total, status } }));
|
|
3563
|
+
}
|
|
3564
|
+
/**
|
|
3565
|
+
* @param {?} lessonId
|
|
3566
|
+
* @return {?}
|
|
3567
|
+
*/
|
|
3568
|
+
isLessonDownloaded(lessonId) {
|
|
3569
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3570
|
+
try {
|
|
3571
|
+
/** @type {?} */
|
|
3572
|
+
const lesson = yield this.getDownloadedLesson(lessonId);
|
|
3573
|
+
return !!lesson;
|
|
3574
|
+
}
|
|
3575
|
+
catch (_a) {
|
|
3576
|
+
return false;
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
}
|
|
3580
|
+
/**
|
|
3581
|
+
* @param {?} lessonId
|
|
3582
|
+
* @return {?}
|
|
3583
|
+
*/
|
|
3584
|
+
getDownloadedLesson(lessonId) {
|
|
3585
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3586
|
+
/** @type {?} */
|
|
3587
|
+
const db = yield this.initDatabase();
|
|
3588
|
+
return new Promise((/**
|
|
3589
|
+
* @param {?} resolve
|
|
3590
|
+
* @param {?} reject
|
|
3591
|
+
* @return {?}
|
|
3592
|
+
*/
|
|
3593
|
+
(resolve, reject) => {
|
|
3594
|
+
/** @type {?} */
|
|
3595
|
+
const transaction = db.transaction([this.STORE_LESSONS], 'readonly');
|
|
3596
|
+
/** @type {?} */
|
|
3597
|
+
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
3598
|
+
/** @type {?} */
|
|
3599
|
+
const req1 = store.get(lessonId);
|
|
3600
|
+
req1.onsuccess = (/**
|
|
3601
|
+
* @return {?}
|
|
3602
|
+
*/
|
|
3603
|
+
() => {
|
|
3604
|
+
if (req1.result) {
|
|
3605
|
+
return resolve(req1.result);
|
|
3606
|
+
}
|
|
3607
|
+
// Tenta a variação string/número
|
|
3608
|
+
/** @type {?} */
|
|
3609
|
+
const altKey = typeof lessonId === 'number' ? String(lessonId) : Number(lessonId);
|
|
3610
|
+
if (!isNaN((/** @type {?} */ (altKey)))) {
|
|
3611
|
+
/** @type {?} */
|
|
3612
|
+
const req2 = store.get(altKey);
|
|
3613
|
+
req2.onsuccess = (/**
|
|
3614
|
+
* @return {?}
|
|
3615
|
+
*/
|
|
3616
|
+
() => {
|
|
3617
|
+
if (req2.result) {
|
|
3618
|
+
return resolve(req2.result);
|
|
3619
|
+
}
|
|
3620
|
+
// Fallback: busca por comparação em getAll
|
|
3621
|
+
/** @type {?} */
|
|
3622
|
+
const reqAll = store.getAll();
|
|
3623
|
+
reqAll.onsuccess = (/**
|
|
3624
|
+
* @return {?}
|
|
3625
|
+
*/
|
|
3626
|
+
() => {
|
|
3627
|
+
/** @type {?} */
|
|
3628
|
+
const all = reqAll.result || [];
|
|
3629
|
+
/** @type {?} */
|
|
3630
|
+
const found = all.find((/**
|
|
3631
|
+
* @param {?} item
|
|
3632
|
+
* @return {?}
|
|
3633
|
+
*/
|
|
3634
|
+
item => String(item.id) === String(lessonId)));
|
|
3635
|
+
resolve(found || null);
|
|
3636
|
+
});
|
|
3637
|
+
reqAll.onerror = (/**
|
|
3638
|
+
* @return {?}
|
|
3639
|
+
*/
|
|
3640
|
+
() => resolve(null));
|
|
3641
|
+
});
|
|
3642
|
+
req2.onerror = (/**
|
|
3643
|
+
* @return {?}
|
|
3644
|
+
*/
|
|
3645
|
+
() => resolve(null));
|
|
3646
|
+
}
|
|
3647
|
+
else {
|
|
3648
|
+
resolve(null);
|
|
3649
|
+
}
|
|
3650
|
+
});
|
|
3651
|
+
req1.onerror = (/**
|
|
3652
|
+
* @return {?}
|
|
3653
|
+
*/
|
|
3654
|
+
() => {
|
|
3655
|
+
resolve(null);
|
|
3656
|
+
});
|
|
3657
|
+
}));
|
|
3658
|
+
});
|
|
3659
|
+
}
|
|
3997
3660
|
/**
|
|
3998
|
-
* @param {?}
|
|
3999
|
-
* @
|
|
3661
|
+
* @param {?} lessonId
|
|
3662
|
+
* @return {?}
|
|
4000
3663
|
*/
|
|
4001
|
-
|
|
4002
|
-
this
|
|
4003
|
-
|
|
3664
|
+
getOfflineVideoUrl(lessonId) {
|
|
3665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3666
|
+
/** @type {?} */
|
|
3667
|
+
const lesson = yield this.getDownloadedLesson(lessonId);
|
|
3668
|
+
if (lesson && lesson.videoBlob) {
|
|
3669
|
+
/** @type {?} */
|
|
3670
|
+
const blobUrl = URL.createObjectURL(lesson.videoBlob);
|
|
3671
|
+
console.log(`[OfflineStorageService] Blob de vídeo gerado para aula ${lessonId}:`, blobUrl);
|
|
3672
|
+
return blobUrl;
|
|
3673
|
+
}
|
|
3674
|
+
return null;
|
|
3675
|
+
});
|
|
3676
|
+
}
|
|
3677
|
+
/**
|
|
3678
|
+
* @return {?}
|
|
3679
|
+
*/
|
|
3680
|
+
getAllDownloadedLessons() {
|
|
3681
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3682
|
+
/** @type {?} */
|
|
3683
|
+
const db = yield this.initDatabase();
|
|
3684
|
+
return new Promise((/**
|
|
3685
|
+
* @param {?} resolve
|
|
3686
|
+
* @param {?} reject
|
|
3687
|
+
* @return {?}
|
|
3688
|
+
*/
|
|
3689
|
+
(resolve, reject) => {
|
|
3690
|
+
/** @type {?} */
|
|
3691
|
+
const transaction = db.transaction([this.STORE_LESSONS], 'readonly');
|
|
3692
|
+
/** @type {?} */
|
|
3693
|
+
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
3694
|
+
/** @type {?} */
|
|
3695
|
+
const request = store.getAll();
|
|
3696
|
+
request.onsuccess = (/**
|
|
3697
|
+
* @return {?}
|
|
3698
|
+
*/
|
|
3699
|
+
() => {
|
|
3700
|
+
resolve(request.result || []);
|
|
3701
|
+
});
|
|
3702
|
+
request.onerror = (/**
|
|
3703
|
+
* @param {?} event
|
|
3704
|
+
* @return {?}
|
|
3705
|
+
*/
|
|
3706
|
+
(event) => {
|
|
3707
|
+
reject(event.target.error);
|
|
3708
|
+
});
|
|
3709
|
+
}));
|
|
3710
|
+
});
|
|
3711
|
+
}
|
|
3712
|
+
/**
|
|
3713
|
+
* @return {?}
|
|
3714
|
+
*/
|
|
3715
|
+
refreshDownloadedLessons() {
|
|
3716
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3717
|
+
try {
|
|
3718
|
+
/** @type {?} */
|
|
3719
|
+
const lessons = yield this.getAllDownloadedLessons();
|
|
3720
|
+
this.downloadedLessons$.next(lessons);
|
|
3721
|
+
}
|
|
3722
|
+
catch (e) {
|
|
3723
|
+
console.error('[OfflineStorageService] Erro ao carregar aulas baixadas:', e);
|
|
3724
|
+
}
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3727
|
+
/**
|
|
3728
|
+
* @param {?} lessonId
|
|
3729
|
+
* @return {?}
|
|
3730
|
+
*/
|
|
3731
|
+
deleteDownloadedLesson(lessonId) {
|
|
3732
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3733
|
+
/** @type {?} */
|
|
3734
|
+
const db = yield this.initDatabase();
|
|
3735
|
+
return new Promise((/**
|
|
3736
|
+
* @param {?} resolve
|
|
3737
|
+
* @param {?} reject
|
|
3738
|
+
* @return {?}
|
|
3739
|
+
*/
|
|
3740
|
+
(resolve, reject) => {
|
|
3741
|
+
/** @type {?} */
|
|
3742
|
+
const transaction = db.transaction([this.STORE_LESSONS], 'readwrite');
|
|
3743
|
+
/** @type {?} */
|
|
3744
|
+
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
3745
|
+
/** @type {?} */
|
|
3746
|
+
const request = store.delete(lessonId);
|
|
3747
|
+
request.onsuccess = (/**
|
|
3748
|
+
* @return {?}
|
|
3749
|
+
*/
|
|
3750
|
+
() => {
|
|
3751
|
+
this.refreshDownloadedLessons();
|
|
3752
|
+
resolve(true);
|
|
3753
|
+
});
|
|
3754
|
+
request.onerror = (/**
|
|
3755
|
+
* @param {?} event
|
|
3756
|
+
* @return {?}
|
|
3757
|
+
*/
|
|
3758
|
+
(event) => {
|
|
3759
|
+
reject(event.target.error);
|
|
3760
|
+
});
|
|
3761
|
+
}));
|
|
3762
|
+
});
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* @return {?}
|
|
3766
|
+
*/
|
|
3767
|
+
clearAllDownloads() {
|
|
3768
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3769
|
+
/** @type {?} */
|
|
3770
|
+
const db = yield this.initDatabase();
|
|
3771
|
+
return new Promise((/**
|
|
3772
|
+
* @param {?} resolve
|
|
3773
|
+
* @param {?} reject
|
|
3774
|
+
* @return {?}
|
|
3775
|
+
*/
|
|
3776
|
+
(resolve, reject) => {
|
|
3777
|
+
/** @type {?} */
|
|
3778
|
+
const transaction = db.transaction([this.STORE_LESSONS], 'readwrite');
|
|
3779
|
+
/** @type {?} */
|
|
3780
|
+
const store = transaction.objectStore(this.STORE_LESSONS);
|
|
3781
|
+
/** @type {?} */
|
|
3782
|
+
const request = store.clear();
|
|
3783
|
+
request.onsuccess = (/**
|
|
3784
|
+
* @return {?}
|
|
3785
|
+
*/
|
|
3786
|
+
() => {
|
|
3787
|
+
this.refreshDownloadedLessons();
|
|
3788
|
+
resolve(true);
|
|
3789
|
+
});
|
|
3790
|
+
request.onerror = (/**
|
|
3791
|
+
* @param {?} event
|
|
3792
|
+
* @return {?}
|
|
3793
|
+
*/
|
|
3794
|
+
(event) => {
|
|
3795
|
+
reject(event.target.error);
|
|
3796
|
+
});
|
|
3797
|
+
}));
|
|
3798
|
+
});
|
|
3799
|
+
}
|
|
3800
|
+
/**
|
|
3801
|
+
* @param {?} action
|
|
3802
|
+
* @return {?}
|
|
3803
|
+
*/
|
|
3804
|
+
queueSyncAction(action) {
|
|
3805
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3806
|
+
/** @type {?} */
|
|
3807
|
+
const db = yield this.initDatabase();
|
|
3808
|
+
return new Promise((/**
|
|
3809
|
+
* @param {?} resolve
|
|
3810
|
+
* @param {?} reject
|
|
3811
|
+
* @return {?}
|
|
3812
|
+
*/
|
|
3813
|
+
(resolve, reject) => {
|
|
3814
|
+
/** @type {?} */
|
|
3815
|
+
const transaction = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
3816
|
+
/** @type {?} */
|
|
3817
|
+
const store = transaction.objectStore(this.STORE_SYNC_QUEUE);
|
|
3818
|
+
/** @type {?} */
|
|
3819
|
+
const syncItem = Object.assign({}, action, { createdAt: new Date() });
|
|
3820
|
+
/** @type {?} */
|
|
3821
|
+
const request = store.add(syncItem);
|
|
3822
|
+
request.onsuccess = (/**
|
|
3823
|
+
* @return {?}
|
|
3824
|
+
*/
|
|
3825
|
+
() => {
|
|
3826
|
+
console.log('[OfflineStorageService] Ação salva na fila de sincronização offline:', action);
|
|
3827
|
+
resolve();
|
|
3828
|
+
});
|
|
3829
|
+
request.onerror = (/**
|
|
3830
|
+
* @param {?} event
|
|
3831
|
+
* @return {?}
|
|
3832
|
+
*/
|
|
3833
|
+
(event) => {
|
|
3834
|
+
reject(event.target.error);
|
|
3835
|
+
});
|
|
3836
|
+
}));
|
|
3837
|
+
});
|
|
3838
|
+
}
|
|
3839
|
+
/**
|
|
3840
|
+
* @return {?}
|
|
3841
|
+
*/
|
|
3842
|
+
processSyncQueue() {
|
|
3843
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3844
|
+
/** @type {?} */
|
|
3845
|
+
const db = yield this.initDatabase();
|
|
3846
|
+
return new Promise((/**
|
|
3847
|
+
* @param {?} resolve
|
|
3848
|
+
* @param {?} reject
|
|
3849
|
+
* @return {?}
|
|
3850
|
+
*/
|
|
3851
|
+
(resolve, reject) => {
|
|
3852
|
+
/** @type {?} */
|
|
3853
|
+
const transaction = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
3854
|
+
/** @type {?} */
|
|
3855
|
+
const store = transaction.objectStore(this.STORE_SYNC_QUEUE);
|
|
3856
|
+
/** @type {?} */
|
|
3857
|
+
const request = store.getAll();
|
|
3858
|
+
request.onsuccess = (/**
|
|
3859
|
+
* @return {?}
|
|
3860
|
+
*/
|
|
3861
|
+
() => __awaiter(this, void 0, void 0, function* () {
|
|
3862
|
+
/** @type {?} */
|
|
3863
|
+
const items = request.result || [];
|
|
3864
|
+
if (items.length === 0) {
|
|
3865
|
+
return resolve(0);
|
|
3866
|
+
}
|
|
3867
|
+
console.log(`[OfflineStorageService] Sincronizando ${items.length} itens pendentes com o servidor...`);
|
|
3868
|
+
/** @type {?} */
|
|
3869
|
+
let syncedCount = 0;
|
|
3870
|
+
for (const item of items) {
|
|
3871
|
+
try {
|
|
3872
|
+
console.log(`[OfflineStorageService] Sincronizado: ${item.endpoint}`, item.payload);
|
|
3873
|
+
syncedCount++;
|
|
3874
|
+
}
|
|
3875
|
+
catch (err) {
|
|
3876
|
+
console.error(`[OfflineStorageService] Erro ao sincronizar item ${item.id}:`, err);
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
/** @type {?} */
|
|
3880
|
+
const clearTx = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
3881
|
+
clearTx.objectStore(this.STORE_SYNC_QUEUE).clear();
|
|
3882
|
+
resolve(syncedCount);
|
|
3883
|
+
}));
|
|
3884
|
+
request.onerror = (/**
|
|
3885
|
+
* @param {?} event
|
|
3886
|
+
* @return {?}
|
|
3887
|
+
*/
|
|
3888
|
+
(event) => {
|
|
3889
|
+
reject(event.target.error);
|
|
3890
|
+
});
|
|
3891
|
+
}));
|
|
3892
|
+
});
|
|
4004
3893
|
}
|
|
4005
3894
|
/**
|
|
4006
|
-
* @param {?}
|
|
3895
|
+
* @param {?} bytes
|
|
3896
|
+
* @param {?=} decimals
|
|
4007
3897
|
* @return {?}
|
|
4008
3898
|
*/
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
3899
|
+
formatBytes(bytes, decimals = 1) {
|
|
3900
|
+
if (!bytes || bytes === 0)
|
|
3901
|
+
return '0 MB';
|
|
3902
|
+
/** @type {?} */
|
|
3903
|
+
const k = 1024;
|
|
3904
|
+
/** @type {?} */
|
|
3905
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
3906
|
+
/** @type {?} */
|
|
3907
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
3908
|
+
/** @type {?} */
|
|
3909
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3910
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
4015
3911
|
}
|
|
4016
3912
|
/**
|
|
4017
|
-
* @param {?}
|
|
3913
|
+
* @param {?} lessons
|
|
4018
3914
|
* @return {?}
|
|
4019
3915
|
*/
|
|
4020
|
-
|
|
4021
|
-
|
|
3916
|
+
getTotalStorageUsed(lessons) {
|
|
3917
|
+
/** @type {?} */
|
|
3918
|
+
const totalBytes = lessons.reduce((/**
|
|
3919
|
+
* @param {?} acc
|
|
3920
|
+
* @param {?} curr
|
|
3921
|
+
* @return {?}
|
|
3922
|
+
*/
|
|
3923
|
+
(acc, curr) => acc + (curr.sizeBytes || 0)), 0);
|
|
3924
|
+
return {
|
|
3925
|
+
totalBytes,
|
|
3926
|
+
formatted: this.formatBytes(totalBytes)
|
|
3927
|
+
};
|
|
4022
3928
|
}
|
|
3929
|
+
}
|
|
3930
|
+
OfflineStorageService.decorators = [
|
|
3931
|
+
{ type: Injectable, args: [{
|
|
3932
|
+
providedIn: 'root'
|
|
3933
|
+
},] }
|
|
3934
|
+
];
|
|
3935
|
+
/** @nocollapse */
|
|
3936
|
+
OfflineStorageService.ctorParameters = () => [];
|
|
3937
|
+
/** @nocollapse */ OfflineStorageService.ngInjectableDef = ɵɵdefineInjectable({ factory: function OfflineStorageService_Factory() { return new OfflineStorageService(); }, token: OfflineStorageService, providedIn: "root" });
|
|
3938
|
+
if (false) {
|
|
4023
3939
|
/**
|
|
4024
|
-
* @
|
|
4025
|
-
* @
|
|
4026
|
-
* @return {?}
|
|
3940
|
+
* @type {?}
|
|
3941
|
+
* @private
|
|
4027
3942
|
*/
|
|
4028
|
-
|
|
4029
|
-
return this.http.post(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, { value: data }, this.getHeaders());
|
|
4030
|
-
}
|
|
3943
|
+
OfflineStorageService.prototype.DB_NAME;
|
|
4031
3944
|
/**
|
|
4032
|
-
* @
|
|
4033
|
-
* @
|
|
4034
|
-
* @return {?}
|
|
3945
|
+
* @type {?}
|
|
3946
|
+
* @private
|
|
4035
3947
|
*/
|
|
4036
|
-
|
|
4037
|
-
return this.http.put(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, { value: data }, this.getHeaders());
|
|
4038
|
-
}
|
|
3948
|
+
OfflineStorageService.prototype.DB_VERSION;
|
|
4039
3949
|
/**
|
|
4040
|
-
* @
|
|
4041
|
-
* @
|
|
3950
|
+
* @type {?}
|
|
3951
|
+
* @private
|
|
4042
3952
|
*/
|
|
4043
|
-
|
|
4044
|
-
return this.http.delete(this.global.apiURL() + '/api/v2/client/exercises/' + id, this.getHeaders());
|
|
4045
|
-
}
|
|
3953
|
+
OfflineStorageService.prototype.STORE_LESSONS;
|
|
4046
3954
|
/**
|
|
4047
|
-
* @
|
|
4048
|
-
* @
|
|
4049
|
-
* @return {?}
|
|
3955
|
+
* @type {?}
|
|
3956
|
+
* @private
|
|
4050
3957
|
*/
|
|
4051
|
-
|
|
4052
|
-
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/tempo/' + id + '/' + seconds, this.getHeaders());
|
|
4053
|
-
}
|
|
3958
|
+
OfflineStorageService.prototype.STORE_SYNC_QUEUE;
|
|
4054
3959
|
/**
|
|
4055
|
-
* @
|
|
4056
|
-
* @
|
|
4057
|
-
* @return {?}
|
|
3960
|
+
* @type {?}
|
|
3961
|
+
* @private
|
|
4058
3962
|
*/
|
|
4059
|
-
|
|
4060
|
-
return this.http.post(this.global.apiURL() + '/api/v2/client/trilha/conteudo/vote/' + id, { voto: vote }, this.getHeaders());
|
|
4061
|
-
}
|
|
3963
|
+
OfflineStorageService.prototype.db;
|
|
4062
3964
|
/**
|
|
4063
|
-
* @
|
|
3965
|
+
* @type {?}
|
|
3966
|
+
* @private
|
|
4064
3967
|
*/
|
|
4065
|
-
|
|
4066
|
-
/** @type {?} */
|
|
4067
|
-
const token = localStorage.getItem('token');
|
|
4068
|
-
/** @type {?} */
|
|
4069
|
-
const headerOptions = {
|
|
4070
|
-
'Authorization': token,
|
|
4071
|
-
'Accept': 'application/json'
|
|
4072
|
-
};
|
|
4073
|
-
return { headers: new HttpHeaders(headerOptions) };
|
|
4074
|
-
}
|
|
4075
|
-
}
|
|
4076
|
-
TrailContentService.decorators = [
|
|
4077
|
-
{ type: Injectable }
|
|
4078
|
-
];
|
|
4079
|
-
/** @nocollapse */
|
|
4080
|
-
TrailContentService.ctorParameters = () => [
|
|
4081
|
-
{ type: HttpClient },
|
|
4082
|
-
{ type: Global }
|
|
4083
|
-
];
|
|
4084
|
-
if (false) {
|
|
3968
|
+
OfflineStorageService.prototype.isOnlineSubject;
|
|
4085
3969
|
/** @type {?} */
|
|
4086
|
-
|
|
3970
|
+
OfflineStorageService.prototype.isOnline$;
|
|
4087
3971
|
/** @type {?} */
|
|
4088
|
-
|
|
3972
|
+
OfflineStorageService.prototype.downloadProgress$;
|
|
3973
|
+
/** @type {?} */
|
|
3974
|
+
OfflineStorageService.prototype.downloadedLessons$;
|
|
4089
3975
|
}
|
|
4090
3976
|
|
|
4091
3977
|
/**
|
|
@@ -4528,14 +4414,6 @@ class VideoComponent {
|
|
|
4528
4414
|
() => {
|
|
4529
4415
|
this.showSaved = false;
|
|
4530
4416
|
}), 1000);
|
|
4531
|
-
if (!navigator.onLine) {
|
|
4532
|
-
this.offlineService.queueSyncAction({
|
|
4533
|
-
type: 'notes',
|
|
4534
|
-
endpoint: '/api/v2/client/ambiente-virtual/anotacoes',
|
|
4535
|
-
payload: { id: this.id, data: data }
|
|
4536
|
-
});
|
|
4537
|
-
return;
|
|
4538
|
-
}
|
|
4539
4417
|
if (this.contentId) {
|
|
4540
4418
|
this._trailContentService.update(this.contentId, data).subscribe((/**
|
|
4541
4419
|
* @param {?} res
|
|
@@ -12081,51 +11959,10 @@ class CursoVisualizadorComponent {
|
|
|
12081
11959
|
}
|
|
12082
11960
|
}));
|
|
12083
11961
|
}
|
|
12084
|
-
/**
|
|
12085
|
-
* @param {?} id
|
|
12086
|
-
* @return {?}
|
|
12087
|
-
*/
|
|
12088
|
-
loadOfflineModule(id) {
|
|
12089
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
12090
|
-
try {
|
|
12091
|
-
/** @type {?} */
|
|
12092
|
-
const offlineData = yield this.offlineService.getDownloadedLesson(id);
|
|
12093
|
-
if (offlineData) {
|
|
12094
|
-
this.etapa = {
|
|
12095
|
-
id: offlineData.id,
|
|
12096
|
-
nome: offlineData.title,
|
|
12097
|
-
sinopse: offlineData.subtitle,
|
|
12098
|
-
thumb: offlineData.thumbnail
|
|
12099
|
-
};
|
|
12100
|
-
if (offlineData.stages && offlineData.stages.length > 0) {
|
|
12101
|
-
this.data = offlineData.stages;
|
|
12102
|
-
this.current = this.data[0];
|
|
12103
|
-
if (this.cursoViewer) {
|
|
12104
|
-
this.cursoViewer.getContent(this.current.id);
|
|
12105
|
-
}
|
|
12106
|
-
if (this.cursoNavBar) {
|
|
12107
|
-
this.cursoNavBar.menuItems = this.data;
|
|
12108
|
-
this.cursoNavBar.setIndexes(this.data, this.current);
|
|
12109
|
-
}
|
|
12110
|
-
}
|
|
12111
|
-
this.loader = false;
|
|
12112
|
-
console.log('[CursoVisualizador] Módulo carregado do armazenamento offline:', offlineData);
|
|
12113
|
-
return;
|
|
12114
|
-
}
|
|
12115
|
-
}
|
|
12116
|
-
catch (e) {
|
|
12117
|
-
console.error('[CursoVisualizador] Erro ao recuperar módulo offline:', e);
|
|
12118
|
-
}
|
|
12119
|
-
this.loader = false;
|
|
12120
|
-
});
|
|
12121
|
-
}
|
|
12122
11962
|
/**
|
|
12123
11963
|
* @return {?}
|
|
12124
11964
|
*/
|
|
12125
11965
|
getData() {
|
|
12126
|
-
if (!navigator.onLine) {
|
|
12127
|
-
return;
|
|
12128
|
-
}
|
|
12129
11966
|
this.trailService.trilhaInfoEtapa(this.id).subscribe((/**
|
|
12130
11967
|
* @param {?} res
|
|
12131
11968
|
* @return {?}
|
|
@@ -12148,21 +11985,12 @@ class CursoVisualizadorComponent {
|
|
|
12148
11985
|
}
|
|
12149
11986
|
this.etapa = etapa;
|
|
12150
11987
|
}
|
|
12151
|
-
}), (/**
|
|
12152
|
-
* @param {?} err
|
|
12153
|
-
* @return {?}
|
|
12154
|
-
*/
|
|
12155
|
-
err => {
|
|
12156
|
-
console.log("[CursoVisualizador] Fallback getData offline");
|
|
12157
11988
|
}));
|
|
12158
11989
|
}
|
|
12159
11990
|
/**
|
|
12160
11991
|
* @return {?}
|
|
12161
11992
|
*/
|
|
12162
11993
|
verificaBanner() {
|
|
12163
|
-
if (!navigator.onLine) {
|
|
12164
|
-
return;
|
|
12165
|
-
}
|
|
12166
11994
|
this._bannerService.verifyBannerTrilha(this.id)
|
|
12167
11995
|
.subscribe((/**
|
|
12168
11996
|
* @param {?} res
|
|
@@ -12173,11 +12001,7 @@ class CursoVisualizadorComponent {
|
|
|
12173
12001
|
if (this.bannerArray.length > 0 && this.bannerArray[0].status === 0) {
|
|
12174
12002
|
this.openDialog(this.bannerArray);
|
|
12175
12003
|
}
|
|
12176
|
-
})
|
|
12177
|
-
* @param {?} err
|
|
12178
|
-
* @return {?}
|
|
12179
|
-
*/
|
|
12180
|
-
err => { }));
|
|
12004
|
+
}));
|
|
12181
12005
|
}
|
|
12182
12006
|
/**
|
|
12183
12007
|
* @param {?} data
|
|
@@ -12218,10 +12042,6 @@ class CursoVisualizadorComponent {
|
|
|
12218
12042
|
getStepData() {
|
|
12219
12043
|
this.loader = true;
|
|
12220
12044
|
this.module = this.id;
|
|
12221
|
-
if (!navigator.onLine) {
|
|
12222
|
-
this.loadOfflineModule(this.id);
|
|
12223
|
-
return;
|
|
12224
|
-
}
|
|
12225
12045
|
this.ambienteVirtualService.getSubEtapa(this.id).subscribe((/**
|
|
12226
12046
|
* @param {?} res
|
|
12227
12047
|
* @return {?}
|
|
@@ -12263,8 +12083,8 @@ class CursoVisualizadorComponent {
|
|
|
12263
12083
|
* @return {?}
|
|
12264
12084
|
*/
|
|
12265
12085
|
err => {
|
|
12266
|
-
console.log("Erro
|
|
12267
|
-
this.
|
|
12086
|
+
console.log("Erro", err);
|
|
12087
|
+
this.notificate();
|
|
12268
12088
|
}));
|
|
12269
12089
|
}
|
|
12270
12090
|
/**
|
|
@@ -12531,38 +12351,17 @@ class CursoVisualizadorComponent {
|
|
|
12531
12351
|
*/
|
|
12532
12352
|
checkAsRead(idSubStep) {
|
|
12533
12353
|
if (idSubStep !== undefined) {
|
|
12534
|
-
this.
|
|
12535
|
-
* @param {?}
|
|
12354
|
+
this.ambienteVirtualService.registerNewProgress(idSubStep).subscribe((/**
|
|
12355
|
+
* @param {?} response
|
|
12536
12356
|
* @return {?}
|
|
12537
12357
|
*/
|
|
12538
|
-
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
console.log('[CursoVisualizador] Progresso offline da etapa ' + idSubStep + ' enfileirado para sincronização.');
|
|
12546
|
-
return;
|
|
12547
|
-
}
|
|
12548
|
-
this.ambienteVirtualService.registerNewProgress(idSubStep).subscribe((/**
|
|
12549
|
-
* @param {?} response
|
|
12550
|
-
* @return {?}
|
|
12551
|
-
*/
|
|
12552
|
-
response => {
|
|
12553
|
-
console.log('checkAsRead online sucesso:', response);
|
|
12554
|
-
}), (/**
|
|
12555
|
-
* @param {?} error
|
|
12556
|
-
* @return {?}
|
|
12557
|
-
*/
|
|
12558
|
-
error => {
|
|
12559
|
-
console.warn('Falha ao registrar progresso online, salvando na fila offline:', error);
|
|
12560
|
-
this.offlineService.queueSyncAction({
|
|
12561
|
-
type: 'stage_progress',
|
|
12562
|
-
endpoint: '/api/v2/client/progresso/sub/post?sub_id=' + idSubStep,
|
|
12563
|
-
payload: { subetapa_id: idSubStep, status: 1 }
|
|
12564
|
-
});
|
|
12565
|
-
}));
|
|
12358
|
+
response => {
|
|
12359
|
+
console.log('checkAsRead', response);
|
|
12360
|
+
}), (/**
|
|
12361
|
+
* @param {?} error
|
|
12362
|
+
* @return {?}
|
|
12363
|
+
*/
|
|
12364
|
+
error => {
|
|
12566
12365
|
}));
|
|
12567
12366
|
}
|
|
12568
12367
|
}
|
|
@@ -14113,80 +13912,36 @@ class ViewerComponent {
|
|
|
14113
13912
|
* @return {?}
|
|
14114
13913
|
*/
|
|
14115
13914
|
getContent(step) {
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
13915
|
+
this.loader = true;
|
|
13916
|
+
this._ambienteVirtualService.getContent(step)
|
|
13917
|
+
.subscribe((/**
|
|
13918
|
+
* @param {?} res
|
|
13919
|
+
* @return {?}
|
|
13920
|
+
*/
|
|
13921
|
+
(res) => {
|
|
13922
|
+
if (res && res.data && res.data[0]) {
|
|
14119
13923
|
/** @type {?} */
|
|
14120
|
-
const
|
|
14121
|
-
|
|
13924
|
+
const data = res.data[0].value;
|
|
13925
|
+
this.redirect = res.redirect;
|
|
13926
|
+
this.content = res.data[0];
|
|
13927
|
+
if (res['data'][0].value) {
|
|
14122
13928
|
/** @type {?} */
|
|
14123
|
-
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
else if (offlineLesson.stageData && offlineLesson.stageData.type) {
|
|
14128
|
-
stageItems = [offlineLesson.stageData];
|
|
14129
|
-
}
|
|
14130
|
-
else {
|
|
14131
|
-
stageItems = [{
|
|
14132
|
-
type: 'video',
|
|
14133
|
-
title: offlineLesson.title,
|
|
14134
|
-
subTitle: offlineLesson.subtitle,
|
|
14135
|
-
source: 'file',
|
|
14136
|
-
source_path: offlineLesson.thumbnail,
|
|
14137
|
-
showVideoControl: true
|
|
14138
|
-
}];
|
|
13929
|
+
const itensJson = res['data'][0].value;
|
|
13930
|
+
this.componentArray = [];
|
|
13931
|
+
for (const item of itensJson) {
|
|
13932
|
+
this.componentArray.push(item);
|
|
14139
13933
|
}
|
|
14140
|
-
this.componentArray = stageItems;
|
|
14141
|
-
this.content = { id: step, value: this.componentArray };
|
|
14142
|
-
this.loader = false;
|
|
14143
|
-
this.cdr.detectChanges();
|
|
14144
|
-
console.log('[ViewerComponent] Conteúdo carregado offline com sucesso (sem chamadas HTTP):', this.componentArray);
|
|
14145
|
-
return;
|
|
14146
13934
|
}
|
|
14147
13935
|
}
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
if (res && res.data && res.data[0]) {
|
|
14158
|
-
/** @type {?} */
|
|
14159
|
-
const data = res.data[0].value;
|
|
14160
|
-
this.redirect = res.redirect;
|
|
14161
|
-
this.content = res.data[0];
|
|
14162
|
-
if (res['data'][0].value) {
|
|
14163
|
-
/** @type {?} */
|
|
14164
|
-
const itensJson = res['data'][0].value;
|
|
14165
|
-
this.componentArray = [];
|
|
14166
|
-
for (const item of itensJson) {
|
|
14167
|
-
this.componentArray.push(item);
|
|
14168
|
-
}
|
|
14169
|
-
}
|
|
14170
|
-
}
|
|
14171
|
-
this.loader = false;
|
|
14172
|
-
}), (/**
|
|
14173
|
-
* @param {?} err
|
|
14174
|
-
* @return {?}
|
|
14175
|
-
*/
|
|
14176
|
-
(err) => __awaiter(this, void 0, void 0, function* () {
|
|
14177
|
-
console.log("Erro de rede getContent, tentando recuperar do offline storage:", err);
|
|
14178
|
-
try {
|
|
14179
|
-
/** @type {?} */
|
|
14180
|
-
const offlineLesson = yield this.offlineService.getDownloadedLesson(step);
|
|
14181
|
-
if (offlineLesson && offlineLesson.stageData) {
|
|
14182
|
-
this.componentArray = Array.isArray(offlineLesson.stageData) ? offlineLesson.stageData : [offlineLesson.stageData];
|
|
14183
|
-
this.content = { id: step, value: this.componentArray };
|
|
14184
|
-
}
|
|
14185
|
-
}
|
|
14186
|
-
catch (e) { }
|
|
14187
|
-
this.loader = false;
|
|
14188
|
-
})));
|
|
14189
|
-
});
|
|
13936
|
+
this.loader = false;
|
|
13937
|
+
}), (/**
|
|
13938
|
+
* @param {?} err
|
|
13939
|
+
* @return {?}
|
|
13940
|
+
*/
|
|
13941
|
+
err => {
|
|
13942
|
+
console.log(err);
|
|
13943
|
+
this.loader = false;
|
|
13944
|
+
}));
|
|
14190
13945
|
}
|
|
14191
13946
|
/**
|
|
14192
13947
|
* @return {?}
|
|
@@ -14240,16 +13995,6 @@ class ViewerComponent {
|
|
|
14240
13995
|
* @return {?}
|
|
14241
13996
|
*/
|
|
14242
13997
|
doUpdateVideoTime(time) {
|
|
14243
|
-
if (!navigator.onLine) {
|
|
14244
|
-
if (this.content && this.content.id) {
|
|
14245
|
-
this.offlineService.queueSyncAction({
|
|
14246
|
-
type: 'video_progress',
|
|
14247
|
-
endpoint: '/api/v2/client/ambiente-virtual/video-tempo',
|
|
14248
|
-
payload: { content_id: this.content.id, current_time: time.current }
|
|
14249
|
-
});
|
|
14250
|
-
}
|
|
14251
|
-
return;
|
|
14252
|
-
}
|
|
14253
13998
|
if (this.content && this.content.id) {
|
|
14254
13999
|
this.trailContentService.videoTime(this.content.id, time.current).subscribe((/**
|
|
14255
14000
|
* @param {?} result
|
|
@@ -26512,13 +26257,6 @@ AsapViewerModule.decorators = [
|
|
|
26512
26257
|
ModalStarRatingComponent,
|
|
26513
26258
|
StudioModalStarRatingComponent,
|
|
26514
26259
|
OfflineManagerModalComponent
|
|
26515
|
-
],
|
|
26516
|
-
providers: [
|
|
26517
|
-
{
|
|
26518
|
-
provide: HTTP_INTERCEPTORS,
|
|
26519
|
-
useClass: OfflineHttpInterceptor,
|
|
26520
|
-
multi: true
|
|
26521
|
-
}
|
|
26522
26260
|
]
|
|
26523
26261
|
},] }
|
|
26524
26262
|
];
|
|
@@ -26535,5 +26273,5 @@ AsapViewerModule.decorators = [
|
|
|
26535
26273
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
26536
26274
|
*/
|
|
26537
26275
|
|
|
26538
|
-
export { AsapViewerComponent, AsapViewerModule, AsapViewerRoutes, AsapViewerService, OfflineManagerModalComponent, OfflineStorageService, CursoVisualizadorComponent as ɵa, AmbienteVirtualService as ɵb, FornecedorService as ɵba, VisualizarMaoObraProdutoComponent as ɵbb, ArtesanService as ɵbc, VisualizarFornecedorProdutoComponent as ɵbd, VisualizarCalcularProdutoComponent as ɵbe, CalculadoraService as ɵbf, PedidosComponent as ɵbg, MY_FORMATS as ɵbh, DadosPedidoComponent as ɵbi, PedidoService as ɵbj, CalculoPedidoComponent as ɵbk, ValorService as ɵbl, ListaProdutoseService as ɵbm, CustosComponent as ɵbn, TransporteService as ɵbo, DescService as ɵbp, ComprasComponent as ɵbq, ListaService as ɵbr, ViabilidadeComponent as ɵbs, CustosFixosComponent as ɵbt, CustoService as ɵbu, CustosVariaveisComponent as ɵbv, ViabilidadeService as ɵbw, FaturamentoEstimadoComponent as ɵbx, MaterialModule as ɵby, ExerciciosModule as ɵbz, bannerService as ɵc, ExerciciosRoutes as ɵca, GestaoVisualizadorComponent as ɵcb, GestaoResumoComponent as ɵcc, Exercicio1Component as ɵcd, CalculadoraFinanceiraComponent as ɵce, BalanceSheetService as ɵcf, ExercisesService as ɵcg, ComoResolverDividasComponent as ɵch, TrabalharPraGanharComponent as ɵci, MeuClienteComponent as ɵcj, MY_FORMATS$1 as ɵck, SemanaComponent as ɵcl, Aula10Ex1Component as ɵcm, Aula10Ex3Component as ɵcn, Aula12Ex6Component as ɵco, ProductionTimeComponent as ɵcp, GestaoSidebarComponent as ɵcq, GestaoNavbarComponent as ɵcr, ViewerGestaoComponent as ɵcs, Exercicio1Tab1Component as ɵct, Exercicio1Tab2Component as ɵcu, Exercicio1Tab3Component as ɵcv, Exercicio1ScenarioComponent as ɵcw, Exercicio2Component as ɵcx, Exercicio2_3Component as ɵcy, Exercicio3Component as ɵcz, Trailv2Service as ɵd, Exercicio4Component as ɵda, Exercicio5Component as ɵdb, AssessmentVisualizadorModule as ɵdc, AssessmentVisualizadorRoute as ɵdd, AssessmentVisualizadorComponent as ɵde, AssessmentService as ɵdf, DetailComponent as ɵdg, AsessmentReportComponent as ɵdh, DetailInnerComponent as ɵdi, SidebarAssessmentComponent as ɵdj, NavbarAssessmentComponent as ɵdk, AssessmentReportInnerComponent as ɵdl, RadarComponent as ɵdm, EditorComponentsModule as ɵdn, FileManagerModule as ɵdo, FileManagerComponent as ɵdp, FileManagerService as ɵdq, FileManagerModel as ɵdr, FileManagerDirective as ɵds, PipesModule as ɵdt, SafeUrlPipe as ɵdu, StreamPipe as ɵdv, AsapClientPipe as ɵdw, YoutubeEmbedPipe as ɵdx, CheckTypePipe as ɵdy, VimeoEmbedPipe as ɵdz, StudioVisualizadorComponent as ɵe, ComponentSharedModule as ɵea, SharedTitleComponent as ɵeb, SharedSubTitleComponent as ɵec, SharedButtonComponent as ɵed, SharedMediaComponent as ɵee, SharedTextComponent as ɵef, DynamicInputComponent as ɵeg, EditorChallengeComponent as ɵeh, VimeoService as ɵei, EditorChallengeConfigComponent as ɵej, EditorConclusionComponent as ɵek, TrilhaPerformanceService as ɵel, TrilhaRatingService as ɵem, EditorConclusionConfigComponent as ɵen, EditorDynamicTableComponent as ɵeo, TrailContentService as ɵep, EditorDynamicTableConfigComponent as ɵeq, EditorIntroComponent as ɵer, EditorIntroConfigComponent as ɵes, EditorLongTextComponent as ɵet, EditorLongTextConfigComponent as ɵeu, EditorMultiChoiceComponent as ɵev, EditorMultipleQuestionsComponent as ɵew, EditorMultipleQuestionsConfigComponent as ɵex, EditorSalesChannelComponent as ɵey, EditorSalesChannelConfigComponent as ɵez, StudioVisualizadorService as ɵf, EditorSheetCorrectIncorrectComponent as ɵfa, EditorSheetCorrectIncorrectConfigComponent as ɵfb, EditorYesNoComponent as ɵfc, EditorYesNoConfigComponent as ɵfd, VideoComponent as ɵfe, ImageComponent as ɵff, EditorImageConfigComponent as ɵfg, EditorUploadComponent as ɵfh, EditorUploadConfigComponent as ɵfi, EditorDownloadComponent as ɵfj, EditorDownloadConfigComponent as ɵfk, EditorStarPointComponent as ɵfl, EditorStarPointConfigComponent as ɵfm, EditorRatingComponent as ɵfn, EditorRatingConfigComponent as ɵfo, ForumComponent as ɵfp, ForumService as ɵfq, ForumResponseService as ɵfr, ForumVoteService as ɵfs, EditorForumConfigComponent as ɵft, EditorAvaliationComponent as ɵfu, EditorContractComponent as ɵfv, FormStepComponent as ɵfw, EditorPdfComponent as ɵfx, EditorResearchComponent as ɵfy, EditorPageComponent as ɵfz, MiniCursoVisualizadorComponent as ɵg, FeedbackComponent as ɵga, FirebaseNotificationService as ɵgb, AudioComponent as ɵgc, EditorRandomQuestionsComponent as ɵgd, TextComponent as ɵge, BannerModule as ɵgf, BannerComponent as ɵgg, SpinnerModule as ɵgh, SpinnerComponent as ɵgi, CursoNavbarComponent as ɵgj, CursoSidebarComponent as ɵgk, modalTrilhaBanner as ɵgl, ModalStarRatingComponent as ɵgm, ViewerComponent as ɵgn, MiniCursoSidebarComponent as ɵgo, MiniCursoSideMenuComponent as ɵgp, AreaPermissionService as ɵgq, TutorService as ɵgr, MiniCursoNavbarComponent as ɵgs, NotificationService as ɵgt, MiniViewerComponent as ɵgu, MiniTrailCommentService as ɵgv, MiniModalTrilhaBanner as ɵgw, MiniSliderComponent as ɵgx, StarRatingComponent as ɵgy, PrecificacaoSidebarComponent as ɵgz, MiniTrailService as ɵh, PrecificacaoNavbarComponent as ɵha, ViewerPrecificacaoComponent as ɵhb, ModalMaoObraProdutoComponent as ɵhc, ModalCustosComponent as ɵhd, ModalResumoComponent as ɵhe, ModalEdit as ɵhf, ModalFaturamentoEstimadoComponent as ɵhg, MaterialPipe as ɵhh, CommentsComponent as ɵhi, CommentsService as ɵhj, VisualizarForumComponent as ɵhk, ForumTrilhaService as ɵhl, PointsComponent as ɵhm, TrailService as ɵhn, Trail as ɵho, StudioStarRatingComponent as ɵhp, StudioModalStarRatingComponent as ɵhq,
|
|
26276
|
+
export { AsapViewerComponent, AsapViewerModule, AsapViewerRoutes, AsapViewerService, OfflineManagerModalComponent, OfflineStorageService, CursoVisualizadorComponent as ɵa, AmbienteVirtualService as ɵb, FornecedorService as ɵba, VisualizarMaoObraProdutoComponent as ɵbb, ArtesanService as ɵbc, VisualizarFornecedorProdutoComponent as ɵbd, VisualizarCalcularProdutoComponent as ɵbe, CalculadoraService as ɵbf, PedidosComponent as ɵbg, MY_FORMATS as ɵbh, DadosPedidoComponent as ɵbi, PedidoService as ɵbj, CalculoPedidoComponent as ɵbk, ValorService as ɵbl, ListaProdutoseService as ɵbm, CustosComponent as ɵbn, TransporteService as ɵbo, DescService as ɵbp, ComprasComponent as ɵbq, ListaService as ɵbr, ViabilidadeComponent as ɵbs, CustosFixosComponent as ɵbt, CustoService as ɵbu, CustosVariaveisComponent as ɵbv, ViabilidadeService as ɵbw, FaturamentoEstimadoComponent as ɵbx, MaterialModule as ɵby, ExerciciosModule as ɵbz, bannerService as ɵc, ExerciciosRoutes as ɵca, GestaoVisualizadorComponent as ɵcb, GestaoResumoComponent as ɵcc, Exercicio1Component as ɵcd, CalculadoraFinanceiraComponent as ɵce, BalanceSheetService as ɵcf, ExercisesService as ɵcg, ComoResolverDividasComponent as ɵch, TrabalharPraGanharComponent as ɵci, MeuClienteComponent as ɵcj, MY_FORMATS$1 as ɵck, SemanaComponent as ɵcl, Aula10Ex1Component as ɵcm, Aula10Ex3Component as ɵcn, Aula12Ex6Component as ɵco, ProductionTimeComponent as ɵcp, GestaoSidebarComponent as ɵcq, GestaoNavbarComponent as ɵcr, ViewerGestaoComponent as ɵcs, Exercicio1Tab1Component as ɵct, Exercicio1Tab2Component as ɵcu, Exercicio1Tab3Component as ɵcv, Exercicio1ScenarioComponent as ɵcw, Exercicio2Component as ɵcx, Exercicio2_3Component as ɵcy, Exercicio3Component as ɵcz, Trailv2Service as ɵd, Exercicio4Component as ɵda, Exercicio5Component as ɵdb, AssessmentVisualizadorModule as ɵdc, AssessmentVisualizadorRoute as ɵdd, AssessmentVisualizadorComponent as ɵde, AssessmentService as ɵdf, DetailComponent as ɵdg, AsessmentReportComponent as ɵdh, DetailInnerComponent as ɵdi, SidebarAssessmentComponent as ɵdj, NavbarAssessmentComponent as ɵdk, AssessmentReportInnerComponent as ɵdl, RadarComponent as ɵdm, EditorComponentsModule as ɵdn, FileManagerModule as ɵdo, FileManagerComponent as ɵdp, FileManagerService as ɵdq, FileManagerModel as ɵdr, FileManagerDirective as ɵds, PipesModule as ɵdt, SafeUrlPipe as ɵdu, StreamPipe as ɵdv, AsapClientPipe as ɵdw, YoutubeEmbedPipe as ɵdx, CheckTypePipe as ɵdy, VimeoEmbedPipe as ɵdz, StudioVisualizadorComponent as ɵe, ComponentSharedModule as ɵea, SharedTitleComponent as ɵeb, SharedSubTitleComponent as ɵec, SharedButtonComponent as ɵed, SharedMediaComponent as ɵee, SharedTextComponent as ɵef, DynamicInputComponent as ɵeg, EditorChallengeComponent as ɵeh, VimeoService as ɵei, EditorChallengeConfigComponent as ɵej, EditorConclusionComponent as ɵek, TrilhaPerformanceService as ɵel, TrilhaRatingService as ɵem, EditorConclusionConfigComponent as ɵen, EditorDynamicTableComponent as ɵeo, TrailContentService as ɵep, EditorDynamicTableConfigComponent as ɵeq, EditorIntroComponent as ɵer, EditorIntroConfigComponent as ɵes, EditorLongTextComponent as ɵet, EditorLongTextConfigComponent as ɵeu, EditorMultiChoiceComponent as ɵev, EditorMultipleQuestionsComponent as ɵew, EditorMultipleQuestionsConfigComponent as ɵex, EditorSalesChannelComponent as ɵey, EditorSalesChannelConfigComponent as ɵez, StudioVisualizadorService as ɵf, EditorSheetCorrectIncorrectComponent as ɵfa, EditorSheetCorrectIncorrectConfigComponent as ɵfb, EditorYesNoComponent as ɵfc, EditorYesNoConfigComponent as ɵfd, VideoComponent as ɵfe, ImageComponent as ɵff, EditorImageConfigComponent as ɵfg, EditorUploadComponent as ɵfh, EditorUploadConfigComponent as ɵfi, EditorDownloadComponent as ɵfj, EditorDownloadConfigComponent as ɵfk, EditorStarPointComponent as ɵfl, EditorStarPointConfigComponent as ɵfm, EditorRatingComponent as ɵfn, EditorRatingConfigComponent as ɵfo, ForumComponent as ɵfp, ForumService as ɵfq, ForumResponseService as ɵfr, ForumVoteService as ɵfs, EditorForumConfigComponent as ɵft, EditorAvaliationComponent as ɵfu, EditorContractComponent as ɵfv, FormStepComponent as ɵfw, EditorPdfComponent as ɵfx, EditorResearchComponent as ɵfy, EditorPageComponent as ɵfz, MiniCursoVisualizadorComponent as ɵg, FeedbackComponent as ɵga, FirebaseNotificationService as ɵgb, AudioComponent as ɵgc, EditorRandomQuestionsComponent as ɵgd, TextComponent as ɵge, BannerModule as ɵgf, BannerComponent as ɵgg, SpinnerModule as ɵgh, SpinnerComponent as ɵgi, CursoNavbarComponent as ɵgj, CursoSidebarComponent as ɵgk, modalTrilhaBanner as ɵgl, ModalStarRatingComponent as ɵgm, ViewerComponent as ɵgn, MiniCursoSidebarComponent as ɵgo, MiniCursoSideMenuComponent as ɵgp, AreaPermissionService as ɵgq, TutorService as ɵgr, MiniCursoNavbarComponent as ɵgs, NotificationService as ɵgt, MiniViewerComponent as ɵgu, MiniTrailCommentService as ɵgv, MiniModalTrilhaBanner as ɵgw, MiniSliderComponent as ɵgx, StarRatingComponent as ɵgy, PrecificacaoSidebarComponent as ɵgz, MiniTrailService as ɵh, PrecificacaoNavbarComponent as ɵha, ViewerPrecificacaoComponent as ɵhb, ModalMaoObraProdutoComponent as ɵhc, ModalCustosComponent as ɵhd, ModalResumoComponent as ɵhe, ModalEdit as ɵhf, ModalFaturamentoEstimadoComponent as ɵhg, MaterialPipe as ɵhh, CommentsComponent as ɵhi, CommentsService as ɵhj, VisualizarForumComponent as ɵhk, ForumTrilhaService as ɵhl, PointsComponent as ɵhm, TrailService as ɵhn, Trail as ɵho, StudioStarRatingComponent as ɵhp, StudioModalStarRatingComponent as ɵhq, BaseService as ɵi, DevelopmentService as ɵj, ArticlesService as ɵk, TrilhaService as ɵl, TrilhaItemService as ɵm, LayoutService as ɵn, ExercisesComponent as ɵo, PrecificacaoVisualizadorComponent as ɵp, ProdutosComponent as ɵq, ProdutosService as ɵr, NovoProdutoComponent as ɵs, MeusPedidosComponent as ɵt, PedidoService$1 as ɵu, VisualizarProdutoComponent as ɵv, VisualizarResumoProdutoComponent as ɵw, MaterialService as ɵx, MaoObraService as ɵy, VisualizarMateriaisProdutoComponent as ɵz };
|
|
26539
26277
|
//# sourceMappingURL=asap-viewer.js.map
|