1"use strict";(self.webpackChunkwebpack=self.webpackChunkwebpack||[]).push([[8371],{72717:function(e,t,n){var i=n(42799),s=n(79234);class r extends i.o{constructor(e,t){super(e),this.init(),this.type=t}init(){}static getInstance(e){if(!r.instance[e]){let t=document.querySelector("[data-component-class='FavoritesManager']");r.instance[e]=t?new r(t,e):null}return r.instance[e]}addFavorite(e,t){const n=this.parm.addFavoriteUrl+"?ts="+(new Date).getTime();let i={id:e,type:this.type},r=new s.o(n,i,!1);this.ajaxWrapper.doFetch(r).then((e=>t(e)))}addFavorites(e,t){const n=this.parm.addFavoritesUrl+"?ts="+(new Date).getTime();let i={ids:e,type:this.type},r=new s.o(n,i,!1);this.ajaxWrapper.doFetch(r).then((e=>t(e)))}deleteFavorite(e,t){const n=this.parm.deleteFavoriteUrl+"?ts="+(new Date).getTime();let i={id:e,type:this.type},r=new s.o(n,i,!1);this.ajaxWrapper.doFetch(r).then((e=>t(e)))}deleteFavorites(e,t){const n=this.parm.deleteFavoritesUrl+"?ts="+(new Date).getTime();let i={ids:e,type:this.type},r=new s.o(n,i,!1);this.ajaxWrapper.doFetch(r).then((e=>t(e)))}listFavorites(e){const t=this.parm.listFavoritesUrl+"?ts="+(new Date).getTime();let n={type:this.type},i=new s.o(t,n,!1);this.ajaxWrapper.doFetch(i).then((t=>e(t)))}}r.instance=[],t.Z=r},10886:function(e,t,n){n.d(t,{C_:function(){return l},Fi:function(){return d},OP:function(){return o},cn:function(){return c},er:function(){return a},go:function(){return i},iF:function(){return r},us:function(){return u}});class i{constructor(e,t){this.dataSheet=e,this.fileName=t}}class s{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;this.watermarkFormId=n,this.skipAuthentication=e,this.skipWatermarking=t,this.watermarkFormSubmissionId=i,this.eventCategory=s}}class r extends s{constructor(e,t,n){super(t,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,arguments.length>5&&void 0!==arguments[5]?arguments[5]:null),this.packageId=e}}class o extends s{constructor(e,t,n,i,s,r){let o=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null,a=arguments.length>10&&void 0!==arguments[10]?arguments[10]:null;super(s,r,arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,arguments.length>7&&void 0!==arguments[7]?arguments[7]:null),this.documentList=e,this.entityName=i,this.dataSheetInfos=n,this.documentPacks=t,this.encodedPreFilledWatermarkLines=o,this.eventCategory=l,this.customDocumentList=a}}class l{constructor(e,t){this.documentPackRequest=e,this.authDeniedCallback=t}}class a{}a.documentPackageDownloadRequested="DOWNLOAD_DOCUMENT_PACKAGE_REQUESTED",a.documentPackageDownloadRequestHandled="DOWNLOAD_DOCUMENT_PACKAGE_REQUEST_HANDLED",a.documentPackageCreationRequested="DOWNLOAD_DOCUMENT_PACKAGE_CREATION",a.documentPackageCreationRequestedHandled="DOWNLOAD_DOCUMENT_PACKAGE_CREATION_HANDLED",a.authenticationRequested="DOWNLOAD_DOCUMENT_AUTHENTICATION_REQUESTED",a.emptyResultReceived="DOWNLOAD_EMPTY_RESULT",a.watermarkingInputRequested="DOWNLOAD_DOCUMENT_WATERMARKING_INPUT_REQUESTED",a.watermarkingSingleDocumentInputRequested="DOWNLOAD_SINGLE_DOCUMENT_WATERMARKING_INPUT_REQUESTED",a.downloadLimitationReached="DOWNLOAD_LIMITATION_REACHED",a.failedRequest="DOWNLOAD_CENTER_FAILED_REQUEST",a.exportJobRequested="EXPORT_JOB_REQUESTED",a.createPdfDocumentRequested="DOWNLOAD_CREATE_PDF_REQUESTED",a.createPdfDocumentRequestHandled="DOWNLOAD_CREATE_PDF_REQUEST_HANDLED";class c{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{};this.formCompleted=n,this.skipWatermarkingCallback=i,this.popupUrl=e,this.documentPackRequest=t}}class d{constructor(e,t){this.popupUrl=e,this.assetId=t}}class u{constructor(e,t){this.job=e,this.toasterElement=t}}},75778:function(e,t,n){n.d(t,{E1:function(){return s},GS:function(){return i},Rn:function(){return r}});class i{constructor(e,t,n,i){this.externalProductId=e,this.title=t,this.shortDescription=n,this.vendor=i}}class s{constructor(e){this.externalProductId=e}}class r{}r.editRequested="editRequested",r.manageDocumentsRequested="manageDocuments"},78371:function(e,t,n){n.r(t),n.d(t,{default:function(){return O}});var i=n(17873),s=n(79234),r=n(70392),o=n.n(r),l=n(66497),a=n(83340),c=n(83491),d=n(72717),u=n(75778),h=n(94994),m=n(10886),p="[data-js='external-products-results']",v=".js-table-choice-
1all",y=".js-table-choice",S="[data-js='action-remove-from-project']",g="[data-js='action-edit']",E="[data-js='action-download']",D="[data-js='action-manage-documents']",f="data-external-product-id",U="data-external-product-name",R="[data-js='multi-select-toaster-container']",T="[data-component-class='MultiSelectToaster']",C=".js-list-container",A=".js-empty-result";class O extends i.${constructor(e){super(e),this.userSelection=[],this.totalCount=0,this.init()}init(){this.emptyResultContainer=this.element.querySelector(A),this.listContainer=this.element.querySelector(C),this.loadLister(),this.initFavorites(),o().subscribe(l.m.entityRemoved,(()=>{this.loadLister()})),o().subscribe(l.m.entityUnselected,((e,t)=>{let n=t;if("externalProduct"===n.entityType){if(!this.isSelected(n.entityId))return;this.removeFromUserSelection(n.entityId),this.renderUserSelection()}})),o().subscribe(l.m.externalProductCreatedOrUpdated,(()=>{this.loadLister()})),document.addEventListener("click",(e=>{var t=e.target,n=t.closest(S);if(n){const e=n.dataset.entityid;this.parm.currentEntityId?this.singleRemoveFromProject(e):this.singleRemoveFavorite(e)}else{var i=t.closest(g);if(i){const e=i.dataset.entityid,t=i.dataset.title,n=i.dataset.shortdescription,s=i.dataset.vendor,r=new u.GS(e,t,n,s);o().publish(u.Rn.editRequested,r)}else{var s=t.closest(E);if(s){const e=s.dataset.documents.split(","),t=s.dataset.title,n=new m.OP(null,null,null,t,!0,!0,null,null,null,null,e);o().publish(m.er.documentPackageCreationRequested,n)}else{var r=t.closest(D);if(r){const e=r.dataset.entityid,t=new u.E1(e);o().publish(u.Rn.manageDocumentsRequested,t)}else;}}}})),o().subscribe(h.Y.userSelectionCancelled,((e,t)=>{this.clearUserSelection(),this.renderUserSelection()}))}bindToggleSelectAll(){let e=this.element.querySelector(v);e&&e.addEventListener("click",(()=>{e.checked?this.element.querySelectorAll(y).forEach((e=>{let t=e.getAttribute(f);this.isSelected(t)||this.addToUserSelection(t,!0)})):this.clearUserSelection(!0),this.renderUserSelection()}))}bindSingleSelection(){this.element.querySelectorAll(y).forEach((e=>{let t=e;t.addEventListener("click",(()=>{let e=t.getAttribute(f);this.isSelected(e)?this.removeFromUserSelection(e,!0):this.addToUserSelection(e,!0),this.renderUserSelection()}))}))}initFavorites(){if(!this.element.querySelector(T)){var e={entityType:this.parm.entityType},t=this.element.querySelector(R);this.reInitCompsOnDomChangeFor(t,!0);var n=new s.o(this.parm.dialogsUrl,e,!1);this.ajaxWrapper.doFetch(n).then((e=>{e.clone().text().then((e=>{t.innerHTML=e}))}))}}loadLister(){var e=this.parm.listUrl+"&ts="+(new Date).getTime(),t=new s.o(e,null,!1);null!==this.parm.currentEntityId&&(t.headers={"x-current-entity-id":this.parm.currentEntityId});let n=this.element.querySelector(p);n&&this.reInitCompsOnDomChangeFor(n,!0),this.ajaxWrapper.doFetch(t).then((e=>{e.clone().text().then((e=>{let t=new c.E(e),i=t.getComponentUpdate("list").json,s=!1;i.totalCount<=0?(this.emptyResultContainer.classList.remove("u-hidden"),this.listContainer.classList.add("u-hidden"),this.totalCount=0):n&&(s=!0,n.outerHTML=t.getComponentUpdate("list").content,a.Z.initializeActionMenu(this.element),this.bindListEvents(),this.emptyResultContainer.classList.add("u-hidden"),this.listContainer.classList.remove("u-hidden"),this.totalCount=i.totalCount,this.renderUserSelection());let r=document.querySelectorAll("#footer-continue-button-step1"),o=document.querySelector("#footer-has-product-selected");o&&o.value&&"true"===o.value||s?r.forEach((e=>e.removeAttribute("disabled"))):r.forEach((e=>e.setAttribute("disabled","true")))}))}))}singleRemoveFavorite(e){d.Z.getInstance(this.parm.entityType).deleteFavorite(e,(()=>{this.isSelected(e)&&this.removeFromUserSelection(e,!0),o().publish(l.m.entityRemoved)}))}singleRemoveFromProject(e){let t={identifier:this.parm.currentEntityId,entityType:this.parm.entityType,externalIdentifiers:[]};t.externalIdentifiers.push(e);var n=new s.o("/api/reporter-app/fireprotectionproject/unlinkentities",t,!1);this.ajaxWrapper.doFetch(n).then((()=>{this.isSelected(e)&&this.removeFromUserSelection(e,!0),o().publish(l.m.entityRemoved)}))}bindListEvents(){this.bindToggleSelectAll(),this.bindSingleSelection()}getProductSelectionEventData(e){var t=new l.Q(e,this.parm.entityType),n=this.element.querySelector(`${y}[${f}='${e}']`);if(n){let e=n.getAttribute(U);t.entityName=e}return t}addToUserSelection(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.userSelection.includes(e)&&(this.userSelection.push(e),t)){var n=this.getProductSelectionEventData(e);o().publish(h.Y.entitySelected,n)}}removeFromUserSelection(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.userSelection.includes(e)&&(this.userSelection=this.userSelection.filter((t=>e!==t)),t)){var n=this.getProductSelectionEventData(e);o().publish(h.Y.entityUnselected,n)}}clearUserSelection(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.userSelection.forEach((t=>{this.removeFromUserSelection(t,e)}))}isSelected(e){return this.userSelection.includes(e)}
1renderUserSelection(){this.element.querySelectorAll(y).forEach((e=>{let t=e,n=t.getAttribute(f);this.isSelected(n)?t.checked=!0:t.checked=!1}));let e=this.element.querySelector(v);this.totalCount>0&&this.totalCount===this.userSelection.length?e.checked=!0:e.checked=!1}}},66497:function(e,t,n){n.d(t,{Q:function(){return i},m:function(){return s}});class i{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.entityId=e,this.entityType=t,this.entityName=n,this.entityImgUrl=i,this.entityUrl=s}}class s{}s.entitySelected="entity-selected",s.entityUnselected="entity-unselected",s.favoritesBulkDeleted="favorites-bulk-delete",s.favoritesChangedFromDialog="favoritesChangedFromDialog",s.entityRemoved="entityRemoved",s.externalProductCreatedOrUpdated="externalProductCreatedOrUpdated"},94994:function(e,t,n){n.d(t,{Q:function(){return i},Y:function(){return s}});class i{constructor(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.entityId=e,this.entityName=t,this.entityType=n,this.entityImgUrl=i,this.entityUrl=s}}class s{}s.entitySelected="entity-selected",s.entityUnselected="entity-unselected",s.removeSelectedEntity="entity-remove-selected",s.userSelectionCancelled="user-selection-cancelled",s.userSelectionRestored="user-selection-restored",s.userSelectionRestoredFullItems="user-initial-restored"},83491:function(e,t,n){n.d(t,{E:function(){return r}});var i=n(47277),s=n.n(i);class r{constructor(e){this.rawResponse=e,this.response=s()(e)}getComponentUpdate(e){var t=this.response.filter("[data-component="+e+"]");return t.length?{content:t.html().trim(),json:s().parseJSON(t.find("script[type='json']")[0].innerHTML)}:null}getChildComponentUpdate(e){var t=this.response.find("[data-component="+e+"]");return t.length?{content:t[0].innerHTML,json:s().parseJSON(this.response.find("script")[0].innerHTML)}:null}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.