PageSourceSearch

https://ohmywishes.com/assets/close-with-bg.B17tqG-Y.js

js ohmywishes.com collected 2026-10-02 05:56:45 UTC 10,878 bytes, 2 lines download raw bytes

1import{n as e}from"./rolldown-runtime.CTF2Kanw.js";import{At as t,Mt as n,Ut as r,an as i,et as a,jt as o,lt as s,nn as c,ot as l,sn as u,st as d,un as f,vt as p}from"./vendor.D0J7OxQZ.js";import{B as m}from"./AuthorizationStore.dksjtQ60.js";import{n as h}from"./Button.Dyzsxk7d.js";import{n as g}from"./helpers.C-7PtMI8.js";import{t as _}from"./arrow-right.fgul8PQl.js";import{t as v}from"./useClickOutside.c1fTsXOs.js";import{t as y}from"./portal.BdZOWFNN.js";var b=e(f(),1),x=i(),S=(e,t)=>t?e?.phrase===t?.phrase:!1,C=(e,t,n)=>n?(e+t+n)%n:-1,w=(e,t)=>{let n=e?.toLowerCase().indexOf(t?.toLowerCase())??0;if(n===-1)return e;let r=e?.toLowerCase()?.substring(0,n),i=e?.toLowerCase().substring(n,n+t.length),a=e?.toLowerCase().substring(n+t.length);return(0,x.jsxs)(`span`,{children:[r,(0,x.jsx)(`span`,{style:{color:`#FFFFFF`},children:i}),a]})},T=4,E=(e,t,n)=>e===0&&t===n-1||e===n-1&&t===0,D=(e,t)=>{let{options:n,elements:r,container:i,focusedIndex:a,behavior:o}=t;if(!n.length)return-1;let s=C(a,e,n.length),c=0;for(;n[s].disabled&&c<n.length;)s=C(s,e,n.length),c+=1;if(c>=n.length)return-1;let l=r[s],u=i.scrollTop,d=i.scrollTop+i.clientHeight;if(l.offsetTop<u||l.offsetTop>d){let e=l.offsetTop-i.offsetTop-T,t=E(a,s,n.length)?`auto`:`smooth`;i.scrollTo({top:e,behavior:o||t})}return s},O=({options:e,onPick:t,onFocusElementChange:n,value:i})=>{let[a,o]=(0,b.useState)(-1),s=(0,b.useRef)(null),c=(0,b.useRef)([]);r();let l=(0,b.useMemo)(()=>({setReference:e=>{e&&c.current.push(e)},setRoot:()=>s}),[]);return(0,b.useEffect)(()=>{if(!s.current)return;let t=s.current,n=-1;for(let t=0;t<e.length;t+=1)if(S(e[t],i)){o(t),n=t;break}let r=c.current[n];if(r){let e=r.offsetTop-t.offsetTop-4;t.scrollTo({top:e,behavior:`auto`})}},[e]),(0,b.useEffect)(()=>{if(!s.current)return;let r=new AbortController,i=s.current;return window.addEventListener(`keydown`,r=>{switch(r.key){case`ArrowUp`:{r.preventDefault();let t=D(-1,{options:e,focusedIndex:a,container:i,elements:c.current});o(t),n?.(t);break}case`ArrowDown`:{r.preventDefault();let t=D(1,{options:e,focusedIndex:a,container:i,elements:c.current});o(t),n?.(t);break}case`Enter`:if(a<0)return;let s=e[a];t?.(s);break}},{signal:r.signal}),()=>{r.abort()}},[a,e]),{refs:l,focusedIndex:a,setFocusedIndex:o}},k=n.ul.withConfig({componentId:`sc-13xfixz-0`})([`margin-top:0;max-height:264px;width:100%;overflow-y:auto;border-radius:24px;padding:8px;background:#33333399;backdrop-filter:blur(32px);`]),A=n.li.withConfig({componentId:`sc-xw3q6-0`})([`width:100%;cursor:pointer;list-style-type:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:12px;display:flex;align-items:center;column-gap:8px;color:#ffffff80;padding:0 12px;height:46px;transition:0.1s linear;font-weight:500;font-size:16px;line-height:18px;&:disabled{cursor:default;pointer-events:none;}`,` `,``],e=>e.$active&&t([`background-color:#444444;`]),e=>e.$focused&&t([`background-color:#444444;`])),j=n(_).withConfig({componentId:`sc-auo1cb-0`})([`position:absolute;right:12px;bottom:50%;transform:translateY(50%);`]),M=(0,b.forwardRef)(({item:e,onPick:t,active:n,focused:r,disabled:i,displayValue:a,inputValue:o,onKeyDownItemDropdown:s,...c},l)=>{let u=w(a?a(e):e?.phrase,o??``);return(0,x.jsxs)(`div`,{style:{position:`relative`},children:[(0,x.jsx)(A,{role:`listitem`,$active:n,$focused:r,tabIndex:0,"data-focused":r,"data-active":n,onKeyDown:t=>s(t,e),onClick:n=>t?.(e,n),...c,ref:l,children:u}),r&&(0,x.jsx)(j,{})]})}),N=({options:e=[],value:t,onPick:n,displayValue:r,target:i,onFocusElementChange:a,empty:o,inputValue:s,onKeyDownItemDropdown:c,...l})=>{let u=(0,b.useRef)(null),{refs:d,focusedIndex:f,setFocusedIndex:p}=O({options:e,onFocusElementChange:a,onPick:n,value:t}),m=e=>{n?.(e),i&&i.current&&i.current.focus()},h=e.filter(e=>e.phrase!==s);return v(u,()=>p(-1)),(0,x.jsx)(x.Fragment,{children:h.length>0&&(0,x.jsx)(k,{...l,ref:d.setRoot(),children:e?.map((e,n)=>{let i=S(e,t);return(0,x.jsx)(M,{item:e,ref:d.setReference,onKeyDownItemDropdown:c,active:i,focused:f===n,displayValue:r,inputValue:s,onPick:m,onMouseEnter:()=>p(n),onMouseLeave:()=>p(-1)},n)})})})},P=n.div.withConfig({componentId:`sc-1vzjq8b-0`})([`display:flex;width:clamp(384px,100%,960px);gap:16px;justify-self:center;border-radius:100px;overflow:hidden;padding:16px;height:60px;background:#33333399;backdrop-filter:blur(32px);`]),F=n.input.withConfig({componentId:`sc-1vzjq8b-1`})([`font-family:'SF Pro Rounded',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,'Apple Color Emoji',Arial,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-weight:500;font-size:16px;line-height:18px;border:none;width:100%;padding:0;color:white;outline:none;&::placeholder{color:#ffffff;font-weight:500;font-size:16px;line-height:18px;}background:transparent;`]),I=n.div.withConfig({componentId:`sc-1vzjq8b-2`})([`display:flex;justify-items:center;width:100%;gap:8px;`]),L=n.div.withConfig({componentId:`sc-1vzjq8b-3`})([`display:flex;justify-items:center;align-items:center;gap:16px;`]),R=n.div.withConfig({componentId:`sc-1r03nmx-0`})([`cursor:pointer;display:flex;align-items:center;`]),z=({children:e,onClickIcon:t})=>(0,x.jsx)(R,{onClick:e=>{t?.(e)},children:e}),B=({onChange:e,onBlur:t,onFocus:n,onClick:r,value:i,externalHandlers:a,attachmentPropsLeft:o,attachmentPropsRight:s,refCallback:c,buttonSlot:l,...u})=>{let{t:d}=p(),f=t=>
1{e?.(t),a?.onChange?.(t)},m=e=>{t?.(e),a?.onBlur?.(e)},h=e=>{n?.(e),a?.onFocus?.(e)},g=e=>{r?.(e),a?.onClick?.(e)};return(0,x.jsxs)(P,{children:[(0,x.jsxs)(I,{children:[o&&(0,x.jsx)(z,{...o}),(0,x.jsx)(F,{placeholder:d(`Common.Search`,`Поиск`),ref:e=>{e&&c?.(e)},value:i??``,onBlur:m,onClick:g,onFocus:h,onChange:f,...u})]}),(0,x.jsxs)(L,{children:[s&&(0,x.jsx)(z,{...s}),l]})]})},V=e=>{let[t,n]=(0,b.useState)(!1);return e&&([t,n]=[...e]),[t,n]},H=({displayValue:e,onChange:t,externalOnInputChange:n,openState:r})=>{let[i,a]=V(r);return{open:i,setOpen:a,onInputChange:e=>{a(!0),n?.(e.target.value)},changeHandler:r=>{let i=e&&r?e(r):r?.phrase;t?.(r),n?.(i??``),a(!1)},comboboxDisplayValue:t=>{if(t)return e?e(t):t.phrase},clean:()=>{n?.(``)}}},U=({ref:e,openChangeHandler:t})=>{(0,b.useEffect)(()=>{if(!e.current)return;let n=e.current,r=new AbortController;return n.addEventListener(`keydown`,e=>{switch(e.key){case` `:t(!0);break;case`Escape`:t(!1)}},{signal:r.signal}),()=>{r.abort()}},[])},W=n.div.withConfig({componentId:`sc-11alq07-0`})([`position:relative;width:100%;max-width:960px;`]),G=n.div.withConfig({componentId:`sc-11alq07-1`})([`width:clamp(384px,100%,960px);left:unset;justify-self:center;`]),K=({options:e,value:t,onChange:n,searchable:r,inputValue:i,onInputChange:o,displayValue:c,disabled:u,readOnly:f,onFocusElementChange:p,attachmentProps:m,filterDisabled:h,openState:g,onKeyDownItemDropdown:_,...b})=>{let{onInputChange:S,changeHandler:C,setOpen:w,open:T,comboboxDisplayValue:E}=H({onChange:n,openState:g,displayValue:c,externalOnInputChange:o}),{refs:D,floatingStyles:O}=a({placement:`bottom-start`,strategy:`absolute`,middleware:[l({boundary:`clippingAncestors`,crossAxis:!1}),d(4)],whileElementsMounted:s}),k=D.domReference.current??document?.body;return U({ref:D.domReference,openChangeHandler:w}),v(D.floating,()=>w(!1)),(0,x.jsxs)(W,{ref:D.setReference,children:[(0,x.jsx)(B,{value:i??(()=>{if(r)return i;if(t)return E(t)})(),onChange:S,readOnly:f,disabled:u,onMouseDown:()=>w(e=>!e),autoComplete:`off`,...b}),(0,x.jsx)(y,{root:k,children:T&&(0,x.jsx)(G,{style:{...O},ref:D.setFloating,children:e?.length>0&&(0,x.jsx)(N,{onKeyDownItemDropdown:_,options:e,onFocusElementChange:p,onPick:C,value:t,displayValue:c,target:D.domReference,inputValue:i})})})]})},q=({query:e,value:t=``,displayValue:n,queryOptions:i,onChange:a,onKeyDownItemDropdown:o,...s})=>{let[c,l]=(0,b.useState)(!1),d=r(),{data:f}=e(t??``,{enabled:!c&&t?.length>1,placeholderData:u,staleTime:0,gcTime:0,...i})??[],p=e=>{let t=n?n(e):e?.phrase??``;a?.(t),l(!1),g(t,d)},m=e=>{if(!f?.data?.items)return;let t=f.data.items[e];t.phrase&&(l(!0),a?.(t.phrase))},h=e=>{a?.(e),l(!1)};return(0,x.jsx)(K,{...s,filterDisabled:c,options:f?.data?.items??[],searchable:!0,inputValue:t,onInputChange:h,onFocusElementChange:m,displayValue:n,onChange:p,id:`input-search`,onKeyDownItemDropdown:o})},J=o([`from{opacity:0;transform:scale(0.5);}to{opacity:1;transform:scale(1);}`]),Y=o([`from{opacity:1;transform:scale(1);}to{opacity:0;transform:scale(0.8);}`]),X=o([`from{transform:translateY(0);}to{transform:translateY(-50%);}`]),Z=o([`from{transform:translateY(-50%);}to{transform:translateY(0);}`]),Q=n.div.withConfig({componentId:`sc-1ntuzvu-0`})([`position:fixed;inset:0;display:flex;height:100vh;justify-content:center;background-color:#000000b2;z-index:120;outline:none;`]),$=n.div.withConfig({componentId:`sc-1ntuzvu-1`})([`width:100%;padding:0 50px;display:flex;margin-top:16px;justify-content:center;transform-origin:center center;animation:`,` 150ms ease-out;opacity:`,`;transform:scale(`,`);border:1px solid transparent;`],e=>e.$isModalOpen?J:Y,e=>e.$isModalOpen?1:0,e=>e.$isModalOpen?1:.4),ee=n.form.withConfig({componentId:`sc-1r9ulpa-0`})([`width:100%;max-width:960px;`]),te=n(h).withConfig({componentId:`sc-1r9ulpa-1`})([`height:40px;transform-origin:center center;animation:`,` 150ms ease-out;opacity:`,`;display:`,`;transform:scale(`,`);@media screen and (max-width:1024px){display:none;}`],e=>e.$isVisible?J:Y,e=>e.$isVisible?1:0,e=>e.$isVisible?`block`:`none`,e=>e.$isVisible?1:0),ne=(e,t)=>c({queryKey:[`search`,e],queryFn:async({signal:t})=>await m(e,t)??{},...t}),re=({closeIconCallback:e,submitCallback:t,search:n,setSearch:r,onKeyDownItemDropdown:i,...a})=>{let[o,s]=(0,b.useState)(!1),{t:c}=p();return(0,x.jsx)(ee,{onSubmit:e=>{e.preventDefault(),s(!1),t(n)},children:(0,x.jsx)(q,{value:n,onKeyDownItemDropdown:i,openState:[o,s],onChange:r,query:ne,buttonSlot:(0,x.jsx)(te,{$isVisible:n.length>1,size:`small`,onClick:()=>{s(!1),t(n)},kind:`primary_blue`,children:c(`Action.Search`,`Найти`)}),...a}
1)})},ie=e=>(0,x.jsx)(`svg`,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,x.jsxs)(`g`,{opacity:.5,children:[(0,x.jsx)(`circle`,{cx:14,cy:14,r:14,fill:`white`,fillOpacity:.2}),(0,x.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.6004 8.50093C20.9042 8.19719 20.9042 7.70472 20.6004 7.40098C20.2967 7.09724 19.8042 7.09724 19.5005 7.40098L14.0014 12.9001L8.50093 7.39958C8.19719 7.09584 7.70472 7.09584 7.40098 7.39958C7.09724 7.70332 7.09724 8.19578 7.40098 8.49953L12.9015 14L7.40109 19.5004C7.09735 19.8041 7.09735 20.2966 7.40109 20.6003C7.70483 20.904 8.19729 20.904 8.50103 20.6003L14.0014 15.0999L19.5004 20.5989C19.8041 20.9026 20.2966 20.9027 20.6003 20.5989C20.9041 20.2952 20.9041 19.8027 20.6003 19.499L15.1013 14L20.6004 8.50093Z`,fill:`white`})]})});export{Z as a,Q as i,re as n,X as o,$ as r,ie as t};
2//# sourceMappingURL=close-with-bg.B17tqG-Y.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.