@verifiedinc-public/shared-ui-elements 8.11.1 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{b as s,k as a,a as e,i as u,u as o,j as r,
|
|
1
|
+
"use strict";import{b as s,k as a,a as e,i as u,u as o,j as r,n as i,d as t,c,m as l,l as n,e as T,f as m,g as d,h as p}from"../shared/useNetworkType-CydsbWPo.mjs";import{u as g,a as C}from"../shared/usePrevious-Dppy11px.mjs";import{b as S,u as b,c as f,a as O,d as R,e as k,f as v}from"../shared/magic-qr-code-DEnCvbjS.mjs";import{u as M}from"../shared/useCounter-BV32zXDQ.mjs";import{u as Q}from"../shared/useResizeObserver-D7K4jTvT.mjs";export{s as useCallbackRef,g as useCopyToClipboard,M as useCounter,a as useDebounceCallback,S as useDebounceValue,e as useDisclosure,b as useGoogleFont,u as useIntersectionObserver,o as useLocalStorage,r as useNavigatorOnline,i as useNetworkType,f as useOnClickOutside,C as usePrevious,O as useQRCode,Q as useResizeObserver,t as useScript,c as useSearchParams,R as useStyledQRCode,l as useTTSMagicLink,k as useTTSMagicQRCode,v as useTTSMagicQRCodeOptions,n as useTTSMagicText,T as useThrottle,m as useToggle,d as useWindowScroll,p as useWindowSize};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network connection type from the Network Information API.
|
|
3
|
+
* Represents the type of connection used (bluetooth, cellular, ethernet, wifi, etc.).
|
|
4
|
+
*/
|
|
5
|
+
type NetworkType = 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown';
|
|
6
|
+
/**
|
|
7
|
+
* A React hook that tracks the network's connection type.
|
|
8
|
+
* Uses the Navigator.connection.type property and change events for efficient tracking.
|
|
9
|
+
* Implements useSyncExternalStore for React 18+ concurrent rendering compatibility.
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - SSR compatible (defaults to 'unknown' during server-side rendering)
|
|
13
|
+
* - Updates automatically when network type changes
|
|
14
|
+
* - Type-safe return value
|
|
15
|
+
* - Zero dependencies
|
|
16
|
+
*
|
|
17
|
+
* Note: The Network Information API is not available in all browsers, just in Chrome Android.
|
|
18
|
+
* Check browser compatibility before relying on this hook.
|
|
19
|
+
*
|
|
20
|
+
* @returns {NetworkType} Current network connection type ('bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown')
|
|
21
|
+
*/
|
|
22
|
+
export declare function useNetworkType(): NetworkType;
|
|
23
|
+
export {};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{A as a,an as s,a0 as e,c as r,ab as t,a7 as o,B as i,ad as n,ac as m,aj as l,ai as d,ao as p,C as u,ag as c,D as C,i as h,$ as g,h as S,a9 as T,E as f,N as y,R as P,Q as k,U as F,Z as
|
|
1
|
+
"use strict";import{A as a,an as s,a0 as e,c as r,ab as t,a7 as o,B as i,ad as n,ac as m,aj as l,ai as d,ao as p,C as u,ag as c,D as C,i as h,$ as g,h as S,a9 as T,E as f,N as y,R as P,Q as k,U as F,Z as B,F as D,am as b,I,b as O,L as M,M as N,a1 as L,X as R,g as v,k as w,a4 as U,O as x,ah as A,e as E,a5 as G,f as H,P as Y,a6 as W,_ as V,al as q,a8 as j,S as z,d as Q,ap as _,ar as K,aq as X,aa as $,T as J,j as Z,a as aa,a2 as sa,a3 as ea,ak as ra,H as ta,v as oa,t as ia,p as na,u as ma,l as la,r as da,G as pa,z as ua,q as ca,J as Ca,s as ha,m as ga,K as Sa,n as Ta,o as fa,w as ya,V as Pa,ae as ka,W as Fa,x as Ba,y as Da,af as ba,Y as Ia}from"./shared/magic-legal-language-BqpWHWWZ.mjs";import{a as Oa,b as Ma,P as Na,S as La}from"./shared/PageSectionHeader-lc9WunC-.mjs";import{B as Ra,C as va,j as wa,E as Ua,L as xa,k as Aa,M as Ea,r as Ga,p as Ha,g as Ya,O as Wa,P as Va,R as qa,e as ja,d as za,S as Qa,a as _a,b as Ka,l as Xa,c as $a,f as Ja,o as Za,T as as,W as ss,t as es,s as rs,i as ts,q as os,h as is,m as ns,n as ms,u as ls}from"./shared/OneClickHealthBigNumbers-DmqOXVRu.mjs";import{T as ds}from"./shared/index-CgwlGvef.mjs";import{b as ps,k as us,a as cs,i as Cs,u as hs,j as gs,n as Ss,d as Ts,c as fs,m as ys,l as Ps,e as ks,f as Fs,g as Bs,h as Ds}from"./shared/useNetworkType-CydsbWPo.mjs";import{u as bs,a as Is}from"./shared/usePrevious-Dppy11px.mjs";import{b as Os,u as Ms,c as Ns,a as Ls,d as Rs,e as vs,f as ws}from"./shared/magic-qr-code-DEnCvbjS.mjs";import{u as Us}from"./shared/useCounter-BV32zXDQ.mjs";import{u as xs}from"./shared/useResizeObserver-D7K4jTvT.mjs";import{b as As,a as Es,x as Gs,m as Hs,e as Ys,d as Ws,q as Vs,v as qs,h as js,j as zs,g as Qs,p as _s,u as Ks,n as Xs,c as $s,l as Js,o as Zs,s as ae,f as se,i as ee,r as re,t as te,k as oe,w as ie,y as ne}from"./shared/colors-CSvtCJK4.mjs";import{s as me,t as le}from"./shared/shadows-levwxV7v.mjs";import{wrapPromise as de}from"./utils/wrapPromise/index.mjs";import{f as pe,b as ue,a as ce,c as Ce,s as he,t as ge,u as Se}from"./shared/uuidColor-CbuBMrIl.mjs";import{c as Te,g as fe,a as ye,p as Pe,s as ke,v as Fe}from"./shared/phone-cSkbYk4g.mjs";import{masks as Be}from"./utils/masks/index.mjs";import{o as De,s as be,a as Ie}from"./shared/ssn-I4gN8M-_.mjs";import{toCapitalize as Oe,toSentenceCase as Me}from"./utils/string/index.mjs";import{k as Ne}from"./shared/formatKebabToPretty-Du43TgPC.mjs";import{g as Le}from"./shared/generateKeyFromString-D1AuwK4y.mjs";import{alpha as Re,contrastColor as ve,darken as we,getThemeFromPrimaryColor as Ue,lighten as xe}from"./utils/color/index.mjs";import{addressFormatter as Ae,fromUSAddress as Ee,parseCountryCode as Ge,toUSaddress as He,toUSaddressPretty as Ye}from"./utils/address/index.mjs";import{D as We,a as Ve,m as qe}from"./shared/makeGoogleFont-pok2oDWs.mjs";import{p as je}from"./shared/notification-sBaCxCY5.mjs";import{resolveLogo as ze}from"./utils/logo/index.mjs";import{M as Qe,S as _e,U as Ke,g as Xe,n as $e,p as Je}from"./shared/npi.schema-BsAQ0yLj.mjs";import{d as Ze,e as ar,f as sr,g as er,s as rr}from"./shared/unix.schema-D7g4VIKT.mjs";import{SnackbarProvider as tr}from"notistack";export{a as AcceptTermsNotice,s as AdaptativeBox,e as AddressInput,r as Alert,t as Backdrop,o as Banner,i as BasePhoneInput,Ra as BigNumber,n as BrandFilterInput,m as Button,l as CalendlyDialog,d as CalendlyDialogComponent,p as ContentWithLoader,u as CredentialRequestsEditor,va as CustomAlertComponent,c as CustomDialog,We as DEFAULT_FONT_FAMILY,Ve as DEFAULT_FONT_WEIGHTS,C as DateInput,h as DateRangeInput,g as DefaultInput,S as EmailInput,wa as EmptyChartSection,Ua as ErrorCodesChart,T as ExactBirthdayBanner,f as ExportToPdfButton,y as Form,P as FormBuilder,k as FormField,F as FormFieldBuilder,B as FormProvider,D as FullWidthAlert,b as IconPlayer,I as Image,O as LegalLink,M as LinkButton,xa as LoadingChartSection,N as MandatoryEnum,Qe as MaskedAndUnmaskedSSNSchema,Aa as MetricLastUpdated,Ea as MonthlySignupsOverviewTable,L as NPIInput,R as NewOneClickForm,v as OTPInput,w as OneClickForm,Ga as OneClickHealthBigNumbers,Ha as OneClickHealthOverTimeChart,Ya as OneClickOverTimeChart,Wa as OneClickPercentageChart,U as OneClickPoweredByVerified,x as OriginalButton,Oa as PageHeader,Ma as PageSectionHeader,Na as Paragraph,A as PersistentDialog,E as PhoneInput,Va as PieChart,G as PoweredByVerified,H as PrettyPhoneInput,Y as PrivacyPolicyNotice,W as QRCodeDisplay,V as RadioOption,qa as ReasonCodesChart,q as RequiredLabel,j as ResendPhoneBanner,ja as RiskScoreBarChart,za as RiskScorePieChart,z as SSNInput,_e as SSNSchema,La as SectionHeader,Q as SelectInput,Qa as SeriesChart,_a as SeriesChartLegend,Ka as SeriesPercentageChart,Xa as SignupBigNumbers,$a as SimpleBarChart,Ja as SimpleLegend,tr as SnackbarProvider,Za as TTSBigNumbers,_ as TTSMagicButton,K as TTSMagicLegalLanguage,X as TTSMagicQRCode,as as TTSOverTimeChart,$ as TestPhoneNumbersBanner,J as TextButton,Z as TimezoneInput,ds as Tunnel,aa as Typography,Ke as USDateSchema,sa as VerifiedImage,ea as VerifiedIncLogo,ss as When,ra as WhenStyled,Ae as addressFormatter,Re as alpha,As as black,Es as blue,es as calculateOneClickHealthMetrics,Gs as colors,ve as contrastColor,Te as countries,Hs as dangerContrast,Ys as darkBlue,Ws as darkGreen,Vs as darkGrey,qs as darkGreyContrast,js as darkRed,zs as darkYellow,we as darken,rs as defaultMetrics,Ze as descriptionSchema,ar as emailSchema,ta as extractChildrenFromCredentialFieldSet,oa as extractTypesFromSchema,sr as fieldSchema,ia as filterRepeatedCredentials,na as findCorrectSchemaProperty,ma as findCredentialsByType,pe as formatDateMMDDYYYY,ue as formatDateMMYY,ce as formatDateToTimestamp,Ce as formatExtendedDate,Ee as fromUSAddress,Le as generateKeyFromString,la as getCredentialTypeDisplayInfo,da as getCredentialValues,Xe as getDateSchemaWithPastValidation,pa as getLastPathName,ua as getParentPath,fe as getPhoneData,ye as getPhoneDataByFieldName,ca as getReferencedSchemaNames,Ue as getThemeFromPrimaryColor,er as getUnixSchema,Qs as green,_s as grey,Ks as greyContrast,Ca as hasMandatoryFieldEmpty,Xs as infoContrast,ha as isNewCredentialAgainstInstance,ga as isRequiredCredentialDisplayInfo,Sa as isSomeFieldInputAllowed,Ta as isValidInputCredential,Ne as kebabCaseToPretty,$s as lightBlue,Js as lightGreen,Zs as lightGrey,ae as lightGreyContrast,se as lightRed,ee as lightYellow,xe as lighten,fa as makeCredentialDisplayInfoList,qe as makeGoogleFontUrl,ts as mapMonthlySignupsOverviewTableData,os as mapOneClickHealthTimeSeriesData,is as mapOneClickTimeSeriesData,ns as mapSeriesTimeSeriesData,ms as mapTTSTimeSeriesData,Be as masks,$e as npiSchema,De as omitProperties,Ge as parseCountryCode,Pe as parseToPhoneNational,Je as phoneSchema,je as prepareNotification,re as red,ze as resolveLogo,me as shadows,ke as sortByCountryName,ya as sortCredentialsBySchema,be as ssnFormatter,Ie as ssnRegex,rr as stateSchema,he as stringToHashedColor,te as textDisabled,le as theme,Oe as toCapitalize,Pa as toCreatePatchCredentials,ka as toOption,Me as toSentenceCase,Fa as toShareCredentials,He as toUSaddress,Ye as toUSaddressPretty,ge as toUTCMilliseconds,Ba as transformToFormObject,Da as transformToFormSchema,ba as useBrandFilterInput,ps as useCallbackRef,bs as useCopyToClipboard,Us as useCounter,us as useDebounceCallback,Os as useDebounceValue,cs as useDisclosure,Ia as useForm,Ms as useGoogleFont,Cs as useIntersectionObserver,hs as useLocalStorage,gs as useNavigatorOnline,Ss as useNetworkType,Ns as useOnClickOutside,Is as usePrevious,Ls as useQRCode,xs as useResizeObserver,Ts as useScript,fs as useSearchParams,ls as useSnackbar,Rs as useStyledQRCode,ys as useTTSMagicLink,vs as useTTSMagicQRCode,ws as useTTSMagicQRCodeOptions,Ps as useTTSMagicText,ks as useThrottle,Fs as useToggle,Bs as useWindowScroll,Ds as useWindowSize,Se as uuidToHashedColor,Fe as validatePhone,oe as warningContrast,ie as white,de as wrapPromise,ne as yellow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{useRef as m,useInsertionEffect as x,useCallback as w,useState as d,useId as A,useEffect as g,useLayoutEffect as I,useSyncExternalStore as k,useMemo as N}from"react";import{g as C}from"./magic-qr-code-DEnCvbjS.mjs";import $ from"libphonenumber-js";function z(e){return{set:t=>{const o=typeof t=="string"?t:JSON.stringify(t);localStorage.setItem(e,o)},get:()=>{const t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch{return t}return null},remove:()=>{localStorage.removeItem(e)}}}function E(e,t=[]){const o=m(()=>{throw new Error("Cannot call an event handler while rendering.")});return x(()=>{o.current=e}),w((...r)=>{var i;return(i=o.current)==null?void 0:i.call(o,...r)},t)}function P(e={}){const{onClose:t,onOpen:o,open:r,id:i}=e,n=E(o),s=E(t),[a,c]=d(e.defaultOpen??!1),u=r??a,l=r!==void 0,p=A(),f=i??`disclosure-${p}`,h=w(()=>{l||c(!1),s?.()},[l,s]),y=w(()=>{l||c(!0),n?.()},[l,n]),b=w(()=>{u?h():y()},[u,y,h]);function S(v={}){return{...v,"aria-expanded":u,"aria-controls":f,onClick(O){var L;(L=v.onClick)==null||L.call(v,O),b()}}}function T(v={}){return{...v,hidden:!u,id:f}}return{open:u,onOpen:y,onClose:h,onToggle:b,isControlled:l,getButtonProps:S,getDisclosureProps:T}}function D(e){return new URLSearchParams(e??window.location.search)}function H(e,t={addToHead:!1,removeOnUnmount:!1,nonce:void 0}){const[o,r]=d("loading"),i=m(t);return g(()=>{let n=document.querySelector(`script[src="${e}"]`);const s=n?.getAttribute("data-status");if(s){r(s);return}if(n===null){n=document.createElement("script"),n.src=e,n.async=!0,n.setAttribute("data-status","loading"),i.current.nonce&&n.setAttribute("nonce",i.current.nonce),i.current.addToHead?document.head.appendChild(n):document.body.appendChild(n);const a=()=>{n?.setAttribute("data-status","ready"),r("ready"),u()},c=()=>{n?.setAttribute("data-status","error"),r("error"),u()},u=()=>{n?.removeEventListener("load",a),n?.removeEventListener("error",c)};n.addEventListener("load",a),n.addEventListener("error",c);const l=i.current.removeOnUnmount;return()=>{l&&(n?.remove(),u())}}else r("unknown")},[e]),o}function j(e,t=500){const[o,r]=d(e),i=m(Date.now());return g(()=>{const n=Date.now(),s=n-i.current;if(s>=t)i.current=n,r(e);else{const a=t-s,c=window.setTimeout(()=>{i.current=Date.now(),r(e)},a);return()=>{window.clearTimeout(c)}}},[e,t]),o}function M(e){const[t,o]=d(()=>typeof e=="boolean"?e:!!e),r=w(i=>{if(typeof i=="boolean"){o(i);return}o(n=>!n)},[]);return[t,r]}function U(){const[e,t]=d({x:0,y:0}),o=w((...r)=>{if(r.length===1&&typeof r[0]=="object")window.scrollTo(r[0]);else if(r.length===2)window.scrollTo(r[0],r[1]);else throw new Error("Invalid arguments passed to scrollTo. Expected either ScrollToOptions object or x,y coordinates. See https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return I(()=>{const r=()=>{t({x:window.scrollX,y:window.scrollY})};return r(),window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[]),{...e,scrollTo:o}}function W(){const[e,t]=d({width:window.innerWidth,height:window.innerHeight});return I(()=>{const o=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),e}function J(e,{threshold:t=0,root:o=null,rootMargin:r="0%",freezeOnceVisible:i=!1}={}){const[n,s]=d({isIntersecting:!1,entry:null});return g(()=>{const a=e?.current;let c;if(a){if(i&&n.isIntersecting)return;const u=p=>{const[f]=p;s({isIntersecting:f.isIntersecting,entry:f})},l=new IntersectionObserver(u,{threshold:t,root:o,rootMargin:r});l.observe(a),c=()=>{l.disconnect()}}return()=>{c&&c()}},[e,t,o,r,i,n.isIntersecting]),n}function R(){return k(e=>typeof window>"u"?()=>{}:(window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}),()=>typeof navigator>"u"?!0:navigator.onLine,()=>!0)}function q(e,t=500,o){const r=m(),i=N(()=>{const n=C(e,t,o),s=(...a)=>n(...a);return s.cancel=()=>{n.cancel()},s.isPending=()=>!!r.current,s.flush=()=>n.flush(),s},[e,t,o]);return g(()=>{r.current=C(e,t,o)},[e,t,o]),g(()=>()=>{r.current&&r.current.cancel()},[]),i}function B({phoneNumber:e,keyword:t,text:o="Text",signature:r="to"}){var i;e&&(e=((i=$(e))==null?void 0:i.format("NATIONAL").replace("(","").replace(")","").replace(" ","-"))??e);const n={text:o,keyword:t,phoneNumber:e,signature:r};return{...n,displayValue:`${n.text} ${n.keyword} ${n.signature} ${n.phoneNumber}`}}function V(e,t){return`${e}/tts/${t}`}function X(){return k(e=>{if(typeof window>"u")return()=>{};const t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t?(t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}):()=>{}},()=>{if(typeof navigator>"u")return"unknown";const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e!=null&&e.type?e.type:"unknown"},()=>"unknown")}export{P as a,E as b,D as c,H as d,j as e,M as f,U as g,W as h,J as i,R as j,q as k,B as l,V as m,X as n,z as u};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{useRef as m,useInsertionEffect as C,useCallback as w,useState as d,useId as k,useEffect as v,useLayoutEffect as I,useSyncExternalStore as A,useMemo as $}from"react";import{g as S}from"./magic-qr-code-DEnCvbjS.mjs";import N from"libphonenumber-js";function P(e){return{set:t=>{const o=typeof t=="string"?t:JSON.stringify(t);localStorage.setItem(e,o)},get:()=>{const t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch{return t}return null},remove:()=>{localStorage.removeItem(e)}}}function E(e,t=[]){const o=m(()=>{throw new Error("Cannot call an event handler while rendering.")});return C(()=>{o.current=e}),w((...r)=>{var i;return(i=o.current)==null?void 0:i.call(o,...r)},t)}function H(e={}){const{onClose:t,onOpen:o,open:r,id:i}=e,n=E(o),s=E(t),[c,u]=d(e.defaultOpen??!1),a=r??c,l=r!==void 0,p=k(),f=i??`disclosure-${p}`,h=w(()=>{l||u(!1),s?.()},[l,s]),y=w(()=>{l||u(!0),n?.()},[l,n]),b=w(()=>{a?h():y()},[a,y,h]);function T(g={}){return{...g,"aria-expanded":a,"aria-controls":f,onClick(x){var L;(L=g.onClick)==null||L.call(g,x),b()}}}function O(g={}){return{...g,hidden:!a,id:f}}return{open:a,onOpen:y,onClose:h,onToggle:b,isControlled:l,getButtonProps:T,getDisclosureProps:O}}function U(e){return new URLSearchParams(e??window.location.search)}function j(e,t={addToHead:!1,removeOnUnmount:!1,nonce:void 0}){const[o,r]=d("loading"),i=m(t);return v(()=>{let n=document.querySelector(`script[src="${e}"]`);const s=n?.getAttribute("data-status");if(s){r(s);return}if(n===null){n=document.createElement("script"),n.src=e,n.async=!0,n.setAttribute("data-status","loading"),i.current.nonce&&n.setAttribute("nonce",i.current.nonce),i.current.addToHead?document.head.appendChild(n):document.body.appendChild(n);const c=()=>{n?.setAttribute("data-status","ready"),r("ready"),a()},u=()=>{n?.setAttribute("data-status","error"),r("error"),a()},a=()=>{n?.removeEventListener("load",c),n?.removeEventListener("error",u)};n.addEventListener("load",c),n.addEventListener("error",u);const l=i.current.removeOnUnmount;return()=>{l&&(n?.remove(),a())}}else r("unknown")},[e]),o}function z(e,t=500){const[o,r]=d(e),i=m(Date.now());return v(()=>{const n=Date.now(),s=n-i.current;if(s>=t)i.current=n,r(e);else{const c=t-s,u=window.setTimeout(()=>{i.current=Date.now(),r(e)},c);return()=>{window.clearTimeout(u)}}},[e,t]),o}function D(e){const[t,o]=d(()=>typeof e=="boolean"?e:!!e),r=w(i=>{if(typeof i=="boolean"){o(i);return}o(n=>!n)},[]);return[t,r]}function M(){const[e,t]=d({x:0,y:0}),o=w((...r)=>{if(r.length===1&&typeof r[0]=="object")window.scrollTo(r[0]);else if(r.length===2)window.scrollTo(r[0],r[1]);else throw new Error("Invalid arguments passed to scrollTo. Expected either ScrollToOptions object or x,y coordinates. See https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return I(()=>{const r=()=>{t({x:window.scrollX,y:window.scrollY})};return r(),window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[]),{...e,scrollTo:o}}function W(){const[e,t]=d({width:window.innerWidth,height:window.innerHeight});return I(()=>{const o=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),e}function J(e,{threshold:t=0,root:o=null,rootMargin:r="0%",freezeOnceVisible:i=!1}={}){const[n,s]=d({isIntersecting:!1,entry:null});return v(()=>{const c=e?.current;let u;if(c){if(i&&n.isIntersecting)return;const a=p=>{const[f]=p;s({isIntersecting:f.isIntersecting,entry:f})},l=new IntersectionObserver(a,{threshold:t,root:o,rootMargin:r});l.observe(c),u=()=>{l.disconnect()}}return()=>{u&&u()}},[e,t,o,r,i,n.isIntersecting]),n}function R(){return A(e=>typeof window>"u"?()=>{}:(window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}),()=>typeof navigator>"u"?!0:navigator.onLine,()=>!0)}function q(e,t=500,o){const r=m(),i=$(()=>{const n=S(e,t,o),s=(...c)=>n(...c);return s.cancel=()=>{n.cancel()},s.isPending=()=>!!r.current,s.flush=()=>n.flush(),s},[e,t,o]);return v(()=>{r.current=S(e,t,o)},[e,t,o]),v(()=>()=>{r.current&&r.current.cancel()},[]),i}function B({phoneNumber:e,keyword:t,text:o="Text",signature:r="to"}){var i;e&&(e=((i=N(e))==null?void 0:i.format("NATIONAL").replace("(","").replace(")","").replace(" ","-"))??e);const n={text:o,keyword:t,phoneNumber:e,signature:r};return{...n,displayValue:`${n.text} ${n.keyword} ${n.signature} ${n.phoneNumber}`}}function V(e,t){return`${e}/tts/${t}`}export{H as a,E as b,U as c,j as d,z as e,D as f,M as g,W as h,J as i,R as j,q as k,B as l,V as m,P as u};
|