@nvwa-app/sdk-web 6.0.20 → 6.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var M=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var Ue=(e,t)=>{for(var r in t)M(e,r,{get:t[r],enumerable:!0})},De=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Re(t))!Me.call(e,o)&&o!==r&&M(e,o,{get:()=>t[o],enumerable:!(a=He(t,o))||a.enumerable});return e};var Fe=e=>De(M({},"__esModule",{value:!0}),e);var ht={};Ue(ht,{default:()=>k,disableIframeHoverInspector:()=>nt,enableIframeHoverInspector:()=>ot,getIframeSourceLocation:()=>it,localStorage:()=>ke,setupIframeHoverInspector:()=>at,setupIframeSourceLocationListener:()=>lt,webFetch:()=>C});module.exports=Fe(ht);var Be=Object.create,A=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyNames,Ge=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(e&&(t=e(e=0)),t),b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),We=(e,t)=>{for(var r in t)A(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qe(t))!Je.call(e,o)&&o!==r&&A(e,o,{get:()=>t[o],enumerable:!(a=ze(t,o))||a.enumerable});return e},Ke=(e,t,r)=>(r=e!=null?Be(Ge(e)):{},z(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e)),O=e=>z(A({},"__esModule",{value:!0}),e),m=B(()=>{"use strict"}),_={};We(_,{__addDisposableResource:()=>fe,__assign:()=>T,__asyncDelegator:()=>ne,__asyncGenerator:()=>oe,__asyncValues:()=>ie,__await:()=>E,__awaiter:()=>Z,__classPrivateFieldGet:()=>ue,__classPrivateFieldIn:()=>pe,__classPrivateFieldSet:()=>de,__createBinding:()=>$,__decorate:()=>J,__disposeResources:()=>me,__esDecorate:()=>K,__exportStar:()=>te,__extends:()=>q,__generator:()=>ee,__importDefault:()=>he,__importStar:()=>ce,__makeTemplateObject:()=>le,__metadata:()=>X,__param:()=>W,__propKey:()=>Y,__read:()=>U,__rest:()=>G,__rewriteRelativeImportExtension:()=>ye,__runInitializers:()=>V,__setFunctionName:()=>Q,__spread:()=>re,__spreadArray:()=>ae,__spreadArrays:()=>se,__values:()=>L,default:()=>we});function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function G(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function J(e,t,r,a){var o=arguments.length,s=o<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function W(e,t){return function(r,a){t(r,a,e)}}function K(e,t,r,a,o,s){function n(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var i=a.kind,h=i==="getter"?"get":i==="setter"?"set":"value",l=!t&&e?a.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,a.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var y in a)p[y]=y==="access"?{}:a[y];for(var y in a.access)p.access[y]=a.access[y];p.addInitializer=function(g){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(n(g||null))};var v=(0,r[d])(i==="accessor"?{get:c.get,set:c.set}:c[h],p);if(i==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(u=n(v.get))&&(c.get=u),(u=n(v.set))&&(c.set=u),(u=n(v.init))&&o.unshift(u)}else(u=n(v))&&(i==="field"?o.unshift(u):c[h]=u)}l&&Object.defineProperty(l,a.name,c),f=!0}function V(e,t,r){for(var a=arguments.length>2,o=0;o<t.length;o++)r=a?t[o].call(e,r):t[o].call(e);return a?r:void 0}function Y(e){return typeof e=="symbol"?e:"".concat(e)}function Q(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function X(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Z(e,t,r,a){function o(s){return s instanceof r?s:new r(function(n){n(s)})}return new(r||(r=Promise))(function(s,n){function i(c){try{l(a.next(c))}catch(u){n(u)}}function h(c){try{l(a.throw(c))}catch(u){n(u)}}function l(c){c.done?s(c.value):o(c.value).then(i,h)}l((a=a.apply(e,t||[])).next())})}function ee(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,n=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return n.next=i(0),n.throw=i(1),n.return=i(2),typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(l){return function(c){return h([l,c])}}function h(l){if(a)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(r=0)),r;)try{if(a=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],o=0}finally{a=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function te(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&$(t,e,r)}function L(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,s=[],n;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(i){n={error:i}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s}function re(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(U(arguments[t]));return e}function se(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),o=0,t=0;t<r;t++)for(var s=arguments[t],n=0,i=s.length;n<i;n++,o++)a[o]=s[n];return a}function ae(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,s;a<o;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function oe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(e,t||[]),o,s=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",n),o[Symbol.asyncIterator]=function(){return this},o;function n(d){return function(p){return Promise.resolve(p).then(d,u)}}function i(d,p){a[d]&&(o[d]=function(y){return new Promise(function(v,g){s.push([d,y,v,g])>1||h(d,y)})},p&&(o[d]=p(o[d])))}function h(d,p){try{l(a[d](p))}catch(y){f(s[0][3],y)}}function l(d){d.value instanceof E?Promise.resolve(d.value.v).then(c,u):f(s[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),s.shift(),s.length&&h(s[0][0],s[0][1])}}function ne(e){var t,r;return t={},a("next"),a("throw",function(o){throw o}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(o,s){t[o]=e[o]?function(n){return(r=!r)?{value:E(e[o](n)),done:!1}:s?s(n):n}:s}}function ie(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof L=="function"?L(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(s){r[s]=e[s]&&function(n){return new Promise(function(i,h){n=e[s](n),o(i,h,n.done,n.value)})}}function o(s,n,i,h){Promise.resolve(h).then(function(l){s({value:l,done:i})},n)}}function le(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ce(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=j(e),a=0;a<r.length;a++)r[a]!=="default"&&$(t,e,r[a]);return ge(t,e),t}function he(e){return e&&e.__esModule?e:{default:e}}function ue(e,t,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(e):a?a.value:t.get(e)}function de(e,t,r,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function pe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function fe(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var a,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");a=t[Symbol.asyncDispose]}if(a===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");a=t[Symbol.dispose],r&&(o=a)}if(typeof a!="function")throw new TypeError("Object not disposable.");o&&(a=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:a,async:r})}else r&&e.stack.push({async:!0});return t}function me(e){function t(s){e.error=e.hasError?new ve(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var r,a=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&a===1)return a=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return a|=2,Promise.resolve(s).then(o,function(n){return t(n),o()})}else a|=1}catch(n){t(n)}if(a===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function ye(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,a,o,s,n){return a?t?".jsx":".js":o&&(!s||!n)?r:o+s+"."+n.toLowerCase()+"js"}):e}var x,T,$,ge,j,ve,we,P=B(()=>{"use strict";m(),x=function(e,t){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},x(e,t)},T=function(){return T=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},T.apply(this,arguments)},$=Object.create?(function(e,t,r,a){a===void 0&&(a=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,o)}):(function(e,t,r,a){a===void 0&&(a=r),e[a]=t[r]}),ge=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(t){var r=[];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[r.length]=a);return r},j(e)},ve=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var a=new Error(r);return a.name="SuppressedError",a.error=e,a.suppressed=t,a},we={__extends:q,__assign:T,__rest:G,__decorate:J,__param:W,__esDecorate:K,__runInitializers:V,__propKey:Y,__setFunctionName:Q,__metadata:X,__awaiter:Z,__generator:ee,__createBinding:$,__exportStar:te,__values:L,__read:U,__spread:re,__spreadArrays:se,__spreadArray:ae,__await:E,__asyncGenerator:oe,__asyncDelegator:ne,__asyncValues:ie,__makeTemplateObject:le,__importStar:ce,__importDefault:he,__classPrivateFieldGet:ue,__classPrivateFieldSet:de,__classPrivateFieldIn:pe,__addDisposableResource:fe,__disposeResources:me,__rewriteRelativeImportExtension:ye}}),be=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};e.default=t}),_e=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(be()),a=class{constructor(o){var s,n;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(s=o.shouldThrowOnError)!==null&&s!==void 0?s:!1,this.signal=o.signal,this.isMaybeSingle=(n=o.isMaybeSingle)!==null&&n!==void 0?n:!1,o.fetch?this.fetch=o.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,s){return this.headers=new Headers(this.headers),this.headers.set(o,s),this}then(o,s){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var l,c,u,f;let d=null,p=null,y=null,v=h.status,g=h.statusText;if(h.ok){if(this.method!=="HEAD"){let R=await h.text();R===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((l=this.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")?p=R:p=JSON.parse(R))}let S=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),H=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");S&&H&&H.length>1&&(y=parseInt(H[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,y=null,v=406,g="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let S=await h.text();try{d=JSON.parse(S),Array.isArray(d)&&h.status===404&&(p=[],d=null,v=200,g="OK")}catch{h.status===404&&S===""?(v=204,g="No Content"):d={message:S}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,v=200,g="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:y,status:v,statusText:g}});return this.shouldThrowOnError||(i=i.catch(h=>{var l,c,u;return{error:{message:`${(l=h?.name)!==null&&l!==void 0?l:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(o,s)}returns(){return this}overrideTypes(){return this}};e.default=a}),Ee=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(_e()),a=class extends r.default{select(o){let s=!1,n=(o??"*").split("").map(i=>/\s/.test(i)&&!s?"":(i==='"'&&(s=!s),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!0,nullsFirst:n,foreignTable:i,referencedTable:h=i}={}){let l=h?`${h}.order`:"order",c=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${c?`${c},`:""}${o}.${s?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:n=s}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${o}`),this}range(o,s,{foreignTable:n,referencedTable:i=n}={}){let h=typeof i>"u"?"offset":`${i}.offset`,l=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(h,`${o}`),this.url.searchParams.set(l,`${s-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:o=!1,verbose:s=!1,settings:n=!1,buffers:i=!1,wal:h=!1,format:l="text"}={}){var c;let u=[o?"analyze":null,s?"verbose":null,n?"settings":null,i?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${l}; for="${f}"; options=${u};`),l==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}};e.default=a}),D=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Ee()),a=new RegExp("[,()]"),o=class extends r.default{eq(s,n){return this.url.searchParams.append(s,`eq.${n}`),this}neq(s,n){return this.url.searchParams.append(s,`neq.${n}`),this}gt(s,n){return this.url.searchParams.append(s,`gt.${n}`),this}gte(s,n){return this.url.searchParams.append(s,`gte.${n}`),this}lt(s,n){return this.url.searchParams.append(s,`lt.${n}`),this}lte(s,n){return this.url.searchParams.append(s,`lte.${n}`),this}like(s,n){return this.url.searchParams.append(s,`like.${n}`),this}likeAllOf(s,n){return this.url.searchParams.append(s,`like(all).{${n.join(",")}}`),this}likeAnyOf(s,n){return this.url.searchParams.append(s,`like(any).{${n.join(",")}}`),this}ilike(s,n){return this.url.searchParams.append(s,`ilike.${n}`),this}ilikeAllOf(s,n){return this.url.searchParams.append(s,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(s,n){return this.url.searchParams.append(s,`ilike(any).{${n.join(",")}}`),this}is(s,n){return this.url.searchParams.append(s,`is.${n}`),this}in(s,n){let i=Array.from(new Set(n)).map(h=>typeof h=="string"&&a.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(s,`in.(${i})`),this}contains(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cs.{${n.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(n)}`),this}containedBy(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cd.{${n.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(n)}`),this}rangeGt(s,n){return this.url.searchParams.append(s,`sr.${n}`),this}rangeGte(s,n){return this.url.searchParams.append(s,`nxl.${n}`),this}rangeLt(s,n){return this.url.searchParams.append(s,`sl.${n}`),this}rangeLte(s,n){return this.url.searchParams.append(s,`nxr.${n}`),this}rangeAdjacent(s,n){return this.url.searchParams.append(s,`adj.${n}`),this}overlaps(s,n){return typeof n=="string"?this.url.searchParams.append(s,`ov.${n}`):this.url.searchParams.append(s,`ov.{${n.join(",")}}`),this}textSearch(s,n,{config:i,type:h}={}){let l="";h==="plain"?l="pl":h==="phrase"?l="ph":h==="websearch"&&(l="w");let c=i===void 0?"":`(${i})`;return this.url.searchParams.append(s,`${l}fts${c}.${n}`),this}match(s){return Object.entries(s).forEach(([n,i])=>{this.url.searchParams.append(n,`eq.${i}`)}),this}not(s,n,i){return this.url.searchParams.append(s,`not.${n}.${i}`),this}or(s,{foreignTable:n,referencedTable:i=n}={}){let h=i?`${i}.or`:"or";return this.url.searchParams.append(h,`(${s})`),this}filter(s,n,i){return this.url.searchParams.append(s,`${n}.${i}`),this}};e.default=o}),Oe=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(D()),a=class{constructor(o,{headers:s={},schema:n,fetch:i}){this.url=o,this.headers=new Headers(s),this.schema=n,this.fetch=i}select(o,s){let{head:n=!1,count:i}=s??{},h=n?"HEAD":"GET",l=!1,c=(o??"*").split("").map(u=>/\s/.test(u)&&!l?"":(u==='"'&&(l=!l),u)).join("");return this.url.searchParams.set("select",c),i&&this.headers.append("Prefer",`count=${i}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(o,{count:s,defaultToNull:n=!0}={}){var i;let h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let l=o.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){let c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:n=!1,count:i,defaultToNull:h=!0}={}){var l;let c="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),i&&this.headers.append("Prefer",`count=${i}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let u=o.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}update(o,{count:s}={}){var n;let i="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new r.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:o}={}){var s;let n="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new r.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};e.default=a}),Ve=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Oe()),a=t.__importDefault(D()),o=class Pe{constructor(n,{headers:i={},schema:h,fetch:l}={}){this.url=n,this.headers=new Headers(i),this.schemaName=h,this.fetch=l}from(n){let i=new URL(`${this.url}/${n}`);return new r.default(i,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(n){return new Pe(this.url,{headers:this.headers,schema:n,fetch:this.fetch})}rpc(n,i={},{head:h=!1,get:l=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${n}`),p;h||l?(f=h?"HEAD":"GET",Object.entries(i).filter(([v,g])=>g!==void 0).map(([v,g])=>[v,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([v,g])=>{d.searchParams.append(v,g)})):(f="POST",p=i);let y=new Headers(this.headers);return c&&y.set("Prefer",`count=${c}`),new a.default({method:f,url:d,headers:y,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};e.default=o}),Ye=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0}),e.PostgrestError=e.PostgrestBuilder=e.PostgrestTransformBuilder=e.PostgrestFilterBuilder=e.PostgrestQueryBuilder=e.PostgrestClient=void 0;var t=(P(),O(_)),r=t.__importDefault(Ve());e.PostgrestClient=r.default;var a=t.__importDefault(Oe());e.PostgrestQueryBuilder=a.default;var o=t.__importDefault(D());e.PostgrestFilterBuilder=o.default;var s=t.__importDefault(Ee());e.PostgrestTransformBuilder=s.default;var n=t.__importDefault(_e());e.PostgrestBuilder=n.default;var i=t.__importDefault(be());e.PostgrestError=i.default,e.default={PostgrestClient:r.default,PostgrestQueryBuilder:a.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:s.default,PostgrestBuilder:n.default,PostgrestError:i.default}});m();m();var Se=class{constructor(e,t=""){this.http=e,this.baseUrl=t.replace(/\/$/,"")}async invoke(e,t){let r=this.baseUrl?`${this.baseUrl}/functions/${e}`:`/functions/${e}`;return await(await this.http.fetch(r,{method:t.method||"POST",body:t.body,headers:t.headers})).json()}};m();m();var Qe="current_jwt";var dt=typeof fetch<"u"?(e,t)=>fetch(e,t):(()=>{throw new Error("AuthClient requires fetch")})();m();m();var w=class Te{constructor(t){if(this.headerMap=new Map,t){if(t instanceof Te)t.forEach((r,a)=>this.set(a,r));else if(Array.isArray(t))for(let[r,a]of t)this.set(r,String(a));else if(typeof t=="object")for(let r of Object.keys(t))this.set(r,String(t[r]))}}append(t,r){let a=t.toLowerCase(),o=this.headerMap.get(a);this.headerMap.set(a,o?`${o}, ${r}`:r)}set(t,r){this.headerMap.set(t.toLowerCase(),String(r))}get(t){return this.headerMap.get(t.toLowerCase())??null}has(t){return this.headerMap.has(t.toLowerCase())}delete(t){this.headerMap.delete(t.toLowerCase())}forEach(t){for(let[r,a]of this.headerMap.entries())t(a,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}};m();m();var $e=class{constructor(e,t){this.bodyData=e,this.status=t?.status??200,this.statusText=t?.statusText??"",this.headers=Xe(t?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let e=await this.text();return new TextEncoder().encode(e).buffer}};function Xe(e){return e?new w(e):new w}m();m();var xe=class{constructor(e,t,r){this.storage=e,this.customFetch=t,this.handleUnauthorized=r}async fetch(e,t){return await this.customFetch(e,t)}async fetchWithAuth(e,t){let r=await this.storage.get(Qe),a=new w(t?.headers);r&&a.set("Authorization",`Bearer ${r}`);let o=t?.method||"GET";if((o==="POST"||o==="PUT"||o==="PATCH")&&t?.body){let n=a.get("Content-Type");(!n||n.includes("text/plain"))&&a.set("Content-Type","application/json")}let s=await this.customFetch(e,{...t,headers:a});if(s.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return s}};m();var Ze="/storage",et=Ze+"/generateUploadUrl",je=class{constructor(e,t){this.baseUrl=e,this.http=t}async uploadFile(e){let t=await this.http.fetch(this.baseUrl+et,{method:"POST",body:{fileName:e.name||e.fileName,fileSize:e.size||e.fileSize,fileType:e.type||e.fileType}}),{url:r}=await t.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let a=await this.http.fetch(r,{method:"PUT",body:e,headers:new w({"Content-Type":e.type||e.fileType||"application/octet-stream"})}),{url:o}=await a.json();return{url:o.split("?")[0]}}};m();m();m();var F=Ke(Ye(),1),{PostgrestClient:tt,PostgrestQueryBuilder:pt,PostgrestFilterBuilder:ft,PostgrestTransformBuilder:mt,PostgrestBuilder:yt,PostgrestError:gt}=F.default||F,rt="/entities",Le=(e,t)=>new tt(e+rt,{fetch:t.fetchWithAuth.bind(t)});m();var Ie=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ae=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t!=null?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ne=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let e=document.createElement("style");e.id="__nvwa-inspector-overlay-style",e.textContent=`
|
|
1
|
+
"use strict";var M=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var Ue=(e,t)=>{for(var r in t)M(e,r,{get:t[r],enumerable:!0})},De=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Re(t))!Me.call(e,o)&&o!==r&&M(e,o,{get:()=>t[o],enumerable:!(a=He(t,o))||a.enumerable});return e};var Fe=e=>De(M({},"__esModule",{value:!0}),e);var ht={};Ue(ht,{default:()=>k,disableIframeHoverInspector:()=>nt,enableIframeHoverInspector:()=>ot,getIframeSourceLocation:()=>it,localStorage:()=>ke,setupIframeHoverInspector:()=>at,setupIframeSourceLocationListener:()=>lt,webFetch:()=>C});module.exports=Fe(ht);var Be=Object.create,A=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyNames,Ge=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(e&&(t=e(e=0)),t),b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),We=(e,t)=>{for(var r in t)A(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qe(t))!Je.call(e,o)&&o!==r&&A(e,o,{get:()=>t[o],enumerable:!(a=ze(t,o))||a.enumerable});return e},Ke=(e,t,r)=>(r=e!=null?Be(Ge(e)):{},z(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e)),O=e=>z(A({},"__esModule",{value:!0}),e),m=B(()=>{"use strict"}),_={};We(_,{__addDisposableResource:()=>fe,__assign:()=>T,__asyncDelegator:()=>ne,__asyncGenerator:()=>oe,__asyncValues:()=>ie,__await:()=>E,__awaiter:()=>Z,__classPrivateFieldGet:()=>ue,__classPrivateFieldIn:()=>pe,__classPrivateFieldSet:()=>de,__createBinding:()=>$,__decorate:()=>J,__disposeResources:()=>me,__esDecorate:()=>K,__exportStar:()=>te,__extends:()=>q,__generator:()=>ee,__importDefault:()=>he,__importStar:()=>ce,__makeTemplateObject:()=>le,__metadata:()=>X,__param:()=>W,__propKey:()=>Y,__read:()=>U,__rest:()=>G,__rewriteRelativeImportExtension:()=>ye,__runInitializers:()=>V,__setFunctionName:()=>Q,__spread:()=>re,__spreadArray:()=>ae,__spreadArrays:()=>se,__values:()=>L,default:()=>we});function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function G(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function J(e,t,r,a){var o=arguments.length,s=o<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function W(e,t){return function(r,a){t(r,a,e)}}function K(e,t,r,a,o,s){function n(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var i=a.kind,h=i==="getter"?"get":i==="setter"?"set":"value",l=!t&&e?a.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,a.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var y in a)p[y]=y==="access"?{}:a[y];for(var y in a.access)p.access[y]=a.access[y];p.addInitializer=function(g){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(n(g||null))};var v=(0,r[d])(i==="accessor"?{get:c.get,set:c.set}:c[h],p);if(i==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(u=n(v.get))&&(c.get=u),(u=n(v.set))&&(c.set=u),(u=n(v.init))&&o.unshift(u)}else(u=n(v))&&(i==="field"?o.unshift(u):c[h]=u)}l&&Object.defineProperty(l,a.name,c),f=!0}function V(e,t,r){for(var a=arguments.length>2,o=0;o<t.length;o++)r=a?t[o].call(e,r):t[o].call(e);return a?r:void 0}function Y(e){return typeof e=="symbol"?e:"".concat(e)}function Q(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function X(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Z(e,t,r,a){function o(s){return s instanceof r?s:new r(function(n){n(s)})}return new(r||(r=Promise))(function(s,n){function i(c){try{l(a.next(c))}catch(u){n(u)}}function h(c){try{l(a.throw(c))}catch(u){n(u)}}function l(c){c.done?s(c.value):o(c.value).then(i,h)}l((a=a.apply(e,t||[])).next())})}function ee(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,n=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return n.next=i(0),n.throw=i(1),n.return=i(2),typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(l){return function(c){return h([l,c])}}function h(l){if(a)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(r=0)),r;)try{if(a=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],o=0}finally{a=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function te(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&$(t,e,r)}function L(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,s=[],n;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(i){n={error:i}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s}function re(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(U(arguments[t]));return e}function se(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),o=0,t=0;t<r;t++)for(var s=arguments[t],n=0,i=s.length;n<i;n++,o++)a[o]=s[n];return a}function ae(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,s;a<o;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function oe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(e,t||[]),o,s=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",n),o[Symbol.asyncIterator]=function(){return this},o;function n(d){return function(p){return Promise.resolve(p).then(d,u)}}function i(d,p){a[d]&&(o[d]=function(y){return new Promise(function(v,g){s.push([d,y,v,g])>1||h(d,y)})},p&&(o[d]=p(o[d])))}function h(d,p){try{l(a[d](p))}catch(y){f(s[0][3],y)}}function l(d){d.value instanceof E?Promise.resolve(d.value.v).then(c,u):f(s[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),s.shift(),s.length&&h(s[0][0],s[0][1])}}function ne(e){var t,r;return t={},a("next"),a("throw",function(o){throw o}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(o,s){t[o]=e[o]?function(n){return(r=!r)?{value:E(e[o](n)),done:!1}:s?s(n):n}:s}}function ie(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof L=="function"?L(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(s){r[s]=e[s]&&function(n){return new Promise(function(i,h){n=e[s](n),o(i,h,n.done,n.value)})}}function o(s,n,i,h){Promise.resolve(h).then(function(l){s({value:l,done:i})},n)}}function le(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ce(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=j(e),a=0;a<r.length;a++)r[a]!=="default"&&$(t,e,r[a]);return ge(t,e),t}function he(e){return e&&e.__esModule?e:{default:e}}function ue(e,t,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(e):a?a.value:t.get(e)}function de(e,t,r,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function pe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function fe(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var a,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");a=t[Symbol.asyncDispose]}if(a===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");a=t[Symbol.dispose],r&&(o=a)}if(typeof a!="function")throw new TypeError("Object not disposable.");o&&(a=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:a,async:r})}else r&&e.stack.push({async:!0});return t}function me(e){function t(s){e.error=e.hasError?new ve(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var r,a=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&a===1)return a=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return a|=2,Promise.resolve(s).then(o,function(n){return t(n),o()})}else a|=1}catch(n){t(n)}if(a===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function ye(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,a,o,s,n){return a?t?".jsx":".js":o&&(!s||!n)?r:o+s+"."+n.toLowerCase()+"js"}):e}var x,T,$,ge,j,ve,we,P=B(()=>{"use strict";m(),x=function(e,t){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},x(e,t)},T=function(){return T=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},T.apply(this,arguments)},$=Object.create?(function(e,t,r,a){a===void 0&&(a=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,o)}):(function(e,t,r,a){a===void 0&&(a=r),e[a]=t[r]}),ge=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(t){var r=[];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[r.length]=a);return r},j(e)},ve=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var a=new Error(r);return a.name="SuppressedError",a.error=e,a.suppressed=t,a},we={__extends:q,__assign:T,__rest:G,__decorate:J,__param:W,__esDecorate:K,__runInitializers:V,__propKey:Y,__setFunctionName:Q,__metadata:X,__awaiter:Z,__generator:ee,__createBinding:$,__exportStar:te,__values:L,__read:U,__spread:re,__spreadArrays:se,__spreadArray:ae,__await:E,__asyncGenerator:oe,__asyncDelegator:ne,__asyncValues:ie,__makeTemplateObject:le,__importStar:ce,__importDefault:he,__classPrivateFieldGet:ue,__classPrivateFieldSet:de,__classPrivateFieldIn:pe,__addDisposableResource:fe,__disposeResources:me,__rewriteRelativeImportExtension:ye}}),be=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};e.default=t}),_e=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(be()),a=class{constructor(o){var s,n;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(s=o.shouldThrowOnError)!==null&&s!==void 0?s:!1,this.signal=o.signal,this.isMaybeSingle=(n=o.isMaybeSingle)!==null&&n!==void 0?n:!1,o.fetch?this.fetch=o.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,s){return this.headers=new Headers(this.headers),this.headers.set(o,s),this}then(o,s){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var l,c,u,f;let d=null,p=null,y=null,v=h.status,g=h.statusText;if(h.ok){if(this.method!=="HEAD"){let R=await h.text();R===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((l=this.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")?p=R:p=JSON.parse(R))}let S=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),H=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");S&&H&&H.length>1&&(y=parseInt(H[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,y=null,v=406,g="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let S=await h.text();try{d=JSON.parse(S),Array.isArray(d)&&h.status===404&&(p=[],d=null,v=200,g="OK")}catch{h.status===404&&S===""?(v=204,g="No Content"):d={message:S}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,v=200,g="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:y,status:v,statusText:g}});return this.shouldThrowOnError||(i=i.catch(h=>{var l,c,u;return{error:{message:`${(l=h?.name)!==null&&l!==void 0?l:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(o,s)}returns(){return this}overrideTypes(){return this}};e.default=a}),Ee=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(_e()),a=class extends r.default{select(o){let s=!1,n=(o??"*").split("").map(i=>/\s/.test(i)&&!s?"":(i==='"'&&(s=!s),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!0,nullsFirst:n,foreignTable:i,referencedTable:h=i}={}){let l=h?`${h}.order`:"order",c=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${c?`${c},`:""}${o}.${s?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:n=s}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${o}`),this}range(o,s,{foreignTable:n,referencedTable:i=n}={}){let h=typeof i>"u"?"offset":`${i}.offset`,l=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(h,`${o}`),this.url.searchParams.set(l,`${s-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:o=!1,verbose:s=!1,settings:n=!1,buffers:i=!1,wal:h=!1,format:l="text"}={}){var c;let u=[o?"analyze":null,s?"verbose":null,n?"settings":null,i?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${l}; for="${f}"; options=${u};`),l==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}};e.default=a}),D=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Ee()),a=new RegExp("[,()]"),o=class extends r.default{eq(s,n){return this.url.searchParams.append(s,`eq.${n}`),this}neq(s,n){return this.url.searchParams.append(s,`neq.${n}`),this}gt(s,n){return this.url.searchParams.append(s,`gt.${n}`),this}gte(s,n){return this.url.searchParams.append(s,`gte.${n}`),this}lt(s,n){return this.url.searchParams.append(s,`lt.${n}`),this}lte(s,n){return this.url.searchParams.append(s,`lte.${n}`),this}like(s,n){return this.url.searchParams.append(s,`like.${n}`),this}likeAllOf(s,n){return this.url.searchParams.append(s,`like(all).{${n.join(",")}}`),this}likeAnyOf(s,n){return this.url.searchParams.append(s,`like(any).{${n.join(",")}}`),this}ilike(s,n){return this.url.searchParams.append(s,`ilike.${n}`),this}ilikeAllOf(s,n){return this.url.searchParams.append(s,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(s,n){return this.url.searchParams.append(s,`ilike(any).{${n.join(",")}}`),this}is(s,n){return this.url.searchParams.append(s,`is.${n}`),this}in(s,n){let i=Array.from(new Set(n)).map(h=>typeof h=="string"&&a.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(s,`in.(${i})`),this}contains(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cs.{${n.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(n)}`),this}containedBy(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cd.{${n.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(n)}`),this}rangeGt(s,n){return this.url.searchParams.append(s,`sr.${n}`),this}rangeGte(s,n){return this.url.searchParams.append(s,`nxl.${n}`),this}rangeLt(s,n){return this.url.searchParams.append(s,`sl.${n}`),this}rangeLte(s,n){return this.url.searchParams.append(s,`nxr.${n}`),this}rangeAdjacent(s,n){return this.url.searchParams.append(s,`adj.${n}`),this}overlaps(s,n){return typeof n=="string"?this.url.searchParams.append(s,`ov.${n}`):this.url.searchParams.append(s,`ov.{${n.join(",")}}`),this}textSearch(s,n,{config:i,type:h}={}){let l="";h==="plain"?l="pl":h==="phrase"?l="ph":h==="websearch"&&(l="w");let c=i===void 0?"":`(${i})`;return this.url.searchParams.append(s,`${l}fts${c}.${n}`),this}match(s){return Object.entries(s).forEach(([n,i])=>{this.url.searchParams.append(n,`eq.${i}`)}),this}not(s,n,i){return this.url.searchParams.append(s,`not.${n}.${i}`),this}or(s,{foreignTable:n,referencedTable:i=n}={}){let h=i?`${i}.or`:"or";return this.url.searchParams.append(h,`(${s})`),this}filter(s,n,i){return this.url.searchParams.append(s,`${n}.${i}`),this}};e.default=o}),Oe=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(D()),a=class{constructor(o,{headers:s={},schema:n,fetch:i}){this.url=o,this.headers=new Headers(s),this.schema=n,this.fetch=i}select(o,s){let{head:n=!1,count:i}=s??{},h=n?"HEAD":"GET",l=!1,c=(o??"*").split("").map(u=>/\s/.test(u)&&!l?"":(u==='"'&&(l=!l),u)).join("");return this.url.searchParams.set("select",c),i&&this.headers.append("Prefer",`count=${i}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(o,{count:s,defaultToNull:n=!0}={}){var i;let h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let l=o.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){let c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:n=!1,count:i,defaultToNull:h=!0}={}){var l;let c="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),i&&this.headers.append("Prefer",`count=${i}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let u=o.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}update(o,{count:s}={}){var n;let i="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new r.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:o}={}){var s;let n="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new r.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};e.default=a}),Ve=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Oe()),a=t.__importDefault(D()),o=class Pe{constructor(n,{headers:i={},schema:h,fetch:l}={}){this.url=n,this.headers=new Headers(i),this.schemaName=h,this.fetch=l}from(n){let i=new URL(`${this.url}/${n}`);return new r.default(i,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(n){return new Pe(this.url,{headers:this.headers,schema:n,fetch:this.fetch})}rpc(n,i={},{head:h=!1,get:l=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${n}`),p;h||l?(f=h?"HEAD":"GET",Object.entries(i).filter(([v,g])=>g!==void 0).map(([v,g])=>[v,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([v,g])=>{d.searchParams.append(v,g)})):(f="POST",p=i);let y=new Headers(this.headers);return c&&y.set("Prefer",`count=${c}`),new a.default({method:f,url:d,headers:y,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};e.default=o}),Ye=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0}),e.PostgrestError=e.PostgrestBuilder=e.PostgrestTransformBuilder=e.PostgrestFilterBuilder=e.PostgrestQueryBuilder=e.PostgrestClient=void 0;var t=(P(),O(_)),r=t.__importDefault(Ve());e.PostgrestClient=r.default;var a=t.__importDefault(Oe());e.PostgrestQueryBuilder=a.default;var o=t.__importDefault(D());e.PostgrestFilterBuilder=o.default;var s=t.__importDefault(Ee());e.PostgrestTransformBuilder=s.default;var n=t.__importDefault(_e());e.PostgrestBuilder=n.default;var i=t.__importDefault(be());e.PostgrestError=i.default,e.default={PostgrestClient:r.default,PostgrestQueryBuilder:a.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:s.default,PostgrestBuilder:n.default,PostgrestError:i.default}});m();m();var Se=class{constructor(e,t=""){this.http=e,this.baseUrl=t.replace(/\/$/,"")}async invoke(e,t){let r=this.baseUrl?`${this.baseUrl}/functions/${e}`:`/functions/${e}`;return await(await this.http.fetch(r,{method:t.method||"POST",body:t.body,headers:t.headers})).json()}};m();m();var Qe="nvwa_current_jwt";var dt=typeof fetch<"u"?(e,t)=>fetch(e,t):(()=>{throw new Error("AuthClient requires fetch")})();m();m();var w=class Te{constructor(t){if(this.headerMap=new Map,t){if(t instanceof Te)t.forEach((r,a)=>this.set(a,r));else if(Array.isArray(t))for(let[r,a]of t)this.set(r,String(a));else if(typeof t=="object")for(let r of Object.keys(t))this.set(r,String(t[r]))}}append(t,r){let a=t.toLowerCase(),o=this.headerMap.get(a);this.headerMap.set(a,o?`${o}, ${r}`:r)}set(t,r){this.headerMap.set(t.toLowerCase(),String(r))}get(t){return this.headerMap.get(t.toLowerCase())??null}has(t){return this.headerMap.has(t.toLowerCase())}delete(t){this.headerMap.delete(t.toLowerCase())}forEach(t){for(let[r,a]of this.headerMap.entries())t(a,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}};m();m();var $e=class{constructor(e,t){this.bodyData=e,this.status=t?.status??200,this.statusText=t?.statusText??"",this.headers=Xe(t?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let e=await this.text();return new TextEncoder().encode(e).buffer}};function Xe(e){return e?new w(e):new w}m();m();var xe=class{constructor(e,t,r){this.storage=e,this.customFetch=t,this.handleUnauthorized=r}async fetch(e,t){return await this.customFetch(e,t)}async fetchWithAuth(e,t){let r=await this.storage.get(Qe),a=new w(t?.headers);r&&a.set("Authorization",`Bearer ${r}`);let o=t?.method||"GET";if((o==="POST"||o==="PUT"||o==="PATCH")&&t?.body){let n=a.get("Content-Type");(!n||n.includes("text/plain"))&&a.set("Content-Type","application/json")}let s=await this.customFetch(e,{...t,headers:a});if(s.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return s}};m();var Ze="/storage",et=Ze+"/generateUploadUrl",je=class{constructor(e,t){this.baseUrl=e,this.http=t}async uploadFile(e){let t=await this.http.fetch(this.baseUrl+et,{method:"POST",body:{fileName:e.name||e.fileName,fileSize:e.size||e.fileSize,fileType:e.type||e.fileType}}),{url:r}=await t.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let a=await this.http.fetch(r,{method:"PUT",body:e,headers:new w({"Content-Type":e.type||e.fileType||"application/octet-stream"})}),{url:o}=await a.json();return{url:o.split("?")[0]}}};m();m();m();var F=Ke(Ye(),1),{PostgrestClient:tt,PostgrestQueryBuilder:pt,PostgrestFilterBuilder:ft,PostgrestTransformBuilder:mt,PostgrestBuilder:yt,PostgrestError:gt}=F.default||F,rt="/entities",Le=(e,t)=>new tt(e+rt,{fetch:t.fetchWithAuth.bind(t)});m();var Ie=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ae=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t!=null?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ne=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let e=document.createElement("style");e.id="__nvwa-inspector-overlay-style",e.textContent=`
|
|
2
2
|
.__nvwa-inspector-overlay {
|
|
3
3
|
position: absolute;
|
|
4
4
|
pointer-events: none;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ke=Object.create,N=Object.defineProperty,He=Object.getOwnPropertyDescriptor,Re=Object.getOwnPropertyNames,Me=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(e&&(t=e(e=0)),t),b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),De=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Re(t))!Ue.call(e,o)&&o!==r&&N(e,o,{get:()=>t[o],enumerable:!(a=He(t,o))||a.enumerable});return e},Fe=(e,t,r)=>(r=e!=null?ke(Me(e)):{},z(t||!e||!e.__esModule?N(r,"default",{value:e,enumerable:!0}):r,e)),O=e=>z(N({},"__esModule",{value:!0}),e),m=B(()=>{"use strict"}),_={};De(_,{__addDisposableResource:()=>fe,__assign:()=>T,__asyncDelegator:()=>ne,__asyncGenerator:()=>oe,__asyncValues:()=>ie,__await:()=>E,__awaiter:()=>Z,__classPrivateFieldGet:()=>ue,__classPrivateFieldIn:()=>pe,__classPrivateFieldSet:()=>de,__createBinding:()=>$,__decorate:()=>J,__disposeResources:()=>me,__esDecorate:()=>K,__exportStar:()=>te,__extends:()=>q,__generator:()=>ee,__importDefault:()=>he,__importStar:()=>ce,__makeTemplateObject:()=>le,__metadata:()=>X,__param:()=>W,__propKey:()=>Y,__read:()=>R,__rest:()=>G,__rewriteRelativeImportExtension:()=>ye,__runInitializers:()=>V,__setFunctionName:()=>Q,__spread:()=>re,__spreadArray:()=>ae,__spreadArrays:()=>se,__values:()=>L,default:()=>we});function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function G(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function J(e,t,r,a){var o=arguments.length,s=o<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function W(e,t){return function(r,a){t(r,a,e)}}function K(e,t,r,a,o,s){function n(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var i=a.kind,h=i==="getter"?"get":i==="setter"?"set":"value",l=!t&&e?a.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,a.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var y in a)p[y]=y==="access"?{}:a[y];for(var y in a.access)p.access[y]=a.access[y];p.addInitializer=function(g){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(n(g||null))};var v=(0,r[d])(i==="accessor"?{get:c.get,set:c.set}:c[h],p);if(i==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(u=n(v.get))&&(c.get=u),(u=n(v.set))&&(c.set=u),(u=n(v.init))&&o.unshift(u)}else(u=n(v))&&(i==="field"?o.unshift(u):c[h]=u)}l&&Object.defineProperty(l,a.name,c),f=!0}function V(e,t,r){for(var a=arguments.length>2,o=0;o<t.length;o++)r=a?t[o].call(e,r):t[o].call(e);return a?r:void 0}function Y(e){return typeof e=="symbol"?e:"".concat(e)}function Q(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function X(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Z(e,t,r,a){function o(s){return s instanceof r?s:new r(function(n){n(s)})}return new(r||(r=Promise))(function(s,n){function i(c){try{l(a.next(c))}catch(u){n(u)}}function h(c){try{l(a.throw(c))}catch(u){n(u)}}function l(c){c.done?s(c.value):o(c.value).then(i,h)}l((a=a.apply(e,t||[])).next())})}function ee(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,n=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return n.next=i(0),n.throw=i(1),n.return=i(2),typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(l){return function(c){return h([l,c])}}function h(l){if(a)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(r=0)),r;)try{if(a=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],o=0}finally{a=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function te(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&$(t,e,r)}function L(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,s=[],n;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(i){n={error:i}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s}function re(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(R(arguments[t]));return e}function se(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),o=0,t=0;t<r;t++)for(var s=arguments[t],n=0,i=s.length;n<i;n++,o++)a[o]=s[n];return a}function ae(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,s;a<o;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function oe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(e,t||[]),o,s=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",n),o[Symbol.asyncIterator]=function(){return this},o;function n(d){return function(p){return Promise.resolve(p).then(d,u)}}function i(d,p){a[d]&&(o[d]=function(y){return new Promise(function(v,g){s.push([d,y,v,g])>1||h(d,y)})},p&&(o[d]=p(o[d])))}function h(d,p){try{l(a[d](p))}catch(y){f(s[0][3],y)}}function l(d){d.value instanceof E?Promise.resolve(d.value.v).then(c,u):f(s[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),s.shift(),s.length&&h(s[0][0],s[0][1])}}function ne(e){var t,r;return t={},a("next"),a("throw",function(o){throw o}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(o,s){t[o]=e[o]?function(n){return(r=!r)?{value:E(e[o](n)),done:!1}:s?s(n):n}:s}}function ie(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof L=="function"?L(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(s){r[s]=e[s]&&function(n){return new Promise(function(i,h){n=e[s](n),o(i,h,n.done,n.value)})}}function o(s,n,i,h){Promise.resolve(h).then(function(l){s({value:l,done:i})},n)}}function le(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ce(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=j(e),a=0;a<r.length;a++)r[a]!=="default"&&$(t,e,r[a]);return ge(t,e),t}function he(e){return e&&e.__esModule?e:{default:e}}function ue(e,t,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(e):a?a.value:t.get(e)}function de(e,t,r,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function pe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function fe(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var a,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");a=t[Symbol.asyncDispose]}if(a===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");a=t[Symbol.dispose],r&&(o=a)}if(typeof a!="function")throw new TypeError("Object not disposable.");o&&(a=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:a,async:r})}else r&&e.stack.push({async:!0});return t}function me(e){function t(s){e.error=e.hasError?new ve(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var r,a=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&a===1)return a=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return a|=2,Promise.resolve(s).then(o,function(n){return t(n),o()})}else a|=1}catch(n){t(n)}if(a===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function ye(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,a,o,s,n){return a?t?".jsx":".js":o&&(!s||!n)?r:o+s+"."+n.toLowerCase()+"js"}):e}var x,T,$,ge,j,ve,we,P=B(()=>{"use strict";m(),x=function(e,t){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},x(e,t)},T=function(){return T=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},T.apply(this,arguments)},$=Object.create?(function(e,t,r,a){a===void 0&&(a=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,o)}):(function(e,t,r,a){a===void 0&&(a=r),e[a]=t[r]}),ge=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(t){var r=[];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[r.length]=a);return r},j(e)},ve=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var a=new Error(r);return a.name="SuppressedError",a.error=e,a.suppressed=t,a},we={__extends:q,__assign:T,__rest:G,__decorate:J,__param:W,__esDecorate:K,__runInitializers:V,__propKey:Y,__setFunctionName:Q,__metadata:X,__awaiter:Z,__generator:ee,__createBinding:$,__exportStar:te,__values:L,__read:R,__spread:re,__spreadArrays:se,__spreadArray:ae,__await:E,__asyncGenerator:oe,__asyncDelegator:ne,__asyncValues:ie,__makeTemplateObject:le,__importStar:ce,__importDefault:he,__classPrivateFieldGet:ue,__classPrivateFieldSet:de,__classPrivateFieldIn:pe,__addDisposableResource:fe,__disposeResources:me,__rewriteRelativeImportExtension:ye}}),be=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};e.default=t}),_e=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(be()),a=class{constructor(o){var s,n;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(s=o.shouldThrowOnError)!==null&&s!==void 0?s:!1,this.signal=o.signal,this.isMaybeSingle=(n=o.isMaybeSingle)!==null&&n!==void 0?n:!1,o.fetch?this.fetch=o.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,s){return this.headers=new Headers(this.headers),this.headers.set(o,s),this}then(o,s){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var l,c,u,f;let d=null,p=null,y=null,v=h.status,g=h.statusText;if(h.ok){if(this.method!=="HEAD"){let H=await h.text();H===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((l=this.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")?p=H:p=JSON.parse(H))}let S=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),k=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");S&&k&&k.length>1&&(y=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,y=null,v=406,g="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let S=await h.text();try{d=JSON.parse(S),Array.isArray(d)&&h.status===404&&(p=[],d=null,v=200,g="OK")}catch{h.status===404&&S===""?(v=204,g="No Content"):d={message:S}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,v=200,g="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:y,status:v,statusText:g}});return this.shouldThrowOnError||(i=i.catch(h=>{var l,c,u;return{error:{message:`${(l=h?.name)!==null&&l!==void 0?l:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(o,s)}returns(){return this}overrideTypes(){return this}};e.default=a}),Ee=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(_e()),a=class extends r.default{select(o){let s=!1,n=(o??"*").split("").map(i=>/\s/.test(i)&&!s?"":(i==='"'&&(s=!s),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!0,nullsFirst:n,foreignTable:i,referencedTable:h=i}={}){let l=h?`${h}.order`:"order",c=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${c?`${c},`:""}${o}.${s?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:n=s}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${o}`),this}range(o,s,{foreignTable:n,referencedTable:i=n}={}){let h=typeof i>"u"?"offset":`${i}.offset`,l=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(h,`${o}`),this.url.searchParams.set(l,`${s-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:o=!1,verbose:s=!1,settings:n=!1,buffers:i=!1,wal:h=!1,format:l="text"}={}){var c;let u=[o?"analyze":null,s?"verbose":null,n?"settings":null,i?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${l}; for="${f}"; options=${u};`),l==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}};e.default=a}),M=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Ee()),a=new RegExp("[,()]"),o=class extends r.default{eq(s,n){return this.url.searchParams.append(s,`eq.${n}`),this}neq(s,n){return this.url.searchParams.append(s,`neq.${n}`),this}gt(s,n){return this.url.searchParams.append(s,`gt.${n}`),this}gte(s,n){return this.url.searchParams.append(s,`gte.${n}`),this}lt(s,n){return this.url.searchParams.append(s,`lt.${n}`),this}lte(s,n){return this.url.searchParams.append(s,`lte.${n}`),this}like(s,n){return this.url.searchParams.append(s,`like.${n}`),this}likeAllOf(s,n){return this.url.searchParams.append(s,`like(all).{${n.join(",")}}`),this}likeAnyOf(s,n){return this.url.searchParams.append(s,`like(any).{${n.join(",")}}`),this}ilike(s,n){return this.url.searchParams.append(s,`ilike.${n}`),this}ilikeAllOf(s,n){return this.url.searchParams.append(s,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(s,n){return this.url.searchParams.append(s,`ilike(any).{${n.join(",")}}`),this}is(s,n){return this.url.searchParams.append(s,`is.${n}`),this}in(s,n){let i=Array.from(new Set(n)).map(h=>typeof h=="string"&&a.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(s,`in.(${i})`),this}contains(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cs.{${n.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(n)}`),this}containedBy(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cd.{${n.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(n)}`),this}rangeGt(s,n){return this.url.searchParams.append(s,`sr.${n}`),this}rangeGte(s,n){return this.url.searchParams.append(s,`nxl.${n}`),this}rangeLt(s,n){return this.url.searchParams.append(s,`sl.${n}`),this}rangeLte(s,n){return this.url.searchParams.append(s,`nxr.${n}`),this}rangeAdjacent(s,n){return this.url.searchParams.append(s,`adj.${n}`),this}overlaps(s,n){return typeof n=="string"?this.url.searchParams.append(s,`ov.${n}`):this.url.searchParams.append(s,`ov.{${n.join(",")}}`),this}textSearch(s,n,{config:i,type:h}={}){let l="";h==="plain"?l="pl":h==="phrase"?l="ph":h==="websearch"&&(l="w");let c=i===void 0?"":`(${i})`;return this.url.searchParams.append(s,`${l}fts${c}.${n}`),this}match(s){return Object.entries(s).forEach(([n,i])=>{this.url.searchParams.append(n,`eq.${i}`)}),this}not(s,n,i){return this.url.searchParams.append(s,`not.${n}.${i}`),this}or(s,{foreignTable:n,referencedTable:i=n}={}){let h=i?`${i}.or`:"or";return this.url.searchParams.append(h,`(${s})`),this}filter(s,n,i){return this.url.searchParams.append(s,`${n}.${i}`),this}};e.default=o}),Oe=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(M()),a=class{constructor(o,{headers:s={},schema:n,fetch:i}){this.url=o,this.headers=new Headers(s),this.schema=n,this.fetch=i}select(o,s){let{head:n=!1,count:i}=s??{},h=n?"HEAD":"GET",l=!1,c=(o??"*").split("").map(u=>/\s/.test(u)&&!l?"":(u==='"'&&(l=!l),u)).join("");return this.url.searchParams.set("select",c),i&&this.headers.append("Prefer",`count=${i}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(o,{count:s,defaultToNull:n=!0}={}){var i;let h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let l=o.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){let c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:n=!1,count:i,defaultToNull:h=!0}={}){var l;let c="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),i&&this.headers.append("Prefer",`count=${i}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let u=o.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}update(o,{count:s}={}){var n;let i="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new r.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:o}={}){var s;let n="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new r.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};e.default=a}),Be=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Oe()),a=t.__importDefault(M()),o=class Pe{constructor(n,{headers:i={},schema:h,fetch:l}={}){this.url=n,this.headers=new Headers(i),this.schemaName=h,this.fetch=l}from(n){let i=new URL(`${this.url}/${n}`);return new r.default(i,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(n){return new Pe(this.url,{headers:this.headers,schema:n,fetch:this.fetch})}rpc(n,i={},{head:h=!1,get:l=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${n}`),p;h||l?(f=h?"HEAD":"GET",Object.entries(i).filter(([v,g])=>g!==void 0).map(([v,g])=>[v,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([v,g])=>{d.searchParams.append(v,g)})):(f="POST",p=i);let y=new Headers(this.headers);return c&&y.set("Prefer",`count=${c}`),new a.default({method:f,url:d,headers:y,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};e.default=o}),ze=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0}),e.PostgrestError=e.PostgrestBuilder=e.PostgrestTransformBuilder=e.PostgrestFilterBuilder=e.PostgrestQueryBuilder=e.PostgrestClient=void 0;var t=(P(),O(_)),r=t.__importDefault(Be());e.PostgrestClient=r.default;var a=t.__importDefault(Oe());e.PostgrestQueryBuilder=a.default;var o=t.__importDefault(M());e.PostgrestFilterBuilder=o.default;var s=t.__importDefault(Ee());e.PostgrestTransformBuilder=s.default;var n=t.__importDefault(_e());e.PostgrestBuilder=n.default;var i=t.__importDefault(be());e.PostgrestError=i.default,e.default={PostgrestClient:r.default,PostgrestQueryBuilder:a.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:s.default,PostgrestBuilder:n.default,PostgrestError:i.default}});m();m();var Se=class{constructor(e,t=""){this.http=e,this.baseUrl=t.replace(/\/$/,"")}async invoke(e,t){let r=this.baseUrl?`${this.baseUrl}/functions/${e}`:`/functions/${e}`;return await(await this.http.fetch(r,{method:t.method||"POST",body:t.body,headers:t.headers})).json()}};m();m();var qe="current_jwt";var Ze=typeof fetch<"u"?(e,t)=>fetch(e,t):(()=>{throw new Error("AuthClient requires fetch")})();m();m();var w=class Te{constructor(t){if(this.headerMap=new Map,t){if(t instanceof Te)t.forEach((r,a)=>this.set(a,r));else if(Array.isArray(t))for(let[r,a]of t)this.set(r,String(a));else if(typeof t=="object")for(let r of Object.keys(t))this.set(r,String(t[r]))}}append(t,r){let a=t.toLowerCase(),o=this.headerMap.get(a);this.headerMap.set(a,o?`${o}, ${r}`:r)}set(t,r){this.headerMap.set(t.toLowerCase(),String(r))}get(t){return this.headerMap.get(t.toLowerCase())??null}has(t){return this.headerMap.has(t.toLowerCase())}delete(t){this.headerMap.delete(t.toLowerCase())}forEach(t){for(let[r,a]of this.headerMap.entries())t(a,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}};m();m();var $e=class{constructor(e,t){this.bodyData=e,this.status=t?.status??200,this.statusText=t?.statusText??"",this.headers=Ge(t?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let e=await this.text();return new TextEncoder().encode(e).buffer}};function Ge(e){return e?new w(e):new w}m();m();var xe=class{constructor(e,t,r){this.storage=e,this.customFetch=t,this.handleUnauthorized=r}async fetch(e,t){return await this.customFetch(e,t)}async fetchWithAuth(e,t){let r=await this.storage.get(qe),a=new w(t?.headers);r&&a.set("Authorization",`Bearer ${r}`);let o=t?.method||"GET";if((o==="POST"||o==="PUT"||o==="PATCH")&&t?.body){let n=a.get("Content-Type");(!n||n.includes("text/plain"))&&a.set("Content-Type","application/json")}let s=await this.customFetch(e,{...t,headers:a});if(s.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return s}};m();var Je="/storage",We=Je+"/generateUploadUrl",je=class{constructor(e,t){this.baseUrl=e,this.http=t}async uploadFile(e){let t=await this.http.fetch(this.baseUrl+We,{method:"POST",body:{fileName:e.name||e.fileName,fileSize:e.size||e.fileSize,fileType:e.type||e.fileType}}),{url:r}=await t.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let a=await this.http.fetch(r,{method:"PUT",body:e,headers:new w({"Content-Type":e.type||e.fileType||"application/octet-stream"})}),{url:o}=await a.json();return{url:o.split("?")[0]}}};m();m();m();var F=Fe(ze(),1),{PostgrestClient:Ke,PostgrestQueryBuilder:et,PostgrestFilterBuilder:tt,PostgrestTransformBuilder:rt,PostgrestBuilder:st,PostgrestError:at}=F.default||F,Ve="/entities",Le=(e,t)=>new Ke(e+Ve,{fetch:t.fetchWithAuth.bind(t)});m();var Ie=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ae=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t!=null?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ne=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let e=document.createElement("style");e.id="__nvwa-inspector-overlay-style",e.textContent=`
|
|
1
|
+
var ke=Object.create,N=Object.defineProperty,He=Object.getOwnPropertyDescriptor,Re=Object.getOwnPropertyNames,Me=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(e&&(t=e(e=0)),t),b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),De=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Re(t))!Ue.call(e,o)&&o!==r&&N(e,o,{get:()=>t[o],enumerable:!(a=He(t,o))||a.enumerable});return e},Fe=(e,t,r)=>(r=e!=null?ke(Me(e)):{},z(t||!e||!e.__esModule?N(r,"default",{value:e,enumerable:!0}):r,e)),O=e=>z(N({},"__esModule",{value:!0}),e),m=B(()=>{"use strict"}),_={};De(_,{__addDisposableResource:()=>fe,__assign:()=>T,__asyncDelegator:()=>ne,__asyncGenerator:()=>oe,__asyncValues:()=>ie,__await:()=>E,__awaiter:()=>Z,__classPrivateFieldGet:()=>ue,__classPrivateFieldIn:()=>pe,__classPrivateFieldSet:()=>de,__createBinding:()=>$,__decorate:()=>J,__disposeResources:()=>me,__esDecorate:()=>K,__exportStar:()=>te,__extends:()=>q,__generator:()=>ee,__importDefault:()=>he,__importStar:()=>ce,__makeTemplateObject:()=>le,__metadata:()=>X,__param:()=>W,__propKey:()=>Y,__read:()=>R,__rest:()=>G,__rewriteRelativeImportExtension:()=>ye,__runInitializers:()=>V,__setFunctionName:()=>Q,__spread:()=>re,__spreadArray:()=>ae,__spreadArrays:()=>se,__values:()=>L,default:()=>we});function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function G(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function J(e,t,r,a){var o=arguments.length,s=o<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function W(e,t){return function(r,a){t(r,a,e)}}function K(e,t,r,a,o,s){function n(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var i=a.kind,h=i==="getter"?"get":i==="setter"?"set":"value",l=!t&&e?a.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,a.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var y in a)p[y]=y==="access"?{}:a[y];for(var y in a.access)p.access[y]=a.access[y];p.addInitializer=function(g){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(n(g||null))};var v=(0,r[d])(i==="accessor"?{get:c.get,set:c.set}:c[h],p);if(i==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(u=n(v.get))&&(c.get=u),(u=n(v.set))&&(c.set=u),(u=n(v.init))&&o.unshift(u)}else(u=n(v))&&(i==="field"?o.unshift(u):c[h]=u)}l&&Object.defineProperty(l,a.name,c),f=!0}function V(e,t,r){for(var a=arguments.length>2,o=0;o<t.length;o++)r=a?t[o].call(e,r):t[o].call(e);return a?r:void 0}function Y(e){return typeof e=="symbol"?e:"".concat(e)}function Q(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function X(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Z(e,t,r,a){function o(s){return s instanceof r?s:new r(function(n){n(s)})}return new(r||(r=Promise))(function(s,n){function i(c){try{l(a.next(c))}catch(u){n(u)}}function h(c){try{l(a.throw(c))}catch(u){n(u)}}function l(c){c.done?s(c.value):o(c.value).then(i,h)}l((a=a.apply(e,t||[])).next())})}function ee(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,n=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return n.next=i(0),n.throw=i(1),n.return=i(2),typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(l){return function(c){return h([l,c])}}function h(l){if(a)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(r=0)),r;)try{if(a=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],o=0}finally{a=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function te(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&$(t,e,r)}function L(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,s=[],n;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(i){n={error:i}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s}function re(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(R(arguments[t]));return e}function se(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),o=0,t=0;t<r;t++)for(var s=arguments[t],n=0,i=s.length;n<i;n++,o++)a[o]=s[n];return a}function ae(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,s;a<o;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function oe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(e,t||[]),o,s=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",n),o[Symbol.asyncIterator]=function(){return this},o;function n(d){return function(p){return Promise.resolve(p).then(d,u)}}function i(d,p){a[d]&&(o[d]=function(y){return new Promise(function(v,g){s.push([d,y,v,g])>1||h(d,y)})},p&&(o[d]=p(o[d])))}function h(d,p){try{l(a[d](p))}catch(y){f(s[0][3],y)}}function l(d){d.value instanceof E?Promise.resolve(d.value.v).then(c,u):f(s[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),s.shift(),s.length&&h(s[0][0],s[0][1])}}function ne(e){var t,r;return t={},a("next"),a("throw",function(o){throw o}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(o,s){t[o]=e[o]?function(n){return(r=!r)?{value:E(e[o](n)),done:!1}:s?s(n):n}:s}}function ie(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof L=="function"?L(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(s){r[s]=e[s]&&function(n){return new Promise(function(i,h){n=e[s](n),o(i,h,n.done,n.value)})}}function o(s,n,i,h){Promise.resolve(h).then(function(l){s({value:l,done:i})},n)}}function le(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ce(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=j(e),a=0;a<r.length;a++)r[a]!=="default"&&$(t,e,r[a]);return ge(t,e),t}function he(e){return e&&e.__esModule?e:{default:e}}function ue(e,t,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(e):a?a.value:t.get(e)}function de(e,t,r,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function pe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function fe(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var a,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");a=t[Symbol.asyncDispose]}if(a===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");a=t[Symbol.dispose],r&&(o=a)}if(typeof a!="function")throw new TypeError("Object not disposable.");o&&(a=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:a,async:r})}else r&&e.stack.push({async:!0});return t}function me(e){function t(s){e.error=e.hasError?new ve(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var r,a=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&a===1)return a=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return a|=2,Promise.resolve(s).then(o,function(n){return t(n),o()})}else a|=1}catch(n){t(n)}if(a===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function ye(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,a,o,s,n){return a?t?".jsx":".js":o&&(!s||!n)?r:o+s+"."+n.toLowerCase()+"js"}):e}var x,T,$,ge,j,ve,we,P=B(()=>{"use strict";m(),x=function(e,t){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},x(e,t)},T=function(){return T=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},T.apply(this,arguments)},$=Object.create?(function(e,t,r,a){a===void 0&&(a=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,o)}):(function(e,t,r,a){a===void 0&&(a=r),e[a]=t[r]}),ge=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(t){var r=[];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[r.length]=a);return r},j(e)},ve=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var a=new Error(r);return a.name="SuppressedError",a.error=e,a.suppressed=t,a},we={__extends:q,__assign:T,__rest:G,__decorate:J,__param:W,__esDecorate:K,__runInitializers:V,__propKey:Y,__setFunctionName:Q,__metadata:X,__awaiter:Z,__generator:ee,__createBinding:$,__exportStar:te,__values:L,__read:R,__spread:re,__spreadArrays:se,__spreadArray:ae,__await:E,__asyncGenerator:oe,__asyncDelegator:ne,__asyncValues:ie,__makeTemplateObject:le,__importStar:ce,__importDefault:he,__classPrivateFieldGet:ue,__classPrivateFieldSet:de,__classPrivateFieldIn:pe,__addDisposableResource:fe,__disposeResources:me,__rewriteRelativeImportExtension:ye}}),be=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};e.default=t}),_e=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(be()),a=class{constructor(o){var s,n;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(s=o.shouldThrowOnError)!==null&&s!==void 0?s:!1,this.signal=o.signal,this.isMaybeSingle=(n=o.isMaybeSingle)!==null&&n!==void 0?n:!1,o.fetch?this.fetch=o.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,s){return this.headers=new Headers(this.headers),this.headers.set(o,s),this}then(o,s){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var l,c,u,f;let d=null,p=null,y=null,v=h.status,g=h.statusText;if(h.ok){if(this.method!=="HEAD"){let H=await h.text();H===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((l=this.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")?p=H:p=JSON.parse(H))}let S=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),k=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");S&&k&&k.length>1&&(y=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,y=null,v=406,g="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let S=await h.text();try{d=JSON.parse(S),Array.isArray(d)&&h.status===404&&(p=[],d=null,v=200,g="OK")}catch{h.status===404&&S===""?(v=204,g="No Content"):d={message:S}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,v=200,g="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:y,status:v,statusText:g}});return this.shouldThrowOnError||(i=i.catch(h=>{var l,c,u;return{error:{message:`${(l=h?.name)!==null&&l!==void 0?l:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(o,s)}returns(){return this}overrideTypes(){return this}};e.default=a}),Ee=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(_e()),a=class extends r.default{select(o){let s=!1,n=(o??"*").split("").map(i=>/\s/.test(i)&&!s?"":(i==='"'&&(s=!s),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!0,nullsFirst:n,foreignTable:i,referencedTable:h=i}={}){let l=h?`${h}.order`:"order",c=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${c?`${c},`:""}${o}.${s?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:n=s}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${o}`),this}range(o,s,{foreignTable:n,referencedTable:i=n}={}){let h=typeof i>"u"?"offset":`${i}.offset`,l=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(h,`${o}`),this.url.searchParams.set(l,`${s-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:o=!1,verbose:s=!1,settings:n=!1,buffers:i=!1,wal:h=!1,format:l="text"}={}){var c;let u=[o?"analyze":null,s?"verbose":null,n?"settings":null,i?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${l}; for="${f}"; options=${u};`),l==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}};e.default=a}),M=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Ee()),a=new RegExp("[,()]"),o=class extends r.default{eq(s,n){return this.url.searchParams.append(s,`eq.${n}`),this}neq(s,n){return this.url.searchParams.append(s,`neq.${n}`),this}gt(s,n){return this.url.searchParams.append(s,`gt.${n}`),this}gte(s,n){return this.url.searchParams.append(s,`gte.${n}`),this}lt(s,n){return this.url.searchParams.append(s,`lt.${n}`),this}lte(s,n){return this.url.searchParams.append(s,`lte.${n}`),this}like(s,n){return this.url.searchParams.append(s,`like.${n}`),this}likeAllOf(s,n){return this.url.searchParams.append(s,`like(all).{${n.join(",")}}`),this}likeAnyOf(s,n){return this.url.searchParams.append(s,`like(any).{${n.join(",")}}`),this}ilike(s,n){return this.url.searchParams.append(s,`ilike.${n}`),this}ilikeAllOf(s,n){return this.url.searchParams.append(s,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(s,n){return this.url.searchParams.append(s,`ilike(any).{${n.join(",")}}`),this}is(s,n){return this.url.searchParams.append(s,`is.${n}`),this}in(s,n){let i=Array.from(new Set(n)).map(h=>typeof h=="string"&&a.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(s,`in.(${i})`),this}contains(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cs.{${n.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(n)}`),this}containedBy(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cd.{${n.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(n)}`),this}rangeGt(s,n){return this.url.searchParams.append(s,`sr.${n}`),this}rangeGte(s,n){return this.url.searchParams.append(s,`nxl.${n}`),this}rangeLt(s,n){return this.url.searchParams.append(s,`sl.${n}`),this}rangeLte(s,n){return this.url.searchParams.append(s,`nxr.${n}`),this}rangeAdjacent(s,n){return this.url.searchParams.append(s,`adj.${n}`),this}overlaps(s,n){return typeof n=="string"?this.url.searchParams.append(s,`ov.${n}`):this.url.searchParams.append(s,`ov.{${n.join(",")}}`),this}textSearch(s,n,{config:i,type:h}={}){let l="";h==="plain"?l="pl":h==="phrase"?l="ph":h==="websearch"&&(l="w");let c=i===void 0?"":`(${i})`;return this.url.searchParams.append(s,`${l}fts${c}.${n}`),this}match(s){return Object.entries(s).forEach(([n,i])=>{this.url.searchParams.append(n,`eq.${i}`)}),this}not(s,n,i){return this.url.searchParams.append(s,`not.${n}.${i}`),this}or(s,{foreignTable:n,referencedTable:i=n}={}){let h=i?`${i}.or`:"or";return this.url.searchParams.append(h,`(${s})`),this}filter(s,n,i){return this.url.searchParams.append(s,`${n}.${i}`),this}};e.default=o}),Oe=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(M()),a=class{constructor(o,{headers:s={},schema:n,fetch:i}){this.url=o,this.headers=new Headers(s),this.schema=n,this.fetch=i}select(o,s){let{head:n=!1,count:i}=s??{},h=n?"HEAD":"GET",l=!1,c=(o??"*").split("").map(u=>/\s/.test(u)&&!l?"":(u==='"'&&(l=!l),u)).join("");return this.url.searchParams.set("select",c),i&&this.headers.append("Prefer",`count=${i}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(o,{count:s,defaultToNull:n=!0}={}){var i;let h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let l=o.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){let c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:n=!1,count:i,defaultToNull:h=!0}={}){var l;let c="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),i&&this.headers.append("Prefer",`count=${i}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){let u=o.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}update(o,{count:s}={}){var n;let i="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new r.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:o}={}){var s;let n="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new r.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};e.default=a}),Be=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0});var t=(P(),O(_)),r=t.__importDefault(Oe()),a=t.__importDefault(M()),o=class Pe{constructor(n,{headers:i={},schema:h,fetch:l}={}){this.url=n,this.headers=new Headers(i),this.schemaName=h,this.fetch=l}from(n){let i=new URL(`${this.url}/${n}`);return new r.default(i,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(n){return new Pe(this.url,{headers:this.headers,schema:n,fetch:this.fetch})}rpc(n,i={},{head:h=!1,get:l=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${n}`),p;h||l?(f=h?"HEAD":"GET",Object.entries(i).filter(([v,g])=>g!==void 0).map(([v,g])=>[v,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([v,g])=>{d.searchParams.append(v,g)})):(f="POST",p=i);let y=new Headers(this.headers);return c&&y.set("Prefer",`count=${c}`),new a.default({method:f,url:d,headers:y,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};e.default=o}),ze=b(e=>{"use strict";m(),Object.defineProperty(e,"__esModule",{value:!0}),e.PostgrestError=e.PostgrestBuilder=e.PostgrestTransformBuilder=e.PostgrestFilterBuilder=e.PostgrestQueryBuilder=e.PostgrestClient=void 0;var t=(P(),O(_)),r=t.__importDefault(Be());e.PostgrestClient=r.default;var a=t.__importDefault(Oe());e.PostgrestQueryBuilder=a.default;var o=t.__importDefault(M());e.PostgrestFilterBuilder=o.default;var s=t.__importDefault(Ee());e.PostgrestTransformBuilder=s.default;var n=t.__importDefault(_e());e.PostgrestBuilder=n.default;var i=t.__importDefault(be());e.PostgrestError=i.default,e.default={PostgrestClient:r.default,PostgrestQueryBuilder:a.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:s.default,PostgrestBuilder:n.default,PostgrestError:i.default}});m();m();var Se=class{constructor(e,t=""){this.http=e,this.baseUrl=t.replace(/\/$/,"")}async invoke(e,t){let r=this.baseUrl?`${this.baseUrl}/functions/${e}`:`/functions/${e}`;return await(await this.http.fetch(r,{method:t.method||"POST",body:t.body,headers:t.headers})).json()}};m();m();var qe="nvwa_current_jwt";var Ze=typeof fetch<"u"?(e,t)=>fetch(e,t):(()=>{throw new Error("AuthClient requires fetch")})();m();m();var w=class Te{constructor(t){if(this.headerMap=new Map,t){if(t instanceof Te)t.forEach((r,a)=>this.set(a,r));else if(Array.isArray(t))for(let[r,a]of t)this.set(r,String(a));else if(typeof t=="object")for(let r of Object.keys(t))this.set(r,String(t[r]))}}append(t,r){let a=t.toLowerCase(),o=this.headerMap.get(a);this.headerMap.set(a,o?`${o}, ${r}`:r)}set(t,r){this.headerMap.set(t.toLowerCase(),String(r))}get(t){return this.headerMap.get(t.toLowerCase())??null}has(t){return this.headerMap.has(t.toLowerCase())}delete(t){this.headerMap.delete(t.toLowerCase())}forEach(t){for(let[r,a]of this.headerMap.entries())t(a,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}};m();m();var $e=class{constructor(e,t){this.bodyData=e,this.status=t?.status??200,this.statusText=t?.statusText??"",this.headers=Ge(t?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let e=await this.text();return new TextEncoder().encode(e).buffer}};function Ge(e){return e?new w(e):new w}m();m();var xe=class{constructor(e,t,r){this.storage=e,this.customFetch=t,this.handleUnauthorized=r}async fetch(e,t){return await this.customFetch(e,t)}async fetchWithAuth(e,t){let r=await this.storage.get(qe),a=new w(t?.headers);r&&a.set("Authorization",`Bearer ${r}`);let o=t?.method||"GET";if((o==="POST"||o==="PUT"||o==="PATCH")&&t?.body){let n=a.get("Content-Type");(!n||n.includes("text/plain"))&&a.set("Content-Type","application/json")}let s=await this.customFetch(e,{...t,headers:a});if(s.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return s}};m();var Je="/storage",We=Je+"/generateUploadUrl",je=class{constructor(e,t){this.baseUrl=e,this.http=t}async uploadFile(e){let t=await this.http.fetch(this.baseUrl+We,{method:"POST",body:{fileName:e.name||e.fileName,fileSize:e.size||e.fileSize,fileType:e.type||e.fileType}}),{url:r}=await t.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let a=await this.http.fetch(r,{method:"PUT",body:e,headers:new w({"Content-Type":e.type||e.fileType||"application/octet-stream"})}),{url:o}=await a.json();return{url:o.split("?")[0]}}};m();m();m();var F=Fe(ze(),1),{PostgrestClient:Ke,PostgrestQueryBuilder:et,PostgrestFilterBuilder:tt,PostgrestTransformBuilder:rt,PostgrestBuilder:st,PostgrestError:at}=F.default||F,Ve="/entities",Le=(e,t)=>new Ke(e+Ve,{fetch:t.fetchWithAuth.bind(t)});m();var Ie=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ae=class{constructor(e,t){this.baseUrl=e,this.http=t}async execute(e,t){let r=`${this.baseUrl}/capability/${e}/execute`,a=await(await this.http.fetchWithAuth(r,{method:"POST",body:t!=null?JSON.stringify(t):void 0,timeout:6e5})).json();if(a.status!==200)throw new Error(a.message);return a.data}};m();var Ne=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let e=document.createElement("style");e.id="__nvwa-inspector-overlay-style",e.textContent=`
|
|
2
2
|
.__nvwa-inspector-overlay {
|
|
3
3
|
position: absolute;
|
|
4
4
|
pointer-events: none;
|