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AAI,IAC/E4I,YAAY,4BAA6B,8BACzCC,UACH,GA3PY5I,E,mUAAe,EAD3B,EAAA6I,W,kIAgB4B,IAA8B,IAAmC,EAAAC,gBAChE,IAAiC,IACpC,IAAuC,IAAgC,IAC9D,IAAkC,EAAAC,KACpC,IAA+C,OAnBpE/I,E","sources":["webpack://client-app/./src/app/project/quantity-takeoff/quantity-takeoff.scss","webpack://client-app/./src/app/project/quantity-takeoff/quantity-takeoff.html","webpack://client-app/./src/app/project/quantity-takeoff/quantity-takeoff.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.quantity-takeoff-container .takeoff-top-bar{border-bottom:1px #d3d3d3 solid}.quantity-takeoff-container .body-content{height:calc(100vh - 4em - 10px);width:100%;white-space:nowrap;margin:5px;display:flex}.quantity-takeoff-container .body-content .hide_sigmapub{display:none}.quantity-takeoff-container .body-content--left{position:relative;display:inline-block;height:100%;width:50%;border-bottom-right-radius:10px;border-top-right-radius:10px;overflow:hidden;scrollbar-color:#d3d3d3 #fff}.quantity-takeoff-container .body-content--left--padding{width:100%;height:100%}.quantity-takeoff-container .body-content--left--padding .top-area{width:100%;min-width:350px;height:50px;padding:10px;margin-bottom:30px}.quantity-takeoff-container .body-content--left--padding .top-area .float-start{margin-right:10px}.quantity-takeoff-container .body-content--left--padding .top-area h3{margin:0}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown{margin-bottom:10px}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown .takeoff-filter-headline{border-bottom:1px solid #a9a9a9;padding:2px}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown .dropdown-qf{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom-right-radius:0;border-top-right-radius:0}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown .takeoff-filter-item{padding-left:3px;cursor:pointer}.quantity-takeoff-container .body-content--left--padding .top-area .should-round-checkbox{position:absolute;top:50px;left:15px}.quantity-takeoff-container .body-content--left--padding .top-area .job-checkbox{position:relative;top:10px}.quantity-takeoff-container .body-content--left--padding .top-area .showids-checkbox{position:relative;top:-4px;left:250px}.quantity-takeoff-container .body-content--left--padding .pivot-grid,.quantity-takeoff-container .body-content--left--padding .type-overview{display:block;width:100%;height:calc(100% - 90px);overflow:auto}.quantity-takeoff-container .body-content--left::-webkit-scrollbar-track{background-color:#fff}.quantity-takeoff-container .body-content .gutter.gutter-horizontal{cursor:col-resize}.quantity-takeoff-container .body-content .gutter.gutter-horizontal::before{position:relative;display:flex;justify-content:center;top:50%;transform:translateY(-50%);font-size:35px !important;content:\"|\";font:var(--fa-font-solid)}.quantity-takeoff-container .body-content--right{position:relative;display:inline-block;margin-right:5px;border-bottom-left-radius:10px;border-top-left-radius:10px;height:100%;width:50%;overflow:hidden}.quantity-takeoff-container .body-content--right .source-selector-container{height:100%;width:100%}.quantity-takeoff-container .body-content--right .ss-top-area{display:block;height:50%;width:100%;margin-bottom:15px}.quantity-takeoff-container .body-content--right .property-container{display:block;margin-top:15px;height:50%;min-width:300px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/project/quantity-takeoff/quantity-takeoff.scss\"],\"names\":[],\"mappings\":\"AAGI,6CACI,+BAAA,CAEJ,0CAGI,+BAAA,CACA,UAAA,CACA,kBAAA,CACA,UAAA,CACA,YAAA,CANN,yDAAA,YAAA,CAOM,gDACI,iBAAA,CACA,oBAAA,CACA,WAAA,CACA,SAAA,CACA,+BAAA,CACA,4BAAA,CACA,eAAA,CACA,4BAAA,CACA,yDACI,UAAA,CACA,WAAA,CAEA,mEACI,UAAA,CACA,eAAA,CACA,WAAA,CACA,YAAA,CACA,kBAAA,CACA,gFACI,iBAAA,CAGJ,sEACI,QAAA,CAGJ,6FAEI,kBAAA,CACA,sHACI,+BAAA,CACA,WAAA,CAEJ,0GACI,eAAA,CACA,eAAA,CAGA,sBAAA,CAEA,kBAAA,CACA,4BAAA,CACA,yBAAA,CAEJ,kHACI,gBAAA,CACA,cAAA,CAGR,0FACI,iBAAA,CACA,QAAA,CACA,SAAA,CAEJ,iFACI,iBAAA,CACA,QAAA,CAEJ,qFACI,iBAAA,CACA,QAAA,CAClB,UAAA,CAIU,6IACI,aAAA,CACA,UAAA,CACA,wBAAA,CACA,aAAA,CAKZ,yEACI,qBAAA,CAGJ,oEACI,iBAAA,CAGJ,4EACI,iBAAA,CACA,YAAA,CACA,sBAAA,CACA,OAAA,CACA,0BAAA,CACA,yBAAA,CACA,WAAA,CACA,yBAAA,CAGJ,iDACI,iBAAA,CACA,oBAAA,CACA,gBAAA,CACA,8BAAA,CACA,2BAAA,CACA,WAAA,CACA,SAAA,CACA,eAAA,CACA,4EACI,WAAA,CACA,UAAA,CAEJ,8DACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,kBAAA,CAEJ,qEACI,aAAA,CACA,eAAA,CACA,UAAA,CACA,eAAA\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Module\nvar code = ` `;\n// Exports\nexport default code;","import { ProjectDto } from \"app/models/project-dto\";\r\nimport { AppContextService } from \"app/services/app-context-service\";\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { EventAggregator, Subscription } from \"aurelia-event-aggregator\";\r\nimport { TypeDto, TypeDtoWCategory } from \"app/components/quantity-filter-sources/quantity-filter-sources\";\r\nimport { ApiClient } from \"app/services/api-client\";\r\nimport { SplitHandler } from \"./split-handler\";\r\nimport { QuantitySourcesService } from \"app/services/quantity-sources-service\";\r\nimport { QuantityFilterDto } from \"../quantity-views/quantity-filters\";\r\nimport { QuantityTakeoffService } from \"app/services/quantity-takeoff-service\";\r\nimport { ModalService } from \"app/services/modal-service\";\r\nimport { QuantityFilterCreatePrompt } from \"../quantity-views/quantityfilter-create-prompt\";\r\nimport { SourceMediator } from \"./source-mediator\";\r\nimport { DialogCloseResult } from \"aurelia-dialog\";\r\nimport { QuantityFilterEditPrompt } from \"../quantity-views/quantityfilter-edit-prompt\";\r\nimport { DuplicateQuantityFilter } from \"app/components/duplicate-quantity-filter/duplicate-quantity-filter\";\r\nimport { ContextMenuService } from \"app/services/context-menu-service\";\r\nimport { I18N } from \"aurelia-i18n\";\r\nimport { QtoExportService } from \"app/services/qto-export-service\";\r\nimport { UpdateSourcesDialog } from \"./update-sources-dialog/update-sources-dialog\";\r\nimport {ProjectTokenService} from \"../../services/project-token-service\";\r\nimport {NavigationInstruction, Redirect, RouteConfig} from \"aurelia-router\";\r\nimport {verifyAccessOrRedirect} from \"../access-denied-page/access-redirecter\";\r\n\r\n\r\n@autoinject\r\nexport class QuantityTakeoff {\r\n curProject: ProjectDto | undefined;\r\n isViewerLoaded: boolean = false;\r\n isSettingsVisible: boolean = false;\r\n private subscriptions: Subscription[] = [];\r\n private quantityFilters: QuantityFilterDto[] = [];\r\n private isViewerModeLoaded: boolean = false;\r\n private isViewerVisible: boolean = false;\r\n private isPivotGridVisible: boolean = true;\r\n private shouldRoundNumbers: boolean = false;\r\n\tprivate useFunction: boolean = false;\r\n\tprivate showIfcIDs: boolean = false;\r\n\t//\r\n\tprivate sigmapub_class:string=''; // used to hide the sigma-publish feature, per customer.\r\n\r\n constructor(private api: ApiClient, public appContext: AppContextService, private events: EventAggregator,\r\n private splitHandler: SplitHandler, private qsService: QuantitySourcesService,\r\n private qtService: QuantityTakeoffService, private modal: ModalService, public sMediator: SourceMediator,\r\n private contextMenuService: ContextMenuService, private i18n: I18N,\r\n private qtoExportService: QtoExportService, private projectTokenService: ProjectTokenService) {}\r\n\r\n async activate(params: any): Promise {\r\n if (params.projectId) {\r\n this.appContext.setProject(params.projectId);//in-activate.\r\n\t\t\tawait this.projectTokenService.updatePrjTokenIfNeeded(params.projectId, this.api)\r\n this.curProject = this.appContext.getSelectedProject();//in-activate.\r\n }\r\n\t\tthis.sigmapub_class = (this.appContext.currentUser?.organization.sigma ? '' : 'hide_sigmapub' );\r\n this.setupSubscriptions();\r\n await this.refreshQuantityFilters();\r\n }\r\n async refreshQuantityFilters(isNewCreated?: boolean): Promise {\r\n let currentOldFilters = [...this.quantityFilters.map(type => type.id)];\r\n this.quantityFilters = [];\r\n\t\tconsole.log('..GetQuantityFiltersForProject.begin ');\r\n\t\tthis.quantityFilters = await this.qtService.GetQuantityFilters();\r\n\t\tconsole.log('..GetQuantityFiltersForProject.end, isNewCreated?',isNewCreated);\r\n if (isNewCreated == true) {\r\n await this.setSelectedQF(this.quantityFilters.filter(type => !currentOldFilters.includes(type.id))[0])\r\n } else {\r\n\t\t\tconst DEFAULT_FILTER_NAME = 'Default_QTO_Filter'; // Also in C:\\dev\\aoc\\AO.Command.App\\Services\\Ifc\\IfcOneShotImportCommands.cs\r\n\t\t\tconst anyDefault = this.quantityFilters.filter(F => F.name == DEFAULT_FILTER_NAME);\r\n\t\t\tif (anyDefault.length > 0) {\r\n\t\t\t\tawait this.setSelectedQF(anyDefault[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n }\r\n\r\n attached(): void {\r\n this.splitHandler.setupMainSplitter();\r\n }\r\n\r\n\tasync canActivate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction) {\r\n\t\treturn await verifyAccessOrRedirect(params, this.projectTokenService, this.api);\r\n\t}\r\n\r\n\tsetupSubscriptions(): void {\r\n this.subscriptions = [\r\n this.events.subscribe('ViewerMenu:ChangeIsSettingsVisible', () => {\r\n this.isSettingsVisible = false;\r\n }),\r\n this.events.subscribe('quantity-takeoff:add-found-types', (objectIds: number[]) => { this.addTypesToFilter(objectIds) }),\r\n this.events.subscribe('quantity-takeoff:open-source-dialog', (objectIds: number[]) => { this.openSourceDialog(objectIds) }),\r\n this.events.subscribe(\"project-selector:project-changed\", () => this.reload()),\r\n this.events.subscribe('takeoff-switch-right-view', () => { this.switchIsViewerMode()}),\r\n this.events.subscribe('takeoff-show-in-search', (objectIds: number[]) => { this.showInSearchMode(objectIds)}),\r\n ]\r\n }\r\n\r\n reload(): void {\r\n this.events.publish('viewer-settings:reload');\r\n this.curProject = this.appContext.getSelectedProject(); \r\n this.sMediator.resetSelectionAndFilter();\r\n this.isSettingsVisible = false;\r\n this.isPivotGridVisible = true;\r\n }\r\n\r\n async deactivate(): Promise {\r\n this.subscriptions.forEach((subscription: Subscription) => subscription.dispose());\r\n this.sMediator.resetSelectionAndFilter();\r\n }\r\n\r\n async switchSettingsVisibility(): Promise {\r\n this.isViewerLoaded = true;\r\n this.isSettingsVisible = !this.isSettingsVisible;\r\n }\r\n\r\n async addTypesToFilter(objectIds: number[]) { // UB: event quantity-takeoff:add-found-types\r\n\t\tconsole.log('QuantityTakeoff.addTypesToFilter', objectIds.length, objectIds);\r\n if (this.sMediator.selectedQF == undefined) {\r\n this.modal.OpenMessage('No filter selected','Please select a filter to update it.');\r\n } else {\r\n\t\t\tconsole.log('QuantityTakeoff.GetTypesByEntityLabels,B, with: (#) objectIds:', objectIds.length, objectIds);\r\n let typesToAdd: string[] = (await this.qtService.GetTypesByEntityLabels(objectIds)).map(t => t.id);\r\n console.log\r\n if (typesToAdd.length == 0 || typesToAdd == undefined) {\r\n return;\r\n }\r\n let response = await this.sMediator.qsService.addSources(this.sMediator.selectedQF.id, typesToAdd);\r\n if (response.statusCode == 200) {\r\n this.events.publish('pivot-grid-component:update-grid');\r\n this.events.publish('type-overview:update-grid');\r\n }\r\n }\r\n }\r\n\r\n async openSourceDialog(objectIds: number[]): Promise {\r\n let result: DialogCloseResult = await this.modal.OpenModal(UpdateSourcesDialog, {selectedSources: objectIds, selectedQF:this.sMediator.selectedQF}).whenClosed();\r\n if (result.wasCancelled == false) {\r\n if (result.output == this.sMediator.selectedQF) {\r\n this.events.publish('pivot-grid-component:update-grid');\r\n this.events.publish('type-overview:update-grid');\r\n }\r\n }\r\n }\r\n \r\n //currently not used, but could be a starting point for what the next version of the quantity-grid should be.\r\n async colorTypes(): Promise {\r\n if (this.sMediator.selectedQF?.id != undefined) {\r\n let types: TypeDto[] = await this.qsService.getSelectedTypes(this.sMediator.selectedQF?.id,'colorTypes', false);\r\n let instanceIds: number[] = []\r\n for (let type of types) {\r\n instanceIds.push(...await this.qsService.GetInstancesByTypeId(type.id))\r\n }\r\n console.log(\"instanceIds \" , instanceIds);\r\n this.events.publish('3dViewer:colorInstancesOfTypes', instanceIds);\r\n }\r\n }\r\n \r\n resetColors(): void {\r\n this.events.publish('3dViewer:reset-colors');\r\n }\r\n \r\n\r\n async setSelectedQF(qf: QuantityFilterDto): Promise {\r\n\t\tconsole.log('TEMP-QT-setSelectedQF');\r\n\r\n if (this.sMediator.selectedQF && this.sMediator.isBasketAndOriginalDifferent) {\r\n let result: DialogCloseResult = await this.modal.OpenConfirm(\"Unsaved Changes\", \r\n\t\t\t\t'You have unsaved changes on this filter. Are you sure you want to switch filter and loose the changes?'\r\n\t\t\t).whenClosed();\t\t\r\n if (result.wasCancelled) {\r\n return;\r\n }\r\n }\r\n this.sMediator.setSelectedQF(qf,false);\r\n }\r\n\r\n async deleteQF(event: Event, qf: QuantityFilterDto): Promise {\r\n event.stopPropagation();\r\n document.getElementById('delete-filter')?.blur();\r\n\t\tlet result:DialogCloseResult = await this.modal.OpenConfirm(\"Delete\", 'Please confirm that you want to delete the selected quantity filter.').whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n\r\n await this.qtService.DeleteQF(qf); \r\n this.refreshQuantityFilters();\r\n let selectedFilterDeleted: boolean = this.sMediator.handleDeletedQF(qf);\r\n if (selectedFilterDeleted) {\r\n this.isPivotGridVisible = true;\r\n }\r\n }\r\n\r\n async editQF(event: Event, qf: QuantityFilterDto): Promise {\r\n event.stopPropagation();\r\n\t\tlet result:DialogCloseResult = await this.modal.OpenModal(QuantityFilterEditPrompt, qf).whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n this.events.publish('pivot-grid-component:update-grid');\r\n this.refreshQuantityFilters();\r\n }\r\n\r\n async duplicateQF(event: Event, qf: QuantityFilterDto): Promise {\r\n event.stopPropagation();\r\n\t\tlet result:DialogCloseResult = await this.modal.OpenModal(DuplicateQuantityFilter, qf.id).whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n\r\n this.refreshQuantityFilters(true);\r\n }\r\n\r\n async addNewFilter(): Promise {\r\n\t\tconsole.log('QuantityTakeoff.addNewFilter calls QuantityFilterCreatePrompt');\r\n await this.modal.OpenModal(QuantityFilterCreatePrompt).whenClosed(result => {\r\n if (result.wasCancelled != true) {\r\n\t\t\t\tconsole.log('addNewFilter then calling QuantityTakeoff.refreshQuantityFilters:');\r\n this.refreshQuantityFilters(true);\r\n }\r\n });\r\n }\r\n\r\n\r\n async switchIsViewerMode(): Promise {\r\n this.isViewerLoaded = true;\r\n this.isViewerVisible = !this.isViewerVisible;\r\n if (this.isViewerVisible == false) {\r\n //Changes could have been made to the filter in viewer mode, so the filter is reloaded.\r\n await this.sMediator.setSelectedQF(this.sMediator.selectedQF, false);\r\n await this.sMediator.newSearchForTypes({typeInput: \"\", catInput: \"\", famInput: \"\"}, 0, 'switchIsViewerMode',false);\r\n await this.sMediator.scrollSearchForTypes({typeInput: \"\", catInput: \"\", famInput: \"\"}, 1);\r\n } else {\r\n setTimeout(() => { //Making sure viewers are not being in a 'wierd' state.\r\n window.dispatchEvent(new Event('resize'));\r\n }, 0);\r\n }\r\n }\r\n\r\n async showInSearchMode(objectIds: number[]): Promise {\r\n let typesToShow: TypeDtoWCategory[] = (await this.qtService.GetTypesWCategoriesByEntityLabels(objectIds));\r\n this.sMediator.setLoadedTypes(typesToShow,'QT.showInSearchMode'); // loadedTypes = \r\n\r\n if (this.sMediator.selectedQF != undefined) {\r\n this.sMediator.setSelectedQF(this.sMediator.selectedQF,false);\r\n }\r\n this.isViewerLoaded = true;\r\n this.isViewerVisible = false; //Can only be clicked from viewer.\r\n\r\n\r\n }\r\n\r\n showMenu(event: Event): void {\r\n let isQFUndefined: boolean = this.sMediator.selectedQF == undefined;\r\n let actions: any[] = [\r\n { viewKey: \"button\", setup: { textKey: \"Export grid to excel\", icon:\"fa-solid fa-file-excel\", isDisabled: isQFUndefined, actionKey: \"exportGridToExcel\", service: {exportGridToExcel: () => { this.directToExcel(); }}}},\r\n { viewKey: \"button\", setup: { textKey: \"Export to Excel pivot\", icon:\"fa-solid fa-table-pivot\", isDisabled: isQFUndefined, actionKey: \"exportPivotToExcel\", service: {exportPivotToExcel: () => { this.toExcelPivot(); }}}},\r\n ];\r\n this.contextMenuService.open(event,actions,\"left-start\");\r\n }\r\n \r\n async directToExcel(): Promise {\r\n\t\tawait this.qtoExportService.exportToExcel();\r\n\t}\r\n\r\n async toExcelPivot(): Promise {\r\n\t\tawait this.qtoExportService.exportToExcelPivot();\r\n\t}\r\n\r\n async switchVisibility(): Promise {\r\n this.isPivotGridVisible = !this.isPivotGridVisible;\r\n }\r\n\t\r\n\tasync publishRevision(): Promise {\r\n\t\t// Could ask if the user wants to publish even though no data is present in the grid.\r\n\t\t\r\n\t\tlet result: DialogCloseResult = await this.modal.OpenConfirm(\"Publish Revision\", \r\n\t\t\t'Please confirm that you want to save the current data as a revision.'\r\n\t\t).whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n\t\t\r\n\t\tawait this.api.project(this.appContext.projectId)\r\n\t\t\t.postText('QuantityFilter/PublishNewRevision/' + this.sMediator.selectedQF?.id, '')\r\n\t\t\t.handleError(\"Error publishing revision\", \"Could not publish revision\")\r\n\t\t\t.response();\r\n\t}\r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","QuantityTakeoff","constructor","api","appContext","events","splitHandler","qsService","qtService","modal","sMediator","contextMenuService","i18n","qtoExportService","projectTokenService","isViewerLoaded","isSettingsVisible","subscriptions","quantityFilters","isViewerModeLoaded","isViewerVisible","isPivotGridVisible","shouldRoundNumbers","useFunction","showIfcIDs","sigmapub_class","activate","params","projectId","this","setProject","updatePrjTokenIfNeeded","curProject","getSelectedProject","currentUser","organization","sigma","setupSubscriptions","refreshQuantityFilters","isNewCreated","currentOldFilters","map","type","console","log","GetQuantityFilters","setSelectedQF","filter","includes","DEFAULT_FILTER_NAME","anyDefault","F","name","length","attached","setupMainSplitter","canActivate","routeConfig","navigationInstruction","subscribe","objectIds","addTypesToFilter","openSourceDialog","reload","switchIsViewerMode","showInSearchMode","publish","resetSelectionAndFilter","deactivate","forEach","subscription","dispose","switchSettingsVisibility","undefined","selectedQF","OpenMessage","typesToAdd","GetTypesByEntityLabels","t","addSources","statusCode","result","OpenModal","selectedSources","whenClosed","wasCancelled","output","colorTypes","types","getSelectedTypes","instanceIds","GetInstancesByTypeId","resetColors","qf","isBasketAndOriginalDifferent","OpenConfirm","deleteQF","event","stopPropagation","document","getElementById","blur","DeleteQF","handleDeletedQF","editQF","duplicateQF","addNewFilter","newSearchForTypes","typeInput","catInput","famInput","scrollSearchForTypes","setTimeout","window","dispatchEvent","Event","typesToShow","GetTypesWCategoriesByEntityLabels","setLoadedTypes","showMenu","isQFUndefined","actions","viewKey","setup","textKey","icon","isDisabled","actionKey","service","exportGridToExcel","directToExcel","exportPivotToExcel","toExcelPivot","open","exportToExcel","exportToExcelPivot","switchVisibility","publishRevision","project","postText","handleError","response","autoinject","EventAggregator","I18N"],"sourceRoot":""}