import{d as Y,u as ie,b as Be,c as J,e as B,g as A,j as t,o,_ as ye,w as f,n as O,D as S,f as u,s as _e,t as V,bq as be,P as I,Q as z,h as ke,p as xe,l as Se,dK as ve,d$ as he,x as q,X as je,a1 as re,ao as ue,b4 as Ce,a6 as se,e0 as ne,bw as Ee,$ as me,a5 as Fe,bv as Oe,Y as Ne,a0 as De,V as Pe,cR as Je,e1 as Ae,bQ as we,dW as Ie,dX as Me,dy as He,W as We,e2 as Ke,e3 as Qe,c4 as Te,H as Ue,c5 as ze,c6 as Ge,bt as Xe,dV as Ye,c7 as Ze,e4 as qe,T as et,B as tt,e5 as st,e6 as nt,e7 as at,e8 as lt,e9 as fe,N as ot}from"./QlNHqkx-.js";const K={ej:{columnDBName:{ja:"データベース名",en:"Database name"},columnGenre:{ja:"ジャンル",en:"Genre"},columnDescription:{ja:"説明",en:"Description"},columnData:{ja:"データ",en:"Data"},columnUsage:{ja:"利用",en:"Usage"}}},ct={class:"ej-head is-hidden-mobile"},rt={class:"srej-block"},ut={class:"srej-block"},it={class:"srej-block"},_t={class:"srej-block"},pt={key:1},dt={class:"has-text-body-s has-text-sub"},ht={key:0,class:"has-text-body-s has-text-sub"},mt={class:"has-text-headline-s has-text-heading is-hidden-desktop"},ft={class:"has-text-headline-s has-text-heading is-hidden-desktop"},gt=Y({__name:"SearchResultJsonEJ",props:{ss:{},cs:{},getValue:{type:Function}},setup(e){const{$langLabel:s}=ie(),l=Be(),a=(r,C)=>d.getValue(r,C)?.[0]||"",i=r=>{const C=d.getValue(r,"library"),E=d.getValue(r,"pcflag"),F=l.$state.loc,v=l.$state.ejFlag?.split("")||[];return!(!he(C)&&!C.includes(F)||!he(E)&&v.every(_=>!E.includes(_)))},h=(r,C,E)=>{const F=d.cs.searchFields?.filter(_=>_.key===E)?.pop()?.options;return d.getValue(r,C).map(_=>F.filter(j=>j.key===_).pop()?.name).filter(_=>_).map(_=>s(_))},d=e,D=J(()=>d.ss.searchState.result);return(r,C)=>{const E=_e,F=be,v=xe,_=ke,j=ve,R=ye;return t(D)?(o(),B(R,{key:0,class:"search-result-ej"},{default:f(()=>[O("div",ct,[u(E,{gap:"40"},{default:f(()=>[O("p",null,V(t(s)(t(K).ej.columnDBName)),1),O("p",null,V(t(s)(t(K).ej.columnGenre)),1),O("p",null,V(t(s)(t(K).ej.columnDescription)),1)]),_:1}),O("div",rt,[u(F)]),O("div",ut,[O("p",null,V(t(s)(t(K).ej.columnData)),1)]),O("div",it,[u(F)]),O("div",_t,[O("p",null,V(t(s)(t(K).ej.columnUsage)),1)])]),(o(!0),S(I,null,z(t(D).list,p=>(o(),S("div",{key:a(p,"id"),class:"ej"},[u(_,{class:"ej-title",level:"3","visual-level":"headline"},{default:f(()=>[i(p)?(o(),B(v,{key:0,to:a(p,"url")},{default:f(()=>[Se(V(a(p,"title")),1)]),_:2},1032,["to"])):(o(),S("span",pt,V(a(p,"title")),1))]),_:2},1024),u(R,{class:"ej-desc has-text-body-s has-text-sub",gap:"8"},{default:f(()=>[O("span",null,V(h(p,"subject","genre").join(", "))+" - "+V(h(p,"subjectSub","genre").join(", ")),1),O("p",dt,[u(j,{md:a(p,"content")?.replaceAll(/\\n/g,` `)},null,8,["md"])]),i(p)?(o(),S("p",ht,[u(j,{md:a(p,"activeContent")?.replaceAll(/\\n/g,` `)},null,8,["md"])])):A("",!0)]),_:2},1024),u(R,{class:"ej-data srej-block has-text-body-s"},{default:f(()=>[O("span",mt,V(t(s)(t(K).ej.columnData)),1),(o(!0),S(I,null,z(h(p,"category","category"),L=>(o(),S("span",{key:L},V(L),1))),128))]),_:2},1024),u(R,{class:"ej-note srej-block has-text-body-s"},{default:f(()=>[O("span",ft,V(t(s)(t(K).ej.columnUsage)),1),(o(!0),S(I,null,z(e.getValue(p,"useNote"),L=>(o(),S("span",{key:L},V(L),1))),128))]),_:2},1024)]))),128))]),_:1})):A("",!0)}}}),yt=Object.assign(q(gt,[["__scopeId","data-v-11b8b6dd"]]),{__name:"SearchResultJsonEJ"}),bt={key:1},kt={key:0,class:"search-result-item-meta",gap:"8","flex-wrap":""},xt={key:0,class:"field-label has-text-headline-s has-text-heading"},St={key:1,class:"search-result-item-content"},vt=Y({__name:"SearchResultJsonEntry",props:{ss:{},cs:{},detailLink:{type:Boolean},detailAllOpen:{type:Boolean},layout:{},row:{},getValue:{type:Function}},setup(e){const{$langLabel:s}=ie(),l=e,{cs:a,ss:i}=je(l),h=F=>{const v=l.getValue(l.row,F);return v?v[0]:""},d=J(()=>l.ss.searchState.result),D=J(()=>l.layout==="page"?null:new RegExp(i.value.searchState.resultQuery?.keyword.join("|"))),r=re(!1);ue(d,()=>{r.value=!1});const C=J(()=>l.detailLink?`?cs=${a.value.id}&olid=${h("id")}`:h("url")?h("url"):null),E=F=>{if(!a.value.columns)return[];const v=[];return a.value.columns.forEach(_=>{const j=[];_.fields.forEach(R=>{if(_.type==="OPTIONS"){const p=a.value.searchFields?.filter(L=>L.key===_.codeKey)?.pop()?.options;p&&l.getValue(F,R)?.forEach(L=>{const T=p.filter(P=>P.key===L).pop();T&&j.push(s(T.name))})}else l.getValue(F,R)?.forEach(p=>{j.push(p)});j.length>0&&v.push({label:_.header,values:j})})}),v};return(F,v)=>{const _=_e,j=xe,R=ke,p=be,L=Ee,T=ve;return o(),S("div",{class:Ce(["search-result-json-entry","layout-"+e.layout])},[u(_,{class:"search-result-item-format","vertical-align":"top",gap:"8"}),u(_,{class:"search-result-item-heading",gap:"16"},{default:f(()=>[se((o(),B(R,{level:e.layout==="page"?1:3,"visual-level":e.layout==="page"?null:"headline"},{default:f(()=>[t(C)?(o(),B(j,{key:0,to:t(C)},{default:f(()=>[Se(V(h("title")),1)]),_:1},8,["to"])):(o(),S("span",bt,V(h("title")),1))]),_:1},8,["level","visual-level"])),[[t(ne),t(D)]])]),_:1}),t(a).columns?se((o(),S("div",kt,[(o(!0),S(I,null,z(E(e.row),(P,k)=>(o(),B(_,{key:k,gap:"16","vertical-align":"top"},{default:f(()=>[t(s)(P.label)?(o(),S("span",xt,V(t(s)(P.label)),1)):A("",!0),u(_,{gap:"8","flex-wrap":"",class:"has-text-body-s"},{default:f(()=>[(o(!0),S(I,null,z(P.values,(M,Z)=>(o(),S("span",{key:Z},V(M),1))),128))]),_:2},1024),u(p)]),_:2},1024))),128))])),[[t(ne),t(D)]]):A("",!0),h("content")?(o(),S(I,{key:1},[e.detailAllOpen?A("",!0):(o(),B(L,{key:0,modelValue:t(r),"onUpdate:modelValue":v[0]||(v[0]=P=>Fe(r)?r.value=P:null),class:"search-result-item-content-disclosure",labels:[t(s)(t(me).result.detail.open),t(s)(t(me).result.detail.close)]},null,8,["modelValue","labels"])),t(r)||e.detailAllOpen?se((o(),S("div",St,[u(T,{md:h("content")},null,8,["md"])])),[[t(ne),t(D)]]):A("",!0)],64)):A("",!0)],2)}}}),jt=Object.assign(q(vt,[["__scopeId","data-v-7b138407"]]),{__name:"SearchResultJsonEntry"}),Lt=Y({__name:"SearchResultJson",props:{ss:{},cs:{},detailAllOpen:{type:Boolean},detailLink:{type:Boolean},layout:{},getValue:{type:Function}},setup(e){const s=e,l=(d,D)=>{const r=s.getValue(d,D);return r?r[0]:""},{cs:a,ss:i}=je(s),h=J(()=>s.ss.searchState.result);return(d,D)=>{const r=jt,C=Oe;return t(h)?(o(),B(C,{key:0},{default:f(()=>[(o(!0),S(I,null,z(t(h).list,E=>(o(),B(r,{key:l(E,"id"),row:E,ss:t(i),cs:t(a),"get-value":e.getValue,"detail-link":e.detailLink,layout:e.layout,"detail-all-open":e.detailAllOpen},null,8,["row","ss","cs","get-value","detail-link","layout","detail-all-open"]))),128))]),_:1})):A("",!0)}}}),$t=Object.assign(q(Lt,[["__scopeId","data-v-6c59d708"]]),{__name:"SearchResultJson"}),ae=(e,s="AND")=>{const l={must:[],should:[],must_not:[]};if(!e||e.length===0)return l;if(e.length===1){const{keyword:a,prefix:i}=le(e[0],s);i==="-"?l.must_not.push(a):l.must.push(a)}else{let a=null;switch(e.forEach(i=>{const h=le(i,s);if(a!==null)switch(a.prefix+h.prefix){case"++":case"+-":l.should.push(a.keyword);break;case"+/":l.should.push(a.keyword);break;case"-+":case"--":case"-/":l.must_not.push(a.keyword);break;case"/+":l.should.push(a.keyword);break;case"/-":case"//":l.must.push(a.keyword)}a=le(i,s)}),a.prefix){case"+":l.should.push(a.keyword);break;case"-":l.must_not.push(a.keyword);break;case"/":l.must.push(a.keyword)}}return l},le=(e,s)=>(e=e.replace(/^([+-]?)"(.+)"$/,"1ドル2ドル"),s==="OR"&&!e.startsWith("+")&&!e.startsWith("-")&&(e="+"+e),e.startsWith("-")?{keyword:e.substring(1),prefix:"-"}:e.startsWith("+")?{keyword:e.substring(1),prefix:"+"}:{keyword:e,prefix:"/"}),Rt=e=>e.must_not.length>0&&e.must.length===0&&e.should.length===0,Q=e=>!e||e.length===0,oe=e=>e.map(s=>s?.split(/\|\|/g)).filter(s=>s).flatMap(s=>s),ce=(e,s,l)=>Rt(s)?Q(e)||!e.some(a=>s.must_not.includes(a)):!(Q(e)||!Q(s.must)&&s.must.some(a=>e.every(i=>!l(i,a)))||!Q(s.should)&&s.should.every(a=>e.every(i=>!l(i,a)))||!Q(s.must_not)&&s.must_not.some(a=>e.some(i=>l(i,a)))),Vt=(e,s)=>!Q(e)&&!Q(s)?s.every(l=>{const a=l.from!==""?Number(l.from):null,i=l.to!==""?Number(l.to):null;return e.some(h=>{const d=h&&Number(h);return d==null?!1:i==null&&a==null?!0:i==null?a<=d:(a==null||a<=d)&&d<=i})}):!1,ge=(e,s)=>e?.toLocaleLowerCase().includes(s?.toLocaleLowerCase()),Bt=(e,s)=>s?.endsWith("*")?e?.toLocaleLowerCase().startsWith(s.toLocaleLowerCase().substring(0,s.length-1)):e?.toLocaleLowerCase()===s?.toLocaleLowerCase(),Ct=Y({__name:"SearchJsonPart",props:{url:{},layout:{default:"list"},detailLink:{type:Boolean,default:!1},detailAllOpen:{type:Boolean,default:!1},historyName:{}},async setup(e){let s,l;const a=Ne(),i=De(),h=e,d=([s,l]=Pe(()=>Je(h.url)),s=await s,l(),s),D=J(()=>d.template?i.page(d.template)?.md?.md:void 0),r=d.cs,C=d.columns.split(/\t/g),E=d.data.map(n=>n.split(/\t/g)),{$isEn:F}=ie(),v=n=>{if(F.value){const c=C.indexOf(n+"_en");if(c>=0)return c}return C.indexOf(n)},_=n=>n?.map(c=>v(c)).filter(c=>c>=0),j=(n,c)=>oe(c.map($=>n[$]).filter($=>$)),R=(n,c)=>{const $=v(c);return $<0||$>=n.length?null:n[$]?oe([n[$]])||[]:[]},p=re(null),L=J(()=>{if(p.value){const n=v("id");return E.filter(c=>c[n]===p.value).pop()}return null}),T=J(()=>{const n={};return C.forEach(c=>{n[c]=R(L.value,c)?.[0]?.replaceAll("\\n",` `)}),{id:R(L.value,"id")[0],title:R(L.value,"title")[0],md:{md:R(L.value,"content")[0]},props:n}}),P=n=>{const c=[];let $=!1,N="";for(let w=0;w0&&(c.push(N),N=""):N+=n[w];return N.length>0&&c.push(N),c},k=Ae(r.id,a.path,n=>{k.searchState.searching=!0,n.keyword=n.keyword.flatMap(m=>P(m)),Object.keys(n.query).forEach(m=>{n.query[m]=n.query[m].flatMap(x=>P(x))}),Object.keys(n.filter).forEach(m=>{n.filter[m]=n.filter[m].flatMap(x=>P(x))});let c=E;if(n.keyword){const m=_(r.keywordFields.map(x=>x.field));if(m.length){const x=ae(n.keyword);c=c.filter(g=>ce(j(g,m),x,ge))}}n.query&&Object.entries(n.query).forEach(([m,x])=>{const g=r.searchFields?.filter(y=>y.key===m)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));if(y.length){const b=ae(x);c=c.filter(H=>ce(j(H,y),b,ge))}}}),n.filter&&Object.entries(n.filter).forEach(([m,x])=>{const g=r.searchFields?.filter(y=>y.key===m)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));if(y.length){const b=ae(x,g.defaultOperator);c=c.filter(H=>ce(j(H,y),b,Bt))}}}),n.range&&Object.entries(n.range).forEach(([m,x])=>{const g=r.searchFields?.filter(y=>y.key===m)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));y.length&&(c=c.filter(b=>Vt(j(b,y),x)))}});const $=[];r.searchFields?.filter(m=>m.facetField)?.forEach(m=>{const x=v(m.facetField),g={};c?.forEach(y=>{y[x]&&oe([y[x]])?.forEach(b=>{g[b]?g[b]++:g[b]=1})}),$.push({field:m.key,counts:g})});const N=n.sort?.[0]||r.defaultSort||null;if(N){const[m,x]=N.split(":"),g=r.sorts?.filter(b=>b.key===m)?.pop(),y=_(g?.fields);y&&(c=c.sort((b,H)=>{const G=j(b,y)?.join("_"),X=j(H,y)?.join("_");let W=0;return G&&X?W=G.localeCompare(X,"ja"):X?W=-1:G&&(W=1),W*(x==="desc"?-1:1)}))}const w=Math.max(0,n.from||0),U=Math.min(w+(n.size||20),c.length);return{list:c.slice(w,U),hit:c.length,facets:$}}),M=J(()=>we(a)),Z=async()=>{M.value.cs?.[0]===r.id?M.value.olid?p.value=M.value.olid?.[0]:(k.restoreQuery(M.value),await k.apiCallSearch(),p.value=null):(p.value=null,k.searchState.result=null)};Z();const ee=re();ue(M,()=>{if(Z(),k.searchState.scroll){let n=ee.value?.getElementsByClassName("sticky-observer")[0];n||(n=ee.value?.getElementsByClassName("search-result")[0]),n&&n.scrollIntoView({behavior:"auto"}),k.searchState.scroll=!1}});const pe=J(()=>k.searchState.result),te=Ie(),{getSearchResultTitle:Le,getTitle:de}=Me(),$e=J(()=>p.value?de(R(L.value,"title")[0],te.page.title):k.searchState.resultQuery&&r?Le(k.searchState.resultQuery,r):de(te.page.title,te.page.subSite));if(h.historyName){const n=He();ue(()=>a.query,()=>{n.setup(a,h.historyName)},{immediate:!0})}return We({title:$e}),(n,c)=>{const $=Ke,N=Qe,w=Te,U=_e,m=ze,x=Ge,g=Xe,y=Ye,b=yt,H=$t,G=Ue,X=Ze,W=ye,Re=tt,Ve=et;return o(),S("div",{ref_key:"root",ref:ee,class:"search-bibpart"},[u(,ドル{ss:t(k),cs:t(r),"history-name":e.historyName},null,8,["ss","cs","history-name"]),t(pe)?(o(),B(W,{key:0,class:"search-result"},{default:f(()=>[u(W,{gap:"24"},{default:f(()=>[u(U,{gap:"24"},{default:f(()=>[u(N,{ss:t(k)},null,8,["ss"]),u(w,{ss:t(k),class:"is-hidden-mobile"},null,8,["ss"])]),_:1}),u(G,{padding:"0"},{default:f(()=>[u(U,{class:"search-result-option",gap:"8"},{default:f(()=>[u(U,{gap:"8"},{default:f(()=>[u(m,{ss:t(k)},null,8,["ss"]),u(x,{ss:t(k),cs:t(r)},null,8,["ss","cs"])]),_:1})]),_:1}),t(k)?.searchState?.searching?(o(),B(g,{key:0})):t(pe).hit===0?(o(),B(y,{key:1,"target-class":"search-result-ndls-bib-nohit"})):(o(),S(I,{key:2},[e.layout==="ej"?(o(),B(b,{key:0,ss:t(k),cs:t(r),"get-value":R},null,8,["ss","cs"])):(o(),B(H,{key:1,ss:t(k),cs:t(r),"get-value":R,"detail-link":e.detailLink,layout:e.layout,"detail-all-open":e.detailAllOpen},null,8,["ss","cs","detail-link","layout","detail-all-open"]))],64))]),_:1}),u(U,{align:"center"},{default:f(()=>[u(X,{ss:t(k),"auto-scroll":""},null,8,["ss"])]),_:1})]),_:1})]),_:1})):A("",!0),t(p)?(o(),B(qe,{key:1,to:"#main-overlay"},[t(L)?(o(),B(Ve,{key:0,class:"search-json-page"},{default:f(()=>[u(Re,{page:t(T),template:t(D)},null,8,["page","template"])]),_:1})):A("",!0)])):A("",!0)],512)}}}),Et=Object.assign(q(Ct,[["__scopeId","data-v-a6393f5d"]]),{__name:"SearchJsonPart"}),Ft=Y({__name:"CmsSearchJson",props:{url:{},layout:{},detailLink:{type:Boolean},detailAllOpen:{type:Boolean}},setup(e){const s=e;return(l,a)=>{const i=lt,h=Et,d=ot;return o(),B(d,null,{fallback:f(()=>[u(i,{message:l.$langLabel(t(fe).search_json.loading)},null,8,["message"])]),default:f(()=>[(o(),B(st,null,{fallback:f(()=>[u(i,{message:l.$langLabel(t(fe).search_json.loading)},null,8,["message"])]),default:f(()=>[u(h,nt(at(s)),null,16)]),_:1}))]),_:1})}}}),Nt=Object.assign(Ft,{__name:"CmsSearchJson"});export{Nt as default};

AltStyle によって変換されたページ (->オリジナル) /