@nizza/core 0.8.0-beta.2 → 0.8.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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var J0=Object.defineProperty;var X0=(t,e,n)=>e in t?J0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Pe=(t,e,n)=>X0(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("react"),Q0=require("react/jsx-runtime"),Z0=require("react-dom");function eS(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Dn={};let tS=0;function Ju(t,e){const n=`atom${++tS}`,r={toString(){return(Dn?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=nS,r.write=rS),r}function nS(t){return t(this)}function rS(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const hp=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,hl=t=>"init"in t,pl=t=>!!t.write,wu=new WeakMap,$d=t=>{var e;return jd(t)&&!((e=wu.get(t))!=null&&e[1])},iS=(t,e)=>{const n=wu.get(t);if(n)n[1]=!0,n[0].forEach(r=>r(e));else if((Dn?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},sS=t=>{if(wu.has(t))return;const e=[new Set,!1];wu.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},jd=t=>typeof(t==null?void 0:t.then)=="function",pp=t=>"v"in t||"e"in t,Pa=t=>{if("e"in t)throw t.e;if((Dn?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},Ty=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},mp=(t,e,n,r,i)=>{var s;if((Dn?"production":void 0)!=="production"&&r===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),$d(n.v)&&Ty(e,n.v,i),(s=i.m)==null||s.t.add(e),t&&oS(t,r,e)},qi=()=>[new Map,new Map,new Set],ml=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},oS=(t,e,n)=>{const r=t[0].get(e);r&&r.add(n)},aS=(t,e)=>t[0].get(e),gp=(t,e)=>{t[2].add(e)},ti=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(s=>s())}),n.forEach(r=>r())}},Oy=t=>{let e;(Dn?"production":void 0)!=="production"&&(e=new Set);const n=(w,k,C)=>{const E="v"in k,O=k.v,I=$d(k.v)?k.v:null;if(jd(C)){sS(C);for(const M of k.d.keys())Ty(w,C,t(M,k));k.v=C,delete k.e}else k.v=C,delete k.e;(!E||!Object.is(O,k.v))&&(++k.n,I&&iS(I,C))},r=(w,k,C,E)=>{var O;if(!(E!=null&&E(k))&&pp(C)&&(C.m||Array.from(C.d).every(([se,H])=>r(w,se,t(se,C),E).n===H)))return C;C.d.clear();let I=!0;const M=se=>{if(hp(k,se)){const ie=t(se,C);if(!pp(ie))if(hl(se))n(se,ie,se.init);else throw new Error("no atom init");return Pa(ie)}const H=r(w,se,t(se,C),E);if(I)mp(w,k,C,se,H);else{const ie=qi();mp(ie,k,C,se,H),u(ie,k,C),ti(ie)}return Pa(H)};let Y,ee;const F={get signal(){return Y||(Y=new AbortController),Y.signal},get setSelf(){return(Dn?"production":void 0)!=="production"&&!pl(k)&&console.warn("setSelf function cannot be used with read-only atom"),!ee&&pl(k)&&(ee=(...se)=>{if((Dn?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)return c(k,...se)}),ee}};try{const se=k.read(M,F);if(n(k,C,se),jd(se)){(O=se.onCancel)==null||O.call(se,()=>Y==null?void 0:Y.abort());const H=()=>{if(C.m){const ie=qi();u(ie,k,C),ti(ie)}};se.then(H,H)}return C}catch(se){return delete C.v,C.e=se,++C.n,C}finally{I=!1}},i=w=>Pa(r(void 0,w,t(w))),s=(w,k,C)=>{var E,O;const I=new Map;for(const M of((E=C.m)==null?void 0:E.t)||[])I.set(M,t(M,C));for(const M of C.p)I.set(M,t(M,C));return(O=aS(w,k))==null||O.forEach(M=>{I.set(M,t(M,C))}),I},o=(w,k,C)=>{const E=[],O=new Set,I=(ee,F)=>{if(!O.has(ee)){O.add(ee);for(const[se,H]of s(w,ee,F))ee!==se&&I(se,H);E.push([ee,F,F.n])}};I(k,C);const M=new Set([k]),Y=ee=>O.has(ee);for(let ee=E.length-1;ee>=0;--ee){const[F,se,H]=E[ee];let ie=!1;for(const xe of se.d.keys())if(xe!==F&&M.has(xe)){ie=!0;break}ie&&(r(w,F,se,Y),u(w,F,se),H!==se.n&&(ml(w,F,se),M.add(F))),O.delete(F)}},a=(w,k,C,...E)=>{const O=Y=>Pa(r(w,Y,t(Y,C))),I=(Y,...ee)=>{const F=t(Y,C);let se;if(hp(k,Y)){if(!hl(Y))throw new Error("atom not writable");const H="v"in F,ie=F.v,xe=ee[0];n(Y,F,xe),u(w,Y,F),(!H||!Object.is(ie,F.v))&&(ml(w,Y,F),o(w,Y,F))}else se=a(w,Y,F,...ee);return ti(w),se};return k.write(O,I,...E)},c=(w,...k)=>{const C=qi(),E=a(C,w,t(w),...k);return ti(C),E},u=(w,k,C)=>{if(C.m&&!$d(C.v)){for(const E of C.d.keys())C.m.d.has(E)||(d(w,E,t(E,C)).t.add(k),C.m.d.add(E));for(const E of C.m.d||[])if(!C.d.has(E)){C.m.d.delete(E);const O=h(w,E,t(E,C));O==null||O.t.delete(k)}}},d=(w,k,C)=>{if(!C.m){r(w,k,C);for(const E of C.d.keys())d(w,E,t(E,C)).t.add(k);if(C.m={l:new Set,d:new Set(C.d.keys()),t:new Set},(Dn?"production":void 0)!=="production"&&e.add(k),pl(k)&&k.onMount){const E=C.m,{onMount:O}=k;gp(w,()=>{const I=O((...M)=>a(w,k,C,...M));I&&(E.u=I)})}}return C.m},h=(w,k,C)=>{if(C.m&&!C.m.l.size&&!Array.from(C.m.t).some(E=>{var O;return(O=t(E,C).m)==null?void 0:O.d.has(k)})){const E=C.m.u;E&&gp(w,E),delete C.m,(Dn?"production":void 0)!=="production"&&e.delete(k);for(const O of C.d.keys()){const I=h(w,O,t(O,C));I==null||I.t.delete(k)}return}return C.m},v={get:i,set:c,sub:(w,k)=>{const C=qi(),E=t(w),O=d(C,w,E);ti(C);const I=O.l;return I.add(k),()=>{I.delete(k);const M=qi();h(M,w,E),ti(M)}},unstable_derive:w=>Oy(...w(t))};return(Dn?"production":void 0)!=="production"&&Object.assign(v,{dev4_get_internal_weak_map:()=>({get:k=>{const C=t(k);if(C.n!==0)return C}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:k=>{const C=qi();for(const[E,O]of k)if(hl(E)){const I=t(E),M="v"in I,Y=I.v;n(E,I,O),u(C,E,I),(!M||!Object.is(Y,I.v))&&(ml(C,E,I),o(C,E,I))}ti(C)}}),v},uS=()=>{const t=new WeakMap;return Oy(n=>{let r=t.get(n);return r||(r={d:new Map,p:new Set,n:0},t.set(n,r)),r})};let zs;const cS=()=>(zs||(zs=uS(),(Dn?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=zs),globalThis.__JOTAI_DEFAULT_STORE__!==zs&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),zs),Iy={},lS=st.createContext(void 0),Ry=t=>st.useContext(lS)||cS(),Py=t=>typeof(t==null?void 0:t.then)=="function",dS=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},fS=st.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(dS(t),t)}),gl=new WeakMap,hS=t=>{let e=gl.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>u=>{i===c&&n(u)},o=c=>u=>{i===c&&r(u)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(u=>{if((Iy?"production":void 0)!=="production"&&u===c)throw new Error("[Bug] p is not updated even after cancelation");Py(u)?(gl.set(u,e),i=u,u.then(s(u),o(u)),a(u)):n(u)})};t.then(s(t),o(t)),a(t)}),gl.set(t,e)),e};function Vd(t,e){const n=Ry(),[[r,i,s],o]=st.useReducer(u=>{const d=n.get(t);return Object.is(u[0],d)&&u[1]===n&&u[2]===t?u:[d,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),st.useEffect(()=>{const u=n.sub(t,()=>{o()});return o(),u},[n,t,void 0]),st.useDebugValue(a),Py(a)){const u=hS(a);return fS(u)}return a}function zf(t,e){const n=Ry();return st.useCallback((...i)=>{if((Iy?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function vl(t,e){return[Vd(t),zf(t)]}const Dy=Ju(null);Dy.debugLabel="accountAtom";const pS={},{NZ_CORE_SERVICES_GRAPHQL_URL:mS,NZ_CORE_SERVICES_REST_URL:gS}=pS,bs={apiUrls:{restV2:gS||"https://core-services-dev.nizza.com/api",graphql:mS||"https://core-services-dev.nizza.com/graphql"},publicUrls:{wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};var vS="Logging",yS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Hi=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bS(arguments[e]));return t},vp={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},Rn;(function(t){t.DEBUG="DEBUG",t.ERROR="ERROR",t.INFO="INFO",t.WARN="WARN",t.VERBOSE="VERBOSE"})(Rn||(Rn={}));var $n=function(){function t(e,n){n===void 0&&(n=Rn.WARN),this.name=e,this.level=n,this._pluggables=[]}return t.prototype._padding=function(e){return e<10?"0"+e:""+e},t.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},t.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},t.prototype._log=function(e){for(var n,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];var o=this.level;t.LOG_LEVEL&&(o=t.LOG_LEVEL),typeof window!="undefined"&&window.LOG_LEVEL&&(o=window.LOG_LEVEL);var a=vp[o],c=vp[e];if(c>=a){var u=console.log.bind(console);e===Rn.ERROR&&console.error&&(u=console.error.bind(console)),e===Rn.WARN&&console.warn&&(u=console.warn.bind(console));var d="["+e+"] "+this._ts()+" "+this.name,h="";if(i.length===1&&typeof i[0]=="string")h=d+" - "+i[0],u(h);else if(i.length===1)h=d+" "+i[0],u(d,i[0]);else if(typeof i[0]=="string"){var p=i.slice(1);p.length===1&&(p=p[0]),h=d+" - "+i[0]+" "+p,u(d+" - "+i[0],p)}else h=d+" "+i,u(d,i);try{for(var y=yS(this._pluggables),v=y.next();!v.done;v=y.next()){var w=v.value,k={message:h,timestamp:Date.now()};w.pushLogs([k])}}catch(C){n={error:C}}finally{try{v&&!v.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.INFO],e))},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.INFO],e))},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.WARN],e))},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.ERROR],e))},t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.DEBUG],e))},t.prototype.verbose=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.VERBOSE],e))},t.prototype.addPluggable=function(e){e&&e.getCategoryName()===vS&&(this._pluggables.push(e),e.configure(this._config))},t.prototype.listPluggables=function(){return this._pluggables},t.LOG_LEVEL=null,t}(),wS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},yl=new $n("Amplify"),_S=function(){function t(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=$n,this.ServiceWorker=null}return t.prototype.register=function(e){yl.debug("component registered in amplify",e),this._components.push(e),typeof e.getModuleName=="function"?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):yl.debug("no getModuleName method for component",e),e.configure(this._config)},t.prototype.configure=function(e){var n=this;return e?(this._config=Object.assign(this._config,e),yl.debug("amplify config",this._config),Object.entries(this._modules).forEach(function(r){var i=wS(r,2);i[0];var s=i[1];Object.keys(s).forEach(function(o){n._modules[o]&&(s[o]=n._modules[o])})}),this._components.map(function(r){r.configure(n._config)}),this._config):this._config},t.prototype.addPluggable=function(e){e&&e.getCategory&&typeof e.getCategory=="function"&&this._components.map(function(n){n.addPluggable&&typeof n.addPluggable=="function"&&n.addPluggable(e)})},t}(),Gf=new _S,SS="4.7.14",qd="aws-amplify/"+SS,ui={userAgent:qd+" js",product:"",navigator:null,isReactNative:!1};if(typeof navigator!="undefined"&&navigator.product)switch(ui.product=navigator.product||"",ui.navigator=navigator||null,navigator.product){case"ReactNative":ui.userAgent=qd+" react-native",ui.isReactNative=!0;break;default:ui.userAgent=qd+" js",ui.isReactNative=!1;break}var kS=function(t){return""+ui.userAgent},xo=function(){return xo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xo.apply(this,arguments)},Fy=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},yp=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fy(arguments[e]));return t},tr=new $n("Hub"),ES=typeof Symbol!="undefined"&&typeof Symbol.for=="function"?Symbol.for("amplify_default"):"@@amplify_default";function AS(t){return t.onHubCapsule!==void 0}var CS=function(){function t(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return t.prototype.remove=function(e,n){if(e instanceof RegExp){var r=this.patterns.find(function(s){var o=s.pattern;return o.source===e.source});if(!r){tr.warn("No listeners for "+e);return}this.patterns=yp(this.patterns.filter(function(s){return s!==r}))}else{var i=this.listeners[e];if(!i){tr.warn("No listeners for "+e);return}this.listeners[e]=yp(i.filter(function(s){var o=s.callback;return o!==n}))}},t.prototype.dispatch=function(e,n,r,i){if(r===void 0&&(r=""),this.protectedChannels.indexOf(e)>-1){var s=i===ES;s||tr.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences")}var o={channel:e,payload:xo({},n),source:r,patternInfo:[]};try{this._toListeners(o)}catch(a){tr.error(a)}},t.prototype.listen=function(e,n,r){var i=this;r===void 0&&(r="noname");var s;if(AS(n))tr.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),s=n.onHubCapsule.bind(n);else{if(typeof n!="function")throw new Error("No callback supplied to Hub");s=n}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:s});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:r,callback:s})}return function(){i.remove(e,s)}},t.prototype._toListeners=function(e){var n=e.channel,r=e.payload,i=this.listeners[n];if(i&&i.forEach(function(o){tr.debug("Dispatching to "+n+" with ",r);try{o.callback(e)}catch(a){tr.error(a)}}),this.patterns.length>0){if(!r.message){tr.warn("Cannot perform pattern matching without a message key");return}var s=r.message;this.patterns.forEach(function(o){var a=s.match(o.pattern);if(a){var c=Fy(a),u=c.slice(1),d=xo(xo({},e),{patternInfo:u});try{o.callback(d)}catch(h){tr.error(h)}}})}},t}(),Nr=new CS("__default__"),xS=function(t){if(t.isResolved)return t;var e=!0,n=!1,r=!1,i=t.then(function(s){return r=!0,e=!1,s},function(s){throw n=!0,e=!1,s});return i.isFullfilled=function(){return r},i.isPending=function(){return e},i.isRejected=function(){return n},i},ur=function(){var t=typeof window!="undefined"&&typeof window.document!="undefined",e=typeof process!="undefined"&&process.versions!=null&&process.versions.node!=null;return{isBrowser:t,isNode:e}},Mr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Hr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ws(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}/*! *****************************************************************************
1
+ "use strict";var J0=Object.defineProperty;var X0=(t,e,n)=>e in t?J0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Pe=(t,e,n)=>X0(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("react"),Q0=require("react/jsx-runtime"),Z0=require("react-dom");function eS(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Dn={};let tS=0;function Ju(t,e){const n=`atom${++tS}`,r={toString(){return(Dn?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=nS,r.write=rS),r}function nS(t){return t(this)}function rS(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const hp=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,hl=t=>"init"in t,pl=t=>!!t.write,wu=new WeakMap,$d=t=>{var e;return jd(t)&&!((e=wu.get(t))!=null&&e[1])},iS=(t,e)=>{const n=wu.get(t);if(n)n[1]=!0,n[0].forEach(r=>r(e));else if((Dn?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},sS=t=>{if(wu.has(t))return;const e=[new Set,!1];wu.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},jd=t=>typeof(t==null?void 0:t.then)=="function",pp=t=>"v"in t||"e"in t,Pa=t=>{if("e"in t)throw t.e;if((Dn?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},Ty=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},mp=(t,e,n,r,i)=>{var s;if((Dn?"production":void 0)!=="production"&&r===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),$d(n.v)&&Ty(e,n.v,i),(s=i.m)==null||s.t.add(e),t&&oS(t,r,e)},qi=()=>[new Map,new Map,new Set],ml=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},oS=(t,e,n)=>{const r=t[0].get(e);r&&r.add(n)},aS=(t,e)=>t[0].get(e),gp=(t,e)=>{t[2].add(e)},ti=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(s=>s())}),n.forEach(r=>r())}},Oy=t=>{let e;(Dn?"production":void 0)!=="production"&&(e=new Set);const n=(w,k,C)=>{const E="v"in k,O=k.v,I=$d(k.v)?k.v:null;if(jd(C)){sS(C);for(const M of k.d.keys())Ty(w,C,t(M,k));k.v=C,delete k.e}else k.v=C,delete k.e;(!E||!Object.is(O,k.v))&&(++k.n,I&&iS(I,C))},r=(w,k,C,E)=>{var O;if(!(E!=null&&E(k))&&pp(C)&&(C.m||Array.from(C.d).every(([se,H])=>r(w,se,t(se,C),E).n===H)))return C;C.d.clear();let I=!0;const M=se=>{if(hp(k,se)){const ie=t(se,C);if(!pp(ie))if(hl(se))n(se,ie,se.init);else throw new Error("no atom init");return Pa(ie)}const H=r(w,se,t(se,C),E);if(I)mp(w,k,C,se,H);else{const ie=qi();mp(ie,k,C,se,H),u(ie,k,C),ti(ie)}return Pa(H)};let Y,ee;const F={get signal(){return Y||(Y=new AbortController),Y.signal},get setSelf(){return(Dn?"production":void 0)!=="production"&&!pl(k)&&console.warn("setSelf function cannot be used with read-only atom"),!ee&&pl(k)&&(ee=(...se)=>{if((Dn?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)return c(k,...se)}),ee}};try{const se=k.read(M,F);if(n(k,C,se),jd(se)){(O=se.onCancel)==null||O.call(se,()=>Y==null?void 0:Y.abort());const H=()=>{if(C.m){const ie=qi();u(ie,k,C),ti(ie)}};se.then(H,H)}return C}catch(se){return delete C.v,C.e=se,++C.n,C}finally{I=!1}},i=w=>Pa(r(void 0,w,t(w))),s=(w,k,C)=>{var E,O;const I=new Map;for(const M of((E=C.m)==null?void 0:E.t)||[])I.set(M,t(M,C));for(const M of C.p)I.set(M,t(M,C));return(O=aS(w,k))==null||O.forEach(M=>{I.set(M,t(M,C))}),I},o=(w,k,C)=>{const E=[],O=new Set,I=(ee,F)=>{if(!O.has(ee)){O.add(ee);for(const[se,H]of s(w,ee,F))ee!==se&&I(se,H);E.push([ee,F,F.n])}};I(k,C);const M=new Set([k]),Y=ee=>O.has(ee);for(let ee=E.length-1;ee>=0;--ee){const[F,se,H]=E[ee];let ie=!1;for(const xe of se.d.keys())if(xe!==F&&M.has(xe)){ie=!0;break}ie&&(r(w,F,se,Y),u(w,F,se),H!==se.n&&(ml(w,F,se),M.add(F))),O.delete(F)}},a=(w,k,C,...E)=>{const O=Y=>Pa(r(w,Y,t(Y,C))),I=(Y,...ee)=>{const F=t(Y,C);let se;if(hp(k,Y)){if(!hl(Y))throw new Error("atom not writable");const H="v"in F,ie=F.v,xe=ee[0];n(Y,F,xe),u(w,Y,F),(!H||!Object.is(ie,F.v))&&(ml(w,Y,F),o(w,Y,F))}else se=a(w,Y,F,...ee);return ti(w),se};return k.write(O,I,...E)},c=(w,...k)=>{const C=qi(),E=a(C,w,t(w),...k);return ti(C),E},u=(w,k,C)=>{if(C.m&&!$d(C.v)){for(const E of C.d.keys())C.m.d.has(E)||(d(w,E,t(E,C)).t.add(k),C.m.d.add(E));for(const E of C.m.d||[])if(!C.d.has(E)){C.m.d.delete(E);const O=h(w,E,t(E,C));O==null||O.t.delete(k)}}},d=(w,k,C)=>{if(!C.m){r(w,k,C);for(const E of C.d.keys())d(w,E,t(E,C)).t.add(k);if(C.m={l:new Set,d:new Set(C.d.keys()),t:new Set},(Dn?"production":void 0)!=="production"&&e.add(k),pl(k)&&k.onMount){const E=C.m,{onMount:O}=k;gp(w,()=>{const I=O((...M)=>a(w,k,C,...M));I&&(E.u=I)})}}return C.m},h=(w,k,C)=>{if(C.m&&!C.m.l.size&&!Array.from(C.m.t).some(E=>{var O;return(O=t(E,C).m)==null?void 0:O.d.has(k)})){const E=C.m.u;E&&gp(w,E),delete C.m,(Dn?"production":void 0)!=="production"&&e.delete(k);for(const O of C.d.keys()){const I=h(w,O,t(O,C));I==null||I.t.delete(k)}return}return C.m},v={get:i,set:c,sub:(w,k)=>{const C=qi(),E=t(w),O=d(C,w,E);ti(C);const I=O.l;return I.add(k),()=>{I.delete(k);const M=qi();h(M,w,E),ti(M)}},unstable_derive:w=>Oy(...w(t))};return(Dn?"production":void 0)!=="production"&&Object.assign(v,{dev4_get_internal_weak_map:()=>({get:k=>{const C=t(k);if(C.n!==0)return C}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:k=>{const C=qi();for(const[E,O]of k)if(hl(E)){const I=t(E),M="v"in I,Y=I.v;n(E,I,O),u(C,E,I),(!M||!Object.is(Y,I.v))&&(ml(C,E,I),o(C,E,I))}ti(C)}}),v},uS=()=>{const t=new WeakMap;return Oy(n=>{let r=t.get(n);return r||(r={d:new Map,p:new Set,n:0},t.set(n,r)),r})};let zs;const cS=()=>(zs||(zs=uS(),(Dn?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=zs),globalThis.__JOTAI_DEFAULT_STORE__!==zs&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),zs),Iy={},lS=st.createContext(void 0),Ry=t=>st.useContext(lS)||cS(),Py=t=>typeof(t==null?void 0:t.then)=="function",dS=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},fS=st.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(dS(t),t)}),gl=new WeakMap,hS=t=>{let e=gl.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>u=>{i===c&&n(u)},o=c=>u=>{i===c&&r(u)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(u=>{if((Iy?"production":void 0)!=="production"&&u===c)throw new Error("[Bug] p is not updated even after cancelation");Py(u)?(gl.set(u,e),i=u,u.then(s(u),o(u)),a(u)):n(u)})};t.then(s(t),o(t)),a(t)}),gl.set(t,e)),e};function Vd(t,e){const n=Ry(),[[r,i,s],o]=st.useReducer(u=>{const d=n.get(t);return Object.is(u[0],d)&&u[1]===n&&u[2]===t?u:[d,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),st.useEffect(()=>{const u=n.sub(t,()=>{o()});return o(),u},[n,t,void 0]),st.useDebugValue(a),Py(a)){const u=hS(a);return fS(u)}return a}function zf(t,e){const n=Ry();return st.useCallback((...i)=>{if((Iy?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function vl(t,e){return[Vd(t),zf(t)]}const Dy=Ju(null);Dy.debugLabel="accountAtom";const pS={},{NZ_CORE_SERVICES_GRAPHQL_URL:mS,NZ_CORE_SERVICES_REST_URL:gS}=pS,bs={apiUrls:{restV2:gS||"https://core-services-prod.nizza.com/api",graphql:mS||"https://core-services-prod.nizza.com/graphql"},publicUrls:{wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};var vS="Logging",yS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Hi=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bS(arguments[e]));return t},vp={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},Rn;(function(t){t.DEBUG="DEBUG",t.ERROR="ERROR",t.INFO="INFO",t.WARN="WARN",t.VERBOSE="VERBOSE"})(Rn||(Rn={}));var $n=function(){function t(e,n){n===void 0&&(n=Rn.WARN),this.name=e,this.level=n,this._pluggables=[]}return t.prototype._padding=function(e){return e<10?"0"+e:""+e},t.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},t.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},t.prototype._log=function(e){for(var n,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];var o=this.level;t.LOG_LEVEL&&(o=t.LOG_LEVEL),typeof window!="undefined"&&window.LOG_LEVEL&&(o=window.LOG_LEVEL);var a=vp[o],c=vp[e];if(c>=a){var u=console.log.bind(console);e===Rn.ERROR&&console.error&&(u=console.error.bind(console)),e===Rn.WARN&&console.warn&&(u=console.warn.bind(console));var d="["+e+"] "+this._ts()+" "+this.name,h="";if(i.length===1&&typeof i[0]=="string")h=d+" - "+i[0],u(h);else if(i.length===1)h=d+" "+i[0],u(d,i[0]);else if(typeof i[0]=="string"){var p=i.slice(1);p.length===1&&(p=p[0]),h=d+" - "+i[0]+" "+p,u(d+" - "+i[0],p)}else h=d+" "+i,u(d,i);try{for(var y=yS(this._pluggables),v=y.next();!v.done;v=y.next()){var w=v.value,k={message:h,timestamp:Date.now()};w.pushLogs([k])}}catch(C){n={error:C}}finally{try{v&&!v.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.INFO],e))},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.INFO],e))},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.WARN],e))},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.ERROR],e))},t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.DEBUG],e))},t.prototype.verbose=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.VERBOSE],e))},t.prototype.addPluggable=function(e){e&&e.getCategoryName()===vS&&(this._pluggables.push(e),e.configure(this._config))},t.prototype.listPluggables=function(){return this._pluggables},t.LOG_LEVEL=null,t}(),wS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},yl=new $n("Amplify"),_S=function(){function t(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=$n,this.ServiceWorker=null}return t.prototype.register=function(e){yl.debug("component registered in amplify",e),this._components.push(e),typeof e.getModuleName=="function"?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):yl.debug("no getModuleName method for component",e),e.configure(this._config)},t.prototype.configure=function(e){var n=this;return e?(this._config=Object.assign(this._config,e),yl.debug("amplify config",this._config),Object.entries(this._modules).forEach(function(r){var i=wS(r,2);i[0];var s=i[1];Object.keys(s).forEach(function(o){n._modules[o]&&(s[o]=n._modules[o])})}),this._components.map(function(r){r.configure(n._config)}),this._config):this._config},t.prototype.addPluggable=function(e){e&&e.getCategory&&typeof e.getCategory=="function"&&this._components.map(function(n){n.addPluggable&&typeof n.addPluggable=="function"&&n.addPluggable(e)})},t}(),Gf=new _S,SS="4.7.14",qd="aws-amplify/"+SS,ui={userAgent:qd+" js",product:"",navigator:null,isReactNative:!1};if(typeof navigator!="undefined"&&navigator.product)switch(ui.product=navigator.product||"",ui.navigator=navigator||null,navigator.product){case"ReactNative":ui.userAgent=qd+" react-native",ui.isReactNative=!0;break;default:ui.userAgent=qd+" js",ui.isReactNative=!1;break}var kS=function(t){return""+ui.userAgent},xo=function(){return xo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xo.apply(this,arguments)},Fy=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},yp=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fy(arguments[e]));return t},tr=new $n("Hub"),ES=typeof Symbol!="undefined"&&typeof Symbol.for=="function"?Symbol.for("amplify_default"):"@@amplify_default";function AS(t){return t.onHubCapsule!==void 0}var CS=function(){function t(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return t.prototype.remove=function(e,n){if(e instanceof RegExp){var r=this.patterns.find(function(s){var o=s.pattern;return o.source===e.source});if(!r){tr.warn("No listeners for "+e);return}this.patterns=yp(this.patterns.filter(function(s){return s!==r}))}else{var i=this.listeners[e];if(!i){tr.warn("No listeners for "+e);return}this.listeners[e]=yp(i.filter(function(s){var o=s.callback;return o!==n}))}},t.prototype.dispatch=function(e,n,r,i){if(r===void 0&&(r=""),this.protectedChannels.indexOf(e)>-1){var s=i===ES;s||tr.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences")}var o={channel:e,payload:xo({},n),source:r,patternInfo:[]};try{this._toListeners(o)}catch(a){tr.error(a)}},t.prototype.listen=function(e,n,r){var i=this;r===void 0&&(r="noname");var s;if(AS(n))tr.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),s=n.onHubCapsule.bind(n);else{if(typeof n!="function")throw new Error("No callback supplied to Hub");s=n}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:s});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:r,callback:s})}return function(){i.remove(e,s)}},t.prototype._toListeners=function(e){var n=e.channel,r=e.payload,i=this.listeners[n];if(i&&i.forEach(function(o){tr.debug("Dispatching to "+n+" with ",r);try{o.callback(e)}catch(a){tr.error(a)}}),this.patterns.length>0){if(!r.message){tr.warn("Cannot perform pattern matching without a message key");return}var s=r.message;this.patterns.forEach(function(o){var a=s.match(o.pattern);if(a){var c=Fy(a),u=c.slice(1),d=xo(xo({},e),{patternInfo:u});try{o.callback(d)}catch(h){tr.error(h)}}})}},t}(),Nr=new CS("__default__"),xS=function(t){if(t.isResolved)return t;var e=!0,n=!1,r=!1,i=t.then(function(s){return r=!0,e=!1,s},function(s){throw n=!0,e=!1,s});return i.isFullfilled=function(){return r},i.isPending=function(){return e},i.isRejected=function(){return n},i},ur=function(){var t=typeof window!="undefined"&&typeof window.document!="undefined",e=typeof process!="undefined"&&process.versions!=null&&process.versions.node!=null;return{isBrowser:t,isNode:e}},Mr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Hr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ws(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any