@wellesley/network 1.0.101 → 1.0.103

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.
Files changed (2) hide show
  1. package/index.mjs +24 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,13 @@
1
- import{createSlice as g}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import E,{forwardRef as R,createElement as y,useRef as L,useEffect as O}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{useDispatch as j,useSelector as C}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{toast as m}from"https://cdn.jsdelivr.net/npm/react-toastify@10.0.5/+esm";function S(){return!(typeof navigator<"u"&&"boolean"==typeof navigator.onLine)||navigator.onLine}const $={isOnline:S()},_=g({name:"network",initialState:$,reducers:{setOnline:(e,{payload:t})=>{e.isOnline=t}},selectors:{selectOnline:e=>e.isOnline}});var w,h,k={exports:{}},a={};
1
+ function jt(e,t){for(var r=0;r<t.length;r++){const n=t[r];if("string"!=typeof n&&!Array.isArray(n))for(const t in n)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Tt(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Mt(e){return Tt(e)&&"type"in e&&"string"==typeof e.type}var at=Symbol.for("immer-nothing"),Be=Symbol.for("immer-draftable"),$=Symbol.for("immer-state");function W(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Y=Object.getPrototypeOf;function H(e){return!!e&&!!e[$]}function V(e){var t;return!!e&&(lt(e)||Array.isArray(e)||!!e[Be]||!(null==(t=e.constructor)||!t[Be])||_e(e)||me(e))}var Dt=Object.prototype.constructor.toString();function lt(e){if(!e||"object"!=typeof e)return!1;const t=Y(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Dt}function re(e,t){0===he(e)?Object.entries(e).forEach((([r,n])=>{t(r,n,e)})):e.forEach(((r,n)=>t(n,r,e)))}function he(e){const t=e[$];return t?t.type_:Array.isArray(e)?1:_e(e)?2:me(e)?3:0}function Oe(e,t){return 2===he(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dt(e,t,r){const n=he(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function It(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function _e(e){return e instanceof Map}function me(e){return e instanceof Set}function K(e){return e.copy_||e.base_}function xe(e,t){if(_e(e))return new Map(e);if(me(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&lt(e))return Y(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[$];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const o=n[t],i=r[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Y(e),r)}function ze(e,t=!1){return ve(e)||H(e)||!V(e)||(he(e)>1&&(e.set=e.add=e.clear=e.delete=zt),Object.freeze(e),t&&re(e,((e,t)=>ze(t,!0)))),e}function zt(){W(2)}function ve(e){return Object.isFrozen(e)}var ne,At={};function J(e){const t=At[e];return t||W(0,e),t}function pt(){return ne}function $t(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ue(e,t){t&&(J("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pe(e){je(e),e.drafts_.forEach(Ft),e.drafts_=null}function je(e){e===ne&&(ne=e.parent_)}function Ve(e){return ne=$t(ne,e)}function Ft(e){const t=e[$];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function He(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[$].modified_&&(Pe(t),W(4)),V(e)&&(e=de(t,e),t.parent_||pe(t,e)),t.patches_&&J("Patches").generateReplacementPatches_(r[$].base_,e,t.patches_,t.inversePatches_)):e=de(t,r,[]),Pe(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==at?e:void 0}function de(e,t,r){if(ve(t))return t;const n=t[$];if(!n)return re(t,((o,i)=>Ke(e,n,t,o,i,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return pe(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let o=t,i=!1;3===n.type_&&(o=new Set(t),t.clear(),i=!0),re(o,((o,u)=>Ke(e,n,t,o,u,r,i))),pe(e,t,!1),r&&e.patches_&&J("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Ke(e,t,r,n,o,i,u){if(H(o)){const u=de(e,o,i&&t&&3!==t.type_&&!Oe(t.assigned_,n)?i.concat(n):void 0);if(dt(r,n,u),!H(u))return;e.canAutoFreeze_=!1}else u&&r.add(o);if(V(o)&&!ve(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;de(e,o),(!t||!t.scope_.parent_)&&pe(e,o)}}function pe(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ze(t,r)}function Nt(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:pt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,i=Ae;r&&(o=[n],i=oe);const{revoke:u,proxy:c}=Proxy.revocable(o,i);return n.draft_=c,n.revoke_=u,c}var Ae={get(e,t){if(t===$)return e;const r=K(e);if(!Oe(r,t))return Lt(e,r,t);const n=r[t];return e.finalized_||!V(n)?n:n===Se(e.base_,t)?(Ce(e),e.copy_[t]=Me(n,e)):n},has:(e,t)=>t in K(e),ownKeys:e=>Reflect.ownKeys(K(e)),set(e,t,r){const n=yt(K(e),t);if(null!=n&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=Se(K(e),t),o=null==n?void 0:n[$];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(It(r,n)&&(void 0!==r||Oe(e.base_,t)))return!0;Ce(e),Te(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Se(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ce(e),Te(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=K(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){W(11)},getPrototypeOf:e=>Y(e.base_),setPrototypeOf(){W(12)}},oe={};function Se(e,t){const r=e[$];return(r?K(r):e)[t]}function Lt(e,t,r){var n;const o=yt(t,r);return o?"value"in o?o.value:null==(n=o.get)?void 0:n.call(e.draft_):void 0}function yt(e,t){if(!(t in e))return;let r=Y(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Y(r)}}function Te(e){e.modified_||(e.modified_=!0,e.parent_&&Te(e.parent_))}function Ce(e){e.copy_||(e.copy_=xe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}re(Ae,((e,t)=>{oe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),oe.deleteProperty=function(e,t){return oe.set.call(this,e,t,void 0)},oe.set=function(e,t,r){return Ae.set.call(this,e[0],t,r,e[0])};var Wt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...o){return n.produce(e,(e=>t.call(this,e,...o)))}}let n;if("function"!=typeof t&&W(6),void 0!==r&&"function"!=typeof r&&W(7),V(e)){const o=Ve(this),i=Me(e,void 0);let u=!0;try{n=t(i),u=!1}finally{u?Pe(o):je(o)}return Ue(o,r),He(n,o)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===at&&(n=void 0),this.autoFreeze_&&ze(n,!0),r){const t=[],o=[];J("Patches").generateReplacementPatches_(e,n,t,o),r(t,o)}return n}W(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){V(e)||W(8),H(e)&&(e=ht(e));const t=Ve(this),r=Me(e,void 0);return r[$].isManual_=!0,je(t),r}finishDraft(e,t){const r=e&&e[$];(!r||!r.isManual_)&&W(9);const{scope_:n}=r;return Ue(n,t),He(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=J("Patches").applyPatches_;return H(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};function Me(e,t){const r=_e(e)?J("MapSet").proxyMap_(e,t):me(e)?J("MapSet").proxySet_(e,t):Nt(e,t);return(t?t.scope_:pt()).drafts_.push(r),r}function ht(e){return H(e)||W(10,e),_t(e)}function _t(e){if(!V(e)||ve(e))return e;const t=e[$];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=xe(e,t.scope_.immer_.useStrictShallowCopy_)}else r=xe(e,!0);return re(r,((e,t)=>{dt(r,e,_t(t))})),t&&(t.finalized_=!1),r}var F=new Wt,mt=F.produce;function qt(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}function Bt(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}function Ut(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const r=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${r}]`)}}F.produceWithPatches.bind(F),F.setAutoFreeze.bind(F),F.setUseStrictShallowCopy.bind(F),F.applyPatches.bind(F),F.createDraft.bind(F),F.finishDraft.bind(F);var Je=e=>Array.isArray(e)?e:[e];function Vt(e){const t=Array.isArray(e[0])?e[0]:e;return Ut(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ht(e,t){const r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Kt=class{constructor(e){this.value=e}deref(){return this.value}},Jt=typeof WeakRef<"u"?WeakRef:Kt,Qt=0,Qe=1;function fe(){return{s:Qt,v:void 0,o:null,p:null}}function $e(e,t={}){let r=fe();const{resultEqualityCheck:n}=t;let o,i=0;function u(){var t;let u=r;const{length:c}=arguments;for(let e=0,t=c;e<t;e++){const t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=u.o;null===e&&(u.o=e=new WeakMap);const r=e.get(t);void 0===r?(u=fe(),e.set(t,u)):u=r}else{let e=u.p;null===e&&(u.p=e=new Map);const r=e.get(t);void 0===r?(u=fe(),e.set(t,u)):u=r}}const a=u;let s;if(u.s===Qe?s=u.v:(s=e.apply(null,arguments),i++),a.s=Qe,n){const e=(null==(t=null==o?void 0:o.deref)?void 0:t.call(o))??o;null!=e&&n(e,s)&&(s=e,0!==i&&i--),o="object"==typeof s&&null!==s||"function"==typeof s?new Jt(s):s}return a.v=s,s}return u.clearCache=()=>{r=fe(),u.resetResultsCount()},u.resultsCount=()=>i,u.resetResultsCount=()=>{i=0},u}function vt(e,...t){const r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n=0,o=0,i={},u=e.pop();"object"==typeof u&&(i=u,u=e.pop()),qt(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...r,...i},{memoize:a,memoizeOptions:s=[],argsMemoize:l=$e,argsMemoizeOptions:f=[],devModeChecks:p={}}=c,d=Je(s),y=Je(f),h=Vt(e),_=a((function(){return n++,u.apply(null,arguments)}),...d),v=l((function(){o++;const e=Ht(h,arguments);return t=_.apply(null,e),t}),...y);return Object.assign(v,{resultFunc:u,memoizedResultFunc:_,dependencies:h,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:a,argsMemoize:l})};return Object.assign(n,{withTypes:()=>n}),n}var Yt=vt($e),Gt=Object.assign(((e,t=Yt)=>{Bt(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const r=Object.keys(e);return t(r.map((t=>e[t])),((...e)=>e.reduce(((e,t,n)=>(e[r[n]]=t,e)),{})))}),{withTypes:()=>Gt}),Xt=(...e)=>{const t=vt(...e),r=Object.assign(((...e)=>{const r=t(...e),n=(e,...t)=>r(H(e)?ht(e):e,...t);return Object.assign(n,r),n}),{withTypes:()=>r});return r};function G(e,t){function r(...r){if(t){let n=t(...r);if(!n)throw new Error(A(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>Mt(t)&&t.type===e,r}function Ye(e){return V(e)?mt(e,(()=>{})):e}function Ge(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw new Error(A(10));const n=r.insert(t,e);return e.set(t,n),n}function wt(e){const t={},r=[];let n;const o={addCase(e,r){const n="string"==typeof e?e:e.type;if(!n)throw new Error(A(28));if(n in t)throw new Error(A(29));return t[n]=r,o},addMatcher:(e,t)=>(r.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(n=e,o)};return e(o),[t,r,n]}function Zt(e){return"function"==typeof e}function er(e,t){let r,[n,o,i]=wt(t);if(Zt(e))r=()=>Ye(e());else{const t=Ye(e);r=()=>t}function u(e=r(),t){let u=[n[t.type],...o.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===u.filter((e=>!!e)).length&&(u=[i]),u.reduce(((e,r)=>{if(r){if(H(e)){const n=r(e,t);return void 0===n?e:n}if(V(e))return mt(e,(e=>r(e,t)));{const n=r(e,t);if(void 0===n){if(null===e)return e;throw new Error(A(9))}return n}}return e}),e)}return u.getInitialState=r,u}Xt($e);var tr="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",rr=(e=21)=>{let t="",r=e;for(;r--;)t+=tr[64*Math.random()|0];return t},nr=Symbol.for("rtk-slice-createasyncthunk");function or(e,t){return`${e}/${t}`}function ir({creators:e}={}){var t;const r=null==(t=null==e?void 0:e.asyncThunk)?void 0:t[nr];return function(e){const{name:t,reducerPath:n=t}=e;if(!t)throw new Error(A(11));const o=("function"==typeof e.reducers?e.reducers(sr()):e.reducers)||{},i=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(e,t){const r="string"==typeof e?e:e.type;if(!r)throw new Error(A(12));if(r in u.sliceCaseReducersByType)throw new Error(A(13));return u.sliceCaseReducersByType[r]=t,c},addMatcher:(e,t)=>(u.sliceMatchers.push({matcher:e,reducer:t}),c),exposeAction:(e,t)=>(u.actionCreators[e]=t,c),exposeCaseReducer:(e,t)=>(u.sliceCaseReducersByName[e]=t,c)};function a(){const[t={},r=[],n]="function"==typeof e.extraReducers?wt(e.extraReducers):[e.extraReducers],o={...t,...u.sliceCaseReducersByType};return er(e.initialState,(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of u.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)}))}i.forEach((n=>{const i=o[n],u={reducerName:n,type:or(t,n),createNotation:"function"==typeof e.reducers};ar(i)?dr(u,i,c,r):fr(u,i,c)}));const s=e=>e,l=new Map;let f;function p(e,t){return f||(f=a()),f(e,t)}function d(){return f||(f=a()),f.getInitialState()}function y(t,r=!1){function n(e){let n=e[t];return typeof n>"u"&&r&&(n=d()),n}function o(t=s){const n=Ge(l,r,{insert:()=>new WeakMap});return Ge(n,t,{insert:()=>{const n={};for(const[o,i]of Object.entries(e.selectors??{}))n[o]=ur(i,t,d,r);return n}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(n)},selectSlice:n}}const h={name:t,reducer:p,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:d,...y(n),injectInto(e,{reducerPath:t,...r}={}){const o=t??n;return e.inject({reducerPath:o,reducer:p},r),{...h,...y(o,!0)}}};return h}}function ur(e,t,r,n){function o(o,...i){let u=t(o);return typeof u>"u"&&n&&(u=r()),e(u,...i)}return o.unwrapped=e,o}var cr=ir();function sr(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}function fr({type:e,reducerName:t,createNotation:r},n,o){let i,u;if("reducer"in n){if(r&&!lr(n))throw new Error(A(17));i=n.reducer,u=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,u?G(e,u):G(e))}function ar(e){return"asyncThunk"===e._reducerDefinitionType}function lr(e){return"reducerWithPrepare"===e._reducerDefinitionType}function dr({type:e,reducerName:t},r,n,o){if(!o)throw new Error(A(18));const{payloadCreator:i,fulfilled:u,pending:c,rejected:a,settled:s,options:l}=r,f=o(e,i,l);n.exposeAction(t,f),u&&n.addCase(f.fulfilled,u),c&&n.addCase(f.pending,c),a&&n.addCase(f.rejected,a),s&&n.addMatcher(f.settled,s),n.exposeCaseReducer(t,{fulfilled:u||ae,pending:c||ae,rejected:a||ae,settled:s||ae})}function ae(){}var pr=(e,t)=>{if("function"!=typeof e)throw new Error(A(32))},Fe="listenerMiddleware",yr=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=G(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(A(21));return pr(i),{predicate:o,type:t,effect:i}},hr=Object.assign((e=>{const{type:t,predicate:r,effect:n}=yr(e);return{id:rr(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(A(22))}}}),{withTypes:()=>hr}),_r=Object.assign(G(`${Fe}/add`),{withTypes:()=>_r});G(`${Fe}/removeAll`);var mr=Object.assign(G(`${Fe}/remove`),{withTypes:()=>mr});function A(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function vr(){return!(typeof navigator<"u"&&"boolean"==typeof navigator.onLine)||navigator.onLine}const wr={isOnline:vr()},De=cr({name:"network",initialState:wr,reducers:{setOnline:(e,{payload:t})=>{e.isOnline=t}},selectors:{selectOnline:e=>e.isOnline}});function gr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xe,Ze,et,tt,Re={exports:{}},Z={},ke={exports:{}},y={};
2
+ /**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */function Sr(){if(Xe)return y;Xe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),s=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d=Object.assign,h={};function _(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||p}function v(){}function m(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||p}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=_.prototype;var b=m.prototype=new v;b.constructor=m,d(b,_.prototype),b.isPureReactComponent=!0;var w=Array.isArray,g=Object.prototype.hasOwnProperty,S={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(t,r,n){var o,i={},u=null,c=null;if(null!=r)for(o in void 0!==r.ref&&(c=r.ref),void 0!==r.key&&(u=""+r.key),r)g.call(r,o)&&!O.hasOwnProperty(o)&&(i[o]=r[o]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];i.children=s}if(t&&t.defaultProps)for(o in a=t.defaultProps)void 0===i[o]&&(i[o]=a[o]);return{$$typeof:e,type:t,key:u,ref:c,props:i,_owner:S.current}}function C(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var j=/\/+/g;function k(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function E(r,n,o,i,u){var c=typeof r;("undefined"===c||"boolean"===c)&&(r=null);var a=!1;if(null===r)a=!0;else switch(c){case"string":case"number":a=!0;break;case"object":switch(r.$$typeof){case e:case t:a=!0}}if(a)return u=u(a=r),r=""===i?"."+k(a,0):i,w(u)?(o="",null!=r&&(o=r.replace(j,"$&/")+"/"),E(u,n,o,"",(function(e){return e}))):null!=u&&(C(u)&&(u=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(u,o+(!u.key||a&&a.key===u.key?"":(""+u.key).replace(j,"$&/")+"/")+r)),n.push(u)),1;if(a=0,i=""===i?".":i+":",w(r))for(var s=0;s<r.length;s++){var l=i+k(c=r[s],s);a+=E(c,n,o,l,u)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(r),"function"==typeof l)for(r=l.call(r),s=0;!(c=r.next()).done;)a+=E(c=c.value,n,o,l=i+k(c,s++),u);else if("object"===c)throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return a}function P(e,t,r){if(null==e)return e;var n=[],o=0;return E(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function x(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)}),(function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var $={current:null},A={transition:null},N={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:A,ReactCurrentOwner:S};return y.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},y.Component=_,y.Fragment=r,y.Profiler=o,y.PureComponent=m,y.StrictMode=n,y.Suspense=a,y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,y.cloneElement=function(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=d({},t.props),i=t.key,u=t.ref,c=t._owner;if(null!=r){if(void 0!==r.ref&&(u=r.ref,c=S.current),void 0!==r.key&&(i=""+r.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(s in r)g.call(r,s)&&!O.hasOwnProperty(s)&&(o[s]=void 0===r[s]&&void 0!==a?a[s]:r[s])}var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){a=Array(s);for(var l=0;l<s;l++)a[l]=arguments[l+2];o.children=a}return{$$typeof:e,type:t.type,key:i,ref:u,props:o,_owner:c}},y.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},y.createElement=R,y.createFactory=function(e){var t=R.bind(null,e);return t.type=e,t},y.createRef=function(){return{current:null}},y.forwardRef=function(e){return{$$typeof:c,render:e}},y.isValidElement=C,y.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:x}},y.memo=function(e,t){return{$$typeof:s,type:e,compare:void 0===t?null:t}},y.startTransition=function(e){var t=A.transition;A.transition={};try{e()}finally{A.transition=t}},y.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},y.useCallback=function(e,t){return $.current.useCallback(e,t)},y.useContext=function(e){return $.current.useContext(e)},y.useDebugValue=function(){},y.useDeferredValue=function(e){return $.current.useDeferredValue(e)},y.useEffect=function(e,t){return $.current.useEffect(e,t)},y.useId=function(){return $.current.useId()},y.useImperativeHandle=function(e,t,r){return $.current.useImperativeHandle(e,t,r)},y.useInsertionEffect=function(e,t){return $.current.useInsertionEffect(e,t)},y.useLayoutEffect=function(e,t){return $.current.useLayoutEffect(e,t)},y.useMemo=function(e,t){return $.current.useMemo(e,t)},y.useReducer=function(e,t,r){return $.current.useReducer(e,t,r)},y.useRef=function(e){return $.current.useRef(e)},y.useState=function(e){return $.current.useState(e)},y.useSyncExternalStore=function(e,t,r){return $.current.useSyncExternalStore(e,t,r)},y.useTransition=function(){return $.current.useTransition()},y.version="18.2.0",y}function Ne(){return Ze||(Ze=1,ke.exports=Sr()),ke.exports
2
11
  /**
3
12
  * @license React
4
13
  * react-jsx-runtime.production.min.js
@@ -7,28 +16,37 @@ import{createSlice as g}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1
7
16
  *
8
17
  * This source code is licensed under the MIT license found in the
9
18
  * LICENSE file in the root directory of this source tree.
10
- */function I(){if(w)return a;w=1;var e=E,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(e,r,i){var a,c={},l=null,u=null;for(a in void 0!==i&&(l=""+i),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)n.call(r,a)&&!s.hasOwnProperty(a)&&(c[a]=r[a]);if(e&&e.defaultProps)for(a in r=e.defaultProps)void 0===c[a]&&(c[a]=r[a]);return{$$typeof:t,type:e,key:l,ref:u,props:c,_owner:o.current}}return a.Fragment=r,a.jsx=i,a.jsxs=i,a}function N(){return h||(h=1,k.exports=I()),k.exports}var q=N();
19
+ */}function Cr(){if(et)return Z;et=1;var e=Ne(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,u){var c,a={},s=null,l=null;for(c in void 0!==u&&(s=""+u),void 0!==r.key&&(s=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,c)&&!i.hasOwnProperty(c)&&(a[c]=r[c]);if(e&&e.defaultProps)for(c in r=e.defaultProps)void 0===a[c]&&(a[c]=r[c]);return{$$typeof:t,type:e,key:s,ref:l,props:a,_owner:o.current}}return Z.Fragment=r,Z.jsx=u,Z.jsxs=u,Z}function Rr(){return tt||(tt=1,Re.exports=Cr()),Re.exports}var kr=Rr(),N=Ne();const gt=gr(N),rt=jt({__proto__:null,default:gt},[N]);var nt,ot,Ee={exports:{}},be={};
20
+ /**
21
+ * @license React
22
+ * use-sync-external-store-with-selector.production.min.js
23
+ *
24
+ * Copyright (c) Facebook, Inc. and its affiliates.
25
+ *
26
+ * This source code is licensed under the MIT license found in the
27
+ * LICENSE file in the root directory of this source tree.
28
+ */function Er(){if(nt)return be;nt=1;var e=Ne();var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,u=e.useDebugValue;return be.useSyncExternalStoreWithSelector=function(e,c,a,s,l){var f=n(null);if(null===f.current){var p={hasValue:!1,value:null};f.current=p}else p=f.current;f=i((function(){function e(e){if(!o){if(o=!0,r=e,e=s(e),void 0!==l&&p.hasValue){var i=p.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var u=s(e);return void 0!==l&&l(i,u)?i:(r=e,n=u)}var r,n,o=!1,i=void 0===a?null:a;return[function(){return e(c())},null===i?void 0:function(){return e(i())}]}),[c,a,s,l]);var d=r(e,f[0],f[1]);return o((function(){p.hasValue=!0,p.value=d}),[d]),u(d),d},be}function br(){return ot||(ot=1,Ee.exports=Er()),Ee.exports}var Or=br(),U="default"in rt?gt:rt,it=Symbol.for("react-redux-context"),ut=typeof globalThis<"u"?globalThis:{};function xr(){if(!U.createContext)return{};const e=ut[it]??(ut[it]=new Map);let t=e.get(U.createContext);return t||(t=U.createContext(null),e.set(U.createContext,t)),t}var Q=xr(),Pr=()=>{throw new Error("uSES not initialized!")};function Le(e=Q){return function(){return U.useContext(e)}}var St=Le(),Ct=Pr,jr=e=>{Ct=e},Tr=(e,t)=>e===t;function Mr(e=Q){const t=e===Q?St:Le(e),r=(e,r={})=>{const{equalityFn:n=Tr,devModeChecks:o={}}="function"==typeof r?{equalityFn:r}:r,{store:i,subscription:u,getServerState:c,stabilityCheck:a,identityFunctionCheck:s}=t();U.useRef(!0);const l=U.useCallback({[e.name]:t=>e(t)}[e.name],[e,a,o.stabilityCheck]),f=Ct(u.addNestedSub,i.getState,c||i.getState,l,n);return U.useDebugValue(f),f};return Object.assign(r,{withTypes:()=>r}),r}var Dr=Mr(),Ir=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rt(e=Q){const t=e===Q?St:Le(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}Ir?U.useLayoutEffect:U.useEffect;var zr=Rt();function Ar(e=Q){const t=e===Q?zr:Rt(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var $r=Ar();jr(Or.useSyncExternalStoreWithSelector);const We=e=>"number"==typeof e&&!isNaN(e),ee=e=>"string"==typeof e,kt=e=>"function"==typeof e,Fr=e=>N.isValidElement(e)||ee(e)||kt(e)||We(e),B=new Map;let Ie=[];const ct=new Set,Et=()=>B.size>0;function Nr(e,t){var r;if(t)return!(null==(r=B.get(t))||!r.isToastActive(e));let n=!1;return B.forEach((t=>{t.isToastActive(e)&&(n=!0)})),n}function Lr(e,t){Fr(e)&&(Et()||Ie.push({content:e,options:t}),B.forEach((r=>{r.buildToast(e,t)})))}function st(e,t){B.forEach((r=>{null!=t&&null!=t&&t.containerId?(null==t?void 0:t.containerId)===r.id&&r.toggle(e,null==t?void 0:t.id):r.toggle(e,null==t?void 0:t.id)}))}let Wr=1;const bt=()=>""+Wr++;function qr(e){return e&&(ee(e.toastId)||We(e.toastId))?e.toastId:bt()}function te(e,t){return Lr(e,t),t.toastId}function ye(e,t){return{...t,type:t&&t.type||e,toastId:qr(t)}}function le(e){return(t,r)=>te(t,ye(e,r))}function R(e,t){return te(e,ye("default",t))}R.loading=(e,t)=>te(e,ye("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),R.promise=function(e,t,r){let n,{pending:o,error:i,success:u}=t;o&&(n=ee(o)?R.loading(o,r):R.loading(o.render,{...r,...o}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},a=(e,t,o)=>{if(null==t)return void R.dismiss(n);const i={type:e,...c,...r,data:o},u=ee(t)?{render:t}:t;return n?R.update(n,{...i,...u}):R(u.render,{...i,...u}),o},s=kt(e)?e():e;return s.then((e=>a("success",u,e))).catch((e=>a("error",i,e))),s},R.success=le("success"),R.info=le("info"),R.error=le("error"),R.warning=le("warning"),R.warn=R.warning,R.dark=(e,t)=>te(e,ye("default",{theme:"dark",...t})),R.dismiss=function(e){!function(e){var t;if(Et()){if(null==e||ee(t=e)||We(t))B.forEach((t=>{t.removeToast(e)}));else if(e&&("containerId"in e||"id"in e)){const t=B.get(e.containerId);t?t.removeToast(e.id):B.forEach((t=>{t.removeToast(e.id)}))}}else Ie=Ie.filter((t=>null!=e&&t.options.toastId!==e))}(e)},R.clearWaitingQueue=function(e){void 0===e&&(e={}),B.forEach((t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()}))},R.isActive=Nr,R.update=function(e,t){void 0===t&&(t={});const r=((e,t)=>{var r;let{containerId:n}=t;return null==(r=B.get(n||1))?void 0:r.toasts.get(e)})(e,t);if(r){const{props:n,content:o}=r,i={delay:100,...n,...t,toastId:t.toastId||e,updateId:bt()};i.toastId!==e&&(i.staleId=e);const u=i.render||o;delete i.render,te(u,i)}},R.done=e=>{R.update(e,{progress:1})},R.onChange=function(e){return ct.add(e),()=>{ct.delete(e)}},R.play=e=>st(!0,e),R.pause=e=>st(!1,e)
11
29
  /**
12
30
  * @license lucide-react v0.471.2 - ISC
13
31
  *
14
32
  * This source code is licensed under the ISC license.
15
33
  * See the LICENSE file in the root directory of this source tree.
16
- */const M=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b=(...e)=>e.filter(((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t)).join(" ").trim()
34
+ */;const Br=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ot=(...e)=>e.filter(((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t)).join(" ").trim()
17
35
  /**
18
36
  * @license lucide-react v0.471.2 - ISC
19
37
  *
20
38
  * This source code is licensed under the ISC license.
21
39
  * See the LICENSE file in the root directory of this source tree.
22
- */;var A={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
40
+ */;var Ur={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
23
41
  /**
24
42
  * @license lucide-react v0.471.2 - ISC
25
43
  *
26
44
  * This source code is licensed under the ISC license.
27
45
  * See the LICENSE file in the root directory of this source tree.
28
- */const J=R((({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...a},c)=>y("svg",{ref:c,...A,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:b("lucide",o),...a},[...i.map((([e,t])=>y(e,t))),...Array.isArray(s)?s:[s]]))),P=(e,t)=>{const r=R((({className:r,...n},o)=>y(J,{ref:o,iconNode:t,className:b(`lucide-${M(e)}`,r),...n})));return r.displayName=`${e}`,r},W=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],B=P("WifiOff",W);
46
+ */const Vr=N.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:u,...c},a)=>N.createElement("svg",{ref:a,...Ur,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:Ot("lucide",o),...c},[...u.map((([e,t])=>N.createElement(e,t))),...Array.isArray(i)?i:[i]]))),Hr=(e,t)=>{const r=N.forwardRef((({className:r,...n},o)=>N.createElement(Vr,{ref:o,iconNode:t,className:Ot(`lucide-${Br(e)}`,r),...n})));return r.displayName=`${e}`,r},Kr=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Jr=Hr("WifiOff",Kr);
29
47
  /**
30
48
  * @license lucide-react v0.471.2 - ISC
31
49
  *
32
50
  * This source code is licensed under the ISC license.
33
51
  * See the LICENSE file in the root directory of this source tree.
34
- */function x(e,t,r=window){const n=L(t);O((()=>{n.current=t}),[t]),O((()=>{if(!r)return;const t=e=>n.current(e);return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}}),[e,r])}function Y(){const e=j(),t=L(null);function r(){t.current&&(m.dismiss(t.current),t.current=null)}x("online",(()=>{e(_.actions.setOnline(!0)),r(),t.current=m.success("Connection restored")})),x("offline",(()=>{e(_.actions.setOnline(!1)),r(),t.current=m.error("Your network is unavailable",{icon:()=>q.jsx(B,{}),autoClose:1e4})}))}const z=()=>C(_.selectors.selectOnline);export{_ as networkSlice,z as useIsOnline,Y as useNetworkStatusListener};
52
+ */function ft(e,t,r=window){const n=N.useRef(t);N.useEffect((()=>{n.current=t}),[t]),N.useEffect((()=>{if(!r)return;const t=e=>n.current(e);return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}}),[e,r])}function Qr(){const e=$r(),t=N.useRef(null);function r(){t.current&&(R.dismiss(t.current),t.current=null)}ft("online",(()=>{e(De.actions.setOnline(!0)),r(),t.current=R.success("Connection restored")})),ft("offline",(()=>{e(De.actions.setOnline(!1)),r(),t.current=R.error("Your network is unavailable",{icon:()=>kr.jsx(Jr,{}),autoClose:1e4})}))}const Yr=()=>Dr(De.selectors.selectOnline);export{De as networkSlice,Yr as useIsOnline,Qr as useNetworkStatusListener};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wellesley/network",
3
- "version": "1.0.101",
3
+ "version": "1.0.103",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",
6
6
  "files": [