1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="adb6cb27-0de1-4c84-9f51-f9017ee1bebd",e._sentryDebugIdIdentifier="sentry-dbid-adb6cb27-0de1-4c84-9f51-f9017ee1bebd")}catch(e){}}();import"./_sentry-release-injection-file-SYOkQ1Km.js";import{a as e}from"./rolldown-runtime-BBzOAo5_.js";import{t as s}from"./react-DuV36FPs.js";import{t as r}from"./SearchSources-DzUyx6OD.js";import{t as o}from"./formatClasses-DEp3Ml96.js";import{t}from"./useLocalStorage-CLkwt2cY.js";import{E as a,K as n,O as i,at as l,ct as c,f as m,h as d,lt as u,r as f}from"./index-CRc22cjs.js";import{t as j}from"./FormLayoutContext-CsyD3FrV.js";import{t as h}from"./usePageLayout-CkXFEI4G.js";import{t as g}from"./scrollToElement-Kz6yN-cq.js";import{a as x,c as p,t as b}from"./FinalControlGroup-Cmc21xKd.js";import{t as w}from"./FormField-DM_MQnEG.js";import{t as v}from"./Submit-CHUFd811.js";import{t as y}from"./FormError-DCBM5X0M.js";import{t as C}from"./FinalSelect-mq7-Evlf.js";import{n as S,r as T,t as _}from"./ExclusionString-YEY5gGMW.js";import{n as F,t as E}from"./PriceRange-DD08lJYX.js";import{t as N}from"./SimpleSearchFields-DenGjBfc.js";import{t as k}from"./CurrencySelect-CRgu5xYb.js";var L=e(s()),R=l(),I=n(),P=(0,R.withTranslators)((({sort:e,countries:s,alternativeCountries:t,aggregators:a,harvestCount:n,t:i})=>{const[l,c]=(0,L.useState)(!0),[m,d]=(0,L.useState)(!0),u=(0,L.useRef)(null),{columnCount:f,isNarrow:g}=h();(0,L.useLayoutEffect)((()=>{const e=()=>{if(u.current){const e=window.innerHeight<1e3&&u.current.offsetWidth>475&&!g;c(e),d(e&&u.current.offsetWidth>620||!e&&1===f)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[f,g]);const x={"rare-books":i("Rare Books"),"cheap-books":i("Bargains")};return(0,I.jsx)(j.Provider,{value:{groups:{vertical:l,compact:!0},inputs:{small:l||1===f}},children:(0,I.jsxs)("div",{className:o("advanced-search",{"two-column":l}),ref:u,children:[(0,I.jsxs)("div",{className:"advanced-search__column",children:[(0,I.jsx)(N,{autofocus:!0}),(0,I.jsx)(w,{name:"publisher",label:(0,I.jsx)(R.T,{message:"Publisher:"}),autocomplete:!1,clearField:!0}),(0,I.jsx)(F,{}),(0,I.jsx)(E,{}),(0,I.jsx)(_,{})]}),(0,I.jsxs)("div",{className:"advanced-search__column",children:[(0,I.jsx)(T,{twoColumns:m}),(0,I.jsx)(b,{name:"sort",label:(0,I.jsx)(R.T,{message:"Sort by:"}),hintKey:"sort",children:(0,I.jsx)(C,{name:"sort",options:e})}),(0,I.jsx)(k,{hintKey:"currency"}),(0,I.jsx)(b,{name:"prioritise",label:(0,I.jsx)(R.T,{message:"Prioritise:"}),hintKey:"prioritise",children:(0,I.jsx)(C,{name:"prioritise",options:x,short:!0})}),(0,I.jsx)(S,{options:s,alternativeCountries:t}),(0,I.jsx)(r,{aggregators:a,useModal:l,harvestCount:n})]})]})})})),B=({singleLine:e=!1,websiteCount:s})=>(0,I.jsxs)("div",{className:o("tagline",{"single-line":e}),children:[!e&&(0,I.jsx)("span",{className:"tagline__line",children:(0,I.jsx)(R.T,{message:"The worldâs largest search engine for old, rare & second-hand books."})}),(0,I.jsx)("span",{className:"tagline__line",children:(0,I.jsx)(R.T,{message:"Search for books on over {{ strong }}.",strong:(0,I.jsx)("strong",{children:(0,I.jsx)(R.T,{message:"{{ websiteCount }} websites worldwide",websiteCount:10*Math.floor(s/10)})})})})]}),D=({defaultValues:e,formValues:s,options:r,harvestCount:o,forceAdvancedForm:n,pageHasShowcaseBanner:l=!1})=>{const j=(0,L.useRef)(null),b=(0,L.useMemo)((()=>new URLSearchParams(window.location.search)),[]);(0,L.useEffect)((()=>{b.has("advanced-search")&&l&&g(j.current)}),[l,b]);const[w,C]=t("vialibri-show-advanced-search-form",n);(0,L.useEffect)((()=>{!w&&n&&C(!0)}),[]);const S=(0,L.useMemo)((()=>a(e)),[e]),T=()=>C((e=>(e&&window.scroll(0,0),!e))),_=f(),{columnCount:F}=h(),E=1===F,k=w?(0,I.jsx)("a",{onClick:T,children:E?(0,I.jsx)(R.T,{message:"Show less"}):(0,I.jsx)(R.T,{message:"Show fewer search options"})}):(0,I.jsx)("a",{onClick:T,children:E?(0,I.jsx)(R.T,{message:"Show more"}):(0,I.jsx)(R.T,{message:"Show more search options"})}),D=o-1+r.aggregators.length;return(0,I.jsxs)(I.Fragment,{children:[!w&&(0,I.jsx)(B,{websiteCount:D}),(0,I.jsx)("div",{className:"box box--shadow margin-bottom",children:(0,I.jsx)(p,{onSubmit:d("/searches",_,(e=>i(e,!w))),initialValues:a({...e,...s}),validate:e=>x(e,w),render:e=>{const s=["exclude_pods","exclude_aggregators","sort","currency","prioritise"],t=c(e.values,((e,r)=>!s.includes(r)&&void 0!==e&&""!==e&&e!==S[r]));return(0,I.jsxs)("form",{onSubmit:e.handleSubmit,ref:j,children:[w&&(0,I.jsx)(B,{singleLine:!0,websiteCount:D}),(0,I.jsx)(y,{formIsEmpty:!t}),w?(0,I.jsx)(P,{...r,harvestCount:o}):(0,I.jsx)(N,{autofocus:!0}),(0,I.jsx)(v,{label:(0,I.jsx)(R.T,{message:"Search"}),buttonCanFloat:w,buttonContainerRef:j,centered:!0,beforeButton:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("a",{className:"colour--grey",href:"/content/search-help",children:E?(0,I.jsx)(R.T,{message:"Help"}):(0,I.jsx)(R.T,{message:"How to search"})}),(0,I.jsx)("a",{className:"colour--grey",onClick:()=>{e.form.reset(u(e.values,s)),_(m())},children:E?(0,I.jsx)(R.T,{message:"Reset"}):(0,I.jsx)(R.T,{message:"Reset form"})})]}),afterButton:k})]})}})})]})};export{D as default}; 2//# sourceMappingURL=HomepageSearchForm-BJJuo_0b.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.