@entropic-bond/crud-panel 4.4.2 → 4.4.4
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(se,Q){typeof exports=="object"&&typeof module<"u"?Q(exports):typeof define=="function"&&define.amd?define(["exports"],Q):(se=typeof globalThis<"u"?globalThis:se||self,Q(se["entropic-bond-crud-panel"]={}))})(this,function(se){"use strict";class Q{constructor(){this.subscribers=new Set}subscribe(t){return this.subscribers.add(t),()=>this.unsubscribe(t)}unsubscribe(t){this.subscribers.delete(t)}notify(t){this.subscribers.forEach(s=>s(t))}get subscribersCount(){return this.subscribers.size}}const j=[];for(let n=0;n<256;++n)j.push((n+256).toString(16).slice(1));function it(n,t=0){return(j[n[t+0]]+j[n[t+1]]+j[n[t+2]]+j[n[t+3]]+"-"+j[n[t+4]]+j[n[t+5]]+"-"+j[n[t+6]]+j[n[t+7]]+"-"+j[n[t+8]]+j[n[t+9]]+"-"+j[n[t+10]]+j[n[t+11]]+j[n[t+12]]+j[n[t+13]]+j[n[t+14]]+j[n[t+15]]).toLowerCase()}let Ae;const ut=new Uint8Array(16);function at(){if(!Ae){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ae=crypto.getRandomValues.bind(crypto)}return Ae(ut)}const ct=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Me={randomUUID:ct};function lt(n,t,s){n=n||{};const a=n.random??n.rng?.()??at();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,it(a)}function ft(n,t,s){return Me.randomUUID&&!n?Me.randomUUID():lt(n)}var dt=Object.defineProperty,ht=(n,t,s,a)=>{for(var c=void 0,p=n.length-1,O;p>=0;p--)(O=n[p])&&(c=O(t,s,c)||c);return c&&dt(t,s,c),c},
|
|
1
|
+
(function(se,Q){typeof exports=="object"&&typeof module<"u"?Q(exports):typeof define=="function"&&define.amd?define(["exports"],Q):(se=typeof globalThis<"u"?globalThis:se||self,Q(se["entropic-bond-crud-panel"]={}))})(this,function(se){"use strict";class Q{constructor(){this.subscribers=new Set}subscribe(t){return this.subscribers.add(t),()=>this.unsubscribe(t)}unsubscribe(t){this.subscribers.delete(t)}notify(t){this.subscribers.forEach(s=>s(t))}get subscribersCount(){return this.subscribers.size}}const j=[];for(let n=0;n<256;++n)j.push((n+256).toString(16).slice(1));function it(n,t=0){return(j[n[t+0]]+j[n[t+1]]+j[n[t+2]]+j[n[t+3]]+"-"+j[n[t+4]]+j[n[t+5]]+"-"+j[n[t+6]]+j[n[t+7]]+"-"+j[n[t+8]]+j[n[t+9]]+"-"+j[n[t+10]]+j[n[t+11]]+j[n[t+12]]+j[n[t+13]]+j[n[t+14]]+j[n[t+15]]).toLowerCase()}let Ae;const ut=new Uint8Array(16);function at(){if(!Ae){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ae=crypto.getRandomValues.bind(crypto)}return Ae(ut)}const ct=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Me={randomUUID:ct};function lt(n,t,s){n=n||{};const a=n.random??n.rng?.()??at();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,it(a)}function ft(n,t,s){return Me.randomUUID&&!n?Me.randomUUID():lt(n)}var dt=Object.defineProperty,ht=(n,t,s,a)=>{for(var c=void 0,p=n.length-1,O;p>=0;p--)(O=n[p])&&(c=O(t,s,c)||c);return c&&dt(t,s,c),c},A;const Ie=(A=class{static registerFactory(n,t,s,a=!1){this._factoryMap[n]={factory:t,annotation:s,isLegacy:a}}static classFactory(n){if(!n)throw new Error("You should provide a class name.");if(!this._factoryMap[n])throw new Error(`You should register class ${n} prior to use.`);return this._factoryMap[n].factory}static registeredClasses(){return Object.entries(this._factoryMap).filter(([,n])=>!n.isLegacy).map(([n])=>n)}static registeredClassesAndLegacyNames(){return Object.keys(this._factoryMap)}static classesExtending(n){return Object.entries(this._factoryMap).filter(([,t])=>new t.factory instanceof n&&!t.isLegacy).map(([t])=>t)}static annotations(n){if(n instanceof A?n=n.className:typeof n=="string"||(n=new n().className),!this._factoryMap[n])throw new Error(`You should register class ${n} prior to use.`);return this._factoryMap[n].annotation}constructor(n=ft()){this._id=n}get className(){return this.__className}setId(n){this._id=n}get id(){return this._id}afterDeserialize(){}beforeSerialize(){}getPersistentProperties(){return this._persistentProperties?this._persistentProperties.map(n=>({...n,name:n.name.slice(1)})):[]}getPropInfo(n){const t=this.getPersistentProperties().find(s=>s.name===n);if(!t)throw new Error(`Property "${n}" has not been registered.`);return t}isRequired(n){return this.getPropInfo(n).validator!=null}isPropValueValid(n){const t=this.getPropInfo(n);return t.validator?t.validator(this[t.name],t,this):!0}clone(n){const t=n.toObject();return delete t.id,this.fromObject(t)}fromObject(n){return this.fromObj(n),this.afterDeserialize(),this}fromObj(n){return this._persistentProperties?(this._persistentProperties.forEach(t=>{const s=this.removeUnderscore(t),a=n[s];a!=null&&(this[t.name]=this.fromDeepObject(a))}),this):this}toObject(){const n={},t=this.toObj(n);return this.pushDocument(n,this.className,t),{...t,__rootCollections:n}}toObj(n){if(!this._persistentProperties)return{};this.beforeSerialize();const t={};if(!this.className)throw new Error(`You should register \`${this.constructor.name||this.toString()||"this"}\` class prior to streaming it.`);return this._persistentProperties.forEach(s=>{const a=this[s.name],c=this.removeUnderscore(s);a!=null&&(s.isReference?t[c]=this.toReferenceObj(s,n):t[c]=this.toDeepObj(a,n),s.searchableArray&&(t[A.searchableArrayNameFor(c)]=a.map(p=>p.id)))}),t.__className=this.className,t}static searchableArrayNameFor(n){return`__${n}_searchable`}fromDeepObject(n){if(n==null)return n;if(Array.isArray(n))return n.map(t=>this.fromDeepObject(t));if(n.__documentReference){const t=n,s=A.createInstance(t);return s.__documentReference=n.__documentReference,s}if(n.__className)return A.createInstance(n);if(typeof n=="object"){const t={};return Object.entries(n).forEach(([s,a])=>t[s]=this.fromDeepObject(a)),t}return n}toDeepObj(n,t){if(n!=null){if(Array.isArray(n))return n.map(s=>this.toDeepObj(s,t));if(n.__documentReference)return n;if(n instanceof A)return n.toObj(t);if(typeof n=="object"){const s={};return Object.entries(n).forEach(([a,c])=>s[a]=this.toDeepObj(c,t)),s}return n}}static collectionPath(n,t,s){let a;return typeof t.storeInCollection=="function"?a=t.storeInCollection(n,t,s):a=t.storeInCollection??n.className,a}toReferenceObj(n,t){const s=this[n.name];return Array.isArray(s)?s.map(a=>(n.isPureReference||this.pushDocument(t,A.collectionPath(a,n),a),this.buildRefObject(a,A.collectionPath(a,n),n.cachedProps))):(n.isPureReference||this.pushDocument(t,A.collectionPath(s,n),s),this.buildRefObject(s,A.collectionPath(s,n),n.cachedProps))}buildRefObject(n,t,s){const a=s?.reduce((c,p)=>(n[p]!==void 0&&(c[p]=n[p]),c),{});return{id:n.id,__className:n.className||n.__className,__documentReference:{storedInCollection:t},...a}}pushDocument(n,t,s){if("__documentReference"in s&&s.__documentReference)return;n[t]||(n[t]=[]);const a=this.toDeepObj(s,n);n[t].push(a)}removeUnderscore(n){return n.name.slice(1)}static createReference(n){const t=A.createInstance(n);return t.__documentReference=n.__documentReference||{storedInCollection:t.className},t}static createInstance(n){if(typeof n=="string")return new(A.classFactory(n));try{return new(A.classFactory(n.__className))().fromObject(n)}catch(t){const s=Object.entries(n).filter(([a,c])=>c!=null&&typeof c!="function").map(([a,c])=>`${a}: ${c}`).join(`,
|
|
2
2
|
`);throw new Error(`${t}
|
|
3
3
|
-----> Class name not found in object:
|
|
4
4
|
{
|
|
5
5
|
${s}
|
|
6
6
|
}
|
|
7
|
-
`)}}static propInfo(n,t){return k.createInstance(n).getPropInfo(t)}static getSystemRegisteredReferencesWithCachedProps(){return k.registeredClassesAndLegacyNames().reduce((n,t)=>{const s=k.createInstance(t).getPersistentProperties().filter(a=>a.cachedPropsConfig?.cachedProps);return s.length>0&&(n[t]=s),n},{})}},k._factoryMap={},k);ht([de],Ie.prototype,"_id");let Le=Ie;function de(n,t){return pt()(n,t)}function pt(n){return function(t,s){Object.getOwnPropertyDescriptor(t,"_persistentProperties")||(t._persistentProperties?t._persistentProperties=[...t._persistentProperties]:t._persistentProperties=[]);const a=t._persistentProperties.find(c=>c.name===s);a?Object.assign(a,n):t._persistentProperties.push({name:s,...n})}}function mt(n,t){return s=>{Le.registerFactory(n,s,t),s.prototype.__className=n}}const Ye=class _e{static registerCloudStorage(t,s){_e._cloudStorageFactoryMap[t]=s}static createInstance(t){const s=_e._cloudStorageFactoryMap[t];if(!s)throw new Error(`You should register the ${t} cloud storage provider prior to use it`);return s()}get className(){return this.__className}static useCloudStorage(t){_e._defaultCloudStorage=t}static get defaultCloudStorage(){if(!_e._defaultCloudStorage)throw new Error("You should define a default cloud storage provider prior to use it");return _e._defaultCloudStorage}};Ye._cloudStorageFactoryMap={};let ye=Ye;function _t(n,t){return ye.registerCloudStorage(n,t),s=>{s.prototype.__className=n}}var yt=(n,t,s,a)=>{for(var c=t,p=n.length-1,O;p>=0;p--)(O=n[p])&&(c=O(c)||c);return c};let ke=class extends ye{constructor(n=""){super(),this._simulateDelay=0,this._pendingPromises=[],this.mockFileSystem={},this._pathToMockFiles=n}simulateDelay(n){return this._simulateDelay=n,this}resolveWithDelay(n){if(this._simulateDelay<=0)return Promise.resolve(n);const t=new Promise(s=>{setTimeout(()=>s(n),this._simulateDelay)});return this._pendingPromises.push(t),t.finally(()=>this._pendingPromises=this._pendingPromises.filter(s=>s===t)),t}save(n,t){const s=n;this._onProgress&&this._onProgress(0,100),this.mockFileSystem[n]=JSON.stringify(t),this._onProgress&&this._onProgress(100,100);const a=t instanceof File?t.name:s;return this.resolveWithDelay(a)}uploadControl(){return{resume:()=>{},pause:()=>{},cancel:()=>{},onProgress:n=>this._onProgress=n}}getUrl(n){return Promise.resolve(this._pathToMockFiles+n)}delete(n){return delete this.mockFileSystem[n],this.resolveWithDelay()}};ke=yt([_t("MockCloudStorage",()=>new ke)],ke);var gt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,he=(n,t,s,a)=>{for(var c=a>1?void 0:a?vt(t,s):t,p=n.length-1,O;p>=0;p--)(O=n[p])&&(c=(a?O(t,s,c):O(c))||c);return a&&c&>(t,s,c),c};let ie=class extends Le{constructor(){super(...arguments),this._onChange=new Q}async save({data:n,fileName:t,progress:s,cloudStorageProvider:a}={}){const c=n||this._pendingData;c&&(this._reference&&await this.delete(),this.provider=a||ye.defaultCloudStorage,this._originalFileName=t||(c instanceof File?c.name:void 0),this._reference=await this.provider.save(this.id,c,s),this._url=await this.provider.getUrl(this._reference),this._pendingData=void 0,this._onChange.notify({event:0,storedFile:this}))}uploadControl(){return this.provider.uploadControl()}async delete(){if(!this._reference)throw new Error("Cannot delete a not stored file");await this.provider.delete(this._reference),this._reference=void 0,this._url=void 0,this._onChange.notify({event:2,storedFile:this})}set provider(n){this._provider=n,this._cloudStorageProviderName=n.className}get provider(){if(!this._provider)try{this._provider=ye.createInstance(this._cloudStorageProviderName)}catch{this._provider=ye.defaultCloudStorage}return this._provider}get url(){return this._url}get mimeType(){return this._mimeType}setDataToStore(n){return this._pendingData=n,this._originalFileName=n instanceof File?n.name:void 0,this._mimeType=n instanceof Blob?n.type:void 0,this._onChange.notify({event:1,pendingData:n,storedFile:this}),this}get originalFileName(){return this._originalFileName}onChange(n){return this._onChange.subscribe(n)}};he([de],ie.prototype,"_reference",2),he([de],ie.prototype,"_url",2),he([de],ie.prototype,"_cloudStorageProviderName",2),he([de],ie.prototype,"_originalFileName",2),he([de],ie.prototype,"_mimeType",2),ie=he([mt("StoredFile")],ie);function Et(n,t="-"){if(!n)return"";const s=n.slice(1).replace(/( |[A-Z])/g,a=>a===" "?"-":t+a[0].toLowerCase());return n[0].toLocaleLowerCase()+s.replace(/--/g,"-")}class bt{constructor(){this._debug=!1,this._stages={},this._onProgress=new Q}notifyBusy(t,s){this.pushStage({name:s??"",progress:t?0:1,total:1})}pushStage(t){this._stages[t.name]=t;const s=Object.values(this._stages).reduce((a,c,p,O)=>a+c.progress/c.total/O.length,0);this._onProgress.notify({busy:s<1,overallProgress:s,stages:this._stages}),s>=1&&(this._stages={}),this.debug&&console.log(`ProgressController ${t.name}: Progress: ${t.progress} Stages: ${t.total}`)}onProgress(t){return this._onProgress.subscribe(t)}set debug(t){this._debug=t}get debug(){return this._debug}}const X=class X{constructor(t){this.progressController=new bt,this.onChangeHdl=new Q,this.onErrorHdl=new Q,this.validator={},this.setDocument(t||this.createDocument())}allRequiredPropertiesFilled(){return this.nonFilledRequiredProperties.length<=0&&this.validateGlobal()}get nonFilledRequiredProperties(){return this.requiredProperties.filter(t=>this.validateProp(t))}get requiredProperties(){if(!this.document)throw new Error(X.errorMessages.missedDocument);const t=this.document.getPersistentProperties().filter(a=>this.document.isRequired(a.name)).map(a=>a.name);return[...new Set(t.concat(Object.keys(this.validator)))]}addValidator(t,s,a){this.validator[t]={func:s,errorMessage:a}}removeValidator(t){delete this.validator[t]}addGlobalValidator(t,s){this.globalValidator={func:t,errorMessage:s}}removeGlobalValidator(){this.globalValidator=void 0}failedValidationError(t){if(t)return this.validator[t]?.errorMessage;const s=this.nonFilledRequiredProperties[0];return s?this.validator[s]?.errorMessage:this.globalValidator?.errorMessage}validateProp(t){if(!this.document)throw new Error(X.errorMessages.missedDocument);const s=this.document[t];return this.validator[t]?!this.validator[t].func(s):!this.document.isPropValueValid(t)}validateGlobal(){if(!this.document)throw new Error(X.errorMessages.missedDocument);return this.globalValidator?this.globalValidator.func(this.document):!0}storeDoc(){if(!this.document)throw new Error(X.errorMessages.missedDocument);return this.model.save(this.document)}deleteDoc(){if(!this.document)throw new Error(X.errorMessages.missedDocument);return this.model.delete(this.document.id)}queryDocs(t){let s=this.model.find();return t&&(s=s.limit(t)),s}findDocs(t){}async setFilter(t){return this._filter=t,this.onChangeHdl.notify({action:"filterChange"}),this}resetFilter(){return this._filter=void 0,this.onChangeHdl.notify({action:"filterChange"}),this}onChange(t){return this.onChangeHdl.subscribe(t)}onError(t){return this.onErrorHdl.subscribe(t)}notifyChange(t){this.onChangeHdl.notify(t)}newDocument(){return this.setDocument(this.createDocument())}async storeDocument(){const t="Saving main document";try{this.progressController.notifyBusy(!0,t),await this.storeDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"saved"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async deleteDocument(){const t="Delete main document";try{this.progressController.notifyBusy(!0,t),await this.deleteDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"deleted"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async documentCollection(t){const s="Retrieving document collection";let a=[];try{this.progressController.notifyBusy(!0,s);const c=this.findDocs(t);c?a=await c:a=await this.queryDocs(t).get()}catch(c){if(this.onChangeHdl.notify({error:this.errorToError(c)}),this.onErrorHdl.notify(this.errorToError(c)),this.throwOnError)throw c}finally{this.onChangeHdl.notify({documentCollection:a}),this.progressController.notifyBusy(!1,s)}return a}filter(t){return t.filter(s=>this._filter?.(s)??!0)}onProgress(t){return this.progressController.onProgress(t)}get model(){return this.getModel()}setDocument(t){return this._document!==t&&(this.unsubscribeDocument&&this.unsubscribeDocument(),t&&(this.unsubscribeDocument=t.onChange(s=>this.onChangeHdl.notify({documentProps:s}))),this._document=t,this.onChangeHdl.notify({documentChanged:this._document})),this}set document(t){this.setDocument(t)}get document(){return this._document}managedThrow(t){if(this.onChangeHdl.notify({error:this.errorToError(t)}),this.onErrorHdl.notify(this.errorToError(t)),this.throwOnError)throw this.errorToError(t)}errorToError(t){return t instanceof Error?t:typeof t=="string"?new Error(t):"code"in t?new Error(t.code):"message"in t?new Error(t.error):new Error(JSON.stringify(t))}get throwOnError(){return this.onErrorHdl.subscribersCount===0}};X.errorMessages={missedDocument:"No document to save"};let je=X;var Re={exports:{}},ge={};var Ue;function wt(){if(Ue)return ge;Ue=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,c,p){var O=null;if(p!==void 0&&(O=""+p),c.key!==void 0&&(O=""+c.key),"key"in c){p={};for(var P in c)P!=="key"&&(p[P]=c[P])}else p=c;return c=p.ref,{$$typeof:n,type:a,key:O,ref:c!==void 0?c:null,props:p}}return ge.Fragment=t,ge.jsx=s,ge.jsxs=s,ge}var ve={},Ce={exports:{}},_={};var He;function Rt(){if(He)return _;He=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),O=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),V=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),$=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=$&&r[$]||r["@@iterator"],typeof r=="function"?r:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ue=Object.assign,J={};function W(r,i,f){this.props=r,this.context=i,this.refs=J,this.updater=f||K}W.prototype.isReactComponent={},W.prototype.setState=function(r,i){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,i,"setState")},W.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function Z(){}Z.prototype=W.prototype;function ae(r,i,f){this.props=r,this.context=i,this.refs=J,this.updater=f||K}var ee=ae.prototype=new Z;ee.constructor=ae,ue(ee,W.prototype),ee.isPureReactComponent=!0;var F=Array.isArray;function ce(){}var R={H:null,A:null,T:null,S:null},pe=Object.prototype.hasOwnProperty;function N(r,i,f){var d=f.ref;return{$$typeof:n,type:r,key:i,ref:d!==void 0?d:null,props:f}}function te(r,i){return N(r.type,i,r.props)}function le(r){return typeof r=="object"&&r!==null&&r.$$typeof===n}function C(r){var i={"=":"=0",":":"=2"};return"$"+r.replace(/[=:]/g,function(f){return i[f]})}var re=/\/+/g;function z(r,i){return typeof r=="object"&&r!==null&&r.key!=null?C(""+r.key):i.toString(36)}function q(r){switch(r.status){case"fulfilled":return r.value;case"rejected":throw r.reason;default:switch(typeof r.status=="string"?r.then(ce,ce):(r.status="pending",r.then(function(i){r.status==="pending"&&(r.status="fulfilled",r.value=i)},function(i){r.status==="pending"&&(r.status="rejected",r.reason=i)})),r.status){case"fulfilled":return r.value;case"rejected":throw r.reason}}throw r}function M(r,i,f,d,g){var w=typeof r;(w==="undefined"||w==="boolean")&&(r=null);var m=!1;if(r===null)m=!0;else switch(w){case"bigint":case"string":case"number":m=!0;break;case"object":switch(r.$$typeof){case n:case t:m=!0;break;case L:return m=r._init,M(m(r._payload),i,f,d,g)}}if(m)return g=g(r),m=d===""?"."+z(r,0):d,F(g)?(f="",m!=null&&(f=m.replace(re,"$&/")+"/"),M(g,i,f,"",function(G){return G})):g!=null&&(le(g)&&(g=te(g,f+(g.key==null||r&&r.key===g.key?"":(""+g.key).replace(re,"$&/")+"/")+m)),i.push(g)),1;m=0;var A=d===""?".":d+":";if(F(r))for(var S=0;S<r.length;S++)d=r[S],w=A+z(d,S),m+=M(d,i,f,w,g);else if(S=H(r),typeof S=="function")for(r=S.call(r),S=0;!(d=r.next()).done;)d=d.value,w=A+z(d,S++),m+=M(d,i,f,w,g);else if(w==="object"){if(typeof r.then=="function")return M(q(r),i,f,d,g);throw i=String(r),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return m}function x(r,i,f){if(r==null)return r;var d=[],g=0;return M(r,d,"","",function(w){return i.call(f,w,g++)}),d}function ne(r){if(r._status===-1){var i=r._result;i=i(),i.then(function(f){(r._status===0||r._status===-1)&&(r._status=1,r._result=f)},function(f){(r._status===0||r._status===-1)&&(r._status=2,r._result=f)}),r._status===-1&&(r._status=0,r._result=i)}if(r._status===1)return r._result.default;throw r._result}var B=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},fe={map:x,forEach:function(r,i,f){x(r,function(){i.apply(this,arguments)},f)},count:function(r){var i=0;return x(r,function(){i++}),i},toArray:function(r){return x(r,function(i){return i})||[]},only:function(r){if(!le(r))throw Error("React.Children.only expected to receive a single React element child.");return r}};return _.Activity=Y,_.Children=fe,_.Component=W,_.Fragment=s,_.Profiler=c,_.PureComponent=ae,_.StrictMode=a,_.Suspense=D,_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,_.__COMPILER_RUNTIME={__proto__:null,c:function(r){return R.H.useMemoCache(r)}},_.cache=function(r){return function(){return r.apply(null,arguments)}},_.cacheSignal=function(){return null},_.cloneElement=function(r,i,f){if(r==null)throw Error("The argument must be a React element, but you passed "+r+".");var d=ue({},r.props),g=r.key;if(i!=null)for(w in i.key!==void 0&&(g=""+i.key),i)!pe.call(i,w)||w==="key"||w==="__self"||w==="__source"||w==="ref"&&i.ref===void 0||(d[w]=i[w]);var w=arguments.length-2;if(w===1)d.children=f;else if(1<w){for(var m=Array(w),A=0;A<w;A++)m[A]=arguments[A+2];d.children=m}return N(r.type,g,d)},_.createContext=function(r){return r={$$typeof:O,_currentValue:r,_currentValue2:r,_threadCount:0,Provider:null,Consumer:null},r.Provider=r,r.Consumer={$$typeof:p,_context:r},r},_.createElement=function(r,i,f){var d,g={},w=null;if(i!=null)for(d in i.key!==void 0&&(w=""+i.key),i)pe.call(i,d)&&d!=="key"&&d!=="__self"&&d!=="__source"&&(g[d]=i[d]);var m=arguments.length-2;if(m===1)g.children=f;else if(1<m){for(var A=Array(m),S=0;S<m;S++)A[S]=arguments[S+2];g.children=A}if(r&&r.defaultProps)for(d in m=r.defaultProps,m)g[d]===void 0&&(g[d]=m[d]);return N(r,w,g)},_.createRef=function(){return{current:null}},_.forwardRef=function(r){return{$$typeof:P,render:r}},_.isValidElement=le,_.lazy=function(r){return{$$typeof:L,_payload:{_status:-1,_result:r},_init:ne}},_.memo=function(r,i){return{$$typeof:V,type:r,compare:i===void 0?null:i}},_.startTransition=function(r){var i=R.T,f={};R.T=f;try{var d=r(),g=R.S;g!==null&&g(f,d),typeof d=="object"&&d!==null&&typeof d.then=="function"&&d.then(ce,B)}catch(w){B(w)}finally{i!==null&&f.types!==null&&(i.types=f.types),R.T=i}},_.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},_.use=function(r){return R.H.use(r)},_.useActionState=function(r,i,f){return R.H.useActionState(r,i,f)},_.useCallback=function(r,i){return R.H.useCallback(r,i)},_.useContext=function(r){return R.H.useContext(r)},_.useDebugValue=function(){},_.useDeferredValue=function(r,i){return R.H.useDeferredValue(r,i)},_.useEffect=function(r,i){return R.H.useEffect(r,i)},_.useEffectEvent=function(r){return R.H.useEffectEvent(r)},_.useId=function(){return R.H.useId()},_.useImperativeHandle=function(r,i,f){return R.H.useImperativeHandle(r,i,f)},_.useInsertionEffect=function(r,i){return R.H.useInsertionEffect(r,i)},_.useLayoutEffect=function(r,i){return R.H.useLayoutEffect(r,i)},_.useMemo=function(r,i){return R.H.useMemo(r,i)},_.useOptimistic=function(r,i){return R.H.useOptimistic(r,i)},_.useReducer=function(r,i,f){return R.H.useReducer(r,i,f)},_.useRef=function(r){return R.H.useRef(r)},_.useState=function(r){return R.H.useState(r)},_.useSyncExternalStore=function(r,i,f){return R.H.useSyncExternalStore(r,i,f)},_.useTransition=function(){return R.H.useTransition()},_.version="19.2.3",_}var Ee={exports:{}};Ee.exports;var Fe;function Ct(){return Fe||(Fe=1,function(n,t){process.env.NODE_ENV!=="production"&&function(){function s(e,o){Object.defineProperty(p.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",o[0],o[1])}})}function a(e){return e===null||typeof e!="object"?null:(e=Ve&&e[Ve]||e["@@iterator"],typeof e=="function"?e:null)}function c(e,o){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var u=e+"."+o;Be[u]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",o,e),Be[u]=!0)}function p(e,o,u){this.props=e,this.context=o,this.refs=De,this.updater=u||Ge}function O(){}function P(e,o,u){this.props=e,this.context=o,this.refs=De,this.updater=u||Ge}function D(){}function V(e){return""+e}function L(e){try{V(e);var o=!1}catch{o=!0}if(o){o=console;var u=o.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),V(e)}}function Y(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===St?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case r:return"Fragment";case f:return"Profiler";case i:return"StrictMode";case m:return"Suspense";case A:return"SuspenseList";case ze:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case fe:return"Portal";case g:return e.displayName||"Context";case d:return(e._context.displayName||"Context")+".Consumer";case w:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case S:return o=e.displayName||null,o!==null?o:Y(e.type)||"Memo";case G:o=e._payload,e=e._init;try{return Y(e(o))}catch{}}return null}function $(e){if(e===r)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===G)return"<...>";try{var o=Y(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function H(){var e=v.A;return e===null?null:e.getOwner()}function K(){return Error("react-stack-top-frame")}function ue(e){if(Te.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function J(e,o){function u(){Je||(Je=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}function W(){var e=Y(this.type);return et[e]||(et[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function Z(e,o,u,l,h,E){var y=u.ref;return e={$$typeof:B,type:e,key:o,props:u,_owner:l},(y!==void 0?y:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:W}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:E}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function ae(e,o){return o=Z(e.type,o,e.props,e._owner,e._debugStack,e._debugTask),e._store&&(o._store.validated=e._store.validated),o}function ee(e){F(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===G&&(e._payload.status==="fulfilled"?F(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function F(e){return typeof e=="object"&&e!==null&&e.$$typeof===B}function ce(e){var o={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(u){return o[u]})}function R(e,o){return typeof e=="object"&&e!==null&&e.key!=null?(L(e.key),ce(""+e.key)):o.toString(36)}function pe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(D,D):(e.status="pending",e.then(function(o){e.status==="pending"&&(e.status="fulfilled",e.value=o)},function(o){e.status==="pending"&&(e.status="rejected",e.reason=o)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function N(e,o,u,l,h){var E=typeof e;(E==="undefined"||E==="boolean")&&(e=null);var y=!1;if(e===null)y=!0;else switch(E){case"bigint":case"string":case"number":y=!0;break;case"object":switch(e.$$typeof){case B:case fe:y=!0;break;case G:return y=e._init,N(y(e._payload),o,u,l,h)}}if(y){y=e,h=h(y);var T=l===""?"."+R(y,0):l;return Xe(h)?(u="",T!=null&&(u=T.replace(rt,"$&/")+"/"),N(h,o,u,"",function(oe){return oe})):h!=null&&(F(h)&&(h.key!=null&&(y&&y.key===h.key||L(h.key)),u=ae(h,u+(h.key==null||y&&y.key===h.key?"":(""+h.key).replace(rt,"$&/")+"/")+T),l!==""&&y!=null&&F(y)&&y.key==null&&y._store&&!y._store.validated&&(u._store.validated=2),h=u),o.push(h)),1}if(y=0,T=l===""?".":l+":",Xe(e))for(var b=0;b<e.length;b++)l=e[b],E=T+R(l,b),y+=N(l,o,u,E,h);else if(b=a(e),typeof b=="function")for(b===e.entries&&(tt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),tt=!0),e=b.call(e),b=0;!(l=e.next()).done;)l=l.value,E=T+R(l,b++),y+=N(l,o,u,E,h);else if(E==="object"){if(typeof e.then=="function")return N(pe(e),o,u,l,h);throw o=String(e),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return y}function te(e,o,u){if(e==null)return e;var l=[],h=0;return N(e,l,"","",function(E){return o.call(u,E,h++)}),l}function le(e){if(e._status===-1){var o=e._ioInfo;o!=null&&(o.start=o.end=performance.now()),o=e._result;var u=o();if(u.then(function(h){if(e._status===0||e._status===-1){e._status=1,e._result=h;var E=e._ioInfo;E!=null&&(E.end=performance.now()),u.status===void 0&&(u.status="fulfilled",u.value=h)}},function(h){if(e._status===0||e._status===-1){e._status=2,e._result=h;var E=e._ioInfo;E!=null&&(E.end=performance.now()),u.status===void 0&&(u.status="rejected",u.reason=h)}}),o=e._ioInfo,o!=null){o.value=u;var l=u.displayName;typeof l=="string"&&(o.name=l)}e._status===-1&&(e._status=0,e._result=u)}if(e._status===1)return o=e._result,o===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
+
`)}}static propInfo(n,t){return A.createInstance(n).getPropInfo(t)}static propType(n){if(n.typeName)return Array.isArray(n.typeName)?"undefined[]":n.typeName??"undefined";const t=A.createInstance(n.ownerClassName())[n.name];if(Array.isArray(t)){if(t.length===0)return"undefined[]";const s=t[0];return s instanceof A?s.className+"[]":typeof s+"[]"}else return t instanceof A?t.className:typeof t}static getSystemRegisteredReferencesWithCachedProps(){return A.registeredClasses().reduce((n,t)=>{const s=A.createInstance(t).getPersistentProperties().filter(a=>a.cachedProps);return s.length>0&&(n[t]=s),n},{})}},A._factoryMap={},A);ht([de],Ie.prototype,"_id");let Le=Ie;function de(n,t){return pt()(n,t)}function pt(n){return function(t,s){Object.getOwnPropertyDescriptor(t,"_persistentProperties")||(t._persistentProperties?t._persistentProperties=[...t._persistentProperties]:t._persistentProperties=[]);const a=t._persistentProperties.find(c=>c.name===s);a?Object.assign(a,n):t._persistentProperties.push({name:s,ownerClassName:()=>t.className,...n})}}function mt(n,t){return s=>{Le.registerFactory(n,s,t),s.prototype.__className=n}}const Ye=class _e{static registerCloudStorage(t,s){_e._cloudStorageFactoryMap[t]=s}static createInstance(t){const s=_e._cloudStorageFactoryMap[t];if(!s)throw new Error(`You should register the ${t} cloud storage provider prior to use it`);return s()}get className(){return this.__className}static useCloudStorage(t){_e._defaultCloudStorage=t}static get defaultCloudStorage(){if(!_e._defaultCloudStorage)throw new Error("You should define a default cloud storage provider prior to use it");return _e._defaultCloudStorage}};Ye._cloudStorageFactoryMap={};let ye=Ye;function _t(n,t){return ye.registerCloudStorage(n,t),s=>{s.prototype.__className=n}}var yt=(n,t,s,a)=>{for(var c=t,p=n.length-1,O;p>=0;p--)(O=n[p])&&(c=O(c)||c);return c};let ke=class extends ye{constructor(n=""){super(),this._simulateDelay=0,this._pendingPromises=[],this.mockFileSystem={},this._pathToMockFiles=n}simulateDelay(n){return this._simulateDelay=n,this}resolveWithDelay(n){if(this._simulateDelay<=0)return Promise.resolve(n);const t=new Promise(s=>{setTimeout(()=>s(n),this._simulateDelay)});return this._pendingPromises.push(t),t.finally(()=>this._pendingPromises=this._pendingPromises.filter(s=>s===t)),t}save(n,t){const s=n;this._onProgress&&this._onProgress(0,100),this.mockFileSystem[n]=JSON.stringify(t),this._onProgress&&this._onProgress(100,100);const a=t instanceof File?t.name:s;return this.resolveWithDelay(a)}uploadControl(){return{resume:()=>{},pause:()=>{},cancel:()=>{},onProgress:n=>this._onProgress=n}}getUrl(n){return Promise.resolve(this._pathToMockFiles+n)}delete(n){return delete this.mockFileSystem[n],this.resolveWithDelay()}};ke=yt([_t("MockCloudStorage",()=>new ke)],ke);var gt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,he=(n,t,s,a)=>{for(var c=a>1?void 0:a?vt(t,s):t,p=n.length-1,O;p>=0;p--)(O=n[p])&&(c=(a?O(t,s,c):O(c))||c);return a&&c&>(t,s,c),c};let ie=class extends Le{constructor(){super(...arguments),this._onChange=new Q}async save({data:n,fileName:t,progress:s,cloudStorageProvider:a}={}){const c=n||this._pendingData;c&&(this._reference&&await this.delete(),this.provider=a||ye.defaultCloudStorage,this._originalFileName=t||(c instanceof File?c.name:void 0),this._reference=await this.provider.save(this.id,c,s),this._url=await this.provider.getUrl(this._reference),this._pendingData=void 0,this._onChange.notify({event:0,storedFile:this}))}uploadControl(){return this.provider.uploadControl()}async delete(){if(!this._reference)throw new Error("Cannot delete a not stored file");await this.provider.delete(this._reference),this._reference=void 0,this._url=void 0,this._onChange.notify({event:2,storedFile:this})}set provider(n){this._provider=n,this._cloudStorageProviderName=n.className}get provider(){if(!this._provider)try{this._provider=ye.createInstance(this._cloudStorageProviderName)}catch{this._provider=ye.defaultCloudStorage}return this._provider}get url(){return this._url}get mimeType(){return this._mimeType}setDataToStore(n){return this._pendingData=n,this._originalFileName=n instanceof File?n.name:void 0,this._mimeType=n instanceof Blob?n.type:void 0,this._onChange.notify({event:1,pendingData:n,storedFile:this}),this}get originalFileName(){return this._originalFileName}onChange(n){return this._onChange.subscribe(n)}};he([de],ie.prototype,"_reference",2),he([de],ie.prototype,"_url",2),he([de],ie.prototype,"_cloudStorageProviderName",2),he([de],ie.prototype,"_originalFileName",2),he([de],ie.prototype,"_mimeType",2),ie=he([mt("StoredFile")],ie);function Et(n,t="-"){if(!n)return"";const s=n.slice(1).replace(/( |[A-Z])/g,a=>a===" "?"-":t+a[0].toLowerCase());return n[0].toLocaleLowerCase()+s.replace(/--/g,"-")}class bt{constructor(){this._debug=!1,this._stages={},this._onProgress=new Q}notifyBusy(t,s){this.pushStage({name:s??"",progress:t?0:1,total:1})}pushStage(t){this._stages[t.name]=t;const s=Object.values(this._stages).reduce((a,c,p,O)=>a+c.progress/c.total/O.length,0);this._onProgress.notify({busy:s<1,overallProgress:s,stages:this._stages}),s>=1&&(this._stages={}),this.debug&&console.log(`ProgressController ${t.name}: Progress: ${t.progress} Stages: ${t.total}`)}onProgress(t){return this._onProgress.subscribe(t)}set debug(t){this._debug=t}get debug(){return this._debug}}const X=class X{constructor(t){this.progressController=new bt,this.onChangeHdl=new Q,this.onErrorHdl=new Q,this.validator={},this.setDocument(t||this.createDocument())}allRequiredPropertiesFilled(){return this.nonFilledRequiredProperties.length<=0&&this.validateGlobal()}get nonFilledRequiredProperties(){return this.requiredProperties.filter(t=>this.validateProp(t))}get requiredProperties(){if(!this.document)throw new Error(X.errorMessages.missedDocument);const t=this.document.getPersistentProperties().filter(a=>this.document.isRequired(a.name)).map(a=>a.name);return[...new Set(t.concat(Object.keys(this.validator)))]}addValidator(t,s,a){this.validator[t]={func:s,errorMessage:a}}removeValidator(t){delete this.validator[t]}addGlobalValidator(t,s){this.globalValidator={func:t,errorMessage:s}}removeGlobalValidator(){this.globalValidator=void 0}failedValidationError(t){if(t)return this.validator[t]?.errorMessage;const s=this.nonFilledRequiredProperties[0];return s?this.validator[s]?.errorMessage:this.globalValidator?.errorMessage}validateProp(t){if(!this.document)throw new Error(X.errorMessages.missedDocument);const s=this.document[t];return this.validator[t]?!this.validator[t].func(s):!this.document.isPropValueValid(t)}validateGlobal(){if(!this.document)throw new Error(X.errorMessages.missedDocument);return this.globalValidator?this.globalValidator.func(this.document):!0}storeDoc(){if(!this.document)throw new Error(X.errorMessages.missedDocument);return this.model.save(this.document)}deleteDoc(){if(!this.document)throw new Error(X.errorMessages.missedDocument);return this.model.delete(this.document.id)}queryDocs(t){let s=this.model.find();return t&&(s=s.limit(t)),s}findDocs(t){}async setFilter(t){return this._filter=t,this.onChangeHdl.notify({action:"filterChange"}),this}resetFilter(){return this._filter=void 0,this.onChangeHdl.notify({action:"filterChange"}),this}onChange(t){return this.onChangeHdl.subscribe(t)}onError(t){return this.onErrorHdl.subscribe(t)}notifyChange(t){this.onChangeHdl.notify(t)}newDocument(){return this.setDocument(this.createDocument())}async storeDocument(){const t="Saving main document";try{this.progressController.notifyBusy(!0,t),await this.storeDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"saved"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async deleteDocument(){const t="Delete main document";try{this.progressController.notifyBusy(!0,t),await this.deleteDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"deleted"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async documentCollection(t){const s="Retrieving document collection";let a=[];try{this.progressController.notifyBusy(!0,s);const c=this.findDocs(t);c?a=await c:a=await this.queryDocs(t).get()}catch(c){if(this.onChangeHdl.notify({error:this.errorToError(c)}),this.onErrorHdl.notify(this.errorToError(c)),this.throwOnError)throw c}finally{this.onChangeHdl.notify({documentCollection:a}),this.progressController.notifyBusy(!1,s)}return a}filter(t){return t.filter(s=>this._filter?.(s)??!0)}onProgress(t){return this.progressController.onProgress(t)}get model(){return this.getModel()}setDocument(t){return this._document!==t&&(this.unsubscribeDocument&&this.unsubscribeDocument(),t&&(this.unsubscribeDocument=t.onChange(s=>this.onChangeHdl.notify({documentProps:s}))),this._document=t,this.onChangeHdl.notify({documentChanged:this._document})),this}set document(t){this.setDocument(t)}get document(){return this._document}managedThrow(t){if(this.onChangeHdl.notify({error:this.errorToError(t)}),this.onErrorHdl.notify(this.errorToError(t)),this.throwOnError)throw this.errorToError(t)}errorToError(t){return t instanceof Error?t:typeof t=="string"?new Error(t):"code"in t?new Error(t.code):"message"in t?new Error(t.error):new Error(JSON.stringify(t))}get throwOnError(){return this.onErrorHdl.subscribersCount===0}};X.errorMessages={missedDocument:"No document to save"};let je=X;var Re={exports:{}},ge={};var He;function wt(){if(He)return ge;He=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,c,p){var O=null;if(p!==void 0&&(O=""+p),c.key!==void 0&&(O=""+c.key),"key"in c){p={};for(var S in c)S!=="key"&&(p[S]=c[S])}else p=c;return c=p.ref,{$$typeof:n,type:a,key:O,ref:c!==void 0?c:null,props:p}}return ge.Fragment=t,ge.jsx=s,ge.jsxs=s,ge}var ve={},Ce={exports:{}},_={};var Ue;function Rt(){if(Ue)return _;Ue=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),O=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),V=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),$=Symbol.iterator;function U(r){return r===null||typeof r!="object"?null:(r=$&&r[$]||r["@@iterator"],typeof r=="function"?r:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ue=Object.assign,Z={};function W(r,i,f){this.props=r,this.context=i,this.refs=Z,this.updater=f||K}W.prototype.isReactComponent={},W.prototype.setState=function(r,i){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,i,"setState")},W.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function J(){}J.prototype=W.prototype;function ae(r,i,f){this.props=r,this.context=i,this.refs=Z,this.updater=f||K}var ee=ae.prototype=new J;ee.constructor=ae,ue(ee,W.prototype),ee.isPureReactComponent=!0;var F=Array.isArray;function ce(){}var R={H:null,A:null,T:null,S:null},pe=Object.prototype.hasOwnProperty;function N(r,i,f){var d=f.ref;return{$$typeof:n,type:r,key:i,ref:d!==void 0?d:null,props:f}}function te(r,i){return N(r.type,i,r.props)}function le(r){return typeof r=="object"&&r!==null&&r.$$typeof===n}function C(r){var i={"=":"=0",":":"=2"};return"$"+r.replace(/[=:]/g,function(f){return i[f]})}var re=/\/+/g;function z(r,i){return typeof r=="object"&&r!==null&&r.key!=null?C(""+r.key):i.toString(36)}function q(r){switch(r.status){case"fulfilled":return r.value;case"rejected":throw r.reason;default:switch(typeof r.status=="string"?r.then(ce,ce):(r.status="pending",r.then(function(i){r.status==="pending"&&(r.status="fulfilled",r.value=i)},function(i){r.status==="pending"&&(r.status="rejected",r.reason=i)})),r.status){case"fulfilled":return r.value;case"rejected":throw r.reason}}throw r}function M(r,i,f,d,g){var w=typeof r;(w==="undefined"||w==="boolean")&&(r=null);var m=!1;if(r===null)m=!0;else switch(w){case"bigint":case"string":case"number":m=!0;break;case"object":switch(r.$$typeof){case n:case t:m=!0;break;case L:return m=r._init,M(m(r._payload),i,f,d,g)}}if(m)return g=g(r),m=d===""?"."+z(r,0):d,F(g)?(f="",m!=null&&(f=m.replace(re,"$&/")+"/"),M(g,i,f,"",function(G){return G})):g!=null&&(le(g)&&(g=te(g,f+(g.key==null||r&&r.key===g.key?"":(""+g.key).replace(re,"$&/")+"/")+m)),i.push(g)),1;m=0;var k=d===""?".":d+":";if(F(r))for(var P=0;P<r.length;P++)d=r[P],w=k+z(d,P),m+=M(d,i,f,w,g);else if(P=U(r),typeof P=="function")for(r=P.call(r),P=0;!(d=r.next()).done;)d=d.value,w=k+z(d,P++),m+=M(d,i,f,w,g);else if(w==="object"){if(typeof r.then=="function")return M(q(r),i,f,d,g);throw i=String(r),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return m}function x(r,i,f){if(r==null)return r;var d=[],g=0;return M(r,d,"","",function(w){return i.call(f,w,g++)}),d}function ne(r){if(r._status===-1){var i=r._result;i=i(),i.then(function(f){(r._status===0||r._status===-1)&&(r._status=1,r._result=f)},function(f){(r._status===0||r._status===-1)&&(r._status=2,r._result=f)}),r._status===-1&&(r._status=0,r._result=i)}if(r._status===1)return r._result.default;throw r._result}var B=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},fe={map:x,forEach:function(r,i,f){x(r,function(){i.apply(this,arguments)},f)},count:function(r){var i=0;return x(r,function(){i++}),i},toArray:function(r){return x(r,function(i){return i})||[]},only:function(r){if(!le(r))throw Error("React.Children.only expected to receive a single React element child.");return r}};return _.Activity=Y,_.Children=fe,_.Component=W,_.Fragment=s,_.Profiler=c,_.PureComponent=ae,_.StrictMode=a,_.Suspense=D,_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,_.__COMPILER_RUNTIME={__proto__:null,c:function(r){return R.H.useMemoCache(r)}},_.cache=function(r){return function(){return r.apply(null,arguments)}},_.cacheSignal=function(){return null},_.cloneElement=function(r,i,f){if(r==null)throw Error("The argument must be a React element, but you passed "+r+".");var d=ue({},r.props),g=r.key;if(i!=null)for(w in i.key!==void 0&&(g=""+i.key),i)!pe.call(i,w)||w==="key"||w==="__self"||w==="__source"||w==="ref"&&i.ref===void 0||(d[w]=i[w]);var w=arguments.length-2;if(w===1)d.children=f;else if(1<w){for(var m=Array(w),k=0;k<w;k++)m[k]=arguments[k+2];d.children=m}return N(r.type,g,d)},_.createContext=function(r){return r={$$typeof:O,_currentValue:r,_currentValue2:r,_threadCount:0,Provider:null,Consumer:null},r.Provider=r,r.Consumer={$$typeof:p,_context:r},r},_.createElement=function(r,i,f){var d,g={},w=null;if(i!=null)for(d in i.key!==void 0&&(w=""+i.key),i)pe.call(i,d)&&d!=="key"&&d!=="__self"&&d!=="__source"&&(g[d]=i[d]);var m=arguments.length-2;if(m===1)g.children=f;else if(1<m){for(var k=Array(m),P=0;P<m;P++)k[P]=arguments[P+2];g.children=k}if(r&&r.defaultProps)for(d in m=r.defaultProps,m)g[d]===void 0&&(g[d]=m[d]);return N(r,w,g)},_.createRef=function(){return{current:null}},_.forwardRef=function(r){return{$$typeof:S,render:r}},_.isValidElement=le,_.lazy=function(r){return{$$typeof:L,_payload:{_status:-1,_result:r},_init:ne}},_.memo=function(r,i){return{$$typeof:V,type:r,compare:i===void 0?null:i}},_.startTransition=function(r){var i=R.T,f={};R.T=f;try{var d=r(),g=R.S;g!==null&&g(f,d),typeof d=="object"&&d!==null&&typeof d.then=="function"&&d.then(ce,B)}catch(w){B(w)}finally{i!==null&&f.types!==null&&(i.types=f.types),R.T=i}},_.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},_.use=function(r){return R.H.use(r)},_.useActionState=function(r,i,f){return R.H.useActionState(r,i,f)},_.useCallback=function(r,i){return R.H.useCallback(r,i)},_.useContext=function(r){return R.H.useContext(r)},_.useDebugValue=function(){},_.useDeferredValue=function(r,i){return R.H.useDeferredValue(r,i)},_.useEffect=function(r,i){return R.H.useEffect(r,i)},_.useEffectEvent=function(r){return R.H.useEffectEvent(r)},_.useId=function(){return R.H.useId()},_.useImperativeHandle=function(r,i,f){return R.H.useImperativeHandle(r,i,f)},_.useInsertionEffect=function(r,i){return R.H.useInsertionEffect(r,i)},_.useLayoutEffect=function(r,i){return R.H.useLayoutEffect(r,i)},_.useMemo=function(r,i){return R.H.useMemo(r,i)},_.useOptimistic=function(r,i){return R.H.useOptimistic(r,i)},_.useReducer=function(r,i,f){return R.H.useReducer(r,i,f)},_.useRef=function(r){return R.H.useRef(r)},_.useState=function(r){return R.H.useState(r)},_.useSyncExternalStore=function(r,i,f){return R.H.useSyncExternalStore(r,i,f)},_.useTransition=function(){return R.H.useTransition()},_.version="19.2.3",_}var Ee={exports:{}};Ee.exports;var Fe;function Ct(){return Fe||(Fe=1,function(n,t){process.env.NODE_ENV!=="production"&&function(){function s(e,o){Object.defineProperty(p.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",o[0],o[1])}})}function a(e){return e===null||typeof e!="object"?null:(e=Ve&&e[Ve]||e["@@iterator"],typeof e=="function"?e:null)}function c(e,o){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var u=e+"."+o;Be[u]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",o,e),Be[u]=!0)}function p(e,o,u){this.props=e,this.context=o,this.refs=De,this.updater=u||Ge}function O(){}function S(e,o,u){this.props=e,this.context=o,this.refs=De,this.updater=u||Ge}function D(){}function V(e){return""+e}function L(e){try{V(e);var o=!1}catch{o=!0}if(o){o=console;var u=o.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),V(e)}}function Y(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Pt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case r:return"Fragment";case f:return"Profiler";case i:return"StrictMode";case m:return"Suspense";case k:return"SuspenseList";case ze:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case fe:return"Portal";case g:return e.displayName||"Context";case d:return(e._context.displayName||"Context")+".Consumer";case w:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return o=e.displayName||null,o!==null?o:Y(e.type)||"Memo";case G:o=e._payload,e=e._init;try{return Y(e(o))}catch{}}return null}function $(e){if(e===r)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===G)return"<...>";try{var o=Y(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function U(){var e=v.A;return e===null?null:e.getOwner()}function K(){return Error("react-stack-top-frame")}function ue(e){if(Te.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function Z(e,o){function u(){Ze||(Ze=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}function W(){var e=Y(this.type);return et[e]||(et[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function J(e,o,u,l,h,E){var y=u.ref;return e={$$typeof:B,type:e,key:o,props:u,_owner:l},(y!==void 0?y:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:W}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:E}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function ae(e,o){return o=J(e.type,o,e.props,e._owner,e._debugStack,e._debugTask),e._store&&(o._store.validated=e._store.validated),o}function ee(e){F(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===G&&(e._payload.status==="fulfilled"?F(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function F(e){return typeof e=="object"&&e!==null&&e.$$typeof===B}function ce(e){var o={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(u){return o[u]})}function R(e,o){return typeof e=="object"&&e!==null&&e.key!=null?(L(e.key),ce(""+e.key)):o.toString(36)}function pe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(D,D):(e.status="pending",e.then(function(o){e.status==="pending"&&(e.status="fulfilled",e.value=o)},function(o){e.status==="pending"&&(e.status="rejected",e.reason=o)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function N(e,o,u,l,h){var E=typeof e;(E==="undefined"||E==="boolean")&&(e=null);var y=!1;if(e===null)y=!0;else switch(E){case"bigint":case"string":case"number":y=!0;break;case"object":switch(e.$$typeof){case B:case fe:y=!0;break;case G:return y=e._init,N(y(e._payload),o,u,l,h)}}if(y){y=e,h=h(y);var T=l===""?"."+R(y,0):l;return Xe(h)?(u="",T!=null&&(u=T.replace(rt,"$&/")+"/"),N(h,o,u,"",function(oe){return oe})):h!=null&&(F(h)&&(h.key!=null&&(y&&y.key===h.key||L(h.key)),u=ae(h,u+(h.key==null||y&&y.key===h.key?"":(""+h.key).replace(rt,"$&/")+"/")+T),l!==""&&y!=null&&F(y)&&y.key==null&&y._store&&!y._store.validated&&(u._store.validated=2),h=u),o.push(h)),1}if(y=0,T=l===""?".":l+":",Xe(e))for(var b=0;b<e.length;b++)l=e[b],E=T+R(l,b),y+=N(l,o,u,E,h);else if(b=a(e),typeof b=="function")for(b===e.entries&&(tt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),tt=!0),e=b.call(e),b=0;!(l=e.next()).done;)l=l.value,E=T+R(l,b++),y+=N(l,o,u,E,h);else if(E==="object"){if(typeof e.then=="function")return N(pe(e),o,u,l,h);throw o=String(e),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return y}function te(e,o,u){if(e==null)return e;var l=[],h=0;return N(e,l,"","",function(E){return o.call(u,E,h++)}),l}function le(e){if(e._status===-1){var o=e._ioInfo;o!=null&&(o.start=o.end=performance.now()),o=e._result;var u=o();if(u.then(function(h){if(e._status===0||e._status===-1){e._status=1,e._result=h;var E=e._ioInfo;E!=null&&(E.end=performance.now()),u.status===void 0&&(u.status="fulfilled",u.value=h)}},function(h){if(e._status===0||e._status===-1){e._status=2,e._result=h;var E=e._ioInfo;E!=null&&(E.end=performance.now()),u.status===void 0&&(u.status="rejected",u.reason=h)}}),o=e._ioInfo,o!=null){o.value=u;var l=u.displayName;typeof l=="string"&&(o.name=l)}e._status===-1&&(e._status=0,e._result=u)}if(e._status===1)return o=e._result,o===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
8
8
|
|
|
9
9
|
Your code should look like:
|
|
10
10
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -16,10 +16,10 @@ Your code should look like:
|
|
|
16
16
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
17
17
|
2. You might be breaking the Rules of Hooks
|
|
18
18
|
3. You might have more than one copy of React in the same app
|
|
19
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function re(){v.asyncTransitions--}function z(e){if(Oe===null)try{var o=("require"+Math.random()).slice(0,7);Oe=(n&&n[o]).call(n,"timers").setImmediate}catch{Oe=function(l){ot===!1&&(ot=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var h=new MessageChannel;h.port1.onmessage=l,h.port2.postMessage(void 0)}}return Oe(e)}function q(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function M(e,o){o!==Pe-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Pe=o}function x(e,o,u){var l=v.actQueue;if(l!==null)if(l.length!==0)try{ne(l),z(function(){return x(e,o,u)});return}catch(h){v.thrownErrors.push(h)}else v.actQueue=null;0<v.thrownErrors.length?(l=q(v.thrownErrors),v.thrownErrors.length=0,u(l)):o(e)}function ne(e){if(!Ne){Ne=!0;var o=0;try{for(;o<e.length;o++){var u=e[o];do{v.didUsePromise=!1;var l=u(!1);if(l!==null){if(v.didUsePromise){e[o]=u,e.splice(0,o);return}u=l}else break}while(!0)}e.length=0}catch(h){e.splice(0,o+1),v.thrownErrors.push(h)}finally{Ne=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var B=Symbol.for("react.transitional.element"),fe=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),g=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ze=Symbol.for("react.activity"),Ve=Symbol.iterator,Be={},Ge={isMounted:function(){return!1},enqueueForceUpdate:function(e){c(e,"forceUpdate")},enqueueReplaceState:function(e){c(e,"replaceState")},enqueueSetState:function(e){c(e,"setState")}},Qe=Object.assign,De={};Object.freeze(De),p.prototype.isReactComponent={},p.prototype.setState=function(e,o){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,o,"setState")},p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var U={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(we in U)U.hasOwnProperty(we)&&s(we,U[we]);O.prototype=p.prototype,U=P.prototype=new O,U.constructor=P,Qe(U,p.prototype),U.isPureReactComponent=!0;var Xe=Array.isArray,St=Symbol.for("react.client.reference"),v={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Te=Object.prototype.hasOwnProperty,Ke=console.createTask?console.createTask:function(){return null};U={react_stack_bottom_frame:function(e){return e()}};var Je,Ze,et={},At=U.react_stack_bottom_frame.bind(U,K)(),kt=Ke($(K)),tt=!1,rt=/\/+/g,nt=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ot=!1,Oe=null,Pe=0,Se=!1,Ne=!1,st=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:z;U=Object.freeze({__proto__:null,c:function(e){return C().useMemoCache(e)}});var we={map:te,forEach:function(e,o,u){te(e,function(){o.apply(this,arguments)},u)},count:function(e){var o=0;return te(e,function(){o++}),o},toArray:function(e){return te(e,function(o){return o})||[]},only:function(e){if(!F(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=ze,t.Children=we,t.Component=p,t.Fragment=r,t.Profiler=f,t.PureComponent=P,t.StrictMode=i,t.Suspense=m,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=v,t.__COMPILER_RUNTIME=U,t.act=function(e){var o=v.actQueue,u=Pe;Pe++;var l=v.actQueue=o!==null?o:[],h=!1;try{var E=e()}catch(b){v.thrownErrors.push(b)}if(0<v.thrownErrors.length)throw M(o,u),e=q(v.thrownErrors),v.thrownErrors.length=0,e;if(E!==null&&typeof E=="object"&&typeof E.then=="function"){var y=E;return st(function(){h||Se||(Se=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(b,oe){h=!0,y.then(function(me){if(M(o,u),u===0){try{ne(l),z(function(){return x(me,b,oe)})}catch(Dt){v.thrownErrors.push(Dt)}if(0<v.thrownErrors.length){var jt=q(v.thrownErrors);v.thrownErrors.length=0,oe(jt)}}else b(me)},function(me){M(o,u),0<v.thrownErrors.length&&(me=q(v.thrownErrors),v.thrownErrors.length=0),oe(me)})}}}var T=E;if(M(o,u),u===0&&(ne(l),l.length!==0&&st(function(){h||Se||(Se=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),v.actQueue=null),0<v.thrownErrors.length)throw e=q(v.thrownErrors),v.thrownErrors.length=0,e;return{then:function(b,oe){h=!0,u===0?(v.actQueue=l,z(function(){return x(T,b,oe)})):b(T)}}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.captureOwnerStack=function(){var e=v.getCurrentStack;return e===null?null:e()},t.cloneElement=function(e,o,u){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var l=Qe({},e.props),h=e.key,E=e._owner;if(o!=null){var y;e:{if(Te.call(o,"ref")&&(y=Object.getOwnPropertyDescriptor(o,"ref").get)&&y.isReactWarning){y=!1;break e}y=o.ref!==void 0}y&&(E=H()),ue(o)&&(L(o.key),h=""+o.key);for(T in o)!Te.call(o,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&o.ref===void 0||(l[T]=o[T])}var T=arguments.length-2;if(T===1)l.children=u;else if(1<T){y=Array(T);for(var b=0;b<T;b++)y[b]=arguments[b+2];l.children=y}for(l=Z(e.type,h,l,E,e._debugStack,e._debugTask),h=2;h<arguments.length;h++)ee(arguments[h]);return l},t.createContext=function(e){return e={$$typeof:g,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:d,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},t.createElement=function(e,o,u){for(var l=2;l<arguments.length;l++)ee(arguments[l]);l={};var h=null;if(o!=null)for(b in Ze||!("__self"in o)||"key"in o||(Ze=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),ue(o)&&(L(o.key),h=""+o.key),o)Te.call(o,b)&&b!=="key"&&b!=="__self"&&b!=="__source"&&(l[b]=o[b]);var E=arguments.length-2;if(E===1)l.children=u;else if(1<E){for(var y=Array(E),T=0;T<E;T++)y[T]=arguments[T+2];Object.freeze&&Object.freeze(y),l.children=y}if(e&&e.defaultProps)for(b in E=e.defaultProps,E)l[b]===void 0&&(l[b]=E[b]);h&&J(l,typeof e=="function"?e.displayName||e.name||"Unknown":e);var b=1e4>v.recentlyCreatedOwnerStacks++;return Z(e,h,l,H(),b?Error("react-stack-top-frame"):At,b?Ke($(e)):kt)},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){e!=null&&e.$$typeof===S?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var o={$$typeof:w,render:e},u;return Object.defineProperty(o,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(l){u=l,e.name||e.displayName||(Object.defineProperty(e,"name",{value:l}),e.displayName=l)}}),o},t.isValidElement=F,t.lazy=function(e){e={_status:-1,_result:e};var o={$$typeof:G,_payload:e,_init:le},u={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=u,o._debugInfo=[{awaited:u}],o},t.memo=function(e,o){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),o={$$typeof:S,type:e,compare:o===void 0?null:o};var u;return Object.defineProperty(o,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(l){u=l,e.name||e.displayName||(Object.defineProperty(e,"name",{value:l}),e.displayName=l)}}),o},t.startTransition=function(e){var o=v.T,u={};u._updatedFibers=new Set,v.T=u;try{var l=e(),h=v.S;h!==null&&h(u,l),typeof l=="object"&&l!==null&&typeof l.then=="function"&&(v.asyncTransitions++,l.then(re,re),l.then(D,nt))}catch(E){nt(E)}finally{o===null&&u._updatedFibers&&(e=u._updatedFibers.size,u._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),o!==null&&u.types!==null&&(o.types!==null&&o.types!==u.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),o.types=u.types),v.T=o}},t.unstable_useCacheRefresh=function(){return C().useCacheRefresh()},t.use=function(e){return C().use(e)},t.useActionState=function(e,o,u){return C().useActionState(e,o,u)},t.useCallback=function(e,o){return C().useCallback(e,o)},t.useContext=function(e){var o=C();return e.$$typeof===d&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),o.useContext(e)},t.useDebugValue=function(e,o){return C().useDebugValue(e,o)},t.useDeferredValue=function(e,o){return C().useDeferredValue(e,o)},t.useEffect=function(e,o){return e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),C().useEffect(e,o)},t.useEffectEvent=function(e){return C().useEffectEvent(e)},t.useId=function(){return C().useId()},t.useImperativeHandle=function(e,o,u){return C().useImperativeHandle(e,o,u)},t.useInsertionEffect=function(e,o){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),C().useInsertionEffect(e,o)},t.useLayoutEffect=function(e,o){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),C().useLayoutEffect(e,o)},t.useMemo=function(e,o){return C().useMemo(e,o)},t.useOptimistic=function(e,o){return C().useOptimistic(e,o)},t.useReducer=function(e,o,u){return C().useReducer(e,o,u)},t.useRef=function(e){return C().useRef(e)},t.useState=function(e){return C().useState(e)},t.useSyncExternalStore=function(e,o,u){return C().useSyncExternalStore(e,o,u)},t.useTransition=function(){return C().useTransition()},t.version="19.2.3",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(Ee,Ee.exports)),Ee.exports}var qe;function xe(){return qe||(qe=1,process.env.NODE_ENV==="production"?Ce.exports=Rt():Ce.exports=Ct()),Ce.exports}var $e;function Tt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){function n(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===le?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case J:return"Fragment";case Z:return"Profiler";case W:return"StrictMode";case ce:return"Suspense";case R:return"SuspenseList";case te:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case ue:return"Portal";case ee:return r.displayName||"Context";case ae:return(r._context.displayName||"Context")+".Consumer";case F:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case pe:return i=r.displayName||null,i!==null?i:n(r.type)||"Memo";case N:i=r._payload,r=r._init;try{return n(r(i))}catch{}}return null}function t(r){return""+r}function s(r){try{t(r);var i=!1}catch{i=!0}if(i){i=console;var f=i.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return f.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),t(r)}}function a(r){if(r===J)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===N)return"<...>";try{var i=n(r);return i?"<"+i+">":"<...>"}catch{return"<...>"}}function c(){var r=C.A;return r===null?null:r.getOwner()}function p(){return Error("react-stack-top-frame")}function O(r){if(re.call(r,"key")){var i=Object.getOwnPropertyDescriptor(r,"key").get;if(i&&i.isReactWarning)return!1}return r.key!==void 0}function P(r,i){function f(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}f.isReactWarning=!0,Object.defineProperty(r,"key",{get:f,configurable:!0})}function D(){var r=n(this.type);return x[r]||(x[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function V(r,i,f,d,g,w){var m=f.ref;return r={$$typeof:K,type:r,key:i,props:f,_owner:d},(m!==void 0?m:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:D}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:g}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function L(r,i,f,d,g,w){var m=i.children;if(m!==void 0)if(d)if(z(m)){for(d=0;d<m.length;d++)Y(m[d]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(m);if(re.call(i,"key")){m=n(r);var A=Object.keys(i).filter(function(G){return G!=="key"});d=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",fe[m+d]||(A=0<A.length?"{"+A.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
19
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function re(){v.asyncTransitions--}function z(e){if(Oe===null)try{var o=("require"+Math.random()).slice(0,7);Oe=(n&&n[o]).call(n,"timers").setImmediate}catch{Oe=function(l){ot===!1&&(ot=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var h=new MessageChannel;h.port1.onmessage=l,h.port2.postMessage(void 0)}}return Oe(e)}function q(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function M(e,o){o!==Se-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Se=o}function x(e,o,u){var l=v.actQueue;if(l!==null)if(l.length!==0)try{ne(l),z(function(){return x(e,o,u)});return}catch(h){v.thrownErrors.push(h)}else v.actQueue=null;0<v.thrownErrors.length?(l=q(v.thrownErrors),v.thrownErrors.length=0,u(l)):o(e)}function ne(e){if(!Ne){Ne=!0;var o=0;try{for(;o<e.length;o++){var u=e[o];do{v.didUsePromise=!1;var l=u(!1);if(l!==null){if(v.didUsePromise){e[o]=u,e.splice(0,o);return}u=l}else break}while(!0)}e.length=0}catch(h){e.splice(0,o+1),v.thrownErrors.push(h)}finally{Ne=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var B=Symbol.for("react.transitional.element"),fe=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),g=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ze=Symbol.for("react.activity"),Ve=Symbol.iterator,Be={},Ge={isMounted:function(){return!1},enqueueForceUpdate:function(e){c(e,"forceUpdate")},enqueueReplaceState:function(e){c(e,"replaceState")},enqueueSetState:function(e){c(e,"setState")}},Qe=Object.assign,De={};Object.freeze(De),p.prototype.isReactComponent={},p.prototype.setState=function(e,o){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,o,"setState")},p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var H={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(we in H)H.hasOwnProperty(we)&&s(we,H[we]);O.prototype=p.prototype,H=S.prototype=new O,H.constructor=S,Qe(H,p.prototype),H.isPureReactComponent=!0;var Xe=Array.isArray,Pt=Symbol.for("react.client.reference"),v={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Te=Object.prototype.hasOwnProperty,Ke=console.createTask?console.createTask:function(){return null};H={react_stack_bottom_frame:function(e){return e()}};var Ze,Je,et={},At=H.react_stack_bottom_frame.bind(H,K)(),kt=Ke($(K)),tt=!1,rt=/\/+/g,nt=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ot=!1,Oe=null,Se=0,Pe=!1,Ne=!1,st=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:z;H=Object.freeze({__proto__:null,c:function(e){return C().useMemoCache(e)}});var we={map:te,forEach:function(e,o,u){te(e,function(){o.apply(this,arguments)},u)},count:function(e){var o=0;return te(e,function(){o++}),o},toArray:function(e){return te(e,function(o){return o})||[]},only:function(e){if(!F(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=ze,t.Children=we,t.Component=p,t.Fragment=r,t.Profiler=f,t.PureComponent=S,t.StrictMode=i,t.Suspense=m,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=v,t.__COMPILER_RUNTIME=H,t.act=function(e){var o=v.actQueue,u=Se;Se++;var l=v.actQueue=o!==null?o:[],h=!1;try{var E=e()}catch(b){v.thrownErrors.push(b)}if(0<v.thrownErrors.length)throw M(o,u),e=q(v.thrownErrors),v.thrownErrors.length=0,e;if(E!==null&&typeof E=="object"&&typeof E.then=="function"){var y=E;return st(function(){h||Pe||(Pe=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(b,oe){h=!0,y.then(function(me){if(M(o,u),u===0){try{ne(l),z(function(){return x(me,b,oe)})}catch(Dt){v.thrownErrors.push(Dt)}if(0<v.thrownErrors.length){var jt=q(v.thrownErrors);v.thrownErrors.length=0,oe(jt)}}else b(me)},function(me){M(o,u),0<v.thrownErrors.length&&(me=q(v.thrownErrors),v.thrownErrors.length=0),oe(me)})}}}var T=E;if(M(o,u),u===0&&(ne(l),l.length!==0&&st(function(){h||Pe||(Pe=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),v.actQueue=null),0<v.thrownErrors.length)throw e=q(v.thrownErrors),v.thrownErrors.length=0,e;return{then:function(b,oe){h=!0,u===0?(v.actQueue=l,z(function(){return x(T,b,oe)})):b(T)}}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.captureOwnerStack=function(){var e=v.getCurrentStack;return e===null?null:e()},t.cloneElement=function(e,o,u){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var l=Qe({},e.props),h=e.key,E=e._owner;if(o!=null){var y;e:{if(Te.call(o,"ref")&&(y=Object.getOwnPropertyDescriptor(o,"ref").get)&&y.isReactWarning){y=!1;break e}y=o.ref!==void 0}y&&(E=U()),ue(o)&&(L(o.key),h=""+o.key);for(T in o)!Te.call(o,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&o.ref===void 0||(l[T]=o[T])}var T=arguments.length-2;if(T===1)l.children=u;else if(1<T){y=Array(T);for(var b=0;b<T;b++)y[b]=arguments[b+2];l.children=y}for(l=J(e.type,h,l,E,e._debugStack,e._debugTask),h=2;h<arguments.length;h++)ee(arguments[h]);return l},t.createContext=function(e){return e={$$typeof:g,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:d,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},t.createElement=function(e,o,u){for(var l=2;l<arguments.length;l++)ee(arguments[l]);l={};var h=null;if(o!=null)for(b in Je||!("__self"in o)||"key"in o||(Je=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),ue(o)&&(L(o.key),h=""+o.key),o)Te.call(o,b)&&b!=="key"&&b!=="__self"&&b!=="__source"&&(l[b]=o[b]);var E=arguments.length-2;if(E===1)l.children=u;else if(1<E){for(var y=Array(E),T=0;T<E;T++)y[T]=arguments[T+2];Object.freeze&&Object.freeze(y),l.children=y}if(e&&e.defaultProps)for(b in E=e.defaultProps,E)l[b]===void 0&&(l[b]=E[b]);h&&Z(l,typeof e=="function"?e.displayName||e.name||"Unknown":e);var b=1e4>v.recentlyCreatedOwnerStacks++;return J(e,h,l,U(),b?Error("react-stack-top-frame"):At,b?Ke($(e)):kt)},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){e!=null&&e.$$typeof===P?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var o={$$typeof:w,render:e},u;return Object.defineProperty(o,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(l){u=l,e.name||e.displayName||(Object.defineProperty(e,"name",{value:l}),e.displayName=l)}}),o},t.isValidElement=F,t.lazy=function(e){e={_status:-1,_result:e};var o={$$typeof:G,_payload:e,_init:le},u={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=u,o._debugInfo=[{awaited:u}],o},t.memo=function(e,o){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),o={$$typeof:P,type:e,compare:o===void 0?null:o};var u;return Object.defineProperty(o,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(l){u=l,e.name||e.displayName||(Object.defineProperty(e,"name",{value:l}),e.displayName=l)}}),o},t.startTransition=function(e){var o=v.T,u={};u._updatedFibers=new Set,v.T=u;try{var l=e(),h=v.S;h!==null&&h(u,l),typeof l=="object"&&l!==null&&typeof l.then=="function"&&(v.asyncTransitions++,l.then(re,re),l.then(D,nt))}catch(E){nt(E)}finally{o===null&&u._updatedFibers&&(e=u._updatedFibers.size,u._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),o!==null&&u.types!==null&&(o.types!==null&&o.types!==u.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),o.types=u.types),v.T=o}},t.unstable_useCacheRefresh=function(){return C().useCacheRefresh()},t.use=function(e){return C().use(e)},t.useActionState=function(e,o,u){return C().useActionState(e,o,u)},t.useCallback=function(e,o){return C().useCallback(e,o)},t.useContext=function(e){var o=C();return e.$$typeof===d&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),o.useContext(e)},t.useDebugValue=function(e,o){return C().useDebugValue(e,o)},t.useDeferredValue=function(e,o){return C().useDeferredValue(e,o)},t.useEffect=function(e,o){return e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),C().useEffect(e,o)},t.useEffectEvent=function(e){return C().useEffectEvent(e)},t.useId=function(){return C().useId()},t.useImperativeHandle=function(e,o,u){return C().useImperativeHandle(e,o,u)},t.useInsertionEffect=function(e,o){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),C().useInsertionEffect(e,o)},t.useLayoutEffect=function(e,o){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),C().useLayoutEffect(e,o)},t.useMemo=function(e,o){return C().useMemo(e,o)},t.useOptimistic=function(e,o){return C().useOptimistic(e,o)},t.useReducer=function(e,o,u){return C().useReducer(e,o,u)},t.useRef=function(e){return C().useRef(e)},t.useState=function(e){return C().useState(e)},t.useSyncExternalStore=function(e,o,u){return C().useSyncExternalStore(e,o,u)},t.useTransition=function(){return C().useTransition()},t.version="19.2.3",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(Ee,Ee.exports)),Ee.exports}var qe;function xe(){return qe||(qe=1,process.env.NODE_ENV==="production"?Ce.exports=Rt():Ce.exports=Ct()),Ce.exports}var $e;function Tt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){function n(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===le?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case Z:return"Fragment";case J:return"Profiler";case W:return"StrictMode";case ce:return"Suspense";case R:return"SuspenseList";case te:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case ue:return"Portal";case ee:return r.displayName||"Context";case ae:return(r._context.displayName||"Context")+".Consumer";case F:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case pe:return i=r.displayName||null,i!==null?i:n(r.type)||"Memo";case N:i=r._payload,r=r._init;try{return n(r(i))}catch{}}return null}function t(r){return""+r}function s(r){try{t(r);var i=!1}catch{i=!0}if(i){i=console;var f=i.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return f.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),t(r)}}function a(r){if(r===Z)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===N)return"<...>";try{var i=n(r);return i?"<"+i+">":"<...>"}catch{return"<...>"}}function c(){var r=C.A;return r===null?null:r.getOwner()}function p(){return Error("react-stack-top-frame")}function O(r){if(re.call(r,"key")){var i=Object.getOwnPropertyDescriptor(r,"key").get;if(i&&i.isReactWarning)return!1}return r.key!==void 0}function S(r,i){function f(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}f.isReactWarning=!0,Object.defineProperty(r,"key",{get:f,configurable:!0})}function D(){var r=n(this.type);return x[r]||(x[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function V(r,i,f,d,g,w){var m=f.ref;return r={$$typeof:K,type:r,key:i,props:f,_owner:d},(m!==void 0?m:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:D}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:g}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function L(r,i,f,d,g,w){var m=i.children;if(m!==void 0)if(d)if(z(m)){for(d=0;d<m.length;d++)Y(m[d]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(m);if(re.call(i,"key")){m=n(r);var k=Object.keys(i).filter(function(G){return G!=="key"});d=0<k.length?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}",fe[m+d]||(k=0<k.length?"{"+k.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
20
20
|
let props = %s;
|
|
21
21
|
<%s {...props} />
|
|
22
22
|
React keys must be passed directly to JSX without using spread:
|
|
23
23
|
let props = %s;
|
|
24
|
-
<%s key={someKey} {...props} />`,d,m,
|
|
24
|
+
<%s key={someKey} {...props} />`,d,m,k,m),fe[m+d]=!0)}if(m=null,f!==void 0&&(s(f),m=""+f),O(i)&&(s(i.key),m=""+i.key),"key"in i){f={};for(var P in i)P!=="key"&&(f[P]=i[P])}else f=i;return m&&S(f,typeof r=="function"?r.displayName||r.name||"Unknown":r),V(r,m,f,c(),g,w)}function Y(r){$(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===N&&(r._payload.status==="fulfilled"?$(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function $(r){return typeof r=="object"&&r!==null&&r.$$typeof===K}var U=xe(),K=Symbol.for("react.transitional.element"),ue=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),pe=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),le=Symbol.for("react.client.reference"),C=U.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=Object.prototype.hasOwnProperty,z=Array.isArray,q=console.createTask?console.createTask:function(){return null};U={react_stack_bottom_frame:function(r){return r()}};var M,x={},ne=U.react_stack_bottom_frame.bind(U,p)(),B=q(a(p)),fe={};ve.Fragment=Z,ve.jsx=function(r,i,f){var d=1e4>C.recentlyCreatedOwnerStacks++;return L(r,i,f,!1,d?Error("react-stack-top-frame"):ne,d?q(a(r)):B)},ve.jsxs=function(r,i,f){var d=1e4>C.recentlyCreatedOwnerStacks++;return L(r,i,f,!0,d?Error("react-stack-top-frame"):ne,d?q(a(r)):B)}}()),ve}var We;function Ot(){return We||(We=1,process.env.NODE_ENV==="production"?Re.exports=wt():Re.exports=Tt()),Re.exports}var I=Ot(),be=xe();class St extends be.Component{constructor(t){super(t),this.unfilteredDocuments=[],this.state={documents:[],mode:0}}async componentDidMount(){const{controller:t}=this.props;this.unsubscriber=t.onChange(s=>{s.documentCollection&&(this.unfilteredDocuments=s.documentCollection,this.setState({documents:t.filter(this.unfilteredDocuments)})),s.action==="filterChange"?this.setState({documents:t.filter(this.unfilteredDocuments)}):this.setState({})}),this.unfilteredDocuments=await t.documentCollection(),this.setState({documents:t.filter(this.unfilteredDocuments)})}componentWillUnmount(){this.unsubscriber?.()}newDocument(){this.props.controller.newDocument(),this.setState({mode:1})}editDocument(t){this.props.controller.setDocument(t),this.setState({mode:2})}async storeDocument(t){const{controller:s,layout:a}=this.props;s.setDocument(t),await s.storeDocument(),a==="formAndItems"?this.newDocument():this.setState({mode:0})}invokeContentViewChild(t){const{children:s,layout:a,controller:c}=this.props,{mode:p}=this.state,O=a!=="formAndItems";if(!c.document)return;const S={controller:c,submitButtonCaption:p==2?t?.updateButtonLabel:t?.addButtonLabel,onSubmit:D=>this.storeDocument(D),onCancel:O?()=>this.setState({mode:0}):()=>this.newDocument()};return typeof s[0]=="function"?be.cloneElement(s[0](S),{key:c.document.id}):be.cloneElement(s[0],{key:c.document.id,...S})}invokeDetailViewChild(t){const{children:s,controller:a}=this.props,c={document:t,onSelect:p=>this.editDocument(p),onDelete:p=>a.setDocument(p).deleteDocument()};return typeof s[1]=="function"?be.cloneElement(s[1](c),{key:t.id}):be.cloneElement(s[1],{key:t.id,...c})}render(){const{mode:t,documents:s}=this.state,{className:a,cardAddButton:c,controller:p}=this.props,O=Et(p.document?.className);let S=this.props.labels||{};const D=this.props.layout||"itemsAlways";typeof S=="function"&&(S=S(p));const{addNewDocumentLabel:V,singularDocumentInCollectionCaption:L,documentsInCollectionCaption:Y,noDocumentsFoundLabel:$}=S;return I.jsxs("div",{className:`crud-panel ${O} ${a||""}`,children:[t===0&&D!=="formAndItems"&&!c&&I.jsx("div",{className:"header",children:this.props.header?typeof this.props.header=="function"?this.props.header(p,()=>this.newDocument(),S):this.props.header:I.jsx("button",{onClick:()=>this.newDocument(),children:V})}),(D==="formAndItems"||t===1||t===2)&&I.jsx("div",{className:"content-panel",children:this.invokeContentViewChild(S)}),(D==="itemsAlways"||D==="formAndItems"||t===0)&&I.jsxs("div",{className:"collection-panel",children:[s?.length>0&&I.jsx("h3",{children:s.length>1?Y:L||Y}),I.jsxs("div",{className:"documents",children:[c&&I.jsxs("div",{className:"crud-card card-add-button clickable",onClick:()=>this.newDocument(),children:[I.jsx("div",{className:"button-element",children:c}),I.jsx("div",{className:"add-label",children:V})]}),s?.length?s.map(U=>this.invokeDetailViewChild(U)):I.jsx("p",{children:$})]})]}),I.jsx("div",{className:"footer",children:this.props.footer&&typeof this.props.footer=="function"?this.props.footer(p,()=>this.newDocument(),S):this.props.footer})]})}}se.CrudController=je,se.CrudPanel=St,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|
|
25
25
|
//# sourceMappingURL=entropic-bond-crud-panel.umd.cjs.map
|