mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[97920],{79935:(e,t,a)=>{a.r(t),a.d(t,{default:()=>H});var r=a(67294),c=a(86010),n=a(70290),l=a.n(n),s=a(8131),o=a.n(s),u=a(71098),i=a(31984),m=a(58087),h=a(40060),g=a(18168),p=a(37806),d=a(89712),v=a(80958),f=a(54995),b=a(8241),y=a(55995),E=a(92210),P=a(37728);const w="searchQueryInput_cpyO",O="searchVersionInput_wf2r",S="searchResultsColumn_PLpb",_="algoliaLogo_YElR",j="algoliaLogoPathFill_grp5",z="searchResultItem_AlWU",R="searchResultItemHeading_HJFH",V="searchResultItemPath_x9Ef",N="searchResultItemSummary_jej3",I="searchQueryColumn_hQFc",k="searchVersionColumn_GkmC",M="searchLogoColumn_Mj_0",T="loadingSpinner_E_zt",F="loader_ujSQ";var C=a(68263);function D(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),r.forEach((function(t){D(e,t,a[t])}))}return e}function x(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})),e}function L({docsSearchVersionsHelpers:e}){const t=Object.entries(e.allDocsData).filter((([,e])=>e.versions.length>1));return r.createElement("div",{className:(0,c.Z)("col","col--3","padding-left--none",k)},t.map((([a,c])=>{const n=t.length>1?`${a}: `:"";return r.createElement("select",{key:a,onChange:t=>e.setSearchVersion(a,t.target.value),defaultValue:e.searchVersions[a],className:O},c.versions.map(((e,t)=>r.createElement("option",{key:t,label:`${n}${e.label}`,value:e.name}))))})))}function A(){const{siteConfig:{themeConfig:e},i18n:{currentLocale:t}}=(0,b.Z)(),{algolia:{appId:a,apiKey:n,indexName:s,externalUrlRegex:d}}=e,O=function(){const{selectMessage:e}=(0,h.c)();return t=>e(t,(0,E.I)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}(),k=function(){const e=(0,y._r)(),[t,a]=(0,r.useState)((()=>Object.entries(e).reduce(((e,[t,a])=>x(Z({},e),{[t]:a.versions[0].name})),{}))),c=Object.values(e).some((e=>e.versions.length>1));return{allDocsData:e,versioningEnabled:c,searchVersions:t,setSearchVersion:(e,t)=>a((a=>x(Z({},a),{[e]:t})))}}(),{searchQuery:D,setSearchQuery:A}=(0,v.O)(),H={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[q,Q]=(0,r.useReducer)(((e,t)=>{switch(t.type){case"reset":return H;case"loading":return x(Z({},e),{loading:!0});case"update":return D!==t.value.query?e:x(Z({},t.value),{items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)});case"advance":{const t=e.totalPages>e.lastPage+1;return x(Z({},e),{lastPage:t?e.lastPage+1:e.lastPage,hasMore:t})}default:return e}}),H),$=l()(a,n),U=o()($,s,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","counter"]});U.on("result",(({results:{query:e,hits:t,page:a,nbHits:r,nbPages:c}})=>{if(""===e||!Array.isArray(t))return void Q({type:"reset"});const n=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),l=t.map((({url:e,_highlightResult:{hierarchy:t},_snippetResult:a={}})=>{const r=new URL(e),c=Object.keys(t).map((e=>n(t[e].value)));return{title:c.pop(),url:(0,g.F)(d,r.href)?r.href:r.pathname+r.hash,summary:a.content?`${n(a.content.value)}...`:"",breadcrumbs:c}}));Q({type:"updat
|