@hestia-earth/ui-components 0.0.7 → 0.0.10

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.
Files changed (66) hide show
  1. package/README.md +5 -22
  2. package/bibliographies/bibliographies-search-confirm/bibliographies-search-confirm.component.d.ts +1 -1
  3. package/bundles/hestia-earth-ui-components.umd.js +2339 -806
  4. package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
  5. package/common/blank-node-state/blank-node-state.component.d.ts +2 -2
  6. package/common/common.light.module.d.ts +19 -0
  7. package/common/common.module.d.ts +10 -19
  8. package/common/delta-utils.d.ts +1 -1
  9. package/common/index.d.ts +1 -0
  10. package/common/link-key-value/link-key-value.component.d.ts +1 -1
  11. package/common/maps-utils.d.ts +2 -2
  12. package/common/precision.pipe.d.ts +1 -1
  13. package/common/tags-input.directive.d.ts +1 -1
  14. package/common/utils.d.ts +7 -7
  15. package/cycles/cycles-emissions-chart/cycles-emissions-chart.component.d.ts +2 -2
  16. package/cycles/cycles-suggest-form/cycles-suggest-form.component.d.ts +1 -2
  17. package/cycles/cycles.model.d.ts +1 -1
  18. package/engine/aggregation-engine.service.d.ts +2 -2
  19. package/engine/engine.service.d.ts +5 -4
  20. package/esm2015/common/common.light.module.js +66 -0
  21. package/esm2015/common/common.module.js +11 -47
  22. package/esm2015/common/index.js +2 -1
  23. package/esm2015/common/tags-input.directive.js +3 -3
  24. package/esm2015/common/utils.js +1 -2
  25. package/esm2015/engine/engine.service.js +10 -6
  26. package/esm2015/tags-input/defaultOptions.js +26 -0
  27. package/esm2015/tags-input/index.js +1053 -0
  28. package/esm2015/tags-input/templates/dropdown-item.js +3 -0
  29. package/esm2015/tags-input/templates/tag.js +6 -0
  30. package/esm2015/tags-input/templates/wrapper.js +10 -0
  31. package/esm2015/tags-input/utils/component.js +80 -0
  32. package/esm2015/tags-input/utils/dom.js +98 -0
  33. package/esm2015/tags-input/utils/events.js +147 -0
  34. package/esm2015/tags-input/utils/type.js +41 -0
  35. package/esm2015/tags-input/utils/uuid.js +3 -0
  36. package/fesm2015/hestia-earth-ui-components.js +1977 -499
  37. package/fesm2015/hestia-earth-ui-components.js.map +1 -1
  38. package/files/files-error.model.d.ts +5 -5
  39. package/files/files-form/files-form.component.d.ts +7 -7
  40. package/files/files-form.model.d.ts +10 -10
  41. package/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.d.ts +2 -2
  42. package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +2 -2
  43. package/node/node-icon/node-icon.component.d.ts +1 -1
  44. package/node/node-link/node-link.component.d.ts +1 -1
  45. package/node/node-logs-models/node-logs-models.component.d.ts +1 -1
  46. package/node/node.service.d.ts +2 -2
  47. package/package.json +1 -2
  48. package/schema/schema.service.d.ts +1 -1
  49. package/search/search.model.d.ts +18 -17
  50. package/search/search.service.d.ts +7 -7
  51. package/sites/sites-maps/sites-maps.component.d.ts +1 -1
  52. package/sites/sites-measurements/sites-measurements.component.d.ts +1 -1
  53. package/sites/sites.model.d.ts +1 -1
  54. package/styles.scss +1 -1
  55. package/tags-input/defaultOptions.d.ts +25 -0
  56. package/tags-input/index.d.ts +277 -0
  57. package/tags-input/styles.sass +154 -0
  58. package/tags-input/templates/dropdown-item.d.ts +2 -0
  59. package/tags-input/templates/tag.d.ts +2 -0
  60. package/tags-input/templates/wrapper.d.ts +2 -0
  61. package/tags-input/utils/component.d.ts +22 -0
  62. package/tags-input/utils/dom.d.ts +38 -0
  63. package/tags-input/utils/events.d.ts +72 -0
  64. package/tags-input/utils/type.d.ts +17 -0
  65. package/tags-input/utils/uuid.d.ts +2 -0
  66. package/terms/terms.model.d.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@ng-bootstrap/ng-bootstrap'), require('@angular/google-maps'), require('@fortawesome/angular-fontawesome'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-solid-svg-icons'), require('random-material-color'), require('@hestia-earth/schema'), require('@hestia-earth/api'), require('@hestia-earth/utils'), require('rxjs'), require('rxjs/operators'), require('csvtojson'), require('@angular/common/http'), require('@angular/platform-browser'), require('pluralize'), require('@hestia-earth/bulma-tagsinput'), require('json-2-csv'), require('@angular/cdk/drag-drop'), require('@hestia-earth/schema-convert'), require('@hestia-earth/json-schema/schema-utils'), require('jsondiffpatch'), require('chart.js'), require('moment'), require('moment/locale/en-gb'), require('uuid'), require('@google/markerclustererplus'), require('chartjs-plugin-datalabels')) :
3
- typeof define === 'function' && define.amd ? define('@hestia-earth/ui-components', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@ng-bootstrap/ng-bootstrap', '@angular/google-maps', '@fortawesome/angular-fontawesome', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-solid-svg-icons', 'random-material-color', '@hestia-earth/schema', '@hestia-earth/api', '@hestia-earth/utils', 'rxjs', 'rxjs/operators', 'csvtojson', '@angular/common/http', '@angular/platform-browser', 'pluralize', '@hestia-earth/bulma-tagsinput', 'json-2-csv', '@angular/cdk/drag-drop', '@hestia-earth/schema-convert', '@hestia-earth/json-schema/schema-utils', 'jsondiffpatch', 'chart.js', 'moment', 'moment/locale/en-gb', 'uuid', '@google/markerclustererplus', 'chartjs-plugin-datalabels'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["hestia-earth"] = global["hestia-earth"] || {}, global["hestia-earth"]["ui-components"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.i10, global.ng.googleMaps, global.i1, global.freeRegularSvgIcons, global.freeSolidSvgIcons, global.randomMaterialColor, global.schema, global.api, global.utils, global.rxjs, global.rxjs.operators, global.csvtojson, global.ng.common.http, global.ng.platformBrowser, global.pluralize, global.BulmaTagsInput, global.json2Csv, global.ng.cdk.dragDrop, global.schemaConvert, global.schemaUtils, global.jsondiffpatch, global.chart_js, global.moment, null, global.uuid, global.MarkerClusterer, global.ChartDataLabels));
5
- })(this, (function (exports, i0, i3, i1$4, i4, i10, i1$2, i1, freeRegularSvgIcons, freeSolidSvgIcons, randomMaterialColor, schema, api, utils, rxjs, operators, csvtojson, i1$1, i1$3, pluralize, BulmaTagsInput, json2Csv, i6, schemaConvert, schemaUtils, jsondiffpatch, chart_js, moment, enGb, uuid, MarkerClusterer, ChartDataLabels) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@ng-bootstrap/ng-bootstrap'), require('@angular/google-maps'), require('@fortawesome/angular-fontawesome'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-solid-svg-icons'), require('@angular/platform-browser'), require('rxjs'), require('random-material-color'), require('@hestia-earth/schema'), require('@hestia-earth/api'), require('@hestia-earth/utils'), require('pluralize'), require('rxjs/operators'), require('csvtojson'), require('@angular/common/http'), require('json-2-csv'), require('@angular/cdk/drag-drop'), require('@hestia-earth/schema-convert'), require('@hestia-earth/json-schema/schema-utils'), require('jsondiffpatch'), require('chart.js'), require('moment'), require('moment/locale/en-gb'), require('uuid'), require('@google/markerclustererplus'), require('chartjs-plugin-datalabels')) :
3
+ typeof define === 'function' && define.amd ? define('@hestia-earth/ui-components', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@ng-bootstrap/ng-bootstrap', '@angular/google-maps', '@fortawesome/angular-fontawesome', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-solid-svg-icons', '@angular/platform-browser', 'rxjs', 'random-material-color', '@hestia-earth/schema', '@hestia-earth/api', '@hestia-earth/utils', 'pluralize', 'rxjs/operators', 'csvtojson', '@angular/common/http', 'json-2-csv', '@angular/cdk/drag-drop', '@hestia-earth/schema-convert', '@hestia-earth/json-schema/schema-utils', 'jsondiffpatch', 'chart.js', 'moment', 'moment/locale/en-gb', 'uuid', '@google/markerclustererplus', 'chartjs-plugin-datalabels'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["hestia-earth"] = global["hestia-earth"] || {}, global["hestia-earth"]["ui-components"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.i10, global.ng.googleMaps, global.i1, global.freeRegularSvgIcons, global.freeSolidSvgIcons, global.ng.platformBrowser, global.rxjs, global.randomMaterialColor, global.schema, global.api, global.utils, global.pluralize, global.rxjs.operators, global.csvtojson, global.ng.common.http, global.json2Csv, global.ng.cdk.dragDrop, global.schemaConvert, global.schemaUtils, global.jsondiffpatch, global.chart_js, global.moment, null, global.uuid$1, global.MarkerClusterer, global.ChartDataLabels));
5
+ })(this, (function (exports, i0, i3, i1$2, i4, i10, i1$4, i1, freeRegularSvgIcons, freeSolidSvgIcons, i1$1, rxjs, randomMaterialColor, schema, api, utils, pluralize, operators, csvtojson, i1$3, json2Csv, i6, schemaConvert, schemaUtils, jsondiffpatch, chart_js, moment, enGb, uuid$1, MarkerClusterer, ChartDataLabels) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -26,16 +26,15 @@
26
26
 
27
27
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
28
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
29
- var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
29
+ var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$2);
30
30
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
31
31
  var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
32
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
32
+ var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$4);
33
33
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
34
- var csvtojson__namespace = /*#__PURE__*/_interopNamespace(csvtojson);
35
34
  var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
36
- var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
37
35
  var pluralize__namespace = /*#__PURE__*/_interopNamespace(pluralize);
38
- var BulmaTagsInput__default = /*#__PURE__*/_interopDefaultLegacy(BulmaTagsInput);
36
+ var csvtojson__namespace = /*#__PURE__*/_interopNamespace(csvtojson);
37
+ var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$3);
39
38
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
40
39
  var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
41
40
  var MarkerClusterer__default = /*#__PURE__*/_interopDefaultLegacy(MarkerClusterer);
@@ -417,6 +416,161 @@
417
416
  }]
418
417
  }], ctorParameters: function () { return [{ type: i1__namespace.FaIconLibrary }]; } });
419
418
 
419
+ var SocialTagsComponent = /** @class */ (function () {
420
+ function SocialTagsComponent(meta) {
421
+ this.meta = meta;
422
+ this.config = {};
423
+ this.classes = 'is-hidden';
424
+ }
425
+ SocialTagsComponent.prototype.ngOnInit = function () {
426
+ var _this = this;
427
+ this.meta.addTag({ charset: 'UTF-8' });
428
+ var config = Object.assign({ 'og:url': window.location.href.split('?')[0] }, this.config);
429
+ Object.keys(config).map(function (name) {
430
+ var content = config[name];
431
+ _this.meta.updateTag({ name: name, content: content });
432
+ if (name === 'og:description') {
433
+ _this.meta.updateTag({ name: 'description', content: content });
434
+ }
435
+ });
436
+ };
437
+ return SocialTagsComponent;
438
+ }());
439
+ SocialTagsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SocialTagsComponent, deps: [{ token: i1__namespace$1.Meta }], target: i0__namespace.ɵɵFactoryTarget.Component });
440
+ SocialTagsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SocialTagsComponent, selector: "he-social-tags", inputs: { config: "config" }, host: { properties: { "class": "this.classes" } }, ngImport: i0__namespace, template: "<span></span>\n", styles: [""] });
441
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SocialTagsComponent, decorators: [{
442
+ type: i0.Component,
443
+ args: [{
444
+ selector: 'he-social-tags',
445
+ templateUrl: './social-tags.component.html',
446
+ styleUrls: ['./social-tags.component.scss']
447
+ }]
448
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.Meta }]; }, propDecorators: { config: [{
449
+ type: i0.Input
450
+ }], classes: [{
451
+ type: i0.HostBinding,
452
+ args: ['class']
453
+ }] } });
454
+
455
+ var toastId = 0;
456
+ var HeToastService = /** @class */ (function () {
457
+ function HeToastService() {
458
+ this.toasts = new rxjs.ReplaySubject(1);
459
+ }
460
+ HeToastService.prototype.success = function (message, duration) {
461
+ if (duration === void 0) { duration = 3000; }
462
+ this.toasts.next({
463
+ id: ++toastId,
464
+ message: message,
465
+ duration: duration,
466
+ color: 'success',
467
+ showRawMessage: true
468
+ });
469
+ };
470
+ HeToastService.prototype.error = function (message, showRawMessage, duration) {
471
+ if (showRawMessage === void 0) { showRawMessage = true; }
472
+ if (duration === void 0) { duration = 3000; }
473
+ this.toasts.next({
474
+ id: ++toastId,
475
+ message: ("" + message || '').trim(),
476
+ duration: duration,
477
+ color: 'danger',
478
+ showRawMessage: showRawMessage
479
+ });
480
+ };
481
+ return HeToastService;
482
+ }());
483
+ HeToastService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
484
+ HeToastService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, providedIn: 'root' });
485
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, decorators: [{
486
+ type: i0.Injectable,
487
+ args: [{
488
+ providedIn: 'root'
489
+ }]
490
+ }] });
491
+
492
+ var ToastComponent = /** @class */ (function () {
493
+ function ToastComponent(toastService) {
494
+ this.toastService = toastService;
495
+ this.subscriptions = [];
496
+ this.toasts = [];
497
+ }
498
+ ToastComponent.prototype.ngOnInit = function () {
499
+ var _this = this;
500
+ this.subscriptions.push(this.toastService.toasts.subscribe(function (toast) { return _this.add(toast); }));
501
+ };
502
+ ToastComponent.prototype.ngOnDestroy = function () {
503
+ this.subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
504
+ };
505
+ ToastComponent.prototype.add = function (toast) {
506
+ var _this = this;
507
+ this.toasts.push(toast);
508
+ if (toast.duration) {
509
+ toast.timeout = setTimeout(function () { return _this.dismiss(toast); }, toast.duration);
510
+ }
511
+ };
512
+ ToastComponent.prototype.dismiss = function (toast) {
513
+ this.toasts.splice(this.toasts.findIndex(function (val) { return val.id === toast.id; }), 1);
514
+ };
515
+ return ToastComponent;
516
+ }());
517
+ ToastComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, deps: [{ token: HeToastService }], target: i0__namespace.ɵɵFactoryTarget.Component });
518
+ ToastComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToastComponent, selector: "he-toast", ngImport: i0__namespace, template: "<div class=\"mb-3 columns is-centered is-vcentered\">\n <div class=\"notification is-{{toast.color}}\" role=\"alert\" *ngFor=\"let toast of toasts\">\n <button class=\"delete\" aria-label=\"delete\" (click)=\"dismiss(toast)\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <strong [ngSwitch]=\"toast.color\">\n <ng-container *ngSwitchCase=\"'danger'\">\n <ng-container [ngSwitch]=\"toast.message\">\n <span *ngSwitchCase=\"'Unauthorized'\">You are not allowed to perform this action.</span>\n <span *ngSwitchCase=\"'form-invalid'\">Please fix all the errors on this page.</span>\n <span *ngSwitchCase=\"'users-email-already-taken'\">Email already taken.</span>\n <span *ngSwitchCase=\"'users-auth-already-taken'\">Account already connected.</span>\n <span *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </ng-container>\n </strong>\n </div>\n</div>\n", styles: [":host{bottom:0;position:fixed;width:100%}\n"], directives: [{ type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
519
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, decorators: [{
520
+ type: i0.Component,
521
+ args: [{
522
+ selector: 'he-toast',
523
+ templateUrl: './toast.component.html',
524
+ styleUrls: ['./toast.component.scss']
525
+ }]
526
+ }], ctorParameters: function () { return [{ type: HeToastService }]; } });
527
+
528
+ /* eslint-disable @angular-eslint/directive-selector */
529
+ var BindOnceDirective = /** @class */ (function () {
530
+ function BindOnceDirective(templateRef, viewContainerRef) {
531
+ this.embeddedViewRef = viewContainerRef.createEmbeddedView(templateRef);
532
+ this.embeddedViewRef.detach();
533
+ }
534
+ BindOnceDirective.prototype.ngOnChanges = function () {
535
+ this.embeddedViewRef.detectChanges();
536
+ };
537
+ return BindOnceDirective;
538
+ }());
539
+ BindOnceDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BindOnceDirective, deps: [{ token: i0__namespace.TemplateRef }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
540
+ BindOnceDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BindOnceDirective, selector: "[bindOnce]", inputs: { bindOnce: "bindOnce" }, usesOnChanges: true, ngImport: i0__namespace });
541
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BindOnceDirective, decorators: [{
542
+ type: i0.Directive,
543
+ args: [{
544
+ selector: '[bindOnce]'
545
+ }]
546
+ }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }, { type: i0__namespace.ViewContainerRef }]; }, propDecorators: { bindOnce: [{
547
+ type: i0.Input
548
+ }] } });
549
+
550
+ var shouldDefault = {
551
+ string: function (value) { return !value; },
552
+ number: function (value) { return !value && value !== 0; },
553
+ boolean: function (value) { return !value; },
554
+ object: function (value) { return !value || !Object.keys(value).length; },
555
+ undefined: function () { return true; }
556
+ };
557
+ var DefaultPipe = /** @class */ (function () {
558
+ function DefaultPipe() {
559
+ }
560
+ DefaultPipe.prototype.transform = function (value, defaultValue) {
561
+ return shouldDefault[typeof value](value) ? defaultValue : value;
562
+ };
563
+ return DefaultPipe;
564
+ }());
565
+ DefaultPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DefaultPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
566
+ DefaultPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DefaultPipe, name: "default" });
567
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DefaultPipe, decorators: [{
568
+ type: i0.Pipe,
569
+ args: [{
570
+ name: 'default'
571
+ }]
572
+ }] });
573
+
420
574
  var _a$6;
421
575
  var get$4 = require('lodash.get');
422
576
  var gitHome = 'https://gitlab.com/hestia-earth';
@@ -429,7 +583,6 @@
429
583
  window.location.origin :
430
584
  'https://www.hestia.earth'; };
431
585
  var isExternal = function () { return baseUrl() !== window.location.origin; };
432
- ;
433
586
  var parseErrorStatus = function (error) { return ((error === null || error === void 0 ? void 0 : error.statusText) || '').toLowerCase().replace(/\s/g, '-'); };
434
587
  var parseErrorMessage = function (error) { return get$4(error, 'error.error', get$4(error, 'error.message', get$4(error, 'error', get$4(error, 'message', error)))); };
435
588
  var handleAPIError = function (error) {
@@ -623,176 +776,24 @@
623
776
  return file.endsWith('.') ? file.substring(0, file.length - 1) : file;
624
777
  };
625
778
 
626
- var _a$5, _b$2, _c$2, _d$2;
627
- var SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
628
- var WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
629
- exports.DeltaColour = void 0;
630
- (function (DeltaColour) {
631
- DeltaColour["Success"] = "success";
632
- DeltaColour["Warning"] = "warning";
633
- DeltaColour["Danger"] = "danger";
634
- })(exports.DeltaColour || (exports.DeltaColour = {}));
635
- exports.DeltaDisplayType = void 0;
636
- (function (DeltaDisplayType) {
637
- DeltaDisplayType["absolute"] = "absolute";
638
- DeltaDisplayType["percent"] = "percent";
639
- })(exports.DeltaDisplayType || (exports.DeltaDisplayType = {}));
640
- var deltaPerType = (_a$5 = {},
641
- _a$5[exports.DeltaDisplayType.absolute] = function (value, original) { return value - original; },
642
- _a$5[exports.DeltaDisplayType.percent] = function (value, original) { return ((value - original) / original) * 100; },
643
- _a$5);
644
- var roundValue = function (value) { return +("" + value).substring(0, 10); };
645
- var delta = function (value, originalValue, displayType, mapping) {
646
- if (displayType === void 0) { displayType = exports.DeltaDisplayType.percent; }
647
- var vvalue = roundValue(propertyValue$1(value));
648
- var voriginalValue = roundValue(propertyValue$1(originalValue));
649
- var deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
650
- var diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
651
- return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
652
- };
653
- var PercentDeltaConditions;
654
- (function (PercentDeltaConditions) {
655
- PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
656
- PercentDeltaConditions["original0"] = "original is 0";
657
- })(PercentDeltaConditions || (PercentDeltaConditions = {}));
658
- var calculatePercentDeltaConditions = (_b$2 = {},
659
- _b$2[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return original > 0 && recalculated === 0; },
660
- _b$2[PercentDeltaConditions.original0] = function (original, recalculated) { return original === 0 && recalculated > 0; },
661
- _b$2);
662
- var calculatePercentDeltaResult = (_c$2 = {},
663
- _c$2[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return (recalculated - original) / (original + 1); },
664
- // Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
665
- _c$2[PercentDeltaConditions.original0] = function (original, recalculated) { return Math.sign(recalculated - original); },
666
- _c$2.default = function (original, recalculated) { return (recalculated - original) / original; },
667
- _c$2);
668
- var calculatePercentDelta = function (recalculated, original) {
669
- var matchingCondition = Object.values(PercentDeltaConditions).find(function (value) { return calculatePercentDeltaConditions[value](original, recalculated); }) || 'default';
670
- return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
671
- };
672
- var customDeltaFuncs = (_d$2 = {},
673
- _d$2[exports.DeltaDisplayType.percent] = calculatePercentDelta,
674
- _d$2);
675
- var evaluateSuccess = function (deltaValue) { return Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
676
- ? exports.DeltaColour.Success
677
- : Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
678
- ? exports.DeltaColour.Warning
679
- : exports.DeltaColour.Danger; };
680
-
681
- /* eslint-disable @angular-eslint/directive-selector */
682
- var BindOnceDirective = /** @class */ (function () {
683
- function BindOnceDirective(templateRef, viewContainerRef) {
684
- this.embeddedViewRef = viewContainerRef.createEmbeddedView(templateRef);
685
- this.embeddedViewRef.detach();
686
- }
687
- BindOnceDirective.prototype.ngOnChanges = function () {
688
- this.embeddedViewRef.detectChanges();
689
- };
690
- return BindOnceDirective;
691
- }());
692
- BindOnceDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BindOnceDirective, deps: [{ token: i0__namespace.TemplateRef }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
693
- BindOnceDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BindOnceDirective, selector: "[bindOnce]", inputs: { bindOnce: "bindOnce" }, usesOnChanges: true, ngImport: i0__namespace });
694
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BindOnceDirective, decorators: [{
695
- type: i0.Directive,
696
- args: [{
697
- selector: '[bindOnce]'
698
- }]
699
- }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }, { type: i0__namespace.ViewContainerRef }]; }, propDecorators: { bindOnce: [{
700
- type: i0.Input
701
- }] } });
702
-
703
- var PrecisionPipe = /** @class */ (function () {
704
- function PrecisionPipe() {
779
+ var EllipsisPipe = /** @class */ (function () {
780
+ function EllipsisPipe() {
705
781
  }
706
- PrecisionPipe.prototype.transform = function (value, precision) {
707
- return utils.isUndefined(value) ?
708
- null : (utils.isNumber(value) ?
709
- ("" + utils.toPrecision(parseFloat("" + value), parseInt("" + precision, 10))).replace(/\.00$/, '') :
710
- value);
782
+ EllipsisPipe.prototype.transform = function (value, maxLength) {
783
+ return ellipsis("" + value, maxLength);
711
784
  };
712
- return PrecisionPipe;
785
+ return EllipsisPipe;
713
786
  }());
714
- PrecisionPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PrecisionPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
715
- PrecisionPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PrecisionPipe, name: "precision" });
716
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PrecisionPipe, decorators: [{
787
+ EllipsisPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EllipsisPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
788
+ EllipsisPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EllipsisPipe, name: "ellipsis" });
789
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EllipsisPipe, decorators: [{
717
790
  type: i0.Pipe,
718
791
  args: [{
719
- name: 'precision'
792
+ name: 'ellipsis'
720
793
  }]
721
794
  }] });
722
795
 
723
- var BlankNodeValueDeltaComponent = /** @class */ (function () {
724
- function BlankNodeValueDeltaComponent() {
725
- this.displayType = exports.DeltaDisplayType.percent;
726
- this.DeltaDisplayType = exports.DeltaDisplayType;
727
- }
728
- Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "hide", {
729
- get: function () {
730
- return emptyValue(this.value) || emptyValue(this.originalValue);
731
- },
732
- enumerable: false,
733
- configurable: true
734
- });
735
- Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "delta", {
736
- get: function () {
737
- return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
738
- },
739
- enumerable: false,
740
- configurable: true
741
- });
742
- Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "color", {
743
- get: function () {
744
- return this.displayType === exports.DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
745
- },
746
- enumerable: false,
747
- configurable: true
748
- });
749
- return BlankNodeValueDeltaComponent;
750
- }());
751
- BlankNodeValueDeltaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeValueDeltaComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
752
- BlankNodeValueDeltaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: { value: "value", originalValue: "originalValue", displayType: "displayType" }, ngImport: i0__namespace, template: "<small [class.is-hidden]=\"hide\">\n <span class=\"has-text-{{color}}\">\n <span *ngIf=\"delta > 0\">+</span>\n <ng-container [ngSwitch]=\"displayType\">\n <ng-container *ngSwitchCase=\"DeltaDisplayType.absolute\">\n <span *bindOnce=\"delta\">{{delta | precision:3}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DeltaDisplayType.percent\">\n <span *bindOnce=\"delta\">{{delta | number:'1.0-2'}}</span>\n <span>%</span>\n </ng-container>\n </ng-container>\n </span>\n</small>\n", styles: [""], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "precision": PrecisionPipe, "number": i3__namespace.DecimalPipe } });
753
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeValueDeltaComponent, decorators: [{
754
- type: i0.Component,
755
- args: [{
756
- selector: 'he-blank-node-value-delta',
757
- templateUrl: './blank-node-value-delta.component.html',
758
- styleUrls: ['./blank-node-value-delta.component.scss']
759
- }]
760
- }], propDecorators: { value: [{
761
- type: i0.Input
762
- }], originalValue: [{
763
- type: i0.Input
764
- }], displayType: [{
765
- type: i0.Input
766
- }] } });
767
-
768
- var BlankNodeDiffsComponent = /** @class */ (function () {
769
- function BlankNodeDiffsComponent() {
770
- this.originalValues = [];
771
- this.recalculatedValues = [];
772
- this.propertyValue = propertyValue$1;
773
- this.values = [];
774
- }
775
- BlankNodeDiffsComponent.prototype.ngOnInit = function () {
776
- this.values = formatDiffValues(this.originalValues, this.recalculatedValues);
777
- };
778
- return BlankNodeDiffsComponent;
779
- }());
780
- BlankNodeDiffsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeDiffsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
781
- BlankNodeDiffsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeDiffsComponent, selector: "he-blank-node-diffs", inputs: { originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-3\" *bindOnce=\"values\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th>Original</th>\n <th>Recalculated</th>\n <th>Difference</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let value of values\"\n [class.has-background-light]=\"!!value.original && value.original !== value.recalculated\"\n >\n <td class=\"width-auto\" [attr.title]=\"value.term.name\">\n <ng-container *ngTemplateOutlet=\"termLink; context: {$implicit: value.term}\"></ng-container>\n </td>\n <td>\n <span>{{value.original === undefined ? '-' : value.original}}</span>\n </td>\n <td>\n <span>{{value.recalculated === undefined ? '-' : value.recalculated}}</span>\n </td>\n <td class=\"is-nowrap\">\n <he-blank-node-value-delta\n [value]=\"value.recalculated\"\n [originalValue]=\"value.original\"\n ></he-blank-node-value-delta>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<ng-template #termLink let-term>\n <a [routerLink]=\"['/', 'term', term['@id']]\" target=\"_blank\">\n <span class=\"is-nowrap has-text-ellipsis\">{{term.name}}</span>\n </a>\n</ng-template>\n", styles: ["table.data-table th:first-child,table.data-table td:first-child{width:auto}\n"], components: [{ type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4__namespace.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }] });
782
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeDiffsComponent, decorators: [{
783
- type: i0.Component,
784
- args: [{
785
- selector: 'he-blank-node-diffs',
786
- templateUrl: './blank-node-diffs.component.html',
787
- styleUrls: ['./blank-node-diffs.component.scss']
788
- }]
789
- }], propDecorators: { originalValues: [{
790
- type: i0.Input
791
- }], recalculatedValues: [{
792
- type: i0.Input
793
- }] } });
794
-
795
- var _a$4, _b$1, _c$1;
796
+ var _a$5, _b$2, _c$2;
796
797
  var termProperties = function (term) { return Object.keys(term).filter(function (key) { return !schema.isExpandable(term[key]) && ![
797
798
  'pinned', 'expanded', 'extended', 'selected', 'loading',
798
799
  '_score', '@type', '@id', '@context', 'createdAt',
@@ -818,20 +819,20 @@
818
819
  lng: longitude
819
820
  });
820
821
  };
821
- var termTypeToLabel = (_a$4 = {},
822
- _a$4[schema.TermTermType.methodEmissionResourceUse] = 'Method (Emissions)',
823
- _a$4[schema.TermTermType.methodMeasurement] = 'Method (Measurement)',
824
- _a$4[schema.TermTermType.pesticideAI] = 'Pesticide Active Ingredient',
825
- _a$4[schema.TermTermType.standardsLabels] = 'Standards & Labels',
826
- _a$4[schema.TermTermType.usdaSoilType] = 'USDA Soil Type',
827
- _a$4);
822
+ var termTypeToLabel = (_a$5 = {},
823
+ _a$5[schema.TermTermType.methodEmissionResourceUse] = 'Method (Emissions)',
824
+ _a$5[schema.TermTermType.methodMeasurement] = 'Method (Measurement)',
825
+ _a$5[schema.TermTermType.pesticideAI] = 'Pesticide Active Ingredient',
826
+ _a$5[schema.TermTermType.standardsLabels] = 'Standards & Labels',
827
+ _a$5[schema.TermTermType.usdaSoilType] = 'USDA Soil Type',
828
+ _a$5);
828
829
  var termTypeLabel = function (type) {
829
830
  if (type === void 0) { type = 'N/A'; }
830
831
  return type in termTypeToLabel ? termTypeToLabel[type] : keyToLabel(type);
831
832
  };
832
833
  var termTypesToChildren = function (termTypes) { return termTypes.map(function (termType) { return ({ label: termTypeLabel(termType), termType: termType }); }); };
833
- var groups = Object.freeze((_b$1 = {},
834
- _b$1[schema.TermTermType.emission] = {
834
+ var groups = Object.freeze((_b$2 = {},
835
+ _b$2[schema.TermTermType.emission] = {
835
836
  label: 'Emissions & Resource Use',
836
837
  termType: 'Emissions & Resource Use',
837
838
  children: termTypesToChildren([
@@ -843,12 +844,12 @@
843
844
  schema.TermTermType.methodEmissionResourceUse
844
845
  ])
845
846
  },
846
- _b$1[schema.TermTermType.region] = {
847
+ _b$2[schema.TermTermType.region] = {
847
848
  label: termTypeLabel(schema.TermTermType.region),
848
849
  termType: schema.TermTermType.region,
849
850
  children: []
850
851
  },
851
- _b$1.infrastructure = {
852
+ _b$2.infrastructure = {
852
853
  label: 'Infrastructure & Equipment',
853
854
  termType: 'Infrastructure & Equipment',
854
855
  children: termTypesToChildren([
@@ -859,7 +860,7 @@
859
860
  schema.TermTermType.machinery
860
861
  ])
861
862
  },
862
- _b$1.input = {
863
+ _b$2.input = {
863
864
  label: 'Inputs',
864
865
  termType: 'Inputs',
865
866
  children: termTypesToChildren([
@@ -877,7 +878,7 @@
877
878
  schema.TermTermType.water
878
879
  ])
879
880
  },
880
- _b$1[schema.TermTermType.measurement] = {
881
+ _b$2[schema.TermTermType.measurement] = {
881
882
  label: 'Measurements',
882
883
  termType: 'Measurements',
883
884
  children: termTypesToChildren([
@@ -888,7 +889,7 @@
888
889
  schema.TermTermType.methodMeasurement
889
890
  ])
890
891
  },
891
- _b$1.practice = {
892
+ _b$2.practice = {
892
893
  label: 'Practices',
893
894
  termType: 'Production Practices',
894
895
  children: termTypesToChildren([
@@ -906,7 +907,7 @@
906
907
  schema.TermTermType.waterRegime,
907
908
  ])
908
909
  },
909
- _b$1.product = {
910
+ _b$2.product = {
910
911
  label: 'Products',
911
912
  termType: 'Products',
912
913
  children: termTypesToChildren([
@@ -919,12 +920,12 @@
919
920
  schema.TermTermType.processedFood
920
921
  ])
921
922
  },
922
- _b$1[schema.TermTermType.property] = {
923
+ _b$2[schema.TermTermType.property] = {
923
924
  label: termTypeLabel(schema.TermTermType.property),
924
925
  termType: schema.TermTermType.property,
925
926
  children: []
926
927
  },
927
- _b$1));
928
+ _b$2));
928
929
  var termTypeGroups = [
929
930
  groups.property,
930
931
  groups.region,
@@ -935,10 +936,10 @@
935
936
  groups.measurement,
936
937
  groups.infrastructure
937
938
  ];
938
- var termToParent = (_c$1 = {},
939
- _c$1[schema.TermTermType.property] = 'Properties',
940
- _c$1[schema.TermTermType.region] = 'Geographies',
941
- _c$1);
939
+ var termToParent = (_c$2 = {},
940
+ _c$2[schema.TermTermType.property] = 'Properties',
941
+ _c$2[schema.TermTermType.region] = 'Geographies',
942
+ _c$2);
942
943
  var termChildToParent = function (termType) { return termTypeGroups.find(function (_a) {
943
944
  var children = _a.children;
944
945
  return (children || []).some(function (child) { return child.termType === termType; });
@@ -993,268 +994,526 @@
993
994
  schema.TermTermType.standardsLabels
994
995
  ];
995
996
 
996
- var HE_API_BASE_URL = new i0.InjectionToken('HE_API_BASE_URL');
997
- var HeCommonService = /** @class */ (function () {
998
- function HeCommonService(_apiBaseUrl) {
999
- this._apiBaseUrl = _apiBaseUrl;
997
+ var KeyToLabelPipe = /** @class */ (function () {
998
+ function KeyToLabelPipe() {
1000
999
  }
1001
- Object.defineProperty(HeCommonService.prototype, "apiBaseUrl", {
1002
- get: function () {
1003
- return this._apiBaseUrl || '/api';
1004
- },
1005
- enumerable: false,
1006
- configurable: true
1007
- });
1008
- return HeCommonService;
1000
+ KeyToLabelPipe.prototype.transform = function (value) {
1001
+ // using termTypeLabel here which defaults to `keyToLabel` function
1002
+ return termTypeLabel(value);
1003
+ };
1004
+ return KeyToLabelPipe;
1009
1005
  }());
1010
- HeCommonService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, deps: [{ token: HE_API_BASE_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1011
- HeCommonServiceprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, providedIn: 'root' });
1012
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, decorators: [{
1013
- type: i0.Injectable,
1006
+ KeyToLabelPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeyToLabelPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1007
+ KeyToLabelPipepipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeyToLabelPipe, name: "keyToLabel" });
1008
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeyToLabelPipe, decorators: [{
1009
+ type: i0.Pipe,
1014
1010
  args: [{
1015
- providedIn: 'root'
1011
+ name: 'keyToLabel'
1016
1012
  }]
1017
- }], ctorParameters: function () {
1018
- return [{ type: undefined, decorators: [{
1019
- type: i0.Inject,
1020
- args: [HE_API_BASE_URL]
1021
- }] }];
1022
- } });
1013
+ }] });
1023
1014
 
1024
- var nodeTypeUrl = function (apiBaseUrl, type) { return type ? apiBaseUrl + "/" + api.nodeTypeToParam(type) : ''; };
1025
- /**
1026
- * Get the full url to fetch the node data.
1027
- *
1028
- * @param apiBaseUrl The url of the API hosting the data.
1029
- * @param node The node with a type, id and optionally a dataState
1030
- * @returns The full url.
1031
- */
1032
- var nodeUrl = function (apiBaseUrl, _a) {
1033
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1034
- return nodeTypeUrl(apiBaseUrl, node['@type'] || node.type) + "/" + (node['@id'] || node.id) + (dataState ? "?dataState=" + dataState : '');
1035
- };
1036
- var nodeLogsUrl = function (apiBaseUrl, _a) {
1037
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1038
- return nodeUrl(apiBaseUrl, node) + "/log" + (dataState ? "?dataState=" + dataState : '');
1039
- };
1040
- var lookupUrl = function (filename) { return filename.startsWith('http') ? filename : baseUrl() + "/glossary/lookups/" + filename + ".csv"; };
1041
- var termTypeLookupUrl = function (termType) { return baseUrl() + "/glossary/" + termChildToParent(termType).termType + "/" + termType + ".csv"; };
1042
- var HeNodeService = /** @class */ (function () {
1043
- function HeNodeService(http, authService, commonService) {
1044
- this.http = http;
1045
- this.authService = authService;
1046
- this.commonService = commonService;
1015
+ var KeysPipe = /** @class */ (function () {
1016
+ function KeysPipe() {
1047
1017
  }
1048
- HeNodeService.prototype.get$ = function (_a) {
1049
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1050
- return this.http.get(this.nodeUrl(node), {
1051
- headers: this.authService.headers,
1052
- params: filterParams({ dataState: dataState })
1053
- });
1054
- };
1055
- HeNodeService.prototype.get = function (node, defaultForState) {
1056
- if (defaultForState === void 0) { defaultForState = true; }
1057
- return this.get$(node)
1058
- .toPromise()
1059
- .catch(function () { return node.dataState && defaultForState ? node : ({}); });
1060
- };
1061
- HeNodeService.prototype.getLog = function (_a) {
1062
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1063
- return this.http.get(this.nodeUrl(node) + "/log", {
1064
- headers: this.authService.headers,
1065
- responseType: 'text',
1066
- params: filterParams({ dataState: dataState })
1067
- }).pipe(operators.catchError(function () { return rxjs.of(''); }));
1068
- };
1069
- HeNodeService.prototype.getMissingLookupsLog = function (_a) {
1070
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1071
- return this.http.get(this.nodeUrl(node) + "/log/lookups", {
1072
- headers: this.authService.headers,
1073
- params: filterParams({ dataState: dataState })
1074
- }).toPromise().catch(handleAPIError);
1075
- };
1076
- HeNodeService.prototype.getModelsLog = function (_a) {
1077
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1078
- return this.http.get(this.nodeUrl(node) + "/log/models", {
1079
- headers: this.authService.headers,
1080
- params: filterParams({ dataState: dataState })
1081
- }).toPromise().catch(handleAPIError);
1082
- };
1083
- HeNodeService.prototype.triggerPipeline = function (_a) {
1084
- var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1085
- return this.http.post(this.nodeUrl(node) + "/pipeline", dataState ? { dataState: dataState } : {}, {
1086
- headers: this.authService.headers
1087
- }).toPromise().catch(handleAPIError);
1088
- };
1089
- HeNodeService.prototype.downloadRaw = function (url, responseType) {
1090
- if (responseType === void 0) { responseType = 'json'; }
1091
- return this.http.get(url, { responseType: responseType })
1092
- .toPromise()
1093
- .catch(function () { return (responseType === 'json' ? ({}) : ''); });
1094
- };
1095
- HeNodeService.prototype.nodeTypeUrl = function (type) {
1096
- return nodeTypeUrl(this.commonService.apiBaseUrl, type);
1097
- };
1098
- HeNodeService.prototype.nodeUrl = function (node) {
1099
- return nodeUrl(this.commonService.apiBaseUrl, node);
1100
- };
1101
- HeNodeService.prototype.nodeLogsUrl = function (node) {
1102
- return nodeLogsUrl(this.commonService.apiBaseUrl, node);
1103
- };
1104
- HeNodeService.prototype.downloadLookup = function (filename) {
1105
- return __awaiter(this, void 0, void 0, function () {
1106
- var url;
1107
- return __generator(this, function (_b) {
1108
- try {
1109
- url = lookupUrl(filename);
1110
- return [2 /*return*/, this.downloadRaw(url, 'text')];
1111
- }
1112
- catch (_err) {
1113
- return [2 /*return*/, null];
1114
- }
1115
- return [2 /*return*/];
1116
- });
1117
- });
1118
- };
1119
- HeNodeService.prototype.lookupLink = function (termType) {
1120
- return __awaiter(this, void 0, void 0, function () {
1121
- var data, _err_1;
1122
- return __generator(this, function (_b) {
1123
- switch (_b.label) {
1124
- case 0:
1125
- _b.trys.push([0, 2, , 3]);
1126
- return [4 /*yield*/, this.downloadLookup(termType)];
1127
- case 1:
1128
- data = _b.sent();
1129
- return [2 /*return*/, (data === null || data === void 0 ? void 0 : data.startsWith('term.id')) ? lookupUrl(termType) : null];
1130
- case 2:
1131
- _err_1 = _b.sent();
1132
- return [2 /*return*/, null];
1133
- case 3: return [2 /*return*/];
1134
- }
1135
- });
1136
- });
1018
+ KeysPipe.prototype.transform = function (value, sort) {
1019
+ if (sort === void 0) { sort = false; }
1020
+ var keys = Object.keys(value).map(function (key) { return ({ key: key, value: value[key] }); });
1021
+ if (sort) {
1022
+ keys.sort(function (a, b) { return a.key.localeCompare(b.key); });
1023
+ }
1024
+ return keys;
1137
1025
  };
1138
- return HeNodeService;
1026
+ return KeysPipe;
1139
1027
  }());
1140
- HeNodeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeService, deps: [{ token: i1__namespace$1.HttpClient }, { token: HeAuthService }, { token: HeCommonService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1141
- HeNodeServiceprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeService, providedIn: 'root' });
1142
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeService, decorators: [{
1143
- type: i0.Injectable,
1028
+ KeysPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeysPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1029
+ KeysPipepipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeysPipe, name: "keys" });
1030
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeysPipe, decorators: [{
1031
+ type: i0.Pipe,
1144
1032
  args: [{
1145
- providedIn: 'root'
1033
+ name: 'keys'
1146
1034
  }]
1147
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeAuthService }, { type: HeCommonService }]; } });
1035
+ }] });
1148
1036
 
1149
- var gitUrl$1 = function () { return gitHome + "/hestia-aggregation-engine/-/blob/" + gitBranch(); };
1150
- var rawUrl$1 = function () { return gitRawBaseUrl + "/hestia-aggregation-engine/-/raw/" + gitBranch(); };
1151
- var lookups = Object.freeze({
1152
- cropYield: 'region-crop-cropGroupingFaostatProduction-yield',
1153
- cropGroupingColumn: 'cropGroupingFaostatProduction'
1154
- });
1155
- var HeAggregationEngineService = /** @class */ (function () {
1156
- function HeAggregationEngineService(http, nodeService) {
1157
- this.http = http;
1158
- this.nodeService = nodeService;
1159
- this.modelsLoading = false;
1160
- this.modelsLoaded = false;
1161
- this._models = new rxjs.ReplaySubject(1);
1162
- this.lookupsLoading = false;
1163
- this.lookupsLoaded = false;
1164
- this._lookups = new rxjs.ReplaySubject(1);
1165
- this.init();
1037
+ var PluralizePipe = /** @class */ (function () {
1038
+ function PluralizePipe() {
1166
1039
  }
1167
- HeAggregationEngineService.prototype.init = function () {
1168
- return __awaiter(this, void 0, void 0, function () {
1169
- return __generator(this, function (_b) {
1170
- switch (_b.label) {
1171
- case 0: return [4 /*yield*/, this.loadModels().toPromise()];
1172
- case 1:
1173
- _b.sent();
1174
- return [2 /*return*/];
1175
- }
1176
- });
1177
- });
1040
+ PluralizePipe.prototype.transform = function (value, times) {
1041
+ if (times === void 0) { times = 0; }
1042
+ return pluralize__namespace(value, times);
1178
1043
  };
1179
- HeAggregationEngineService.prototype.loadModels = function () {
1180
- var _this = this;
1181
- this.modelsLoading = true;
1182
- return this.http.get(rawUrl$1() + "/model-links.json").pipe(operators.catchError(function () { return rxjs.of({ links: [] }); }), operators.map(function (_b) {
1183
- var links = _b.links;
1184
- _this._models.next(links.map(function (_a) {
1185
- var modelPath = _a.path, docPath = _a.docPath, link = __rest(_a, ["path", "docPath"]);
1186
- return (Object.assign(Object.assign({}, link), { path: gitUrl$1() + "/" + modelPath, docPath: gitUrl$1() + "/" + docPath }));
1187
- }));
1188
- _this.modelsLoading = false;
1189
- _this.modelsLoaded = true;
1190
- return links;
1191
- }));
1044
+ return PluralizePipe;
1045
+ }());
1046
+ PluralizePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PluralizePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1047
+ PluralizePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PluralizePipe, name: "pluralize" });
1048
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PluralizePipe, decorators: [{
1049
+ type: i0.Pipe,
1050
+ args: [{
1051
+ name: 'pluralize'
1052
+ }]
1053
+ }] });
1054
+
1055
+ var PrecisionPipe = /** @class */ (function () {
1056
+ function PrecisionPipe() {
1057
+ }
1058
+ PrecisionPipe.prototype.transform = function (value, precision) {
1059
+ return utils.isUndefined(value) ?
1060
+ null : (utils.isNumber(value) ?
1061
+ ("" + utils.toPrecision(parseFloat("" + value), parseInt("" + precision, 10))).replace(/\.00$/, '') :
1062
+ value);
1192
1063
  };
1193
- Object.defineProperty(HeAggregationEngineService.prototype, "models$", {
1064
+ return PrecisionPipe;
1065
+ }());
1066
+ PrecisionPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PrecisionPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1067
+ PrecisionPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PrecisionPipe, name: "precision" });
1068
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PrecisionPipe, decorators: [{
1069
+ type: i0.Pipe,
1070
+ args: [{
1071
+ name: 'precision'
1072
+ }]
1073
+ }] });
1074
+
1075
+ var components$7 = [
1076
+ SocialTagsComponent,
1077
+ ToastComponent,
1078
+ BindOnceDirective,
1079
+ DefaultPipe,
1080
+ EllipsisPipe,
1081
+ KeysPipe,
1082
+ PluralizePipe,
1083
+ KeyToLabelPipe,
1084
+ PrecisionPipe
1085
+ ];
1086
+ var HeCommonLightModule = /** @class */ (function () {
1087
+ function HeCommonLightModule() {
1088
+ }
1089
+ return HeCommonLightModule;
1090
+ }());
1091
+ HeCommonLightModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonLightModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1092
+ HeCommonLightModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonLightModule, declarations: [SocialTagsComponent,
1093
+ ToastComponent,
1094
+ BindOnceDirective,
1095
+ DefaultPipe,
1096
+ EllipsisPipe,
1097
+ KeysPipe,
1098
+ PluralizePipe,
1099
+ KeyToLabelPipe,
1100
+ PrecisionPipe], imports: [i3.CommonModule, i1$2.FormsModule, i4.RouterModule,
1101
+ HeFontawesomeModule], exports: [HeFontawesomeModule, SocialTagsComponent,
1102
+ ToastComponent,
1103
+ BindOnceDirective,
1104
+ DefaultPipe,
1105
+ EllipsisPipe,
1106
+ KeysPipe,
1107
+ PluralizePipe,
1108
+ KeyToLabelPipe,
1109
+ PrecisionPipe] });
1110
+ HeCommonLightModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonLightModule, imports: [[
1111
+ i3.CommonModule, i1$2.FormsModule, i4.RouterModule,
1112
+ HeFontawesomeModule
1113
+ ], HeFontawesomeModule] });
1114
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonLightModule, decorators: [{
1115
+ type: i0.NgModule,
1116
+ args: [{
1117
+ declarations: components$7,
1118
+ exports: __spreadArray([
1119
+ HeFontawesomeModule
1120
+ ], __read(components$7)),
1121
+ imports: [
1122
+ i3.CommonModule, i1$2.FormsModule, i4.RouterModule,
1123
+ HeFontawesomeModule
1124
+ ]
1125
+ }]
1126
+ }] });
1127
+
1128
+ var _a$4, _b$1, _c$1, _d$2;
1129
+ var SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
1130
+ var WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
1131
+ exports.DeltaColour = void 0;
1132
+ (function (DeltaColour) {
1133
+ DeltaColour["Success"] = "success";
1134
+ DeltaColour["Warning"] = "warning";
1135
+ DeltaColour["Danger"] = "danger";
1136
+ })(exports.DeltaColour || (exports.DeltaColour = {}));
1137
+ exports.DeltaDisplayType = void 0;
1138
+ (function (DeltaDisplayType) {
1139
+ DeltaDisplayType["absolute"] = "absolute";
1140
+ DeltaDisplayType["percent"] = "percent";
1141
+ })(exports.DeltaDisplayType || (exports.DeltaDisplayType = {}));
1142
+ var deltaPerType = (_a$4 = {},
1143
+ _a$4[exports.DeltaDisplayType.absolute] = function (value, original) { return value - original; },
1144
+ _a$4[exports.DeltaDisplayType.percent] = function (value, original) { return ((value - original) / original) * 100; },
1145
+ _a$4);
1146
+ var roundValue = function (value) { return +("" + value).substring(0, 10); };
1147
+ var delta = function (value, originalValue, displayType, mapping) {
1148
+ if (displayType === void 0) { displayType = exports.DeltaDisplayType.percent; }
1149
+ var vvalue = roundValue(propertyValue$1(value));
1150
+ var voriginalValue = roundValue(propertyValue$1(originalValue));
1151
+ var deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
1152
+ var diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
1153
+ return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
1154
+ };
1155
+ var PercentDeltaConditions;
1156
+ (function (PercentDeltaConditions) {
1157
+ PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
1158
+ PercentDeltaConditions["original0"] = "original is 0";
1159
+ })(PercentDeltaConditions || (PercentDeltaConditions = {}));
1160
+ var calculatePercentDeltaConditions = (_b$1 = {},
1161
+ _b$1[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return original > 0 && recalculated === 0; },
1162
+ _b$1[PercentDeltaConditions.original0] = function (original, recalculated) { return original === 0 && recalculated > 0; },
1163
+ _b$1);
1164
+ var calculatePercentDeltaResult = (_c$1 = {},
1165
+ _c$1[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return (recalculated - original) / (original + 1); },
1166
+ // Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
1167
+ _c$1[PercentDeltaConditions.original0] = function (original, recalculated) { return Math.sign(recalculated - original); },
1168
+ _c$1.default = function (original, recalculated) { return (recalculated - original) / original; },
1169
+ _c$1);
1170
+ var calculatePercentDelta = function (recalculated, original) {
1171
+ var matchingCondition = Object.values(PercentDeltaConditions).find(function (value) { return calculatePercentDeltaConditions[value](original, recalculated); }) || 'default';
1172
+ return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
1173
+ };
1174
+ var customDeltaFuncs = (_d$2 = {},
1175
+ _d$2[exports.DeltaDisplayType.percent] = calculatePercentDelta,
1176
+ _d$2);
1177
+ var evaluateSuccess = function (deltaValue) { return Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
1178
+ ? exports.DeltaColour.Success
1179
+ : Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
1180
+ ? exports.DeltaColour.Warning
1181
+ : exports.DeltaColour.Danger; };
1182
+
1183
+ var BlankNodeValueDeltaComponent = /** @class */ (function () {
1184
+ function BlankNodeValueDeltaComponent() {
1185
+ this.displayType = exports.DeltaDisplayType.percent;
1186
+ this.DeltaDisplayType = exports.DeltaDisplayType;
1187
+ }
1188
+ Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "hide", {
1194
1189
  get: function () {
1195
- return this.modelsLoading || this.modelsLoaded ? this._models.asObservable() : this.loadModels();
1190
+ return emptyValue(this.value) || emptyValue(this.originalValue);
1196
1191
  },
1197
1192
  enumerable: false,
1198
1193
  configurable: true
1199
1194
  });
1200
- HeAggregationEngineService.prototype.models = function () {
1201
- return this.models$.pipe(operators.take(1)).toPromise();
1202
- };
1203
- HeAggregationEngineService.prototype.model$ = function (model) {
1204
- return this.models$.pipe(operators.map(function (models) { return models.find(function (m) { return Object.keys(model).every(function (key) { return model[key] === m[key]; }); }); }));
1205
- };
1206
- HeAggregationEngineService.prototype.model = function (model) {
1207
- return this.model$(model).pipe(operators.take(1)).toPromise();
1208
- };
1209
- HeAggregationEngineService.prototype.loadLookup = function (filename) {
1210
- return __awaiter(this, void 0, void 0, function () {
1211
- var data;
1212
- return __generator(this, function (_b) {
1213
- switch (_b.label) {
1214
- case 0: return [4 /*yield*/, this.nodeService.downloadLookup(filename)];
1215
- case 1:
1216
- data = _b.sent();
1217
- return [2 /*return*/, csvtojson__namespace({ delimiter: 'auto' }).fromString(data)];
1218
- }
1219
- });
1220
- });
1221
- };
1222
- HeAggregationEngineService.prototype.loadLookups = function () {
1223
- var _this = this;
1224
- return rxjs.forkJoin({
1225
- cropYield: rxjs.from(this.loadLookup(lookups.cropYield)),
1226
- crop: rxjs.from(this.loadLookup(schema.TermTermType.crop))
1227
- }).pipe(operators.map(function (values) {
1228
- _this._lookups.next(values);
1229
- _this.lookupsLoading = false;
1230
- _this.lookupsLoaded = true;
1231
- return values;
1232
- }));
1233
- };
1234
- Object.defineProperty(HeAggregationEngineService.prototype, "lookups$", {
1195
+ Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "delta", {
1235
1196
  get: function () {
1236
- return this.lookupsLoading || this.lookupsLoaded ? this._lookups.asObservable() : this.loadLookups();
1197
+ return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
1237
1198
  },
1238
1199
  enumerable: false,
1239
1200
  configurable: true
1240
1201
  });
1241
- HeAggregationEngineService.prototype.lookups = function () {
1242
- return this.lookups$.pipe(operators.take(1)).toPromise();
1202
+ Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "color", {
1203
+ get: function () {
1204
+ return this.displayType === exports.DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
1205
+ },
1206
+ enumerable: false,
1207
+ configurable: true
1208
+ });
1209
+ return BlankNodeValueDeltaComponent;
1210
+ }());
1211
+ BlankNodeValueDeltaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeValueDeltaComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1212
+ BlankNodeValueDeltaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: { value: "value", originalValue: "originalValue", displayType: "displayType" }, ngImport: i0__namespace, template: "<small [class.is-hidden]=\"hide\">\n <span class=\"has-text-{{color}}\">\n <span *ngIf=\"delta > 0\">+</span>\n <ng-container [ngSwitch]=\"displayType\">\n <ng-container *ngSwitchCase=\"DeltaDisplayType.absolute\">\n <span *bindOnce=\"delta\">{{delta | precision:3}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DeltaDisplayType.percent\">\n <span *bindOnce=\"delta\">{{delta | number:'1.0-2'}}</span>\n <span>%</span>\n </ng-container>\n </ng-container>\n </span>\n</small>\n", styles: [""], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "precision": PrecisionPipe, "number": i3__namespace.DecimalPipe } });
1213
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeValueDeltaComponent, decorators: [{
1214
+ type: i0.Component,
1215
+ args: [{
1216
+ selector: 'he-blank-node-value-delta',
1217
+ templateUrl: './blank-node-value-delta.component.html',
1218
+ styleUrls: ['./blank-node-value-delta.component.scss']
1219
+ }]
1220
+ }], propDecorators: { value: [{
1221
+ type: i0.Input
1222
+ }], originalValue: [{
1223
+ type: i0.Input
1224
+ }], displayType: [{
1225
+ type: i0.Input
1226
+ }] } });
1227
+
1228
+ var BlankNodeDiffsComponent = /** @class */ (function () {
1229
+ function BlankNodeDiffsComponent() {
1230
+ this.originalValues = [];
1231
+ this.recalculatedValues = [];
1232
+ this.propertyValue = propertyValue$1;
1233
+ this.values = [];
1234
+ }
1235
+ BlankNodeDiffsComponent.prototype.ngOnInit = function () {
1236
+ this.values = formatDiffValues(this.originalValues, this.recalculatedValues);
1243
1237
  };
1244
- return HeAggregationEngineService;
1238
+ return BlankNodeDiffsComponent;
1245
1239
  }());
1246
- HeAggregationEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, deps: [{ token: i1__namespace$1.HttpClient }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1247
- HeAggregationEngineServiceprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, providedIn: 'root' });
1248
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, decorators: [{
1240
+ BlankNodeDiffsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeDiffsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1241
+ BlankNodeDiffsComponentcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeDiffsComponent, selector: "he-blank-node-diffs", inputs: { originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-3\" *bindOnce=\"values\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th>Original</th>\n <th>Recalculated</th>\n <th>Difference</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let value of values\"\n [class.has-background-light]=\"!!value.original && value.original !== value.recalculated\"\n >\n <td class=\"width-auto\" [attr.title]=\"value.term.name\">\n <ng-container *ngTemplateOutlet=\"termLink; context: {$implicit: value.term}\"></ng-container>\n </td>\n <td>\n <span>{{value.original === undefined ? '-' : value.original}}</span>\n </td>\n <td>\n <span>{{value.recalculated === undefined ? '-' : value.recalculated}}</span>\n </td>\n <td class=\"is-nowrap\">\n <he-blank-node-value-delta\n [value]=\"value.recalculated\"\n [originalValue]=\"value.original\"\n ></he-blank-node-value-delta>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<ng-template #termLink let-term>\n <a [routerLink]=\"['/', 'term', term['@id']]\" target=\"_blank\">\n <span class=\"is-nowrap has-text-ellipsis\">{{term.name}}</span>\n </a>\n</ng-template>\n", styles: ["table.data-table th:first-child,table.data-table td:first-child{width:auto}\n"], components: [{ type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4__namespace.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }] });
1242
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlankNodeDiffsComponent, decorators: [{
1243
+ type: i0.Component,
1244
+ args: [{
1245
+ selector: 'he-blank-node-diffs',
1246
+ templateUrl: './blank-node-diffs.component.html',
1247
+ styleUrls: ['./blank-node-diffs.component.scss']
1248
+ }]
1249
+ }], propDecorators: { originalValues: [{
1250
+ type: i0.Input
1251
+ }], recalculatedValues: [{
1252
+ type: i0.Input
1253
+ }] } });
1254
+
1255
+ var HE_API_BASE_URL = new i0.InjectionToken('HE_API_BASE_URL');
1256
+ var HeCommonService = /** @class */ (function () {
1257
+ function HeCommonService(_apiBaseUrl) {
1258
+ this._apiBaseUrl = _apiBaseUrl;
1259
+ }
1260
+ Object.defineProperty(HeCommonService.prototype, "apiBaseUrl", {
1261
+ get: function () {
1262
+ return this._apiBaseUrl || '/api';
1263
+ },
1264
+ enumerable: false,
1265
+ configurable: true
1266
+ });
1267
+ return HeCommonService;
1268
+ }());
1269
+ HeCommonService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, deps: [{ token: HE_API_BASE_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1270
+ HeCommonService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, providedIn: 'root' });
1271
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, decorators: [{
1249
1272
  type: i0.Injectable,
1250
1273
  args: [{
1251
1274
  providedIn: 'root'
1252
1275
  }]
1253
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeNodeService }]; } });
1276
+ }], ctorParameters: function () {
1277
+ return [{ type: undefined, decorators: [{
1278
+ type: i0.Inject,
1279
+ args: [HE_API_BASE_URL]
1280
+ }] }];
1281
+ } });
1254
1282
 
1255
- var HE_ORCHESTRATOR_BASE_URL = new i0.InjectionToken('HE_ORCHESTRATOR_BASE_URL');
1256
- var gitUrl = function () { return gitHome + "/hestia-engine-models/-/blob/" + gitBranch(); };
1257
- var rawUrl = function () { return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + gitBranch(); };
1283
+ var nodeTypeUrl = function (apiBaseUrl, type) { return type ? apiBaseUrl + "/" + api.nodeTypeToParam(type) : ''; };
1284
+ /**
1285
+ * Get the full url to fetch the node data.
1286
+ *
1287
+ * @param apiBaseUrl The url of the API hosting the data.
1288
+ * @param node The node with a type, id and optionally a dataState
1289
+ * @returns The full url.
1290
+ */
1291
+ var nodeUrl = function (apiBaseUrl, _a) {
1292
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1293
+ return nodeTypeUrl(apiBaseUrl, node['@type'] || node.type) + "/" + (node['@id'] || node.id) + (dataState ? "?dataState=" + dataState : '');
1294
+ };
1295
+ var nodeLogsUrl = function (apiBaseUrl, _a) {
1296
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1297
+ return nodeUrl(apiBaseUrl, node) + "/log" + (dataState ? "?dataState=" + dataState : '');
1298
+ };
1299
+ var lookupUrl = function (filename) { return filename.startsWith('http') ? filename : baseUrl() + "/glossary/lookups/" + filename + ".csv"; };
1300
+ var termTypeLookupUrl = function (termType) { return baseUrl() + "/glossary/" + termChildToParent(termType).termType + "/" + termType + ".csv"; };
1301
+ var HeNodeService = /** @class */ (function () {
1302
+ function HeNodeService(http, authService, commonService) {
1303
+ this.http = http;
1304
+ this.authService = authService;
1305
+ this.commonService = commonService;
1306
+ }
1307
+ HeNodeService.prototype.get$ = function (_a) {
1308
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1309
+ return this.http.get(this.nodeUrl(node), {
1310
+ headers: this.authService.headers,
1311
+ params: filterParams({ dataState: dataState })
1312
+ });
1313
+ };
1314
+ HeNodeService.prototype.get = function (node, defaultForState) {
1315
+ if (defaultForState === void 0) { defaultForState = true; }
1316
+ return this.get$(node)
1317
+ .toPromise()
1318
+ .catch(function () { return node.dataState && defaultForState ? node : ({}); });
1319
+ };
1320
+ HeNodeService.prototype.getLog = function (_a) {
1321
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1322
+ return this.http.get(this.nodeUrl(node) + "/log", {
1323
+ headers: this.authService.headers,
1324
+ responseType: 'text',
1325
+ params: filterParams({ dataState: dataState })
1326
+ }).pipe(operators.catchError(function () { return rxjs.of(''); }));
1327
+ };
1328
+ HeNodeService.prototype.getMissingLookupsLog = function (_a) {
1329
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1330
+ return this.http.get(this.nodeUrl(node) + "/log/lookups", {
1331
+ headers: this.authService.headers,
1332
+ params: filterParams({ dataState: dataState })
1333
+ }).toPromise().catch(handleAPIError);
1334
+ };
1335
+ HeNodeService.prototype.getModelsLog = function (_a) {
1336
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1337
+ return this.http.get(this.nodeUrl(node) + "/log/models", {
1338
+ headers: this.authService.headers,
1339
+ params: filterParams({ dataState: dataState })
1340
+ }).toPromise().catch(handleAPIError);
1341
+ };
1342
+ HeNodeService.prototype.triggerPipeline = function (_a) {
1343
+ var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
1344
+ return this.http.post(this.nodeUrl(node) + "/pipeline", dataState ? { dataState: dataState } : {}, {
1345
+ headers: this.authService.headers
1346
+ }).toPromise().catch(handleAPIError);
1347
+ };
1348
+ HeNodeService.prototype.downloadRaw = function (url, responseType) {
1349
+ if (responseType === void 0) { responseType = 'json'; }
1350
+ return this.http.get(url, { responseType: responseType })
1351
+ .toPromise()
1352
+ .catch(function () { return (responseType === 'json' ? ({}) : ''); });
1353
+ };
1354
+ HeNodeService.prototype.nodeTypeUrl = function (type) {
1355
+ return nodeTypeUrl(this.commonService.apiBaseUrl, type);
1356
+ };
1357
+ HeNodeService.prototype.nodeUrl = function (node) {
1358
+ return nodeUrl(this.commonService.apiBaseUrl, node);
1359
+ };
1360
+ HeNodeService.prototype.nodeLogsUrl = function (node) {
1361
+ return nodeLogsUrl(this.commonService.apiBaseUrl, node);
1362
+ };
1363
+ HeNodeService.prototype.downloadLookup = function (filename) {
1364
+ return __awaiter(this, void 0, void 0, function () {
1365
+ var url;
1366
+ return __generator(this, function (_b) {
1367
+ try {
1368
+ url = lookupUrl(filename);
1369
+ return [2 /*return*/, this.downloadRaw(url, 'text')];
1370
+ }
1371
+ catch (_err) {
1372
+ return [2 /*return*/, null];
1373
+ }
1374
+ return [2 /*return*/];
1375
+ });
1376
+ });
1377
+ };
1378
+ HeNodeService.prototype.lookupLink = function (termType) {
1379
+ return __awaiter(this, void 0, void 0, function () {
1380
+ var data, _err_1;
1381
+ return __generator(this, function (_b) {
1382
+ switch (_b.label) {
1383
+ case 0:
1384
+ _b.trys.push([0, 2, , 3]);
1385
+ return [4 /*yield*/, this.downloadLookup(termType)];
1386
+ case 1:
1387
+ data = _b.sent();
1388
+ return [2 /*return*/, (data === null || data === void 0 ? void 0 : data.startsWith('term.id')) ? lookupUrl(termType) : null];
1389
+ case 2:
1390
+ _err_1 = _b.sent();
1391
+ return [2 /*return*/, null];
1392
+ case 3: return [2 /*return*/];
1393
+ }
1394
+ });
1395
+ });
1396
+ };
1397
+ return HeNodeService;
1398
+ }());
1399
+ HeNodeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeService, deps: [{ token: i1__namespace$2.HttpClient }, { token: HeAuthService }, { token: HeCommonService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1400
+ HeNodeService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeService, providedIn: 'root' });
1401
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeService, decorators: [{
1402
+ type: i0.Injectable,
1403
+ args: [{
1404
+ providedIn: 'root'
1405
+ }]
1406
+ }], ctorParameters: function () { return [{ type: i1__namespace$2.HttpClient }, { type: HeAuthService }, { type: HeCommonService }]; } });
1407
+
1408
+ var gitUrl$1 = function () { return gitHome + "/hestia-aggregation-engine/-/blob/" + gitBranch(); };
1409
+ var rawUrl$1 = function () { return gitRawBaseUrl + "/hestia-aggregation-engine/-/raw/" + gitBranch(); };
1410
+ var lookups = Object.freeze({
1411
+ cropYield: 'region-crop-cropGroupingFaostatProduction-yield',
1412
+ cropGroupingColumn: 'cropGroupingFaostatProduction'
1413
+ });
1414
+ var HeAggregationEngineService = /** @class */ (function () {
1415
+ function HeAggregationEngineService(http, nodeService) {
1416
+ this.http = http;
1417
+ this.nodeService = nodeService;
1418
+ this.modelsLoading = false;
1419
+ this.modelsLoaded = false;
1420
+ this._models = new rxjs.ReplaySubject(1);
1421
+ this.lookupsLoading = false;
1422
+ this.lookupsLoaded = false;
1423
+ this._lookups = new rxjs.ReplaySubject(1);
1424
+ this.init();
1425
+ }
1426
+ HeAggregationEngineService.prototype.init = function () {
1427
+ return __awaiter(this, void 0, void 0, function () {
1428
+ return __generator(this, function (_b) {
1429
+ switch (_b.label) {
1430
+ case 0: return [4 /*yield*/, this.loadModels().toPromise()];
1431
+ case 1:
1432
+ _b.sent();
1433
+ return [2 /*return*/];
1434
+ }
1435
+ });
1436
+ });
1437
+ };
1438
+ HeAggregationEngineService.prototype.loadModels = function () {
1439
+ var _this = this;
1440
+ this.modelsLoading = true;
1441
+ return this.http.get(rawUrl$1() + "/model-links.json").pipe(operators.catchError(function () { return rxjs.of({ links: [] }); }), operators.map(function (_b) {
1442
+ var links = _b.links;
1443
+ _this._models.next(links.map(function (_a) {
1444
+ var modelPath = _a.path, docPath = _a.docPath, link = __rest(_a, ["path", "docPath"]);
1445
+ return (Object.assign(Object.assign({}, link), { path: gitUrl$1() + "/" + modelPath, docPath: gitUrl$1() + "/" + docPath }));
1446
+ }));
1447
+ _this.modelsLoading = false;
1448
+ _this.modelsLoaded = true;
1449
+ return links;
1450
+ }));
1451
+ };
1452
+ Object.defineProperty(HeAggregationEngineService.prototype, "models$", {
1453
+ get: function () {
1454
+ return this.modelsLoading || this.modelsLoaded ? this._models.asObservable() : this.loadModels();
1455
+ },
1456
+ enumerable: false,
1457
+ configurable: true
1458
+ });
1459
+ HeAggregationEngineService.prototype.models = function () {
1460
+ return this.models$.pipe(operators.take(1)).toPromise();
1461
+ };
1462
+ HeAggregationEngineService.prototype.model$ = function (model) {
1463
+ return this.models$.pipe(operators.map(function (models) { return models.find(function (m) { return Object.keys(model).every(function (key) { return model[key] === m[key]; }); }); }));
1464
+ };
1465
+ HeAggregationEngineService.prototype.model = function (model) {
1466
+ return this.model$(model).pipe(operators.take(1)).toPromise();
1467
+ };
1468
+ HeAggregationEngineService.prototype.loadLookup = function (filename) {
1469
+ return __awaiter(this, void 0, void 0, function () {
1470
+ var data;
1471
+ return __generator(this, function (_b) {
1472
+ switch (_b.label) {
1473
+ case 0: return [4 /*yield*/, this.nodeService.downloadLookup(filename)];
1474
+ case 1:
1475
+ data = _b.sent();
1476
+ return [2 /*return*/, csvtojson__namespace({ delimiter: 'auto' }).fromString(data)];
1477
+ }
1478
+ });
1479
+ });
1480
+ };
1481
+ HeAggregationEngineService.prototype.loadLookups = function () {
1482
+ var _this = this;
1483
+ return rxjs.forkJoin({
1484
+ cropYield: rxjs.from(this.loadLookup(lookups.cropYield)),
1485
+ crop: rxjs.from(this.loadLookup(schema.TermTermType.crop))
1486
+ }).pipe(operators.map(function (values) {
1487
+ _this._lookups.next(values);
1488
+ _this.lookupsLoading = false;
1489
+ _this.lookupsLoaded = true;
1490
+ return values;
1491
+ }));
1492
+ };
1493
+ Object.defineProperty(HeAggregationEngineService.prototype, "lookups$", {
1494
+ get: function () {
1495
+ return this.lookupsLoading || this.lookupsLoaded ? this._lookups.asObservable() : this.loadLookups();
1496
+ },
1497
+ enumerable: false,
1498
+ configurable: true
1499
+ });
1500
+ HeAggregationEngineService.prototype.lookups = function () {
1501
+ return this.lookups$.pipe(operators.take(1)).toPromise();
1502
+ };
1503
+ return HeAggregationEngineService;
1504
+ }());
1505
+ HeAggregationEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, deps: [{ token: i1__namespace$2.HttpClient }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1506
+ HeAggregationEngineService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, providedIn: 'root' });
1507
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, decorators: [{
1508
+ type: i0.Injectable,
1509
+ args: [{
1510
+ providedIn: 'root'
1511
+ }]
1512
+ }], ctorParameters: function () { return [{ type: i1__namespace$2.HttpClient }, { type: HeNodeService }]; } });
1513
+
1514
+ var HE_ORCHESTRATOR_BASE_URL = new i0.InjectionToken('HE_ORCHESTRATOR_BASE_URL');
1515
+ var gitUrl = function () { return gitHome + "/hestia-engine-models/-/blob/" + gitBranch(); };
1516
+ var rawUrl = function () { return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + gitBranch(); };
1258
1517
  var findConfigModels = function (_b, modelId, modelKey) {
1259
1518
  var models = _b.models;
1260
1519
  return models.flat().filter(function (_b) {
@@ -1272,7 +1531,8 @@
1272
1531
  ].filter(Boolean).join('-')
1273
1532
  ].join('/'); };
1274
1533
  var HeEngineService = /** @class */ (function () {
1275
- function HeEngineService(http) {
1534
+ function HeEngineService(_orchestratorBaseUrl, http) {
1535
+ this._orchestratorBaseUrl = _orchestratorBaseUrl;
1276
1536
  this.http = http;
1277
1537
  this.modelsLoading = false;
1278
1538
  this.modelsLoaded = false;
@@ -1322,20 +1582,25 @@
1322
1582
  return this.model$(model).pipe(operators.take(1)).toPromise();
1323
1583
  };
1324
1584
  HeEngineService.prototype.ochestratorConfig = function (type) {
1325
- return this.http.get(HE_ORCHESTRATOR_BASE_URL + "/" + type + ".json", {
1585
+ return this.http.get(this._orchestratorBaseUrl + "/" + type + ".json", {
1326
1586
  params: { inline: false }
1327
1587
  }).toPromise();
1328
1588
  };
1329
1589
  return HeEngineService;
1330
1590
  }());
1331
- HeEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1591
+ HeEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, deps: [{ token: HE_ORCHESTRATOR_BASE_URL }, { token: i1__namespace$2.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1332
1592
  HeEngineService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, providedIn: 'root' });
1333
1593
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, decorators: [{
1334
1594
  type: i0.Injectable,
1335
1595
  args: [{
1336
1596
  providedIn: 'root'
1337
1597
  }]
1338
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
1598
+ }], ctorParameters: function () {
1599
+ return [{ type: undefined, decorators: [{
1600
+ type: i0.Inject,
1601
+ args: [HE_ORCHESTRATOR_BASE_URL]
1602
+ }] }, { type: i1__namespace$2.HttpClient }];
1603
+ } });
1339
1604
 
1340
1605
  var NodeKeyState;
1341
1606
  (function (NodeKeyState) {
@@ -1788,7 +2053,7 @@
1788
2053
  return MapsDrawingConfirmComponent;
1789
2054
  }());
1790
2055
  MapsDrawingConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MapsDrawingConfirmComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1791
- MapsDrawingConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: { value: "value", modes: "modes", center: "center", zoom: "zoom" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$2.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Draw on Map</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(value)\"></button>\n </header>\n <section class=\"modal-card-body p-0\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n ></google-map>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"closed.next(value)\">\n <span>Close</span>\n </button>\n <button class=\"button is-danger is-outlined\" (click)=\"clear()\">\n <fa-icon class=\"mr-2\" icon=\"times\"></fa-icon>\n <span>Clear</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: ["google-map{display:block;height:100%;max-height:calc(100vh - 146px);min-height:500px}\n"], components: [{ type: i1__namespace$2.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] });
2056
+ MapsDrawingConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: { value: "value", modes: "modes", center: "center", zoom: "zoom" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Draw on Map</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(value)\"></button>\n </header>\n <section class=\"modal-card-body p-0\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n ></google-map>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"closed.next(value)\">\n <span>Close</span>\n </button>\n <button class=\"button is-danger is-outlined\" (click)=\"clear()\">\n <fa-icon class=\"mr-2\" icon=\"times\"></fa-icon>\n <span>Clear</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: ["google-map{display:block;height:100%;max-height:calc(100vh - 146px);min-height:500px}\n"], components: [{ type: i1__namespace$3.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] });
1792
2057
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MapsDrawingConfirmComponent, decorators: [{
1793
2058
  type: i0.Component,
1794
2059
  args: [{
@@ -1798,7 +2063,7 @@
1798
2063
  }]
1799
2064
  }], propDecorators: { map: [{
1800
2065
  type: i0.ViewChild,
1801
- args: [i1$2.GoogleMap]
2066
+ args: [i1$4.GoogleMap]
1802
2067
  }], value: [{
1803
2068
  type: i0.Input
1804
2069
  }], modes: [{
@@ -1974,340 +2239,1634 @@
1974
2239
  args: ['style.height']
1975
2240
  }] } });
1976
2241
 
1977
- var SocialTagsComponent = /** @class */ (function () {
1978
- function SocialTagsComponent(meta) {
1979
- this.meta = meta;
1980
- this.config = {};
1981
- this.classes = 'is-hidden';
2242
+ var parsePropertyValue = function (value) { return utils.isNumber(value) ? +value : (utils.isBoolean(value) ? value.toString() === 'true' : value); };
2243
+ var parseResult = function (value) { return isNaN(value) ? '' : ("" + value).replace(',', '.'); };
2244
+ var UnitConverterComponent = /** @class */ (function () {
2245
+ function UnitConverterComponent() {
2246
+ this.value = 1;
2247
+ this.ConvertUnits = utils.ConvertUnits;
2248
+ this.result = '';
2249
+ this.arguments = [];
1982
2250
  }
1983
- SocialTagsComponent.prototype.ngOnInit = function () {
2251
+ UnitConverterComponent.prototype.ngOnInit = function () {
2252
+ return this.updateValue();
2253
+ };
2254
+ Object.defineProperty(UnitConverterComponent.prototype, "args", {
2255
+ get: function () {
2256
+ var _a;
2257
+ return (((_a = this.term) === null || _a === void 0 ? void 0 : _a.defaultProperties) || []).reduce(function (prev, prop) {
2258
+ var _c;
2259
+ var _a, _b;
2260
+ return (Object.assign(Object.assign({}, prev), (_c = {}, _c[(_b = (_a = prop.term) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()] = parsePropertyValue(prop.value), _c)));
2261
+ }, {});
2262
+ },
2263
+ enumerable: false,
2264
+ configurable: true
2265
+ });
2266
+ Object.defineProperty(UnitConverterComponent.prototype, "units", {
2267
+ get: function () {
2268
+ var _this = this;
2269
+ return this.fromUnits ?
2270
+ Object.values(utils.ConvertUnits).filter(function (v) { return v in utils.converters[_this.fromUnits]; }) :
2271
+ [];
2272
+ },
2273
+ enumerable: false,
2274
+ configurable: true
2275
+ });
2276
+ UnitConverterComponent.prototype.requireArgs = function (keys) {
2277
+ var args = this.args;
2278
+ this.arguments = keys.map(function (key) { return ({ key: key, value: args[key] || '' }); });
2279
+ };
2280
+ UnitConverterComponent.prototype.updateUnits = function () {
2281
+ var requiredKeys = [];
2282
+ if (this.fromUnits === utils.ConvertUnits.kg || this.toUnits === utils.ConvertUnits.kg) {
2283
+ requiredKeys = ['density'];
2284
+ }
2285
+ this.requireArgs(requiredKeys);
2286
+ return this.updateValue();
2287
+ };
2288
+ UnitConverterComponent.prototype.updateValue = function () {
2289
+ if (!this.fromUnits || !this.toUnits) {
2290
+ return;
2291
+ }
2292
+ var args = Object.assign(Object.assign({}, this.args), this.arguments.reduce(function (prev, _c) {
2293
+ var _d;
2294
+ var key = _c.key, value = _c.value;
2295
+ return (Object.assign(Object.assign({}, prev), (_d = {}, _d[key] = value, _d)));
2296
+ }, {}));
2297
+ try {
2298
+ this.result = parseResult(utils.convertValue(this.value, this.fromUnits, this.toUnits, args));
2299
+ }
2300
+ catch (_) { }
2301
+ };
2302
+ return UnitConverterComponent;
2303
+ }());
2304
+ UnitConverterComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: UnitConverterComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2305
+ UnitConverterComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UnitConverterComponent, selector: "he-unit-converter", inputs: { term: "term", value: "value", fromUnits: "fromUnits", toUnits: "toUnits" }, ngImport: i0__namespace, template: "<div class=\"columns mb-0\">\n <div class=\"column\">\n <label class=\"label has-text-white\" for=\"value\">Value</label>\n </div>\n <div class=\"column\">\n <label class=\"label has-text-white\" for=\"result\">Convert To</label>\n </div>\n</div>\n\n<div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" [(ngModel)]=\"value\" name=\"value\" id=\"value\"\n (input)=\"updateValue()\"\n >\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth\">\n <select [(ngModel)]=\"fromUnits\" name=\"fromUnits\" id=\"fromUnits\"\n (change)=\"updateUnits()\"\n >\n <option [value]=\"undefined\">Unit</option>\n <option *ngFor=\"let unit of ConvertUnits | keys\" [value]=\"unit.value\">{{unit.key}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <input type=\"string\" class=\"input\" [value]=\"result\" name=\"result\" id=\"result\" readonly>\n </div>\n <div class=\"control\">\n <div class=\"select is-fullwidth\">\n <select [(ngModel)]=\"toUnits\" name=\"toUnits\" id=\"toUnits\"\n (change)=\"updateUnits()\"\n >\n <option [value]=\"undefined\">Unit</option>\n <option *ngFor=\"let unit of units\" [value]=\"unit\">{{unit}}</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <he-clipboard clipboardClass=\"button is-white px-2\"\n [value]=\"result\" [disabled]=\"!result\" [hideText]=\"true\"\n ></he-clipboard>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"field is-horizontal\" *ngFor=\"let arg of arguments\">\n <div class=\"field-label is-normal\">\n <label class=\"label has-text-white\" [for]=\"arg.key\">\n <span class=\"is-capitalized\">{{arg.key}}</span>\n <span class=\"has-text-danger pl-1\">*</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control\">\n <input type=\"string\" class=\"input is-small\"\n [(ngModel)]=\"arg.value\" [id]=\"arg.key\"\n (input)=\"updateValue()\"\n placeholder=\"Required for conversion\"\n >\n </div>\n </div>\n </div>\n</div>\n", styles: [".select{min-width:85px}\n"], components: [{ type: ClipboardComponent, selector: "he-clipboard", inputs: ["value", "disabled", "hideText", "icon", "size", "rotate", "clipboardClass"] }], directives: [{ type: i1__namespace$4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "keys": KeysPipe } });
2306
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: UnitConverterComponent, decorators: [{
2307
+ type: i0.Component,
2308
+ args: [{
2309
+ selector: 'he-unit-converter',
2310
+ templateUrl: './unit-converter.component.html',
2311
+ styleUrls: ['./unit-converter.component.scss']
2312
+ }]
2313
+ }], propDecorators: { term: [{
2314
+ type: i0.Input
2315
+ }], value: [{
2316
+ type: i0.Input
2317
+ }], fromUnits: [{
2318
+ type: i0.Input
2319
+ }], toUnits: [{
2320
+ type: i0.Input
2321
+ }] } });
2322
+
2323
+ /* eslint-disable @angular-eslint/directive-selector */
2324
+ var ClickOutsideDirective = /** @class */ (function () {
2325
+ function ClickOutsideDirective(elementRef) {
2326
+ this.elementRef = elementRef;
2327
+ this.clickOutside = new i0.EventEmitter();
2328
+ }
2329
+ ClickOutsideDirective.prototype.onClick = function (event) {
2330
+ if (!this.elementRef.nativeElement.contains(event.target)) {
2331
+ this.clickOutside.emit();
2332
+ }
2333
+ };
2334
+ return ClickOutsideDirective;
2335
+ }());
2336
+ ClickOutsideDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClickOutsideDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2337
+ ClickOutsideDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0__namespace });
2338
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClickOutsideDirective, decorators: [{
2339
+ type: i0.Directive,
2340
+ args: [{
2341
+ selector: '[clickOutside]'
2342
+ }]
2343
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { clickOutside: [{
2344
+ type: i0.Output
2345
+ }], onClick: [{
2346
+ type: i0.HostListener,
2347
+ args: ['document:click', ['$event']]
2348
+ }] } });
2349
+
2350
+ var get$3 = require('lodash.get');
2351
+ var GetPipe = /** @class */ (function () {
2352
+ function GetPipe() {
2353
+ }
2354
+ GetPipe.prototype.transform = function (value, key, defaultValue) {
2355
+ if (defaultValue === void 0) { defaultValue = ''; }
2356
+ return get$3(value, key, defaultValue);
2357
+ };
2358
+ return GetPipe;
2359
+ }());
2360
+ GetPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2361
+ GetPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetPipe, name: "get" });
2362
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetPipe, decorators: [{
2363
+ type: i0.Pipe,
2364
+ args: [{
2365
+ name: 'get'
2366
+ }]
2367
+ }] });
2368
+
2369
+ /* eslint-disable */
2370
+ /**
2371
+ * @class EventEmitter
2372
+ *
2373
+ * @property {Array} _listeners
2374
+ */
2375
+ var EventEmitter = /** @class */ (function () {
2376
+ /**
2377
+ * Construct EventEmitter
2378
+ *
2379
+ * @param listeners
2380
+ */
2381
+ function EventEmitter(listeners) {
2382
+ if (listeners === void 0) { listeners = []; }
2383
+ this._listeners = new Map(listeners);
2384
+ }
2385
+ /**
2386
+ * Destroys EventEmitter
2387
+ */
2388
+ EventEmitter.prototype.destroy = function () {
2389
+ this._listeners = {};
2390
+ };
2391
+ /**
2392
+ * Count listeners registered for the provided eventName
2393
+ *
2394
+ * @param eventName
2395
+ */
2396
+ EventEmitter.prototype.listenerCount = function (eventName) {
2397
+ if (!this._listeners.has(eventName)) {
2398
+ return 0;
2399
+ }
2400
+ return this._listeners.get(eventName).length;
2401
+ };
2402
+ /**
2403
+ * Subscribes on event eventName specified function
2404
+ *
2405
+ * @param eventName
2406
+ * @param listener
2407
+ */
2408
+ EventEmitter.prototype.on = function (eventName, listener) {
2409
+ this._addListener(eventName, listener, false);
2410
+ };
2411
+ /**
2412
+ * Subscribes on event name specified function to fire only once
2413
+ *
2414
+ * @param eventName
2415
+ * @param listener
2416
+ */
2417
+ EventEmitter.prototype.once = function (eventName, listener) {
2418
+ this._addListener(eventName, listener, true);
2419
+ };
2420
+ /**
2421
+ * Removes event with specified eventName.
2422
+ *
2423
+ * @param eventName
2424
+ */
2425
+ EventEmitter.prototype.off = function (eventName) {
2426
+ this._removeListeners(eventName);
2427
+ };
2428
+ /**
2429
+ * Emits event with specified name and params.
2430
+ *
2431
+ * @param eventName
2432
+ * @param eventArgs
2433
+ */
2434
+ EventEmitter.prototype.emit = function (eventName) {
2435
+ var eventArgs = [];
2436
+ for (var _i = 1; _i < arguments.length; _i++) {
2437
+ eventArgs[_i - 1] = arguments[_i];
2438
+ }
2439
+ return this._applyEvents(eventName, eventArgs);
2440
+ };
2441
+ /**
2442
+ * Register a new listener
2443
+ *
2444
+ * @param eventName
2445
+ * @param listener
2446
+ * @param once
2447
+ */
2448
+ EventEmitter.prototype._addListener = function (eventName, listener, once) {
2449
+ var _this = this;
2450
+ if (once === void 0) { once = false; }
2451
+ if (Array.isArray(eventName)) {
2452
+ eventName.forEach(function (e) { return _this._addListener(e, listener, once); });
2453
+ }
2454
+ else {
2455
+ eventName = eventName.toString();
2456
+ var split = eventName.split(/,|, | /);
2457
+ if (split.length > 1) {
2458
+ split.forEach(function (e) { return _this._addListener(e, listener, once); });
2459
+ }
2460
+ else {
2461
+ if (!Array.isArray(this._listeners.get(eventName))) {
2462
+ this._listeners.set(eventName, []);
2463
+ }
2464
+ (this._listeners.get(eventName)).push({
2465
+ once: once,
2466
+ fn: listener
2467
+ });
2468
+ }
2469
+ }
2470
+ };
2471
+ /**
2472
+ *
2473
+ * @param eventName
2474
+ */
2475
+ EventEmitter.prototype._removeListeners = function (eventName) {
2476
+ var _this = this;
2477
+ if (eventName === void 0) { eventName = null; }
2478
+ if (eventName !== null) {
2479
+ if (Array.isArray(eventName)) {
2480
+ eventName.forEach(function (e) { return _this._removeListeners(e); });
2481
+ }
2482
+ else {
2483
+ eventName = eventName.toString();
2484
+ var split = eventName.split(/,|, | /);
2485
+ if (split.length > 1) {
2486
+ split.forEach(function (e) { return _this._removeListeners(e); });
2487
+ }
2488
+ else {
2489
+ this._listeners.delete(eventName);
2490
+ }
2491
+ }
2492
+ }
2493
+ else {
2494
+ this._listeners = new Map();
2495
+ }
2496
+ };
2497
+ /**
2498
+ * Applies arguments to specified event
2499
+ *
2500
+ * @param eventName
2501
+ * @param eventArguments
2502
+ * @protected
2503
+ */
2504
+ EventEmitter.prototype._applyEvents = function (eventName, eventArguments) {
2505
+ var result = eventArguments;
2506
+ if (this._listeners.has(eventName)) {
2507
+ var listeners_1 = this._listeners.get(eventName);
2508
+ var removableListeners_1 = [];
2509
+ listeners_1.forEach(function (listener, index) {
2510
+ if (result = listener.fn.apply(null, eventArguments)) {
2511
+ if (listener.once) {
2512
+ removableListeners_1.unshift(index);
2513
+ }
2514
+ }
2515
+ });
2516
+ removableListeners_1.forEach(function (index) {
2517
+ listeners_1.splice(index, 1);
2518
+ });
2519
+ return result;
2520
+ }
2521
+ return result[0];
2522
+ };
2523
+ return EventEmitter;
2524
+ }());
2525
+
2526
+ var isFunction = function (unknown) { return typeof unknown === 'function'; };
2527
+ var isString = function (unknown) { return (typeof unknown === 'string' ||
2528
+ ((!!unknown && typeof unknown === 'object') && Object.prototype.toString.call(unknown) === '[object String]')); };
2529
+ var isObject = function (unknown) { return ((typeof unknown === 'function' || (typeof unknown === 'object' && !!unknown)) && !Array.isArray(unknown)); };
2530
+ // Returns true if the value has a "then" function. Adapted from
2531
+ // https://github.com/graphql/graphql-js/blob/499a75939f70c4863d44149371d6a99d57ff7c35/src/jsutils/isPromise.js
2532
+ var isPromise = function (value) { return Boolean(value && typeof value.then === 'function'); };
2533
+ var isNode = function (unknown) {
2534
+ try {
2535
+ Node.prototype.cloneNode.call(unknown, false);
2536
+ return true;
2537
+ }
2538
+ catch (err) {
2539
+ return false;
2540
+ }
2541
+ };
2542
+ /**
2543
+ * Convert String (false,False,True,true,no,yes,0,1) to real Boolean
2544
+ *
2545
+ * @param val
2546
+ */
2547
+ var BooleanParse = function (val) {
2548
+ var falsy = /^(?:f(?:alse)?|no?|0+)$/i;
2549
+ return !falsy.test(val) && !!val;
2550
+ };
2551
+ /**
2552
+ * Check if given query selector is valid
2553
+ *
2554
+ * @param selector
2555
+ */
2556
+ var isSelectorValid = function (selector) {
2557
+ var queryCheck = function (s) { return document.createDocumentFragment().querySelector(s); };
2558
+ try {
2559
+ queryCheck(selector);
2560
+ }
2561
+ catch (_a) {
2562
+ return false;
2563
+ }
2564
+ return true;
2565
+ };
2566
+
2567
+ /**
2568
+ * querySelector under steroid
2569
+ * Can use as selector:
2570
+ * - function
2571
+ * - DOM Node
2572
+ * - String
2573
+ *
2574
+ * @param selector
2575
+ * @param node
2576
+ */
2577
+ var querySelector = function (selector, node) {
2578
+ if (isFunction(selector)) {
2579
+ return selector(node);
2580
+ }
2581
+ if (isNode(selector)) {
2582
+ return selector;
2583
+ }
2584
+ if (isString(selector)) {
2585
+ if (!node || !isNode(node) || node.nodeType !== 1) {
2586
+ node = document;
2587
+ }
2588
+ return node.querySelector(selector);
2589
+ }
2590
+ if (Array.isArray(selector) || (typeof NodeList !== 'undefined' && NodeList.prototype.isPrototypeOf(selector))) {
2591
+ return selector[0];
2592
+ }
2593
+ };
2594
+ /**
2595
+ * querySelectorAll under steroid
2596
+ * Can use as selector:
2597
+ * - function
2598
+ * - DOM Node
2599
+ * - String
2600
+ *
2601
+ * @param selector
2602
+ * @param node
2603
+ */
2604
+ var querySelectorAll = function (selector, node) {
2605
+ if (isFunction(selector)) {
2606
+ return selector(node);
2607
+ }
2608
+ if (isNode(selector)) {
2609
+ return [selector];
2610
+ }
2611
+ if (isString(selector)) {
2612
+ if (!node || !isNode(node) || node.nodeType !== 1) {
2613
+ node = document;
2614
+ }
2615
+ return node.querySelectorAll(selector);
2616
+ }
2617
+ if (typeof NodeList !== 'undefined' && NodeList.prototype.isPrototypeOf(selector)) {
2618
+ return selector;
2619
+ }
2620
+ return [];
2621
+ };
2622
+ // Convert dataset into Object
2623
+ var optionsFromDataset = function (node, defaultOptions) {
2624
+ if (defaultOptions === void 0) { defaultOptions = {}; }
2625
+ if (isNode(node)) {
2626
+ return node.dataset ? Object.keys(node.dataset)
2627
+ .filter(function (key) { return Object.keys(defaultOptions).includes(key); })
2628
+ .reduce(function (obj, key) {
2629
+ var _a;
2630
+ return (Object.assign(Object.assign({}, obj), (_a = {}, _a[key] = node.dataset[key], _a)));
2631
+ }, {}) : {};
2632
+ }
2633
+ return {};
2634
+ };
2635
+ /**
2636
+ * Copy HTML attributes from a source element to a target element
2637
+ *
2638
+ * @param target
2639
+ * @param source
2640
+ * @param except list of attributes to skip (separated by space)
2641
+ */
2642
+ var cloneAttributes = function (target, source, except) {
2643
+ if (except === void 0) { except = null; }
2644
+ if (except !== null) {
2645
+ except = except.split(' ');
2646
+ }
2647
+ __spreadArray([], __read(source.attributes)).forEach(function (attr) {
2648
+ if (!except.includes(attr.nodeName)) {
2649
+ target.setAttribute(attr.nodeName === 'id' ? 'data-id' : attr.nodeName, attr.nodeValue);
2650
+ }
2651
+ });
2652
+ };
2653
+ /**
2654
+ * Escapes string for insertion into HTML, replacing special characters with HTML
2655
+ * entities.
2656
+ *
2657
+ * @param string
2658
+ */
2659
+ var escape = function (string) { return isString(string) ?
2660
+ string.replace(/(['"<>])/g, function (char) { return ({
2661
+ '<': '&lt;',
2662
+ '>': '&gt;',
2663
+ '"': '&quot;',
2664
+ '\'': '&#39;'
2665
+ }[char]); })
2666
+ : string; };
2667
+
2668
+ /* eslint-disable */
2669
+ var uuid = (function (prefix) {
2670
+ if (prefix === void 0) { prefix = ''; }
2671
+ return (prefix + (1e7 + -1e3 + -4e3 + -8e3 + -1e11)).replace(/[018]/g, function (c) { return (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16); });
2672
+ });
2673
+
2674
+ var Component = /** @class */ (function (_super) {
2675
+ __extends(Component, _super);
2676
+ function Component(element, options, defaultOptions) {
2677
+ if (options === void 0) { options = {}; }
2678
+ if (defaultOptions === void 0) { defaultOptions = {}; }
2679
+ var _this = _super.call(this) || this;
2680
+ _this.element = querySelector(element, document);
2681
+ // An invalid selector or non-DOM node has been provided.
2682
+ if (!_this.element) {
2683
+ throw new Error("An invalid selector or non-DOM node has been provided for " + _this.constructor.name + ".");
2684
+ }
2685
+ _this.id = uuid('c-');
2686
+ _this.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), options), optionsFromDataset(_this.element, defaultOptions) // Use Element dataset values to override options
2687
+ );
2688
+ return _this;
2689
+ }
2690
+ /**
2691
+ * Initiate all DOM element corresponding to selector
2692
+ *
2693
+ * @method
2694
+ * @return Array of all Plugin instances
2695
+ */
2696
+ Component.attach = function (selector, options, node) {
2697
+ var _this = this;
2698
+ if (selector === void 0) { selector = null; }
2699
+ if (options === void 0) { options = {}; }
2700
+ if (node === void 0) { node = null; }
2701
+ var instances = new Array();
2702
+ if (selector !== null) {
2703
+ querySelectorAll(selector, node).forEach(function (element) {
2704
+ // Check if plugin has already been instantiated for element
2705
+ if (typeof element[_this.name] === 'undefined') { // If no then instantiate it and register it in element
2706
+ instances.push(new _this(element, Object.assign({ selector: selector }, options)));
2707
+ }
2708
+ else { // If Yes then return the existing instance
2709
+ instances.push(element[_this.name]);
2710
+ }
2711
+ });
2712
+ if (typeof window[this.name] === 'undefined') {
2713
+ window[this.name] = {
2714
+ observers: []
2715
+ };
2716
+ }
2717
+ if (window[this.name]['observers'] && !window[this.name]['observers'].includes(selector)) {
2718
+ this.observeDom(selector, options);
2719
+ window[this.name]['observers'].push(selector);
2720
+ }
2721
+ }
2722
+ return instances;
2723
+ };
2724
+ /**
2725
+ * Observe DOM mutations to automatically initialize plugin on new elements when added to the DOM
2726
+ *
2727
+ * @param selector
2728
+ * @param options
2729
+ */
2730
+ Component.observeDom = function (selector, options) {
2731
+ var _this = this;
2732
+ var observer = new MutationObserver(function (mutations) {
2733
+ mutations.forEach(function (mutation) {
2734
+ for (var i = 0; i < mutation.addedNodes.length; i++) {
2735
+ if (typeof window[_this.name] !== 'undefined') {
2736
+ _this.attach(selector, options, mutation.addedNodes[i]);
2737
+ }
2738
+ }
2739
+ });
2740
+ });
2741
+ if (typeof document !== 'undefined') {
2742
+ observer.observe(document, {
2743
+ childList: true,
2744
+ subtree: true
2745
+ });
2746
+ }
2747
+ };
2748
+ Component._interface = function (name, options) {
2749
+ if (name === void 0) { name = null; }
2750
+ if (options === void 0) { options = {}; }
2751
+ if (typeof name === 'string') {
2752
+ if (typeof this[name] === 'undefined') {
2753
+ throw new TypeError("No method named \"" + name + "\"");
2754
+ }
2755
+ return this[name](options);
2756
+ }
2757
+ return this;
2758
+ };
2759
+ return Component;
2760
+ }(EventEmitter));
2761
+
2762
+ var defaultOptions = {
2763
+ allowDuplicates: false,
2764
+ caseSensitive: true,
2765
+ clearSelectionOnTyping: false,
2766
+ closeDropdownOnItemSelect: true,
2767
+ delimiter: ',',
2768
+ freeInput: true,
2769
+ highlightDuplicate: true,
2770
+ highlightMatchesString: true,
2771
+ itemValue: undefined,
2772
+ itemText: undefined,
2773
+ maxTags: undefined,
2774
+ maxChars: undefined,
2775
+ minChars: 1,
2776
+ noResultsLabel: 'No results found',
2777
+ placeholder: '',
2778
+ removable: true,
2779
+ searchMinChars: 1,
2780
+ searchOn: 'text',
2781
+ selectable: true,
2782
+ source: undefined,
2783
+ tagClass: 'is-rounded',
2784
+ trim: true // Should we trim value before processing them ?
2785
+ };
2786
+
2787
+ var tagTemplate = (function (data) { return "<span class=\"tag " + escape(data.style) + "\" data-value=\"" + escape(data.value) + "\">\n " + escape(data.text) + "\n " + (data.removable ? '<div class="delete is-small" data-tag="delete"></div>' : '') + "\n </span>"; });
2788
+
2789
+ var containerTemplate = (function (data) { return "<div class=\"tags-input\">\n <input class=\"input\" type=\"text\" placeholder=\"" + escape(data.placeholder) + "\">\n <div id=\"" + escape(data.uuid) + "-list\" class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\">\n <span class=\"dropdown-item empty-title\">" + escape(data.emptyTitle) + "</span>\n </div>\n </div>\n </div>"; });
2790
+
2791
+ var dropdownItemTemplate = (function (data) { return "<a href=\"javascript:void(0);\" class=\"dropdown-item\" data-value=\"" + escape(data.value) + "\" data-text=\"" + escape(data.text) + "\">" + escape(data.text) + "</a>"; });
2792
+
2793
+ // TODO: add pattern or function to valdiate value before adding
2794
+ var BulmaTagsInput = /** @class */ (function (_super) {
2795
+ __extends(BulmaTagsInput, _super);
2796
+ function BulmaTagsInput(element, options) {
2797
+ if (options === void 0) { options = {}; }
2798
+ var _this = _super.call(this, element, options, defaultOptions) || this;
2799
+ // Convert Boolean string options to full Boolean
2800
+ _this.options.allowDuplicates = BooleanParse(_this.options.allowDuplicates);
2801
+ _this.options.caseSensitive = BooleanParse(_this.options.caseSensitive);
2802
+ _this.options.clearSelectionOnTyping = BooleanParse(_this.options.clearSelectionOnTyping);
2803
+ _this.options.closeDropdownOnItemSelect = BooleanParse(_this.options.closeDropdownOnItemSelect);
2804
+ _this.options.freeInput = BooleanParse(_this.options.freeInput);
2805
+ _this.options.highlightDuplicate = BooleanParse(_this.options.highlightDuplicate);
2806
+ _this.options.highlightMatchesString = BooleanParse(_this.options.highlightMatchesString);
2807
+ _this.options.removable = BooleanParse(_this.options.removable);
2808
+ _this.options.searchOn = _this.options.searchOn.toLowerCase();
2809
+ _this.options.selectable = BooleanParse(_this.options.selectable);
2810
+ _this.options.trim = BooleanParse(_this.options.trim);
2811
+ //Bind events to current class
2812
+ _this._onDocumentClick = _this._onDocumentClick.bind(_this);
2813
+ _this._onInputChange = _this._onInputChange.bind(_this);
2814
+ _this._onInputClick = _this._onInputClick.bind(_this);
2815
+ _this._onInputFocusOut = _this._onInputFocusOut.bind(_this);
2816
+ _this._onInputFocusIn = _this._onInputFocusIn.bind(_this);
2817
+ _this._onInputKeyDown = _this._onInputKeyDown.bind(_this);
2818
+ _this._onInputKeyPress = _this._onInputKeyPress.bind(_this);
2819
+ _this._onOriginalInputChange = _this._onOriginalInputChange.bind(_this);
2820
+ _this._onTagDeleteClick = _this._onTagDeleteClick.bind(_this);
2821
+ _this._onTagClick = _this._onTagClick.bind(_this);
2822
+ _this._onDropdownItemClick = _this._onDropdownItemClick.bind(_this);
2823
+ // Define internal variables
2824
+ _this._items = [];
2825
+ _this._selected = -1; // index of selected item
2826
+ // Initiate plugin
2827
+ _this._init();
2828
+ return _this;
2829
+ }
2830
+ /**
2831
+ * Initiate all DOM element corresponding to selector
2832
+ *
2833
+ * @method
2834
+ * @return Array of all Plugin instances
2835
+ */
2836
+ BulmaTagsInput.attach = function (selector, options, container) {
2837
+ if (selector === void 0) { selector = 'input[data-type="tags"], input[type="tags"], select[data-type="tags"], select[type="tags"]'; }
2838
+ if (options === void 0) { options = {}; }
2839
+ if (container === void 0) { container = null; }
2840
+ return _super.attach.call(this, selector, options, container);
2841
+ };
2842
+ /**
2843
+ * Initiate plugin
2844
+ *
2845
+ * @method init
2846
+ * @return
2847
+ */
2848
+ BulmaTagsInput.prototype._init = function () {
2849
+ var _this = this;
2850
+ // Detect if original input was a Select element
2851
+ this._isSelect = (this.element.tagName === 'SELECT');
2852
+ this._isMultiple = (this._isSelect && this.element.hasAttribute('multiple'));
2853
+ // Detect if we work with Object items or not
2854
+ // Object Items is forced when working with select element
2855
+ this._objectItems = (typeof this.options.itemValue !== 'undefined') || this._isSelect;
2856
+ this.options.itemValue = this.options.itemValue ? this.options.itemValue : (this._isSelect ? 'value' : undefined);
2857
+ this.options.itemText = this.options.itemText ? this.options.itemText : (this._isSelect ? 'text' : undefined);
2858
+ // If no itemText pass then use itemValue as itemText
2859
+ if (typeof this.options.itemText === 'undefined') {
2860
+ this.options.itemText = this.options.itemValue;
2861
+ }
2862
+ // Force freeInput to False if working with object items
2863
+ this.options.freeInput = this._objectItems ? false : this.options.freeInput;
2864
+ // Init search engine
2865
+ this.source = null;
2866
+ if (typeof this.options.source !== 'undefined') {
2867
+ // Fix searchOn option if wrong
2868
+ if (!['value', 'text'].includes(this.options.searchOn)) {
2869
+ this.options.searchOn = defaultOptions.searchOn;
2870
+ }
2871
+ if (isPromise(this.options.source)) {
2872
+ this.source = this.options.source;
2873
+ }
2874
+ else if (isFunction(this.options.source)) {
2875
+ this.source = function (value) { return Promise.resolve(_this.options.source(value)); };
2876
+ }
2877
+ else if (Array.isArray(this.options.source)) {
2878
+ this.source = function (value) { return Promise.resolve(_this.options.source.filter(function (i) {
2879
+ var val = (_this._objectItems ? i[_this.options.itemValue] : i);
2880
+ return _this.options.caseSensitive ? val.includes(value) : val.toLowerCase().includes(value.toLowerCase());
2881
+ })); };
2882
+ }
2883
+ }
2884
+ // Determine allowed input modes
2885
+ this._manualInputAllowed = !this._isSelect && this.options.freeInput;
2886
+ this._filterInputAllowed = this._isSelect || this.source;
2887
+ this._build();
2888
+ };
2889
+ /**
2890
+ * Build TagsInput DOM elements
2891
+ */
2892
+ BulmaTagsInput.prototype._build = function () {
2893
+ var _this = this;
2894
+ // Create TagsInput DOM
2895
+ var containerFragment = document.createRange().createContextualFragment(containerTemplate({
2896
+ emptyTitle: typeof this.options.noResultsLabel !== 'undefined' ? this.options.noResultsLabel : 'No results found',
2897
+ placeholder: this.element.placeholder ? this.element.placeholder : this.options.placeholder,
2898
+ uuid: this.id
2899
+ }));
2900
+ this.container = containerFragment.firstElementChild;
2901
+ this._input = this.container.querySelector('input');
2902
+ this.dropdown = this.container.querySelector("#" + this.id + "-list .dropdown-content");
2903
+ this.dropdownEmptyOption = this.dropdown.querySelector('.empty-title');
2904
+ // Clone attributes between original and new input
2905
+ cloneAttributes(this._input, this.element, 'data-type multiple name type value');
2906
+ if (this.element.disabled) {
2907
+ this.container.setAttribute('disabled', 'disabled');
2908
+ this.options.removable = false;
2909
+ this.options.selectable = false;
2910
+ }
2911
+ // Propagate original input disabled attribute to the container
2912
+ if (this._input.getAttribute('disabled') || this._input.classList.contains('is-disabled')) {
2913
+ this.container.setAttribute('disabled', 'disabled');
2914
+ }
2915
+ if (!this._manualInputAllowed) {
2916
+ this.container.classList.add(this._filterInputAllowed ? 'is-filter' : 'no-input');
2917
+ }
2918
+ // Remove dropdown if no source or original input is not a select element
2919
+ if (!this._isSelect && typeof this.options.source === 'undefined') {
2920
+ this.dropdown.remove();
2921
+ this.dropdown = null;
2922
+ this._input.setAttribute('list', null);
2923
+ }
2924
+ // Initialize plugin value from original input value
2925
+ if (this._isSelect) {
2926
+ Array.from(this.element.options).forEach(function (option) {
2927
+ if (option.selected) {
2928
+ // HTML Option element contains value and text properties
2929
+ // Add it silently to not propagate to the original element
2930
+ _this.add(option.value ? option : {
2931
+ value: option.text,
2932
+ text: option.text
2933
+ }, true);
2934
+ }
2935
+ _this._createDropdownItem(option);
2936
+ });
2937
+ }
2938
+ else {
2939
+ // We have on input element
2940
+ if (this.element.value.length) {
2941
+ this.add(this._objectItems ? JSON.parse(this.element.value) : this.element.value, true);
2942
+ }
2943
+ }
2944
+ this._bindEvents();
2945
+ // Insert container right before original input and make original input hidden
2946
+ this.element.parentNode.insertBefore(this.container, this.element);
2947
+ // Hide original input (type="hidden" only works on select)
2948
+ this.element.style.display = 'none';
2949
+ };
2950
+ /**
2951
+ * Bind all events listener
2952
+ */
2953
+ BulmaTagsInput.prototype._bindEvents = function () {
2954
+ // Bind document click event to close dropdown
2955
+ document.addEventListener('click', this._onDocumentClick);
2956
+ // Bind event handlers to orginal input
2957
+ this.element.addEventListener('change', this._onOriginalInputChange);
2958
+ // Bind event handlers to internal input
2959
+ this._input.addEventListener('input', this._onInputChange);
2960
+ this._input.addEventListener('click', this._onInputClick);
2961
+ this._input.addEventListener('keydown', this._onInputKeyDown);
2962
+ this._input.addEventListener('keypress', this._onInputKeyPress);
2963
+ this._input.addEventListener('focusout', this._onInputFocusOut);
2964
+ this._input.addEventListener('focusin', this._onInputFocusIn);
2965
+ };
2966
+ /**
2967
+ * Check if caret is at the beginning of the input value
2968
+ */
2969
+ BulmaTagsInput.prototype._caretAtStart = function () {
2970
+ try {
2971
+ return this._input.selectionStart === 0 && this._input.selectionEnd === 0;
2972
+ }
2973
+ catch (e) {
2974
+ return this._input.value === '';
2975
+ }
2976
+ };
2977
+ /**
2978
+ * Check value length constraint if option activated
2979
+ *
2980
+ * @param item
2981
+ */
2982
+ BulmaTagsInput.prototype._checkLength = function (item) {
2983
+ var value = this._objectItems ? item[this.options.itemValue] : item;
2984
+ if (!isString(value)) {
2985
+ return true;
2986
+ }
2987
+ return value.length >= this.options.minChars && (typeof this.options.maxChars === 'undefined' || value.length <= this.options.maxChars);
2988
+ };
2989
+ /**
2990
+ * Close dropdown
2991
+ */
2992
+ BulmaTagsInput.prototype._closeDropdown = function () {
2993
+ if (this.dropdown) {
2994
+ this.emit('before.dropdown.close', this);
2995
+ this.container.classList.remove('is-active');
2996
+ this.emit('after.dropdown.close', this);
2997
+ }
2998
+ };
2999
+ /**
3000
+ * Create a new dropdown item based on given item data
3001
+ *
3002
+ * @param item
3003
+ */
3004
+ BulmaTagsInput.prototype._createDropdownItem = function (item) {
3005
+ if (this.dropdown) {
3006
+ // TODO: add possibility to provide template through options
3007
+ var dropdownItemFragment = document.createRange().createContextualFragment(dropdownItemTemplate({
3008
+ text: item.text,
3009
+ value: item.value
3010
+ }));
3011
+ var dropdownItem = dropdownItemFragment.firstElementChild;
3012
+ // Save item data into dataset
3013
+ dropdownItem.dataset.value = item.value;
3014
+ dropdownItem.dataset.text = item.text;
3015
+ dropdownItem.addEventListener('click', this._onDropdownItemClick);
3016
+ this.dropdown.append(dropdownItem);
3017
+ }
3018
+ };
3019
+ /**
3020
+ * Create a new tag and add it to the DOM
3021
+ *
3022
+ * @param string value
3023
+ */
3024
+ BulmaTagsInput.prototype._createTag = function (item) {
3025
+ var tagFragment = document.createRange().createContextualFragment(tagTemplate({
3026
+ removable: this.options.removable,
3027
+ style: this.options.tagClass,
3028
+ text: item.text,
3029
+ value: item.value
3030
+ }));
3031
+ var tag = tagFragment.firstElementChild;
3032
+ // Attach tag click event to select it
3033
+ tag.addEventListener('click', this._onTagClick);
3034
+ if (this.options.removable) {
3035
+ // Find delete button and attach click event
3036
+ var deleteButton = tag.querySelector('.delete');
3037
+ if (deleteButton) {
3038
+ deleteButton.addEventListener('click', this._onTagDeleteClick);
3039
+ }
3040
+ }
3041
+ // insert new tag at the end (ie just before input)
3042
+ this.container.insertBefore(tag, this._input);
3043
+ };
3044
+ /**
3045
+ * Remove all dropdown items except the empty title
3046
+ */
3047
+ BulmaTagsInput.prototype._emptyDropdown = function () {
3048
+ if (this.dropdown) {
3049
+ Array.from(this.dropdown.children).filter(function (child) { return !child.classList.contains('empty-title'); }).forEach(function (child) {
3050
+ child.remove();
3051
+ });
3052
+ }
3053
+ };
3054
+ /**
3055
+ * Find needle into a string and wrap it with <mark> HTML tag
3056
+ *
3057
+ * @param string
3058
+ * @param needle
3059
+ */
3060
+ BulmaTagsInput.prototype._highlightMatchesInString = function (string, needle) {
3061
+ var reg = '(' + needle + ')(?![^<]*>|[^<>]*</)'; // explanation: http://stackoverflow.com/a/18622606/1147859
3062
+ var regex = new RegExp(reg, 'i');
3063
+ // If the regex doesn't match the string just return initial string
3064
+ if (!string.match(regex)) {
3065
+ return string;
3066
+ }
3067
+ // Otherwise, get to highlighting
3068
+ var matchStartPosition = string.match(regex).index;
3069
+ var matchEndPosition = matchStartPosition + string.match(regex)[0].toString().length;
3070
+ var originalTextFoundByRegex = string.substring(matchStartPosition, matchEndPosition);
3071
+ string = string.replace(regex, "<mark class=\"is-highlighted\">" + originalTextFoundByRegex + "</mark>");
3072
+ return string;
3073
+ };
3074
+ /**
3075
+ * Open dropdown
3076
+ */
3077
+ BulmaTagsInput.prototype._openDropdown = function () {
3078
+ if (this.dropdown) {
3079
+ this.container.classList.add('is-active');
3080
+ }
3081
+ };
3082
+ /**
3083
+ * Propagate internal input changes to the original input
3084
+ */
3085
+ BulmaTagsInput.prototype._propagateChange = function () {
3086
+ var _this = this;
3087
+ if (!this._isSelect) {
3088
+ // If original element is an input element
3089
+ this.element.value = this.value;
3090
+ }
3091
+ else {
3092
+ // If original element is a select element
3093
+ Array.from(this.element.options).forEach(function (option) {
3094
+ option.setAttribute('selected', undefined);
3095
+ option.selected = false;
3096
+ // If option has been added by TagsInput then we remove it
3097
+ // Otherwise it is an original option
3098
+ if (typeof option.dataset.source !== 'undefined') {
3099
+ option.remove();
3100
+ }
3101
+ });
3102
+ // Update original element options selected attributes
3103
+ this._items.forEach(function (item) {
3104
+ _this._updateSelectOptions({
3105
+ value: _this._objectItems ? item[_this.options.itemValue] : item,
3106
+ text: _this._objectItems ? item[_this.options.itemText] : item
3107
+ });
3108
+ });
3109
+ }
3110
+ // Trigger Change event manually (because original input is now hidden)
3111
+ // Trick: Passes current class constructor name to prevent loop with _onOriginalInputChange handler)
3112
+ var changeEvent = new CustomEvent('change', {
3113
+ detail: this.constructor.name
3114
+ });
3115
+ this.element.dispatchEvent(changeEvent);
3116
+ };
3117
+ /**
3118
+ * Trim value if option activated
3119
+ *
3120
+ * @param item
3121
+ */
3122
+ BulmaTagsInput.prototype._trim = function (item) {
3123
+ if (this.options.trim) {
3124
+ if (this._objectItems) {
3125
+ if (isString(item[this.options.itemValue])) {
3126
+ item[this.options.itemValue] = item[this.options.itemValue].trim();
3127
+ }
3128
+ if (isString(item[this.options.itemText])) {
3129
+ item[this.options.itemText] = item[this.options.itemText].trim();
3130
+ }
3131
+ }
3132
+ else {
3133
+ item = item.trim();
3134
+ }
3135
+ }
3136
+ return item;
3137
+ };
3138
+ /**
3139
+ * Filter Dropdown items to be compliant with already selected items and current input value
3140
+ * Filtering is made on Text by default (can be changed with option)
3141
+ */
3142
+ BulmaTagsInput.prototype._filterDropdownItems = function (value) {
3143
+ var _this = this;
3144
+ if (value === void 0) { value = null; }
3145
+ if (this.dropdown) {
3146
+ if (this.emit('before.dropdown.filter', this)) {
3147
+ Array.from(this.dropdown.children).filter(function (child) { return !child.classList.contains('empty-title'); }).forEach(function (child) {
3148
+ var childValue = child.dataset[_this.options.searchOn];
3149
+ // Remove highlights
3150
+ if (_this.options.highlightMatchesString) {
3151
+ child.textContent = child.textContent.replace(/<\/?(mark\s?(class="is\-highlighted")?)?>]*>?/gm, '');
3152
+ }
3153
+ // If value is found in dropdown
3154
+ if ((value && value.length)) {
3155
+ if (_this.options.caseSensitive) {
3156
+ child.style.display = childValue.includes(value) ? 'block' : 'none';
3157
+ }
3158
+ else {
3159
+ child.style.display = childValue.toLowerCase().includes(value.toLowerCase()) ? 'block' : 'none';
3160
+ }
3161
+ if (_this.options.highlightMatchesString) {
3162
+ child.innerHTML = _this._highlightMatchesInString(child.innerHTML, value);
3163
+ }
3164
+ }
3165
+ else {
3166
+ child.style.display = 'block';
3167
+ }
3168
+ if (!_this.options.allowDuplicates || (_this._isSelect && !_this._isMultiple)) {
3169
+ var hasValue = _this.options.searchOn === 'value' ? _this.hasValue(childValue) : _this.hasText(childValue);
3170
+ child.style.display = hasValue ? 'none' : child.style.display;
3171
+ }
3172
+ });
3173
+ var hasActiveItems = Array.from(this.dropdown.children).filter(function (child) { return !child.classList.contains('empty-title'); }).some(function (child) { return child.style.display !== 'none'; });
3174
+ if (hasActiveItems) {
3175
+ this.dropdownEmptyOption.style.display = 'none';
3176
+ }
3177
+ else {
3178
+ this.dropdownEmptyOption.style.display = 'block';
3179
+ }
3180
+ this.emit('after.dropdown.filter', this);
3181
+ return hasActiveItems;
3182
+ }
3183
+ }
3184
+ return true;
3185
+ };
3186
+ /**
3187
+ * Update original select option based on given item
3188
+ *
3189
+ * @param item
3190
+ */
3191
+ BulmaTagsInput.prototype._updateSelectOptions = function (item) {
3192
+ if (this._isSelect) {
3193
+ // Check to see if the tag exists in its raw or uri-encoded form
3194
+ var option = this.element.querySelector("option[value=\"" + encodeURIComponent(item.value) + "\"]") || this.element.querySelector("option[value=\"" + item.value + "\"]");
3195
+ // add <option /> if item represents a value not present in one of the <select />'s options
3196
+ if (!option) {
3197
+ var optionFragment = document.createRange().createContextualFragment("<option value=\"" + item.value + "\" data-source=\"" + this.id + "\" selected>" + item.text + "</option>");
3198
+ option = optionFragment.firstElementChild;
3199
+ this.element.add(option);
3200
+ }
3201
+ // mark option as selected
3202
+ option.setAttribute('selected', 'selected');
3203
+ option.selected = true;
3204
+ }
3205
+ };
3206
+ /**
3207
+ * Add given item
3208
+ * item = 'john'
3209
+ * item = 'john,jane'
3210
+ * item = ['john', 'jane']
3211
+ * item = [{
3212
+ * "value": "1",
3213
+ * "text": "John"
3214
+ * }, {
3215
+ * "value": "2",
3216
+ * "text": "Jane"
3217
+ * }]
3218
+ *
3219
+ * @param item
3220
+ * @param silently Should the change be propagated to the original element
3221
+ */
3222
+ BulmaTagsInput.prototype.add = function (items, silently) {
1984
3223
  var _this = this;
1985
- this.meta.addTag({ charset: 'UTF-8' });
1986
- var config = Object.assign({ 'og:url': window.location.href.split('?')[0] }, this.config);
1987
- Object.keys(config).map(function (name) {
1988
- var content = config[name];
1989
- _this.meta.updateTag({ name: name, content: content });
1990
- if (name === 'og:description') {
1991
- _this.meta.updateTag({ name: 'description', content: content });
3224
+ if (silently === void 0) { silently = false; }
3225
+ // Check if number of items is limited ans reached
3226
+ if (typeof this.options.maxTags !== 'undefined' && this._items.length >= this.options.maxTags) {
3227
+ return this;
3228
+ }
3229
+ // Make sure to work with an array of items
3230
+ items = Array.isArray(items) ? items : isObject(items) ? [items] : items.split(this.options.delimiter);
3231
+ // If string items are expected then check every item is a string
3232
+ if (!this._objectItems && (items.filter(function (item) { return isString(item); }).length !== items.length)) {
3233
+ throw ('Item must be a string or an array of strings');
3234
+ }
3235
+ // If object items are expected then check every item is an object
3236
+ if (this._objectItems && (items.filter(function (item) { return isObject(item); }).length !== items.length)) {
3237
+ throw ('Item must be an object or an array of objects');
3238
+ }
3239
+ items.forEach(function (item) {
3240
+ item = _this._trim(item);
3241
+ // Check if item respects min/max chars
3242
+ if (_this._checkLength(item)) {
3243
+ // If original input is a non multiple select element
3244
+ if (_this._isSelect && !_this._isMultiple && _this._items.length > 0) {
3245
+ _this.removeAtIndex(0);
3246
+ _this.element.remove(_this.element.selectedIndex);
3247
+ }
3248
+ // check if duplicates are allowed or not
3249
+ if (item = _this.emit('before.add', item)) {
3250
+ if (_this.options.allowDuplicates || !_this.has(item)) {
3251
+ var itemData = {
3252
+ value: _this._objectItems ? item[_this.options.itemValue] : item,
3253
+ text: _this._objectItems ? item[_this.options.itemText] : item
3254
+ };
3255
+ var tag = _this._createTag(itemData);
3256
+ // save item into the internal array
3257
+ _this._items.push(item);
3258
+ if (!silently) {
3259
+ // Propagate change event to the original input
3260
+ _this._propagateChange();
3261
+ _this.emit('after.add', {
3262
+ item: item,
3263
+ tag: tag
3264
+ });
3265
+ }
3266
+ }
3267
+ else {
3268
+ if (_this.options.highlightDuplicate) {
3269
+ var duplicateTag_1 = Array.from(_this.container.children).filter(function (child) { return child.classList.contains('tag'); })[_this.indexOf(item)];
3270
+ if (duplicateTag_1) {
3271
+ duplicateTag_1.classList.add('is-duplicate');
3272
+ setTimeout(function () {
3273
+ duplicateTag_1.classList.remove('is-duplicate');
3274
+ }, 1250);
3275
+ }
3276
+ }
3277
+ _this.emit('item.duplicate', item);
3278
+ }
3279
+ }
1992
3280
  }
1993
3281
  });
3282
+ return this;
1994
3283
  };
1995
- return SocialTagsComponent;
1996
- }());
1997
- SocialTagsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SocialTagsComponent, deps: [{ token: i1__namespace$3.Meta }], target: i0__namespace.ɵɵFactoryTarget.Component });
1998
- SocialTagsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SocialTagsComponent, selector: "he-social-tags", inputs: { config: "config" }, host: { properties: { "class": "this.classes" } }, ngImport: i0__namespace, template: "<span></span>\n", styles: [""] });
1999
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SocialTagsComponent, decorators: [{
2000
- type: i0.Component,
2001
- args: [{
2002
- selector: 'he-social-tags',
2003
- templateUrl: './social-tags.component.html',
2004
- styleUrls: ['./social-tags.component.scss']
2005
- }]
2006
- }], ctorParameters: function () { return [{ type: i1__namespace$3.Meta }]; }, propDecorators: { config: [{
2007
- type: i0.Input
2008
- }], classes: [{
2009
- type: i0.HostBinding,
2010
- args: ['class']
2011
- }] } });
2012
-
2013
- var toastId = 0;
2014
- var HeToastService = /** @class */ (function () {
2015
- function HeToastService() {
2016
- this.toasts = new rxjs.ReplaySubject(1);
2017
- }
2018
- HeToastService.prototype.success = function (message, duration) {
2019
- if (duration === void 0) { duration = 3000; }
2020
- this.toasts.next({
2021
- id: ++toastId,
2022
- message: message,
2023
- duration: duration,
2024
- color: 'success',
2025
- showRawMessage: true
2026
- });
3284
+ /**
3285
+ * Unselect the selected item
3286
+ */
3287
+ BulmaTagsInput.prototype.clearSelection = function () {
3288
+ if (this._selected >= 0) {
3289
+ var item = this._items[this._selected];
3290
+ var tag = Array.from(this.container.children).filter(function (child) { return child.classList.contains('tag'); })[this._selected];
3291
+ if (this.emit('before.unselect', {
3292
+ item: item,
3293
+ tag: tag
3294
+ })) {
3295
+ if (tag) {
3296
+ tag.classList.remove('is-selected');
3297
+ }
3298
+ this._selected = -1;
3299
+ this.emit('after.unselect', {
3300
+ item: item,
3301
+ tag: tag
3302
+ });
3303
+ }
3304
+ }
3305
+ return this;
2027
3306
  };
2028
- HeToastService.prototype.error = function (message, showRawMessage, duration) {
2029
- if (showRawMessage === void 0) { showRawMessage = true; }
2030
- if (duration === void 0) { duration = 3000; }
2031
- this.toasts.next({
2032
- id: ++toastId,
2033
- message: ("" + message || '').trim(),
2034
- duration: duration,
2035
- color: 'danger',
2036
- showRawMessage: showRawMessage
3307
+ /**
3308
+ * Shortcut to removeAll method
3309
+ */
3310
+ BulmaTagsInput.prototype.flush = function () {
3311
+ return this.removeAll();
3312
+ };
3313
+ /**
3314
+ * Sets focus on the input
3315
+ */
3316
+ BulmaTagsInput.prototype.focus = function () {
3317
+ this.container.classList.add('is-focused');
3318
+ this._input.focus();
3319
+ return this;
3320
+ };
3321
+ /**
3322
+ * Check if given item is present
3323
+ *
3324
+ * @param item
3325
+ */
3326
+ BulmaTagsInput.prototype.has = function (item) {
3327
+ var _this = this;
3328
+ item = this._trim(item);
3329
+ if (this._objectItems) {
3330
+ return this._items.some(function (i) { return _this.options.caseSensitive || !isString(i[_this.options.itemValue]) ? i[_this.options.itemValue] === item[_this.options.itemValue] : i[_this.options.itemValue].toLowerCase() === item[_this.options.itemValue].toLowerCase(); });
3331
+ }
3332
+ else {
3333
+ return this.hasValue(item);
3334
+ }
3335
+ };
3336
+ /**
3337
+ * Check if given text is present
3338
+ *
3339
+ * @param value
3340
+ */
3341
+ BulmaTagsInput.prototype.hasText = function (value) {
3342
+ var _this = this;
3343
+ if (this.options.trim) {
3344
+ value = value.trim();
3345
+ }
3346
+ return this._items.some(function (i) {
3347
+ var val = (_this._objectItems ? i[_this.options.itemText] : i);
3348
+ return _this.options.caseSensitive ? val === value : val.toLowerCase() === value.toLowerCase();
2037
3349
  });
2038
3350
  };
2039
- return HeToastService;
2040
- }());
2041
- HeToastService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2042
- HeToastService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, providedIn: 'root' });
2043
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, decorators: [{
2044
- type: i0.Injectable,
2045
- args: [{
2046
- providedIn: 'root'
2047
- }]
2048
- }] });
2049
-
2050
- var ToastComponent = /** @class */ (function () {
2051
- function ToastComponent(toastService) {
2052
- this.toastService = toastService;
2053
- this.subscriptions = [];
2054
- this.toasts = [];
2055
- }
2056
- ToastComponent.prototype.ngOnInit = function () {
3351
+ /**
3352
+ * Check if given value is present
3353
+ *
3354
+ * @param value
3355
+ */
3356
+ BulmaTagsInput.prototype.hasValue = function (value) {
2057
3357
  var _this = this;
2058
- this.subscriptions.push(this.toastService.toasts.subscribe(function (toast) { return _this.add(toast); }));
3358
+ if (this.options.trim) {
3359
+ value = value.trim();
3360
+ }
3361
+ return this._items.some(function (i) {
3362
+ var val = (_this._objectItems ? i[_this.options.itemValue] : i);
3363
+ return _this.options.caseSensitive ? val === value : val.toLowerCase() === value.toLowerCase();
3364
+ });
2059
3365
  };
2060
- ToastComponent.prototype.ngOnDestroy = function () {
2061
- this.subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
3366
+ /**
3367
+ * Get index of given item
3368
+ *
3369
+ * @param item
3370
+ */
3371
+ BulmaTagsInput.prototype.indexOf = function (item) {
3372
+ item = this._trim(item);
3373
+ if (this._objectItems) {
3374
+ if (!isObject(item)) {
3375
+ throw ('Item must be an object');
3376
+ }
3377
+ return this._items.map(function (e) { return e.value; }).indexOf(item.value);
3378
+ }
3379
+ else {
3380
+ return this._items.indexOf(item);
3381
+ }
2062
3382
  };
2063
- ToastComponent.prototype.add = function (toast) {
3383
+ /**
3384
+ * Returns the internal input element
3385
+ */
3386
+ BulmaTagsInput.prototype.input = function () {
3387
+ return this._input;
3388
+ };
3389
+ /**
3390
+ * Get items
3391
+ */
3392
+ BulmaTagsInput.prototype.items = function () {
3393
+ return this._items;
3394
+ };
3395
+ /**
3396
+ * Remove given item
3397
+ * item = 'john'
3398
+ * item = 'john,jane'
3399
+ *
3400
+ * @param String item
3401
+ */
3402
+ BulmaTagsInput.prototype.remove = function (items) {
2064
3403
  var _this = this;
2065
- this.toasts.push(toast);
2066
- if (toast.duration) {
2067
- toast.timeout = setTimeout(function () { return _this.dismiss(toast); }, toast.duration);
3404
+ if (this.options.removable) {
3405
+ // Make sure to work with an array of items
3406
+ items = Array.isArray(items) ? items : isObject(items) ? [items] : items.split(this.options.delimiter);
3407
+ // If string items are expected then check every item is a string
3408
+ if (!this._objectItems && (items.filter(function (item) { return isString(item); }).length !== items.length)) {
3409
+ throw ('Item must be a string or an array of strings');
3410
+ }
3411
+ // If object items are expected then check every item is an object
3412
+ if (this._objectItems && (items.filter(function (item) { return isObject(item); }).length !== items.length)) {
3413
+ throw ('Item must be an object or an array of objects');
3414
+ }
3415
+ items.forEach(function (item) {
3416
+ var index = _this.indexOf(item);
3417
+ while (index >= 0) {
3418
+ _this.removeAtIndex(index);
3419
+ index = _this.indexOf(item);
3420
+ }
3421
+ });
2068
3422
  }
3423
+ return this;
2069
3424
  };
2070
- ToastComponent.prototype.dismiss = function (toast) {
2071
- this.toasts.splice(this.toasts.findIndex(function (val) { return val.id === toast.id; }), 1);
3425
+ /**
3426
+ * Remove all tags at once
3427
+ */
3428
+ BulmaTagsInput.prototype.removeAll = function () {
3429
+ if (this.options.removable) {
3430
+ if (this.emit('before.flush', this._items)) {
3431
+ this.clearSelection();
3432
+ Array.from(this.container.children).filter(function (child) { return child.classList.contains('tag'); }).forEach(function (tag) { return tag.remove(); });
3433
+ this._items = [];
3434
+ this._filterDropdownItems();
3435
+ this._propagateChange();
3436
+ this.emit('after.flush', this._items);
3437
+ }
3438
+ }
3439
+ return this;
2072
3440
  };
2073
- return ToastComponent;
2074
- }());
2075
- ToastComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, deps: [{ token: HeToastService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2076
- ToastComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToastComponent, selector: "he-toast", ngImport: i0__namespace, template: "<div class=\"mb-3 columns is-centered is-vcentered\">\n <div class=\"notification is-{{toast.color}}\" role=\"alert\" *ngFor=\"let toast of toasts\">\n <button class=\"delete\" aria-label=\"delete\" (click)=\"dismiss(toast)\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <strong [ngSwitch]=\"toast.color\">\n <ng-container *ngSwitchCase=\"'danger'\">\n <ng-container [ngSwitch]=\"toast.message\">\n <span *ngSwitchCase=\"'Unauthorized'\">You are not allowed to perform this action.</span>\n <span *ngSwitchCase=\"'form-invalid'\">Please fix all the errors on this page.</span>\n <span *ngSwitchCase=\"'users-email-already-taken'\">Email already taken.</span>\n <span *ngSwitchCase=\"'users-auth-already-taken'\">Account already connected.</span>\n <span *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </ng-container>\n </strong>\n </div>\n</div>\n", styles: [":host{bottom:0;position:fixed;width:100%}\n"], directives: [{ type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2077
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, decorators: [{
2078
- type: i0.Component,
2079
- args: [{
2080
- selector: 'he-toast',
2081
- templateUrl: './toast.component.html',
2082
- styleUrls: ['./toast.component.scss']
2083
- }]
2084
- }], ctorParameters: function () { return [{ type: HeToastService }]; } });
2085
-
2086
- var KeysPipe = /** @class */ (function () {
2087
- function KeysPipe() {
2088
- }
2089
- KeysPipe.prototype.transform = function (value, sort) {
2090
- if (sort === void 0) { sort = false; }
2091
- var keys = Object.keys(value).map(function (key) { return ({ key: key, value: value[key] }); });
2092
- if (sort) {
2093
- keys.sort(function (a, b) { return a.key.localeCompare(b.key); });
3441
+ /**
3442
+ * Remove item at given index
3443
+ *
3444
+ * @param Integer index
3445
+ */
3446
+ BulmaTagsInput.prototype.removeAtIndex = function (index, clearSelection) {
3447
+ if (clearSelection === void 0) { clearSelection = true; }
3448
+ if (this.options.removable && !isNaN(index) && index >= 0 && index < this._items.length) {
3449
+ var tag = Array.from(this.container.children).filter(function (child) { return child.classList.contains('tag'); })[index];
3450
+ var item = this._items[index];
3451
+ if (this.emit('before.remove', item)) {
3452
+ if (clearSelection) {
3453
+ this.clearSelection();
3454
+ }
3455
+ if (tag) {
3456
+ tag.remove();
3457
+ }
3458
+ // If original input is a select element
3459
+ // then deselect related option
3460
+ if (this._isSelect) {
3461
+ this.element.options[index].selected = false;
3462
+ }
3463
+ if (this._selected == index) {
3464
+ this._selected = -1;
3465
+ }
3466
+ else if (this._selected >= 0) {
3467
+ // One item less so selected index is
3468
+ this._selected -= 1;
3469
+ }
3470
+ this._items.splice(index, 1);
3471
+ this._filterDropdownItems();
3472
+ this._propagateChange();
3473
+ this.emit('after.remove', item);
3474
+ }
2094
3475
  }
2095
- return keys;
3476
+ return this;
2096
3477
  };
2097
- return KeysPipe;
2098
- }());
2099
- KeysPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeysPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2100
- KeysPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeysPipe, name: "keys" });
2101
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeysPipe, decorators: [{
2102
- type: i0.Pipe,
2103
- args: [{
2104
- name: 'keys'
2105
- }]
2106
- }] });
2107
-
2108
- var parsePropertyValue = function (value) { return utils.isNumber(value) ? +value : (utils.isBoolean(value) ? value.toString() === 'true' : value); };
2109
- var parseResult = function (value) { return isNaN(value) ? '' : ("" + value).replace(',', '.'); };
2110
- var UnitConverterComponent = /** @class */ (function () {
2111
- function UnitConverterComponent() {
2112
- this.value = 1;
2113
- this.ConvertUnits = utils.ConvertUnits;
2114
- this.result = '';
2115
- this.arguments = [];
2116
- }
2117
- UnitConverterComponent.prototype.ngOnInit = function () {
2118
- return this.updateValue();
3478
+ /**
3479
+ * Select given item
3480
+ *
3481
+ * @param item
3482
+ */
3483
+ BulmaTagsInput.prototype.select = function (items) {
3484
+ var _this = this;
3485
+ if (this.options.selectable) {
3486
+ // Make sure to work with an array of items
3487
+ items = Array.isArray(items) ? items : isObject(items) ? [items] : items.split(this.options.delimiter);
3488
+ // If string items are expected then check every item is a string
3489
+ if (!this._objectItems && (items.filter(function (item) { return isString(item); }).length !== items.length)) {
3490
+ throw ('Item must be a string or an array of strings');
3491
+ }
3492
+ // If object items are expected then check every item is an object
3493
+ if (this._objectItems && (items.filter(function (item) { return isObject(item); }).length !== items.length)) {
3494
+ throw ('Item must be an object or an array of objects');
3495
+ }
3496
+ items.forEach(function (item) {
3497
+ _this.selectAtIndex(_this.indexOf(item));
3498
+ });
3499
+ }
3500
+ return this;
2119
3501
  };
2120
- Object.defineProperty(UnitConverterComponent.prototype, "args", {
3502
+ /**
3503
+ * Select tag at given index
3504
+ *
3505
+ * @param Integer index
3506
+ */
3507
+ BulmaTagsInput.prototype.selectAtIndex = function (index) {
3508
+ if (this.options.selectable) {
3509
+ // Clear selection
3510
+ this.clearSelection();
3511
+ if (!isNaN(index) && index >= 0 && index < this._items.length) {
3512
+ var tag = Array.from(this.container.children).filter(function (child) { return child.classList.contains('tag'); })[index];
3513
+ var item = this._items[index];
3514
+ if (this.emit('before.select', {
3515
+ item: item,
3516
+ tag: tag
3517
+ })) {
3518
+ if (tag) {
3519
+ tag.classList.add('is-selected');
3520
+ }
3521
+ this._selected = index;
3522
+ this.emit('after.select', {
3523
+ item: item,
3524
+ tag: tag
3525
+ });
3526
+ }
3527
+ }
3528
+ }
3529
+ return this;
3530
+ };
3531
+ Object.defineProperty(BulmaTagsInput.prototype, "selected", {
3532
+ /**
3533
+ * Get selected item
3534
+ */
2121
3535
  get: function () {
2122
- var _a;
2123
- return (((_a = this.term) === null || _a === void 0 ? void 0 : _a.defaultProperties) || []).reduce(function (prev, prop) {
2124
- var _c;
2125
- var _a, _b;
2126
- return (Object.assign(Object.assign({}, prev), (_c = {}, _c[(_b = (_a = prop.term) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()] = parsePropertyValue(prop.value), _c)));
2127
- }, {});
3536
+ if (this._selected >= 0) {
3537
+ return this._items[this._selected];
3538
+ }
3539
+ else {
3540
+ return null;
3541
+ }
2128
3542
  },
2129
3543
  enumerable: false,
2130
3544
  configurable: true
2131
3545
  });
2132
- Object.defineProperty(UnitConverterComponent.prototype, "units", {
3546
+ Object.defineProperty(BulmaTagsInput.prototype, "selectedIndex", {
3547
+ /**
3548
+ * Get selected item index
3549
+ */
2133
3550
  get: function () {
2134
- var _this = this;
2135
- return this.fromUnits ?
2136
- Object.values(utils.ConvertUnits).filter(function (v) { return v in utils.converters[_this.fromUnits]; }) :
2137
- [];
3551
+ return this._selected;
2138
3552
  },
2139
3553
  enumerable: false,
2140
3554
  configurable: true
2141
3555
  });
2142
- UnitConverterComponent.prototype.requireArgs = function (keys) {
2143
- var args = this.args;
2144
- this.arguments = keys.map(function (key) { return ({ key: key, value: args[key] || '' }); });
2145
- };
2146
- UnitConverterComponent.prototype.updateUnits = function () {
2147
- var requiredKeys = [];
2148
- if (this.fromUnits === utils.ConvertUnits.kg || this.toUnits === utils.ConvertUnits.kg) {
2149
- requiredKeys = ['density'];
3556
+ Object.defineProperty(BulmaTagsInput.prototype, "value", {
3557
+ /**
3558
+ * Get value
3559
+ */
3560
+ get: function () {
3561
+ if (!this._isSelect) {
3562
+ if (this._objectItems) {
3563
+ return this._items.map(function (item) { return item.value; }).join(this.options.delimiter);
3564
+ }
3565
+ else {
3566
+ return this._items.join(this.options.delimiter);
3567
+ }
3568
+ }
3569
+ else {
3570
+ return Array.from(this.element.options).filter(function (option) { return option.selected; }).map(function (option) { return option.value; });
3571
+ }
3572
+ },
3573
+ /**
3574
+ * Set value
3575
+ */
3576
+ set: function (string) {
3577
+ this.removeAll();
3578
+ this.add(string);
3579
+ },
3580
+ enumerable: false,
3581
+ configurable: true
3582
+ });
3583
+ /**
3584
+ * Document click event handler
3585
+ *
3586
+ * @param e
3587
+ */
3588
+ BulmaTagsInput.prototype._onDocumentClick = function (e) {
3589
+ if (this.dropdown) {
3590
+ // If we click on element inside container then do nothing
3591
+ if (this.container.contains(e.target)) {
3592
+ return;
3593
+ }
3594
+ // Tag and delete button already deleted when event triggered
3595
+ // So we check if target is a tag delete button
3596
+ if (e.target.dataset.tag && e.target.dataset.tag === 'delete') {
3597
+ return;
3598
+ }
3599
+ // Click outside dropdown so close it
3600
+ this._closeDropdown();
2150
3601
  }
2151
- this.requireArgs(requiredKeys);
2152
- return this.updateValue();
2153
3602
  };
2154
- UnitConverterComponent.prototype.updateValue = function () {
2155
- if (!this.fromUnits || !this.toUnits) {
2156
- return;
3603
+ /**
3604
+ * Input focus lost event handler
3605
+ *
3606
+ * @param e
3607
+ */
3608
+ BulmaTagsInput.prototype._onDropdownItemClick = function (e) {
3609
+ e.preventDefault();
3610
+ if (this.dropdown) {
3611
+ if (this._objectItems) {
3612
+ var item = {};
3613
+ item[this.options.itemText] = e.currentTarget.dataset.text;
3614
+ item[this.options.itemValue] = e.currentTarget.dataset.value;
3615
+ this.add(item);
3616
+ }
3617
+ else {
3618
+ this.add(e.currentTarget.dataset.value);
3619
+ }
3620
+ this._filterDropdownItems();
3621
+ this._input.value = '';
3622
+ this._input.focus();
3623
+ if (this.options.closeDropdownOnItemSelect) {
3624
+ this._closeDropdown();
3625
+ }
2157
3626
  }
2158
- var args = Object.assign(Object.assign({}, this.args), this.arguments.reduce(function (prev, _c) {
2159
- var _d;
2160
- var key = _c.key, value = _c.value;
2161
- return (Object.assign(Object.assign({}, prev), (_d = {}, _d[key] = value, _d)));
2162
- }, {}));
2163
- try {
2164
- this.result = parseResult(utils.convertValue(this.value, this.fromUnits, this.toUnits, args));
3627
+ };
3628
+ /**
3629
+ * Input change event handler
3630
+ *
3631
+ * @param e
3632
+ */
3633
+ BulmaTagsInput.prototype._onInputChange = function (e) {
3634
+ this._filterDropdownItems(this._input.value);
3635
+ };
3636
+ /**
3637
+ * Input click event handler
3638
+ *
3639
+ * @param e
3640
+ */
3641
+ BulmaTagsInput.prototype._onInputClick = function (e) {
3642
+ e.preventDefault();
3643
+ if (!this.source || this._input.value.length >= this.options.searchMinChars) {
3644
+ this._openDropdown();
3645
+ this._filterDropdownItems();
2165
3646
  }
2166
- catch (_) { }
2167
3647
  };
2168
- return UnitConverterComponent;
2169
- }());
2170
- UnitConverterComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: UnitConverterComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2171
- UnitConverterComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UnitConverterComponent, selector: "he-unit-converter", inputs: { term: "term", value: "value", fromUnits: "fromUnits", toUnits: "toUnits" }, ngImport: i0__namespace, template: "<div class=\"columns mb-0\">\n <div class=\"column\">\n <label class=\"label has-text-white\" for=\"value\">Value</label>\n </div>\n <div class=\"column\">\n <label class=\"label has-text-white\" for=\"result\">Convert To</label>\n </div>\n</div>\n\n<div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" [(ngModel)]=\"value\" name=\"value\" id=\"value\"\n (input)=\"updateValue()\"\n >\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth\">\n <select [(ngModel)]=\"fromUnits\" name=\"fromUnits\" id=\"fromUnits\"\n (change)=\"updateUnits()\"\n >\n <option [value]=\"undefined\">Unit</option>\n <option *ngFor=\"let unit of ConvertUnits | keys\" [value]=\"unit.value\">{{unit.key}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <input type=\"string\" class=\"input\" [value]=\"result\" name=\"result\" id=\"result\" readonly>\n </div>\n <div class=\"control\">\n <div class=\"select is-fullwidth\">\n <select [(ngModel)]=\"toUnits\" name=\"toUnits\" id=\"toUnits\"\n (change)=\"updateUnits()\"\n >\n <option [value]=\"undefined\">Unit</option>\n <option *ngFor=\"let unit of units\" [value]=\"unit\">{{unit}}</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <he-clipboard clipboardClass=\"button is-white px-2\"\n [value]=\"result\" [disabled]=\"!result\" [hideText]=\"true\"\n ></he-clipboard>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"field is-horizontal\" *ngFor=\"let arg of arguments\">\n <div class=\"field-label is-normal\">\n <label class=\"label has-text-white\" [for]=\"arg.key\">\n <span class=\"is-capitalized\">{{arg.key}}</span>\n <span class=\"has-text-danger pl-1\">*</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control\">\n <input type=\"string\" class=\"input is-small\"\n [(ngModel)]=\"arg.value\" [id]=\"arg.key\"\n (input)=\"updateValue()\"\n placeholder=\"Required for conversion\"\n >\n </div>\n </div>\n </div>\n</div>\n", styles: [".select{min-width:85px}\n"], components: [{ type: ClipboardComponent, selector: "he-clipboard", inputs: ["value", "disabled", "hideText", "icon", "size", "rotate", "clipboardClass"] }], directives: [{ type: i1__namespace$4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "keys": KeysPipe } });
2172
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: UnitConverterComponent, decorators: [{
2173
- type: i0.Component,
2174
- args: [{
2175
- selector: 'he-unit-converter',
2176
- templateUrl: './unit-converter.component.html',
2177
- styleUrls: ['./unit-converter.component.scss']
2178
- }]
2179
- }], propDecorators: { term: [{
2180
- type: i0.Input
2181
- }], value: [{
2182
- type: i0.Input
2183
- }], fromUnits: [{
2184
- type: i0.Input
2185
- }], toUnits: [{
2186
- type: i0.Input
2187
- }] } });
2188
-
2189
- /* eslint-disable @angular-eslint/directive-selector */
2190
- var ClickOutsideDirective = /** @class */ (function () {
2191
- function ClickOutsideDirective(elementRef) {
2192
- this.elementRef = elementRef;
2193
- this.clickOutside = new i0.EventEmitter();
2194
- }
2195
- ClickOutsideDirective.prototype.onClick = function (event) {
2196
- if (!this.elementRef.nativeElement.contains(event.target)) {
2197
- this.clickOutside.emit();
3648
+ /**
3649
+ * Input focus event handler
3650
+ *
3651
+ * @param e
3652
+ */
3653
+ BulmaTagsInput.prototype._onInputFocusIn = function (e) {
3654
+ e.preventDefault();
3655
+ if (this.container.getAttribute('disabled') !== null || this.container.classList.contains('is-disabled')) {
3656
+ this._input.blur();
3657
+ return false;
2198
3658
  }
3659
+ this.container.classList.add('is-focused');
2199
3660
  };
2200
- return ClickOutsideDirective;
2201
- }());
2202
- ClickOutsideDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClickOutsideDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2203
- ClickOutsideDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0__namespace });
2204
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClickOutsideDirective, decorators: [{
2205
- type: i0.Directive,
2206
- args: [{
2207
- selector: '[clickOutside]'
2208
- }]
2209
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { clickOutside: [{
2210
- type: i0.Output
2211
- }], onClick: [{
2212
- type: i0.HostListener,
2213
- args: ['document:click', ['$event']]
2214
- }] } });
2215
-
2216
- var shouldDefault = {
2217
- string: function (value) { return !value; },
2218
- number: function (value) { return !value && value !== 0; },
2219
- boolean: function (value) { return !value; },
2220
- object: function (value) { return !value || !Object.keys(value).length; },
2221
- undefined: function () { return true; }
2222
- };
2223
- var DefaultPipe = /** @class */ (function () {
2224
- function DefaultPipe() {
2225
- }
2226
- DefaultPipe.prototype.transform = function (value, defaultValue) {
2227
- return shouldDefault[typeof value](value) ? defaultValue : value;
3661
+ /**
3662
+ * Input focus lost event handler
3663
+ *
3664
+ * @param e
3665
+ */
3666
+ BulmaTagsInput.prototype._onInputFocusOut = function (e) {
3667
+ e.preventDefault();
3668
+ this.container.classList.remove('is-focused');
2228
3669
  };
2229
- return DefaultPipe;
2230
- }());
2231
- DefaultPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DefaultPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2232
- DefaultPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DefaultPipe, name: "default" });
2233
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DefaultPipe, decorators: [{
2234
- type: i0.Pipe,
2235
- args: [{
2236
- name: 'default'
2237
- }]
2238
- }] });
2239
-
2240
- var EllipsisPipe = /** @class */ (function () {
2241
- function EllipsisPipe() {
2242
- }
2243
- EllipsisPipe.prototype.transform = function (value, maxLength) {
2244
- return ellipsis("" + value, maxLength);
3670
+ /**
3671
+ * Input Keydown event handler
3672
+ *
3673
+ * @param e
3674
+ */
3675
+ BulmaTagsInput.prototype._onInputKeyDown = function (e) {
3676
+ var key = e.charCode || e.keyCode || e.which;
3677
+ switch (key) {
3678
+ // BACKSPACE
3679
+ case 8:
3680
+ if (this.options.removable) {
3681
+ if (this._caretAtStart() && this._selected >= 0) {
3682
+ var currentItemIndex = this._selected;
3683
+ // If tag was selected then select next (or previous if next does not exists)
3684
+ if (currentItemIndex >= 0) {
3685
+ this.selectAtIndex(currentItemIndex + 1 < this._items.length ? currentItemIndex + 1 : currentItemIndex - 1);
3686
+ }
3687
+ this.removeAtIndex(currentItemIndex, false);
3688
+ }
3689
+ }
3690
+ if (this.source && (this._input.value.length) < this.options.searchMinChars) {
3691
+ this._closeDropdown();
3692
+ }
3693
+ break;
3694
+ // ESCAPE
3695
+ case 27:
3696
+ if (this._selected >= 0) {
3697
+ this.clearSelection();
3698
+ }
3699
+ this._closeDropdown();
3700
+ break;
3701
+ // DELETE
3702
+ case 46:
3703
+ if (this.options.removable) {
3704
+ if (this._caretAtStart() && this._selected >= 0) {
3705
+ var currentItemIndex = this._selected;
3706
+ // If tag was selected then select next (or previous if next does not exists)
3707
+ if (currentItemIndex >= 0) {
3708
+ this.selectAtIndex(currentItemIndex + 1 < this._items.length ? currentItemIndex + 1 : currentItemIndex - 1);
3709
+ }
3710
+ this.removeAtIndex(currentItemIndex, false);
3711
+ }
3712
+ }
3713
+ if (this.source && (this._input.value.length) < this.options.searchMinChars) {
3714
+ this._closeDropdown();
3715
+ }
3716
+ break;
3717
+ // LEFT ARROW
3718
+ case 37:
3719
+ if (!this._input.value.length) {
3720
+ if (this._selected < 0) {
3721
+ this.selectAtIndex(this._items.length - 1);
3722
+ }
3723
+ else {
3724
+ this.selectAtIndex(this._selected - 1 >= 0 ? this._selected - 1 : this._items.length - 1);
3725
+ }
3726
+ }
3727
+ break;
3728
+ // RIGHT ARROW
3729
+ case 39:
3730
+ if (!this._input.value.length) {
3731
+ if (this._selected < 0) {
3732
+ this.selectAtIndex(0);
3733
+ }
3734
+ else {
3735
+ this.selectAtIndex(this._selected + 1 >= this._items.length ? 0 : this._selected + 1);
3736
+ }
3737
+ }
3738
+ break;
3739
+ default:
3740
+ if (this.options.clearSelectionOnTyping) {
3741
+ this.clearSelection();
3742
+ }
3743
+ // ignore
3744
+ }
2245
3745
  };
2246
- return EllipsisPipe;
2247
- }());
2248
- EllipsisPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EllipsisPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2249
- EllipsisPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EllipsisPipe, name: "ellipsis" });
2250
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EllipsisPipe, decorators: [{
2251
- type: i0.Pipe,
2252
- args: [{
2253
- name: 'ellipsis'
2254
- }]
2255
- }] });
2256
-
2257
- var get$3 = require('lodash.get');
2258
- var GetPipe = /** @class */ (function () {
2259
- function GetPipe() {
2260
- }
2261
- GetPipe.prototype.transform = function (value, key, defaultValue) {
2262
- if (defaultValue === void 0) { defaultValue = ''; }
2263
- return get$3(value, key, defaultValue);
3746
+ /**
3747
+ * Input Keypress event handler
3748
+ *
3749
+ * @param e
3750
+ */
3751
+ BulmaTagsInput.prototype._onInputKeyPress = function (e) {
3752
+ var _this = this;
3753
+ var key = e.charCode || e.keyCode || e.which;
3754
+ var value = this._trim(this._input.value) + String.fromCharCode(key);
3755
+ if (!this._manualInputAllowed && !this._filterInputAllowed) {
3756
+ e.preventDefault();
3757
+ return false;
3758
+ }
3759
+ // ENTER
3760
+ if (!value.length && key !== 13) {
3761
+ return false;
3762
+ }
3763
+ if (this._filterInputAllowed) {
3764
+ this._filterDropdownItems(value);
3765
+ }
3766
+ if (this._filterInputAllowed && this.source && value.length >= this.options.searchMinChars && key !== 13) {
3767
+ this._openDropdown();
3768
+ this.dropdown.classList.add('is-loading');
3769
+ this._emptyDropdown();
3770
+ this.source(value).then(function (results) {
3771
+ results = _this.emit('on.results.received', results);
3772
+ if (results.length) {
3773
+ results.forEach(function (result) {
3774
+ var item = {
3775
+ value: null,
3776
+ text: null
3777
+ };
3778
+ if (!isObject(result)) {
3779
+ item.value = result;
3780
+ item.text = result;
3781
+ }
3782
+ else {
3783
+ item.value = result[_this.options.itemValue];
3784
+ item.text = result[_this.options.itemText];
3785
+ }
3786
+ _this._createDropdownItem(item);
3787
+ });
3788
+ }
3789
+ _this._filterDropdownItems(value);
3790
+ _this.dropdown.classList.remove('is-loading');
3791
+ });
3792
+ }
3793
+ if (this._manualInputAllowed && (value.includes(this.options.delimiter) || key == 13)) {
3794
+ // Prevent default behavior (ie: add char into input value)
3795
+ e.preventDefault();
3796
+ // Split value by delimiter in case we copy/paste multiple values
3797
+ var values = value.split(this.options.delimiter);
3798
+ values.forEach(function (value) {
3799
+ // check if empty text when delimiter is removed
3800
+ if ((value = value.replace(_this.options.delimiter, '')) != '') {
3801
+ // push to array and remove delimiter
3802
+ _this.add(value);
3803
+ }
3804
+ });
3805
+ value = '';
3806
+ // clear input
3807
+ this._input.value = '';
3808
+ this._closeDropdown();
3809
+ return false;
3810
+ }
2264
3811
  };
2265
- return GetPipe;
2266
- }());
2267
- GetPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2268
- GetPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetPipe, name: "get" });
2269
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetPipe, decorators: [{
2270
- type: i0.Pipe,
2271
- args: [{
2272
- name: 'get'
2273
- }]
2274
- }] });
2275
-
2276
- var KeyToLabelPipe = /** @class */ (function () {
2277
- function KeyToLabelPipe() {
2278
- }
2279
- KeyToLabelPipe.prototype.transform = function (value) {
2280
- // using termTypeLabel here which defaults to `keyToLabel` function
2281
- return termTypeLabel(value);
3812
+ /**
3813
+ * Original input change event handler
3814
+ * CAUTION: because original input is now hidden the change event must be triggered manually on change
3815
+ * Example how to trigger change event manually
3816
+ * var changeEvent = new Event('change');
3817
+ * input.dispatchEvent(changeEvent);
3818
+ *
3819
+ * @param e
3820
+ */
3821
+ BulmaTagsInput.prototype._onOriginalInputChange = function (e) {
3822
+ if (!e.detail || isString(e.detail) && e.detail !== this.constructor.name) {
3823
+ this.value = e.currentTarget.value;
3824
+ }
2282
3825
  };
2283
- return KeyToLabelPipe;
2284
- }());
2285
- KeyToLabelPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeyToLabelPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2286
- KeyToLabelPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeyToLabelPipe, name: "keyToLabel" });
2287
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KeyToLabelPipe, decorators: [{
2288
- type: i0.Pipe,
2289
- args: [{
2290
- name: 'keyToLabel'
2291
- }]
2292
- }] });
2293
-
2294
- var PluralizePipe = /** @class */ (function () {
2295
- function PluralizePipe() {
2296
- }
2297
- PluralizePipe.prototype.transform = function (value, times) {
2298
- if (times === void 0) { times = 0; }
2299
- return pluralize__namespace(value, times);
3826
+ /**
3827
+ * Tag click event handler
3828
+ *
3829
+ * @param e
3830
+ */
3831
+ BulmaTagsInput.prototype._onTagClick = function (e) {
3832
+ e.preventDefault();
3833
+ if (e.currentTarget.classList.contains('delete')) {
3834
+ return false;
3835
+ }
3836
+ if (this.container.getAttribute('disabled') !== null || this.container.classList.contains('is-disabled')) {
3837
+ return false;
3838
+ }
3839
+ this._input.focus();
3840
+ if (this.options.selectable) {
3841
+ var tag = e.currentTarget.closest('.tag');
3842
+ if (tag) {
3843
+ var tagIndex = Array.from(this.container.children).indexOf(tag);
3844
+ if (tagIndex === this._selected) {
3845
+ this.clearSelection();
3846
+ }
3847
+ else {
3848
+ this.selectAtIndex(tagIndex);
3849
+ }
3850
+ }
3851
+ }
2300
3852
  };
2301
- return PluralizePipe;
2302
- }());
2303
- PluralizePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PluralizePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2304
- PluralizePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PluralizePipe, name: "pluralize" });
2305
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PluralizePipe, decorators: [{
2306
- type: i0.Pipe,
2307
- args: [{
2308
- name: 'pluralize'
2309
- }]
2310
- }] });
3853
+ /**
3854
+ * Delete tag button click event handler
3855
+ *
3856
+ * @param e
3857
+ */
3858
+ BulmaTagsInput.prototype._onTagDeleteClick = function (e) {
3859
+ e.preventDefault();
3860
+ if (this.container.getAttribute('disabled') !== null || this.container.classList.contains('is-disabled')) {
3861
+ return false;
3862
+ }
3863
+ var tag = e.currentTarget.closest('.tag');
3864
+ if (tag) {
3865
+ this.removeAtIndex(Array.from(this.container.children).indexOf(tag));
3866
+ }
3867
+ };
3868
+ return BulmaTagsInput;
3869
+ }(Component));
2311
3870
 
2312
3871
  var restrictToType = {
2313
3872
  number: function (val) { return parseFloat(val) === +val ? val : false; }
@@ -2331,7 +3890,7 @@
2331
3890
  return _this.tagsInputInput.removeEventListener(event, listener);
2332
3891
  });
2333
3892
  this.inputEvents = [];
2334
- this.tagsInput = null;
3893
+ this.tagsInput = undefined;
2335
3894
  };
2336
3895
  Object.defineProperty(TagsInputDirective.prototype, "input", {
2337
3896
  get: function () {
@@ -2372,7 +3931,7 @@
2372
3931
  var _this = this;
2373
3932
  try {
2374
3933
  var _a = this.appTagsInput, enabled = _a.enabled, items = _a.items, options = __rest(_a, ["enabled", "items"]);
2375
- this.tagsInput = new BulmaTagsInput__default["default"](this.input, options);
3934
+ this.tagsInput = new BulmaTagsInput(this.input, options);
2376
3935
  // TODO: remove when fixed, @see https://github.com/CreativeBulma/bulma-tagsinput/issues/23
2377
3936
  var classes = ['is-small', 'is-large'].filter(function (v) { return _this.input.classList.contains(v); });
2378
3937
  classes.map(function (v) { return _this.tagsInputNode.classList.add(v); });
@@ -2430,18 +3989,9 @@
2430
3989
  UnitConverterComponent,
2431
3990
  BlankNodeDiffsComponent,
2432
3991
  TimesPipe,
2433
- ToastComponent,
2434
3992
  ClickOutsideDirective,
2435
- KeysPipe,
2436
- PrecisionPipe,
2437
- SocialTagsComponent,
2438
- DefaultPipe,
2439
3993
  SkeletonTextComponent,
2440
- PluralizePipe,
2441
- KeyToLabelPipe,
2442
- BindOnceDirective,
2443
- GetPipe,
2444
- EllipsisPipe
3994
+ GetPipe
2445
3995
  ];
2446
3996
  var HeCommonModule = /** @class */ (function () {
2447
3997
  function HeCommonModule() {
@@ -2462,23 +4012,14 @@
2462
4012
  UnitConverterComponent,
2463
4013
  BlankNodeDiffsComponent,
2464
4014
  TimesPipe,
2465
- ToastComponent,
2466
4015
  ClickOutsideDirective,
2467
- KeysPipe,
2468
- PrecisionPipe,
2469
- SocialTagsComponent,
2470
- DefaultPipe,
2471
4016
  SkeletonTextComponent,
2472
- PluralizePipe,
2473
- KeyToLabelPipe,
2474
- BindOnceDirective,
2475
- GetPipe,
2476
- EllipsisPipe], imports: [i3.CommonModule, i1$4.FormsModule, i4.RouterModule,
4017
+ GetPipe], imports: [i3.CommonModule, i1$2.FormsModule, i4.RouterModule,
2477
4018
  i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
2478
- i1$2.GoogleMapsModule,
2479
- HeFontawesomeModule], exports: [i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
2480
- i1$2.GoogleMapsModule,
2481
- HeFontawesomeModule, ClipboardComponent,
4019
+ i1$4.GoogleMapsModule,
4020
+ HeCommonLightModule], exports: [i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
4021
+ i1$4.GoogleMapsModule,
4022
+ HeCommonLightModule, ClipboardComponent,
2482
4023
  PopoverComponent,
2483
4024
  PopoverConfirmComponent,
2484
4025
  TagsInputDirective,
@@ -2491,40 +4032,31 @@
2491
4032
  UnitConverterComponent,
2492
4033
  BlankNodeDiffsComponent,
2493
4034
  TimesPipe,
2494
- ToastComponent,
2495
4035
  ClickOutsideDirective,
2496
- KeysPipe,
2497
- PrecisionPipe,
2498
- SocialTagsComponent,
2499
- DefaultPipe,
2500
4036
  SkeletonTextComponent,
2501
- PluralizePipe,
2502
- KeyToLabelPipe,
2503
- BindOnceDirective,
2504
- GetPipe,
2505
- EllipsisPipe] });
4037
+ GetPipe] });
2506
4038
  HeCommonModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonModule, imports: [[
2507
- i3.CommonModule, i1$4.FormsModule, i4.RouterModule,
4039
+ i3.CommonModule, i1$2.FormsModule, i4.RouterModule,
2508
4040
  i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
2509
- i1$2.GoogleMapsModule,
2510
- HeFontawesomeModule
4041
+ i1$4.GoogleMapsModule,
4042
+ HeCommonLightModule
2511
4043
  ], i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
2512
- i1$2.GoogleMapsModule,
2513
- HeFontawesomeModule] });
4044
+ i1$4.GoogleMapsModule,
4045
+ HeCommonLightModule] });
2514
4046
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonModule, decorators: [{
2515
4047
  type: i0.NgModule,
2516
4048
  args: [{
2517
4049
  declarations: components$6,
2518
4050
  exports: __spreadArray([
2519
4051
  i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
2520
- i1$2.GoogleMapsModule,
2521
- HeFontawesomeModule
4052
+ i1$4.GoogleMapsModule,
4053
+ HeCommonLightModule
2522
4054
  ], __read(components$6)),
2523
4055
  imports: [
2524
- i3.CommonModule, i1$4.FormsModule, i4.RouterModule,
4056
+ i3.CommonModule, i1$2.FormsModule, i4.RouterModule,
2525
4057
  i10.NgbTypeaheadModule, i10.NgbTooltipModule, i10.NgbPopoverModule,
2526
- i1$2.GoogleMapsModule,
2527
- HeFontawesomeModule
4058
+ i1$4.GoogleMapsModule,
4059
+ HeCommonLightModule
2528
4060
  ]
2529
4061
  }]
2530
4062
  }] });
@@ -2556,14 +4088,14 @@
2556
4088
  };
2557
4089
  return HeMendeleyService;
2558
4090
  }());
2559
- HeMendeleyService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeMendeleyService, deps: [{ token: i1__namespace$1.HttpClient }, { token: HeCommonService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4091
+ HeMendeleyService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeMendeleyService, deps: [{ token: i1__namespace$2.HttpClient }, { token: HeCommonService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2560
4092
  HeMendeleyService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeMendeleyService, providedIn: 'root' });
2561
4093
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeMendeleyService, decorators: [{
2562
4094
  type: i0.Injectable,
2563
4095
  args: [{
2564
4096
  providedIn: 'root'
2565
4097
  }]
2566
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeCommonService }]; } });
4098
+ }], ctorParameters: function () { return [{ type: i1__namespace$2.HttpClient }, { type: HeCommonService }]; } });
2567
4099
 
2568
4100
  var _a$3, _b, _c, _d$1, _e;
2569
4101
  var searchableTypes = [
@@ -2907,14 +4439,14 @@
2907
4439
  };
2908
4440
  return HeSearchService;
2909
4441
  }());
2910
- HeSearchService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSearchService, deps: [{ token: i1__namespace$1.HttpClient }, { token: HeCommonService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4442
+ HeSearchService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSearchService, deps: [{ token: i1__namespace$2.HttpClient }, { token: HeCommonService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2911
4443
  HeSearchService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSearchService, providedIn: 'root' });
2912
4444
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSearchService, decorators: [{
2913
4445
  type: i0.Injectable,
2914
4446
  args: [{
2915
4447
  providedIn: 'root'
2916
4448
  }]
2917
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeCommonService }]; } });
4449
+ }], ctorParameters: function () { return [{ type: i1__namespace$2.HttpClient }, { type: HeCommonService }]; } });
2918
4450
 
2919
4451
  var BibliographiesSearchConfirmComponent = /** @class */ (function () {
2920
4452
  function BibliographiesSearchConfirmComponent(formBuilder, mendeleyService, searchService) {
@@ -2929,7 +4461,7 @@
2929
4461
  this.loading = true;
2930
4462
  this.hasResults = false;
2931
4463
  this.formGroup = formBuilder.group({
2932
- search: ['', i1$4.Validators.required]
4464
+ search: ['', i1$2.Validators.required]
2933
4465
  });
2934
4466
  this.results = this.searchControl.valueChanges.pipe(operators.debounceTime(300), operators.distinctUntilChanged(), operators.tap(function () {
2935
4467
  _this.loading = true;
@@ -3027,10 +4559,10 @@
3027
4559
  return HeBibliographiesModule;
3028
4560
  }());
3029
4561
  HeBibliographiesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeBibliographiesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3030
- HeBibliographiesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeBibliographiesModule, declarations: [BibliographiesSearchConfirmComponent], imports: [i3.CommonModule, i1$4.ReactiveFormsModule,
4562
+ HeBibliographiesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeBibliographiesModule, declarations: [BibliographiesSearchConfirmComponent], imports: [i3.CommonModule, i1$2.ReactiveFormsModule,
3031
4563
  HeCommonModule], exports: [BibliographiesSearchConfirmComponent] });
3032
4564
  HeBibliographiesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeBibliographiesModule, imports: [[
3033
- i3.CommonModule, i1$4.ReactiveFormsModule,
4565
+ i3.CommonModule, i1$2.ReactiveFormsModule,
3034
4566
  HeCommonModule
3035
4567
  ]] });
3036
4568
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeBibliographiesModule, decorators: [{
@@ -3039,7 +4571,7 @@
3039
4571
  declarations: components$5,
3040
4572
  exports: components$5,
3041
4573
  imports: [
3042
- i3.CommonModule, i1$4.ReactiveFormsModule,
4574
+ i3.CommonModule, i1$2.ReactiveFormsModule,
3043
4575
  HeCommonModule
3044
4576
  ]
3045
4577
  }]
@@ -3293,14 +4825,14 @@
3293
4825
  ;
3294
4826
  return HeSchemaService;
3295
4827
  }());
3296
- HeSchemaService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSchemaService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4828
+ HeSchemaService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSchemaService, deps: [{ token: i1__namespace$2.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3297
4829
  HeSchemaService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSchemaService, providedIn: 'root' });
3298
4830
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSchemaService, decorators: [{
3299
4831
  type: i0.Injectable,
3300
4832
  args: [{
3301
4833
  providedIn: 'root'
3302
4834
  }]
3303
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
4835
+ }], ctorParameters: function () { return [{ type: i1__namespace$2.HttpClient }]; } });
3304
4836
 
3305
4837
  var headerGroup = function (header) {
3306
4838
  var parts = header.split('.');
@@ -3502,7 +5034,7 @@
3502
5034
  });
3503
5035
  return NodeCsvExportConfirmComponent;
3504
5036
  }());
3505
- NodeCsvExportConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvExportConfirmComponent, deps: [{ token: i1__namespace$3.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Component });
5037
+ NodeCsvExportConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvExportConfirmComponent, deps: [{ token: i1__namespace$1.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Component });
3506
5038
  NodeCsvExportConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: { nodes: "nodes", filename: "filename", headerKeys: "headerKeys", extension: "extension", isUpload: "isUpload" }, outputs: { closed: "closed" }, ngImport: i0__namespace, template: "<div class=\"modal is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Export as CSV</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(true)\"></button>\n </header>\n <section class=\"modal-card-body\">\n <div class=\"notification is-info\" role=\"alert\" *ngIf=\"isUpload\">\n <span>After Download, you can edit and</span>\n <a class=\"px-1\" routerLink=\"../\">upload the CSV file</a>\n <span>to submit your content on the Hestia platform, and your draft will remain unchanged.</span>\n\n <p>\n <span>Alternatively, you can import the CSV file right back by clicking on the \"Import from CSV\" button and selecting the exported file.</span>\n </p>\n </div>\n\n <ng-container *ngIf=\"!isUpload && includedNodes.length > 1\">\n <p class=\"mb-2\">\n <b>{{includedNodes.length}}</b>\n <span class=\"px-1\">Nodes will be included in your download.</span>\n <a (click)=\"showIncludeNodes = !showIncludeNodes\">\n <ng-container *ngIf=\"!showIncludeNodes\">Show list</ng-container>\n <ng-container *ngIf=\"showIncludeNodes\">Hide list</ng-container>\n </a>\n </p>\n\n <div class=\"table-container\" *ngIf=\"showIncludeNodes\">\n <table class=\"table is-fullwidth is-hoverable mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">@type</span>\n </th>\n <th>\n <span class=\"has-text-white\">@id</span>\n </th>\n <th>\n <span class=\"has-text-white\">Name</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let node of includedNodes\">\n <td>\n <span *bindOnce=\"node\">{{node.node['@type']}}</span>\n </td>\n <td>\n <span *bindOnce=\"node\">{{node.node['@id']}}</span>\n </td>\n <td>\n <span *bindOnce=\"node\">{{node.node.name}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n\n <he-node-csv-select-headers [class.is-hidden]=\"isUpload\"\n [csv]=\"csvData\" [keys]=\"headerKeys\" [includeDefaultCSV]=\"isUpload\"\n (headersChanged)=\"headersUpdated($event)\"\n ></he-node-csv-select-headers>\n </section>\n <footer class=\"modal-card-foot\">\n <a class=\"button is-success\" target=\"_blank\"\n [attr.disabled]=\"csvContent ? null : true\"\n [href]=\"csvContent\"\n [attr.download]=\"csvContent ? downloadFilename : null\"\n (click)=\"closed.next(true)\"\n >\n <fa-icon class=\"mr-2\" icon=\"download\"></fa-icon>\n <span>Download CSV</span>\n </a>\n <button class=\"button\" (click)=\"closed.next(true)\">\n <span>Cancel</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: [""], components: [{ type: NodeCsvSelectHeadersComponent, selector: "he-node-csv-select-headers", inputs: ["csv", "keys", "includeDefaultCSV"], outputs: ["headersChanged"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }] });
3507
5039
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvExportConfirmComponent, decorators: [{
3508
5040
  type: i0.Component,
@@ -3511,7 +5043,7 @@
3511
5043
  templateUrl: './node-csv-export-confirm.component.html',
3512
5044
  styleUrls: ['./node-csv-export-confirm.component.scss']
3513
5045
  }]
3514
- }], ctorParameters: function () { return [{ type: i1__namespace$3.DomSanitizer }]; }, propDecorators: { nodes: [{
5046
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }]; }, propDecorators: { nodes: [{
3515
5047
  type: i0.Input
3516
5048
  }], filename: [{
3517
5049
  type: i0.Input
@@ -3733,7 +5265,7 @@
3733
5265
  };
3734
5266
  return NodeLogsFileComponent;
3735
5267
  }());
3736
- NodeLogsFileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsFileComponent, deps: [{ token: i1__namespace$3.DomSanitizer }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
5268
+ NodeLogsFileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsFileComponent, deps: [{ token: i1__namespace$1.DomSanitizer }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
3737
5269
  NodeLogsFileComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsFileComponent, selector: "he-node-logs-file", inputs: { node: "node", dataState: "dataState" }, ngImport: i0__namespace, template: "<div class=\"is-relative\">\n <div class=\"copy-clipboard\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <he-clipboard clipboardClass=\"button is-link is-small\"\n [value]=\"nodeLog | async\" [hideText]=\"true\" [icon]=\"['far', 'clone']\" size=\"lg\" rotate=\"180\"\n ></he-clipboard>\n </div>\n <ng-container *ngIf=\"showFilters\">\n <div class=\"control\">\n <input class=\"input is-link is-small\"\n [(ngModel)]=\"modelFilter\" id=\"modelFilter\"\n (input)=\"applyFilters()\"\n placeholder=\"Filter by Method / Model\"\n >\n </div>\n <div class=\"control\">\n <input class=\"input is-link is-small\"\n [(ngModel)]=\"termFilter\" id=\"termFilter\"\n (input)=\"applyFilters()\"\n placeholder=\"Filter by Term\"\n >\n </div>\n <div class=\"control\">\n <div class=\"select is-link is-small\">\n <select (change)=\"applyFilters()\"\n [(ngModel)]=\"selectedLevel\" id=\"selectedLevel\"\n >\n <option *ngFor=\"let level of Level | keys\" [value]=\"level.value\">{{level.value}}</option>\n </select>\n </div>\n </div>\n </ng-container>\n <div class=\"control\">\n <button class=\"button is-small\" (click)=\"showFilters = !showFilters\"\n [ngbTooltip]=\"showFilters ? 'Hide filters' : 'Show filters'\" placement=\"bottom\" container=\"body\"\n >\n <fa-icon icon=\"filter\"></fa-icon>\n </button>\n </div>\n <div class=\"control pl-3\">\n <a class=\"button is-dark is-outlined is-small\" target=\"_blank\"\n [href]=\"csvContent\"\n [download]=\"fileToExt(node!['@id'], 'csv')\"\n >\n <fa-icon class=\"mr-2\" icon=\"download\"></fa-icon>\n <span>Download (CSV)</span>\n </a>\n </div>\n </div>\n </div>\n\n <pre class=\"pl-3 pt-3 ml-3\"><code class=\"is-block {{line.class}}\" *ngFor=\"let line of nodeLogLines\">{{line.data.timestamp}} {{('[' + line.data.level + ']:').padEnd(9, ' ')}} {{line.data.message}}</code></pre>\n</div>\n", styles: [":host{display:block}pre{background-color:inherit;color:inherit;min-height:38px;max-height:500px}\n"], components: [{ type: ClipboardComponent, selector: "he-clipboard", inputs: ["value", "disabled", "hideText", "icon", "size", "rotate", "clipboardClass"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }], pipes: { "async": i3__namespace.AsyncPipe, "keys": KeysPipe } });
3738
5270
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsFileComponent, decorators: [{
3739
5271
  type: i0.Component,
@@ -3742,7 +5274,7 @@
3742
5274
  templateUrl: './node-logs-file.component.html',
3743
5275
  styleUrls: ['./node-logs-file.component.scss']
3744
5276
  }]
3745
- }], ctorParameters: function () { return [{ type: i1__namespace$3.DomSanitizer }, { type: HeNodeService }]; }, propDecorators: { node: [{
5277
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }, { type: HeNodeService }]; }, propDecorators: { node: [{
3746
5278
  type: i0.Input
3747
5279
  }], dataState: [{
3748
5280
  type: i0.Input
@@ -4053,7 +5585,7 @@
4053
5585
  NodeLogsFileComponent,
4054
5586
  NodeLogsModelsComponent,
4055
5587
  NodeMissingLookupFactorsComponent,
4056
- NodeValueDetailsComponent], imports: [i3.CommonModule, i4.RouterModule, i1$4.FormsModule,
5588
+ NodeValueDetailsComponent], imports: [i3.CommonModule, i4.RouterModule, i1$2.FormsModule,
4057
5589
  i6.DragDropModule,
4058
5590
  HeCommonModule], exports: [NodeIconComponent,
4059
5591
  NodeLinkComponent,
@@ -4065,7 +5597,7 @@
4065
5597
  NodeMissingLookupFactorsComponent,
4066
5598
  NodeValueDetailsComponent] });
4067
5599
  HeNodeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeNodeModule, imports: [[
4068
- i3.CommonModule, i4.RouterModule, i1$4.FormsModule,
5600
+ i3.CommonModule, i4.RouterModule, i1$2.FormsModule,
4069
5601
  i6.DragDropModule,
4070
5602
  HeCommonModule
4071
5603
  ]] });
@@ -4075,7 +5607,7 @@
4075
5607
  declarations: components$4,
4076
5608
  exports: components$4,
4077
5609
  imports: [
4078
- i3.CommonModule, i4.RouterModule, i1$4.FormsModule,
5610
+ i3.CommonModule, i4.RouterModule, i1$2.FormsModule,
4079
5611
  i6.DragDropModule,
4080
5612
  HeCommonModule
4081
5613
  ]
@@ -4111,7 +5643,7 @@
4111
5643
  this.cycles = [];
4112
5644
  this.cycleAdded = new i0.EventEmitter();
4113
5645
  this.form = this.formBuilder.group({
4114
- search: ['', i1$4.Validators.required]
5646
+ search: ['', i1$2.Validators.required]
4115
5647
  });
4116
5648
  this.loading = false;
4117
5649
  this.suggesting = false;
@@ -4752,7 +6284,7 @@
4752
6284
  CyclesEmissionsLogsComponent,
4753
6285
  CyclesFunctionalUnitMeasureComponent,
4754
6286
  CyclesResultComponent,
4755
- CyclesSuggestFormComponent], imports: [i3.CommonModule, i1$4.FormsModule, i1$4.ReactiveFormsModule,
6287
+ CyclesSuggestFormComponent], imports: [i3.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
4756
6288
  HeCommonModule,
4757
6289
  HeNodeModule], exports: [CyclesActivityComponent,
4758
6290
  CyclesActivityLogsComponent,
@@ -4764,7 +6296,7 @@
4764
6296
  CyclesResultComponent,
4765
6297
  CyclesSuggestFormComponent] });
4766
6298
  HeCyclesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCyclesModule, imports: [[
4767
- i3.CommonModule, i1$4.FormsModule, i1$4.ReactiveFormsModule,
6299
+ i3.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
4768
6300
  HeCommonModule,
4769
6301
  HeNodeModule
4770
6302
  ]] });
@@ -4774,7 +6306,7 @@
4774
6306
  declarations: components$3,
4775
6307
  exports: components$3,
4776
6308
  imports: [
4777
- i3.CommonModule, i1$4.FormsModule, i1$4.ReactiveFormsModule,
6309
+ i3.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
4778
6310
  HeCommonModule,
4779
6311
  HeNodeModule
4780
6312
  ]
@@ -5171,7 +6703,7 @@
5171
6703
  (!fullKey || nestingTypeEnabled(schemaType));
5172
6704
  };
5173
6705
  var editableKey = function (key) { return !['type', '@type', 'termType'].includes(key); };
5174
- var propertyId = function () { return uuid.v4(); };
6706
+ var propertyId = function () { return uuid$1.v4(); };
5175
6707
  var propertyUrl = function (node, key) { return ['@id', 'name'].includes(key) && linkTypeEnabled(node['@type']) ?
5176
6708
  {
5177
6709
  url: baseUrl() + "/" + node['@type'].toLowerCase() + "/" + node['@id'],
@@ -5794,7 +7326,7 @@
5794
7326
  return SitesMapsComponent;
5795
7327
  }());
5796
7328
  SitesMapsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
5797
- SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$2.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1__namespace$2.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
7329
+ SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1__namespace$3.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
5798
7330
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, decorators: [{
5799
7331
  type: i0.Component,
5800
7332
  args: [{
@@ -5804,7 +7336,7 @@
5804
7336
  }]
5805
7337
  }], ctorParameters: function () { return [{ type: HeNodeService }]; }, propDecorators: { map: [{
5806
7338
  type: i0.ViewChild,
5807
- args: [i1$2.GoogleMap]
7339
+ args: [i1$4.GoogleMap]
5808
7340
  }], loadPolygons: [{
5809
7341
  type: i0.Input
5810
7342
  }], sites: [{
@@ -5989,13 +7521,13 @@
5989
7521
  HeSitesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSitesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
5990
7522
  HeSitesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSitesModule, declarations: [SitesMapsComponent,
5991
7523
  SitesMeasurementsComponent,
5992
- SitesMeasurementsLogsComponent], imports: [i3.CommonModule, i1$4.ReactiveFormsModule,
7524
+ SitesMeasurementsLogsComponent], imports: [i3.CommonModule, i1$2.ReactiveFormsModule,
5993
7525
  HeCommonModule,
5994
7526
  HeNodeModule], exports: [SitesMapsComponent,
5995
7527
  SitesMeasurementsComponent,
5996
7528
  SitesMeasurementsLogsComponent] });
5997
7529
  HeSitesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeSitesModule, imports: [[
5998
- i3.CommonModule, i1$4.ReactiveFormsModule,
7530
+ i3.CommonModule, i1$2.ReactiveFormsModule,
5999
7531
  HeCommonModule,
6000
7532
  HeNodeModule
6001
7533
  ]] });
@@ -6005,7 +7537,7 @@
6005
7537
  declarations: components$2,
6006
7538
  exports: components$2,
6007
7539
  imports: [
6008
- i3.CommonModule, i1$4.ReactiveFormsModule,
7540
+ i3.CommonModule, i1$2.ReactiveFormsModule,
6009
7541
  HeCommonModule,
6010
7542
  HeNodeModule
6011
7543
  ]
@@ -6489,13 +8021,13 @@
6489
8021
  return HeFilesModule;
6490
8022
  }());
6491
8023
  HeFilesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeFilesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
6492
- HeFilesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeFilesModule, declarations: [FilesFormComponent], imports: [i3.CommonModule, i1$4.FormsModule,
8024
+ HeFilesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeFilesModule, declarations: [FilesFormComponent], imports: [i3.CommonModule, i1$2.FormsModule,
6493
8025
  HeCommonModule,
6494
8026
  HeNodeModule,
6495
8027
  HeBibliographiesModule,
6496
8028
  HeSitesModule], exports: [FilesFormComponent] });
6497
8029
  HeFilesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeFilesModule, imports: [[
6498
- i3.CommonModule, i1$4.FormsModule,
8030
+ i3.CommonModule, i1$2.FormsModule,
6499
8031
  HeCommonModule,
6500
8032
  HeNodeModule,
6501
8033
  HeBibliographiesModule,
@@ -6507,7 +8039,7 @@
6507
8039
  declarations: components$1,
6508
8040
  exports: components$1,
6509
8041
  imports: [
6510
- i3.CommonModule, i1$4.FormsModule,
8042
+ i3.CommonModule, i1$2.FormsModule,
6511
8043
  HeCommonModule,
6512
8044
  HeNodeModule,
6513
8045
  HeBibliographiesModule,
@@ -6680,7 +8212,7 @@
6680
8212
  };
6681
8213
  return ImpactAssessmentsIndicatorBreakdownChartComponent;
6682
8214
  }());
6683
- ImpactAssessmentsIndicatorBreakdownChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorBreakdownChartComponent, deps: [{ token: i1__namespace$3.DomSanitizer }, { token: HeSearchService }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
8215
+ ImpactAssessmentsIndicatorBreakdownChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorBreakdownChartComponent, deps: [{ token: i1__namespace$1.DomSanitizer }, { token: HeSearchService }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
6684
8216
  ImpactAssessmentsIndicatorBreakdownChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: { impactAssessment: "impactAssessment", indicators: "indicators" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], ngImport: i0__namespace, template: "<div class=\"p-3\" [class.is-hidden]=\"loading || !terms?.length\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select an Indicator</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}} ({{term.units}})</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"button is-dark is-outlined is-small\" [href]=\"csvContent\" [download]=\"id + '-logs.csv'\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download All (CSV)</span>\n </a>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <p *ngIf=\"noData\" class=\"has-text-centered\">No breakdown available for {{selectedTerm?.name}}.</p>\n <div class=\"chart-container h-100\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"loading\">\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-container>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
6685
8217
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorBreakdownChartComponent, decorators: [{
6686
8218
  type: i0.Component,
@@ -6689,7 +8221,7 @@
6689
8221
  templateUrl: './impact-assessments-indicator-breakdown-chart.component.html',
6690
8222
  styleUrls: ['./impact-assessments-indicator-breakdown-chart.component.scss']
6691
8223
  }]
6692
- }], ctorParameters: function () { return [{ type: i1__namespace$3.DomSanitizer }, { type: HeSearchService }, { type: HeNodeService }]; }, propDecorators: { chartRef: [{
8224
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }, { type: HeSearchService }, { type: HeNodeService }]; }, propDecorators: { chartRef: [{
6693
8225
  type: i0.ViewChild,
6694
8226
  args: ['chart']
6695
8227
  }], impactAssessment: [{
@@ -6950,7 +8482,7 @@
6950
8482
  this.indicators = [];
6951
8483
  // Adding impacts to compare
6952
8484
  this.form = this.formBuilder.group({
6953
- search: ['', i1$4.Validators.required]
8485
+ search: ['', i1$2.Validators.required]
6954
8486
  });
6955
8487
  this.selectedImpactAssessments = [];
6956
8488
  this.loading = false;
@@ -7239,14 +8771,14 @@
7239
8771
  HeImpactAssessmentsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeImpactAssessmentsModule, declarations: [ImpactAssessmentsProductsComponent,
7240
8772
  ImpactAssessmentsIndicatorsChartComponent,
7241
8773
  ImpactAssessmentsProductsLogsComponent,
7242
- ImpactAssessmentsIndicatorBreakdownChartComponent], imports: [i3.CommonModule, i4.RouterModule, i1$4.FormsModule, i1$4.ReactiveFormsModule,
8774
+ ImpactAssessmentsIndicatorBreakdownChartComponent], imports: [i3.CommonModule, i4.RouterModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
7243
8775
  HeCommonModule,
7244
8776
  HeNodeModule], exports: [ImpactAssessmentsProductsComponent,
7245
8777
  ImpactAssessmentsIndicatorsChartComponent,
7246
8778
  ImpactAssessmentsProductsLogsComponent,
7247
8779
  ImpactAssessmentsIndicatorBreakdownChartComponent] });
7248
8780
  HeImpactAssessmentsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeImpactAssessmentsModule, imports: [[
7249
- i3.CommonModule, i4.RouterModule, i1$4.FormsModule, i1$4.ReactiveFormsModule,
8781
+ i3.CommonModule, i4.RouterModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
7250
8782
  HeCommonModule,
7251
8783
  HeNodeModule
7252
8784
  ]] });
@@ -7256,7 +8788,7 @@
7256
8788
  declarations: components,
7257
8789
  exports: components,
7258
8790
  imports: [
7259
- i3.CommonModule, i4.RouterModule, i1$4.FormsModule, i1$4.ReactiveFormsModule,
8791
+ i3.CommonModule, i4.RouterModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
7260
8792
  HeCommonModule,
7261
8793
  HeNodeModule
7262
8794
  ]
@@ -7335,6 +8867,7 @@
7335
8867
  exports.HeAggregationEngineService = HeAggregationEngineService;
7336
8868
  exports.HeAuthService = HeAuthService;
7337
8869
  exports.HeBibliographiesModule = HeBibliographiesModule;
8870
+ exports.HeCommonLightModule = HeCommonLightModule;
7338
8871
  exports.HeCommonModule = HeCommonModule;
7339
8872
  exports.HeCommonService = HeCommonService;
7340
8873
  exports.HeCyclesModule = HeCyclesModule;