PageSourceSearch

https://cdn.vialibri.net/static/assets/UserSearchPreferences-DFqL0yRi.js

js vialibri.net collected 2026-09-24 09:38:45 UTC 6,927 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2c4b62d3-89a2-4eb2-812c-480009509fa1",e._sentryDebugIdIdentifier="sentry-dbid-2c4b62d3-89a2-4eb2-812c-480009509fa1")}catch(e){}}();import"./_sentry-release-injection-file-SYOkQ1Km.js";import{a as e}from"./rolldown-runtime-BBzOAo5_.js";import{t}from"./react-DuV36FPs.js";import{t as s}from"./SearchSources-DzUyx6OD.js";import{t as n}from"./sortBy-Cw9Nl2mh.js";import{t as a}from"./react-dom-CY_asObH.js";import{n as o}from"./objectWithoutPropertiesLoose-lq5GB41P.js";import{c as r,d as i,g as l,h as c,i as u,l as d,m as p,n as m,o as h,p as g,r as b,s as f,u as j}from"./selectStyles-ELM30RAn.js";import{t as x}from"./react-select.esm-BO-DpDEC.js";import{K as v,at as w}from"./index-CRc22cjs.js";import{l as y,n as _,o as C,t as O}from"./FinalControlGroup-Cmc21xKd.js";import{t as L}from"./Submit-CHUFd811.js";import{t as S}from"./SuccessMessage-D1FypT3L.js";import{t as T}from"./BasicFinalForm-BXHiGXP7.js";import{t as k}from"./FinalCheckbox-B4d-pr_9.js";import{t as D}from"./CurrencySelect-CRgu5xYb.js";var V,I,E,N=w(),F=v(),M=e(t()),W=(l(),a(),function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,s=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase(),n=String(t.getOptionValue(e)).toLowerCase(),a=String(t.getOptionLabel(e)).toLowerCase();return n===s||a===s}),A=j({allowCreateWhileLoading:!1,createOptionPosition:"last"},{formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,s,n){return!(!e||t.some((function(t){return W(e,t,n)}))||s.some((function(t){return W(e,t,n)})))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}},getOptionValue:f,getOptionLabel:h}),P=b((V=u,E=I=function(e){g(s,e);var t=d(s);function s(e){var n;c(this,s),(n=t.call(this,e)).select=void 0,n.onChange=function(e,t){var s=n.props,a=s.getNewOptionData,o=s.inputValue,l=s.isMulti,c=s.onChange,u=s.onCreateOption,d=s.value,p=s.name;if("select-option"!==t.action)return c(e,t);var m=n.state.newOption,h=Array.isArray(e)?e:[e];if(h[h.length-1]!==m)c(e,t);else if(u)u(o);else{var g=a(o,o),b={action:"create-option",name:p,option:g};c(l?[].concat(r(i(d)),[g]):g,b)}};var a=e.options||[];return n.state={newOption:void 0,options:a},n}return p(s,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){var e=this,t=this.state.options;return M.createElement(V,o({},this.props,{ref:function(t){e.select=t},options:t,onChange:this.onChange}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var s=e.allowCreateWhileLoading,n=e.createOptionPosition,a=e.formatCreateLabel,o=e.getNewOptionData,l=e.inputValue,c=e.isLoading,u=e.isValidNewOption,d=e.value,p=e.getOptionValue,m=e.getOptionLabel,h=e.options||[],g=t.newOption;return{newOption:g=u(l,i(d),h,{getOptionValue:p,getOptionLabel:m})?o(l,a(l)):void 0,options:!s&&c||!g?h:"first"===n?[g].concat(r(h)):[].concat(r(h),[g])}}}]),s}(M.Component),I.defaultProps=A,E)),B=({dealers:e})=>{const t="dealer_exclusions",s=y(t),n=_(s.meta);return(0,F.jsx)(O,{name:t,label:(0,F.jsx)(N.T,{message:"Excluded booksellers:"}),children:s.input.value&&s.input.value.length?(0,F.jsx)(x,{styles:m,...s.input,className:"vl-react-select",components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:()=>null},isMulti:!0,isClearable:!1,noOptionsMessage:()=>(0,F.jsx)(N.T,{message:"You need to exclude a bookseller from the search result page in order to see it here."}),getOptionLabel:t=>e[t],getOptionValue:e=>e,menuPortalTarget:document.querySelector("body"),isDisabled:n}):(0,F.jsx)("div",{className:"radio-group",children:(0,F.jsx)(N.T,{message:"You haven't excluded any booksellers yet."})})})},G={DropdownIndicator:null},H={control:e=>({...e,border:"1px solid #979797",boxShadow:"none","&:hover":{border:"1px solid #979797"}})}
1,K=({initialValue:e,onChange:t,stringFormatter:s=null})=>{const[n,a]=(0,M.useState)(e),[o,r]=(0,M.useState)(""),i=e=>{a(e),t(e)};return(0,F.jsx)(P,{components:G,inputValue:o,className:"vl-react-select",styles:H,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:i,onInputChange:e=>{r(e)},onKeyDown:e=>{var t;if(o)switch(e.key){case"Enter":case"Tab":{const a=s?s(o):o;i([...n,(t=a,{label:t,value:t})]),r(""),e.preventDefault();break}}},placeholder:(0,F.jsx)(N.T,{message:"Type something and press Enter."}),value:n})},Y=()=>{const e="exclusion_filters",t=y(e),s=(0,F.jsx)(N.T,{message:"Exclusion filters:"}),n=(0,F.jsx)(N.T,{message:"Add exclusion filters by typing something and pressing Enter. These terms will be used to exclude items from your search and match results."}),a=[...t.input.value.matchAll(/\[([^\]]+)(]+)/gm)].map((function(e){const t=e[1];return{label:t,value:t}}));return(0,F.jsx)(O,{name:e,label:s,notes:n,children:(0,F.jsx)(K,{initialValue:a,onChange:e=>{const s=e.map((function(e){return`[${e.value}]`})).join("");t.input.onChange(s)},stringFormatter:e=>e.startsWith("[")&&e.endsWith("]")?e.substring(1).slice(0,-1):e})})},q=(0,N.withTranslators)((({user:e,t:t,aggregators:a,dealer_exclusions:o,harvestCount:r})=>{const i=n(o,[e=>e.name.toLowerCase()],["desc"]),l={};return o.forEach((e=>{l[e.id]=e.name})),(0,F.jsxs)(T,{endpoint:"/account/search-preferences",initialValues:{...e,dealer_exclusions:i.map((e=>e.id))},resetOnSubmit:!0,children:[(0,F.jsx)(D,{}),(0,F.jsxs)(C,{children:[(0,F.jsx)("div",{children:(0,F.jsx)(k,{name:"always_show_full_descriptions",label:t("Always show long search result descriptions")})}),(0,F.jsx)("div",{children:(0,F.jsx)(k,{name:"hide_images_in_search_results",label:t("Hide images in search results")})}),e.has_valid_subscription&&(0,F.jsx)("div",{children:(0,F.jsx)(k,{name:"enable_libristat",label:t("Show statistics on search results page (Libristat)")})})]}),(0,F.jsx)(Y,{}),(0,F.jsx)(B,{dealers:l}),(0,F.jsx)("hr",{}),(0,F.jsx)("h3",{children:"Libribot"}),(0,F.jsx)(O,{name:"enable_libribot_notifications",label:t("Send emails:"),children:(0,F.jsx)("div",{className:"checkbox-group",children:(0,F.jsx)(k,{name:"enable_libribot_notifications",label:t("Send me email reports for all Libribot matches")})})}),(0,F.jsx)(s,{name:"exclude_libribot_aggregators",aggregators:a,harvestCount:r}),(0,F.jsx)(C,{children:(0,F.jsxs)("div",{children:[(0,F.jsx)(N.T,{message:"For further information on how Libribot searches sites please see"})," ",(0,F.jsx)("a",{href:"/content/how-libribot-works",children:"How Libribot Works"}),"."]})}),(0,F.jsx)(L,{label:(0,F.jsx)(N.T,{message:"Save changes"})}),(0,F.jsx)(S,{children:(0,F.jsx)(N.T,{message:"Account preferences successfully updated"})})]})}));export{q as default};
2//# sourceMappingURL=UserSearchPreferences-DFqL0yRi.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.