PageSourceSearch

https://docs-website-es.netlify.app/component---src-pages-search-results-js-8f76c868b5c17ee9892e.js

js docs-website-es.netlify.app collected 2026-10-03 10:40:57 UTC 7,047 bytes, 6 lines download raw bytes

1"use strict";(self.webpackChunkdocs_website=self.webpackChunkdocs_website||[]).push([[976],{61168:function(e,r,t){var n=t(96),a=t(5556),o=t.n(a),s=t(17437);const i={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},l={base:{[i.PRIMARY]:{name:"1yg1ozi",styles:"border:1px solid var(--border-color);background:var(--primary-background-color)"},[i.SECONDARY]:{name:"a74yef",styles:"background:var(--primary-background-color);.dark-mode &{background:var(--primary-hover-color);}"}},interactive:{[i.PRIMARY]:{name:"fjnkrt",styles:"&:hover{border-color:var(--border-color);}"}}},c=(0,n.A)("div",{target:"esuq8iu0"})("border-radius:0.25rem;box-shadow:var(--shadow-3);text-decoration:none;",(e=>{let{base:r}=e;return l.base[r]}),";",(e=>{let{base:r,interactive:t}=e;return t&&(0,s.AH)("cursor:pointer;transition:transform 0.15s ease-out,border-color 0.15s ease-out,box-shadow 0.15s ease-out;&:hover{transform:translateY(-2px);box-shadow:var(--shadow-4);}",l.interactive[r],";","")}),";");c.propTypes={base:o().oneOf(Object.values(i)).isRequired,interactive:o().bool},c.defaultProps={interactive:!1},c.BASE=i,r.A=c},86230:function(e,r,t){var n=t(96540),a=t(41693);const o=e=>Array.from(e.keys()).length?`?${e}`:"";r.A=()=>{const e=(0,a.useLocation)(),r=(0,n.useMemo)((()=>new URLSearchParams(e.search)),[e.search]),t=(0,n.useCallback)(((t,n)=>{r.set(t,n),(0,a.navigate)(o(r)||e.pathname)}),[r,e.pathname]),s=(0,n.useCallback)((t=>{r.delete(t),(0,a.navigate)(o(r)||e.pathname)}),[r,e.pathname]);return{queryParams:r,setQueryParam:t,deleteQueryParam:s}}},14580:function(e,r,t){t.r(r),t.d(r,{default:function(){return $}});var n=t(58168),a=t(80045),o=t(54506),s=t(64467),i=t(96),l=t(96540),c=t(86230),u=t(93448),m=t(19909);var d=e=>{let{searchTerm:r,sources:t,cursor:n,limit:a,page:o,sort:s,since:i,until:l,tags:c,language:u}=e;return(0,m.$P)({searchTerm:r,sources:t,cursor:n,limit:a,page:o,sort:s,since:i,until:l,tags:c,language:u})},g=t(17437);const h=g.i7`
2  to {
3    transform: rotate(1turn);
4  }
5`,p=e=>{let{className:r,inline:t,size:n}=e;return(0,g.Y)("div",{className:r,"aria-label":"Loading","aria-busy":!0,css:(0,g.AH)("--spinner-size:",n,";display:inline-block;position:relative;height:",t?"var(--spinner-size, 1rem)":"100%",";width:",t?"var(--spinner-size)":"100%",";&:after{animation:",h," 0.5s linear infinite;border-radius:50%;border-right:1px solid transparent;border-top:1px solid;content:'';left:calc(50% + 1px);margin-left:calc(var(--spinner-size) / 2 * -1);margin-top:calc(var(--spinner-size) / 2 * -1);position:absolute;top:calc(50% + 1px);width:var(--spinner-size);height:var(--spinner-size);}","")})};p.defaultProps={inline:!1,size:"1rem"};var b=p,y=t(6609),v=t(2643),f=t(61168),A=t(96805),x=t(83227),w=t(41693);const Y=["children"];function k(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function O(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?k(Object(t),!0).forEach((function(r){(0,s.A)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var P={name:"1y2mh23",styles:"margin-left:0.25rem"},z={name:"bv80fz",styles:"padding:0.25rem 0.35rem;margin-left:0.5rem"},j={name:"qqykjf",styles:"margin-right:0.25rem"},R={name:"13puyt0",styles:"padding:0.25rem 0.35rem;margin-right:0.5rem"},C={name:"khzbe5",styles:"margin-top:1rem;height:50px"};const S=(0,i.A)("div",{target:"e8si03z3"})({name:"1x71qaq",styles:"font-size:1.125rem;display:flex;flex-direction:column;justify-content:center;width:100%;height:100%;padding-right:3.5rem;h2{font-weight:normal;margin-bottom:1rem;}@media (max-width: 1240px){padding-right:0;}"}),q=(0,i.A)("div",{target:"e8si03z2"})({name:"3eng59",styles:"height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center"}),E=(0,i.A)("div",{target:"e8si03z1"})({name:"74evbs",styles:"display:flex;max-width:760px;justify-content:center;align-items:center;margin:3rem auto 0;a{margin:0 0.25rem 0;display:flex;text-decoration:none;button{&:hover{color:var(--brand-button-primary-accent-hover);border-color:var(--brand-button-primary-accent-hover);}}&[disabled]{pointer-events:none;button{border-color:--system-text-muted-light;color:--system-text-muted-light;}}}"}),L=(0,i.A)("span",{target:"e8si03z0"})({name:"eokbve",styles:"margin:0 0.75rem;font-size:1rem;white-space:nowrap;color:var(--secondary-text-color)"}),I=e=>{let{children:r}=e,t=(0,a.A)(e,Y);return(0,g.Y)(v.A,(0,n.A)({},t,{variant:v.A.VARIANT.OUTLINE,size:v.A.SIZE.SMALL}),r)};var M={name:"vbn6dl",styles:"margin-bottom:0;font-weight:500"},T={name:"17xkdtr",styles:"margin-bottom:0;color:var(--secondary-text-color);font-size:0.875rem"}
5,N={name:"15otgh0",styles:".highlight{color:#00ac69;font-style:normal;}margin-bottom:2rem;box-shadow:none;color:var(--primary-font-color);&:hover{color:var(--primary-font-color);h3{text-decoration:underline;}}"};const D=e=>{let{result:r,query:t}=e;return(0,g.Y)(f.A,{as:A.A,to:r.url,css:N},(0,g.Y)("p",{css:T},r.url.replace("https://docs.newrelic.com/docs/","")),(0,g.Y)("h3",{css:M,dangerouslySetInnerHTML:{__html:(0,x.A)(r.title,t)}}),(0,g.Y)("p",{dangerouslySetInnerHTML:{__html:r.summary}}))};var $=()=>{const{queryParams:e}=(0,c.A)(),r=e.get("query"),{locale:t}=(0,u.A)()||{},n=(0,m.yW)(t),{0:a,1:s}=(0,l.useState)({loading:!0}),{0:i,1:h}=(0,l.useState)(void 0),{0:p,1:v}=(0,l.useState)([]),{results:f,totalCount:A,nextCursor:x,loading:Y,error:k}=a;(0,l.useEffect)((()=>{h(void 0),v([])}),[r]),(0,l.useEffect)((()=>{if(!r)return void(0,w.navigate)("/");let e=!1;return s((e=>O(O({},e),{},{loading:!0}))),(async()=>{try{const t=await d({searchTerm:r,cursor:i,limit:5,language:n});if(e)return;s({results:t.results,totalCount:t.totalCount,nextCursor:t.nextCursor,loading:!1})}catch(a){var t;if(e)return;s({error:"RateLimitError"===a.name?`Rate limited. Try again in ${null===(t=a.rateLimit)||void 0===t?void 0:t.resetInSeconds}s.`:"Unable to get search results, an error has occurred",loading:!1})}})(),()=>{e=!0}}),[r,i,n]);const M=p.length>0,T=Boolean(x),N=p.length+1,$=null!=A?Math.ceil(A/5):null;
5return(0,g.Y)(S,null,Y&&(0,g.Y)(q,null,(0,g.Y)("h2",null,"Loading results"),(0,g.Y)(b,{size:"2rem",css:C})),f&&!Y&&(0,g.Y)(l.Fragment,null,(0,g.Y)("h2",null,A,' results for "',r,'"'),f.map(((e,t)=>(0,g.Y)(D,{key:`${t}-${e.title}`,result:e,query:r}))),(0,g.Y)(E,null,(0,g.Y)(I,{disabled:!M,onClick:()=>{v((e=>{const r=e.slice(0,-1);return h(e[e.length-1]),r}))},css:R},(0,g.Y)(y.A,{name:"fe-arrow-left",css:j}),"Previous"),(0,g.Y)(L,null,"Page ",N,null!=$&&` of ~${$}`),(0,g.Y)(I,{disabled:!T,onClick:()=>{x&&(v((e=>[].concat((0,o.A)(e),[i]))),h(x))},css:z},"Next",(0,g.Y)(y.A,{name:"fe-arrow-right",css:P})))),k&&!Y&&(0,g.Y)(q,null,k))}}}]);
6//# sourceMappingURL=component---src-pages-search-results-js-8f76c868b5c17ee9892e.js.map

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.