@inspectr/app 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/_astro/client.DghpSMxZ.js +33 -0
- package/dist/_astro/{index.uG8-tmmD.js → index.CtIA4zXx.js} +1 -1
- package/dist/_astro/{index.DqJDusVa.css → index.DkFoYwcI.css} +1 -1
- package/dist/_astro/ui.Ct8_qMBH.js +25 -0
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/_astro/client.WCY5ZO72.js +0 -33
- package/dist/_astro/ui.VFnAlxts.js +0 -23
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{r as K,s as Ve}from"./index.CtIA4zXx.js";var Ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Hr={exports:{}},It={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ur;function Go(){if(Ur)return It;Ur=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function d(y,k,_){var C=null;if(_!==void 0&&(C=""+_),k.key!==void 0&&(C=""+k.key),"key"in k){_={};for(var P in k)P!=="key"&&(_[P]=k[P])}else _=k;return k=_.ref,{$$typeof:s,type:y,key:C,ref:k!==void 0?k:null,props:_}}return It.Fragment=c,It.jsx=d,It.jsxs=d,It}var Gr;function $o(){return Gr||(Gr=1,Hr.exports=Go()),Hr.exports}var i=$o(),lr={exports:{}},Jo=lr.exports,$r;function Zo(){return $r||($r=1,function(s,c){(function(d,y){s.exports=y()})(Jo,function(){var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])})(e,t)},y=function(){return(y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function k(e,t,n){for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var _=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ho,C=Object.keys,P=Array.isArray;function L(e,t){return typeof t!="object"||C(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||_.Promise||(_.Promise=Promise);var z=Object.getPrototypeOf,R={}.hasOwnProperty;function D(e,t){return R.call(e,t)}function G(e,t){typeof t=="function"&&(t=t(z(e))),(typeof Reflect>"u"?C:Reflect.ownKeys)(t).forEach(function(n){M(e,n,t[n])})}var te=Object.defineProperty;function M(e,t,n,r){te(e,t,L(n&&D(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function $(e){return{from:function(t){return e.prototype=Object.create(t.prototype),M(e.prototype,"constructor",e),{extend:G.bind(null,e.prototype)}}}}var V=Object.getOwnPropertyDescriptor,ue=[].slice;function ne(e,t,n){return ue.call(e,t,n)}function _e(e,t){return t(e)}function ve(e){if(!e)throw new Error("Assertion Failed")}function he(e){_.setImmediate?setImmediate(e):setTimeout(e,0)}function re(e,t){if(typeof t=="string"&&D(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],r=0,o=t.length;r<o;++r){var a=re(e,t[r]);n.push(a)}return n}var u=t.indexOf(".");if(u!==-1){var l=e[t.substr(0,u)];return l==null?void 0:re(l,t.substr(u+1))}}function ee(e,t,n){if(e&&t!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){ve(typeof n!="string"&&"length"in n);for(var r=0,o=t.length;r<o;++r)ee(e,t[r],n[r])}else{var a,u,l=t.indexOf(".");l!==-1?(a=t.substr(0,l),(u=t.substr(l+1))===""?n===void 0?P(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n:ee(l=!(l=e[a])||!D(e,a)?e[a]={}:l,u,n)):n===void 0?P(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function xe(e){var t,n={};for(t in e)D(e,t)&&(n[t]=e[t]);return n}var Ae=[].concat;function se(e){return Ae.apply([],e)}var at="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(se([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return _[e]}),We=new Set(at.map(function(e){return _[e]})),Me=null;function De(e){return Me=new WeakMap,e=function t(n){if(!n||typeof n!="object")return n;var r=Me.get(n);if(r)return r;if(P(n)){r=[],Me.set(n,r);for(var o=0,a=n.length;o<a;++o)r.push(t(n[o]))}else if(We.has(n.constructor))r=n;else{var u,l=z(n);for(u in r=l===Object.prototype?{}:Object.create(l),Me.set(n,r),n)D(n,u)&&(r[u]=t(n[u]))}return r}(e),Me=null,e}var Te={}.toString;function J(e){return Te.call(e).slice(8,-1)}var fe=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Le=typeof fe=="symbol"?function(e){var t;return e!=null&&(t=e[fe])&&t.apply(e)}:function(){return null};function Se(e,t){return t=e.indexOf(t),0<=t&&e.splice(t,1),0<=t}var Pe={};function Be(e){var t,n,r,o;if(arguments.length===1){if(P(e))return e.slice();if(this===Pe&&typeof e=="string")return[e];if(o=Le(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(e==null)return[e];if(typeof(t=e.length)!="number")return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var H=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ct=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ze=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ct),Z={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ce(e,t){this.name=e,this.message=t}function be(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,r,o){return o.indexOf(n)===r}).join(`
|
|
10
|
+
`)}function ye(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=be(e,t)}function pe(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=be(e,this.failures)}$(ce).from(Error).extend({toString:function(){return this.name+": "+this.message}}),$(ye).from(ce),$(pe).from(ce);var yt=ze.reduce(function(e,t){return e[t]=t+"Error",e},{}),we=ce,U=ze.reduce(function(e,t){var n=t+"Error";function r(o,a){this.name=n,o?typeof o=="string"?(this.message="".concat(o).concat(a?`
|
|
11
|
+
`+a:""),this.inner=a||null):typeof o=="object"&&(this.message="".concat(o.name," ").concat(o.message),this.inner=o):(this.message=Z[t]||n,this.inner=null)}return $(r).from(we),e[t]=r,e},{});U.Syntax=SyntaxError,U.Type=TypeError,U.Range=RangeError;var dr=Ct.reduce(function(e,t){return e[t+"Error"]=U[t],e},{}),Vt=ze.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=U[t]),e},{});function de(){}function _t(e){return e}function yo(e,t){return e==null||e===_t?t:function(n){return t(e(n))}}function ot(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function go(e,t){return e===de?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?ot(r,this.onsuccess):r),o&&(this.onerror=this.onerror?ot(o,this.onerror):o),a!==void 0?a:n}}function vo(e,t){return e===de?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?ot(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ot(r,this.onerror):r)}}function bo(e,t){return e===de?t:function(n){var r=e.apply(this,arguments);L(n,r);var o=this.onsuccess,a=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),o&&(this.onsuccess=this.onsuccess?ot(o,this.onsuccess):o),a&&(this.onerror=this.onerror?ot(a,this.onerror):a),r===void 0?n===void 0?void 0:n:L(r,n)}}function xo(e,t){return e===de?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function An(e,t){return e===de?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,o=arguments.length,a=new Array(o);o--;)a[o]=arguments[o];return n.then(function(){return t.apply(r,a)})}return t.apply(this,arguments)}}Vt.ModifyError=ye,Vt.DexieError=ce,Vt.BulkError=pe;var Qe=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function hr(e){Qe=e}var Nt={},pr=100,at=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,z(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,z(t),e]}(),Ct=at[0],ze=at[1],at=at[2],ze=ze&&ze.then,it=Ct&&Ct.constructor,_n=!!at,St=function(e,t){Pt.push([e,t]),Qt&&(queueMicrotask(jo),Qt=!1)},Nn=!0,Qt=!0,st=[],Ht=[],Cn=_t,Je={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:de,pgp:!1,env:{},finalize:de},Q=Je,Pt=[],ut=0,Ut=[];function F(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=Q;if(typeof e!="function"){if(e!==Nt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Pn(this,this._value))}this._state=null,this._value=null,++t.ref,function n(r,o){try{o(function(a){if(r._state===null){if(a===r)throw new TypeError("A promise cannot be resolved with itself.");var u=r._lib&>();a&&typeof a.then=="function"?n(r,function(l,h){a instanceof F?a._then(l,h):a.then(l,h)}):(r._state=!0,r._value=a,yr(r)),u&&vt()}},Pn.bind(null,r))}catch(a){Pn(r,a)}}(this,e)}var Sn={get:function(){var e=Q,t=Zt;function n(r,o){var a=this,u=!e.global&&(e!==Q||t!==Zt),l=u&&!Ye(),h=new F(function(m,b){On(a,new mr(vr(r,e,u,l),vr(o,e,u,l),m,b,e))});return this._consoleTask&&(h._consoleTask=this._consoleTask),h}return n.prototype=Nt,n},set:function(e){M(this,"then",e&&e.prototype===Nt?Sn:{get:function(){return e},set:Sn.set})}};function mr(e,t,n,r,o){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=r,this.psd=o}function Pn(e,t){var n,r;Ht.push(t),e._state===null&&(n=e._lib&>(),t=Cn(t),e._state=!1,e._value=t,r=e,st.some(function(o){return o._value===r._value})||st.push(r),yr(e),n&&vt())}function yr(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)On(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),ut===0&&(++ut,St(function(){--ut==0&&En()},[]))}function On(e,t){if(e._state!==null){var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ut,St(wo,[n,e,t])}else e._listeners.push(t)}function wo(e,t,n){try{var r,o=t._value;!t._state&&Ht.length&&(Ht=[]),r=Qe&&t._consoleTask?t._consoleTask.run(function(){return e(o)}):e(o),t._state||Ht.indexOf(o)!==-1||function(a){for(var u=st.length;u;)if(st[--u]._value===a._value)return st.splice(u,1)}(t),n.resolve(r)}catch(a){n.reject(a)}finally{--ut==0&&En(),--n.psd.ref||n.psd.finalize()}}function jo(){lt(Je,function(){gt()&&vt()})}function gt(){var e=Nn;return Qt=Nn=!1,e}function vt(){var e,t,n;do for(;0<Pt.length;)for(e=Pt,Pt=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<Pt.length);Qt=Nn=!0}function En(){var e=st;st=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var t=Ut.slice(0),n=t.length;n;)t[--n]()}function Gt(e){return new F(Nt,!1,e)}function ge(e,t){var n=Q;return function(){var r=gt(),o=Q;try{return Xe(n,!0),e.apply(this,arguments)}catch(a){t&&t(a)}finally{Xe(o,!1),r&&vt()}}}G(F.prototype,{then:Sn,_then:function(e,t){On(this,new mr(null,null,e,t,Q))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=e,n=arguments[1];return typeof t=="function"?this.then(null,function(r){return(r instanceof t?n:Gt)(r)}):this.then(null,function(r){return(r&&r.name===t?n:Gt)(r)})},finally:function(e){return this.then(function(t){return F.resolve(e()).then(function(){return t})},function(t){return F.resolve(e()).then(function(){return Gt(t)})})},timeout:function(e,t){var n=this;return e<1/0?new F(function(r,o){var a=setTimeout(function(){return o(new U.Timeout(t))},e);n.then(r,o).finally(clearTimeout.bind(null,a))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&M(F.prototype,Symbol.toStringTag,"Dexie.Promise"),Je.env=gr(),G(F,{all:function(){var e=Be.apply(null,arguments).map(Yt);return new F(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(o,a){return F.resolve(o).then(function(u){e[a]=u,--r||t(e)},n)})})},resolve:function(e){return e instanceof F?e:e&&typeof e.then=="function"?new F(function(t,n){e.then(t,n)}):new F(Nt,!0,e)},reject:Gt,race:function(){var e=Be.apply(null,arguments).map(Yt);return new F(function(t,n){e.map(function(r){return F.resolve(r).then(t,n)})})},PSD:{get:function(){return Q},set:function(e){return Q=e}},totalEchoes:{get:function(){return Zt}},newPSD:Ze,usePSD:lt,scheduler:{get:function(){return St},set:function(e){St=e}},rejectionMapper:{get:function(){return Cn},set:function(e){Cn=e}},follow:function(e,t){return new F(function(n,r){return Ze(function(o,a){var u=Q;u.unhandleds=[],u.onunhandled=a,u.finalize=ot(function(){var l,h=this;l=function(){h.unhandleds.length===0?o():a(h.unhandleds[0])},Ut.push(function m(){l(),Ut.splice(Ut.indexOf(m),1)}),++ut,St(function(){--ut==0&&En()},[])},u.finalize),e()},t,n,r)})}}),it&&(it.allSettled&&M(F,"allSettled",function(){var e=Be.apply(null,arguments).map(Yt);return new F(function(t){e.length===0&&t([]);var n=e.length,r=new Array(n);e.forEach(function(o,a){return F.resolve(o).then(function(u){return r[a]={status:"fulfilled",value:u}},function(u){return r[a]={status:"rejected",reason:u}}).then(function(){return--n||t(r)})})})}),it.any&&typeof AggregateError<"u"&&M(F,"any",function(){var e=Be.apply(null,arguments).map(Yt);return new F(function(t,n){e.length===0&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach(function(a,u){return F.resolve(a).then(function(l){return t(l)},function(l){o[u]=l,--r||n(new AggregateError(o))})})})}),it.withResolvers&&(F.withResolvers=it.withResolvers));var Ne={awaits:0,echoes:0,id:0},ko=0,$t=[],Jt=0,Zt=0,Ao=0;function Ze(e,t,n,r){var o=Q,a=Object.create(o);return a.parent=o,a.ref=0,a.global=!1,a.id=++Ao,Je.env,a.env=_n?{Promise:F,PromiseProp:{value:F,configurable:!0,writable:!0},all:F.all,race:F.race,allSettled:F.allSettled,any:F.any,resolve:F.resolve,reject:F.reject}:{},t&&L(a,t),++o.ref,a.finalize=function(){--this.parent.ref||this.parent.finalize()},r=lt(a,e,n,r),a.ref===0&&a.finalize(),r}function bt(){return Ne.id||(Ne.id=++ko),++Ne.awaits,Ne.echoes+=pr,Ne.id}function Ye(){return!!Ne.awaits&&(--Ne.awaits==0&&(Ne.id=0),Ne.echoes=Ne.awaits*pr,!0)}function Yt(e){return Ne.echoes&&e&&e.constructor===it?(bt(),e.then(function(t){return Ye(),t},function(t){return Ye(),je(t)})):e}function _o(){var e=$t[$t.length-1];$t.pop(),Xe(e,!1)}function Xe(e,t){var n,r=Q;(t?!Ne.echoes||Jt++&&e===Q:!Jt||--Jt&&e===Q)||queueMicrotask(t?function(o){++Zt,Ne.echoes&&--Ne.echoes!=0||(Ne.echoes=Ne.awaits=Ne.id=0),$t.push(Q),Xe(o,!0)}.bind(null,e):_o),e!==Q&&(Q=e,r===Je&&(Je.env=gr()),_n&&(n=Je.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(_,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function gr(){var e=_.Promise;return _n?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(_,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function lt(e,t,n,r,o){var a=Q;try{return Xe(e,!0),t(n,r,o)}finally{Xe(a,!1)}}function vr(e,t,n,r){return typeof e!="function"?e:function(){var o=Q;n&&bt(),Xe(t,!0);try{return e.apply(this,arguments)}finally{Xe(o,!1),r&&queueMicrotask(Ye)}}}function Rn(e){Promise===it&&Ne.echoes===0?Jt===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+ze).indexOf("[native code]")===-1&&(bt=Ye=de);var je=F.reject,ct="",Ge="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",br="String expected.",xt=[],Xt="__dbnames",Mn="readonly",qn="readwrite";function ft(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var xr={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function en(e){return typeof e!="string"||/\./.test(e)?function(t){return t}:function(t){return t[e]===void 0&&e in t&&delete(t=De(t))[e],t}}function wr(){throw U.Type()}function ie(e,t){try{var n=jr(e),r=jr(t);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(o,a){for(var u=o.length,l=a.length,h=u<l?u:l,m=0;m<h;++m)if(o[m]!==a[m])return o[m]<a[m]?-1:1;return u===l?0:u<l?-1:1}(kr(e),kr(t));case"Array":return function(o,a){for(var u=o.length,l=a.length,h=u<l?u:l,m=0;m<h;++m){var b=ie(o[m],a[m]);if(b!==0)return b}return u===l?0:u<l?-1:1}(e,t)}}catch{}return NaN}function jr(e){var t=typeof e;return t!="object"?t:ArrayBuffer.isView(e)?"binary":(e=J(e),e==="ArrayBuffer"?"binary":e)}function kr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var Ar=(me.prototype._trans=function(e,t,n){var r=this._tx||Q.trans,o=this.name,a=Qe&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function u(m,b,f){if(!f.schema[o])throw new U.NotFound("Table "+o+" not part of transaction");return t(f.idbtrans,f)}var l=gt();try{var h=r&&r.db._novip===this.db._novip?r===Q.trans?r._promise(e,u,n):Ze(function(){return r._promise(e,u,n)},{trans:r,transless:Q.transless||Q}):function m(b,f,w,p){if(b.idbdb&&(b._state.openComplete||Q.letThrough||b._vip)){var v=b._createTransaction(f,w,b._dbSchema);try{v.create(),b._state.PR1398_maxLoop=3}catch(x){return x.name===yt.InvalidState&&b.isOpen()&&0<--b._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),b.close({disableAutoOpen:!1}),b.open().then(function(){return m(b,f,w,p)})):je(x)}return v._promise(f,function(x,g){return Ze(function(){return Q.trans=v,p(x,g,v)})}).then(function(x){if(f==="readwrite")try{v.idbtrans.commit()}catch{}return f==="readonly"?x:v._completion.then(function(){return x})})}if(b._state.openComplete)return je(new U.DatabaseClosed(b._state.dbOpenError));if(!b._state.isBeingOpened){if(!b._state.autoOpen)return je(new U.DatabaseClosed);b.open().catch(de)}return b._state.dbReadyPromise.then(function(){return m(b,f,w,p)})}(this.db,e,[this.name],u);return a&&(h._consoleTask=a,h=h.catch(function(m){return console.trace(m),je(m)})),h}finally{l&&vt()}},me.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?je(new U.Type("Invalid argument to Table.get()")):this._trans("readonly",function(r){return n.core.get({trans:r,key:e}).then(function(o){return n.hook.reading.fire(o)})}).then(t)},me.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(P(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=C(e);if(t.length===1)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(l){if(l.compound&&t.every(function(m){return 0<=l.keyPath.indexOf(m)})){for(var h=0;h<t.length;++h)if(t.indexOf(l.keyPath[h])===-1)return!1;return!0}return!1}).sort(function(l,h){return l.keyPath.length-h.keyPath.length})[0];if(n&&this.db._maxKey!==ct){var a=n.keyPath.slice(0,t.length);return this.where(a).equals(a.map(function(h){return e[h]}))}!n&&Qe&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var r=this.schema.idxByName;function o(l,h){return ie(l,h)===0}var u=t.reduce(function(f,h){var m=f[0],b=f[1],f=r[h],w=e[h];return[m||f,m||!f?ft(b,f&&f.multi?function(p){return p=re(p,h),P(p)&&p.some(function(v){return o(w,v)})}:function(p){return o(w,re(p,h))}):b]},[null,null]),a=u[0],u=u[1];return a?this.where(a.name).equals(e[a.keyPath]).filter(u):n?this.filter(u):this.where(t).equals("")},me.prototype.filter=function(e){return this.toCollection().and(e)},me.prototype.count=function(e){return this.toCollection().count(e)},me.prototype.offset=function(e){return this.toCollection().offset(e)},me.prototype.limit=function(e){return this.toCollection().limit(e)},me.prototype.each=function(e){return this.toCollection().each(e)},me.prototype.toArray=function(e){return this.toCollection().toArray(e)},me.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},me.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,P(e)?"[".concat(e.join("+"),"]"):e))},me.prototype.reverse=function(){return this.toCollection().reverse()},me.prototype.mapToClass=function(e){var t,n=this.db,r=this.name;function o(){return t!==null&&t.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof wr&&(function(h,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");function b(){this.constructor=h}d(h,m),h.prototype=m===null?Object.create(m):(b.prototype=m.prototype,new b)}(o,t=e),Object.defineProperty(o.prototype,"db",{get:function(){return n},enumerable:!1,configurable:!0}),o.prototype.table=function(){return r},e=o);for(var a=new Set,u=e.prototype;u;u=z(u))Object.getOwnPropertyNames(u).forEach(function(h){return a.add(h)});function l(h){if(!h)return h;var m,b=Object.create(e.prototype);for(m in h)if(!a.has(m))try{b[m]=h[m]}catch{}return b}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=l,this.hook("reading",l),e},me.prototype.defineClass=function(){return this.mapToClass(function(e){L(this,e)})},me.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,a=r.keyPath,u=e;return a&&o&&(u=en(a)(e)),this._trans("readwrite",function(l){return n.core.mutate({trans:l,type:"add",keys:t!=null?[t]:null,values:[u]})}).then(function(l){return l.numFailures?F.reject(l.failures[0]):l.lastResult}).then(function(l){if(a)try{ee(e,a,l)}catch{}return l})},me.prototype.update=function(e,t){return typeof e!="object"||P(e)?this.where(":id").equals(e).modify(t):(e=re(e,this.schema.primKey.keyPath),e===void 0?je(new U.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t))},me.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,a=r.keyPath,u=e;return a&&o&&(u=en(a)(e)),this._trans("readwrite",function(l){return n.core.mutate({trans:l,type:"put",values:[u],keys:t!=null?[t]:null})}).then(function(l){return l.numFailures?F.reject(l.failures[0]):l.lastResult}).then(function(l){if(a)try{ee(e,a,l)}catch{}return l})},me.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(n){return n.numFailures?F.reject(n.failures[0]):void 0})},me.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:xr})}).then(function(t){return t.numFailures?F.reject(t.failures[0]):void 0})},me.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(r){return r.map(function(o){return t.hook.reading.fire(o)})})})},me.prototype.bulkAdd=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(u){var m=r.schema.primKey,l=m.auto,m=m.keyPath;if(m&&o)throw new U.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new U.InvalidArgument("Arguments objects and keys must have the same length");var h=e.length,m=m&&l?e.map(en(m)):e;return r.core.mutate({trans:u,type:"add",keys:o,values:m,wantResults:a}).then(function(v){var f=v.numFailures,w=v.results,p=v.lastResult,v=v.failures;if(f===0)return a?w:p;throw new pe("".concat(r.name,".bulkAdd(): ").concat(f," of ").concat(h," operations failed"),v)})})},me.prototype.bulkPut=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(u){var m=r.schema.primKey,l=m.auto,m=m.keyPath;if(m&&o)throw new U.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new U.InvalidArgument("Arguments objects and keys must have the same length");var h=e.length,m=m&&l?e.map(en(m)):e;return r.core.mutate({trans:u,type:"put",keys:o,values:m,wantResults:a}).then(function(v){var f=v.numFailures,w=v.results,p=v.lastResult,v=v.failures;if(f===0)return a?w:p;throw new pe("".concat(r.name,".bulkPut(): ").concat(f," of ").concat(h," operations failed"),v)})})},me.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(u){return u.key}),o=e.map(function(u){return u.changes}),a=[];return this._trans("readwrite",function(u){return n.getMany({trans:u,keys:r,cache:"clone"}).then(function(l){var h=[],m=[];e.forEach(function(f,w){var p=f.key,v=f.changes,x=l[w];if(x){for(var g=0,j=Object.keys(v);g<j.length;g++){var A=j[g],N=v[A];if(A===t.schema.primKey.keyPath){if(ie(N,p)!==0)throw new U.Constraint("Cannot update primary key in bulkUpdate()")}else ee(x,A,N)}a.push(w),h.push(p),m.push(x)}});var b=h.length;return n.mutate({trans:u,type:"put",keys:h,values:m,updates:{keys:r,changeSpecs:o}}).then(function(f){var w=f.numFailures,p=f.failures;if(w===0)return b;for(var v=0,x=Object.keys(p);v<x.length;v++){var g,j=x[v],A=a[Number(j)];A!=null&&(g=p[j],delete p[j],p[A]=g)}throw new pe("".concat(t.name,".bulkUpdate(): ").concat(w," of ").concat(b," operations failed"),p)})})})},me.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(r){return t.core.mutate({trans:r,type:"delete",keys:e})}).then(function(u){var o=u.numFailures,a=u.lastResult,u=u.failures;if(o===0)return a;throw new pe("".concat(t.name,".bulkDelete(): ").concat(o," of ").concat(n," operations failed"),u)})},me);function me(){}function Ot(e){function t(u,l){if(l){for(var h=arguments.length,m=new Array(h-1);--h;)m[h-1]=arguments[h];return n[u].subscribe.apply(null,m),e}if(typeof u=="string")return n[u]}var n={};t.addEventType=a;for(var r=1,o=arguments.length;r<o;++r)a(arguments[r]);return t;function a(u,l,h){if(typeof u!="object"){var m;l=l||xo;var b={subscribers:[],fire:h=h||de,subscribe:function(f){b.subscribers.indexOf(f)===-1&&(b.subscribers.push(f),b.fire=l(b.fire,f))},unsubscribe:function(f){b.subscribers=b.subscribers.filter(function(w){return w!==f}),b.fire=b.subscribers.reduce(l,h)}};return n[u]=t[u]=b}C(m=u).forEach(function(f){var w=m[f];if(P(w))a(f,m[f][0],m[f][1]);else{if(w!=="asap")throw new U.InvalidArgument("Invalid event config");var p=a(f,_t,function(){for(var v=arguments.length,x=new Array(v);v--;)x[v]=arguments[v];p.subscribers.forEach(function(g){he(function(){g.apply(null,x)})})})}})}}function Et(e,t){return $(t).from({prototype:e}),t}function wt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Dn(e,t){e.filter=ft(e.filter,t)}function Tn(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ft(r(),t())}:t,e.justLimit=n&&!r}function tn(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new U.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function _r(e,t,n){var r=tn(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function nn(e,t,n,r){var o=e.replayFilter?ft(e.filter,e.replayFilter()):e.filter;if(e.or){var a={},u=function(l,h,m){var b,f;o&&!o(h,m,function(w){return h.stop(w)},function(w){return h.fail(w)})||((f=""+(b=h.primaryKey))=="[object ArrayBuffer]"&&(f=""+new Uint8Array(b)),D(a,f)||(a[f]=!0,t(l,h,m)))};return Promise.all([e.or._iterate(u,n),Nr(_r(e,r,n),e.algorithm,u,!e.keysOnly&&e.valueMapper)])}return Nr(_r(e,r,n),ft(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function Nr(e,t,n,r){var o=ge(r?function(a,u,l){return n(r(a),u,l)}:n);return e.then(function(a){if(a)return a.start(function(){var u=function(){return a.continue()};t&&!t(a,function(l){return u=l},function(l){a.stop(l),u=de},function(l){a.fail(l),u=de})||o(a.value,a,function(l){return u=l}),u()})})}var Rt=(Cr.prototype.execute=function(e){var t=this["@@propmod"];if(t.add!==void 0){var n=t.add;if(P(n))return k(k([],P(e)?e:[],!0),n).sort();if(typeof n=="number")return(Number(e)||0)+n;if(typeof n=="bigint")try{return BigInt(e)+n}catch{return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(t.remove!==void 0){var r=t.remove;if(P(r))return P(e)?e.filter(function(o){return!r.includes(o)}).sort():[];if(typeof r=="number")return Number(e)-r;if(typeof r=="bigint")try{return BigInt(e)-r}catch{return BigInt(0)-r}throw new TypeError("Invalid subtrahend ".concat(r))}return n=(n=t.replacePrefix)===null||n===void 0?void 0:n[0],n&&typeof e=="string"&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},Cr);function Cr(e){this["@@propmod"]=e}var No=(le.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,je.bind(null,n.error)):n.table._trans("readonly",e).then(t)},le.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,je.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},le.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ft(t.algorithm,e)},le.prototype._iterate=function(e,t){return nn(this._ctx,e,t,this._ctx.table.core)},le.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&L(n,e),t._ctx=n,t},le.prototype.raw=function(){return this._ctx.valueMapper=null,this},le.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return nn(t,e,n,t.table.core)})},le.prototype.count=function(e){var t=this;return this._read(function(n){var r=t._ctx,o=r.table.core;if(wt(r,!0))return o.count({trans:n,query:{index:tn(r,o.schema),range:r.range}}).then(function(u){return Math.min(u,r.limit)});var a=0;return nn(r,function(){return++a,!1},n,o).then(function(){return a})}).then(e)},le.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function a(h,m){return m?a(h[n[m]],m-1):h[r]}var u=this._ctx.dir==="next"?1:-1;function l(h,m){return ie(a(h,o),a(m,o))*u}return this.toArray(function(h){return h.sort(l)}).then(t)},le.prototype.toArray=function(e){var t=this;return this._read(function(n){var r=t._ctx;if(r.dir==="next"&&wt(r,!0)&&0<r.limit){var o=r.valueMapper,a=tn(r,r.table.core.schema);return r.table.core.query({trans:n,limit:r.limit,values:!0,query:{index:a,range:r.range}}).then(function(l){return l=l.result,o?l.map(o):l})}var u=[];return nn(r,function(l){return u.push(l)},n,r.table.core).then(function(){return u})},e)},le.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,wt(t)?Tn(t,function(){var n=e;return function(r,o){return n===0||(n===1?--n:o(function(){r.advance(n),n=0}),!1)}}):Tn(t,function(){var n=e;return function(){return--n<0}})),this},le.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Tn(this._ctx,function(){var t=e;return function(n,r,o){return--t<=0&&r(o),0<=t}},!0),this},le.prototype.until=function(e,t){return Dn(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this},le.prototype.first=function(e){return this.limit(1).toArray(function(t){return t[0]}).then(e)},le.prototype.last=function(e){return this.reverse().first(e)},le.prototype.filter=function(e){var t;return Dn(this._ctx,function(n){return e(n.value)}),(t=this._ctx).isMatch=ft(t.isMatch,e),this},le.prototype.and=function(e){return this.filter(e)},le.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},le.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},le.prototype.desc=function(){return this.reverse()},le.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.key,r)})},le.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},le.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.primaryKey,r)})},le.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(r,o){n.push(o.key)}).then(function(){return n}).then(e)},le.prototype.primaryKeys=function(e){var t=this._ctx;if(t.dir==="next"&&wt(t,!0)&&0<t.limit)return this._read(function(r){var o=tn(t,t.table.core.schema);return t.table.core.query({trans:r,values:!1,limit:t.limit,query:{index:o,range:t.range}})}).then(function(r){return r.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(r,o){n.push(o.primaryKey)}).then(function(){return n}).then(e)},le.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},le.prototype.firstKey=function(e){return this.limit(1).keys(function(t){return t[0]}).then(e)},le.prototype.lastKey=function(e){return this.reverse().firstKey(e)},le.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return Dn(this._ctx,function(o){var r=o.primaryKey.toString(),o=D(t,r);return t[r]=!0,!o}),this},le.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var o,a,u;u=typeof e=="function"?e:(o=C(e),a=o.length,function(g){for(var j=!1,A=0;A<a;++A){var N=o[A],S=e[N],O=re(g,N);S instanceof Rt?(ee(g,N,S.execute(O)),j=!0):O!==S&&(ee(g,N,S),j=!0)}return j});var l=n.table.core,f=l.schema.primaryKey,h=f.outbound,m=f.extractKey,b=200,f=t.db._options.modifyChunkSize;f&&(b=typeof f=="object"?f[l.name]||f["*"]||200:f);function w(g,N){var A=N.failures,N=N.numFailures;v+=g-N;for(var S=0,O=C(A);S<O.length;S++){var B=O[S];p.push(A[B])}}var p=[],v=0,x=[];return t.clone().primaryKeys().then(function(g){function j(N){var S=Math.min(b,g.length-N);return l.getMany({trans:r,keys:g.slice(N,N+S),cache:"immutable"}).then(function(O){for(var B=[],E=[],q=h?[]:null,I=[],T=0;T<S;++T){var W=O[T],X={value:De(W),primKey:g[N+T]};u.call(X,X.value,X)!==!1&&(X.value==null?I.push(g[N+T]):h||ie(m(W),m(X.value))===0?(E.push(X.value),h&&q.push(g[N+T])):(I.push(g[N+T]),B.push(X.value)))}return Promise.resolve(0<B.length&&l.mutate({trans:r,type:"add",values:B}).then(function(oe){for(var ae in oe.failures)I.splice(parseInt(ae),1);w(B.length,oe)})).then(function(){return(0<E.length||A&&typeof e=="object")&&l.mutate({trans:r,type:"put",keys:q,values:E,criteria:A,changeSpec:typeof e!="function"&&e,isAdditionalChunk:0<N}).then(function(oe){return w(E.length,oe)})}).then(function(){return(0<I.length||A&&e===Bn)&&l.mutate({trans:r,type:"delete",keys:I,criteria:A,isAdditionalChunk:0<N}).then(function(oe){return w(I.length,oe)})}).then(function(){return g.length>N+S&&j(N+b)})})}var A=wt(n)&&n.limit===1/0&&(typeof e!="function"||e===Bn)&&{index:n.index,range:n.range};return j(0).then(function(){if(0<p.length)throw new ye("Error modifying one or more objects",p,v,x);return g.length})})})},le.prototype.delete=function(){var e=this._ctx,t=e.range;return wt(e)&&(e.isPrimKey||t.type===3)?this._write(function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then(function(a){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then(function(u){var l=u.failures;if(u.lastResult,u.results,u=u.numFailures,u)throw new ye("Could not delete some values",Object.keys(l).map(function(h){return l[h]}),a-u);return a-u})})}):this.modify(Bn)},le);function le(){}var Bn=function(e,t){return t.value=null};function Co(e,t){return e<t?-1:e===t?0:1}function So(e,t){return t<e?-1:e===t?0:1}function Ke(e,t,n){return e=e instanceof Pr?new e.Collection(e):e,e._ctx.error=new(n||TypeError)(t),e}function jt(e){return new e.Collection(e,function(){return Sr("")}).limit(0)}function rn(e,t,n,r){var o,a,u,l,h,m,b,f=n.length;if(!n.every(function(v){return typeof v=="string"}))return Ke(e,br);function w(v){o=v==="next"?function(g){return g.toUpperCase()}:function(g){return g.toLowerCase()},a=v==="next"?function(g){return g.toLowerCase()}:function(g){return g.toUpperCase()},u=v==="next"?Co:So;var x=n.map(function(g){return{lower:a(g),upper:o(g)}}).sort(function(g,j){return u(g.lower,j.lower)});l=x.map(function(g){return g.upper}),h=x.map(function(g){return g.lower}),b=(m=v)==="next"?"":r}w("next"),e=new e.Collection(e,function(){return et(l[0],h[f-1]+r)}),e._ondirectionchange=function(v){w(v)};var p=0;return e._addAlgorithm(function(v,x,g){var j=v.key;if(typeof j!="string")return!1;var A=a(j);if(t(A,h,p))return!0;for(var N=null,S=p;S<f;++S){var O=function(B,E,q,I,T,W){for(var X=Math.min(B.length,I.length),oe=-1,ae=0;ae<X;++ae){var Ie=E[ae];if(Ie!==I[ae])return T(B[ae],q[ae])<0?B.substr(0,ae)+q[ae]+q.substr(ae+1):T(B[ae],I[ae])<0?B.substr(0,ae)+I[ae]+q.substr(ae+1):0<=oe?B.substr(0,oe)+E[oe]+q.substr(oe+1):null;T(B[ae],Ie)<0&&(oe=ae)}return X<I.length&&W==="next"?B+q.substr(B.length):X<B.length&&W==="prev"?B.substr(0,q.length):oe<0?null:B.substr(0,oe)+I[oe]+q.substr(oe+1)}(j,A,l[S],h[S],u,m);O===null&&N===null?p=S+1:(N===null||0<u(N,O))&&(N=O)}return x(N!==null?function(){v.continue(N+b)}:g),!1}),e}function et(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Sr(e){return{type:1,lower:e,upper:e}}var Pr=(Object.defineProperty(Ce.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ce.prototype.between=function(e,t,n,r){n=n!==!1,r=r===!0;try{return 0<this._cmp(e,t)||this._cmp(e,t)===0&&(n||r)&&(!n||!r)?jt(this):new this.Collection(this,function(){return et(e,t,!n,!r)})}catch{return Ke(this,Ge)}},Ce.prototype.equals=function(e){return e==null?Ke(this,Ge):new this.Collection(this,function(){return Sr(e)})},Ce.prototype.above=function(e){return e==null?Ke(this,Ge):new this.Collection(this,function(){return et(e,void 0,!0)})},Ce.prototype.aboveOrEqual=function(e){return e==null?Ke(this,Ge):new this.Collection(this,function(){return et(e,void 0,!1)})},Ce.prototype.below=function(e){return e==null?Ke(this,Ge):new this.Collection(this,function(){return et(void 0,e,!1,!0)})},Ce.prototype.belowOrEqual=function(e){return e==null?Ke(this,Ge):new this.Collection(this,function(){return et(void 0,e)})},Ce.prototype.startsWith=function(e){return typeof e!="string"?Ke(this,br):this.between(e,e+ct,!0,!0)},Ce.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):rn(this,function(t,n){return t.indexOf(n[0])===0},[e],ct)},Ce.prototype.equalsIgnoreCase=function(e){return rn(this,function(t,n){return t===n[0]},[e],"")},Ce.prototype.anyOfIgnoreCase=function(){var e=Be.apply(Pe,arguments);return e.length===0?jt(this):rn(this,function(t,n){return n.indexOf(t)!==-1},e,"")},Ce.prototype.startsWithAnyOfIgnoreCase=function(){var e=Be.apply(Pe,arguments);return e.length===0?jt(this):rn(this,function(t,n){return n.some(function(r){return t.indexOf(r)===0})},e,ct)},Ce.prototype.anyOf=function(){var e=this,t=Be.apply(Pe,arguments),n=this._cmp;try{t.sort(n)}catch{return Ke(this,Ge)}if(t.length===0)return jt(this);var r=new this.Collection(this,function(){return et(t[0],t[t.length-1])});r._ondirectionchange=function(a){n=a==="next"?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm(function(a,u,l){for(var h=a.key;0<n(h,t[o]);)if(++o===t.length)return u(l),!1;return n(h,t[o])===0||(u(function(){a.continue(t[o])}),!1)}),r},Ce.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ce.prototype.noneOf=function(){var e=Be.apply(Pe,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return Ke(this,Ge)}var t=e.reduce(function(n,r){return n?n.concat([[n[n.length-1][1],r]]):[[-1/0,r]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Ce.prototype.inAnyRange=function(j,t){var n=this,r=this._cmp,o=this._ascending,a=this._descending,u=this._min,l=this._max;if(j.length===0)return jt(this);if(!j.every(function(A){return A[0]!==void 0&&A[1]!==void 0&&o(A[0],A[1])<=0}))return Ke(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",U.InvalidArgument);var h=!t||t.includeLowers!==!1,m=t&&t.includeUppers===!0,b,f=o;function w(A,N){return f(A[0],N[0])}try{(b=j.reduce(function(A,N){for(var S=0,O=A.length;S<O;++S){var B=A[S];if(r(N[0],B[1])<0&&0<r(N[1],B[0])){B[0]=u(B[0],N[0]),B[1]=l(B[1],N[1]);break}}return S===O&&A.push(N),A},[])).sort(w)}catch{return Ke(this,Ge)}var p=0,v=m?function(A){return 0<o(A,b[p][1])}:function(A){return 0<=o(A,b[p][1])},x=h?function(A){return 0<a(A,b[p][0])}:function(A){return 0<=a(A,b[p][0])},g=v,j=new this.Collection(this,function(){return et(b[0][0],b[b.length-1][1],!h,!m)});return j._ondirectionchange=function(A){f=A==="next"?(g=v,o):(g=x,a),b.sort(w)},j._addAlgorithm(function(A,N,S){for(var O,B=A.key;g(B);)if(++p===b.length)return N(S),!1;return!v(O=B)&&!x(O)||(n._cmp(B,b[p][1])===0||n._cmp(B,b[p][0])===0||N(function(){f===o?A.continue(b[p][0]):A.continue(b[p][1])}),!1)}),j},Ce.prototype.startsWithAnyOf=function(){var e=Be.apply(Pe,arguments);return e.every(function(t){return typeof t=="string"})?e.length===0?jt(this):this.inAnyRange(e.map(function(t){return[t,t+ct]})):Ke(this,"startsWithAnyOf() only works with strings")},Ce);function Ce(){}function He(e){return ge(function(t){return Mt(t),e(t.target.error),!1})}function Mt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var qt="storagemutated",Kn="x-storagemutated-1",tt=Ot(null,qt),Po=(Ue.prototype._lock=function(){return ve(!Q.global),++this._reculock,this._reculock!==1||Q.global||(Q.lockOwnerFor=this),this},Ue.prototype._unlock=function(){if(ve(!Q.global),--this._reculock==0)for(Q.global||(Q.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{lt(e[1],e[0])}catch{}}return this},Ue.prototype._locked=function(){return this._reculock&&Q.lockOwnerFor!==this},Ue.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(ve(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new U.DatabaseClosed(r);case"MissingAPIError":throw new U.MissingAPI(r.message,r);default:throw new U.OpenFailed(r)}if(!this.active)throw new U.TransactionInactive;return ve(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ge(function(o){Mt(o),t._reject(e.error)}),e.onabort=ge(function(o){Mt(o),t.active&&t._reject(new U.Abort(e.error)),t.active=!1,t.on("abort").fire(o)}),e.oncomplete=ge(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&tt.storagemutated.fire(e.mutatedParts)}),this},Ue.prototype._promise=function(e,t,n){var r=this;if(e==="readwrite"&&this.mode!=="readwrite")return je(new U.ReadOnly("Transaction is readonly"));if(!this.active)return je(new U.TransactionInactive);if(this._locked())return new F(function(a,u){r._blockedFuncs.push([function(){r._promise(e,t,n).then(a,u)},Q])});if(n)return Ze(function(){var a=new F(function(u,l){r._lock();var h=t(u,l,r);h&&h.then&&h.then(u,l)});return a.finally(function(){return r._unlock()}),a._lib=!0,a});var o=new F(function(a,u){var l=t(a,u,r);l&&l.then&&l.then(a,u)});return o._lib=!0,o},Ue.prototype._root=function(){return this.parent?this.parent._root():this},Ue.prototype.waitFor=function(e){var t,n=this._root(),r=F.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function a(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=a)}());var o=n._waitingFor;return new F(function(a,u){r.then(function(l){return n._waitingQueue.push(ge(a.bind(null,l)))},function(l){return n._waitingQueue.push(ge(u.bind(null,l)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},Ue.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new U.Abort))},Ue.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(D(t,e))return t[e];var n=this.schema[e];if(!n)throw new U.NotFound("Table "+e+" not part of transaction");return n=new this.db.Table(e,n,this),n.core=this.db.core.table(e),t[e]=n},Ue);function Ue(){}function In(e,t,n,r,o,a,u){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:a,src:(n&&!u?"&":"")+(r?"*":"")+(o?"++":"")+Or(t)}}function Or(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function Fn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(o){return[o.name,o]},n.reduce(function(o,a,u){return u=r(a,u),u&&(o[u[0]]=u[1]),o},{}))};var r}var Dt=function(e){try{return e.only([[]]),Dt=function(){return[[]]},[[]]}catch{return Dt=function(){return ct},ct}};function Ln(e){return e==null?function(){}:typeof e=="string"?(t=e).split(".").length===1?function(n){return n[t]}:function(n){return re(n,t)}:function(n){return re(n,e)};var t}function Er(e){return[].slice.call(e)}var Oo=0;function Tt(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function Eo(e,t,h){function r(g){if(g.type===3)return null;if(g.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var p=g.lower,v=g.upper,x=g.lowerOpen,g=g.upperOpen;return p===void 0?v===void 0?null:t.upperBound(v,!!g):v===void 0?t.lowerBound(p,!!x):t.bound(p,v,!!x,!!g)}function o(w){var p,v=w.name;return{name:v,schema:w,mutate:function(x){var g=x.trans,j=x.type,A=x.keys,N=x.values,S=x.range;return new Promise(function(O,B){O=ge(O);var E=g.objectStore(v),q=E.keyPath==null,I=j==="put"||j==="add";if(!I&&j!=="delete"&&j!=="deleteRange")throw new Error("Invalid operation type: "+j);var T,W=(A||N||{length:1}).length;if(A&&N&&A.length!==N.length)throw new Error("Given keys array must have same length as given values array.");if(W===0)return O({numFailures:0,failures:{},results:[],lastResult:void 0});function X(qe){++Ie,Mt(qe)}var oe=[],ae=[],Ie=0;if(j==="deleteRange"){if(S.type===4)return O({numFailures:Ie,failures:ae,results:[],lastResult:void 0});S.type===3?oe.push(T=E.clear()):oe.push(T=E.delete(r(S)))}else{var q=I?q?[N,A]:[N,null]:[A,null],Y=q[0],Ee=q[1];if(I)for(var Re=0;Re<W;++Re)oe.push(T=Ee&&Ee[Re]!==void 0?E[j](Y[Re],Ee[Re]):E[j](Y[Re])),T.onerror=X;else for(Re=0;Re<W;++Re)oe.push(T=E[j](Y[Re])),T.onerror=X}function gn(qe){qe=qe.target.result,oe.forEach(function(pt,ar){return pt.error!=null&&(ae[ar]=pt.error)}),O({numFailures:Ie,failures:ae,results:j==="delete"?A:oe.map(function(pt){return pt.result}),lastResult:qe})}T.onerror=function(qe){X(qe),gn(qe)},T.onsuccess=gn})},getMany:function(x){var g=x.trans,j=x.keys;return new Promise(function(A,N){A=ge(A);for(var S,O=g.objectStore(v),B=j.length,E=new Array(B),q=0,I=0,T=function(oe){oe=oe.target,E[oe._pos]=oe.result,++I===q&&A(E)},W=He(N),X=0;X<B;++X)j[X]!=null&&((S=O.get(j[X]))._pos=X,S.onsuccess=T,S.onerror=W,++q);q===0&&A(E)})},get:function(x){var g=x.trans,j=x.key;return new Promise(function(A,N){A=ge(A);var S=g.objectStore(v).get(j);S.onsuccess=function(O){return A(O.target.result)},S.onerror=He(N)})},query:(p=m,function(x){return new Promise(function(g,j){g=ge(g);var A,N,S,q=x.trans,O=x.values,B=x.limit,T=x.query,E=B===1/0?void 0:B,I=T.index,T=T.range,q=q.objectStore(v),I=I.isPrimaryKey?q:q.index(I.name),T=r(T);if(B===0)return g({result:[]});p?((E=O?I.getAll(T,E):I.getAllKeys(T,E)).onsuccess=function(W){return g({result:W.target.result})},E.onerror=He(j)):(A=0,N=!O&&"openKeyCursor"in I?I.openKeyCursor(T):I.openCursor(T),S=[],N.onsuccess=function(W){var X=N.result;return X?(S.push(O?X.value:X.primaryKey),++A===B?g({result:S}):void X.continue()):g({result:S})},N.onerror=He(j))})}),openCursor:function(x){var g=x.trans,j=x.values,A=x.query,N=x.reverse,S=x.unique;return new Promise(function(O,B){O=ge(O);var I=A.index,E=A.range,q=g.objectStore(v),q=I.isPrimaryKey?q:q.index(I.name),I=N?S?"prevunique":"prev":S?"nextunique":"next",T=!j&&"openKeyCursor"in q?q.openKeyCursor(r(E),I):q.openCursor(r(E),I);T.onerror=He(B),T.onsuccess=ge(function(W){var X,oe,ae,Ie,Y=T.result;Y?(Y.___id=++Oo,Y.done=!1,X=Y.continue.bind(Y),oe=(oe=Y.continuePrimaryKey)&&oe.bind(Y),ae=Y.advance.bind(Y),Ie=function(){throw new Error("Cursor not stopped")},Y.trans=g,Y.stop=Y.continue=Y.continuePrimaryKey=Y.advance=function(){throw new Error("Cursor not started")},Y.fail=ge(B),Y.next=function(){var Ee=this,Re=1;return this.start(function(){return Re--?Ee.continue():Ee.stop()}).then(function(){return Ee})},Y.start=function(Ee){function Re(){if(T.result)try{Ee()}catch(qe){Y.fail(qe)}else Y.done=!0,Y.start=function(){throw new Error("Cursor behind last entry")},Y.stop()}var gn=new Promise(function(qe,pt){qe=ge(qe),T.onerror=He(pt),Y.fail=pt,Y.stop=function(ar){Y.stop=Y.continue=Y.continuePrimaryKey=Y.advance=Ie,qe(ar)}});return T.onsuccess=ge(function(qe){T.onsuccess=Re,Re()}),Y.continue=X,Y.continuePrimaryKey=oe,Y.advance=ae,Re(),gn},O(Y)):O(null)},B)})},count:function(x){var g=x.query,j=x.trans,A=g.index,N=g.range;return new Promise(function(S,O){var B=j.objectStore(v),E=A.isPrimaryKey?B:B.index(A.name),B=r(N),E=B?E.count(B):E.count();E.onsuccess=ge(function(q){return S(q.target.result)}),E.onerror=He(O)})}}}var a,u,l,b=(u=h,l=Er((a=e).objectStoreNames),{schema:{name:a.name,tables:l.map(function(w){return u.objectStore(w)}).map(function(w){var p=w.keyPath,g=w.autoIncrement,v=P(p),x={},g={name:w.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:p==null,compound:v,keyPath:p,autoIncrement:g,unique:!0,extractKey:Ln(p)},indexes:Er(w.indexNames).map(function(j){return w.index(j)}).map(function(S){var A=S.name,N=S.unique,O=S.multiEntry,S=S.keyPath,O={name:A,compound:P(S),keyPath:S,unique:N,multiEntry:O,extractKey:Ln(S)};return x[Tt(S)]=O}),getIndexByKeyPath:function(j){return x[Tt(j)]}};return x[":id"]=g.primaryKey,p!=null&&(x[Tt(p)]=g.primaryKey),g})},hasGetAll:0<l.length&&"getAll"in u.objectStore(l[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),h=b.schema,m=b.hasGetAll,b=h.tables.map(o),f={};return b.forEach(function(w){return f[w.name]=w}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(w){if(!f[w])throw new Error("Table '".concat(w,"' not found"));return f[w]},MIN_KEY:-1/0,MAX_KEY:Dt(t),schema:h}}function Ro(e,t,n,r){var o=n.IDBKeyRange;return n.indexedDB,{dbcore:(r=Eo(t,o,r),e.dbcore.reduce(function(a,u){return u=u.create,y(y({},a),u(a))},r))}}function on(e,r){var n=r.db,r=Ro(e._middlewares,n,e._deps,r);e.core=r.dbcore,e.tables.forEach(function(o){var a=o.name;e.core.schema.tables.some(function(u){return u.name===a})&&(o.core=e.core.table(a),e[a]instanceof e.Table&&(e[a].core=o.core))})}function an(e,t,n,r){n.forEach(function(o){var a=r[o];t.forEach(function(u){var l=function h(m,b){return V(m,b)||(m=z(m))&&h(m,b)}(u,o);(!l||"value"in l&&l.value===void 0)&&(u===e.Transaction.prototype||u instanceof e.Transaction?M(u,o,{get:function(){return this.table(o)},set:function(h){te(this,o,{value:h,writable:!0,configurable:!0,enumerable:!0})}}):u[o]=new e.Table(o,a))})})}function zn(e,t){t.forEach(function(n){for(var r in n)n[r]instanceof e.Table&&delete n[r]})}function Mo(e,t){return e._cfg.version-t._cfg.version}function qo(e,t,n,r){var o=e._dbSchema;n.objectStoreNames.contains("$meta")&&!o.$meta&&(o.$meta=Fn("$meta",Mr("")[0],[]),e._storeNames.push("$meta"));var a=e._createTransaction("readwrite",e._storeNames,o);a.create(n),a._completion.catch(r);var u=a._reject.bind(a),l=Q.transless||Q;Ze(function(){return Q.trans=a,Q.transless=l,t!==0?(on(e,n),m=t,((h=a).storeNames.includes("$meta")?h.table("$meta").get("version").then(function(b){return b??m}):F.resolve(m)).then(function(b){return w=b,p=a,v=n,x=[],b=(f=e)._versions,g=f._dbSchema=un(0,f.idbdb,v),(b=b.filter(function(j){return j._cfg.version>=w})).length!==0?(b.forEach(function(j){x.push(function(){var A=g,N=j._cfg.dbschema;ln(f,A,v),ln(f,N,v),g=f._dbSchema=N;var S=Wn(A,N);S.add.forEach(function(I){Vn(v,I[0],I[1].primKey,I[1].indexes)}),S.change.forEach(function(I){if(I.recreate)throw new U.Upgrade("Not yet support for changing primary key");var T=v.objectStore(I.name);I.add.forEach(function(W){return sn(T,W)}),I.change.forEach(function(W){T.deleteIndex(W.name),sn(T,W)}),I.del.forEach(function(W){return T.deleteIndex(W)})});var O=j._cfg.contentUpgrade;if(O&&j._cfg.version>w){on(f,v),p._memoizedTables={};var B=xe(N);S.del.forEach(function(I){B[I]=A[I]}),zn(f,[f.Transaction.prototype]),an(f,[f.Transaction.prototype],C(B),B),p.schema=B;var E,q=H(O);return q&&bt(),S=F.follow(function(){var I;(E=O(p))&&q&&(I=Ye.bind(null,null),E.then(I,I))}),E&&typeof E.then=="function"?F.resolve(E):S.then(function(){return E})}}),x.push(function(A){var N,S,O=j._cfg.dbschema;N=O,S=A,[].slice.call(S.db.objectStoreNames).forEach(function(B){return N[B]==null&&S.db.deleteObjectStore(B)}),zn(f,[f.Transaction.prototype]),an(f,[f.Transaction.prototype],f._storeNames,f._dbSchema),p.schema=f._dbSchema}),x.push(function(A){f.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(f.idbdb.version/10)===j._cfg.version?(f.idbdb.deleteObjectStore("$meta"),delete f._dbSchema.$meta,f._storeNames=f._storeNames.filter(function(N){return N!=="$meta"})):A.objectStore("$meta").put(j._cfg.version,"version"))})}),function j(){return x.length?F.resolve(x.shift()(p.idbtrans)).then(j):F.resolve()}().then(function(){Rr(g,v)})):F.resolve();var f,w,p,v,x,g}).catch(u)):(C(o).forEach(function(b){Vn(n,b,o[b].primKey,o[b].indexes)}),on(e,n),void F.follow(function(){return e.on.populate.fire(a)}).catch(u));var h,m})}function Do(e,t){Rr(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=un(0,e.idbdb,t);ln(e,e._dbSchema,t);for(var r=0,o=Wn(n,e._dbSchema).change;r<o.length;r++){var a=function(u){if(u.change.length||u.recreate)return console.warn("Unable to patch indexes of table ".concat(u.name," because it has changes on the type of index or primary key.")),{value:void 0};var l=t.objectStore(u.name);u.add.forEach(function(h){Qe&&console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name,".").concat(h.src)),sn(l,h)})}(o[r]);if(typeof a=="object")return a.value}}function Wn(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],a=t[n];if(o){var u={name:n,def:a,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(a.primKey.keyPath||"")||o.primKey.auto!==a.primKey.auto)u.recreate=!0,r.change.push(u);else{var l=o.idxByName,h=a.idxByName,m=void 0;for(m in l)h[m]||u.del.push(m);for(m in h){var b=l[m],f=h[m];b?b.src!==f.src&&u.change.push(f):u.add.push(f)}(0<u.del.length||0<u.add.length||0<u.change.length)&&r.change.push(u)}}else r.add.push([n,a])}return r}function Vn(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(a){return sn(o,a)}),o}function Rr(e,t){C(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(Qe&&console.debug("Dexie: Creating missing table",n),Vn(t,n,e[n].primKey,e[n].indexes))})}function sn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function un(e,t,n){var r={};return ne(t.objectStoreNames,0).forEach(function(o){for(var a=n.objectStore(o),u=In(Or(m=a.keyPath),m||"",!0,!1,!!a.autoIncrement,m&&typeof m!="string",!0),l=[],h=0;h<a.indexNames.length;++h){var b=a.index(a.indexNames[h]),m=b.keyPath,b=In(b.name,m,!!b.unique,!!b.multiEntry,!1,m&&typeof m!="string",!1);l.push(b)}r[o]=Fn(o,u,l)}),r}function ln(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var a=r[o],u=n.objectStore(a);e._hasGetAll="getAll"in u;for(var l=0;l<u.indexNames.length;++l){var h=u.indexNames[l],m=u.index(h).keyPath,b=typeof m=="string"?m:"["+ne(m).join("+")+"]";!t[a]||(m=t[a].idxByName[b])&&(m.name=h,delete t[a].idxByName[b],t[a].idxByName[h]=m)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&_.WorkerGlobalScope&&_ instanceof _.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function Mr(e){return e.split(",").map(function(t,n){var r=(t=t.trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return In(r,o||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),P(o),n===0)})}var To=(cn.prototype._parseStoresSpec=function(e,t){C(e).forEach(function(n){if(e[n]!==null){var r=Mr(e[n]),o=r.shift();if(o.unique=!0,o.multi)throw new U.Schema("Primary key cannot be multi-valued");r.forEach(function(a){if(a.auto)throw new U.Schema("Only primary key can be marked as autoIncrement (++)");if(!a.keyPath)throw new U.Schema("Index must have a name and cannot be an empty string")}),t[n]=Fn(n,o,r)}})},cn.prototype.stores=function(n){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?L(this._cfg.storesSource,n):n;var n=t._versions,r={},o={};return n.forEach(function(a){L(r,a._cfg.storesSource),o=a._cfg.dbschema={},a._parseStoresSpec(r,o)}),t._dbSchema=o,zn(t,[t._allTables,t,t.Transaction.prototype]),an(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],C(o),o),t._storeNames=C(o),this},cn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=An(this._cfg.contentUpgrade||de,e),this},cn);function cn(){}function Qn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new $e(Xt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function Hn(e){return e&&typeof e.databases=="function"}function Un(e){return Ze(function(){return Q.letThrough=!0,e()})}function Gn(e){return!("from"in e)}var Oe=function(e,t){if(!this){var n=new Oe;return e&&"d"in e&&L(n,e),n}L(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function Bt(e,t,n){var r=ie(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(Gn(e))return L(e,{from:t,to:n,d:1});var o=e.l,r=e.r;if(ie(n,e.from)<0)return o?Bt(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Dr(e);if(0<ie(t,e.to))return r?Bt(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Dr(e);ie(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<ie(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,o&&!e.l&&Kt(e,o),r&&n&&Kt(e,r)}}function Kt(e,t){Gn(t)||function n(r,h){var a=h.from,u=h.to,l=h.l,h=h.r;Bt(r,a,u),l&&n(r,l),h&&n(r,h)}(e,t)}function qr(e,t){var n=fn(t),r=n.next();if(r.done)return!1;for(var o=r.value,a=fn(e),u=a.next(o.from),l=u.value;!r.done&&!u.done;){if(ie(l.from,o.to)<=0&&0<=ie(l.to,o.from))return!0;ie(o.from,l.from)<0?o=(r=n.next(l.from)).value:l=(u=a.next(o.from)).value}return!1}function fn(e){var t=Gn(e)?null:{s:0,n:e};return{next:function(n){for(var r=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&ie(n,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||ie(n,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function Dr(e){var t,n,r=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),o=1<r?"r":r<-1?"l":"";o&&(t=o=="r"?"l":"r",n=y({},e),r=e[o],e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],(e[t]=n).d=Tr(n)),e.d=Tr(e)}function Tr(n){var t=n.r,n=n.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}function dn(e,t){return C(t).forEach(function(n){e[n]?Kt(e[n],t[n]):e[n]=function r(o){var a,u,l={};for(a in o)D(o,a)&&(u=o[a],l[a]=!u||typeof u!="object"||We.has(u.constructor)?u:r(u));return l}(t[n])}),e}function $n(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&qr(t[n],e[n])})}G(Oe.prototype,((ze={add:function(e){return Kt(this,e),this},addKey:function(e){return Bt(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return Bt(t,n,n)}),this},hasKey:function(e){var t=fn(this).next(e).value;return t&&ie(t.from,e)<=0&&0<=ie(t.to,e)}})[fe]=function(){return fn(this)},ze));var dt={},Jn={},Zn=!1;function hn(e){dn(Jn,e),Zn||(Zn=!0,setTimeout(function(){Zn=!1,Yn(Jn,!(Jn={}))},0))}function Yn(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,o=Object.values(dt);r<o.length;r++)Br(u=o[r],e,n,t);else for(var a in e){var u,l=/^idb\:\/\/(.*)\/(.*)\//.exec(a);l&&(a=l[1],l=l[2],(u=dt["idb://".concat(a,"/").concat(l)])&&Br(u,e,n,t))}n.forEach(function(h){return h()})}function Br(e,t,n,r){for(var o=[],a=0,u=Object.entries(e.queries.query);a<u.length;a++){for(var l=u[a],h=l[0],m=[],b=0,f=l[1];b<f.length;b++){var w=f[b];$n(t,w.obsSet)?w.subscribers.forEach(function(g){return n.add(g)}):r&&m.push(w)}r&&o.push([h,m])}if(r)for(var p=0,v=o;p<v.length;p++){var x=v[p],h=x[0],m=x[1];e.queries.query[h]=m}}function Bo(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?je(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,o=Math.round(10*e.verno),a=!1;function u(){if(t.openCanceller!==r)throw new U.DatabaseClosed("db.open() was cancelled")}function l(){return new F(function(w,p){if(u(),!n)throw new U.MissingAPI;var v=e.name,x=t.autoSchema||!o?n.open(v):n.open(v,o);if(!x)throw new U.MissingAPI;x.onerror=He(p),x.onblocked=ge(e._fireOnBlocked),x.onupgradeneeded=ge(function(g){var j;b=x.transaction,t.autoSchema&&!e._options.allowEmptyDB?(x.onerror=Mt,b.abort(),x.result.close(),(j=n.deleteDatabase(v)).onsuccess=j.onerror=ge(function(){p(new U.NoSuchDatabase("Database ".concat(v," doesnt exist")))})):(b.onerror=He(p),g=g.oldVersion>Math.pow(2,62)?0:g.oldVersion,f=g<1,e.idbdb=x.result,a&&Do(e,b),qo(e,g/10,b,p))},p),x.onsuccess=ge(function(){b=null;var g,j,A,N,S,O=e.idbdb=x.result,B=ne(O.objectStoreNames);if(0<B.length)try{var E=O.transaction((N=B).length===1?N[0]:N,"readonly");if(t.autoSchema)j=O,A=E,(g=e).verno=j.version/10,A=g._dbSchema=un(0,j,A),g._storeNames=ne(j.objectStoreNames,0),an(g,[g._allTables],C(A),A);else if(ln(e,e._dbSchema,E),((S=Wn(un(0,(S=e).idbdb,E),S._dbSchema)).add.length||S.change.some(function(q){return q.add.length||q.change.length}))&&!a)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),O.close(),o=O.version+1,a=!0,w(l());on(e,E)}catch{}xt.push(e),O.onversionchange=ge(function(q){t.vcFired=!0,e.on("versionchange").fire(q)}),O.onclose=ge(function(q){e.on("close").fire(q)}),f&&(S=e._deps,E=v,O=S.indexedDB,S=S.IDBKeyRange,Hn(O)||E===Xt||Qn(O,S).put({name:E}).catch(de)),w()},p)}).catch(function(w){switch(w?.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),l();break;case"VersionError":if(0<o)return o=0,l()}return F.reject(w)})}var h,m=t.dbReadyResolve,b=null,f=!1;return F.race([r,(typeof navigator>"u"?F.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(w){function p(){return indexedDB.databases().finally(w)}h=setInterval(p,100),p()}).finally(function(){return clearInterval(h)}):Promise.resolve()).then(l)]).then(function(){return u(),t.onReadyBeingFired=[],F.resolve(Un(function(){return e.on.ready.fire(e.vip)})).then(function w(){if(0<t.onReadyBeingFired.length){var p=t.onReadyBeingFired.reduce(An,de);return t.onReadyBeingFired=[],F.resolve(Un(function(){return p(e.vip)})).then(w)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(w){t.dbOpenError=w;try{b&&b.abort()}catch{}return r===t.openCanceller&&e._close(),je(w)}).finally(function(){t.openComplete=!0,m()}).then(function(){var w;return f&&(w={},e.tables.forEach(function(p){p.schema.indexes.forEach(function(v){v.name&&(w["idb://".concat(e.name,"/").concat(p.name,"/").concat(v.name)]=new Oe(-1/0,[[[]]]))}),w["idb://".concat(e.name,"/").concat(p.name,"/")]=w["idb://".concat(e.name,"/").concat(p.name,"/:dels")]=new Oe(-1/0,[[[]]])}),tt(qt).fire(w),Yn(w,!0)),e})}function Xn(e){function t(a){return e.next(a)}var n=o(t),r=o(function(a){return e.throw(a)});function o(a){return function(h){var l=a(h),h=l.value;return l.done?h:h&&typeof h.then=="function"?h.then(n,r):P(h)?Promise.all(h).then(n,r):n(h)}}return o(t)()}function pn(e,t,n){for(var r=P(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var Ko={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return y(y({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},a=[];function u(f,w,p){var v=Tt(f),x=o[v]=o[v]||[],g=f==null?0:typeof f=="string"?1:f.length,j=0<w,j=y(y({},p),{name:j?"".concat(v,"(virtual-from:").concat(p.name,")"):p.name,lowLevelIndex:p,isVirtual:j,keyTail:w,keyLength:g,extractKey:Ln(f),unique:!j&&p.unique});return x.push(j),j.isPrimaryKey||a.push(j),1<g&&u(g===2?f[0]:f.slice(0,g-1),w+1,p),x.sort(function(A,N){return A.keyTail-N.keyTail}),j}t=u(r.primaryKey.keyPath,0,r.primaryKey),o[":id"]=[t];for(var l=0,h=r.indexes;l<h.length;l++){var m=h[l];u(m.keyPath,0,m)}function b(f){var w,p=f.query.index;return p.isVirtual?y(y({},f),{query:{index:p.lowLevelIndex,range:(w=f.query.range,p=p.keyTail,{type:w.type===1?2:w.type,lower:pn(w.lower,w.lowerOpen?e.MAX_KEY:e.MIN_KEY,p),lowerOpen:!0,upper:pn(w.upper,w.upperOpen?e.MIN_KEY:e.MAX_KEY,p),upperOpen:!0})}}):f}return y(y({},n),{schema:y(y({},r),{primaryKey:t,indexes:a,getIndexByKeyPath:function(f){return(f=o[Tt(f)])&&f[0]}}),count:function(f){return n.count(b(f))},query:function(f){return n.query(b(f))},openCursor:function(f){var w=f.query.index,p=w.keyTail,v=w.isVirtual,x=w.keyLength;return v?n.openCursor(b(f)).then(function(j){return j&&g(j)}):n.openCursor(f);function g(j){return Object.create(j,{continue:{value:function(A){A!=null?j.continue(pn(A,f.reverse?e.MAX_KEY:e.MIN_KEY,p)):f.unique?j.continue(j.key.slice(0,x).concat(f.reverse?e.MIN_KEY:e.MAX_KEY,p)):j.continue()}},continuePrimaryKey:{value:function(A,N){j.continuePrimaryKey(pn(A,e.MAX_KEY,p),N)}},primaryKey:{get:function(){return j.primaryKey}},key:{get:function(){var A=j.key;return x===1?A[0]:A.slice(0,x)}},value:{get:function(){return j.value}}})}}})}})}};function er(e,t,n,r){return n=n||{},r=r||"",C(e).forEach(function(o){var a,u,l;D(t,o)?(a=e[o],u=t[o],typeof a=="object"&&typeof u=="object"&&a&&u?(l=J(a))!==J(u)?n[r+o]=t[o]:l==="Object"?er(a,u,n,r+o+"."):a!==u&&(n[r+o]=t[o]):a!==u&&(n[r+o]=t[o])):n[r+o]=void 0}),C(t).forEach(function(o){D(e,o)||(n[r+o]=t[o])}),n}function tr(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var Io={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return y(y({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return y(y({},n),{mutate:function(o){var a=Q.trans,u=a.table(t).hook,l=u.deleting,h=u.creating,m=u.updating;switch(o.type){case"add":if(h.fire===de)break;return a._promise("readwrite",function(){return b(o)},!0);case"put":if(h.fire===de&&m.fire===de)break;return a._promise("readwrite",function(){return b(o)},!0);case"delete":if(l.fire===de)break;return a._promise("readwrite",function(){return b(o)},!0);case"deleteRange":if(l.fire===de)break;return a._promise("readwrite",function(){return function f(w,p,v){return n.query({trans:w,values:!1,query:{index:r,range:p},limit:v}).then(function(x){var g=x.result;return b({type:"delete",keys:g,trans:w}).then(function(j){return 0<j.numFailures?Promise.reject(j.failures[0]):g.length<v?{failures:[],numFailures:0,lastResult:void 0}:f(w,y(y({},p),{lower:g[g.length-1],lowerOpen:!0}),v)})})}(o.trans,o.range,1e4)},!0)}return n.mutate(o);function b(f){var w,p,v,x=Q.trans,g=f.keys||tr(r,f);if(!g)throw new Error("Keys missing");return(f=f.type==="add"||f.type==="put"?y(y({},f),{keys:g}):y({},f)).type!=="delete"&&(f.values=k([],f.values)),f.keys&&(f.keys=k([],f.keys)),w=n,v=g,((p=f).type==="add"?Promise.resolve([]):w.getMany({trans:p.trans,keys:v,cache:"immutable"})).then(function(j){var A=g.map(function(N,S){var O,B,E,q=j[S],I={onerror:null,onsuccess:null};return f.type==="delete"?l.fire.call(I,N,q,x):f.type==="add"||q===void 0?(O=h.fire.call(I,N,f.values[S],x),N==null&&O!=null&&(f.keys[S]=N=O,r.outbound||ee(f.values[S],r.keyPath,N))):(O=er(q,f.values[S]),(B=m.fire.call(I,O,N,q,x))&&(E=f.values[S],Object.keys(B).forEach(function(T){D(E,T)?E[T]=B[T]:ee(E,T,B[T])}))),I});return n.mutate(f).then(function(N){for(var S=N.failures,O=N.results,B=N.numFailures,N=N.lastResult,E=0;E<g.length;++E){var q=(O||g)[E],I=A[E];q==null?I.onerror&&I.onerror(S[E]):I.onsuccess&&I.onsuccess(f.type==="put"&&j[E]?f.values[E]:q)}return{failures:S,results:O,numFailures:B,lastResult:N}}).catch(function(N){return A.forEach(function(S){return S.onerror&&S.onerror(N)}),Promise.reject(N)})})}}})}})}};function Kr(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],o=0,a=0;o<t.keys.length&&a<e.length;++o)ie(t.keys[o],e[a])===0&&(r.push(n?De(t.values[o]):t.values[o]),++a);return r.length===e.length?r:null}catch{return null}}var Fo={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return y(y({},n),{getMany:function(r){if(!r.cache)return n.getMany(r);var o=Kr(r.keys,r.trans._cache,r.cache==="clone");return o?F.resolve(o):n.getMany(r).then(function(a){return r.trans._cache={keys:r.keys,values:r.cache==="clone"?De(a):a},a})},mutate:function(r){return r.type!=="add"&&(r.trans._cache=null),n.mutate(r)}})}}}};function Ir(e,t){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!t.schema.primaryKey.outbound}function Fr(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Lo={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,n=new Oe(e.MIN_KEY,e.MAX_KEY);return y(y({},e),{transaction:function(r,o,a){if(Q.subscr&&o!=="readonly")throw new U.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Q.querier));return e.transaction(r,o,a)},table:function(r){var o=e.table(r),a=o.schema,u=a.primaryKey,f=a.indexes,l=u.extractKey,h=u.outbound,m=u.autoIncrement&&f.filter(function(p){return p.compound&&p.keyPath.includes(u.keyPath)}),b=y(y({},o),{mutate:function(p){function v(T){return T="idb://".concat(t,"/").concat(r,"/").concat(T),N[T]||(N[T]=new Oe)}var x,g,j,A=p.trans,N=p.mutatedParts||(p.mutatedParts={}),S=v(""),O=v(":dels"),B=p.type,I=p.type==="deleteRange"?[p.range]:p.type==="delete"?[p.keys]:p.values.length<50?[tr(u,p).filter(function(T){return T}),p.values]:[],E=I[0],q=I[1],I=p.trans._cache;return P(E)?(S.addKeys(E),(I=B==="delete"||E.length===q.length?Kr(E,I):null)||O.addKeys(E),(I||q)&&(x=v,g=I,j=q,a.indexes.forEach(function(T){var W=x(T.name||"");function X(ae){return ae!=null?T.extractKey(ae):null}function oe(ae){return T.multiEntry&&P(ae)?ae.forEach(function(Ie){return W.addKey(Ie)}):W.addKey(ae)}(g||j).forEach(function(ae,Ee){var Y=g&&X(g[Ee]),Ee=j&&X(j[Ee]);ie(Y,Ee)!==0&&(Y!=null&&oe(Y),Ee!=null&&oe(Ee))})}))):E?(q={from:(q=E.lower)!==null&&q!==void 0?q:e.MIN_KEY,to:(q=E.upper)!==null&&q!==void 0?q:e.MAX_KEY},O.add(q),S.add(q)):(S.add(n),O.add(n),a.indexes.forEach(function(T){return v(T.name).add(n)})),o.mutate(p).then(function(T){return!E||p.type!=="add"&&p.type!=="put"||(S.addKeys(T.results),m&&m.forEach(function(W){for(var X=p.values.map(function(Y){return W.extractKey(Y)}),oe=W.keyPath.findIndex(function(Y){return Y===u.keyPath}),ae=0,Ie=T.results.length;ae<Ie;++ae)X[ae][oe]=T.results[ae];v(W.name).addKeys(X)})),A.mutatedParts=dn(A.mutatedParts||{},N),T})}}),f=function(v){var x=v.query,v=x.index,x=x.range;return[v,new Oe((v=x.lower)!==null&&v!==void 0?v:e.MIN_KEY,(x=x.upper)!==null&&x!==void 0?x:e.MAX_KEY)]},w={get:function(p){return[u,new Oe(p.key)]},getMany:function(p){return[u,new Oe().addKeys(p.keys)]},count:f,query:f,openCursor:f};return C(w).forEach(function(p){b[p]=function(v){var x=Q.subscr,g=!!x,j=Ir(Q,o)&&Fr(p,v)?v.obsSet={}:x;if(g){var A=function(q){return q="idb://".concat(t,"/").concat(r,"/").concat(q),j[q]||(j[q]=new Oe)},N=A(""),S=A(":dels"),x=w[p](v),g=x[0],x=x[1];if((p==="query"&&g.isPrimaryKey&&!v.values?S:A(g.name||"")).add(x),!g.isPrimaryKey){if(p!=="count"){var O=p==="query"&&h&&v.values&&o.query(y(y({},v),{values:!1}));return o[p].apply(this,arguments).then(function(q){if(p==="query"){if(h&&v.values)return O.then(function(X){return X=X.result,N.addKeys(X),q});var I=v.values?q.result.map(l):q.result;(v.values?N:S).addKeys(I)}else if(p==="openCursor"){var T=q,W=v.values;return T&&Object.create(T,{key:{get:function(){return S.addKey(T.primaryKey),T.key}},primaryKey:{get:function(){var X=T.primaryKey;return S.addKey(X),X}},value:{get:function(){return W&&N.addKey(T.primaryKey),T.value}}})}return q})}S.add(n)}}return o[p].apply(this,arguments)}}),b}})}};function Lr(e,t,n){if(n.numFailures===0)return t;if(t.type==="deleteRange")return null;var r=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;return n.numFailures===r?null:(t=y({},t),P(t.keys)&&(t.keys=t.keys.filter(function(o,a){return!(a in n.failures)})),"values"in t&&P(t.values)&&(t.values=t.values.filter(function(o,a){return!(a in n.failures)})),t)}function nr(e,t){return n=e,((r=t).lower===void 0||(r.lowerOpen?0<ie(n,r.lower):0<=ie(n,r.lower)))&&(e=e,(t=t).upper===void 0||(t.upperOpen?ie(e,t.upper)<0:ie(e,t.upper)<=0));var n,r}function zr(e,t,w,r,o,a){if(!w||w.length===0)return e;var u=t.query.index,l=u.multiEntry,h=t.query.range,m=r.schema.primaryKey.extractKey,b=u.extractKey,f=(u.lowLevelIndex||u).extractKey,w=w.reduce(function(p,v){var x=p,g=[];if(v.type==="add"||v.type==="put")for(var j=new Oe,A=v.values.length-1;0<=A;--A){var N,S=v.values[A],O=m(S);j.hasKey(O)||(N=b(S),(l&&P(N)?N.some(function(T){return nr(T,h)}):nr(N,h))&&(j.addKey(O),g.push(S)))}switch(v.type){case"add":var B=new Oe().addKeys(t.values?p.map(function(W){return m(W)}):p),x=p.concat(t.values?g.filter(function(W){return W=m(W),!B.hasKey(W)&&(B.addKey(W),!0)}):g.map(function(W){return m(W)}).filter(function(W){return!B.hasKey(W)&&(B.addKey(W),!0)}));break;case"put":var E=new Oe().addKeys(v.values.map(function(W){return m(W)}));x=p.filter(function(W){return!E.hasKey(t.values?m(W):W)}).concat(t.values?g:g.map(function(W){return m(W)}));break;case"delete":var q=new Oe().addKeys(v.keys);x=p.filter(function(W){return!q.hasKey(t.values?m(W):W)});break;case"deleteRange":var I=v.range;x=p.filter(function(W){return!nr(m(W),I)})}return x},e);return w===e?e:(w.sort(function(p,v){return ie(f(p),f(v))||ie(m(p),m(v))}),t.limit&&t.limit<1/0&&(w.length>t.limit?w.length=t.limit:e.length===t.limit&&w.length<t.limit&&(o.dirty=!0)),a?Object.freeze(w):w)}function Wr(e,t){return ie(e.lower,t.lower)===0&&ie(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function zo(e,t){return function(n,r,o,a){if(n===void 0)return r!==void 0?-1:0;if(r===void 0)return 1;if((r=ie(n,r))===0){if(o&&a)return 0;if(o)return 1;if(a)return-1}return r}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(n,r,o,a){if(n===void 0)return r!==void 0?1:0;if(r===void 0)return-1;if((r=ie(n,r))===0){if(o&&a)return 0;if(o)return-1;if(a)return 1}return r}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function Wo(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",function(){var o,a;e.subscribers.delete(n),e.subscribers.size===0&&(o=e,a=t,setTimeout(function(){o.subscribers.size===0&&Se(a,o)},3e3))})}var Vo={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name;return y(y({},e),{transaction:function(n,r,o){var a,u,l=e.transaction(n,r,o);return r==="readwrite"&&(u=(a=new AbortController).signal,o=function(h){return function(){if(a.abort(),r==="readwrite"){for(var m=new Set,b=0,f=n;b<f.length;b++){var w=f[b],p=dt["idb://".concat(t,"/").concat(w)];if(p){var v=e.table(w),x=p.optimisticOps.filter(function(W){return W.trans===l});if(l._explicit&&h&&l.mutatedParts)for(var g=0,j=Object.values(p.queries.query);g<j.length;g++)for(var A=0,N=(B=j[g]).slice();A<N.length;A++)$n((E=N[A]).obsSet,l.mutatedParts)&&(Se(B,E),E.subscribers.forEach(function(W){return m.add(W)}));else if(0<x.length){p.optimisticOps=p.optimisticOps.filter(function(W){return W.trans!==l});for(var S=0,O=Object.values(p.queries.query);S<O.length;S++)for(var B,E,q,I=0,T=(B=O[S]).slice();I<T.length;I++)(E=T[I]).res!=null&&l.mutatedParts&&(h&&!E.dirty?(q=Object.isFrozen(E.res),q=zr(E.res,E.req,x,v,E,q),E.dirty?(Se(B,E),E.subscribers.forEach(function(W){return m.add(W)})):q!==E.res&&(E.res=q,E.promise=F.resolve({result:q}))):(E.dirty&&Se(B,E),E.subscribers.forEach(function(W){return m.add(W)})))}}}m.forEach(function(W){return W()})}}},l.addEventListener("abort",o(!1),{signal:u}),l.addEventListener("error",o(!1),{signal:u}),l.addEventListener("complete",o(!0),{signal:u})),l},table:function(n){var r=e.table(n),o=r.schema.primaryKey;return y(y({},r),{mutate:function(a){var u=Q.trans;if(o.outbound||u.db._options.cache==="disabled"||u.explicit||u.idbtrans.mode!=="readwrite")return r.mutate(a);var l=dt["idb://".concat(t,"/").concat(n)];return l?(u=r.mutate(a),a.type!=="add"&&a.type!=="put"||!(50<=a.values.length||tr(o,a).some(function(h){return h==null}))?(l.optimisticOps.push(a),a.mutatedParts&&hn(a.mutatedParts),u.then(function(h){0<h.numFailures&&(Se(l.optimisticOps,a),(h=Lr(0,a,h))&&l.optimisticOps.push(h),a.mutatedParts&&hn(a.mutatedParts))}),u.catch(function(){Se(l.optimisticOps,a),a.mutatedParts&&hn(a.mutatedParts)})):u.then(function(h){var m=Lr(0,y(y({},a),{values:a.values.map(function(b,f){var w;return h.failures[f]||(b=(w=o.keyPath)!==null&&w!==void 0&&w.includes(".")?De(b):y({},b),ee(b,o.keyPath,h.results[f])),b})}),h);l.optimisticOps.push(m),queueMicrotask(function(){return a.mutatedParts&&hn(a.mutatedParts)})}),u):r.mutate(a)},query:function(a){if(!Ir(Q,r)||!Fr("query",a))return r.query(a);var u=((m=Q.trans)===null||m===void 0?void 0:m.db._options.cache)==="immutable",f=Q,l=f.requery,h=f.signal,m=function(v,x,g,j){var A=dt["idb://".concat(v,"/").concat(x)];if(!A)return[];if(!(x=A.queries[g]))return[null,!1,A,null];var N=x[(j.query?j.query.index.name:null)||""];if(!N)return[null,!1,A,null];switch(g){case"query":var S=N.find(function(O){return O.req.limit===j.limit&&O.req.values===j.values&&Wr(O.req.query.range,j.query.range)});return S?[S,!0,A,N]:[N.find(function(O){return("limit"in O.req?O.req.limit:1/0)>=j.limit&&(!j.values||O.req.values)&&zo(O.req.query.range,j.query.range)}),!1,A,N];case"count":return S=N.find(function(O){return Wr(O.req.query.range,j.query.range)}),[S,!!S,A,N]}}(t,n,"query",a),b=m[0],f=m[1],w=m[2],p=m[3];return b&&f?b.obsSet=a.obsSet:(f=r.query(a).then(function(v){var x=v.result;if(b&&(b.res=x),u){for(var g=0,j=x.length;g<j;++g)Object.freeze(x[g]);Object.freeze(x)}else v.result=De(x);return v}).catch(function(v){return p&&b&&Se(p,b),Promise.reject(v)}),b={obsSet:a.obsSet,promise:f,subscribers:new Set,type:"query",req:a,dirty:!1},p?p.push(b):(p=[b],(w=w||(dt["idb://".concat(t,"/").concat(n)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[a.query.index.name||""]=p)),Wo(b,p,l,h),b.promise.then(function(v){return{result:zr(v.result,a,w?.optimisticOps,r,b,u)}})}})}})}};function mn(e,t){return new Proxy(e,{get:function(n,r,o){return r==="db"?t:Reflect.get(n,r,o)}})}var $e=(ke.prototype.version=function(e){if(isNaN(e)||e<.1)throw new U.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new U.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(r){return r._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(Mo),n.stores({}),this._state.autoSchema=!1,n)},ke.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||Q.letThrough||this._vip)?e():new F(function(n,r){if(t._state.openComplete)return r(new U.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void r(new U.DatabaseClosed);t.open().catch(de)}t._state.dbReadyPromise.then(n,r)}).then(e)},ke.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;return o&&this.unuse({stack:t,name:o}),e=this._middlewares[t]||(this._middlewares[t]=[]),e.push({stack:t,create:n,level:r??10,name:o}),e.sort(function(a,u){return a.level-u.level}),this},ke.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(o){return r?o.create!==r:!!n&&o.name!==n})),this},ke.prototype.open=function(){var e=this;return lt(Je,function(){return Bo(e)})},ke.prototype._close=function(){var e=this._state,t=xt.indexOf(this);if(0<=t&&xt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new F(function(n){e.dbReadyResolve=n}),e.openCanceller=new F(function(n,r){e.cancelOpen=r}))},ke.prototype.close=function(n){var t=(n===void 0?{disableAutoOpen:!0}:n).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new U.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new U.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},ke.prototype.delete=function(e){var t=this;e===void 0&&(e={disableAutoOpen:!0});var n=0<arguments.length&&typeof arguments[0]!="object",r=this._state;return new F(function(o,a){function u(){t.close(e);var l=t._deps.indexedDB.deleteDatabase(t.name);l.onsuccess=ge(function(){var h,m,b;h=t._deps,m=t.name,b=h.indexedDB,h=h.IDBKeyRange,Hn(b)||m===Xt||Qn(b,h).delete(m).catch(de),o()}),l.onerror=He(a),l.onblocked=t._fireOnBlocked}if(n)throw new U.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(u):u()})},ke.prototype.backendDB=function(){return this.idbdb},ke.prototype.isOpen=function(){return this.idbdb!==null},ke.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},ke.prototype.hasFailed=function(){return this._state.dbOpenError!==null},ke.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(ke.prototype,"tables",{get:function(){var e=this;return C(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),ke.prototype.transaction=function(){var e=function(t,n,r){var o=arguments.length;if(o<2)throw new U.InvalidArgument("Too few arguments");for(var a=new Array(o-1);--o;)a[o-1]=arguments[o];return r=a.pop(),[t,se(a),r]}.apply(this,arguments);return this._transaction.apply(this,e)},ke.prototype._transaction=function(e,t,n){var r=this,o=Q.trans;o&&o.db===this&&e.indexOf("!")===-1||(o=null);var a,u,l=e.indexOf("?")!==-1;e=e.replace("!","").replace("?","");try{if(u=t.map(function(m){if(m=m instanceof r.Table?m.name:m,typeof m!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return m}),e=="r"||e===Mn)a=Mn;else{if(e!="rw"&&e!=qn)throw new U.InvalidArgument("Invalid transaction mode: "+e);a=qn}if(o){if(o.mode===Mn&&a===qn){if(!l)throw new U.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&u.forEach(function(m){if(o&&o.storeNames.indexOf(m)===-1){if(!l)throw new U.SubTransaction("Table "+m+" not included in parent transaction.");o=null}}),l&&o&&!o.active&&(o=null)}}catch(m){return o?o._promise(null,function(b,f){f(m)}):je(m)}var h=function m(b,f,w,p,v){return F.resolve().then(function(){var x=Q.transless||Q,g=b._createTransaction(f,w,b._dbSchema,p);if(g.explicit=!0,x={trans:g,transless:x},p)g.idbtrans=p.idbtrans;else try{g.create(),g.idbtrans._explicit=!0,b._state.PR1398_maxLoop=3}catch(N){return N.name===yt.InvalidState&&b.isOpen()&&0<--b._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),b.close({disableAutoOpen:!1}),b.open().then(function(){return m(b,f,w,null,v)})):je(N)}var j,A=H(v);return A&&bt(),x=F.follow(function(){var N;(j=v.call(g,g))&&(A?(N=Ye.bind(null,null),j.then(N,N)):typeof j.next=="function"&&typeof j.throw=="function"&&(j=Xn(j)))},x),(j&&typeof j.then=="function"?F.resolve(j).then(function(N){return g.active?N:je(new U.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):x.then(function(){return j})).then(function(N){return p&&g._resolve(),g._completion.then(function(){return N})}).catch(function(N){return g._reject(N),je(N)})})}.bind(null,this,a,u,o,n);return o?o._promise(a,h,"lock"):Q.trans?lt(Q.transless,function(){return r._whenReady(h)}):this._whenReady(h)},ke.prototype.table=function(e){if(!D(this._allTables,e))throw new U.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},ke);function ke(e,t){var n=this;this._middlewares={},this.verno=0;var r=ke.dependencies;this._options=t=y({addons:ke.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,cache:"cloned"},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange},r=t.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,a,u,l,h,m={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:de,dbReadyPromise:null,cancelOpen:de,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:t.autoOpen};m.dbReadyPromise=new F(function(f){m.dbReadyResolve=f}),m.openCanceller=new F(function(f,w){m.cancelOpen=w}),this._state=m,this.name=e,this.on=Ot(this,"populate","blocked","versionchange","close",{ready:[An,de]}),this.on.ready.subscribe=_e(this.on.ready.subscribe,function(f){return function(w,p){ke.vip(function(){var v,x=n._state;x.openComplete?(x.dbOpenError||F.resolve().then(w),p&&f(w)):x.onReadyBeingFired?(x.onReadyBeingFired.push(w),p&&f(w)):(f(w),v=n,p||f(function g(){v.on.ready.unsubscribe(w),v.on.ready.unsubscribe(g)}))})}}),this.Collection=(o=this,Et(No.prototype,function(j,g){this.db=o;var p=xr,v=null;if(g)try{p=g()}catch(A){v=A}var x=j._ctx,g=x.table,j=g.hook.reading.fire;this._ctx={table:g,index:x.index,isPrimKey:!x.index||g.schema.primKey.keyPath&&x.index===g.schema.primKey.name,range:p,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:v,or:x.or,valueMapper:j!==_t?j:null}})),this.Table=(a=this,Et(Ar.prototype,function(f,w,p){this.db=a,this._tx=p,this.name=f,this.schema=w,this.hook=a._allTables[f]?a._allTables[f].hook:Ot(null,{creating:[go,de],reading:[yo,_t],updating:[bo,de],deleting:[vo,de]})})),this.Transaction=(u=this,Et(Po.prototype,function(f,w,p,v,x){var g=this;this.db=u,this.mode=f,this.storeNames=w,this.schema=p,this.chromeTransactionDurability=v,this.idbtrans=null,this.on=Ot(this,"complete","error","abort"),this.parent=x||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new F(function(j,A){g._resolve=j,g._reject=A}),this._completion.then(function(){g.active=!1,g.on.complete.fire()},function(j){var A=g.active;return g.active=!1,g.on.error.fire(j),g.parent?g.parent._reject(j):A&&g.idbtrans&&g.idbtrans.abort(),je(j)})})),this.Version=(l=this,Et(To.prototype,function(f){this.db=l,this._cfg={version:f,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(h=this,Et(Pr.prototype,function(f,w,p){if(this.db=h,this._ctx={table:f,index:w===":id"?null:w,or:p},this._cmp=this._ascending=ie,this._descending=function(v,x){return ie(x,v)},this._max=function(v,x){return 0<ie(v,x)?v:x},this._min=function(v,x){return ie(v,x)<0?v:x},this._IDBKeyRange=h._deps.IDBKeyRange,!this._IDBKeyRange)throw new U.MissingAPI})),this.on("versionchange",function(f){0<f.newVersion?console.warn("Another connection wants to upgrade database '".concat(n.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(n.name,"'. Closing db now to resume the delete request.")),n.close({disableAutoOpen:!1})}),this.on("blocked",function(f){!f.newVersion||f.newVersion<f.oldVersion?console.warn("Dexie.delete('".concat(n.name,"') was blocked")):console.warn("Upgrade '".concat(n.name,"' blocked by other connection holding version ").concat(f.oldVersion/10))}),this._maxKey=Dt(t.IDBKeyRange),this._createTransaction=function(f,w,p,v){return new n.Transaction(f,w,p,n._options.chromeTransactionDurability,v)},this._fireOnBlocked=function(f){n.on("blocked").fire(f),xt.filter(function(w){return w.name===n.name&&w!==n&&!w._state.vcFired}).map(function(w){return w.on("versionchange").fire(f)})},this.use(Fo),this.use(Vo),this.use(Lo),this.use(Ko),this.use(Io);var b=new Proxy(this,{get:function(f,w,p){if(w==="_vip")return!0;if(w==="table")return function(x){return mn(n.table(x),b)};var v=Reflect.get(f,w,p);return v instanceof Ar?mn(v,b):w==="tables"?v.map(function(x){return mn(x,b)}):w==="_createTransaction"?function(){return mn(v.apply(this,arguments),b)}:v}});this.vip=b,r.forEach(function(f){return f(n)})}var yn,ze=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Qo=(rr.prototype.subscribe=function(e,t,n){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:t,complete:n})},rr.prototype[ze]=function(){return this},rr);function rr(e){this._subscribe=e}try{yn={indexedDB:_.indexedDB||_.mozIndexedDB||_.webkitIndexedDB||_.msIndexedDB,IDBKeyRange:_.IDBKeyRange||_.webkitIDBKeyRange}}catch{yn={indexedDB:null,IDBKeyRange:null}}function Vr(e){var t,n=!1,r=new Qo(function(o){var a=H(e),u,l=!1,h={},m={},b={get closed(){return l},unsubscribe:function(){l||(l=!0,u&&u.abort(),f&&tt.storagemutated.unsubscribe(p))}};o.start&&o.start(b);var f=!1,w=function(){return Rn(v)},p=function(x){dn(h,x),$n(m,h)&&w()},v=function(){var x,g,j;!l&&yn.indexedDB&&(h={},x={},u&&u.abort(),u=new AbortController,j=function(A){var N=gt();try{a&&bt();var S=Ze(e,A);return S=a?S.finally(Ye):S}finally{N&&vt()}}(g={subscr:x,signal:u.signal,requery:w,querier:e,trans:null}),Promise.resolve(j).then(function(A){n=!0,t=A,l||g.signal.aborted||(h={},function(N){for(var S in N)if(D(N,S))return;return 1}(m=x)||f||(tt(qt,p),f=!0),Rn(function(){return!l&&o.next&&o.next(A)}))},function(A){n=!1,["DatabaseClosedError","AbortError"].includes(A?.name)||l||Rn(function(){l||o.error&&o.error(A)})}))};return setTimeout(w,0),b});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var ht=$e;function or(e){var t=nt;try{nt=!0,tt.storagemutated.fire(e),Yn(e,!0)}finally{nt=t}}G(ht,y(y({},Vt),{delete:function(e){return new ht(e,{addons:[]}).delete()},exists:function(e){return new ht(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return t=ht.dependencies,n=t.indexedDB,t=t.IDBKeyRange,(Hn(n)?Promise.resolve(n.databases()).then(function(r){return r.map(function(o){return o.name}).filter(function(o){return o!==Xt})}):Qn(n,t).toCollection().primaryKeys()).then(e)}catch{return je(new U.MissingAPI)}var t,n},defineClass:function(){return function(e){L(this,e)}},ignoreTransaction:function(e){return Q.trans?lt(Q.transless,e):e()},vip:Un,async:function(e){return function(){try{var t=Xn(e.apply(this,arguments));return t&&typeof t.then=="function"?t:F.resolve(t)}catch(n){return je(n)}}},spawn:function(e,t,n){try{var r=Xn(e.apply(n,t||[]));return r&&typeof r.then=="function"?r:F.resolve(r)}catch(o){return je(o)}},currentTransaction:{get:function(){return Q.trans||null}},waitFor:function(e,t){return t=F.resolve(typeof e=="function"?ht.ignoreTransaction(e):e).timeout(t||6e4),Q.trans?Q.trans.waitFor(t):t},Promise:F,debug:{get:function(){return Qe},set:function(e){hr(e)}},derive:$,extend:L,props:G,override:_e,Events:Ot,on:tt,liveQuery:Vr,extendObservabilitySet:dn,getByKeyPath:re,setByKeyPath:ee,delByKeyPath:function(e,t){typeof t=="string"?ee(e,t,void 0):"length"in t&&[].map.call(t,function(n){ee(e,n,void 0)})},shallowClone:xe,deepClone:De,getObjectDiff:er,cmp:ie,asap:he,minKey:-1/0,addons:[],connections:xt,errnames:yt,dependencies:yn,cache:dt,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),ht.maxKey=Dt(ht.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(tt(qt,function(e){nt||(e=new CustomEvent(Kn,{detail:e}),nt=!0,dispatchEvent(e),nt=!1)}),addEventListener(Kn,function(e){e=e.detail,nt||or(e)}));var kt,nt=!1,Qr=function(){};return typeof BroadcastChannel<"u"&&((Qr=function(){(kt=new BroadcastChannel(Kn)).onmessage=function(e){return e.data&&or(e.data)}})(),typeof kt.unref=="function"&&kt.unref(),tt(qt,function(e){nt||kt.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!$e.disableBfCache&&e.persisted){Qe&&console.debug("Dexie: handling persisted pagehide"),kt?.close();for(var t=0,n=xt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!$e.disableBfCache&&e.persisted&&(Qe&&console.debug("Dexie: handling persisted pageshow"),Qr(),or({all:new Oe(-1/0,[[]])}))})),F.rejectionMapper=function(e,t){return!e||e instanceof ce||e instanceof TypeError||e instanceof SyntaxError||!e.name||!dr[e.name]?e:(t=new dr[e.name](t||e.message,e),"stack"in e&&M(t,"stack",{get:function(){return this.inner.stack}}),t)},hr(Qe),y($e,Object.freeze({__proto__:null,Dexie:$e,liveQuery:Vr,Entity:wr,cmp:ie,PropModification:Rt,replacePrefix:function(e,t){return new Rt({replacePrefix:[e,t]})},add:function(e){return new Rt({add:e})},remove:function(e){return new Rt({remove:e})},default:$e,RangeSet:Oe,mergeRanges:Kt,rangesOverlap:qr}),{default:$e}),$e})}(lr)),lr.exports}var Yo=Zo();const cr=Uo(Yo),Jr=Symbol.for("Dexie"),wn=globalThis[Jr]||(globalThis[Jr]=cr);if(cr.semVer!==wn.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${cr.semVer} and ${wn.semVer}`);const{liveQuery:Xo,mergeRanges:_i,rangesOverlap:Ni,RangeSet:Ci,cmp:Si,Entity:Pi,PropModification:Oi,replacePrefix:Ei,add:Ri,remove:Mi}=wn;function ea(s,c,d){var y,k;typeof s=="function"?(y=c||[],k=d):(y=[],k=c);var _=Ve.useRef({hasResult:!1,result:k,error:null}),C=Ve.useReducer(function(z){return z+1},0);C[0];var P=C[1],L=Ve.useMemo(function(){var z=typeof s=="function"?s():s;if(!z||typeof z.subscribe!="function")throw s===z?new TypeError("Given argument to useObservable() was neither a valid observable nor a function."):new TypeError("Observable factory given to useObservable() did not return a valid observable.");if(!_.current.hasResult&&typeof window<"u"&&(typeof z.hasValue!="function"||z.hasValue()))if(typeof z.getValue=="function")_.current.result=z.getValue(),_.current.hasResult=!0;else{var R=z.subscribe(function(D){_.current.result=D,_.current.hasResult=!0});typeof R=="function"?R():R.unsubscribe()}return z},y);if(Ve.useDebugValue(_.current.result),Ve.useEffect(function(){var z=L.subscribe(function(R){var D=_.current;(D.error!==null||D.result!==R)&&(D.error=null,D.result=R,D.hasResult=!0,P())},function(R){var D=_.current;D.error!==R&&(D.error=R,P())});return typeof z=="function"?z:z.unsubscribe.bind(z)},y),_.current.error)throw _.current.error;return _.current.result}function Zr(s,c,d){return ea(function(){return Xo(s)},c||[],d)}const fr=s=>s>=200&&s<300?"bg-green-200 text-green-800":s>=300&&s<400?"bg-blue-200 text-blue-800":s>=400&&s<500?"bg-orange-600 text-orange-200":s>=500?"bg-red-800 text-red-100":"bg-gray-200 text-gray-800",ta=["bg-blue-100","border-l-4","border-blue-700"].join(" "),na=({request:s,reqId:c,onSelect:d,onRemove:y,selected:k})=>{var _,C;const P=L=>{d(L)};return i.jsx("li",{className:`flex items-center cursor-pointer hover:bg-gray-200 ${k?ta:""}`,onClick:()=>{P(s)},children:i.jsxs("div",{className:"flex items-center p-2 w-full",children:[i.jsx("div",{className:"w-16 flex justify-center",children:i.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${fr((_=s?.response)==null?void 0:_.statusCode)}`,children:((C=s?.response)==null?void 0:C.statusCode)||"N/A"})}),i.jsx("div",{className:"w-20 text-center font-medium",children:s?.method||"GET"}),i.jsx("div",{className:"flex-grow truncate text-left",children:s.path||s.url}),i.jsxs("div",{className:"w-20 text-gray-500 text-center",children:[s.latency,"ms"]}),i.jsx("button",{className:"w-8 h-8 flex items-center justify-center cursor-pointer text-red-500 hover:text-red-700",onClick:L=>{L.stopPropagation(),y(c)},children:"✕"})]})})},Yr=({options:s,selected:c,onChange:d,placeholder:y="Add option...",colorFn:k})=>{const[_,C]=K.useState(""),[P,L]=K.useState(!1),[z,R]=K.useState(0),D=K.useRef(null),G=s.filter(V=>V.toLowerCase().includes(_.toLowerCase())&&!c.includes(V));K.useEffect(()=>{R(0)},[_,c]);const te=V=>{c.includes(V)||d([...c,V]),C("")},M=V=>{d(c.filter(ue=>ue!==V))},$=V=>{V.key==="ArrowDown"?(V.preventDefault(),R(ue=>ue+1<G.length?ue+1:ue)):V.key==="ArrowUp"?(V.preventDefault(),R(ue=>ue-1>=0?ue-1:0)):V.key==="Enter"?(console.log("enter",z),V.preventDefault(),G.length>0&&te(G[z])):V.key==="Backspace"&&!_&&c.length>0&&M(c[c.length-1])};return i.jsxs("div",{className:"w-full max-w-md relative",children:[i.jsxs("div",{className:"flex flex-wrap items-center border border-gray-300 rounded-md shadow-sm px-2 py-1",children:[c.map(V=>i.jsxs("div",{className:`flex items-center rounded-full px-2 py-1 mr-2 my-1 text-xs ${k?k(V):"bg-indigo-100 text-indigo-700"}`,children:[i.jsx("span",{children:V}),i.jsx("button",{type:"button",onClick:()=>M(V),className:"ml-1 focus:outline-none cursor-pointer","aria-label":`Remove ${V}`,children:i.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414
|
|
12
|
+
1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293
|
|
13
|
+
4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:"evenodd"})})})]},V)),i.jsx("input",{ref:D,type:"text",className:"flex-grow outline-none p-1",placeholder:c.length>0?"":y,value:_,onChange:V=>C(V.target.value),onKeyDown:$,onFocus:()=>L(!0),onBlur:()=>setTimeout(()=>L(!1),100)})]}),P&&G.length>0&&i.jsx("ul",{className:"absolute left-0 right-0 border border-gray-300 mt-1 rounded-md shadow-lg bg-white max-h-40 overflow-y-auto z-10",children:G.map((V,ue)=>i.jsx("li",{className:`cursor-pointer px-2 py-1 hover:bg-indigo-100 ${ue===z?"bg-indigo-200":""}`,onMouseEnter:()=>R(ue),onMouseDown:()=>te(V),children:V},V))})]})},ra=s=>{switch(s.toUpperCase()){case"GET":return"text-green-700 border border-green-700";case"POST":return"text-sky-700 border border-sky-700";case"PUT":return"text-fuchsia-700 border border-fuchsia-700";case"PATCH":return"text-purple-700 border border-purple-700";case"DELETE":return"text-red-700 border border-red-700";case"OPTIONS":return"text-rose-700 border border-rose-700";case"HEAD":return"text-pink-700 border border-pink-700";default:return"text-gray-700 border border-gray-700"}},oa=({isOpen:s,onClose:c,sortField:d,sortDirection:y,filters:k,setSortField:_,setSortDirection:C,setFilters:P})=>{const L=()=>{_("time"),C("desc")},z=()=>{P({})},R=M=>{const $=M.target.value;P(V=>({...V,timestampRange:$,customStart:void 0,customEnd:void 0}))},D=(M,$)=>{P(V=>({...V,timestampRange:{...typeof V.timestampRange=="object"&&V.timestampRange||{},[M]:$}}))},G=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"],te=["200","201","204","301","302","400","401","403","404","500","502","503"];return i.jsxs(i.Fragment,{children:[s&&i.jsx("div",{className:"fixed inset-0 bg-black opacity-50",style:{zIndex:9998},onClick:c}),i.jsxs("div",{className:`fixed top-0 left-0 h-full w-100 bg-white shadow-xl transform transition-transform duration-300
|
|
14
|
+
${s?"translate-x-0":"-translate-x-full"}
|
|
15
|
+
`,style:{zIndex:9999},children:[i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-300 bg-gray-50",children:[i.jsx("h2",{className:"pl-4 text-lg font-semibold text-gray-800",children:"Filter & Sort"}),i.jsx("button",{onClick:c,className:"text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),i.jsxs("div",{className:"p-4 overflow-y-auto h-full",children:[i.jsxs("section",{className:"mb-6 ml-4 mr-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Sort By"}),i.jsx("button",{onClick:L,className:"text-xs text-blue-600 hover:underline cursor-pointer",children:"Reset"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortField",value:"time",checked:d==="time",onChange:M=>_(M.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Timestamp"})]}),i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortField",value:"statusCode",checked:d==="statusCode",onChange:M=>_(M.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Status"})]}),i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortField",value:"method",checked:d==="method",onChange:M=>_(M.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Method"})]})]}),i.jsxs("div",{className:"mt-4",children:[i.jsx("h4",{className:"mb-2 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Sort Direction"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortDirection",value:"asc",checked:y==="asc",onChange:M=>C(M.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Ascending"})]}),i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortDirection",value:"desc",checked:y==="desc",onChange:M=>C(M.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Descending"})]})]})]})]}),i.jsxs("section",{className:"mb-6 ml-4 mr-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Filters"}),i.jsx("button",{onClick:z,className:"text-xs text-blue-600 hover:underline cursor-pointer",children:"Reset"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Quick Time Range"}),i.jsxs("select",{value:typeof k.timestampRange=="string"?k.timestampRange:"",onChange:R,className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm",children:[i.jsx("option",{value:"",children:"Any"}),i.jsx("option",{value:"15M",children:"Last 15 minutes"}),i.jsx("option",{value:"30M",children:"Last 30 minutes"}),i.jsx("option",{value:"1H",children:"Last 1 hour"}),i.jsx("option",{value:"3H",children:"Last 3 hours"}),i.jsx("option",{value:"6H",children:"Last 6 hours"}),i.jsx("option",{value:"12H",children:"Last 12 hours"}),i.jsx("option",{value:"24H",children:"Last 24 hours"}),i.jsx("option",{value:"48H",children:"Last 2 days"}),i.jsx("option",{value:"week",children:"Last Week"}),i.jsx("option",{value:"month",children:"Last Month"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Specific Time Range"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("input",{type:"datetime-local",value:typeof k.timestampRange=="object"&&k.timestampRange.start?k.timestampRange.start:"",onChange:M=>D("start",M.target.value),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("input",{type:"datetime-local",value:typeof k.timestampRange=="object"&&k.timestampRange.end?k.timestampRange.end:"",onChange:M=>D("end",M.target.value),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),i.jsx(Yr,{options:te,selected:k.status||[],onChange:M=>P($=>({...$,status:M})),placeholder:"Add status code...",colorFn:fr})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Method"}),i.jsx(Yr,{options:G,selected:k.method||[],onChange:M=>P($=>({...$,method:M})),placeholder:"Add method...",colorFn:ra})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Path"}),i.jsx("input",{type:"text",placeholder:"e.g. /api/users",value:k.path||"",onChange:M=>P($=>({...$,path:M.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Duration (ms)"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("input",{type:"number",placeholder:"Min",value:k.durationMin||"",onChange:M=>P($=>({...$,durationMin:M.target.value})),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("input",{type:"number",placeholder:"Max",value:k.durationMax||"",onChange:M=>P($=>({...$,durationMax:M.target.value})),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Host"}),i.jsx("input",{type:"text",placeholder:"e.g. localhost",value:k.host||"",onChange:M=>P($=>({...$,host:M.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})]})]})]})},aa=({currentPage:s,totalPages:c,onPageChange:d})=>{const y=((k,_)=>{const C=[];if(_<=7)for(let P=1;P<=_;P++)C.push(P);else if(k<=4){for(let P=1;P<=5;P++)C.push(P);C.push("ellipsis"),C.push(_)}else if(k>=_-3){C.push(1),C.push("ellipsis");for(let P=_-4;P<=_;P++)C.push(P)}else C.push(1),C.push("ellipsis"),C.push(k-1),C.push(k),C.push(k+1),C.push("ellipsis"),C.push(_);return C})(s,c);return i.jsx("nav",{className:"p-2 border-t border-gray-300",children:i.jsxs("ul",{className:"flex items-center justify-center -space-x-px h-8 text-sm",children:[i.jsx("li",{children:i.jsxs("button",{onClick:()=>d(s-1),disabled:s<=1,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[i.jsx("span",{className:"sr-only",children:"Previous"}),i.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:i.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 1 1 5l4 4"})})]})}),y.map((k,_)=>{if(k==="ellipsis")return i.jsx("li",{children:i.jsx("span",{className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 cursor-pointer",children:"..."})},`ellipsis-${_}`);const C=k===s;return i.jsx("li",{children:i.jsx("button",{onClick:()=>d(k),className:C?"z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white cursor-pointer":"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:k})},k)}),i.jsx("li",{children:i.jsxs("button",{onClick:()=>d(s+1),disabled:s>=c,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[i.jsx("span",{className:"sr-only",children:"Next"}),i.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:i.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})})]})})]})})},ia=({open:s,onClose:c,onConfirmAll:d,onConfirmFiltered:y,hasFilters:k})=>s?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:c}),i.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6 z-10",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("div",{className:"flex-shrink-0 bg-red-100 rounded-full p-2",children:i.jsx("svg",{className:"size-6 text-red-600",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",children:i.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),i.jsxs("div",{className:"ml-4",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-900",children:k?"Clear Requests":"Clear All Requests"}),i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:k?"You have active filters. Would you like to clear only the filtered requests or all requests?":"Are you sure you want to clear all requests? This action cannot be undone."})]})]}),i.jsxs("div",{className:"mt-6 flex justify-end space-x-3",children:[i.jsx("button",{onClick:c,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Cancel"}),k&&i.jsx("button",{onClick:()=>{y(),c()},className:"px-4 py-2 bg-yellow-500 text-white rounded hover:bg-yellow-600 text-sm",children:"Clear Filtered"}),i.jsx("button",{onClick:()=>{d(),c()},className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 text-sm",children:"Clear All"})]})]})]}):null,sa=({requests:s,onSelect:c,onRemove:d,clearRequests:y,clearFilteredRequests:k,selectedRequest:_,currentPage:C,totalPages:P,totalCount:L,onPageChange:z,sortField:R,sortDirection:D,filters:G,setSortField:te,setSortDirection:M,setFilters:$})=>{const[V,ue]=K.useState(!1),[ne,_e]=K.useState(!1),ve=Object.entries(G||{}).reduce((re,[ee,xe])=>ee==="timestampRange"&&typeof xe=="object"?xe.start||xe.end?re+1:re:xe?re+1:re,0),he=ve>0?"bg-green-500 text-white":"bg-blue-500 text-white";return i.jsxs("div",{className:"flex flex-col h-full relative",children:[i.jsxs("div",{className:"p-4 flex justify-between items-center",children:[i.jsxs("span",{className:"font-bold text-xl",children:["Requests (",s.length," of ",L,")"]}),i.jsxs("div",{className:"space-x-2 relative",children:[i.jsxs("button",{className:`relative px-3 py-1 rounded text-xs cursor-pointer ${he}`,onClick:()=>ue(!0),children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-4 h-4 text-white",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})}),ve>0&&i.jsx("span",{className:"absolute -top-1 -right-1 bg-green-700 text-white text-[10px] font-bold w-4 h-4 flex items-center justify-center rounded-full",children:ve})]}),i.jsx("button",{className:"px-3 py-1 bg-red-500 text-white rounded text-xs cursor-pointer",onClick:()=>_e(!0),children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-4 h-4 text-white",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]})]}),i.jsxs("div",{className:"flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold cursor-pointer",onClick:()=>ue(!0),children:[i.jsx("div",{className:"w-16 text-center",children:"Status"}),i.jsx("div",{className:"w-20 text-center",children:"Method"}),i.jsx("div",{className:"flex-grow text-left",children:"Path"}),i.jsx("div",{className:"w-20 text-center",children:"Duration"}),i.jsx("div",{className:"w-10"})]}),i.jsx("ul",{className:"overflow-y-auto flex-grow",style:{maxHeight:"calc(100vh - 40px - 100px - 49px)"},children:s.map((re,ee)=>{const xe=re.id||ee;return i.jsx(na,{reqId:xe,request:re,onSelect:c,onRemove:d,selected:_&&_.id===xe},xe)})}),i.jsx(aa,{currentPage:C,totalPages:P,onPageChange:z}),i.jsx(oa,{isOpen:V,onClose:()=>ue(!1),sortField:R,sortDirection:D,filters:G,setSortField:te,setSortDirection:M,setFilters:$}),i.jsx(ia,{open:ne,onClose:()=>_e(!1),onConfirmAll:y,onConfirmFiltered:k,hasFilters:ve>0})]})},xn=({message:s,subMessage:c,onClose:d,type:y="success"})=>{const[k,_]=K.useState(3e3),[C,P]=K.useState(!1);K.useEffect(()=>{const te=setInterval(()=>{C||_(M=>M<=50?(clearInterval(te),d(),0):M-50)},50);return()=>clearInterval(te)},[C,d]);const L=k/3e3*100,z=y==="error"?"border-red-500":"border-green-500",R=y==="error"?"text-red-500":"text-green-500",D=y==="error"?"bg-red-500":"bg-green-500",G=y==="error"?"M12 9v2m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z":"M9 12.75L11.25 15L15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z";return i.jsx("div",{className:"fixed top-4 right-4 z-50 w-80",onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:i.jsx("div",{className:`bg-white border-l-4 ${z} p-2 shadow-lg rounded-lg`,children:i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("svg",{className:`h-6 w-6 ${R}`,fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:G})})}),i.jsxs("div",{className:"ml-1 flex-1",children:[i.jsx("p",{className:"text-sm font-medium text-gray-900",children:s}),c&&i.jsx("p",{className:"mt-1 text-sm text-gray-500 break-words",children:c}),i.jsx("div",{className:`w-full h-1 rounded-t-lg ${D}`,style:{width:`${L}%`}})]}),i.jsx("div",{className:"ml-auto pl-1",children:i.jsxs("button",{onClick:d,className:`text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${y==="error"?"red":"green"}-500`,children:[i.jsx("span",{className:"sr-only",children:"Close"}),i.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 0 1 1.414 0L10 8.586l4.293-4.293a1 1 0 1 1 1.414 1.414L11.414 10l4.293 4.293a1 1 0 0 1-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 1 1-1.414-1.414L8.586 10 4.293 5.707a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})})]})})]})})})},ua=({request:s})=>{var c,d;const[y,k]=K.useState(!1),[_,C]=K.useState(!1),[P,L]=K.useState(!1),z=M=>{if(!M)return"N/A";const $=new Date(M),V=$.toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}),ue=$.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${V} at ${ue}`},R=()=>{const{method:M,url:$,request:V}=s;let ue=`curl -X ${M} '${$}'`;return V.headers&&Object.entries(V.headers).forEach(([ne,_e])=>{ue+=` -H '${ne}: ${_e}'`}),V.payload&&(ue+=` --data '${V.payload}'`),ue},D=()=>{const M=R();navigator.clipboard.writeText(M).then(()=>{k(!0)}).catch($=>{console.error("[Inspectr] Failed to copy cURL command:",$)})},G=()=>{navigator.clipboard.writeText(s.url).then(()=>{C(!0)}).catch(M=>{console.error("[Inspectr] Failed to copy URL:",M)})},te=()=>{fetch("/api/replay",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(M=>{if(!M.ok)throw new Error("Replay failed");return M.json()}).then(()=>{L(!0)}).catch(M=>{console.error("[Inspectr] Failed to replay request:",M)})};return i.jsxs("div",{className:"mb-4 p-4 bg-white rounded shadow relative",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h2",{className:"font-bold text-2xl",children:"Request Details"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs("button",{onClick:D,className:"flex items-center space-x-2 px-2 py-1 border border-slate-600 text-slate-600 rounded focus:outline-none cursor-pointer",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"h-4 w-4",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})}),i.jsx("span",{className:"text-xs",children:"Copy as cURL"})]}),i.jsxs("button",{onClick:te,className:"flex items-center space-x-2 px-2 py-1 border border-slate-600 text-slate-600 rounded focus:outline-none cursor-pointer",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),i.jsx("span",{className:"text-xs",children:"Replay"})]})]})]}),i.jsxs("div",{className:"flex flex-col space-y-1",children:[i.jsxs("div",{className:"flex items-center space-x-2 font-mono text-lg",children:[i.jsx("span",{className:"font-bold",children:s.method}),i.jsx("span",{className:"text-blue-600",children:s.path}),i.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${fr((c=s?.response)==null?void 0:c.statusCode)}`,children:(d=s?.response)==null?void 0:d.statusCode}),i.jsx("span",{className:"text-sm",children:s.response.statusMessage})]}),i.jsxs("div",{className:"flex items-center text-gray-600",children:[i.jsx("span",{onClick:G,className:"cursor-pointer",children:s.url}),i.jsx("button",{onClick:G,className:"cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:"w-4 h-4",children:i.jsx("path",{d:"M48.186 92.137c0-8.392 6.49-14.89 16.264-14.89s29.827-.225 29.827-.225-.306-6.99-.306-15.88c0-8.888 7.954-14.96 17.49-14.96 9.538 0 56.786.401 61.422.401 4.636 0 8.397 1.719 13.594 5.67 5.196 3.953 13.052 10.56 16.942 14.962 3.89 4.402 5.532 6.972 5.532 10.604 0 3.633 0 76.856-.06 85.34-.059 8.485-7.877 14.757-17.134 14.881-9.257.124-29.135.124-29.135.124s.466 6.275.466 15.15-8.106 15.811-17.317 16.056c-9.21.245-71.944-.49-80.884-.245-8.94.245-16.975-6.794-16.975-15.422s.274-93.175.274-101.566zm16.734 3.946l-1.152 92.853a3.96 3.96 0 0 0 3.958 4.012l73.913.22a3.865 3.865 0 0 0 3.91-3.978l-.218-8.892a1.988 1.988 0 0 0-2.046-1.953s-21.866.64-31.767.293c-9.902-.348-16.672-6.807-16.675-15.516-.003-8.709.003-69.142.003-69.142a1.989 1.989 0 0 0-2.007-1.993l-23.871.082a4.077 4.077 0 0 0-4.048 4.014zm106.508-35.258c-1.666-1.45-3.016-.84-3.016 1.372v17.255c0 1.106.894 2.007 1.997 2.013l20.868.101c2.204.011 2.641-1.156.976-2.606l-20.825-18.135zm-57.606.847a2.002 2.002 0 0 0-2.02 1.988l-.626 96.291a2.968 2.968 0 0 0 2.978 2.997l75.2-.186a2.054 2.054 0 0 0 2.044-2.012l1.268-62.421a1.951 1.951 0 0 0-1.96-2.004s-26.172.042-30.783.042c-4.611 0-7.535-2.222-7.535-6.482S152.3 63.92 152.3 63.92a2.033 2.033 0 0 0-2.015-2.018l-36.464-.23z",stroke:"#979797",fillRule:"evenodd"})})})]}),i.jsxs("div",{className:"text-gray-500 text-xs",children:["Received on ",z(s.request.timestamp)," • Took ",s.latency,"ms to respond"]})]}),y&&i.jsx(xn,{message:"cURL command copied!",subMessage:"You can now paste it into your terminal.",onClose:()=>k(!1)}),_&&i.jsx(xn,{message:"URL copied!",subMessage:"The request URL has been copied to your clipboard.",onClose:()=>C(!1)}),P&&i.jsx(xn,{message:"Replay sent!",subMessage:"The request event has been replayd.",onClose:()=>L(!1)})]})};function la(s,c,d){return c in s?Object.defineProperty(s,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[c]=d,s}function Xr(s,c){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(s);c&&(y=y.filter(function(k){return Object.getOwnPropertyDescriptor(s,k).enumerable})),d.push.apply(d,y)}return d}function eo(s){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?Xr(Object(d),!0).forEach(function(y){la(s,y,d[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):Xr(Object(d)).forEach(function(y){Object.defineProperty(s,y,Object.getOwnPropertyDescriptor(d,y))})}return s}function ca(s,c){if(s==null)return{};var d={},y=Object.keys(s),k,_;for(_=0;_<y.length;_++)k=y[_],!(c.indexOf(k)>=0)&&(d[k]=s[k]);return d}function fa(s,c){if(s==null)return{};var d=ca(s,c),y,k;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(s);for(k=0;k<_.length;k++)y=_[k],!(c.indexOf(y)>=0)&&Object.prototype.propertyIsEnumerable.call(s,y)&&(d[y]=s[y])}return d}function da(s,c){return ha(s)||pa(s,c)||ma(s,c)||ya()}function ha(s){if(Array.isArray(s))return s}function pa(s,c){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(s)))){var d=[],y=!0,k=!1,_=void 0;try{for(var C=s[Symbol.iterator](),P;!(y=(P=C.next()).done)&&(d.push(P.value),!(c&&d.length===c));y=!0);}catch(L){k=!0,_=L}finally{try{!y&&C.return!=null&&C.return()}finally{if(k)throw _}}return d}}function ma(s,c){if(s){if(typeof s=="string")return to(s,c);var d=Object.prototype.toString.call(s).slice(8,-1);if(d==="Object"&&s.constructor&&(d=s.constructor.name),d==="Map"||d==="Set")return Array.from(s);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return to(s,c)}}function to(s,c){(c==null||c>s.length)&&(c=s.length);for(var d=0,y=new Array(c);d<c;d++)y[d]=s[d];return y}function ya(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(s,c,d){return c in s?Object.defineProperty(s,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[c]=d,s}function no(s,c){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(s);c&&(y=y.filter(function(k){return Object.getOwnPropertyDescriptor(s,k).enumerable})),d.push.apply(d,y)}return d}function ro(s){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?no(Object(d),!0).forEach(function(y){ga(s,y,d[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):no(Object(d)).forEach(function(y){Object.defineProperty(s,y,Object.getOwnPropertyDescriptor(d,y))})}return s}function va(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];return function(y){return c.reduceRight(function(k,_){return _(k)},y)}}function Ft(s){return function c(){for(var d=this,y=arguments.length,k=new Array(y),_=0;_<y;_++)k[_]=arguments[_];return k.length>=s.length?s.apply(this,k):function(){for(var C=arguments.length,P=new Array(C),L=0;L<C;L++)P[L]=arguments[L];return c.apply(d,[].concat(k,P))}}}function jn(s){return{}.toString.call(s).includes("Object")}function ba(s){return!Object.keys(s).length}function zt(s){return typeof s=="function"}function xa(s,c){return Object.prototype.hasOwnProperty.call(s,c)}function wa(s,c){return jn(c)||rt("changeType"),Object.keys(c).some(function(d){return!xa(s,d)})&&rt("changeField"),c}function ja(s){zt(s)||rt("selectorType")}function ka(s){zt(s)||jn(s)||rt("handlerType"),jn(s)&&Object.values(s).some(function(c){return!zt(c)})&&rt("handlersType")}function Aa(s){s||rt("initialIsRequired"),jn(s)||rt("initialType"),ba(s)&&rt("initialContent")}function _a(s,c){throw new Error(s[c]||s.default)}var Na={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},rt=Ft(_a)(Na),vn={changes:wa,selector:ja,handler:ka,initial:Aa};function Ca(s){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vn.initial(s),vn.handler(c);var d={current:s},y=Ft(Oa)(d,c),k=Ft(Pa)(d),_=Ft(vn.changes)(s),C=Ft(Sa)(d);function P(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(R){return R};return vn.selector(z),z(d.current)}function L(z){va(y,k,_,C)(z)}return[P,L]}function Sa(s,c){return zt(c)?c(s.current):c}function Pa(s,c){return s.current=ro(ro({},s.current),c),c}function Oa(s,c,d){return zt(c)?c(s.current):Object.keys(d).forEach(function(y){var k;return(k=c[y])===null||k===void 0?void 0:k.call(c,s.current[y])}),d}var Ea={create:Ca},Ra={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Ma(s){return function c(){for(var d=this,y=arguments.length,k=new Array(y),_=0;_<y;_++)k[_]=arguments[_];return k.length>=s.length?s.apply(this,k):function(){for(var C=arguments.length,P=new Array(C),L=0;L<C;L++)P[L]=arguments[L];return c.apply(d,[].concat(k,P))}}}function qa(s){return{}.toString.call(s).includes("Object")}function Da(s){return s||oo("configIsRequired"),qa(s)||oo("configType"),s.urls?(Ta(),{paths:{vs:s.urls.monacoBase}}):s}function Ta(){console.warn(io.deprecation)}function Ba(s,c){throw new Error(s[c]||s.default)}var io={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
17
|
+
You are using deprecated way of configuration.
|
|
18
|
+
|
|
19
|
+
Instead of using
|
|
20
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
21
|
+
use
|
|
22
|
+
monaco.config({ paths: { vs: '...' } })
|
|
23
|
+
|
|
24
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
25
|
+
`},oo=Ma(Ba)(io),Ka={config:Da},Ia=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];return function(y){return c.reduceRight(function(k,_){return _(k)},y)}};function so(s,c){return Object.keys(c).forEach(function(d){c[d]instanceof Object&&s[d]&&Object.assign(c[d],so(s[d],c[d]))}),eo(eo({},s),c)}var Fa={type:"cancelation",msg:"operation is manually canceled"};function ir(s){var c=!1,d=new Promise(function(y,k){s.then(function(_){return c?k(Fa):y(_)}),s.catch(k)});return d.cancel=function(){return c=!0},d}var La=Ea.create({config:Ra,isInitialized:!1,resolve:null,reject:null,monaco:null}),uo=da(La,2),Wt=uo[0],kn=uo[1];function za(s){var c=Ka.config(s),d=c.monaco,y=fa(c,["monaco"]);kn(function(k){return{config:so(k.config,y),monaco:d}})}function Wa(){var s=Wt(function(c){var d=c.monaco,y=c.isInitialized,k=c.resolve;return{monaco:d,isInitialized:y,resolve:k}});if(!s.isInitialized){if(kn({isInitialized:!0}),s.monaco)return s.resolve(s.monaco),ir(sr);if(window.monaco&&window.monaco.editor)return lo(window.monaco),s.resolve(window.monaco),ir(sr);Ia(Va,Ha)(Ua)}return ir(sr)}function Va(s){return document.body.appendChild(s)}function Qa(s){var c=document.createElement("script");return s&&(c.src=s),c}function Ha(s){var c=Wt(function(y){var k=y.config,_=y.reject;return{config:k,reject:_}}),d=Qa("".concat(c.config.paths.vs,"/loader.js"));return d.onload=function(){return s()},d.onerror=c.reject,d}function Ua(){var s=Wt(function(d){var y=d.config,k=d.resolve,_=d.reject;return{config:y,resolve:k,reject:_}}),c=window.require;c.config(s.config),c(["vs/editor/editor.main"],function(d){lo(d),s.resolve(d)},function(d){s.reject(d)})}function lo(s){Wt().monaco||kn({monaco:s})}function Ga(){return Wt(function(s){var c=s.monaco;return c})}var sr=new Promise(function(s,c){return kn({resolve:s,reject:c})}),co={config:za,init:Wa,__getMonacoInstance:Ga},$a={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ur=$a,Ja={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Za=Ja;function Ya({children:s}){return Ve.createElement("div",{style:Za.container},s)}var Xa=Ya,ei=Xa;function ti({width:s,height:c,isEditorReady:d,loading:y,_ref:k,className:_,wrapperProps:C}){return Ve.createElement("section",{style:{...ur.wrapper,width:s,height:c},...C},!d&&Ve.createElement(ei,null,y),Ve.createElement("div",{ref:k,style:{...ur.fullWidth,...!d&&ur.hide},className:_}))}var ni=ti,fo=K.memo(ni);function ri(s){K.useEffect(s,[])}var ho=ri;function oi(s,c,d=!0){let y=K.useRef(!0);K.useEffect(y.current||!d?()=>{y.current=!1}:s,c)}var Fe=oi;function Lt(){}function At(s,c,d,y){return ai(s,y)||ii(s,c,d,y)}function ai(s,c){return s.editor.getModel(po(s,c))}function ii(s,c,d,y){return s.editor.createModel(c,d,y?po(s,y):void 0)}function po(s,c){return s.Uri.parse(c)}function si({original:s,modified:c,language:d,originalLanguage:y,modifiedLanguage:k,originalModelPath:_,modifiedModelPath:C,keepCurrentOriginalModel:P=!1,keepCurrentModifiedModel:L=!1,theme:z="light",loading:R="Loading...",options:D={},height:G="100%",width:te="100%",className:M,wrapperProps:$={},beforeMount:V=Lt,onMount:ue=Lt}){let[ne,_e]=K.useState(!1),[ve,he]=K.useState(!0),re=K.useRef(null),ee=K.useRef(null),xe=K.useRef(null),Ae=K.useRef(ue),se=K.useRef(V),We=K.useRef(!1);ho(()=>{let J=co.init();return J.then(fe=>(ee.current=fe)&&he(!1)).catch(fe=>fe?.type!=="cancelation"&&console.error("Monaco initialization: error:",fe)),()=>re.current?Te():J.cancel()}),Fe(()=>{if(re.current&&ee.current){let J=re.current.getOriginalEditor(),fe=At(ee.current,s||"",y||d||"text",_||"");fe!==J.getModel()&&J.setModel(fe)}},[_],ne),Fe(()=>{if(re.current&&ee.current){let J=re.current.getModifiedEditor(),fe=At(ee.current,c||"",k||d||"text",C||"");fe!==J.getModel()&&J.setModel(fe)}},[C],ne),Fe(()=>{let J=re.current.getModifiedEditor();J.getOption(ee.current.editor.EditorOption.readOnly)?J.setValue(c||""):c!==J.getValue()&&(J.executeEdits("",[{range:J.getModel().getFullModelRange(),text:c||"",forceMoveMarkers:!0}]),J.pushUndoStop())},[c],ne),Fe(()=>{var J,fe;(fe=(J=re.current)==null?void 0:J.getModel())==null||fe.original.setValue(s||"")},[s],ne),Fe(()=>{let{original:J,modified:fe}=re.current.getModel();ee.current.editor.setModelLanguage(J,y||d||"text"),ee.current.editor.setModelLanguage(fe,k||d||"text")},[d,y,k],ne),Fe(()=>{var J;(J=ee.current)==null||J.editor.setTheme(z)},[z],ne),Fe(()=>{var J;(J=re.current)==null||J.updateOptions(D)},[D],ne);let Me=K.useCallback(()=>{var J;if(!ee.current)return;se.current(ee.current);let fe=At(ee.current,s||"",y||d||"text",_||""),Le=At(ee.current,c||"",k||d||"text",C||"");(J=re.current)==null||J.setModel({original:fe,modified:Le})},[d,c,k,s,y,_,C]),De=K.useCallback(()=>{var J;!We.current&&xe.current&&(re.current=ee.current.editor.createDiffEditor(xe.current,{automaticLayout:!0,...D}),Me(),(J=ee.current)==null||J.editor.setTheme(z),_e(!0),We.current=!0)},[D,z,Me]);K.useEffect(()=>{ne&&Ae.current(re.current,ee.current)},[ne]),K.useEffect(()=>{!ve&&!ne&&De()},[ve,ne,De]);function Te(){var J,fe,Le,Se;let Pe=(J=re.current)==null?void 0:J.getModel();P||(fe=Pe?.original)==null||fe.dispose(),L||(Le=Pe?.modified)==null||Le.dispose(),(Se=re.current)==null||Se.dispose()}return Ve.createElement(fo,{width:te,height:G,isEditorReady:ne,loading:R,_ref:xe,className:M,wrapperProps:$})}var ui=si;K.memo(ui);function li(s){let c=K.useRef();return K.useEffect(()=>{c.current=s},[s]),c.current}var ci=li,bn=new Map;function fi({defaultValue:s,defaultLanguage:c,defaultPath:d,value:y,language:k,path:_,theme:C="light",line:P,loading:L="Loading...",options:z={},overrideServices:R={},saveViewState:D=!0,keepCurrentModel:G=!1,width:te="100%",height:M="100%",className:$,wrapperProps:V={},beforeMount:ue=Lt,onMount:ne=Lt,onChange:_e,onValidate:ve=Lt}){let[he,re]=K.useState(!1),[ee,xe]=K.useState(!0),Ae=K.useRef(null),se=K.useRef(null),We=K.useRef(null),Me=K.useRef(ne),De=K.useRef(ue),Te=K.useRef(),J=K.useRef(y),fe=ci(_),Le=K.useRef(!1),Se=K.useRef(!1);ho(()=>{let H=co.init();return H.then(Z=>(Ae.current=Z)&&xe(!1)).catch(Z=>Z?.type!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>se.current?Be():H.cancel()}),Fe(()=>{var H,Z,ce,be;let ye=At(Ae.current,s||y||"",c||k||"",_||d||"");ye!==((H=se.current)==null?void 0:H.getModel())&&(D&&bn.set(fe,(Z=se.current)==null?void 0:Z.saveViewState()),(ce=se.current)==null||ce.setModel(ye),D&&((be=se.current)==null||be.restoreViewState(bn.get(_))))},[_],he),Fe(()=>{var H;(H=se.current)==null||H.updateOptions(z)},[z],he),Fe(()=>{!se.current||y===void 0||(se.current.getOption(Ae.current.editor.EditorOption.readOnly)?se.current.setValue(y):y!==se.current.getValue()&&(Se.current=!0,se.current.executeEdits("",[{range:se.current.getModel().getFullModelRange(),text:y,forceMoveMarkers:!0}]),se.current.pushUndoStop(),Se.current=!1))},[y],he),Fe(()=>{var H,Z;let ce=(H=se.current)==null?void 0:H.getModel();ce&&k&&((Z=Ae.current)==null||Z.editor.setModelLanguage(ce,k))},[k],he),Fe(()=>{var H;P!==void 0&&((H=se.current)==null||H.revealLine(P))},[P],he),Fe(()=>{var H;(H=Ae.current)==null||H.editor.setTheme(C)},[C],he);let Pe=K.useCallback(()=>{var H;if(!(!We.current||!Ae.current)&&!Le.current){De.current(Ae.current);let Z=_||d,ce=At(Ae.current,y||s||"",c||k||"",Z||"");se.current=(H=Ae.current)==null?void 0:H.editor.create(We.current,{model:ce,automaticLayout:!0,...z},R),D&&se.current.restoreViewState(bn.get(Z)),Ae.current.editor.setTheme(C),P!==void 0&&se.current.revealLine(P),re(!0),Le.current=!0}},[s,c,d,y,k,_,z,R,D,C,P]);K.useEffect(()=>{he&&Me.current(se.current,Ae.current)},[he]),K.useEffect(()=>{!ee&&!he&&Pe()},[ee,he,Pe]),J.current=y,K.useEffect(()=>{var H,Z;he&&_e&&((H=Te.current)==null||H.dispose(),Te.current=(Z=se.current)==null?void 0:Z.onDidChangeModelContent(ce=>{Se.current||_e(se.current.getValue(),ce)}))},[he,_e]),K.useEffect(()=>{if(he){let H=Ae.current.editor.onDidChangeMarkers(Z=>{var ce;let be=(ce=se.current.getModel())==null?void 0:ce.uri;if(be&&Z.find(ye=>ye.path===be.path)){let ye=Ae.current.editor.getModelMarkers({resource:be});ve?.(ye)}});return()=>{H?.dispose()}}return()=>{}},[he,ve]);function Be(){var H,Z;(H=Te.current)==null||H.dispose(),G?D&&bn.set(_,se.current.saveViewState()):(Z=se.current.getModel())==null||Z.dispose(),se.current.dispose()}return Ve.createElement(fo,{width:te,height:M,isEditorReady:he,loading:L,_ref:We,className:$,wrapperProps:V})}var di=fi,hi=K.memo(di),mo=hi;const pi=({open:s,onClose:c,decoded:d})=>{var y,k,_;if(!s)return null;const C=()=>{const L=JSON.stringify(d,null,2);navigator.clipboard.writeText(L).then(()=>{}).catch(z=>{console.error("Failed to copy JWT:",z)})},P=L=>L?new Date(L*1e3).toLocaleString():"N/A";return i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:c}),i.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 p-6 z-10",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("div",{className:"flex-shrink-0 bg-blue-100 rounded-full p-2",children:i.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 48 48",children:[i.jsx("polygon",{fill:"#546e7a",points:"21.906,31.772 24.507,29.048 27.107,31.772 27.107,43 21.906,43"}),i.jsx("polygon",{fill:"#f50057",points:"17.737,29.058 21.442,28.383 21.945,32.115 15.345,41.199 11.138,38.141"}),i.jsx("polygon",{fill:"#d500f9",points:"15.962,24.409 19.355,26.041 17.569,29.356 6.89,32.825 5.283,27.879"}),i.jsx("polygon",{fill:"#29b6f6",points:"17.256,19.607 19.042,22.922 15.649,24.554 4.97,21.084 6.577,16.137"}),i.jsx("polygon",{fill:"#00e5ff",points:"21.126,16.482 20.623,20.214 16.918,19.539 10.318,10.455 14.526,7.398"}),i.jsx("polygon",{fill:"#546e7a",points:"26.094,16.228 23.493,18.952 20.893,16.228 20.893,5 26.094,5"}),i.jsx("polygon",{fill:"#f50057",points:"30.262,18.943 26.558,19.618 26.055,15.886 32.654,6.802 36.862,9.859"}),i.jsx("polygon",{fill:"#d500f9",points:"32.039,23.59 28.645,21.958 30.431,18.643 41.11,15.174 42.717,20.12"}),i.jsx("polygon",{fill:"#29b6f6",points:"30.744,28.393 28.958,25.078 32.351,23.447 43.03,26.916 41.423,31.863"}),i.jsx("polygon",{fill:"#00e5ff",points:"26.874,31.518 27.378,27.786 31.082,28.461 37.682,37.545 33.474,40.602"})]})}),i.jsxs("div",{className:"ml-4",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Decoded JWT"}),i.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Below is the decoded JWT information."})]})]}),i.jsx("button",{onClick:c,className:"text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),i.jsxs("div",{className:"relative mt-4",children:[i.jsx("button",{onClick:C,className:"absolute top-2 right-2 z-10 cursor-pointer bg-gray-200 p-1 rounded hover:bg-gray-300",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:"w-5 h-5",children:i.jsx("path",{d:"M48.186 92.137c0-8.392 6.49-14.89 16.264-14.89s29.827-.225 29.827-.225-.306-6.99-.306-15.88c0-8.888 7.954-14.96 17.49-14.96 9.538 0 56.786.401 61.422.401 4.636 0 8.397 1.719 13.594 5.67 5.196 3.953 13.052 10.56 16.942 14.962 3.89 4.402 5.532 6.972 5.532 10.604 0 3.633 0 76.856-.06 85.34-.059 8.485-7.877 14.757-17.134 14.881-9.257.124-29.135.124-29.135.124s.466 6.275.466 15.15-8.106 15.811-17.317 16.056c-9.21.245-71.944-.49-80.884-.245-8.94.245-16.975-6.794-16.975-15.422s.274-93.175.274-101.566zm16.734 3.946l-1.152 92.853a3.96 3.96 0 0 0 3.958 4.012l73.913.22a3.865 3.865 0 0 0 3.91-3.978l-.218-8.892a1.988 1.988 0 0 0-2.046-1.953s-21.866.64-31.767.293c-9.902-.348-16.672-6.807-16.675-15.516-.003-8.709.003-69.142.003-69.142a1.989 1.989 0 0 0-2.007-1.993l-23.871.082a4.077 4.077 0 0 0-4.048 4.014zm106.508-35.258c-1.666-1.45-3.016-.84-3.016 1.372v17.255c0 1.106.894 2.007 1.997 2.013l20.868.101c2.204.011 2.641-1.156.976-2.606l-20.825-18.135zm-57.606.847a2.002 2.002 0 0 0-2.02 1.988l-.626 96.291a2.968 2.968 0 0 0 2.978 2.997l75.2-.186a2.054 2.054 0 0 0 2.044-2.012l1.268-62.421a1.951 1.951 0 0 0-1.96-2.004s-26.172.042-30.783.042c-4.611 0-7.535-2.222-7.535-6.482S152.3 63.92 152.3 63.92a2.033 2.033 0 0 0-2.015-2.018l-36.464-.23z",stroke:"#979797",fillRule:"evenodd"})})}),i.jsx("pre",{className:"bg-gray-100 p-2 rounded text-xs text-gray-700 overflow-x-auto",children:JSON.stringify(d,null,2)}),d&&i.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[((y=d?.payload)==null?void 0:y.iat)&&i.jsxs("p",{children:["Issued At (iat): ",P(d.payload.iat)]}),((k=d?.payload)==null?void 0:k.nbf)&&i.jsxs("p",{children:["Not Before (nbf): ",P(d.payload.nbf)]}),((_=d?.payload)==null?void 0:_.exp)&&i.jsxs("p",{children:["Expires At (exp): ",P(d.payload.exp)]})]})]}),i.jsx("div",{className:"mt-6 flex justify-end",children:i.jsx("button",{onClick:c,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Close"})})]})]})},ao=s=>{let c=s.replace(/-/g,"+").replace(/_/g,"/");for(;c.length%4;)c+="=";return c},mi=s=>{try{const c=s.split(".");if(c.length!==3)return null;const d=JSON.parse(atob(ao(c[0]))),y=JSON.parse(atob(ao(c[1])));return{header:d,payload:y,signature:c[2]}}catch(c){return console.error("Failed to decode JWT:",c),null}},yi=s=>typeof s!="string"?!1:((s.startsWith("Bearer ")||s.startsWith("bearer "))&&(s=s.slice(7).trim()),/^[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+$/.test(s)),gi=({request:s})=>{const[c,d]=K.useState(!1),[y,k]=K.useState(!1),[_,C]=K.useState(!1),[P,L]=K.useState(null),z=M=>{const $=M.startsWith("Bearer ")||M.startsWith("bearer ")?M.slice(7).trim():M,V=mi($);V&&(L(V),C(!0))},R=M=>Object.entries(M||{}).map(([$,V])=>i.jsxs("tr",{children:[i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:$}),i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:i.jsxs("div",{className:"flex flex-wrap items-center",children:[i.jsx("span",{className:"min-w-0 break-all flex-1",children:V}),yi(V)&&i.jsx("button",{onClick:()=>z(V),className:"ml-2 p-1 text-blue-500 text-xs border border-slate-600 rounded cursor-pointer",children:i.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 48 48",children:[i.jsx("polygon",{fill:"#546e7a",points:"21.906,31.772 24.507,29.048 27.107,31.772 27.107,43 21.906,43"}),i.jsx("polygon",{fill:"#f50057",points:"17.737,29.058 21.442,28.383 21.945,32.115 15.345,41.199 11.138,38.141"}),i.jsx("polygon",{fill:"#d500f9",points:"15.962,24.409 19.355,26.041 17.569,29.356 6.89,32.825 5.283,27.879"}),i.jsx("polygon",{fill:"#29b6f6",points:"17.256,19.607 19.042,22.922 15.649,24.554 4.97,21.084 6.577,16.137"}),i.jsx("polygon",{fill:"#00e5ff",points:"21.126,16.482 20.623,20.214 16.918,19.539 10.318,10.455 14.526,7.398"}),i.jsx("polygon",{fill:"#546e7a",points:"26.094,16.228 23.493,18.952 20.893,16.228 20.893,5 26.094,5"}),i.jsx("polygon",{fill:"#f50057",points:"30.262,18.943 26.558,19.618 26.055,15.886 32.654,6.802 36.862,9.859"}),i.jsx("polygon",{fill:"#d500f9",points:"32.039,23.59 28.645,21.958 30.431,18.643 41.11,15.174 42.717,20.12"}),i.jsx("polygon",{fill:"#29b6f6",points:"30.744,28.393 28.958,25.078 32.351,23.447 43.03,26.916 41.423,31.863"}),i.jsx("polygon",{fill:"#00e5ff",points:"26.874,31.518 27.378,27.786 31.082,28.461 37.682,37.545 33.474,40.602"})]})})]})})]},$)),D=s.request.payload,G=!D||typeof D=="object"&&Object.keys(D).length===0||typeof D=="string"&&(D.trim()===""||D.trim()==="{}"),te=M=>{try{const $=JSON.parse(M);return JSON.stringify($,null,2)}catch{return M}};return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>d(!c),children:["Query Parameters (",Object.keys(s.request.queryParams||{}).length,")"]}),c&&i.jsx("div",{className:"p-0",children:i.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-gray-100",children:[i.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Key"}),i.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),i.jsx("tbody",{children:R(s.request.queryParams)})]})})]}),i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>k(!y),children:["Headers (",Object.keys(s.request.headers||{}).length,")"]}),y&&i.jsx("div",{className:"p-0",children:i.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-gray-100",children:[i.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),i.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),i.jsx("tbody",{children:R(s.request.headers)})]})})]}),i.jsxs("div",{children:[i.jsx("button",{className:"w-full p-2 text-left font-bold bg-gray-200",children:"Request Body"}),G?i.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:"No payload"}):i.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:i.jsx(mo,{height:"100%",defaultLanguage:"json",value:te(D),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]}),i.jsx(pi,{open:_,decoded:P,onClose:()=>{C(!1),L(null)}})]})},vi=({request:s})=>{const[c,d]=K.useState(!1),y=P=>Object.entries(P||{}).map(([L,z])=>i.jsxs("tr",{children:[i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:L}),i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:z})]},L)),k=s.response.payload,_=!k||typeof k=="object"&&Object.keys(k).length===0||typeof k=="string"&&(k.trim()===""||k.trim()==="{}"),C=P=>{try{const L=JSON.parse(P);return JSON.stringify(L,null,2)}catch{return P}};return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>d(!c),children:["Headers (",Object.keys(s.response.headers||{}).length,")"]}),c&&i.jsx("div",{className:"p-0",children:i.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-gray-100",children:[i.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),i.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),i.jsx("tbody",{children:y(s.response.headers)})]})})]}),i.jsxs("div",{children:[i.jsx("button",{className:"w-full p-2 text-left font-bold bg-gray-200",children:"Response Body"}),_?i.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:"No payload"}):i.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:i.jsx(mo,{height:"100%",defaultLanguage:"json",value:C(k),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},bi=({request:s,currentTab:c,setCurrentTab:d})=>s?i.jsxs("div",{children:[i.jsx(ua,{request:s}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("button",{className:`px-4 py-2 rounded-t ${c==="request"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>d("request"),children:"Request"}),i.jsx("button",{className:`px-4 py-2 rounded-t ${c==="response"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>d("response"),children:"Response"})]}),i.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:c==="request"?i.jsx(gi,{request:s}):i.jsx(vi,{request:s})})]}):i.jsx("div",{className:"text-gray-500",children:"No request selected."}),xi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACHxJREFUeJztnX+MFGcdxiul8UWMcECtlSIcR+GKYKsHhTu9dsQr9PhxV+TSEtTYVqXVHnD9AZWWhkG7tY1pY2uUtrYRQhZbTyC1Ftyilhg1Ri0Ww4gh1pomeze3O8ZaClZ68PoZ50gu6+zdLjd732FmnuT5j5DvPJ/bfZ93fu155yVKlChRokSJEg1FatLssXi09ByxE6FfjHfjU/g/+HE8TnquWKgv/D9jXeCf4irp+SItAj4f/9wn/DN+EL9Les7IinCXDxC+63/ij0vPGUn1LbivDQLA9Y+lZ42kCPZ6fLoEACdxrfS8kZL7vY5/XUL4Z7xVeuZIiUA/XOJf/xn/FV8kPXdkRJj3lBG+7tsffEF67kjI3ekOUj0zuAVfjtfg7/R5pfTskRBBzsJvFQn/V8kOOAARosL34tfxOwU+VST8N8ZMr7+sPe3svW27o295Kq+/uDWvb3o0rz/3zbxe9UCu5wYzd1/bppySPr7QizDvxr1lfs9/a+0zPW3tO53TRQBoAPSuuDe3Qfr4Qi/C/FuZ4b9dbXxm0rrO/CsA0AMA0CvuyR2VPr7Qi0APlQng+Y5dzlUA6C0BwEHp4wu9CPQ6/O8yKuaC23c7z3V05vUgAE7wFbRU+vhCL+XtdJvwdvzDfn7VB0AWV92xx+kEQAYAGQBkAJABQAYAGQBkAPAsABayCCdnR89Gyjv1/CMfADukZ4uFCHoC/pMPgOukZ4uFCLq2yLpwofRssRBBf8on/C7puWIjwr7ZB8A+6bnOSRHceHxbvxNlpfi3PgA2r3/BWXXX806aFpSmBaVpQWlaUJoWlKYFpWlBaVpQmhaUpgWlP70xt6P1ztz2pWty3792dc/TTTf1PGWssp9obLO/29Bq3zJ/iT1WOp+Kqq/NfK/MjVYxLwTAcwDQANAl7AP0io05DQANAA0ADQANAA0AXd9i63nN9qNzmrqjW1UJ7WP4HwGEfxxXA+BokACuvNa2ATBdOqeKidDq8b8CAJB979S6KgCcCBhAHgCzpHOqmAjuAnfxDADA4TWdr05av9fRAX8F7QLACOmcKirCm4ifxFaJdk9BFJ6e3r9hnzMTABYALABYALAAYAHAAoAFAAsAFgAsAFgAsABgAcACgAUACwAWACwAHG5osR+bv9hOrh0XirAb8JsFALZJzxUbEXaz8m667Q/gIem5YiPCXumzBrRLzxUbEfZXfAC0Ss8VGxH2Rh8Ac6XnCq2Ud0FlKV6Nbw3AewsBjJ919bS7M85aWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSY11GQfYNYt6DYvb+w2Z9d3mTPndJkzrugyp83KbqqpzS6fOj0b7oqqvLuW9wfQ8wf08vs7xwLgtaD3AQDQANAA0ADQANAA0ADQANDVl2ZfnDItO0Y656IinDZV3n2bZ+Newq/CWQEAp6fUZJdL51xUbjup9F8/zhP+hTgnAEBPrsneKp1zURHOlfjtCgPIEf4HsCMA4ASfgI9K51xUyjvd3KG8uxUqBeB1wp+Mjw0zgC4AtLMGnC+d87CKwDsLAFjl/h8rv54bCYCLADCh5c7cOABULVrd8z4AjAbAKAC8u6HFvgAAIyJ9PeBspLx7goYEINEQlAAQVgJAWAmAsxAhVeGpATnj04IUbqQFGbQggxZk0IIMWpBBCzJoQQYtyKAFGbQggxZksAgbLMIGLchgETZoQQaLsMEibLAIG7Qgg0XYoAUZtCCDFmTQggxakEELMmouy1ZL5zqolPd0y2Oq/Acsyt0HTMHHh7mGnqaGPk0NHSWdc1Ep767mSoZ/BsCH8JsCG7FeNmKLpHMuKsJZW+HwXR8j/PcLnoq4QzrnoiKcxcPwCdCEPwHbAgBO8QkI70MehDMKb1XFn2YMxPU3b5kIgL8LANjOGhD+t3IR0iX4amwE4G2FAMbWNkwHwPwht6Ab7QUAuAYATQBYAIBPFm1BtdkZ0rmKSHmPrRZ+Cj4hPVdsRNhf9gFwg/RcsZEbtg+Au6Tnio0Ie5H6/4s8j0jPFRsp/zuq09JznbMivDr88hCr6Esb9jl1QdbQhhb70LzF9jzpfCoqghuDfx/AXuDI6m2vXBL4PqDZ/sOcpu7w3nYyVBFcIz4WAAAbj1//gnM84I3YMQA0SudUMSnvfW+5AAC4zwzXAOBIwAB6ADBTOqeKiuA2K+91kkOFsAQAewIE8M68ZnuLdD4Vl/KuGSzs2+GaJfpFHwApACwBQAoAKQCkAJACQAoAKQCkAJACwP0A+BoAtgxwb+jmhlZ72fwldnjP9UuKsG/0AfAz6bliI8K+ygeAu5Yk9/AMhwj6UuX/tsQPSs8WCxH0OHzQB8D10rPFQgQ9Aj/jA+BZ6dkiJ0IdqbwbfN3TFf2fF/Z7xcH/NmS0oF8O8pzwQVpQR9um3Ejp4wu9lPeMQanXld2HQZpv3+38oIR9gPve0C9JH1/oRaBHy9yQZTp2OXPXdeZPlvDaykPSxxd6EeiRMgGcvHjusskA+F0JAF6WPr7Qi0BX4RNlQtjavrO7GQC9g7w3tE36+EIv5T1ls0x5L/TYVuCXigB4a3R13Ufa087DADgAgAMAOACAXwBgf98bs1pZhOP1dEvQIugZ+I0iEP6IJ/b7t251na28W1vC+1zXuSTl3fj1kwG+in6DP4+vwd/APcp7u9bj0rNHRoS5rsz1wf3dgc9Kzx0ZEWZNGfsE139RyS9rBCvl/VZkqQCSW1iClvJeBlLKDcDupctJ0vNGTsr7NaXDJQDYKT1rZKW8p3EGejGI24CukJ4zsurr+XsGAPBV6RkjL+VdqPG70WsHfo/0fLGQ8h6J/bbyzh/l8X0q+W354ZdKLtAnSpQoUaJEicrRfwFj5g/5zsKE0wAAAABJRU5ErkJggg==",wi=({apiEndpoint:s,setApiEndpoint:c,isConnected:d,accessCode:y,setAccessCode:k,channel:_,setChannel:C,onRegister:P})=>{const[L,z]=K.useState(!1),[R,D]=K.useState(s),[G,te]=K.useState(y),[M,$]=K.useState(_);K.useEffect(()=>{D(s),te(y),$(_)},[s,y,_]),K.useEffect(()=>{if(typeof window<"u"){const ne=localStorage.getItem("apiEndpoint")||window.location.origin+"/api";D(ne),c(ne)}},[c]);const V=()=>{typeof window<"u"&&localStorage.setItem("apiEndpoint",R),c(R)},ue=()=>{typeof window<"u"&&(localStorage.setItem("accessCode",G),localStorage.setItem("channel",M)),k(G),C(M),P(G,M,!0)};return i.jsxs("div",{className:"fixed bottom-0 left-0 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none",onClick:()=>z(ne=>!ne),children:[i.jsx("div",{className:"flex items-center gap-4",children:i.jsxs("span",{className:`px-2 py-1 rounded-full text-xs font-semibold flex items-center ${d?"bg-green-500 text-white":"bg-red-500"}`,children:[i.jsx("span",{className:`w-2 h-2 rounded-full mr-1 ${d?"bg-green-800":"bg-red-800"}`}),d?"Connected":"Disconnected"]})}),i.jsxs("a",{href:"https://github.com/thim81/inspectr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",onClick:ne=>ne.stopPropagation(),children:[i.jsx("img",{src:xi,alt:"Inspectr Logo",className:"h-6"}),i.jsx("span",{className:"text-gray-700 font-semibold text-sm",children:"Inspectr"})]})]}),i.jsx("div",{className:`bg-gray-100 border-t border-gray-300 transition-all duration-300 overflow-hidden ${L?"max-h-96 opacity-100 py-4":"max-h-0 opacity-0 py-0"}`,children:i.jsxs("div",{className:"px-6",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Configuration"}),i.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Inspectr API Endpoint"}),i.jsx("input",{type:"text",placeholder:"Enter API Endpoint...",value:R,onChange:ne=>D(ne.target.value),className:"w-full border bg-white border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("button",{onClick:V,className:"mt-2 bg-blue-600 text-white px-4 py-2 rounded-md",children:"Save"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Channel"}),i.jsx("input",{type:"text",placeholder:"Enter Channel...",value:M,onChange:ne=>$(ne.target.value),className:"w-full bg-white border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("button",{onClick:ue,className:"mt-2 bg-green-600 text-white px-4 py-2 rounded-md",children:"Register"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Access Code"}),i.jsx("input",{type:"text",placeholder:"Enter Access Code...",value:G,onChange:ne=>te(ne.target.value),className:"w-full border bg-white border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})})]})};class ji{constructor(){this.db=new wn("InspectrDB"),this.db.version(1).stores({events:"id, time, method, statusCode, path, latency, server"})}transformEvent(c){var d;const{id:y,time:k,data:_}=c;return{id:y,time:k,method:_.method,url:_.url,server:_.server,path:_.path,clientIp:_.clientIp,latency:_.latency,statusCode:(d=_.response)==null?void 0:d.statusCode,raw:c}}async upsertEvent(c){const d=this.transformEvent(c);return await this.db.events.put(d)}async deleteEvent(c){return await this.db.events.delete(c)}async getEvent(c){return await this.db.events.get(c)}async queryEvents(c={}){const{filters:d={},sort:y={field:"time",order:"desc"},page:k=1,pageSize:_=20}=c;let C=this.db.events.toCollection();if(d.timestampRange){if(typeof d.timestampRange=="string"){let R=new Date;switch(d.timestampRange){case"15M":R.setMinutes(R.getMinutes()-15);break;case"30M":R.setMinutes(R.getMinutes()-30);break;case"1H":R.setHours(R.getHours()-1);break;case"3H":R.setHours(R.getHours()-3);break;case"6H":R.setHours(R.getHours()-6);break;case"12H":R.setHours(R.getHours()-12);break;case"24H":R.setHours(R.getHours()-24);break;case"48H":R.setHours(R.getHours()-48);break;case"week":R.setDate(R.getDate()-7);break;case"month":R.setMonth(R.getMonth()-1);break}C=C.filter(D=>new Date(D.time)>=R)}else if(typeof d.timestampRange=="object"){if(d.timestampRange.start&&d.timestampRange.end){const R=new Date(d.timestampRange.start),D=new Date(d.timestampRange.end);C=C.filter(G=>{const te=new Date(G.time);return te>=R&&te<=D})}else if(d.timestampRange.start){const R=new Date(d.timestampRange.start);C=C.filter(D=>new Date(D.time)>=R)}else if(d.timestampRange.end){const R=new Date(d.timestampRange.end);C=C.filter(D=>new Date(D.time)<=R)}}}if(d.status&&Array.isArray(d.status)&&d.status.length>0&&(C=C.filter(R=>d.status.includes(String(R.statusCode)))),d.method&&Array.isArray(d.method)&&d.method.length>0){const R=d.method.map(D=>D.toLowerCase());C=C.filter(D=>R.includes(D.method.toLowerCase()))}d.path&&(C=C.filter(R=>R.path.includes(d.path))),d.durationMin&&(C=C.filter(R=>Number(R.latency)>=Number(d.durationMin))),d.durationMax&&(C=C.filter(R=>Number(R.latency)<=Number(d.durationMax))),d.host&&(C=C.filter(R=>R.server.toLowerCase().includes(d.host.toLowerCase())));let P;if(typeof C.orderBy=="function")try{P=C.orderBy(y.field),y.order==="desc"&&(P=P.reverse())}catch(R){console.error("[EventDB] orderBy error, fallback sorting:",R),P=(await C.toArray()).sort((D,G)=>{const te=y.field;return D[te]<G[te]?y.order==="asc"?-1:1:D[te]>G[te]?y.order==="asc"?1:-1:0})}else P=(await C.toArray()).sort((R,D)=>{const G=y.field;return R[G]<D[G]?y.order==="asc"?-1:1:R[G]>D[G]?y.order==="asc"?1:-1:0});const L=(k-1)*_;let z;return Array.isArray(P)?z=P.slice(L,L+_):typeof P.offset=="function"?z=await P.offset(L).limit(_).toArray():z=[],z.map(R=>({id:R.id,...R.raw.data}))}async clearEvents(){return await this.db.events.clear()}}const mt=new ji,ki=typeof window<"u"&&window.location.hostname==="localhost",qi=({apiEndpoint:s="/api"})=>{const[c,d]=K.useState(null),[y,k]=K.useState("request"),[_,C]=K.useState(s),[P,L]=K.useState(!1),[z,R]=K.useState(""),[D,G]=K.useState(""),[te,M]=K.useState(""),[$,V]=K.useState(""),[ue,ne]=K.useState(!1),[_e,ve]=K.useState(null),he=100,[re,ee]=K.useState(1),[xe,Ae]=K.useState("time"),[se,We]=K.useState("desc"),[Me,De]=K.useState({}),Te=Zr(()=>mt.queryEvents({sort:{field:xe,order:se},filters:Me,page:re,pageSize:he}),[re,xe,se,Me]),J=Zr(()=>mt.db.events.count(),[]),fe=J?Math.ceil(J/he):1;K.useEffect(()=>{if(typeof window>"u")return;const H=new URLSearchParams(window.location.search),Z=H.get("accessCode"),ce=H.get("channel"),be=H.get("token");if(Z||ce||be)console.log("🔍 Found credentials in query params"),Z&&(G(Z),localStorage.setItem("accessCode",Z)),ce&&(M(ce),localStorage.setItem("channel",ce)),be&&(V(be),localStorage.setItem("token",be)),window.history.replaceState({},"",`${window.location.pathname}${H.toString()?"?"+H.toString():""}`);else{const ye=localStorage.getItem("accessCode"),pe=localStorage.getItem("channel"),yt=localStorage.getItem("token");ye&&pe&&yt?(console.log("✅ Using stored credentials from localStorage"),G(ye),M(pe),V(yt)):ki&&(console.log("🔄 Fetching /app/config (Localhost, No credentials found)"),fetch("/app/config").then(we=>we.json()).then(we=>{we!=null&&we.token&&we!=null&&we.sse_endpoint&&we!=null&&we.access_code&&(console.log("✅ Loaded from /app/config:",we),G(we.access_code),localStorage.setItem("accessCode",we.access_code),M(we.channel),localStorage.setItem("channel",we.channel),V(we.token),localStorage.setItem("token",we.token),R(we.sse_endpoint),localStorage.setItem("sseEndpoint",we.sse_endpoint))}).catch(we=>console.error("❌ Failed to load /app/config:",we)))}ne(!0)},[]),K.useEffect(()=>{ue&&(console.log("🔄 Auto-registering with stored credentials:",te,D),te&&D?Le(D,te):console.log("⚠️ Missing credentials for auto-registration, skipping."))},[ue,te,D]);const Le=async(H=D,Z=te,ce=$,be)=>{try{let ye={};H&&Z?ye={channel:Z,access_code:H}:ce&&(ye={token:ce}),console.log("📤 Registering with:",ye);const pe=await(await fetch(`${_}/register`,{method:"POST",headers:{"Content-Type":"application/json","x-inspectr-client":"inspectr-app"},body:JSON.stringify(ye)})).json();pe!=null&&pe.token&&pe!=null&&pe.sse_endpoint&&pe!=null&&pe.access_code?(console.log("✅ Registration successful"),G(pe.access_code),localStorage.setItem("accessCode",pe.access_code),M(pe.channel),localStorage.setItem("channel",pe.channel),V(pe.token),localStorage.setItem("token",pe.token),R(pe.sse_endpoint),localStorage.setItem("sseEndpoint",pe.sse_endpoint),be&&ve({message:"Registration Successful",subMessage:"Your channel and access code have been registered."})):(console.error("❌ Registration failed:",pe),ve({message:"Registration Failed",subMessage:"Please check your channel and access code.",type:"error"}))}catch(ye){console.error("❌ Registration error:",ye),ve({message:"Registration Error",subMessage:ye.message||"An error occurred during registration.",type:"error"})}};K.useEffect(()=>{if(!z)return;const H=()=>`req-${Math.random().toString(36).substr(2,9)}`,Z=new EventSource(z);return console.log(`Inspectr EventSource created with URL: ${z}`),Z.onopen=()=>{console.log("SSE Inspectr connection opened"),L(!0)},Z.onmessage=ce=>{try{const be=JSON.parse(ce.data);be.id||(be.id=H()),mt.upsertEvent(be).catch(ye=>console.error("Error saving event to DB:",ye))}catch(be){console.error("Error parsing SSE Inspectr data:",be)}},Z.onerror=ce=>{console.error("SSE Inspectr error:",ce),L(!1)},()=>{console.log("Closing Inspectr EventSource"),Z.close(),L(!1)}},[z]),K.useEffect(()=>{!c&&Te&&Te.length>0&&d(Te[0])},[Te,c]);const Se=()=>{d(null),mt.clearEvents().catch(H=>console.error("Error clearing events from DB:",H))},Pe=async()=>{try{const H=await mt.queryEvents({filters:Me,sort:{field:"time",order:"desc"},page:1,pageSize:Number.MAX_SAFE_INTEGER});await Promise.all(H.map(Z=>mt.deleteEvent(Z.id))),c&&H.some(Z=>Z.id===c.id)&&d(null)}catch(H){console.error("Error clearing filtered requests:",H)}},Be=H=>{c&&(c.id||"")===H&&d(null),mt.deleteEvent(H).catch(Z=>console.error("Error deleting event from DB:",Z))};return i.jsxs("div",{className:"flex flex-col h-screen",children:[i.jsxs("div",{className:"flex flex-grow",children:[i.jsx("div",{className:"w-1/3 border-r border-gray-300 overflow-y-auto",children:i.jsx(sa,{requests:Te||[],onSelect:d,onRemove:Be,clearRequests:Se,clearFilteredRequests:Pe,selectedRequest:c,currentPage:re,totalPages:fe,totalCount:J||0,onPageChange:ee,sortField:xe,sortDirection:se,filters:Me,setSortField:Ae,setSortDirection:We,setFilters:De})}),i.jsx("div",{className:"w-2/3 p-4",children:i.jsx(bi,{request:c,currentTab:y,setCurrentTab:k})})]}),i.jsx(wi,{apiEndpoint:_,setApiEndpoint:C,isConnected:P,accessCode:D,setAccessCode:G,channel:te,setChannel:M,onRegister:Le}),_e&&i.jsx(xn,{message:_e.message,subMessage:_e.subMessage,type:_e.type,onClose:()=>ve(null)})]})};export{qi as InspectrApp};
|
package/dist/index.html
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" data-astro-cid-sckkx6r4> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width"><link rel="icon" type="image/icon" href="/favicon.ico"><meta name="description" content="Inspectr – Simplifying API and Webhook debugging"><title>Inspectr</title><link rel="stylesheet" href="/_astro/index.
|
|
1
|
+
<!DOCTYPE html><html lang="en" data-astro-cid-sckkx6r4> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width"><link rel="icon" type="image/icon" href="/favicon.ico"><meta name="description" content="Inspectr – Simplifying API and Webhook debugging"><title>Inspectr</title><link rel="stylesheet" href="/_astro/index.DkFoYwcI.css"></head> <body data-astro-cid-sckkx6r4> <style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event("astro:load"));})();;(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,"Component");d(this,"hydrator");d(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},h=this.querySelectorAll("template[data-astro-template]");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let p;try{p=this.hasAttribute("props")?m(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute("props"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});d(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[h,{default:p}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),u=this.getAttribute("component-export")||"default";if(!u.includes("."))this.Component=h[u];else{this.Component=h;for(let f of u.split("."))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute("component-url")}`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",y)}})();</script><astro-island uid="25Iyi8" prefix="r0" component-url="/_astro/ui.Ct8_qMBH.js" component-export="InspectrApp" renderer-url="/_astro/client.DghpSMxZ.js" props="{}" ssr client="load" opts="{"name":"InspectrApp","value":true}" await-children><div class="flex flex-col h-screen"><div class="flex flex-grow"><div class="w-1/3 border-r border-gray-300 overflow-y-auto"><div class="flex flex-col h-full relative"><div class="p-4 flex justify-between items-center"><span class="font-bold text-xl">Requests (<!-- -->0<!-- --> of <!-- -->0<!-- -->)</span><div class="space-x-2 relative"><button class="relative px-3 py-1 rounded text-xs cursor-pointer bg-blue-500 text-white"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-white"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"></path></svg></button><button class="px-3 py-1 bg-red-500 text-white rounded text-xs cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-white"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"></path></svg></button></div></div><div class="flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold cursor-pointer"><div class="w-16 text-center">Status</div><div class="w-20 text-center">Method</div><div class="flex-grow text-left">Path</div><div class="w-20 text-center">Duration</div><div class="w-10"></div></div><ul class="overflow-y-auto flex-grow" style="max-height:calc(100vh - 40px - 100px - 49px)"></ul><nav class="p-2 border-t border-gray-300"><ul class="flex items-center justify-center -space-x-px h-8 text-sm"><li><button disabled="" class="flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer"><span class="sr-only">Previous</span><svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 1 1 5l4 4"></path></svg></button></li><li><button class="z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white cursor-pointer">1</button></li><li><button disabled="" class="flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer"><span class="sr-only">Next</span><svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 9 4-4-4-4"></path></svg></button></li></ul></nav><div class="fixed top-0 left-0 h-full w-100 bg-white shadow-xl transform transition-transform duration-300
|
|
2
2
|
-translate-x-full
|
|
3
|
-
" style="z-index:9999"><div class="flex items-center justify-between px-4 py-3 border-b border-gray-300 bg-gray-50"><h2 class="pl-4 text-lg font-semibold text-gray-800">Filter & Sort</h2><button class="text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer" aria-label="Close">×</button></div><div class="p-4 overflow-y-auto h-full"><section class="mb-6 ml-4 mr-4"><div class="flex items-center justify-between"><h3 class="mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide">Sort By</h3><button class="text-xs text-blue-600 hover:underline cursor-pointer">Reset</button></div><div class="space-y-3"><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" checked="" value="time"/><span class="ml-3 text-gray-700">Timestamp</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" value="statusCode"/><span class="ml-3 text-gray-700">Status</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" value="method"/><span class="ml-3 text-gray-700">Method</span></label></div><div class="mt-4"><h4 class="mb-2 text-xs font-bold text-gray-600 uppercase tracking-wide">Sort Direction</h4><div class="space-y-3"><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortDirection" value="asc"/><span class="ml-3 text-gray-700">Ascending</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortDirection" checked="" value="desc"/><span class="ml-3 text-gray-700">Descending</span></label></div></div></section><section class="mb-6 ml-4 mr-4"><div class="flex items-center justify-between"><h3 class="mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide">Filters</h3><button class="text-xs text-blue-600 hover:underline cursor-pointer">Reset</button></div><div class="space-y-4"><div><label class="block text-sm font-medium text-gray-700 mb-1">
|
|
3
|
+
" style="z-index:9999"><div class="flex items-center justify-between px-4 py-3 border-b border-gray-300 bg-gray-50"><h2 class="pl-4 text-lg font-semibold text-gray-800">Filter & Sort</h2><button class="text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer" aria-label="Close">×</button></div><div class="p-4 overflow-y-auto h-full"><section class="mb-6 ml-4 mr-4"><div class="flex items-center justify-between"><h3 class="mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide">Sort By</h3><button class="text-xs text-blue-600 hover:underline cursor-pointer">Reset</button></div><div class="space-y-3"><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" checked="" value="time"/><span class="ml-3 text-gray-700">Timestamp</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" value="statusCode"/><span class="ml-3 text-gray-700">Status</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" value="method"/><span class="ml-3 text-gray-700">Method</span></label></div><div class="mt-4"><h4 class="mb-2 text-xs font-bold text-gray-600 uppercase tracking-wide">Sort Direction</h4><div class="space-y-3"><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortDirection" value="asc"/><span class="ml-3 text-gray-700">Ascending</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortDirection" checked="" value="desc"/><span class="ml-3 text-gray-700">Descending</span></label></div></div></section><section class="mb-6 ml-4 mr-4"><div class="flex items-center justify-between"><h3 class="mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide">Filters</h3><button class="text-xs text-blue-600 hover:underline cursor-pointer">Reset</button></div><div class="space-y-4"><div><label class="block text-sm font-medium text-gray-700 mb-1">Quick Time Range</label><select class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"><option value="" selected="">Any</option><option value="15M">Last 15 minutes</option><option value="30M">Last 30 minutes</option><option value="1H">Last 1 hour</option><option value="3H">Last 3 hours</option><option value="6H">Last 6 hours</option><option value="12H">Last 12 hours</option><option value="24H">Last 24 hours</option><option value="48H">Last 2 days</option><option value="week">Last Week</option><option value="month">Last Month</option></select></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Specific Time Range</label><div class="flex space-x-2"><input type="datetime-local" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/><input type="datetime-local" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Status</label><div class="w-full max-w-md relative"><div class="flex flex-wrap items-center border border-gray-300 rounded-md shadow-sm px-2 py-1"><input type="text" class="flex-grow outline-none p-1" placeholder="Add status code..." value=""/></div></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Method</label><div class="w-full max-w-md relative"><div class="flex flex-wrap items-center border border-gray-300 rounded-md shadow-sm px-2 py-1"><input type="text" class="flex-grow outline-none p-1" placeholder="Add method..." value=""/></div></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Path</label><input type="text" placeholder="e.g. /api/users" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Duration (ms)</label><div class="flex space-x-2"><input type="number" placeholder="Min" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/><input type="number" placeholder="Max" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Host</label><input type="text" placeholder="e.g. localhost" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div></section></div></div></div></div><div class="w-2/3 p-4"><div class="text-gray-500">No request selected.</div></div></div><div class="fixed bottom-0 left-0 w-full"><div class="flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none"><div class="flex items-center gap-4"><span class="px-2 py-1 rounded-full text-xs font-semibold flex items-center bg-red-500"><span class="w-2 h-2 rounded-full mr-1 bg-red-800"></span>Disconnected</span></div><a href="https://github.com/thim81/inspectr" target="_blank" rel="noopener noreferrer" class="flex items-center gap-2"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACHxJREFUeJztnX+MFGcdxiul8UWMcECtlSIcR+GKYKsHhTu9dsQr9PhxV+TSEtTYVqXVHnD9AZWWhkG7tY1pY2uUtrYRQhZbTyC1Ftyilhg1Ri0Ww4gh1pomeze3O8ZaClZ68PoZ50gu6+zdLjd732FmnuT5j5DvPJ/bfZ93fu155yVKlChRokSJEg1FatLssXi09ByxE6FfjHfjU/g/+HE8TnquWKgv/D9jXeCf4irp+SItAj4f/9wn/DN+EL9Les7IinCXDxC+63/ij0vPGUn1LbivDQLA9Y+lZ42kCPZ6fLoEACdxrfS8kZL7vY5/XUL4Z7xVeuZIiUA/XOJf/xn/FV8kPXdkRJj3lBG+7tsffEF67kjI3ekOUj0zuAVfjtfg7/R5pfTskRBBzsJvFQn/V8kOOAARosL34tfxOwU+VST8N8ZMr7+sPe3svW27o295Kq+/uDWvb3o0rz/3zbxe9UCu5wYzd1/bppySPr7QizDvxr1lfs9/a+0zPW3tO53TRQBoAPSuuDe3Qfr4Qi/C/FuZ4b9dbXxm0rrO/CsA0AMA0CvuyR2VPr7Qi0APlQng+Y5dzlUA6C0BwEHp4wu9CPQ6/O8yKuaC23c7z3V05vUgAE7wFbRU+vhCL+XtdJvwdvzDfn7VB0AWV92xx+kEQAYAGQBkAJABQAYAGQBkAPAsABayCCdnR89Gyjv1/CMfADukZ4uFCHoC/pMPgOukZ4uFCLq2yLpwofRssRBBf8on/C7puWIjwr7ZB8A+6bnOSRHceHxbvxNlpfi3PgA2r3/BWXXX806aFpSmBaVpQWlaUJoWlKYFpWlBaVpQmhaUpgWlP70xt6P1ztz2pWty3792dc/TTTf1PGWssp9obLO/29Bq3zJ/iT1WOp+Kqq/NfK/MjVYxLwTAcwDQANAl7AP0io05DQANAA0ADQANAA0AXd9i63nN9qNzmrqjW1UJ7WP4HwGEfxxXA+BokACuvNa2ATBdOqeKidDq8b8CAJB979S6KgCcCBhAHgCzpHOqmAjuAnfxDADA4TWdr05av9fRAX8F7QLACOmcKirCm4ifxFaJdk9BFJ6e3r9hnzMTABYALABYALAAYAHAAoAFAAsAFgAsAFgAsABgAcACgAUACwAWACwAHG5osR+bv9hOrh0XirAb8JsFALZJzxUbEXaz8m667Q/gIem5YiPCXumzBrRLzxUbEfZXfAC0Ss8VGxH2Rh8Ac6XnCq2Ud0FlKV6Nbw3AewsBjJ919bS7M85aWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSY11GQfYNYt6DYvb+w2Z9d3mTPndJkzrugyp83KbqqpzS6fOj0b7oqqvLuW9wfQ8wf08vs7xwLgtaD3AQDQANAA0ADQANAA0ADQANDVl2ZfnDItO0Y656IinDZV3n2bZ+Newq/CWQEAp6fUZJdL51xUbjup9F8/zhP+hTgnAEBPrsneKp1zURHOlfjtCgPIEf4HsCMA4ASfgI9K51xUyjvd3KG8uxUqBeB1wp+Mjw0zgC4AtLMGnC+d87CKwDsLAFjl/h8rv54bCYCLADCh5c7cOABULVrd8z4AjAbAKAC8u6HFvgAAIyJ9PeBspLx7goYEINEQlAAQVgJAWAmAsxAhVeGpATnj04IUbqQFGbQggxZk0IIMWpBBCzJoQQYtyKAFGbQggxZksAgbLMIGLchgETZoQQaLsMEibLAIG7Qgg0XYoAUZtCCDFmTQggxakEELMmouy1ZL5zqolPd0y2Oq/Acsyt0HTMHHh7mGnqaGPk0NHSWdc1Ep767mSoZ/BsCH8JsCG7FeNmKLpHMuKsJZW+HwXR8j/PcLnoq4QzrnoiKcxcPwCdCEPwHbAgBO8QkI70MehDMKb1XFn2YMxPU3b5kIgL8LANjOGhD+t3IR0iX4amwE4G2FAMbWNkwHwPwht6Ab7QUAuAYATQBYAIBPFm1BtdkZ0rmKSHmPrRZ+Cj4hPVdsRNhf9gFwg/RcsZEbtg+Au6Tnio0Ie5H6/4s8j0jPFRsp/zuq09JznbMivDr88hCr6Esb9jl1QdbQhhb70LzF9jzpfCoqghuDfx/AXuDI6m2vXBL4PqDZ/sOcpu7w3nYyVBFcIz4WAAAbj1//gnM84I3YMQA0SudUMSnvfW+5AAC4zwzXAOBIwAB6ADBTOqeKiuA2K+91kkOFsAQAewIE8M68ZnuLdD4Vl/KuGSzs2+GaJfpFHwApACwBQAoAKQCkAJACQAoAKQCkAJACwP0A+BoAtgxwb+jmhlZ72fwldnjP9UuKsG/0AfAz6bliI8K+ygeAu5Yk9/AMhwj6UuX/tsQPSs8WCxH0OHzQB8D10rPFQgQ9Aj/jA+BZ6dkiJ0IdqbwbfN3TFf2fF/Z7xcH/NmS0oF8O8pzwQVpQR9um3Ejp4wu9lPeMQanXld2HQZpv3+38oIR9gPve0C9JH1/oRaBHy9yQZTp2OXPXdeZPlvDaykPSxxd6EeiRMgGcvHjusskA+F0JAF6WPr7Qi0BX4RNlQtjavrO7GQC9g7w3tE36+EIv5T1ls0x5L/TYVuCXigB4a3R13Ufa087DADgAgAMAOACAXwBgf98bs1pZhOP1dEvQIugZ+I0iEP6IJ/b7t251na28W1vC+1zXuSTl3fj1kwG+in6DP4+vwd/APcp7u9bj0rNHRoS5rsz1wf3dgc9Kzx0ZEWZNGfsE139RyS9rBCvl/VZkqQCSW1iClvJeBlLKDcDupctJ0vNGTsr7NaXDJQDYKT1rZKW8p3EGejGI24CukJ4zsurr+XsGAPBV6RkjL+VdqPG70WsHfo/0fLGQ8h6J/bbyzh/l8X0q+W354ZdKLtAnSpQoUaJEicrRfwFj5g/5zsKE0wAAAABJRU5ErkJggg==" alt="Inspectr Logo" class="h-6"/><span class="text-gray-700 font-semibold text-sm">Inspectr</span></a></div><div class="bg-gray-100 border-t border-gray-300 transition-all duration-300 overflow-hidden max-h-0 opacity-0 py-0"><div class="px-6"><h2 class="text-lg font-semibold text-gray-800 mb-4">Configuration</h2><div class="grid grid-cols-3 gap-6"><div><label class="block text-sm font-medium text-gray-700 mb-1">Inspectr API Endpoint</label><input type="text" placeholder="Enter API Endpoint..." class="w-full border bg-white border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value="/api"/><button class="mt-2 bg-blue-600 text-white px-4 py-2 rounded-md">Save</button></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Channel</label><input type="text" placeholder="Enter Channel..." class="w-full bg-white border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/><button class="mt-2 bg-green-600 text-white px-4 py-2 rounded-md">Register</button></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Access Code</label><input type="text" placeholder="Enter Access Code..." class="w-full border bg-white border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div></div></div></div></div><!--astro:end--></astro-island> </body></html>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@inspectr/app",
|
|
3
3
|
"description": "Standalone Inspectr app for inspecting API requests & Webhook events.",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.5",
|
|
6
6
|
"author": "Tim Haselaars",
|
|
7
7
|
"homepage": "https://github.com/thim81/inspectr#readme",
|
|
8
8
|
"bugs": "https://github.com/thim81/inspectr-app/issues",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@astrojs/react": "^4.2.0",
|
|
39
39
|
"@tailwindcss/vite": "^4.0.6",
|
|
40
|
-
"@inspectr/ui": "^0.0
|
|
40
|
+
"@inspectr/ui": "^0.1.0",
|
|
41
41
|
"@types/react": "^19.0.8",
|
|
42
42
|
"@types/react-dom": "^19.0.3",
|
|
43
43
|
"astro": "^5.3.0",
|