PageSourceSearch

https://www.blogo.ai/assets/useField-D2xWtOIv.js

js blogo.ai collected 2026-10-05 13:44:50 UTC 3,138 bytes, 1 lines download raw bytes

1import{l as e,m as t}from"./runtime-CtOt7Xfv.js";import{t as n}from"./react-dom-C5N66LKV.js";import{B as r,E as i,F as a,P as o,a as s,g as c,z as l}from"./button-C9tALODw.js";import{V as u}from"./createBaseUIEventDetails-mPYBZ6fo.js";var d=t(e()),f=t(n()),p=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),m={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},h={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},g={disabled:!1,...h},_={valid(e){return e===null?null:e?{[p.valid]:``}:{[p.invalid]:``}}},v=d.createContext({invalid:void 0,name:void 0,validityData:{state:m,errors:[],error:``,value:``,initialValue:null},setValidityData:a,disabled:void 0,touched:h.touched,setTouched:a,dirty:h.dirty,setDirty:a,filled:h.filled,setFilled:a,focused:h.focused,setFocused:a,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:g,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=o)=>e,getInputValidationProps:(e=o)=>e,inputRef:{current:null},commit:async()=>{}}});function y(e=!0){let t=d.useContext(v);if(t.setValidityData===a&&!e)throw Error(r(28));return t}var b=d.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:a,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function x(){return d.useContext(b)}var S=d.createContext({controlId:void 0,registerControlId:a,labelId:void 0,setLabelId:a,messageIds:[],setMessageIds:a,getDescriptionProps:e=>e});function C(){return d.useContext(S)}function w(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function T({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=d.useRef(e!==void 0),[a,o]=d.useState(t);return[i?e:a,d.useCallback(e=>{i||o(e)},[])]}function E(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:f}=C(),p=u(t),m=n?o:void 0,h=l(()=>Symbol(`labelable-control`)),g=d.useRef(!1),_=d.useRef(t!=null),v=i(()=>{!g.current||f===a||(g.current=!1,f(h.current,void 0))});return s(()=>{if(f===a)return;let e;if(n){let n=r?.current;e=c(n)&&n.closest(`label`)!=null?t??null:m??p}else if(t!=null)_.current=!0,e=t;else if(_.current)e=p;else{v();return}if(e===void 0){v();return}g.current=!0,f(h.current,e)},[t,r,m,f,n,p,h,v]),d.useEffect(()=>v,[v]),o??p}function D(e){let{enabled:t=!0,value:n,id:r,name:a,controlRef:o,commit:c}=e,{formRef:l}=x(),{invalid:u,markedDirtyRef:d,validityData:p,setValidityData:m}=y(),h=i(e.getValue);s(()=>{if(!t)return;let e=n;e===void 0&&(e=h()),p.initialValue===null&&e!==null&&m(t=>({...t,initialValue:e}))},[t,m,n,p.initialValue,h]),s(()=>{!t||!r||l.current.fields.set(r,{getValue:h,name:a,controlRef:o,validityData:w(p,u),validate(e=!0){let t=n;t===void 0&&(t=h()),d.current=!0,e?f.flushSync(()=>c(t)):c(t)}})},[c,o,t,l,h,r,u,d,a,p,n]),s(()=>{let e=l.current.fields;return()=>{r&&e.delete(r)}},[l,r])}export{x as a,C as i,E as n,y as o,T as r,_ as s,D 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.