nuxeo-development-framework 4.5.3 → 4.5.5

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.
@@ -20691,27 +20691,28 @@
20691
20691
  _this.fileManagerService = fileManagerService;
20692
20692
  _this.customToastrService = customToastrService;
20693
20693
  _this.nuxeoDialogService = nuxeoDialogService;
20694
- _this.createOperation = 'Collection.Create';
20695
- _this.addOperation = 'Document.AddToCollection';
20696
- _this.getCollectionPP = 'PP_DMS_User_Collections';
20694
+ _this.createOperation = "Collection.Create";
20695
+ _this.addOperation = "Document.AddToCollection";
20696
+ _this.getCollectionPP = "PP_DMS_User_Collections";
20697
20697
  _this.visibleChange = new i0.EventEmitter();
20698
20698
  _this.rtlEnabled = false;
20699
20699
  _this.isSelected = true;
20700
20700
  _this.tagsInput$ = new rxjs.Subject();
20701
20701
  _this.tagsLoading = false;
20702
20702
  _this._visible = false;
20703
- _this.onFormCollectionSubmit = function (e) {
20704
- e.preventDefault();
20703
+ _this.onFormCollectionSubmit = function () {
20705
20704
  _this.loading = true;
20706
- return _this.fileManagerService.addToCollection(_this.selectedItems, _this.collectionid, _this.addOperation).pipe(operators.tap(function (res) {
20705
+ return _this.fileManagerService
20706
+ .addToCollection(_this.selectedItems, _this.collectionid, _this.addOperation)
20707
+ .pipe(operators.tap(function (res) {
20707
20708
  _this.loading = false;
20708
20709
  _this.form.instance.resetValues();
20709
20710
  _this.selectedTags = null;
20710
20711
  _this.visible = false;
20711
- _this.customToastrService.show('success', 'TOASTER.SUCCESS', 'TOASTER.DOCUMENT_ADDED_TO_COLLECTION');
20712
+ _this.customToastrService.show("success", "TOASTER.SUCCESS", "TOASTER.DOCUMENT_ADDED_TO_COLLECTION");
20712
20713
  }, function (err) {
20713
20714
  _this.loading = false;
20714
- _this.customToastrService.show('error', 'TOASTER.ERROR', 'TOASTER.DOCUMENT_ADDED_TO_COLLECTION_ERROR');
20715
+ _this.customToastrService.show("error", "TOASTER.ERROR", "TOASTER.DOCUMENT_ADDED_TO_COLLECTION_ERROR");
20715
20716
  }));
20716
20717
  };
20717
20718
  return _this;
@@ -20740,12 +20741,12 @@
20740
20741
  var options = {
20741
20742
  component: NdfNuxeoDialog,
20742
20743
  //TODO [Asem] how to put the wrapper ID
20743
- panelClass: 'popUpParent',
20744
+ panelClass: "popUpParent",
20744
20745
  config: {
20745
- title: this.translateService.instant('FILE_MANAGER.ADD_TO_COLLECTION'),
20746
+ title: this.translateService.instant("FILE_MANAGER.ADD_TO_COLLECTION"),
20746
20747
  contentTemplate: this.contentTemplate,
20747
- actionsTemplate: this.actionsTemplate
20748
- }
20748
+ actionsTemplate: this.actionsTemplate,
20749
+ },
20749
20750
  };
20750
20751
  this.nuxeoDialogService
20751
20752
  .open(options)
@@ -20757,7 +20758,9 @@
20757
20758
  AddToCollectionComponent.prototype.emitSelection = function (event) {
20758
20759
  var _this = this;
20759
20760
  if (this.isSelected) {
20760
- this.fileManagerService.createNewCollection(event.displayLabel, this.createOperation).subscribe(function (res) {
20761
+ this.fileManagerService
20762
+ .createNewCollection(event.displayLabel, this.createOperation)
20763
+ .subscribe(function (res) {
20761
20764
  _this.collectionid = res.uid;
20762
20765
  });
20763
20766
  }
@@ -20766,24 +20769,29 @@
20766
20769
  };
20767
20770
  AddToCollectionComponent.prototype.loadItems = function () {
20768
20771
  var _this = this;
20769
- var searchterm = '';
20772
+ var searchterm = "";
20770
20773
  this.isSelected = false;
20771
20774
  var mycategories = [];
20772
- this.items$ = rxjs.concat(this.fileManagerService.getCollectionFromPP(searchterm, this.getCollectionPP).pipe(operators.switchMap(function (res) {
20775
+ this.items$ = rxjs.concat(this.fileManagerService
20776
+ .getCollectionFromPP(searchterm, this.getCollectionPP)
20777
+ .pipe(operators.switchMap(function (res) {
20773
20778
  res.entries.map(function (entry) {
20774
- if (!_this.enableMemberInCollections || !_this.memberInCollections.includes(entry.id)) {
20779
+ if (!_this.enableMemberInCollections ||
20780
+ !_this.memberInCollections.includes(entry.id)) {
20775
20781
  mycategories.push({
20776
20782
  displayLabel: entry.title,
20777
20783
  id: entry.uid,
20778
20784
  path: entry.path,
20779
- icon: entry.properties['common:icon']
20785
+ icon: entry.properties["common:icon"],
20780
20786
  });
20781
20787
  }
20782
20788
  });
20783
20789
  return rxjs.of(mycategories);
20784
20790
  })), // default items
20785
20791
  this.tagsInput$.pipe(operators.debounceTime(200), operators.distinctUntilChanged(), operators.tap(function () { return (_this.tagsLoading = true); }), operators.switchMap(function (searchterm) {
20786
- return _this.fileManagerService.getCollectionFromPP(searchterm, _this.getCollectionPP).pipe(operators.catchError(function () { return rxjs.of([]); }), // empty list on error
20792
+ return _this.fileManagerService
20793
+ .getCollectionFromPP(searchterm, _this.getCollectionPP)
20794
+ .pipe(operators.catchError(function () { return rxjs.of([]); }), // empty list on error
20787
20795
  operators.switchMap(function (searchCat) {
20788
20796
  var myInerCateg = [];
20789
20797
  _this.tagsLoading = false;
@@ -20793,7 +20801,7 @@
20793
20801
  displayLabel: entry.title,
20794
20802
  id: entry.uid,
20795
20803
  path: entry.path,
20796
- icon: entry.properties['common:icon']
20804
+ icon: entry.properties["common:icon"],
20797
20805
  });
20798
20806
  });
20799
20807
  return rxjs.of(myInerCateg);
@@ -20803,23 +20811,23 @@
20803
20811
  return AddToCollectionComponent;
20804
20812
  }(BaseComponent));
20805
20813
  AddToCollectionComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AddToCollectionComponent, deps: [{ token: FileManagerService }, { token: CustomToastrService }, { token: NuxeoDialogService }, { token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Component });
20806
- AddToCollectionComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AddToCollectionComponent, selector: "app-add-to-collection", inputs: { createOperation: "createOperation", addOperation: "addOperation", getCollectionPP: "getCollectionPP", memberInCollections: "memberInCollections", enableMemberInCollections: "enableMemberInCollections", visible: "visible", rtlEnabled: "rtlEnabled", selectedItems: "selectedItems" }, outputs: { visibleChange: "visibleChange" }, viewQueries: [{ propertyName: "form", first: true, predicate: i4$4.DxFormComponent, descendants: true }, { propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template #contentTemplate>\r\n\t<form>\r\n\t\t<dx-form class=\"collection-form-wrapper\" #createForm [formData]=\"formData\" [disabled]=\"loading\">\r\n\t\t\t<dxi-item editorType=\"dxTextBox\">\r\n\t\t\t\t<ng-select\r\n\t\t\t\t\t[items]=\"items$ | async\"\r\n\t\t\t\t\tbindLabel=\"displayLabel\"\r\n\t\t\t\t\t[addTag]=\"true\"\r\n\t\t\t\t\taddTagText=\"Add collection\"\r\n\t\t\t\t\t[multiple]=\"false\"\r\n\t\t\t\t\t[hideSelected]=\"true\"\r\n\t\t\t\t\t[minTermLength]=\"0\"\r\n\t\t\t\t\t[loading]=\"tagsLoading\"\r\n\t\t\t\t\ttypeToSearchText=\"search\"\r\n\t\t\t\t\t[typeahead]=\"tagsInput$\"\r\n\t\t\t\t\t[(ngModel)]=\"selectedTags\"\r\n\t\t\t\t\trequired\r\n\t\t\t\t\tplaceholder=\"{{ 'VOCABULARY.SELECT_ITEM' | translate }}\"\r\n\t\t\t\t\tname=\"selectedItem\"\r\n\t\t\t\t\t(change)=\"emitSelection($event)\"\r\n\t\t\t\t>\r\n\t\t\t\t</ng-select>\r\n\t\t\t</dxi-item>\r\n\t\t</dx-form>\r\n\t</form>\r\n</ng-template>\r\n\r\n<ng-template #actionsTemplate let-dialog=\"dialog\">\r\n\t<span class=\"submission-button px-5\" (click)=\"dialog.executeAction(onFormCollectionSubmit, [$event])\">\r\n\t\t{{ 'FILE_MANAGER.ADD' | translate }}\r\n\t</span>\r\n</ng-template>\r\n", styles: [""], components: [{ type: i4__namespace$4.DxFormComponent, selector: "dx-form", inputs: ["accessKey", "activeStateEnabled", "alignItemLabels", "alignItemLabelsInAllGroups", "colCount", "colCountByScreen", "customizeItem", "disabled", "elementAttr", "focusStateEnabled", "formData", "height", "hint", "hoverStateEnabled", "items", "labelLocation", "labelMode", "minColWidth", "optionalMark", "readOnly", "requiredMark", "requiredMessage", "rtlEnabled", "screenByWidth", "scrollingEnabled", "showColonAfterLabel", "showOptionalMark", "showRequiredMark", "showValidationSummary", "tabIndex", "validationGroup", "visible", "width"], outputs: ["onContentReady", "onDisposing", "onEditorEnterKey", "onFieldDataChanged", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "alignItemLabelsChange", "alignItemLabelsInAllGroupsChange", "colCountChange", "colCountByScreenChange", "customizeItemChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "formDataChange", "heightChange", "hintChange", "hoverStateEnabledChange", "itemsChange", "labelLocationChange", "labelModeChange", "minColWidthChange", "optionalMarkChange", "readOnlyChange", "requiredMarkChange", "requiredMessageChange", "rtlEnabledChange", "screenByWidthChange", "scrollingEnabledChange", "showColonAfterLabelChange", "showOptionalMarkChange", "showRequiredMarkChange", "showValidationSummaryChange", "tabIndexChange", "validationGroupChange", "visibleChange", "widthChange"] }, { type: i5__namespace$2.DxiItemComponent, selector: "dxi-item", inputs: ["disabled", "html", "icon", "template", "text", "title", "titleTemplate", "visible", "onClick", "stylingMode", "type", "baseSize", "box", "ratio", "shrink", "elementAttr", "hint", "beginGroup", "closeMenuOnClick", "items", "selectable", "selected", "colSpan", "cssClass", "dataField", "editorOptions", "editorType", "helpText", "isRequired", "itemType", "label", "name", "validationRules", "visibleIndex", "alignItemLabels", "caption", "colCount", "colCountByScreen", "tabPanelOptions", "tabs", "badge", "tabTemplate", "buttonOptions", "horizontalAlignment", "verticalAlignment", "locateInMenu", "location", "menuItemTemplate", "options", "showText", "widget", "height", "width", "imageAlt", "imageSrc", "acceptedValues", "formatName", "formatValues", "key", "showChevron", "linkAttr", "url", "heightRatio", "widthRatio", "expanded", "hasItems", "id", "parentId"] }, { type: i3__namespace$3.NgSelectComponent, selector: "ng-select", inputs: ["markFirst", "dropdownPosition", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "bufferAmount", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "bindLabel", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "virtualScroll", "openOnEnter", "appendTo", "bindValue", "appearance", "maxSelectedItems", "groupBy", "groupValue", "tabIndex", "typeahead"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i2__namespace$6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2__namespace$6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2__namespace$6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2__namespace$6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2__namespace$6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2__namespace$6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
20814
+ AddToCollectionComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AddToCollectionComponent, selector: "app-add-to-collection", inputs: { createOperation: "createOperation", addOperation: "addOperation", getCollectionPP: "getCollectionPP", memberInCollections: "memberInCollections", enableMemberInCollections: "enableMemberInCollections", visible: "visible", rtlEnabled: "rtlEnabled", selectedItems: "selectedItems" }, outputs: { visibleChange: "visibleChange" }, viewQueries: [{ propertyName: "form", first: true, predicate: i4$4.DxFormComponent, descendants: true }, { propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template #contentTemplate>\r\n <form>\r\n <dx-form\r\n class=\"collection-form-wrapper\"\r\n #createForm\r\n [formData]=\"formData\"\r\n [disabled]=\"loading\"\r\n >\r\n <dxi-item editorType=\"dxTextBox\">\r\n <ng-select\r\n [items]=\"items$ | async\"\r\n bindLabel=\"displayLabel\"\r\n [addTag]=\"true\"\r\n addTagText=\"Add collection\"\r\n [multiple]=\"false\"\r\n [hideSelected]=\"true\"\r\n [minTermLength]=\"0\"\r\n [loading]=\"tagsLoading\"\r\n typeToSearchText=\"search\"\r\n [typeahead]=\"tagsInput$\"\r\n [(ngModel)]=\"selectedTags\"\r\n required\r\n placeholder=\"{{ 'VOCABULARY.SELECT_ITEM' | translate }}\"\r\n name=\"selectedItem\"\r\n (change)=\"emitSelection($event)\"\r\n >\r\n </ng-select>\r\n </dxi-item>\r\n </dx-form>\r\n </form>\r\n</ng-template>\r\n\r\n<ng-template #actionsTemplate let-dialog=\"dialog\">\r\n <span\r\n class=\"submission-button px-5\"\r\n (click)=\"dialog.executeAction(onFormCollectionSubmit)\"\r\n >\r\n {{ \"FILE_MANAGER.ADD\" | translate }}\r\n </span>\r\n</ng-template>\r\n", styles: [""], components: [{ type: i4__namespace$4.DxFormComponent, selector: "dx-form", inputs: ["accessKey", "activeStateEnabled", "alignItemLabels", "alignItemLabelsInAllGroups", "colCount", "colCountByScreen", "customizeItem", "disabled", "elementAttr", "focusStateEnabled", "formData", "height", "hint", "hoverStateEnabled", "items", "labelLocation", "labelMode", "minColWidth", "optionalMark", "readOnly", "requiredMark", "requiredMessage", "rtlEnabled", "screenByWidth", "scrollingEnabled", "showColonAfterLabel", "showOptionalMark", "showRequiredMark", "showValidationSummary", "tabIndex", "validationGroup", "visible", "width"], outputs: ["onContentReady", "onDisposing", "onEditorEnterKey", "onFieldDataChanged", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "alignItemLabelsChange", "alignItemLabelsInAllGroupsChange", "colCountChange", "colCountByScreenChange", "customizeItemChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "formDataChange", "heightChange", "hintChange", "hoverStateEnabledChange", "itemsChange", "labelLocationChange", "labelModeChange", "minColWidthChange", "optionalMarkChange", "readOnlyChange", "requiredMarkChange", "requiredMessageChange", "rtlEnabledChange", "screenByWidthChange", "scrollingEnabledChange", "showColonAfterLabelChange", "showOptionalMarkChange", "showRequiredMarkChange", "showValidationSummaryChange", "tabIndexChange", "validationGroupChange", "visibleChange", "widthChange"] }, { type: i5__namespace$2.DxiItemComponent, selector: "dxi-item", inputs: ["disabled", "html", "icon", "template", "text", "title", "titleTemplate", "visible", "onClick", "stylingMode", "type", "baseSize", "box", "ratio", "shrink", "elementAttr", "hint", "beginGroup", "closeMenuOnClick", "items", "selectable", "selected", "colSpan", "cssClass", "dataField", "editorOptions", "editorType", "helpText", "isRequired", "itemType", "label", "name", "validationRules", "visibleIndex", "alignItemLabels", "caption", "colCount", "colCountByScreen", "tabPanelOptions", "tabs", "badge", "tabTemplate", "buttonOptions", "horizontalAlignment", "verticalAlignment", "locateInMenu", "location", "menuItemTemplate", "options", "showText", "widget", "height", "width", "imageAlt", "imageSrc", "acceptedValues", "formatName", "formatValues", "key", "showChevron", "linkAttr", "url", "heightRatio", "widthRatio", "expanded", "hasItems", "id", "parentId"] }, { type: i3__namespace$3.NgSelectComponent, selector: "ng-select", inputs: ["markFirst", "dropdownPosition", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "bufferAmount", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "bindLabel", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "virtualScroll", "openOnEnter", "appendTo", "bindValue", "appearance", "maxSelectedItems", "groupBy", "groupValue", "tabIndex", "typeahead"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i2__namespace$6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2__namespace$6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2__namespace$6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2__namespace$6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2__namespace$6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2__namespace$6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
20807
20815
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AddToCollectionComponent, decorators: [{
20808
20816
  type: i0.Component,
20809
20817
  args: [{
20810
- selector: 'app-add-to-collection',
20811
- templateUrl: './add-to-collection.component.html',
20812
- styleUrls: ['./add-to-collection.component.scss']
20818
+ selector: "app-add-to-collection",
20819
+ templateUrl: "./add-to-collection.component.html",
20820
+ styleUrls: ["./add-to-collection.component.scss"],
20813
20821
  }]
20814
20822
  }], ctorParameters: function () { return [{ type: FileManagerService }, { type: CustomToastrService }, { type: NuxeoDialogService }, { type: i0__namespace.Injector }]; }, propDecorators: { form: [{
20815
20823
  type: i0.ViewChild,
20816
20824
  args: [i4$4.DxFormComponent, { static: false }]
20817
20825
  }], contentTemplate: [{
20818
20826
  type: i0.ViewChild,
20819
- args: ['contentTemplate']
20827
+ args: ["contentTemplate"]
20820
20828
  }], actionsTemplate: [{
20821
20829
  type: i0.ViewChild,
20822
- args: ['actionsTemplate']
20830
+ args: ["actionsTemplate"]
20823
20831
  }], createOperation: [{
20824
20832
  type: i0.Input
20825
20833
  }], addOperation: [{
@@ -29761,6 +29769,104 @@
29761
29769
  }]
29762
29770
  }], ctorParameters: function () { return []; } });
29763
29771
 
29772
+ var _SilentPdfTronService_instances, _SilentPdfTronService_webViewerInstance, _SilentPdfTronService_webViewerElement, _SilentPdfTronService_isInitialized, _SilentPdfTronService_initializationPromise, _SilentPdfTronService_isArabic, _SilentPdfTronService_isEnabled, _SilentPdfTronService_initializeWebViewer;
29773
+ var SilentPdfTronService = /** @class */ (function () {
29774
+ function SilentPdfTronService(baseHref, translationService, environment, nuxeo) {
29775
+ this.baseHref = baseHref;
29776
+ this.translationService = translationService;
29777
+ this.environment = environment;
29778
+ this.nuxeo = nuxeo;
29779
+ _SilentPdfTronService_instances.add(this);
29780
+ _SilentPdfTronService_webViewerInstance.set(this, void 0);
29781
+ _SilentPdfTronService_webViewerElement.set(this, null);
29782
+ _SilentPdfTronService_isInitialized.set(this, false);
29783
+ _SilentPdfTronService_initializationPromise.set(this, null);
29784
+ _SilentPdfTronService_isArabic.set(this, void 0);
29785
+ _SilentPdfTronService_isEnabled.set(this, void 0);
29786
+ }
29787
+ Object.defineProperty(SilentPdfTronService.prototype, "isEnabled", {
29788
+ get: function () {
29789
+ return __classPrivateFieldGet(this, _SilentPdfTronService_isEnabled, "f");
29790
+ },
29791
+ enumerable: false,
29792
+ configurable: true
29793
+ });
29794
+ SilentPdfTronService.prototype.start = function () {
29795
+ var _this = this;
29796
+ __classPrivateFieldSet(this, _SilentPdfTronService_isEnabled, true, "f");
29797
+ this.translationService.isArabic.subscribe(function (res) {
29798
+ __classPrivateFieldSet(_this, _SilentPdfTronService_isArabic, res, "f");
29799
+ if (!__classPrivateFieldGet(_this, _SilentPdfTronService_webViewerElement, "f")) {
29800
+ __classPrivateFieldSet(_this, _SilentPdfTronService_webViewerElement, document.createElement('div'), "f");
29801
+ __classPrivateFieldGet(_this, _SilentPdfTronService_webViewerElement, "f").id = 'silent-viewer';
29802
+ Object.assign(__classPrivateFieldGet(_this, _SilentPdfTronService_webViewerElement, "f").style, {
29803
+ display: 'none',
29804
+ width: '100%',
29805
+ height: '100%'
29806
+ });
29807
+ document.body.appendChild(__classPrivateFieldGet(_this, _SilentPdfTronService_webViewerElement, "f"));
29808
+ }
29809
+ __classPrivateFieldGet(_this, _SilentPdfTronService_instances, "m", _SilentPdfTronService_initializeWebViewer).call(_this);
29810
+ });
29811
+ };
29812
+ SilentPdfTronService.prototype.getWebViewer = function () {
29813
+ var _this = this;
29814
+ if (__classPrivateFieldGet(this, _SilentPdfTronService_isInitialized, "f") && __classPrivateFieldGet(this, _SilentPdfTronService_webViewerElement, "f") && __classPrivateFieldGet(this, _SilentPdfTronService_webViewerInstance, "f")) {
29815
+ return Promise.resolve([__classPrivateFieldGet(this, _SilentPdfTronService_webViewerElement, "f"), __classPrivateFieldGet(this, _SilentPdfTronService_webViewerInstance, "f")]);
29816
+ }
29817
+ return __classPrivateFieldGet(this, _SilentPdfTronService_instances, "m", _SilentPdfTronService_initializeWebViewer).call(this).then(function () {
29818
+ if (!__classPrivateFieldGet(_this, _SilentPdfTronService_isInitialized, "f") || !__classPrivateFieldGet(_this, _SilentPdfTronService_webViewerElement, "f") || !__classPrivateFieldGet(_this, _SilentPdfTronService_webViewerInstance, "f")) {
29819
+ return Promise.reject(new Error('WebViewer initialization failed.'));
29820
+ }
29821
+ return [__classPrivateFieldGet(_this, _SilentPdfTronService_webViewerElement, "f"), __classPrivateFieldGet(_this, _SilentPdfTronService_webViewerInstance, "f")];
29822
+ });
29823
+ };
29824
+ return SilentPdfTronService;
29825
+ }());
29826
+ _SilentPdfTronService_webViewerInstance = new WeakMap(), _SilentPdfTronService_webViewerElement = new WeakMap(), _SilentPdfTronService_isInitialized = new WeakMap(), _SilentPdfTronService_initializationPromise = new WeakMap(), _SilentPdfTronService_isArabic = new WeakMap(), _SilentPdfTronService_isEnabled = new WeakMap(), _SilentPdfTronService_instances = new WeakSet(), _SilentPdfTronService_initializeWebViewer = function _SilentPdfTronService_initializeWebViewer() {
29827
+ var _this = this;
29828
+ if (__classPrivateFieldGet(this, _SilentPdfTronService_isInitialized, "f"))
29829
+ return Promise.resolve();
29830
+ if (__classPrivateFieldGet(this, _SilentPdfTronService_initializationPromise, "f"))
29831
+ return __classPrivateFieldGet(this, _SilentPdfTronService_initializationPromise, "f");
29832
+ __classPrivateFieldSet(this, _SilentPdfTronService_initializationPromise, WebViewer__default["default"]({
29833
+ path: this.baseHref + "/assets/pdftrons",
29834
+ forceClientSideInit: true,
29835
+ streaming: true,
29836
+ licenseKey: this.environment.pdftronLicenceKey,
29837
+ css: this.baseHref + "/assets/styles/" + (__classPrivateFieldGet(this, _SilentPdfTronService_isArabic, "f") ? 'ar' : 'en') + "-mypdftron.css",
29838
+ annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + " " + this.nuxeo.nuxeoClient.user.properties.lastName,
29839
+ disabledElements: ['downloadButton', 'printButton']
29840
+ }, __classPrivateFieldGet(this, _SilentPdfTronService_webViewerElement, "f"))
29841
+ .then(function (instance) {
29842
+ __classPrivateFieldSet(_this, _SilentPdfTronService_webViewerInstance, instance, "f");
29843
+ __classPrivateFieldSet(_this, _SilentPdfTronService_isInitialized, true, "f");
29844
+ })
29845
+ .catch(function (error) {
29846
+ console.error('Failed to initialize WebViewer:', error);
29847
+ __classPrivateFieldSet(_this, _SilentPdfTronService_initializationPromise, null, "f");
29848
+ return Promise.reject(error);
29849
+ }), "f");
29850
+ return __classPrivateFieldGet(this, _SilentPdfTronService_initializationPromise, "f");
29851
+ };
29852
+ SilentPdfTronService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SilentPdfTronService, deps: [{ token: i4.APP_BASE_HREF }, { token: TranslationService }, { token: 'environment' }, { token: NuxeoService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
29853
+ SilentPdfTronService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SilentPdfTronService, providedIn: 'root' });
29854
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SilentPdfTronService, decorators: [{
29855
+ type: i0.Injectable,
29856
+ args: [{
29857
+ providedIn: 'root'
29858
+ }]
29859
+ }], ctorParameters: function () {
29860
+ return [{ type: undefined, decorators: [{
29861
+ type: i0.Inject,
29862
+ args: [i4.APP_BASE_HREF]
29863
+ }] }, { type: TranslationService }, { type: undefined, decorators: [{
29864
+ type: i0.Inject,
29865
+ args: ['environment']
29866
+ }] }, { type: NuxeoService }];
29867
+ } });
29868
+
29869
+ var _PdftronComponent_instances, _PdftronComponent_updateSilentPdfTron, _PdftronComponent_afterLoadWebViewer, _PdftronComponent_docLoaded, _PdftronComponent_reset;
29764
29870
  /**
29765
29871
  * A reusable file viewer based on PDFTron Library
29766
29872
  * @title
@@ -29775,16 +29881,16 @@
29775
29881
  * </app-pdftron>
29776
29882
  */
29777
29883
  var PdftronComponent = /** @class */ (function () {
29778
- function PdftronComponent(cdr, pdftronService, nuxeo, baseHref, securePipe, translationService, toaster, environment) {
29884
+ function PdftronComponent(cdr, pdftronService, nuxeo, baseHref, translationService, silentPdfTronService, environment) {
29779
29885
  var _this = this;
29780
29886
  this.cdr = cdr;
29781
29887
  this.pdftronService = pdftronService;
29782
29888
  this.nuxeo = nuxeo;
29783
29889
  this.baseHref = baseHref;
29784
- this.securePipe = securePipe;
29785
29890
  this.translationService = translationService;
29786
- this.toaster = toaster;
29891
+ this.silentPdfTronService = silentPdfTronService;
29787
29892
  this.environment = environment;
29893
+ _PdftronComponent_instances.add(this);
29788
29894
  this.actionClicked = false; // used to know if there is action clicked outside to start edit mode or not
29789
29895
  this.DOCUMENT_TYPE = 'application/pdf';
29790
29896
  this.fitMode = 'FitWidth';
@@ -29799,8 +29905,18 @@
29799
29905
  this.events = new i0.EventEmitter();
29800
29906
  this.SignatureEvent = new i0.EventEmitter(); // used to export signature to outside
29801
29907
  this.firstTimeLoad = true; //flage to control importing signatures in the first time load only
29802
- this.firstSignatureLoad = true; // flage to pass first load of imported signatures without emitting the event
29908
+ this.firstSignatureLoad = true; // flage to pass first load of imported signatures without emitting the event
29803
29909
  this.newSignCreation = false; // flage to indicate signature creation is created or choosed from stored ones
29910
+ _PdftronComponent_docLoaded.set(this, function () {
29911
+ var fitMode = _this.webViewerInstance.FitMode.FitWidth;
29912
+ if (_this.fitMode === 'FitPage') {
29913
+ fitMode = _this.webViewerInstance.FitMode.FitPage;
29914
+ }
29915
+ else if (_this.fitMode === 'Zoom') {
29916
+ fitMode = _this.webViewerInstance.FitMode.Zoom;
29917
+ }
29918
+ _this.webViewerInstance.setFitMode(fitMode);
29919
+ });
29804
29920
  this.savedAnotations = [];
29805
29921
  this.fileWithOcr = false;
29806
29922
  this.newAnnotations = [];
@@ -29826,13 +29942,13 @@
29826
29942
  _this.pages.pages.forEach(function (page, index) {
29827
29943
  _this.pageHeight = page.page_height;
29828
29944
  _this.pageWidth = page.page_width;
29829
- _this.standardHeight = _this.webViewerInstance.docViewer.getPageHeight((index + 1));
29830
- _this.standardWidth = _this.webViewerInstance.docViewer.getPageWidth((index + 1));
29945
+ _this.standardHeight = _this.webViewerInstance.docViewer.getPageHeight(index + 1);
29946
+ _this.standardWidth = _this.webViewerInstance.docViewer.getPageWidth(index + 1);
29831
29947
  page.zones.forEach(function (zone) {
29832
29948
  zone.paragraphs.forEach(function (paragraph) {
29833
29949
  paragraph.lines.forEach(function (line) {
29834
29950
  if (line.text.includes(searchValue)) {
29835
- _this.SearchForWordInLine(mySearch_1, line, (index + 1), page);
29951
+ _this.SearchForWordInLine(mySearch_1, line, index + 1, page);
29836
29952
  }
29837
29953
  });
29838
29954
  });
@@ -29840,7 +29956,7 @@
29840
29956
  });
29841
29957
  }
29842
29958
  else {
29843
- // then i am searching with only one word
29959
+ // then i am searching with only one word
29844
29960
  _this.searchForWordInAllPages(searchValue);
29845
29961
  }
29846
29962
  _this.webViewerInstance.docViewer.clearSearchResults();
@@ -29854,81 +29970,58 @@
29854
29970
  }
29855
29971
  PdftronComponent.prototype.ngOnInit = function () {
29856
29972
  return __awaiter(this, void 0, void 0, function () {
29973
+ var _b;
29857
29974
  var _this = this;
29858
- return __generator(this, function (_a) {
29859
- this.transelationSubscrition = this.translationService.isArabic.subscribe(function (res) {
29860
- _this.isArabic = res;
29861
- });
29862
- return [2 /*return*/];
29863
- });
29864
- });
29865
- };
29866
- PdftronComponent.prototype.ngAfterViewInit = function () {
29867
- return __awaiter(this, void 0, void 0, function () {
29868
- var _this = this;
29869
- return __generator(this, function (_a) {
29870
- this.recivedSearchStringsArray = this.searchString.trim() ? this.searchString.split(',') : [];
29871
- if (this.fileTitle) {
29872
- if (this.fileTitle.endsWith('.ppt')) {
29873
- this.DOCUMENT_TYPE = 'application/vnd.ms-powerpoint';
29874
- }
29875
- else if (this.fileTitle.endsWith('.pptx')) {
29876
- this.DOCUMENT_TYPE =
29877
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
29878
- }
29879
- else if (this.fileTitle.endsWith('.doc')) {
29880
- this.DOCUMENT_TYPE = 'application/msword';
29881
- }
29882
- else if (this.fileTitle.endsWith('.docx')) {
29883
- this.DOCUMENT_TYPE =
29884
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
29885
- }
29886
- WebViewer__default["default"]({
29887
- path: this.baseHref + '/assets/pdftrons',
29888
- forceClientSideInit: true,
29889
- streaming: true,
29890
- licenseKey: this.environment.pdftronLicenceKey,
29891
- css: this.isArabic ? (this.baseHref + '/assets/styles/ar-mypdftron.css') : (this.baseHref + '/assets/styles/en-mypdftron.css'),
29892
- annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + ' ' + this.nuxeo.nuxeoClient.user.properties.lastName,
29893
- disabledElements: ['downloadButton', 'printButton'],
29894
- }, this.viewerRef.nativeElement).then(function (instance) { return __awaiter(_this, void 0, void 0, function () {
29895
- return __generator(this, function (_a) {
29896
- this.isArabic ? instance.setLanguage('ar') : instance.setLanguage('en');
29897
- this.pdftronService.instance = this.webViewerInstance = instance;
29898
- if (this.correspondance.facets.indexOf('ctocr') > -1) {
29899
- this.fileWithOcr = true;
29900
- this.pages = JSON.parse(this.correspondance.properties['ctocr:recognizedJson']);
29901
- // override search funtion to use our search in ocr not defult search
29902
- instance.overrideSearchExecution(this.searchFn);
29975
+ return __generator(this, function (_c) {
29976
+ switch (_c.label) {
29977
+ case 0:
29978
+ this.transelationSubscrition = this.translationService.isArabic.subscribe(function (res) {
29979
+ _this.isArabic = res;
29980
+ });
29981
+ this.recivedSearchStringsArray = this.searchString.trim() ? this.searchString.split(',') : [];
29982
+ if (this.fileTitle) {
29983
+ if (this.fileTitle.endsWith('.ppt')) {
29984
+ this.DOCUMENT_TYPE = 'application/vnd.ms-powerpoint';
29903
29985
  }
29904
- else {
29905
- // if no ocr then add search lisner to lisne to internal search and catch results
29906
- this.addSearchListner();
29986
+ else if (this.fileTitle.endsWith('.pptx')) {
29987
+ this.DOCUMENT_TYPE = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
29907
29988
  }
29908
- this.addPrintButton();
29909
- this.addDownloadButton();
29910
- this.importSignature();
29911
- this.exportingSignature();
29912
- this.deleteAnnotation();
29913
- this.exportingSavedSignature();
29914
- if (this.useOutsideAnotations) {
29915
- this.importAnotationsFromOutside();
29916
- this.exportAnotationsToOutside();
29989
+ else if (this.fileTitle.endsWith('.doc')) {
29990
+ this.DOCUMENT_TYPE = 'application/msword';
29917
29991
  }
29918
- this.webViewerInstance.docViewer.setSearchHighlightColors({
29919
- // setSearchHighlightColors accepts both Annotations.Color objects or 'rgba' strings
29920
- searchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
29921
- activeSearchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
29922
- });
29923
- if (this.recivedSearchStringsArray.length !== 0) {
29924
- this.automaticSearch(this.recivedSearchStringsArray);
29992
+ else if (this.fileTitle.endsWith('.docx')) {
29993
+ this.DOCUMENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
29925
29994
  }
29926
- this.loadDocument();
29927
- return [2 /*return*/];
29928
- });
29929
- }); });
29995
+ }
29996
+ if (!this.silentPdfTronService.isEnabled) return [3 /*break*/, 2];
29997
+ return [4 /*yield*/, this.silentPdfTronService.getWebViewer()];
29998
+ case 1:
29999
+ _b = __read.apply(void 0, [_c.sent(), 2]), this.silentPdfTron = _b[0], this.webViewerInstance = _b[1];
30000
+ __classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_afterLoadWebViewer).call(this, this.webViewerInstance);
30001
+ this.resizeObserver = new ResizeObserver(function () { return __classPrivateFieldGet(_this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(_this); });
30002
+ this.resizeObserver.observe(this.viewerRef.nativeElement);
30003
+ __classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(this);
30004
+ return [3 /*break*/, 3];
30005
+ case 2:
30006
+ WebViewer__default["default"]({
30007
+ path: this.baseHref + '/assets/pdftrons',
30008
+ forceClientSideInit: true,
30009
+ streaming: true,
30010
+ licenseKey: this.environment.pdftronLicenceKey,
30011
+ css: this.isArabic
30012
+ ? this.baseHref + '/assets/styles/ar-mypdftron.css'
30013
+ : this.baseHref + '/assets/styles/en-mypdftron.css',
30014
+ annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + ' ' + this.nuxeo.nuxeoClient.user.properties.lastName,
30015
+ disabledElements: ['downloadButton', 'printButton']
30016
+ }, this.viewerRef.nativeElement).then(function (instance) { return __awaiter(_this, void 0, void 0, function () {
30017
+ return __generator(this, function (_b) {
30018
+ __classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_afterLoadWebViewer).call(this, instance);
30019
+ return [2 /*return*/];
30020
+ });
30021
+ }); });
30022
+ _c.label = 3;
30023
+ case 3: return [2 /*return*/];
29930
30024
  }
29931
- return [2 /*return*/];
29932
30025
  });
29933
30026
  });
29934
30027
  };
@@ -29947,8 +30040,8 @@
29947
30040
  // exctract all anotations on the file and send it out side to be saved and leave the file as it is without any anotations on it
29948
30041
  PdftronComponent.prototype.exportAnotationsToOutside = function () {
29949
30042
  var _this = this;
29950
- this.webViewerInstance.annotManager.on('annotationChanged', function (annotations, action, _a) {
29951
- var imported = _a.imported;
30043
+ this.webViewerInstance.annotManager.on('annotationChanged', function (annotations, action, _b) {
30044
+ var imported = _b.imported;
29952
30045
  if (imported)
29953
30046
  return;
29954
30047
  _this.webViewerInstance.annotManager.exportAnnotations().then(function (exctractedAnotations) {
@@ -29982,7 +30075,6 @@
29982
30075
  }
29983
30076
  _this.firstSignatureLoad = false;
29984
30077
  });
29985
- ;
29986
30078
  };
29987
30079
  PdftronComponent.prototype.exportingSignature = function () {
29988
30080
  var _this = this;
@@ -29995,11 +30087,10 @@
29995
30087
  console.log(annotation);
29996
30088
  }
29997
30089
  });
29998
- ;
29999
30090
  };
30000
30091
  PdftronComponent.prototype.extractAnotation = function (annotation, documentViewer) {
30001
30092
  if (annotation['image']) {
30002
- // convert base64 signature into file and emit it to out side
30093
+ // convert base64 signature into file and emit it to out side
30003
30094
  var base64Img = annotation['image']['currentSrc'];
30004
30095
  var arr = base64Img.split(','), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
30005
30096
  while (n--) {
@@ -30017,7 +30108,7 @@
30017
30108
  return __awaiter(this, void 0, void 0, function () {
30018
30109
  var canvas, pageMatrix, ctx;
30019
30110
  var _this = this;
30020
- return __generator(this, function (_a) {
30111
+ return __generator(this, function (_b) {
30021
30112
  canvas = document.createElement('canvas');
30022
30113
  pageMatrix = docViewer.getDocument().getPageMatrix(annotation.PageNumber);
30023
30114
  // Set the height & width of the canvas to madeleteSavedSignaturetch the annotation
@@ -30051,16 +30142,19 @@
30051
30142
  };
30052
30143
  PdftronComponent.prototype.addDownloadButton = function () {
30053
30144
  var _this = this;
30054
- if (this.allowDownloadSecretFile || (!this.allowDownloadSecretFile && this.correspondance.properties[this.secrecyProperty] && this.correspondance.properties[this.secrecyProperty] === 'Normal')) {
30145
+ if (this.allowDownloadSecretFile ||
30146
+ (!this.allowDownloadSecretFile &&
30147
+ this.correspondance.properties[this.secrecyProperty] &&
30148
+ this.correspondance.properties[this.secrecyProperty] === 'Normal')) {
30055
30149
  this.webViewerInstance.setHeaderItems(function (header) {
30056
30150
  header.push({
30057
30151
  type: 'actionButton',
30058
30152
  img: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-file-earmark-arrow-down" viewBox="0 0 16 16"> <path d="M8.5 6.5a.5.5 0 0 0-1 0v3.793L6.354 9.146a.5.5 0 1 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0-.708-.708L8.5 10.293V6.5z"/> <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/></svg>',
30059
30153
  title: _this.isArabic ? 'تنزيل' : 'Download',
30060
30154
  onClick: function () { return __awaiter(_this, void 0, void 0, function () {
30061
- var _a, DocumentViewer, AnnotationManager, SaveOptions, saveOptions, options;
30062
- return __generator(this, function (_b) {
30063
- _a = this.webViewerInstance.CoreControls, DocumentViewer = _a.DocumentViewer, AnnotationManager = _a.AnnotationManager, SaveOptions = _a.SaveOptions;
30155
+ var _b, DocumentViewer, AnnotationManager, SaveOptions, saveOptions, options;
30156
+ return __generator(this, function (_c) {
30157
+ _b = this.webViewerInstance.CoreControls, DocumentViewer = _b.DocumentViewer, AnnotationManager = _b.AnnotationManager, SaveOptions = _b.SaveOptions;
30064
30158
  saveOptions = SaveOptions;
30065
30159
  options = {
30066
30160
  filename: this.correspondance.title ? this.correspondance.title : 'myDocument.pdf',
@@ -30072,30 +30166,31 @@
30072
30166
  this.events.next('download');
30073
30167
  return [2 /*return*/];
30074
30168
  });
30075
- }); },
30169
+ }); }
30076
30170
  });
30077
30171
  });
30078
30172
  }
30079
30173
  };
30080
30174
  PdftronComponent.prototype.addPrintButton = function () {
30081
30175
  var _this = this;
30082
- if (this.allowPrintSecretFile || (!this.allowPrintSecretFile && this.correspondance.properties[this.secrecyProperty] && this.correspondance.properties[this.secrecyProperty] === 'Normal')) {
30176
+ if (this.allowPrintSecretFile ||
30177
+ (!this.allowPrintSecretFile &&
30178
+ this.correspondance.properties[this.secrecyProperty] &&
30179
+ this.correspondance.properties[this.secrecyProperty] === 'Normal')) {
30083
30180
  this.webViewerInstance.setHeaderItems(function (header) {
30084
30181
  header.push({
30085
30182
  type: 'actionButton',
30086
30183
  img: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:#abb0c4;}</style></defs><title>icon - header - print - line</title><path class="cls-1" d="M20,6H18V2H6V6H4A2,2,0,0,0,2,8v9a2,2,0,0,0,2,2H6v3H18V19h2a2,2,0,0,0,2-2V8A2,2,0,0,0,20,6ZM8,4h8V6H8Zm8,16H8V16h8Zm4-3H18V14H6v3H4V8H20Zm-4-7h2v2H16Zm-3,0h2v2H13Z"></path></svg>',
30087
- title: _this.isArabic ? "طباعة" : 'Print',
30184
+ title: _this.isArabic ? 'طباعة' : 'Print',
30088
30185
  onClick: function () {
30089
30186
  _this.pdftronService.instance.print();
30090
30187
  _this.events.next('print');
30091
- },
30188
+ }
30092
30189
  });
30093
30190
  });
30094
30191
  }
30095
30192
  else {
30096
- this.webViewerInstance.disableElements([
30097
- 'printModal',
30098
- ]);
30193
+ this.webViewerInstance.disableElements(['printModal']);
30099
30194
  }
30100
30195
  };
30101
30196
  PdftronComponent.prototype.addWatermark = function () {
@@ -30107,21 +30202,11 @@
30107
30202
  );
30108
30203
  };
30109
30204
  PdftronComponent.prototype.loadDocument = function () {
30110
- var _this = this;
30111
30205
  if (!this.webViewerInstance || (!this.fileData && !this.fileURL)) {
30112
30206
  return;
30113
30207
  }
30114
- var _a = this.webViewerInstance, docViewer = _a.docViewer, annotManager = _a.annotManager, Annotations = _a.Annotations;
30115
- docViewer.on('documentLoaded', function () {
30116
- var fitMode = _this.webViewerInstance.FitMode.FitWidth;
30117
- if (_this.fitMode === 'FitPage') {
30118
- fitMode = _this.webViewerInstance.FitMode.FitPage;
30119
- }
30120
- else if (_this.fitMode === 'Zoom') {
30121
- fitMode = _this.webViewerInstance.FitMode.Zoom;
30122
- }
30123
- _this.webViewerInstance.setFitMode(fitMode);
30124
- });
30208
+ var _b = this.webViewerInstance, docViewer = _b.docViewer, annotManager = _b.annotManager, Annotations = _b.Annotations;
30209
+ docViewer.on('documentLoaded', __classPrivateFieldGet(this, _PdftronComponent_docLoaded, "f"));
30125
30210
  if (!this.editMode) {
30126
30211
  this.webViewerInstance.annotManager.setReadOnly(true);
30127
30212
  // instance.enableTools([]);
@@ -30130,24 +30215,25 @@
30130
30215
  this.webViewerInstance.loadDocument(this.fileURL, {
30131
30216
  xodstreaming: true,
30132
30217
  customHeaders: {
30133
- Authorization: this.authHeader,
30134
- },
30218
+ Authorization: this.authHeader
30219
+ }
30135
30220
  // withCredentials: true,
30136
30221
  });
30137
30222
  }
30138
30223
  else {
30139
30224
  this.webViewerInstance.loadDocument(new Blob([new Uint8Array(this.fileData)], { type: this.DOCUMENT_TYPE }), {
30140
- filename: this.fileTitle,
30225
+ filename: this.fileTitle
30141
30226
  });
30142
30227
  }
30143
30228
  this.isFetching = false;
30144
30229
  // if not negelcting adding water mark then check conditions for adding it
30145
30230
  if (!this.negelectAddingWaterMark) {
30146
30231
  if (this.correspondance !== undefined) {
30147
- // if we need to check on secrecy level for adding water mark or not
30232
+ // if we need to check on secrecy level for adding water mark or not
30148
30233
  if (this.environment.enableViewerWaterMark && this.secrecyProperty) {
30149
30234
  // check for secrecy level befor adding watermark
30150
- if (this.correspondance.properties[this.secrecyProperty] && this.correspondance.properties[this.secrecyProperty] !== 'Normal') {
30235
+ if (this.correspondance.properties[this.secrecyProperty] &&
30236
+ this.correspondance.properties[this.secrecyProperty] !== 'Normal') {
30151
30237
  this.addWatermark();
30152
30238
  }
30153
30239
  }
@@ -30161,19 +30247,19 @@
30161
30247
  PdftronComponent.prototype.exportAsBlob = function () {
30162
30248
  return __awaiter(this, void 0, void 0, function () {
30163
30249
  var doc, xfdfString, data, arr, blob;
30164
- return __generator(this, function (_a) {
30165
- switch (_a.label) {
30250
+ return __generator(this, function (_b) {
30251
+ switch (_b.label) {
30166
30252
  case 0:
30167
30253
  doc = this.webViewerInstance.docViewer.getDocument();
30168
30254
  return [4 /*yield*/, this.webViewerInstance.annotManager.exportAnnotations()];
30169
30255
  case 1:
30170
- xfdfString = _a.sent();
30256
+ xfdfString = _b.sent();
30171
30257
  return [4 /*yield*/, doc.getFileData({
30172
30258
  // saves the document with annotations in it
30173
- xfdfString: xfdfString,
30259
+ xfdfString: xfdfString
30174
30260
  })];
30175
30261
  case 2:
30176
- data = _a.sent();
30262
+ data = _b.sent();
30177
30263
  arr = new Uint8Array(data);
30178
30264
  blob = new Blob([arr], { type: this.DOCUMENT_TYPE });
30179
30265
  return [2 /*return*/, Promise.resolve(blob)];
@@ -30188,7 +30274,7 @@
30188
30274
  'toolbarGroup-Shapes',
30189
30275
  'toolbarGroup-Edit',
30190
30276
  'toolbarGroup-Insert',
30191
- 'toolbarGroup-Annotate',
30277
+ 'toolbarGroup-Annotate'
30192
30278
  ]);
30193
30279
  this.webViewerInstance.annotManager.setReadOnly(true);
30194
30280
  }
@@ -30199,20 +30285,14 @@
30199
30285
  'toolbarGroup-Shapes',
30200
30286
  'toolbarGroup-Edit',
30201
30287
  'toolbarGroup-Insert',
30202
- 'toolbarGroup-Annotate',
30288
+ 'toolbarGroup-Annotate'
30203
30289
  ]);
30204
30290
  var group = void 0;
30205
30291
  if (this.editingType === 'signDoc') {
30206
- this.webViewerInstance.enableElements([
30207
- 'toolbarGroup-Insert'
30208
- ]);
30292
+ this.webViewerInstance.enableElements(['toolbarGroup-Insert']);
30209
30293
  }
30210
30294
  else if (this.editingType === 'annotate') {
30211
- this.webViewerInstance.enableElements([
30212
- 'toolbarGroup-Shapes',
30213
- 'toolbarGroup-Edit',
30214
- 'toolbarGroup-Annotate',
30215
- ]);
30295
+ this.webViewerInstance.enableElements(['toolbarGroup-Shapes', 'toolbarGroup-Edit', 'toolbarGroup-Annotate']);
30216
30296
  }
30217
30297
  }
30218
30298
  else {
@@ -30220,7 +30300,7 @@
30220
30300
  'toolbarGroup-Shapes',
30221
30301
  'toolbarGroup-Edit',
30222
30302
  'toolbarGroup-Insert',
30223
- 'toolbarGroup-Annotate',
30303
+ 'toolbarGroup-Annotate'
30224
30304
  ]);
30225
30305
  }
30226
30306
  this.webViewerInstance.annotManager.setReadOnly(false);
@@ -30232,11 +30312,9 @@
30232
30312
  this.toggleEdit();
30233
30313
  if (changes.urlFileContent &&
30234
30314
  changes.urlFileContent.previousValue &&
30235
- changes.urlFileContent.previousValue !==
30236
- changes.urlFileContent.currentValue) {
30315
+ changes.urlFileContent.previousValue !== changes.urlFileContent.currentValue) {
30237
30316
  this.ngOnDestroy();
30238
30317
  this.ngOnInit();
30239
- this.ngAfterViewInit();
30240
30318
  }
30241
30319
  }
30242
30320
  };
@@ -30249,9 +30327,9 @@
30249
30327
  // adding search lisner to lisen to internal search from ui and without ocr
30250
30328
  PdftronComponent.prototype.addSearchListner = function () {
30251
30329
  var _this = this;
30252
- var _a = this.webViewerInstance, annotManager = _a.annotManager, docViewer = _a.docViewer, Annotations = _a.Annotations;
30330
+ var _b = this.webViewerInstance, annotManager = _b.annotManager, docViewer = _b.docViewer, Annotations = _b.Annotations;
30253
30331
  var searchListener = function (searchPattern, options, results) {
30254
- var _a;
30332
+ var _b;
30255
30333
  _this.mySearchStringResults = [];
30256
30334
  if (_this.savedAnotations.length > 0) {
30257
30335
  _this.savedAnotations.map(function (annotation) {
@@ -30271,7 +30349,7 @@
30271
30349
  annotation.Author = _this.webViewerInstance.annotManager.getCurrentUser();
30272
30350
  return annotation;
30273
30351
  });
30274
- (_a = _this.savedAnotations).push.apply(_a, __spreadArray([], __read(_this.newAnnotations)));
30352
+ (_b = _this.savedAnotations).push.apply(_b, __spreadArray([], __read(_this.newAnnotations)));
30275
30353
  annotManager.addAnnotations(_this.newAnnotations);
30276
30354
  annotManager.drawAnnotationsFromList(_this.newAnnotations);
30277
30355
  }
@@ -30283,14 +30361,16 @@
30283
30361
  _this.webViewerInstance.addSearchListener(searchListener);
30284
30362
  });
30285
30363
  };
30286
- // perform automatic search when intering the page
30364
+ // perform automatic search when intering the page
30287
30365
  PdftronComponent.prototype.automaticSearch = function (searchTextArray) {
30288
30366
  var _this = this;
30289
- var _a = this.webViewerInstance, annotManager = _a.annotManager, docViewer = _a.docViewer, Annotations = _a.Annotations;
30367
+ var _b = this.webViewerInstance, annotManager = _b.annotManager, docViewer = _b.docViewer, Annotations = _b.Annotations;
30290
30368
  var searchOptions;
30291
30369
  this.webViewerInstance.openElements(['searchPanel']);
30292
30370
  docViewer.on('documentLoaded', function () {
30293
- var mode = _this.webViewerInstance.CoreControls.Search.Mode.PAGE_STOP | _this.webViewerInstance.CoreControls.Search.Mode.HIGHLIGHT | _this.webViewerInstance.CoreControls.Search.Mode.AMBIENT_STRING;
30371
+ var mode = _this.webViewerInstance.CoreControls.Search.Mode.PAGE_STOP |
30372
+ _this.webViewerInstance.CoreControls.Search.Mode.HIGHLIGHT |
30373
+ _this.webViewerInstance.CoreControls.Search.Mode.AMBIENT_STRING;
30294
30374
  _this.mySearchStringResults = []; // empty my search result when starting new search
30295
30375
  if (_this.fileWithOcr) {
30296
30376
  // add redaction annotation for each search result
@@ -30302,13 +30382,13 @@
30302
30382
  _this.pages.pages.forEach(function (page, index) {
30303
30383
  _this.pageHeight = page.page_height;
30304
30384
  _this.pageWidth = page.page_width;
30305
- _this.standardHeight = _this.webViewerInstance.docViewer.getPageHeight((index + 1));
30306
- _this.standardWidth = _this.webViewerInstance.docViewer.getPageWidth((index + 1));
30385
+ _this.standardHeight = _this.webViewerInstance.docViewer.getPageHeight(index + 1);
30386
+ _this.standardWidth = _this.webViewerInstance.docViewer.getPageWidth(index + 1);
30307
30387
  page.zones.forEach(function (zone) {
30308
30388
  zone.paragraphs.forEach(function (paragraph) {
30309
30389
  paragraph.lines.forEach(function (line) {
30310
30390
  if (line.text.includes(searchText)) {
30311
- _this.SearchForWordInLine(mySearch, line, (index + 1), page);
30391
+ _this.SearchForWordInLine(mySearch, line, index + 1, page);
30312
30392
  }
30313
30393
  });
30314
30394
  });
@@ -30316,7 +30396,7 @@
30316
30396
  });
30317
30397
  }
30318
30398
  else {
30319
- // then i am searching with only one word
30399
+ // then i am searching with only one word
30320
30400
  _this.searchForWordInAllPages(searchText);
30321
30401
  }
30322
30402
  });
@@ -30350,32 +30430,34 @@
30350
30430
  }
30351
30431
  });
30352
30432
  };
30353
- // search for single word in all pages
30433
+ // search for single word in all pages
30354
30434
  PdftronComponent.prototype.searchForWordInAllPages = function (searchedWord) {
30355
30435
  var _this = this;
30356
30436
  this.pages.pages.forEach(function (page, index) {
30357
30437
  _this.pageHeight = page.page_height;
30358
30438
  _this.pageWidth = page.page_width;
30359
- _this.standardHeight = _this.webViewerInstance.docViewer.getPageHeight((index + 1));
30360
- _this.standardWidth = _this.webViewerInstance.docViewer.getPageWidth((index + 1));
30361
- var x = (_this.pageWidth / _this.standardWidth); // width ratio
30362
- var y = (_this.pageHeight / _this.standardHeight); // height ratio
30439
+ _this.standardHeight = _this.webViewerInstance.docViewer.getPageHeight(index + 1);
30440
+ _this.standardWidth = _this.webViewerInstance.docViewer.getPageWidth(index + 1);
30441
+ var x = _this.pageWidth / _this.standardWidth; // width ratio
30442
+ var y = _this.pageHeight / _this.standardHeight; // height ratio
30363
30443
  page.zones.forEach(function (zone) {
30364
30444
  zone.paragraphs.forEach(function (paragraph) {
30365
30445
  paragraph.lines.forEach(function (line) {
30366
30446
  line.words.forEach(function (word) {
30367
30447
  if (word.text.includes(searchedWord)) {
30368
30448
  // annotation.PageNumber = index+1;
30369
- var quads = [{
30370
- x1: (word.coordinates.upper_left.x / x),
30371
- x2: (word.coordinates.bottom_right.x / x),
30372
- x3: (word.coordinates.bottom_right.x / x),
30373
- x4: (word.coordinates.upper_left.x / x),
30374
- y1: (word.coordinates.upper_left.y / y),
30375
- y2: (word.coordinates.upper_left.y / y),
30376
- y3: (word.coordinates.bottom_right.y / y),
30377
- y4: (word.coordinates.bottom_right.y / y),
30378
- }];
30449
+ var quads = [
30450
+ {
30451
+ x1: word.coordinates.upper_left.x / x,
30452
+ x2: word.coordinates.bottom_right.x / x,
30453
+ x3: word.coordinates.bottom_right.x / x,
30454
+ x4: word.coordinates.upper_left.x / x,
30455
+ y1: word.coordinates.upper_left.y / y,
30456
+ y2: word.coordinates.upper_left.y / y,
30457
+ y3: word.coordinates.bottom_right.y / y,
30458
+ y4: word.coordinates.bottom_right.y / y
30459
+ }
30460
+ ];
30379
30461
  _this.higlightText(quads, index + 1);
30380
30462
  _this.constructSearchResult(searchedWord, index + 1, quads, line.text);
30381
30463
  }
@@ -30385,14 +30467,14 @@
30385
30467
  });
30386
30468
  });
30387
30469
  };
30388
- // search for word in single line
30470
+ // search for word in single line
30389
30471
  PdftronComponent.prototype.SearchForWordInLine = function (listOfSearchedWords, line, pagenumber, page) {
30390
30472
  this.pageHeight = page.page_height;
30391
30473
  this.pageWidth = page.page_width;
30392
- this.standardHeight = this.webViewerInstance.docViewer.getPageHeight((pagenumber));
30393
- this.standardWidth = this.webViewerInstance.docViewer.getPageWidth((pagenumber));
30394
- var x = (this.pageWidth / this.standardWidth); // width ratio
30395
- var y = (this.pageHeight / this.standardHeight); // height ratio
30474
+ this.standardHeight = this.webViewerInstance.docViewer.getPageHeight(pagenumber);
30475
+ this.standardWidth = this.webViewerInstance.docViewer.getPageWidth(pagenumber);
30476
+ var x = this.pageWidth / this.standardWidth; // width ratio
30477
+ var y = this.pageHeight / this.standardHeight; // height ratio
30396
30478
  // find only words related to my search form the line
30397
30479
  var myFoundedResults = [];
30398
30480
  var correctResults = [];
@@ -30403,27 +30485,29 @@
30403
30485
  });
30404
30486
  // find only words exist in my search sentence and not single and repeated word
30405
30487
  myFoundedResults.map(function (result, index) {
30406
- if ((myFoundedResults[index]['wordIndex'] - 1 === (myFoundedResults[index - 1] && myFoundedResults[index - 1]['wordIndex'])) ||
30407
- (myFoundedResults[index + 1] && (myFoundedResults[index + 1]['wordIndex'] - 1 === myFoundedResults[index]['wordIndex']))) {
30488
+ if (myFoundedResults[index]['wordIndex'] - 1 ===
30489
+ (myFoundedResults[index - 1] && myFoundedResults[index - 1]['wordIndex']) ||
30490
+ (myFoundedResults[index + 1] &&
30491
+ myFoundedResults[index + 1]['wordIndex'] - 1 === myFoundedResults[index]['wordIndex'])) {
30408
30492
  correctResults.push(result);
30409
30493
  }
30410
30494
  });
30411
30495
  // highliht these words after eleminating all repeated and related words
30412
30496
  // must be for loop sp i can control the step in each loop
30413
30497
  var quads = [];
30414
- for (var i = 0; i < correctResults.length; (i = i + listOfSearchedWords.length)) {
30498
+ for (var i = 0; i < correctResults.length; i = i + listOfSearchedWords.length) {
30415
30499
  quads.push({
30416
- x1: (correctResults[((i + listOfSearchedWords.length) - 1)].word.coordinates.upper_left.x / x),
30417
- x2: (correctResults[i].word.coordinates.bottom_right.x / x),
30418
- x3: (correctResults[i].word.coordinates.bottom_right.x / x),
30419
- x4: (correctResults[((i + listOfSearchedWords.length) - 1)].word.coordinates.upper_left.x / x),
30420
- y1: (correctResults[i].word.coordinates.upper_left.y / y),
30421
- y2: (correctResults[((i + listOfSearchedWords.length) - 1)].word.coordinates.upper_left.y / y),
30422
- y3: (correctResults[((i + listOfSearchedWords.length) - 1)].word.coordinates.bottom_right.y / y),
30423
- y4: (correctResults[i].word.coordinates.bottom_right.y / y),
30500
+ x1: correctResults[i + listOfSearchedWords.length - 1].word.coordinates.upper_left.x / x,
30501
+ x2: correctResults[i].word.coordinates.bottom_right.x / x,
30502
+ x3: correctResults[i].word.coordinates.bottom_right.x / x,
30503
+ x4: correctResults[i + listOfSearchedWords.length - 1].word.coordinates.upper_left.x / x,
30504
+ y1: correctResults[i].word.coordinates.upper_left.y / y,
30505
+ y2: correctResults[i + listOfSearchedWords.length - 1].word.coordinates.upper_left.y / y,
30506
+ y3: correctResults[i + listOfSearchedWords.length - 1].word.coordinates.bottom_right.y / y,
30507
+ y4: correctResults[i].word.coordinates.bottom_right.y / y
30424
30508
  });
30425
30509
  this.higlightText(quads, pagenumber);
30426
- this.constructSearchResult(listOfSearchedWords.join(" "), pagenumber, quads, line.text);
30510
+ this.constructSearchResult(listOfSearchedWords.join(' '), pagenumber, quads, line.text);
30427
30511
  }
30428
30512
  };
30429
30513
  PdftronComponent.prototype.constructSearchResult = function (searchedText, pageNum, quads, line) {
@@ -30436,7 +30520,8 @@
30436
30520
  resultStrEnd: mySeearchedTextEndIndex,
30437
30521
  pageNum: pageNum,
30438
30522
  resultCode: 2,
30439
- quads: [{
30523
+ quads: [
30524
+ {
30440
30525
  ea: quads[0]['y3'],
30441
30526
  fa: quads[0]['y4'],
30442
30527
  ha: quads[0]['x1'],
@@ -30445,7 +30530,8 @@
30445
30530
  qB: quads[0]['x4'],
30446
30531
  rB: quads[0]['y1'],
30447
30532
  sB: quads[0]['y2']
30448
- }]
30533
+ }
30534
+ ]
30449
30535
  };
30450
30536
  this.mySearchStringResults.push(searchResultObject);
30451
30537
  console.log(this.mySearchStringResults);
@@ -30470,37 +30556,100 @@
30470
30556
  };
30471
30557
  // ------------------------------------------------------------------------ ------------------------------------------
30472
30558
  PdftronComponent.prototype.ngOnDestroy = function () {
30473
- if (this.webViewerInstance) {
30474
- this.webViewerInstance.closeDocument().then(function () {
30475
- console.log('document closed!');
30476
- });
30477
- this.pdftronService.instance = this.webViewerInstance = null;
30559
+ if (this.silentPdfTronService.isEnabled) {
30560
+ __classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_reset).call(this);
30561
+ }
30562
+ else {
30563
+ if (this.webViewerInstance) {
30564
+ this.webViewerInstance.closeDocument().then(function () {
30565
+ console.log('document closed!');
30566
+ });
30567
+ this.pdftronService.instance = this.webViewerInstance = null;
30568
+ }
30569
+ this.transelationSubscrition ? this.transelationSubscrition.unsubscribe() : null;
30478
30570
  }
30479
- this.transelationSubscrition ? this.transelationSubscrition.unsubscribe() : null;
30480
30571
  };
30481
30572
  return PdftronComponent;
30482
30573
  }());
30483
- PdftronComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PdftronComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: PdftronService }, { token: NuxeoService }, { token: i4.APP_BASE_HREF }, { token: SecurePipe }, { token: TranslationService }, { token: CustomToastrService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Component });
30484
- PdftronComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PdftronComponent, selector: "app-pdftron", inputs: { editMode: "editMode", actionClicked: "actionClicked", fileTitle: "fileTitle", docId: "docId", DOCUMENT_TYPE: "DOCUMENT_TYPE", fileData: "fileData", fitMode: "fitMode", authHeader: "authHeader", fileURL: "fileURL", correspondance: "correspondance", secrecyProperty: "secrecyProperty", editingType: "editingType", userSignatures: "userSignatures", searchString: "searchString", trackSignature: "trackSignature", useOutsideAnotations: "useOutsideAnotations", importedAnotations: "importedAnotations", allowDownloadSecretFile: "allowDownloadSecretFile", allowPrintSecretFile: "allowPrintSecretFile", negelectAddingWaterMark: "negelectAddingWaterMark" }, outputs: { onSignatureTracking: "onSignatureTracking", onAddingAnotation: "onAddingAnotation", events: "events", SignatureEvent: "SignatureEvent" }, providers: [SecurePipe], viewQueries: [{ propertyName: "viewerRef", first: true, predicate: ["fileViewer"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div #fileViewer style=\"width: 100%; height: 100%;\"></div>\r\n", styles: [""] });
30574
+ _PdftronComponent_docLoaded = new WeakMap(), _PdftronComponent_instances = new WeakSet(), _PdftronComponent_updateSilentPdfTron = function _PdftronComponent_updateSilentPdfTron() {
30575
+ var rect = this.viewerRef.nativeElement.getBoundingClientRect();
30576
+ Object.assign(this.silentPdfTron.style, {
30577
+ position: 'absolute',
30578
+ top: rect.top + "px",
30579
+ left: rect.left + "px",
30580
+ width: rect.width + "px",
30581
+ height: rect.height + "px",
30582
+ zIndex: '9999',
30583
+ display: 'block'
30584
+ });
30585
+ }, _PdftronComponent_afterLoadWebViewer = function _PdftronComponent_afterLoadWebViewer(instance) {
30586
+ this.isArabic ? instance.setLanguage('ar') : instance.setLanguage('en');
30587
+ this.pdftronService.instance = this.webViewerInstance = instance;
30588
+ if (this.correspondance.facets.indexOf('ctocr') > -1) {
30589
+ this.fileWithOcr = true;
30590
+ this.pages = JSON.parse(this.correspondance.properties['ctocr:recognizedJson']);
30591
+ // override search funtion to use our search in ocr not defult search
30592
+ instance.overrideSearchExecution(this.searchFn);
30593
+ }
30594
+ else {
30595
+ // if no ocr then add search lisner to lisne to internal search and catch results
30596
+ this.addSearchListner();
30597
+ }
30598
+ this.addPrintButton();
30599
+ this.addDownloadButton();
30600
+ this.importSignature();
30601
+ this.exportingSignature();
30602
+ this.deleteAnnotation();
30603
+ this.exportingSavedSignature();
30604
+ if (this.useOutsideAnotations) {
30605
+ this.importAnotationsFromOutside();
30606
+ this.exportAnotationsToOutside();
30607
+ }
30608
+ this.webViewerInstance.docViewer.setSearchHighlightColors({
30609
+ // setSearchHighlightColors accepts both Annotations.Color objects or 'rgba' strings
30610
+ searchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
30611
+ activeSearchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196)
30612
+ });
30613
+ if (this.recivedSearchStringsArray.length !== 0) {
30614
+ this.automaticSearch(this.recivedSearchStringsArray);
30615
+ }
30616
+ this.loadDocument();
30617
+ }, _PdftronComponent_reset = function _PdftronComponent_reset() {
30618
+ var _a;
30619
+ this.webViewerInstance.closeDocument().then(function () {
30620
+ console.log('document closed!');
30621
+ });
30622
+ this.pdftronService.instance = null;
30623
+ this.transelationSubscrition ? this.transelationSubscrition.unsubscribe() : null;
30624
+ this.silentPdfTron.style.display = 'none';
30625
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
30626
+ this.webViewerInstance.setHeaderItems(function (header) {
30627
+ header.headers.default = header.headers.default.filter(function (q) { var _a; return !((_a = q.img) === null || _a === void 0 ? void 0 : _a.includes('<svg')); });
30628
+ });
30629
+ this.webViewerInstance.docViewer.off('documentLoaded', __classPrivateFieldGet(this, _PdftronComponent_docLoaded, "f"));
30630
+ // maybe will need to reset signature & annotations
30631
+ };
30632
+ PdftronComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PdftronComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: PdftronService }, { token: NuxeoService }, { token: i4.APP_BASE_HREF }, { token: TranslationService }, { token: SilentPdfTronService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Component });
30633
+ PdftronComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PdftronComponent, selector: "app-pdftron", inputs: { editMode: "editMode", actionClicked: "actionClicked", fileTitle: "fileTitle", docId: "docId", DOCUMENT_TYPE: "DOCUMENT_TYPE", fileData: "fileData", fitMode: "fitMode", authHeader: "authHeader", fileURL: "fileURL", correspondance: "correspondance", secrecyProperty: "secrecyProperty", editingType: "editingType", userSignatures: "userSignatures", searchString: "searchString", trackSignature: "trackSignature", useOutsideAnotations: "useOutsideAnotations", importedAnotations: "importedAnotations", allowDownloadSecretFile: "allowDownloadSecretFile", allowPrintSecretFile: "allowPrintSecretFile", negelectAddingWaterMark: "negelectAddingWaterMark" }, outputs: { onSignatureTracking: "onSignatureTracking", onAddingAnotation: "onAddingAnotation", events: "events", SignatureEvent: "SignatureEvent" }, providers: [SecurePipe], viewQueries: [{ propertyName: "viewerRef", first: true, predicate: ["fileViewer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div #fileViewer style=\"width: 100%; height: 100%;\"></div>\r\n", styles: [""] });
30485
30634
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PdftronComponent, decorators: [{
30486
30635
  type: i0.Component,
30487
30636
  args: [{
30488
30637
  selector: 'app-pdftron',
30489
30638
  templateUrl: './pdftron.component.html',
30490
30639
  styleUrls: ['./pdftron.component.scss'],
30491
- providers: [SecurePipe],
30640
+ providers: [SecurePipe]
30492
30641
  }]
30493
30642
  }], ctorParameters: function () {
30494
30643
  return [{ type: i0__namespace.ChangeDetectorRef }, { type: PdftronService }, { type: NuxeoService }, { type: undefined, decorators: [{
30495
30644
  type: i0.Inject,
30496
30645
  args: [i4.APP_BASE_HREF]
30497
- }] }, { type: SecurePipe }, { type: TranslationService }, { type: CustomToastrService }, { type: undefined, decorators: [{
30646
+ }] }, { type: TranslationService }, { type: SilentPdfTronService }, { type: undefined, decorators: [{
30498
30647
  type: i0.Inject,
30499
30648
  args: ['environment']
30500
30649
  }] }];
30501
30650
  }, propDecorators: { viewerRef: [{
30502
30651
  type: i0.ViewChild,
30503
- args: ['fileViewer']
30652
+ args: ['fileViewer', { static: true }]
30504
30653
  }], editMode: [{
30505
30654
  type: i0.Input
30506
30655
  }], actionClicked: [{
@@ -35990,6 +36139,7 @@
35990
36139
  exports.SharedDocsService = SharedDocsService;
35991
36140
  exports.SharedServicesModule = SharedServicesModule;
35992
36141
  exports.SidepanelComponent = SidepanelComponent;
36142
+ exports.SilentPdfTronService = SilentPdfTronService;
35993
36143
  exports.SingleActivityComponent = SingleActivityComponent;
35994
36144
  exports.Socket = Socket;
35995
36145
  exports.SpellCheckerFieldModule = SpellCheckerFieldModule;