PageSourceSearch

https://www.lofty.ai/assets/lib-DFHwdoKZ.js

js lofty.ai collected 2026-09-28 05:45:32 UTC 11,267 bytes, 1 lines download raw bytes

1import{s as e}from"./rolldown-runtime-BG2f4sTM.js";import{t}from"./react-CYsHstG7.js";import{C as n,K as r,L as i,R as a,S as o,U as s,V as c,W as l,X as u,Y as d,a as f,c as p,d as m,n as h,o as g,p as _,q as v,s as y,v as b,w as x,y as S}from"./hooks-Dr3i4SJb.js";import{i as C}from"./components-DBQ8KnQG.js";import{a as w,c as T,g as E,n as D,s as O}from"./errorBoundaries-DA2nkwLq.js";var k=`application/x-www-form-urlencoded`;function A(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function j(e){return A(e)&&e.tagName.toLowerCase()===`button`}function M(e){return A(e)&&e.tagName.toLowerCase()===`form`}function N(e){return A(e)&&e.tagName.toLowerCase()===`input`}function P(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function F(e,t){return e.button===0&&(!t||t===`_self`)&&!P(e)}function I(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function L(e,t){let n=I(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var R=null;function z(){if(R===null)try{new FormData(document.createElement(`form`),0),R=!1}catch{R=!0}return R}var B=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function V(e){return e!=null&&!B.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${k}"`),null):e}function H(e,t){let n,r,i,a,o;if(M(e)){let o=e.getAttribute(`action`);r=o?l(o,t):null,n=e.getAttribute(`method`)||`get`,i=V(e.getAttribute(`enctype`))||k,a=new FormData(e)}else if(j(e)||N(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?l(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=V(e.getAttribute(`formenctype`))||V(o.getAttribute(`enctype`))||k,a=new FormData(o,e),!z()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(A(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=k,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var U=e(t(),1),W=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{W&&(window.__reactRouterVersion=`8.3.0`)}catch{}function G({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=U.useState({action:n.action,location:n.location}),o=U.useCallback(e=>{r===!1?a(e):U.startTransition(()=>a(e))},[r]);return U.useLayoutEffect(()=>n.listen(o),[n,o]),U.createElement(C,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}G.displayName=`unstable_HistoryRouter`;var K=U.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:a,replace:l,mask:d,state:p,target:m,to:g,preventScrollReset:_,viewTransition:v,defaultShouldRevalidate:y,...b},x){let{basename:S,navigator:C,useTransitions:E}=U.useContext(o),D=typeof g==`string`&&u.test(g),k=c(g,S);g=k.to;let A=h(g,{relative:r}),j=f(),M=null;if(d){let e=s(d,[],j.mask?j.mask.pathname:`/`,!0);S!==`/`&&(e.pathname=e.pathname===`/`?S:i([S,e.pathname])),M=C.createHref(e)}let[N,P,F]=T(n,b),I=ne(g,{replace:l,mask:d,state:p,target:m,preventScrollReset:_,relative:r,viewTransition:v,defaultShouldRevalidate:y,useTransitions:E});function L(t){e&&e(t),t.defaultPrevented||I(t)}let R=!(k.isExternal||a),z=U.createElement(`a`,{...b,...F,href:(R?M:void 0)||k.absoluteURL||A,onClick:R?L:e,ref:O(x,P),target:m,"data-discover":!D&&t===`render`?`true`:void 0});return N&&!D?U.createElement(U.Fragment,null,z,U.createElement(w,{page:A})):z});K.displayName=`Link`;var q=U.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:s,children:c,...u},d){let p=m(a,{relative:u.relative}),h=f(),g=U.useContext(S),{navigator:_,basename:v}=U.useContext(o),y=g!=null&&ue(p)&&s===!0,b=_.encodeLocation?_.encodeLocation(p).pathname:p.pathname,x=h.pathname,C=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;t||(x=x.toLowerCase(),C=C?C.toLowerCase():null,b=b.toLowerCase()),C&&v&&(C=l(C,v)||C);let w=b!==`/`&&b.endsWith(`/`)?b.length-1:b.length,T=x===b||!r&&x.startsWith(b)&&x.charAt(w)===`/`,E=C!=null&&(C===b||!r&&
1C.startsWith(b)&&C.charAt(w)===`/`),D={isActive:T,isPending:E,isTransitioning:y},O=T?e:void 0,k;k=typeof n==`function`?n(D):[n,T?`active`:null,E?`pending`:null,y?`transitioning`:null].filter(Boolean).join(` `);let A=typeof i==`function`?i(D):i;return U.createElement(K,{...u,"aria-current":O,className:k,ref:d,style:A,to:a,viewTransition:s},typeof c==`function`?c(D):c)});q.displayName=`NavLink`;var ee=U.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:s=`get`,action:c,onSubmit:l,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=U.useContext(o),v=oe(),y=se(c,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&u.test(c);return U.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,o=r?.getAttribute(`formmethod`)||s,c=()=>v(r||e.currentTarget,{fetcherKey:t,method:o,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?U.startTransition(()=>c()):c()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});ee.displayName=`Form`;function J({getKey:e,storageKey:t,...n}){let r=U.useContext(D),{basename:i}=U.useContext(o),a=f(),s=g();ce({getKey:e,storageKey:t});let c=U.useMemo(()=>{if(!r||!e)return null;let t=$(a,s,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
1typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),U.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${E(JSON.stringify(t||Z))}, ${E(JSON.stringify(c))})`}})}J.displayName=`ScrollRestoration`;function Y(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function X(e){let t=U.useContext(b);return v(t,Y(e)),t}function te(e){let t=U.useContext(S);return v(t,Y(e)),t}function ne(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=y(),p=f(),h=m(e,{relative:s});return U.useCallback(f=>{if(F(f,t)){f.preventDefault();let t=n===void 0?r(p)===r(h):n,m=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?U.startTransition(()=>m()):m()}},[p,d,h,n,i,a,t,e,o,s,c,l,u])}function re(e){d(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=U.useRef(I(e)),n=U.useRef(!1),r=f(),i=U.useMemo(()=>L(r.search,n.current?null:t.current),[r.search]),a=y();return[i,U.useCallback((e,t)=>{let r=I(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var ie=0,ae=()=>`__${String(++ie)}__`;function oe(){let{router:e}=X(`useSubmit`),{basename:t}=U.useContext(o),n=_(),r=e.fetch,i=e.navigate;return U.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=H(e,t);a.navigate===!1?await r(a.fetcherKey||ae(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function se(e,{relative:t}={}){let{basename:a}=U.useContext(o),s=U.useContext(n);v(s,`useFormAction must be used inside a RouteContext`);let[c]=s.matches.slice(-1),l={...m(e||`.`,{relative:t})},u=f();if(e==null){l.search=u.search;let e=new URLSearchParams(l.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();l.search=n?`?${n}`:``}}return(!e||e===`.`)&&c.route.index&&(l.search=l.search?l.search.replace(/^\?/,`?index&`):`?index`),a!==`/`&&(l.pathname=l.pathname===`/`?a:i([a,l.pathname])),r(l)}var Z=`react-router-scroll-positions`,Q={};function $(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:l(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ce({getKey:e,storageKey:t}={}){let{router:n}=X(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=te(`useScrollRestoration`),{basename:a}=U.useContext(o),s=f(),c=g(),l=p();U.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),le(U.useCallback(()=>{if(l.state===`idle`){let t=$(s,c,a,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||Z,JSON.stringify(Q))}catch(e){d(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(U.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Z);e&&(Q=JSON.parse(e))}catch{}},[t]),U.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>$(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),U.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{d(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function le(e,t){let{capture:n}=t||{};U.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ue(e,{relative:t}={}){let n=U.useContext(x);v(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=X(`useViewTransitionState`),i=m(e,{relative:t});if(!n.isTransitioning)return!1;let o=l(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=l(n.nextLocation.pathname,r)||n.nextLocation.pathname;return a(i.pathname,s)!=null||a(i.pathname,o)!=null}export{re as i,q as n,J as r,K as t};

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.