@rero/sonar-ui
Version:
User interface for SONAR.
2 lines (1 loc) • 3.02 kB
JavaScript
import{a as M}from"./chunk-LUYCTK2V.js";import{Ba as a,G as y,Gb as D,Pa as p,Qa as v,Ra as u,V as C,X as o,Ze as L,_ as I,_b as B,aa as k,ac as E,ia as x,ja as m,jb as d,kb as c,oa as h,pa as s,qa as l,rb as S,tb as g}from"./chunk-OW4VQFLY.js";function U(e,i){if(e&1&&(s(0,"a",1),p(1),l()),e&2){let t=a(2);h("href",t.identifier().link,C)("title",t.externalLinkText),o(),v(t.identifier().value)}}function j(e,i){if(e&1&&(s(0,"a",1),p(1),l()),e&2){let t=a(3);h("href",t.identifier().value,C)("title",t.externalLinkText),o(),v(t.identifier().value)}}function w(e,i){if(e&1&&p(0),e&2){let t=a(3);u(" ",t.identifier().value," ")}}function z(e,i){if(e&1&&x(0,j,2,3,"a",1)(1,w,1,1),e&2){let t=a(2);m(t.identifier().value.startsWith("http")?0:1)}}function N(e,i){if(e&1&&(s(0,"p-tag",0),p(1),d(2,"translate"),d(3,"uppercase"),l(),x(4,U,2,3,"a",1)(5,z,2,1)),e&2){let t=a();o(),u(" ",c(3,4,t.identifier().source?t.identifier().source:c(2,2,t.identifier().type))," "),o(3),m(t.identifier().link?4:5)}}function P(e,i){if(e&1&&(s(0,"p-tag",0)(1,"a",3),p(2),d(3,"translate"),d(4,"uppercase"),l()()),e&2){let t=a(2);o(),h("title",t.externalLinkText)("href",t.identifier().link,C),o(),v(c(4,5,t.identifier().source?t.identifier().source:c(3,3,t.identifier().type)))}}function q(e,i){if(e&1&&(s(0,"p-tag",2),p(1),d(2,"translate"),d(3,"uppercase"),l()),e&2){let t=a(2);o(),u(" ",c(3,3,t.identifier().source?t.identifier().source:c(2,1,t.identifier().type))," ")}}function F(e,i){if(e&1&&x(0,P,5,7,"p-tag",0)(1,q,4,5,"p-tag",2),e&2){let t=a();m(t.identifier().link?0:1)}}function A(e,i){if(e&1&&p(0),e&2){let t=a();u(" ",t.identifier().value," ")}}var V=(()=>{let i=class i{constructor(){this.store=y(L),this.translateService=y(B),this.type=g.required(),this.data=g.required(),this.identifier=S(()=>this.processData())}get externalLinkText(){return this.translateService.instant("External link to the source")}processData(){var _,f;let r=(f=(_=this.store.settings())==null?void 0:_.document_identifier_link)!=null?f:{},n={field:this.type(),type:this.data().type,value:this.data().value};if(this.data().type in r){let T=this.data().source?this.data().source.toLowerCase():"default";n.source=this.data().source,T in r[this.data().type]&&(n.link=r[this.data().type][T].replace("_identifier_",this.data().value))}return n}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=I({type:i,selectors:[["sonar-record-identifier"]],inputs:{type:[1,"type"],data:[1,"data"]},decls:3,vars:1,consts:[["severity","secondary",1,"ui:mr-1"],["target","_blank",3,"href","title"],["severity","secondary"],[3,"title","href"]],template:function(n,_){if(n&1&&x(0,N,6,6)(1,F,2,1)(2,A,1,1),n&2){let f;m((f=_.identifier().field)==="identifiedBy"?0:f==="agent"?1:2)}},dependencies:[M,D,E],encapsulation:2,changeDetection:0});let e=i;return e})();var Y=(()=>{let i=class i{transform(r,...n){return r?(n[0]||(n[0]=", "),r.join(n[0])):""}};i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=k({name:"join",type:i,pure:!0});let e=i;return e})();export{V as a,Y as b};