1"use strict";(self.webpackChunkdspace_angular=self.webpackChunkdspace_angular||[]).push([[4204],{64204:(U,h,n)=>{n.r(h),n.d(h,{DsDynamicLookupRelationSearchTabComponent:()=>A});var e=n(94650),g=n(14292),u=n(36872),D=(n(33609),n(61135)),v=n(5164),E=n(51117),f=n(24702),_=n(95698),m=n(68285),O=n(8041),y=n(45715),C=n(77467),I=n(88002),b=(n(87917),n(36895)),x=n(30236),p=n(9769),T=n(98605),P=n(89383);function R(o,l){1&o&&(e.\u0275\u0275elementStart(0,"button",10),e.\u0275\u0275element(1,"span",11),e.\u0275\u0275elementStart(2,"span",8),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()()),2&o&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,1,"submission.sections.describe.relationship-lookup.search-tab.loading")))}function S(o,l){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",12)(1,"button",13),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).ngVar,a=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(a.selectPage(null==r?null:r.page))}),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",13),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).ngVar,a=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(a.deselectPage(null==r?null:r.page))}),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd()()}2&o&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,2,"submission.sections.describe.relationship-lookup.search-tab.select-page")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(6,4,"submission.sections.describe.relationship-lookup.search-tab.deselect-page")))}function M(o,l){if(1&o&&(e.\u0275\u0275elementStart(0,"div",3)(1,"div",4)(2,"div",5),e.\u0275\u0275template(3,R,5,3,"button",6),e.\u0275\u0275elementStart(4,"button",7)(5,"span",8),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(8,S,7,6,"div",9),e.\u0275\u0275pipe(9,"async"),e.\u0275\u0275elementEnd()()()),2&o){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.selectAllLoading),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",t.selectAllLoading),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(7,4,"submission.sections.describe.relationship-lookup.toggle-dropdown")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngVar",e.\u0275\u0275pipeBind1(9,6,t.resultsRD$))}}const L=function(o,l){return{repeatable:o,listId:l}};function j(o,l){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ds-themed-search",1),e.\u0275\u0275listener("resultFound",function(s){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.onResultFound(s))})("deselectObject",function(s){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.deselectObject.emit(s))})("selectObject",function(s){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.selectObject.emit(s))}),e.\u0275\u0275template(1,M,10,8,"div",2),e.\u0275\u0275elementEnd()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("configuration",t.relationship.searchConfiguration)("context",t.context)("fixedFilterQuery",t.relationship.filter)("hiddenQuery",t.hiddenQuery)("inPlaceSearch",!0)("linkType",t.linkTypes.ExternalLink)("searchFormPlaceholder","submission.sections.describe.relationship-lookup.search-tab.search-form.placeholder")("selectable",!0)("selectionConfig",e.\u0275\u0275pureFunction2(13,L,t.repeatable,t.listId))("showScopeSelector",!1)("showViewModes",!1)("query",t.query),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.repeatable)}}let A=(()=>{class o{constructor(t,i,s,r,a,c){this.searchService=t,this.selectableListService=i,this.searchConfigService=s,this.lookupRelationService=r,this.relationshipService=a,this.paginationService=c,this.deselectObject=ne
1w e.EventEmitter,this.selectObject=new e.EventEmitter,this.resultsRD$=new D.X(null),this.initialPagination={page:1,pageSize:5},this.linkTypes=O.m,this.resultFound=new e.EventEmitter}ngOnInit(){this.resetRoute()}resetRoute(){this.paginationService.updateRoute(this.searchConfigService.paginationID,this.initialPagination)}selectPage(t){this.selection$.pipe((0,_.q)(1)).subscribe(i=>{const s=t.filter(r=>i.findIndex(a=>a.equals(r))<0);this.selectObject.emit(...s)}),this.selectableListService.select(this.listId,t)}deselectPage(t){this.allSelected=!1,this.selection$.pipe((0,_.q)(1)).subscribe(i=>{const s=t.filter(r=>i.findIndex(a=>a.equals(r))>=0);this.deselectObject.emit(...s)}),this.selectableListService.deselect(this.listId,t)}setSelectedIds(t,i){let s=this.relationshipType.rightwardType;this.isLeft&&(s=this.relationshipType.leftwardType),this.relationshipService.searchByItemsAndType(this.relationshipType.id,this.item.uuid,s,t).pipe((0,m.xw)(),(0,m.xe)()).subscribe(r=>{let a=r.page.map(c=>{let d=[];return d=this.isLeft?c._links.rightItem.href.split("/"):c._links.leftItem.href.split("/"),this.getRelatedItem(d[d.length-1],i)});a=a.filter(c=>!this.getIfInRemove(c.indexableObject.uuid)),a.length>0&&this.selectableListService.select(this.listId,a)})}deselectAll(){this.allSelected=!1,this.selection$.pipe((0,_.q)(1)).subscribe(t=>this.deselectObject.emit(...t)),this.selectableListService.deselectAll(this.listId)}getRelatedItem(t,i){return i.find(s=>s.indexableObject.uuid===t)}getIfInRemove(t){return!!this.toRemove.find(i=>i.indexableObject.uuid===t)}ngOnDestroy(){(0,f.Uh)(this.subscription)&&this.subscription.unsubscribe()}onResultFound(t){if(this.resultsRD$.next(t),this.resultFound.emit(t),this.isEditRelationship){const i=t.page.map(s=>s.indexableObject.uuid);this.setSelectedIds(i,t.page)}}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(v.o),e.\u0275\u0275directiveInject(E.w),e.\u0275\u0275directiveInject(u.U),e.\u0275\u0275directiveInject(y.P),e.\u0275\u0275directiveInject(I.U),e.\u0275\u0275directiveInject(C.N))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["ds-dynamic-lookup-relation-search-tab"]],inputs:{relationship:"relationship",listId:"listId",query:"query",repeatable:"repeatable",selection$:"selection$",context:"context",relationshipType:"relationshipType",item:"item",isLeft:"isLeft",toRemove:"toRemove",isEditRelationship:"isEditRelationship",hiddenQuery:"hiddenQuery"},outputs:{deselectObject:"deselectObject",selectObject:"selectObject",resultFound:"resultFound"},features:[e.\u0275\u0275ProvidersFeature([{provide:g.SEARCH_CONFIG_SERVICE,useClass:u.U}])],decls:1,vars:1,consts:[[3,"configuration","context","fixedFilterQuery","hiddenQuery","inPlaceSearch","linkType","searchFormPlaceholder","selectable","selectionConfig","showScopeSelector","showViewModes","query","resultFound","deselectObject","selectObject",4,"ngIf"],[3,"configuration","context","fixedFilterQuery","hiddenQuery","inPlaceSearch","linkType","searchFormPlaceholder","selectable","selectionConfig","showScopeSelector","showViewModes","query","resultFound","deselectObject","selectObject"],["additionalSearchOptions","","class","position-absolute",4,"ngIf"],["additionalSearchOptions","",1,"position-absolute"],[1,"input-group","mb-3"],["ngbDropdown","",1,"input-group","dropdown-button"],["type","button","class","btn btn-outline-secondary rounded-right",4,"ngIf"],["id","resultdropdown","type","button","ngbDropdownToggle","","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle-split",3,"hidden"],[1,"sr-only"],["ngbDropdownMenu","","aria-labelledby","resultdropdown",4,"ngVar"],["type","button",1,"btn","btn-outline-secondary","rounded-right"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"],["ngbDropdownMenu","","aria-labelledby","resultdropdown"],[1,"dropdown-item",3,"click"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,j,2,16,"ds-themed-search",0),2&t&&e.\u0275\u0275property("ngIf",i.relationship.searchConfiguration&&i.context)},dependencies:[b.O5,x.l,p.jt,p.iD,p.Vi,T.g,b.Ov,P.X$],styles:[".position-absolute[_ngcontent-%COMP%]{right:var(--bs-spacer)}.dropdown-button[_ngcontent-%COMP%]{z-index:3}"]}),o})()}}]);
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.